/* Training live-response app. EHS palette, system fonts, flat institutional style, no external assets. */
:root {
  --navy: #325277;
  --navy-dark: #1f344d;
  --sage: #84ae98;
  --sage-dark: #2f5a43;
  --sage-light: #edf4f0;
  --blue: #b5d0d9;
  --blue-light: #eef4f6;
  --grey: #6f6c6f;
  --grey-dark: #4a474a;
  --line: #c9cdd1;
  --line-light: #e3e6e8;
  --bg: #f5f6f7;
  --white: #ffffff;
  --text: #1b2733;
  --bad: #a3392f;
  --bad-light: #f8ecea;
  --warn: #7a5200;
  --warn-light: #fbf3e2;
  --radius: 4px;
  --font: Arial, "Helvetica Neue", Helvetica, system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --mono: ui-monospace, Menlo, Consolas, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}
h1, h2, h3 { line-height: 1.25; color: var(--navy-dark); margin: 0 0 0.5em; font-weight: 700; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 0.75em; }
a { color: var(--navy); text-underline-offset: 0.15em; }
a:hover { color: var(--navy-dark); }
code { background: var(--blue-light); padding: 0.1em 0.3em; border-radius: 2px; font-size: 0.92em; }
.muted { color: var(--grey); }
.small { font-size: 0.875rem; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[dir="rtl"], .rtl { direction: rtl; text-align: right; }
:focus-visible { outline: 3px solid var(--navy-dark); outline-offset: 2px; }

/* ------------------------------------------------ buttons and fields */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4em;
  min-height: 44px; padding: 0.55em 1.1em;
  border: 1px solid var(--navy); border-radius: var(--radius);
  background: var(--navy); color: var(--white);
  font: inherit; font-weight: 700; line-height: 1.2; cursor: pointer; text-decoration: none; text-align: center;
  touch-action: manipulation;
}
.btn:hover { background: var(--navy-dark); border-color: var(--navy-dark); color: var(--white); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.secondary { background: var(--white); color: var(--navy); }
.btn.secondary:hover { background: var(--blue-light); color: var(--navy-dark); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--navy); text-decoration: underline; text-underline-offset: 0.15em; font-weight: 400; }
.btn.ghost:hover { background: var(--blue-light); }
.btn.danger { background: var(--bad); border-color: var(--bad); }
.btn.danger:hover { background: #82291f; border-color: #82291f; }
.btn.secondary.danger { background: var(--white); color: var(--bad); border-color: var(--bad); }
.btn.secondary.danger:hover { background: var(--bad-light); }
.btn.small { min-height: 36px; padding: 0.3em 0.75em; font-size: 0.9rem; }
.btn.block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0.4em 0; min-height: 44px; font: inherit; color: var(--navy); text-decoration: underline; text-underline-offset: 0.15em; cursor: pointer; text-align: start; }
.link-btn:hover { color: var(--navy-dark); }
.btn-row { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.btn-row.spread { justify-content: space-between; }
label { display: block; font-weight: 700; margin: 0 0 0.3em; color: var(--text); }
.field { margin-bottom: 1.25rem; }
.field .optional { font-weight: 400; color: var(--grey); }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="number"], input[type="tel"], input:not([type]), textarea, select {
  width: 100%; font: inherit; color: var(--text);
  padding: 0.55em 0.7em; min-height: 44px;
  border: 1px solid var(--grey); border-radius: var(--radius); background: var(--white);
}
input:focus, textarea:focus, select:focus { border-color: var(--navy-dark); outline: 2px solid var(--navy-dark); outline-offset: 0; }
input:disabled, textarea:disabled { background: var(--bg); color: var(--grey-dark); }
textarea { min-height: 140px; resize: vertical; }
.hint { font-size: 0.9rem; color: var(--grey); margin: 0 0 0.4em; }
.error-text { color: var(--bad); font-weight: 700; }
.error-text:empty { display: none; }
.check { display: flex; gap: 0.6rem; align-items: center; font-weight: 400; min-height: 44px; }
.check input { width: 22px; height: 22px; accent-color: var(--navy); }

