:root {
  /* layout: one reading column. creed, then today's drill, the week, the decision journal, and what this is */
  --paper: #F2F4F7;
  --card: #FFFFFF;
  --ink: #1A2130;
  --muted: #586274;
  --line: #D6DCE5;
  --ai: #2B4A80;   /* 藍: actions and labels */
  --shu: #BF3A28;  /* 朱: the seal and the quote rule */
  --font-display: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  --font-body: "BIZ UDPGothic", "Hiragino Sans", "Yu Gothic", "Meiryo", "Noto Sans JP", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0E131B;
    --card: #161D28;
    --ink: #E5E9F0;
    --muted: #9BA5B5;
    --line: #2A3446;
    --ai: #8EA8D8;
    --shu: #E46A55;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0E131B;
  --card: #161D28;
  --ink: #E5E9F0;
  --muted: #9BA5B5;
  --line: #2A3446;
  --ai: #8EA8D8;
  --shu: #E46A55;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.85;
  line-break: strict;
}
h1, h2, h3 { text-wrap: balance; word-break: auto-phrase; }
a { color: var(--ai); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--ai);
  outline-offset: 2px;
}
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.wrap { max-width: 46rem; margin: 0 auto; padding: 0 20px 48px; }

/* masthead */
.masthead { display: flex; flex-direction: column; gap: 14px; padding: 32px 0 6px; }
.brand { display: flex; gap: 14px; align-items: center; }
.seal {
  display: inline-grid; place-items: center; flex: none;
  width: 46px; height: 46px;
  border: 2px solid var(--shu); border-radius: 6px;
  color: var(--shu); font-family: var(--font-display); font-weight: 700; font-size: 24px;
  transform: rotate(-4deg);
}
h1 { font-family: var(--font-display); font-weight: 700; font-size: 32px; line-height: 1.2; margin: 0; letter-spacing: 0.06em; }
.tagline { margin: 4px 0 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
nav { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 15px; }
nav a { text-decoration: none; border-bottom: 1px solid transparent; }
nav a:hover { border-bottom-color: currentColor; }

.intro { padding-top: 22px; }
.intro .q { font-size: 22px; line-height: 1.6; margin: 0 0 14px; }
.intro .flow {
  display: grid; gap: 10px;
  padding: 2px 0 2px 16px;
  border-left: 3px solid var(--ai);
  font-family: var(--font-display); font-weight: 600; font-size: 17px; line-height: 1.9;
}
.intro .flow p { margin: 0; }
.intro .bridge { margin: 18px 0 8px; font-weight: 700; word-break: auto-phrase; }
.intro .how { margin: 0; font-size: 15px; color: var(--muted); }
.nw { white-space: nowrap; }

section { padding: 30px 0 6px; }
section + section { border-top: 1px solid var(--line); margin-top: 26px; }
h2 { font-family: var(--font-display); font-weight: 700; font-size: 24px; line-height: 1.4; margin: 0 0 14px; }
.lead { margin: -4px 0 16px; color: var(--muted); font-size: 15px; }

/* drill cards */
.today-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 14px; flex-wrap: wrap; }
.date { margin: 0 0 12px; color: var(--muted); font-size: 15px; font-variant-numeric: tabular-nums; }
.drill {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
}
.drill--today { border-color: var(--ai); }
.meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 8px; font-size: 13px; color: var(--muted); line-height: 1.4; }
.chip {
  display: inline-block; padding: 4px 10px;
  border: 1px solid currentColor; border-radius: 999px;
  font-size: 13px; font-weight: 700; line-height: 1.3; white-space: nowrap;
}
.drill--now { border-color: var(--ai); }
.drill--now .meta { color: var(--ai); font-weight: 700; }
.drill h3.do { font-family: var(--font-display); font-weight: 700; font-size: 20px; line-height: 1.7; color: var(--ink); margin: 0 0 6px;  word-break: auto-phrase; }
.check { margin: 0 0 16px; font-size: 15px; line-height: 1.7; color: var(--muted); }
.check .when {
  display: inline-block; margin-right: 8px; padding: 0 8px;
  border: 1px solid currentColor; border-radius: 999px;
  font-size: 12px; font-weight: 700; line-height: 1.6;
}
.drill--today h3.do { padding-right: 64px; }
.quote {
  margin: 4px 0 0; padding: 12px 14px;
  border-left: 3px solid var(--shu); border-radius: 0 8px 8px 0;
  background: var(--paper);
}
.quote p { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 17px; line-height: 1.9; }
.quote p.en { font-family: var(--font-body); font-weight: 400; font-size: 13px; line-height: 1.6; color: var(--muted); margin-top: 4px; }
.quote cite { display: block; margin-top: 6px; font-style: normal; font-size: 13px; color: var(--muted); }
.k-note { margin: 10px 0 0; }
.k-link { display: inline-block; margin-top: 6px; font-size: 14px; }
.drill dl { margin: 0; display: grid; gap: 10px; }
.drill dt { font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: 0.08em; line-height: 1.4; }
.drill dd { margin: 0; }
.share {
  margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line);
  display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; justify-content: space-between;
}
.share-text { margin: 0; flex: 1 1 18rem; font-size: 15px; line-height: 1.7; }
.stamp {
  position: absolute; top: 16px; right: 16px;
  width: 54px; height: 54px; display: grid; place-items: center;
  border: 3px solid var(--shu); border-radius: 50%;
  color: var(--shu); font-family: var(--font-display); font-weight: 700; font-size: 24px;
  transform: rotate(-12deg);
}
.stamp[hidden] { display: none; }

