/* ─── Reset & Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    /* Mint Interactive brand palette */
    --brand:        #3CC47C;   /* mint green */
    --brand-hover:  #2dab68;
    --brand-dark:   #1B3D2F;   /* deep forest green — nav/headers */
    --brand-mid:    #2A5A42;
    --brand-light:  #E8F8EF;
    --brand-light2: #D0F0E0;

    --surface:   #FFFFFF;
    --surface-2: #F5FAF7;
    --surface-3: #EDF5F0;
    --border:    #D8EDE3;

    --text:   #122219;
    --text-2: #3D6652;
    --text-3: #7EA896;

    --success: #22C55E;
    --danger:  #EF4444;

    --radius:    12px;
    --radius-sm: 8px;

    --shadow-sm: 0 1px 3px rgba(27,61,47,.08), 0 1px 2px rgba(27,61,47,.06);
    --shadow:    0 4px 16px rgba(27,61,47,.10), 0 1px 4px rgba(27,61,47,.06);
    --shadow-lg: 0 12px 40px rgba(27,61,47,.16), 0 4px 12px rgba(27,61,47,.08);
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--surface-2);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

/* ─── Navbar ────────────────────────────────────────────────────── */
.navbar {
    background: var(--brand-dark);
    border-bottom: none;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0,0,0,.25);
}
.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    text-decoration: none;
}
.brand-logo {
    height: 32px;
    width: auto;
}
.brand-divider {
    width: 1px;
    height: 22px;
    background: rgba(255,255,255,.2);
    margin: 0 .5rem;
}
.brand-app-name {
    font-size: .9rem;
    font-weight: 600;
    color: rgba(255,255,255,.75);
    letter-spacing: .01em;
}
.nav-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.nav-link {
    text-decoration: none;
    color: rgba(255,255,255,.65);
    font-size: .88rem;
    font-weight: 500;
    transition: color .15s;
    padding: .25rem 0;
    border-bottom: 2px solid transparent;
}
.nav-link:hover { color: #fff; }
.nav-link.active {
    color: var(--brand);
    border-bottom-color: var(--brand);
}
.nav-user {
    display: flex;
    align-items: center;
    gap: .75rem;
}
.user-badge {
    font-size: .82rem;
    font-weight: 600;
    color: var(--brand-dark);
    background: var(--brand);
    padding: .25rem .8rem;
    border-radius: 999px;
}
.btn-logout {
    font-size: .82rem;
    color: rgba(255,255,255,.5);
    text-decoration: none;
    transition: color .15s;
}
.btn-logout:hover { color: #fff; }

/* ─── Main ──────────────────────────────────────────────────────── */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.page-header { margin-bottom: 2rem; }
.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--brand-dark);
}
.page-header p {
    color: var(--text-2);
    margin-top: .35rem;
    font-size: .95rem;
}

/* ─── Login ─────────────────────────────────────────────────────── */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--brand-dark);
    /* Subtle diagonal-stripe texture */
    background-image: repeating-linear-gradient(
        -45deg,
        rgba(255,255,255,.02) 0px,
        rgba(255,255,255,.02) 1px,
        transparent 1px,
        transparent 12px
    );
}
.login-card {
    background: var(--surface);
    border-radius: 20px;
    padding: 2.75rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}
.login-header {
    text-align: center;
    margin-bottom: 2rem;
}
.login-logo {
    height: 48px;
    margin-bottom: 1.25rem;
}
.login-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--brand-dark);
}
.login-header p {
    color: var(--text-3);
    font-size: .875rem;
    margin-top: .25rem;
}

.login-form .form-group { margin-bottom: 1.25rem; }
.login-form label {
    display: block;
    font-size: .83rem;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: .4rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.login-form input {
    width: 100%;
    padding: .75rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .95rem;
    font-family: inherit;
    color: var(--text);
    background: var(--surface-2);
    transition: border-color .15s, box-shadow .15s;
    outline: none;
}
.login-form input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(60,196,124,.18);
    background: var(--surface);
}

.login-footer {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: .78rem;
    color: var(--text-3);
}

