/* 統合アプリ（試作・bench.tabumi.jp/next/）の見た目。
   色・字・部品の決まりは 今の3つのアプリと同じ（面＋枠・影なし・押せる物は 48px 以上・字は 15px 以上。例外は その場に理由）。
   配置: 1画面のアプリ。上から 題 → 中身（タブで切り替える）→ 下の5つのタブ（どの画面でも出す）。
   記録のメニュー（タイル）は マップの下。押すと 専用の入力画面（上に もどる・下に 主のボタン）。
   はじめは明るい色（今のアプリと同じ）。暗い色は :root[data-theme="dark"]（切り替えは これから）。 */
:root{
  --bg:#eceeeb; --card:#ffffff; --bg2:#eef1ee; --ink:#101a14; --ink2:#3d4a43; --line:#c9d0cb; --edge:#7d8a83;
  --accent:#176b35; --accent-ink:#ffffff; --accent-bg:#dcefe1;
  --danger:#b3261e; --warn:#8a4b00; --info:#12589c;
  --danger-bg:#fdeeec; --warn-bg:#fdf3e3; --info-bg:#e9f2fa;
  --ov:rgba(16,26,20,.45);
  /* 地図の色（作業＝緑・散布＝青・作業中＝橙・病害虫＝赤い点） */
  --m-work:rgba(23,107,53,.5); --m-spray:rgba(18,88,156,.45); --m-now:rgba(232,131,12,.5); --m-pest:#b3261e;
  /* グラフの線（圃場モニタと同じ。明るい・暗い で共通） */
  --c-temp:#e05c2a; --c-out:#0891b2; --c-hum:#1a73e8;
  /* 時間の帯の色（今の施設園芸記録と同じ 8色。農場の「時間の帯の色」の 1〜8。明るい・暗い で共通） */
  --viz1:#257de0; --viz2:#f47230; --viz3:#00b894; --viz4:#f2a600; --viz5:#ee7fac; --viz6:#008a17; --viz7:#6a4ce2; --viz8:#ec4647;
  /* カメラの画面は いつも暗い（テーマで変えない） */
  --cam-bg:#0b100d; --cam-ink:#f2f6f3; --cam-line:rgba(242,246,243,.62); --cam-face:rgba(242,246,243,.12);
  --knob:#ffffff;   /* スイッチの つまみ */
  --r:14px; --r-s:10px; --tap:48px;
  --fs:16px; --fs-s:15px; --fs-l:24px; --fs-xl:30px;
  --font:system-ui,-apple-system,"Hiragino Sans","Noto Sans JP",sans-serif;
}
:root[data-theme="dark"]{
  --bg:#0c110e; --card:#18201b; --bg2:#232d27; --ink:#f2f6f3; --ink2:#c5cfc8; --line:#39453e; --edge:#7f8c84;
  --accent:#6fdc95; --accent-ink:#07150c; --accent-bg:#1d3a29;
  --danger:#ff8a80; --warn:#ffc46b; --info:#8cc4ff;
  --danger-bg:#3a1f1b; --warn-bg:#33290f; --info-bg:#15283a;
  --ov:rgba(0,0,0,.6);
  --m-work:rgba(111,220,149,.45); --m-spray:rgba(140,196,255,.45); --m-now:rgba(255,196,107,.5); --m-pest:#ff8a80;
  --knob:#f2f6f3;
  color-scheme:dark;
}
*{box-sizing:border-box; -webkit-tap-highlight-color:transparent}
html,body{height:100%; margin:0}
html{background:var(--card); box-sizing:border-box; padding:env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px)}   /* 画面の上下の切り欠きの分 */
[hidden]{display:none !important}
body{background:var(--bg); color:var(--ink); font-family:var(--font); font-size:var(--fs); font-weight:500; line-height:1.5;
  overflow:hidden; -webkit-font-smoothing:antialiased; font-variant-numeric:tabular-nums}
:where(button){font-family:inherit; font-size:var(--fs-s); font-weight:700; color:var(--accent); background:var(--bg2); border:1.5px solid var(--edge);
  border-radius:999px; min-height:var(--tap); padding:8px 14px; cursor:pointer; touch-action:manipulation}
:where(input,select){font-family:inherit; color:var(--ink)}
:focus-visible{outline:2px solid var(--accent); outline-offset:2px}
h1,h2,p,dl,ul{margin:0} ul{padding:0; list-style:none}
svg.ic{width:22px; height:22px; flex:0 0 auto}