/* ------------------------------------------------ participant shell */
.p-header {
  background: var(--navy); color: var(--white);
  padding: 0.85rem 1rem 0.95rem;
  border-bottom: 4px solid var(--sage);
}
.p-header .course { font-size: 0.85rem; }
.p-header h1 { color: var(--white); font-size: 1.25rem; margin: 0.2rem 0 0; }
.p-header .meta { font-size: 0.85rem; margin-top: 0.2rem; }
.p-header .meta:empty { display: none; }
.p-main { max-width: 640px; margin: 0 auto; padding: 1rem 1rem calc(88px + env(safe-area-inset-bottom)); }
.p-main:focus { outline: none; }
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.15rem 1rem; margin-bottom: 1rem;
}
.card.flat { background: transparent; border-color: var(--line-light); }
.card > :last-child { margin-bottom: 0; }
.lead { font-size: 1.05rem; }
.intro { background: var(--blue-light); border-left: 4px solid var(--navy); padding: 0.75rem 0.9rem; margin-bottom: 1rem; }
.intro + .anon-line { margin-top: -0.4rem; }
.anon-line { font-size: 0.9rem; color: var(--grey-dark); margin: 0 0 1rem; }
.saved-text { white-space: pre-wrap; background: var(--white); border: 1px solid var(--line-light); padding: 0.5rem 0.65rem; margin: 0.4rem 0 0.5rem; }
.banner { padding: 0.75rem 0.9rem; margin-bottom: 1rem; border-left: 4px solid; }
.banner.closed { background: var(--warn-light); color: var(--warn); border-color: var(--warn); font-weight: 700; }
.banner.info { background: var(--sage-light); color: var(--sage-dark); border-color: var(--sage); }
.panel { border-left: 4px solid var(--navy); padding: 0.1rem 0 0.1rem 1rem; margin: 1rem 0; }
.panel.sage { border-color: var(--sage); }
.status-line { display: flex; gap: 0.6rem; align-items: center; color: var(--grey-dark); font-size: 0.95rem; margin-top: 1rem; }
.details-list { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1rem; margin: 0 0 1rem; }
.details-list dt { color: var(--grey); }
.details-list dd { margin: 0; overflow-wrap: anywhere; }
.access-code { font-family: var(--mono); font-size: 2.4rem; font-weight: 700; letter-spacing: 0.08em; color: var(--navy-dark); margin: 0.2rem 0 0.8rem; white-space: nowrap; }
.divider { border: 0; border-top: 1px solid var(--line-light); margin: 1.25rem 0; }
.switch-line { margin-top: 1rem; font-size: 0.95rem; }

.progress { display: flex; gap: 6px; margin: 0 0 1rem; flex-wrap: wrap; }
.progress button {
  min-width: 40px; height: 40px; padding: 0 0.5rem; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--white); color: var(--navy); font: inherit; font-size: 0.9rem; font-weight: 700; cursor: pointer;
}
.progress button.done { background: var(--sage-light); border-color: var(--sage); color: var(--sage-dark); }
.progress button.current { border: 2px solid var(--navy-dark); color: var(--navy-dark); }
.q-count { font-size: 0.875rem; color: var(--grey); margin-bottom: 0.4rem; font-weight: 700; }
.q-prompt { font-size: 1.12rem; font-weight: 700; color: var(--navy-dark); margin-bottom: 1rem; }

.options { display: grid; gap: 0.5rem; margin-bottom: 1rem; border: 0; padding: 0; margin-inline: 0; }
.option {
  display: flex; gap: 0.75rem; align-items: flex-start;
  padding: 0.75rem 0.85rem; min-height: 48px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--white);
  cursor: pointer; font-weight: 400; color: var(--text);
}
.option input { margin-top: 0.15rem; width: 22px; height: 22px; flex: none; accent-color: var(--navy); }
.option:has(input:checked) { border-color: var(--navy); background: var(--blue-light); }
.option:has(input:focus-visible) { outline: 3px solid var(--navy-dark); outline-offset: 2px; }
.option.correct { border-color: var(--sage-dark); background: var(--sage-light); }
.option.wrong { border-color: var(--bad); background: var(--bad-light); }
.option .tag { margin-inline-start: auto; font-size: 0.85rem; font-weight: 700; color: var(--sage-dark); }

