/* 道標。色は 03 §14（案5）。昼と夜は prefers-color-scheme に従う。 */
:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --text: #1c1b1a;
  --muted: #6b6760;
  --line: #c9c4ba;
  --line-soft: #e0ddd6;
  --accent: #8a2e2e;
  --on-accent: #ffffff;
  --band: #1c1b1a;
  --band-text: #f3efe6;
  --band-sub: #d9a06b;
  --done: #8f8c86;
  --done-surface: #e9e5dc;
  --soft: #ebe7df;
  --good-bg: #f3f8f1;
  --good-line: #c9d9c4;
  --good-text: #2f6b3a;
  --bad-bg: #fbf3f1;
  --bad-line: #e0c9c4;
  --other-month: #f1efea;
  --overlay: rgba(28, 27, 26, 0.45);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17150f;
    --surface: #201d16;
    --text: #ece6d8;
    --muted: #9c9484;
    --line: #3c372c;
    --line-soft: #2b2820;
    --accent: #d9a65c;
    --on-accent: #17150f;
    --band: #0d0c09;
    --band-text: #ece6d8;
    --band-sub: #b9a98a;
    --done: #6f685a;
    --done-surface: #1e1b15;
    --soft: #2b2820;
    --good-bg: #1e2219;
    --good-line: #3a4a35;
    --good-text: #9cc49a;
    --bad-bg: #261c16;
    --bad-line: #4a3a2c;
    --other-month: #1a1812;
    --overlay: rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'IBM Plex Sans JP', 'Hiragino Sans', 'Noto Sans JP', sans-serif;
  font-size: 15px;
  line-height: 1.55;
}
a { color: var(--text); }
button, input, textarea, select { font-family: inherit; font-size: 16px; color: var(--text); }
button { cursor: pointer; }
svg { display: block; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 16px 14px 40px; display: flex; flex-direction: column; gap: 14px; }

.top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.brand { font-size: 17px; font-weight: 700; }
.brand small { font-size: 12px; font-weight: 500; color: var(--muted); }
.nav { display: flex; gap: 4px; align-items: center; }
.nav a, .nav button {
  padding: 0 12px; min-height: 40px; display: inline-flex; align-items: center; border-radius: 8px;
  border: 1px solid var(--line); background: transparent; text-decoration: none; font-size: 16px; font-weight: 600;
}
.nav a.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.nav .who { border: none; color: var(--muted); font-weight: 500; padding: 0 4px; }

.weekbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.iconbtn {
  width: 44px; height: 44px; flex: 0 0 auto; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); display: flex; align-items: center; justify-content: center;
}
.iconbtn svg { stroke: var(--text); }
.weekbar .mid { text-align: center; }
.weekbar .sub { font-size: 12px; color: var(--muted); }
.weekbar .main { font-size: 15px; font-weight: 700; }

.band {
  background: var(--band); color: var(--band-text); border-radius: 12px; padding: 12px 14px;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.band .k { font-size: 11px; color: var(--band-sub); }
.band .v { font-size: 26px; font-weight: 700; line-height: 1.1; }
.band .v span { font-size: 13px; font-weight: 500; }
.band .r { text-align: right; font-size: 12px; color: var(--band-sub); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip {
  min-height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); font-size: 16px;
}
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 700; }
.chips select {
  margin-left: auto; min-height: 40px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); padding: 0 8px;
}

.notice {
  border: 2px solid var(--accent); border-radius: 12px; padding: 10px 12px; background: var(--surface);
  font-size: 14px;
}
.notice b { color: var(--accent); }

