/* Stage G: the page of the way in from outside (its own style; nothing of this PC's screens).
   本人 2026-09-28 13:3x: the same look as this PC's screens — a warm off-white canvas, ink-coloured words, thin pale
   lines, a clay accent; the rail on the left (on a phone it slides in from the button at the top left). The values
   are the same as app/static/style.css's (this page cannot load that file). The dark colours follow the device. */

:root {
  --bg: #faf9f5;
  --rail-bg: #f3f1e9;
  --card: #ffffff;
  --sunk: #f0eee6;
  --hover: #efece3;
  --selected: #e8e5da;
  --button-hover: #f5f3ec;
  --backdrop: rgba(20, 20, 19, 0.32);
  --text: #141413;
  --muted: #6b6a63;
  --faint: #8e8c84;
  --link: #9a4325;
  --line: #e4e1d6;
  --line-strong: #d4d0c3;
  --accent: #c96442;
  --accent-strong: #b3522f;
  --accent-hover: #9e4627;
  --accent-soft: #f6e8e0;
  --on-accent: #ffffff;
  --danger: #b3261e;
  --on-danger: #ffffff;
  --error: #b3261e;
  --warn: #86590a;
  --red-soft: #fbeae5;
  --yellow-soft: #f9efd8;
  --info-soft: #edf0f3;
  --code-bg: #f3f1ea;
  --radius: 12px;
  --r-sm: 8px;
  --r-xl: 22px;
  --shadow-sm: 0 1px 2px rgba(20, 20, 19, 0.04);
  --shadow-lg: 0 1px 3px rgba(20, 20, 19, 0.05), 0 10px 32px rgba(20, 20, 19, 0.08);
  --rail-width: 248px;
  --column: 760px;
  --ja: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Segoe UI", "Yu Gothic UI", "Meiryo", sans-serif;
  --serif: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", Georgia, serif;
  --mono: ui-monospace, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #262624;
    --rail-bg: #1f1e1c;
    --card: #30302d;
    --sunk: #1b1a18;
    --hover: #2f2e2b;
    --selected: #393834;
    --button-hover: #3a3a36;
    --backdrop: rgba(0, 0, 0, 0.5);
    --text: #f2f0e8;
    --muted: #a8a59b;
    --faint: #85827a;
    --link: #eb9b7f;
    --line: #3b3a36;
    --line-strong: #4b4944;
    --accent: #d97757;
    --accent-strong: #b3522f;
    --accent-hover: #c25c37;
    --accent-soft: #3b2b23;
    --danger: #c8412f;
    --on-danger: #ffffff;
    --error: #ff9d8f;
    --warn: #e5c16d;
    --red-soft: #3a221e;
    --yellow-soft: #352d18;
    --info-soft: #252a31;
    --code-bg: #1f1e1c;
    --shadow-sm: none;
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.3), 0 12px 36px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--ja);
  font-size: 16px;
  line-height: 1.7;
  line-break: strict;
}

[hidden] { display: none !important; }

a { color: var(--link); text-underline-offset: 0.18em; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

button, .button {
  font: inherit;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--text);
  border-radius: var(--r-sm);
  padding: 8px 14px;
  min-height: 44px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  line-height: 1.4;
}
button:hover:not(:disabled), .button:hover { background: var(--button-hover); }
button.small { padding: 6px 12px; min-height: 40px; font-size: 0.92rem; }
button.primary, .button.primary { background: var(--accent-strong); color: var(--on-accent); border-color: var(--accent-strong); font-weight: 600; }
button.primary:hover:not(:disabled), .button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button.danger { background: var(--danger); color: var(--on-danger); border-color: var(--danger); font-weight: 600; }
button.danger:hover:not(:disabled) { background: var(--danger); opacity: 0.9; }
button:disabled { opacity: 0.5; cursor: default; }

input, select, textarea {
  font: inherit;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  min-height: 40px;
  max-width: 100%;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type="checkbox"], input[type="radio"] { min-height: 0; accent-color: var(--accent-strong); }
textarea { width: 100%; resize: vertical; line-height: 1.6; }
input.code { width: 7.5em; letter-spacing: 0.15em; text-align: center; }

.muted { color: var(--muted); }
/* 段階H2: what is being read (the calendar) says 読み込み中, and is replaced when it comes */
.loading { color: var(--muted); }
.loading::after {
  content: "";
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  margin-left: 0.4em;
  vertical-align: -0.1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: ext-spin 0.8s linear infinite;
}
@keyframes ext-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .loading::after { animation: none; } }
.error { color: var(--error); }
.ok { color: var(--muted); }
.grow { flex: 1 1 auto; }

