:root {
    --ws-blue: #004aad;
    --ws-blue-dark: #003b8a;
    --ws-ink: #1a202c;
    --ws-muted: #4a5568;
    --ws-line: #e2e8f0;
    --ws-ok: #276749;
    --ws-ok-bg: #f0fff4;
    --ws-warn: #c05621;
    --ws-warn-bg: #fffaf0;
    --ws-card: #ffffff;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
    margin: 0;
    font-family: Inter, system-ui, sans-serif;
    background: #f7fafc;
    color: var(--ws-muted);
    -webkit-font-smoothing: antialiased;
}

.ws-header {
    background: #fff;
    border-bottom: 1px solid var(--ws-line);
    position: sticky;
    top: 0;
    z-index: 20;
}

.ws-header-inner {
    max-width: 920px;
    margin: 0 auto;
    padding: 0.75rem 1rem 0.4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.ws-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.ws-logo {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 0.35rem;
    object-fit: contain;
}

.ws-kicker {
    margin: 0;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #718096;
}

.ws-header h1 {
    margin: 0;
    font-size: 1.15rem;
    color: var(--ws-ink);
}

.ws-header-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem 0.85rem;
}

.ws-save-status {
    margin: 0;
    font-size: 0.72rem;
    color: #718096;
}

.ws-link-quiet {
    font-size: 0.8rem;
    color: var(--ws-blue);
    text-decoration: none;
    font-weight: 600;
}

.btn-sm {
    padding: 0.35rem 0.7rem;
    font-size: 0.78rem;
}

.ws-link-quiet:hover { text-decoration: underline; }

body.is-landing .ws-progress,
body.is-landing .ws-nav-bar,
body.is-landing #btn-reset {
    display: none;
}

.ws-landing {
    padding-top: 0.5rem;
}

.ws-landing-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 1.5rem 0 1.25rem;
}

@media (min-width: 700px) {
    .ws-landing-cards { grid-template-columns: 1fr 1fr; }
}

.ws-landing-card {
    text-align: left;
    border: 2px solid var(--ws-line);
    background: #fff;
    border-radius: 0.9rem;
    padding: 1.15rem 1.2rem;
    cursor: pointer;
    min-height: 8.5rem;
}

.ws-landing-card:hover {
    border-color: #90cdf4;
    box-shadow: 0 0 0 3px rgba(0, 74, 173, 0.08);
}

.ws-landing-card-title {
    display: block;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--ws-ink);
}

.ws-landing-card-meta {
    display: block;
    margin-top: 0.45rem;
    font-size: 0.9rem;
    line-height: 1.45;
    color: #718096;
}

.ws-host-link {
    display: inline-block;
    margin-top: 0.25rem;
    font-size: 0.82rem;
    color: #718096;
    text-decoration: none;
}

.ws-host-link:hover {
    color: var(--ws-blue);
    text-decoration: underline;
}

.ws-landing-cert-note {
    margin-top: 2.25rem;
    padding: 1rem 1.25rem;
    background: #f1f8ff;
    border: 1px solid #bae3ff;
    border-radius: 0.65rem;
    color: var(--ws-ink);
    font-size: 0.925rem;
    line-height: 1.4;
    text-align: left;
}

.ws-landing-cert-note strong {
    color: var(--ws-blue);
    font-weight: 700;
}

.ws-field-note {
    font-weight: 500;
    font-size: 0.75rem;
    color: #718096;
}

.ws-inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.ws-otp {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.ws-otp-cell {
    flex: 0 0 3.15rem;
    width: 3.15rem;
    height: 3.25rem;
    padding: 0;
    text-align: center;
    font: inherit;
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--ws-ink);
    border: 1px solid #cbd5e0;
    border-radius: 0.65rem;
    background: #fff;
    caret-color: var(--ws-blue);
}

.ws-otp-cell:focus {
    outline: none;
    border-color: var(--ws-blue);
    box-shadow: 0 0 0 3px rgba(0, 74, 173, 0.22);
}

