:root {
  color-scheme: light dark;
  --bg: #f4f5f2;
  --card: #fffefa;
  --tx: #26343b;
  --mu: #687982;
  --pr: #547487;
  --pr-dark: #3e6174;
  --button-bg: #547487;
  --button-hover: #3e6174;
  --ln: #dce4e2;
  --soft: #e8efed;
  --sun: #e7c986;
  --er: #a63d35;
  --shadow: 0 12px 32px rgb(47 71 77 / 7%);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #182126;
    --card: #202c32;
    --tx: #eef2ef;
    --mu: #b1c0c3;
    --pr: #96b5c3;
    --pr-dark: #789bad;
    --button-bg: #41697a;
    --button-hover: #527d8e;
    --ln: #3a4a50;
    --soft: #2b3c41;
    --er: #ffaaa1;
    --shadow: 0 12px 32px rgb(0 0 0 / 18%);
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, "Segoe UI", Tahoma, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  background:
    radial-gradient(ellipse at 95% 12%, rgb(216 229 223 / 38%), transparent 25rem),
    var(--bg);
  color: var(--tx);
  padding-bottom: calc(88px + env(safe-area-inset-bottom));
}
.skip { position: absolute; inset-inline-start: 8px; top: -60px; z-index: 9; padding: 8px 12px; border-radius: 8px; background: var(--card); color: var(--tx); }
.skip:focus { top: 8px; }
header {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  overflow: hidden;
  padding: calc(14px + env(safe-area-inset-top)) max(20px, calc((100vw - 860px) / 2)) 16px;
  color: #fff;
  background: linear-gradient(115deg, #49687a, #678496 70%, #799493);
  box-shadow: 0 5px 18px rgb(35 58 68 / 13%);
}
header::after { content: ""; position: absolute; width: 210px; height: 210px; border: 1px solid rgb(255 255 255 / 12%); border-radius: 50%; inset-inline-end: -76px; top: -134px; box-shadow: 0 0 0 24px rgb(255 255 255 / 4%), 0 0 0 50px rgb(255 255 255 / 3%); pointer-events: none; }
header img { position: relative; z-index: 1; width: 46px; height: 46px; border: 1px solid rgb(255 255 255 / 23%); border-radius: 14px; object-fit: cover; }
header h1 { position: relative; z-index: 1; flex: 1; margin: 0; font-size: 18px; line-height: 1.35; letter-spacing: -.02em; }
#st { position: relative; z-index: 1; min-width: 52px; color: #edf5f4; font-size: 12px; text-align: end; }
main { width: min(100%, 800px); margin: 0 auto; padding: 22px 18px 38px; }
.welcome {
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
  padding: 22px 23px;
  border: 1px solid #dce7e0;
  border-radius: 22px;
  background: linear-gradient(118deg, #e8f0e9, #f5f1e5 75%, #f5ebd8);
  color: #334b4d;
  box-shadow: var(--shadow);
}
.welcome::after { content: ""; position: absolute; width: 126px; height: 126px; border: 1px solid rgb(84 116 135 / 16%); border-radius: 50%; inset-inline-end: -27px; bottom: -76px; box-shadow: 0 0 0 15px rgb(84 116 135 / 5%), 0 0 0 31px rgb(84 116 135 / 4%); }
.welcome-kicker { margin: 0 0 3px; color: #597570; font-size: 13px; font-weight: 700; letter-spacing: .02em; }
.welcome h2 { position: relative; z-index: 1; margin: 0; color: #304a50; font-size: clamp(20px, 5vw, 25px); line-height: 1.4; }
.welcome p:last-child { position: relative; z-index: 1; max-width: 560px; margin: 7px 0 0; color: #526b6d; font-size: 14px; }
@media (prefers-color-scheme: dark) {
  .welcome { border-color: #3e514e; background: linear-gradient(118deg, #263a38, #34372e 80%, #433a2b); color: var(--tx); }
  .welcome-kicker, .welcome p:last-child { color: #bed1c7; }
  .welcome h2 { color: #edf3e9; }
}
.card { margin-bottom: 15px; padding: clamp(18px, 4vw, 25px); border: 1px solid var(--ln); border-radius: 20px; background: var(--card); box-shadow: var(--shadow); }
h2 { margin: 0 0 9px; font-size: 19px; line-height: 1.45; }
p { margin: 8px 0; }
.form-intro { margin: 0 0 16px; color: var(--mu); font-size: 14px; }
.day-label { margin: 0 0 12px; color: var(--pr-dark); font-size: 14px; font-weight: 700; }
.today-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0 0 16px; padding: 16px 19px; border: 1px solid var(--ln); border-radius: 18px; background: linear-gradient(120deg, var(--card), var(--soft)); box-shadow: var(--shadow); }
.today-card strong { display: block; font-size: 15px; }
.today-card p { margin: 3px 0 0; color: var(--mu); font-size: 14px; }
.today-card button { flex: 0 0 auto; }
.incident-tools { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 10px; margin: 0 0 15px; padding: 13px; border: 1px solid var(--ln); border-radius: 14px; background: var(--soft); }
.incident-tools label { grid-column: 1 / -1; margin: 0; }
.incident-tools input { min-width: 0; background: var(--card); }
.incident-tools button { white-space: nowrap; }
.draft-bar { display: flex; gap: 8px; overflow-x: auto; margin: 0 0 13px; padding: 3px 1px 8px; }
.draft-chip { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; min-height: 42px; padding: 7px 12px; border: 1px solid var(--ln); border-radius: 999px; background: var(--bg); color: var(--tx); box-shadow: none; font-size: 13px; }
.draft-chip[aria-pressed=true] { border-color: var(--pr); background: var(--pr); color: #fff; }
.draft-chip small { opacity: .8; }
.simple-toggle { margin: 4px 0 10px; border-color: #c9d8d4; background: #eaf1ed; color: #385a59; box-shadow: none; }
.simple-toggle:hover { background: #dce9e4; }
.simple-hint { margin: 0 0 9px; color: var(--mu); font-size: 13px; }
.simple-mode .detail-only { display: none !important; }
.edit-notice { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 10px 0; padding: 10px 13px; border-radius: 12px; background: var(--soft); color: var(--pr-dark); font-weight: 650; }
.edit-notice[hidden] { display: none !important; }
.day-heading { margin: 17px 0 4px; padding: 8px 12px; border-radius: 10px; background: var(--soft); color: var(--pr-dark); font-weight: 750; }
label, .lb { display: block; margin: 17px 0 7px; color: var(--tx); font-size: 14px; font-weight: 650; }
.chk { display: flex; align-items: center; gap: 9px; }
.chk input { width: 22px; height: 22px; }
input, textarea, select { width: 100%; min-height: 48px; padding: 11px 13px; border: 1px solid var(--ln); border-radius: 12px; background: var(--bg); color: var(--tx); font: inherit; font-size: 16px; transition: border-color .18s ease, box-shadow .18s ease, background .18s ease; }
input:hover, textarea:hover, select:hover { border-color: #a9bcc0; }
input:focus, textarea:focus, select:focus { border-color: var(--pr); outline: 0; box-shadow: 0 0 0 3px rgb(84 116 135 / 15%); }
input[type=range] { min-height: 32px; padding: 0; accent-color: var(--pr); background: transparent; }
input[type=checkbox] { min-height: 0; width: 22px; accent-color: var(--pr); }
textarea { min-height: 94px; resize: vertical; }
button { min-height: 48px; padding: 10px 17px; border: 1px solid transparent; border-radius: 13px; background: var(--button-bg); color: #fff; font: inherit; font-weight: 700; cursor: pointer; box-shadow: 0 3px 8px rgb(47 71 77 / 12%); transition: background .18s ease, transform .18s ease, box-shadow .18s ease; }
button:hover { background: var(--button-hover); box-shadow: 0 5px 13px rgb(47 71 77 / 18%); transform: translateY(-1px); }
button:active { transform: translateY(0); }
button.g { border-color: var(--ln); background: var(--soft); color: var(--tx); box-shadow: none; }
button.g:hover { background: var(--ln); }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }
.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 8px 15px; border: 1px solid var(--ln); border-radius: 999px; background: var(--bg); color: var(--tx); font-weight: 600; box-shadow: none; }
.chip::before { content: ""; width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: #a4bdc4; }
#prim .chip:nth-child(1)::before { background: #6d9bb2; }
#prim .chip:nth-child(2)::before { background: #9f88ad; }
#prim .chip:nth-child(3)::before { background: #d6b35e; }
#prim .chip:nth-child(4)::before { background: #ce8f98; }
#prim .chip:nth-child(5)::before { background: #719dbb; }
#prim .chip:nth-child(6)::before { background: #d47e72; }
.chip[aria-pressed=true] { border-color: var(--button-bg); background: var(--button-bg); color: #fff; font-weight: 750; }
.chip[aria-pressed=true]::before { background: #fff; box-shadow: 0 0 0 3px rgb(255 255 255 / 22%); }
.row { display: flex; flex-wrap: wrap; gap: 9px; }
.it { padding: 14px 0; border-bottom: 1px solid var(--ln); }
.it:last-child { border: 0; }
.it small { color: var(--mu); }
.it div { margin: 3px 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.hint { color: var(--mu); font-size: 14px; }
.err { min-height: 0; color: var(--er); font-size: 14px; }
.ban { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--ln); background: var(--soft); }
[hidden] { display: none !important; }
nav { position: fixed; z-index: 5; inset-inline: 0; bottom: 0; display: flex; padding: 7px 8px calc(7px + env(safe-area-inset-bottom)); border-top: 1px solid var(--ln); background: color-mix(in srgb, var(--card) 94%, transparent); backdrop-filter: blur(14px); }
nav button { flex: 1; min-height: 54px; padding: 8px 2px; border-radius: 12px; background: transparent; color: var(--mu); font-size: 13px; box-shadow: none; }
nav button:hover { background: var(--soft); color: var(--tx); box-shadow: none; transform: none; }
nav button[aria-selected=true] { background: var(--soft); color: var(--pr-dark); box-shadow: inset 0 0 0 1px rgb(84 116 135 / 13%); }
@media (min-width: 700px) { main { padding-top: 30px; } .welcome { padding: 26px 30px; } }
@media (max-width: 480px) { .today-card { align-items: flex-start; flex-direction: column; } .today-card button { width: 100%; } .incident-tools { grid-template-columns: 1fr; } .incident-tools label { grid-column: auto; } .incident-tools button { width: 100%; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; } }
