/* SecondOpinion - palette from the 2degrees design system */
:root {
  --ink: #1D292E;
  --ink-2: #61696D;
  --ink-3: #8E9699;
  --line: #E4E5E6;
  --line-2: #F1F1F2;
  --bg: #FFFFFF;
  --bg-2: #F5F5F7;
  --navy: #003660;
  --blue: #009ED8;
  --blue-d: #0070BF;
  --blue-l: #E0F3FA;
  --blue-m: #4DBBE4;
  --orange: #F1600D;
  --orange-l: #FEF2E5;
  --green: #00875A;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(29, 41, 46, .04), 0 8px 24px rgba(29, 41, 46, .06);
  --font: "Figtree", "Circular Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--blue-d); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; color: var(--navy); letter-spacing: -0.02em; line-height: 1.15; }
h1 { font-size: clamp(32px, 4.6vw, 54px); font-weight: 800; letter-spacing: -0.035em; }
h2 { font-size: clamp(24px, 2.6vw, 32px); font-weight: 800; }
h3 { font-size: 18px; font-weight: 700; }
p { margin: 0; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.tiny { font-size: 12px; color: var(--ink-3); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

/* Header */
.top { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--line-2); }
.top .wrap { display: flex; align-items: center; gap: 28px; height: 68px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--navy); font-weight: 800; font-size: 22px; letter-spacing: -0.04em; }
.brand:hover { text-decoration: none; }
.brand svg { flex: none; }
.brand .op { color: var(--blue); }
.nav { margin-left: auto; display: flex; align-items: center; gap: 22px; font-size: 15px; }
.nav a { color: var(--ink); font-weight: 500; }
.nav a.active { color: var(--blue-d); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; font: inherit; font-weight: 700; font-size: 15px; padding: 12px 24px; border-radius: 999px; background: var(--blue); color: #fff; transition: background .15s, transform .15s; white-space: nowrap; }
.btn:hover { background: var(--blue-d); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.lg { padding: 16px 30px; font-size: 16px; }
.btn.sm { padding: 8px 16px; font-size: 14px; }
.btn.navy { background: var(--navy); }
.btn.navy:hover { background: #00264a; }
.btn.orange { background: var(--orange); }
.btn.orange:hover { background: #d9530a; }
.btn.ghost { background: transparent; color: var(--navy); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1.5px var(--navy); }
.btn.white { background: #fff; color: var(--navy); }
.btn[disabled] { opacity: .5; cursor: default; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--blue-d); cursor: pointer; }

/* Hero */
.hero { padding: 72px 0 40px; }
.hero .grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 64px; align-items: center; }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--blue); margin-bottom: 18px; }
.lede { font-size: 19px; color: var(--ink-2); margin-top: 22px; max-width: 34em; }
.carriers { display: flex; gap: 10px; margin-top: 28px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: 999px; background: var(--bg-2); font-size: 13px; font-weight: 600; color: var(--ink-2); }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); }

/* Drop zone */
.drop { position: relative; border-radius: 24px; background: var(--bg-2); padding: 10px; }
.drop-inner { border: 2px dashed #BBBFC0; border-radius: 18px; background: #fff; padding: 44px 28px 34px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.drop.over .drop-inner, .drop-inner:hover { border-color: var(--blue); background: #FBFEFF; }
.drop-icon { width: 58px; height: 58px; border-radius: 16px; background: var(--blue-l); display: grid; place-items: center; margin: 0 auto 18px; }
.drop h3 { font-size: 20px; color: var(--navy); }
.drop p { color: var(--ink-2); margin-top: 6px; font-size: 15px; }
.drop .or { margin-top: 18px; font-size: 13px; color: var(--ink-3); }
.files { text-align: left; margin-top: 18px; display: grid; gap: 8px; }
.file { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--bg-2); font-size: 14px; }
.file .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file .x { background: none; border: 0; color: var(--ink-3); cursor: pointer; font-size: 18px; line-height: 1; }
.drop-actions { margin-top: 18px; display: flex; gap: 12px; justify-content: center; }
.email-alt { margin-top: 16px; text-align: center; font-size: 14px; color: var(--ink-2); }
.email-alt a { font-weight: 600; }