.alert {
    padding: .75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: .9rem;
    margin-bottom: 1.25rem;
}
.alert-error {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #B91C1C;
}

/* ─── Buttons ───────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .7rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: .95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s;
    text-decoration: none;
    letter-spacing: .01em;
}
.btn-primary {
    background: var(--brand);
    color: var(--brand-dark);
}
.btn-primary:hover:not(:disabled) {
    background: var(--brand-hover);
    color: #fff;
    box-shadow: 0 4px 14px rgba(60,196,124,.35);
    transform: translateY(-1px);
}
.btn-primary:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none;
}
.btn-full { width: 100%; }
.btn-large {
    padding: 1rem 2rem;
    font-size: 1rem;
    border-radius: var(--radius);
}

/* ─── Calculator Layout ─────────────────────────────────────────── */
.calc-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 1.5rem;
    align-items: start;
}

/* ─── Sidebar ───────────────────────────────────────────────────── */
.calc-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 80px;
}
.sidebar-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}
.sidebar-label {
    display: block;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--text-3);
    margin-bottom: .75rem;
}
.select-rate {
    width: 100%;
    padding: .6rem .9rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: .9rem;
    font-weight: 600;
    color: var(--text);
    background: var(--surface-2);
    cursor: pointer;
    outline: none;
    transition: border-color .15s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237EA896' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .8rem center;
    background-color: var(--surface-2);
    padding-right: 2.2rem;
}
.select-rate:focus { border-color: var(--brand); }

.calc-tabs { display: flex; flex-direction: column; gap: .5rem; }
.tab-btn {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .7rem .9rem;
    border: 1.5px solid transparent;
    border-radius: var(--radius-sm);
    background: var(--surface-3);
    font-family: inherit;
    font-size: .88rem;
    font-weight: 600;
    color: var(--text-2);
    cursor: pointer;
    transition: all .15s;
    text-align: left;
}
.tab-btn:hover {
    background: var(--brand-light);
    color: var(--brand-dark);
    border-color: var(--brand-light2);
}
.tab-btn.active {
    background: var(--brand-light);
    border-color: var(--brand);
    color: var(--brand-dark);
}
.tab-icon { font-size: 1rem; }

/* ─── Tab panels ────────────────────────────────────────────────── */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.section-header { margin-bottom: 1.25rem; }
.section-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--brand-dark);
}
.hint {
    font-size: .82rem;
    color: var(--text-3);
    margin-top: .2rem;
}

/* ─── Form card ─────────────────────────────────────────────────── */
.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.form-section {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}
.form-section:last-child { border-bottom: none; }
.form-section h3 {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--text-3);
    margin-bottom: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group label {
    display: block;
    font-size: .88rem;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: .5rem;
}
.form-group select,
.form-group .number-input {
    width: 100%;
    padding: .6rem .9rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: .9rem;
    color: var(--text);
    background: var(--surface-2);
    outline: none;
    transition: border-color .15s;
}
.form-group select:focus,
.form-group .number-input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(60,196,124,.15);
}
.unit {
    font-weight: 400;
    color: var(--text-3);
    font-size: .82rem;
}

/* ─── Radio cards ───────────────────────────────────────────────── */
.radio-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .6rem;
}
.radio-group.three-col { grid-template-columns: repeat(3, 1fr); }
.radio-group.five-col  { grid-template-columns: repeat(5, 1fr); }

.radio-card { position: relative; cursor: pointer; }
.radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.radio-label {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    padding: .75rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    transition: all .15s;
    cursor: pointer;
}
.radio-label strong { font-size: .88rem; color: var(--text); }
.radio-label small {
    font-size: .77rem;
    color: var(--text-3);
    line-height: 1.35;
}
.radio-card input:checked + .radio-label {
    border-color: var(--brand);
    background: var(--brand-light);
}
.radio-card input:checked + .radio-label strong { color: var(--brand-dark); }
.radio-card input:checked + .radio-label small  { color: var(--brand-mid); }
.radio-label:hover {
    border-color: var(--brand);
    background: var(--surface-3);
}

