:root {
  color-scheme: light;
  --paper: #f5f2eb;
  --paper-deep: #ebe6dc;
  --surface: #fbfaf6;
  --ink: #1c1c1a;
  --muted: #6e6a61;
  --faint: #9b968d;
  --line: #d8d2c6;
  --accent: #b63a2b;
  --accent-dark: #8f2e23;
  --success: #426752;
  --serif: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "YuGothic", "Noto Sans JP", sans-serif;
  --measure: 1040px;
  --shadow: 0 16px 48px rgba(28, 28, 26, .055);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: .12em;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--ink);
  font-size: 15px;
  letter-spacing: 0;
}
.brand.compact .brand-mark { width: 34px; height: 34px; font-size: 14px; }
.brand.compact { font-size: 13px; }
.eyebrow, .section-label {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2em;
}

.login-shell {
  min-height: 100svh;
  display: grid;
  align-items: center;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  background: var(--paper);
}
.login-panel {
  width: min(100%, 520px);
  margin: auto;
  padding: clamp(30px, 7vw, 58px);
  border: 1px solid var(--line);
  background: rgba(251,250,246,.94);
  box-shadow: var(--shadow);
}
.login-panel::before {
  content: "";
  display: block;
  width: 52px;
  height: 2px;
  margin-bottom: 34px;
  background: var(--accent);
}
.login-copy { margin: 8px 0 34px; }
.login-copy h1, .welcome-block h1, .session-hero h1, .guide-hero h1, .admin-title h1, .simple-page h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.42;
  letter-spacing: .035em;
}
.login-copy h1 { font-size: clamp(27px, 5vw, 37px); }
.login-copy p:not(.eyebrow) { margin: 20px 0 0; color: var(--muted); font-size: 14px; }
.login-form { display: grid; gap: 14px; }
.login-form > label, .admin-form label { color: var(--muted); font-size: 13px; font-weight: 600; }
.password-field { position: relative; }
.password-field input { padding-right: 68px; }
input, textarea, select {
  width: 100%;
  min-height: 48px;
  margin-top: 7px;
  padding: 12px 13px;
  border: 1px solid #c9c2b5;
  border-radius: 2px;
  background: #fffefa;
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { resize: vertical; line-height: 1.65; }
input:focus, textarea:focus, select:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px rgba(182,58,43,.1); }
.reveal {
  position: absolute;
  right: 8px;
  top: 15px;
  min-width: 50px;
  min-height: 36px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}
