@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=Instrument+Sans:wght@400;500;600;700&display=swap");

:root {
  --bg: #0e0f0c;
  --bg-elev: #171910;
  --ink: #f4f4ec;
  --muted: #8e9084;
  --line: #2c2e26;
  --acid: #dffb3a;
  --ink-on-acid: #15170c;
  --hot: #ff4d2a;
  --sans: "Instrument Sans", "Avenir Next", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  background:
    radial-gradient(880px 420px at 110% -12%, rgba(223, 251, 58, 0.09), transparent 52%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.4;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: var(--acid); color: var(--ink-on-acid); }
:focus-visible { outline: 2px solid var(--acid); outline-offset: 2px; }

.wrap {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 80px;
}
.wrap.narrow { width: min(720px, calc(100% - 32px)); }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.brand {
  color: var(--acid);
  font-weight: 700;
  letter-spacing: -0.07em;
  text-decoration: none;
  font-size: 22px;
}
.domain {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

h1 {
  font-size: clamp(48px, 8vw, 84px);
  line-height: 0.9;
  letter-spacing: -0.065em;
  font-weight: 700;
  margin: 28px 0 10px;
}
.sub { margin: 0 0 28px; color: var(--muted); font-size: 18px; }
.hint, .muted { color: var(--muted); }
.hint { margin: 8px 0 0; font-size: 14px; }
.k, .label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.label { margin-bottom: 8px; }
.err { color: var(--hot); min-height: 1.2em; margin: 0; font-size: 14px; }
.status {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  min-width: 9ch;
}

.stack { display: grid; gap: 16px; }
.block { display: grid; gap: 8px; }
.quick, .days, .times, .row, .shareline, .namerow, .restore {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.times { align-items: end; }
.namerow, .shareline, .restore { flex-wrap: nowrap; }
.namerow input, .shareline input, .restore input { flex: 1; min-width: 0; }

input, select {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 12px;
  width: 100%;
  font-size: 16px;
}
input:focus, select:focus { border-color: var(--acid); outline: none; }
input.bad { border-color: var(--hot); }
select { width: auto; min-width: 7.5rem; }
.shareurl {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
}
.shareline { align-items: center; }

button.primary, a.primary {
  appearance: none;
  border: 0;
  background: var(--acid);
  color: var(--ink-on-acid);
  font-weight: 700;
  letter-spacing: -0.03em;
  padding: 14px 18px;
  font-size: 16px;
  text-decoration: none;
  display: inline-block;
}
button.primary { width: 100%; }
button.primary:hover, a.primary:hover { background: #e9ff6a; }
button.primary:disabled { opacity: 0.55; cursor: wait; }
@media (min-width: 720px) {
  button.primary { width: auto; min-width: 180px; }
}

button.tiny, button.ghost, button.slim {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 8px 10px;
}
button.tiny { color: var(--muted); font-size: 13px; padding: 6px 8px; }
button.tiny:hover, button.ghost:hover { border-color: var(--ink); color: var(--ink); }
button.slim { padding: 6px 8px; font-size: 13px; }
button.slim:disabled { opacity: 0.45; cursor: default; }
button.linkish {
  background: none;
  border: 0;
  padding: 8px 0 0;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
button.danger { color: var(--hot); }

.chip {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  min-width: 68px;
  padding: 8px 8px 7px;
  text-align: left;
}
.chip .dow {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.chip .dom { font-weight: 600; letter-spacing: -0.03em; }
.chip.we { color: var(--muted); }
.chip.on { background: var(--acid); border-color: var(--acid); color: var(--ink-on-acid); }
.chip.on .dow { color: var(--ink-on-acid); }

.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button {
  border: 1px solid var(--line);
  background: transparent;
  padding: 10px 12px;
}
.seg button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.meethead {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin: 22px 0 8px;
}
.meethead > :first-child { flex: 1; min-width: 0; }
.mtitle {
  font-size: clamp(32px, 5vw, 52px);
  line-height: 0.95;
  letter-spacing: -0.05em;
  font-weight: 700;
  margin: 0;
  width: 100%;
  overflow-wrap: anywhere;
}
input.mtitle {
  background: transparent;
  border: 0;
  border-bottom: 1px solid transparent;
  padding: 0 0 2px;
  border-radius: 0;
  min-width: 0;
}
input.mtitle:focus { border-bottom-color: var(--acid); }
.meta { color: var(--muted); margin: 8px 0 0; font-size: 14px; }
.countbig { text-align: right; }
.num {
  font-family: var(--mono);
  font-size: 56px;
  line-height: 0.85;
  letter-spacing: -0.06em;
  font-weight: 500;
}
.numlabel {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.lockedbanner {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  background: var(--hot);
  color: #1a0906;
  font-weight: 700;
  padding: 12px 14px;
  margin: 12px 0;
}
.onbanner {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.4);
  color: #1a0906;
  font-weight: 700;
  padding: 6px 8px;
}
.best { margin: 8px 0 14px; }
.run {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.run .when { flex: 1; font-weight: 600; letter-spacing: -0.03em; }
.run .score { font-family: var(--mono); color: var(--acid); font-size: 13px; }

.board {
  display: grid;
  gap: 14px;
  grid-template-areas:
    "grid"
    "detail"
    "people";
}
.gridwrap { grid-area: grid; }
.detail { grid-area: detail; }
.peoplebox { grid-area: people; }
@media (min-width: 960px) {
  .board {
    grid-template-columns: minmax(0, 1fr) 300px;
    grid-template-areas:
      "grid detail"
      "grid people";
    align-items: start;
  }
  .peoplebox { position: sticky; top: 16px; }
}

.gridwrap {
  overflow: auto;
  max-height: min(62vh, 720px);
  border: 1px solid var(--line);
  overscroll-behavior: contain;
}
.gridwrap::-webkit-scrollbar { height: 8px; width: 8px; }
.gridwrap::-webkit-scrollbar-thumb { background: #3a3d32; }
.grid {
  --days: 5;
  display: grid;
  grid-template-columns: 64px repeat(var(--days), minmax(56px, 1fr));
  gap: 3px;
  padding: 3px;
  width: max-content;
  min-width: 100%;
  user-select: none;
  touch-action: pan-x pan-y;
}
.hd, .tm {
  position: sticky;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 32px;
}
.hd {
  top: 0;
  z-index: 3;
  align-items: center;
  text-align: center;
  padding: 6px 4px 8px;
}
.tm {
  left: 0;
  z-index: 2;
  align-items: flex-end;
  padding-right: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.corner { z-index: 4; left: 0; }
.hd .dow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.hd .dom { font-weight: 700; letter-spacing: -0.03em; }
.hd.today .dom { color: var(--acid); }
.hd.we .dom, .hd.we .dow { color: #6e7066; }
.hd.today.we .dom { color: var(--acid); }

.cell {
  position: relative;
  min-height: 32px;
  border: 0;
  background: var(--bg-elev);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  padding: 0;
}
.cell .n { pointer-events: none; }
.cell.hot { color: var(--ink-on-acid); }
.cell.mine { box-shadow: inset 0 0 0 2px var(--acid); }
.cell.locked::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: var(--hot);
}
.cell.focuscan { box-shadow: inset 0 0 0 2px var(--acid); }
.cell.dim { opacity: 0.28; }
.cell:hover { filter: brightness(1.18); }

.detail {
  border: 1px solid var(--line);
  padding: 12px 14px;
  display: grid;
  gap: 6px;
  align-content: start;
  min-height: 74px;
}
.detail strong { letter-spacing: -0.03em; }
.person {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 9px 0;
  text-align: left;
}
.person.on { color: var(--acid); }
.mono { font-family: var(--mono); color: var(--muted); font-size: 12px; }
.person.on .mono { color: var(--acid); }

.meetlink {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}
.meetlink .mt { font-weight: 600; letter-spacing: -0.03em; }
.meetlink:hover .mt { color: var(--acid); }
.meetlink .ms {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  text-align: right;
}
.listhead { margin: 28px 0 0; }
.footeractions { margin-top: 28px; }

@media (max-width: 640px) {
  .namerow, .restore { flex-wrap: wrap; }
  .shareline { flex-direction: column; align-items: stretch; }
  .meethead { flex-direction: column; align-items: stretch; }
  .countbig { display: flex; gap: 10px; align-items: baseline; text-align: left; }
  .num { font-size: 32px; }
  .mtitle { font-size: 36px; }
  .meetlink { flex-direction: column; gap: 4px; }
  .meetlink .ms { text-align: left; }
}
