/* かんたん議事録 — デザイン
 * 方向性：「方眼ノートと朱の印」
 *   紙（記録）＝明るく静か、録音中＝夜の墨色で集中、唯一の強い色は「録」の朱印。
 */
@font-face { font-family: "Barlow Condensed"; font-weight: 500; font-display: swap; src: url(fonts/barlow-condensed-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url(fonts/barlow-condensed-latin-600-normal.woff2) format("woff2"); }

:root {
  --paper: #f6f7f5;     /* 紙 */
  --grid: #e3e8eb;      /* 方眼 */
  --ink: #172437;       /* 墨紺：文字・主ボタン */
  --ink-2: #44515f;     /* 本文の二番手 */
  --mute: #7a8592;      /* 補足 */
  --line: #d9dfe4;      /* 罫線 */
  --shu: #dd4126;       /* 朱：録音と印だけ */
  --night: #0f1a2b;     /* 録音中の背景 */
  --night-2: #1b2940;
  --white: #ffffff;
  --num: "Barlow Condensed", "Roboto Condensed", system-ui, sans-serif;
  --sans: system-ui, -apple-system, "Noto Sans CJK JP", "Noto Sans JP", "Hiragino Sans", sans-serif;
  --serif: "Noto Serif CJK JP", "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --safe-b: env(safe-area-inset-bottom);
  --safe-t: env(safe-area-inset-top);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.7;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--shu); outline-offset: 2px; border-radius: 4px; }
.num { font-family: var(--num); font-weight: 500; letter-spacing: .02em; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- 画面の枠 */
.screen { max-width: 680px; margin: 0 auto; padding: calc(var(--safe-t) + 14px) 20px calc(var(--safe-b) + 140px); min-height: 100vh; }
.bar { display: flex; align-items: center; gap: 6px; min-height: 44px; margin-bottom: 8px; }
.bar .grow { flex: 1; min-width: 0; }
.icon {
  width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink); flex: none;
}
.icon:active { background: rgba(23,36,55,.07); }
.icon svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------------- ホーム */
.brand { font-size: 22px; font-weight: 800; letter-spacing: .04em; margin: 0; }
.brand small { display: block; font-size: 12px; font-weight: 500; color: var(--mute); letter-spacing: .02em; }
.search {
  display: flex; align-items: center; gap: 8px; margin: 14px 0 6px;
  border-bottom: 1.5px solid var(--ink); padding: 6px 2px;
}
.search svg { width: 18px; height: 18px; stroke: var(--mute); fill: none; stroke-width: 2; flex: none; }
.search input { flex: 1; border: 0; background: none; outline: none; padding: 4px 0; min-width: 0; }
.search input::placeholder { color: var(--mute); }