.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .04em;
  text-decoration: none;
  transition: background .16s ease, color .16s ease, transform .12s ease;
}
.button:active { transform: translateY(1px); }
.button.primary { border-color: #aaa398; background: #e7e2d8; color: var(--ink); }
.button.primary:hover { border-color: #8d877d; background: #ddd7cc; }
.button.secondary { background: transparent; color: var(--ink); }
.button.secondary:hover { border-color: #8d877d; background: #ebe6dc; color: var(--ink); }
.button.full { width: 100%; margin-top: 5px; }
.button.small { min-height: 40px; padding: 8px 14px; font-size: 12px; }
.button[aria-busy="true"]::after { content: ""; width: 13px; height: 13px; border: 1px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: turn .7s linear infinite; }
@keyframes turn { to { transform: rotate(360deg); } }
.quiet-note { margin: 24px 0 0; color: var(--faint); font-size: 12px; }
.form-error { padding: 11px 13px; border-left: 2px solid var(--accent); background: #f8eae6; color: var(--accent-dark); font-size: 13px; }

.portal-shell { min-height: 100svh; padding-bottom: 76px; }
.portal-header, .admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(245,242,235,.92);
  backdrop-filter: blur(14px);
}
.client-chip { color: var(--muted); font-size: 12px; }
.portal-main { width: min(var(--measure), calc(100% - 40px)); margin: 0 auto; }
.welcome-block { padding: 48px 0 44px; }
.welcome-block h1 { font-size: clamp(29px, 5vw, 42px); }
.next-session {
  position: relative;
  display: grid;
  gap: 28px;
  padding: 30px 26px;
  border: 1px solid var(--line);
  background: rgba(251,250,246,.72);
  color: var(--ink);
}
.next-session > * { position: relative; z-index: 1; }
.next-session .section-label { color: var(--accent); }
.next-date { margin: 6px 0 14px; font-family: var(--serif); font-size: 23px; letter-spacing: .04em; }
.next-date span { color: var(--muted); font-family: var(--sans); font-size: 15px; }
.next-session h2 { margin: 0; font-family: var(--serif); font-size: 25px; font-weight: 500; }
.next-session p:last-child { margin: 12px 0 0; color: var(--muted); font-size: 14px; }
.next-session .button { align-self: end; border-color: #aaa398; background: #e7e2d8; color: var(--ink); }
.next-session-actions { display: grid; gap: 9px; align-self: end; }
.next-session-actions > .button { width: 100%; }
.next-session-actions .event-actions { display: grid; gap: 9px; margin: 0; }
.event-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.event-button { min-height: 40px; padding: 8px 14px; background: var(--surface); font-size: 11px; }
.next-session .event-button { background: var(--surface); }
.section-block { padding: 58px 0; scroll-margin-top: 20px; }
.section-heading { margin-bottom: 26px; }
.section-heading h2, .reading-section h2, .guide-service h2, .guide-finish h2, .admin-section h2 { margin: 0; font-family: var(--serif); font-size: 25px; font-weight: 500; letter-spacing: .04em; }
.action-list { display: grid; gap: 8px; }
.action-row { display: grid; grid-template-columns: 26px 1fr; gap: 13px; padding: 16px 0; }
.action-check { display: grid; place-items: center; width: 22px; height: 22px; margin-top: 1px; border: 1px solid var(--ink); color: var(--surface); font-size: 12px; }
.action-row.done .action-check { border-color: var(--success); background: var(--success); }
.action-row strong { display: block; font-size: 14px; font-weight: 600; line-height: 1.6; }
.action-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.action-row.done strong { color: var(--muted); text-decoration: line-through; text-decoration-color: #bcb5aa; }
.timeline { display: grid; gap: 8px; }
.timeline-row { display: grid; grid-template-columns: 88px 12px 1fr 18px; gap: 12px; align-items: start; min-height: 0; padding: 22px 0 25px; text-decoration: none; }
.timeline-date { padding-top: 2px; font-family: var(--serif); font-size: 14px; }
.timeline-marker { width: 7px; height: 7px; margin-top: 7px; border: 1px solid var(--ink); border-radius: 50%; }
.timeline-marker.planned { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 4px rgba(182,58,43,.1); }
.timeline-copy strong, .document-row strong { display: block; font-size: 15px; font-weight: 600; line-height: 1.5; }
.timeline-copy small, .document-row small { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.timeline-copy .timeline-summary { display: -webkit-box; margin-top: 12px; overflow: hidden; color: #7d786f; line-height: 1.75; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.timeline-row .row-arrow { align-self: center; }
.row-arrow { color: var(--faint); font-family: var(--serif); font-size: 24px; text-align: right; }
.document-list { display: grid; gap: 4px; }
.document-row { display: grid; grid-template-columns: 40px 1fr 20px; gap: 14px; align-items: center; min-height: 78px; padding: 12px 0; text-decoration: none; }
.doc-icon { display: grid; place-items: center; width: 38px; height: 44px; border: 1px solid var(--line); background: var(--surface); font-family: var(--serif); font-size: 12px; }
.guide-row .doc-icon { border-color: #b8b1a6; background: #eee9df; color: var(--ink); }

.mobile-nav {
  position: fixed;
  z-index: 20;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 7px 10px max(7px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(251,250,246,.96);
  backdrop-filter: blur(16px);
}
.mobile-nav a, .mobile-nav button { display: grid; place-items: center; gap: 1px; width: 100%; min-height: 47px; border: 0; background: transparent; color: var(--muted); font-size: 10px; text-decoration: none; }
.mobile-nav span { color: var(--ink); font-family: var(--serif); font-size: 16px; }
.mobile-nav form { margin: 0; }

.detail-main { max-width: 800px; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 6px; padding: 24px 0; color: var(--muted); font-size: 12px; }
.breadcrumbs a { text-underline-offset: 3px; }
.session-detail, .guide { padding-bottom: 90px; }
.session-hero { padding: 40px 0 48px; border-bottom: 1px solid var(--line); }
.status { display: inline-flex; margin-bottom: 18px; padding: 4px 9px; border: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.status.planned { border-color: #d8aaa3; color: var(--accent-dark); }
.session-date { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.session-hero h1 { font-size: clamp(31px, 7vw, 47px); }
.session-hero .lead { margin: 20px 0 0; color: var(--muted); font-size: 15px; }
.reading-section { padding: 44px 0; border-bottom: 1px solid var(--line); }
.reading-section h2 { margin-bottom: 24px; }
.reading-section p { margin: 0 0 18px; }
.transcript-inline-link { display: inline-flex; align-items: center; gap: 10px; margin-top: 26px; color: var(--ink); font-size: 14px; font-weight: 600; text-decoration: none; }
.transcript-inline-link span:last-child { color: var(--muted); font-family: var(--serif); font-size: 21px; font-weight: 400; transition: transform .15s ease; }
.transcript-inline-link:hover span:last-child { transform: translateX(3px); }
.transcript-fields { display: grid; gap: 18px; margin: 10px 0; padding: 20px; border: 1px solid var(--line); }
.transcript-fields legend { padding: 0 8px; font-size: 13px; font-weight: 700; }
.transcript-hero { padding-top: 32px; }
.transcript-article { padding-bottom: 90px; }
.transcript-materials { margin: 30px 0 8px; padding: 20px; background: rgba(233,228,218,.55); }
.transcript-materials h2 { margin: 0 0 8px; font-family: var(--serif); font-size: 18px; font-weight: 500; }
.transcript-materials .document-row { min-height: 64px; padding-block: 8px; }
.transcript-section { padding: 44px 0; border-bottom: 1px solid var(--line); }
.transcript-section-head { margin-bottom: 30px; }
.transcript-section-head p { margin: 0 0 6px; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .12em; }
.transcript-section-head h2 { margin: 0; font-family: var(--serif); font-size: 24px; font-weight: 500; line-height: 1.5; }
.dialogue { display: grid; width: min(94%, 650px); grid-template-columns: 28px minmax(0, 1fr); grid-template-areas: "avatar bubble"; gap: 8px; align-items: start; margin: 22px 0; }
.dialogue.speaker-kano { margin-right: auto; }
.dialogue.speaker-hasegawa { grid-template-columns: minmax(0, 1fr) 28px; grid-template-areas: "bubble avatar"; margin-left: auto; }
.dialogue .speaker { display: grid; grid-area: avatar; place-items: center; width: 28px; height: 28px; margin: 3px 0 0; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--muted); font-family: var(--serif); font-size: 12px; font-weight: 600; }
.dialogue.speaker-hasegawa .speaker { border-color: #cfc6b9; background: #ded7cb; color: #5d574f; }
.dialogue > p:last-child { grid-area: bubble; width: fit-content; max-width: 100%; margin: 0; padding: 12px 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); font-size: 14px; line-height: 1.85; }
.dialogue.speaker-kano > p:last-child { justify-self: start; }
.dialogue.speaker-hasegawa > p:last-child { justify-self: end; }
.dialogue.speaker-kano > p:last-child { border-bottom-left-radius: 4px; }
.dialogue.speaker-hasegawa > p:last-child { border-color: #d1cabe; border-bottom-right-radius: 4px; background: #e9e4da; }
.transcript-note { margin: 20px 0; padding: 14px 16px; border-left: 2px solid var(--line); color: var(--muted); font-size: 13px; }
.transcript-footer { padding: 30px 0; color: var(--muted); font-size: 11px; }
.note-block + .note-block { margin-top: 28px; }
.note-block h3 { margin: 0 0 14px; font-size: 14px; }
.note-block ul { margin: 0; padding: 0; list-style: none; }
.note-block li { position: relative; padding: 8px 0 8px 22px; border-bottom: 1px dotted var(--line); }
.note-block li::before { content: ""; position: absolute; left: 3px; top: 19px; width: 6px; height: 1px; background: var(--accent); }

.guide-hero { padding: 38px 0 54px; }
.guide-hero h1 { font-size: clamp(33px, 8vw, 50px); }
.guide-hero > p:last-child { margin: 24px 0 0; color: var(--muted); }
.guide-notice { display: grid; gap: 6px; padding: 20px; border-left: 3px solid var(--accent); background: #eee9df; font-size: 13px; }
.guide-notice span { color: var(--muted); }
.guide-service { display: grid; grid-template-columns: 42px 1fr; gap: 18px; padding: 52px 0; border-bottom: 1px solid var(--line); }
.guide-number { padding-top: 4px; color: var(--accent); font-family: var(--serif); font-size: 14px; letter-spacing: .12em; }
.guide-service ol { margin: 22px 0 28px; padding-left: 24px; }
.guide-service li { margin: 8px 0; padding-left: 5px; }
.guide-service img { display: block; width: 100%; margin: 16px 0; border: 1px solid var(--line); background: #fff; }
.guide-finish { margin-top: 48px; padding: 30px 26px; border: 1px solid var(--line); background: #eee9df; color: var(--ink); }
.guide-finish .eyebrow { color: var(--accent); }
.guide-finish p:last-child { color: var(--muted); }

.admin-shell { min-height: 100svh; background: #f1eee7; }
.admin-utility { display: flex; width: min(900px, calc(100% - 32px)); margin: 0 auto; padding-top: 14px; justify-content: flex-end; }
.logout-link { min-height: 40px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; }
.admin-main { width: min(900px, calc(100% - 32px)); margin: 0 auto; padding: 36px 0 90px; }
.admin-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 32px; }
.admin-title h1 { font-size: clamp(31px, 7vw, 46px); }
.admin-badge { padding: 5px 9px; border: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.admin-section { margin-top: 22px; padding: 24px 20px; border: 1px solid var(--line); background: var(--surface); }
.admin-section h2 { margin-bottom: 22px; font-size: 21px; }
.admin-section-head { display: flex; justify-content: space-between; }
.admin-client-list { border-top: 1px solid var(--line); }
.admin-client-row { display: flex; justify-content: space-between; gap: 20px; padding: 17px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.admin-client-row strong, .admin-doc-row strong { display: block; font-size: 14px; }
.admin-client-row small, .admin-doc-row small, .admin-doc-edit small { display: block; color: var(--muted); font-size: 11px; }
.admin-client-row > span:last-child { align-self: center; color: var(--muted); font-size: 12px; }
.admin-form { display: grid; gap: 18px; }
.field-grid { display: grid; gap: 16px; }
.check-label { display: flex; align-items: center; gap: 9px; }
.check-label input { width: auto; min-height: auto; margin: 0; }
.form-help { color: var(--muted); font-size: 12px; }
.create-panel { margin-top: 20px; border-top: 1px solid var(--line); }
.create-panel summary { min-height: 50px; padding-top: 16px; cursor: pointer; font-size: 13px; font-weight: 700; }
.create-panel .admin-form { padding-top: 14px; }
.admin-doc-list { display: grid; }
.admin-doc-row { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.admin-doc-row a { align-self: center; font-size: 12px; }
.admin-action-list, .admin-doc-list { overflow-x: auto; }
.admin-action-row, .admin-doc-edit { display: grid; grid-template-columns: minmax(220px,2fr) minmax(110px,1fr) 100px 110px 56px; gap: 8px; align-items: center; min-width: 690px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.admin-action-row input, .admin-action-row select, .admin-doc-edit select { min-height: 40px; margin: 0; padding: 7px; font-size: 12px; }
.admin-action-row button, .admin-doc-edit button { min-height: 38px; border: 1px solid var(--line); background: transparent; cursor: pointer; font-size: 11px; }
.admin-doc-edit { grid-template-columns: minmax(260px,1fr) 110px 56px 44px; min-width: 520px; }
.admin-doc-edit a { font-size: 11px; }

.simple-page { width: min(680px, calc(100% - 40px)); margin: 15vh auto; }
.simple-page h1 { font-size: clamp(30px, 7vw, 45px); }
.simple-page p { color: var(--muted); }
.text-link { text-underline-offset: 4px; }
.empty { color: var(--muted); font-size: 13px; }

@media (min-width: 700px) {
  .portal-shell { padding-bottom: 0; }
  .portal-header { padding-inline: 34px; }
  .portal-main { width: min(var(--measure), calc(100% - 68px)); }
  .welcome-block { padding: 72px 0 60px; }
  .next-session { grid-template-columns: 1fr auto; align-items: end; padding: 42px; }
  .section-block { padding: 76px 0; }
  .action-row { grid-template-columns: 28px 1fr; padding: 18px 0; }
  .timeline-row { grid-template-columns: 112px 18px 1fr 22px; gap: 18px; padding: 30px 0 34px; }
  .timeline-date { padding-top: 3px; font-size: 17px; }
  .timeline-marker { margin-top: 9px; }
  .timeline-copy strong { font-size: 17px; }
  .timeline-copy small { margin-top: 9px; font-size: 12px; }
  .timeline-copy .timeline-summary { max-width: 760px; margin-top: 15px; line-height: 1.8; }
  .document-row { grid-template-columns: 46px 1fr 24px; min-height: 86px; }
  .mobile-nav { position: static; width: min(var(--measure), calc(100% - 68px)); margin: 0 auto; grid-template-columns: auto auto auto; justify-content: end; padding: 20px 0; border-top: 1px solid var(--line); background: transparent; backdrop-filter: none; }
  .mobile-nav a, .mobile-nav button { display: flex; min-height: 40px; padding: 0 15px; font-size: 11px; }
  .mobile-nav span { margin-right: 5px; }
  .guide-service { grid-template-columns: 68px 1fr; gap: 26px; }
  .dialogue { width: min(82%, 650px); }
  .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .session-time-grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .admin-section { padding: 32px; }
  .inline-form { grid-template-columns: 1fr auto; align-items: end; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
