/* 回覧の出欠表に蛍光ペンを引く。藍墨が支配色、アクセントは蛍光黄の1点だけ。 */
:root {
  --paper: #e9f0f6;
  --grid: rgba(16, 36, 58, .055);
  --surface: #fbfdff;
  --ink: #10243a;
  --ink-2: #47596c;
  --line: #c5d2dd;
  --line-strong: #10243a;
  --marker: #ffe94d;
  --marker-ink: #10243a;
  --best-row: #fff9c7;
  --yes: #0a58a8;
  --maybe: #8f5400;
  --no: #5f6d7b;
  --danger: #ad2319;
  --main-bg: #10243a;
  --main-ink: #fbfdff;
  --seg-on-ink: #fbfdff;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0c1621;
    --grid: rgba(190, 215, 240, .05);
    --surface: #132130;
    --ink: #e8eff6;
    --ink-2: #a6b6c6;
    --line: #2d4052;
    --line-strong: #a6b6c6;
    --best-row: #2c3224;
    --yes: #7fc1ff;
    --maybe: #f2b45c;
    --no: #93a3b3;
    --danger: #ff8d82;
    --main-bg: #ffe94d;
    --main-ink: #10243a;
    --seg-on-ink: #0c1621;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0c1621;
  --grid: rgba(190, 215, 240, .05);
  --surface: #132130;
  --ink: #e8eff6;
  --ink-2: #a6b6c6;
  --line: #2d4052;
  --line-strong: #a6b6c6;
  --best-row: #2c3224;
  --yes: #7fc1ff;
  --maybe: #f2b45c;
  --no: #93a3b3;
  --danger: #ff8d82;
  --main-bg: #ffe94d;
  --main-ink: #10243a;
  --seg-on-ink: #0c1621;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
  font-family: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.75;
  letter-spacing: .04em;
  line-break: strict;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; letter-spacing: inherit; color: inherit; }
.page { max-width: 880px; margin: 0 auto; padding: 24px 16px 64px; }

.brand { margin: 0 0 28px; font-weight: 900; font-size: 15px; }
.brand a { text-decoration: none; border-bottom: 3px solid var(--ink); padding-bottom: 1px; }
h1 { margin: 0; font-weight: 900; line-height: 1.22; letter-spacing: .02em; overflow-wrap: anywhere; word-break: auto-phrase; text-wrap: balance; }
/* 「みんなの都合を、」8字が1行に収まる大きさ。幅が足りずに折り返さないよう画面幅から決める */
.hero h1 { font-size: min(calc((100vw - 32px) / 8.7), 96px); line-height: 1.3; }
.hero { padding-bottom: 28px; }
/* 帯は字の全体を覆う（字が帯からはみ出すとダークで沈む）。inline-block にして高さを字に合わせ、上の行に被らせない */
.hero .marker { display: inline-block; line-height: 1.12; padding: 0 .1em; margin: 0 .02em; }
.event-head { padding-bottom: 20px; }
.event-head h1 { font-size: clamp(34px, 7.5vw, 64px); }
.lead { margin: 20px 0 0; font-size: 17px; color: var(--ink-2); font-weight: 300; }
.memo { margin: 14px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink-2); }

.marker {
  color: var(--marker-ink);
  background-image: linear-gradient(var(--marker), var(--marker));
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-position: 0 100%;
  padding: 0 .12em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.sheet {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--line-strong);
  padding: 20px;
  margin: 0 0 20px;
}
.sheet-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin-bottom: 14px; }
h2 { margin: 0; font-size: 22px; font-weight: 900; line-height: 1.4; }
h3 { margin: 0 0 8px; font-size: 16px; font-weight: 900; }
.hint { margin: 4px 0 0; font-size: 13px; color: var(--ink-2); }
.mini { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 4px; }

.field { margin-bottom: 22px; }
.field > label:not(.mini) { display: block; font-weight: 900; font-size: 17px; margin-bottom: 8px; }
.step {
  display: inline-block; min-width: 1.6em; margin-right: .5em; text-align: center;
  background: var(--ink); color: var(--surface); font-weight: 900; line-height: 1.6;
}
input[type=text], input[type=time], textarea, select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--ink-2);
  border-radius: 0;
  padding: 10px 12px;
  font-size: 16px; /* iPhone の自動ズームを防ぐ */
  min-height: 46px;
}
textarea { resize: vertical; line-height: 1.6; }
:focus-visible { outline: 3px solid var(--yes); outline-offset: 2px; }

