/* ============================================================
   PEPTIDECALC — STYLESHEET
   ============================================================ */

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* === DESIGN TOKENS === */
:root {
    --bg:         #07090f;
    --surface:    #0c0f1a;
    --card:       #101522;
    --border:     #1b2035;
    --border-hi:  #252d48;

    --cyan:       #00d4ff;
    --cyan-dim:   rgba(0, 212, 255, 0.10);
    --purple:     #8b5cf6;
    --gradient:   linear-gradient(135deg, #00d4ff 0%, #8b5cf6 100%);

    --text:       #e2e8f0;
    --text-dim:   #94a3b8;
    --text-muted: #4e5a72;
    --amber:      #f59e0b;

    --radius:     14px;
    --radius-sm:  9px;
    --radius-xs:  6px;
    --radius-pill:100px;

    --ease:       0.18s ease;
    --shadow:     0 4px 28px rgba(0,0,0,.45);

    --font: 'Inter', system-ui, -apple-system, sans-serif;
    --max-w: 860px;
}

/* === BASE === */
html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 15px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   DISCLAIMER BANNER
   ============================================================ */
.disclaimer-banner {
    background: rgba(245, 158, 11, 0.06);
    border-bottom: 1px solid rgba(245, 158, 11, 0.14);
    color: #c0914a;
    font-size: 11.5px;
    line-height: 1.4;
    padding: 6px 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    text-align: center;
    letter-spacing: 0.01em;
}
.disclaimer-banner svg { flex-shrink: 0; opacity: 0.75; }
.disclaimer-banner span { white-space: normal; }
.disclaimer-banner strong { color: #d4a04a; font-weight: 600; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: rgba(7, 9, 15, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.logo-text {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.4px;
    white-space: nowrap;
}
.logo-accent {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* === TAB NAV === */
.tab-nav {
    display: flex;
    gap: 2px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 4px;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar { display: none; }

.tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: color var(--ease), background var(--ease);
    white-space: nowrap;
}
.tab-btn:hover { color: var(--text-dim); }
.tab-btn.active {
    background: var(--card);
    color: var(--cyan);
    border: 1px solid var(--border-hi);
}

/* ============================================================
   LAYOUT
   ============================================================ */
main { flex: 1; padding-bottom: 96px; }

.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 24px;
}

.tab-pane { display: none; padding-top: 56px; }
.tab-pane.active { display: block; }

/* ============================================================
   PAGE HERO
   ============================================================ */
.page-hero {
    text-align: center;
    margin-bottom: 40px;
}
.page-hero h1 {
    font-size: clamp(26px, 5vw, 38px);
    font-weight: 700;
    letter-spacing: -1.2px;
    line-height: 1.15;
    margin-bottom: 12px;
    background: linear-gradient(170deg, #ffffff 30%, #8899bb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.page-hero p {
    font-size: 15px;
    color: var(--text-dim);
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ============================================================
   CALCULATOR
   ============================================================ */
.calc-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px;
    box-shadow: var(--shadow);
}

/* Steps */
.form-step { margin-bottom: 32px; }
.form-step:last-of-type { margin-bottom: 24px; }

.step-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.step-badge {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}
.step-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-dim);
}

/* Count pills */
.pill-group { display: flex; gap: 8px; flex-wrap: wrap; }

.pill {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    padding: 8px 20px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all var(--ease);
    outline: none;
}
.pill:hover { border-color: var(--border-hi); color: var(--text); }
.pill.active { background: var(--cyan-dim); border-color: var(--cyan); color: var(--cyan); }

/* === COMPOUND DROPDOWN === */
.select-wrap {
    position: relative;
    display: block;
}

.select-wrap select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    padding-right: 40px;
    cursor: pointer;
    background-color: var(--surface);
}

.select-wrap::after {
    content: '';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--text-muted);
}

