:root {
  --bg: #f6f3ec;
  --surface: #ffffff;
  --surface-2: #f3efe6;
  --ink: #1f1c17;
  --muted: #6f695e;
  --faint: #a49d90;
  --line: #e7e1d5;
  --line-strong: #d3cbbb;
  --accent: #5b4bdb;
  --accent-ink: #ffffff;
  --accent-soft: #ebe8fc;
  --mine-rgb: 91 75 219;
  --heat-rgb: 16 163 127;
  --heat-ink: #0b6b54;
  --cell: #f7f4ee;
  --danger: #c2410c;
  --shadow: 0 1px 2px rgb(31 28 23 / .05), 0 8px 24px -12px rgb(31 28 23 / .12);
  --radius: 18px;
  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --body: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12110f; --surface: #1b1a17; --surface-2: #23211d; --ink: #f2eee6; --muted: #a39d91; --faint: #6e685e;
    --line: #2e2b26; --line-strong: #403c35; --accent: #8b7ff0; --accent-ink: #12110f; --accent-soft: #2a2645;
    --mine-rgb: 139 127 240; --heat-rgb: 45 212 160; --heat-ink: #5ee3b7; --cell: #201e1b; --danger: #fb923c;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px -12px rgb(0 0 0 / .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12110f; --surface: #1b1a17; --surface-2: #23211d; --ink: #f2eee6; --muted: #a39d91; --faint: #6e685e;
  --line: #2e2b26; --line-strong: #403c35; --accent: #8b7ff0; --accent-ink: #12110f; --accent-soft: #2a2645;
  --mine-rgb: 139 127 240; --heat-rgb: 45 212 160; --heat-ink: #5ee3b7; --cell: #201e1b; --danger: #fb923c;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px -12px rgb(0 0 0 / .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink); font: 15px/1.5 var(--body);
  -webkit-font-smoothing: antialiased; min-height: 100vh; overflow-x: hidden;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 700 21px/1 var(--display); letter-spacing: -.02em; }
.logo svg { width: 30px; height: 30px; }
.ghost-btn { background: none; border: 1px solid var(--line-strong); border-radius: 999px; padding: 7px 14px; font-weight: 500; font-size: 14px; text-decoration: none; transition: background .15s; }
.ghost-btn:hover { background: var(--surface-2); }