.numeric-row { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.4rem; }
.numeric-row input { font-size: 1.25rem; }
.numeric-row .unit { font-weight: 700; color: var(--navy-dark); font-size: 1.1rem; }

.rating { display: grid; grid-template-columns: repeat(auto-fit, minmax(44px, 1fr)); gap: 0.4rem; margin-bottom: 0.4rem; border: 0; padding: 0; margin-inline: 0; }
.rating label { margin: 0; }
.rating input { position: absolute; opacity: 0; }
.rating span {
  display: flex; align-items: center; justify-content: center; height: 48px;
  border: 1px solid var(--line); border-radius: var(--radius); font-weight: 700; font-size: 1.1rem; cursor: pointer; background: var(--white);
}
.rating input:checked + span { background: var(--navy); color: var(--white); border-color: var(--navy); }
.rating input:focus-visible + span { outline: 3px solid var(--navy-dark); outline-offset: 2px; }
.rating.wide { grid-template-columns: repeat(var(--cols, 6), minmax(0, 1fr)); gap: 4px; }
@media (min-width: 600px) { .rating.wide { grid-template-columns: repeat(var(--n, 11), minmax(0, 1fr)); } }
.rating-labels { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.875rem; color: var(--grey); margin-bottom: 1rem; }

.words-inputs { display: grid; gap: 0.5rem; margin-bottom: 1rem; }
.counter { font-size: 0.8rem; color: var(--grey); text-align: end; margin: 0.2rem 0 0.8rem; }

.result { padding: 0.75rem 0.9rem; margin-top: 1rem; border-left: 4px solid; }
.result.ok { background: var(--sage-light); border-color: var(--sage-dark); }
.result.bad { background: var(--bad-light); border-color: var(--bad); }
.result.neutral { background: var(--blue-light); border-color: var(--navy); }
.result strong.title { display: block; margin-bottom: 0.2rem; }
.result.ok strong.title { color: var(--sage-dark); }
.result.bad strong.title { color: var(--bad); }
.result > :last-child { margin-bottom: 0; }

.feedback { margin-top: 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.feedback header { background: var(--blue-light); padding: 0.6rem 0.9rem; display: flex; gap: 0.6rem; align-items: center; justify-content: space-between; flex-wrap: wrap; border-bottom: 1px solid var(--line-light); }
.feedback header strong { color: var(--navy-dark); }
.feedback section { padding: 0.7rem 0.9rem; border-top: 1px solid var(--line-light); }
.feedback header + section { border-top: 0; }
.feedback h4 { margin: 0 0 0.25rem; font-size: 0.95rem; color: var(--navy-dark); }
.feedback .improved { background: var(--bg); padding: 0.6rem 0.75rem; white-space: pre-wrap; border-left: 3px solid var(--blue); }
.feedback .source { font-size: 0.85rem; color: var(--grey); }
.score-dots { display: inline-flex; gap: 3px; align-items: center; }
.score-dots i { width: 12px; height: 12px; border-radius: 2px; background: var(--line-light); border: 1px solid var(--line); display: inline-block; }
.score-dots i.on { background: var(--sage-dark); border-color: var(--sage-dark); }
.badge { display: inline-block; font-size: 0.8rem; font-weight: 700; padding: 0.1em 0.45em; border-radius: 2px; background: var(--blue-light); color: var(--navy-dark); white-space: nowrap; border: 1px solid var(--blue); }
.badge.auto { background: var(--warn-light); color: var(--warn); border-color: #e7d3a8; }
.badge.ok { background: var(--sage-light); color: var(--sage-dark); border-color: var(--sage); }
.badge.bad { background: var(--bad-light); color: var(--bad); border-color: #e3b4ae; }
.badge.closed { background: var(--white); color: var(--grey-dark); border-color: var(--line); }
.spinner { width: 16px; height: 16px; border: 2px solid var(--blue); border-top-color: var(--navy); border-radius: 50%; animation: spin 0.9s linear infinite; display: inline-block; vertical-align: middle; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

.nav-row { display: flex; justify-content: space-between; gap: 0.6rem; margin-top: 1.25rem; }
.nav-row .btn { flex: 1; }

/* checkpoint lists (home, journey) */
.cp-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-light); }
.cp-list li { border-bottom: 1px solid var(--line-light); }
.cp-list a, .cp-list .row { display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; padding: 0.7rem 0; min-height: 44px; text-decoration: none; color: var(--text); }
.cp-list a:hover .cp-title { text-decoration: underline; }
.cp-list .cp-title { font-weight: 700; color: var(--navy); }
.cp-list .row .cp-title { color: var(--grey-dark); font-weight: 400; }
.cp-list .cp-sub { display: block; font-size: 0.85rem; color: var(--grey); font-weight: 400; }
.cp-list .cp-state { font-size: 0.85rem; color: var(--grey); white-space: nowrap; text-align: end; }
.cp-list .cp-state.open { color: var(--sage-dark); font-weight: 700; }

/* bottom bar */
.bottom-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--white); border-top: 1px solid var(--line);
  padding: 0 0 env(safe-area-inset-bottom);
}
.bottom-bar button, .bottom-bar a {
  display: flex; align-items: center; justify-content: center;
  min-height: 52px; border: 0; background: none; color: var(--navy); font: inherit; font-size: 0.95rem; font-weight: 700;
  cursor: pointer; text-decoration: none; border-top: 3px solid transparent;
}
.bottom-bar button + button, .bottom-bar button + a { border-left: 1px solid var(--line-light); }
.bottom-bar button:hover, .bottom-bar a:hover { background: var(--blue-light); }
.bottom-bar [aria-current="page"] { border-top-color: var(--navy); }

