
:root {
    --zwfc-wine: #5a0010;
    --zwfc-wine-dark: #3d000a;
    --zwfc-wine-soft: #7a1a2c;
    --zwfc-beige: #f2eee8;
    --zwfc-cream: #fffaf4;
    --zwfc-gold: #b89561;
    --zwfc-ink: #1f1816;
    --zwfc-muted: #716864;
    --zwfc-border: #ded5cc;
    --zwfc-white: #ffffff;
}

.zwfc-shell,
.zwfc-shell * {
    box-sizing: border-box;
}

.zwfc-shell {
    width: min(1220px, calc(100% - 24px));
    margin: 32px auto 40px;
    color: var(--zwfc-ink);
    font-family: inherit;
}

.zwfc-shell button,
.zwfc-shell input {
    font: inherit;
}

.zwfc-hero {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 288px;
    gap: clamp(42px, 7vw, 92px);
    min-height: 382px;
    align-items: center;
    padding: 34px 47px 26px 53px;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 17px;
    background:
        radial-gradient(circle at 88% 18%, rgba(144, 35, 51, .48), transparent 31%),
        radial-gradient(circle at 69% 61%, rgba(131, 18, 36, .38), transparent 32%),
        linear-gradient(112deg, #3a0009 0%, #57000f 48%, #790c1f 100%);
    color: var(--zwfc-white);
    overflow: hidden;
    box-shadow: 0 16px 36px rgba(61, 0, 10, .12);
}

.zwfc-hero::before {
    content: '';
    position: absolute;
    z-index: -1;
    inset: 0;
    background:
        radial-gradient(circle at 18% 22%, rgba(255,255,255,.045) 0 1px, transparent 1.6px),
        radial-gradient(circle at 74% 72%, rgba(255,255,255,.035) 0 1px, transparent 1.7px);
    background-size: 6px 6px, 9px 9px;
    opacity: .28;
    pointer-events: none;
}

.zwfc-hero__content {
    min-width: 0;
    align-self: center;
}

.zwfc-eyebrow,
.zwfc-step {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--zwfc-gold);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.zwfc-eyebrow {
    color: #c5a638;
    font-size: clamp(14px, 1.55vw, 18px);
    letter-spacing: .015em;
}

.zwfc-hero h2 {
    margin: 11px 0 16px;
    color: var(--zwfc-white);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(45px, 5.45vw, 68px);
    font-weight: 400;
    letter-spacing: -.025em;
    line-height: 1.005;
}

.zwfc-hero h2 span,
.zwfc-hero__intro span,
.zwfc-notice p span {
    display: block;
}

.zwfc-hero p {
    max-width: 610px;
    margin: 0;
    color: rgba(255,255,255,.94);
    font-size: clamp(17px, 1.65vw, 21px);
    font-weight: 400;
    line-height: 1.31;
}

.zwfc-hero p strong {
    color: #fff;
}

.zwfc-hero__badge {
    display: flex;
    width: 100%;
    min-height: 247px;
    flex-direction: column;
    justify-content: center;
    padding: 28px 24px;
    border: 1px solid rgba(255,255,255,.29);
    border-radius: 22px;
    background: rgba(255,255,255,.075);
    text-align: center;
    box-shadow: inset 0 0 0 1px rgba(73,0,11,.1);
    backdrop-filter: blur(4px);
}

.zwfc-hero__badge span,
.zwfc-hero__badge small {
    color: rgba(255,255,255,.92);
    font-size: clamp(15px, 1.5vw, 19px);
    line-height: 1.35;
}

.zwfc-hero__badge strong {
    display: block;
    margin: 25px 0 23px;
    color: #fff;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(45px, 4.5vw, 55px);
    font-weight: 400;
    line-height: 1;
}

.zwfc-notice {
    display: flex;
    min-height: 210px;
    gap: 20px;
    align-items: flex-start;
    margin: 8px 0 22px;
    padding: 19px 44px 18px 45px;
    border: 1px solid #d9c9bc;
    border-radius: 17px;
    background:
        radial-gradient(circle at 78% 35%, rgba(255,255,255,.78), transparent 32%),
        linear-gradient(105deg, #f2ede7, #faf8f5);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
}

.zwfc-notice__icon {
    display: inline-grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    margin-top: 0;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(145deg, #7b0719, #4a000a);
    color: #fff;
    font-family: Georgia, serif;
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 4px 11px rgba(80,0,13,.15);
}

.zwfc-notice__content {
    min-width: 0;
    padding-top: 1px;
}

.zwfc-notice__content > strong {
    display: block;
    margin: 0 0 2px;
    color: #171313;
    font-size: clamp(20px, 1.95vw, 24px);
    font-weight: 800;
    line-height: 1.25;
}

.zwfc-notice p {
    max-width: 505px;
    margin: 0;
    color: #272121;
    font-size: clamp(16px, 1.55vw, 19px);
    line-height: 1.22;
}

.zwfc-card {
    margin-top: 22px;
    padding: clamp(22px, 3vw, 34px);
    border: 1px solid var(--zwfc-border);
    border-radius: 20px;
    background: var(--zwfc-white);
    box-shadow: 0 12px 35px rgba(57, 38, 30, .06);
}

.zwfc-card__heading {
    display: flex;
    gap: 20px;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 24px;
}

.zwfc-card__heading h3 {
    margin: 4px 0 0;
    color: var(--zwfc-wine);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(25px, 3vw, 34px);
    font-weight: 500;
}

.zwfc-card__heading p {
    margin: 0;
    color: var(--zwfc-muted);
}

.zwfc-entry-form {
    display: grid;
    grid-template-columns: 1.55fr .8fr .8fr .62fr auto;
    gap: 13px;
    align-items: end;
}

.zwfc-field label {
    display: block;
    margin-bottom: 8px;
    color: var(--zwfc-ink);
    font-size: 14px;
    font-weight: 700;
}

.zwfc-field label span {
    color: var(--zwfc-muted);
    font-weight: 500;
}

.zwfc-field input {
    width: 100%;
    min-height: 50px;
    padding: 0 15px;
    border: 1px solid var(--zwfc-border);
    border-radius: 11px;
    outline: none;
    background: #fcfaf8;
    color: var(--zwfc-ink);
    transition: border-color .2s, box-shadow .2s, background .2s;
}

.zwfc-field input:focus {
    border-color: var(--zwfc-wine);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(90, 0, 16, .08);
}

.zwfc-button {
    display: inline-flex;
    min-height: 50px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 22px;
    border: 1px solid transparent;
    border-radius: 11px;
    cursor: pointer;
    font-weight: 800;
    text-decoration: none;
    transition: transform .18s, box-shadow .18s, background .18s, color .18s;
}

.zwfc-button:hover {
    transform: translateY(-1px);
}

.zwfc-button--primary {
    background: var(--zwfc-wine);
    color: #fff;
    box-shadow: 0 9px 20px rgba(90, 0, 16, .18);
}

.zwfc-button--primary:hover {
    background: var(--zwfc-wine-dark);
    color: #fff;
}

.zwfc-button--light {
    border-color: var(--zwfc-wine);
    background: #fff;
    color: var(--zwfc-wine);
}

.zwfc-button--ghost {
    border-color: var(--zwfc-border);
    background: #f8f5f1;
    color: var(--zwfc-ink);
}

.zwfc-button--cream {
    width: 100%;
    margin-top: 22px;
    background: var(--zwfc-cream);
    color: var(--zwfc-wine);
}

.zwfc-form-error,
.zwfc-save-message {
    min-height: 20px;
    margin-top: 12px;
    color: #a11b2f;
    font-size: 14px;
    font-weight: 700;
}

.zwfc-save-message {
    color: #536b2f;
}

.zwfc-item-count {
    display: inline-flex;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--zwfc-beige);
    color: var(--zwfc-wine);
    font-size: 13px;
    font-weight: 800;
}

.zwfc-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--zwfc-border);
    border-radius: 14px;
}