/* the login page and the page after closing */
.plain-page { max-width: 480px; margin: 0 auto; padding: 18vh 20px 48px; }
.plain-page h1 { margin: 0 0 12px; font-family: var(--serif); font-size: 2rem; font-weight: 600; line-height: 1.35; }
.plain-page .button.primary { display: inline-flex; align-items: center; justify-content: center; min-width: 14em; padding: 10px 20px; border-radius: 12px; }

/* --- the frame: the rail on the left, one column in the middle ---------------------------------------------- */

.shell { display: flex; min-height: 100vh; min-height: 100dvh; }

.rail {
  position: sticky;
  top: 0;
  z-index: 20;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: var(--rail-width);
  height: 100vh;
  height: 100dvh;
  padding: 10px 10px max(12px, env(safe-area-inset-bottom));
  background: var(--rail-bg);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}
.rail-head { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 2px 0 10px; margin-bottom: 4px; }
.brand { flex: 1; min-width: 0; font-family: var(--serif); font-size: 1.05rem; font-weight: 600; }

.rail-new {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 10px;
  border: none;
  background: transparent;
  font-weight: 600;
  text-align: left;
}
.rail-new:hover:not(:disabled) { background: var(--hover); }
.rail-new .plus { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #ffffff; }
.rail-new .plus svg { width: 14px; height: 14px; }

.tabs { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.tabs button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: transparent;
  text-align: left;
}
.tabs button:hover:not(:disabled) { background: var(--hover); }
.tabs button[aria-selected="true"] { background: var(--selected); font-weight: 600; }
.count:not(:empty) { margin-left: auto; min-width: 1.6em; padding: 0 7px; border-radius: 999px; background: var(--accent-strong); color: var(--on-accent); font-size: 0.8rem; font-weight: 700; text-align: center; }

.rail-foot { margin-top: auto; display: grid; gap: 8px; padding: 12px 6px 0; border-top: 1px solid var(--line); font-size: 0.85rem; }
.rail-foot #who { overflow-wrap: anywhere; }

/* 段階CH2 (本人 2026-09-30 16:5x 「Claudeと同じデザイン」): the conversations in the rail (on a phone the drawer from the
   left), each with its 「…」 — always there on a touch screen, shown when the pointer is on the row with a mouse. */
.rail-title { margin: 14px 10px 4px; color: var(--muted); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.02em; }
.rail-threads { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.rail-threads .empty { padding: 4px 10px; font-size: 0.85rem; color: var(--muted); }
.thread-row { position: relative; display: flex; align-items: center; border-radius: var(--r-sm); }
.thread-row:hover, .thread-row.menu-open { background: var(--hover); }
.thread-row.current { background: var(--selected); }
.rail button.thread-link {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  padding: 6px 4px 6px 10px;
  border: none;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text);
  text-align: left;
  font: inherit;
  font-size: 0.92rem;
}
.rail button.thread-link:hover:not(:disabled) { background: transparent; }
.thread-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-row.current .thread-name { font-weight: 600; }
.thread-name .tag { margin-right: 6px; padding: 0 6px; border-radius: 999px; border: 1px solid currentColor; font-size: 0.7rem; font-weight: 700; }
.thread-name .running { margin-left: 6px; color: var(--accent); font-size: 0.72rem; font-weight: 600; }
.rail button.thread-more {
  flex: none;
  width: 40px;
  height: 40px;
  min-height: 0;
  margin-right: 2px;
  padding: 0;
  border: none;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
}
.rail button.thread-more:hover:not(:disabled), .rail button.thread-more[aria-expanded="true"] { background: var(--line); color: var(--text); }
@media (hover: hover) and (pointer: fine) {
  .rail button.thread-more { width: 28px; height: 28px; opacity: 0; }
  .thread-row:hover .thread-more, .thread-row:focus-within .thread-more, .thread-row.current .thread-more, .thread-row.menu-open .thread-more { opacity: 1; }
}
.thread-menu {
  position: absolute;
  top: calc(100% - 2px);
  right: 4px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  min-width: 11rem;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow-lg);
}
.thread-menu[hidden] { display: none; }
.rail button.menu-item {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: none;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text);
  text-align: left;
  font: inherit;
}
.rail button.menu-item:hover:not(:disabled), .rail button.menu-item:focus-visible { background: var(--hover); outline: none; }
.rail button.menu-item.menu-danger { color: var(--error); }
.thread-group { margin: 14px 10px 4px; color: var(--muted); font-size: 0.78rem; font-weight: 600; }
.thread-rename { flex: 1; min-width: 0; margin: 0; padding: 2px 4px; }
.thread-rename input { width: 100%; min-width: 0; padding: 6px 8px; border: 1px solid var(--accent); border-radius: var(--r-sm); background: var(--card); color: var(--text); font: inherit; font-size: 16px; }
.rail-shelves { display: flex; flex-wrap: wrap; gap: 2px; margin: 8px 0 0; }
.rail button.shelf-link { flex: 1; min-height: 40px; padding: 6px 10px; border: none; border-radius: var(--r-sm); background: transparent; color: var(--muted); text-align: left; font-size: 0.85rem; }
.rail button.shelf-link:hover:not(:disabled) { background: var(--hover); color: var(--text); }