.day { margin-top: 22px; }
.day-head { display: flex; align-items: baseline; gap: 8px; color: var(--mute); font-size: 13px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.day-head .num { font-size: 20px; color: var(--ink); font-weight: 600; }
.meet { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px 2px; border-bottom: 1px solid var(--line); }
.meet:active { background: rgba(23,36,55,.04); }
.meet .t { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meet .t .snip { display: block; font-weight: 400; font-size: 13px; color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meet .meta { text-align: right; flex: none; }
.meet .meta .num { font-size: 17px; color: var(--ink-2); display: block; line-height: 1.2; }
.stamp-mini {
  display: inline-block; font-family: var(--serif); font-weight: 700; font-size: 11px; line-height: 1;
  color: var(--shu); border: 1.5px solid var(--shu); border-radius: 50%; width: 22px; height: 22px;
  text-align: center; padding-top: 4px; transform: rotate(-8deg); margin-top: 3px;
}
.empty { color: var(--ink-2); padding: 48px 6px 0; }
.empty b { display: block; font-size: 20px; margin-bottom: 6px; color: var(--ink); }

/* 朱印の録音ボタン（この画面の主役） */
.dock { position: fixed; left: 0; right: 0; bottom: 0; padding: 0 0 calc(var(--safe-b) + 16px); display: flex; flex-direction: column; align-items: center; pointer-events: none;
  background: linear-gradient(to top, var(--paper) 55%, rgba(246,247,245,0)); padding-top: 30px; }
.dock > * { pointer-events: auto; }
.seal {
  width: 92px; height: 92px; border-radius: 50%; background: var(--shu); color: #fff; position: relative;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 22px rgba(221,65,38,.35);
  transition: transform .12s;
}
.seal::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.75); }
.seal span { font-family: var(--serif); font-weight: 700; font-size: 40px; line-height: 1; transform: translateY(-1px); }
.seal:active { transform: scale(.94); }
.lang-pick { margin-top: 8px; font-size: 13px; color: var(--ink-2); padding: 6px 12px; border-radius: 20px; }
.lang-pick:active { background: rgba(23,36,55,.06); }

/* ---------------------------------------------------------------- 録音中（夜） */
body.night { background: var(--night); color: #e9eef5; }
.rec { padding-bottom: calc(var(--safe-b) + 150px); }
.rec .icon { color: #e9eef5; }
.rec-status { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #a9b6c7; }
.lamp { width: 10px; height: 10px; border-radius: 50%; background: #5d6b80; }
.lamp.on { background: var(--shu); box-shadow: 0 0 0 0 rgba(221,65,38,.6); animation: lamp 1.6s infinite; }
@keyframes lamp { 70% { box-shadow: 0 0 0 10px rgba(221,65,38,0); } 100% { box-shadow: 0 0 0 0 rgba(221,65,38,0); } }
.clock { font-family: var(--num); font-weight: 500; font-size: 64px; line-height: 1; letter-spacing: .01em; margin: 10px 0 4px; font-variant-numeric: tabular-nums; }
.rec-title { width: 100%; background: none; border: 0; border-bottom: 1px solid #2d3d57; color: #e9eef5; padding: 8px 0; outline: none; font-weight: 700; }
.rec-title::placeholder { color: #6c7a8f; font-weight: 400; }
.speakers { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 2px; scrollbar-width: none; }
.speakers::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 6px 14px; border-radius: 18px; border: 1px solid var(--line); font-size: 14px; color: var(--ink-2); background: var(--white);
}
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.rec .chip { background: transparent; border-color: #34465f; color: #c3cedb; }
.rec .chip.on { background: #e9eef5; color: var(--night); border-color: #e9eef5; }
.live { margin-top: 14px; font-size: 18px; line-height: 1.85; }
.live .ln { padding: 3px 0; }
.live .ts { font-family: var(--num); font-size: 14px; color: #6c7a8f; margin-right: 8px; }
.live .sp { color: #f0a493; font-weight: 700; margin-right: 4px; }
.live .interim { color: #7f8ea3; }
.live .hint { color: #6c7a8f; font-size: 16px; }
.rec-dock {
  position: fixed; left: 0; right: 0; bottom: 0; padding: 18px 20px calc(var(--safe-b) + 18px);
  background: linear-gradient(to top, var(--night) 70%, rgba(15,26,43,0));
}
.rec-dock .inner { max-width: 680px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.round { width: 60px; height: 60px; border-radius: 50%; border: 1.5px solid #3a4c68; color: #e9eef5; display: flex; align-items: center; justify-content: center; flex-direction: column; font-size: 11px; gap: 2px; }
.round svg { width: 22px; height: 22px; fill: currentColor; }
.round:disabled { opacity: .4; }
.stop { width: 84px; height: 84px; border-radius: 50%; background: var(--shu); display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 22px rgba(221,65,38,.35); }
.stop i { width: 26px; height: 26px; border-radius: 5px; background: #fff; display: block; }
.stop:active { transform: scale(.95); }

/* ---------------------------------------------------------------- 会議の画面 */
.title-edit { width: 100%; border: 0; background: none; outline: none; font-size: 22px; font-weight: 800; padding: 2px 0; border-bottom: 1.5px solid transparent; }
.title-edit:focus { border-bottom-color: var(--ink); }
.meta-line { color: var(--mute); font-size: 13px; display: flex; gap: 14px; align-items: baseline; margin-top: 2px; }
.meta-line .num { font-size: 16px; color: var(--ink-2); }

.tabs { display: flex; gap: 22px; margin: 18px 0 14px; border-bottom: 1px solid var(--line); }
.tab { padding: 8px 0; font-weight: 700; color: var(--mute); border-bottom: 2.5px solid transparent; margin-bottom: -1px; }
.tab.on { color: var(--ink); border-bottom-color: var(--ink); }

/* 方眼の紙（議事録） */
.sheet {
  background-color: var(--white);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 22px 22px; background-position: -1px -1px;
  border: 1px solid var(--line); border-radius: 4px; padding: 22px 20px 18px; position: relative;
}
.sheet .stamp {
  position: absolute; top: 14px; right: 14px; width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--shu);
  color: var(--shu); font-family: var(--serif); font-weight: 700; display: flex; align-items: center; justify-content: center;
  font-size: 13px; line-height: 1.1; text-align: center; transform: rotate(-10deg); opacity: .9; background: rgba(255,255,255,.7);
}
.sheet h3 { font-size: 15px; margin: 18px 0 6px; padding-right: 50px; display: flex; align-items: center; gap: 8px; }
.sheet h3::before { content: ""; width: 4px; height: 16px; background: var(--ink); display: inline-block; }
.sheet h3:first-of-type { margin-top: 0; }
.sheet ul { margin: 0; padding-left: 1.2em; }
.sheet li { margin: 3px 0; background: rgba(255,255,255,.75); }
.sheet .who { color: var(--mute); font-size: 13px; display: block; }
.sheet .none { color: var(--mute); font-size: 14px; }
.sheet pre { white-space: pre-wrap; font-family: inherit; margin: 0; background: rgba(255,255,255,.75); }
.sheet + .sheet { margin-top: 14px; }
.note { color: var(--mute); font-size: 13px; margin: 10px 2px 0; }

.blank { padding: 26px 4px; color: var(--ink-2); }
.blank b { display: block; font-size: 18px; color: var(--ink); margin-bottom: 4px; }

/* 文字起こし */
.paint { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; align-items: center; }
.paint::-webkit-scrollbar { display: none; }
.paint .lbl { font-size: 13px; color: var(--mute); flex: none; }
.tlines { border-top: 1px solid var(--line); }
.tl { display: flex; gap: 10px; width: 100%; text-align: left; padding: 10px 2px; border-bottom: 1px solid var(--line); align-items: baseline; }
.tl .ts { font-family: var(--num); color: var(--mute); font-size: 14px; flex: none; width: 44px; }
.tl .tx { flex: 1; min-width: 0; word-break: break-word; }
.tl .sp { font-weight: 700; color: var(--shu); margin-right: 4px; }
.tl:active { background: rgba(23,36,55,.04); }
.painting .tl { cursor: copy; }

/* 編集 */
.field { display: block; margin: 16px 0 0; }
.field > span { display: block; font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.field small { font-weight: 400; color: var(--mute); }
.area { width: 100%; min-height: 96px; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; background: var(--white); resize: vertical; line-height: 1.6; }
.area:focus { outline: none; border-color: var(--ink); }

/* 下のボタン帯 */
.actions {
  position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 20px calc(var(--safe-b) + 14px);
  background: rgba(246,247,245,.96); border-top: 1px solid var(--line); backdrop-filter: blur(6px);
}
.actions .inner { max-width: 680px; margin: 0 auto; display: flex; gap: 10px; }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  min-height: 52px; border-radius: 26px; padding: 0 20px; font-weight: 700; background: var(--ink); color: #fff;
}
.btn:active { opacity: .85; }
.btn:disabled { opacity: .45; }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.btn.quiet { background: #e8ecef; color: var(--ink); }
.btn.danger { background: transparent; color: var(--shu); border: 1.5px solid var(--shu); }
.btn.sq { width: 52px; flex: none; padding: 0; }
.btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------------- 下から出るシート */
.scrim { position: fixed; inset: 0; background: rgba(15,26,43,.42); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.panel {
  background: var(--paper); color: var(--ink); width: 100%; max-width: 680px; max-height: 88vh; overflow-y: auto;
  border-radius: 18px 18px 0 0; padding: 10px 20px calc(var(--safe-b) + 20px); animation: up .2s ease-out;
}
.panel::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 12px; }
.panel h2 { font-size: 18px; margin: 4px 0 10px; }
.panel p { margin: 6px 0; }
.panel .btn { margin-top: 10px; }
.panel .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.panel .group { margin-top: 14px; }
.panel .group > span { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.menu-item { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 4px; border-bottom: 1px solid var(--line); text-align: left; }
.menu-item:last-child { border-bottom: 0; }
.menu-item svg { width: 22px; height: 22px; stroke: var(--ink); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.menu-item small { display: block; color: var(--mute); font-size: 12px; }
.menu-item.red, .menu-item.red svg { color: var(--shu); stroke: var(--shu); }
.or { display: flex; align-items: center; gap: 10px; color: var(--mute); font-size: 12px; margin: 18px 0 2px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.quota { color: var(--mute); font-size: 13px; text-align: center; margin-top: 8px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; }
.check input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--ink); }
.panel ul.facts { padding-left: 1.1em; margin: 8px 0; font-size: 14px; color: var(--ink-2); }
.panel ul.facts li { margin: 6px 0; }

/* 録音中のシート（夜） */
body.night .panel { background: var(--night-2); color: #e9eef5; }
body.night .panel::before { background: #34465f; }
body.night .panel ul.facts, body.night .panel .quota, body.night .panel .mute { color: #c3cedb; }
body.night .btn.quiet { background: #2a3a54; color: #e9eef5; }

/* ---------------------------------------------------------------- 設定 */
.set-h { font-size: 13px; color: var(--mute); margin: 26px 0 6px; font-weight: 700; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left; padding: 14px 2px; border-bottom: 1px solid var(--line); }
.set-row .v { color: var(--ink-2); font-size: 14px; }
.plan { padding: 14px 2px; border-bottom: 1px solid var(--line); }
.plan .num { font-size: 28px; font-weight: 600; }
.small { font-size: 13px; }
.mute { color: var(--mute); }

/* ---------------------------------------------------------------- トースト */
.toast {
  position: fixed; left: 50%; top: calc(var(--safe-t) + 14px); transform: translateX(-50%); z-index: 60;
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 22px; font-size: 14px; max-width: 90vw; text-align: center;
}
body.night .toast { background: #e9eef5; color: var(--night); }
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes up { from { transform: translateY(24px); opacity: .6; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
