:root {
  color-scheme: light;
  --ink: #102a2c;
  --muted: #587174;
  --forest: #123b3d;
  --teal: #1e7775;
  --acid: #d7ff62;
  --paper: #f6f8f4;
  --white: #ffffff;
  --line: #cdd8d4;
  --soft: #e8eeea;
  --amber: #ffd76a;
  --red: #ff8d79;
  --blue: #89c8ff;
  --shadow: 0 24px 70px rgba(18, 59, 61, .12);
  --radius: 22px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    linear-gradient(rgba(18,59,61,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18,59,61,.035) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
}

button, input, select { font: inherit; }
button, label { -webkit-tap-highlight-color: transparent; }

.topbar {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 clamp(20px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgba(246,248,244,.88);
  backdrop-filter: blur(14px);
}

.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--forest); font-weight: 800; font-size: 1.06rem; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--forest); display: flex; align-items: end; justify-content: center; gap: 3px; padding: 8px; }
.brand-mark i { display: block; width: 4px; background: var(--acid); border-radius: 2px 2px 0 0; }
.brand-mark i:nth-child(1) { height: 10px; }
.brand-mark i:nth-child(2) { height: 18px; }
.brand-mark i:nth-child(3) { height: 13px; }
.privacy-pill { font-size: .82rem; font-weight: 700; color: var(--teal); border: 1px solid #a8cac5; border-radius: 999px; padding: 8px 12px; background: rgba(255,255,255,.65); }

main { width: min(1320px, calc(100% - 32px)); margin: 0 auto; }
.workspace { display: grid; grid-template-columns: minmax(0, .92fr) minmax(420px, 1.08fr); gap: clamp(36px, 7vw, 96px); align-items: center; min-height: 575px; padding: 68px 0 54px; }
.eyebrow { margin: 0 0 16px; color: var(--teal); font-size: .78rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1 { margin: 0; max-width: 720px; font-family: Georgia, "Times New Roman", serif; font-weight: 500; font-size: clamp(3.25rem, 7vw, 6.75rem); line-height: .94; letter-spacing: -.055em; }
.lede { max-width: 650px; margin: 28px 0 0; color: var(--muted); font-size: clamp(1.05rem, 1.7vw, 1.3rem); line-height: 1.6; }

.upload-panel { border-radius: var(--radius); background: var(--white); padding: 14px; box-shadow: var(--shadow); border: 1px solid #dce5e1; }
.dropzone { min-height: 340px; border: 1.5px dashed #8caaa6; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 36px; outline: none; transition: .2s ease; background: linear-gradient(145deg, #fbfcfa, #f1f6f3); }
.dropzone:hover, .dropzone:focus-visible, .dropzone.dragging { border-color: var(--teal); background: #eef9f4; box-shadow: inset 0 0 0 3px rgba(30,119,117,.08); transform: translateY(-1px); }
.upload-icon { width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; background: var(--acid); color: var(--forest); font-size: 2rem; font-weight: 800; margin-bottom: 22px; }
.dropzone h2 { margin: 0; font-size: 1.35rem; }
.dropzone p { color: var(--muted); line-height: 1.55; margin: 10px 0 24px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border-radius: 10px; border: 0; font-weight: 800; cursor: pointer; }
.button.primary { background: var(--forest); color: white; }
.button.primary:hover { background: #195355; }
.panel-foot { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 14px 8px 2px; color: var(--muted); font-size: .86rem; }
.text-button { border: 0; background: transparent; color: var(--teal); font-weight: 800; cursor: pointer; padding: 6px; }

.preview-strip { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: rgba(255,255,255,.7); margin-bottom: 72px; }
.preview-strip article { min-height: 180px; padding: 26px; border-right: 1px solid var(--line); }
.preview-strip article:last-child { border-right: 0; }
.preview-index { color: var(--teal); font-size: .76rem; font-weight: 800; letter-spacing: .12em; }
.preview-strip h3 { margin: 34px 0 8px; font-family: Georgia, "Times New Roman", serif; font-size: 1.35rem; }
.preview-strip p { margin: 0; color: var(--muted); line-height: 1.5; font-size: .92rem; }

.results { margin: 0 0 72px; }
.results-shell { background: var(--white); border: 1px solid #dce5e1; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.results-head { padding: clamp(26px, 4vw, 46px); background: var(--forest); color: white; display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.results-head .eyebrow { color: var(--acid); }
.results-head h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; font-size: clamp(2.2rem, 5vw, 4.5rem); line-height: 1; letter-spacing: -.04em; margin: 0; }
.results-meta { color: #bed2cf; margin: 12px 0 0; }
.button.secondary { background: var(--acid); color: var(--forest); white-space: nowrap; }
.button.secondary:hover { background: #e3ff8e; }
.summary-grid { display: grid; grid-template-columns: repeat(6, 1fr); border-bottom: 1px solid var(--line); }
.summary-card { padding: 22px 20px; min-height: 118px; border-right: 1px solid var(--line); }
.summary-card:last-child { border-right: 0; }
.summary-card span { display: block; color: var(--muted); font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.summary-card strong { display: block; margin-top: 14px; font-family: Georgia, "Times New Roman", serif; font-size: 2.25rem; font-weight: 500; }
.opportunity { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(310px, .5fr); gap: 30px; padding: 34px clamp(22px, 4vw, 46px); border-bottom: 1px solid var(--line); background: #f9fbf8; }
.opportunity-label { color: var(--teal); font-size: .75rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.opportunity h3 { margin: 10px 0 12px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.55rem, 3vw, 2.35rem); line-height: 1.15; }
.opportunity p { margin: 0; color: var(--muted); line-height: 1.6; }
.score-block { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; align-content: center; }
.score-block div { border: 1px solid var(--line); border-radius: 12px; background: white; padding: 15px; }
.score-block span { display: block; color: var(--muted); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.score-block strong { display: block; font-size: 1.35rem; margin-top: 8px; }
.toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) 220px auto; gap: 12px; padding: 22px clamp(18px, 3vw, 34px); border-bottom: 1px solid var(--line); }
.control { min-height: 46px; border: 1px solid #b9c9c5; border-radius: 10px; background: white; color: var(--ink); padding: 0 14px; width: 100%; }
.control:focus { outline: 3px solid rgba(30,119,117,.16); border-color: var(--teal); }
.table-wrap { overflow-x: auto; }
.doctor-table { width: 100%; border-collapse: collapse; min-width: 1040px; }
.doctor-table th { position: sticky; top: 0; background: #e8efec; color: #385457; text-align: left; padding: 13px 14px; font-size: .73rem; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.doctor-table td { padding: 16px 14px; border-top: 1px solid #e0e8e4; vertical-align: middle; font-size: .9rem; }
.doctor-table tbody tr:hover { background: #f4f8f5; }
.rank { color: var(--muted); width: 56px; text-align: center; }
.title-cell { min-width: 300px; max-width: 440px; font-weight: 700; line-height: 1.4; }
.title-cell a { color: var(--ink); text-decoration-color: #9db5b0; text-underline-offset: 3px; }
.number { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.diagnosis { display: inline-flex; align-items: center; min-height: 30px; border-radius: 999px; padding: 5px 10px; font-size: .76rem; font-weight: 850; white-space: nowrap; }
.diagnosis.repackage { background: #d8f7d8; color: #176032; }
.diagnosis.content-problem { background: #fff0bf; color: #815500; }
.diagnosis.dont-touch { background: #dcebff; color: #174b7e; }
.diagnosis.low-opportunity { background: #ffe0da; color: #8c2d1e; }
.diagnosis.insufficient-signal, .diagnosis.monitor-mixed { background: #edf0ee; color: #52615e; }
.confidence { color: var(--muted); font-size: .8rem; }
.table-foot { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 20px 28px 26px; border-top: 1px solid var(--line); color: var(--muted); }
.learn { margin: 0 0 80px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.82); box-shadow: 0 18px 55px rgba(18,59,61,.08); overflow: hidden; }
.learn-heading { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr); gap: 48px; align-items: end; padding: clamp(28px, 5vw, 56px); background: #edf3ef; border-bottom: 1px solid var(--line); }
.learn-heading h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.35rem, 5vw, 4.8rem); font-weight: 500; letter-spacing: -.045em; line-height: .98; }
.learn-heading > p { margin: 0; max-width: 560px; color: var(--muted); font-size: 1.05rem; line-height: 1.65; }
.learn-tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--forest); padding: 0 clamp(18px, 4vw, 48px); }
.learn-tab { min-height: 70px; border: 0; border-bottom: 4px solid transparent; background: transparent; color: #bcd0cd; cursor: pointer; font-weight: 850; text-align: left; padding: 0 8px; }
.learn-tab:hover { color: white; }
.learn-tab[aria-selected="true"] { color: var(--acid); border-bottom-color: var(--acid); }
.learn-tab:focus-visible { outline: 3px solid var(--acid); outline-offset: -5px; }
.learn-panel { padding: clamp(24px, 4vw, 48px); }
.video-placeholder { min-height: 150px; display: flex; align-items: center; gap: 22px; border-radius: 16px; padding: 28px; background: linear-gradient(130deg, #143f41, #1b5c5d); color: white; }
.play-mark { display: grid; place-items: center; flex: 0 0 auto; width: 60px; height: 60px; border-radius: 50%; background: var(--acid); color: var(--forest); padding-left: 4px; }
.video-placeholder strong, .video-placeholder span { display: block; }
.video-placeholder strong { font-family: Georgia, "Times New Roman", serif; font-size: 1.45rem; font-weight: 500; }
.video-placeholder div span { margin-top: 6px; color: #bdd1ce; }
.tutorial-steps { list-style: none; display: grid; grid-template-columns: 1fr 1fr; margin: 28px 0; padding: 0; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: white; }
.tutorial-steps li { display: grid; grid-template-columns: 48px 1fr; gap: 12px; min-height: 178px; padding: 26px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tutorial-steps li:nth-child(2n) { border-right: 0; }
.tutorial-steps li:nth-last-child(-n+2) { border-bottom: 0; }
.step-number { color: var(--teal); font-size: .75rem; font-weight: 900; letter-spacing: .12em; padding-top: 4px; }
.tutorial-steps h3 { margin: 0 0 9px; font-size: 1.05rem; }
.tutorial-steps p { margin: 0; color: var(--muted); line-height: 1.6; }
.guide-callout { display: grid; grid-template-columns: 58px 1fr; gap: 18px; align-items: start; border-radius: 16px; padding: 26px; background: var(--acid); color: var(--forest); }
.guide-callout > span { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--forest); color: var(--acid); font-size: 1.5rem; font-weight: 900; }
.guide-callout strong { font-size: 1.08rem; }
.guide-callout p { margin: 6px 0 0; line-height: 1.55; }
.philosophy-intro { max-width: 870px; padding: 12px 0 36px; }
.philosophy-intro h3 { margin: 0 0 18px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 4vw, 3.5rem); font-weight: 500; letter-spacing: -.035em; line-height: 1.08; }
.philosophy-intro > p:last-child { color: var(--muted); font-size: 1.08rem; line-height: 1.7; }
.signal-grid { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: white; }
.signal-grid article { min-height: 230px; padding: 28px; border-right: 1px solid var(--line); }
.signal-grid article:last-child { border-right: 0; }
.signal-grid span { color: var(--teal); font-size: .73rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.signal-grid h4 { margin: 22px 0 10px; font-family: Georgia, "Times New Roman", serif; font-size: 1.35rem; }
.signal-grid p, .diagnosis-guide p, .principles-grid p { margin: 0; color: var(--muted); line-height: 1.6; }
.diagnosis-guide { margin: 28px 0; border-top: 1px solid var(--line); }
.diagnosis-row { display: grid; grid-template-columns: 190px 1fr; gap: 28px; align-items: start; padding: 24px 0; border-bottom: 1px solid var(--line); }
.diagnosis-row > .diagnosis { justify-self: start; }
.diagnosis-row h4 { margin: 1px 0 7px; }
.principles-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.principles-grid > div { padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: #f6f9f6; }
.principles-grid h4 { margin: 0 0 9px; }
.error-box { padding: 28px; border-radius: 16px; border: 1px solid #f1b1a5; background: #fff2ef; color: #74291e; }
.error-box h2 { margin-top: 0; }
.noscript { margin: 20px; padding: 16px; background: var(--amber); color: var(--ink); }
.loading { opacity: .7; pointer-events: none; }
footer { max-width: 1320px; margin: 0 auto; padding: 28px 16px 42px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 24px; color: var(--muted); font-size: .85rem; }

@media (max-width: 900px) {
  .workspace { grid-template-columns: 1fr; padding-top: 48px; }
  .upload-panel { max-width: 650px; width: 100%; }
  .preview-strip { grid-template-columns: 1fr 1fr; }
  .preview-strip article:nth-child(2) { border-right: 0; }
  .preview-strip article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .summary-grid { grid-template-columns: repeat(3, 1fr); }
  .summary-card:nth-child(3) { border-right: 0; }
  .summary-card:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .opportunity { grid-template-columns: 1fr; }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .toolbar .button { grid-column: 1 / -1; }
  .learn-heading { grid-template-columns: 1fr; gap: 20px; }
  .signal-grid { grid-template-columns: 1fr; }
  .signal-grid article { min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .signal-grid article:last-child { border-bottom: 0; }
  .principles-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .privacy-pill { display: none; }
  main { width: min(100% - 24px, 1320px); }
  .workspace { padding-top: 38px; gap: 34px; }
  h1 { font-size: clamp(3rem, 17vw, 4.5rem); }
  .dropzone { min-height: 290px; padding: 28px 18px; }
  .panel-foot { align-items: flex-start; flex-direction: column; }
  .preview-strip { grid-template-columns: 1fr; }
  .preview-strip article { border-right: 0; border-bottom: 1px solid var(--line); min-height: 145px; }
  .preview-strip article:nth-child(3) { border-bottom: 1px solid var(--line); }
  .preview-strip article:last-child { border-bottom: 0; }
  .preview-strip h3 { margin-top: 20px; }
  footer { flex-direction: column; }
  .results-head { align-items: flex-start; flex-direction: column; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .summary-card:nth-child(2n) { border-right: 0; }
  .summary-card:nth-child(3) { border-right: 1px solid var(--line); }
  .summary-card:nth-child(-n+4) { border-bottom: 1px solid var(--line); }
  .score-block { grid-template-columns: 1fr; }
  .toolbar { grid-template-columns: 1fr; }
  .toolbar .button { grid-column: auto; }
  .table-foot { align-items: flex-start; flex-direction: column; }
  .learn-tabs { grid-template-columns: 1fr; padding: 0 18px; }
  .learn-tab { min-height: 58px; }
  .tutorial-steps { grid-template-columns: 1fr; }
  .tutorial-steps li { min-height: 0; border-right: 0; }
  .tutorial-steps li:nth-last-child(2) { border-bottom: 1px solid var(--line); }
  .diagnosis-row { grid-template-columns: 1fr; gap: 12px; }
  .video-placeholder { align-items: flex-start; }
}