/* create */
.hero { padding: 28px 0 24px; text-align: center; }
.hero h1 { font: 800 clamp(36px, 7vw, 64px)/1.02 var(--display); letter-spacing: -.035em; margin: 0 auto 14px; max-width: 14ch; }
.hero h1 em { font-style: normal; background: linear-gradient(100deg, rgb(var(--mine-rgb)) 10%, rgb(var(--heat-rgb)) 90%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); font-size: 17px; margin: 0 auto; max-width: 44ch; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.create { max-width: 640px; margin: 8px auto 48px; padding: 24px; }
@media (min-width: 720px) { .create { padding: 32px; } }
.field { margin-bottom: 24px; }
.label { display: flex; align-items: baseline; justify-content: space-between; font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.label small { font-weight: 400; color: var(--muted); font-size: 13px; }
.input, .select {
  width: 100%; background: var(--surface-2); border: 1px solid transparent; border-radius: 12px;
  padding: 12px 14px; outline: none; transition: border-color .15s, background .15s;
}
.input:focus, .select:focus { border-color: var(--accent); background: var(--surface); }
.input.big { font: 600 20px/1.3 var(--display); letter-spacing: -.01em; padding: 14px 16px; }
.select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%23888' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }

.seg { display: inline-flex; background: var(--surface-2); border-radius: 12px; padding: 4px; gap: 2px; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 9px; font-weight: 500; font-size: 14px; color: var(--muted); transition: all .15s; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / .1); }
.seg.full { display: flex; } .seg.full button { flex: 1; }

.cal { margin-top: 12px; user-select: none; -webkit-user-select: none; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-head strong { font: 600 16px var(--display); }
.icon-btn { width: 34px; height: 34px; border-radius: 10px; border: 0; background: none; display: grid; place-items: center; color: var(--muted); }
.icon-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { text-align: center; font-size: 12px; color: var(--faint); font-weight: 600; padding: 4px 0; }
.day {
  height: 44px; border: 0; border-radius: 10px; background: none; font-weight: 500; font-size: 14px;
  touch-action: none; transition: background .1s, color .1s, transform .1s;
}
.day:hover:not(:disabled) { background: var(--surface-2); }
.day.today { box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.day.on { background: var(--accent); color: var(--accent-ink); }
.day:disabled { color: var(--faint); opacity: .45; cursor: default; }
.day.blank { visibility: hidden; }
.hint { font-size: 13px; color: var(--muted); margin-top: 8px; min-height: 20px; }

.dows { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 12px; }
.dows button { border: 1px solid var(--line); background: var(--surface); padding: 12px 0; border-radius: 12px; font-weight: 600; font-size: 14px; transition: all .12s; }
.dows button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row .select { flex: 1; min-width: 120px; }
.row .to { color: var(--muted); font-size: 14px; }

.primary {
  width: 100%; border: 0; background: var(--ink); color: var(--bg); border-radius: 14px; padding: 15px 20px;
  font: 600 16px var(--display); display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .12s, opacity .15s;
}
.primary:hover:not(:disabled) { transform: translateY(-1px); }
.primary:disabled { opacity: .35; cursor: default; }
.error { color: var(--danger); font-size: 14px; margin-top: 10px; min-height: 1px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 640px; margin: 0 auto 64px; }
.steps div { text-align: center; font-size: 13px; color: var(--muted); }
.steps b { display: grid; place-items: center; width: 28px; height: 28px; margin: 0 auto 6px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); color: var(--ink); font-family: var(--display); }

/* event */
.ev-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 12px 0 22px; }
.ev-head h1 { font: 800 clamp(28px, 5vw, 44px)/1.05 var(--display); letter-spacing: -.03em; margin: 0 0 6px; overflow-wrap: anywhere; }
.meta { color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.share { display: flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 5px 5px 5px 14px; max-width: 100%; min-width: 0; }
.share code { font: 500 13px var(--body); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.share button { border: 0; background: var(--accent); color: var(--accent-ink); border-radius: 10px; padding: 8px 14px; font-weight: 600; font-size: 14px; white-space: nowrap; }

.panels { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .panels { grid-template-columns: 1fr 1fr; } }
.panel { padding: 20px; min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; min-height: 36px; flex-wrap: wrap; }
.panel-head h2 { font: 700 18px var(--display); letter-spacing: -.01em; margin: 0; display: flex; align-items: center; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.status { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.status.err { color: var(--danger); }
.link-btn { background: none; border: 0; padding: 0; color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--ink); }

.namebox { display: flex; gap: 8px; margin-bottom: 14px; }
.namebox .input { flex: 1; min-width: 0; }
.namebox button { border: 0; background: var(--accent); color: var(--accent-ink); border-radius: 12px; padding: 0 18px; font-weight: 600; white-space: nowrap; }
.mybody { margin-bottom: 14px; }
.name-error { color: var(--danger); font-size: 13px; margin: -6px 0 10px; }
.name-error:empty { display: none; }
@media (min-width: 900px) { .mybody { min-height: 76px; } }
.greet { font-size: 14px; color: var(--muted); margin: 0; }
.namebox + .greet { margin-top: -6px; font-size: 13px; }
.greet b { color: var(--ink); }

.scroller { overflow-x: auto; overscroll-behavior-x: contain; padding-bottom: 4px; }
.grid { display: grid; user-select: none; -webkit-user-select: none; position: relative; min-width: max-content; }
.grid.locked { opacity: .4; pointer-events: none; filter: saturate(.4); }
.colhead { text-align: center; padding: 0 2px 8px; line-height: 1.2; position: sticky; top: 0; }
.colhead small { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.colhead span { font: 600 14px var(--display); }
.tlabel { font-size: 11px; color: var(--muted); text-align: right; padding-right: 8px; white-space: nowrap; font-variant-numeric: tabular-nums; position: sticky; left: 0; z-index: 2; background: var(--surface); overflow: visible; }
.tlabel span { display: block; transform: translateY(-.65em); }
.grid > :first-child { position: sticky; left: 0; z-index: 2; background: var(--surface); }
.cell { background: var(--cell); border-left: 1px solid var(--surface); border-top: 1px dashed var(--line); touch-action: none; }
.cell.hr { border-top: 1px solid var(--line-strong); }
.cell.last-row { border-bottom: 1px solid var(--line-strong); }
.cell.first-col { border-left: 0; }
.cell.top-left { border-top-left-radius: 8px; } .cell.top-right { border-top-right-radius: 8px; }
.cell.bot-left { border-bottom-left-radius: 8px; } .cell.bot-right { border-bottom-right-radius: 8px; }
.mine .cell { cursor: pointer; transition: background .06s; }
.mine .cell.on { background: rgb(var(--mine-rgb) / .9); border-top-color: rgb(255 255 255 / .18); }
.mine .cell:hover:not(.on) { background: rgb(var(--mine-rgb) / .15); }
.heat .cell { touch-action: auto; background-color: var(--cell); background-image: linear-gradient(rgb(var(--heat-rgb) / var(--a, 0)), rgb(var(--heat-rgb) / var(--a, 0))); }
.heat .cell.all { background-image: linear-gradient(var(--heat-ink), var(--heat-ink)); }
.heat .cell.hover { outline: 2px solid var(--ink); outline-offset: -1px; z-index: 1; position: relative; }

.info { min-height: 76px; background: var(--surface-2); border-radius: 12px; padding: 10px 12px; margin-bottom: 14px; font-size: 13px; }
.info .when { font-weight: 600; font-size: 14px; display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.info .when span { color: var(--heat-ink); }
.names { display: flex; flex-wrap: wrap; gap: 4px; }
.names span { padding: 2px 8px; border-radius: 999px; font-size: 12px; background: var(--surface); border: 1px solid var(--line); }
.names span.yes { background: rgb(var(--heat-rgb) / .16); border-color: transparent; color: var(--heat-ink); font-weight: 500; }
.names span.no { color: var(--faint); text-decoration: line-through; }
.info .empty { color: var(--muted); display: flex; align-items: center; height: 56px; }

.legend { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.legend .bar { width: 90px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--cell), rgb(var(--heat-rgb))); border: 1px solid var(--line); }

.below { display: grid; gap: 18px; grid-template-columns: 1fr; margin: 18px 0 56px; }
@media (min-width: 900px) { .below { grid-template-columns: 1fr 1fr; } }
.below h3 { font: 700 16px var(--display); margin: 0 0 12px; display: flex; gap: 8px; }
.below { align-items: start; }
.best { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.best li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 14px; }
.best li b { font-weight: 600; }
.best li .t { color: var(--muted); }
.pill { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: rgb(var(--heat-rgb) / .16); color: var(--heat-ink); white-space: nowrap; }
.muted { color: var(--muted); font-size: 14px; margin: 0; }
.people { display: flex; flex-wrap: wrap; gap: 6px; }
.person { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 6px; border-radius: 999px; background: var(--surface-2); border: 1px solid transparent; font-size: 14px; font-weight: 500; transition: all .12s; }
.person i { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 600 11px var(--body); font-style: normal; color: #fff; }
.person.off { opacity: .45; text-decoration: line-through; }
.person.me { border-color: rgb(var(--mine-rgb) / .5); }
.people-note { font-size: 12px; color: var(--muted); margin-top: 10px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 12px; font-weight: 500; font-size: 14px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 10; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.center { text-align: center; padding: 80px 0; }
.center h1 { font: 800 36px var(--display); letter-spacing: -.03em; margin: 0 0 8px; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
footer { text-align: center; color: var(--faint); font-size: 13px; padding: 0 0 32px; }
footer a { color: var(--muted); }

/* about / SEO content (home only) */
.eyebrow { display: inline-block; font-size: 13px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 5px 12px; border-radius: 999px; margin-bottom: 18px; }
.about { max-width: 860px; margin: 0 auto 72px; }
.about h2 { font: 800 clamp(26px, 4vw, 34px)/1.1 var(--display); letter-spacing: -.025em; margin: 0 0 8px; text-align: center; }
.about .sub { text-align: center; color: var(--muted); margin: 0 auto 28px; max-width: 52ch; }
.about section { margin-bottom: 64px; }
.features { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .features { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .features { grid-template-columns: 1fr 1fr 1fr; } }
.feature { padding: 20px; }
.feature h3 { font: 700 16px var(--display); margin: 0 0 6px; }
.feature p { margin: 0; color: var(--muted); font-size: 14px; }
.feature .ic { font-size: 22px; display: block; margin-bottom: 10px; }
.compare { width: 100%; border-collapse: collapse; font-size: 14px; }
.compare-wrap { padding: 8px 20px; overflow-x: auto; }
.compare th, .compare td { padding: 12px 8px; text-align: left; border-bottom: 1px solid var(--line); }
.compare tr:last-child td { border-bottom: 0; }
.compare th { font: 700 14px var(--display); }
.compare td:not(:first-child), .compare th:not(:first-child) { text-align: center; white-space: nowrap; }
.compare .y { color: var(--heat-ink); font-weight: 600; }
.compare .n { color: var(--faint); }
.faq details { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.faq details:last-child { border-bottom: 0; }
.faq summary { font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-weight: 400; font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 10px 0 0; color: var(--muted); }
.cta { text-align: center; }
.cta a { display: inline-flex; width: auto; padding: 14px 28px; text-decoration: none; }