/* ─── Calc footer ───────────────────────────────────────────────── */
.calc-footer {
    margin: 1.5rem 0;
    display: flex;
    justify-content: flex-end;
}

/* ─── Result panel ──────────────────────────────────────────────── */
.result-panel {
    background: var(--surface);
    border: 2px solid var(--brand);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}
.result-panel.hidden { display: none; }

.result-header { margin-bottom: 1.5rem; }
.result-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--brand-dark);
}
.result-note {
    font-size: .82rem;
    color: var(--text-3);
    margin-top: .25rem;
}

.pricing-grid {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.price-box {
    flex: 1;
    background: var(--brand-dark);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
}
.price-label {
    display: block;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: rgba(255,255,255,.6);
    margin-bottom: .5rem;
}
.price-value {
    display: block;
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--brand);
    letter-spacing: -.02em;
}
.price-divider {
    font-size: .9rem;
    color: var(--text-3);
    font-weight: 600;
    flex-shrink: 0;
}

.poa-box {
    text-align: center;
    padding: 2rem;
    background: var(--surface-3);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}
.poa-box.hidden { display: none; }
.poa-icon { font-size: 2rem; margin-bottom: .75rem; }
.poa-box h3 { font-size: 1.15rem; color: var(--brand-dark); margin-bottom: .5rem; }
.poa-box p { color: var(--text-2); font-size: .9rem; }

/* ─── Breakdown ─────────────────────────────────────────────────── */
.breakdown-section { border-top: 1px solid var(--border); padding-top: 1rem; }
.breakdown-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: .88rem;
    font-weight: 600;
    color: var(--brand-hover);
    padding: 0;
}
.breakdown-toggle:hover { color: var(--brand-dark); }
.breakdown-body { margin-top: 1rem; }
.breakdown-body.hidden { display: none; }
.breakdown-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
}
.breakdown-table th {
    text-align: left;
    color: var(--text-3);
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    padding: .5rem .75rem;
    border-bottom: 1px solid var(--border);
}
.breakdown-table td {
    padding: .5rem .75rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-2);
}
.breakdown-table tfoot td {
    color: var(--text);
    border-top: 2px solid var(--border);
    border-bottom: none;
}
.breakdown-table td:last-child,
.breakdown-table th:last-child { text-align: right; }

/* ─── Admin ─────────────────────────────────────────────────────── */
.admin-layout { display: flex; flex-direction: column; gap: 1.5rem; }
.admin-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.admin-card-header {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1.1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--brand-dark);
}
.admin-card-header h2 {
    font-size: .95rem;
    font-weight: 700;
    color: #fff;
}
.badge {
    font-size: .72rem;
    font-weight: 700;
    background: var(--brand);
    color: var(--brand-dark);
    padding: .2rem .6rem;
    border-radius: 999px;
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
}
.admin-table th {
    text-align: left;
    padding: .75rem 1.25rem;
    color: var(--text-3);
    font-size: .73rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    background: var(--surface-3);
    border-bottom: 1px solid var(--border);
}
.admin-table td {
    padding: .875rem 1.25rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-2);
    vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--surface-2); }
.rate-cell { font-weight: 700; color: var(--success); }
.access-cell { text-align: center; }
.check { color: var(--success); font-weight: 700; }
.cross { color: var(--border); }

