@font-face {
  font-family: 'Golos';
  src: url('../../fonts/GolosText-Variable.ttf') format('truetype');
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: 'Plex Mono';
  src: url('../../fonts/IBMPlexMono-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Plex Mono';
  src: url('../../fonts/IBMPlexMono-Medium.ttf') format('truetype');
  font-weight: 500 700;
  font-display: swap;
}

:root {
  --desk: #151514;
  --desk-2: #1b1b19;
  --desk-3: #23231f;
  --desk-4: #2d2c28;
  --ink: #e9e4d8;
  --ink-2: #a9a396;
  --ink-3: #736e63;
  --line: rgba(233, 228, 216, .12);
  --line-2: rgba(233, 228, 216, .28);
  --red: #e0402e;
  --red-2: #f2533f;
  --paper: #e8e1d1;
  --paper-2: #d9cfb9;
  --paper-ink: #1e1f22;
  --paper-ink-2: #6b6455;
  --paper-line: rgba(30, 31, 34, .22);
  --stamp: #b8322a;
  --board: #c2ae84;
  --board-ink: #43391f;

  --sans: 'Golos', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'Plex Mono', ui-monospace, 'Cascadia Mono', Menlo, Consolas, monospace;

  --gut: 16px;
  --top: 56px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --t: 160ms;
  color-scheme: dark;
}
@media (min-width: 720px) { :root { --gut: 32px; } }
@media (min-width: 1280px) { :root { --gut: 56px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--desk);
  color: var(--ink);
  font: 400 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
html { background: var(--desk); }
body { background: var(--desk); isolation: isolate; }
body::before, body::after { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; }
body::before {
  background:
    radial-gradient(ellipse 60% 50% at 16% -6%, rgba(255, 233, 196, .06), transparent 72%),
    radial-gradient(ellipse 140% 100% at 50% 36%, transparent 55%, rgba(0, 0, 0, .5) 100%);
}
body::after {
  z-index: 95;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.78' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='.33 .33 .33 0 0 .33 .33 .33 0 0 .33 .33 .33 0 0 0 0 0 0 1'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23g)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
  opacity: .22;
}
.backdrop { position: fixed; inset: 0; z-index: -1; pointer-events: none; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
::-webkit-scrollbar-thumb { background: rgba(233, 228, 216, .2); border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(224, 64, 46, .85); }
.paper::-webkit-scrollbar-thumb, .paper ::-webkit-scrollbar-thumb { background-color: rgba(30, 31, 34, .32); }
.paper::-webkit-scrollbar-thumb:hover, .paper ::-webkit-scrollbar-thumb:hover { background-color: var(--stamp); }
@supports not selector(::-webkit-scrollbar) {
  html { scrollbar-width: thin; scrollbar-color: rgba(233, 228, 216, .22) transparent; }
  .paper, .paper * { scrollbar-width: thin; scrollbar-color: rgba(30, 31, 34, .32) transparent; }
}

input, textarea, .selectable { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
p { margin: 0; }
ol, ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3 { margin: 0; font-weight: inherit; }
[hidden] { display: none !important; }
::selection { background: var(--red); color: var(--desk); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.micro {
  font: 500 11px/1.35 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.lead { font-size: 17px; line-height: 1.5; color: var(--ink-2); max-width: 34em; }
.lead b { color: var(--ink); font-weight: 600; }
.h2 { font: 750 26px/1.1 var(--sans); letter-spacing: -.02em; }
.h3 { font: 700 18px/1.2 var(--sans); letter-spacing: -.01em; }
.red { color: var(--red); }

.mark {
  --ls: -.03em;
  display: inline-flex;
  align-items: baseline;
  font-weight: 850;
  letter-spacing: var(--ls);
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.mark i {
  flex: none;
  display: inline-block;
  width: .703em;
  height: .703em;
  margin: 0 calc(.047em + var(--ls)) 0 .053em;
  background: var(--red);
}

.top {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--top);
  padding: 0 var(--gut);
  background: var(--desk);
  border-bottom: 1px solid var(--line);
}
.top .mark { font-size: 21px; }
.top__all { margin-left: -10px; color: var(--ink-3); }
.top__all:hover { color: var(--ink); }
.top__room { display: flex; align-items: baseline; gap: 10px; min-width: 0; white-space: nowrap; }
.top__room .num { font-size: 13px; letter-spacing: .14em; color: var(--ink); }
.top__tools { display: flex; gap: 2px; margin-left: auto; }
@media (max-width: 520px) {
  .top { gap: 10px; }
  .top__room .micro { display: none; }
  .top__room .num { font-size: 12px; letter-spacing: .1em; }
  .top__tools .btn--icon { width: 36px; }
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid var(--line-2);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: 650 13px/1 var(--sans);
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  transition: background var(--t), color var(--t), border-color var(--t);
}
.btn:hover { background: var(--desk-3); border-color: var(--ink-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .32; cursor: default; transform: none; background: transparent; border-color: var(--line-2); }
.btn--primary { background: var(--ink); border-color: var(--ink); color: var(--desk); }
.btn--primary:hover { background: #fff; border-color: #fff; }
.btn--primary:disabled { background: var(--ink); border-color: var(--ink); }
.btn--red { background: var(--red); border-color: var(--red); color: #1a0c09; }
.btn--red:hover { background: var(--red-2); border-color: var(--red-2); }
.btn--red:disabled, .btn--red:disabled:hover { opacity: 1; background: transparent; border: 1px dashed rgba(224, 64, 46, .55); color: rgba(224, 64, 46, .75); }
.btn--ghost { border-color: transparent; }
.btn--wide { width: 100%; justify-content: space-between; }
.btn--lg { min-height: 60px; font-size: 14px; padding: 0 22px; }
.btn--sm { min-height: 32px; padding: 0 11px; gap: 8px; font-size: 11px; letter-spacing: .09em; }
.btn--icon { width: 40px; min-height: 40px; padding: 0; border-color: transparent; color: var(--ink-2); }
.btn--icon:hover { color: var(--ink); background: var(--desk-3); border-color: transparent; }
.btn--icon[aria-pressed="false"] { color: var(--ink-3); }
.btn .arr { font: 500 16px/1 var(--mono); letter-spacing: 0; }
.btn svg { flex: none; }
.link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  border: 0;
  border-bottom: 1px solid var(--line-2);
  background: none;
  font: 600 12px/1.4 var(--sans);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-2);
  text-decoration: none;
}
.link:hover { color: var(--ink); border-color: var(--ink); }

.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line-2); }
.seg button {
  min-width: 44px;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-left: 1px solid var(--line-2);
  background: transparent;
  font: 500 13px/1 var(--mono);
  color: var(--ink-2);
  transition: background var(--t), color var(--t);
}
.seg button:first-child { border-left: 0; }
.seg button:hover { color: var(--ink); background: var(--desk-3); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--desk); }
.seg button:disabled { opacity: .3; cursor: default; background: transparent; color: var(--ink-2); }
.seg--ro button { cursor: default; }
.seg--ro button:hover { background: transparent; color: var(--ink-2); }
.seg--ro button[aria-pressed="true"]:hover { background: var(--ink); color: var(--desk); }

.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font: 500 13px/1.3 var(--mono); color: var(--ink-2); }
.check input {
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  place-content: center;
  width: 22px;
  height: 22px;
  margin: 0;
  border: 1px solid var(--line-2);
  background: transparent;
  cursor: pointer;
}
.check input::before { content: '×'; font: 500 20px/1 var(--mono); color: var(--ink); transform: translateY(-1px); opacity: 0; }
.check input:checked { border-color: var(--ink); }
.check input:checked::before { opacity: 1; }
.check input:disabled { cursor: default; opacity: .5; }

.field {
  position: relative;
  display: block;
  padding: 24px 14px 10px;
  border: 1px solid var(--line-2);
  background: transparent;
  transition: border-color var(--t);
}
.field:focus-within { border-color: var(--ink); }
.field__label { position: absolute; top: 8px; left: 14px; }
.field input, .field textarea {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: 500 20px/1.3 var(--mono);
  color: var(--ink);
  caret-color: var(--red);
}
.field textarea { font-size: 14px; line-height: 1.55; resize: vertical; min-height: 120px; }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-3); }

.sec { border-top: 1px solid var(--line-2); padding-top: 12px; }
.sec__head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.sec__title { font: 700 13px/1.2 var(--sans); letter-spacing: .12em; text-transform: uppercase; }
.sec__meta { margin-left: auto; }

.opt { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.opt__name { font-weight: 600; font-size: 15px; }
.opt__desc { font-size: 13px; color: var(--ink-3); line-height: 1.4; }
.opt--stack { grid-template-columns: 1fr; }
.opt__desc b { font: 500 1em var(--mono); color: var(--ink-2); }

.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tabs button {
  flex: 1;
  min-height: 46px;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: none;
  font: 650 12px/1 var(--sans);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--red); }
.tabs .num { margin-left: 6px; color: var(--ink-3); letter-spacing: 0; }

.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(9, 9, 8, .84);
  overflow-y: auto;
  animation: fadeIn 160ms var(--ease);
}
.dialog {
  position: relative;
  width: min(560px, 100%);
  background: var(--desk-2);
  border: 1px solid var(--line-2);
  padding: 22px 22px 20px;
  animation: riseIn 200ms var(--ease);
}
.dialog--wide { width: min(820px, 100%); }
.dialog__head { display: flex; align-items: baseline; gap: 14px; padding-bottom: 14px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.dialog__title { font: 750 22px/1.15 var(--sans); letter-spacing: -.015em; }
.dialog__head .micro { margin-left: auto; }
.dialog__text { color: var(--ink-2); }
.dialog__text b { color: var(--ink); font-weight: 600; }
.dialog__btns { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 22px; }
@media (max-width: 520px) {
  .overlay { align-items: end; padding: 0; }
  .dialog { width: 100%; border-width: 1px 0 0; padding-bottom: calc(20px + env(safe-area-inset-bottom)); max-height: 92dvh; overflow-y: auto; }
  .dialog__btns .btn { flex: 1; }
}

.toast {
  position: fixed;
  left: var(--gut);
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(440px, calc(100% - 2 * var(--gut)));
  padding: 12px 16px 12px 14px;
  background: var(--ink);
  color: var(--desk);
  font: 500 13px/1.35 var(--mono);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--t), transform var(--t);
  pointer-events: none;
}
.toast::before { content: ''; flex: none; width: 8px; height: 8px; background: var(--red); }
.toast.is-on { opacity: 1; transform: none; }

.screen { display: none; }
.screen.is-on { display: block; animation: riseIn 240ms var(--ease); }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes riseIn { from { opacity: 0; transform: translateY(8px); } }

.no-anim *, .no-anim *::before, .no-anim *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
