:root {
  --bg: #F3F5F8;
  --surface: #FFFFFF;
  --surface-2: #F7F8FB;
  --ink: #18233D;
  --ink-2: #56617A;
  --line: #DCE1EA;
  --line-strong: #C3CAD7;
  --yes: #1F9D6A;
  --yes-ink: #FFFFFF;
  --maybe: #F2B01E;
  --maybe-2: #F8CF6A;
  --best: #FFF4D2;
  --best-edge: #E9A800;
  --accent: #18233D;
  --accent-hover: #26365C;
  --accent-ink: #FFFFFF;
  --danger: #B93A26;
  --focus: #3D6FE0;
  --radius: 12px;
  --display: 'Bricolage Grotesque', 'PingFang SC', 'Hiragino Sans GB', 'Noto Sans SC', 'Microsoft YaHei', system-ui, sans-serif;
  --body: 'Public Sans', 'PingFang SC', 'Hiragino Sans GB', 'Noto Sans SC', 'Microsoft YaHei', system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10151F;
    --surface: #171E2B;
    --surface-2: #1C2433;
    --ink: #E8ECF3;
    --ink-2: #9AA6BA;
    --line: #2A3446;
    --line-strong: #3A4660;
    --yes: #2FB57F;
    --yes-ink: #0B1A13;
    --maybe: #F2B93A;
    --maybe-2: #9C7A28;
    --best: rgba(242, 185, 58, 0.11);
    --best-edge: #F2B93A;
    --accent: #E8ECF3;
    --accent-hover: #FFFFFF;
    --accent-ink: #10151F;
    --danger: #F07D68;
    --focus: #7FA4FF;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
}
h1, h2 { font-family: var(--display); line-height: 1.12; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 4.6vw, 3.1rem); font-weight: 800; }
h2 { font-size: 1.25rem; font-weight: 700; }
p { margin: 0; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; z-index: 10; background: var(--surface); padding: 6px 10px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px 72px; }
.top { display: flex; align-items: center; justify-content: space-between; padding: 18px 0 22px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 1.12rem; }
.brand-mark { width: 26px; height: 26px; color: var(--ink); display: inline-flex; }
.brand-mark svg { width: 100%; height: 100%; }
.mode-banner { background: var(--best); border: 1px solid var(--best-edge); border-radius: 10px; padding: 10px 14px; font-size: 0.9rem; margin-bottom: 20px; }

.muted { color: var(--ink-2); }
.small { font-size: 0.875rem; }
.block { display: block; }

/* ---------- buttons & inputs ---------- */
.primary, .ghost-btn, .danger-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 10px; padding: 10px 18px; font-weight: 600; cursor: pointer; text-decoration: none;
  border: 1px solid transparent; min-height: 44px; transition: background-color .15s, border-color .15s;
}
.primary { background: var(--accent); color: var(--accent-ink); }
.primary:hover:not(:disabled) { background: var(--accent-hover); }
.primary:disabled { opacity: .6; cursor: progress; }
.primary.small { min-height: 34px; padding: 5px 14px; font-size: 0.875rem; border-radius: 8px; }
.ghost-btn { background: var(--surface); border-color: var(--line-strong); }
.ghost-btn:hover { border-color: var(--ink-2); }
.ghost-btn.done { border-color: var(--yes); color: var(--yes); }
.danger-btn { background: transparent; border-color: var(--danger); color: var(--danger); }
.danger-btn:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); }
.link-btn { background: none; border: 0; padding: 2px 4px; color: var(--ink-2); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font-size: 0.85rem; }
.link-btn:hover { color: var(--ink); }
.link-btn.danger { color: var(--ink-2); }
.link-btn.danger:hover, .link-btn.danger.armed { color: var(--danger); }
.icon-btn { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 1.15rem; line-height: 1; flex: none; }
.icon-btn:hover:not(:disabled) { border-color: var(--ink-2); }
.icon-btn:disabled { opacity: .35; cursor: default; }

