/* Skunk Works on Keelson Style 3 (dark). Tokens are the Keelson Style 3 design system's. */
@font-face { font-family: Satoshi; src: url(fonts/satoshi_regular.ttf) format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: Satoshi; src: url(fonts/satoshi_medium.ttf) format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: Satoshi; src: url(fonts/satoshi_bold.ttf) format('truetype'); font-weight: 600 700; font-display: swap; }
@font-face { font-family: 'Commit Mono'; src: url(fonts/commit_mono_regular.ttf) format('truetype'); font-weight: 400 500; font-display: swap; }

:root {
  --wall: #14110e; --glass: #0f0e0cd6; --solid: #0f0e0cf0; --inset: #0a090899;
  --edge: #fff3dc1f; --edge-lit: #fff3dc33; --hair: #fff3dc14; --hair-g: #fff3dc24;
  --wash: #fff3dc0d; --wash-gold: #d9b76629; --gold: #ffd66e; --on-gold: #1c1608; --gold-dull: #a8925a;
  --ink-strong: #f4ecda; --ink: #e9e0cb; --text: #d2c7ab; --dim: #b8ac8e; --faint: #a3977a; --sunken: #4d4637;
  --ok: #8edb86; --danger: #ff6e62;
  --ring: inset 0 1px 0 var(--edge-lit), inset 0 0 0 1px var(--edge);
  --lift: 0 18px 48px #00000080;
  --spring: cubic-bezier(.2, .8, .2, 1);
  --sans: Satoshi, system-ui, sans-serif; --mono: 'Commit Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--wall); color: var(--text); font: 400 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--ink); }
a:hover { color: var(--ink-strong); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
[hidden] { display: none !important; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.glass { background: var(--glass); backdrop-filter: blur(32px); -webkit-backdrop-filter: blur(32px); box-shadow: var(--ring); }
.solid { background: var(--solid); backdrop-filter: blur(48px); -webkit-backdrop-filter: blur(48px); box-shadow: var(--ring), var(--lift); }
.press { transition: transform 220ms var(--spring), background 150ms ease-out, opacity 150ms ease-out; }
.press:active { transform: scale(.97); }

.cap { font-size: 13px; line-height: 18px; font-weight: 500; color: var(--faint); }
.ls { font-size: 14px; line-height: 20px; color: var(--dim); }
.kick { font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--dim); }
.verdict { margin: 0; font-size: 32px; line-height: 38px; font-weight: 600; letter-spacing: -.6px; color: var(--ink-strong); }

.pill { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 0; border-radius: 999px; font-size: 15px; line-height: 20px; font-weight: 500; white-space: nowrap; }
.pill.g { background: var(--solid); color: var(--ink); box-shadow: var(--ring); }
.pill.g:hover { background: #1a1815f0; }
.pill.lead { background: var(--gold); color: var(--on-gold); }
.pill.wide { width: 100%; }
.pill[disabled] { opacity: .6; cursor: default; }

/* sign in */
.signin { height: 100%; display: grid; place-items: center; padding: 20px; }
.signcard { width: min(400px, 100%); padding: 32px 28px; border-radius: 30px; display: flex; flex-direction: column; gap: 12px; }
.signcard .sub { margin: 0 0 12px; color: var(--dim); font-size: 15px; }
.field input { width: 100%; height: 48px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--inset); box-shadow: inset 0 0 0 1px var(--edge); color: var(--ink); outline: 0; }
.field input::placeholder { color: var(--faint); }
.field input:focus { box-shadow: inset 0 0 0 1px var(--ink); }
.err { margin: 0; color: var(--danger); font-size: 14px; }
.err::before { content: '× '; }
.quiet { align-self: center; font-size: 14px; color: var(--dim); text-decoration: none; margin-top: 4px; }

.boot { position: fixed; inset: 0; display: grid; place-items: center; }

/* layout */
.app { position: fixed; inset: 0; display: flex; gap: 12px; padding: 12px; }
.rail { width: 264px; flex: none; border-radius: 16px; padding: 20px 12px 12px; display: flex; flex-direction: column; gap: 2px; min-height: 0; }
.brandbox { display: flex; flex-direction: column; gap: 4px; padding: 0 12px; }
.brand { font-size: 20px; line-height: 26px; font-weight: 600; letter-spacing: -.2px; color: var(--ink-strong); }
.search { display: flex; align-items: center; gap: 10px; margin: 16px 0 12px; padding: 0 16px; height: 44px; border-radius: 999px; background: var(--inset); box-shadow: inset 0 0 0 1px var(--edge); color: var(--dim); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--ink); font-size: 15px; }
.search input::placeholder { color: var(--faint); }
.folders { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; min-height: 0; flex: 1; }
.row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 12px; border: 0; border-radius: 10px; background: none; font-size: 16px; line-height: 22px; color: var(--text); text-align: left; }
.row:hover { background: var(--wash); }
.row.on { background: var(--wash); color: var(--ink); font-weight: 500; }
.row.in { padding-left: 30px; }
.row.drop { background: var(--wash-gold); color: var(--ink-strong); box-shadow: inset 0 0 0 1px var(--gold-dull); }
.row .n { margin-left: auto; font: 400 13px/18px var(--mono); color: var(--faint); }
.rule { height: 1px; margin: 8px 12px; background: var(--hair-g); flex: none; }
.railfoot { border-top: 1px solid var(--hair); padding-top: 8px; margin-top: 8px; }
.railfoot .row { color: var(--dim); font-size: 15px; }

