/* 作業ログ（iPhone 版） v0.6 */
:root {
  --bg: #FFFFFF; --bg2: #F2F3F5; --fg: #1D1D1F; --fg2: #5F6368; --line: #D4D4D4; --acc: #2B4C7E; --accfg: #FFFFFF;
  --card: #FFFFFF; --done: #6E6E6E; --err: #B3261E; --ok: #1E7B45; --warn: #8A5A00;
  --at-due: #C00000;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #121212; --bg2: #1E1F22; --fg: #ECECEC; --fg2: #A8ABB0; --line: #4A4A4A; --acc: #8FB4F0; --accfg: #0B1A33;
    --card: #1A1B1E; --done: #9A9A9A; --err: #FF8A80; --ok: #6FD39A; --warn: #F0C060; --at-due: #FF8A8A; }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); -webkit-text-size-adjust: 100%; }
body { display: flex; flex-direction: column; }
button, input, select, textarea { font: inherit; font-size: 16px; color: var(--fg); }   /* 16px 未満だと iPhone が拡大する */
#top { display: flex; align-items: center; gap: 8px; padding: calc(env(safe-area-inset-top) + 8px) 12px 8px; background: var(--bg2); border-bottom: 1px solid var(--line); }
#title { font-weight: 700; flex: 1; }
.sync { border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: 3px 10px; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.sync i { width: 9px; height: 9px; border-radius: 50%; background: #8A8A8A; display: inline-block; }
.sync.ok i { background: #2E9E5B; } .sync.busy i { background: #2F6FD6; } .sync.warn i { background: #D08A00; } .sync.err i { background: #C43C3C; }
#main { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 10px 12px 16px; }
#tabs { display: flex; border-top: 1px solid var(--line); background: var(--bg2); padding-bottom: env(safe-area-inset-bottom); }
#tabs button { flex: 1; border: 0; background: none; padding: 6px 0 8px; font-size: 12px; color: var(--fg2); display: flex; flex-direction: column; align-items: center; gap: 2px; }
#tabs button .ic { font-size: 19px; line-height: 1.1; }
#tabs button.on { color: var(--acc); font-weight: 700; }
h2 { font-size: 17px; margin: 6px 0 10px; }
h3 { font-size: 15px; margin: 14px 0 6px; color: var(--fg2); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.muted { color: var(--fg2); font-size: 13px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.btn { border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 8px 12px; min-height: 40px; }
.btn.primary { background: var(--acc); color: var(--accfg); border-color: var(--acc); font-weight: 700; }
.btn.danger { color: var(--err); }
.btn.small { min-height: 32px; padding: 4px 10px; font-size: 14px; }
label.f { display: block; margin: 8px 0 3px; font-size: 13px; color: var(--fg2); }
input[type=text], input[type=date], input[type=number], input[type=email], input[type=password], input[type=search], select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--card); min-height: 40px; }
textarea { min-height: 110px; line-height: 1.5; resize: vertical; }
.chip { display: inline-block; border-radius: 10px; padding: 1px 8px; font-size: 13px; line-height: 1.6; border: 1px solid transparent; }
.chip.outline { border-color: var(--line); color: var(--fg2); }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.chips button { white-space: nowrap; border: 1px solid var(--line); background: var(--card); border-radius: 16px; padding: 4px 12px; font-size: 14px; }
.chips button.on { background: var(--acc); color: var(--accfg); border-color: var(--acc); }
.list .item { display: block; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; margin-bottom: 7px; }
.item .t1 { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.item .t2 { margin-top: 4px; white-space: pre-wrap; word-break: break-word; font-size: 15px; line-height: 1.45; max-height: 6.6em; overflow: hidden; }
.item.full .t2 { max-height: none; }
.prop { font-weight: 700; }
.plan .ln { display: flex; gap: 10px; align-items: flex-start; padding: 7px 2px; border-bottom: 1px solid var(--line); }
.plan .ln:last-child { border-bottom: 0; }
.plan .ln input { width: 22px; height: 22px; margin-top: 1px; flex: none; }
.plan .ln span { white-space: pre-wrap; word-break: break-word; }
.done, .plan .ln.dn span { color: var(--done); text-decoration: line-through; }
.mtg { background: rgba(120, 120, 120, .14); }
.at-due { color: var(--at-due); text-decoration: underline; text-decoration-thickness: 2px; }
.at-k1, .at-k2, .at-k3 { color: #1D1D1F; border-radius: 2px; }
.at-k1 { background: #FFFF00; } .at-k2 { background: #92D050; } .at-k3 { background: #C4FF82; }
.toolbar { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.toolbar button { border: 1px solid var(--line); background: var(--card); border-radius: 6px; padding: 4px 8px; font-size: 14px; min-height: 34px; }
.sheet { position: fixed; inset: 0; background: var(--bg); z-index: 20; display: flex; flex-direction: column; }
.sheet .hd { display: flex; align-items: center; gap: 8px; padding: calc(env(safe-area-inset-top) + 8px) 12px 8px; border-bottom: 1px solid var(--line); background: var(--bg2); }
.sheet .bd { flex: 1; overflow-y: auto; padding: 8px 12px calc(env(safe-area-inset-bottom) + 24px); }
.picker { position: relative; }
.picker .drop { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; max-height: 300px; overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 16px rgba(0,0,0,.25); }
.picker .drop div { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.picker .drop div.on { background: var(--bg2); }
.picker .drop b { text-decoration: underline; }
.log { display: flex; gap: 8px; align-items: baseline; }
.log .nm { font-weight: 700; min-width: 5em; }
.num { font-variant-numeric: tabular-nums; }
#toast { position: fixed; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom) + 70px); background: #323232; color: #FFFFFF; border-radius: 10px; padding: 10px 14px; font-size: 14px; display: none; z-index: 50; }
#toast.err { background: #8E1B16; }
.kv { display: grid; grid-template-columns: 7.5em 1fr; gap: 4px 8px; font-size: 14px; }
.kv div:nth-child(odd) { color: var(--fg2); }
.sun { color: #D00000; } .sat { color: #0062A8; }
@media (prefers-color-scheme: dark) { .sun { color: #FF7070; } .sat { color: #6CB4FF; } }
