/* 秘書ハブ 共通の見た目 */
:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --text: #1f1f1d;
  --muted: #6b6a65;
  --line: #e2e0d8;
  --accent: #2f5d50;
  --accent-text: #ffffff;
  --danger: #a23b2a;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171716;
    --surface: #222220;
    --text: #ecebe6;
    --muted: #a3a29b;
    --line: #3a3935;
    --accent: #7fb5a3;
    --accent-text: #10201b;
    --danger: #e08a7a;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  font-size: 17px;
  line-height: 1.6;
}
main { max-width: 720px; margin: 0 auto; padding: 24px 16px 48px; }
h1 { font-size: 24px; margin: 8px 0 20px; }
h2 { font-size: 18px; margin: 24px 0 8px; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
label { display: block; font-weight: 600; margin-bottom: 6px; }
input[type="email"], input[type="text"] {
  width: 100%;
  font: inherit;
  font-size: 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
}
input.code { letter-spacing: 0.3em; font-variant-numeric: tabular-nums; }
button {
  font: inherit;
  font-weight: 600;
  padding: 12px 18px;
  border-radius: 10px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-text);
  cursor: pointer;
}
button.sub { background: transparent; color: var(--accent); }
button:disabled { opacity: 0.5; cursor: default; }
.row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.muted { color: var(--muted); font-size: 15px; }
.msg { margin-top: 14px; min-height: 1.6em; }
.msg.error { color: var(--danger); }
.hidden { display: none !important; }
header.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface);
}
header.top .who { font-size: 15px; color: var(--muted); }
.row.first { margin-top: 0; }
nav.links { display: flex; gap: 14px; align-items: center; }
nav.links a { color: var(--accent); text-decoration: none; font-weight: 600; }
ul.list { list-style: none; padding: 0; margin: 0; }
ul.list li {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
ul.list li:last-child { border-bottom: 0; }
button.small { padding: 6px 12px; font-size: 15px; }
button.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
a.button {
  display: inline-block; text-decoration: none; font-weight: 600;
  padding: 12px 18px; border-radius: 10px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-text);
}
ul.list li.error { color: var(--danger); }

/* ───── ホーム ───── */
.home-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
h2 .count { font-size: 15px; font-weight: 600; color: var(--muted); margin-left: 6px; }
select {
  width: 100%; font: inherit; padding: 11px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--bg); color: var(--text);
}
input[type="date"] {
  width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--bg); color: var(--text);
}
.switch { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; }
.switch button.on { background: var(--accent); color: var(--accent-text); }
ul.tasks li.task { justify-content: flex-start; align-items: flex-start; }
.check {
  flex: 0 0 auto; width: 28px; height: 28px; padding: 0; margin-top: 2px;
  border-radius: 50%; border: 2px solid var(--accent); background: transparent;
  color: var(--accent-text); font-size: 16px; line-height: 1;
}
.check.on { background: var(--accent); }
.task-body { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.task-title { font-weight: 600; }
ul.tasks li.task > button.danger { flex: 0 0 auto; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tag {
  font-size: 13px; padding: 1px 8px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted);
}
.tag.late { color: var(--danger); border-color: var(--danger); font-weight: 600; }
.tag.soon { color: var(--accent); border-color: var(--accent); font-weight: 600; }
details.add { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
details summary { cursor: pointer; font-weight: 600; color: var(--accent); }
details.add[open] summary { margin-bottom: 12px; }
.add-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
@media (max-width: 480px) { .add-row { grid-template-columns: 1fr; } }
details.done-box { margin-top: 20px; }
details.done-box .card { margin-top: 10px; }
details.done-box .task-title { font-weight: 400; color: var(--muted); text-decoration: line-through; }
header.top { flex-wrap: wrap; }

/* ───── 下に出る知らせ・専用の確認の窓（common/ui.js） ───── */
.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 140%);
  display: flex; align-items: center; gap: 16px;
  max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 12px;
  background: var(--text); color: var(--bg); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease; z-index: 50;
}
.toast.show { transform: translate(-50%, 0); }
.toast-action {
  background: transparent; border: 0; padding: 4px 6px; color: var(--bg);
  text-decoration: underline; font-weight: 700;
}
dialog.ask {
  width: min(420px, calc(100% - 32px)); padding: 20px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface); color: var(--text);
}
dialog.ask::backdrop { background: rgba(0, 0, 0, 0.45); }
dialog.ask h2 { margin-top: 0; }
button.danger-fill { background: var(--danger); border-color: var(--danger); color: #fff; }

/* ───── 利用者 ───── */
ul.users li.user { align-items: flex-start; flex-wrap: wrap; }
ul.users li.stopped .task-title { color: var(--muted); }
.limit { margin-top: 10px; max-width: 260px; }
.limit label { font-size: 14px; font-weight: 600; color: var(--muted); }
.limit input {
  width: 100%; font: inherit; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--bg); color: var(--text);
}
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
details.add > .card { margin-top: 10px; }
