/* ==========================================================================
   Sync — minimal, full-bleed, mobile-first stylesheet
   色は「黒・グレー階調 + アクセント1色」に限定。
   カードや枠は使わず、余白とヘアラインで区切る。
   ========================================================================== */

:root {
  --bg: #ffffff;
  --fill: #f2f2f4;            /* コントロールの面（セグメント・選択中チップ等） */
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #a1a1a6;
  --line: rgba(0, 0, 0, .1);
  --accent: #0071e3;          /* 唯一の色。主要ボタン・選択状態のみに使用 */
  --accent-press: #0062c4;
  --accent-soft: rgba(0, 113, 227, .09);
  --danger: #d70015;          /* エラーと削除のみ */
  --thumb: #ffffff;
  --glass: rgba(255, 255, 255, .8);
  --glass-bar: rgba(255, 255, 255, .55);
  --btn: #1f1f21;          /* 主ボタン：かすかに薄い黒 */
  --btn-press: #000000;
  --btn-text: #ffffff;
  --btn-shadow: rgba(0, 0, 0, .28);

  --gutter: 20px;
  --pad: max(var(--gutter), env(safe-area-inset-left));
  --pad-r: max(var(--gutter), env(safe-area-inset-right));
  --r: 12px;
  --ease: cubic-bezier(.32, .72, 0, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Hiragino Sans",
          "Hiragino Kaku Gothic ProN", "Helvetica Neue", "Noto Sans JP", "Segoe UI", Meiryo, sans-serif;
  --bar-h: 84px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --fill: #1c1c1e;
    --text: #f5f5f7;
    --text-2: #98989d;
    --text-3: #636366;
    --line: rgba(255, 255, 255, .14);
    --accent: #2997ff;
    --accent-press: #47a6ff;
    --accent-soft: rgba(41, 151, 255, .18);
    --danger: #ff453a;
    --thumb: #48484a;
    --glass: rgba(0, 0, 0, .72);
    --glass-bar: rgba(30, 30, 32, .5);
    --btn: #f2f2f4;        /* ダークモードでは反転（白に近いグレー） */
    --btn-press: #ffffff;
    --btn-text: #1d1d1f;
    --btn-shadow: rgba(0, 0, 0, .6);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
h1, h2, p { text-wrap: pretty; word-break: auto-phrase; }
[hidden] { display: none !important; }
svg { display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.page { flex: 1 0 auto; width: 100%; max-width: 720px; margin: 0 auto; padding-bottom: 40px; }

/* フッター（下部固定ボタンがある画面ではその分だけ余白をとる） */
.site-footer {
  padding: 20px var(--pad-r) calc(24px + env(safe-area-inset-bottom)) var(--pad);
  text-align: center;
  font-size: 11px;
}
.site-footer a { color: var(--text-3); text-decoration: none; letter-spacing: .02em; }
.site-footer a:hover { color: var(--text-2); }
.page.has-action-bar { padding-bottom: 24px; }
.wrap { padding-left: var(--pad); padding-right: var(--pad-r); }
.section, .event-head, #results, #answer-section { scroll-margin-top: calc(64px + env(safe-area-inset-top)); }

/* ---------- Navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  padding-top: env(safe-area-inset-top);
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: .5px solid var(--line);
}
.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  height: 50px;
  padding: 0 var(--pad-r) 0 var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -.01em;
}
.brand-mark { width: 28px; height: 28px; margin: -2px -2px -2px -4px; background: url("logo.png") center / contain no-repeat; }
.brand-by { margin-left: 2px; font-size: 12px; font-weight: 400; color: var(--text-3); letter-spacing: 0; }
.nav-link { color: var(--accent); text-decoration: none; font-size: 14px; padding: 8px 0; }

/* ---------- Typography ---------- */
.hero { padding-top: 40px; padding-bottom: 8px; }
.hero-title {
  font-size: clamp(30px, 8.6vw, 44px);
  line-height: 1.16;
  font-weight: 700;
  letter-spacing: -.025em;
}
.hero-lead { margin-top: 12px; color: var(--text-2); font-size: 16px; }

.section { padding-top: 44px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-title { font-size: 20px; font-weight: 700; letter-spacing: -.015em; padding-bottom: 12px; }
.section-head .section-title { padding-left: 0; padding-right: 0; }
.section-meta { font-size: 14px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.hint { margin-top: 12px; font-size: 12px; color: var(--text-2); }

/* ---------- Fields (枠なし・ヘアラインのみ) ---------- */
.field {
  display: block;
  padding: 12px var(--pad-r) 12px var(--pad);
  border-bottom: .5px solid var(--line);
  transition: border-color .2s;
}
.section-title + .field,
.section-head + form > .field:first-child { border-top: .5px solid var(--line); }
.field-label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 2px; transition: color .2s; }
.field:focus-within .field-label { color: var(--accent); }
.field input,
.field textarea {
  display: block;
  width: 100%;
  border: 0;
  outline: 0;
  padding: 4px 0;
  background: transparent;
  font-size: 16px;
}
.field textarea { resize: vertical; min-height: 2.6em; line-height: 1.5; }
.field input::placeholder, .field textarea::placeholder { color: var(--text-3); }
.field-help { display: block; margin-top: 2px; font-size: 11px; color: var(--text-3); }

/* ---------- Buttons ---------- */
.btn {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 0 28px;
  border: 0;
  border-radius: var(--r);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  user-select: none;
  -webkit-user-select: none;
  transition: transform .2s var(--ease), background-color .2s, opacity .2s;
}
.btn:active { transform: scale(.98); }
.btn-block { width: 100%; }
.btn-primary {
  background: var(--btn);
  color: var(--btn-text);
  /* 同系色（黒）のやわらかい影 */
  box-shadow: 0 8px 20px -8px var(--btn-shadow), 0 2px 6px -2px var(--btn-shadow);
}
.btn-primary:active { background: var(--btn-press); box-shadow: 0 3px 8px -4px var(--btn-shadow); }
.btn-primary:disabled { box-shadow: none; }
.btn-secondary { background: var(--fill); color: var(--accent); }
.btn-secondary:active { opacity: .7; }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.is-busy { pointer-events: none; }
.btn.is-busy .btn-label { opacity: 0; }
.btn.is-busy::after {
  content: "";
  position: absolute;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--btn-text) 35%, transparent);
  border-top-color: var(--btn-text);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.text-btn {
  border: 0;
  background: none;
  padding: 8px 0;
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
}
.text-btn:active { opacity: .5; }
.text-btn--danger { color: var(--danger); }
.text-btn:disabled { color: var(--text-3); }

.icon-btn {
  width: 44px; height: 44px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--text);
  display: grid;
  place-items: center;
}
.icon-btn:active { background: var(--fill); }
.icon-btn:disabled { color: var(--text-3); background: none; cursor: default; }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Bottom action bar ---------- */
/* 画面下に追従（sticky）。ページの最後まで来ると通常位置に収まり、その下にフッターが来る */
.action-bar {
  position: sticky;
  bottom: 0;
  z-index: 40;
  padding: 12px var(--pad-r) calc(12px + env(safe-area-inset-bottom)) var(--pad);
  background: var(--glass-bar);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
  border-top: .5px solid var(--line);
}
.action-bar.is-hidden { transform: translateY(110%); opacity: 0; pointer-events: none; }
.action-bar-inner { max-width: 1120px; margin: 0 auto; display: grid; justify-items: stretch; }
.action-bar .btn { width: 100%; }

/* ---------- Calendar（全幅） ---------- */
.calendar { padding: 0 max(8px, env(safe-area-inset-left)) 0 max(8px, env(safe-area-inset-right)); border-top: .5px solid var(--line); }
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 4px; }
.cal-title { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-week { padding: 4px 0 6px; }
.cal-week span { text-align: center; font-size: 11px; font-weight: 500; color: var(--text-3); }
.cal-grid {
  row-gap: 2px;
  padding-bottom: 8px;
  touch-action: none;            /* なぞり選択のためスクロールを抑止 */
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.cal-day {
  position: relative;
  height: 48px;
  padding: 0;
  border: 0;
  background: none;
  display: grid;
  place-items: center;
  font-variant-numeric: tabular-nums;
}
.cal-num {
  position: relative;
  z-index: 1;
  width: 42px; height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 17px;
  font-weight: 400;
  transition: background-color .15s, color .15s, transform .15s var(--ease);
}
.cal-day.is-today .cal-num { font-weight: 700; color: var(--accent); }
.cal-day.is-past { cursor: default; }
.cal-day.is-past .cal-num { color: var(--text-3); }
.cal-day:not(.is-past):active .cal-num { transform: scale(.9); }
@media (hover: hover) {
  .cal-day:not(.is-past):not(.is-selected):hover .cal-num { background: var(--fill); }
}
.cal-day.is-selected .cal-num { background: var(--accent); color: #fff; font-weight: 600; }

/* 連続選択の「帯」 */
.cal-day::before {
  content: "";
  position: absolute;
  top: 3px; bottom: 3px;
  left: 50%; right: 50%;
  background: var(--accent-soft);
  opacity: 0;
}
.cal-day.join-l::before, .cal-day.join-r::before { opacity: 1; }
.cal-day.join-l::before { left: 0; }
.cal-day.join-r::before { right: 0; }
.cal-grid.is-dragging .cal-num { transition: none; }

/* ---------- Create wizard（1画面1ステップ） ---------- */
.wizard-progress {
  position: sticky;
  top: calc(50px + env(safe-area-inset-top));
  z-index: 45;
  height: 2px;
  background: transparent;
}
.wizard-progress span {
  display: block;
  height: 100%;
  width: 33.3%;
  background: var(--accent);
  transition: width .45s var(--ease);
}
.wizard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding-top: 8px;
}
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: -6px;
  padding: 8px 6px 8px 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 15px;
}
.back-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.back-btn:active { opacity: .5; }
.wizard-count { margin-left: auto; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }

.step-title {
  padding-top: 16px;
  padding-bottom: 24px;
  font-size: clamp(28px, 7.8vw, 36px);
  line-height: 1.22;
  font-weight: 700;
  letter-spacing: -.025em;
}
.step-lead { margin: -12px 0 20px; font-size: 14px; color: var(--text-2); }
.step-title + .field,
.step-title + .summary { border-top: .5px solid var(--line); }
.field--lg input { font-size: 20px; font-weight: 600; padding: 6px 0; }

.step.enter-fwd  { animation: stepIn .38s var(--ease); }
.step.enter-back { animation: stepBack .38s var(--ease); }
@keyframes stepIn   { from { opacity: 0; transform: translateX(28px); } }
@keyframes stepBack { from { opacity: 0; transform: translateX(-28px); } }

/* 確認ステップ */
.summary { margin: 0; }
.summary-row {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 12px;
  align-items: start;
  padding: 14px var(--pad-r) 14px var(--pad);
  border-bottom: .5px solid var(--line);
}
.summary-row dt { grid-column: 1; font-size: 12px; color: var(--text-2); }
.summary-row dd { grid-column: 1; margin: 2px 0 0; font-size: 16px; overflow-wrap: anywhere; white-space: pre-wrap; }
.summary-row dd.is-empty { color: var(--text-3); }
.summary-row .text-btn { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.summary-row .chips { margin-top: 6px; }
#sum-count, #sel-count { font-variant-numeric: tabular-nums; }
.chip--static { padding-right: 12px; }

/* ---------- 作成完了・共有画面 ---------- */
.page.done { max-width: 560px; display: flex; flex-direction: column; justify-content: center; }
.done-body { padding-top: 32px; padding-bottom: 32px; text-align: center; }
.done-icon {
  width: 56px; height: 56px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--accent);
  display: grid;
  place-items: center;
  box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--accent) 60%, transparent);
  animation: pop .45s var(--ease);
}
.done-icon svg { width: 28px; height: 28px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.done-title {
  font-size: clamp(24px, 6.6vw, 30px);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
}
.done-lead { margin-top: 8px; color: var(--text-2); font-size: 14px; }
.done-url {
  display: block;
  width: 100%;
  margin-top: 28px;
  padding: 14px 16px;
  border: 0;
  border-radius: var(--r);
  background: var(--fill);
  color: var(--text);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  text-align: center;
  overflow-wrap: anywhere;
  cursor: pointer;
  transition: transform .15s var(--ease);
}
.done-url:active { transform: scale(.98); }
.done-actions { gap: 6px; }
.done-actions .text-btn { padding: 10px 0 0; }
.done-actions .btn { width: 100%; }
.done-actions .text-btn { justify-self: center; text-decoration: none; }

/* 参加者の事前登録 */
.step-lead + .field { border-top: .5px solid var(--line); }
.member-row { display: flex; align-items: center; gap: 12px; }
.member-row input { flex: 1; min-width: 0; }

/* 回答画面：名前の選択 */
.who { padding: 8px 0 8px; }
.who-q { font-size: 20px; font-weight: 700; letter-spacing: -.015em; padding-bottom: 14px; }
.who .field { margin-top: 12px; border-top: .5px solid var(--line); }
.overview { padding-top: 36px; }
.overview > .list-title { display: block; padding-bottom: 6px; }
.best-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding-bottom: 8px; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.best-tag { font-size: 10px; font-weight: 700; color: #fff; background: var(--accent); padding: 2px 8px; border-radius: 999px; }
.best-n { font-size: 12px; font-weight: 500; color: var(--text-2); }
.name-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.name-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--fill);
  color: var(--text);
  font-size: 15px;
  transition: background-color .2s, color .2s, transform .15s var(--ease), box-shadow .2s;
}
.name-chip:active { transform: scale(.96); }
.name-chip svg { width: 14px; height: 14px; fill: none; stroke: var(--text-3); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.name-chip--add { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1px var(--line); }
.name-chip.is-selected {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--accent) 60%, transparent);
}
.name-chip.is-selected svg { stroke: #fff; }
.p-name.is-pending { color: var(--text-3); font-weight: 400; }

/* ---------- Selected dates ---------- */
.selected { margin-top: 20px; }
.selected-head { display: flex; align-items: center; justify-content: space-between; min-height: 36px; }
.selected-label { font-size: 12px; color: var(--text-2); }
.chips { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 2px 0 12px;
  border-radius: 999px;
  background: var(--fill);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  animation: pop .2s var(--ease);
}
.chip button {
  width: 30px; height: 30px;
  border: 0;
  background: none;
  color: var(--text-3);
  display: grid;
  place-items: center;
}
.chip svg { width: 12px; height: 12px; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; fill: none; }
.empty-note { margin-top: 4px; color: var(--text-3); font-size: 14px; }
@keyframes pop { from { transform: scale(.9); opacity: 0; } }

.d-wd { font-size: .85em; color: var(--text-2); margin-left: 1px; font-weight: 400; }

/* ---------- Event head ---------- */
.notice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 20px;
  font-size: 13px;
  color: var(--text-2);
}
.notice svg { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.event-head { padding-top: 28px; padding-bottom: 28px; }
.event-title {
  font-size: clamp(28px, 7.6vw, 40px);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -.025em;
  overflow-wrap: anywhere;
}
.event-memo { margin-top: 12px; color: var(--text-2); overflow-wrap: anywhere; }
.meta { margin-top: 14px; font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.meta-item + .meta-item::before { content: "・"; margin: 0 2px; color: var(--text-3); }

/* ---------- Share ---------- */
.share { padding-top: 14px; padding-bottom: 14px; border-top: .5px solid var(--line); border-bottom: .5px solid var(--line); }
.share-row { display: flex; align-items: center; gap: 16px; }
.share-row input {
  flex: 1;
  min-width: 0;
  padding: 2px 0;
  border: 0;
  outline: 0;
  background: none;
  font-size: 14px;
  color: var(--text);
  text-overflow: ellipsis;
}

/* ---------- Best ---------- */
.best { padding-bottom: 16px; }
.best-label { font-size: 12px; color: var(--accent); font-weight: 600; }
.best-dates { margin-top: 2px; font-size: 18px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.best-sub { margin-top: 2px; font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }

.best-pill { margin-top: 2px; font-size: 10px; font-weight: 700; letter-spacing: .08em; color: var(--accent); }

/* ---------- みんなの回答（表）：罫線なし ---------- */
.matrix-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  padding-bottom: 4px;
}
.matrix-scroll:focus-visible { outline-offset: -2px; }
.matrix { border-collapse: separate; border-spacing: 0 3px; min-width: 100%; font-size: 14px; }
.matrix th, .matrix td {
  height: 44px;
  padding: 0;
  text-align: center;
  white-space: nowrap;
  background: var(--bg);
}
.matrix thead th { height: 32px; font-size: 11px; font-weight: 500; color: var(--text-3); }
.matrix .col-date {
  position: sticky;
  left: 0;
  z-index: 2;
  padding: 0 12px 0 var(--pad);
  text-align: left;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.matrix .col-sum { width: 40px; padding: 0 8px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
.matrix thead .col-sum { color: var(--text-3); font-weight: 500; }
.matrix .col-p { min-width: 52px; max-width: 72px; padding: 0 2px; }
.matrix .col-p:last-child { padding-right: var(--pad-r); }
/* 最有力の行は帯状に色づけ */
.matrix tr.is-best > * { background: linear-gradient(var(--accent-soft), var(--accent-soft)) var(--bg); }
.matrix tr.is-best .col-sum { color: var(--accent); }
.matrix tr.is-best > :first-child { box-shadow: inset 3px 0 0 var(--accent); }

.sum { display: flex; flex-direction: column; gap: 6px; }
.sum-nums { display: flex; gap: 10px; justify-content: center; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.sum-nums .n-yes { color: var(--text); font-weight: 600; }
.sum-nums .n-yes b { font-size: 15px; margin-left: 1px; }
.sum-nums .n-maybe { color: var(--text-2); }
.sum-bar { height: 3px; border-radius: 2px; background: var(--fill); overflow: hidden; display: flex; }
.sum-bar i { display: block; height: 100%; }
.sum-bar .b-yes { background: var(--text); }
.sum-bar .b-maybe { background: var(--text-3); }
.matrix tr.is-best .sum-bar .b-yes { background: var(--accent); }

.p-name {
  width: 100%;
  max-width: 76px;
  padding: 6px 2px;
  border: 0;
  background: none;
  font-size: 11px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.p-name:active { opacity: .5; }
.p-name.is-mine { font-weight: 700; }
.p-name.is-mine::before { content: "● "; font-size: 10px; vertical-align: 2px; }

/* ◯△✕ は色ではなく濃淡で区別 */
.mark { font-size: 16px; line-height: 1; }
.mark-yes { color: var(--text); font-weight: 600; }
.mark-maybe { color: var(--text-2); }
.mark-no { color: var(--text-3); font-size: 13px; }
.mark-none { color: var(--text-3); font-size: 18px; }

.matrix-empty { padding: 24px var(--pad); color: var(--text-2); font-size: 14px; }

.comments { list-style: none; margin: 0; padding: 0; }
.comments { margin-top: 16px; }
.comment {
  padding: 8px var(--pad-r) 8px var(--pad);
  font-size: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.comment-name { display: block; font-size: 11px; color: var(--text-2); white-space: normal; }

/* ---------- Answer form ---------- */
.event-time { margin-top: 8px; font-size: 14px; font-weight: 600; color: var(--text); }
.meta { display: flex; align-items: center; flex-wrap: wrap; }

.edit-note { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; padding-bottom: 4px; font-size: 12px; color: var(--accent); }

.list-head { display: flex; align-items: center; justify-content: space-between; padding-top: 28px; padding-bottom: 8px; }
.list-title { font-size: 12px; color: var(--text-2); font-weight: 500; }
.bulk { display: inline-flex; align-items: center; gap: 14px; }
.bulk-label { font-size: 11px; color: var(--text-3); }
.bulk .text-btn { font-size: 15px; min-width: 24px; padding: 4px 0; color: var(--text-2); }

.answer-list { border-top: .5px solid var(--line); margin-bottom: 8px; }
.answer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 12px;
  align-items: center;
  padding: 10px var(--pad-r) 10px var(--pad);
  border-bottom: .5px solid var(--line);
  transition: background-color .3s;
}
.answer-date { display: flex; flex-direction: column; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.25; }
.answer-row .best-pill { display: none; }
.answer-row.is-best .best-pill { display: block; }
.answer-row.is-best { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.answer-row.is-missing .answer-date { color: var(--danger); }
.answer-row.is-missing .seg { box-shadow: inset 0 0 0 1px var(--danger); }

.form-extra { display: flex; justify-content: center; }
.extras { padding-top: 24px; }
.comments-wrap .list-title { display: block; padding-bottom: 8px; }
.table-view { margin-top: 20px; border-top: .5px solid var(--line); border-bottom: .5px solid var(--line); }
.table-view summary {
  list-style: none;
  padding-top: 14px;
  padding-bottom: 14px;
  font-size: 14px;
  color: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.table-view summary::-webkit-details-marker { display: none; }
.table-view summary::after { content: "›"; font-size: 18px; line-height: 1; color: var(--text-3); transition: transform .2s var(--ease); }
.table-view[open] summary::after { transform: rotate(90deg); }
.table-view .matrix-scroll { border-bottom: 0; }

/* iOS Segmented Control（モノトーン） */
.seg {
  position: relative;
  flex: 0 0 auto;
  width: min(192px, 54vw);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 2px;
  border-radius: 10px;
  background: var(--fill);
  isolation: isolate;
}
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.seg label {
  position: relative;
  z-index: 1;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-size: 17px;
  color: var(--text-3);
  cursor: pointer;
  transition: color .2s, transform .15s var(--ease);
  user-select: none;
  -webkit-user-select: none;
}
.seg label:active { transform: scale(.92); }         /* 押下中は凹む */
.seg label + input + label::before {                 /* 区切り線 */
  content: "";
  position: absolute;
  left: 0; top: 12px; bottom: 12px;
  width: 1px;
  background: var(--line);
  transition: opacity .2s;
}
.seg input:checked + label::before,
.seg input:checked + label + input + label::before { opacity: 0; }
.seg input:checked + label { color: var(--text); font-weight: 600; }
.seg-n {
  position: absolute;
  top: 3px;
  right: 7px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.seg input:checked + label .seg-n { color: var(--accent); }
.seg input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: -2px; }
.seg-thumb {
  position: absolute;
  z-index: 0;
  top: 2px; bottom: 2px; left: 2px;
  width: calc((100% - 4px) / 3);
  border-radius: 8px;
  background: var(--thumb);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .1), 0 1px 1px rgba(0, 0, 0, .04);
  opacity: 0;
  transform: translateX(0) scale(.9);
  transition: transform .3s var(--ease), opacity .2s;
}
.seg input:checked ~ .seg-thumb { opacity: 1; transform: translateX(0) scale(1); }
.seg input:nth-of-type(2):checked ~ .seg-thumb { transform: translateX(100%) scale(1); }
.seg input:nth-of-type(3):checked ~ .seg-thumb { transform: translateX(200%) scale(1); }

.form-actions { padding-top: 24px; display: grid; justify-items: center; gap: 8px; }

/* ---------- Not found ---------- */
.notfound { padding-top: 72px; display: grid; justify-items: start; gap: 16px; }
.notfound .hero-title { font-size: 28px; }
.notfound .hero-lead { margin: 0 0 8px; font-size: 14px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  top: calc(62px + env(safe-area-inset-top));
  z-index: 100;
  max-width: calc(100% - 40px);
  padding: 11px 20px;
  border-radius: 999px;
  background: rgba(29, 29, 31, .9);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  color: #fff;
  font-size: 14px;
  text-align: center;
  transform: translate(-50%, -12px);
  opacity: 0;
  pointer-events: none;
  transition: transform .4s var(--ease), opacity .25s;
}
.toast.is-show { transform: translate(-50%, 0); opacity: 1; }
.toast.is-error { background: var(--danger); }

/* ==========================================================================
   PC / タブレット
   ========================================================================== */
@media (min-width: 720px) {
  :root { --gutter: 32px; }
  .page.wizard { max-width: 640px; }
  .page-create .nav-inner { max-width: 640px; }
  .page-created .nav-inner,
  .page-created .action-bar-inner { max-width: 560px; }
  .page-created .action-bar-inner { padding: 0 var(--gutter); }
  .action-bar .done-actions .btn { width: 100%; }
  .page-create .action-bar-inner,
  .page-event .action-bar-inner { max-width: 640px; padding: 0 var(--gutter); }
  .page-create .action-bar .btn,
  .page-event .action-bar .btn { width: 100%; }
  .page.answer { max-width: 640px; }
  .page-event .nav-inner { max-width: 640px; }
  .wizard-progress { max-width: none; }
  .hero { padding-top: 72px; }
  .action-bar .btn { width: auto; min-width: 240px; }
}

@media (min-width: 1000px) {
  .page { max-width: 1120px; }

  .cal-day { height: 56px; }
  .cal-num { width: 46px; height: 46px; }

  .seg { width: 192px; }
  .share-row input { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}

/* ---------- 名前のプルダウン ---------- */
.select-wrap { position: relative; }
.select {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 52px;
  padding: 0 44px 0 16px;
  border: 0;
  border-radius: var(--r);
  background: var(--fill);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  cursor: pointer;
}
.select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.select-wrap::after {               /* ▼ の代わりのシェブロン */
  content: "";
  position: absolute;
  right: calc(var(--pad-r) + 18px);
  top: 50%;
  width: 8px; height: 8px;
  margin-top: -6px;
  border-right: 2px solid var(--text-2);
  border-bottom: 2px solid var(--text-2);
  transform: rotate(45deg);
  pointer-events: none;
}
.who-note { margin-top: 10px; font-size: 12px; color: var(--text-2); }
.admin-badge { color: var(--text); font-weight: 600; }

/* ---------- 回答完了の演出（暗転 + 👍） ---------- */
.celebrate {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, .45);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .3s ease;
  cursor: pointer;
}
.celebrate.is-show { opacity: 1; }
.celebrate-body { text-align: center; color: #fff; transform: scale(.9); transition: transform .45s var(--ease); }
.celebrate.is-show .celebrate-body { transform: scale(1); }
.celebrate-emoji {
  font-size: 96px;
  line-height: 1;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, .35));
}
.celebrate.is-show .celebrate-emoji { animation: thumb .7s cubic-bezier(.2, 1.4, .4, 1) both; }
.celebrate-text { margin-top: 18px; font-size: 17px; font-weight: 700; letter-spacing: .02em; }
@keyframes thumb {
  0%   { transform: scale(.3) rotate(-18deg); opacity: 0; }
  60%  { transform: scale(1.12) rotate(6deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); }
}

/* ---------- 回答画面：注記 ---------- */
.list-note { padding-top: 20px; padding-bottom: 8px; font-size: 11px; color: var(--text-3); }
.list-note[hidden] + .answer-list { margin-top: 20px; }
span.p-name { display: block; margin: 0 auto; }

/* ---------- みんなの回答：下からせり出すシート ---------- */
.sheet { margin: -12px calc(-1 * var(--pad-r)) 10px calc(-1 * var(--pad)); }
.sheet-handle {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 16px 8px;
  border: 0;
  background: none;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  touch-action: none;          /* ドラッグで高さを変えるため */
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.sheet-handle:active { cursor: grabbing; }
.sheet-grabber {
  position: absolute;
  top: 6px;
  left: 50%;
  width: 36px; height: 5px;
  margin-left: -18px;
  border-radius: 3px;
  background: var(--text-3);
  opacity: .45;
}
#sheet-count { font-variant-numeric: tabular-nums; }
.sheet-chev {
  width: 7px; height: 7px;
  margin-left: 2px;
  border-left: 1.8px solid var(--text-3);
  border-top: 1.8px solid var(--text-3);
  transform: translateY(2px) rotate(45deg);
  transition: transform .3s var(--ease);
}
.sheet.is-open .sheet-chev { transform: translateY(-2px) rotate(225deg); }
.sheet-body {
  height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
  transition: height .38s var(--ease);
}
.sheet.is-open .sheet-body { border-top: .5px solid var(--line); }
.sheet-body.no-anim { transition: none; }
.sheet-inner { max-width: 640px; margin: 0 auto; padding: 4px 0 12px; }
.sheet .comments { margin-top: 8px; }

/* 日付は「11/5(木)」を1行で */
.answer-date { display: block; }

/* ---------- 警告は画面の中央に ---------- */
.toast.is-error {
  top: 50%;
  width: max-content;
  max-width: min(320px, calc(100% - 48px));
  padding: 16px 22px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.55;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .25);
  transform: translate(-50%, -50%) scale(.94);
}
.toast.is-error.is-show { transform: translate(-50%, -50%) scale(1); }

/* ---------- 自分の回答（修正ボタン） ---------- */
.mine-card { padding-bottom: 28px; }
.mine-label { font-size: 12px; color: var(--text-2); margin-bottom: 8px; }
.mine-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 10px 10px 16px;
  border-radius: var(--r);
  background: var(--fill);
}
.mine-row + .mine-row { margin-top: 8px; }
.mine-name { font-size: 16px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.mine-check { font-size: 13px; color: var(--text-2); }
.mine-edit {
  flex: 0 0 auto;
  height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--btn);
  color: var(--btn-text);
  font-size: 13px;
  font-weight: 600;
  transition: transform .15s var(--ease);
}
.mine-edit:active { transform: scale(.96); }
.mine-card:not([hidden]) + .who .who-q { font-size: 16px; color: var(--text-2); }

/* ヘッダー右端の tanukie */
.nav-by { font-size: 12px; color: var(--text-3); text-decoration: none; letter-spacing: .02em; padding: 8px 0; }
.nav-by:hover { color: var(--text-2); }

/* 「返答をみる」を開いたときは背景を少し暗く（下の画面はそのまま操作できる） */
.sheet-scrim {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(0, 0, 0, .28);
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s var(--ease);
}
.sheet-scrim.is-show { opacity: 1; }
.page-event .action-bar { z-index: 60; }

/* つまみ（開くところの上の線）を濃く */
.sheet-grabber { background: var(--text-2); opacity: .7; width: 40px; margin-left: -20px; }
.page-event .action-bar { border-top-color: color-mix(in srgb, var(--text) 18%, transparent); }
/* 開いているときはバーを不透明に（暗い背景が透けてグレーにならないように） */
.page-event:has(.sheet.is-open) .action-bar { background: var(--bg); }


/* ==========================================================================
   調整：ヘッダー / 見出しサイズの統一 / 文字サイズ
   ========================================================================== */
.nav-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.nav-left { justify-self: start; }
.nav-right { justify-self: end; }
.brand { justify-self: center; font-size: 16px; }
.nav-back {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  margin-left: -6px;
  padding: 8px 8px 8px 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 15px;
}
.nav-back svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.nav-back:active { opacity: .5; }
.nav-by { font-size: 12px; }

/* 見出し（どんな予定を〜／候補日を〜／あなたの名前は？／イベント名など）は同じサイズ */
.step-title, .event-title, .who-q, .done-title {
  font-size: clamp(24px, 6.6vw, 30px);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -.02em;
}
.who-q { padding-bottom: 16px; }
.mine-card:not([hidden]) + .who .who-q { font-size: clamp(24px, 6.6vw, 30px); color: var(--text); }
.wizard-head { min-height: 32px; padding-top: 12px; }

/* 入力欄は16px（iOSで勝手に拡大されないように） */
.field input, .field textarea, .select { font-size: 16px; }
.field--lg input { font-size: 20px; }
.cal-num { font-size: 16px; }

/* 作成の最後のボタンだけ青 */
.btn-primary.btn-accent {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--accent) 70%, transparent),
              0 2px 6px -2px color-mix(in srgb, var(--accent) 45%, transparent);
}
.btn-primary.btn-accent:active { background: var(--accent-press); }
.btn-primary.btn-accent.is-busy::after { border-color: rgba(255, 255, 255, .35); border-top-color: #fff; }
/* 戻るボタンをヘッダーに移したので、回答画面の見出しの上に余白 */
.astep[data-astep="2"] .step-title { padding-top: 28px; }

/* ---------- 返答の表：日付列と◯列を固定、横スクロール時は境界に影 ---------- */
.sheet .matrix .col-date { z-index: 3; }
.sheet .matrix .col-sum {
  position: sticky;
  left: var(--date-w, 96px);
  z-index: 3;
  transition: box-shadow .2s;
}
.sheet .matrix-scroll.is-scrolled .col-sum { box-shadow: 8px 0 10px -8px rgba(0, 0, 0, .28); }
.sheet .matrix-scroll { padding-bottom: 0; }

/* ---------- 選択中の候補日タグ：小さめの文字・右側の余白を整える ---------- */
.chip {
  height: 30px;
  padding: 0 5px 0 11px;
  gap: 3px;
  font-size: 13px;
}
.chip button {
  width: 20px; height: 20px;
  padding: 0;
  border-radius: 50%;
}
.chip button:active { background: rgba(0, 0, 0, .08); }
.chip svg { width: 10px; height: 10px; }
.chip--static { padding-right: 11px; }

/* ---------- PC：下部ボタンの上下の余白をブラウザサイズに比例させる ---------- */
.action-bar { --bar-pad: 12px; padding-top: var(--bar-pad); padding-bottom: calc(var(--bar-pad) + env(safe-area-inset-bottom)); }
.sheet { margin-top: calc(-1 * var(--bar-pad)); }
@media (min-width: 720px) {
  .action-bar { --bar-pad: clamp(18px, 2.4vh + .6vw, 48px); }
}

/* ---------- 通知（iOS風スイッチ） ---------- */
.notify { margin-top: 28px; border-top: .5px solid var(--line); }
.notify .field { border-top: 0; }
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 10px var(--pad-r) 10px var(--pad);
  border-bottom: .5px solid var(--line);
  cursor: pointer;
}
.switch-label { font-size: 15px; }
.switch {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  flex: 0 0 auto;
  width: 51px; height: 31px;
  margin: 0;
  border-radius: 999px;
  background: var(--fill);
  box-shadow: inset 0 0 0 1px var(--line);
  cursor: pointer;
  transition: background-color .25s var(--ease), box-shadow .25s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 27px; height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 1px 1px rgba(0, 0, 0, .1);
  transition: transform .25s var(--ease);
}
.switch:checked { background: var(--accent); box-shadow: none; }
.switch:checked::after { transform: translateX(20px); }
.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (min-width: 1000px) {
  .create-layout .switch-row { padding-left: 0; padding-right: 0; }
}

/* ---------- 確認ダイアログ（画面中央） ---------- */
.dialog-wrap {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, .4);
  opacity: 0;
  transition: opacity .2s ease;
}
.dialog-wrap.is-show { opacity: 1; }
.dialog {
  width: min(300px, 100%);
  border-radius: 16px;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
  text-align: center;
  overflow: hidden;
  transform: scale(1.08);
  transition: transform .25s var(--ease);
}
.dialog-wrap.is-show .dialog { transform: scale(1); }
.dialog-title { padding: 20px 18px 4px; font-size: 16px; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.dialog-msg { padding: 0 18px 18px; font-size: 13px; color: var(--text-2); }
.dialog-title:last-child { padding-bottom: 18px; }
.dialog-actions { display: grid; border-top: .5px solid var(--line); }
.dialog-btn {
  height: 46px;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 16px;
}
.dialog-btn + .dialog-btn { border-top: .5px solid var(--line); }
.dialog-btn.is-primary { font-weight: 700; }
.dialog-btn:active { background: rgba(127, 127, 127, .15); }

/* ==========================================================================
   見出しを1行に／ラベルと入力欄を横並びにして高さを詰める
   ========================================================================== */
.step-title.fit {
  font-size: var(--fit-title, 22px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  padding-top: 8px;
  padding-bottom: 18px;
}
.wizard-head { min-height: 24px; padding-top: 10px; }

/* ラベル（左）＋入力欄（右） */
.field {
  display: grid;
  grid-template-columns: 4.6em minmax(0, 1fr);
  column-gap: 14px;
  align-items: center;
  padding-top: 8px;
  padding-bottom: 8px;
}
.field > .field-label { margin: 0; font-size: 13px; line-height: 1.3; }
.field input, .field textarea { padding: 8px 0; }
.field:has(textarea) { align-items: start; }
.field:has(textarea) > .field-label { padding-top: 10px; }
.field textarea { min-height: 2.2em; }
.field--lg input { font-size: 17px; font-weight: 600; padding: 8px 0; }
.field .member-row { min-width: 0; }

/* 確認画面も「項目名（左）＋内容（右）＋編集」の横並びで詰める */
.summary-row {
  grid-template-columns: 4.6em minmax(0, 1fr) auto;
  column-gap: 14px;
  align-items: center;
  padding-top: 10px;
  padding-bottom: 10px;
}
.summary-row dt { grid-column: 1; grid-row: 1; font-size: 13px; line-height: 1.3; }
.summary-row dd { grid-column: 2; grid-row: 1; margin: 0; font-size: 16px; }
.summary-row .text-btn { grid-column: 3; grid-row: 1; }
.summary-row .chips { margin-top: 0; }
#sum-count, #sum-mcount { display: block; font-size: 12px; color: var(--text-3); }
.notify { margin-top: 16px; }
.switch-row { min-height: 52px; }

/* スマホで入力中は追従ボタンを隠す（キーボードを閉じると戻る） */
@media (pointer: coarse) {
  body.is-typing .action-bar { display: none; }
  body.is-typing .page { padding-bottom: 45vh; }   /* 一番下の入力欄もキーボードの上までスクロールできるように */
}