.stage { position: relative; flex: 1; min-width: 0; border-radius: 16px; overflow: hidden; }
.head { position: absolute; z-index: 5; left: 0; right: 0; top: 0; padding: 16px 16px 0 20px; display: flex; align-items: flex-start; gap: 16px; pointer-events: none; }
.head > * { pointer-events: auto; }
.hcol { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding-top: 4px; }
.title { margin: 0; font-size: 20px; line-height: 26px; font-weight: 600; letter-spacing: -.2px; color: var(--ink-strong); }
.acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.statebar { position: absolute; z-index: 5; left: 20px; top: 76px; margin: 0; font-size: 14px; color: var(--danger); display: flex; align-items: center; gap: 12px; }
.statebar.quiet { color: var(--faint); }
.hint { position: absolute; z-index: 5; left: 20px; bottom: 14px; margin: 0; pointer-events: none; }

/* board */
.board { position: absolute; inset: 0; overflow: hidden; touch-action: none; cursor: grab; }
.board.panning { cursor: grabbing; }
.world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.strings { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; }
.strings .kept { fill: none; stroke: var(--ink); stroke-opacity: .5; stroke-width: 1.5; }
.strings .sugg { fill: none; stroke: var(--gold-dull); stroke-width: 2; stroke-dasharray: 2 8; stroke-linecap: round; }
.strings .live { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 4 6; }

.card { position: absolute; width: 240px; padding: 18px 16px 16px; border-radius: 16px; display: flex; flex-direction: column; gap: 4px;
  background: var(--glass); backdrop-filter: blur(32px); -webkit-backdrop-filter: blur(32px); box-shadow: var(--ring), var(--lift);
  cursor: grab; user-select: none; transition: opacity 150ms ease-out, box-shadow 220ms var(--spring), transform 220ms var(--spring); }
