
:root {
    --ink: #0f1117;
    --paper: #f7f4ee;
    --paper-warm: #ede9df;
    --accent: #c8622a;
    --accent-light: #f0936a;
    --accent-faint: rgba(200,98,42,0.08);
    --accent-faint2: rgba(200,98,42,0.14);
    --muted: #7a7468;
    --border: #d4cfc5;
    --border-soft: #e8e4dc;
    --card-shadow: 0 1px 3px rgba(15,17,23,0.07), 0 8px 28px rgba(15,17,23,0.07);
    --green: #2d6a1f;
    --green-bg: #edf7e6;
    --green-border: #b8dfa8;
    --blue: #1e4d8c;
    --blue-bg: #e8f0fe;
    --blue-border: #b3ccf5;
    --amber: #92580a;
    --amber-bg: #fef3dc;
    --amber-border: #f5d48a;
}

/* ══════════════════════════════════════
   HERO SECTION
══════════════════════════════════════ */
.hero {
    background:
            radial-gradient(ellipse 70% 60% at 50% 110%, rgba(200,98,42,0.09) 0%, transparent 70%),
            var(--paper);
    padding: 3.5rem 2rem 2.5rem;
    text-align: center;
    border-bottom: 1px solid var(--border-soft);
}

.hero-eyebrow {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.68rem;
    letter-spacing: 0.2em;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.hero-eyebrow::before,
.hero-eyebrow::after {
    content: '';
    display: inline-block;
    width: 24px;
    height: 1px;
    background: var(--accent);
    opacity: 0.5;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.8rem, 4vw, 2.9rem);
    font-weight: 700;
    color: var(--ink);
    line-height: 1.2;
    margin-bottom: 0.75rem;
    max-width: 100%;
}
.hero-title em { font-style: italic; color: var(--accent); }

.hero-sub {
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.65;
    max-width: 480px;
    margin: 0 auto;
}

/* ══════════════════════════════════════
   MAIN CONTENT
══════════════════════════════════════ */
.page-body {
    flex: 1;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 2.5rem 2rem 4rem;
}

/* ══════════════════════════════════════
   CONVERSION FORM CARD
══════════════════════════════════════ */
.form-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem 2.4rem 2.2rem;
    box-shadow: var(--card-shadow);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}
.form-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-light) 100%);
    border-radius: 16px 16px 0 0;
}

/* Three-step flow */
.flow-grid {
    display: grid;
    grid-template-columns: 1fr 32px 1fr 32px 1fr;
    align-items: end;
    gap: 0.6rem;
    margin-bottom: 1.8rem;
}

.flow-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 0.6rem;
    color: var(--border);
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: color 0.3s;
}
.flow-arrow.active { color: var(--accent-light); }

.flow-step {}

.step-label {
    font-size: 0.62rem;
    font-family: 'IBM Plex Mono', monospace;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.45rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}