.backdrop { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 19; background: var(--backdrop); }

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--muted);
}
.icon-button:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.icon-button svg { width: 22px; height: 22px; }
.narrow-only { display: none !important; }

.page { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.top {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg);
  padding: 20px 20px 0;
  padding-top: max(20px, env(safe-area-inset-top));
}
.top-row, .bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.top-row { max-width: var(--column); margin: 0 auto; }
.page-title { margin: 0; font-family: var(--serif); font-size: 1.6rem; font-weight: 600; line-height: 1.35; }
#message { max-width: var(--column); min-height: 1.4em; margin: 4px auto 0; font-size: 0.95rem; }
#message:empty { min-height: 0; }

main { width: 100%; max-width: calc(var(--column) + 40px); margin: 0 auto; padding: 12px 20px 24px; flex: 1; }
h2 { font-size: 1.02rem; font-weight: 600; margin: 24px 0 8px; }
h3 { font-size: 1rem; margin: 6px 0; }
.plain-list { padding-left: 1.2em; margin: 0; }
.plain-list li { margin: 2px 0; overflow-wrap: anywhere; }
.plain-list li.done { color: var(--muted); text-decoration: line-through; }
/* 段階UI2b: 今日の予定 — each row its time and title, what was recorded, and its buttons (完了・始めた・終わった・取り消す)
   pressed once; on a phone the buttons go under the title */
#events.plain-list { list-style: none; padding-left: 0; }
#events li.today-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; padding: 6px 0; border-bottom: 1px solid var(--line); }
#events li.today-row:last-child { border-bottom: none; }
.today-text { flex: 1 1 12em; min-width: 0; overflow-wrap: anywhere; }
li.today-row.is-done .today-text { color: var(--muted); }
.today-mark { color: var(--muted); font-size: 0.86rem; overflow-wrap: anywhere; }
.quick-buttons { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.today-error { flex-basis: 100%; font-size: 0.88rem; overflow-wrap: anywhere; }

.alerts { display: grid; gap: 8px; margin-top: 8px; }
.alert { border-radius: var(--radius); padding: 10px 14px; border: 1px solid var(--line); border-left: 4px solid var(--line-strong); background: var(--card); }
.alert.red { background: var(--red-soft); border-left-color: var(--error); }
.alert.yellow { background: var(--yellow-soft); border-left-color: var(--warn); }
.alert.info { background: var(--info-soft); }
.alert-title { margin: 0; font-weight: 600; }
.alert p { margin: 2px 0; }
.alert .alert-link { display: inline-block; margin: 2px 0; font-weight: 600; } /* 段階DW1: the Drive folder of a notice */
.badge { display: inline-block; font-size: 0.78rem; border: 1px solid var(--line-strong); border-radius: 999px; padding: 0 8px; margin-right: 6px; background: var(--card); }

.deadline { border: 1px solid var(--line); border-left: 3px solid var(--line-strong); padding: 6px 12px; margin: 6px 0; background: var(--card); border-radius: var(--r-sm); }
.deadline.red { border-left-color: var(--error); }
.deadline.yellow { border-left-color: var(--warn); }
.deadline p { margin: 2px 0; }
.deadline-title { font-weight: 600; }
#news li { margin-bottom: 8px; }
.news-title { display: block; font-weight: 600; }
.news-summary { display: block; }

/* the conversation: the user's words in a soft bubble on the right, the answer on the page itself */
.turns { display: grid; gap: 24px; margin: 12px 0; }
.turn, .live { display: flex; flex-direction: column; gap: 4px; }
.who-you, .who-head { margin: 0; font-size: 0.78rem; color: var(--faint); }
.who-you { align-self: flex-end; }
.sent { align-self: flex-end; max-width: 88%; margin: 0 0 8px; padding: 8px 16px; border-radius: var(--r-xl); background: var(--sunk); white-space: pre-wrap; overflow-wrap: anywhere; }
.reply { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.85; }
.live #stop { align-self: flex-start; margin-top: 6px; }
.composer {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  margin-top: 16px;
  padding: 10px 10px 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xl);
  background: var(--card);
  box-shadow: var(--shadow-lg);
  margin-bottom: max(8px, env(safe-area-inset-bottom));
}
.composer textarea { grid-column: 1 / -1; min-height: 64px; padding: 4px; border: none; background: transparent; resize: none; }
.composer textarea:focus-visible { box-shadow: none; }
.composer #send { grid-column: 2; border-radius: 12px; }
.new-thread { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; margin: 8px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }

