:root {
  --ink: #102a2a;
  --muted: #5f7371;
  --line: #d5e0dd;
  --paper: #ffffff;
  --wash: #f1f6f4;
  --teal: #0c7068;
  --teal-dark: #07554f;
  --teal-soft: #d9efeb;
  --amber: #f4ad32;
  --amber-soft: #fff1d2;
  --danger: #b73535;
  --shadow: 0 18px 50px rgba(16, 42, 42, .09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--wash);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; font-size: 16px; line-height: 1.55; background: var(--wash); }
button, input, select { font: inherit; }
a { color: var(--teal-dark); }
[hidden] { display: none !important; }

.skip-link { position: fixed; top: 12px; left: 12px; z-index: 10; transform: translateY(-150%); padding: 10px 14px; border-radius: 8px; background: var(--ink); color: white; }
.skip-link:focus { transform: translateY(0); }
.site-header { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 24px; max-width: 1480px; margin: auto; padding: 0 32px; background: var(--paper); border-bottom: 1px solid var(--line); }
.site-header .brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 850; letter-spacing: -.02em; font-size: 1.2rem; }
.site-header nav, footer nav { display: flex; flex-wrap: wrap; gap: 22px; }
.site-header nav a, footer a { color: var(--muted); text-decoration: none; font-weight: 700; }
.site-header nav a:hover, .site-header nav a:focus-visible, footer a:hover, footer a:focus-visible { color: var(--teal); text-decoration: underline; text-underline-offset: 4px; }