.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--paper-warm);
    border: 1px solid var(--border);
    font-size: 0.58rem;
    color: var(--muted);
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
    flex-shrink: 0;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.step-num.done { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Light-theme custom dropdown */
.light-dd-wrap { position: relative; user-select: none; }
.light-dd-trigger {
    display: flex; align-items: center; gap: 0.7rem;
    border: 1.5px solid var(--border); border-radius: 10px;
    padding: 0.7rem 0.9rem; background: #fff;
    cursor: pointer; transition: border-color 0.2s, box-shadow 0.2s;
}
.light-dd-trigger:hover { border-color: var(--accent); }
.light-dd-trigger.open { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-faint); }
.light-dd-flag { font-size: 1.1rem; flex-shrink: 0; }
.light-dd-text { flex: 1; min-width: 0; }
.light-dd-name {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.82rem; font-weight: 500; color: var(--ink);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.light-dd-desc { font-size: 0.63rem; color: var(--muted); margin-top: 2px; }
.light-chevron { flex-shrink: 0; color: var(--muted); transition: transform 0.2s; }
.light-dd-trigger.open .light-chevron { transform: rotate(180deg); }

.light-dd-panel {
    display: none; position: fixed;
    background: #fff; border: 1.5px solid var(--accent); border-radius: 10px;
    z-index: 9999; overflow-y: auto; max-height: 260px;
    box-shadow: 0 8px 28px rgba(15,17,23,0.12); min-width: 220px;
    scrollbar-width: thin; scrollbar-color: rgba(200,98,42,0.3) transparent;
}
.light-dd-panel::-webkit-scrollbar { width: 4px; }
.light-dd-panel::-webkit-scrollbar-thumb { background: rgba(200,98,42,0.3); border-radius: 99px; }
.light-dd-panel.open { display: block; animation: dropIn 0.15s ease; }

.light-dd-group-label {
    font-size: 0.58rem; font-family: 'IBM Plex Mono', monospace; letter-spacing: 0.13em;
    text-transform: uppercase; color: var(--muted); opacity: 0.7;
    padding: 0.55rem 0.9rem 0.2rem; border-top: 1px solid var(--border-soft);
}
.light-dd-group-label:first-child { border-top: none; }

.light-dd-option {
    display: flex; align-items: center; gap: 0.65rem;
    padding: 0.6rem 0.9rem; cursor: pointer; transition: background 0.12s;
}
.light-dd-option:hover { background: var(--paper); }
.light-dd-option.selected { background: var(--accent-faint); }

.light-opt-flag { font-size: 0.95rem; flex-shrink: 0; }
.light-opt-body { flex: 1; min-width: 0; }
.light-opt-name { font-family: 'IBM Plex Mono', monospace; font-size: 0.78rem; font-weight: 500; color: var(--ink); }
.light-dd-option.selected .light-opt-name { color: var(--accent); }
.light-opt-desc { font-size: 0.61rem; color: var(--muted); margin-top: 1px; }
.light-opt-check { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--border); flex-shrink: 0; }
.light-dd-option.selected .light-opt-check { background: var(--accent); border-color: var(--accent); }

/* Code input */
.code-input-wrap { position: relative; }
.code-input {
    width: 100%;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 0.7rem 2.6rem 0.7rem 0.95rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--ink);
    background: #fff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    letter-spacing: 0.06em;
}
.code-input::placeholder { color: #c4bfb8; font-weight: 400; font-size: 0.88rem; letter-spacing: 0; }
.code-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-faint); }
.code-input.error { border-color: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,0.1); }

