:root {
  --ink: #172033;
  --muted: #697386;
  --line: #e5eaf0;
  --line-strong: #d7dee8;
  --surface: #ffffff;
  --canvas: #f5f7fa;
  --navy: #172a46;
  --navy-2: #203a5e;
  --cyan: #10b8b1;
  --cyan-soft: #e8f8f7;
  --orange: #f47d52;
  --orange-soft: #fff1ec;
  --blue: #4f7cff;
  --yellow: #f3c75f;
  --shadow: 0 18px 50px rgba(24, 37, 57, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
button, select, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, select:focus-visible, .dropzone:focus-visible { outline: 3px solid rgba(16,184,177,.27); outline-offset: 2px; }
.app-shell { min-height: 100vh; }
.topbar {
  height: 72px;
  padding: 0 clamp(20px, 4vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--navy);
  color: white;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: white; text-decoration: none; font-family: Manrope, sans-serif; font-weight: 700; letter-spacing: -.02em; }
.brand strong { color: #73e0dc; }
.brand-mark { width: 32px; height: 32px; display: flex; align-items: end; justify-content: center; gap: 3px; padding: 7px; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.14); border-radius: 9px; }
.brand-mark span { display: block; width: 4px; background: #72ded9; border-radius: 3px 3px 1px 1px; }
.brand-mark span:nth-child(1) { height: 9px; }
.brand-mark span:nth-child(2) { height: 16px; }
.brand-mark span:nth-child(3) { height: 12px; background: var(--orange); }
.header-actions { display: flex; align-items: center; gap: 16px; }
.privacy-note { display: inline-flex; align-items: center; gap: 8px; color: #b9c8dc; font-size: .86rem; }
.privacy-dot { width: 7px; height: 7px; background: #6be2ad; border-radius: 50%; box-shadow: 0 0 0 4px rgba(107,226,173,.1); }
main { max-width: 1480px; margin: 0 auto; padding: 34px clamp(20px,4vw,64px) 72px; }
.workspace-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.eyebrow { margin: 0 0 6px; color: #748196; font-size: .73rem; font-weight: 800; letter-spacing: .15em; }
h1,h2,h3 { margin: 0; font-family: Manrope, sans-serif; letter-spacing: -.035em; }
h1 { color: var(--navy); font-size: clamp(1.7rem,3vw,2.5rem); line-height: 1.12; }
h2 { font-size: 1.5rem; color: var(--navy); }
h3 { font-size: 1.03rem; }
.dataset-pill { min-width: 245px; display: flex; align-items: center; gap: 11px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 4px 16px rgba(24,37,57,.04); }
.dataset-pill .file-icon { width: 34px; height: 34px; display: grid; place-items: center; color: var(--cyan); background: var(--cyan-soft); border-radius: 9px; font-weight: 800; }
.dataset-pill span:last-child { display: grid; min-width: 0; }
.dataset-pill strong { font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dataset-pill small { color: var(--muted); font-size: .74rem; }
.dataset-pill.is-empty .file-icon { color: #93a0b2; background: #f0f3f7; }

.step-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-bottom: 28px; background: white; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.step-tab { position: relative; display: flex; align-items: center; gap: 13px; min-height: 78px; padding: 14px 24px; border: 0; border-right: 1px solid var(--line); background: white; color: var(--ink); text-align: left; }
.step-tab:last-child { border-right: 0; }
.step-tab:not(:disabled):hover { background: #f9fbfc; }
.step-tab.active { background: var(--navy); color: white; }
.step-tab.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--cyan); }
.step-tab:disabled { cursor: not-allowed; color: #a7b0bd; }
.step-number { color: var(--cyan); font-family: Manrope, sans-serif; font-size: 1.15rem; font-weight: 800; }
.step-tab.active .step-number { color: #73e0dc; }
.step-tab span:last-child { display: grid; }
.step-tab strong { font-size: .95rem; }
.step-tab small { color: #8490a1; font-size: .76rem; }
.step-tab.active small { color: #b7c7da; }
.tab-panel { animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.upload-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(285px, .75fr); gap: 22px; }
.dropzone { min-height: 420px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 46px 30px; border: 1.5px dashed #aab7c6; border-radius: 18px; background: white; text-align: center; transition: .2s ease; }
.dropzone:hover, .dropzone.dragover { border-color: var(--cyan); background: #fbfefe; box-shadow: inset 0 0 0 1px var(--cyan); }
.upload-visual { width: 72px; height: 72px; display: grid; place-items: center; margin-bottom: 20px; border-radius: 20px; background: var(--cyan-soft); color: #078e89; transform: rotate(-3deg); }
.upload-visual svg { width: 34px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transform: rotate(3deg); }
.dropzone h2 { font-size: 1.45rem; }
.dropzone p { margin: 6px 0 20px; color: var(--muted); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 16px; border: 1px solid transparent; border-radius: 9px; font-weight: 700; font-size: .88rem; transition: .18s ease; }
.button-primary { background: var(--navy); color: white; box-shadow: 0 7px 18px rgba(23,42,70,.18); }
.button-primary:hover { background: var(--navy-2); transform: translateY(-1px); }
.button-secondary { width: 100%; justify-content: space-between; background: var(--cyan); color: #082d31; }
.button-secondary:hover { background: #31cac4; }
.button-ghost { border-color: rgba(255,255,255,.17); background: transparent; color: inherit; }
main .button-ghost { border-color: var(--line-strong); background: white; color: var(--navy); }
.button-ghost:hover:not(:disabled) { border-color: var(--cyan); }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.format-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 24px; }
.format-row span { padding: 4px 9px; border: 1px solid var(--line); border-radius: 5px; color: #536073; background: #fafbfd; font-size: .69rem; font-weight: 800; letter-spacing: .06em; }
.upload-limit { margin-top: 13px; color: #8995a5; }
.getting-started { display: flex; flex-direction: column; justify-content: space-between; min-height: 420px; padding: 32px; color: white; background: var(--navy); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; position: relative; }
.getting-started::after { content: ""; position: absolute; width: 180px; height: 180px; right: -80px; top: -70px; border: 35px solid rgba(16,184,177,.13); border-radius: 50%; }
.getting-started .eyebrow { color: #73e0dc; }
.getting-started h2 { color: white; font-size: 1.55rem; }
.getting-started p:not(.eyebrow) { color: #b9c7da; font-size: .93rem; }
.sample-preview { position: relative; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px; padding: 16px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); border-radius: 12px; }
.sample-badge { padding: 4px 7px; color: #72ded9; border: 1px solid rgba(114,222,217,.35); border-radius: 5px; font-size: .63rem; font-weight: 800; }
.sample-preview div:nth-child(2) { display: grid; }
.sample-preview strong { font-size: .86rem; }
.sample-preview span { color: #aebed2; font-size: .73rem; }
.mini-bars { grid-column: 1 / -1; height: 38px; display: flex; align-items: end; gap: 6px; padding-top: 4px; }
.mini-bars i { flex: 1; height: 40%; background: rgba(114,222,217,.3); border-radius: 2px 2px 0 0; }
.mini-bars i:nth-child(2) { height: 73%; }.mini-bars i:nth-child(3) { height: 55%; }.mini-bars i:nth-child(4) { height: 92%; background: var(--orange); }.mini-bars i:nth-child(5) { height: 68%; }
.alert { margin-top: 16px; padding: 13px 16px; border: 1px solid #f7b6a0; background: var(--orange-soft); color: #9b4527; border-radius: 10px; }

.section-toolbar, .dashboard-toolbar { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 22px; }
.section-toolbar p:not(.eyebrow) { margin: 5px 0 0; color: var(--muted); }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.metric-card { padding: 19px 20px; background: white; border: 1px solid var(--line); border-radius: 12px; }
.metric-card span { color: var(--muted); font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.metric-card strong { display: block; margin-top: 6px; color: var(--navy); font: 800 1.7rem Manrope, sans-serif; }
.metric-card i { display: block; width: 28px; height: 3px; margin-top: 12px; border-radius: 4px; background: var(--cyan); }
.metric-card:nth-child(2) i { background: var(--orange); }.metric-card:nth-child(3) i { background: var(--blue); }.metric-card:nth-child(4) i { background: var(--yellow); }
.content-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; }
.span-2 { grid-column: span 2; }.span-3 { grid-column: 1 / -1; }
.card, .visual-card { padding: 22px; background: white; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 7px 22px rgba(24,37,57,.035); }
.card-heading, .visual-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 17px; }
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line); background: #f4f6f8; border-radius: 8px; }
.segmented button { padding: 5px 9px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; font-size: .74rem; font-weight: 700; }
.segmented button.active { color: var(--navy); background: white; box-shadow: 0 1px 4px rgba(30,40,60,.12); }
.table-wrap { width: 100%; overflow: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th { padding: 10px 12px; color: #778397; background: #f7f9fb; border-bottom: 1px solid var(--line); font-size: .72rem; letter-spacing: .04em; text-align: left; text-transform: uppercase; }
td { padding: 11px 12px; border-bottom: 1px solid #edf0f4; color: #465267; font-size: .82rem; }
tbody tr:hover { background: #fbfcfd; }
.preview-table { max-height: 350px; }
.muted { color: var(--muted); font-size: .78rem; }
.score-ring { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 50%; color: var(--navy); background: conic-gradient(var(--cyan) var(--score, 0%), #e8edf2 0); position: relative; font-weight: 800; }
.score-ring::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: white; }
.score-ring { isolation: isolate; }.score-ring::before { z-index: -1; }
.quality-details { display: grid; gap: 13px; }
.quality-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; }
.quality-row div { display: flex; justify-content: space-between; color: #526074; font-size: .83rem; }
.quality-row strong { color: var(--navy); }
.progress { grid-column: 1 / -1; height: 6px; overflow: hidden; background: #edf1f5; border-radius: 8px; }
.progress i { display: block; height: 100%; border-radius: inherit; background: var(--cyan); }

.feature-controls { display: flex; align-items: end; gap: 10px; }
.feature-controls label { display: grid; gap: 4px; color: var(--muted); font-size: .72rem; font-weight: 700; }
select { min-width: 170px; height: 42px; padding: 0 34px 0 12px; border: 1px solid var(--line-strong); border-radius: 9px; background: white; color: var(--navy); font-size: .84rem; }
.dashboard-metrics { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 16px; }
.dash-metric { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; background: var(--navy); color: white; border-radius: 11px; }
.dash-metric:nth-child(2) { background: #1d5c64; }.dash-metric:nth-child(3) { background: #324c75; }.dash-metric:nth-child(4) { background: #705044; }
.dash-metric span { color: #bdcadd; font-size: .73rem; }.dash-metric strong { font: 700 1.1rem Manrope, sans-serif; text-align: right; }
.visual-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.visual-card { min-height: 340px; overflow: hidden; }
.visual-card.wide { grid-column: span 2; }
.visual-heading > div { display: flex; align-items: center; gap: 9px; }
.visual-heading span { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 7px; color: #088e89; background: var(--cyan-soft); font: 800 .68rem Manrope, sans-serif; }
.visual-heading p { margin: 0; color: var(--muted); font-size: .74rem; }
.chart { min-height: 255px; display: grid; place-items: center; }
.chart svg { width: 100%; height: 255px; overflow: visible; }
.chart-label { fill: #778397; font-size: 10px; font-family: "DM Sans", sans-serif; }
.chart-value { fill: #31425d; font-size: 10px; font-weight: 700; font-family: "DM Sans", sans-serif; }
.grid-line { stroke: #e9edf2; stroke-width: 1; }
.axis-line { stroke: #ccd4de; stroke-width: 1; }
.bar { fill: var(--cyan); }.bar-accent { fill: var(--orange); }
.line-path { fill: none; stroke: var(--cyan); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.area-path { fill: url(#areaGradient); }
.point { fill: var(--cyan); opacity: .62; }.point:hover { opacity: 1; stroke: white; stroke-width: 2; }
.empty-chart { color: var(--muted); font-size: .83rem; text-align: center; padding: 30px; }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 8px; color: var(--muted); font-size: .72rem; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }.legend i { width: 8px; height: 8px; border-radius: 2px; }
.donut-wrap { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 12px; width: 100%; }
.donut { width: 144px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; position: relative; }
.donut::after { content: ""; position: absolute; inset: 27px; background: white; border-radius: 50%; }
.donut strong { z-index: 1; font: 800 1.35rem Manrope, sans-serif; }.donut small { z-index: 1; margin-top: -35px; color: var(--muted); font-size: .65rem; }
.donut-legend { display: grid; gap: 9px; }.donut-legend div { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: .76rem; }.donut-legend i { width: 8px; height: 8px; display: inline-block; margin-right: 6px; border-radius: 2px; }
.heatmap-wrap { align-items: start; justify-items: start; overflow: auto; }
.heatmap { display: grid; gap: 3px; min-width: 100%; padding: 4px 0 10px; }
.heat-cell { min-width: 45px; min-height: 39px; display: grid; place-items: center; border-radius: 5px; color: white; font-size: .67rem; font-weight: 700; }
.heat-label { min-width: 72px; display: flex; align-items: center; color: #667286; font-size: .67rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.heat-head { min-width: 45px; color: #667286; font-size: .64rem; transform: rotate(-28deg); transform-origin: left bottom; white-space: nowrap; padding-left: 12px; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 10; transform: translate(-50%, 20px); padding: 11px 16px; color: white; background: var(--navy); border-radius: 9px; box-shadow: 0 12px 30px rgba(18,31,50,.25); opacity: 0; pointer-events: none; transition: .22s ease; font-size: .84rem; }
.toast.show { opacity: 1; transform: translate(-50%,0); }

@media (max-width: 1050px) {
  .visual-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .visual-card.wide { grid-column: span 2; }
  .dashboard-toolbar { align-items: start; }
  .feature-controls { flex-wrap: wrap; justify-content: end; }
  .content-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .span-3 { grid-column: span 2; }
}
@media (max-width: 780px) {
  .privacy-note { display: none; }
  .workspace-heading, .section-toolbar, .dashboard-toolbar { align-items: stretch; flex-direction: column; }
  .dataset-pill { width: 100%; }
  .step-tab { padding: 12px; min-height: 68px; }.step-tab small { display: none; }
  .upload-layout { grid-template-columns: 1fr; }
  .dropzone, .getting-started { min-height: 350px; }
  .metric-grid, .dashboard-metrics { grid-template-columns: repeat(2,1fr); }
  .content-grid, .visual-grid { grid-template-columns: 1fr; }
  .span-2,.span-3,.visual-card.wide { grid-column: auto; }
  .feature-controls { justify-content: stretch; }
  .feature-controls label { flex: 1 1 190px; }
  select { width: 100%; min-width: 0; }
}
@media (max-width: 520px) {
  .topbar { height: auto; min-height: 66px; padding: 12px 16px; }
  .topbar .button { width: 42px; padding: 0; font-size: 0; }
  main { padding: 24px 14px 50px; }
  .step-tab { justify-content: center; gap: 6px; }.step-tab span:last-child { display: none; }
  .metric-grid,.dashboard-metrics { grid-template-columns: 1fr 1fr; }
  .metric-card { padding: 14px; }.metric-card strong { font-size: 1.35rem; }
  .card,.visual-card { padding: 16px; }
  .dropzone { padding: 30px 18px; }
  .getting-started { padding: 24px; }
  .donut-wrap { grid-template-columns: 125px 1fr; }.donut { width: 122px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
