:root {
  color-scheme: light;
  --ink: #181713;
  --muted: #676258;
  --paper: #f7f1e8;
  --panel: #fffcf4;
  --line: #d8cbbb;
  --field: #fff8ec;
  --green: #1f7a55;
  --green-soft: #e3f4ea;
  --red: #a3422a;
  --red-soft: #fbe5dc;
  --blue: #285f8f;
  --blue-soft: #dcebf8;
  --gold: #a76a12;
  --shadow: 0 18px 50px rgba(38, 31, 19, 0.13);
  font-family: "Aptos", "Segoe UI", "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(24, 23, 19, 0.045) 1px, transparent 1px),
    linear-gradient(0deg, rgba(24, 23, 19, 0.04) 1px, transparent 1px),
    var(--paper);
  background-size: 44px 44px;
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--panel);
  min-height: 44px;
  padding: 0 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 140ms ease-out, box-shadow 140ms ease-out, background 140ms ease-out;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(24, 23, 19, 0.18);
}

button:active {
  transform: translateY(0);
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: rgba(247, 241, 232, 0.91);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 800;
}

.topbar nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar nav a {
  padding: 8px 10px;
  color: var(--muted);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(340px, 420px) minmax(0, 1fr);
  gap: clamp(16px, 3vw, 32px);
  padding: clamp(18px, 4vw, 40px);
  align-items: start;
}

.triage-panel,
.output-panel,
.price-panel,
.readback-panel,
.export-band {
  background: rgba(255, 252, 244, 0.94);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.triage-panel {
  position: sticky;
  top: 78px;
  max-height: calc(100vh - 96px);
  overflow: auto;
  padding: 22px;
  border-radius: 8px;
}

.panel-head h1,
.export-band h2,
.price-panel h2 {
  margin: 6px 0 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 5vw, 4.6rem);
  line-height: 0.94;
  letter-spacing: 0;
}

.panel-head p,
.export-band p,
.price-panel p,
.auditor-copy {
  color: var(--muted);
  line-height: 1.55;
}

.kicker {
  display: inline-flex;
  align-items: center;
  color: var(--red);
  font-size: 0.77rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

fieldset {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 18px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

legend {
  padding: 0 8px;
  font-weight: 800;
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.86rem;
  color: var(--muted);
}

input,
select {
  min-width: 0;
  min-height: 40px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--field);
  color: var(--ink);
  padding: 8px 10px;
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(40, 95, 143, 0.28);
  outline-offset: 2px;
}

.check-grid {
  grid-template-columns: 1fr;
}

.check-grid label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.check-grid input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  accent-color: var(--green);
}

.primary-action {
  width: 100%;
  min-height: 50px;
}

.microcopy {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.output-panel {
  min-height: calc(100vh - 118px);
  padding: clamp(18px, 3vw, 30px);
  border-radius: 8px;
}

.notice {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 6px;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 700;
}

.scope-strip {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.scope-strip h2,
.section-heading h2,
.matrix-wrap h2 {
  margin: 4px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.7rem, 3vw, 3rem);
  line-height: 1;
  letter-spacing: 0;
}

.score-grid,
.readback-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(74px, 1fr));
  gap: 8px;
}

.metric {
  display: grid;
  gap: 2px;
  min-width: 74px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--field);
  text-align: center;
}

.metric b {
  font-size: 1.35rem;
}

.metric small {
  color: var(--muted);
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0;
}

.week-card,
.control-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
}

.week-card {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  min-height: 260px;
  padding: 16px;
}

.week-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.82rem;
}

.week-card h3 {
  margin: 12px 0;
  font-size: 1.05rem;
}

ul {
  margin: 0;
  padding-left: 19px;
}

li {
  margin-bottom: 8px;
  line-height: 1.42;
}

code {
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(24, 23, 19, 0.08);
  font-size: 0.82em;
}

.control-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.control-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 12px 14px;
  cursor: pointer;
}

.control-card summary::-webkit-details-marker {
  display: none;
}

.control-card b {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
}

.status-ready {
  background: var(--green-soft);
  color: var(--green);
}

.status-start {
  background: var(--red-soft);
  color: var(--red);
}

.status-next {
  background: var(--blue-soft);
  color: var(--blue);
}