.code-clear-btn {
    position: absolute; right: 0.7rem; top: 50%; transform: translateY(-50%);
    width: 20px; height: 20px; border-radius: 50%; background: var(--border);
    border: none; cursor: pointer; display: none; align-items: center; justify-content: center;
    color: var(--muted); font-size: 0.7rem; transition: background 0.15s;
}
.code-clear-btn:hover { background: #c0bbb4; color: var(--ink); }
.code-clear-btn.visible { display: flex; }

.code-input-error {
    font-size: 0.72rem; color: #dc2626; margin-top: 0.35rem;
    font-family: 'IBM Plex Mono', monospace; display: none; padding-left: 2px;
}
.code-input-error.visible { display: block; }

/* Convert button */
.convert-action-row {
    display: flex;
    justify-content: center;
    padding-top: 0.4rem;
}
.convert-btn {
    background: var(--accent); color: #fff; border: none; border-radius: 10px;
    padding: 0.9rem 2.8rem; font-size: 0.9rem;
    font-family: 'DM Sans', sans-serif; font-weight: 600; letter-spacing: 0.05em;
    cursor: pointer; transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    display: inline-flex; align-items: center; gap: 0.6rem;
    box-shadow: 0 2px 10px rgba(200,98,42,0.25);
}
.convert-btn:hover { background: #b5531f; box-shadow: 0 4px 18px rgba(200,98,42,0.35); transform: translateY(-1px); }
.convert-btn:active { transform: translateY(0) scale(0.98); }
.convert-btn:disabled { background: #c4bfb8; color: rgba(255,255,255,0.6); cursor: not-allowed; transform: none; box-shadow: none; }

.btn-spinner { width: 15px; height: 15px; border: 2px solid rgba(255,255,255,0.35); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; display: none; }
.btn-spinner.active { display: block; }

/* ══════════════════════════════════════
   SOURCE INFO STRIP (shown after code lookup)
══════════════════════════════════════ */
.source-info {
    display: none;
    align-items: center;
    gap: 0.8rem;
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.65rem 1rem;
    margin-top: 0.6rem;
    font-size: 0.8rem;
    color: var(--muted);
    animation: fadeIn 0.25s ease;
}
.source-info.visible { display: flex; }
.source-info-code {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
    color: var(--accent);
    font-size: 0.88rem;
    flex-shrink: 0;
}
.source-info-title { color: var(--ink); font-weight: 500; }
.source-info-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--border); flex-shrink: 0; }

/* ══════════════════════════════════════
   RESULTS SECTION
══════════════════════════════════════ */
#results-section { display: none; }

.results-header {
    display: flex; align-items: center; gap: 0.8rem;
    margin-bottom: 1.2rem; flex-wrap: wrap;
}
.results-title { font-family: 'Playfair Display', serif; font-size: 1.35rem; color: var(--ink); }
.results-meta-badge {
    font-size: 0.65rem; font-family: 'IBM Plex Mono', monospace;
    padding: 0.22rem 0.65rem; border-radius: 4px;
    background: var(--green-bg); color: var(--green);
    border: 1px solid var(--green-border); letter-spacing: 0.05em;
}
.results-latency { margin-left: auto; font-size: 0.72rem; color: var(--muted); font-family: 'IBM Plex Mono', monospace; }

/* Source summary strip */
.results-source-strip {
    background: var(--ink);
    border-radius: 10px;
    padding: 0.9rem 1.2rem;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.rss-label { font-size: 0.6rem; font-family: 'IBM Plex Mono', monospace; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255,255,255,0.35); }
.rss-arrow { color: rgba(255,255,255,0.25); font-size: 0.9rem; }
.rss-code { font-family: 'IBM Plex Mono', monospace; font-size: 1rem; font-weight: 500; color: var(--accent-light); }
.rss-name { font-size: 0.82rem; color: rgba(255,255,255,0.7); }
.rss-std { font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem; color: rgba(255,255,255,0.4); }

/* Match cards */
.match-card {
    background: #fff; border: 1px solid var(--border); border-radius: 12px;
    padding: 1.4rem 1.6rem 1rem; margin-bottom: 1rem;
    box-shadow: var(--card-shadow); position: relative; overflow: hidden;
    animation: slideUp 0.3s ease both;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.match-card:hover { border-color: rgba(200,98,42,0.25); box-shadow: 0 4px 20px rgba(15,17,23,0.09); }

.confidence-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: 4px 0 0 4px; }
.conf-high   { background: linear-gradient(180deg, #4caf50, #66bb6a); }
.conf-medium { background: linear-gradient(180deg, #ff9800, #ffa726); }
.conf-low    { background: linear-gradient(180deg, #9e9e9e, #bdbdbd); }
.conf-zero   { background: linear-gradient(180deg, #e0e0e0, #eeeeee); }

.match-top { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 0.9rem; }
.match-code {
    font-family: 'IBM Plex Mono', monospace; font-size: 1.15rem; font-weight: 500; color: var(--ink);
    background: var(--paper); border: 1px solid var(--border); border-radius: 6px;
    padding: 0.25rem 0.7rem; white-space: nowrap; flex-shrink: 0;
}
.match-title-wrap { flex: 1; min-width: 0; }
.match-title { font-size: 0.95rem; font-weight: 600; color: var(--ink); margin-bottom: 0.3rem; }

.confidence-row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.conf-label { font-size: 0.68rem; color: var(--muted); font-family: 'IBM Plex Mono', monospace; letter-spacing: 0.05em; }
.conf-track { flex: 1; height: 5px; background: var(--paper-warm); border-radius: 99px; overflow: hidden; max-width: 100px; }
.conf-fill { height: 100%; border-radius: 99px; transition: width 0.6s ease; }
.fill-high { background: #4caf50; }
.fill-medium { background: #ff9800; }
.fill-low { background: #9e9e9e; }
.fill-zero { background: #e0e0e0; }
.conf-score { font-family: 'IBM Plex Mono', monospace; font-size: 0.8rem; font-weight: 500; min-width: 32px; }
.score-high   { color: #2e7d32; }
.score-medium { color: #e65100; }
.score-low    { color: #757575; }
.score-zero   { color: #bdbdbd; }

.excluded-badge {
    display: inline-flex; align-items: center; gap: 0.3rem;
    font-size: 0.62rem; font-family: 'IBM Plex Mono', monospace;
    padding: 0.18rem 0.55rem; border-radius: 4px; letter-spacing: 0.04em;
    background: #fef3dc; color: #92580a; border: 1px solid #f5d48a;
}

.match-reason {
    font-size: 0.82rem; color: #5a5550; line-height: 1.7;
    background: var(--paper); border-radius: 8px; padding: 0.75rem 0.9rem;
    border-left: 3px solid var(--border);
    max-height: 0; overflow: hidden; opacity: 0;
    transition: max-height 0.4s cubic-bezier(0.4,0,0.2,1), opacity 0.3s ease, margin 0.3s ease;
    margin-top: 0;
}
.match-reason.open { max-height: 800px; opacity: 1; margin-top: 0.6rem; }

.match-footer {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 0.75rem; padding-top: 0.6rem;
    border-top: 1px solid var(--border-soft); gap: 0.5rem; flex-wrap: wrap;
}
.match-reason-toggle {
    display: inline-flex; align-items: center; gap: 0.4rem;
    font-size: 0.73rem; color: var(--muted); cursor: pointer;
    font-weight: 500; background: none; border: none; padding: 0;
    font-family: 'DM Sans', sans-serif; transition: color 0.15s;
}
.match-reason-toggle:hover { color: var(--accent); }
.toggle-arrow { display: inline-block; transition: transform 0.3s cubic-bezier(0.4,0,0.2,1); font-size: 0.8rem; }
.toggle-arrow.rotated { transform: rotate(180deg); }

.match-votes { display: flex; align-items: center; gap: 0.4rem; }
.vote-btn {
    display: inline-flex; align-items: center; gap: 0.3rem;
    padding: 0.28rem 0.65rem; border-radius: 6px;
    font-size: 0.72rem; font-family: 'DM Sans', sans-serif; font-weight: 500;
    border: 1px solid var(--border); background: transparent; cursor: pointer;
    color: var(--muted); transition: all 0.18s; user-select: none;
}
.vote-btn:hover { border-color: rgba(200,98,42,0.35); color: var(--accent); background: var(--accent-faint); }
.vote-btn.voted-up   { border-color: #4caf50; color: #2e7d32; background: #f0faf0; }
.vote-btn.voted-down { border-color: #ef9a9a; color: #c62828; background: #fff5f5; }
.vote-count { font-family: 'IBM Plex Mono', monospace; font-size: 0.68rem; min-width: 8px; text-align: center; }

/* Excluded notice */
.excluded-notice {
    background: var(--amber-bg); border: 1px solid var(--amber-border);
    border-radius: 10px; padding: 1rem 1.2rem; margin-top: 1rem;
    display: flex; gap: 0.75rem; align-items: flex-start;
}
.excluded-icon { font-size: 0.9rem; flex-shrink: 0; margin-top: 1px; }
.excluded-text { font-size: 0.8rem; color: var(--amber); line-height: 1.6; }
.excluded-label { font-size: 0.65rem; font-family: 'IBM Plex Mono', monospace; letter-spacing: 0.1em; text-transform: uppercase; color: var(--amber); opacity: 0.7; margin-bottom: 0.3rem; font-weight: 500; }

/* Skeleton */
.skeleton-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 1.4rem 1.6rem; margin-bottom: 1rem; box-shadow: var(--card-shadow); }
.skeleton-line { height: 12px; background: linear-gradient(90deg, var(--paper-warm) 25%, var(--border-soft) 50%, var(--paper-warm) 75%); background-size: 200% 100%; animation: shimmer 1.4s ease infinite; border-radius: 6px; margin-bottom: 0.6rem; }
.skeleton-line.w40 { width: 40%; }
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w80 { width: 80%; }
.skeleton-line.tall { height: 56px; }

/* No exact match card (included_candidates === 0) */
.no-exact-match-card {
    background: linear-gradient(135deg, #f0f6ff 0%, #e8f0fe 100%);
    border: 1px solid var(--blue-border);
    border-radius: 12px;
    padding: 1.6rem 2rem 1.8rem;
    margin-top: 1rem;
    margin-bottom: 1.2rem;
    box-shadow: 0 2px 12px rgba(30,77,140,0.08);
    position: relative;
    overflow: hidden;
    animation: slideUp 0.35s ease both;
    text-align: center;
}
.no-exact-match-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--blue), #5a9bd5);
    border-radius: 4px 4px 0 0;
}
.no-exact-match-icon {
    width: 46px;
    height: 46px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: var(--blue-bg);
    border: 1.5px solid var(--blue-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}
.no-exact-match-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--blue);
    margin-bottom: 0.55rem;
    line-height: 1.4;
}
.no-exact-match-desc {
    font-size: 0.82rem;
    color: #4a5568;
    line-height: 1.7;
    max-width: 480px;
    margin: 0 auto;
}
.no-exact-match-desc strong {
    color: var(--blue);
    font-weight: 600;
}
.nem-contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1.1rem;
    padding: 0.55rem 1.3rem;
    background: var(--blue);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(30,77,140,0.2);
}
.nem-contact-btn:hover {
    background: #1a3f6e;
    box-shadow: 0 4px 14px rgba(30,77,140,0.3);
    transform: translateY(-1px);
}

/* Error notice */
.error-notice {
    background: #fef2f2; border: 1px solid #fca5a5; border-radius: 10px;
    padding: 1rem 1.2rem; display: flex; gap: 0.75rem; align-items: flex-start;
}
.error-text { font-size: 0.82rem; color: #b91c1c; line-height: 1.6; }

/* Empty notice */
.empty-notice {
    text-align: center; padding: 2.5rem 1rem;
    color: var(--muted); font-size: 0.88rem;
}
.empty-notice-icon { font-size: 2rem; margin-bottom: 0.6rem; opacity: 0.4; }

/* ══════════════════════════════════════
   ANIMATIONS
══════════════════════════════════════ */
@keyframes dropIn   { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }
@keyframes slideDown{ from { opacity:0; transform:translateY(-10px); } to { opacity:1; transform:translateY(0); } }
@keyframes slideUp  { from { opacity:0; transform:translateY(10px); }  to { opacity:1; transform:translateY(0); } }
@keyframes shimmer  { 0%{ background-position:200% 0; } 100%{ background-position:-200% 0; } }
@keyframes spin     { to{ transform:rotate(360deg); } }
@keyframes fadeIn   { from{ opacity:0; } to{ opacity:1; } }

.match-card:nth-child(1){ animation-delay:0s; }
.match-card:nth-child(2){ animation-delay:.07s; }
.match-card:nth-child(3){ animation-delay:.14s; }
.match-card:nth-child(4){ animation-delay:.21s; }
.match-card:nth-child(5){ animation-delay:.28s; }

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 860px) {
    .flow-grid { grid-template-columns: 1fr; gap: 1rem; }
    .flow-arrow { display: none; }
}

@media (max-width: 768px) {
    footer { padding: 2.2rem 1.5rem 1.4rem; }
    .footer-bottom { flex-direction: column; align-items: flex-start; gap: 0.6rem; }
    .footer-top { gap: 1.5rem; }
}

@media (max-width: 640px) {
    .hero { padding: 2.2rem 1.2rem 2rem; }
    .page-body { padding: 1.8rem 1.2rem 3rem; }
    .form-card { padding: 1.4rem 1.2rem 1.6rem; }
    .rss-name, .rss-std { display: none; }
}

@media (max-width: 700px) {
    header { padding: 0 1rem; height: 54px; }
    .header-nav { display: none; }
    .lang-dropdown-wrap { display: none; }
    .header-auth { display: none; }
    .hamburger { display: flex; }
    .mobile-menu { top: 54px; }
    footer { padding: 1.8rem 1rem 1.2rem; }
    .footer-top { flex-direction: column; gap: 1.2rem; padding-bottom: 1.2rem; }
    .footer-links { flex-direction: column; gap: 1.2rem; }
    .footer-link-group { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 0.3rem 1.2rem; }
    .footer-link-group-label { width: 100%; margin-bottom: 0; }
    .footer-filings { gap: 0.6rem; }
    .footer-filing-sep { display: none; }
    .footer-filings { flex-direction: column; align-items: flex-start; gap: 0.3rem; }
}

/* ══════════════════════════════════════
   QUOTA MODAL
══════════════════════════════════════ */
.quota-overlay {
    position: fixed; inset: 0;
    background: rgba(15,17,23,0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 900;
    display: flex; align-items: center; justify-content: center;
    padding: 1.5rem;
    opacity: 0; pointer-events: none;
    transition: opacity 0.25s ease;
}
.quota-overlay.open { opacity: 1; pointer-events: auto; }

.quota-modal {
    background: #fff;
    border-radius: 18px;
    padding: 2.4rem 2.2rem 2rem;
    max-width: 420px; width: 100%;
    box-shadow: 0 8px 40px rgba(15,17,23,0.22), 0 2px 8px rgba(15,17,23,0.1);
    position: relative;
    transform: translateY(16px) scale(0.97);
    transition: transform 0.28s cubic-bezier(0.34,1.56,0.64,1);
    overflow: hidden;
}
.quota-overlay.open .quota-modal { transform: translateY(0) scale(1); }

/* accent top bar */
.quota-modal::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
}

.quota-close {
    position: absolute; top: 1rem; right: 1rem;
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--paper-warm); border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--muted); font-size: 0.85rem;
    transition: background 0.15s, color 0.15s;
}
.quota-close:hover { background: var(--border); color: var(--ink); }

.quota-icon-wrap {
    width: 54px; height: 54px; border-radius: 50%;
    background: var(--amber-bg); border: 1.5px solid var(--amber-border);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; margin: 0 auto 1.2rem;
}

.quota-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem; font-weight: 700;
    color: var(--ink); text-align: center;
    margin-bottom: 0.55rem;
}

.quota-desc {
    font-size: 0.85rem; color: var(--muted);
    line-height: 1.7; text-align: center;
    margin-bottom: 1.6rem;
}
.quota-desc strong { color: var(--ink); }

/* Usage badge */
.quota-usage {
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    background: var(--paper); border: 1px solid var(--border-soft);
    border-radius: 8px; padding: 0.6rem 1rem;
    margin-bottom: 1.6rem;
    font-size: 0.78rem; color: var(--muted);
    font-family: 'IBM Plex Mono', monospace;
}
.quota-usage-num {
    font-size: 1rem; font-weight: 600;
    color: var(--accent); letter-spacing: 0.04em;
}
.quota-usage-sep { color: var(--border); }

.quota-btns {
    display: flex; flex-direction: column; gap: 0.7rem;
}

.quota-btn-primary {
    width: 100%; padding: 0.88rem;
    background: var(--accent); color: #fff;
    border: none; border-radius: 10px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem; font-weight: 700;
    letter-spacing: 0.04em; cursor: pointer;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    box-shadow: 0 2px 10px rgba(200,98,42,0.25);
    display: flex; align-items: center; justify-content: center; gap: 0.4rem;
}
.quota-btn-primary:hover {
    background: #b5531f;
    box-shadow: 0 4px 18px rgba(200,98,42,0.35);
    transform: translateY(-1px);
}

.quota-btn-secondary {
    width: 100%; padding: 0.78rem;
    background: transparent; color: var(--ink);
    border: 1.5px solid var(--border); border-radius: 10px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.88rem; font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
    display: flex; align-items: center; justify-content: center; gap: 0.4rem;
}
.quota-btn-secondary:hover {
    border-color: var(--accent); color: var(--accent);
    background: var(--accent-faint);
}

.quota-hint {
    text-align: center; font-size: 0.72rem;
    color: var(--muted); margin-top: 1rem;
    line-height: 1.5;
}
.quota-hint a { color: var(--accent); text-decoration: none; font-weight: 500; }
.quota-hint a:hover { text-decoration: underline; }

/* ══════════════════════════════════════
   HOW-TO BAR
══════════════════════════════════════ */
.howto-bar {
    background: var(--paper);
    border-bottom: 1px solid var(--border-soft);
}
.howto-inner {
    max-width: 800px;
    margin: 0 auto;
    padding: 1.2rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.howto-desc {
    font-size: 0.84rem;
    color: #4a4540;
    line-height: 1.7;
}
.howto-desc strong { color: var(--ink); font-weight: 600; }
.howto-desc em { font-style: normal; color: var(--accent); font-weight: 600; }

.howto-steps {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.howto-step {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.78rem;
    color: var(--muted);
}
.howto-step-num {
    width: 20px; height: 20px;
    border-radius: 50%;
    background: var(--accent-faint);
    border: 1px solid rgba(200,98,42,0.2);
    display: flex; align-items: center; justify-content: center;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.62rem; font-weight: 700;
    color: var(--accent); flex-shrink: 0;
}
.howto-sep {
    color: var(--border);
    font-size: 0.9rem;
    line-height: 1;
}
@media (max-width: 640px) {
    .howto-inner { padding: 1rem 1.2rem; }
    .howto-steps { gap: 0.5rem; }
    .howto-step-text { font-size: 0.74rem; }
}

@media (max-width: 480px) {
    .howto-sep { display: none; }
    .howto-steps { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
}