.ws-session-banner {
    margin: 0 0 1rem;
    padding: 0.7rem 0.9rem;
    border-radius: 0.7rem;
    background: #ebf8ff;
    border: 1px solid #90cdf4;
    color: var(--ws-blue-dark);
    font-size: 0.88rem;
}

.ws-session-banner.is-closed {
    background: var(--ws-warn-bg);
    border-color: #fbd38d;
    color: #7b341e;
}

.ws-progress {
    max-width: 920px;
    margin: 0 auto;
    padding: 0 1.25rem 0.75rem;
    overflow-x: auto;
}

.ws-progress ol {
    display: flex;
    gap: 0.4rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.ws-progress button {
    border: 1px solid var(--ws-line);
    background: #fff;
    color: #718096;
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.ws-progress button.is-current {
    background: var(--ws-blue);
    border-color: var(--ws-blue);
    color: #fff;
}

.ws-progress button.is-done {
    background: #ebf8ff;
    border-color: #90cdf4;
    color: var(--ws-blue-dark);
}

.ws-progress button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.ws-main {
    max-width: 920px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 7rem;
}

.ws-stage h2 {
    margin: 0.25rem 0 0.5rem;
    color: var(--ws-ink);
    font-size: 1.6rem;
}

.ws-stage-label {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ws-blue);
}

.ws-lead { margin: 0 0 1.15rem; line-height: 1.6; }

.ws-lead-link {
    color: inherit;
    font-weight: 700;
    text-decoration: none;
}

.ws-lead-link:hover {
    text-decoration: underline;
}
.ws-subhead { color: var(--ws-ink); margin: 0 0 0.65rem; font-size: 1.05rem; }

.ws-hint-static {
    background: #ebf8ff;
    border: 1px solid #bee3f8;
    border-radius: 0.85rem;
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0 0 1.25rem;
}

.ws-callout {
    background: #ebf8ff;
    border: 1px solid #90cdf4;
    border-radius: 0.85rem;
    padding: 0.85rem 1rem;
    margin: 0 0 1.25rem;
    color: var(--ws-blue-dark);
}

.ws-stack {
    display: grid;
    gap: 0.85rem;
}

.ws-card,
.ws-input-card,
.ws-period,
.ws-month-card {
    background: #fff;
    border: 1px solid var(--ws-line);
    border-radius: 0.9rem;
    padding: 1.1rem 1.15rem;
}

.ws-card-title,
.ws-period-title {
    margin: 0 0 0.85rem;
    font-weight: 700;
    color: var(--ws-ink);
    font-size: 0.95rem;
}

.ws-card-help {
    margin: -0.4rem 0 0.9rem;
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.45;
    color: #718096;
}

.ws-grid-2,
.ws-grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 700px) {
    .ws-grid-2 { grid-template-columns: 1fr 1fr; }
    .ws-grid-3 { grid-template-columns: 0.75fr 1fr 1fr; }
    .ws-span-2 { grid-column: 1 / -1; }
}

.ws-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #2d3748;
}

.ws-field-short { max-width: 220px; margin-bottom: 1rem; }

.ws-period-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

@media (min-width: 800px) {
    .ws-period-row { grid-template-columns: 1.3fr 0.9fr 1.3fr 0.9fr; }
}

.ws-month-list {
    display: grid;
    gap: 0.85rem;
}

.ws-month-card {
    display: grid;
    gap: 0.9rem;
}

@media (min-width: 700px) {
    .ws-month-card {
        grid-template-columns: minmax(11rem, 0.9fr) 1.2fr;
        align-items: start;
        gap: 1.25rem;
    }
}