select option  { background: #141c2e; color: var(--text); }
select optgroup { background: #0c1220; color: var(--text-muted); font-style: normal; }

/* === CUSTOM BLEND ROW === */
.custom-blend-row {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.custom-blend-row.hidden { display: none; }

.preset-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

/* === DOSE UNIT TOGGLE (for unlisted compounds) === */
.unit-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.unit-toggle-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.unit-toggle-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 14px;
    cursor: pointer;
    transition: all var(--ease);
}
.unit-toggle-btn:hover { border-color: var(--border-hi); color: var(--text); }
.unit-toggle-btn.active { background: var(--cyan-dim); border-color: var(--cyan); color: var(--cyan); }

/* Compound groups */
.compound-group {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}
.compound-group:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }

.compound-group-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--cyan);
    margin-bottom: 12px;
}
.compound-row {
    display: grid;
    grid-template-columns: 1fr 160px;
    gap: 12px;
}

/* Fields */
.field { display: flex; flex-direction: column; gap: 6px; }
.field.solo { max-width: 300px; }

.field-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-muted);
}
.field-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
    line-height: 1.55;
}

.input-wrap { position: relative; display: flex; align-items: center; }

.field-input {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    padding: 10px 14px;
    transition: border-color var(--ease), box-shadow var(--ease);
    -webkit-appearance: none;
    appearance: none;
}
.field-input:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.08);
}
.field-input::placeholder { color: var(--text-muted); opacity: 0.55; }
.field-input.has-unit { padding-right: 46px; }

.input-unit {
    position: absolute;
    right: 13px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    pointer-events: none;
    user-select: none;
}

/* === DOSE HINT (contextual dosing info) === */
.dose-hint {
    margin-top: 12px;
    background: rgba(0,212,255,0.04);
    border: 1px solid rgba(0,212,255,0.12);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.6;
    animation: fadeIn 0.2s ease;
}
.dose-hint.hidden { display: none; }

.dose-hint-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--cyan);
    margin-bottom: 10px;
}
.dose-hint-text { line-height: 1.65; }

.hint-ref-link {
    background: none;
    border: none;
    color: var(--cyan);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Blend dose table */
.dht-grid {
    display: grid;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    overflow: hidden;
    margin-top: 10px;
}
.dht-cell {
    padding: 8px 10px;
    font-size: 12px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    color: var(--text-dim);
}
.dht-cell:last-child { border-right: none; }

.dht-header {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-muted);
    background: rgba(255,255,255,0.02);
}
.dht-row-last .dht-cell { border-bottom: none; }

.dht-units {
    font-weight: 600;
    color: var(--text);
}

.dose-hint-subtext {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
    line-height: 1.55;
}

.dht-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.dose-hint-note {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 10px;
    font-style: italic;
}

.dose-hint-recon-note {
    font-size: 12px;
    color: var(--amber);
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.15);
    border-radius: var(--radius-xs);
    padding: 8px 11px;
    margin-top: 8px;
    line-height: 1.55;
}

/* Calculate button */
.calc-button {
    width: 100%;
    background: var(--gradient);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-family: var(--font);
    font-size: 15px;
    font-weight: 600;
    padding: 14px 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.15px;
    transition: opacity var(--ease), transform var(--ease), box-shadow var(--ease);
    margin-top: 4px;
}
.calc-button:hover {
    opacity: 0.91;
    transform: translateY(-1px);
    box-shadow: 0 6px 28px rgba(0,212,255,0.22);
}
.calc-button:active { transform: translateY(0); box-shadow: none; }

/* Result box */
.result-box {
    margin-top: 22px;
    background: rgba(0,212,255,0.04);
    border: 1px solid rgba(0,212,255,0.16);
    border-radius: var(--radius-sm);
    padding: 24px;
    animation: slideUp 0.22s ease;
}
.result-box.hidden { display: none; }
.result-box.error { background: rgba(239,68,68,0.04); border-color: rgba(239,68,68,0.18); }

@keyframes slideUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.result-header {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--cyan);
    margin-bottom: 16px;
}
.result-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; margin-bottom: 16px; }