/* ── 骨組み ── */
.gut{padding-left:max(16px, env(safe-area-inset-left, 0px)); padding-right:max(16px, env(safe-area-inset-right, 0px))}
.app{position:relative; height:100%; max-width:480px; margin:0 auto; display:flex; flex-direction:column; background:var(--bg); overflow:hidden}
@media (min-width:500px){ .app{border-inline:1px solid var(--line)} }
.top{flex:0 0 auto; background:var(--card); border-bottom:1px solid var(--line)}
.top .in{display:flex; align-items:center; gap:8px; min-height:58px; padding-block:5px}
.ttl{flex:0 1 auto; min-width:0; font-size:clamp(20px, 6vw, var(--fs-l)); font-weight:800; line-height:1.3; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.hd-r{flex:1 1 0; min-width:0; display:flex; justify-content:flex-end}
/* お知らせのベル（現在のタブ・題の右。2026-12-03・持ち主の依頼「現在に通知があると とても見にくい。上にベルマークで」）。数字＝まだ見ていない件数 */
.bell{position:relative; flex:0 0 auto; width:var(--tap); height:var(--tap); min-height:0; padding:0; border:0; border-radius:999px; background:none; color:var(--ink); display:inline-flex; align-items:center; justify-content:center}
.bell[hidden]{display:none}
.bell svg.ic{width:26px; height:26px}
.bell .bdg{position:absolute; top:3px; right:0; min-width:20px; height:20px; padding:0 5px; border-radius:999px; background:var(--danger); color:var(--card); font-size:12px; font-weight:800; line-height:20px; text-align:center}
.facsw{-webkit-appearance:none; appearance:none; min-width:0; min-height:var(--tap); max-width:min(150px, 100%); border:1.5px solid var(--edge); border-radius:999px; background:var(--bg2);
  padding:8px 30px 8px 14px; font-size:16px; font-weight:700; text-overflow:ellipsis;
  background-image:linear-gradient(45deg, transparent 50%, var(--ink2) 50%), linear-gradient(135deg, var(--ink2) 50%, transparent 50%);
  background-size:6px 6px, 6px 6px; background-position:right 17px center, right 11px center; background-repeat:no-repeat}
.farm{display:block; min-width:0; max-width:100%; overflow:hidden; text-overflow:ellipsis; line-height:26px; padding:4px 12px; border:1px solid var(--line); border-radius:999px; background:var(--bg2); font-size:var(--fs-s); font-weight:700; white-space:nowrap}
.demo{flex:0 0 auto; font-size:13px; font-weight:700; color:var(--ink2); border:1.5px dashed var(--edge); border-radius:999px; padding:3px 9px; white-space:nowrap}   /* 試作のしるし（置き換えるときに外す） */
.view{flex:1 1 0; min-height:0; overflow-y:auto; overscroll-behavior:contain; -webkit-overflow-scrolling:touch}
.pad{display:flex; flex-direction:column; gap:12px; padding-block:14px 22px}
.lead{font-size:var(--fs-s); color:var(--ink2)}

/* ── 下の5つのタブ（真ん中がカメラ） ── */
.tabs{flex:0 0 auto; position:relative; z-index:5; background:var(--card); border-top:1px solid var(--line)}
.tabs .in{display:flex; align-items:stretch}
.tabs button{position:relative; flex:1 1 0; min-width:0; min-height:62px; border:0; border-radius:0; background:none; padding:8px 2px 6px;
  font-size:var(--fs-s); letter-spacing:-.02em; white-space:nowrap; color:var(--ink2); line-height:1.4;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px}
.tabs button.on{color:var(--accent); font-weight:800}
.tabs button.on::before{content:""; position:absolute; top:-1px; left:20%; right:20%; height:3px; border-radius:0 0 3px 3px; background:var(--accent)}   /* 選ばれたタブ＝緑の字＋太字＋上の線 */
.tabs .camb{flex:0 0 74px; padding:5px 0}
.tabs .camb .disc{width:52px; height:52px; border-radius:50%; background:var(--accent); color:var(--accent-ink); display:grid; place-items:center}
.tabs .camb .disc svg.ic{width:27px; height:27px}
.tabs .camb.on::before{display:none}
.tabs .camb.on .disc{outline:2.5px solid var(--accent); outline-offset:2px}   /* 選ばれている＝外の輪 */

/* ── 面・しるし・ボタン ── */
.card{background:var(--card); border:1px solid var(--line); border-radius:var(--r); padding:12px 14px}
.card h2{font-size:18px; font-weight:800; line-height:1.35}
.sechead{display:flex; flex-wrap:wrap; align-items:baseline; gap:2px 10px; margin-bottom:8px}
.sechead .meta{margin-left:auto; font-size:var(--fs-s); color:var(--ink2)}
.pill{display:inline-flex; align-items:center; gap:4px; font-size:var(--fs-s); font-weight:800; line-height:1.3; padding:2px 10px; border-radius:999px; border:1.5px solid var(--edge); background:var(--bg2); color:var(--ink); white-space:nowrap}
.pill svg.ic{width:17px; height:17px}
.pill.work{background:var(--accent-bg); color:var(--accent); border-color:var(--accent)}
.pill.pest{background:var(--danger-bg); color:var(--danger); border-color:var(--danger)}
.pill.spray{background:var(--info-bg); color:var(--info); border-color:var(--info)}
.pill.warn{background:var(--warn-bg); color:var(--warn); border-color:var(--warn)}
.big{display:flex; align-items:center; justify-content:center; gap:6px; width:100%; min-height:56px; border-radius:999px; font-size:17px; font-weight:800; padding:8px 16px}
.big.sm{min-height:var(--tap); font-size:16px; width:auto; flex:1 1 auto}
.b-green{background:var(--accent); color:var(--accent-ink); border:0}
.b-ghost{background:var(--bg2); color:var(--accent); border:1.5px solid var(--edge)}
.b-soon{background:none; color:var(--ink2); border:1.5px dashed var(--edge)}   /* まだ作っていない物＝点線の枠 */
.tbtn{background:none; border:0; border-radius:var(--r-s); padding:8px 6px; min-height:var(--tap); color:var(--accent); font-size:16px; font-weight:700}
dl.kv{display:grid; grid-template-columns:auto 1fr; gap:3px 12px; margin-top:8px}
dl.kv dt{font-size:var(--fs-s); font-weight:700; color:var(--ink2)}
dl.kv dd{margin:0; font-weight:700; min-width:0}
.btns{display:flex; flex-wrap:wrap; gap:8px; margin-top:10px}

/* ── チャット ── */
.view.chat{display:flex; flex-direction:column; overflow:hidden}
.thread{flex:1 1 0; min-height:0; overflow-y:auto; overscroll-behavior:contain; display:flex; flex-direction:column; gap:12px; padding-block:14px}
.thread > *{flex:0 0 auto}
.day{align-self:center; font-size:var(--fs-s); font-weight:700; color:var(--ink2); background:var(--card); border:1px solid var(--line); border-radius:999px; padding:2px 14px}
.msg{display:flex; max-width:88%}   /* 名前の丸い印は 出さない（2026-12-03 持ち主）。名前は 吹き出しの上に 文字で */
.msg .bw{min-width:0; display:flex; flex-direction:column; gap:2px}
.msg.sys{max-width:none}   /* サーバーの知らせ（前日の要約など）＝横いっぱい */
.msg.sys .bw{flex:1 1 auto}
.msg.sys .bb{border-radius:var(--r); background:var(--info-bg)}
.msg .nm,.msg .tm{font-size:var(--fs-s); color:var(--ink2); font-weight:600}
.msg .nm{font-weight:700}
.msg .bb{background:var(--card); border:1px solid var(--line); border-radius:16px 16px 16px 4px; padding:9px 13px; overflow-wrap:anywhere}
.msg.me{align-self:flex-end}
.msg.me .bw{align-items:flex-end}
.msg.me .bb{background:var(--accent-bg); border-color:var(--accent); border-radius:16px 16px 4px 16px}
.top-row{display:flex; flex-wrap:wrap; align-items:center; gap:4px 8px}
.top-row .when{margin-left:auto; font-size:var(--fs-s); color:var(--ink2); font-weight:600}
.top-row b{font-size:var(--fs); font-weight:800}
.place{font-size:var(--fs-s); color:var(--ink2); font-weight:600; margin-top:6px}
.sum{font-size:18px; font-weight:800; line-height:1.4; margin-top:2px}
.app-card .sum{margin-top:6px}
.sub{font-size:var(--fs-s); color:var(--ink2); font-weight:600}
.nt{margin-top:8px; font-size:var(--fs-s); font-weight:700; color:var(--ink2)}
.nt.bad{color:var(--danger)}

/* 人ごと・日ごとの記録のまとめ・個人の日報（今の施設園芸記録の 記録のまとめ・日報のカードと同じ見た目。2026-12-03） */
.dcard{background:var(--card); border:1px solid var(--line); border-radius:var(--r); padding:10px 14px; max-width:94%}
.dcard.me{align-self:flex-end; background:var(--accent-bg)}
.dcard.daily{background:var(--info-bg)}
.dcard.daily.me{background:var(--accent-bg)}
.dmeta{display:flex; align-items:center; gap:8px; font-size:var(--fs-s); color:var(--ink2); font-weight:700}
.dmeta .when{font-weight:600}
.dmeta .more{flex:0 0 auto; margin-left:auto}
.grow{flex:1 1 auto; min-width:0}
.muted{color:var(--ink2); font-weight:600}
.manual{color:var(--danger); font-weight:800; font-size:max(.92em,var(--fs-s)); margin-left:3px; white-space:nowrap}
.dlyhead{font-size:var(--fs); font-weight:800; margin:2px 0}
.dlytime{font-size:var(--fs-s)}
.dlytime b{color:var(--accent); font-variant-numeric:tabular-nums}
.dlyitems{margin-top:6px; border-top:1px solid var(--line)}
.dlyrow{display:flex; gap:8px; align-items:center; min-height:var(--tap); padding:6px 0; border-bottom:1px solid var(--line); font-size:var(--fs-s)}
.dlyrow[data-act]{cursor:pointer}
.dlyrow b{flex:0 0 auto; font-variant-numeric:tabular-nums}
.dlyrow.brk,.dlyrow.gap{color:var(--ink); min-height:0}
.dlywhere{display:block; font-size:var(--fs-s); color:var(--ink2); font-weight:600}
.dlyothers{display:flex; flex-wrap:wrap; gap:5px; margin-top:6px}
.dlyo{border:1.5px solid var(--edge); background:var(--card); color:var(--ink); border-radius:999px; min-height:var(--tap); display:inline-flex; align-items:center; padding:3px 11px; font-size:var(--fs-s); font-weight:600}
.dlyo[data-act]{cursor:pointer}
.dlynote{margin-top:7px; font-size:var(--fs-s); line-height:1.6; padding:8px 10px; background:var(--card); border-left:3px solid var(--accent); border-radius:0 8px 8px 0; white-space:pre-wrap; overflow-wrap:anywhere}
.dcard .rxr{margin-top:6px}
.dcard .tm{font-size:var(--fs-s); color:var(--ink2); font-weight:600; margin-top:4px}
.dswork{margin:6px 0 2px; font-size:var(--fs-s)}
.dfnote{margin-top:6px; font-size:var(--fs-s); color:var(--ink2); font-weight:600}
.dsbar{margin:6px 0 4px}
.dstrack{position:relative; height:20px; background:var(--card); border:1px solid var(--line); border-radius:6px}
.dsgl{position:absolute; top:0; bottom:0; width:1px; background:var(--line)}   /* 1時間ごとの目盛りの線（目立たせない） */
.dsseg{position:absolute; top:2px; bottom:2px; border-radius:4px}
.dstick{position:absolute; top:-4px; bottom:-4px; width:4px; margin-left:-2px; border-radius:2px; background:var(--ink2); border:1px solid var(--card)}   /* 時間の無い記録（病害虫・散布など）は その時刻に細い印 */
.dstick.pest{background:var(--danger)}
.dsaxis{position:relative; height:24px; font-size:var(--fs-s); color:var(--ink2); font-weight:600}
.dsaxis span{position:absolute; top:2px; transform:translateX(-50%); white-space:nowrap; line-height:1.3}
.dsaxis span.st{transform:none}
.dsaxis span.en{transform:translateX(-100%)}
.dsc0{background:var(--edge)} .dsc1{background:var(--viz1)} .dsc2{background:var(--viz2)} .dsc3{background:var(--viz3)} .dsc4{background:var(--viz4)}
.dsc5{background:var(--viz5)} .dsc6{background:var(--viz6)} .dsc7{background:var(--viz7)} .dsc8{background:var(--viz8)}
/* 休憩・記録のない時間の色は 農場で選ぶ（plan.js の dfColor。dk0＝灰・dk1〜8＝--viz1〜8）。形でも分ける（同じ色を選んでも 見分けられる） */
.dk0{--c:var(--edge)} .dk1{--c:var(--viz1)} .dk2{--c:var(--viz2)} .dk3{--c:var(--viz3)} .dk4{--c:var(--viz4)} .dk5{--c:var(--viz5)} .dk6{--c:var(--viz6)} .dk7{--c:var(--viz7)} .dk8{--c:var(--viz8)}
.dsbrk{position:absolute; top:2px; bottom:2px; border-radius:4px}
.dsbrk,.dssw.brk{background:repeating-linear-gradient(135deg, var(--c, var(--edge)) 0 2px, var(--card) 2px 5px); box-shadow:inset 0 0 0 1.5px var(--c, var(--edge))}   /* 休憩＝縞 */
.dsgap{position:absolute; top:2px; bottom:2px; border-radius:4px}
.dsgap,.dssw.gap{background:var(--card); background:color-mix(in srgb, var(--c, var(--viz4)) 18%, var(--card)); border:1.5px dashed var(--c, var(--viz4))}   /* 記録のない時間＝うすい面に 点線の枠 */
.dsnow{position:absolute; top:-5px; bottom:-5px; width:3px; margin-left:-1.5px; border-radius:2px; background:var(--accent)}   /* 作業中＝いまの所 */
.dsrow{display:flex; gap:8px; align-items:center; min-height:var(--tap); padding:6px 0; border-bottom:1px solid var(--line); font-size:var(--fs-s)}
.dslive{margin-left:6px; color:var(--accent); font-weight:800}
.dsrow .dslive{margin-left:0}
.dsgrp{border-bottom:1px solid var(--line)}
.dsgrp>summary{display:flex; gap:8px; align-items:center; min-height:var(--tap); padding:6px 0; font-size:var(--fs-s); cursor:pointer; list-style:none}
.dsgrp>summary::-webkit-details-marker{display:none}
.dsgrp>summary::after{content:"▾"; flex:0 0 auto; color:var(--ink2); font-size:var(--fs)}
.dsgrp[open]>summary::after{content:"▴"}
.dsgrp>summary b{flex:0 0 auto; font-variant-numeric:tabular-nums}
.dssw{flex:0 0 auto; width:16px; height:16px; border-radius:4px}   /* 帯と同じ色の見本（行が 帯の見方の表） */
.dssw.none{background:none; border:2px dashed var(--edge)}   /* 時間の無い作業（帯に出ていない） */
.dsic{flex:0 0 auto; width:16px; text-align:center}
.dsopen{margin-left:6px; color:var(--danger); font-weight:800}
.dsin{padding:4px 0 8px; display:flex; flex-direction:column; gap:8px}

.degap{margin:4px 0 0; font-size:var(--fs-s); line-height:1.6}   /* 日報の画面の「記録のない時間」（日報に残る） */
.degap b{color:var(--warn); font-variant-numeric:tabular-nums}
.degap:empty{display:none}

/* チャットの入力の帯（文字だけ。記録の入力は マップの下のメニューから 専用の画面で） */
.dock{flex:0 0 auto; background:var(--card); border-top:1px solid var(--line)}
.bar{display:flex; align-items:center; gap:8px; min-height:56px; padding-block:4px}
.bar input{flex:1 1 auto; min-width:0; min-height:var(--tap); border:1.5px solid var(--edge); border-radius:999px; background:var(--bg2); padding:0 16px; font-size:16px}
.send{flex:0 0 auto; width:var(--tap); height:var(--tap); min-height:0; padding:0; display:grid; place-items:center; border-radius:50%; border:0; background:var(--accent); color:var(--accent-ink)}

/* 記録のメニュー（マップの下に いつも出す。横5つ・2段＝マップを広く残す） */
.menu{display:grid; grid-template-columns:repeat(20, 1fr); gap:6px; padding-block:8px}   /* 上の段・下の段 5つずつ（2026-12-04〜 計画が上段に） */
.tile{grid-column:span 4; min-width:0; min-height:60px; border-radius:var(--r-s); padding:5px 1px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px;
  font-size:clamp(12px, 3.6vw, 15px); line-height:1.2; color:var(--ink); text-align:center}   /* 例外（12px〜）: 5つ並べた幅に「給液の量」が入る大きさ */
.tile{position:relative}
.tbadge{position:absolute; top:3px; right:4px; min-width:20px; height:20px; padding:0 5px; border-radius:999px; background:var(--accent); color:var(--accent-ink); font-size:12px; font-weight:800; line-height:20px; text-align:center}   /* 計画＝実施中・病害虫＝残り の数 */
.tile span{word-break:keep-all}
.tile svg.ic{width:24px; height:24px; color:var(--accent)}

/* 専用の入力画面（タブの上に出す。上に もどる・中に 項目ごとの面・下に 主のボタン） */
.view.cols{display:flex; flex-direction:column; overflow:hidden}
.scroll{flex:1 1 0; min-height:0; overflow-y:auto; overscroll-behavior:contain; -webkit-overflow-scrolling:touch}
.fsec h2{font-size:17px; margin-bottom:8px}
.chips{display:flex; flex-wrap:wrap; gap:8px}
.chip{min-height:var(--tap); padding:8px 16px; font-size:16px; color:var(--ink)}
.chip.on{background:var(--accent-bg); border:2px solid var(--accent); color:var(--accent); font-weight:800; padding:8px 15.5px}   /* 選ばれている＝面＋太い緑の枠＋太字＋✓ */
.fields{display:grid; gap:10px}
.fields.c2{grid-template-columns:1fr 1fr}
label.f{display:flex; flex-direction:column; gap:3px; min-width:0}
label.f .lb{font-size:var(--fs-s); font-weight:700; color:var(--ink2)}
label.f input{width:100%; min-width:0; min-height:var(--tap); border:1.5px solid var(--edge); border-radius:var(--r-s); background:var(--bg2); padding:0 12px; font-size:18px; font-weight:700}
label.f input::placeholder{color:var(--ink2); font-weight:500; font-size:15px}
.same{margin-top:4px}
.qtys{display:flex; flex-direction:column}
.qty{display:flex; align-items:center; gap:10px; padding:8px 0; border-top:1px solid var(--line)}
.qty:first-child{border-top:0}
.qty .ql{flex:1 1 auto; min-width:0; display:flex; flex-direction:column; line-height:1.35}
.qty .ql b{font-weight:800} .qty .ql span{font-size:var(--fs-s); color:var(--ink2); font-weight:600}
.stp{flex:0 0 auto; display:flex; align-items:center; gap:6px}
.stp button{width:var(--tap); height:var(--tap); min-height:0; padding:0; font-size:22px; line-height:1; color:var(--ink)}
.stp input{width:58px; height:var(--tap); text-align:center; border:1.5px solid var(--edge); border-radius:var(--r-s); background:var(--bg2); font-size:18px; font-weight:800}
.foot{flex:0 0 auto; background:var(--card); border-top:1px solid var(--line)}
.foot .in{display:flex; gap:8px; padding-block:10px}
.foot .big{flex:1 1 0; min-width:0; padding:8px 6px}
.cnt-wrap{display:flex; align-items:baseline; justify-content:center; gap:8px; padding:4px 0 12px}
.cnt{font-size:64px; font-weight:800; line-height:1}
.cnt-u{font-size:20px; font-weight:800}
.plus{min-height:88px; font-size:26px}
dl.k4{grid-template-columns:auto 1fr auto 1fr; margin:12px 0 4px}

/* まとめて入れる表（給液＝源水と系統ごと・生育調査＝株ごと）。空のマスは記録しない・うすい数字は前回の値 */
.entry-h{display:flex; align-items:baseline; gap:8px; margin-bottom:8px}
.entry-h .nm{font-size:18px; font-weight:800}
.entry-h .vr{font-size:var(--fs-s); color:var(--ink2); font-weight:600}
.rgrid{display:grid; grid-template-columns:auto repeat(var(--c, 2), minmax(0, 1fr)); gap:6px 8px; align-items:center}
.rgrid.nl{grid-template-columns:repeat(var(--c, 2), minmax(0, 1fr)); align-items:end}
.rgrid .rh{font-size:var(--fs-s); font-weight:700; color:var(--ink2); text-align:center; line-height:1.25}
.rgrid .rk{font-weight:700; padding-right:6px; white-space:nowrap}
.rgrid input{width:100%; min-width:0; min-height:var(--tap); border:1.5px solid var(--edge); border-radius:var(--r-s); background:var(--bg2); padding:0 4px; font-size:18px; font-weight:700; text-align:center}
.rgrid input::placeholder{color:var(--ink2); font-weight:500}
/* 農薬の名前の候補（打った文字で探す） */
.sug{display:flex; flex-direction:column; gap:6px; margin-top:6px}
.sugrow{display:flex; flex-direction:column; align-items:flex-start; min-height:var(--tap); border-radius:var(--r-s); padding:6px 12px; text-align:left; color:var(--ink); line-height:1.35}
.sugrow b{font-size:16px; font-weight:800} .sugrow span{font-size:var(--fs-s); color:var(--ink2); font-weight:600}
.mt{margin-top:10px}
.navrow.hist{border:1.5px solid var(--edge); border-radius:var(--r); background:var(--card)}
.spd{font-size:18px}

/* 計測中の帯（どのタブでも 下のタブの上に出る） */
.livebar{flex:0 0 auto; background:var(--card); border-top:1px solid var(--line)}
.livebar .in{display:flex; align-items:center; gap:8px; min-height:60px; padding-block:6px}
.livebar .lv-t{flex:1 1 auto; min-width:0; font-weight:800; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.livebar .lv-c{flex:0 0 auto; font-size:20px; font-weight:800}
.livebar .big.sm{flex:0 0 auto; padding:8px 18px}

/* ── マップ: はじめは 棟を横2つ・たてに並べた一覧（見るだけ・なるべく多く見せる）。棟を押すと その棟だけのマップ（ベンチを押して記録） ── */
.tgrid{display:grid; grid-template-columns:1fr 1fr; gap:10px}
.tcard{display:flex; flex-direction:column; align-items:stretch; gap:6px; min-width:0; min-height:0; padding:8px; border:1.5px solid var(--edge); border-radius:var(--r); background:var(--card); color:var(--ink); text-align:left}
.tc-h{display:flex; align-items:baseline; gap:6px; white-space:nowrap}
.tc-h .nm{font-size:18px; font-weight:800; line-height:1.3}
.tc-h .vr{flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; font-size:var(--fs-s); color:var(--ink2); font-weight:600}
.tc-h .chev{font-size:20px; font-weight:700; color:var(--ink2); line-height:1}
.mini{display:grid; grid-template-columns:repeat(var(--n, 7), 1fr); gap:3px}
.mb{display:flex; flex-direction:column; gap:2px; min-width:0}
.mb .no{font-size:12px; font-weight:700; line-height:1; text-align:center; color:var(--ink2)}   /* 例外（12px）: 幅 20px ほどのベンチの番号 */
.mb .g{display:grid; grid-template-columns:1fr 1fr; grid-auto-rows:1fr; height:70px; gap:1px; padding:1px; border:1px solid var(--edge); border-radius:4px; background:var(--card)}
.mb .c{min-height:1px; border-radius:1.5px; background:var(--bg2)}
.mb .c.w{background:var(--m-work)} .mb .c.s{background:var(--m-spray)} .mb .c.n{background:var(--m-now)} .mb .c.p{background:var(--m-pest)}
.back{flex:0 0 auto; width:var(--tap); height:var(--tap); min-height:0; padding:0 0 3px; margin-left:-4px; border-radius:50%; font-size:26px; line-height:1}
.mapwrap{overflow-x:auto; padding:2px 2px 8px; -webkit-overflow-scrolling:touch}
.hcol{background:var(--card); border:1px solid var(--line); border-radius:var(--r); padding:10px}
.hcol-h{display:flex; align-items:baseline; gap:8px; margin-bottom:8px; white-space:nowrap}
.hcol-h .vr{font-size:var(--fs-s); color:var(--ink2); font-weight:600}
.benches{display:flex; gap:6px}
.vbench{flex:1 1 0; min-width:32px; min-height:0; padding:0; border:0; border-radius:8px; background:none; color:var(--ink); display:flex; flex-direction:column; align-items:center; gap:3px}
.vbench .bno{font-size:var(--fs-s); font-weight:800; line-height:1; padding:6px 0 4px}
.bgrid{display:grid; grid-template-columns:1fr 1fr; grid-auto-rows:1fr; height:230px; gap:2px; width:100%; padding:3px; border:1.5px solid var(--edge); border-radius:8px; background:var(--card)}
.gc{position:relative; min-height:2px; border-radius:3px; background:var(--bg2)}
.gc.w{background:var(--m-work)} .gc.s{background:var(--m-spray)} .gc.n{background:var(--m-now)}
.gc.p::after{content:""; position:absolute; inset:0; margin:auto; width:11px; height:11px; border-radius:50%; background:var(--m-pest)}
.vbench .blen{font-size:12px; font-weight:600; color:var(--ink2); line-height:1; padding:3px 0 2px}   /* 例外（12px）: ベンチの長さ。7本並べた幅（40px ほど）に入る大きさ */
.legend{display:flex; flex-wrap:wrap; gap:6px 16px; font-size:var(--fs-s); font-weight:600; color:var(--ink2)}
.legend li{display:flex; align-items:center; gap:6px}
.legend i{width:18px; height:14px; border-radius:3px; border:1px solid var(--edge)}
.legend i.w{background:var(--m-work)} .legend i.s{background:var(--m-spray)} .legend i.n{background:var(--m-now)}
.legend i.p{border:0; width:11px; height:11px; border-radius:50%; background:var(--m-pest)}

/* ── 現在（いまの値とグラフ） ── */
.stats{display:grid; grid-template-columns:1fr 1fr; gap:12px}
.stat .lb{font-size:var(--fs-s); font-weight:700; color:var(--ink2)}
.stat .v{font-size:var(--fs-xl); font-weight:800; line-height:1.2}
.stat .v small{font-size:var(--fs-s); font-weight:700; color:var(--ink2); margin-left:3px}
.stat .s{font-size:var(--fs-s); color:var(--ink2); font-weight:600}
.lg{display:flex; flex-wrap:wrap; gap:4px 16px; font-size:var(--fs-s); font-weight:600; color:var(--ink2); margin-bottom:4px}
.lg span{display:flex; align-items:center; gap:6px}
.lg i{width:16px; height:3px; border-radius:2px}
.chart{position:relative}
.chart svg{display:block; width:100%; height:auto; touch-action:pan-y; border-radius:6px}
.chart .ax{font-size:11px; font-weight:600; fill:var(--ink2)}   /* 例外（グラフの目盛） */
.chart .grid{stroke:var(--line); stroke-width:1}
.chart .xh{stroke:var(--edge); stroke-width:1}
.chart .endv{font-size:12px; font-weight:800; fill:var(--ink)}
.tip{position:absolute; top:2px; pointer-events:none; background:var(--card); border:1px solid var(--edge); border-radius:8px; padding:5px 9px; font-size:13px; line-height:1.45; white-space:nowrap}
.tip .tt{font-weight:700; color:var(--ink2)}
.tip .tr{display:flex; align-items:center; gap:6px}
.tip .tr i{width:12px; height:3px; border-radius:2px}
.tip .tr b{font-weight:800}
.tip .tr span{color:var(--ink2)}
.cap{font-size:var(--fs-s); color:var(--ink2); font-weight:600; margin-top:4px}
table.irr{width:100%; border-collapse:collapse; font-size:var(--fs)}
table.irr th,table.irr td{padding:6px 4px; text-align:right; border-top:1px solid var(--line)}
table.irr thead th{border-top:0; font-size:var(--fs-s); color:var(--ink2); font-weight:700}
table.irr th:first-child{text-align:left; font-weight:700}
table.irr td{font-weight:800}
.meter{height:12px; border-radius:6px; background:var(--bg2); border:1px solid var(--line); overflow:hidden; margin:8px 0 4px}
.meter i{display:block; height:100%; border-radius:0 4px 4px 0; background:var(--accent)}
.bigv{font-size:var(--fs-l); font-weight:800; line-height:1.3}
.bigv small{font-size:var(--fs-s); color:var(--ink2); font-weight:700}

/* ── カメラ ── */
.view.cam{display:flex; flex-direction:column; background:var(--cam-bg); color:var(--cam-ink)}
.vf{flex:1 1 auto; min-height:190px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px; padding-block:14px}
.frame{position:relative; width:min(54vw, 200px); aspect-ratio:1; max-width:100%}
.frame i{position:absolute; width:34px; height:34px; border:4px solid var(--cam-ink)}
.frame i:nth-child(1){top:0; left:0; border-right:0; border-bottom:0; border-radius:10px 0 0 0}
.frame i:nth-child(2){top:0; right:0; border-left:0; border-bottom:0; border-radius:0 10px 0 0}
.frame i:nth-child(3){bottom:0; left:0; border-right:0; border-top:0; border-radius:0 0 0 10px}
.frame i:nth-child(4){bottom:0; right:0; border-left:0; border-top:0; border-radius:0 0 10px 0}
.vf p{font-size:var(--fs); font-weight:700; text-align:center}
.cam-ui{flex:0 0 auto; display:flex; flex-direction:column; gap:10px; padding-block:6px 16px}
.seg{display:flex; gap:6px; padding:4px; border:1.5px solid var(--cam-line); border-radius:999px}
.seg button{flex:1 1 0; min-width:0; min-height:44px; border:0; background:none; color:var(--cam-ink); font-size:16px}
.seg button.on{background:var(--cam-ink); color:var(--cam-bg); font-weight:800}
.cam-cap{font-size:var(--fs-s); font-weight:600; color:var(--cam-ink)}
.cam-ex{display:flex; flex-direction:column; gap:8px}
.cam-ex button{display:flex; align-items:center; justify-content:space-between; gap:10px; min-height:54px; border-radius:var(--r); border:1.5px solid var(--cam-line); background:var(--cam-face); color:var(--cam-ink); font-size:17px; font-weight:800; text-align:left}
.cam-ex small{font-size:var(--fs-s); font-weight:600}

/* ── 設定 ── */
.sect{font-size:var(--fs-s); font-weight:800; color:var(--ink2); margin:6px 2px -4px}
.navlist{padding:0; overflow:hidden}
.navrow{display:flex; align-items:center; gap:10px; width:100%; min-height:58px; padding:9px 14px; border:0; border-top:1px solid var(--line); border-radius:0; background:none; color:var(--ink); text-align:left}
.navlist > .navrow:first-child{border-top:0}
.navrow .tx{flex:1 1 auto; min-width:0; display:flex; flex-direction:column}
.navrow .nvl{font-size:17px; font-weight:700; line-height:1.35}
.navrow .nvs{font-size:var(--fs-s); font-weight:500; color:var(--ink2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.navrow .chev{flex:0 0 auto; font-size:24px; font-weight:700; color:var(--ink2); line-height:1}
/* 設定の行（レイヤー）: 右に いまの値（押すと えらぶ一覧）・オン／オフの スイッチ・えらぶ一覧の ✓ */
.navrow .val{flex:0 1 auto; min-width:0; max-width:46%; font-size:var(--fs-s); font-weight:700; color:var(--ink2); text-align:right; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.navrow.sw .nvs{white-space:normal}
.navrow .tg{flex:0 0 auto; position:relative; width:54px; height:32px; border-radius:999px; background:var(--line); border:1.5px solid var(--edge); transition:background-color .15s}
.navrow .tg::after{content:""; position:absolute; top:2px; left:2px; width:25px; height:25px; border-radius:50%; background:var(--knob); box-shadow:0 1px 3px rgba(0,0,0,.35); transition:transform .15s}
.navrow[aria-checked="true"] .tg{background:var(--accent); border-color:var(--accent)}
.navrow[aria-checked="true"] .tg::after{transform:translateX(22px)}
.navrow:disabled{cursor:default}
.navrow:disabled .tg{opacity:.5}
.navrow .ck{flex:0 0 auto; width:24px; font-size:20px; font-weight:800; color:var(--accent); text-align:center}
.navrow[role="radio"][aria-checked="true"] .nvl{color:var(--accent); font-weight:800}
.navrow[role="radio"] .nvs{white-space:normal}
.pad > .hint{font-size:var(--fs-s); color:var(--ink2); font-weight:600; margin:-4px 4px 0}
@media (prefers-reduced-motion:reduce){ .navrow .tg, .navrow .tg::after{transition:none} }

/* ── シート・知らせ ── */
.sheet-ov{position:absolute; inset:0; z-index:30; background:var(--ov); display:flex; align-items:flex-end}
.sheet{width:100%; max-height:86%; overflow-y:auto; background:var(--card); border-radius:18px 18px 0 0; padding-block:16px 18px; display:flex; flex-direction:column; gap:10px}
.sheet h2{font-size:20px; font-weight:800}
.sheet .q{font-size:18px; font-weight:800; margin-top:6px}
.row3{display:flex; gap:8px}
.row3 .big{flex:1 1 0; min-width:0; padding:8px 4px; font-size:16px}
.toast{position:absolute; z-index:40; left:50%; top:68px; transform:translateX(-50%); max-width:calc(100% - 32px); background:var(--ink); color:var(--card);
  border-radius:999px; padding:9px 18px; font-size:var(--fs-s); font-weight:700; text-align:center}

/* ── グラフ（色は 項目ごとに決まった色。印の輪は 面の色） ── */
.chart .ring{stroke:var(--card); stroke-width:2}
.chart .ln{fill:none; stroke-width:2; stroke-linejoin:round; stroke-linecap:round}
.lg i{display:inline-block}

/* ── ログイン・お知らせの帯・つながりの確かめ ── */
.login{display:flex; flex-direction:column; gap:12px; padding-block:22px}
.login .lead{margin-bottom:4px}
.err{color:var(--danger); font-weight:700}
.note{flex:0 0 auto; background:var(--warn-bg); color:var(--warn); border-top:1px solid var(--line); font-size:var(--fs-s); font-weight:700}
.note .in{padding-block:8px}
.conn{display:flex; flex-direction:column}
.conn .row{display:flex; align-items:flex-start; gap:10px; padding:10px 0; border-top:1px solid var(--line)}
.conn .row:first-child{border-top:0}
.conn .nm{flex:0 0 7.5em; font-weight:800}
.conn .st{flex:1 1 auto; min-width:0; font-size:var(--fs-s); font-weight:600; color:var(--ink2)}
.conn .st b{display:block; font-size:var(--fs); font-weight:800; color:var(--ink)}
.conn .st b.ok{color:var(--accent)} .conn .st b.ng{color:var(--danger)}
a.navrow{text-decoration:none}
.chipsel{display:flex; flex-wrap:wrap; gap:8px}
.fsec .hint{font-size:var(--fs-s); color:var(--ink2); font-weight:600; margin-top:6px}
.qty .left{font-size:var(--fs-s); color:var(--ink2); font-weight:600}

/* ③ 記録の入力（作業・病害虫・散布）と 散布履歴 */
.fields.c3{grid-template-columns:1fr 1fr 1fr}
.fsec h3.fh, .card h3.fh{font-size:var(--fs-s); color:var(--ink2); font-weight:700; margin:12px 0 6px}
div.f{display:flex; flex-direction:column; gap:3px; min-width:0}
div.f .lb{font-size:var(--fs-s); font-weight:700; color:var(--ink2)}
div.f .chips{gap:6px; flex-wrap:nowrap}
div.f .chip{flex:1 1 0; min-width:0; padding:8px 0; text-align:center}
label.f input[type="datetime-local"], label.f input[type="time"]{font-size:17px; padding:0 8px}
textarea{display:block; width:100%; min-height:72px; border:1.5px solid var(--edge); border-radius:var(--r-s); background:var(--bg2); padding:10px 12px; font:inherit; font-size:17px; color:var(--ink); resize:vertical}
.prow{display:flex; flex-direction:column; gap:6px; margin-top:12px}
.prow .tou{align-self:flex-start}
.chips.bns{gap:6px}
.chip.bn, .chip.bn.on{min-width:var(--tap); padding:8px 0; text-align:center}
/* 記録の画面の「場所 ›」の1行（押すと 場所を えらぶ画面）と その画面（棟ごとに ベンチを 縦の棒で並べる＝マップと同じ向き） */
.navrow.box{border:1.5px solid var(--edge); border-radius:var(--r); background:var(--card)}
.navrow.box .nvs{white-space:normal}
.navrow .nvl.none{color:var(--ink2); font-weight:600}
.plmap{display:flex; flex-direction:column; gap:10px; margin-top:12px}
.pltou{border:1.5px solid var(--edge); border-radius:var(--r); background:var(--card); padding:6px 8px 10px}
.plth{display:flex; align-items:center; justify-content:space-between; gap:8px; width:100%; min-height:var(--tap); padding:4px 6px; border:0; border-radius:var(--r-s); background:none; color:var(--ink); text-align:left}
.plth .nm{font-size:17px; font-weight:800; min-width:0; overflow-wrap:anywhere}
.plth .al{flex:0 0 auto; padding:4px 12px; border:1.5px solid var(--edge); border-radius:999px; font-size:var(--fs-s); font-weight:700; color:var(--ink2)}
.plth.on .al{background:var(--accent-bg); border:2px solid var(--accent); color:var(--accent); font-weight:800}
.plbs{display:grid; grid-template-columns:repeat(var(--n, 7), minmax(0, 1fr)); gap:6px; margin-top:4px}   /* 1棟を 横1列に（8本まで。それより多いと 次の行へ） */
.plb{height:96px; padding:6px 0 0; border:1.5px solid var(--edge); border-radius:8px; background:var(--bg2); color:var(--ink); font-size:17px; font-weight:800; display:flex; align-items:flex-start; justify-content:center}
.plb.on{background:var(--accent); border-color:var(--accent); color:var(--accent-ink)}   /* 選んだベンチ＝塗りつぶし（色だけに頼らない: aria-pressed と 下の文） */
.chem{border-top:1px solid var(--line); margin-top:14px; padding-top:10px}
.chem .tbtn.sm{min-height:var(--tap); padding:4px 10px; color:var(--danger)}
.alerts{list-style:none; margin:8px 0 0; padding:0; display:grid; gap:4px; font-size:var(--fs-s); font-weight:700}
.alerts li{padding:6px 10px; border-radius:var(--r-s); background:var(--bg2)}
.alerts li.warn{background:var(--warn-bg); color:var(--warn)}
.alerts li.over{background:var(--danger-bg); color:var(--danger)}
.sugh{font-size:var(--fs-s); color:var(--ink2); font-weight:700; margin-top:4px}
.sugrow{border:1.5px solid var(--line); background:var(--card)}
.sugrow.ok{border-color:var(--accent)}
.btns.top{align-items:center; justify-content:space-between; margin-top:0; flex-wrap:nowrap}
.btns.top .lead{margin:0}
.btns.shb .big{flex:1 1 0; min-width:0; padding:8px 4px}
.utbl .ur{display:flex; gap:8px; align-items:baseline; padding:7px 0; border-bottom:1px solid var(--line)}
.utbl .ur:last-child{border-bottom:0}
.ur .gr{flex:1 1 auto; min-width:0; font-weight:700; overflow-wrap:anywhere}
.un{flex:0 0 auto; font-weight:800} .un.over{color:var(--danger)} .un.warn{color:var(--warn)}
.ul{flex:0 0 auto; min-width:5.2em; text-align:right; color:var(--ink2); font-size:var(--fs-s); font-weight:600}
.sptbl{width:100%; border-collapse:collapse; margin-top:6px; font-size:var(--fs)}
.sptbl th{text-align:left; font-weight:700; padding:3px 0; overflow-wrap:anywhere}
.sptbl td{text-align:right; white-space:nowrap; padding:3px 0 3px 10px; color:var(--ink2); font-weight:600}
.card.sp + .card.sp{margin-top:10px}

/* ④ チャットの入力欄 */
.composer{flex:0 0 auto; background:var(--card); border-top:1px solid var(--line)}
.composer .in{display:flex; align-items:flex-end; gap:8px; padding-block:8px}
.composer textarea{flex:1 1 auto; min-width:0; min-height:var(--tap); max-height:120px; resize:none; padding:11px 12px; line-height:1.4}
.send:disabled{opacity:.5}

/* ⑤ 計測の帯（下のタブの上）と 確かめのシート */
.livebar button.lv-t{background:none; border:0; padding:0; text-align:left; color:var(--ink); font:inherit; font-weight:800; min-height:var(--tap)}
.livebar .lv-t{font-size:16px}
.btns.col{flex-direction:column}
.btns.col .big{width:100%}
.big.danger{color:var(--danger); border-color:var(--danger)}
.wtxt{color:var(--warn); font-weight:700}   /* 日付が変わって 自動で終えた計測・長すぎる計測（時刻を直してから記録） */
.foot .in .big.b-ghost{flex:0 1 auto; width:auto; padding-inline:14px}   /* 脇のボタン（計測スタートなど）は 文の幅だけ。.big の width:100% のままだと 主のボタンが 潰れる */

/* ④ カメラ（映像を 画面いっぱいに。枠と文は その上） */
.view.cam{position:relative; overflow:hidden}
#camVid{position:absolute; inset:0; width:100%; height:100%; object-fit:cover; background:var(--cam-bg)}
.view.cam .vf{position:relative; z-index:1; height:100%}
.view.cam .vf p{background:rgba(11,16,13,.72); color:var(--cam-ink); padding:8px 14px; border-radius:var(--r-s); max-width:90%}
/* ④ 選果（アプリで数える） */
.sortbig{display:flex; flex-direction:column; align-items:center; gap:6px; text-align:center}
.sortbig .lb{font-size:var(--fs-s); font-weight:700; color:var(--ink2)}
.sortbig .v{font-size:44px; font-weight:800; font-variant-numeric:tabular-nums; line-height:1.1}
.sortbig .tap{width:100%; min-height:84px; font-size:24px}
.chip small{font-weight:600; color:var(--ink2); font-size:var(--fs-s)}

/* ── ⑥ 記録の詳細・直す・消す／病害虫の対応 ── */
.chattop{flex:0 0 auto; background:var(--card); border-bottom:1px solid var(--line)}
.chattop .in{display:flex; gap:8px; padding-block:8px; overflow-x:auto}
.ctop{flex:1 1 0; min-width:84px; min-height:var(--tap); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:0; padding:6px 8px; border:1.5px solid var(--edge); border-radius:var(--r); background:var(--card); color:var(--ink)}
.ctop b{font-size:16px; font-weight:800; line-height:1.3}
.ctop span{font-size:var(--fs-s); font-weight:600; color:var(--ink2); line-height:1.3; text-align:center; overflow-wrap:anywhere}   /* 狭いときは 折り返してよい */
.card.rec.tap{cursor:pointer}
.card.rec.tap:focus-visible{outline:3px solid var(--accent); outline-offset:2px}
.tbtn.sm{min-height:var(--tap); padding:4px 2px; text-align:left}
.msg.me .tbtn.sm{text-align:right}
.hist{list-style:none; margin:6px 0 0; padding:0; display:flex; flex-direction:column; gap:6px; font-size:var(--fs-s); color:var(--ink2); font-weight:600}
.hist b{color:var(--ink); font-weight:800}
.hist span{overflow-wrap:anywhere}
.histd summary{min-height:var(--tap); display:flex; align-items:center; font-size:var(--fs-s); font-weight:700; color:var(--accent); cursor:pointer}
.navlist.bd{border:1px solid var(--line); border-radius:var(--r)}
.sheet .navrow{padding-inline:10px}
.plist{padding:0 6px}
.prow2{display:flex; align-items:center; gap:4px; border-top:1px solid var(--line)}
.prow2:first-child{border-top:0}
.prow2 .navrow{border-top:0; padding-inline:6px; flex:1 1 auto; min-width:0}
.chk{flex:0 0 auto; width:var(--tap); height:var(--tap); border:2px solid var(--edge); border-radius:var(--r-s); background:var(--card); color:var(--accent); font-size:22px; font-weight:800; line-height:1; display:grid; place-items:center}
.chk.on{border-color:var(--accent); background:var(--accent-bg)}

/* ── ⑦ 計画・やること ── */
.card.plan + .card.plan{margin-top:10px}
.pbar{height:10px; border-radius:999px; background:var(--bg2); border:1px solid var(--line); overflow:hidden; margin-top:10px}
.pbar-in{height:100%; background:var(--accent); border-radius:999px}
.sub.mt{margin-top:6px}
.sub.warn{color:var(--danger); font-weight:700}
.pill.ps-doing{background:var(--accent-bg); color:var(--accent); border-color:var(--accent)}
.pill.ps-over{background:var(--danger-bg); color:var(--danger); border-color:var(--danger)}
.pill.ps-future{background:var(--info-bg); color:var(--info); border-color:var(--info)}
.prow2.tdone .nvl{text-decoration:line-through; color:var(--ink2)}
.nvs.late{color:var(--danger); font-weight:700}

/* ── ⑧ 日報 ── */
.pre{white-space:pre-wrap; overflow-wrap:anywhere; font-size:var(--fs-s); line-height:1.6; margin-top:6px}
dl.kv.wide{grid-template-columns:1fr auto}
dl.kv.wide dd{text-align:right}

/* ── ⑩ 出荷: きょうの数・この日の記録 ── */
table.stk{width:100%; border-collapse:collapse; margin-top:6px; font-size:var(--fs)}
table.stk th, table.stk td{padding:7px 4px; border-top:1px solid var(--line); text-align:right; font-weight:600}
table.stk thead th{border-top:0; font-size:var(--fs-s); color:var(--ink2); font-weight:700}
table.stk th:first-child{text-align:left}
table.stk tbody th{font-weight:700}
table.stk small{display:block; font-size:var(--fs-s); color:var(--ink2); font-weight:600}
table.stk td.lf b{font-size:18px; font-weight:800}
table.stk tr.warn th, table.stk tr.warn small{color:var(--danger)}
/* ⑳ グラフの 日ごとの値（列が多いので 横に動かす・日の列は 止める） */
.gday summary{min-height:var(--tap); display:flex; align-items:center; font-weight:700; color:var(--accent); cursor:pointer}
.tscroll{overflow-x:auto; -webkit-overflow-scrolling:touch}
table.gtb th, table.gtb td{white-space:nowrap; padding-inline:6px}
table.gtb th:first-child{position:sticky; left:0; z-index:1; background:var(--card)}   /* 見出しの「日」も 止める（列の名前が ずれて見えない） */
.prow2 div.navrow{cursor:default}
.tbtn.del{flex:0 0 auto; color:var(--danger); padding-inline:10px}

/* ── ⑪ 設定 ── */
.card h3.fh.first{margin-top:0}
.chip:disabled{opacity:.55}
.chip.on:disabled{opacity:.9}

/* ── ⑨ 現在: お知らせ・期間の切り替え ── */
.ntl{list-style:none; margin:6px 0 0; padding:0; display:flex; flex-direction:column}
.ntl li{border-top:1px solid var(--line)}
.ntl li:first-child{border-top:0}
/* 1件＝押すと 全文（シート）。収穫の知らせは その日の 品種ごとと 合計の表（.ntt）・ほかは 文を改行のまま（.ntm） */
.ntb{display:flex; align-items:center; gap:8px; width:100%; padding:8px 0; border:0; border-radius:0; background:none; color:var(--ink); text-align:left; font:inherit}
.ntb .tx{flex:1 1 auto; min-width:0; display:flex; flex-direction:column; gap:2px}
.ntb .chev{flex:0 0 auto; font-size:22px; font-weight:700; color:var(--ink2); line-height:1}
.ntl li.new b::before{content:"●"; color:var(--warn); margin-right:6px; font-size:12px}
.ntl .ntm{font-size:var(--fs-s); color:var(--ink); white-space:pre-line; overflow-wrap:anywhere}
.ntl small{font-size:var(--fs-s); color:var(--ink2); font-weight:600}
.ntt{display:grid; grid-template-columns:minmax(0,1fr) auto auto; row-gap:2px; margin:2px 0; font-size:var(--fs); font-variant-numeric:tabular-nums}
.ntt span{min-width:0; overflow-wrap:anywhere; font-weight:600}
.ntt .n{text-align:right; white-space:nowrap; padding-left:14px}   /* 欄の間は gap でなく padding（合計の線を 切らない） */
.ntt .tot{font-weight:800; border-top:1px solid var(--line); padding-top:3px; margin-top:1px}
.ntd .ntt{font-size:18px; row-gap:4px}
.sechead h2 .pill{margin-left:8px; vertical-align:middle}
#rngSel{margin:10px 0 2px}

/* ── 作付の切り替え: 品種の色（1品種のベンチは 枠・2品種以上は マスの縁） ── */
.bgrid.vb1{border:3px solid var(--vc); padding:2px}
.mb .g.vb1{border:2px solid var(--vc); padding:0}
.gc.vt{box-shadow:inset 0 0 0 2px var(--vc)}
.mb .c.vt{box-shadow:inset 0 0 0 1.5px var(--vc)}
.legend.vleg{margin-top:6px}
.legend i.vd{width:12px; height:12px; border:0; border-radius:50%}
.crophint{font-size:var(--fs-s); color:var(--ink2); font-weight:600; margin-top:6px}
.crophint b{color:var(--ink)}

/* ── 写真: 記録の画面の写真の欄・記録の詳細の写真・カメラの真ん中のボタン（写真を撮る） ── */
.phs{display:flex; flex-wrap:wrap; gap:8px; margin-top:6px}
.ph{position:relative; width:96px; height:96px; border-radius:var(--r-s); overflow:hidden; background:var(--bg2); border:1px solid var(--line); display:flex; flex-direction:column; align-items:center; justify-content:center; font-size:var(--fs-s); color:var(--ink2)}
.ph img{width:100%; height:100%; object-fit:cover; display:block}
.ph .tbtn.del{position:absolute; right:2px; bottom:2px; min-height:32px; padding:2px 8px; background:var(--card); border-radius:999px; font-size:var(--fs-s)}
.sheet .ph{width:140px; height:140px}
.phadd{margin-top:8px; cursor:pointer}
.tabs .camb.shoot .disc{background:var(--card); color:var(--accent); box-shadow:inset 0 0 0 5px var(--accent)}   /* カメラのタブでは シャッター（押すと写真） */

/* ── メッセージ: 入力欄の 写真・あて先・返信先／吹き出しの 引用・写真・リアクション・既読・自分あて／ピン留め ── */
.composer .cbtn{flex:0 0 auto; width:40px; min-height:var(--tap); display:grid; place-items:center; border-radius:var(--r-s); color:var(--ink2); font-weight:800; font-size:var(--fs-l); cursor:pointer; background:none; border:0}
.composer .cbtn svg.ic{width:24px; height:24px}
.cctx{padding-top:8px; display:flex; flex-direction:column; gap:6px}
.cctx .crep{display:flex; align-items:center; gap:8px; font-size:var(--fs-s); color:var(--ink2); background:var(--bg2); border-left:3px solid var(--accent); padding:4px 8px; border-radius:var(--r-s)}
.cctx .crep span{flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.cctx .ph{width:64px; height:64px}
.msg .bb{cursor:pointer}
.msg .bb .tx{white-space:pre-wrap}
.msg .mq{display:block; font-size:var(--fs-s); color:var(--ink2); border-left:3px solid var(--line); padding-left:6px; margin-bottom:4px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:60vw}
.msg .mph{display:flex; margin-top:6px}
.msg .mph .ph{width:84px; height:84px}
.msg .mph .ph.more{font-weight:800}
.msg .rxr,.dcard .rxr{display:flex; flex-wrap:wrap; gap:4px; margin-top:2px}
.msg .rx,.dcard .rx{min-height:32px; padding:2px 8px; border-radius:999px; border:1px solid var(--line); background:var(--card); font-size:var(--fs-s)}
.msg .rx.on,.dcard .rx.on{border-color:var(--accent); background:var(--accent-bg)}
.msg .readn,.dcard .readn{background:none; border:0; padding:0 0 0 6px; color:var(--ink2); font-size:var(--fs-s); text-decoration:underline; min-height:24px}
.msg.tome .bb,.dcard.tome{box-shadow:0 0 0 2px var(--warn)}
.sheet .mtx{white-space:pre-wrap; overflow-wrap:anywhere}
.sheet .rxs .chip{font-size:var(--fs-l)}

/* 出荷の日（◀ 日付 ▶ 今日） */
.dbar{display:flex; align-items:flex-end; gap:8px; margin-bottom:10px}
.dbar .dsel{flex:1 1 auto; margin:0}
.dbar .tbtn{min-height:var(--tap); padding-inline:12px}

/* ⑭ 収穫の記録 */
.hvtop{display:flex; gap:10px; margin:8px 0 12px}
.hvtop > div{flex:1 1 0; background:var(--card); border:1px solid var(--line); border-radius:var(--r); padding:10px; text-align:center}
.hvtop b{display:block; font-size:var(--fs-xl)}
.hvtop span{font-size:var(--fs-s); color:var(--ink2)}
.hvsum{display:flex; justify-content:space-between; gap:8px; padding:6px 0; border-bottom:1px solid var(--line)}
.hvsum:last-child{border-bottom:0}
.hvsum span{min-width:0; overflow-wrap:anywhere}
.hvrow.gone .nvl{text-decoration:line-through; color:var(--ink2)}
.hvkg{flex:0 0 auto; padding-left:8px; text-align:right}
.hvday{display:flex; align-items:center; gap:8px; padding:6px 0}
.hvday .hvt{flex:0 0 76px; font-size:var(--fs-s)}
.hvbar{flex:1 1 auto; display:flex; height:14px; background:var(--bg2); border-radius:7px; overflow:hidden}
.hvbar i{display:block; height:100%; background:var(--accent)}
.mlb{display:flex; align-items:center; justify-content:center; min-height:var(--tap)}
.shrow{padding:6px 0; border-bottom:1px solid var(--line)}
.shb2{display:flex; flex-direction:column; gap:3px; margin-top:4px}
.shb2 i{display:block; height:8px; border-radius:4px; min-width:2px}
.shb2 i.h{background:var(--accent)} .shb2 i.s{background:var(--info)}
.shv{display:flex; flex-wrap:wrap; gap:4px 12px; font-size:var(--fs-s); color:var(--ink2); padding:4px 0 8px}

/* 農場の設定（管理者）: 棟のベンチの行 */
.brow{display:flex; flex-wrap:wrap; align-items:center; gap:4px 6px; padding:6px 0; border-bottom:1px solid var(--line)}
.brow input{min-height:40px; padding:6px 8px}
.brow .bno{width:64px}
.brow .bm{width:52px}
.brow span{font-size:var(--fs-s); color:var(--ink2)}
.brow .del{margin-left:auto}

/* 栽培（読むだけ）: 品種ごとのまとめの表 */
.glx{display:grid; gap:2px; overflow-x:auto}
.glx .gx-r{display:grid; grid-template-columns:minmax(96px,1.4fr) repeat(var(--gl-n), minmax(30px,1fr)); align-items:center; gap:2px; padding:4px 0; border-bottom:1px solid var(--line)}
.glx .gx-hd{font-size:var(--fs-s); color:var(--ink2); font-weight:700}
.glx .gx-n{font-weight:700; overflow-wrap:anywhere}
.glx .gx-o{display:block; font-size:var(--fs-s); color:var(--warn); font-weight:700}
.glx .gx-c{text-align:center; font-weight:800}
.glx .gx-c.ok{color:var(--accent)} .glx .gx-c.up,.glx .gx-c.down,.glx .gx-c.mix{color:var(--warn)} .glx .gx-c.bad{color:var(--danger)}
.glx .gx-x{grid-column:2 / -1; font-size:var(--fs-s); color:var(--ink2)}