.src-list { margin: 1.2em 0; }
.src-list summary { cursor: pointer; font-weight: 700; }
.src-list ul { list-style: none; padding: 0; margin: .6em 0 0; font-size: 14px; line-height: 1.8; }
.src-list li { padding: .35em 0; border-top: 1px solid rgba(127, 127, 127, .25); }
.src-list .src-day { display: inline-block; min-width: 6.5em; opacity: .7; }
.week-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 14px; }
.week-grid .drill { padding: 18px; }
.week-grid h3.do { font-size: 18px; }
.week-grid .quote p { font-size: 16px; }
.week-grid .drill dd { font-size: 15px; line-height: 1.8; }

/* buttons */
.btn {
  font: inherit; font-size: 15px; font-weight: 700; line-height: 1.4;
  border-radius: 8px; padding: 10px 16px; cursor: pointer;
  border: 1px solid var(--ai);
}
.btn-primary { background: var(--ai); color: var(--card); }
.btn-ghost { background: transparent; color: var(--ai); }
.btn-quiet { background: transparent; border-color: transparent; color: var(--muted); padding: 6px 8px; font-weight: 400; text-decoration: underline; }
.btn-quiet.is-armed { color: var(--shu); }

/* this week's record */
.streak { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; margin-top: 14px; }
.dots { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.dots li {
  width: 32px; height: 32px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%;
  font-size: 13px; line-height: 1; color: var(--muted);
}
.dots li.is-today { border-color: var(--ai); color: var(--ai); font-weight: 700; }
.dots li.done { background: var(--shu); border-color: var(--shu); color: var(--card); }

/* journal */
.j-form { display: grid; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px; }
.field { display: grid; gap: 4px; }
.field label { font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: 0.06em; }
.field textarea, .field input[type="date"], .review input[type="text"] {
  font: inherit; font-size: 16px; line-height: 1.6; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%;
}
.field textarea { resize: vertical; min-height: 3.4em; }
.field--date input { max-width: 14rem; }
.form-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; justify-content: space-between; }
.note { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.note.warn { color: var(--shu); }

.j-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 12px; }
.entry { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.entry.is-due { border-left-color: var(--shu); }
.entry.is-done { border-left-color: var(--ai); }
.entry-head { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-content: space-between; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.status-due { color: var(--shu); }
.status-wait { color: var(--muted); }
.status-done { color: var(--ai); }
.entry-what { margin: 8px 0 4px; font-weight: 700; }
.entry-sub { margin: 0; font-size: 15px; }
.entry-sub b { font-size: 13px; color: var(--muted); margin-right: 6px; }
.review { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); display: grid; gap: 8px; }
.review fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.review legend { font-size: 13px; font-weight: 700; color: var(--muted); padding: 0; margin-bottom: 4px; width: 100%; }
.review label { font-size: 15px; display: inline-flex; gap: 6px; align-items: center; }
.verdict { margin: 10px 0 0; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 15px; }
.entry-foot { display: flex; justify-content: flex-end; margin-top: 6px; }
.empty { color: var(--muted); font-size: 15px; margin: 14px 0 0; }

/* feedback */
.critique { margin-top: 14px; background: var(--card); border: 1px solid var(--ai); border-radius: 10px; padding: 14px 16px; }
.critique h3, .scorecard h3 { font-family: var(--font-display); font-weight: 700; font-size: 18px; line-height: 1.5; margin: 0 0 8px; }
.critique ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.critique li { display: grid; grid-template-columns: 1.6em 1fr; font-size: 15px; line-height: 1.7; }
.mark-ok { color: var(--ai); font-weight: 700; }
.mark-ng { color: var(--shu); font-weight: 700; }
.scorecard { margin-top: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.scorecard p { margin: 8px 0 0; font-size: 15px; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tile { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.tile b { display: block; font-size: 22px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.tile span { font-size: 13px; color: var(--muted); line-height: 1.4; }
.entry-tools { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 10px; }
.entry-tools a { font-size: 14px; }
.entry-tools .btn-quiet { margin-left: auto; }
.prompt-copy {
  width: 100%; margin-top: 8px; font: inherit; font-size: 14px; line-height: 1.6; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
}

/* about */
.fine { margin: 22px 0 0; font-size: 13px; color: var(--muted); line-height: 1.8; }

@media (max-width: 420px) {
  .wrap { padding: 0 16px 40px; }
  h1 { font-size: 28px; }
  .intro .q { font-size: 20px; }
  .intro .flow { font-size: 16px; }
  .drill { padding: 16px; }
  .drill--today h3.do { font-size: 19px; }
  .quote p { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* public site: what is sent to the analytics, and the note for browsers without JavaScript */
.disclose { margin-top: 22px; font-size: 14px; line-height: 1.8; color: var(--muted); }
.disclose h3 { font-family: var(--font-display); font-weight: 700; font-size: 16px; line-height: 1.5; margin: 0 0 4px; color: var(--ink); }
.disclose p { margin: 0 0 6px; }
.disclose ul { margin: 0; padding-left: 1.2em; }
.disclose li { margin: 2px 0; }
.nojs { margin: 0 0 12px; }
.h1-like { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 32px; line-height: 1.2; letter-spacing: 0.06em; }
.h1-like a { color: var(--ink); text-decoration: none; }
h1.nf { font-size: 24px; line-height: 1.4; margin: 0 0 14px; letter-spacing: 0; }
@media (max-width: 420px) { .h1-like { font-size: 28px; } }