.ws-month-date {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ws-month-day {
    flex: 0 0 3.1rem;
    width: 3.1rem;
    height: 3.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.8rem;
    background: #ebf8ff;
    color: var(--ws-blue);
    font-size: 1.25rem;
    font-weight: 700;
}

.ws-month-meta {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.ws-month-meta strong {
    color: var(--ws-ink);
    font-size: 1rem;
}

.ws-month-meta span {
    font-size: 0.8rem;
    font-weight: 500;
    color: #718096;
}

.ws-field input,
.ws-field select,
.ws-table input,
.ws-table select {
    font: inherit;
    font-weight: 500;
    min-height: 2.65rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid #cbd5e0;
    border-radius: 0.65rem;
    background: #fff;
    color: var(--ws-ink);
    width: 100%;
}

.ws-field input:focus,
.ws-field select:focus,
.ws-table input:focus,
.ws-table select:focus {
    outline: 2px solid rgba(0, 74, 173, 0.35);
    border-color: var(--ws-blue);
}

.ws-select {
    position: relative;
    width: 100%;
}

.ws-select-native {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.ws-select-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-height: 2.65rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid #cbd5e0;
    border-radius: 0.65rem;
    background: #fff;
    color: var(--ws-ink);
    font: inherit;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(26, 32, 44, 0.04);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.ws-select-trigger::after {
    content: "";
    flex: 0 0 0.7rem;
    width: 0.7rem;
    height: 0.7rem;
    margin-left: 0.25rem;
    background: currentColor;
    opacity: 0.45;
    clip-path: polygon(20% 35%, 50% 70%, 80% 35%);
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.ws-select-trigger:hover {
    border-color: #90cdf4;
    box-shadow: 0 0 0 3px rgba(0, 74, 173, 0.08);
}

.ws-select-trigger:focus {
    outline: none;
}

.ws-select-trigger:focus-visible {
    border-color: var(--ws-blue);
    box-shadow: 0 0 0 3px rgba(0, 74, 173, 0.22);
}

.ws-select.is-open .ws-select-trigger {
    border-color: var(--ws-blue);
    box-shadow: 0 0 0 3px rgba(0, 74, 173, 0.18);
}

.ws-select.is-open .ws-select-trigger::after {
    transform: rotate(180deg);
    opacity: 0.7;
}

.ws-select-trigger.is-placeholder {
    color: #a0aec0;
    font-weight: 500;
}

.ws-select.is-ok .ws-select-trigger {
    border-color: #68d391;
    background: var(--ws-ok-bg);
    color: var(--ws-ok);
}

.ws-select.is-off .ws-select-trigger {
    border-color: #ed8936;
    background: var(--ws-warn-bg);
    color: #9c4221;
}

.ws-select-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 0.3rem);
    z-index: 50;
    margin: 0;
    padding: 0.35rem;
    list-style: none;
    max-height: 16rem;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    box-shadow: 0 12px 28px rgba(26, 32, 44, 0.14);
}

.ws-select-option {
    display: block;
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 0.55rem 0.7rem;
    border-radius: 0.5rem;
    font: inherit;
    font-weight: 500;
    color: var(--ws-ink);
    cursor: pointer;
}

.ws-select-option:hover,
.ws-select-option.is-active {
    background: #ebf8ff;
    color: var(--ws-blue-dark);
}

.ws-select-option.is-selected {
    background: #ebf8ff;
    color: var(--ws-blue);
    font-weight: 700;
}

.ws-select-option.is-placeholder {
    color: #a0aec0;
}

.ws-table .ws-select-trigger {
    min-height: 2.35rem;
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
}

.ws-table .ws-select-menu {
    min-width: 8rem;
}

.ws-member-chip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.85rem;
    margin: -0.45rem 0 0.9rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: #718096;
}

.ws-member-chip span + span {
    position: relative;
}

.ws-invoice-total {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.ws-invoice-total .ws-card-title { margin-bottom: 0.25rem; }
.ws-invoice-total .ws-member-chip { margin: 0; }

.ws-invoice-total .ws-field {
    min-width: 12rem;
    flex: 0 1 16rem;
}

.ws-input-narrow,
.ws-input-mid { width: 100%; }

.ws-field input.is-ok,
.ws-field select.is-ok,
.ws-table input.is-ok,
.ws-table select.is-ok { border-color: #68d391; background: var(--ws-ok-bg); }

.ws-field input.is-off,
.ws-field select.is-off,
.ws-table input.is-off,
.ws-table select.is-off { border-color: #ed8936; background: var(--ws-warn-bg); }

.ws-field-feedback {
    font-weight: 500;
    font-size: 0.78rem;
}

.ws-field-feedback.is-ok { color: var(--ws-ok); }
.ws-field-feedback.is-off { color: var(--ws-warn); }

.ws-choice-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .ws-choice-row { grid-template-columns: 1fr 1fr; }
}

.ws-choice {
    text-align: left;
    border: 2px solid var(--ws-line);
    background: #fff;
    border-radius: 0.85rem;
    padding: 1rem 1.1rem;
    cursor: pointer;
}

.ws-choice:hover { border-color: #90cdf4; }

.ws-choice.is-selected {
    border-color: var(--ws-blue);
    background: #ebf8ff;
    box-shadow: 0 0 0 3px rgba(0, 74, 173, 0.12);
}

.ws-choice-title {
    display: block;
    font-weight: 700;
    color: var(--ws-ink);
}

.ws-choice-meta {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.85rem;
    color: #718096;
}

.ws-inline-note {
    min-height: 1.25rem;
    font-size: 0.85rem;
    color: var(--ws-blue-dark);
}

.ws-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -0.25rem;
    padding-bottom: 0.25rem;
}

.ws-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 0.75rem;
    overflow: hidden;
    font-size: 0.88rem;
}

.ws-table th,
.ws-table td {
    border-bottom: 1px solid var(--ws-line);
    padding: 0.65rem 0.6rem;
    text-align: left;
    vertical-align: middle;
}

.ws-table th {
    background: #edf2f7;
    color: #2d3748;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.ws-table-final td:last-child,
.ws-table-final th:last-child { text-align: right; }

.ws-invoice-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    border: 1px solid var(--ws-line);
    border-radius: 0.9rem;
}

.ws-invoice-sheet {
    width: 100%;
    min-width: 40rem;
    border-collapse: collapse;
    font-size: 0.86rem;
}

.ws-invoice-sheet th,
.ws-invoice-sheet td {
    border-bottom: 1px solid var(--ws-line);
    padding: 0.55rem 0.6rem;
    vertical-align: top;
    text-align: left;
}

.ws-invoice-sheet th {
    background: #edf2f7;
    color: #2d3748;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ws-invoice-sheet thead th:nth-child(3),
.ws-invoice-sheet thead th:nth-child(4),
.ws-invoice-sheet tbody td:nth-child(4),
.ws-invoice-sheet tbody td:nth-child(5),
.ws-invoice-sheet .ws-invoice-sum td:last-child {
    text-align: right;
}

.ws-invoice-qty { width: 5.5rem; }
.ws-invoice-unit {
    width: 6.2rem;
    font-weight: 600;
    color: #4a5568;
    vertical-align: middle;
}
.ws-invoice-desc {
    font-weight: 600;
    color: var(--ws-ink);
    vertical-align: middle;
}

.ws-invoice-sheet .ws-field { gap: 0.25rem; }
.ws-invoice-sheet input {
    min-height: 2.35rem;
    text-align: right;
}

.ws-invoice-sum td {
    background: #f7fafc;
    font-weight: 700;
    color: var(--ws-ink);
    vertical-align: middle;
}

.ws-invoice-balance td { background: #ebf8ff; }

.ws-invoice-note {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #718096;
    text-transform: none;
    letter-spacing: 0;
}

.ws-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.ws-hint-static {
    font-size: 0.85rem;
    color: #4a5568;
    background: #edf2f7;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
}

.ws-btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}

.ws-btn-loading::after {
    content: "";
    position: absolute;
    width: 1.25rem;
    height: 1.25rem;
    top: 50%;
    right: 1rem;
    margin-top: -0.625rem;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: ws-spin 0.8s linear infinite;
}

@keyframes ws-spin {
    to {
        transform: rotate(360deg);
    }
}

.ws-check-btn { margin-top: 1.25rem; }

.ws-reflect {
    margin-top: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.9rem;
    line-height: 1.55;
}

.ws-reflect.is-ok {
    background: var(--ws-ok-bg);
    border: 1px solid #9ae6b4;
    color: var(--ws-ok);
}

.ws-reflect.is-off {
    background: var(--ws-warn-bg);
    border: 1px solid #fbd38d;
    color: #7b341e;
}

.ws-complete {
    margin-top: 1.5rem;
    padding: 1.25rem;
    border-radius: 0.9rem;
    background: #ebf8ff;
    border: 1px solid #90cdf4;
}

.ws-complete h3 { margin: 0 0 0.4rem; color: var(--ws-ink); }

.ws-nav-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 25;
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--ws-line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem 1rem calc(0.7rem + env(safe-area-inset-bottom, 0px));
    width: 100%;
}

.ws-nav-hint {
    margin: 0;
    font-size: 0.78rem;
    color: #718096;
    text-align: center;
    flex: 1;
}

.btn {
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
}

.btn-primary { background: var(--ws-blue); color: #fff; }
.btn-primary:hover { background: var(--ws-blue-dark); }
.btn-secondary {
    background: #edf2f7;
    color: #4a5568;
    border-color: #e2e8f0;
}
.btn-secondary:hover { background: #e2e8f0; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.mt-4 { margin-top: 1rem; }

@media (max-width: 720px) {
    .ws-header-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .ws-brand { min-width: 0; }

    .ws-header h1 {
        font-size: 1.05rem;
        line-height: 1.25;
    }

    .ws-header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .ws-progress {
        padding: 0 1rem 0.65rem;
    }

    .ws-progress button {
        font-size: 0.65rem;
        padding: 0.28rem 0.55rem;
    }

    .ws-main {
        padding: 1.1rem 1rem 6.5rem;
    }

    .ws-stage h2 { font-size: 1.35rem; }

    .ws-table {
        font-size: 0.8rem;
        min-width: 36rem;
    }

    .ws-table th,
    .ws-table td { padding: 0.5rem 0.4rem; }

    .ws-nav-hint { display: none; }

    .ws-nav-bar .btn {
        flex: 1;
        min-height: 2.6rem;
    }
}

.host-main { padding-bottom: 3rem; }

.host-steps {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.host-step {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border: 1px solid var(--ws-line);
    background: #fff;
    color: #718096;
    border-radius: 999px;
    padding: 0.35rem 0.75rem 0.35rem 0.35rem;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
}

.host-step:disabled {
    cursor: default;
    opacity: 0.55;
}

.host-step.is-on {
    border-color: var(--ws-blue);
    background: #ebf8ff;
    color: var(--ws-blue-dark);
}

.host-step-num {
    width: 1.45rem;
    height: 1.45rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #edf2f7;
    color: #4a5568;
    font-size: 0.78rem;
}

.host-step.is-on .host-step-num {
    background: var(--ws-blue);
    color: #fff;
}

.host-step-arrow {
    width: 0.7rem;
    height: 0.7rem;
    border-top: 2px solid #cbd5e0;
    border-right: 2px solid #cbd5e0;
    transform: rotate(45deg);
}

.host-list-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.9rem;
}

.host-list-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.host-list-filter {
    border: 1px solid var(--ws-line);
    background: #fff;
    color: #4a5568;
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.host-list-filter.is-on {
    border-color: var(--ws-blue);
    background: #ebf8ff;
    color: var(--ws-blue-dark);
}

.host-list-search {
    flex: 1 1 14rem;
    min-width: 12rem;
}

.host-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.host-heading {
    margin: 0 0 0.35rem;
    color: var(--ws-ink);
    font-size: 1.45rem;
}

.host-lead { margin-bottom: 0; max-width: 36rem; }

.host-room-list {
    display: grid;
    gap: 0.65rem;
    margin-bottom: 1.5rem;
}

.host-room-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    width: 100%;
    text-align: left;
    border: 1px solid var(--ws-line);
    background: #fff;
    border-radius: 0.75rem;
    padding: 0.85rem 1rem;
    cursor: pointer;
    font: inherit;
}

.host-room-card-body {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
}

.host-room-card.is-current {
    border-color: var(--ws-blue);
    background: #ebf8ff;
}

.host-room-card-title {
    font-weight: 600;
    color: var(--ws-ink);
}

.host-room-card-code {
    font-weight: 700;
    letter-spacing: 0.14em;
    color: var(--ws-ink);
}

.host-room-card-meta { font-size: 0.8rem; color: #718096; }

.host-room-card-result {
    margin-top: 0.35rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--ws-ink);
}

.host-room-card-open {
    flex-shrink: 0;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--ws-blue);
    white-space: nowrap;
}

.host-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
    margin: 1rem 0 0.35rem;
    text-align: left;
}

.host-stat {
    background: #f7fafc;
    border: 1px solid var(--ws-line);
    border-radius: 0.75rem;
    padding: 0.7rem 0.8rem;
}

.host-stat strong {
    display: block;
    font-size: 1.55rem;
    line-height: 1.15;
    color: var(--ws-ink);
}

.host-stat span {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.78rem;
    color: #718096;
}

.host-stage-chips {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
    margin: 0 0 1rem;
}

.host-stage-tab {
    display: grid;
    gap: 0.15rem;
    text-align: left;
    border: 1px solid var(--ws-line);
    background: #fff;
    border-radius: 0.85rem;
    padding: 0.7rem 0.8rem;
    font: inherit;
    color: var(--ws-ink);
    cursor: pointer;
}

.host-stage-tab-count {
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--ws-ink);
}

.host-stage-tab-label {
    font-size: 0.75rem;
    color: #718096;
}

.host-stage-tab.is-on {
    border-color: var(--ws-blue);
    background: #ebf8ff;
}

.host-stage-tab.is-on .host-stage-tab-count { color: var(--ws-blue-dark); }
.host-stage-tab.is-on .host-stage-tab-label { color: var(--ws-blue); }

@media (min-width: 720px) {
    .host-stage-chips { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

.host-board-tools { margin-bottom: 0.85rem; }

.host-search-label { display: block; }

.host-search-label input {
    width: 100%;
    border: 1px solid var(--ws-line);
    border-radius: 0.65rem;
    padding: 0.65rem 0.8rem;
    font: inherit;
}

.learn-dialog-card { max-width: 28rem; }
.ws-certificate-card { max-width: 32rem; text-align: left; }

.learn-dialog-field {
    display: grid;
    gap: 0.35rem;
    margin: 0 0 1rem;
    font-size: 0.85rem;
    color: var(--ws-muted);
}

.learn-dialog-field[hidden] { display: none !important; }

.learn-dialog-hint {
    margin: 0;
    font-size: 0.8rem;
    color: #718096;
}

.learn-dialog-field input {
    border: 1px solid var(--ws-line);
    border-radius: 0.55rem;
    padding: 0.6rem 0.7rem;
    font: inherit;
    color: var(--ws-ink);
}

.ws-celebrate-card { text-align: left; }
.ws-celebrate-card h3 { margin: 0.2rem 0 0.5rem; }

.host-code-card {
    background: #fff;
    border: 1px solid var(--ws-line);
    border-radius: 1rem;
    padding: 1.25rem 1.35rem;
    margin-bottom: 1.25rem;
    text-align: center;
}

.host-code {
    margin: 0.35rem 0 0.5rem;
    font-size: clamp(2.2rem, 8vw, 3.6rem);
    letter-spacing: 0.28em;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: var(--ws-ink);
}

.host-table { min-width: 52rem; }
.host-table tbody tr[data-uid] { cursor: pointer; }
.host-table tbody tr[data-uid]:hover { background: #ebf8ff; }

.host-modal {
    position: fixed;
    inset: 0;
    background: rgba(26, 32, 44, 0.45);
    z-index: 40;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem 1rem;
    overflow: auto;
}

.host-modal:not([hidden]) {
    display: flex;
}

.learn-dialog:not([hidden]) {
    align-items: center;
}

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

.host-modal-card {
    width: min(720px, 100%);
    background: #fff;
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}

.host-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.host-modal-head h3 { margin: 0; color: var(--ws-ink); }

.host-detail-body {
    display: grid;
    gap: 0.55rem;
    font-size: 0.9rem;
}

.host-detail-row {
    display: grid;
    grid-template-columns: 10rem 1fr;
    gap: 0.5rem;
    border-bottom: 1px solid var(--ws-line);
    padding-bottom: 0.4rem;
}

.host-detail-key { color: #718096; font-weight: 600; }
.host-detail-val { color: var(--ws-ink); word-break: break-word; }

@media (max-width: 400px) {
    .ws-logo { width: 32px; height: 32px; }
    .ws-save-status { width: 100%; }
    .ws-link-quiet { font-size: 0.75rem; }
    .ws-otp { gap: 0.35rem; }
    .ws-otp-cell {
        flex-basis: 2.55rem;
        width: 2.55rem;
        height: 2.9rem;
        font-size: 1.25rem;
    }
}

/* ============================================================
   NATIVE WORKSHEET CALCULATOR
   ============================================================ */

/* --- Floating Action Button (FAB) ---
   z-index: 54 — above ws-nav-bar (25) and host-modal (40)
   bottom: 5.5rem — safe clearance above ws-nav-bar on notched iPhones
   Hidden on landing/join via body.is-landing rule
*/
.ws-calc-fab {
    position: fixed;
    bottom: 5.5rem;
    right: 1.25rem;
    z-index: 54;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.95rem 0.55rem 0.75rem;
    background: var(--ws-blue);
    color: #fff;
    border: none;
    border-radius: 2rem;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1;
    box-shadow: 0 4px 14px rgba(0, 74, 173, 0.32), 0 2px 4px rgba(0, 0, 0, 0.14);
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
}

.ws-calc-fab:hover {
    background: var(--ws-blue-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 74, 173, 0.38), 0 2px 6px rgba(0, 0, 0, 0.18);
}

.ws-calc-fab:active {
    transform: translateY(0) scale(0.96);
    box-shadow: 0 2px 8px rgba(0, 74, 173, 0.25);
}

.ws-calc-fab-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Hidden on landing page and join panel */
body.is-landing .ws-calc-fab {
    display: none;
}

/* --- Calculator Widget Container ---
   z-index: 55 — above ws-select-menu (50) so dropdowns stay on top of worksheet,
   NOT on top of the calculator panel. Bug 1 fix.
   
   Visibility uses CSS class (NOT hidden attribute) to allow smooth animation.
   Bug 3 fix: [hidden] { display: none !important } would block all transitions.
*/
.ws-calc-widget {
    position: fixed;
    bottom: 5.5rem;
    right: 1.25rem;
    z-index: 55;
    width: 280px;
    max-width: calc(100vw - 2.5rem);
    max-height: calc(100dvh - 10rem);
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16), 0 4px 10px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    /* Hidden state — visibility + opacity so transitions work (Bug 3 fix) */
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px) scale(0.97);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
}

/* Open state — toggled by JS adding/removing this class */
.ws-calc-widget.ws-calc-widget--open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0s;
}

/* --- Calculator Header --- */
.ws-calc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.75rem 0.5rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.ws-calc-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--ws-ink);
    letter-spacing: 0.01em;
}