input:not([type=checkbox]), textarea, select {
  width: 100%; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 9px;
  padding: 10px 12px; min-height: 44px;
}
textarea { resize: vertical; min-height: 80px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.field { display: grid; gap: 6px; }
.field label, .share-row > label, .admin-block > label { font-weight: 600; font-size: 0.92rem; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.error { color: var(--danger); font-weight: 500; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }

/* ---------- home ---------- */
.home { display: grid; gap: 36px; }
.home-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: 48px; align-items: start; padding-top: 8px; }
.hero { display: grid; gap: 16px; align-content: start; }
.hero h1 { max-width: 16ch; }
.lede { font-size: 1.08rem; color: var(--ink-2); max-width: 46ch; }
.hero-side { display: grid; gap: 20px; }

.sample {
  display: inline-grid; gap: 6px; padding: 16px 18px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); justify-self: start;
}
.sample-row { display: grid; grid-template-columns: 52px repeat(3, 44px); align-items: center; gap: 4px; }
.sample-row > span { display: flex; justify-content: center; align-items: center; height: 32px; border-radius: 6px; }
.sample-row.head > span { font-size: 0.8rem; font-weight: 600; color: var(--ink-2); height: 24px; }
.sample-row .nm { justify-content: flex-start; font-size: 0.85rem; }
.sample-row .best { background: var(--best); }
.sample-row.head .best { color: var(--ink); box-shadow: inset 0 3px 0 var(--best-edge); border-radius: 6px 6px 0 0; }
.sample .mark { width: 22px; height: 22px; border-radius: 5px; }

.recent h2 { font-size: 1.05rem; margin-bottom: 8px; }
.recent ul { list-style: none; margin: 0; padding: 0; display: grid; }
.recent li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.recent a { font-weight: 500; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent a:hover { text-decoration: underline; }
.role { font-size: 0.78rem; color: var(--ink-2); flex: none; }
.role.admin { color: var(--yes); font-weight: 600; }

.create { display: grid; gap: 18px; }
.create > .panel { display: grid; gap: 16px; }
.details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.details-grid .wide { grid-column: 1 / -1; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.kind-switch { font-size: 0.875rem; }
.settings .deadline { max-width: 320px; }
.submit-row { display: grid; gap: 10px; justify-items: start; }
.submit-row .primary { min-width: 200px; font-size: 1.02rem; }

.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; justify-self: start; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 8px; cursor: pointer; font-weight: 500; color: var(--ink-2); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(16, 24, 40, .12); }
.seg.small button { padding: 5px 12px; font-size: 0.9rem; }

/* calendar toolbar */
.cal-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-range { font-family: var(--display); font-size: 1.05rem; margin-left: 6px; white-space: nowrap; }
.today-btn { min-height: 36px; padding: 4px 12px; font-weight: 500; }
.dur { display: flex; align-items: center; gap: 8px; }
.dur label { font-weight: 600; font-size: 0.9rem; }
.dur select { width: auto; min-height: 36px; padding: 4px 30px 4px 10px; }
.custom-dur { display: inline-flex; align-items: center; gap: 6px; }
.custom-dur input { width: 80px; min-height: 36px; padding: 4px 8px; }
.tz { margin-left: auto; }

.times-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 18px; align-items: start; }

