.zmft-app,
.zmft-app * {
    box-sizing: border-box;
}

.zmft-app {
    --zmft-primary: #0f766e;
    --zmft-accent: #22c55e;
    --zmft-text: #102a2a;
    --zmft-muted: #687878;
    --zmft-border: #dfe8e7;
    --zmft-soft: #f4f8f7;
    position: relative;
    width: 100%;
    color: var(--zmft-text);
    font-family: inherit;
    line-height: 1.75;
}

.zmft-hero {
    position: relative;
    overflow: hidden;
    padding: 42px;
    margin-bottom: 34px;
    color: #fff;
    background:
        radial-gradient(circle at 15% 20%, color-mix(in srgb, var(--zmft-accent) 60%, transparent) 0, transparent 34%),
        linear-gradient(135deg, var(--zmft-primary), color-mix(in srgb, var(--zmft-primary) 72%, #071f1d));
    border-radius: 28px;
    box-shadow: 0 20px 55px rgba(15, 118, 110, .18);
}

.zmft-hero::after {
    content: "";
    position: absolute;
    width: 260px;
    height: 260px;
    left: -70px;
    bottom: -150px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 50%;
    box-shadow: 0 0 0 35px rgba(255,255,255,.05), 0 0 0 72px rgba(255,255,255,.03);
}

.zmft-kicker {
    display: inline-flex;
    padding: 5px 12px;
    margin-bottom: 12px;
    color: #fff;
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .03em;
}

.zmft-hero h2 {
    position: relative;
    z-index: 1;
    margin: 0 0 8px;
    color: inherit;
    font-size: clamp(28px, 4vw, 46px);
    line-height: 1.35;
}

.zmft-hero p {
    position: relative;
    z-index: 1;
    max-width: 760px;
    margin: 0;
    color: rgba(255,255,255,.84);
    font-size: 16px;
}

.zmft-section {
    margin-bottom: 34px;
}

.zmft-section > h3,
.zmft-history-head h3 {
    margin: 0 0 16px;
    color: var(--zmft-text);
    font-size: 20px;
    font-weight: 800;
}

.zmft-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.zmft-card {
    appearance: none;
    display: flex;
    align-items: center;
    min-height: 112px;
    width: 100%;
    padding: 18px;
    text-align: right;
    color: var(--zmft-text);
    background: #fff;
    border: 1px solid var(--zmft-border);
    border-radius: 20px;
    cursor: pointer;
    box-shadow: 0 7px 24px rgba(16, 42, 42, .05);
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.zmft-card:hover,
.zmft-card:focus-visible {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--zmft-primary) 45%, var(--zmft-border));
    box-shadow: 0 14px 34px rgba(16, 42, 42, .1);
    outline: none;
}

.zmft-icon {
    display: grid;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    place-items: center;
    margin-left: 13px;
    font-size: 25px;
    background: color-mix(in srgb, var(--zmft-primary) 8%, #fff);
    border-radius: 15px;
}

.zmft-card-copy {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
}

.zmft-card-copy strong {
    color: var(--zmft-text);
    font-size: 15px;
    font-weight: 800;
}

.zmft-card-copy small {
    margin-top: 3px;
    color: var(--zmft-muted);
    font-size: 12px;
}

.zmft-arrow {
    margin-right: 8px;
    color: var(--zmft-primary);
    font-size: 18px;
    transition: transform .2s ease;
}

.zmft-card:hover .zmft-arrow {
    transform: translateX(-4px);
}

.zmft-history-wrap {
    padding: 22px;
    margin-top: 12px;
    background: var(--zmft-soft);
    border: 1px solid var(--zmft-border);
    border-radius: 22px;
}

.zmft-history-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.zmft-history-head h3 {
    margin: 0;
}

.zmft-link-button {
    padding: 0;
    color: #b42318;
    background: transparent;
    border: 0;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
}

.zmft-history {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.zmft-history button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 15px;
    text-align: right;
    color: var(--zmft-text);
    background: #fff;
    border: 1px solid var(--zmft-border);
    border-radius: 14px;
    cursor: pointer;
}

.zmft-history button span {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.zmft-history button b {
    font-size: 13px;
}

.zmft-history button small {
    overflow: hidden;
    color: var(--zmft-muted);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.zmft-history time {
    flex: 0 0 auto;
    color: var(--zmft-muted);
    font-size: 11px;
}

.zmft-disclaimer {
    padding: 13px 16px;
    margin: 24px 0 0;
    color: #6b5b27;
    background: #fffbea;
    border: 1px solid #f3e6a2;
    border-radius: 14px;
    font-size: 12px;
}

.zmft-modal[hidden] {
    display: none !important;
}

.zmft-modal {
    position: fixed;
    z-index: 999999;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
}

.zmft-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 22, 21, .68);
    backdrop-filter: blur(7px);
}

.zmft-dialog {
    position: relative;
    z-index: 1;
    width: min(760px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    overscroll-behavior: contain;
    padding: 30px;
    background: #fff;
    border-radius: 26px;
    box-shadow: 0 30px 100px rgba(0,0,0,.25);
    animation: zmft-pop .22s ease both;
}

@keyframes zmft-pop {
    from { opacity: 0; transform: translateY(12px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.zmft-modal-open {
    overflow: hidden;
}

.zmft-close {
    position: sticky;
    z-index: 3;
    top: 0;
    float: left;
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    margin: -10px 0 0 -10px;
    color: #334b49;
    background: #edf3f2;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    font-size: 25px;
    line-height: 1;
}

.zmft-tool-title {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-left: 45px;
    margin-bottom: 24px;
}

.zmft-tool-title > span {
    display: grid;
    flex: 0 0 54px;
    width: 54px;
    height: 54px;
    place-items: center;
    background: color-mix(in srgb, var(--zmft-primary) 10%, #fff);
    border-radius: 18px;
    font-size: 29px;
}

.zmft-tool-title h3 {
    margin: 0;
    color: var(--zmft-text);
    font-size: 23px;
    font-weight: 900;
}

.zmft-tool-title p {
    margin: 2px 0 0;
    color: var(--zmft-muted);
    font-size: 13px;
}

.zmft-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.zmft-field {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 7px;
    color: var(--zmft-text);
    font-size: 13px;
    font-weight: 700;
}

.zmft-field > span {
    padding-right: 2px;
}

.zmft-field input,
.zmft-field select {
    width: 100%;
    min-height: 49px;
    padding: 9px 13px;
    color: var(--zmft-text);
    background: #fff;
    border: 1px solid var(--zmft-border);
    border-radius: 12px;
    box-shadow: none;
    outline: none;
    font: inherit;
    font-weight: 500;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.zmft-field input:focus,
.zmft-field select:focus {
    border-color: var(--zmft-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--zmft-primary) 13%, transparent);
}

.zmft-input-wrap {
    position: relative;
}

.zmft-input-wrap input {
    padding-left: 88px;
}

.zmft-input-wrap em {
    position: absolute;
    top: 50%;
    left: 13px;
    color: var(--zmft-muted);
    transform: translateY(-50%);
    font-size: 11px;
    font-style: normal;
    font-weight: 500;
    pointer-events: none;
}

.zmft-submit {
    grid-column: 1 / -1;
    min-height: 52px;
    margin-top: 3px;
    color: #fff;
    background: linear-gradient(135deg, var(--zmft-primary), color-mix(in srgb, var(--zmft-primary) 72%, var(--zmft-accent)));
    border: 0;
    border-radius: 14px;
    cursor: pointer;
    box-shadow: 0 10px 24px color-mix(in srgb, var(--zmft-primary) 23%, transparent);
    font: inherit;
    font-size: 14px;
    font-weight: 800;
}

.zmft-submit:hover {
    filter: brightness(.96);
}

.zmft-result {
    margin-top: 22px;
}

.zmft-result[hidden] {
    display: none !important;
}

.zmft-result-card {
    padding: 22px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--zmft-primary) 7%, #fff), #fff 58%);
    border: 1px solid color-mix(in srgb, var(--zmft-primary) 20%, var(--zmft-border));
    border-radius: 18px;
}

.zmft-result-label {
    display: inline-flex;
    padding: 3px 10px;
    color: var(--zmft-primary);
    background: color-mix(in srgb, var(--zmft-primary) 10%, #fff);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.zmft-result-card h4 {
    margin: 10px 0 3px;
    color: var(--zmft-text);
    font-size: 22px;
    font-weight: 900;
}

.zmft-result-lead {
    margin: 0 0 16px;
    color: #38504e;
    font-size: 14px;
}

.zmft-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.zmft-metric {
    display: flex;
    min-height: 92px;
    padding: 12px;
    flex-direction: column;
    justify-content: space-between;
    background: #fff;
    border: 1px solid var(--zmft-border);
    border-radius: 13px;
}

.zmft-metric > span {
    color: var(--zmft-muted);
    font-size: 11px;
}

.zmft-metric strong {
    color: var(--zmft-text);
    font-size: 17px;
    line-height: 1.45;
}

.zmft-metric small {
    margin-right: 4px;
    color: var(--zmft-muted);
    font-size: 10px;
    font-weight: 600;
}

.zmft-result-note {
    padding-top: 13px;
    margin: 14px 0 0;
    color: var(--zmft-muted);
    border-top: 1px dashed var(--zmft-border);
    font-size: 11px;
}

.zmft-table-wrap {
    overflow: hidden;
    margin-top: 14px;
    border: 1px solid var(--zmft-border);
    border-radius: 13px;
}

.zmft-table-wrap table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    font-size: 12px;
}

.zmft-table-wrap th,
.zmft-table-wrap td {
    padding: 9px 12px;
    text-align: right;
    border-bottom: 1px solid var(--zmft-border);
}

.zmft-table-wrap tr:last-child td {
    border-bottom: 0;
}

.zmft-table-wrap th {
    color: var(--zmft-primary);
    background: var(--zmft-soft);
    font-weight: 800;
}

.zmft-macro-bars {
    display: grid;
    gap: 10px;
    margin-top: 15px;
}

.zmft-macro-bars > div {
    display: grid;
    grid-template-columns: 85px 1fr 75px;
    align-items: center;
    gap: 10px;
    font-size: 11px;
}

.zmft-macro-bars i {
    position: relative;
    overflow: hidden;
    height: 7px;
    background: #e8efee;
    border-radius: 999px;
}

.zmft-macro-bars i::after {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--w);
    background: linear-gradient(90deg, var(--zmft-accent), var(--zmft-primary));
    border-radius: inherit;
}

.zmft-macro-bars b {
    text-align: left;
    font-size: 11px;
}

.zmft-quiz {
    display: block;
}

.zmft-question {
    padding: 15px;
    margin: 0 0 13px;
    border: 1px solid var(--zmft-border);
    border-radius: 15px;
}

.zmft-question legend {
    padding: 0 5px;
    color: var(--zmft-text);
    font-size: 13px;
    font-weight: 800;
}

.zmft-question > label {
    display: flex;
    align-items: center;
    margin-top: 8px;
    cursor: pointer;
}

.zmft-question input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.zmft-question > label span,
.zmft-scale-options label span {
    display: block;
    width: 100%;
    padding: 8px 11px;
    color: #415654;
    background: #f8faf9;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 12px;
    transition: .18s ease;
}

.zmft-question input:checked + span {
    color: var(--zmft-primary);
    background: color-mix(in srgb, var(--zmft-primary) 9%, #fff);
    border-color: color-mix(in srgb, var(--zmft-primary) 32%, var(--zmft-border));
    font-weight: 800;
}

.zmft-scale-options {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
}

.zmft-scale-options label {
    cursor: pointer;
}

.zmft-scale-options label span {
    padding: 8px 4px;
    text-align: center;
    font-size: 10px;
}

.zmft-quiz .zmft-submit {
    width: 100%;
}

.zmft-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 15px;
}

.zmft-progress > span {
    position: relative;
    overflow: hidden;
    flex: 1;
    height: 10px;
    background: #e8efee;
    border-radius: 999px;
}

.zmft-progress i {
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--w);
    background: linear-gradient(90deg, var(--zmft-accent), var(--zmft-primary));
    border-radius: inherit;
}

.zmft-progress b {
    font-size: 12px;
}

.zmft-error {
    padding: 12px 14px;
    color: #8a1c14;
    background: #fff1f0;
    border: 1px solid #ffc9c4;
    border-radius: 12px;
    font-size: 13px;
}

.zmft-app.is-compact .zmft-section {
    margin: 0;
}

.zmft-app.is-compact .zmft-grid {
    grid-template-columns: 1fr;
}

.zmft-app.is-compact .zmft-disclaimer {
    margin-top: 12px;
}

@media (max-width: 1050px) {
    .zmft-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 780px) {
    .zmft-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .zmft-hero { padding: 30px; border-radius: 22px; }
    .zmft-dialog { padding: 23px; border-radius: 21px; }
    .zmft-metrics { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 540px) {
    .zmft-hero { padding: 25px 20px; }
    .zmft-hero h2 { font-size: 27px; }
    .zmft-grid { grid-template-columns: 1fr; gap: 10px; }
    .zmft-card { min-height: 91px; padding: 14px; border-radius: 16px; }
    .zmft-icon { flex-basis: 43px; width: 43px; height: 43px; font-size: 22px; }
    .zmft-history { grid-template-columns: 1fr; }
    .zmft-modal { padding: 10px; align-items: end; }
    .zmft-dialog { width: 100%; max-height: 92vh; padding: 20px 16px; border-radius: 22px 22px 0 0; }
    .zmft-tool-title { padding-left: 36px; }
    .zmft-tool-title h3 { font-size: 20px; }
    .zmft-form { grid-template-columns: 1fr; }
    .zmft-submit { grid-column: auto; }
    .zmft-metrics { grid-template-columns: 1fr; }
    .zmft-metric { min-height: 75px; }
    .zmft-scale-options { grid-template-columns: 1fr; }
    .zmft-scale-options label span { text-align: right; padding: 8px 10px; }
    .zmft-macro-bars > div { grid-template-columns: 72px 1fr 65px; }
}