/* dialogs (sheets) */
dialog.sheet {
  border: 1px solid var(--line); padding: 0; width: min(640px, 100%); max-width: 100%; max-height: 92vh;
  margin: auto auto 0; border-radius: var(--radius) var(--radius) 0 0;
}
dialog.sheet::backdrop { background: rgba(31, 52, 77, 0.5); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 1rem; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--white); z-index: 1; }
.sheet-head h2 { margin: 0; }
.sheet-body { padding: 1rem; overflow: auto; }
.note-item, .comment-item { border: 1px solid var(--line-light); border-radius: var(--radius); padding: 0.75rem; margin-bottom: 0.6rem; background: var(--white); }
.note-item .meta, .comment-item .meta { font-size: 0.85rem; color: var(--grey); margin-bottom: 0.3rem; display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.note-text { white-space: pre-wrap; }
.polished { margin-top: 0.5rem; background: var(--sage-light); border-left: 3px solid var(--sage); padding: 0.55rem 0.7rem; white-space: pre-wrap; }

.toast {
  position: fixed; left: 50%; bottom: calc(64px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--navy-dark); color: var(--white); padding: 0.65rem 1rem; border-radius: var(--radius); z-index: 50;
  max-width: calc(100% - 2rem); width: max-content; font-weight: 700;
}
.toast.error { background: var(--bad); }

/* journey */
.journey-cp { break-inside: avoid; }
.journey-item { border-top: 1px solid var(--line-light); padding: 0.75rem 0; }
.journey-item:first-of-type { border-top: 0; }
.journey-item .answer { white-space: pre-wrap; background: var(--bg); padding: 0.5rem 0.65rem; margin: 0.3rem 0; border-left: 3px solid var(--line); }

/* ------------------------------------------------ trainer */
body.trainer { font-size: 16px; background: var(--bg); }
.t-header {
  display: flex; align-items: center; gap: 0.5rem 1rem; flex-wrap: wrap;
  background: var(--navy); color: var(--white); padding: 0.5rem 1.2rem;
  position: sticky; top: 0; z-index: 10; border-bottom: 4px solid var(--sage);
}
.t-brand { color: var(--white); font-weight: 700; text-decoration: none; font-size: 1.05rem; }
.t-brand:hover { color: var(--white); }
.t-nav { display: flex; gap: 0.15rem; flex-wrap: wrap; flex: 1; }
.t-nav a { color: var(--white); text-decoration: none; padding: 0.5rem 0.7rem; border-radius: var(--radius); font-weight: 700; font-size: 0.95rem; }
.t-nav a:hover { background: rgba(255, 255, 255, 0.14); color: var(--white); }
.t-nav a[aria-current="page"] { background: rgba(255, 255, 255, 0.14); text-decoration: underline; text-underline-offset: 0.3em; }
.t-nav .count { display: inline-block; background: var(--white); color: var(--navy-dark); border-radius: 2px; padding: 0 0.35em; margin-inline-start: 0.35em; font-size: 0.8rem; min-width: 1.4em; text-align: center; }
.t-header .btn { min-height: 36px; padding: 0.3em 0.8em; background: transparent; border-color: rgba(255, 255, 255, 0.7); }
.t-header .btn:hover { background: rgba(255, 255, 255, 0.14); }
.t-header .status { font-size: 0.875rem; }
.t-main { max-width: 1280px; margin: 0 auto; padding: 1.2rem; }
.t-main:focus { outline: none; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.75rem; margin-bottom: 1.2rem; }
.stat { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.7rem 0.9rem; }
.stat .v { font-size: 1.6rem; font-weight: 700; color: var(--navy-dark); }
.stat .l { font-size: 0.875rem; color: var(--grey); }
.stat.attention { border-left: 4px solid var(--warn); }
.day-group h2 { margin-top: 1.4rem; }
table.list { width: 100%; border-collapse: collapse; background: var(--white); border: 1px solid var(--line); }
table.list th, table.list td { text-align: start; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--line-light); vertical-align: middle; }
table.list th { background: var(--blue-light); color: var(--navy-dark); font-size: 0.85rem; border-bottom: 1px solid var(--line); }
table.list tr:last-child td { border-bottom: 0; }
table.list td.num { text-align: end; font-variant-numeric: tabular-nums; }
table.list tr.is-open td:first-child { box-shadow: inset 4px 0 0 var(--sage-dark); }
table.list td.wrap { overflow-wrap: anywhere; }
table.list select { width: auto; min-height: 36px; padding: 0.2em 0.4em; }
.table-scroll { overflow-x: auto; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin: 1.4rem 0 0.6rem; }
.section-head h2 { margin: 0; }
.toggle { display: inline-flex; align-items: center; gap: 0.45rem; cursor: pointer; font-weight: 700; font-size: 0.9rem; margin: 0; min-height: 36px; }
.toggle input { position: absolute; opacity: 0; }
.toggle .track { width: 40px; height: 22px; border-radius: 3px; background: var(--line); position: relative; flex: none; border: 1px solid var(--grey); }
.toggle .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 2px; background: var(--white); transition: left 0.12s; }
.toggle input:checked + .track { background: var(--sage-dark); border-color: var(--sage-dark); }
.toggle input:checked + .track::after { left: 20px; }
.toggle input:focus-visible + .track { outline: 3px solid var(--navy-dark); outline-offset: 2px; }
.code-pill { font-family: var(--mono); font-weight: 700; background: var(--navy); color: var(--white); border-radius: 2px; padding: 0.1em 0.4em; font-size: 0.85rem; }
.state-text { font-weight: 700; font-size: 0.9rem; }
.state-text.open { color: var(--sage-dark); }
.state-text.closed { color: var(--grey); }
.notice { background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--navy); padding: 0.8rem 1rem; margin: 0 0 1rem; }
.notice.warn { border-left-color: var(--warn); }
.notice.ok { border-left-color: var(--sage-dark); }
.notice > :last-child { margin-bottom: 0; }

