:root {
  --bg: #0b0c12;
  --ink: #f3f6fb;
  --muted: #8d95a3;
  --cyan: #4ec4ff;
  --cyan-deep: #1d8fd6;
  --amber: #6d9bff;
  --teal: #2ed3c6;
  --line: rgba(255, 255, 255, 0.07);
  --glass: #151820;
  --glass-2: #11141c;
  --cream: #f3f6fb;
  --red: #c45b55;
  --font: "Segoe UI", system-ui, sans-serif;
  --btn-fill: linear-gradient(105deg, #6fd4ff 0%, #4ec4ff 46%, #2ed3c6 100%);
  --btn-surface: #1c2433;
  --btn-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --rail: 260px;
  --radius: 1.35rem;
  --card: #151820;
  --sidebar: #101218;
  --accent: rgba(78, 196, 255, 0.14);
  --primary: #4ec4ff;
  --primary-ink: #062033;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

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

html { height: 100%; overflow: hidden; }

body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
}

img.emoji {
  height: 1.1em;
  width: 1.1em;
  margin: 0 0.05em;
  vertical-align: -0.15em;
}

#pugs-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

#pugs-layer img {
  position: absolute;
  height: auto;
  opacity: 0;
  transform: translate(-50%, -82%) rotate(var(--rot, 0deg)) scale(0.72);
  filter: drop-shadow(0 18px 16px rgba(0, 0, 0, 0.42));
  animation: pug-pop 0.38s cubic-bezier(0.16, 1.2, 0.32, 1) forwards;
  will-change: transform, opacity;
}

@keyframes pug-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -68%) rotate(var(--rot, 0deg)) scale(0.62);
  }
  62% {
    opacity: 1;
    transform: translate(-50%, -86%) rotate(var(--rot, 0deg)) scale(1.045);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -82%) rotate(var(--rot, 0deg)) scale(1);
  }
}

.pug {
  position: absolute;
  object-fit: cover;
  border-radius: 36px;
  opacity: 0.5;
  filter: saturate(0.92);
}

.pug-a { width: min(380px, 34vw); height: min(380px, 34vw); top: 4%; right: 3%; }
.pug-b { width: min(520px, 46vw); height: min(360px, 32vw); right: 6%; bottom: -4%; opacity: 0.42; }
.pug-c { width: min(300px, 28vw); height: min(300px, 28vw); left: 34%; bottom: 6%; opacity: 0.32; }
.pug-d { width: min(260px, 24vw); height: min(260px, 24vw); right: 34%; top: 16%; opacity: 0.28; }
.pug-e { width: min(300px, 26vw); height: min(300px, 26vw); left: 20%; top: -4%; opacity: 0.4; }
.pug-f { width: min(340px, 30vw); height: min(340px, 30vw); right: -3%; top: 36%; opacity: 0.5; }
.pug-g { width: min(460px, 40vw); height: min(300px, 26vw); left: 16%; bottom: -8%; opacity: 0.38; }
.pug-h { width: min(220px, 20vw); height: min(220px, 20vw); left: 46%; top: 46%; opacity: 0.32; }
.pug-i { width: min(280px, 24vw); height: min(280px, 24vw); right: 24%; bottom: 2%; opacity: 0.42; }

.atmosphere { display: none; }

.shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  overflow: hidden;
  gap: 0;
}

.rail {
  position: relative;
  z-index: 3;
  min-height: 0;
  height: 100%;
  overflow: auto;
  padding: 0.9rem 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
}

.worker {
  padding: 0.9rem 0.85rem 0.85rem;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  min-width: 0;
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 0.9rem;
  min-width: 0;
}

.brand-mark {
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 1.15rem;
  object-fit: cover;
  background: #10141c;
  transition: filter 0.35s ease, transform 0.45s cubic-bezier(0.22, 1.05, 0.36, 1);
}

.brand:hover .brand-mark {
  filter:
    drop-shadow(0 0 5px rgba(78, 196, 255, 0.95))
    drop-shadow(0 0 14px rgba(46, 211, 198, 0.8));
}

.wordmark {
  margin: 0;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: #f4fbff;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.worker-id {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  min-width: 0;
}

.worker-id > div {
  min-width: 0;
  flex: 1;
}

.avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 18%;
  flex: none;
  background: #1c1c1c;
}

.worker-role {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.3;
}

.worker-name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.name-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.15rem;
  min-width: 0;
  width: 100%;
}

.tgid-line {
  margin: 0.9rem 0 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 0.78rem;
}