.zwfc-table {
    width: 100%;
    border: 0;
    border-collapse: collapse;
    margin: 0;
}

.zwfc-table thead {
    background: var(--zwfc-wine);
    color: #fff;
}

.zwfc-table th,
.zwfc-table td {
    padding: 15px 17px;
    border: 0;
    border-bottom: 1px solid #eee7e1;
    text-align: left;
}

.zwfc-table th {
    color: #fff;
    font-size: 13px;
    letter-spacing: .025em;
}

.zwfc-table tbody tr:last-child td {
    border-bottom: 0;
}

.zwfc-table tbody tr:nth-child(even):not(.zwfc-empty-row) {
    background: #fcfaf8;
}

.zwfc-table td:not(:first-child) {
    white-space: nowrap;
}

.zwfc-empty-state {
    display: flex;
    min-height: 135px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--zwfc-muted);
    text-align: center;
}

.zwfc-empty-state span {
    display: grid;
    width: 38px;
    height: 38px;
    margin-bottom: 8px;
    place-items: center;
    border-radius: 50%;
    background: var(--zwfc-beige);
    color: var(--zwfc-wine);
    font-size: 24px;
}

.zwfc-empty-state strong {
    color: var(--zwfc-ink);
}

.zwfc-delete {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    background: #f6ecee;
    color: var(--zwfc-wine);
    font-size: 20px;
    line-height: 1;
}