.q-result { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: 1rem; }
.q-result .q-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.q-result .q-head h3 { flex: 1; min-width: 240px; }
.chart { width: 100%; height: auto; display: block; }
.chart text { font-family: var(--font); }
.chart.columns { max-height: 260px; }
.chart.histogram { max-height: 320px; }
.chart.columns.big, .chart.histogram.big { max-height: 52vh; }
.explain { background: var(--sage-light); border-left: 3px solid var(--sage); padding: 0.6rem 0.8rem; margin-top: 0.6rem; }
.filters { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin: 0.6rem 0; }
.filters input[type="search"] { width: auto; flex: 1; min-width: 180px; min-height: 36px; padding: 0.3em 0.6em; }
.filters select { width: auto; min-height: 36px; padding: 0.3em 0.5em; }
.open-answer { border: 1px solid var(--line-light); border-radius: var(--radius); padding: 0.75rem 0.9rem; margin-bottom: 0.6rem; }
.open-answer .who { font-weight: 700; color: var(--navy-dark); display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.3rem; }
.open-answer .text { white-space: pre-wrap; }
.open-answer details { margin-top: 0.4rem; font-size: 0.92rem; }
.open-answer summary { cursor: pointer; color: var(--navy); font-weight: 700; }
.score-btns { display: inline-flex; gap: 2px; margin-inline-start: auto; }
.score-btns button { min-width: 32px; min-height: 32px; border: 1px solid var(--line); background: var(--white); border-radius: 2px; cursor: pointer; font: inherit; font-size: 0.85rem; font-weight: 700; color: var(--navy); }
.score-btns button[aria-pressed="true"] { background: var(--navy); color: var(--white); border-color: var(--navy); }