.cards { display: grid; gap: 12px; }
.card-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin-top: 8px; box-shadow: var(--shadow-sm); }
.card-box.permission { border-left: 3px solid var(--accent); }
.card-box.answered { opacity: 0.75; box-shadow: none; }
.card-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 0.88rem; color: var(--muted); }
.card-state.done { color: var(--muted); }
.card-state.no { color: var(--error); }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.content-head { background: var(--code-bg); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--mono); font-size: 0.86rem; max-height: 50vh; overflow: auto; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 4px 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.emphasis { font-weight: 700; color: var(--error); }
.confirm-tick, .choice { display: flex; gap: 8px; align-items: center; margin: 4px 0; }
.hold p { margin: 4px 0; }

.bottom { width: 100%; max-width: calc(var(--column) + 40px); margin: 0 auto; padding: 16px 20px max(24px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); font-size: 0.9rem; }

/* Stage G2: photos, deadlines, the knowledge */
.stack { display: grid; gap: 12px; max-width: 560px; }
.stack label { display: grid; gap: 4px; }
.stack input[type="text"], .stack input[type="date"], .stack select { width: 100%; }
#photo-list li, #notes-list .card-box { overflow-wrap: anywhere; }
.note-meta { font-size: 0.85rem; color: var(--muted); margin: 0; }
.note-body { white-space: pre-wrap; overflow-wrap: anywhere; }
#dl-result.error { color: var(--error); }

/* --- a phone, an iPad upright: the rail slides in from the left ---------------------------------------------- */

/* 本人 2026-09-28 16:0x 「ページの切り替えをもう少しスムーズに」: a short fade between the way in's pages (the same as
   this PC's screens, app/static/style.css). A browser that does not know this does as before; none with "reduce
   motion". */

@view-transition {
  navigation: auto;
}

.rail {
  view-transition-name: rail;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 140ms;
}

@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }

  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}