/* week grid */
.wk { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); user-select: none; -webkit-user-select: none; }
.wk-row { display: grid; grid-template-columns: 54px repeat(var(--n, 7), minmax(0, 1fr)); }
.wk-gut { border-right: 1px solid var(--line); }
.wk-day {
  border: 0; border-left: 1px solid var(--line); background: transparent; padding: 8px 2px 6px;
  display: grid; justify-items: center; gap: 2px; color: inherit; cursor: default;
}
.wk-head .wk-day:first-of-type { border-left: 0; }
.wk-day .wd { font-size: 0.74rem; color: var(--ink-2); font-weight: 600; }
.wk-day .dn { font-family: var(--display); font-size: 1.3rem; font-weight: 700; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; font-variant-numeric: tabular-nums; }
.wk-day.today .dn { background: var(--ink); color: var(--bg); }
.wk-day.past { opacity: .4; }
.wk-day.pickable:not(:disabled) { cursor: pointer; }
.wk-day.pickable:not(:disabled):hover { background: var(--surface-2); }
.wk-allday { border-top: 1px solid var(--line); min-height: 34px; }
.wk-allday .wk-gut { display: flex; align-items: center; justify-content: flex-end; padding-right: 6px; font-size: 0.68rem; color: var(--ink-2); text-align: right; line-height: 1.1; }
.wk-adcell { border-left: 1px solid var(--line); padding: 3px; display: grid; gap: 3px; align-content: start; }
.wk-gut + .wk-adcell { border-left: 0; }
.wk-adcell.pickable { cursor: pointer; }
.wk-adcell.pickable:hover { background: var(--surface-2); }
.wk-chip {
  display: flex; align-items: center; justify-content: space-between; gap: 2px;
  background: var(--yes); color: var(--yes-ink); border-radius: 6px; font-size: 0.74rem; font-weight: 600; padding: 2px 2px 2px 7px;
}
.wk-chip button { border: 0; background: transparent; color: inherit; width: 20px; height: 20px; border-radius: 4px; cursor: pointer; line-height: 1; }
.wk-chip button:hover { background: rgba(255, 255, 255, .25); }
.wk-scroll { height: 520px; overflow-y: auto; border-top: 1px solid var(--line-strong); overscroll-behavior: contain; }
.wk-body { position: relative; }
.wk-hours { position: relative; }
.wk-hours span { position: absolute; right: 6px; transform: translateY(-50%); font-size: 0.68rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.wk-col {
  position: relative; border-left: 1px solid var(--line); cursor: cell; touch-action: pan-y;
  background-image:
    linear-gradient(to bottom, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--line) 45%, transparent) 1px, transparent 1px);
  background-size: 100% 44px, 100% 22px;
}
.wk-gut + .wk-col { border-left: 0; }
.wk-col.today { background-color: color-mix(in srgb, var(--focus) 4%, transparent); }
.wk-col.allday-mode { cursor: pointer; }
.wk-past {
  position: absolute; left: 0; right: 0; top: 0; pointer-events: none;
  background: repeating-linear-gradient(-45deg, transparent 0 6px, color-mix(in srgb, var(--line) 55%, transparent) 6px 8px);
}
.wk-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); pointer-events: none; z-index: 2; }
.wk-now::before { content: ''; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.wk-block {
  position: absolute; left: 3px; right: 3px; z-index: 1; overflow: hidden;
  background: var(--yes); color: var(--yes-ink); border-radius: 6px; padding: 3px 20px 3px 6px;
  font-size: 0.74rem; font-weight: 600; line-height: 1.2; cursor: grab;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .18);
}
.wk-block.short { padding-top: 0; padding-bottom: 0; display: flex; align-items: center; font-size: 0.66rem; }
.wk-block.dragging { cursor: grabbing; opacity: .9; z-index: 3; box-shadow: 0 6px 16px rgba(16, 24, 40, .25); }
.wk-block.preview { background: color-mix(in srgb, var(--yes) 30%, transparent); color: var(--ink); border: 2px dashed var(--yes); box-shadow: none; pointer-events: none; }
.wk-time { font-variant-numeric: tabular-nums; overflow-wrap: normal; }
.wk-block.short .wk-time { white-space: nowrap; }
.wk-x {
  position: absolute; top: 1px; right: 1px; width: 18px; height: 18px; border: 0; border-radius: 4px;
  background: transparent; color: inherit; cursor: pointer; font-size: 15px; line-height: 1; padding: 0;
}
.wk-x:hover { background: rgba(255, 255, 255, .28); }
.wk-block.short .wk-x { top: 50%; transform: translateY(-50%); height: 16px; }
.wk-resize { position: absolute; left: 0; right: 0; bottom: 0; height: 7px; cursor: ns-resize; }
@media (hover: hover) { .wk-block.short .wk-x { opacity: 0; } .wk-block.short:hover .wk-x { opacity: 1; } }

/* month grid */
.mo { border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: var(--surface); }
.mo-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.mo-wd { text-align: center; font-size: 0.74rem; font-weight: 600; color: var(--ink-2); padding: 4px 0; }
.mo-day {
  min-height: 72px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: 6px 7px;
  cursor: pointer; text-align: left; font-variant-numeric: tabular-nums;
}
.mo-day:hover:not(:disabled) { border-color: var(--ink-2); }
.mo-num { font-weight: 600; }
.mo-day.today .mo-num { text-decoration: underline; text-underline-offset: 3px; }
.mo-day.on { background: color-mix(in srgb, var(--yes) 14%, var(--surface)); border-color: var(--yes); }
.mo-count { font-size: 0.7rem; font-weight: 600; color: var(--yes); }
.mo-day:disabled { color: var(--line-strong); background: transparent; border-color: transparent; cursor: default; }

