/* 日報アプリ 画面の見た目。案B「藍」（02_設計/日報アプリ/デザイン指針.md 2-2。オーナー選択 2026-12-01「B 藍」）。
 * 外のフォント・外の CSS は読み込まない（端末にある文字だけ）。形は 見本/2026-12-01_書く画面の見本.html から引き継ぎ、余白を広げ、立体ボタンの影は細い縁に変えた（デザイン指針.md 4章）。 */
:root {
  --bg: #F1F4F8; --card: #FFFFFF;
  --text: #0F172A; --muted: #435063;
  --line: #D2D9E3; --field: #76808E;
  --main: #12284A; --main-ink: #FFFFFF;
  --accent: #2358D0; --accent-ink: #FFFFFF; --accent-edge: #1B44A0; --accent-soft: #E7EEFC;
  --warn: #8F4A00; --warn-soft: #FFEBCF;
  --ok: #0F6B45; --ok-soft: #DCF1E6;
  --danger: #B3261E; --danger-ink: #FFFFFF;
  --r-big: 18px; --r-small: 10px; --r-btn: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo, system-ui, sans-serif;
  font-size: 18px; line-height: 1.65; font-variant-numeric: tabular-nums;
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* 上の帯 */
.top {
  position: sticky; top: 0; z-index: 5;
  background: rgba(241, 244, 248, .92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  padding: calc(10px + env(safe-area-inset-top)) 20px 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 800; font-size: 22px; letter-spacing: .06em; }
.brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand img { height: 30px; width: auto; max-width: 120px; object-fit: contain; }
.who {
  flex-shrink: 0; max-width: 55%; display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px;
  background: var(--card); border-radius: 999px; padding: 4px 14px 4px 4px; border: 1px solid var(--line);
}
.who .face { width: 30px; height: 30px; border-radius: 50%; background: var(--main); color: var(--main-ink); display: grid; place-items: center; font-size: 14px; flex-shrink: 0; }
.who .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who .role { font-size: 13px; font-weight: 700; color: var(--muted); flex-shrink: 0; }

/* つながりの帯 */
.conn {
  position: sticky; top: calc(54px + env(safe-area-inset-top)); z-index: 4;
  margin: 0 20px; padding: 10px 14px; border-radius: var(--r-small); font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--card); border: 1px solid var(--field);
}
.conn.k-offline, .conn.k-failed, .conn.k-foreign { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }
.conn.k-update { background: var(--main); color: var(--main-ink); border-color: var(--main); }
.conn button { flex-shrink: 0; min-height: 40px; padding: 4px 14px; border-radius: 999px; border: 1.5px solid currentColor; background: transparent; font-weight: 800; font-size: 15px; cursor: pointer; }

main { max-width: 560px; margin: 0 auto; padding: 8px 20px calc(48px + env(safe-area-inset-bottom)); }
.view-center { min-height: 60vh; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 0 12px; }

/* ログイン */
.login h1 { font-size: 22px; font-weight: 800; margin: 24px 0 4px; }
.login .hint { margin: 0 0 16px; }
.pin {
  width: 100%; height: 72px; text-align: center; font-size: 32px; font-weight: 800; letter-spacing: .3em;
  border: 2px solid var(--field); border-radius: var(--r-small); background: var(--card);
}
.pin:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.msg { min-height: 1.65em; margin: 10px 0 0; font-weight: 700; color: var(--warn); font-size: 16px; }
.detail { font-size: 13px; font-weight: 400; color: var(--muted); margin-top: 2px; word-break: break-all; }

/* 今日の帯 */
.pills { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 16px; }
.pill { font-size: 15px; font-weight: 700; padding: 5px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--field); }
.pill.k-todo { background: var(--card); }
.pill.k-saved { background: var(--accent-soft); border-color: var(--accent); }
.pill.k-ok { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.pill.k-off, .pill.k-boss { background: var(--card); }

/* 今日の現場の板 */
.board {
  background: var(--main); color: var(--main-ink); border-radius: var(--r-big); padding: 20px 20px 8px; position: relative;
  box-shadow: 0 10px 24px -14px rgba(18, 40, 74, .7);
}
.board h1 { margin: 0 0 8px; font-size: 14px; font-weight: 700; color: rgba(255, 255, 255, .72); letter-spacing: .08em; }
.row { display: grid; grid-template-columns: 74px 1fr; align-items: center; border-top: 1px solid rgba(255, 255, 255, .28); min-height: 66px; }
.row:first-of-type { border-top: none; }
.row > .k { font-size: 14px; color: rgba(255, 255, 255, .72); font-weight: 700; }
.date-wrap { position: relative; display: flex; align-items: baseline; gap: 8px; padding: 10px 0; }
.date-wrap .big { font-size: 32px; font-weight: 800; line-height: 1; }
.date-wrap .dow { font-size: 17px; font-weight: 700; color: rgba(255, 255, 255, .85); }
.date-wrap input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.site-sel {
  appearance: none; -webkit-appearance: none; width: 100%; background: transparent; color: #fff; border: none; cursor: pointer;
  font-size: 20px; font-weight: 800; text-align: left; padding: 10px 34px 10px 0; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 4px center; background-size: 22px;
}
.site-sel option { color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 0; }
.chip {
  font-size: 16px; font-weight: 700; min-height: 48px; padding: 6px 16px; border-radius: 999px; cursor: pointer;
  background: transparent; color: #fff; border: 1.5px solid rgba(255, 255, 255, .6); display: inline-flex; align-items: center; gap: 6px;
}
.chip[aria-pressed="true"] { background: #fff; color: var(--main); border-color: #fff; }
.chip[aria-pressed="true"]::before { content: "✓"; font-weight: 800; }

/* カード */
.card { background: var(--card); border-radius: var(--r-big); padding: 20px; margin-top: 24px; border: 1px solid var(--line); }
.card h2 { margin: 0 0 4px; font-size: 19px; font-weight: 800; }
.hint { margin: 0 0 12px; font-size: 15px; color: var(--muted); }
textarea.speech {
  width: 100%; min-height: 150px; resize: vertical; font-size: 19px; line-height: 1.6;
  border: 2px solid var(--field); border-radius: var(--r-small); padding: 12px 14px; background: #fff; color: var(--text);
}
textarea.speech:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.btn {
  font-weight: 800; font-size: 20px; width: 100%; min-height: 62px; border-radius: var(--r-btn); cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 14px; border: 1px solid transparent;
}
.btn-main { background: var(--accent); color: var(--accent-ink); border-color: var(--accent-edge); }
.btn-main:active { filter: brightness(.88); }
.btn-sub { background: transparent; color: var(--text); border: 1.5px solid var(--field); font-size: 16px; min-height: 48px; margin-top: 10px; font-weight: 700; }
.btn svg { width: 24px; height: 24px; }
.sec-title { margin: 32px 4px 0; display: flex; justify-content: space-between; align-items: baseline; }
.sec-title h2 { font-size: 17px; margin: 0; font-weight: 800; }
.empty { margin: 8px 4px 0; }

/* 日報のカード */
.report { padding: 0; overflow: hidden; margin-top: 14px; }
.report .head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; }
.report .site { font-weight: 800; font-size: 18px; line-height: 1.35; overflow-wrap: anywhere; min-width: 0; }
.report .meta { font-size: 14px; color: var(--muted); }
.report .foot { padding: 0 20px 16px; font-size: 15px; color: var(--muted); }
.report .foot p { margin: 8px 0 0; }
.report .foot .reason { color: var(--text); font-weight: 700; }
.badge { font-size: 13px; font-weight: 800; padding: 4px 12px; border-radius: 999px; white-space: nowrap; border: 1.5px solid transparent; flex-shrink: 0; }
.b-ai { background: var(--main); color: var(--main-ink); }
.b-ask { background: var(--warn-soft); color: var(--warn); }
.b-draft { background: var(--card); color: var(--text); border-color: var(--text); }
.b-ok { background: var(--ok-soft); color: var(--ok); }
.b-fail { background: var(--warn-soft); color: var(--warn); border: 2.5px solid var(--warn); }
.b-unsent { background: var(--card); color: var(--muted); border: 1.5px dotted var(--muted); }
.b-sending { background: var(--card); color: var(--text); border-color: var(--field); }
.working { padding: 0 20px 16px; }
.bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; width: 40%; background: var(--accent); border-radius: 3px; animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
.working p { margin: 8px 0 0; font-size: 15px; color: var(--muted); }
.q { margin: 0 20px 16px; border-radius: var(--r-small); background: var(--warn-soft); padding: 12px 14px; color: var(--text); }
.q b { display: block; font-size: 15px; color: var(--warn); }
.q ol { margin: 4px 0 0; padding-left: 1.4em; font-weight: 700; }
table.rt { width: 100%; border-collapse: collapse; font-size: 17px; margin-bottom: 8px; }
.rt th, .rt td { text-align: left; padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; white-space: pre-line; }
.rt th { width: 38%; font-size: 14px; color: var(--muted); font-weight: 700; padding-left: 20px; }
.rt td { padding-right: 20px; }
.rt tr.miss td { color: var(--warn); font-weight: 700; }
.safety { margin: 0 20px 16px; padding: 10px 14px; border-radius: var(--r-small); background: var(--danger); color: var(--danger-ink); font-weight: 700; font-size: 16px; }
details.speech-d { margin: 0 20px 16px; font-size: 15px; color: var(--muted); }
details.speech-d summary { cursor: pointer; font-weight: 700; min-height: 32px; }
details.speech-d p { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }

/* 下の知らせ */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  background: var(--main); color: var(--main-ink); font-weight: 700; font-size: 16px; padding: 12px 18px; border-radius: 12px;
  display: flex; align-items: center; gap: 8px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 7;
  width: max-content; max-width: calc(100% - 32px); box-shadow: 0 10px 24px -14px rgba(18, 40, 74, .7);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.warn { background: var(--warn); }
.toast svg { width: 20px; height: 20px; flex-shrink: 0; }

@media (prefers-reduced-motion: reduce) {
  .bar i { animation: none; width: 100%; opacity: .6; }
  .toast { transition: none; }
}

/* 札の下のボタンと、足す・話し直す欄（パートA-2。画面設計.md 3章 S3） */
.report .actions { padding: 0 20px 16px; }
.report .actions > .btn { margin-top: 10px; }
.report .actions .btn-sub:first-child { margin-top: 0; }
.addform { margin-top: 12px; }
.addform textarea.speech { min-height: 120px; margin-bottom: 8px; }
.addform .btn { margin-top: 0; }
.report .opnote { padding-top: 0; }
.btn:disabled, textarea.speech:disabled { opacity: .5; cursor: default; }
