:root {
  --bg: #080810;
  --surface: #101018;
  --line: #2c3448;
  --text: #d8e0ea;
  --muted: #8a96a8;
  --accent: #a8b4c4;
  --font: "IBM Plex Mono", ui-monospace, "Courier New", monospace;
  --w: 28rem;
  --desk: 64rem;
  --h: 2.75rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

html,
body {
  margin: 0;
  min-height: 100dvh;
}

body {
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

button,
input,
select,
textarea {
  outline: none;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
}

button:focus,
button:focus-visible,
input:focus,
input:focus-visible,
select:focus,
textarea:focus {
  outline: none;
  box-shadow: none;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(88px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.42;
}

.glow--a {
  width: min(28rem, 75vw);
  height: min(28rem, 75vw);
  top: -6rem;
  left: -5rem;
  background: radial-gradient(circle, rgba(168, 180, 196, 0.22) 0%, transparent 68%);
}

.glow--b {
  width: min(24rem, 65vw);
  height: min(24rem, 65vw);
  right: -4rem;
  bottom: 18%;
  background: radial-gradient(circle, rgba(90, 110, 130, 0.18) 0%, transparent 70%);
}

.top,
main,
.foot {
  position: relative;
  z-index: 1;
}

.top {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  border-bottom: 1px solid var(--line);
  padding: 0.75rem 6.75rem;
}

.auth-home {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.auth-home:hover {
  text-decoration: none;
}

.top nav {
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand strong {
  font-weight: 500;
}

.mark {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 0.4rem;
  display: grid;
  place-items: center;
  font-size: 0.52rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #fff;
  background: linear-gradient(135deg, #5a6e82 0%, #3a4a5a 100%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.mark--auth {
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 55%, #10b981 100%);
  font-size: 0.72rem;
}

main {
  flex: 1;
  display: grid;
  place-items: center;
  width: 100%;
  padding: 2rem 1.25rem 2.5rem;
}

body.is-in main {
  place-items: start center;
}

.sheet {
  width: min(100%, var(--w));
  text-align: center;
}

.desk {
  width: min(100%, var(--desk));
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
}

.stack.fill {
  flex: 1;
  min-height: 0;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.split3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.75rem;
}

.kpi {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  background: rgba(16, 16, 24, 0.72);
}

.kpi button {
  min-width: 0;
  height: 4.25rem;
  margin: 0;
  padding: 0.55rem 0.7rem;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  cursor: pointer;
}

.kpi button:last-child {
  border-right: 0;
}

.kpi b {
  font-weight: 500;
  font-size: 1rem;
}

.kpi span {
  color: var(--muted);
  font-size: 0.75rem;
}

.stage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  align-items: stretch;
}

.pane {
  border: 1px solid var(--line);
  background: rgba(16, 16, 24, 0.72);
  padding: 1rem;
  min-height: 28rem;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pane .stack {
  flex: 1;
}

.slab {
  flex: none;
  min-width: 0;
  width: 100%;
  height: var(--h);
  padding: 0.7rem 1rem;
  box-sizing: border-box;
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: center;
  outline: none;
  box-shadow: none;
}

.slab:focus,
.slab:focus-visible {
  outline: none;
  box-shadow: none;
  border-color: #555;
}

button.slab {
  cursor: pointer;
}

button.slab.go,
#go {
  background: var(--accent);
  color: #080810;
  border-color: var(--accent);
}

button.slab.on {
  border-color: #555;
  color: var(--text);
  background: #181820;
}

.zone {
  flex: 1;
  min-height: 10rem;
  margin: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.35rem;
  border: 1px dashed var(--line);
  background: rgba(16, 16, 24, 0.72);
  cursor: pointer;
  text-align: center;
  padding: 1.5rem 1rem;
}

.zone.drag {
  border-color: var(--accent);
}

.zone b {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.zone span {
  color: var(--muted);
  font-size: 0.8125rem;
}

input.slab::placeholder {
  color: var(--muted);
}

input.slab[type="search"] {
  appearance: none;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  border: 1px solid var(--line);
  outline: none;
  box-shadow: inset 0 0 0 1000px var(--surface);
  transition: background-color 9999s ease-out;
}

.text {
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  padding: 0;
  outline: none;
  box-shadow: none;
}

.err {
  margin: 0;
  color: #f0a0a0;
  font-size: 0.875rem;
  text-align: center;
}

.bar-wrap {
  height: 2px;
  background: var(--line);
}

.bar {
  height: 2px;
  overflow: hidden;
}

.bar > i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
}

.dropmask {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(8, 8, 16, 0.82);
  border: 1px solid var(--line);
  color: var(--text);
  font: inherit;
  pointer-events: none;
}

.rows {
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: left;
  flex: 1;
  overflow: auto;
}

.rows li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 0.75rem;
  min-height: var(--h);
  padding: 0 0.15rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.8125rem;
}

.rows b {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rows em {
  font-style: normal;
  color: var(--muted);
  white-space: nowrap;
}

.rows button {
  height: var(--h);
  min-width: var(--h);
  padding: 0 0.7rem;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  outline: none;
  box-shadow: none;
}

.rows button:focus,
.rows button:focus-visible {
  outline: none;
  box-shadow: none;
  border-color: #555;
}

.foot {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  margin-top: auto;
  padding: 0.75rem 1.25rem 1.25rem;
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
}

.foot a {
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
}

.foot a:hover {
  text-decoration: underline;
}

@media (max-width: 52rem) {
  .stage,
  .kpi {
    grid-template-columns: 1fr 1fr;
  }

  .kpi button:nth-child(2) {
    border-right: 0;
  }

  .kpi button:nth-child(3),
  .kpi button:nth-child(4) {
    border-top: 1px solid var(--line);
  }

  .pane {
    min-height: 22rem;
  }
}

@media (max-width: 40rem) {
  .top {
    padding: 0.75rem 1rem 3.2rem;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.5rem 0.75rem;
    justify-content: stretch;
  }

  .auth-home,
  .top nav {
    position: static;
    transform: none;
  }

  .brand {
    grid-column: 1 / -1;
    justify-content: center;
  }

  .stage,
  .kpi,
  .split3 {
    grid-template-columns: 1fr;
  }

  .kpi button {
    border-right: 0;
    border-top: 1px solid var(--line);
    height: var(--h);
    flex-direction: row;
    justify-content: center;
    gap: 0.5rem;
  }

  .kpi button:first-child {
    border-top: 0;
  }
}