@media (max-width: 899px) {
  .narrow-only:not([hidden]) { display: inline-flex !important; }
  .rail {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(86vw, var(--rail-width));
    height: auto;
    padding-top: max(10px, env(safe-area-inset-top));
    box-shadow: var(--shadow-lg);
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    visibility: hidden;
  }
  .rail.open { transform: none; visibility: visible; }
  .top { padding: 6px 10px 0; padding-top: max(6px, env(safe-area-inset-top)); border-bottom: 1px solid var(--line); }
  .top-row { flex-wrap: nowrap; }
  .page-title { font-size: 1.1rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #message { padding: 0 6px 4px; }
  main { padding: 8px 16px 24px; }
  .bottom { padding-left: 16px; padding-right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .rail { transition: none; }
}

/* 本人 2026-09-28 15:5x: 「チャットを作る」 on a card, and the conversation's way back to answer it */
.card-chat { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.card-chat .muted { font-size: 0.85rem; overflow-wrap: anywhere; }
.card-box.focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
/* 段階BIO2: 記憶の案 — each memory's lines one under the other, as on this PC's screen (style.css .desc.whole) */
.desc.whole { white-space: pre-line; overflow-wrap: anywhere; }
.card-link { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; padding: 8px 12px; border-radius: var(--radius); background: var(--accent-soft); font-size: 0.9rem; }
.card-link[hidden] { display: none; }
.card-link .grow { min-width: 0; overflow-wrap: anywhere; }

/* 段階UX1 (本人 2026-09-30 00:4x 「文字の量に対して情報の質が低い」「スマホ版のUI、UXが使いづらい」): one line per block and
   its buttons; 「詳しく」 closed at first (the summary is a small grey line with a chevron drawn by the border — no symbol
   character). An open 「詳しく」 in a row of buttons takes the whole width under them. */
.block { margin: 10px 0; }
.block.go { margin: 8px 0 4px; }
details.more > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 2px 4px;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.88rem;
  list-style: none;
}
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}
details.more[open] > summary::before { transform: rotate(45deg); }
.more-body { margin: 2px 0 6px; padding: 2px 0 2px 12px; border-left: 2px solid var(--line); font-size: 0.92rem; overflow-wrap: anywhere; }
.more-body p { margin: 2px 0; }
.actions details.more[open] { flex-basis: 100%; }
/* a block whose one line is the summary: the line in the text's own colour (its words run on under the label),
   「詳しく」 at its right end */
details.line-fold > summary { display: block; color: var(--text); font-size: 1rem; line-height: 1.6; padding: 8px 4px; border-bottom: 1px solid var(--line); }
details.line-fold > summary::before { display: inline-block; margin: 0 8px 2px 2px; vertical-align: middle; }
details.line-fold > summary .more-mark { float: right; margin-left: 8px; color: var(--muted); font-size: 0.8rem; line-height: 1.9; }
details.line-fold .label, #panel-home .label { font-weight: 600; margin-right: 8px; }
.now-line { margin: 2px 0; }
.info-fold { margin-top: 2px; }
.info-item { margin: 4px 0 8px; }
/* 段階NT1: 同じ知らせを1つにした数 */
.alert-repeats { margin-left: 6px; color: var(--muted); font-size: 0.86rem; font-weight: 400; }
.alert .actions { margin-top: 4px; }
.tag { display: inline-block; margin-left: 6px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 0.78rem; color: var(--muted); background: var(--card); }
.card-tail { margin-top: 4px; }
.turn-tail { margin-top: 0; gap: 4px 12px; }
/* the last answer is read above the box to send (it stays at the bottom of the screen) */
.turn { scroll-margin-bottom: 170px; }
@media (max-width: 899px) {
  .card-box { padding: 10px 12px; }
  .composer textarea { min-height: 44px; }
  h3 { font-size: 0.98rem; line-height: 1.5; }
}

/* 本人 2026-09-30 02:5x 「確認待ちの許可ボタンを押しても反応がありません」: what answering did, right under the card's buttons */
.card-result { margin: 6px 0 0; font-size: 0.92rem; color: var(--muted); overflow-wrap: anywhere; }
.card-result.error { color: var(--error); font-weight: 600; }

/* 段階CQ1: 答えたあと（カードの1行） */
.after-answer { margin: 6px 0; padding: 6px 10px; border-left: 3px solid var(--line-strong); color: var(--muted); font-size: 0.85rem; overflow-wrap: anywhere; }
.after-answer-label { font-weight: 600; margin-right: 0.5em; }
/* 段階BIO1: this device's own key (fingerprint / face) — the line on top of 「確認待ち」 and the small window that asks it */
.touch-box p { margin: 0.25rem 0; }
.touch-box .actions { flex-wrap: wrap; }
dialog.touch-ask {
  max-width: min(92vw, 28rem);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  padding: 1rem 1.1rem;
}
dialog.touch-ask::backdrop { background: var(--backdrop); }
dialog.touch-ask button { margin: 0.4rem 0.4rem 0 0; min-height: 44px; }

/* 段階CQ2: 読めるカード（見出しつきの欄・答えたあとを答えごとに・選択肢の説明）。スマホ幅（360px）では見出しを上に */
.cq-fields { display: grid; gap: 6px; margin: 6px 0 8px; }
.cq-field { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 2px 10px; align-items: baseline; }
.cq-label { margin: 0; color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.cq-lines { min-width: 0; }
.cq-line { margin: 0; overflow-wrap: anywhere; }
.cq-line + .cq-line { margin-top: 2px; }
.cq-more { margin: 4px 0; padding-left: 1.2em; overflow-wrap: anywhere; }
.after-answer .after-answer-label { margin: 0 0 4px; }
.after-blocks { display: grid; grid-template-columns: repeat(auto-fit, minmax(15em, 1fr)); gap: 6px 14px; }
.after-who { margin: 0 0 2px; font-weight: 600; }
.after-row { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); gap: 0 8px; }
.after-key { color: var(--muted); }
.after-val { min-width: 0; overflow-wrap: anywhere; }
.choice { flex-wrap: wrap; }
.choice .choice-detail { flex-basis: 100%; padding-left: 26px; font-size: 0.85rem; color: var(--muted); }
.choice-note { margin: 2px 0; font-size: 0.85rem; }
@media (max-width: 480px) {
  .cq-field, .after-blocks { grid-template-columns: minmax(0, 1fr); }
}