.tag {
    display: inline-block;
    padding: .2rem .65rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    background: var(--surface-3);
    color: var(--text-2);
}
.tag-admin  { background: #FEF9C3; color: #92400E; }
.tag-client { background: var(--brand-light); color: var(--brand-dark); }

.config-note {
    padding: .75rem 1.25rem;
    font-size: .82rem;
    color: var(--text-3);
    background: var(--surface-3);
    border-top: 1px solid var(--border);
}
code {
    font-family: 'Menlo', 'Monaco', monospace;
    font-size: .83em;
    background: var(--surface-3);
    padding: .1em .4em;
    border-radius: 4px;
    color: var(--brand-dark);
    border: 1px solid var(--border);
}

/* ─── Responsive ────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .calc-layout { grid-template-columns: 1fr; }
    .calc-sidebar { position: static; flex-direction: row; flex-wrap: wrap; }
    .sidebar-card { flex: 1; min-width: 200px; }
    .form-row { grid-template-columns: 1fr; }
    .radio-group.three-col { grid-template-columns: 1fr 1fr; }
    .radio-group.five-col  { grid-template-columns: repeat(3, 1fr); }
    .pricing-grid { flex-direction: column; }
    .price-divider { display: none; }
}
@media (max-width: 560px) {
    .radio-group, .radio-group.three-col { grid-template-columns: 1fr; }
    .radio-group.five-col { grid-template-columns: 1fr 1fr; }
}

/* ─── Flash messages ────────────────────────────────────────────── */
.flash {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .85rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: .9rem;
    font-weight: 500;
    margin-bottom: 1rem;
}
.flash-success {
    background: #DCFCE7;
    border: 1px solid #86EFAC;
    color: #166534;
}
.flash-error {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #B91C1C;
}

/* ─── Admin table extras ────────────────────────────────────────── */
.admin-card-header { justify-content: flex-start; }
.admin-card-header .btn-add { margin-left: auto; }

.action-cell {
    display: flex;
    gap: .35rem;
    justify-content: flex-end;
    align-items: center;
}
.btn-icon {
    width: 30px;
    height: 30px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    cursor: pointer;
    font-size: .9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
    line-height: 1;
}
.btn-edit:hover  { background: var(--brand-light); border-color: var(--brand); color: var(--brand-dark); }
.btn-delete:hover { background: #FEF2F2; border-color: #FECACA; color: #B91C1C; }

.btn-sm {
    padding: .35rem .85rem;
    font-size: .82rem;
    border-radius: 6px;
}
.btn-add {
    background: var(--brand);
    color: var(--brand-dark);
    font-weight: 700;
}
.btn-add:hover { background: var(--brand-hover); color: #fff; }

.btn-ghost {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text-2);
}
.btn-ghost:hover { border-color: var(--text-3); background: var(--surface-3); }

.btn-danger {
    background: #EF4444;
    color: #fff;
}
.btn-danger:hover { background: #DC2626; box-shadow: 0 4px 12px rgba(239,68,68,.3); }

.rate-hint { font-size: .78rem; color: var(--text-3); margin-left: .25rem; }
.muted { color: var(--text-3); font-style: italic; }
.pw-cell { font-size: .78rem; }

/* ─── Modals ────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(18, 34, 25, 0.6);
    backdrop-filter: blur(3px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
}
.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}
.modal {
    background: var(--surface);
    border-radius: 16px;
    width: 100%;
    max-width: 520px;
    box-shadow: var(--shadow-lg);
    transform: translateY(12px);
    transition: transform .2s;
    overflow: hidden;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-sm { max-width: 400px; }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    background: var(--brand-dark);
}
.modal-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}
.modal-close {
    background: none;
    border: none;
    color: rgba(255,255,255,.6);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: .1rem .3rem;
    transition: color .15s;
}
.modal-close:hover { color: #fff; }

.modal-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
    background: var(--surface-3);
}

/* Modal-specific form styles */
.modal .form-group { display: flex; flex-direction: column; gap: .35rem; }
.modal .form-group label {
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-3);
}
.modal .form-group input,
.modal .form-group select {
    padding: .65rem .9rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: .9rem;
    color: var(--text);
    background: var(--surface-2);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    width: 100%;
}
.modal .form-group input:focus,
.modal .form-group select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(60,196,124,.15);
    background: var(--surface);
}
.input-disabled {
    opacity: .6;
    cursor: not-allowed;
    background: var(--surface-3) !important;
}
.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
}
.hint-inline {
    font-size: .72rem;
    font-weight: 400;
    color: var(--text-3);
    text-transform: none;
    letter-spacing: 0;
}