.control-body {
  padding: 0 14px 14px;
  border-top: 1px solid var(--line);
}

.export-band,
.pricing-readback {
  margin: 0 clamp(18px, 4vw, 40px) clamp(18px, 4vw, 40px);
}

.export-band {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 22px;
  align-items: center;
  padding: clamp(18px, 3vw, 30px);
  border-radius: 8px;
}

.export-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.export-actions button:not(:first-child),
.price-panel button {
  background: transparent;
  color: var(--ink);
}

.pricing-readback {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: 22px;
}

.price-panel,
.readback-panel {
  padding: clamp(18px, 3vw, 28px);
  border-radius: 8px;
}

#signup-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  align-items: end;
}

#signup-status {
  grid-column: 1 / -1;
}

.event-list {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.event-list li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.event-list time {
  color: var(--muted);
  text-align: right;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: var(--ink);
  color: var(--panel);
  font-weight: 800;
}

.seo-link-band {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(360px, 1.2fr);
  gap: 22px;
  align-items: start;
  margin: 0 clamp(18px, 4vw, 40px) clamp(18px, 4vw, 40px);
  padding: clamp(18px, 3vw, 30px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(227, 244, 234, 0.58);
}

.seo-link-band h2 {
  margin: 6px 0 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.75rem, 4vw, 3.1rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.seo-link-band p,
.seo-hero p,
.seo-proof p,
.seo-content p,
.seo-faq p {
  color: var(--muted);
  line-height: 1.6;
}

.seo-link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.seo-link-grid a {
  display: grid;
  gap: 7px;
  min-height: 132px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  transition: transform 140ms ease-out, box-shadow 140ms ease-out;
}

.seo-link-grid a:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(38, 31, 19, 0.12);
}

.seo-link-grid strong {
  line-height: 1.16;
}

.seo-link-grid span {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.42;
}

.seo-page {
  min-height: 100vh;
}

.seo-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: clamp(18px, 4vw, 42px);
  align-items: end;
  padding: clamp(28px, 6vw, 74px) clamp(18px, 5vw, 64px) clamp(18px, 4vw, 44px);
}

.seo-hero h1 {
  margin: 8px 0 14px;
  max-width: 980px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.1rem, 5.7vw, 5.3rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.seo-hero .button-link {
  margin-top: 8px;
}

.seo-proof {
  padding: 22px;
  border: 1px solid var(--line);
  border-left: 6px solid var(--red);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.seo-content,
.seo-related,
.seo-faq {
  margin: 0 clamp(18px, 5vw, 64px) clamp(18px, 4vw, 40px);
}

.seo-content {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.seo-content article,
.seo-faq {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 252, 244, 0.96);
}

.seo-content article {
  padding: 18px;
  min-height: 230px;
}

.seo-related {
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(227, 244, 234, 0.48);
}

.seo-related .section-heading {
  margin-bottom: 16px;
}

.seo-content h2 {
  margin: 0 0 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  line-height: 1;
  letter-spacing: 0;
}

.seo-faq {
  padding: clamp(18px, 3vw, 28px);
}

.seo-faq details {
  border-top: 1px solid var(--line);
}

.seo-faq summary {
  min-height: 56px;
  padding: 16px 0;
  cursor: pointer;
  font-weight: 850;
}

.seo-faq details p {
  margin: 0;
  padding: 0 0 16px;
}

@media (max-width: 1080px) {
  .workspace,
  .export-band,
  .pricing-readback,
  .seo-link-band,
  .seo-hero,
  .seo-content {
    grid-template-columns: 1fr;
  }

  .triage-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace {
    padding: 14px;
  }

  fieldset,
  .week-grid,
  #signup-form {
    grid-template-columns: 1fr;
  }

  .scope-strip {
    flex-direction: column;
  }

  .score-grid,
  .readback-grid {
    width: 100%;
  }

  .control-card summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .export-band,
  .pricing-readback,
  .seo-link-band,
  .seo-content,
  .seo-faq {
    margin-left: 14px;
    margin-right: 14px;
  }

  .seo-link-grid {
    grid-template-columns: 1fr;
  }

  .seo-hero {
    padding-left: 14px;
    padding-right: 14px;
  }
}