button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
.btn-main, .btn-line, .btn-quiet, .btn-danger { border-radius: 0; min-height: 46px; }
.btn-main {
  display: block; width: 100%;
  background: var(--main-bg); color: var(--main-ink);
  border: 0; padding: 14px 20px;
  font-weight: 900; font-size: 19px;
  transition: transform .12s;
}
.btn-main:hover { transform: translateY(-2px); }
.btn-main:disabled { opacity: .55; transform: none; }
.as-link { text-align: center; text-decoration: none; }
.btn-line {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface); color: var(--ink);
  border: 2px solid var(--line-strong); padding: 6px 16px;
  font-weight: 900; font-size: 15px; text-decoration: none; white-space: nowrap;
}
.btn-line:hover { background: var(--marker); color: var(--marker-ink); }
.btn-quiet {
  background: transparent; border: 0; padding: 6px 8px; min-height: 40px;
  font-size: 14px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px;
}
.btn-danger {
  background: transparent; color: var(--danger);
  border: 2px solid var(--danger); padding: 6px 14px; font-weight: 900; font-size: 14px;
}
.error { margin: 0 0 14px; padding: 8px 12px; border-left: 4px solid var(--danger); color: var(--danger); font-weight: 900; }

/* --- つくる画面 --- */
.picker { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.picker-side { min-width: 0; }
.time-field { margin: 10px 0 16px; }
.time-row { display: grid; grid-template-columns: minmax(0, 11em) auto minmax(0, 11em) auto; gap: 6px; align-items: center; justify-content: start; }
.time-row input { min-width: 0; }
.time-sep { font-weight: 900; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cal-head strong { font-weight: 900; font-size: 17px; }
.cal-nav {
  width: 44px; height: 44px; font-size: 22px; line-height: 1;
  background: transparent; border: 1px solid var(--line); border-radius: 0;
}
.cal-nav:disabled { opacity: .3; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.cal-w { text-align: center; font-size: 12px; color: var(--ink-2); padding: 2px 0; }
.cal-day {
  aspect-ratio: 1; min-height: 40px; padding: 0;
  background: transparent; border: 1px solid transparent; border-radius: 0;
  font-size: 15px; letter-spacing: 0;
}
.cal-day:hover:not(:disabled) { border-color: var(--ink); }
.cal-day:disabled { color: var(--line); }
.cal-w.d0, .cal-day.d0:not(:disabled):not(.on) { color: var(--danger); }
.cal-w.d6, .cal-day.d6:not(:disabled):not(.on) { color: var(--yes); }
.cal-day.on { background: var(--marker); color: var(--marker-ink); font-weight: 900; border-color: var(--marker-ink); }

.recent { margin-top: 36px; }
.recent ul { list-style: none; margin: 10px 0 0; padding: 0; border-top: 1px solid var(--line); }
.recent li { display: flex; gap: 10px; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.tag {
  display: inline-block; flex: none; margin-left: .5em; padding: 0 .5em;
  border: 1px solid currentColor; font-size: 11px; font-weight: 400; line-height: 1.6; white-space: nowrap;
}
.foot { margin-top: 36px; font-size: 13px; color: var(--ink-2); }
.foot p { margin: 4px 0; }

/* --- イベント画面 --- */
.decided { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 0 0 20px; font-size: clamp(24px, 5vw, 34px); font-weight: 900; line-height: 1.4; }
.decided-tag { font-size: 14px; background: var(--ink); color: var(--surface); padding: 2px 10px; letter-spacing: .1em; }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 20px; }
.share .hint { margin: 0; }
.welcome { border-top-color: var(--marker); border-top-width: 8px; }
.welcome h2 { margin-bottom: 12px; }
.welcome-warn { margin: 18px 0 8px; }
.welcome-warn b { font-weight: 900; }
.url-row { display: flex; gap: 8px; }
.url-row input { flex: 1; min-width: 0; font-size: 14px; }
.url-row button { flex: none; }

.board { padding: 20px 0 8px; }
.board .sheet-head { padding: 0 20px; }
.table-wrap { overflow-x: auto; border-top: 1px solid var(--line); -webkit-overflow-scrolling: touch; }
.grid { border-collapse: separate; border-spacing: 0; width: 100%; min-width: max-content; }
.grid th, .grid td { border-bottom: 1px solid var(--line); text-align: center; padding: 8px 6px; font-weight: 400; background: var(--surface); }
.grid thead th { font-size: 13px; color: var(--ink-2); vertical-align: bottom; }
.grid .col-label {
  position: sticky; left: 0; z-index: 1;
  text-align: left; padding-left: 20px; padding-right: 10px;
  width: 11em; min-width: 11em; max-width: 15em; white-space: normal;
  border-right: 2px solid var(--line-strong);
  font-weight: 900; color: var(--ink); line-height: 1.45;
  overflow-wrap: anywhere;
}
.grid thead .col-label { font-weight: 400; color: var(--ink-2); }
.col-n { width: 2.4em; font-size: 14px; }
.grid thead .col-n { font-weight: 900; font-size: 15px; }
.yes { color: var(--yes); }
.maybe { color: var(--maybe); }
.no { color: var(--no); }
.grid td.yes, .grid th.yes { color: var(--yes); }
.grid td.maybe, .grid th.maybe { color: var(--maybe); }
.grid td.no, .grid th.no { color: var(--no); }
.num { font-weight: 400; }
.grid td.yes.num { font-weight: 900; }
.mark { font-size: 20px; line-height: 1.2; font-weight: 900; min-width: 3.4em; }
.grid td.mark.blank { color: var(--ink-2); font-weight: 300; }
.col-person { min-width: 3.4em; }
.grid tr.best th, .grid tr.best td { background: var(--best-row); }
.grid tr.best .col-label .tag { color: var(--ink); }
.tag-decided { background: var(--ink); color: var(--surface) !important; border-color: var(--ink); }
.person {
  background: none; border: 0; padding: 2px 4px; min-height: 40px; max-width: 7em;
  font-size: 13px; color: var(--ink); text-decoration: underline; text-underline-offset: 3px;
  overflow-wrap: anywhere; line-height: 1.3;
}
.person.is-editing { background: var(--marker); color: var(--marker-ink); font-weight: 900; }
.comments { list-style: none; margin: 0; padding: 12px 20px; }
.comments li { display: grid; grid-template-columns: minmax(3em, max-content) minmax(0, 1fr); gap: 12px; padding: 4px 0; font-size: 14px; overflow-wrap: anywhere; }
.comments b { font-weight: 900; }

.bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin-bottom: 6px; }
.bulk .mini { margin: 0; }
.answer-rows { margin-bottom: 22px; border-top: 1px solid var(--line); }
.answer-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid var(--line);
}
.answer-label { flex: 1 1 auto; min-width: 0; font-weight: 900; line-height: 1.45; overflow-wrap: anywhere; }
.seg { display: flex; flex: none; }
.seg-item { position: relative; display: block; width: 52px; height: 48px; margin-left: -1px; cursor: pointer; }
.seg-item input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg-item span {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 100%;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 22px; font-weight: 900; line-height: 1;
}
.seg-item:hover span { border-color: var(--ink); }
.seg-item input:focus-visible + span { outline: 3px solid var(--yes); outline-offset: 1px; position: relative; z-index: 1; }
.seg-item.yes input:checked + span { background: var(--yes); border-color: var(--yes); color: var(--seg-on-ink); }
.seg-item.maybe input:checked + span { background: var(--maybe); border-color: var(--maybe); color: var(--seg-on-ink); }
.seg-item.no input:checked + span { background: var(--no); border-color: var(--no); color: var(--seg-on-ink); }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.form-actions .btn-main { flex: 1 1 220px; width: auto; }
.form-actions .btn-danger { flex: none; }

.admin-block { padding: 18px 0; border-top: 1px solid var(--line); }
.admin-block:first-of-type { border-top: 0; padding-top: 0; }
.admin-block .field { margin-bottom: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row select { flex: 1 1 240px; min-width: 0; }
.edit-choices { list-style: none; margin: 0 0 14px; padding: 0; }
.edit-choices li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.edit-choices button { flex: none; }
.noscript { padding: 16px; text-align: center; }

@media (max-width: 640px) {
  .sheet { padding: 16px; }
  .board { padding: 16px 0 8px; }
  .board .sheet-head { padding: 0 16px; }
  .picker { grid-template-columns: minmax(0, 1fr); }
  .time-row { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .time-row button { grid-column: 1 / -1; justify-self: start; }
  .grid .col-label { padding-left: 12px; width: 8.5em; min-width: 8.5em; max-width: 8.5em; font-size: 14px; }
  .col-n { width: 2em; padding-left: 2px !important; padding-right: 2px !important; }
  .comments { padding: 12px 16px; }
  .seg-item { width: 48px; }
}

/* 狭い幅では時計アイコンの分だけ時刻が切れる。押せば入力できるのでアイコンを外す */
@media (max-width: 400px) {
  .time-row input { padding-left: 8px; padding-right: 4px; letter-spacing: 0; }
  .time-row input::-webkit-calendar-picker-indicator { display: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise .5s cubic-bezier(.2, .7, .2, 1) both; }
  .rise:nth-of-type(2) { animation-delay: .08s; }
  .rise:nth-of-type(3) { animation-delay: .16s; }
  .rise:nth-of-type(4) { animation-delay: .24s; }
  .hero .marker { animation: sweep .6s .35s cubic-bezier(.2, .7, .2, 1) both; }
  @keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
  @keyframes sweep { from { background-size: 0 100%; } to { background-size: 100% 100%; } }
}