/* selected list */
.sel-panel { border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: var(--surface-2); display: grid; gap: 12px; align-content: start; max-height: 640px; overflow: hidden auto; min-width: 0; }
.sel-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.sel-day { display: grid; gap: 6px; }
.sel-day + .sel-day { border-top: 1px solid var(--line); padding-top: 10px; }
.sel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.sel-date { font-weight: 600; font-size: 0.9rem; }
.sel-entry { display: flex; align-items: center; gap: 6px; }
.sel-entry .time-sel { min-height: 34px; padding: 4px 24px 4px 8px; font-size: 0.875rem; flex: 1; min-width: 0; width: auto; font-variant-numeric: tabular-nums; }
.sel-allday { flex: 1; font-size: 0.875rem; background: var(--yes); color: var(--yes-ink); border-radius: 6px; padding: 6px 10px; font-weight: 600; }
.icon-btn.sm { width: 30px; height: 30px; font-size: 1rem; }

.text-opts { display: grid; gap: 8px; max-width: 560px; }
.text-opt { display: flex; gap: 6px; align-items: center; }
.text-opts .ghost-btn { justify-self: start; min-height: 38px; padding: 6px 14px; font-weight: 500; }
.count { font-size: 0.875rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--yes); flex: none; }

/* ---------- vote marks ---------- */
.mark { display: inline-block; width: 30px; height: 30px; border-radius: 7px; vertical-align: middle; flex: none; }
.mark.v-y {
  background: var(--yes) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 64% no-repeat;
}
.mark.v-m {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2318233D' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6.5 12.5l3.6 3.6L17.5 8.5'/%3E%3C/svg%3E") center / 62% no-repeat,
    repeating-linear-gradient(-45deg, var(--maybe) 0 5px, var(--maybe-2) 5px 8px);
}
.mark.v-n { box-shadow: inset 0 0 0 2px var(--line); position: relative; }
.mark.v-n::after {
  content: ''; position: absolute; inset: 0; margin: auto; width: 8px; height: 2px; border-radius: 2px; background: var(--line-strong);
}

/* ---------- poll page ---------- */
.poll-page { display: grid; gap: 22px; }
.poll-head { display: grid; gap: 10px; max-width: 72ch; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 22px; color: var(--ink); font-size: 0.95rem; }
.meta .loc::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--ink-2); margin-right: 8px; }
.desc { white-space: pre-wrap; color: var(--ink-2); }

.notice { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--ink-2); border-radius: 10px; padding: 12px 16px; font-weight: 500; }
.final {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--yes); border-radius: 12px; padding: 16px 20px;
}
.final-label { display: block; font-size: 0.85rem; color: var(--ink-2); }
.final-value { font-family: var(--display); font-size: 1.35rem; }
.final-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.875rem; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .mark { width: 18px; height: 18px; border-radius: 4px; }
.legend .mark.v-n::after { width: 6px; }
.toolbar .hint { flex-basis: 100%; }