/* Sections */
.section { padding: 64px 0; }
.section.alt { background: var(--bg-2); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 36px; }
.step .n { width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 800; display: grid; place-items: center; font-size: 15px; margin-bottom: 14px; }
.step h3 { margin-bottom: 6px; }
.step p { color: var(--ink-2); font-size: 15px; }

/* Cards & KPIs */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card.flat { border: 0; background: var(--bg-2); }
.card h3 { margin-bottom: 4px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.kpi .label { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.kpi .value { font-size: 30px; font-weight: 800; color: var(--navy); letter-spacing: -0.03em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.kpi.accent { background: var(--navy); border-color: var(--navy); }
.kpi.accent .label, .kpi.accent .sub { color: #B3E2F3; }
.kpi.accent .value { color: #fff; }
.delta-up { color: var(--orange); font-weight: 600; }
.delta-down { color: var(--green); font-weight: 600; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-main { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; }
.stack > * + * { margin-top: 20px; }
.chart { width: 100%; height: 320px; }
.chart.tall { height: 420px; }
.chart.short { height: 220px; }

/* Segmented control */
.seg { display: inline-flex; background: var(--bg-2); border-radius: 999px; padding: 4px; gap: 2px; }
.seg button { border: 0; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--ink-2); padding: 7px 14px; border-radius: 999px; cursor: pointer; }
.seg button.on { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }

/* Line chips */
.line-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.lchip { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.lchip .sw { width: 9px; height: 9px; border-radius: 50%; }
.lchip.on { border-color: var(--navy); color: var(--navy); }

/* Tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-weight: 600; color: var(--ink-2); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; cursor: default; }
table.data th.sort { cursor: pointer; }
table.data th.sort:hover { color: var(--navy); }
table.data td { padding: 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.data tr.click { cursor: pointer; }
table.data tr.click:hover td { background: #FAFBFB; }
table.data .r { text-align: right; }
.who { font-weight: 600; color: var(--ink); }
.who .tiny, td .tiny { font-weight: 400; display: block; }
.flag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; margin-right: 4px; }
.flag.idle { background: var(--orange-l); color: #B5470A; }
.flag.oversized { background: var(--blue-l); color: var(--blue-d); }
.flag.undersized { background: #FFF4D6; color: #8A6100; }
.status { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.status.done { background: #E3F4EC; color: var(--green); }
.status.queued, .status.processing { background: var(--blue-l); color: var(--blue-d); }
.status.rejected, .status.failed { background: var(--orange-l); color: #B5470A; }
.status.duplicate { background: var(--bg-2); color: var(--ink-2); }
.spark { width: 110px; height: 32px; display: block; }
.bar-cell { display: flex; align-items: center; gap: 10px; min-width: 160px; }
.bar-cell .bar { height: 8px; border-radius: 4px; background: var(--blue); }
.util { width: 90px; height: 8px; border-radius: 4px; background: var(--line); position: relative; overflow: hidden; }
.util > span { position: absolute; left: 0; top: 0; bottom: 0; background: var(--blue); border-radius: 4px; }
.util.over > span { background: var(--orange); }

/* Insights */
.insights { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.insight { border-radius: var(--radius); background: #fff; border: 1px solid var(--line); padding: 22px; position: relative; overflow: hidden; display: flex; flex-direction: column; }
.insight .k { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.insight .h { font-size: 19px; font-weight: 800; color: var(--navy); margin-top: 6px; letter-spacing: -0.02em; line-height: 1.25; }
.insight .b { font-size: 14px; color: var(--ink-2); margin-top: 8px; }
.insight .save { margin-top: 14px; font-size: 14px; font-weight: 700; color: var(--orange); }
.insight ul { list-style: none; padding: 0; margin: 14px 0 0; font-size: 14px; }
.insight li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line-2); }
.insight li .d { color: var(--ink-3); font-size: 12px; }
.locked .blur { filter: blur(6px); user-select: none; pointer-events: none; }
.lock { position: absolute; inset: auto 0 0 0; padding: 18px 22px; background: linear-gradient(180deg, rgba(255, 255, 255, 0), #fff 40%); display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--navy); }

/* Register band */
.band { background: var(--navy); color: #fff; border-radius: 24px; padding: 40px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: center; }
.band h2 { color: #fff; }
.band p { color: #B3E2F3; margin-top: 10px; }
.band ul { margin: 18px 0 0; padding: 0; list-style: none; color: #fff; font-size: 15px; }
.band li { padding: 4px 0 4px 26px; position: relative; }
.band li::before { content: ""; position: absolute; left: 0; top: 10px; width: 14px; height: 8px; border-left: 2.5px solid var(--blue-m); border-bottom: 2.5px solid var(--blue-m); transform: rotate(-45deg); }
.band .actions { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }

/* Progress */
.progress-list { display: grid; gap: 10px; }
.prog { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 12px; background: var(--bg-2); }
.prog .name { flex: 1; font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prog .meta { font-size: 13px; color: var(--ink-2); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--blue-l); border-top-color: var(--blue); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.tick { width: 18px; height: 18px; flex: none; }
.loading-note { color: var(--ink-2); font-size: 15px; margin-top: 14px; }

/* Forms */
.auth { min-height: calc(100vh - 68px); display: grid; place-items: center; padding: 40px 20px; background: var(--bg-2); }
.auth .card { width: 100%; max-width: 440px; padding: 36px; box-shadow: var(--shadow); border: 0; }
.auth h2 { margin-bottom: 8px; }
.field { display: block; margin-top: 18px; }
.field span { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=url], input[type=number], select, textarea {
  width: 100%; font: inherit; font-size: 16px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); outline: none; transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); }
textarea { min-height: 90px; resize: vertical; }
.code-input { font-size: 30px !important; letter-spacing: 12px; text-align: center; font-weight: 800; color: var(--navy); }
.form-actions { margin-top: 24px; display: flex; flex-direction: column; gap: 12px; }
.alert { padding: 12px 14px; border-radius: 10px; font-size: 14px; margin-top: 16px; }
.alert.err { background: var(--orange-l); color: #9A3D08; }
.alert.info { background: var(--blue-l); color: var(--navy); }
.alert.ok { background: #E3F4EC; color: var(--green); }

/* Dashboard */
.dash-head { padding: 36px 0 20px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.dash-head h1 { font-size: 34px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; }
.tabs button { border: 0; background: none; font: inherit; font-weight: 600; font-size: 15px; color: var(--ink-2); padding: 12px 16px; border-bottom: 2.5px solid transparent; cursor: pointer; white-space: nowrap; }
.tabs button.on { color: var(--navy); border-bottom-color: var(--blue); }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filters select { width: auto; padding: 8px 12px; font-size: 14px; border-radius: 999px; }
.savings { background: linear-gradient(0deg, var(--orange-l), var(--orange-l)); border: 0; }
.savings .big { font-size: 40px; font-weight: 800; color: var(--orange); letter-spacing: -0.03em; }
.empty { text-align: center; padding: 60px 20px; color: var(--ink-2); }
.drawer-bg { position: fixed; inset: 0; background: rgba(0, 20, 40, .25); z-index: 50; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: #fff; z-index: 51; box-shadow: -10px 0 40px rgba(0, 0, 0, .12); padding: 28px; overflow-y: auto; }
.drawer .close { position: absolute; top: 18px; right: 18px; }
.mini-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0; }
.mini-kpis div { background: var(--bg-2); border-radius: 12px; padding: 12px; }
.mini-kpis b { display: block; font-size: 20px; color: var(--navy); }
.mini-kpis span { font-size: 12px; color: var(--ink-2); }

/* Ask AI */
.ask-fab { position: fixed; right: 24px; bottom: 24px; z-index: 40; display: flex; align-items: center; gap: 10px; padding: 14px 22px 14px 18px; border-radius: 999px; border: 0; background: var(--navy); color: #fff; font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; box-shadow: 0 10px 30px rgba(0, 54, 96, .3); }
.ask-fab:hover { background: #00264a; }
.ask-panel { position: fixed; right: 24px; bottom: 24px; z-index: 45; width: min(440px, calc(100% - 32px)); height: min(680px, calc(100vh - 48px)); background: #fff; border-radius: 22px; box-shadow: 0 24px 70px rgba(0, 30, 60, .25); display: flex; flex-direction: column; overflow: hidden; }
.ask-head { padding: 18px 20px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 10px; }
.ask-head h3 { font-size: 16px; }
.ask-head .x { margin-left: auto; background: none; border: 0; font-size: 22px; color: var(--ink-3); cursor: pointer; }
.ask-body { flex: 1; overflow-y: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 92%; font-size: 14.5px; line-height: 1.5; }
.msg.user { align-self: flex-end; background: var(--blue); color: #fff; padding: 10px 14px; border-radius: 16px 16px 4px 16px; }
.msg.assistant { align-self: flex-start; background: var(--bg-2); padding: 12px 14px; border-radius: 16px 16px 16px 4px; }
.msg.assistant p + p, .msg.assistant p + ul, .msg.assistant ul + p { margin-top: 8px; }
.msg.assistant ul, .msg.assistant ol { margin: 6px 0; padding-left: 20px; }
.msg.assistant table { border-collapse: collapse; font-size: 13px; margin: 8px 0; background: #fff; border-radius: 8px; overflow: hidden; }
.msg.assistant th, .msg.assistant td { padding: 6px 9px; border-bottom: 1px solid var(--line-2); text-align: left; }
.msg.assistant th { color: var(--ink-2); font-weight: 600; }
.msg .mchart { width: 360px; max-width: 100%; height: 220px; background: #fff; border-radius: 10px; margin: 8px 0; }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; }
.suggest button { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 12px; font: inherit; font-size: 13px; color: var(--navy); cursor: pointer; text-align: left; }
.suggest button:hover { border-color: var(--blue); }
.ask-input { padding: 14px; border-top: 1px solid var(--line-2); display: flex; gap: 8px; }
.ask-input input { border-radius: 999px; padding: 11px 16px; font-size: 15px; }
.ask-input button { flex: none; width: 46px; height: 46px; padding: 0; }

/* Offers */
.offers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.offer { border-radius: var(--radius); border: 1.5px solid var(--line); padding: 26px; display: flex; flex-direction: column; gap: 8px; background: #fff; position: relative; }
.offer .badge { position: absolute; top: 18px; right: 18px; background: var(--orange-l); color: #B5470A; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.offer .title { font-size: 26px; font-weight: 800; color: var(--navy); letter-spacing: -0.03em; margin-top: 18px; }
.offer .sub { color: var(--ink-2); font-size: 15px; flex: 1; }
.offer form { margin-top: 12px; }

/* Admin */
.admin-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 28px 0 24px; }
.admin-tabs a { padding: 8px 16px; border-radius: 999px; background: var(--bg-2); color: var(--ink); font-weight: 600; font-size: 14px; }
.admin-tabs a.on { background: var(--navy); color: #fff; }
.admin-tabs a:hover { text-decoration: none; }
pre.json { background: #0E1A20; color: #D8E3E8; padding: 16px; border-radius: 12px; font-size: 12px; overflow: auto; max-height: 70vh; }
textarea.json { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; min-height: 60vh; }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; }
.funnel { display: grid; gap: 8px; }
.funnel .row { display: grid; grid-template-columns: 170px 1fr 60px; gap: 12px; align-items: center; font-size: 14px; }
.funnel .bar { height: 22px; border-radius: 6px; background: var(--blue); min-width: 3px; }

footer.foot { border-top: 1px solid var(--line-2); padding: 32px 0 48px; margin-top: 40px; font-size: 13px; color: var(--ink-3); }
footer.foot .wrap { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

@media (max-width: 960px) {
  .hero .grid, .grid-main, .band { grid-template-columns: 1fr; gap: 32px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .insights, .offers, .steps, .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .hero { padding: 40px 0 24px; }
  .nav { gap: 14px; font-size: 14px; }
  .nav .hide-sm { display: none; }
  .kpi .value { font-size: 24px; }
  .band { padding: 28px 22px; }
  .ask-panel { right: 8px; bottom: 8px; width: calc(100% - 16px); height: calc(100vh - 16px); }
  .ask-fab { right: 16px; bottom: 16px; }
  .kv { grid-template-columns: 1fr; }
}