.heatmap td.cell { text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 64px; }
.legend { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; font-size: 0.875rem; color: var(--grey); margin: 0.5rem 0; }
.legend i { display: inline-block; width: 14px; height: 14px; border: 1px solid var(--line); vertical-align: -2px; margin-inline-end: 4px; }
.feed-item { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.8rem 1rem; margin-bottom: 0.6rem; display: flex; gap: 1rem; align-items: flex-start; }
.feed-item.answered { opacity: 0.65; }
.feed-item .body { flex: 1; }
.feed-item .text { white-space: pre-wrap; font-size: 1.05rem; }
.login-box { max-width: 380px; margin: 12vh auto; }
.danger-zone { border-left: 4px solid var(--bad); }
.code-reveal { border: 1px solid var(--line); border-left: 4px solid var(--navy); background: var(--white); padding: 1rem 1.1rem; margin: 0 0 1rem; }
.code-reveal .access-code { font-size: 2rem; margin: 0.2rem 0 0.4rem; }

/* QR page */
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.qr-card { margin: 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; text-align: center; break-inside: avoid; }
.qr-card .qr-img svg { width: 100%; max-width: 220px; height: auto; }
.qr-card figcaption { display: grid; gap: 0.15rem; }
.qr-code { font-size: 1.6rem; color: var(--navy-dark); letter-spacing: 0.05em; }
.qr-url { color: var(--grey); word-break: break-all; }