.intro-band { padding: 64px max(32px, calc((100vw - 1420px) / 2)); background: var(--ink); color: white; }
.intro-band h1 { max-width: 900px; margin: 7px 0 14px; font-size: clamp(2.2rem, 5vw, 4.6rem); line-height: 1.02; letter-spacing: -.055em; }
.intro-band > p:last-child { max-width: 760px; margin: 0; color: #c8d8d5; font-size: 1.08rem; }
.eyebrow, .step { margin: 0; color: var(--teal); font-size: .76rem; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.intro-band .eyebrow { color: var(--amber); }

.planner-shell { display: grid; grid-template-columns: minmax(440px, 530px) minmax(0, 1fr); gap: 24px; max-width: 1480px; margin: -24px auto 64px; padding: 0 32px; position: relative; }
.planner-form, .plan-panel { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.planner-form { padding: 28px; }
.plan-panel { min-height: 680px; padding: 28px; }
.form-heading, .subjects-heading, .result-heading, .day-heading, .progress-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.form-heading h2, .subjects-heading h2, .result-heading h2 { margin: 3px 0 0; font-size: 1.35rem; letter-spacing: -.025em; }
.text-button { padding: 5px 0; border: 0; background: transparent; color: var(--teal); font-weight: 800; cursor: pointer; }
.text-button:hover { text-decoration: underline; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 24px 0 30px; }
.field-grid .wide { grid-column: 1 / -1; }
label { display: grid; gap: 7px; color: var(--ink); font-size: .88rem; font-weight: 800; }
input, select { width: 100%; min-height: 46px; padding: 10px 12px; color: var(--ink); border: 1px solid #b9cac6; border-radius: 9px; background: white; }
input:focus, select:focus { outline: 3px solid rgba(12, 112, 104, .18); border-color: var(--teal); }
.subjects-heading { align-items: end; padding-top: 24px; border-top: 1px solid var(--line); }
.subjects-heading p:last-child { max-width: 330px; margin: 5px 0 0; color: var(--muted); font-size: .9rem; }
.subject-list { display: grid; gap: 12px; margin: 18px 0; }
.subject-row { display: grid; grid-template-columns: 1.45fr 1fr 1fr auto; gap: 10px; align-items: end; padding: 14px; border-radius: 12px; background: var(--wash); border: 1px solid transparent; }
.subject-row:focus-within { border-color: var(--teal); }
.subject-row label { font-size: .76rem; }
.remove-subject { min-height: 44px; padding: 0 8px; border: 0; background: transparent; color: var(--danger); font-size: .8rem; font-weight: 800; cursor: pointer; }
.primary-button, .secondary-button { min-height: 44px; border-radius: 9px; font-weight: 850; cursor: pointer; }
.primary-button { width: 100%; min-height: 52px; padding: 12px 20px; border: 1px solid var(--teal); background: var(--teal); color: white; box-shadow: 0 7px 16px rgba(12, 112, 104, .2); }
.primary-button:hover { background: var(--teal-dark); }
.secondary-button { padding: 9px 14px; border: 1px solid var(--teal); background: white; color: var(--teal); }
.secondary-button:hover { background: var(--teal-soft); }
.form-status { min-height: 25px; margin: 12px 0 0; font-weight: 750; font-size: .9rem; }
.form-status.success { color: var(--teal-dark); }
.form-status.error { color: var(--danger); }

.empty-plan { min-height: 620px; display: grid; place-content: center; justify-items: center; text-align: center; }
.empty-plan h2 { margin: 22px 0 6px; letter-spacing: -.03em; }
.empty-plan p { max-width: 430px; margin: 0; color: var(--muted); }
.calendar-mark { width: 128px; height: 138px; display: grid; place-items: center; align-content: center; border-radius: 18px; background: var(--amber-soft); border: 2px solid var(--amber); transform: rotate(-2deg); }
.calendar-mark span, .calendar-mark small { color: #7a5310; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.calendar-mark strong { font-size: 3rem; line-height: 1; }
.calendar-mark small { font-size: .66rem; }
.plan-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 20px 0; }
.plan-stats > div { display: grid; padding: 14px; border-radius: 11px; background: var(--wash); }
.plan-stats strong { font-size: 1.25rem; }
.plan-stats span { color: var(--muted); font-size: .78rem; font-weight: 750; }
.progress-row { align-items: center; padding: 16px 0; border-block: 1px solid var(--line); }
.progress-row > div { display: grid; }
.progress-row span { color: var(--muted); font-size: .78rem; font-weight: 800; text-transform: uppercase; }
progress { width: min(50%, 320px); height: 12px; accent-color: var(--teal); }
.schedule { display: grid; gap: 12px; margin-top: 18px; max-height: 770px; padding-right: 4px; overflow: auto; }
.day-card { border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.day-heading { align-items: center; padding: 12px 15px; background: var(--ink); color: white; }
.day-heading h3 { margin: 0; font-size: 1rem; }
.day-heading span { padding: 3px 8px; border-radius: 999px; background: var(--amber); color: var(--ink); font-size: .68rem; font-weight: 900; }
.session-list { display: grid; }
.session-item { grid-template-columns: auto 1fr; align-items: center; gap: 12px; padding: 12px 15px; border-top: 1px solid var(--line); cursor: pointer; }
.session-item:first-child { border-top: 0; }
.session-item:hover { background: var(--wash); }
.session-item input { width: 19px; min-height: 19px; accent-color: var(--teal); }
.session-item span { display: grid; }
.session-item small { color: var(--muted); font-weight: 500; }
.session-item.done { background: #edf5f2; }
.session-item.done strong { color: var(--muted); text-decoration: line-through; }

.content-section, .faq-section, .legal-page { max-width: 1160px; margin: 0 auto; padding: 72px 32px; }
.content-section > div:first-child { max-width: 600px; }
.content-section h2, .faq-section h2, .legal-page h1 { margin: 6px 0 24px; font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1.08; letter-spacing: -.04em; }
.explain-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 30px; }
.explain-grid article { padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.explain-grid article > span { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--amber-soft); color: #76500f; font-weight: 900; }
.explain-grid h3 { margin: 18px 0 7px; }
.explain-grid p { margin: 0; color: var(--muted); }
.faq-section { padding-top: 22px; }
.faq-section details { padding: 19px 0; border-top: 1px solid var(--line); }
.faq-section summary { font-weight: 850; cursor: pointer; }
.faq-section details p { max-width: 760px; margin-bottom: 0; color: var(--muted); }

.breadcrumb { margin-bottom: 28px; color: var(--muted); font-size: .9rem; }
.breadcrumb a { font-weight: 750; }
.legal-page { min-height: 65vh; max-width: 900px; }
.legal-page .lead { color: var(--muted); font-size: 1.12rem; }
.legal-page h2 { margin: 36px 0 8px; font-size: 1.35rem; }
.legal-page li + li { margin-top: 8px; }
.notice { padding: 17px 19px; border-left: 4px solid var(--amber); background: var(--amber-soft); }

footer { display: flex; justify-content: space-between; gap: 24px; padding: 28px max(32px, calc((100vw - 1420px) / 2)); background: var(--ink); color: #c8d8d5; }
footer p { margin: 0; }
footer a { color: #dce9e6; }

@media (max-width: 900px) {
  .planner-shell { grid-template-columns: 1fr; margin-top: -18px; }
  .plan-panel { min-height: 450px; }
  .empty-plan { min-height: 390px; }
  .explain-grid { grid-template-columns: 1fr; }
  .schedule { max-height: none; }
}

@media (max-width: 620px) {
  .site-header { padding: 0 18px; }
  .site-header nav a:not(:last-child) { display: none; }
  .intro-band { padding: 48px 20px 52px; }
  .planner-shell { padding: 0 12px; }
  .planner-form, .plan-panel { padding: 20px 16px; border-radius: 14px; }
  .field-grid { grid-template-columns: 1fr; }
  .field-grid .wide { grid-column: auto; }
  .subjects-heading { align-items: flex-start; flex-direction: column; }
  .subject-row { grid-template-columns: 1fr 1fr; }
  .subject-row label:first-child { grid-column: 1 / -1; }
  .remove-subject { justify-self: start; }
  .plan-stats { grid-template-columns: 1fr; }
  .result-heading { align-items: flex-start; flex-direction: column; }
  .progress-row { align-items: stretch; flex-direction: column; }
  progress { width: 100%; }
  .content-section, .faq-section, .legal-page { padding-inline: 20px; }
  footer { padding: 26px 20px; flex-direction: column; }
}

@media print {
  @page { margin: 14mm; }
  body { background: white; font-size: 11pt; }
  .skip-link, .site-header, .intro-band, .planner-form, .content-section, .faq-section, footer, .result-heading button { display: none !important; }
  .planner-shell { display: block; margin: 0; padding: 0; max-width: none; }
  .plan-panel { min-height: 0; padding: 0; border: 0; box-shadow: none; }
  .schedule { max-height: none; overflow: visible; }
  .day-card { break-inside: avoid; }
  .session-item { padding-block: 7px; }
}