.zwfc-list-actions {
    display: flex;
    gap: 12px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.zwfc-results-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
    gap: 22px;
    align-items: stretch;
}

.zwfc-options-card {
    height: calc(100% - 22px);
}

.zwfc-enabled-options {
    display: grid;
    gap: 12px;
}

.zwfc-enabled-option {
    display: flex;
    gap: 13px;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--zwfc-border);
    border-radius: 14px;
    background: #fcfaf8;
}

.zwfc-enabled-option small {
    display: block;
    margin-top: 2px;
    color: var(--zwfc-muted);
    line-height: 1.45;
}

.zwfc-check {
    display: grid;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    place-items: center;
    border-radius: 7px;
    background: var(--zwfc-wine);
    color: #fff;
    font-weight: 900;
}

.zwfc-calculation-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 18px;
}

.zwfc-calculation-details > div {
    padding: 14px;
    border-radius: 12px;
    background: var(--zwfc-beige);
}

.zwfc-calculation-details span,
.zwfc-calculation-details strong {
    display: block;
}

.zwfc-calculation-details span {
    margin-bottom: 4px;
    color: var(--zwfc-muted);
    font-size: 12px;
}

.zwfc-calculation-details strong {
    color: var(--zwfc-wine);
}

.zwfc-result-card {
    margin-top: 22px;
    padding: clamp(25px, 4vw, 38px);
    border-radius: 20px;
    background:
        radial-gradient(circle at 85% 8%, rgba(184,149,97,.2), transparent 32%),
        linear-gradient(145deg, var(--zwfc-wine-dark), var(--zwfc-wine));
    color: #fff;
    box-shadow: 0 20px 40px rgba(61, 0, 10, .17);
}

.zwfc-result-card__label {
    color: var(--zwfc-gold);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.zwfc-result-card__number {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    margin: 10px 0;
}

.zwfc-result-card__number strong {
    color: #fff;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(56px, 8vw, 82px);
    font-weight: 500;
    line-height: .9;
}

.zwfc-result-card__number span {
    max-width: 110px;
    padding-bottom: 6px;
    color: rgba(255,255,255,.78);
    font-size: 14px;
    line-height: 1.2;
}

.zwfc-result-explanation {
    min-height: 48px;
    color: rgba(255,255,255,.82);
    line-height: 1.5;
}

.zwfc-roll-advice {
    margin: 14px 0;
    padding: 12px 14px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 11px;
    background: rgba(255,255,255,.08);
    color: #fff;
    font-size: 14px;
}

.zwfc-result-divider {
    height: 1px;
    margin: 20px 0;
    background: rgba(255,255,255,.18);
}

.zwfc-result-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    color: rgba(255,255,255,.72);
    font-size: 13px;
}

