:root {
  --primary: #14a38b;
  --primary-dark: #0e8571;
  --primary-soft: #e3f6f2;
  --accent: #ffd166;
  --text: #24323a;
  --muted: #56656e;
  --line: #dbe2e7;
  --bg: #f5f7f8;
  --card: #fff;
  --yes: #14a38b;
  --yes-bg: #e3f6f2;
  --maybe: #e2a100;
  --maybe-bg: #fff6dc;
  --no: #8d99a3;
  --no-bg: #f0f2f4;
  --danger: #e0475a;
  --sun: #e0475a;
  --sat: #2f7ed8;
  --best: #fff4c9;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(20, 40, 50, .06), 0 4px 16px rgba(20, 40, 50, .05);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}
a { color: var(--primary-dark); }
h1 { font-size: 1.35rem; margin: 0 0 .4em; line-height: 1.4; }
h2 { font-size: 1.05rem; margin: 0 0 .7em; }
p { margin: .3em 0; }
button, input, textarea, select { font: inherit; color: inherit; }
.sp { display: none; }
@media (max-width: 520px) { .sp { display: inline; } }

/* layout */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.15rem; color: var(--text); text-decoration: none; }
.brand small { font-weight: 500; font-size: .75rem; color: var(--muted); }
.logo { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--primary); color: #fff; font-size: 1rem; }
.container { max-width: 760px; margin: 0 auto; padding: 16px 16px 40px; }
.footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 20px 16px 40px; }
.demo-banner { background: #fff3cd; color: #6d5200; font-size: .82rem; padding: 8px 16px; text-align: center; }
.demo-banner code { background: rgba(0,0,0,.06); padding: 0 4px; border-radius: 4px; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin: 0 0 16px; }
.center { text-align: center; }
.row { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.hint { color: var(--muted); font-size: .85rem; }
.hint.warn { color: #9a6a00; }
.empty { color: var(--muted); text-align: center; padding: 10px 0; }
.err-text { color: var(--danger); margin-bottom: 14px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: var(--text);
  font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { border-color: #c8d2d8; background: #fafbfc; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger-ghost { color: var(--danger); border-color: #f3c6cc; }
.btn.ghost { background: transparent; }
.btn.line { background: #06c755; border-color: #06c755; color: #fff; }
.btn.sm { min-height: 32px; padding: 4px 12px; font-size: .85rem; }
.btn.lg { min-height: 52px; padding: 12px 26px; font-size: 1.05rem; }
.btn.block { display: flex; width: 100%; margin: 0 0 16px; }
.link-btn { background: none; border: none; color: var(--primary-dark); font-size: .85rem; cursor: pointer; padding: 4px 2px; text-decoration: underline; text-underline-offset: 2px; }
.danger-text { color: var(--danger); }
.icon-btn { flex: none; width: 32px; height: 32px; border-radius: 50%; border: none; background: transparent; color: var(--muted); font-size: 1.1rem; cursor: pointer; line-height: 1; }
.icon-btn:hover { background: var(--no-bg); color: var(--text); }
.mini-btn { margin-left: 6px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--primary); background: #fff; color: var(--primary-dark); font-size: .72rem; font-weight: 700; cursor: pointer; vertical-align: middle; }
.mini-btn:hover { background: var(--primary-soft); }
.chip { display: inline-block; padding: 0 8px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-dark); font-size: .72rem; font-weight: 700; margin-left: 6px; }
.chip.gray { background: var(--no-bg); color: var(--muted); }

/* home */
.hero { text-align: center; padding: 32px 8px 24px; }
.hero h1 { font-size: 1.7rem; margin-bottom: .5em; }
.hero p { color: var(--muted); margin-bottom: 22px; }
.steps { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 20px; }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }
.step { display: flex; gap: 12px; background: #fff; border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.step .num { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-dark); font-weight: 800; }
.step p { color: var(--muted); font-size: .85rem; margin: 2px 0 0; }
.recent { list-style: none; margin: 0; padding: 0; }
.recent li { display: flex; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.recent li a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; text-decoration: none; }

/* form */
.page-head { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; }
.page-head h1 { margin: 0; }
.back { text-decoration: none; color: var(--muted); font-size: .9rem; }
.field { display: block; margin-bottom: 20px; }
.lbl { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 6px; }
.lbl em { font-style: normal; font-size: .7rem; color: #fff; background: var(--danger); border-radius: 4px; padding: 1px 5px; margin-left: 4px; vertical-align: 1px; }
input:not([type=checkbox]), textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #d3dce1; border-radius: 10px; background: #fff;
  font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(20, 163, 139, .15); }
textarea { resize: vertical; }

.form .card { padding: 20px; }
.field.last { margin-bottom: 0; }
h2.sec { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; margin-bottom: 12px; }
.sec-num { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; font-size: .9rem; }
.form .hint { margin-bottom: 10px; }

/* calendar */
.cal { border: 1px solid var(--line); border-radius: 12px; padding: 12px; user-select: none; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: 1.1rem; }
.nav-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--text); }
.nav-btn:hover { background: var(--primary-soft); border-color: var(--primary); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal .wd { border: none; background: var(--bg); border-radius: 8px; font-size: .8rem; font-weight: 700; color: var(--muted); padding: 4px 0; cursor: pointer; }
.cal .wd:hover { background: var(--primary-soft); }
.cal .wd.sun { color: var(--sun); }
.cal .wd.sat { color: var(--sat); }
.cal .day {
  position: relative; height: 48px; width: 100%;
  border: 2px solid transparent; border-radius: 12px; background: #fff; cursor: pointer;
  font-weight: 700; font-size: 1rem; color: var(--text);
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1;
}
.cal .day:hover:not(:disabled) { border-color: var(--primary); background: var(--primary-soft); }
.cal .day.sun { color: var(--sun); }
.cal .day.sat { color: var(--sat); }
.cal .day.other { opacity: .45; }
.cal .day.past { color: #c3cbd0; background: transparent; cursor: not-allowed; font-weight: 400; }
.cal .day.today { border-color: var(--accent); }
.cal .day.on { background: var(--primary); border-color: var(--primary-dark); color: #fff; box-shadow: 0 2px 6px rgba(20, 163, 139, .35); }
.cal .day.on::after { content: "✓"; position: absolute; top: 1px; right: 5px; font-size: .65rem; }
.cal .day.on:hover { background: var(--primary-dark); }
.cal .day i { font-style: normal; font-size: .62rem; font-weight: 600; margin-top: 2px; }
.cal-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 10px; font-size: .82rem; color: var(--muted); }
.cal-legend > span { display: inline-flex; align-items: center; gap: 5px; }
.cal-legend .swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; border: 2px solid transparent; }
.cal-legend .swatch.on { background: var(--primary); border-color: var(--primary-dark); }
.cal-legend .swatch.today { border-color: var(--accent); }
.sel-n { margin-left: auto; color: var(--text); }
.sel-n b { color: var(--primary-dark); font-size: 1rem; }

/* time settings */
.seg.big { display: flex; width: 100%; border-radius: 12px; padding: 4px; margin-bottom: 14px; }
.seg.big button { flex: 1; padding: 10px 6px; border-radius: 9px; font-size: .92rem; font-weight: 600; }
.seg.big button.on { background: var(--primary); color: #fff; }
.defaults { background: var(--primary-soft); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; }
.def-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 4px; }
.def-head .hint { margin: 0; }
.def-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.slot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.tilde { color: var(--muted); font-weight: 700; }
.ts { display: inline-flex; align-items: center; gap: 2px; background: #fff; border: 1px solid #c9d3d9; border-radius: 10px; padding: 2px 4px; }
.ts b { color: var(--muted); }
.ts select { border: none; background: transparent; font-size: 16px; font-weight: 600; padding: 6px 2px; cursor: pointer; outline: none; font-variant-numeric: tabular-nums; }
.ts select:disabled { color: #b8c2c8; cursor: default; }
.ts:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(20, 163, 139, .15); }
.slot.bad .ts { border-color: var(--danger); background: #fff5f6; }
.slot-err { flex-basis: 100%; color: var(--danger); font-size: .8rem; font-weight: 600; }
.day-list-head { font-weight: 700; font-size: .9rem; margin-bottom: 8px; }
.day-card { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 8px; margin-bottom: 8px; }
.day-card-head { display: flex; align-items: center; justify-content: space-between; }
.day-card-head b { font-size: 1.02rem; }
.day-card .link-btn { margin-top: 4px; }
.allday { display: block; color: var(--muted); font-size: .85rem; padding: 2px 0 4px; }
.empty-box { border: 2px dashed var(--line); border-radius: 12px; padding: 18px; text-align: center; color: var(--muted); font-size: .9rem; margin: 0; }

.free-add { display: flex; gap: 8px; }
.cand-list { list-style: none; margin: 8px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; }
.cand-list li { display: flex; align-items: center; justify-content: space-between; padding: 6px 6px 6px 12px; border-bottom: 1px solid var(--line); }
.cand-list li:last-child { border-bottom: none; }
.sun { color: var(--sun); }
.sat { color: var(--sat); }

/* summary */
.summary { border-top: 4px solid var(--primary); }
.sum-head { display: flex; align-items: center; justify-content: space-between; }
.sum-head h2 { margin: 0; }
.count { display: inline-block; background: var(--primary); color: #fff; border-radius: 999px; padding: 0 10px; font-size: .9rem; margin-left: 4px; }
.preview { margin: 6px 0 16px; padding: 0 0 0 2.2em; max-height: 300px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; background: #fafbfc; }
.preview li { padding: 6px 8px 6px 2px; border-bottom: 1px solid var(--line); font-weight: 600; }
.preview li:last-child { border-bottom: none; }
.preview li.none { list-style: none; margin-left: -2.2em; padding-left: 12px; color: var(--muted); font-weight: 400; }

/* share */
.url-row { display: flex; gap: 8px; }
.url-row input { flex: 1; min-width: 0; background: var(--bg); font-size: 14px; }
.share-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.share-btns.center { justify-content: center; }
.done { padding: 28px 18px; }
.done-icon { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 1.8rem; margin-bottom: 10px; }
.admin-url { border: 2px dashed #f0c96a; }

/* event */
.confirmed { background: linear-gradient(135deg, var(--primary), #3cc3a5); color: #fff; border-radius: var(--radius); padding: 18px; margin-bottom: 16px; text-align: center; box-shadow: var(--shadow); }
.confirmed .c-label { font-size: .85rem; opacity: .9; }
.confirmed .c-date { font-size: 1.4rem; font-weight: 800; margin: 2px 0 6px; }
.confirmed .btn { border-color: rgba(255,255,255,.7); }
.confirmed .btn.ghost { color: #fff; }
.ev-head .memo { white-space: pre-wrap; word-break: break-word; background: var(--bg); border-radius: 10px; padding: 10px 12px; margin: 8px 0; font-size: .92rem; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: .85rem; align-items: center; }
.admin { border-left: 4px solid var(--accent); }
.admin-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.closed-msg { color: var(--muted); }

.table-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.table-head h2 { margin: 0; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; background: var(--bg); }
.seg button { border: none; background: transparent; border-radius: 999px; padding: 3px 12px; cursor: pointer; color: var(--muted); font-size: .82rem; }
.seg button.on { background: #fff; color: var(--text); font-weight: 700; box-shadow: 0 1px 2px rgba(0,0,0,.1); }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 10px; }
table.result { border-collapse: separate; border-spacing: 0; width: 100%; font-size: .9rem; }
.result th, .result td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; background: #fff; }
.result thead th { background: #fafbfc; font-size: .8rem; color: var(--muted); position: sticky; top: 0; }
.result tbody tr:last-child th, .result tbody tr:last-child td { border-bottom: none; }
.result .sticky { position: sticky; left: 0; z-index: 2; text-align: left; border-right: 1px solid var(--line); min-width: 150px; font-weight: 600; }
.result thead .sticky { z-index: 3; }
.result .n { font-weight: 800; min-width: 38px; }
.result td.n.yes { color: var(--yes); }
.result td.n.maybe { color: var(--maybe); }
.result td.n.no { color: var(--no); }
.result thead .n.yes { color: var(--yes); }
.result thead .n.maybe { color: var(--maybe); }
.result .v { font-weight: 800; font-size: 1rem; min-width: 52px; }
.result .v.yes { color: var(--yes); background: var(--yes-bg); }
.result .v.maybe { color: var(--maybe); background: var(--maybe-bg); }
.result .v.no { color: var(--no); }
.result .v.none { color: #c3ccd2; font-weight: 400; }
.result tr.best th, .result tr.best td.n { background: var(--best); }
.result tr.fixed th, .result tr.fixed td.n { background: #d9f3ec; }
.result .tag { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 4px; background: var(--primary); color: #fff; font-size: .68rem; vertical-align: middle; }
.result .tag.best-tag { background: #e8a800; }
.name-btn { border: none; background: none; cursor: pointer; font-weight: 700; color: var(--text); font-size: .82rem; padding: 2px 4px; border-radius: 6px; max-width: 8em; overflow: hidden; text-overflow: ellipsis; text-decoration: underline dotted #b8c2c8; text-underline-offset: 3px; }
.name-btn:hover { background: var(--primary-soft); }
.name-btn.me::after { content: "（自分）"; font-weight: 400; color: var(--primary-dark); font-size: .7rem; }
.comment-row td.cmt { white-space: normal; min-width: 90px; max-width: 180px; font-size: .78rem; color: var(--muted); text-align: left; vertical-align: top; }

.comments { list-style: none; margin: 0; padding: 0; }
.comments li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.comments li:last-child { border-bottom: none; }
.comments p { white-space: pre-wrap; word-break: break-word; margin: 2px 0 0; font-size: .92rem; }

/* answer */
.answer { border-top: 4px solid var(--primary); }
.vote-list { list-style: none; margin: 0; padding: 0; }
.vote-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.vote-list .vl { font-weight: 600; min-width: 0; }
.seg.vote { flex: none; padding: 3px; gap: 3px; border-radius: 12px; }
.seg.vote button { width: 46px; height: 40px; border-radius: 9px; font-size: 1.25rem; font-weight: 800; color: #b8c2c8; background: #fff; }
.seg.vote button.yes.on { background: var(--yes); color: #fff; }
.seg.vote button.maybe.on { background: var(--maybe); color: #fff; }
.seg.vote button.no.on { background: var(--no); color: #fff; }
.bulk { display: flex; gap: 8px; }

/* misc */
.loading { text-align: center; padding: 60px 0; color: var(--muted); }
.spinner { display: inline-block; width: 32px; height: 32px; border: 3px solid var(--primary-soft); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
.spinner.sm { width: 16px; height: 16px; border-width: 2px; border-color: rgba(255,255,255,.4); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: #24323a; color: #fff; padding: 10px 18px; border-radius: 999px; font-size: .9rem; z-index: 100;
  transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--danger); }
.modal-bg { position: fixed; inset: 0; background: rgba(20, 30, 40, .45); display: grid; place-items: center; z-index: 90; padding: 16px; }
.modal { background: #fff; border-radius: var(--radius); padding: 20px; width: 100%; max-width: 400px; box-shadow: 0 10px 40px rgba(0,0,0,.2); }

@media (max-width: 520px) {
  .card { padding: 14px; }
  .hero h1 { font-size: 1.45rem; }
  .vote-list li { flex-wrap: wrap; }
  .seg.vote { margin-left: auto; }
  .result .sticky { min-width: 120px; max-width: 150px; white-space: normal; }
}

@media (max-width: 520px) {
  .form .card { padding: 16px 14px; }
  .cal { padding: 8px; }
  .cal-grid { gap: 4px; }
  .cal .day { height: 44px; }
  .def-actions .btn { width: 100%; }
}

@media print {
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .topbar { position: static; }
  .toast, .modal-bg { display: none; }
  .card { box-shadow: none; border: 1px solid var(--line); break-inside: avoid; }
}

/* ===== timeline (30分マス) ===== */
:root { --pref: #0b7f6b; --pref-bg: #b9ecdf; }
.tl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 10px; margin: 8px 0; background: #fff; }
table.tl { border-collapse: separate; border-spacing: 0; user-select: none; -webkit-user-select: none; }
.tl th, .tl td { padding: 0; }
.tl .tl-lab { position: sticky; left: 0; z-index: 2; background: #fff; text-align: left; padding: 0 8px; min-width: 78px; font-size: .85rem; font-weight: 700; white-space: nowrap; border-right: 2px solid var(--line); border-bottom: 1px solid var(--line); }
.tl thead .tl-lab { z-index: 3; }
.tl thead th { height: 26px; background: #fafbfc; border-bottom: 2px solid var(--line); }
.tl .tl-h { position: relative; min-width: 30px; width: 30px; font-size: .72rem; color: var(--muted); font-weight: 700; cursor: pointer; }
.tl .tl-h span { position: absolute; left: -1px; top: 5px; border-left: 1px solid #b8c2c8; padding-left: 2px; line-height: 1; }
.tl td { height: 40px; min-width: 30px; width: 30px; border-bottom: 1px solid var(--line); border-left: 1px solid #c9d3d9; text-align: center; font-weight: 800; font-size: .9rem; }
.tl td.half { border-left: 1px dashed #e1e7eb; }
.tl td.off { background: repeating-linear-gradient(45deg, #f1f3f5, #f1f3f5 4px, #e8ecef 4px, #e8ecef 8px); }
.tl tbody tr:last-child td, .tl tbody tr:last-child th { border-bottom: none; }
.tl td.cell { cursor: pointer; }
.tl td.cell.none { background: #fff; }
.tl td.cell.pref { background: var(--pref); color: #fff; }
.tl td.cell.yes { background: var(--yes-bg); color: var(--yes); }
.tl td.cell.maybe { background: var(--maybe-bg); color: var(--maybe); }
.tl td.cell.no { background: #e4e8eb; color: #7d8a94; }
.tl.paint td.cell { touch-action: none; }
.tl.paint.moving td.cell { touch-action: auto; cursor: grab; }
.tl.paint th.tl-lab[data-row] { cursor: pointer; }
.tl.paint th.tl-lab[data-row]:hover, .tl.paint .tl-h:hover { background: var(--primary-soft); }
/* 集計 */
.result-tl td.hm { position: relative; color: var(--primary-dark); font-size: .85rem; }
.result-tl td.hm i { position: absolute; right: 1px; bottom: 0; font-style: normal; font-size: .55rem; color: var(--maybe); font-weight: 700; }
.result-tl td.top { box-shadow: inset 0 0 0 2px #e8a800; }
.result-tl td.fixed { box-shadow: inset 0 0 0 3px #d6336c; }
.result-tl td.sel { outline: 3px solid var(--text); outline-offset: -3px; }
.tl-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .78rem; color: var(--muted); align-items: center; }
.tl-legend > span { display: inline-flex; align-items: center; gap: 4px; }
.sw { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 4px; border: 1px solid var(--line); font-size: .7rem; font-weight: 800; }
.sw.pref { background: var(--pref); color: #fff; } .sw.yes { background: var(--yes-bg); color: var(--yes); }
.sw.maybe { background: var(--maybe-bg); color: var(--maybe); } .sw.no { background: #e4e8eb; color: #7d8a94; }
.sw.hm1 { background: rgba(20,163,139,.2); } .sw.hm2 { background: rgba(20,163,139,.9); }
.sw.top { box-shadow: inset 0 0 0 2px #e8a800; } .sw.fixed { box-shadow: inset 0 0 0 3px #d6336c; }
.cell-info { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: var(--bg); font-size: .88rem; }
.cell-info .mini-btn { margin: 8px 0 0; }
.nm { display: inline-block; margin: 2px 12px 2px 0; }
.nm b { font-size: .8rem; }
.nm.pref b { color: var(--pref); } .nm.yes b { color: var(--yes); } .nm.maybe b { color: var(--maybe); } .nm.no b { color: var(--no); } .nm.none b { color: #a3aeb5; }
.viewer { font-size: .85rem; color: var(--muted); }
.viewer select { font-size: 15px; padding: 5px 8px; border: 1px solid #c9d3d9; border-radius: 8px; background: #fff; color: var(--text); max-width: 11em; }
table.result.untimed { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: .88rem; }
.result.untimed th, .result.untimed td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; white-space: normal; vertical-align: top; }
.result.untimed th { width: 40%; }
.result.untimed tr.fixed th { background: #fde8ef; }
.people { margin-top: 12px; }
.people .lbl { font-size: .85rem; }
.person { display: inline-block; margin: 0 6px 6px 0; padding: 5px 12px; border-radius: 999px; border: 1px solid #c9d3d9; background: #fff; cursor: pointer; font-weight: 600; font-size: .88rem; }
.person:hover { border-color: var(--primary); background: var(--primary-soft); }
.person.me { border-color: var(--primary); }
.person.me::after { content: "（自分）"; font-weight: 400; font-size: .72rem; color: var(--primary-dark); }
.best { margin: 0; padding-left: 1.6em; }
.best li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.best li:last-child { border-bottom: none; }
.best li:first-child .best-main > b { color: var(--primary-dark); font-size: 1.05rem; }
.best-main { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.best-n { display: inline-flex; gap: 6px; font-size: .85rem; font-weight: 700; }
.best-n .yes { color: var(--yes); } .best-n .pref { color: var(--pref); } .best-n .maybe { color: var(--maybe); } .best-n .of { color: var(--muted); font-weight: 400; }
.best .mini-btn { margin: 6px 0 0; }
.tag { display: inline-block; padding: 0 6px; border-radius: 4px; background: #d6336c; color: #fff; font-size: .7rem; vertical-align: middle; margin-left: 6px; }
.warn-box { background: #fff3cd; color: #6d5200; font-size: .88rem; }
.row.wrap { flex-wrap: wrap; }

/* palette */
.palette-wrap { position: sticky; top: 52px; z-index: 10; background: #fff; padding: 6px 0; }
.palette { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.pal { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; min-height: 52px; border-radius: 10px; border: 2px solid var(--line); background: #fff; cursor: pointer; font-size: .72rem; font-weight: 700; color: var(--muted); line-height: 1.2; }
.pal span { font-size: 1.3rem; font-weight: 800; }
.pal.pref span { color: var(--pref); } .pal.yes span { color: var(--yes); } .pal.maybe span { color: var(--maybe); } .pal.no span { color: var(--no); }
.pal.on { color: #fff; transform: translateY(-1px); box-shadow: 0 3px 8px rgba(0,0,0,.15); }
.pal.on span { color: #fff; }
.pal.pref.on { background: var(--pref); border-color: var(--pref); }
.pal.yes.on { background: var(--yes); border-color: var(--yes); }
.pal.maybe.on { background: var(--maybe); border-color: var(--maybe); }
.pal.no.on { background: var(--no); border-color: var(--no); }
.pal.erase.on, .pal.move.on { background: var(--text); border-color: var(--text); }
.seg.vote button.pref.on { background: var(--pref); color: #fff; }
@media (max-width: 520px) {
  .palette { gap: 4px; }
  .pal { min-height: 48px; font-size: .66rem; }
  .tl .tl-lab { min-width: 70px; padding: 0 6px; font-size: .8rem; }
  .tl td { height: 42px; min-width: 28px; width: 28px; }
}

/* ===== ○△×の3種類・参加者別の表 ===== */
.palette { grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pal { min-height: 56px; font-size: .8rem; flex-direction: row; gap: 6px; }
.pal span { font-size: 1.5rem; }
.c-yes { color: var(--yes); }
.matrix .day-group + .day-group .day-head th { border-top: 3px solid #b8c2c8; }
.matrix .day-head th { height: 30px; background: #f3f6f8; border-bottom: 1px solid var(--line); }
.matrix .day-head .tl-lab { font-size: .9rem; background: #f3f6f8; }
.matrix .day-head .tl-h { cursor: default; }
.matrix .sum-row .tl-lab { background: #fafbfc; color: var(--muted); }
.matrix .sum-row td { height: 32px; border-bottom: 2px solid var(--line); }
.matrix .p-row td { height: 32px; font-size: .85rem; }
.matrix .p-row td.cell.none { color: #c3ccd2; }
.matrix .pname { padding: 0 4px; }
.pn { border: none; background: none; cursor: pointer; font-weight: 700; font-size: .82rem; color: var(--text); padding: 2px 4px; border-radius: 6px; max-width: 7.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: underline dotted #b8c2c8; text-underline-offset: 3px; }
.pn:hover { background: var(--primary-soft); }
.pn.me { color: var(--primary-dark); }
.pn.me::after { content: "（自分）"; font-weight: 400; font-size: .68rem; }
@media (max-width: 520px) {
  .pal { min-height: 52px; }
  .matrix .p-row td, .matrix .sum-row td { height: 34px; }
}

/* ===== PC 向け：表を横幅いっぱいに収める ===== */
.container.wide { max-width: 1240px; }
table.tl { width: 100%; table-layout: fixed; }
.tl .tl-lab, .tl .tl-h, .tl td, .tl td.half { min-width: 0; width: auto; }
.tl .tl-lab { overflow: hidden; text-overflow: ellipsis; }
.tl td { height: 34px; font-size: .85rem; }
.matrix .p-row td, .matrix .sum-row td { height: 28px; }
.matrix .day-head th { height: 26px; }
.tl .tl-h span { font-size: .7rem; }

.answer h2 { margin-bottom: 8px; }
.ans-top { display: flex; flex-wrap: wrap; gap: 0 20px; align-items: flex-end; }
.ans-top .field { margin-bottom: 8px; }
.ans-name { flex: 0 0 220px; }
.ans-pal { flex: 1 1 380px; }
.ans-pal .palette-wrap { padding: 0; }
.pal { min-height: 46px; }
.ans-hint { margin: 2px 0 6px; }
.ans-hint .link-btn { margin-left: 8px; }
.ans-bottom { display: flex; flex-wrap: wrap; gap: 0 20px; align-items: flex-end; margin-top: 12px; }
.ans-cmt { flex: 1 1 320px; margin-bottom: 0; }
.ans-cmt textarea { min-height: 52px; }
.ans-actions { flex: 0 0 260px; }
.ans-actions .btn.block { margin: 0 0 2px; }
@media (max-width: 720px) {
  .ans-name, .ans-pal, .ans-cmt, .ans-actions { flex-basis: 100%; }
  .ans-cmt { margin-bottom: 12px; }
  .tl td { height: 40px; }
  .matrix .p-row td, .matrix .sum-row td { height: 32px; }
}
#answerArea { scroll-margin-top: 64px; }

/* JS 有効時は静的説明を隠す（アプリが描画内容で置き換える。ディープリンク時のちらつき防止） */
.js .static-intro { display: none; }

/* トップ下部の説明（特長・よくある質問）。JS 有効時はトップ画面だけ表示 */
.js #about { display: none; }
.js.home #about { display: block; }
.about { padding-top: 0; padding-bottom: 8px; }
.about h2 { font-size: 1.15rem; text-align: center; margin: 12px 0 14px; }
.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 28px; }
@media (max-width: 520px) { .features { grid-template-columns: 1fr; } }
.feature { background: #fff; border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); border-top: 3px solid var(--primary); }
.feature p { color: var(--muted); font-size: .85rem; margin: 4px 0 0; }
.faq details { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 10px; }
.faq summary { cursor: pointer; padding: 13px 16px; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '＋'; color: var(--primary-dark); flex: none; }
.faq details[open] summary::after { content: '－'; }
.faq details p { margin: 0; padding: 0 16px 14px; color: var(--muted); font-size: .9rem; }