.result-item {
    background: rgba(255,255,255,0.025);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
}
.result-item-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.result-item-units { display: flex; align-items: baseline; gap: 5px; margin-bottom: 6px; }
.units-number {
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -1px;
    line-height: 1;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.units-label { font-size: 13px; font-weight: 500; color: var(--text-dim); }
.result-item-sub { font-size: 11.5px; color: var(--text-muted); line-height: 1.6; }

.result-note {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: 14px;
}
.result-error { font-size: 14px; color: #f87171; padding: 4px 0; }

.blend-draw-summary { font-size: 14px; color: var(--text-dim); margin-bottom: 14px; line-height: 1.5; }
.blend-draw-summary strong { color: var(--text); font-weight: 600; }
.blend-draw-ml { color: var(--text-muted); font-size: 13px; margin-left: 2px; }
.result-grid-inner { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 12px; margin-bottom: 16px; }

/* Info row below calculator */
.info-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 14px;
}
.info-tile {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
}
.info-tile-label { font-size: 12px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.info-tile-value { font-size: 12px; color: var(--text-muted); line-height: 1.55; }

/* ============================================================
   BLENDS + STACKS SHARED
   ============================================================ */
.stack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(370px, 1fr));
    gap: 20px;
}
.stack-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: border-color var(--ease), transform var(--ease), box-shadow var(--ease);
}
.stack-card:hover { border-color: var(--border-hi); transform: translateY(-2px); box-shadow: var(--shadow); }

.stack-badge {
    display: inline-flex;
    align-items: center;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    width: fit-content;
}
.badge-heal      { background: rgba(16,185,129,0.10);  color: #10b981; }
.badge-growth    { background: rgba(139,92,246,0.12);  color: #a78bfa; }
.badge-glow      { background: rgba(0,212,255,0.10);   color: #00d4ff; }
.badge-klow      { background: rgba(245,158,11,0.10);  color: #f59e0b; }
.badge-fat       { background: rgba(251,113,133,0.10); color: #fb7185; }
.badge-cognitive { background: rgba(99,179,237,0.12);  color: #63b3ed; }

/* === STACKS PAGE SPECIFIC === */

.stacks-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: rgba(245,158,11,0.05);
    border: 1px solid rgba(245,158,11,0.16);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    font-size: 13px;
    color: #9a7435;
    line-height: 1.6;
    margin-bottom: 40px;
}
.stacks-disclaimer svg { color: var(--amber); flex-shrink: 0; margin-top: 2px; }
.stacks-disclaimer strong { color: #c49a4a; }

.tier-section { margin-bottom: 52px; }

.tier-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 0;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
    transition: opacity var(--ease);
}
.tier-header:hover { opacity: 0.8; }

.tier-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    flex: 1;
}

.tier-chevron {
    flex-shrink: 0;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}
.tier-section.collapsed .tier-chevron { transform: rotate(-90deg); }

/* Accordion content — CSS grid collapse trick */
.tier-content {
    display: grid;
    grid-template-rows: 1fr;
    transition: grid-template-rows 0.32s ease;
}
.tier-section.collapsed .tier-content { grid-template-rows: 0fr; }

.tier-content-inner {
    overflow: hidden;
}
.tier-content-inner .stack-grid { padding-top: 20px; }

.tier-badge {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.9px;
    text-transform: uppercase;
    padding: 5px 14px;
    border-radius: var(--radius-pill);
    flex-shrink: 0;
}
.tier-beginner    { background: rgba(16,185,129,0.12);  color: #10b981;  border: 1px solid rgba(16,185,129,0.22); }
.tier-intermediate{ background: rgba(139,92,246,0.12);  color: #a78bfa;  border: 1px solid rgba(139,92,246,0.22); }
.tier-advanced    { background: rgba(251,113,133,0.10); color: #fb7185;  border: 1px solid rgba(251,113,133,0.22); }

.tier-desc {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 0.2px;
}

.stack-compound-names {
    font-size: 13px;
    font-weight: 700;
    color: var(--cyan);
    letter-spacing: 0.1px;
    margin-top: -6px;
    opacity: 0.9;
}

.stack-logic {
    background: rgba(255,255,255,0.025);
    border-left: 2px solid var(--cyan);
    border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
    padding: 12px 14px;
}
.stack-logic-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--cyan);
    margin-bottom: 6px;
}
.stack-logic-text {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.7;
}
.stack-logic-text strong { color: var(--text); font-weight: 600; }

button.compound-tag {
    cursor: pointer;
    font-family: var(--font);
    border: none;
    transition: background var(--ease), border-color var(--ease), color var(--ease);
}
button.compound-tag:hover {
    background: var(--cyan-dim);
    border-color: var(--cyan);
    color: var(--cyan);
}
/* Re-apply compound-tag border since button reset removes it */
button.compound-tag {
    border: 1px solid var(--border);
}

.stack-calc-hint {
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
    margin-top: -4px;
}

.stack-name { font-size: 21px; font-weight: 700; letter-spacing: -0.4px; color: var(--text); line-height: 1.2; }
.stack-desc { font-size: 13.5px; color: var(--text-dim); line-height: 1.7; }

.stack-compounds { display: flex; flex-wrap: wrap; gap: 7px; }
.compound-tag {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    padding: 4px 11px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
}
.compound-tag.muted { color: var(--text-muted); }

.stack-protocol {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 13px 15px;
}
.protocol-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 5px; }
.protocol-text { font-size: 13px; color: var(--text-dim); line-height: 1.65; }

.load-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--cyan);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    padding: 10px 14px;
    cursor: pointer;
    transition: all var(--ease);
    margin-top: auto;
    text-align: left;
}
.load-btn:hover { background: var(--cyan-dim); border-color: var(--cyan); }

.stack-info-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: var(--cyan-dim);
    border: 1px solid rgba(0,212,255,0.14);
    border-radius: var(--radius-sm);
    padding: 13px 17px;
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.6;
    margin-bottom: 26px;
}
.stack-info-banner svg { color: var(--cyan); margin-top: 2px; flex-shrink: 0; }
.stack-info-banner strong { color: var(--text); }

.coming-soon-card { opacity: 0.6; }

/* ============================================================
   REFERENCE TAB
   ============================================================ */
.ref-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    background: rgba(245,158,11,0.05);
    border: 1px solid rgba(245,158,11,0.15);
    border-radius: var(--radius-sm);
    padding: 13px 16px;
    font-size: 13px;
    color: #9a7435;
    line-height: 1.6;
    margin-bottom: 36px;
}
.ref-disclaimer svg { color: var(--amber); flex-shrink: 0; margin-top: 2px; }