.list { display: flex; flex-direction: column; gap: 8px; }
.card {
  display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px; text-decoration: none; position: relative;
}
.card.hi { border: 2px solid var(--accent); }
.card.doing { box-shadow: inset 4px 0 0 var(--text); }
.card.father { border-style: dashed; }
.card.done { background: var(--bg); border-color: var(--line-soft); }
.card .box {
  width: 30px; height: 30px; border-radius: 6px; border: 2px solid var(--line); flex: 0 0 auto;
  background: transparent; padding: 0; display: flex; align-items: center; justify-content: center;
}
.card.hi .box { border-color: var(--accent); }
.card.done .box { background: var(--line); border-color: var(--line); }
.card.done .box svg { stroke: var(--surface); }
.card .body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.card .title { font-weight: 700; font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card.done .title { color: var(--done); text-decoration: line-through; }
.card .meta { font-size: 12px; color: var(--muted); }
.card.done .meta { color: var(--done); }
.tag { color: var(--accent); }
.cols { display: none; }

.section-h { font-size: 12px; letter-spacing: 0.12em; color: var(--muted); margin: 6px 0 0; font-weight: 600; }

.linkcard {
  display: flex; justify-content: space-between; align-items: center; background: var(--surface);
  border: 1px solid var(--line-soft); border-radius: 12px; padding: 12px 14px; text-decoration: none; min-height: 44px; gap: 8px;
}
.linkcard .s { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.foot { font-size: 11px; color: var(--muted); text-align: center; }
details.more > summary { cursor: pointer; color: var(--muted); font-size: 13px; min-height: 40px; display: flex; align-items: center; }

/* 作業の一枚 */
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; text-decoration: none; font-size: 15px; color: var(--muted); }
.back svg { stroke: currentColor; }
.crumb { font-size: 12px; color: var(--muted); }
.thead { display: flex; align-items: flex-start; gap: 12px; }
.thead h1 { margin: 0; font-size: 20px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.thead input { width: 30px; height: 30px; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--accent); }
.acts { display: flex; gap: 8px; }
.btn {
  min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  font-size: 16px; font-weight: 700;
}
.btn.dark { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn.accent { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn:disabled { opacity: 0.5; }
.facts3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; font-size: 12px; }
.facts3 > div { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 8px; padding: 8px; }
.facts3 .k { color: var(--muted); }
.facts3 .v { font-weight: 700; font-size: 14px; }
.rate { background: var(--soft); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
.rate .row { display: flex; gap: 6px; }
.rate button { flex: 1; min-height: 44px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-size: 16px; padding: 0 2px; }
.rate button.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.panel { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.panel.hi { border: 2px solid var(--accent); }
.panel h2 { margin: 0; font-size: 14px; font-weight: 700; }
.panel p { margin: 0; }
.panel ul { margin: 0; padding-left: 1.2em; }
.check { display: flex; gap: 10px; align-items: flex-start; }
.check input { width: 24px; height: 24px; margin: 1px 0 0; flex: 0 0 auto; accent-color: var(--accent); }
.why { font-size: 13px; color: var(--muted); }
.small { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }
.say { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 14px; }
.say h2 { margin: 0; font-size: 13px; letter-spacing: 0.15em; color: var(--muted); }
textarea, input[type='text'] {
  font-size: 16px; line-height: 1.5; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); width: 100%;
}
textarea { resize: vertical; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* 暦 */
.monthbar { display: flex; justify-content: space-between; align-items: center; }
.monthbar .main { font-size: 16px; font-weight: 700; }
.dow, .grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.dow { font-size: 11px; color: var(--muted); text-align: center; }
.day {
  min-height: 56px; border-radius: 6px; padding: 4px 2px; border: 1px solid var(--line-soft); background: var(--surface);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; font-size: 13px; width: 100%; min-width: 0;
}
.day.other { background: var(--other-month); color: var(--done); }
.day.ev { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.day.today { border: 2px solid var(--text); }
.day .n { font-weight: 500; }
.day.ev .n, .day.today .n { font-weight: 700; }
.day .l { font-size: 9px; line-height: 1.2; margin-top: 2px; text-align: center; overflow: hidden; max-height: 3.6em; overflow-wrap: anywhere; }
.sheet-bg { position: fixed; inset: 0; background: var(--overlay); display: flex; align-items: flex-end; justify-content: center; z-index: 10; }
.sheet {
  background: var(--surface); width: 100%; max-width: 560px; border-radius: 20px 20px 0 0; padding: 12px 18px 28px;
  display: flex; flex-direction: column; gap: 12px; max-height: 85%; overflow-y: auto;
}
.sheet .grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto; }
.sheet .h { display: flex; justify-content: space-between; align-items: center; font-size: 20px; font-weight: 700; }
.evrow { background: var(--accent); color: var(--on-accent); border-radius: 10px; padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.evrow .k { font-size: 11px; opacity: 0.8; }
.evrow button { min-height: 40px; padding: 0 10px; border-radius: 8px; border: 1px solid currentColor; background: transparent; color: inherit; font-size: 16px; }
.seg { display: flex; gap: 6px; }
.seg button { flex: 1; min-height: 44px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-size: 16px; }
.seg button.on { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 700; }

/* 名前を選ぶ・通知 */
.modal-bg { position: fixed; inset: 0; background: var(--overlay); display: flex; align-items: center; justify-content: center; z-index: 20; padding: 16px; }
.modal { background: var(--surface); border-radius: 16px; padding: 20px; width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 12px; }
.modal h2 { margin: 0; font-size: 18px; }
.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--band); color: var(--band-text);
  padding: 10px 14px; border-radius: 10px; font-size: 14px; z-index: 30; display: flex; gap: 10px; align-items: center; max-width: calc(100% - 32px);
}
.toast button { min-height: 36px; border-radius: 8px; border: 1px solid var(--band-sub); background: transparent; color: var(--band-text); font-size: 16px; padding: 0 10px; }
.empty { color: var(--muted); font-size: 14px; padding: 12px 0; }

.pc-only { display: none; }

@media (min-width: 900px) {
  .wrap { padding: 24px 28px 48px; gap: 18px; }
  .pc-only { display: block; }
  .sp-only { display: none; }
  .card { align-items: center; }
  .cols { display: grid; grid-template-columns: 110px 70px 70px 150px 150px; gap: 8px; font-size: 13px; color: var(--muted); flex: 0 0 auto; }
  .card .meta .m-owner, .card .meta .m-due { display: none; }
  .listhead { display: flex; gap: 12px; padding: 0 12px; font-size: 12px; color: var(--muted); }
  .listhead .t { flex: 1; padding-left: 42px; }
  .listhead .cols { display: grid; }
  .day { min-height: 84px; }
  .day .l { font-size: 11px; }
  .taskpage { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
  .taskpage .side { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 12px; }
}
@media (max-width: 899px) {
  .listhead { display: none; }
  .taskpage, .taskpage .main, .taskpage .side { display: flex; flex-direction: column; gap: 16px; }
}
