:root {
  color-scheme: light;
  font-family: "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  --brand: #06152C;
  --ink: #1c2c3e;
  --muted: #475568;
  --line: #d9e0ea;
  --canvas: #f6f8fb;
  --warning-ink: #83420f;
  --warning-background: #fff4e3;
  --error-ink: #9b3024;
  --error-background: #fff3ee;
  --suspended-ink: #98243b;
  --suspended-background: #fff1f4;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--canvas); line-height: 1.65; }
h1, h2, p { margin: 0; }
a { color: #155a66; text-underline-offset: .18em; overflow-wrap: anywhere; }
button:focus-visible, a:focus-visible { outline: 3px solid #16788c; outline-offset: 4px; }

.container { width: min(100% - 32px, 1000px); margin-inline: auto; }
.site-header { background: var(--brand); color: #fff; }
.brand-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-block: 15px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-logo-plate {
  display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px;
  border-radius: 10px; background: #fff; padding: 4px;
}
.brand-logo { display: block; width: 100%; height: 100%; object-fit: contain; }

.brand strong, .brand small { display: block; line-height: 1.35; }
.brand strong { font-size: 1.05rem; overflow-wrap: anywhere; }
.brand small { color: #cbd8ec; font-size: .69rem; }
.prototype {
  flex-shrink: 0; color: var(--warning-ink); background: var(--warning-background); padding: 4px 8px;
  border: 1px solid #eed6af; border-radius: 6px; font-size: .69rem; font-weight: 700;
}
.site-copy { margin-top: 17px; color: var(--brand); font-weight: 750; font-size: 1.08rem; }
.date-row { margin: 18px 0 10px; color: var(--muted); font-size: .82rem; font-variant-numeric: tabular-nums; }

.status {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  border-inline-start: 4px solid var(--line); padding: 24px 21px; margin-bottom: 24px;
}
.status h1 { margin-bottom: 5px; font-size: 1.35rem; }
.status p { color: var(--muted); }
.status p:empty { display: none; }

.lesson {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 20px; margin-bottom: 30px; box-shadow: 0 8px 24px #06152c0b;
  overflow-wrap: anywhere;
}
.lesson-title { border-bottom: 1px solid var(--line); padding-block: 1px 16px; margin-bottom: 16px; }
.eyebrow { color: var(--brand); font-size: .85rem; font-weight: 800; }
.lesson h1 { color: var(--brand); margin-block: 3px 8px; font-size: clamp(1.55rem, 4vw, 2.35rem); line-height: 1.32; }
.lesson-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; color: var(--muted); font-size: .75rem; }
.fixture-note { font-weight: 750; color: var(--warning-ink); }
.lesson-grid { display: grid; gap: 11px; }
.panel {
  padding: 13px 15px 14px;
  background: #f4f7f6; border-radius: 9px; border: 1px solid #e0e8e5; border-inline-start: 4px solid #839e98;
}
.panel h2, .money-panel h2 { color: var(--brand); font-size: 1rem; margin-bottom: 4px; line-height: 1.4; }
.panel p, .money-panel p { font-size: 1rem; line-height: 1.7; white-space: pre-wrap; }
.panel.action { border-inline-start-color: #318073; background: #ecf7f2; }
.panel.question { border-inline-start-color: #ba583a; background: #fcf3ed; }
.money-panel { margin-top: 12px; padding: 13px 15px; border-inline-start: 4px solid #a66d18; background: #fbf5e8; }
.controls { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 17px; }
.controls button {
  flex: 1 1 145px; min-height: 46px; cursor: pointer; padding: 8px 14px; border: 1px solid var(--brand);
  border-radius: 7px; background: var(--brand); color: #fff; font: inherit; font-size: .85rem; font-weight: 750;
}
.controls button.secondary { background: #fff; color: var(--brand); }
.source { padding-top: 13px; border-top: 1px solid var(--line); color: var(--muted); font-size: .76rem; }
.source h2 { color: var(--brand); font-size: .83rem; margin-bottom: 4px; }
#metadata { display: flex; flex-wrap: wrap; gap: 1px 12px; }
#metadata span { max-width: 100%; }
.source ul { margin: 4px 0 10px; padding-inline-start: 1.4em; }
.source li { padding-inline-end: .65em; }
.source li + li { margin-top: .3em; }
.source-url { display: none; }
.reuse { line-height: 1.55; }
.signature { margin-top: 8px; font-weight: 650; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media screen and (max-width: 360px) {
  .brand-row, .brand { gap: 8px; }
  .prototype { padding-inline: 5px; font-size: .625rem; }
}

@media screen and (min-width: 680px) {
  .brand-row { padding-block: 18px; }
  .date-row { margin-top: 25px; }
  .lesson { padding: 27px 32px; }
  .lesson-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
  .panel { padding: 17px 18px; }
  .controls button { flex: 0 0 auto; }
}

@media screen {
  .status:is([data-state="unavailable"], [data-state="waiting"]) {
    background: var(--error-background);
    border-inline-start-color: var(--error-ink);
    color: var(--error-ink);
  }
  .status:is([data-state="suspended"], [data-state="revoked"]) {
    background: var(--suspended-background);
    border-inline-start-color: var(--suspended-ink);
    color: var(--suspended-ink);
  }

  body.presentation { background: var(--brand); color: #f7f9fd; }
  .presentation .date-row, .presentation .site-copy, .presentation .brand small { display: none; }
  .presentation .brand-row { padding-block: 10px 0; }
  .presentation .brand-logo-plate { flex-basis: 34px; width: 34px; height: 34px; padding: 2px; }
  .presentation .brand strong { font-size: .85rem; }
  .presentation .container { width: min(100% - 28px, 1240px); }
  .presentation .lesson { background: none; border: 0; box-shadow: none; padding: 18px 0 0; }
  .presentation .lesson-title, .presentation .source { border-color: #4c607c; }
  .presentation .eyebrow { color: #cbdcf5; }
  .presentation .fixture-note { color: #ffe0bd; }
  .presentation .lesson-meta, .presentation .source { color: #cbd8ec; }
  .presentation .source h2 { color: #f7f9fd; }
  .presentation .source a { color: #e0ecff; }
  .presentation .lesson h1 { color: #f7f9fd; font-size: clamp(1.8rem, 4vw, 3.8rem); }
  .presentation .panel, .presentation .money-panel { color: var(--ink); }
  .presentation .panel h2, .presentation .money-panel h2 { font-size: clamp(1.13rem, 1.9vw, 1.6rem); }
  .presentation .panel p, .presentation .money-panel p { font-size: clamp(1.1rem, 1.8vw, 1.45rem); }
  .presentation .controls button { border-color: #9baecb; }
}

@page { size: A4 portrait; margin: 13mm; }

@media print {
  body { color: #151515; background: #fff; font-size: 10pt; line-height: 1.48; }
  .no-print { display: none !important; }
  .container { width: 100%; margin: 0; }
  .site-header { background: transparent; color: var(--brand); }
  .brand-row { padding: 0 0 2mm; }
  .brand { gap: 1.5mm; }
  .brand-logo-plate { flex-basis: 7mm; width: 7mm; height: 7mm; padding: 0; background: transparent; }
  .brand strong { font-size: 9pt; }
  .brand small, .prototype { display: none; }
  .lesson, .status { border: 0; box-shadow: none; border-radius: 0; padding: 0; margin: 0; }
  .status p { color: #252525; }
  .lesson-title { border-color: #555; margin-bottom: 4mm; padding: 0 0 3mm; }
  .lesson h1 { margin: 1mm 0 2mm; font-size: 18pt; }
  .lesson-meta { font-size: 8.5pt; }
  .lesson h1, .lesson h2, .eyebrow, .fixture-note, .lesson-meta, .source, .source a { color: #252525; }
  .eyebrow { font-size: 9pt; }
  .lesson-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3mm; }
  .lesson .panel, .money-panel {
    border: 0.5pt solid #a3a3a3; border-radius: 0;
    padding: 2.5mm; background: #fff !important; break-inside: avoid;
  }
  .panel h2, .money-panel h2 { font-size: 10pt; }
  .panel p, .money-panel p { font-size: 10pt; line-height: 1.48; }
  .money-panel { margin-top: 3mm; }
  .source { border-color: #a3a3a3; font-size: 8.5pt; margin-top: 4mm; padding-top: 3mm; break-inside: avoid; }
  .source h2 { font-size: 9pt; }
  .source ul { margin: 1mm 0 2mm; }
  .source a { text-decoration: none; }
  .source-url { display: block; overflow-wrap: anywhere; }
  .lesson-title { break-after: avoid; }
  .source li { break-inside: avoid; }
}


/* Informational pages and shared non-print footer */
.brand-link { color: inherit; text-decoration: none; }
.brand-link:hover { text-decoration: none; }
.info-main { padding-block: 24px 40px; }
.info-page { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 26px 32px; box-shadow: 0 8px 24px #06152c0b; }
.info-page h1 { color: var(--brand); font-size: clamp(1.55rem, 4vw, 2.2rem); line-height: 1.35; margin: 4px 0 12px; }
.info-lead { color: var(--brand); font-size: 1.12rem; font-weight: 700; }
.info-page section { padding: 18px 0; border-bottom: 1px solid var(--line); }
.info-page section h2 { color: var(--brand); margin-bottom: 6px; font-size: 1.1rem; }
.info-page section p { font-size: .96rem; }
.legal-draft { background: #fff4e3; border-inline-start: 4px solid #83420f; padding: 12px; color: #83420f; border-radius: 5px; }
.info-back { padding-top: 20px; }
.site-footer { margin-top: 20px; background: #fff; border-top: 1px solid var(--line); }
.footer-inner { padding-block: 20px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 24px; }
.footer-ident { display: grid; gap: 3px; font-size: .81rem; color: var(--muted); }
.footer-ident strong { color: var(--brand); font-size: .92rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: .81rem; }
.footer-links a { color: var(--brand); }
@media screen and (max-width: 680px) {
  .info-main { padding-block: 15px 28px; }
  .info-page { padding: 21px 19px; }
  .info-page section { padding: 15px 0; }
  .footer-inner { flex-direction: column; }
  .footer-links { flex-direction: column; gap: 8px; }
}
@media screen {
  body.presentation .site-footer { display: none; }
}
@media print {
  .site-footer { display: none !important; }
  .info-page { border: 0; box-shadow: none; padding: 0; }
}

.print-unverified { display: none; }
@media print {
  body:not(.print-verified) #lesson { display: none !important; }
  body:not(.print-verified):has(#lesson:not([hidden])) .print-unverified { display: block; }
}