.ref-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.ref-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
    margin-bottom: 36px;
}

.ref-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color var(--ease);
}
.ref-card:hover { border-color: var(--border-hi); }

.ref-card-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ref-name { font-size: 17px; font-weight: 700; color: var(--text); letter-spacing: -0.3px; }
.ref-badge { font-size: 10px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; padding: 3px 9px; border-radius: var(--radius-pill); white-space: nowrap; }

.ref-desc { font-size: 13px; color: var(--text-dim); line-height: 1.65; }

.ref-details {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.ref-detail-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 10px;
    padding: 9px 14px;
    border-bottom: 1px solid var(--border);
    align-items: start;
}
.ref-detail-row:last-child { border-bottom: none; }
.ref-detail-row:nth-child(even) { background: rgba(255,255,255,0.012); }

.ref-detail-label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; line-height: 1.6; }
.ref-detail-val { font-size: 12.5px; color: var(--text-dim); line-height: 1.6; }

/* ============================================================
   LEARN TAB
   ============================================================ */
.learn-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}
.learn-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px;
    transition: border-color var(--ease);
}
.learn-card:hover { border-color: var(--border-hi); }

.learn-icon {
    width: 40px; height: 40px;
    background: var(--cyan-dim);
    border: 1px solid rgba(0,212,255,0.13);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cyan);
    margin-bottom: 14px;
}
.learn-card h3 { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 9px; letter-spacing: -0.2px; }
.learn-card p { font-size: 13.5px; color: var(--text-dim); line-height: 1.75; }

