/* ─── ratio ─────────────────────────── */

.hb-page--ratio * { margin: 0; padding: 0; box-sizing: border-box; }
.hb-page--ratio {
    --gold: #C9A84C; --gl: #E8C97A; --gd: #8A6B2A; --gf: rgba(201,168,76,.1); --gff: rgba(201,168,76,.05);
    --bk: #050505; --d1: #0B0B0B; --d2: #111; --d3: #181818; --d4: #1E1E1E;
    --tx: #EDE8DE; --tm: #8A8278; --td: #4A4640; --te: #2A2620;
    --br: rgba(201,168,76,.13); --brh: rgba(201,168,76,.32); --brs: rgba(201,168,76,.55);
    --harmony: #C9A84C; --clash: #C97060; --neutral: #7A8A90;
}
.hb-page--ratio { background: var(--bk); color: var(--tx); font-family: 'Jost',sans-serif; font-weight: 300; min-height: 100vh; overflow-x: hidden; }

.hb-page--ratio .page-header { padding: 2.5rem 2.5rem 2rem; border-bottom: 1px solid var(--br); display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; }
.hb-page--ratio .ph-eye { font-size: 8px; letter-spacing: 5px; text-transform: uppercase; color: var(--gold); margin-bottom: .5rem; }
.hb-page--ratio .ph-title { font-family: 'Cormorant Garamond',serif; font-size: clamp(28px,4vw,52px); font-weight: 300; line-height: 1; }
.hb-page--ratio .ph-sub { font-size: 11px; color: var(--tm); margin-top: .5rem; line-height: 1.7; max-width: 480px; }
.hb-page--ratio .ph-legend { display: flex; gap: 1.5rem; flex-shrink: 0; }
.hb-page--ratio .leg-item { display: flex; align-items: center; gap: 6px; font-size: 9px; letter-spacing: 1px; color: var(--tm); }
.hb-page--ratio .leg-dot { width: 8px; height: 8px; border-radius: 50%; }

.hb-page--ratio .wrap { display: grid; grid-template-columns: 340px 1fr; min-height: calc(100vh - 64px - 120px); }
.hb-page--ratio .left { border-right: 1px solid var(--br); position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto; display: flex; flex-direction: column; }
.hb-page--ratio .lpanel { padding: 1.75rem; flex: 1; }
.hb-page--ratio .sec { margin-bottom: 1.75rem; }
.hb-page--ratio .sec-ttl { font-size: 8px; letter-spacing: 4px; text-transform: uppercase; color: var(--gold); margin-bottom: .875rem; display: flex; align-items: center; gap: 8px; }
.hb-page--ratio .sec-ttl::after { content: ''; flex: 1; height: 1px; background: var(--br); }

.hb-page--ratio .note-layer { border: 1px solid var(--br); background: var(--d1); margin-bottom: 8px; }
.hb-page--ratio .nlhead { padding: .55rem .875rem; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--br); }
.hb-page--ratio .nlname { font-size: 8px; letter-spacing: 3px; text-transform: uppercase; color: var(--tm); }
.hb-page--ratio .nlcnt { font-size: 8px; color: var(--gold); font-weight: 400; }
.hb-page--ratio .nlbody { padding: .75rem; display: flex; flex-wrap: wrap; gap: 4px; }
.hb-page--ratio .nc { padding: 4px 10px; border: 1px solid var(--br); color: var(--td); font-size: 8px; letter-spacing: .5px; cursor: pointer; transition: .22s; user-select: none; background: transparent; }
.hb-page--ratio .nc:hover { border-color: var(--brh); color: var(--tm); }
.hb-page--ratio .nc.on { border-color: var(--gold); color: var(--gold); background: var(--gf); }

.hb-page--ratio .reset-btn { width: 100%; padding: 9px; background: transparent; border: 1px solid var(--br); color: var(--td); font-family: 'Jost',sans-serif; font-size: 8px; letter-spacing: 3px; text-transform: uppercase; cursor: pointer; transition: .3s; margin-top: .25rem; }
.hb-page--ratio .reset-btn:hover { border-color: var(--brh); color: var(--tm); }

.hb-page--ratio .deep-btn { margin: 0 1.75rem 1.75rem; padding: 13px; background: var(--gold); color: var(--bk); border: none; font-family: 'Jost',sans-serif; font-size: 9px; letter-spacing: 4px; text-transform: uppercase; cursor: pointer; transition: .3s; }
.hb-page--ratio .deep-btn:hover { background: var(--gl); }
.hb-page--ratio .deep-btn:disabled { opacity: .28; cursor: not-allowed; pointer-events: none; }

.hb-page--ratio .right { padding: 2rem 2.5rem; overflow-y: auto; max-height: calc(100vh - 64px); }

.hb-page--ratio .empty { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 60vh; text-align: center; padding: 3rem; }
.hb-page--ratio .empty-sym { font-family: 'Cormorant Garamond',serif; font-size: 80px; color: var(--gold); opacity: .07; line-height: 1; margin-bottom: 2rem; }
.hb-page--ratio .empty-ttl { font-family: 'Cormorant Garamond',serif; font-size: 24px; color: var(--td); font-weight: 300; }
.hb-page--ratio .empty-sub { font-size: 10px; color: var(--te); letter-spacing: 1px; margin-top: .75rem; line-height: 1.8; }