.ws-calc-title-icon {
    width: 16px;
    height: 16px;
    color: var(--ws-blue);
    flex-shrink: 0;
}

.ws-calc-close-btn {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: #e2e8f0;
    color: #4a5568;
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.14s ease, color 0.14s ease;
}

.ws-calc-close-btn:hover {
    background: #e53e3e;
    color: #fff;
}

/* --- Calculator Screen (soft blue, matching app highlight style) --- */
.ws-calc-screen {
    background: #ebf8ff;
    border-bottom: 1px solid #bee3f8;
    padding: 0.65rem 0.85rem 0.55rem;
    min-height: 4.5rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 0.15rem;
}

.ws-calc-history {
    font-size: 0.72rem;
    color: #4a90c4;
    text-align: right;
    min-height: 1rem;
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ws-calc-result-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.ws-calc-display {
    flex: 1;
    font-size: 1.9rem;
    font-weight: 400;
    color: var(--ws-ink);
    text-align: right;
    letter-spacing: -0.03em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.1;
}

.ws-calc-display.is-error {
    font-size: 1.2rem;
    color: #e53e3e;
}

.ws-calc-copy-btn {
    flex-shrink: 0;
    padding: 0.25rem 0.5rem;
    border: 1px solid #bee3f8;
    border-radius: 0.35rem;
    background: rgba(255,255,255,0.7);
    color: #2b6cb0;
    font-size: 0.68rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    transition: border-color 0.14s ease, color 0.14s ease, background 0.14s ease;
    -webkit-tap-highlight-color: transparent;
}

.ws-calc-copy-btn:hover,
.ws-calc-copy-btn:focus-visible {
    border-color: var(--ws-blue);
    color: var(--ws-blue);
    background: #fff;
    outline: none;
}

.ws-calc-copy-btn.is-copied {
    border-color: #38a169;
    color: #38a169;
    background: rgba(56, 161, 105, 0.1);
}

/* --- Keypad Grid --- */
.ws-calc-keypad {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: #e2e8f0;
    border-top: 1px solid #e2e8f0;
}

.ws-calc-key {
    padding: 0;
    height: 3.1rem;
    border: none;
    background: #fff;
    color: var(--ws-ink);
    font-size: 1.05rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.1s ease, transform 0.08s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ws-calc-key:active {
    transform: scale(0.92);
    background: #e2e8f0;
}

/* Number keys */
.ws-calc-key:not(.ws-calc-fn):not(.ws-calc-op):not(.ws-calc-equals):hover {
    background: #f1f5f9;
}

/* Function keys: AC, ±, %, ⌫ */
.ws-calc-fn {
    background: #f1f5f9;
    color: var(--ws-ink);
    font-size: 0.9rem;
    font-weight: 600;
}

.ws-calc-fn:hover {
    background: #e2e8f0;
}

/* Operator keys: ÷ × − + */
.ws-calc-op {
    background: #ebf4ff;
    color: var(--ws-blue);
    font-size: 1.2rem;
    font-weight: 600;
}

.ws-calc-op:hover {
    background: #dbeafe;
}

.ws-calc-op.is-active {
    background: var(--ws-blue);
    color: #fff;
}

/* Equals key */
.ws-calc-equals {
    background: var(--ws-blue);
    color: #fff;
    font-size: 1.3rem;
    font-weight: 600;
}

.ws-calc-equals:hover {
    background: var(--ws-blue-dark);
}

.ws-calc-equals:active {
    transform: scale(0.92);
    background: var(--ws-blue-dark);
}

/* Responsive: compact keys on very small screens */
@media (max-width: 360px) {
    .ws-calc-widget {
        width: calc(100vw - 2rem);
        right: 1rem;
    }
    .ws-calc-key {
        height: 2.75rem;
        font-size: 0.95rem;
    }
}
/* ============================================================
   END NATIVE WORKSHEET CALCULATOR
   ============================================================ */