.grid-wrap {
  overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
}
.grid { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; }
.grid th, .grid td { padding: 0; border-bottom: 1px solid var(--line); }
.grid thead th { border-bottom: 1px solid var(--line-strong); vertical-align: bottom; }
.grid tfoot th, .grid tfoot td { border-bottom: 0; border-top: 1px solid var(--line-strong); }
.grid .corner, .grid tbody th, .grid tfoot th {
  position: sticky; left: 0; z-index: 2; background: var(--surface); text-align: left;
  width: 210px; min-width: 170px; max-width: 240px; padding: 10px 14px; border-right: 1px solid var(--line);
}
.grid .corner { font-weight: 600; font-size: 0.875rem; color: var(--ink-2); vertical-align: bottom; }
.opt { width: 76px; min-width: 76px; padding: 12px 6px 10px !important; text-align: center; font-weight: 400; }
.opt > span { display: block; }
.o-month { font-size: 0.75rem; color: var(--ink-2); }
.o-day { font-family: var(--display); font-size: 1.7rem; font-weight: 700; line-height: 1.05; font-variant-numeric: tabular-nums; }
.o-wd { font-size: 0.8rem; font-weight: 600; }
.o-time { font-size: 0.74rem; color: var(--ink-2); margin-top: 4px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.opt-text { font-weight: 600; font-size: 0.9rem; max-width: 140px; white-space: normal; overflow-wrap: anywhere; line-height: 1.3; }
.opt:has(.opt-text) { width: auto; min-width: 96px; max-width: 160px; }
.grid .is-best { background: var(--best); }
.grid thead .is-best { box-shadow: inset 0 4px 0 var(--best-edge); }
.grid .is-final { background: color-mix(in srgb, var(--yes) 14%, var(--surface)); }
.grid thead .is-final { box-shadow: inset 0 4px 0 var(--yes); }

.cell { text-align: center; height: 52px; }
.grid tbody th { font-weight: 500; }
.grid tbody th .nm { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid tr.mine th .nm::after { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--yes); margin-left: 8px; vertical-align: middle; }
.row-tools { display: flex; gap: 8px; margin-left: -4px; }
.grid tbody tr:not(.editing):hover th, .grid tbody tr:not(.editing):hover td:not(.is-best):not(.is-final) { background: var(--surface-2); }

tr.editing th, tr.editing td { background: color-mix(in srgb, var(--focus) 6%, var(--surface)); }
tr.editing td.is-best { background: color-mix(in srgb, var(--focus) 5%, var(--best)); }
tr.editing th { vertical-align: top; }
tr.editing th input { min-height: 38px; padding: 7px 10px; }
.row-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.vote {
  width: 48px; height: 48px; margin: 6px auto; display: flex; align-items: center; justify-content: center;
  border: 0; background: transparent; border-radius: 10px; cursor: pointer; transition: transform .08s;
}
.vote:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.vote:active { transform: scale(.92); }
.vote .mark { width: 36px; height: 36px; border-radius: 8px; }
.vote.v-n .mark { box-shadow: inset 0 0 0 2px var(--line-strong); }

.totals th { font-weight: 600; font-size: 0.875rem; }
.totals td { text-align: center; padding: 8px 4px 10px !important; vertical-align: top; }
.cnt { font-family: var(--display); font-size: 1.2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.cnt-m { font-size: 0.78rem; color: var(--ink-2); margin-left: 3px; }
.best-tag { display: block; font-size: 0.68rem; font-weight: 600; color: var(--ink); line-height: 1.2; margin-top: 2px; }
.tz { margin-top: -12px; }

.share { display: grid; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.share.fresh { border-color: var(--yes); box-shadow: 0 0 0 3px color-mix(in srgb, var(--yes) 18%, transparent); }
.fresh-msg { font-weight: 600; color: var(--yes); }
.share-row { display: grid; gap: 6px; }
.copy { display: flex; gap: 8px; }
.copy input { font-size: 0.9rem; color: var(--ink-2); }
.copy .ghost-btn { flex: none; }
.share-row.admin { padding-top: 14px; border-top: 1px dashed var(--line-strong); }

.admin { display: grid; gap: 18px; }
.admin-block { display: grid; gap: 8px; justify-items: start; }
.admin-block + .admin-block { border-top: 1px solid var(--line); padding-top: 16px; }
.admin-block .field { width: 100%; }
.inline { display: flex; gap: 8px; width: 100%; flex-wrap: wrap; }
.inline select { flex: 1 1 260px; }
details.admin-block summary { cursor: pointer; font-weight: 600; }
details.admin-block[open] { gap: 12px; }

.loading, .empty { padding: 60px 0; text-align: center; color: var(--ink-2); display: grid; gap: 18px; justify-items: center; }
.error-block { color: var(--danger); padding: 40px 0; }

.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 50; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 10px; font-weight: 500; box-shadow: 0 6px 20px rgba(16, 24, 40, .25); animation: toast-in .2s ease-out; transition: opacity .3s, transform .3s; }
.toast.warn { background: var(--danger); color: #fff; }
.toast.out { opacity: 0; transform: translateY(6px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- small screens ---------- */
@media (max-width: 980px) {
  .times-layout { grid-template-columns: 1fr; }
  .sel-panel { max-height: none; }
}
@media (max-width: 900px) {
  .home-top { grid-template-columns: 1fr; gap: 24px; }
  .hero h1 { max-width: none; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px 56px; }
  .panel { padding: 20px 16px; }
  .details-grid { grid-template-columns: 1fr; }
  .tz { margin-left: 0; flex-basis: 100%; }
  .wk-scroll { height: 440px; }
  .wk-row { grid-template-columns: 46px repeat(var(--n, 3), minmax(0, 1fr)); }
  .mo { padding: 6px; }
  .mo-grid { gap: 3px; }
  .mo-day { min-height: 52px; padding: 4px 5px; }
  .mo-count { font-size: 0.62rem; }
  .grid .corner, .grid tbody th, .grid tfoot th { width: 128px; min-width: 128px; max-width: 128px; padding: 8px 10px; }
  .opt { width: 64px; min-width: 64px; }
  .vote { width: 44px; height: 44px; }
  .vote .mark { width: 32px; height: 32px; }
  .row-actions { flex-wrap: wrap; }
  .copy { flex-direction: column; }
  .share { padding: 16px; }
  .sample { justify-self: stretch; }
}