.hb-page--ratio .dashboard { display: none; }
.hb-page--ratio .dashboard.on { display: block; }

.hb-page--ratio .ratio-card { background: var(--d1); border: 1px solid var(--br); padding: 2rem; margin-bottom: 1.5rem; display: grid; grid-template-columns: auto 1fr auto; gap: 2rem; align-items: center; }
.hb-page--ratio .rc-gauge-wrap { position: relative; width: 120px; height: 120px; flex-shrink: 0; }
.hb-page--ratio .rc-score { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); text-align: center; }
.hb-page--ratio .rc-num { font-family: 'Cormorant Garamond',serif; font-size: 36px; color: var(--gold); line-height: 1; }
.hb-page--ratio .rc-pct { font-size: 8px; letter-spacing: 2px; color: var(--tm); }
.hb-page--ratio .rc-label { font-size: 8px; letter-spacing: 4px; text-transform: uppercase; color: var(--gold); margin-bottom: .4rem; }
.hb-page--ratio .rc-title { font-family: 'Cormorant Garamond',serif; font-size: 26px; font-weight: 300; line-height: 1.1; margin-bottom: .4rem; }
.hb-page--ratio .rc-desc { font-size: 11px; color: var(--tm); line-height: 1.6; }
.hb-page--ratio .rc-family { font-family: 'Cormorant Garamond',serif; font-size: 20px; color: var(--tx); margin-bottom: .3rem; }
.hb-page--ratio .rc-tags { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.hb-page--ratio .rtag { padding: 2px 10px; font-size: 8px; letter-spacing: 1px; text-transform: uppercase; border: 1px solid var(--br); }

.hb-page--ratio .layer-bars { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 1.5rem; }
.hb-page--ratio .lbar-card { background: var(--d1); border: 1px solid var(--br); padding: 1.25rem; }
.hb-page--ratio .lbar-label { font-size: 8px; letter-spacing: 2px; text-transform: uppercase; color: var(--td); margin-bottom: .75rem; }
.hb-page--ratio .lbar-bridge { font-family: 'Cormorant Garamond',serif; font-size: 14px; color: var(--tx); margin-bottom: .75rem; line-height: 1.2; }
.hb-page--ratio .lbar-track { height: 3px; background: var(--d3); margin-bottom: .5rem; position: relative; overflow: hidden; }
.hb-page--ratio .lbar-fill { height: 100%; transition: .7s; position: absolute; top: 0; left: 0; }
.hb-page--ratio .lbar-score { font-size: 18px; font-family: 'Cormorant Garamond',serif; }
.hb-page--ratio .lbar-verdict { font-size: 8px; color: var(--tm); letter-spacing: 1px; margin-top: 3px; }

.hb-page--ratio .matrix-section { margin-bottom: 1.5rem; }
.hb-page--ratio .msec-title { font-size: 8px; letter-spacing: 4px; text-transform: uppercase; color: var(--gold); margin-bottom: 1rem; display: flex; align-items: center; gap: 8px; }
.hb-page--ratio .msec-title::after { content: ''; flex: 1; height: 1px; background: var(--br); }
.hb-page--ratio .pair-grid { display: flex; flex-direction: column; gap: 6px; }
.hb-page--ratio .pair-row { background: var(--d1); border: 1px solid var(--br); padding: .875rem 1.25rem; display: grid; grid-template-columns: 1fr auto 1fr auto 120px auto; align-items: center; gap: .875rem; transition: .3s; }
.hb-page--ratio .pair-row:hover { border-color: var(--brh); }
.hb-page--ratio .pnote-a { font-size: 10px; color: var(--tm); text-align: right; }
.hb-page--ratio .pnote-b { font-size: 10px; color: var(--tm); }
.hb-page--ratio .pair-connector { font-size: 12px; color: var(--td); text-align: center; }
.hb-page--ratio .pair-bar-wrap { position: relative; height: 4px; background: var(--d3); overflow: hidden; border-radius: 2px; }
.hb-page--ratio .pair-bar-fill { height: 100%; transition: .6s; border-radius: 2px; position: absolute; top: 0; left: 0; }
.hb-page--ratio .pair-score { font-family: 'Cormorant Garamond',serif; font-size: 16px; min-width: 32px; text-align: right; }
.hb-page--ratio .pair-label { font-size: 7px; letter-spacing: 1px; text-transform: uppercase; text-align: right; white-space: nowrap; }

.hb-page--ratio .wheel-section { background: var(--d1); border: 1px solid var(--br); padding: 2rem; margin-bottom: 1.5rem; display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: center; }
.hb-page--ratio .wheel-wrap { display: flex; align-items: center; justify-content: center; }
.hb-page--ratio .wi-title { font-size: 8px; letter-spacing: 4px; text-transform: uppercase; color: var(--gold); margin-bottom: 1rem; }
.hb-page--ratio .wi-row { display: flex; align-items: center; gap: 10px; margin-bottom: .75rem; }
.hb-page--ratio .wi-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.hb-page--ratio .wi-name { font-size: 10px; color: var(--tm); flex: 1; }
.hb-page--ratio .wi-score { font-family: 'Cormorant Garamond',serif; font-size: 14px; }

.hb-page--ratio .accord-section { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 1.5rem; }
.hb-page--ratio .accord-card { background: var(--d1); border: 1px solid var(--br); padding: 1.25rem; }
.hb-page--ratio .ac-label { font-size: 7px; letter-spacing: 3px; text-transform: uppercase; color: var(--td); margin-bottom: .4rem; }
.hb-page--ratio .ac-val { font-family: 'Cormorant Garamond',serif; font-size: 18px; color: var(--tx); }
.hb-page--ratio .ac-sub { font-size: 9px; color: var(--tm); margin-top: 3px; line-height: 1.5; }
.hb-page--ratio .ac-bar { height: 2px; background: var(--d3); margin-top: .75rem; }
.hb-page--ratio .ac-bar-fill { height: 100%; background: var(--gold); }

.hb-page--ratio .ai-insight { background: var(--d1); border: 1px solid var(--brh); padding: 1.75rem; margin-bottom: 1.5rem; display: none; }
.hb-page--ratio .ai-insight.on { display: block; }
.hb-page--ratio .ai-label { font-size: 8px; letter-spacing: 4px; text-transform: uppercase; color: var(--gold); margin-bottom: 1rem; }
.hb-page--ratio .ai-loading { display: flex; align-items: center; gap: 12px; color: var(--tm); font-size: 11px; letter-spacing: 1px; }
.hb-page--ratio .ai-spinner { width: 18px; height: 18px; border: 1px solid var(--br); border-top-color: var(--gold); border-radius: 50%; animation: ratio-spin .9s linear infinite; flex-shrink: 0; }
@keyframes ratio-spin { to { transform: rotate(360deg); } }
.hb-page--ratio .ai-text { font-family: 'Cormorant Garamond',serif; font-size: 15px; color: var(--tm); line-height: 1.8; font-style: italic; display: none; }

.hb-page--ratio .toast { position: fixed; bottom: 1.75rem; right: 1.75rem; background: var(--d2); border: 1px solid var(--brs); padding: .75rem 1.25rem; font-size: 10px; letter-spacing: 1px; z-index: 9999; transform: translateY(70px); opacity: 0; transition: .3s; display: flex; align-items: center; gap: 8px; color: var(--gold); }
.hb-page--ratio .toast.on { transform: none; opacity: 1; }
.hb-page--ratio .fi { opacity: 0; animation: ratio-fadeUp .4s ease forwards; }
@keyframes ratio-fadeUp { to { opacity: 1; transform: none; } }

@media (max-width: 960px) {
    .hb-page--ratio .wrap { grid-template-columns: 1fr; }
    .hb-page--ratio .left { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--br); }
    .hb-page--ratio .layer-bars, .hb-page--ratio .accord-section, .hb-page--ratio .wheel-section, .hb-page--ratio .ratio-card { grid-template-columns: 1fr; }
    .hb-page--ratio .pair-row { grid-template-columns: 1fr 1fr 60px; gap: .5rem; }
    .hb-page--ratio .pnote-a, .hb-page--ratio .pair-connector { display: none; }
}
@media (max-width: 600px) {
    .hb-page--ratio .page-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 2rem 1.25rem 1.5rem;
    }
    .hb-page--ratio .ph-eye { letter-spacing: 3px; }
    .hb-page--ratio .ph-legend {
        flex-wrap: wrap;
        gap: .75rem 1rem;
    }
    .hb-page--ratio .lpanel,
    .hb-page--ratio .right {
        padding: 1.25rem;
        max-height: none;
        overflow: visible;
    }
    .hb-page--ratio .deep-btn {
        margin: 0 1.25rem 1.25rem;
        min-height: 46px;
    }
    .hb-page--ratio .ratio-card,
    .hb-page--ratio .wheel-section,
    .hb-page--ratio .ai-insight,
    .hb-page--ratio .lbar-card,
    .hb-page--ratio .accord-card {
        padding: 1.25rem;
    }
    .hb-page--ratio .rc-tags {
        align-items: flex-start;
        flex-direction: row;
        flex-wrap: wrap;
    }
    .hb-page--ratio .pair-row {
        grid-template-columns: 1fr;
        gap: .5rem;
        padding: 1rem;
    }
    .hb-page--ratio .pnote-b,
    .hb-page--ratio .pair-score,
    .hb-page--ratio .pair-label { text-align: left; }
    html[dir="rtl"] .hb-page--ratio .pnote-b,
    html[dir="rtl"] .hb-page--ratio .pair-score,
    html[dir="rtl"] .hb-page--ratio .pair-label { text-align: right; }
    .hb-page--ratio .pair-bar-wrap { width: 100%; }
    .hb-page--ratio .toast {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
        justify-content: center;
        text-align: center;
    }
}