.disclaimer-box {
    background: rgba(245,158,11,0.04);
    border: 1px solid rgba(245,158,11,0.16);
    border-radius: var(--radius-sm);
    padding: 18px 22px;
}
.disclaimer-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--amber);
    margin-bottom: 9px;
}
.disclaimer-box p { font-size: 13px; color: var(--text-muted); line-height: 1.65; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { border-top: 1px solid var(--border); padding: 20px 28px; }
.footer-inner {
    max-width: 1120px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}
.footer-brand { font-size: 13px; font-weight: 700; color: var(--text-muted); }
.footer-legal { font-size: 12px; color: var(--text-muted); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 720px) {
    .header-inner { height: auto; padding: 10px 16px; flex-direction: column; align-items: flex-start; gap: 10px; }
    .tab-nav { width: 100%; }
    .tab-btn { padding: 6px 10px; font-size: 12px; }
    .tab-pane { padding-top: 36px; }
    .calc-card { padding: 20px 16px; }
    .compound-row { grid-template-columns: 1fr; }
    .info-row { grid-template-columns: 1fr; }
    .stack-grid, .learn-grid, .ref-grid { grid-template-columns: 1fr; }
    .result-grid, .result-grid-inner { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
    .footer-inner { flex-direction: column; text-align: center; }
    .field.solo { max-width: 100%; }
    .ref-detail-row { grid-template-columns: 100px 1fr; }
}

@media (max-width: 480px) {
    .pill { padding: 7px 13px; font-size: 12px; }
    .container { padding: 0 14px; }
    .preset-btn { min-width: 0; }
}

/* === CALCULATOR ENHANCEMENTS === */

/* "Based on X mg vial and Y mL BAC water" under result header */
.result-based-on {
    font-size: 12.5px;
    color: var(--text-dim);
    margin: -4px 0 12px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--border);
    font-style: italic;
}
.result-based-on.hidden { display: none; }

/* Extra note inside BAC recommendation (e.g. GLOW/KLOW irritation note) */
.bac-rec-extra {
    margin-top: 6px;
    font-size: 12px;
    color: #cbb56f;
    font-weight: 400;
    font-style: italic;
    line-height: 1.45;
}

/* Anchor for the Typical Dosing hint that now sits BELOW Calculate */
.dose-hint-anchor:empty { display: none; }
.dose-hint-anchor { margin-top: 14px; }

/* Field recommendation (persistent hint text next to input) */
.field-recommendation,
.field-suggestion {
    margin-top: 8px;
    padding: 7px 12px;
    background: rgba(245, 158, 11, 0.08);
    border-left: 3px solid var(--amber);
    border-radius: var(--radius-xs);
    font-size: 13px;
    color: #fcd34d;
    font-weight: 500;
    line-height: 1.5;
    animation: suggestionFade 0.3s ease;
}
.field-recommendation strong { color: #fde68a; font-weight: 700; }
.field-rec-disclaimer { color: var(--text-dim); font-weight: 400; font-size: 12px; }
.field-recommendation.hidden,
.field-suggestion.hidden { display: none; }

@keyframes suggestionFade {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Syringe diagram */
.syringe-section {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}
.syringe-wrap {
    width: 100%;
}
.syringe-svg {
    width: 100%;
    height: auto;
    max-height: 120px;
    display: block;
}
.syringe-warning {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-xs);
    font-size: 13px;
    line-height: 1.45;
}
.syringe-warning--over {
    background: rgba(239, 68, 68, 0.10);
    border-left: 3px solid #ef4444;
    color: #fca5a5;
}
.syringe-warning--under {
    background: rgba(245, 158, 11, 0.10);
    border-left: 3px solid var(--amber);
    color: #fcd34d;
}

/* Vial duration line */
.vial-duration {
    margin-top: 12px;
}
.vial-duration-line {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    font-size: 13px;
    color: var(--text-dim);
}
.vial-duration-line svg { color: var(--cyan); flex-shrink: 0; }

/* Dose table ("Dosing at a Glance") */
.dose-table-wrap {
    margin-top: 18px;
    padding: 20px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.dose-table-wrap.hidden { display: none; }
.dose-table-fadein { animation: doseTableFade 0.4s ease; }
@keyframes doseTableFade {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.dose-table-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 6px;
}
.dose-table-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}
.dose-table-sub {
    font-size: 12px;
    color: var(--text-dim);
}
.dose-table-grid {
    display: grid;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    overflow: hidden;
}
.dtg-cell {
    padding: 8px 10px;
    font-size: 13px;
    color: var(--text);
    text-align: center;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    background: var(--surface);
}
.dtg-cell:last-child { border-right: none; }
.dose-table-grid > .dtg-cell:nth-last-child(-n+1),
.dose-table-grid > .dtg-cell:nth-last-child(-n+2),
.dose-table-grid > .dtg-cell:nth-last-child(-n+3),
.dose-table-grid > .dtg-cell:nth-last-child(-n+4) {
    /* last row uses dtg-row-active only when applicable */
}
.dtg-head {
    background: var(--bg);
    color: var(--text-dim);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.dtg-units-col { font-weight: 600; color: var(--cyan); }
.dtg-head.dtg-units-col { color: var(--text-dim); }
.dtg-row-active {
    background: var(--cyan-dim) !important;
    color: var(--cyan);
    font-weight: 600;
}

/* Blend mode toggle */
.blend-mode-toggle {
    display: inline-flex;
    margin-bottom: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 3px;
    gap: 2px;
}
.blend-mode-btn {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-dim);
    background: transparent;
    border: none;
    border-radius: var(--radius-pill);
    cursor: pointer;
    font-family: var(--font);
    transition: all var(--ease);
}
.blend-mode-btn:hover { color: var(--text); }
.blend-mode-btn.active {
    background: var(--gradient);
    color: #fff;
}

/* Next Steps accordion */
.next-steps-wrap {
    margin-top: 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.next-steps-wrap.hidden { display: none; }
.next-steps-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: transparent;
    border: none;
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
}
.next-steps-toggle:hover { background: var(--surface); }
.next-steps-chevron {
    color: var(--text-dim);
    transition: transform var(--ease);
}
.next-steps-body {
    padding: 4px 20px 20px;
    border-top: 1px solid var(--border);
}
.next-steps-section {
    margin-top: 14px;
}
.next-steps-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--cyan);
    margin-bottom: 4px;
    letter-spacing: 0.02em;
}
.next-steps-section p {
    font-size: 13.5px;
    color: var(--text-dim);
    line-height: 1.6;
    margin-bottom: 6px;
}
.next-steps-always-show {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    font-size: 12.5px;
    color: var(--text-dim);
    cursor: pointer;
    user-select: none;
}
.next-steps-always-show input { accent-color: var(--cyan); cursor: pointer; }