.zwfc-result-meta strong {
    color: #fff;
}

.zwfc-plan-card {
    scroll-margin-top: 30px;
}

.zwfc-plan-intro {
    margin-top: -8px;
    color: var(--zwfc-muted);
    line-height: 1.6;
}

.zwfc-icon-button {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid var(--zwfc-border);
    border-radius: 50%;
    cursor: pointer;
    background: #fff;
    color: var(--zwfc-wine);
    font-size: 26px;
}

.zwfc-plan-legend {
    display: flex;
    gap: 12px 18px;
    margin: 18px 0;
    flex-wrap: wrap;
}

.zwfc-legend-item {
    display: inline-flex;
    gap: 7px;
    align-items: center;
    color: var(--zwfc-muted);
    font-size: 13px;
}

.zwfc-legend-color {
    width: 14px;
    height: 14px;
    border: 2px solid var(--zwfc-wine);
    border-radius: 3px;
    background: #f4e7e9;
}

.zwfc-plan-scroll {
    overflow: auto;
    max-height: 760px;
    padding: 18px;
    border: 1px solid var(--zwfc-border);
    border-radius: 16px;
    background: var(--zwfc-beige);
}

.zwfc-plan-ruler {
    display: flex;
    width: min(100%, 720px);
    justify-content: space-between;
    margin: 0 auto 8px;
    color: var(--zwfc-muted);
    font-size: 12px;
}

