:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-soft: #eef3f8;
  --ink: #121a27;
  --muted: #647184;
  --line: #dde4ec;
  --accent: #5b57f4;
  --accent-dark: #4642d5;
  --accent-soft: #ecebff;
  --success: #159a68;
  --success-soft: #e8f7f1;
  --shadow: 0 18px 50px rgba(19, 30, 52, 0.10);
  --shadow-soft: 0 8px 24px rgba(19, 30, 52, 0.07);
  --radius: 20px;
  --max: 1160px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); line-height: 1.55; }
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.container { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; }

.site-header { position: sticky; top: 0; z-index: 30; background: rgba(246,248,251,.9); backdrop-filter: blur(14px); border-bottom: 1px solid rgba(221,228,236,.8); }
.nav-wrap { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 800; letter-spacing: -.02em; }
.brand-mark { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, #6c67ff, #8a87ff); position: relative; box-shadow: 0 6px 15px rgba(91,87,244,.24); overflow: hidden; }
.brand-mark span { position: absolute; left: 6px; right: 6px; height: 4px; border-radius: 6px; background: #fff; transform: rotate(-27deg); }
.brand-mark span:nth-child(1){ top: 9px; }
.brand-mark span:nth-child(2){ top: 15px; opacity: .84; }
.brand-mark span:nth-child(3){ top: 21px; opacity: .68; }
.main-nav { display: flex; gap: 26px; color: #526072; font-size: 14px; font-weight: 700; }
.main-nav a:hover { color: var(--ink); }

.hero { padding: 72px 0 44px; background: radial-gradient(circle at 82% 35%, rgba(91,87,244,.13), transparent 32%), linear-gradient(180deg,#fbfcfe 0%, #f6f8fb 100%); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(340px, .8fr); gap: 72px; align-items: center; }
.eyebrow, .section-kicker { color: var(--accent); font-size: 12px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.eyebrow { display: inline-flex; gap: 9px; align-items: center; margin-bottom: 18px; }
.eyebrow-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 6px rgba(91,87,244,.12); }
.hero h1 { margin: 0; font-size: clamp(44px, 6vw, 75px); line-height: .99; letter-spacing: -.06em; max-width: 760px; }
.hero h1 span { color: var(--accent); }
.hero-text { max-width: 690px; margin: 24px 0 0; font-size: 19px; color: var(--muted); }
.hero-points { display: flex; flex-wrap: wrap; gap: 16px 22px; margin-top: 26px; color: #4e5b6d; font-size: 14px; font-weight: 700; }
.hero-points > div { display: flex; align-items: center; gap: 8px; }
.check { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: var(--success); background: var(--success-soft); font-size: 12px; }
.hero-card { background: #111827; color: #fff; border-radius: 26px; padding: 28px; box-shadow: 0 24px 80px rgba(16,24,39,.28); position: relative; overflow: hidden; }
.hero-card::after { content: ""; position: absolute; width: 180px; height: 180px; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; right: -40px; bottom: -48px; }
.mini-card-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.mini-label, .remaining-label { display: block; font-size: 10px; letter-spacing: .14em; font-weight: 800; color: #9aa6b8; }
.mini-card-head strong { display: block; margin-top: 4px; font-size: 18px; }
.status-pill { font-size: 10px; padding: 7px 10px; border: 1px solid rgba(255,255,255,.13); border-radius: 999px; color: #b9f2d9; background: rgba(21,154,104,.12); font-weight: 800; }
.mini-value { font-size: 58px; font-weight: 850; letter-spacing: -.05em; margin-top: 36px; }
.mini-value small { color: #9aa6b8; font-size: 19px; font-weight: 700; letter-spacing: 0; }
.mini-bar, .progress-track { height: 9px; border-radius: 99px; background: rgba(255,255,255,.09); overflow: hidden; }
.mini-bar { margin: 20px 0 28px; }
.mini-bar span { display:block; height:100%; border-radius:inherit; background: linear-gradient(90deg,#8a87ff,#68d9ae); }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.mini-stats div { padding-top: 16px; border-top: 1px solid rgba(255,255,255,.09); }
.mini-stats span { display:block; color:#9aa6b8; font-size:11px; }
.mini-stats b { display:block; margin-top:3px; font-size:14px; }

.ad-wrap { display: flex; justify-content: center; }
.ad-placeholder { width: 100%; min-height: 76px; border: 1px dashed #cad2dc; border-radius: 14px; display: grid; place-items: center; color: #98a4b4; font-size: 10px; letter-spacing: .16em; font-weight: 800; background: rgba(255,255,255,.35); }
.top-ad { padding: 18px 0 8px; }
.mid-ad { margin-top: 52px; }
.bottom-ad { margin-top: 68px; padding-bottom: 18px; }
.bottom-ad .ad-placeholder { min-height: 120px; }

.calculator-section { padding-top: 72px; }
.section-heading { max-width: 720px; }
.center-heading { margin: 0 auto 28px; text-align: center; }
.section-heading h2 { margin: 10px 0 10px; font-size: clamp(31px, 4vw, 48px); line-height: 1.06; letter-spacing: -.045em; }
.section-heading p { margin: 0; color: var(--muted); font-size: 16px; }
.calculator-shell { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(340px, .88fr); background: var(--surface); border: 1px solid var(--line); border-radius: 28px; overflow: hidden; box-shadow: var(--shadow); }
.form-pane { padding: 36px; }
.results-pane { background: linear-gradient(180deg,#121927 0%, #0f1520 100%); color: #fff; padding: 34px; min-height: 100%; position: relative; }
.form-topline, .section-minihead, .results-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.form-topline h3, .section-minihead h3, .results-head h3 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.form-topline p, .section-minihead p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.link-button { border: 0; background: transparent; color: var(--accent); font-size: 13px; font-weight: 800; padding: 5px 0; }
.field-grid { display: grid; gap: 14px; margin-top: 20px; }
.two-col { grid-template-columns: 1fr 1fr; }
.three-col { grid-template-columns: repeat(3, 1fr); }
.one-col { grid-template-columns: 1fr; }
.field { display: grid; gap: 8px; }
.field span { font-size: 12px; font-weight: 800; color: #4c5869; }
.field em { color: #8a95a4; font-style: normal; font-weight: 600; }
.field input, .field select { width: 100%; height: 49px; padding: 0 14px; border: 1px solid #d6dee8; border-radius: 12px; background: #fbfcfe; color: var(--ink); outline: none; transition: .18s ease; }
.field input:focus, .field select:focus { border-color: rgba(91,87,244,.7); box-shadow: 0 0 0 4px rgba(91,87,244,.10); background:#fff; }
.form-divider { height:1px; background: var(--line); margin: 26px 0; }
.direct-mode-wrap { margin-top: 22px; border: 1px solid var(--line); border-radius: 15px; overflow: hidden; }
.secondary-toggle { width: 100%; display:flex; justify-content:space-between; align-items:center; gap:16px; padding: 15px 16px; border: 0; background: #f8fafc; color: #3f4b5c; font-weight: 800; text-align: left; }
.toggle-arrow { font-size: 22px; color: var(--accent); line-height:1; transition: transform .18s ease; }
.secondary-toggle[aria-expanded="true"] .toggle-arrow { transform: rotate(45deg); }
.direct-mode { padding: 16px; background: #fff; }
.direct-mode p { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.primary-button { width:100%; margin-top: 24px; border:0; border-radius: 14px; height: 56px; display:flex; align-items:center; justify-content:space-between; padding: 0 18px 0 20px; background: linear-gradient(135deg,var(--accent),#7a75ff); color:#fff; font-weight:850; box-shadow: 0 14px 30px rgba(91,87,244,.25); transition: transform .18s ease, box-shadow .18s ease; }
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 18px 34px rgba(91,87,244,.31); }
.primary-button:active { transform: translateY(0); }
.privacy-note { display:flex; justify-content:center; gap:7px; margin: 13px 0 0; color:#8994a2; font-size:11px; }
.form-error { margin-top: 14px; border-radius: 12px; padding: 12px 14px; background: #fff0ef; border: 1px solid #f3cbc7; color:#a63d35; font-size: 13px; font-weight: 700; }
.hidden { display: none !important; }

.results-empty { min-height: 100%; display:flex; flex-direction:column; justify-content:center; align-items:center; text-align:center; padding: 50px 24px; }
.spool-illustration { width: 110px; height:110px; border-radius:50%; border: 12px solid rgba(255,255,255,.09); position:relative; margin-bottom: 22px; box-shadow: inset 0 0 0 16px rgba(255,255,255,.035); }
.spool-illustration::before, .spool-illustration::after { content:""; position:absolute; border-radius:50%; }
.spool-illustration::before { inset:23px; border:9px solid rgba(138,135,255,.55); }
.spool-illustration::after { width:26px;height:26px;left:30px;top:30px;background:#111827;border:4px solid rgba(255,255,255,.13); }
.results-empty h3 { margin:0; font-size: 23px; }
.results-empty p { max-width: 290px; margin: 9px 0 0; color:#98a5b7; font-size: 14px; }
.results-head h3 { margin-top:5px; color:#fff; }
.copy-button { border:1px solid rgba(255,255,255,.14); background:rgba(255,255,255,.04); color:#d6dde8; border-radius:10px; height:38px; padding:0 12px; font-size:12px; font-weight:800; }
.copy-button:hover { background:rgba(255,255,255,.08); }
.remaining-hero { margin-top: 28px; display:flex; align-items:end; justify-content:space-between; gap:18px; }
.remaining-number { margin-top:3px; font-size: 62px; line-height: .95; letter-spacing:-.06em; font-weight: 900; }
.remaining-number small { margin-left:8px; font-size:17px; letter-spacing:0; color:#a8b3c4; }
.percent-circle { width:78px; height:78px; border-radius:50%; display:grid; place-items:center; border:5px solid rgba(255,255,255,.08); background: radial-gradient(circle at center, #121927 58%, transparent 59%), conic-gradient(#72e0b8 0 32.7%, rgba(255,255,255,.11) 32.7% 100%); font-weight:850; font-size:12px; }
.progress-track { margin-top: 22px; background: rgba(255,255,255,.08); }
.progress-track span { display:block; height:100%; width:0; border-radius:inherit; background:linear-gradient(90deg,#8a87ff,#68d9ae); transition:width .45s ease; }
.result-grid { display:grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.result-card { border:1px solid rgba(255,255,255,.08); background:rgba(255,255,255,.045); border-radius:15px; padding:15px; min-height: 108px; }
.result-card span { display:block; font-size:11px; color:#8d99ab; }
.result-card strong { display:block; margin-top:6px; color:#fff; font-size:20px; letter-spacing:-.03em; }
.result-card small { display:block; margin-top:2px; color:#a5b1c0; font-size:11px; }
.accuracy-note { margin-top: 14px; border:1px solid rgba(255,255,255,.08); border-radius: 14px; padding: 13px; display:flex; gap:10px; color:#a5b1c0; font-size: 11px; line-height:1.45; }
.accuracy-note strong { color:#fff; }
.info-icon { flex:0 0 18px; width:18px; height:18px; border-radius:50%; display:grid; place-items:center; font-weight:900; font-size:11px; color:#c4c0ff; background:rgba(91,87,244,.25); }
.copy-confirm { position:absolute; right: 34px; top: 84px; background:#fff; color:#182232; padding:8px 11px; border-radius:9px; font-size:11px; font-weight:850; box-shadow: 0 10px 25px rgba(0,0,0,.18); }

.info-section { margin-top: 82px; padding: 82px 0; background:#eef2f7; }
.steps-grid { margin-top:34px; display:grid; grid-template-columns: repeat(3,1fr); gap:18px; }
.step-card { background:#fff; border:1px solid var(--line); border-radius:18px; padding:25px; box-shadow: var(--shadow-soft); }
.step-number { color:var(--accent); font-weight:900; letter-spacing:.08em; font-size:12px; }
.step-card h3 { margin:9px 0 7px; font-size:20px; }
.step-card p { margin:0; color:var(--muted); font-size:14px; }

.content-section { padding-top:82px; }
.content-layout { display:grid; grid-template-columns:minmax(0,1fr) 330px; gap:60px; align-items:start; }
.article-copy { max-width:740px; }
.article-copy h2 { margin: 34px 0 11px; font-size:31px; line-height:1.08; letter-spacing:-.04em; }
.article-copy h2:first-of-type { margin-top:10px; }
.article-copy p { color:#5c697a; font-size:16px; }
.formula-box { margin: 25px 0; display:flex; flex-wrap:wrap; align-items:center; gap:11px; padding:18px; border:1px solid var(--line); border-radius:16px; background:#fff; font-size:14px; }
.formula-box span, .formula-box strong { padding:10px 12px; border-radius:10px; background:#f2f5f8; }
.formula-box b { color:#8490a0; }
.sidebar-card { position:sticky; top:100px; background:#111827; color:#fff; border-radius:20px; padding:24px; box-shadow:var(--shadow); }
.sidebar-icon { width:42px; height:42px; display:grid; place-items:center; border-radius:13px; background:rgba(138,135,255,.16); color:#aca9ff; font-size:24px; }
.sidebar-card h3 { margin:16px 0 8px; font-size:22px; letter-spacing:-.03em; }
.sidebar-card p { margin:0; color:#a5b1c0; font-size:14px; }
.text-link { display:inline-block; margin-top:18px; color:#c1beff; font-weight:850; font-size:13px; }

.faq-section { margin-top: 86px; padding:84px 0; background:#fff; border-top:1px solid var(--line); }
.faq-wrap { max-width: 900px; }
.faq-list { margin-top:34px; border-top:1px solid var(--line); }
details { border-bottom:1px solid var(--line); }
summary { list-style:none; cursor:pointer; padding:20px 0; font-size:16px; font-weight:800; display:flex; align-items:center; justify-content:space-between; gap:22px; }
summary::-webkit-details-marker { display:none; }
summary::after { content:'+'; font-size:24px; font-weight:400; color:#8894a3; }
details[open] summary::after { content:'−'; }
details p { margin: -4px 0 20px; max-width:760px; color:var(--muted); font-size:14px; }

.site-footer { margin-top: 80px; padding:42px 0 24px; background:#0f1520; color:#fff; }
.footer-grid { display:flex; justify-content:space-between; align-items:flex-start; gap:30px; }
.footer-brand { color:#fff; }
.site-footer p { margin:10px 0 0; color:#8d9aab; font-size:13px; }
.footer-links { display:flex; flex-wrap:wrap; gap:22px; color:#b5bfcc; font-size:13px; font-weight:700; }
.footer-links a:hover { color:#fff; }
.footer-bottom { margin-top:28px; padding-top:18px; border-top:1px solid rgba(255,255,255,.08); display:flex; justify-content:space-between; gap:20px; color:#718093; font-size:11px; }

.simple-page { min-height: 65vh; padding: 72px 0; }
.simple-page .content { max-width: 780px; }
.simple-page h1 { margin:0 0 12px; font-size:clamp(40px,5vw,58px); line-height:1; letter-spacing:-.055em; }
.simple-page .lead { color:var(--muted); font-size:18px; }
.simple-page h2 { margin:40px 0 10px; font-size:28px; letter-spacing:-.03em; }
.simple-page p, .simple-page li { color:#5c697a; font-size:16px; }
.simple-page a { color:var(--accent); font-weight:800; }

@media (max-width: 1179px) {
  main { padding-left: 0; padding-right: 0; }
}

@media (max-width: 980px) {
  .hero-grid, .calculator-shell, .content-layout { grid-template-columns: 1fr; }
  .hero-grid { gap: 35px; }
  .hero-card { max-width: 620px; width:100%; }
  .sidebar-card { position:static; max-width:620px; }
  .results-pane { min-height: 560px; }
}
@media (max-width: 720px) {
  .container { width:min(var(--max), calc(100% - 28px)); }
  .main-nav { display:none; }
  .hero { padding-top:46px; }
  .hero h1 { font-size:clamp(40px,13vw,62px); }
  .hero-text { font-size:17px; }
  .hero-points { display:grid; grid-template-columns:1fr; gap:10px; }
  .form-pane, .results-pane { padding:22px; }
  .two-col, .three-col, .steps-grid { grid-template-columns:1fr; }
  .calculator-shell { border-radius:22px; }
  .result-grid { grid-template-columns:1fr; }
  .remaining-number { font-size:52px; }
  .content-layout { gap:35px; }
  .formula-box { align-items:stretch; flex-direction:column; }
  .footer-grid, .footer-bottom { flex-direction:column; }
  .footer-links { gap:14px 18px; }
}

/* Desktop side-rail ad space. These are intentionally outside the main content column
   so Google AdSense Auto ads can use the open left/right viewport areas without
   crowding the calculator or inventory. The rails are only shown on sufficiently
   wide screens; tablets and phones stay clean and single-column. */
.desktop-rail {
  display: none;
}

/* Desktop side-rail layout for Google AdSense Auto ads.
   On wide desktop screens we reserve a true three-column layout:
   left ad rail + centered site content + right ad rail.
   The rails disappear below 1540px so the calculator remains comfortable on smaller screens. */
@media (min-width: 1540px) {
  main {
    position: relative;
    padding-left: 220px;
    padding-right: 220px;
  }
  .desktop-rail {
    display: flex;
    position: absolute;
    top: 116px;
    width: 220px;
    min-height: 920px;
    z-index: 2;
    pointer-events: none;
    align-items: flex-start;
    justify-content: center;
  }
  .rail-left { left: 0; }
  .rail-right { right: 0; }
  .rail-ad-placeholder {
    width: 200px;
    min-height: 600px;
    border: 1px dashed #cfd8e3;
    border-radius: 14px;
    display: grid;
    place-items: center;
    color: #9aa6b5;
    font-size: 9px;
    letter-spacing: .16em;
    font-weight: 800;
    background: rgba(255,255,255,.78);
    box-shadow: 0 10px 26px rgba(19,30,52,.04);
  }
}

@media (min-width: 1800px) {
  main {
    padding-left: 240px;
    padding-right: 240px;
  }
  .desktop-rail {
    width: 240px;
  }
  .rail-left { left: 0; }
  .rail-right { right: 0; }
  .rail-ad-placeholder { width: 220px; }
}

/* Ultimate tracker additions */
.hero-actions { display:flex; flex-wrap:wrap; gap:12px; margin-top:30px; align-items:center; }
.hero-button { width:auto; min-width:180px; margin-top:0; text-decoration:none; }
.ghost-button { height:56px; display:inline-flex; align-items:center; justify-content:center; padding:0 20px; border-radius:14px; border:1px solid var(--line); background:#fff; color:#334055; font-weight:850; box-shadow: var(--shadow-soft); }
.ghost-button:hover { border-color:#bcc6d3; transform:translateY(-1px); }
.hero-card-foot { margin-top:20px; padding-top:16px; border-top:1px solid rgba(255,255,255,.09); color:#9aa6b8; font-size:11px; display:flex; align-items:center; gap:7px; }
.status-dot { width:8px; height:8px; border-radius:50%; display:inline-block; flex:0 0 8px; }
.status-dot.green { background:#67ddb1; box-shadow:0 0 0 4px rgba(103,221,177,.10); }
.status-dot.amber { background:#f2be5d; box-shadow:0 0 0 4px rgba(242,190,93,.10); }
.status-dot.red { background:#ef766d; box-shadow:0 0 0 4px rgba(239,118,109,.10); }
.inventory-section { padding-top:84px; }
.inventory-heading { display:flex; justify-content:space-between; gap:30px; align-items:end; max-width:none; }
.inventory-heading h2 { margin-bottom:8px; }
.inventory-actions-top { display:flex; flex-wrap:wrap; gap:9px; justify-content:flex-end; }
.small-button { width:auto; min-width:130px; height:46px; padding:0 16px; margin-top:0; }
.secondary-outline-button, .filter-status, .save-button, .outline-button { height:44px; padding:0 14px; border-radius:11px; border:1px solid var(--line); background:#fff; color:#4a5769; font-size:12px; font-weight:850; display:inline-flex; align-items:center; justify-content:center; }
.secondary-outline-button:hover, .filter-status:hover, .outline-button:hover { border-color:#bcc6d3; background:#fbfcfe; }
.file-button { cursor:pointer; }
.file-button input { display:none; }
.inventory-summary { display:grid; grid-template-columns:repeat(5,1fr); gap:12px; margin-top:28px; }
.summary-card { background:#fff; border:1px solid var(--line); border-radius:17px; padding:18px; box-shadow:var(--shadow-soft); }
.summary-card span { display:block; color:#778496; font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.08em; }
.summary-card strong { display:block; margin-top:7px; font-size:26px; letter-spacing:-.04em; }
.summary-card small { display:block; margin-top:2px; color:#8b96a5; font-size:11px; }
.inventory-toolbar { display:flex; justify-content:space-between; gap:14px; margin:22px 0 18px; padding:12px; border:1px solid var(--line); border-radius:16px; background:#f9fbfd; }
.search-wrap { flex:1 1 auto; position:relative; max-width:620px; }
.search-wrap > span { position:absolute; left:13px; top:8px; color:#8e9aaa; font-size:20px; pointer-events:none; }
.search-wrap input { width:100%; height:42px; padding:0 14px 0 36px; border:1px solid #d6dee8; border-radius:11px; background:#fff; outline:none; }
.search-wrap input:focus { border-color:rgba(91,87,244,.7); box-shadow:0 0 0 4px rgba(91,87,244,.10); }
.filter-wrap { display:flex; gap:8px; align-items:center; }
.filter-wrap select { height:42px; min-width:160px; padding:0 12px; border:1px solid #d6dee8; border-radius:11px; background:#fff; color:#465367; font-weight:700; }
.filter-status[aria-pressed="true"], .filter-status.active { border-color:#eccd8a; background:#fff8e7; color:#9a6c14; }
.inventory-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.spool-card { background:#fff; border:1px solid var(--line); border-radius:20px; padding:22px; box-shadow:var(--shadow-soft); }
.spool-card-head { display:flex; justify-content:space-between; gap:18px; align-items:flex-start; }
.spool-material-label { color:#7c8796; font-size:10px; font-weight:850; letter-spacing:.09em; text-transform:uppercase; }
.spool-card h3 { margin:5px 0 0; font-size:21px; letter-spacing:-.03em; }
.dot-sep { color:#a5afbb; padding:0 5px; }
.spool-meta { min-height:18px; margin-top:5px; color:#7b8797; font-size:11px; }
.status-badge { display:inline-flex; align-items:center; gap:7px; border-radius:999px; padding:7px 9px; white-space:nowrap; font-size:10px; font-weight:850; }
.status-badge.green { background:#eaf8f2; color:#167654; }
.status-badge.amber { background:#fff6df; color:#976d17; }
.status-badge.red { background:#fff0ee; color:#a2453d; }
.spool-progress-wrap { display:grid; grid-template-columns:1fr auto; align-items:center; gap:11px; margin-top:18px; }
.spool-progress { height:8px; border-radius:99px; background:#eef2f6; overflow:hidden; }
.spool-progress span { height:100%; display:block; border-radius:inherit; background:linear-gradient(90deg,#7a76ff,#64d7aa); }
.spool-progress-wrap > strong { font-size:11px; color:#647184; }
.spool-primary { display:grid; grid-template-columns:1fr 1.25fr; gap:12px; margin-top:18px; padding-top:18px; border-top:1px solid #edf1f4; }
.spool-primary span, .spool-stat-grid span { display:block; color:#8a95a4; font-size:10px; text-transform:uppercase; letter-spacing:.08em; font-weight:800; }
.spool-primary strong { display:block; margin-top:5px; font-size:21px; letter-spacing:-.04em; }
.spool-stat-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-top:15px; }
.spool-stat-grid > div { padding:12px; background:#f7f9fb; border-radius:12px; }
.spool-stat-grid strong { display:block; margin-top:4px; font-size:14px; }
.spool-card-actions { display:flex; gap:8px; margin-top:16px; padding-top:15px; border-top:1px solid #edf1f4; }
.spool-card-actions button { border:0; background:transparent; color:#5f6b7c; font-size:12px; font-weight:850; padding:0; }
.spool-card-actions button:hover { color:var(--accent); }
.spool-card-actions .danger-action:hover { color:#b24e46; }
.no-match { grid-column:1/-1; padding:50px 20px; text-align:center; border:1px dashed #cbd4df; border-radius:18px; color:#718094; }
.no-match h3 { margin:0 0 4px; color:#263246; }
.no-match p { margin:0; font-size:13px; }
.inventory-empty { padding:58px 20px; text-align:center; border:1px dashed #cbd4df; border-radius:20px; background:rgba(255,255,255,.55); }
.empty-icon { width:58px; height:58px; margin:0 auto 14px; border-radius:18px; display:grid; place-items:center; background:#ecebff; color:var(--accent); font-size:32px; }
.inventory-empty h3 { margin:0; font-size:22px; }
.inventory-empty p { max-width:460px; margin:7px auto 18px; color:var(--muted); font-size:14px; }
.inventory-note { margin:18px 2px 0; color:#7d8997; font-size:11px; }
.inventory-note strong { color:#4a5668; }
.result-actions { display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:7px; position:relative; }
.save-button { border-color:rgba(103,221,177,.25); background:rgba(103,221,177,.10); color:#bdf1dc; }
.save-button:hover { background:rgba(103,221,177,.15); }
.result-footer-actions { display:flex; flex-wrap:wrap; align-items:center; gap:12px; margin-top:16px; }
.outline-button { border-color:rgba(255,255,255,.14); background:transparent; color:#e0e6ee; }
.outline-button:hover { background:rgba(255,255,255,.06); border-color:rgba(255,255,255,.22); }
.light-link { margin-top:0; color:#aaa7ff; }
.muted-result { color:#6f7a8d; }
.spool-dialog { border:0; padding:0; max-width:min(760px, calc(100% - 28px)); width:760px; border-radius:24px; background:transparent; box-shadow:0 30px 100px rgba(15,21,32,.35); }
.spool-dialog::backdrop { background:rgba(12,18,28,.58); backdrop-filter:blur(4px); }
.spool-dialog-card { background:#fff; border:1px solid var(--line); border-radius:24px; padding:26px; box-shadow:var(--shadow); }
.dialog-head { display:flex; justify-content:space-between; gap:18px; align-items:flex-start; }
.dialog-head h2 { margin:7px 0 4px; font-size:29px; letter-spacing:-.04em; }
.dialog-head p { margin:0; color:var(--muted); font-size:13px; }
.icon-close { border:0; width:38px; height:38px; border-radius:10px; background:#f2f5f8; color:#667386; font-size:24px; line-height:1; }
.dialog-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-top:22px; }
.dialog-actions { display:flex; justify-content:flex-end; gap:9px; margin-top:20px; }
.dialog-error { margin-top:14px; border-radius:12px; padding:11px 13px; background:#fff0ef; border:1px solid #f3cbc7; color:#a63d35; font-size:12px; font-weight:700; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.compact-gap { margin-top:12px; }

@media (max-width: 980px) {
  .inventory-heading { display:block; }
  .inventory-actions-top { margin-top:18px; justify-content:flex-start; }
  .inventory-summary { grid-template-columns:repeat(3,1fr); }
  .inventory-grid { grid-template-columns:1fr; }
}
@media (max-width: 720px) {
  .hero-actions { display:grid; grid-template-columns:1fr; }
  .hero-button, .ghost-button { width:100%; }
  .inventory-summary { grid-template-columns:1fr 1fr; }
  .inventory-toolbar { flex-direction:column; }
  .search-wrap { max-width:none; }
  .filter-wrap { display:grid; grid-template-columns:1fr 1fr; }
  .filter-wrap select { min-width:0; width:100%; }
  .inventory-actions-top { display:grid; grid-template-columns:1fr 1fr; }
  .inventory-actions-top .small-button { grid-column:1/-1; width:100%; }
  .dialog-grid { grid-template-columns:1fr; }
  .spool-dialog-card { padding:20px; }
  .spool-primary { grid-template-columns:1fr; }
  .spool-stat-grid { grid-template-columns:1fr 1fr; }
  .result-actions { justify-content:flex-start; margin-top:10px; }
}

/* FINAL DESKTOP SIDE-RAIL LAYOUT v4
   Uses a real 3-column grid so the ad rails reserve physical page space
   instead of sitting on top of the main content. */
@media (min-width: 1520px) {
  body { overflow-x: hidden; }
  main {
    display: grid;
    grid-template-columns: 200px minmax(0, 1160px) 200px;
    column-gap: 24px;
    justify-content: center;
    align-items: start;
    padding-left: 0;
    padding-right: 0;
  }
  main > .desktop-rail {
    display: flex;
    position: sticky;
    top: 96px;
    width: 200px;
    min-height: 600px;
    height: max-content;
    margin: 0;
    z-index: 2;
    pointer-events: none;
    align-items: flex-start;
    justify-content: center;
    grid-row: 1 / -1;
    align-self: start;
  }
  main > .rail-left { grid-column: 1; left: auto; right: auto; }
  main > .rail-right { grid-column: 3; left: auto; right: auto; }
  main > :not(.desktop-rail) { grid-column: 2; min-width: 0; }
  .rail-ad-placeholder {
    width: 160px;
    min-height: 600px;
    margin: 0 auto;
  }
}

@media (min-width: 1900px) {
  main {
    grid-template-columns: 220px minmax(0, 1160px) 220px;
    column-gap: 28px;
  }
  main > .desktop-rail { width: 220px; }
  .rail-ad-placeholder { width: 160px; }
}

@media (max-width: 1519px) {
  main {
    display: block;
    padding-left: 0;
    padding-right: 0;
  }
}


/* FINAL DESKTOP SIDE-RAIL LAYOUT v5
   Uses the browser's CSS viewport width rather than physical monitor width.
   The previous 1520px breakpoint was too high for some laptop/Chrome setups,
   so the rails never activated. This version reserves real columns as soon
   as the CSS viewport can comfortably fit a 160x600 side-rail ad. */
@media (min-width: 1400px) {
  body { overflow-x: hidden; }
  main {
    display: grid !important;
    grid-template-columns: 160px minmax(0, 1120px) 160px !important;
    column-gap: 12px !important;
    justify-content: center !important;
    align-items: start !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  main > .desktop-rail {
    display: flex !important;
    position: sticky !important;
    top: 96px !important;
    width: 160px !important;
    min-height: 600px !important;
    height: max-content !important;
    margin: 0 !important;
    z-index: 2 !important;
    pointer-events: none !important;
    align-items: flex-start !important;
    justify-content: center !important;
    grid-row: 1 / -1 !important;
    align-self: start !important;
  }
  main > .rail-left { grid-column: 1 !important; left: auto !important; right: auto !important; }
  main > .rail-right { grid-column: 3 !important; left: auto !important; right: auto !important; }
  main > :not(.desktop-rail) { grid-column: 2 !important; min-width: 0 !important; }
  main > .container { width: 100% !important; max-width: 1120px !important; }
  main > .hero { width: 100% !important; }
  main > .hero > .container { width: 100% !important; max-width: 1120px !important; }
  .rail-ad-placeholder {
    width: 160px !important;
    min-height: 600px !important;
    margin: 0 auto !important;
  }
}

@media (min-width: 1600px) {
  main {
    grid-template-columns: 180px minmax(0, 1160px) 180px !important;
    column-gap: 20px !important;
  }
  main > .desktop-rail { width: 180px !important; }
  main > .container,
  main > .hero > .container { max-width: 1160px !important; }
  .rail-ad-placeholder { width: 160px !important; }
}

@media (min-width: 1900px) {
  main {
    grid-template-columns: 200px minmax(0, 1160px) 200px !important;
    column-gap: 24px !important;
  }
  main > .desktop-rail { width: 200px !important; }
}