/* ------------------------------------------------ present mode */
body.present { background: var(--white); font-size: 22px; overflow-x: hidden; }
.present-wrap { min-height: 100vh; display: flex; flex-direction: column; padding: 2vh 3vw; }
.present-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 2rem; }
.present-top .title { font-size: 1.1rem; color: var(--grey); font-weight: 700; }
.present-top h1 { font-size: clamp(1.6rem, 3.2vw, 3rem); margin: 0.3rem 0 0; }
.present-join { display: flex; gap: 1rem; align-items: center; text-align: end; color: var(--navy-dark); font-weight: 700; }
.present-join .qr { width: 150px; height: 150px; }
.present-join .code { font-size: 2.2rem; letter-spacing: 0.06em; }
.present-body { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 2vh 0; }
.present-body .chart { max-height: 62vh; }
.present-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; color: var(--grey); font-size: 1rem; flex-wrap: wrap; border-top: 1px solid var(--line-light); padding-top: 0.8rem; }
.present-foot .btn { min-height: 40px; font-size: 1rem; }
.present-big { font-size: clamp(2.5rem, 7vw, 6rem); font-weight: 700; color: var(--navy-dark); text-align: center; }
.present-quotes { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 1rem; }
.present-quotes blockquote { margin: 0; background: var(--blue-light); border-left: 4px solid var(--navy); padding: 1rem 1.2rem; font-size: 1.1rem; }
.present-quotes cite { display: block; margin-top: 0.5rem; font-size: 0.85rem; color: var(--grey); font-style: normal; font-weight: 700; }
.present-closed { border: 2px solid var(--warn); border-left-width: 10px; background: var(--warn-light); padding: 1.4rem 1.8rem; margin: 1.5vh 0 0; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.present-closed h2 { font-size: clamp(1.6rem, 2.8vw, 2.6rem); color: var(--warn); margin: 0 0 0.3rem; }
.present-closed p { margin: 0; font-size: 1.1rem; color: var(--grey-dark); }
.present-closed .btn { min-height: 64px; font-size: 1.4rem; padding: 0.5em 1.6em; }

/* ------------------------------------------------ print (My journey, QR) */
@media print {
  body { background: #fff; font-size: 11pt; }
  .bottom-bar, .no-print, .toast, .t-header { display: none !important; }
  .p-main, .t-main { padding: 0; max-width: none; }
  .card { border: 1px solid #ccc; break-inside: avoid; }
  .p-header { background: #fff; color: var(--navy-dark); border-bottom: 2px solid var(--navy); }
  .p-header h1 { color: var(--navy-dark); }
  .qr-grid { grid-template-columns: repeat(3, 1fr); }
  .qr-card { border: 1px solid #ccc; }
}

@media (min-width: 700px) {
  .p-header { padding: 1rem 1.5rem; }
  .card { padding: 1.4rem 1.5rem; }
  dialog.sheet { margin: auto; border-radius: var(--radius); }
}

/* evaluation report, NPS, comments */
.report-h { margin: 1.6rem 0 0.4rem; }
.eval-report > .stat-row { margin-top: 0.4rem; }
.report-table td { vertical-align: top; }
.report-table td:nth-child(2) { min-width: 260px; }
.agree-cell { white-space: nowrap; min-width: 170px; }
.meter { display: inline-block; width: 96px; height: 10px; background: var(--blue-light); border: 1px solid var(--line); vertical-align: middle; margin-inline-end: 0.5rem; }
.meter span { display: block; height: 100%; background: var(--navy); }
.agree-v { font-weight: 700; font-variant-numeric: tabular-nums; }
.rating-box { width: 100%; }
.present-body .rating-box { margin: 0 auto; }
.nps { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem 2rem; margin: 0.6rem 0 0; padding-top: 0.8rem; border-top: 1px solid var(--line-light); }
.nps-score .v { font-size: 2rem; font-weight: 700; color: var(--navy-dark); line-height: 1.1; font-variant-numeric: tabular-nums; }
.nps-score .l { font-size: 0.875rem; color: var(--grey); }
.nps-groups { display: grid; gap: 0.25rem; }
.nps-item { display: grid; grid-template-columns: 12px 11rem auto; gap: 0.5rem; align-items: center; }
.nps-item i { width: 12px; height: 12px; display: inline-block; }
.nps-item .k { color: var(--grey-dark); }
.nps-note { flex-basis: 100%; margin: 0; font-size: 0.85rem; color: var(--grey); }
.nps.big { gap: 1rem 3rem; font-size: 1.15rem; }
.nps.big .nps-score .v { font-size: clamp(2.5rem, 5vw, 4.5rem); }
.nps.big .nps-score .l { font-size: 1.1rem; }
.nps.big .nps-item { grid-template-columns: 16px 14rem auto; }
.nps.big .nps-item i { width: 16px; height: 16px; }
.nps.big .nps-note { font-size: 1rem; }
.quotes { display: grid; gap: 0.5rem; }
.quote { margin: 0; background: var(--bg); border-left: 3px solid var(--blue); padding: 0.6rem 0.8rem; white-space: pre-wrap; }
.quote cite { display: block; margin-top: 0.3rem; font-size: 0.85rem; color: var(--grey); font-style: normal; font-weight: 700; }
.present-anon { font-size: 1rem; color: var(--grey); }

/* bar lists */
.bars { display: grid; gap: 0.7rem; }
.bar-label { font-weight: 700; color: var(--navy-dark); margin-bottom: 0.2rem; }
.bar-row.hl .bar-label { color: var(--sage-dark); }
.bar-line { display: flex; align-items: center; gap: 0.6rem; }
.bar-track { flex: 1; height: 22px; background: var(--blue-light); overflow: hidden; }
.bar-fill { height: 100%; background: var(--navy); min-width: 2px; transition: width 0.3s; }
.bar-row.hl .bar-fill { background: var(--sage-dark); }
.bar-val { min-width: 76px; text-align: end; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--navy-dark); }
.bars.big { gap: 1.3rem; }
.bars.big .bar-label { font-size: 1.35rem; }
.bars.big .bar-track { height: 44px; }
.bars.big .bar-val { font-size: 1.5rem; min-width: 130px; }