.confirm-text { color: var(--text); font-size: .95rem; line-height: 1.5; }
.confirm-warn { font-size: .85rem; color: #92400E; background: #FEF9C3; padding: .6rem .9rem; border-radius: var(--radius-sm); margin-top: .25rem; }

/* ─── Section note ──────────────────────────────────────────────── */
.section-note {
    font-size: .82rem;
    color: var(--text-3);
    margin-bottom: .75rem;
}

/* ─── Tier Reference Panel ──────────────────────────────────────── */
.tier-reference {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.tier-ref-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .9rem 1.25rem;
    background: var(--brand-dark);
    color: #fff;
    cursor: pointer;
    font-size: .88rem;
    font-weight: 600;
    user-select: none;
    transition: background .15s;
}
.tier-ref-header:hover { background: var(--brand-mid); }
.tier-ref-chevron { font-size: 1rem; transition: transform .2s; }

.tier-ref-body {
    overflow: hidden;
    max-height: 2000px;
    transition: max-height .35s ease;
}
.tier-ref-body.closed { max-height: 0; }

.tier-ref-grid {
    border-bottom: 1px solid var(--border);
}

/* Each tier row */
.tier-ref-row {
    display: grid;
    grid-template-columns: 110px 1fr 1fr;
    gap: 0;
    border-bottom: 1px solid var(--border);
    transition: background .15s;
}
.tier-ref-row:last-child { border-bottom: none; }

.tier-ref-row.tier-ref-active {
    background: var(--brand-light);
    box-shadow: inset 3px 0 0 var(--brand);
}

.tier-ref-name {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    padding: .9rem 1rem;
    border-right: 1px solid var(--border);
    font-size: .88rem;
}
.tier-ref-name strong { color: var(--brand-dark); }

.tier-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: .25rem;
    flex-shrink: 0;
}

/* Tier dot colours */
.tier-bronze      .tier-dot { background: #CD7F32; }
.tier-bronze-plus .tier-dot { background: #C68642; }
.tier-silver      .tier-dot { background: #A8A9AD; }
.tier-silver-plus .tier-dot { background: #8E9AA8; }
.tier-gold        .tier-dot { background: #D4AF37; }
.tier-gold-3d     .tier-dot { background: var(--brand); }

/* Row accent stripe */
.tier-bronze      { border-left: 3px solid #CD7F32; }
.tier-bronze-plus { border-left: 3px solid #C68642; }
.tier-silver      { border-left: 3px solid #A8A9AD; }
.tier-silver-plus { border-left: 3px solid #8E9AA8; }
.tier-gold        { border-left: 3px solid #D4AF37; }
.tier-gold-3d     { border-left: 3px solid var(--brand); }

.tier-ref-included,
.tier-ref-addons {
    padding: .9rem 1rem;
    font-size: .82rem;
    color: var(--text-2);
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    gap: .2rem;
}
.tier-ref-addons {
    border-left: 1px solid var(--border);
}

.or-divider {
    color: var(--text-3);
    font-style: italic;
    font-size: .77rem !important;
}
.tier-plus {
    color: var(--brand-dark);
    font-weight: 600;
    font-size: .8rem !important;
}

.addon-label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-3);
    margin-bottom: .25rem;
}
.poa-tag {
    display: inline-block;
    background: var(--brand-light);
    color: var(--brand-dark);
    padding: .2rem .6rem;
    border-radius: 999px;
    font-size: .8rem !important;
    font-weight: 700;
    letter-spacing: .03em;
}

/* Key / legend */
.tier-key {
    padding: 1.1rem 1.25rem;
    background: var(--surface-3);
    border-top: 1px solid var(--border);
}
.key-title {
    display: block;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-3);
    margin-bottom: .75rem;
}
/* 3-column grid: each item is term + def, laid out in 3 columns */
.key-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .6rem 1.5rem;
}
.key-item {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: .4rem;
    font-size: .8rem;
    line-height: 1.45;
    align-items: baseline;
}
.key-term {
    font-weight: 700;
    color: var(--brand-dark);
    white-space: nowrap;
}
.key-term::after { content: ':'; }
.key-def { color: var(--text-2); }

/* Responsive tier guide */
@media (max-width: 760px) {
    .tier-ref-row { grid-template-columns: 90px 1fr; }
    .tier-ref-addons { grid-column: 1 / -1; border-left: none; border-top: 1px solid var(--border); }
    .key-grid { grid-template-columns: repeat(2, 1fr); }
}

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