.card:hover { box-shadow: inset 0 1px 0 var(--edge-lit), inset 0 0 0 1px var(--edge-lit), var(--lift); }
.card.sel { box-shadow: inset 0 1px 0 var(--edge-lit), inset 0 0 0 1px var(--ink), var(--lift); }
.card.dim { opacity: .3; }
.card.drag { cursor: grabbing; transform: rotate(-1.5deg) scale(1.03); box-shadow: var(--ring), 0 28px 64px #000000b3; z-index: 20; transition: none; }
.card.target { box-shadow: inset 0 1px 0 var(--edge-lit), inset 0 0 0 1px var(--gold-dull), var(--lift); }
.card.arrive { animation: arrive 350ms var(--spring) both; }
@keyframes arrive { from { opacity: 0; transform: translateY(8px) scale(.96); } }
.pin { position: absolute; top: -7px; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 999px; background: var(--ink); box-shadow: 0 2px 6px #00000080; cursor: crosshair; }
.pin.c { background: var(--wall); border: 2px solid var(--dim); }
.pin::after { content: ''; position: absolute; inset: -10px; }
.ct { margin-top: 2px; font-size: 17px; line-height: 22px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.cs { font-size: 14px; line-height: 20px; color: var(--dim); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cs.me { color: var(--ink); }
.cn { font-size: 14px; line-height: 20px; color: var(--ink); border-top: 1px solid var(--hair); padding-top: 8px; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cf { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; line-height: 18px; font-weight: 500; color: var(--faint); }
.cf .grow { flex: 1; }
.cf .n { font-family: var(--mono); }

.chip { position: absolute; transform: translate(-50%, -50%); z-index: 15; }
.chip:hover, .chip:focus-within, .chip.open { z-index: 30; }
.chip.dim { opacity: .3; }
.dot { display: block; width: 28px; height: 28px; padding: 0; border-radius: 999px; border: 2px dashed var(--gold-dull); background: var(--solid); box-shadow: 0 6px 16px #00000080; }
.dot::after { content: ''; display: block; width: 8px; height: 8px; margin: auto; border-radius: 999px; background: var(--gold-dull); }
.dot::before { content: ''; position: absolute; inset: -10px; }
.chippanel { position: absolute; top: calc(100% + 8px); left: 50%; width: 280px; padding: 14px 12px 12px 16px; border-radius: 16px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px; opacity: 0; pointer-events: none; transform: translate(-50%, 4px) scale(.98);
  transition: opacity 150ms ease-out, transform 350ms var(--spring); }
.chip:hover .chippanel, .chip:focus-within .chippanel, .chip.open .chippanel { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.chippanel::before { content: ''; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }
.cb { height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: none; font-size: 15px; font-weight: 500; color: var(--dim); }
.cb:hover { background: var(--wash); color: var(--ink); }
.cb.k { background: var(--wash); color: var(--ink); }
.why { flex: 1 0 100%; display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.why .t { font-size: 14px; line-height: 20px; color: var(--text); }

/* the page */
.scrim { position: fixed; inset: 0; background: #00000066; z-index: 40; animation: fade 150ms ease-out both; }
@keyframes fade { from { opacity: 0; } }
.page { position: fixed; z-index: 41; top: 12px; right: 12px; bottom: 12px; width: min(560px, calc(100% - 24px)); border-radius: 30px; display: flex; flex-direction: column; animation: slidein 350ms var(--spring) both; }
@keyframes slidein { from { opacity: 0; transform: translateX(24px); } }
.pagehead { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px 0 12px; }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 999px; background: none; font-size: 15px; font-weight: 500; color: var(--dim); }
.back:hover { background: var(--wash); color: var(--ink); }
.pagebody { flex: 1; overflow-y: auto; padding: 12px 28px 28px; display: flex; flex-direction: column; gap: 8px; }
.ptitle { width: 100%; resize: none; border: 0; outline: 0; background: none; padding: 0; font-size: 32px; line-height: 38px; font-weight: 600; letter-spacing: -.6px; color: var(--ink-strong); overflow: hidden; }
.meta { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.lab { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; font-size: 13px; line-height: 18px; font-weight: 500; color: var(--faint); }
.pfield { width: 100%; resize: vertical; min-height: 96px; border: 0; outline: 0; border-radius: 16px; padding: 14px 16px; background: var(--inset); box-shadow: inset 0 0 0 1px var(--edge); font-size: 16px; line-height: 24px; color: var(--text); }
.pfield.mine { color: var(--ink); }
.pfield:focus, .pselect:focus { box-shadow: inset 0 0 0 1px var(--ink); }
.pfield::placeholder, .pselect::placeholder { color: var(--faint); }
.pgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pselect { height: 44px; border: 0; outline: 0; border-radius: 999px; padding: 0 16px; background: var(--inset); box-shadow: inset 0 0 0 1px var(--edge); color: var(--ink); font-size: 15px; font-weight: 400; appearance: none; }
.list { display: flex; flex-direction: column; }
.lrow { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 0; border-top: 1px solid var(--hair); }
.lrow:first-child { border-top-color: var(--hair-g); }
.lrow .lt { font-size: 16px; line-height: 22px; color: var(--ink); }
.lrow .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lrow button.link { border: 0; background: none; padding: 0; text-align: left; font-size: 16px; line-height: 22px; color: var(--ink); }
.lrow button.link:hover { text-decoration: underline; }
.empty { padding: 12px 0; color: var(--faint); font-size: 14px; border-top: 1px solid var(--hair-g); }
.pagefoot { margin-top: 24px; display: flex; gap: 8px; }

@media (max-width: 760px) {
  .app { flex-direction: column; padding: 8px; gap: 8px; }
  .rail { width: auto; flex: none; padding: 12px; max-height: 40vh; }
  .brandbox { display: none; }
  .search { margin: 0 0 8px; }
  .folders { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; }
  .folders .row { width: auto; flex: none; padding: 0 14px; }
  .folders .row.in { padding-left: 14px; }
  .folders .rule { display: none; }
  .railfoot { display: none; }
  .head { flex-direction: column; gap: 8px; padding: 12px; }
  .acts { justify-content: flex-start; }
  .acts #add span { display: none; }
  .page { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; height: 86vh; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 150ms !important; }
  .card.drag { transform: none; }
}