.tgid-line code {
  font-family: ui-monospace, monospace;
  color: var(--cream);
  font-size: 0.92rem;
}

.worker-stats {
  margin: 0.85rem 0 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.45rem;
  min-width: 0;
}

.worker-stats > div {
  padding: 0.55rem 0.45rem;
  border-radius: 1rem;
  background: rgba(0, 0, 0, 0.22);
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  grid-template-rows: auto auto;
  column-gap: 0.2rem;
  row-gap: 0.18rem;
  align-items: start;
}

.stat-head {
  display: contents;
}

.worker-stats dt {
  grid-column: 1;
  grid-row: 1;
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.15;
  text-transform: none;
  white-space: normal;
  overflow: visible;
}

.stat-head .tgid-toggle {
  grid-column: 2;
  grid-row: 1;
  width: 24px;
  height: 24px;
  flex: none;
  justify-self: end;
}

.worker-stats dd {
  grid-column: 1 / -1;
  grid-row: 2;
  margin: 0;
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.worker-stats > div.stat-box--compact {
  grid-template-columns: 24px;
  justify-items: stretch;
}

.worker-stats > div.stat-box--compact dt {
  display: none;
}

.worker-stats > div.stat-box--compact .tgid-toggle {
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
}

.worker-stats > div.stat-box--compact dd {
  grid-column: 1;
  grid-row: 2;
}

.delay {
  margin-top: 0.85rem;
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: center;
}

.delay-label { margin: 0; font-weight: 600; font-size: 0.88rem; }
.delay-hint { margin: 0.1rem 0 0; color: var(--muted); font-size: 0.72rem; }

.stepper {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.stepper strong { color: var(--ink); font-size: 1rem; }

.stepper button,
.text-btn,
.choose,
.nav-link,
.tile {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.stepper button {
  width: 28px;
  height: 28px;
  border-radius: calc(var(--radius) - 6px);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
}

.stepper button:hover {
  background: rgba(255, 255, 255, 0.05);
}

.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.2rem;
  flex: 1;
  min-height: 0;
}

.rail-logout {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  text-align: left;
  padding: 0.45rem 0.65rem;
  border: 0;
  border-radius: calc(var(--radius) - 4px);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: none;
}

.rail-logout:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: none;
}

.rail-logout .hq {
  width: 18px;
  height: 18px;
}

.nav-link {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  text-align: left;
  text-decoration: none;
  padding: 0.45rem 0.65rem;
  border: 0;
  border-radius: calc(var(--radius) - 4px);
  background: transparent;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.2;
  box-shadow: none;
}

.nav-link img.emoji { width: 18px; height: 18px; }

.nav-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  box-shadow: none;
  transform: translateX(3px);
}

.nav-link.active:hover {
  transform: none;
}

.nav-link.active {
  background: var(--accent);
  color: var(--ink);
  box-shadow: none;
}

.nav-link.active .hq {
  color: var(--primary);
}

.lang-switch {
  margin-top: auto;
  align-self: flex-start;
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 0.9rem;
  border: 1px solid var(--line);
  background: #12151c;
  color: var(--cyan);
  cursor: pointer;
}

.lang-switch .hq { width: 16px; height: 16px; }

.lang-switch:hover {
  color: var(--ink);
  border-color: rgba(78, 196, 255, 0.45);
}

.stage {
  position: relative;
  z-index: 1;
  min-height: 0;
  min-width: 0;
  height: 100%;
  overflow: auto;
  padding: 1.6rem 2rem 4rem;
  max-width: none;
  scroll-behavior: smooth;
}

.stage-head,
.section-head--row,
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

.stage-head { margin-bottom: 1.6rem; align-items: center; }

.stage-head h2,
.section-head h3,
.build h4,
.panel-head h4 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.stage-head h2 { font-size: 1.5rem; letter-spacing: -0.03em; font-weight: 600; }

