/* 現場ボード（建設業向けデモ）
   世界観: 工事黒板の深緑 / 打放しコンクリート / 安全標識。
   高視認オレンジ(--caution)は注意喚起（遅延・警戒）にだけ使う。 */

:root {
  --bg: #e8e6e1;
  --surface: #fbfaf7;
  --surface-2: #f3f1ec;
  --surface-3: #e7e4dd;
  --fg: #171b19;
  --fg-2: #3a403c;
  --muted: #5f6662;
  --line: #d8d4cb;
  --line-2: #c3beb3;

  --nav-bg: #26292a;
  --nav-fg: #ecebe6;
  --nav-muted: #a2a7a3;
  --nav-hover: #303435;
  --nav-active: #3a3f40;

  --board: #1f4636;
  --board-deep: #183829;
  --board-ink: #f3f1e7;
  --board-line: rgba(243, 241, 231, .62);

  --accent: #1d6a4b;
  --accent-strong: #15553b;
  --accent-ink: #ffffff;
  --accent-soft: #dcebe2;

  --caution: #e8590c;
  --caution-text: #b2430a;
  --caution-soft: #fde8da;
  --danger: #c1272d;
  --danger-soft: #f9dedd;
  --amber-soft: #f3e7c4;

  --shadow: 0 1px 0 rgba(30, 30, 20, .04), 0 2px 6px rgba(30, 30, 20, .05);
  --shadow-lg: 0 18px 48px rgba(15, 20, 18, .22);
  --r: 12px;
  --r-sm: 8px;
  --strip-h: 30px;
  --nav-w: 248px;

  --f-body: "BIZ UDPGothic", "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
  --f-num: "BIZ UDGothic", "BIZ UDPGothic", ui-monospace, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121514; --surface: #1a1e1c; --surface-2: #202523; --surface-3: #2a302d;
    --fg: #ecebe5; --fg-2: #cbcec8; --muted: #9ba29d; --line: #2f3532; --line-2: #3f4744;
    --nav-bg: #0d0f0e; --nav-fg: #ecebe5; --nav-muted: #8f9692; --nav-hover: #171a19; --nav-active: #212624;
    --board: #1f4636; --board-deep: #163326;
    --accent: #5fc499; --accent-strong: #7dd3ad; --accent-ink: #0a1f15; --accent-soft: #183327;
    --caution: #ff7a2e; --caution-text: #ff9b5e; --caution-soft: #3a2316;
    --danger: #ff6b6b; --danger-soft: #3b1a1b; --amber-soft: #3a3218;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3); --shadow-lg: 0 18px 48px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121514; --surface: #1a1e1c; --surface-2: #202523; --surface-3: #2a302d;
  --fg: #ecebe5; --fg-2: #cbcec8; --muted: #9ba29d; --line: #2f3532; --line-2: #3f4744;
  --nav-bg: #0d0f0e; --nav-fg: #ecebe5; --nav-muted: #8f9692; --nav-hover: #171a19; --nav-active: #212624;
  --board: #1f4636; --board-deep: #163326;
  --accent: #5fc499; --accent-strong: #7dd3ad; --accent-ink: #0a1f15; --accent-soft: #183327;
  --caution: #ff7a2e; --caution-text: #ff9b5e; --caution-soft: #3a2316;
  --danger: #ff6b6b; --danger-soft: #3b1a1b; --amber-soft: #3a3218;
  --shadow: 0 1px 0 rgba(0, 0, 0, .3); --shadow-lg: 0 18px 48px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
/* 打放しコンクリートの微かなムラ */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .48 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.35; text-wrap: balance; word-break: auto-phrase; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }
[hidden] { display: none !important; }
.num { font-family: var(--f-num); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.muted { color: var(--muted); }
.sm-text { font-size: 13px; }
.caution-text { color: var(--caution-text); }
.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; }
.ic { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic.sm { width: 16px; height: 16px; }
.ic.xl { width: 44px; height: 44px; stroke-width: 1.3; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- 制作デモ帯 ---------- */
.demo-strip {
  position: sticky; top: 0; z-index: 60;
  height: var(--strip-h);
  display: flex; align-items: center; justify-content: center; gap: 18px;
  padding: 0 16px;
  background: var(--nav-bg); color: var(--nav-muted);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  font-size: 12px; letter-spacing: .02em; white-space: nowrap;
}
.demo-strip b { color: var(--nav-fg); font-weight: 700; }
.demo-strip .sep { margin: 0 .5em; opacity: .5; }
.demo-strip a { display: inline-flex; align-items: center; gap: 4px; color: var(--nav-fg); text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.25); line-height: 1.3; }
.demo-strip a:hover { border-color: currentColor; }
.demo-strip .ic { width: 12px; height: 12px; }

/* ---------- レイアウト ---------- */
.app {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: var(--nav-w) minmax(0, 1fr);
  min-height: calc(100vh - var(--strip-h));
}

.sidenav {
  position: sticky; top: var(--strip-h);
  height: calc(100vh - var(--strip-h));
  display: flex; flex-direction: column; gap: 18px;
  padding: 22px 14px 16px;
  background: var(--nav-bg); color: var(--nav-fg);
  /* Pコン跡（型枠セパレータの穴）を思わせる等間隔の点 */
  background-image: radial-gradient(circle at center, rgba(255,255,255,.05) 0 3px, transparent 3.5px);
  background-size: 60px 60px; background-position: 30px 30px;
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center;
  background: #fbfaf5; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}
.brand-mark svg { width: 26px; height: 26px; fill: #1d8a55; stroke: none; }
.brand-text { display: grid; line-height: 1.25; }
.brand-text b { font-size: 18px; letter-spacing: .06em; }
.brand-text small { font-size: 11.5px; color: var(--nav-muted); }

.site-pill {
  display: grid; gap: 2px; margin: 0 4px; padding: 12px 14px;
  border-radius: 10px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08);
}
.site-pill-label { font-size: 11px; color: var(--nav-muted); letter-spacing: .04em; }
.site-pill-name { font-weight: 700; font-size: 14px; line-height: 1.4; }
.site-pill-meta { font-size: 12px; color: var(--nav-muted); }

.sidenav-list { display: grid; gap: 4px; }
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  min-height: 56px; padding: 0 16px;
  border: 0; border-radius: 10px; background: transparent; color: var(--nav-muted);
  font-size: 16px; font-weight: 700; text-align: left;
  transition: background .15s, color .15s;
}
.nav-item .ic { width: 24px; height: 24px; }
.nav-item:hover { background: var(--nav-hover); color: var(--nav-fg); }
.nav-item[aria-current="page"] { background: var(--nav-active); color: var(--nav-fg); }
.nav-item[aria-current="page"]::before {
  content: ""; position: absolute; left: -14px; top: 12px; bottom: 12px; width: 4px; border-radius: 0 4px 4px 0; background: #3fbf86;
}
.nav-badge { margin-left: auto; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 99px; background: var(--caution); color: #fff; font-size: 13px; font-style: normal; display: grid; place-items: center; }
.nav-tag { margin-left: auto; font-style: normal; font-size: 11px; letter-spacing: .08em; padding: 2px 8px; border-radius: 99px; border: 1px solid rgba(255,255,255,.22); color: var(--nav-fg); }

.sidenav-foot { margin-top: auto; display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.me { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.me span:last-child { display: grid; line-height: 1.3; }
.me small { color: var(--nav-muted); font-size: 11.5px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #3a4a42; color: #e9f3ee; font-weight: 700; }
.theme-btn {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px;
  border: 1px solid rgba(255,255,255,.12); border-radius: 10px; background: transparent; color: var(--nav-fg); font-size: 13.5px;
}
.theme-btn:hover { background: var(--nav-hover); }
.theme-btn .ic { width: 18px; height: 18px; }

.main { min-width: 0; padding: 28px 32px 56px; }
.view { display: grid; gap: 20px; animation: viewIn .28s ease both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.view-head h1 { font-size: 30px; letter-spacing: .04em; }
.eyebrow { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dot-sep { width: 4px; height: 4px; border-radius: 50%; background: var(--line-2); }
.solve {
  max-width: 440px; font-size: 13px; line-height: 1.55; color: var(--fg-2);
  padding: 9px 14px 9px 14px; border-left: 3px solid var(--accent);
  background: var(--surface); border-radius: 0 8px 8px 0; box-shadow: var(--shadow);
}
.solve span { display: block; font-size: 11px; letter-spacing: .06em; color: var(--accent); font-weight: 700; margin-bottom: 1px; }
.solve b { color: var(--fg); }

/* ---------- カード・共通部品 ---------- */
.card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 20px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h3, .card h3 { display: flex; align-items: center; gap: 8px; font-size: 16.5px; }
.card-head h3 .ic { color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px;
  border-radius: 10px; border: 1px solid transparent;
  font-size: 15px; font-weight: 700; white-space: nowrap;
  transition: background .15s, transform .08s, border-color .15s;
}
.btn:active { transform: scale(.98); }
.btn .ic { width: 20px; height: 20px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost { background: var(--surface); border-color: var(--line-2); color: var(--fg); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-lg { min-height: 56px; font-size: 16px; padding: 0 26px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: default; }
.btn.is-done { background: var(--accent-soft); color: var(--accent); }

.icon-btn {
  width: 48px; height: 48px; flex: none; display: grid; place-items: center;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--fg);
}
.icon-btn:hover { background: var(--surface-2); }

.tag-plain { display: inline-block; font-size: 12px; color: var(--muted); padding: 2px 10px; border: 1px solid var(--line-2); border-radius: 99px; }
.count-chip { font-size: 13px; padding: 3px 12px; border-radius: 99px; background: var(--surface-3); color: var(--fg-2); }
.mini-bar { display: block; height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.mini-bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .45s cubic-bezier(.2,.8,.2,1); }
.mini-bar.wide { margin: -4px 0 14px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  min-height: 44px; padding: 0 18px; border-radius: 99px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--fg-2);
  font-size: 14.5px; font-weight: 700;
  transition: background .15s, color .15s, border-color .15s;
}
.chip:hover { border-color: var(--fg-2); }
.chip[aria-pressed="true"] { background: var(--fg); color: var(--surface); border-color: var(--fg); }

.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 12px; background: var(--surface-3); }
.seg-btn { min-height: 42px; padding: 0 18px; border: 0; border-radius: 9px; background: transparent; color: var(--fg-2); font-weight: 700; font-size: 14.5px; }
.seg-btn[aria-pressed="true"] { background: var(--surface); color: var(--fg); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg-full { display: flex; }
.seg-full .seg-btn { flex: 1; }

/* ---------- 今日の現場 ---------- */
.today-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
.col-main, .col-side { display: grid; gap: 16px; min-width: 0; align-content: start; }
.duo { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.site-card { grid-area: site; }
.wbgt-card { grid-area: wbgt; }
.crew-card { grid-area: crew; }
.tasks-card { grid-area: task; }
.ky-card { grid-area: ky; }
.alert-card { grid-area: alrt; }
.ms-card { grid-area: ms; }
@media (min-width: 1281px) { .col-main > *, .col-side > *, .duo > * { grid-area: auto; } }

.site-card { display: grid; gap: 18px; }
.site-top { display: flex; gap: 20px; justify-content: space-between; align-items: center; }
.site-id { display: grid; gap: 8px; justify-items: start; min-width: 0; }
.site-id h2 { font-size: 23px; letter-spacing: .02em; }
.site-addr { font-size: 13px; }
.site-addr .ic { vertical-align: -3px; margin-right: 4px; }
.site-progress { display: flex; align-items: center; gap: 16px; flex: none; }
.ring { position: relative; width: 116px; height: 116px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 11; }
.ring-bg { stroke: var(--surface-3); }
.ring-plan { stroke: var(--line-2); stroke-dasharray: calc(var(--p) * 3.267) 326.7; stroke-width: 11; opacity: .9; }
.ring-fg { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: calc(var(--p) * 3.267) 326.7; animation: ringIn 1s cubic-bezier(.2,.8,.2,1) both; }
@keyframes ringIn { from { stroke-dasharray: 0 326.7; } }
.ring-val { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700; }
.ring-val small { font-size: 13px; margin-left: 1px; }
.ring-legend { display: grid; gap: 4px; font-size: 13px; color: var(--fg-2); }
.ring-legend span { display: flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sw-fg { background: var(--accent); }
.sw-plan { background: var(--line-2); }

.site-facts { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); padding-top: 14px; gap: 12px; }
.site-facts div { min-width: 0; }
.site-facts dt { font-size: 12px; color: var(--muted); }
.site-facts dd { margin: 2px 0 0; font-weight: 700; font-size: 14.5px; }

/* 天気・WBGT */
.wx-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wx-now { display: flex; align-items: baseline; gap: 10px; }
.wx-temp { font-size: 40px; font-weight: 700; line-height: 1; }
.wx-temp small { font-size: 18px; }
.wx-desc { font-size: 16px; font-weight: 700; }
.wx-sub { display: grid; gap: 2px; font-size: 13px; color: var(--fg-2); }
.wx-sub li { display: flex; gap: 6px; align-items: center; }
.wx-sub .ic { color: var(--muted); }
.wbgt-now { margin-top: 16px; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.wbgt-label { display: block; font-size: 12.5px; color: var(--muted); }
.wbgt-val { font-size: 34px; font-weight: 700; line-height: 1.1; }
.level { font-weight: 700; font-size: 15px; padding: 6px 14px; border-radius: 8px; }
.level-3 { background: var(--caution-soft); color: var(--caution-text); box-shadow: inset 0 0 0 1.5px var(--caution); }
.wbgt-scale { position: relative; display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 1fr; gap: 3px; margin-top: 12px; height: 10px; }
.wbgt-scale span { border-radius: 3px; }
.wbgt-scale .s1 { background: #b8c9c0; }
.wbgt-scale .s2 { background: #e9cf7a; }
.wbgt-scale .s3 { background: #f2a066; }
.wbgt-scale .s4 { background: var(--caution); }
.wbgt-scale .s5 { background: var(--danger); }
.wbgt-marker { position: absolute; top: -5px; left: var(--x); width: 4px; height: 20px; margin-left: -2px; border-radius: 2px; background: var(--fg); box-shadow: 0 0 0 2px var(--surface); }
.wbgt-scale-lbl { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 1fr; font-size: 11px; color: var(--muted); margin-top: 3px; }
.wbgt-scale-lbl span { text-align: right; transform: translateX(50%); }
.wbgt-chart { margin-top: 12px; }
.wbgt-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.wbgt-chart text { font-family: var(--f-num); font-size: 10px; fill: var(--muted); }
.wbgt-alert { margin-top: 12px; display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.55; padding: 10px 12px; border-radius: 8px; background: var(--caution-soft); color: var(--fg); }
.wbgt-alert .ic { color: var(--caution-text); margin-top: 2px; }

/* 作業員 */
.big-num { font-size: 30px; font-weight: 700; line-height: 1; }
.big-num small { font-family: var(--f-body); font-size: 13px; margin-left: 4px; color: var(--muted); font-weight: 400; }
.crew-list { display: grid; gap: 10px; }
.crew-row { display: grid; grid-template-columns: 6.2em minmax(0, 1fr) 3.2em; align-items: center; gap: 10px; font-size: 14px; }
.crew-row .bar { height: 14px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.crew-row .bar i { display: block; height: 100%; border-radius: 4px; background: var(--fg-2); opacity: .82; transform-origin: left; animation: grow .7s cubic-bezier(.2,.8,.2,1) both; }
.crew-row:first-child .bar i { background: var(--accent); opacity: 1; }
.crew-row b { text-align: right; }
@keyframes grow { from { transform: scaleX(0); } }
.crew-foot { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line-2); }

/* 本日の作業 */
.task-list { display: grid; }
.task {
  display: grid; grid-template-columns: 3.4em 18px minmax(0, 1fr); gap: 10px; align-items: start;
  width: 100%; padding: 10px 6px; min-height: 56px; border: 0; border-radius: 8px; background: transparent; text-align: left;
  position: relative;
}
.task:hover { background: var(--surface-2); }
.task-time { font-size: 14px; font-weight: 700; padding-top: 1px; }
.task-dot { width: 14px; height: 14px; margin-top: 4px; border-radius: 50%; border: 2.5px solid var(--line-2); background: var(--surface); position: relative; z-index: 1; }
.task::before { content: ""; position: absolute; left: calc(6px + 3.4em + 10px + 6px); top: 0; bottom: 0; width: 2px; background: var(--line); }
.task:first-child::before { top: 20px; }
.task:last-child::before { bottom: calc(100% - 20px); }
.task-body { display: grid; gap: 3px; min-width: 0; }
.task-title { font-weight: 700; font-size: 14.5px; line-height: 1.45; }
.task-meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.st { font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--muted); background: var(--surface); }
.task[data-state="doing"] .task-dot { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.task[data-state="doing"] .st { color: var(--accent); border-color: var(--accent); }
.task[data-state="done"] .task-dot { border-color: var(--accent); background: var(--accent-soft); }
.task[data-state="done"] .task-title { color: var(--muted); }
.task[data-state="done"] .st { background: var(--surface-3); border-color: transparent; }

/* KY */
.ky-card { padding: 0; overflow: hidden; display: grid; }
.ky-head { display: flex; gap: 14px; align-items: flex-start; padding: 20px 20px 16px; background: var(--board); color: var(--board-ink); }
.ky-sign { flex: none; width: 48px; height: 44px; display: grid; place-items: center; }
.ky-sign svg { width: 48px; height: 44px; fill: #ffb02e; stroke: #1b1b1b; stroke-width: 1.5; stroke-linejoin: round; }
.ky-kicker { font-size: 12px; letter-spacing: .08em; opacity: .8; }
.ky-head h3 { font-size: 18px; line-height: 1.45; margin-top: 2px; }
.ky-points { display: grid; gap: 8px; padding: 16px 20px 4px; }
.ky-points li { display: grid; grid-template-columns: 3em minmax(0, 1fr); gap: 8px; font-size: 14px; line-height: 1.55; }
.ky-points b { font-size: 12px; text-align: center; align-self: start; padding: 2px 0; border-radius: 6px; background: var(--caution-soft); color: var(--caution-text); }
.ky-points .ky-measure b { background: var(--accent-soft); color: var(--accent); }
.ky-call { margin: 12px 20px 0; padding: 10px 12px; border: 1.5px dashed var(--line-2); border-radius: 8px; font-size: 12.5px; color: var(--muted); display: grid; }
.ky-call strong { font-size: 17px; color: var(--fg); letter-spacing: .04em; }
.ky-foot { display: flex; align-items: center; gap: 14px; justify-content: space-between; padding: 16px 20px 20px; flex-wrap: wrap; }
.ky-count { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); min-width: 130px; flex: 1; }
.ky-count b { font-size: 18px; color: var(--fg); }

/* 要対応 */
.alert-list { display: grid; gap: 8px; }
.alert {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 12px 12px 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line);
}
.alert-kind { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 6px; background: var(--surface-3); color: var(--fg-2); white-space: nowrap; }
.alert.is-late { border-left: 4px solid var(--caution); }
.alert.is-late .alert-kind { background: var(--caution-soft); color: var(--caution-text); }
.alert-text { min-width: 0; display: grid; }
.alert-text b { font-size: 14.5px; }
.alert-text span { font-size: 12.5px; color: var(--muted); }
.alert .btn { min-height: 44px; padding: 0 14px; font-size: 13.5px; }
.alert.is-resolved { opacity: .55; }
.alert.is-resolved .btn { pointer-events: none; }

/* 節目 */
.ms-list { display: grid; gap: 10px; }
.ms-list li { display: grid; grid-template-columns: 4.6em minmax(0, 1fr); gap: 12px; align-items: center; font-size: 14px; }
.ms-date { font-weight: 700; font-size: 16px; padding: 6px 0; text-align: center; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); }
.ms-date small { font-family: var(--f-body); font-size: 11px; color: var(--muted); margin-left: 3px; }

/* ---------- 工程表 ---------- */
.sched-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: grid; gap: 2px; box-shadow: var(--shadow); min-width: 0; }
.stat span { font-size: 12.5px; color: var(--muted); }
.stat b { font-size: 26px; line-height: 1.2; }
.stat small { font-size: 14px; color: var(--muted); font-family: var(--f-body); font-weight: 400; }
.stat-caution { border-left: 4px solid var(--caution); }
.stat-caution b { color: var(--caution-text); }

.gantt-card { padding: 0; overflow: hidden; }
.gantt-toolbar { display: flex; align-items: center; gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--fg-2); flex-wrap: wrap; margin-right: auto; }
.legend span { display: flex; align-items: center; gap: 6px; }
.lg { display: inline-block; width: 22px; height: 10px; border-radius: 3px; }
.lg-plan { background: transparent; border: 1.5px solid var(--line-2); background: repeating-linear-gradient(135deg, transparent 0 3px, var(--surface-3) 3px 5px); }
.lg-act { background: var(--accent); }
.lg-late { background: var(--caution); }
.lg-today { width: 3px; height: 14px; background: var(--fg); }
.gantt-hint { padding: 10px 16px 14px; }

.gantt-scroll { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
.gantt { --label: 236px; --wk: 46px; position: relative; width: calc(var(--label) + var(--weeks) * var(--wk)); }
.g-head { display: grid; grid-template-columns: var(--label) 1fr; position: sticky; top: 0; z-index: 3; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.g-corner { position: sticky; left: 0; z-index: 2; background: var(--surface-2); padding: 8px 16px; font-size: 12.5px; color: var(--muted); display: flex; align-items: flex-end; border-right: 1px solid var(--line); }
.g-months, .g-weeks { display: flex; }
.g-months span { flex: none; font-size: 13px; font-weight: 700; padding: 6px 8px 2px; border-left: 1px solid var(--line); white-space: nowrap; overflow: hidden; }
.g-weeks span { flex: none; width: var(--wk); font-size: 11px; color: var(--muted); padding: 2px 0 6px 6px; border-left: 1px solid var(--line); }

.gantt-row {
  display: grid; grid-template-columns: var(--label) 1fr; width: 100%;
  min-height: 58px; padding: 0; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); text-align: left;
}
.gantt-row:hover .g-label, .gantt-row:hover .g-track { background-color: var(--surface-2); }
.gantt-row.is-selected .g-label { box-shadow: inset 4px 0 0 var(--accent); }
.g-label { position: sticky; left: 0; z-index: 2; background: var(--surface); padding: 8px 12px 8px 16px; display: grid; gap: 4px; align-content: center; border-right: 1px solid var(--line); }
.g-name { font-weight: 700; font-size: 14px; line-height: 1.35; }
.g-sub { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.g-pct { font-weight: 700; color: var(--fg); }
.g-late { font-size: 11.5px; font-weight: 700; color: var(--caution-text); background: var(--caution-soft); padding: 0 6px; border-radius: 4px; }
.g-track {
  position: relative;
  background-image: repeating-linear-gradient(to right, transparent 0 calc(var(--wk) - 1px), var(--line) calc(var(--wk) - 1px) var(--wk));
}
.g-bar { position: absolute; height: 12px; border-radius: 4px; }
.g-plan { top: 13px; border: 1.5px solid var(--line-2); background: repeating-linear-gradient(135deg, transparent 0 3px, var(--surface-3) 3px 5px); }
.g-act { top: 31px; background: var(--accent); }
.g-act.is-late { background: var(--caution); }
.g-act.is-open::after { content: ""; position: absolute; right: -1px; top: -3px; bottom: -3px; width: 3px; border-radius: 2px; background: inherit; }
.g-act-pct { position: absolute; top: 28px; font-size: 11px; font-weight: 700; color: var(--fg-2); white-space: nowrap; }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--fg); z-index: 1; pointer-events: none; }
.g-today span { position: sticky; top: 0; display: inline-block; transform: translateX(-50%); margin-left: 1px; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 4px; background: var(--fg); color: var(--surface); white-space: nowrap; }
.gantt.only-late .gantt-row:not(.late) { display: none; }

/* 工程詳細パネル */
.scrim { position: fixed; inset: 0; z-index: 70; background: rgba(10, 14, 12, .38); animation: fade .2s both; }
@keyframes fade { from { opacity: 0; } }
.drawer {
  position: fixed; z-index: 80; top: 0; right: 0; bottom: 0; width: min(420px, 100%);
  background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  transform: translateX(105%); transition: transform .3s cubic-bezier(.2,.8,.2,1); visibility: hidden;
}
.drawer.open { transform: none; visibility: visible; }
.drawer-head { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; padding: 22px 22px 16px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 20px; }
.drawer-body { padding: 20px 22px 28px; overflow-y: auto; display: grid; gap: 18px; align-content: start; }
.gd-pct { display: flex; align-items: baseline; gap: 10px; }
.gd-pct b { font-size: 44px; line-height: 1; }
.gd-pct span { color: var(--muted); }
.gd-state { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13.5px; padding: 4px 12px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); justify-self: start; }
.gd-state.is-late { background: var(--caution-soft); color: var(--caution-text); }
.kv { margin: 0; display: grid; grid-template-columns: 6.5em minmax(0, 1fr); gap: 10px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 700; }
.gd-note { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); font-size: 14px; line-height: 1.6; }
.gd-note b { display: block; font-size: 12px; color: var(--muted); margin-bottom: 2px; }

/* ---------- 日報 ---------- */
.report-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px; align-items: start; }
.memo-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; position: sticky; top: calc(var(--strip-h) + 20px); }
.memo-card .card-head { margin-bottom: 0; }
.rec-bar { display: flex; align-items: center; gap: 14px; padding: 10px 14px 10px 10px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); }
.rec-btn { width: 52px; height: 52px; flex: none; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--fg); color: var(--surface); transition: background .2s; }
.rec-btn[aria-pressed="true"] { background: var(--danger); color: #fff; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(193, 39, 45, .18); } }
.wave { flex: 1; min-width: 0; height: 34px; display: flex; align-items: center; gap: 3px; overflow: hidden; }
.wave i { flex: 1 1 0; min-width: 2px; max-width: 4px; height: calc(var(--h) * 1%); min-height: 3px; border-radius: 2px; background: var(--line-2); transition: height .12s; }
.wave.live i { background: var(--fg-2); }
.rec-state { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.memo {
  width: 100%; resize: vertical; min-height: 280px;
  padding: 14px 16px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2);
  font-size: 15px; line-height: 1.85;
}
.memo:focus { outline: 3px solid var(--accent-soft); border-color: var(--accent); }
.memo-actions { display: flex; gap: 10px; justify-content: space-between; flex-wrap: wrap; }
.memo-actions .btn-primary { flex: 1; }

.paper-card { padding: 0; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr); }
.steps { display: flex; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); flex-wrap: wrap; }
.steps span { font-size: 12.5px; padding: 4px 10px 4px 26px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); position: relative; transition: all .2s; }
.steps span::before { content: ""; position: absolute; left: 9px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; border: 2px solid var(--line-2); }
.steps span.run { color: var(--fg); border-color: var(--fg-2); }
.steps span.run::before { border-color: var(--fg-2); border-top-color: transparent; animation: spin .7s linear infinite; }
.steps span.ok { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.steps span.ok::before { border-color: var(--accent); background: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }

.paper { padding: 26px 28px; min-height: 520px; background: var(--surface); }
.paper-empty { display: grid; place-items: center; text-align: center; gap: 10px; min-height: 460px; color: var(--fg-2); }
.paper-empty .ic { color: var(--line-2); }
.paper-empty p { font-size: 14px; line-height: 1.75; }
.rp-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; padding-bottom: 14px; border-bottom: 2px solid var(--fg); flex-wrap: wrap; }
.rp-head h2 { font-size: 22px; letter-spacing: .3em; }
.rp-head p { font-size: 12.5px; color: var(--muted); }
.rp-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line-2); border-top: 0; margin-bottom: 18px; }
.rp-meta div { padding: 8px 10px; border-left: 1px solid var(--line-2); font-size: 13px; min-width: 0; }
.rp-meta div:first-child { border-left: 0; }
.rp-meta small { display: block; font-size: 11px; color: var(--muted); }
.rp-sec { margin-top: 18px; }
.rp-sec h4 { margin: 0 0 8px; font-size: 14.5px; display: flex; align-items: center; gap: 8px; }
.rp-sec h4::before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: var(--board); }
.rp-table { width: 100%; border-collapse: collapse; font-size: 13.5px; table-layout: fixed; }
.rp-table th, .rp-table td { border: 1px solid var(--line-2); padding: 7px 9px; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.rp-table th { background: var(--surface-2); font-size: 12px; color: var(--fg-2); font-weight: 700; }
.rp-table td.r { text-align: right; }
.rp-table tfoot td { font-weight: 700; background: var(--surface-2); }
.rp-list { display: grid; gap: 6px; font-size: 14px; }
.rp-list li { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); gap: 10px; }
.rp-list li b { font-size: 12.5px; color: var(--muted); font-weight: 700; padding-top: 1px; }
.rp-ai { margin-top: 20px; padding: 12px 14px; border-radius: 10px; border: 1px dashed var(--accent); background: var(--accent-soft); display: grid; gap: 6px; font-size: 13px; }
.rp-ai p { display: flex; gap: 8px; align-items: flex-start; }
.rp-ai .ic { width: 16px; height: 16px; color: var(--accent); margin-top: 2px; }
.rp-ai strong { color: var(--accent); font-size: 12px; letter-spacing: .06em; }
.hl { background: linear-gradient(transparent 58%, var(--amber-soft) 58%); }
[data-unit].rp-hide { opacity: 0; transform: translateY(4px); }
[data-unit] { transition: opacity .25s, transform .25s; }
.paper.typing { cursor: progress; }
.paper-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); flex-wrap: wrap; }