@media (max-width: 720px) {
    .dtg-cell { padding: 6px 5px; font-size: 12px; }
    .dtg-head { font-size: 10px; }
    .dose-table-wrap { padding: 14px; }
    .next-steps-toggle { padding: 12px 16px; }
    .next-steps-body { padding: 4px 16px 16px; }
}

/* === NOVA AI PANEL === */
#chatbase-bubble-button { display: none !important; }

#nova-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.25s ease;
}
#nova-overlay.active { opacity: 1; }

#nova-panel {
    position: fixed;
    bottom: 100px;
    right: 22px;
    width: 380px;
    height: 560px;
    max-height: calc(100vh - 140px);
    background: var(--surface, #0c0f1a);
    border: 1px solid var(--border, #1b2035);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(0, 212, 255, 0.08);
    z-index: 999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(16px) scale(0.98);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.25s ease;
}
#nova-panel.open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}
#nova-panel.minimized {
    transform: translateY(16px) scale(0.98);
    opacity: 0;
    pointer-events: none;
}

#nova-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--surface-2, #101522);
    border-bottom: 1px solid var(--border, #1b2035);
    flex-shrink: 0;
}
#nova-panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
}
#nova-header-logo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
#nova-panel-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text, #fff);
    line-height: 1.2;
}
#nova-panel-subtitle {
    font-size: 11.5px;
    color: var(--text-muted, #9aa3b2);
    line-height: 1.2;
    margin-top: 2px;
}
#nova-panel-controls {
    display: flex;
    gap: 4px;
}
#nova-panel-controls button {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--text-muted, #9aa3b2);
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
#nova-panel-controls button:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text, #fff);
    border-color: var(--border, #1b2035);
}

#nova-iframe {
    flex: 1;
    width: 100%;
    border: 0;
    background: #fff;
}

#nova-launcher {
    position: fixed;
    bottom: 22px;
    right: 22px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--surface-2, #101522);
    border: 1px solid var(--border, #1b2035);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 212, 255, 0.1);
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#nova-launcher:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 212, 255, 0.25), 0 0 0 1px rgba(0, 212, 255, 0.2);
}
#nova-launcher-logo {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    transition: transform 0.2s ease;
}
#nova-launcher:hover #nova-launcher-logo {
    transform: scale(1.05);
}

