@font-face {
  font-family: Geist;
  src: url("/brand/geist.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/brand/geist-mono.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --canvas: #091310;
  --surface: #101f19;
  --raised: #192b22;
  --ink: #e8f2ec;
  --accent: #8fe39f;
  --muted: #a3b9aa;
  --pixels: repeating-conic-gradient(var(--accent) 0 25%, transparent 0 50%) 0
    0/4px 4px;
  --soft-pixels: repeating-conic-gradient(#8fe39f46 0 25%, transparent 0 50%) 0
    0/4px 4px;
  font:
    16px/1.5 Geist,
    system-ui,
    sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
}
main {
  min-width: 0;
}
body:has(#workspace:not([hidden])) {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}
#gate {
  min-height: 100dvh;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-direction: column;
  text-align: center;
}
#gate img {
  margin-bottom: -8px;
}
#gate h1 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}
#intro {
  max-width: 320px;
  text-wrap: balance;
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}
#intro:empty {
  display: none;
}
#login {
  width: min(100%, 316px);
  min-height: 42px;
  margin-top: 8px;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    var(--soft-pixels) border-box;
  border: 4px solid transparent;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 500;
}
button:hover {
  background-color: var(--raised);
}
.primary {
  --depth: 4px;
  position: relative;
  background: var(--accent);
  color: var(--canvas);
  font-weight: 600;
  border: 0;
  padding: 0 16px;
  margin: 0 4px 4px 0;
  filter: drop-shadow(0 2px 6px #0008);
}
.primary:after {
  content: "";
  position: absolute;
  inset: 0;
  translate: var(--depth) var(--depth);
  background: var(--pixels);
  clip-path: polygon(
    calc(100% - var(--depth)) 0,
    100% 0,
    100% 100%,
    0 100%,
    0 calc(100% - var(--depth)),
    calc(100% - var(--depth)) calc(100% - var(--depth))
  );
  pointer-events: none;
}
.primary:hover:not(:disabled) {
  background: var(--accent);
  --depth: 6px;
  translate: -2px -2px;
}
.primary:active:not(:disabled) {
  --depth: 0px;
  translate: 4px 4px;
}
.primary:disabled {
  opacity: 0.5;
}
.primary:focus-visible,
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
#rail {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 16px 8px;
  background: var(--surface);
}
#rail strong,
.selected,
.topbar {
  display: flex;
  align-items: center;
  gap: 8px;
}
#rail strong {
  padding: 4px 12px 20px;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.selected {
  background:
    linear-gradient(var(--raised), var(--raised)) padding-box,
    var(--soft-pixels) border-box;
  border: 2px solid transparent;
  padding: 8px;
  font-size: 14px;
}
.face {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 18px;
  border-radius: 40% 52% 45% 50%;
  background: var(--accent);
  color: var(--canvas);
  letter-spacing: 2px;
  font: bold 12px/1 monospace;
  padding-left: 2px;
  rotate: -5deg;
}
dl {
  margin: 20px 12px;
}
dl div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  font-size: 13px;
}
dt {
  color: var(--muted);
}
dd,
th,
#count {
  font-family: "Geist Mono", monospace;
}
dd {
  margin: 0;
}
nav {
  display: grid;
  gap: 8px;
  margin: auto 8px 0;
}
#workspace {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0 clamp(16px, 3vw, 40px) 16px;
}
.topbar {
  min-height: 52px;
}
.topbar h1 {
  font-size: 14px;
  font-weight: 500;
  margin: 0;
}
#rail-toggle {
  display: none;
  margin-left: auto;
}
.toolbar,
footer {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.toolbar {
  margin: 28px 0 16px;
}
.toolbar h2 {
  margin: 0 auto 0 0;
}
h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.025em;
}
input,
select,
textarea {
  background: var(--raised);
  border: 1px solid #ffffff1f;
  border-radius: 0;
  padding: 8px 12px;
  font-size: 14px;
}
select option {
  background-color: var(--surface);
  color: var(--ink);
}
@supports (appearance: base-select) {
  select,
  select::picker(select) {
    appearance: base-select;
  }
  select {
    align-items: center;
    gap: 12px;
    cursor: pointer;
  }
  select::picker-icon {
    color: var(--muted);
  }
  select:open::picker-icon {
    color: var(--accent);
  }
  select::picker(select) {
    margin-block: 4px;
    border: 2px solid transparent;
    border-radius: 0;
    padding: 4px;
    background:
      linear-gradient(var(--surface), var(--surface)) padding-box,
      var(--soft-pixels) border-box;
    color: var(--ink);
    font: inherit;
    max-height: min(320px, 50dvh);
    overflow-y: auto;
    box-shadow: 0 8px 20px #0006;
  }
  select option {
    border-radius: 0;
    padding: 6px 10px;
    gap: 8px;
    cursor: pointer;
  }
  select option:checked {
    color: var(--accent);
    background: var(--raised);
  }
  select option::checkmark {
    order: 1;
    margin-inline-start: auto;
  }
  select option:is(:hover, :focus-visible) {
    background: #22372b;
    outline: 1px solid var(--muted);
    outline-offset: -1px;
  }
}
.sheet {
  flex: 1;
  min-height: 180px;
  overflow: auto;
  background: var(--surface);
  border-top: 4px solid transparent;
  border-image: repeating-linear-gradient(
      90deg,
      #8fe39f5c 0 2px,
      transparent 2px 4px
    )
    4;
}
table {
  border-spacing: 0;
  table-layout: fixed;
  font-size: 14px;
}
td,
th {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid #ffffff12;
  border-right: 1px solid #ffffff0d;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
th {
  position: sticky;
  top: 0;
  background: #22372b;
  z-index: 2;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
td:first-child,
th:first-child {
  position: sticky;
  left: 0;
  background: var(--raised);
  z-index: 1;
}
th:first-child {
  z-index: 3;
}
.sheet th:not(:first-child) {
  padding: 0;
}
.sort {
  touch-action: pan-y;
  user-select: none;
  cursor: grab;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 10px 14px;
  display: block;
  width: 100%;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
}
.moving-columns :is(th, td):not(:first-child) {
  transition: transform 150ms ease-out;
}
.moving-columns :is(th, td).in-hand {
  position: relative;
  z-index: 2;
  background: var(--raised);
  box-shadow:
    inset 2px 0 var(--accent),
    inset -2px 0 var(--accent);
  transition: none;
}
.moving-columns th.in-hand {
  position: sticky;
  z-index: 4;
}
.moving-columns .sort {
  cursor: grabbing;
}
@media (prefers-reduced-motion: reduce) {
  .moving-columns :is(th, td):not(:first-child) {
    transition: none;
  }
}
.resize {
  position: absolute;
  inset: 0 0 0 auto;
  width: 10px;
  cursor: col-resize;
  touch-action: none;
}
.resize:hover {
  background: #8fe39f55;
}
.sheet input[type="checkbox"] {
  accent-color: var(--accent);
  margin: 0;
  width: 16px;
  height: 16px;
  vertical-align: middle;
}
.selected-row td {
  background: var(--raised);
}
#bulk-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  font-size: 14px;
}
#bulk-form label {
  margin-block: 12px;
}
td button {
  background: none;
  border: 0;
  min-height: 24px;
  padding: 0;
  color: var(--accent);
}
td button:hover,
a:hover {
  text-decoration: underline;
}
.stage {
  color: var(--ink);
}
a {
  color: var(--accent);
}
#count {
  color: var(--muted);
  font-size: 12px;
  margin: 8px 0 0;
}
#error,
.error {
  color: #ffad99;
}
#error:empty {
  display: none;
}
#error {
  position: fixed;
  bottom: 16px;
  inset-inline: 16px;
  text-align: center;
}
dialog {
  width: min(560px, 94vw);
  max-height: 90dvh;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 12px 32px #0009;
  border: 4px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    var(--soft-pixels) border-box;
  padding: 24px;
}
dialog::backdrop {
  background: #000a;
}
dialog h2 {
  margin: 0 0 16px;
}
dialog p {
  color: var(--muted);
}
#inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
label {
  display: grid;
  gap: 4px;
  font-size: 14px;
}
label input,
label select,
textarea {
  width: 100%;
  min-width: 0;
}
.wide {
  grid-column: 1/-1;
}
footer {
  justify-content: flex-end;
  margin-top: 20px;
}
@media (max-width: 760px) {
  body:has(#workspace:not([hidden])) {
    display: block;
  }
  #rail {
    display: none;
  }
  .menu-open #rail {
    display: flex;
    position: fixed;
    z-index: 5;
    inset: 52px 0 auto;
    min-height: 0;
    box-shadow: 0 14px 32px #0009;
  }
  .menu-open #rail strong,
  .menu-open .selected {
    display: none;
  }
  #rail-toggle {
    display: inline-flex;
  }
  .toolbar {
    margin: 16px 0;
  }
  .toolbar input {
    order: 3;
    width: 100%;
  }
  #inputs {
    grid-template-columns: 1fr;
  }
}