/* ---------- 写真台帳 ---------- */
.photo-filters { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.selects { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.select { display: grid; gap: 2px; font-size: 12px; color: var(--muted); }
.select select, .field input, .field select, .field textarea {
  min-height: 46px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--fg); font-size: 15px;
}
.select select { min-width: 150px; }
.result-count { font-size: 14px; font-weight: 700; padding: 0 4px 12px; color: var(--fg-2); }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.photo-card {
  min-width: 0; display: grid; gap: 0; padding: 0; text-align: left;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; box-shadow: var(--shadow);
  transition: transform .18s, box-shadow .18s;
}
.photo-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,.12); }
.photo-cap { padding: 10px 12px 12px; display: grid; gap: 4px; }
.photo-cap b { font-size: 14px; line-height: 1.4; }
.photo-cap span { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.kind-tag { font-size: 11px; font-weight: 700; padding: 0 7px; border-radius: 4px; background: var(--surface-3); color: var(--fg-2); }

.photo-frame { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #777; container-type: inline-size; }
.photo-frame canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* 電子小黒板 */
.kokuban {
  position: absolute; left: 3.5%; bottom: 4.5%; width: 58%;
  background: var(--board);
  background-image: radial-gradient(120% 80% at 30% 20%, rgba(255,255,255,.06), transparent 60%);
  color: var(--board-ink);
  border: .9cqw solid #8a6b45;
  border-radius: .6cqw;
  box-shadow: 0 .8cqw 2cqw rgba(0,0,0,.35);
  font-family: var(--f-num);
  font-size: 2.5cqw;
  line-height: 1.25;
}
.kokuban table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.kokuban th, .kokuban td { border: .18cqw solid var(--board-line); padding: .45cqw .7cqw; font-weight: 400; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: clip; }
.kokuban th { width: 26%; font-size: .9em; opacity: .88; }
.kokuban tr:first-child th, .kokuban tr:first-child td { border-top: 0; }
.kokuban tr:last-child th, .kokuban tr:last-child td { border-bottom: 0; }
.kokuban th:first-child { border-left: 0; }
.kokuban td:last-child { border-right: 0; }
.kokuban .kb-val { font-weight: 700; }
.kokuban .kb-split { display: flex; gap: 0; }
.kokuban .kb-split span { flex: 1; }
.kokuban .kb-split span + span { border-left: .18cqw solid var(--board-line); padding-left: .7cqw; }
.photo-frame.big .kokuban { width: 50%; }

.shot-badge { position: absolute; top: 3%; right: 3%; font-size: 11px; padding: 2px 8px; border-radius: 99px; background: rgba(15,18,16,.62); color: #f0efe9; font-family: var(--f-num); backdrop-filter: blur(4px); }

.photo-modal {
  width: min(1180px, calc(100% - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: 16px;
  background: var(--surface); color: var(--fg); box-shadow: var(--shadow-lg); overflow: hidden;
}
.photo-modal::backdrop { background: rgba(8, 11, 10, .72); }
.photo-modal[open] { animation: pop .22s cubic-bezier(.2,.8,.2,1); }
@keyframes pop { from { opacity: 0; transform: scale(.97); } }
.pm-inner { display: grid; grid-template-columns: minmax(0, 1fr) 320px; max-height: calc(100vh - 32px); }
.pm-stage { position: relative; background: #0f1211; display: grid; align-items: center; min-width: 0; }
.pm-nav { position: absolute; top: 50%; margin-top: -24px; background: rgba(20,22,21,.62); border-color: rgba(255,255,255,.18); color: #fff; }
.pm-nav:hover { background: rgba(20,22,21,.82); }
.pm-nav.prev { left: 12px; }
.pm-nav.next { right: 12px; }
.pm-side { padding: 22px; display: grid; gap: 16px; align-content: start; overflow-y: auto; border-left: 1px solid var(--line); }
.pm-side-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.pm-side-head h2 { font-size: 18px; }
.pm-meta { margin: 0; display: grid; grid-template-columns: 5.5em minmax(0, 1fr); gap: 8px 12px; font-size: 14px; }
.pm-meta dt { color: var(--muted); }
.pm-meta dd { margin: 0; font-weight: 700; }
.pm-judge { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 14px; }
.pm-judge .ic { width: 20px; height: 20px; }

/* ---------- 安全・書類 ---------- */
.safety-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 16px; align-items: start; }
.safety-side { display: grid; gap: 16px; min-width: 0; }
.hh-list { display: grid; gap: 10px; }
.hh-item {
  display: grid; grid-template-columns: 4.2em minmax(0, 1fr); gap: 14px; padding: 14px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2);
}
.hh-item.is-new { animation: newIn .6s cubic-bezier(.2,.8,.2,1) both; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
@keyframes newIn { from { opacity: 0; transform: translateY(-8px); } }
.hh-date { text-align: center; display: grid; align-content: start; gap: 2px; }
.hh-date b { font-size: 20px; line-height: 1.1; }
.hh-date small { font-size: 11.5px; color: var(--muted); }
.hh-body { display: grid; gap: 6px; min-width: 0; }
.hh-text { font-size: 14.5px; font-weight: 700; line-height: 1.5; }
.hh-tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); }
.lv { font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 4px; }
.lv-高 { background: var(--danger-soft); color: var(--danger); }
.lv-中 { background: var(--caution-soft); color: var(--caution-text); }
.lv-低 { background: var(--surface-3); color: var(--fg-2); }
.hh-state { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--accent); }
.hh-state.open { color: var(--fg-2); }
.hh-measure { font-size: 13px; color: var(--fg-2); }
.hh-measure b { color: var(--muted); font-size: 12px; margin-right: 6px; }

.hh-form { display: grid; gap: 14px; }
.hh-form .card-head { margin-bottom: 0; }
.form-row.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.field { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; font-size: 13px; color: var(--fg-2); font-weight: 700; }
.field legend { padding: 0; margin-bottom: 6px; }
.field input, .field select { width: 100%; }
.field textarea { width: 100%; padding: 10px 12px; line-height: 1.6; resize: vertical; min-height: 92px; font-weight: 400; }
.field textarea.has-err { border-color: var(--danger); outline: 2px solid var(--danger-soft); }
.field-err { color: var(--danger); font-style: normal; font-size: 12.5px; }
.chips.wrap .chip { min-height: 42px; padding: 0 14px; font-size: 13.5px; }
.attach { justify-self: start; }

.doc-list { display: grid; }
.doc { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); min-height: 56px; }
.doc:first-child { border-top: 0; }
.doc-name { font-size: 14px; font-weight: 700; display: grid; line-height: 1.45; }
.doc-name small { font-weight: 400; color: var(--muted); font-size: 12px; }
.doc-ok { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 700; color: var(--accent); }
.doc-ok .ic { width: 16px; height: 16px; }
.doc .btn { min-height: 42px; padding: 0 14px; font-size: 13px; }

/* ---------- トースト ---------- */
.toast {
  position: fixed; z-index: 90; left: 50%; bottom: 28px;
  display: flex; align-items: center; gap: 10px; max-width: calc(100% - 32px);
  padding: 13px 20px; border-radius: 12px; background: var(--fg); color: var(--surface);
  font-weight: 700; font-size: 14.5px; box-shadow: var(--shadow-lg);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: transform .25s cubic-bezier(.2,.8,.2,1), opacity .2s;
}
.toast .ic { color: var(--accent-strong); }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
:root[data-theme="dark"] .toast .ic { color: var(--accent-ink); }

/* ---------- タブバー（スマホ） ---------- */
.tabbar { display: none; }

/* ---------- レスポンシブ ---------- */
@media (max-width: 1280px) {
  .today-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas: "site site" "wbgt ky" "crew task" "ms task" "alrt alrt";
  }
  .col-main, .col-side, .duo { display: contents; }
  .sched-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .solve { max-width: none; }
}
@media (max-width: 1080px) {
  :root { --nav-w: 92px; }
  .sidenav { padding: 18px 10px; align-items: stretch; }
  .brand { justify-content: center; padding: 0; }
  .brand-text, .site-pill, .me span:last-child, .theme-btn span { display: none; }
  .nav-item { flex-direction: column; justify-content: center; gap: 4px; min-height: 70px; padding: 6px 4px; font-size: 12px; text-align: center; }
  .nav-item[aria-current="page"]::before { left: -10px; }
  .nav-badge, .nav-tag { position: absolute; top: 6px; right: 10px; margin: 0; }
  .nav-badge { min-width: 20px; height: 20px; font-size: 11px; padding: 0 5px; }
  .nav-tag { display: none; }
  .me { justify-content: center; padding: 0; }
  .theme-btn { justify-content: center; padding: 0; }
  .report-grid, .safety-grid { grid-template-columns: minmax(0, 1fr); }
  .memo-card { position: static; }
  .pm-inner { grid-template-columns: minmax(0, 1fr); overflow-y: auto; }
  .pm-side { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 760px) {
  :root { --strip-h: 30px; }
  body { font-size: 15px; }
  .demo-strip { font-size: 11px; gap: 10px; justify-content: space-between; padding: 0 12px; }
  .demo-strip > span b { display: none; }
  .demo-strip .sep { display: none; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidenav { display: none; }
  .main { padding: 18px 16px calc(96px + env(safe-area-inset-bottom)); }
  .view { gap: 16px; }
  .view-head h1 { font-size: 25px; }
  .solve { font-size: 12.5px; }
  .today-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "site" "wbgt" "ky" "task" "crew" "alrt" "ms"; gap: 12px; }
  .card { padding: 16px; }
  .ky-card, .gantt-card, .paper-card { padding: 0; }
  .gantt-toolbar .btn { min-height: 44px; padding: 0 14px; }
  .gantt-toolbar .seg-btn { padding: 0 14px; }
  .g-sub > span:not(.g-pct):not(.g-late) { display: none; }
  .ky-head h3 { font-size: 17px; }
  .site-top { flex-direction: column; align-items: flex-start; }
  .site-id h2 { font-size: 19px; }
  .ring { width: 96px; height: 96px; }
  .ring-val { font-size: 22px; }
  .site-facts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .alert { grid-template-columns: minmax(0, 1fr) auto; }
  .alert-kind { grid-column: 1 / -1; justify-self: start; }
  .sched-summary { gap: 8px; }
  .stat { padding: 12px; }
  .stat b { font-size: 21px; }
  .gantt { --label: 150px; --wk: 40px; }
  .g-label { padding: 8px 8px 8px 12px; }
  .g-name { font-size: 13px; }
  .gantt-toolbar { gap: 12px; }
  .legend { order: 3; width: 100%; gap: 12px; font-size: 12px; }
  .paper { padding: 18px 16px; min-height: 0; }
  .paper-empty { min-height: 280px; }
  .rp-head h2 { font-size: 19px; letter-spacing: .2em; }
  .rp-meta { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .rp-meta div:nth-child(3) { border-left: 0; }
  .rp-meta div:nth-child(n+3) { border-top: 1px solid var(--line-2); }
  .rp-table { font-size: 12.5px; }
  .rp-table th, .rp-table td { padding: 6px 6px; }
  .rp-list li { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .memo { min-height: 220px; font-size: 14.5px; }
  .memo-actions .btn { flex: 1; }
  .photo-filters { display: grid; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; }
  .chips .chip { flex: none; }
  .chips.wrap { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
  .selects { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .select select { min-width: 0; width: 100%; }
  .result-count { grid-column: 1 / -1; padding: 0; }
  .photo-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .photo-cap { padding: 8px 10px 10px; }
  .photo-cap b { font-size: 13px; }
  .shot-badge { display: none; }
  .photo-modal { width: 100%; max-width: 100%; max-height: 100%; height: 100%; margin: 0; border-radius: 0; }
  .pm-inner { max-height: 100%; height: 100%; }
  .pm-stage { min-height: 0; }
  .pm-nav { width: 44px; height: 44px; margin-top: -22px; }
  .pm-nav.prev { left: 8px; }
  .pm-nav.next { right: 8px; }
  .photo-frame.big .kokuban { width: 64%; }
  .hh-item { grid-template-columns: 3.4em minmax(0, 1fr); gap: 10px; padding: 12px; }
  .drawer { top: auto; left: 0; width: 100%; max-height: 86vh; border-left: 0; border-top: 1px solid var(--line); border-radius: 18px 18px 0 0; transform: translateY(105%); }
  .drawer.open { transform: none; }
  .drawer-head { padding: 18px 16px 12px; }
  .drawer-body { padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(92px + env(safe-area-inset-bottom)); }

  .tabbar {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed; z-index: 50; left: 0; right: 0; bottom: 0;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: var(--nav-bg); border-top: 1px solid rgba(255,255,255,.06);
  }
  .tab {
    display: grid; justify-items: center; align-content: center; gap: 3px;
    min-height: 62px; border: 0; border-radius: 12px; background: transparent; color: var(--nav-muted);
    font-size: 11.5px; font-weight: 700;
  }
  .tab .ic { width: 26px; height: 26px; }
  .tab[aria-current="page"] { color: var(--nav-fg); background: var(--nav-active); }
  .tab[aria-current="page"] .ic { color: #4fd096; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