#nova-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    right: 0;
    padding: 8px 12px;
    background: var(--surface-2, #101522);
    color: var(--text, #fff);
    border: 1px solid var(--border, #1b2035);
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    font-size: 12.5px;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
#nova-launcher:hover #nova-tooltip {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 600px) {
    #nova-panel {
        right: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        height: 75vh;
        max-height: 75vh;
        border-radius: 16px 16px 0 0;
        border-left: 0;
        border-right: 0;
        border-bottom: 0;
    }
    #nova-launcher {
        width: 54px;
        height: 54px;
        bottom: 18px;
        right: 18px;
    }
    #nova-launcher-logo { width: 40px; height: 40px; }
}

/* === Hero "use Nova AI" inline button === */
.hero-nova-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
    flex-wrap: nowrap;
    white-space: nowrap;
}
.hero-or {
    color: var(--text-muted);
    font-size: 0.95em;
}
.hero-nova-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-family: var(--font);
    font-size: 0.95em;
    font-weight: 600;
    color: #fff;
    background: var(--gradient);
    border: none;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 2px 8px rgba(0, 212, 255, 0.25);
}
.hero-nova-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 212, 255, 0.4);
}

/* === Learn sub-tabs === */
.learn-subtabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 0 auto 32px;
    padding: 6px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    max-width: max-content;
}
.learn-subtab {
    padding: 10px 20px;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
    white-space: nowrap;
}
.learn-subtab:hover { color: var(--text); }
.learn-subtab.active {
    color: #fff;
    background: var(--gradient);
    box-shadow: 0 2px 10px rgba(0, 212, 255, 0.3);
}

.learn-subpane { display: none; }
.learn-subpane.active { display: block; }

/* === Peptide Library === */
.library-intro {
    max-width: 640px;
    margin: 0 auto 36px;
    text-align: center;
    color: var(--text-dim);
    font-size: 15px;
    line-height: 1.55;
}

.library-category {
    margin-bottom: 44px;
}

.library-cat-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.2px;
    color: var(--text);
    margin: 0 0 18px;
    padding: 0 4px;
}

.library-cat-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 12px currentColor;
}

.library-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.lib-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.lib-card[open] {
    border-color: rgba(0, 212, 255, 0.25);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.lib-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: background 0.15s ease;
}
.lib-summary::-webkit-details-marker { display: none; }
.lib-summary:hover { background: rgba(255, 255, 255, 0.02); }

.lib-summary-main {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.lib-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.2px;
}

.lib-tagline {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.lib-chevron {
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform 0.25s ease, color 0.15s ease;
}
.lib-card[open] .lib-chevron {
    transform: rotate(180deg);
    color: var(--cyan);
}

.lib-body {
    padding: 4px 20px 22px;
    border-top: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.12);
}

.lib-section {
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}
.lib-section:last-child { border-bottom: none; }

.lib-section-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--cyan);
    margin-bottom: 8px;
}

.lib-section p {
    font-size: 14.5px;
    line-height: 1.65;
    color: var(--text-dim);
    margin: 0 0 10px;
}
.lib-section p:last-child { margin-bottom: 0; }

.lib-section p strong {
    color: var(--text);
    font-weight: 600;
}

.lib-warn-pill {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-pill);
    vertical-align: middle;
}

.lib-warn-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 16px 0 4px;
    padding: 12px 14px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: var(--radius-sm);
    color: #f59e0b;
    font-size: 13.5px;
    line-height: 1.55;
}
.lib-warn-banner svg { flex-shrink: 0; margin-top: 2px; }
.lib-warn-banner strong { color: #fbbf24; }

@media (max-width: 600px) {
    .learn-subtabs { max-width: 100%; }
    .learn-subtab { padding: 9px 14px; font-size: 13px; }
    .lib-summary { padding: 16px; }
    .lib-name { font-size: 15px; }
    .lib-tagline { font-size: 12.5px; }
    .lib-body { padding: 4px 16px 18px; }
    .library-cat-title { font-size: 16px; }
}