.place-card {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 1.25rem;
  width: fit-content;
  min-width: 16rem;
  margin: 0 0 0.85rem;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.place-card p {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.2;
}

.place-card strong {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1;
  color: var(--cyan);
  font-variant-numeric: tabular-nums;
}

.kicker {
  margin: 0 0 0.2rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lede {
  margin: 0.45rem 0 0;
  max-width: 62ch;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.98rem;
}

.block {
  margin-top: 2.4rem;
  scroll-margin-top: 1.2rem;
}

.section-head h3 { font-size: 1.15rem; margin-top: 0.15rem; }

.text-btn {
  border-radius: 1rem;
  padding: 0.42rem 0.8rem;
  white-space: nowrap;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: -0.006em;
  line-height: 1.2;
}

.text-btn--solid {
  font-weight: 500;
}

.text-btn--solid.is-off,
.text-btn--solid.is-off:hover {
  border-color: var(--line);
  background: transparent;
  color: var(--ink);
}

.text-btn,
.btn-build,
.login-submit,
.help-send,
.mentor-btn,
.lang-pill {
  position: relative;
  z-index: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background-color: transparent;
  color: var(--ink);
  box-shadow: none;
  transition:
    color 0.15s ease,
    background-color 0.15s ease,
    border-color 0.15s ease,
    opacity 0.15s ease;
}

.text-btn::before,
.btn-build::before,
.login-submit::before,
.help-send::before,
.mentor-btn::before,
.lang-pill::before,
.text-btn::after,
.btn-build::after,
.login-submit::after,
.help-send::after,
.mentor-btn::after,
.lang-pill::after {
  content: none;
}

.text-btn:hover,
.lang-pill:hover:not(.is-on) {
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  box-shadow: none;
}

.btn-build,
.login-submit,
.help-send,
.mentor-btn,
.text-btn--solid {
  border-color: transparent;
  background: var(--primary);
  color: var(--primary-ink);
}

.btn-build:hover,
.login-submit:hover:not(:disabled),
.help-send:hover,
.mentor-btn:hover,
.text-btn--solid:hover {
  background: #6fd4ff;
  color: var(--primary-ink);
  box-shadow: none;
}

.lang-pill.is-on {
  border-color: transparent;
  background: var(--primary);
  color: var(--primary-ink);
}

.login-submit:disabled {
  opacity: 0.55;
  box-shadow: none;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

@keyframes sheet-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

@keyframes backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.kpi-row {
  margin-top: 1.1rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.kpi {
  padding: 1rem 1.05rem 0.95rem;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
}

.kpi .hq { width: 18px; height: 18px; margin-bottom: 0.55rem; }

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

.kpi strong {
  display: block;
  margin-top: 0.15rem;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.stats-split,
.board-grid,
.build-grid {
  margin-top: 0.85rem;
  display: grid;
  gap: 0.75rem;
}

.stats-split {
  grid-template-columns: 1.4fr 0.8fr;
  align-items: stretch;
}

.panel--stats-peer {
  display: flex;
  flex-direction: column;
  min-height: min(22rem, 52vh);
  max-height: min(22rem, 52vh);
}

.stats-panel-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.panel--connect-chart .area--chart {
  flex: 1;
  min-height: 0;
  margin-top: 0.85rem;
  display: flex;
  flex-direction: column;
}

.panel--connect-chart .area--chart svg {
  flex: 1;
  width: 100%;
  min-height: 8rem;
  height: auto;
}

.panel--connect-chart .area-labels {
  flex-shrink: 0;
}
.board-grid { grid-template-columns: 1fr 1fr; }
.build-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.board-wide { grid-column: 1 / -1; }

.panel,
.build {
  padding: 1.05rem 1.1rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.panel,
.build,
.place-card,
.tile {
  background: var(--card);
}

.panel-head h4,
.build h4,
.delay-card h4 {
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.view { display: none; }
.view.active {
  display: block;
  animation: view-in 0.42s var(--btn-ease);
}

.view.active .panel,
.view.active .build,
.view.active .kpi,
.view.active .tile,
.view.active .retriever-card,
.view.active .place-card {
  animation: card-in 0.5s var(--btn-ease) backwards;
}

.view.active .kpi:nth-child(2),
.view.active .tile:nth-child(2),
.view.active .build:nth-child(2) { animation-delay: 0.05s; }
.view.active .kpi:nth-child(3),
.view.active .tile:nth-child(3),
.view.active .build:nth-child(3) { animation-delay: 0.1s; }
.view.active .kpi:nth-child(4),
.view.active .tile:nth-child(4),
.view.active .build:nth-child(4) { animation-delay: 0.15s; }

@keyframes ios-in {
  from { opacity: 0; transform: translate3d(22px, 0, 0) scale(0.985); }
  to { opacity: 1; transform: none; }
}

@keyframes ios-push {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@keyframes ios-pop {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.ios-push { animation: ios-push 0.28s var(--btn-ease); }
.ios-pop { animation: ios-pop 0.28s var(--btn-ease); }

button,
.nav-link,
.help-row,
.tile,
.build {
  transition:
    box-shadow 0.22s ease,
    background-color 0.22s ease,
    color 0.22s ease,
    border-color 0.22s ease,
    opacity 0.22s ease,
    transform 0.22s ease;
}

.text-btn:active:not(:disabled),
.btn-build:active,
.login-submit:active:not(:disabled),
.mentor-btn:active,
.help-send:active,
.lang-pill:active {
  transform: scale(0.985);
}

.hq { display: inline-grid; place-items: center; width: 18px; height: 18px; flex: none; color: var(--cyan); }
.hq svg { width: 100%; height: 100%; display: block; }
.hq[data-tone="amber"] { color: var(--amber); }
.hq[data-tone="teal"] { color: var(--teal); }
.nav-link .hq { width: 18px; height: 18px; }
.tile-emoji .hq { width: 18px; height: 18px; }
.panel-head h4 .hq,
.delay-card h4 .hq,
.switch-copy .hq,
.retriever-card h4 .hq { width: 18px; height: 18px; }

.tgid-toggle {
  margin: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  flex: none;
  border-radius: 0.7rem;
  border: 1px solid var(--line);
  background: #12151c;
  color: var(--cyan);
  cursor: pointer;
}
.tgid-toggle .hq { width: 16px; height: 16px; }
.tgid-reveal {
  margin: 0.55rem 0 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  color: var(--muted);
  font-size: 0.78rem;
}
.tgid-reveal code {
  font-family: ui-monospace, monospace;
  color: var(--cream);
  font-size: 0.92rem;
}
.tgid-reveal[hidden] { display: none; }

.delay-card {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.delay-card h4 { margin: 0; }
.delay-card p { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.82rem; }
.delay-picks {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
  max-width: 28rem;
}
.delay-pick {
  position: relative;
  z-index: 1;
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--line);
  background: rgba(78, 196, 255, 0.08);
  color: var(--cyan);
  border-radius: 999px;
  padding: 0.38rem 0.7rem;
  font-size: 0.78rem;
}
.delay-pick.is-on {
  background: var(--primary);
  color: var(--primary-ink);
  border-color: transparent;
}

.panel-head p,
.build-tag {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.area { margin-top: 0.85rem; }

.area svg {
  width: 100%;
  height: 168px;
  display: block;
}

.area-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.68rem;
}

.map-board .panel-head {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
}
.map-board .panel-head p {
  max-width: 42rem;
}
.map-tools {
  position: relative;
  z-index: 2;
  margin-top: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-end;
  justify-content: space-between;
}
.map-custom {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: flex-end;
}
.map-custom label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  color: var(--muted);
  font-size: 0.72rem;
}
.map-custom input {
  color-scheme: dark;
  font: inherit;
  color: var(--ink);
  background: var(--glass-2);
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  padding: 0.38rem 0.55rem;
}
.world-map {
  position: relative;
  margin-top: 0.85rem;
  background: var(--glass-2);
  border-radius: 1rem;
  overflow: hidden;
}
.world-map svg {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
}
.world-map path {
  stroke: rgba(255, 255, 255, 0.16);
  stroke-width: 0.45;
  vector-effect: non-scaling-stroke;
}
.map-hover {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  max-width: 16rem;
  background: var(--glass-2);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 0.35rem 0.6rem;
  font-size: 0.78rem;
}
.map-hover[hidden] { display: none; }
.map-summary {
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}
.map-ranks {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.55rem 0 0;
  padding: 0;
}
.map-ranks li {
  display: flex;
  gap: 0.4rem;
  align-items: baseline;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
  font-size: 0.75rem;
  color: var(--ink);
}
.map-ranks .swatch {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 0.2rem;
  background: var(--cyan);
}

.feed,
.leaderboard,
.sales ul {
  list-style: none;
  margin: 0.8rem 0 0;
  padding: 0;
}

.feed li,
.leaderboard li,
.sales li {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.55rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.9rem;
}

.leaderboard li.lb-row {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 0.85rem;
}

.lb-rank {
  color: var(--cyan);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.lb-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-score {
  color: var(--cream);
  font-variant-numeric: tabular-nums;
}

.feed time,
.leaderboard .score,
.sales li span:last-child {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.feed li,
.feed li.feed-row {
  align-items: center;
}

.feed li.connect-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.35rem;
  margin: 0 0 0.5rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
}

.connect-card-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.connect-card-geo {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.connect-card-geo .feed-flag {
  width: 18px;
  height: 18px;
}

.connect-card-top time {
  margin-left: auto;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
}

.connect-card-hwid {
  display: block;
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--cream);
  white-space: normal;
  word-break: break-all;
  overflow: visible;
  text-overflow: clip;
}

.feed-row.feed-row--picked,
.connect-card.feed-row--picked {
  background: rgba(78, 196, 255, 0.14);
  border-color: rgba(78, 196, 255, 0.55);
  box-shadow: inset 0 0 0 1px rgba(78, 196, 255, 0.35);
}

.connect-card .feed-resteal {
  width: auto;
  height: auto;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.feed-row.feed-row--pickable:hover {
  background: rgba(255, 255, 255, 0.04);
}

.feed-row.feed-row--picked {
  background: rgba(78, 196, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(78, 196, 255, 0.28);
}

.panel-head--feed {
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.panel-head--feed h4 {
  margin-right: auto;
}

.feed-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.feed-bar .text-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.feed-bar-count {
  font-variant-numeric: tabular-nums;
  opacity: 0.85;
}

.panel--connect-feed .feed-scroll {
  flex: 1;
  min-height: 0;
  margin-top: 0.35rem;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 0.2rem;
  scrollbar-gutter: stable;
}

.panel--connect-feed .feed-scroll::-webkit-scrollbar {
  width: 6px;
}

.panel--connect-feed .feed-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
}

.panel--connect-feed .feed-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(78, 196, 255, 0.35);
}

.panel--connect-feed .feed {
  margin-top: 0;
}

.feed-main {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  column-gap: 0.45rem;
  row-gap: 0.2rem;
  align-items: center;
  min-width: 0;
  flex: 1;
}

.feed-hwid-row {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.feed-hwid-row .feed-hwid {
  flex: 1;
  min-width: 0;
}

.feed-geo {
  display: contents;
}

.feed-geo.feed-geo--empty {
  display: block;
  grid-column: 1 / -1;
  color: var(--muted);
  font-weight: 500;
}

.feed-flag {
  grid-column: 1;
  grid-row: 1;
  width: 22px;
  height: 22px;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

.feed-code {
  grid-column: 2;
  grid-row: 1;
  letter-spacing: 0.06em;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--cream);
  line-height: 1.2;
}

.feed-hwid {
  margin: 0;
  font-family: ui-monospace, monospace;
  font-size: 0.78rem;
  color: var(--cream);
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.35;
  white-space: normal;
  word-break: break-all;
  overflow: visible;
  text-overflow: clip;
}

.feed-resteal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.45rem;
  background: rgba(255, 255, 255, 0.04);
  color: var(--cyan);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.feed-resteal:hover:not(:disabled) {
  background: rgba(78, 196, 255, 0.12);
  border-color: rgba(78, 196, 255, 0.35);
}

.feed-resteal:disabled {
  opacity: 0.45;
  cursor: wait;
}

.feed-resteal .hq {
  width: 0.95rem;
  height: 0.95rem;
}

.tile-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.tile-grid--tight { grid-template-columns: 1fr; }

.tile {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  text-align: left;
  padding: 0.9rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
  transition: border-color 0.22s ease, background 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}

.tile:hover,
.build:hover {
  border-color: rgba(78, 196, 255, 0.45);
  background: #1c212c;
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
}

.tile-emoji {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: calc(var(--radius) - 6px);
  background: var(--accent);
}

.tile-emoji img.emoji { width: 26px; height: 26px; margin: 0; }

.tile-copy { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.tile-title { font-weight: 600; }
.tile-hint { color: var(--muted); font-size: 0.82rem; line-height: 1.35; }

.build-top { display: flex; gap: 0.75rem; align-items: center; margin-bottom: 0.7rem; }
.build p { margin: 0; color: #d5e2ee; line-height: 1.5; font-size: 0.92rem; }
.build ul {
  margin: 0.7rem 0 0.9rem;
  padding-left: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}
.build strong { color: var(--cream); font-weight: 600; }

.build {
  display: flex;
  flex-direction: column;
}

.btn-build {
  width: 100%;
  margin-top: auto;
  border-radius: 1rem;
  padding: 0.55rem 0.8rem;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: -0.006em;
  line-height: 1.2;
}

.util-list { display: flex; flex-direction: column; margin-top: 0.35rem; }

.util-btn {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  text-align: left;
  padding: 0.62rem 0.15rem;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0;
  background: transparent;
  color: inherit;
  box-shadow: none;
  text-decoration: none;
  cursor: pointer;
}

.util-btn:last-child { border-bottom: 0; }
.util-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  transform: none;
  color: inherit;
  box-shadow: none;
}
.util-btn span:last-child { display: flex; flex-direction: column; gap: 0.12rem; min-width: 0; }
.util-title { font-weight: 600; }
.util-hint { color: var(--muted); font-size: 0.78rem; line-height: 1.35; }
.util-groups {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.log-panel { margin-top: 0.75rem; }
.log-panel pre {
  margin: 0.8rem 0 0;
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  background: rgba(0, 0, 0, 0.45);
  color: #d7f3ff;
  font-size: 0.82rem;
  line-height: 1.55;
  overflow: auto;
  max-height: 28rem;
  white-space: pre-wrap;
}

.ach-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.75rem;
}

.ach-item {
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: transparent;
  color: var(--ink);
  padding: 0.45rem 0.7rem;
  font: inherit;
  cursor: pointer;
}

.ach-item.is-on,
.ach-item:hover {
  border-color: transparent;
  background: var(--primary);
  color: var(--primary-ink);
}

.notify-row {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.switch-line,
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius);
  background: var(--glass-2);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.switch-copy { display: flex; align-items: center; gap: 0.45rem; font-weight: 500; }

.toggle { position: relative; width: 42px; height: 22px; flex: none; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #243044;
  cursor: pointer;
  transition:
    background 0.34s var(--btn-ease),
    box-shadow 0.34s var(--btn-ease),
    opacity 0.34s var(--btn-ease);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.toggle-slider::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  top: 2px;
  border-radius: 50%;
  background: #f2f6fc;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
  transition: transform 0.34s var(--btn-ease);
}
.toggle input:checked + .toggle-slider {
  background: var(--primary);
  box-shadow: none;
}
.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
}
.toggle input:focus-visible + .toggle-slider {
  outline: 2px solid rgba(78, 196, 255, 0.45);
  outline-offset: 2px;
}

.secret-note {
  margin: 0 0 0.9rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
}

.secret-note[hidden] { display: none !important; }

.secret-note p {
  margin: 0 0 0.65rem;
  color: var(--cream);
  font-size: 0.92rem;
}

.secret-note-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.secret-note-row input {
  flex: 1 1 180px;
  min-width: 0;
  height: 2.25rem;
  padding: 0 0.7rem;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: inherit;
}

.retriever-grid {
  position: relative;
  z-index: 1;
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  align-items: start;
  padding: 0.7rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--glass-2);
}

.retriever-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0.85rem 0.95rem 0.35rem;
  border-radius: calc(var(--radius) - 4px);
  background: var(--card);
  border: 1px solid var(--line);
}

.retriever-card h4 {
  margin: 0;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  gap: 0.45rem;
  align-items: center;
  font-size: 0.95rem;
  font-weight: 600;
}

.retriever-card .toggle-row {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.9rem;
}

.retriever-card .toggle-row:last-child { border-bottom: 0; }

.news-list { display: flex; flex-direction: column; gap: 0.65rem; margin-top: 0.8rem; }
.help-menu { display: flex; flex-direction: column; padding: 0.35rem 0.85rem; }
.help-menu[hidden],
.help-pane[hidden] { display: none; }
.help-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  text-align: left;
  text-decoration: none;
  color: inherit;
  padding: 0.78rem 0.15rem;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0;
  background: transparent;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none;
}
.help-row:last-child { border-bottom: 0; }
.help-row:hover {
  color: inherit;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: none;
}
.help-row.is-static { cursor: default; }
.help-row.is-static:hover { color: inherit; box-shadow: none; }
.help-pane { padding: 1rem 1.1rem 1.15rem; }
.help-pane h3 { margin: 0.7rem 0 0.85rem; font-size: 1.15rem; }
.help-back { margin-bottom: 0.2rem; }

.text-btn.help-back {
  background-color: transparent;
  color: var(--ink);
  border-color: var(--line);
  filter: none;
}

.text-btn.help-back::before,
.text-btn.help-back::after,
.text-btn.help-back:hover::before {
  opacity: 0;
  background: none;
  -webkit-mask: none;
  mask: none;
}
.help-line { margin: 0.35rem 0; line-height: 1.45; }
.help-line a, .help-owner a, .help-quote a, .help-card a { color: var(--cyan); }
.help-under { text-decoration: underline; text-underline-offset: 3px; }
.help-quote {
  margin: 0.9rem 0;
  padding: 0.85rem 1rem;
  border-left: 3px solid #c45b55;
  border-radius: 0 12px 12px 0;
  background: rgba(196, 91, 85, 0.12);
}
.help-quote p { margin: 0 0 0.7rem; }
.help-quote p:last-child { margin-bottom: 0; }
.help-quote ol { margin: 0.45rem 0 0; padding-left: 1.2rem; }
.help-quote li { margin: 0.2rem 0; }
.help-owner { margin: 0.4rem 0 0; font-weight: 600; }
.help-card {
  margin: 0.4rem 0 0.9rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.help-card-kicker { margin: 0 0 0.25rem; color: var(--muted); font-size: 0.78rem; }
.help-card strong { display: block; margin-bottom: 0.3rem; }
.help-card p { margin: 0 0 0.75rem; }
.help-send {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 0.9rem;
  border-radius: 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: -0.006em;
  text-decoration: none;
}
.help-pane .help-menu { padding-left: 0; padding-right: 0; }

.mentor-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.35rem;
}

.mentor-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.6rem;
  min-height: 0;
  padding: 0.65rem 0.85rem;
  border-radius: 1rem;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.35;
  text-align: left;
}

.news-item {
  padding: 0.7rem 0.8rem;
  border-radius: var(--radius);
  background: rgba(78, 196, 255, 0.05);
  line-height: 1.4;
}
.news-item time { display: block; color: var(--muted); font-size: 0.75rem; margin-bottom: 0.2rem; }

.leaderboard { counter-reset: rank; }
.leaderboard li { align-items: baseline; }
.leaderboard li span:first-child { font-variant-numeric: tabular-nums; }

.toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  z-index: 5;
  transform: translateX(-50%) translateY(140%);
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: rgba(8, 20, 18, 0.95);
  border: 1px solid var(--cyan);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  transition: transform 0.3s ease;
}
.toast.visible { transform: translateX(-50%) translateY(0); }

@media (max-width: 1100px) {
  .kpi-row,
  .build-grid { grid-template-columns: 1fr 1fr; }
  .stats-split,
  .util-groups,
  .notify-row,
  .board-grid { grid-template-columns: 1fr; }
  .retriever-grid { grid-template-columns: 1fr; }
  .board-wide { grid-column: auto; }
}

@media (max-width: 860px) {
  html, body { height: auto; overflow: auto; }
  .shell { grid-template-columns: 1fr; height: auto; overflow: visible; }
  .rail {
    height: auto;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .stage { height: auto; overflow: visible; padding: 1.2rem 1rem 3rem; }
  .stage-head h2 { font-size: 1.8rem; }
  .kpi-row,
  .tile-grid,
  .build-grid { grid-template-columns: 1fr; }
  .delay-card { flex-direction: column; align-items: flex-start; }
  .delay-picks { justify-content: flex-start; }
}

body.is-locked .shell,
body.is-locked #pugs-layer,
body.is-locked .toast {
  display: none !important;
}

body.is-authed .login-page {
  display: none !important;
}

.login-page {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.6rem;
  padding: 1.5rem;
  background:
    radial-gradient(ellipse 55% 42% at 50% 38%, rgba(78, 196, 255, 0.11), transparent 70%),
    var(--bg);
}

.login-logo {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: inherit;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #f4fbff;
}

.login-name {
  position: relative;
  display: inline-block;
  color: transparent;
  -webkit-text-fill-color: transparent;
  background: var(--btn-fill);
  -webkit-background-clip: text;
  background-clip: text;
}

.login-name::after {
  content: "MopsTeam";
  position: absolute;
  left: 0;
  top: 0;
  color: #121418;
  -webkit-text-fill-color: #121418;
  background: var(--btn-fill);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-stroke: 1.45px transparent;
  pointer-events: none;
  transition: opacity 0.28s var(--btn-ease);
}

.login-name:hover::after {
  opacity: 0;
}

.login-logo-gif {
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 1.15rem;
  object-fit: cover;
  background: #10141c;
}

.login-card {
  width: min(400px, 100%);
  margin: 0;
  padding: 1.5rem 1.35rem 1.35rem;
  border-radius: 1.75rem;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  animation: rise 0.55s var(--btn-ease) 0.06s backwards;
}

.login-logo {
  animation: rise 0.45s var(--btn-ease) backwards;
}

.login-badge {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: calc(var(--radius) - 4px);
  color: var(--primary);
  background: var(--accent);
}

.login-title {
  margin: 0.85rem 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.login-sub,
.login-wait {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.login-error {
  margin: 0.7rem 0 0;
  color: var(--red);
  font-size: 0.88rem;
}

.auth-step { display: none; }
.auth-step.is-on { display: block; margin-top: 1rem; }

.lang-row {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

.lang-pill {
  margin: 0;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
}

.login-field {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.login-field input,
.login-input-wrap {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
}

.login-input-wrap {
  position: relative;
}

.login-card input {
  width: 100%;
  box-sizing: border-box;
  height: 2.5rem;
  padding: 0 2.6rem 0 0.75rem;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.875rem;
  box-shadow: none;
}

.login-card input:focus,
.sheet input:focus,
.sheet textarea:focus,
.sheet select:focus,
.secret-note input:focus {
  outline: none;
  border-color: rgba(78, 196, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(78, 196, 255, 0.22);
}

.feed small.muted { color: var(--muted); }

.login-copy:active { transform: translateY(-50%) scale(0.96); }

.login-copy {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  margin: 0;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0.7rem;
  background: transparent;
  color: var(--cyan);
  cursor: pointer;
}

.login-submit {
  display: block;
  width: 100%;
  margin: 0.9rem 0 0;
  padding: 0.78rem 0.9rem;
  border-radius: 1rem;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: -0.006em;
  cursor: pointer;
}

.login-submit:disabled { opacity: 0.6; cursor: wait; }

.sheet-back {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 1.2rem;
  background: rgba(8, 10, 16, 0.72);
}

.sheet-back[hidden] { display: none !important; }

.sheet-back:not([hidden]) {
  animation: backdrop-in 0.2s ease;
}

.sheet {
  width: min(520px, 100%);
  max-height: min(86vh, 760px);
  overflow: auto;
  padding: 1.15rem 1.2rem 1.2rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  animation: sheet-in 0.32s var(--btn-ease);
}

.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.sheet-head h3 { margin: 0; font-size: 0.95rem; font-weight: 600; letter-spacing: -0.015em; }

.sheet label {
  display: block;
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.sheet input,
.sheet textarea,
.sheet select {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: inherit;
}

.sheet textarea { min-height: 110px; resize: vertical; }

.sheet .login-submit { margin-top: 0.9rem; }

.sheet-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.sheet-actions .login-submit { margin-top: 0; }

.sheet-hint {
  margin: 0.35rem 0 0.15rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.sheet-msg {
  margin: 0.8rem 0 0;
  white-space: pre-wrap;
  color: var(--cream);
  font-size: 0.92rem;
}

.sheet-links a {
  color: var(--cyan);
}

.login-back {
  display: block;
  width: 100%;
  margin: 0.55rem 0 0;
  padding: 0.45rem;
  border: 0;
  border-radius: 1rem;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease;
}

.login-back:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
}

.btn-build:hover,
.login-submit:hover:not(:disabled),
.help-send:hover,
.mentor-btn:hover,
.text-btn--solid:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(78, 196, 255, 0.22);
}

.btn-build:active,
.login-submit:active:not(:disabled),
.help-send:active,
.mentor-btn:active,
.text-btn--solid:active {
  transform: scale(0.98);
}

.stub-legend {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.stub-legend-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
}

.stub-status-wrap {
  margin: 0 0 1.25rem;
}

.stub-status-title {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--ink);
}

.stub-status-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  background: rgba(0, 0, 0, 0.22);
  border-radius: 0.85rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.stub-status-table th,
.stub-status-table td {
  padding: 0.5rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.stub-status-table thead th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stub-status-table tbody tr:last-child td {
  border-bottom: none;
}

.stub-status-cell.is-clear {
  color: #7dffc3;
  font-weight: 600;
}
.stub-status-cell.is-runtime {
  color: #ffd963;
  font-weight: 600;
}
.stub-status-cell.is-detected {
  color: #ff9b9b;
  font-weight: 600;
}

.stub-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: #1a1400;
}

.stub-pill.is-clear { background: #1f8a4c; color: #f4fff6; }
.stub-pill.is-runtime { background: #e0b000; color: #1a1400; }
.stub-pill.is-detected { background: #c43b3b; color: #fff5f5; }

.btn-build.is-clear,
.btn-build.is-clear:hover {
  background: #1f8a4c;
  color: #f4fff6;
}

.btn-build.is-runtime,
.btn-build.is-runtime:hover {
  background: #e0b000;
  color: #1a1400;
}

.btn-build.is-detected,
.btn-build.is-detected:hover {
  background: #c43b3b;
  color: #fff5f5;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