.zwfc-plan-canvas {
    position: relative;
    width: min(100%, 720px);
    min-width: 420px;
    min-height: 180px;
    margin: 0 auto;
    border: 2px solid var(--zwfc-wine);
    border-radius: 5px;
    background:
        linear-gradient(rgba(90,0,16,.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(90,0,16,.035) 1px, transparent 1px),
        #fff;
    background-size: 20px 20px;
}

.zwfc-plan-piece {
    position: absolute;
    display: flex;
    overflow: hidden;
    align-items: center;
    justify-content: center;
    padding: 5px;
    border: 2px solid var(--zwfc-wine);
    border-radius: 4px;
    background: #f2dfe3;
    color: var(--zwfc-wine-dark);
    font-size: 11px;
    font-weight: 800;
    text-align: center;
}

.zwfc-plan-piece small {
    display: block;
    font-weight: 600;
}

.zwfc-plan-footer {
    display: flex;
    gap: 18px;
    align-items: center;
    justify-content: space-between;
    margin-top: 18px;
}

.zwfc-plan-footer small {
    max-width: 720px;
    color: var(--zwfc-muted);
    line-height: 1.5;
}

.zwfc-footnote {
    margin-top: 22px;
    padding: 18px 20px;
    border-left: 4px solid var(--zwfc-gold);
    background: #f8f4ef;
    color: var(--zwfc-muted);
    line-height: 1.55;
}

.zwfc-footnote strong {
    color: var(--zwfc-ink);
}

@media (max-width: 980px) {
    .zwfc-entry-form {
        grid-template-columns: 1.4fr 1fr 1fr;
    }

    .zwfc-entry-form .zwfc-button {
        grid-column: span 3;
    }

    .zwfc-results-grid {
        grid-template-columns: 1fr;
    }

    .zwfc-options-card {
        height: auto;
    }
}

@media (max-width: 980px) {
    .zwfc-hero {
        grid-template-columns: minmax(0, 1fr) 245px;
        gap: 32px;
        min-height: 340px;
        padding: 34px;
    }

    .zwfc-hero h2 {
        font-size: clamp(43px, 6.25vw, 59px);
    }

    .zwfc-hero__badge {
        min-height: 220px;
    }

    .zwfc-notice {
        min-height: 0;
    }
}

@media (max-width: 760px) {
    .zwfc-shell {
        width: min(100% - 18px, 1220px);
        margin: 18px auto;
    }

    .zwfc-hero {
        grid-template-columns: 1fr;
        gap: 24px;
        min-height: 0;
        padding: 29px 23px 24px;
        border-radius: 16px;
    }

    .zwfc-hero h2 {
        margin-top: 10px;
        font-size: clamp(40px, 11vw, 55px);
    }

    .zwfc-hero h2 span,
    .zwfc-hero__intro span,
    .zwfc-notice p span {
        display: inline;
    }

    .zwfc-hero h2 span::after {
        content: ' ';
    }

    .zwfc-hero__intro span::after,
    .zwfc-notice p span::after {
        content: ' ';
    }

    .zwfc-hero__badge {
        min-height: 175px;
        border-radius: 18px;
    }

    .zwfc-hero__badge strong {
        margin: 15px 0;
    }

    .zwfc-notice {
        gap: 14px;
        margin-top: 8px;
        padding: 20px 18px;
        border-radius: 16px;
    }

    .zwfc-notice__icon {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
        font-size: 23px;
    }

    .zwfc-card {
        padding: 21px 16px;
        border-radius: 16px;
    }

    .zwfc-card__heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .zwfc-entry-form {
        grid-template-columns: 1fr 1fr;
    }

    .zwfc-field--name {
        grid-column: span 2;
    }

    .zwfc-entry-form .zwfc-button {
        grid-column: span 2;
    }

    .zwfc-calculation-details {
        grid-template-columns: 1fr;
    }

    .zwfc-table {
        min-width: 650px;
    }

    .zwfc-plan-footer,
    .zwfc-result-meta {
        align-items: flex-start;
        flex-direction: column;
    }

    .zwfc-plan-footer .zwfc-button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .zwfc-entry-form {
        grid-template-columns: 1fr;
    }

    .zwfc-field--name,
    .zwfc-entry-form .zwfc-button {
        grid-column: span 1;
    }

    .zwfc-result-card__number {
        align-items: flex-start;
        flex-direction: column;
    }

    .zwfc-result-card__number span {
        max-width: none;
    }

    .zwfc-button {
        width: 100%;
    }

    .zwfc-list-actions {
        display: grid;
        grid-template-columns: 1fr;
    }
}

@media print {
    body * {
        visibility: hidden !important;
    }

    .zwfc-shell,
    .zwfc-shell * {
        visibility: visible !important;
    }

    .zwfc-shell {
        position: absolute;
        inset: 0;
        width: 100%;
        margin: 0;
    }

    .zwfc-entry-card,
    .zwfc-list-actions,
    .zwfc-close-plan,
    .zwfc-view-plan,
    .zwfc-print {
        display: none !important;
    }

    .zwfc-plan-card[hidden] {
        display: block !important;
    }
}

.zwfc-plan-piece.zwfc-tone-0, .zwfc-legend-color.zwfc-tone-0 { background: #f1dadd; }
.zwfc-plan-piece.zwfc-tone-1, .zwfc-legend-color.zwfc-tone-1 { background: #eadfcf; }
.zwfc-plan-piece.zwfc-tone-2, .zwfc-legend-color.zwfc-tone-2 { background: #e3d8dd; }
.zwfc-plan-piece.zwfc-tone-3, .zwfc-legend-color.zwfc-tone-3 { background: #f0e5d6; }
.zwfc-plan-piece.zwfc-tone-4, .zwfc-legend-color.zwfc-tone-4 { background: #e8d4d1; }
.zwfc-plan-piece.zwfc-tone-5, .zwfc-legend-color.zwfc-tone-5 { background: #e5dfcf; }
