/* ==========================================================================
   Zinou Sniper — Eldorado boost desk
   One stylesheet, no framework. Black surfaces, ember accent.
   ========================================================================== */

:root {
  /* Graphite, not black: a cool base makes the ember read as a signal. */
  --bg: #07080b;
  --bg-soft: #0a0c11;
  --surface: #0f1218;
  --surface-2: #141821;
  --surface-3: #1b2130;
  --line: #232a38;
  --line-soft: #1a1f2a;

  --text: #eef2f8;
  --muted: #98a2b3;
  --muted-2: #6b7484;

  --accent: #ff7a1a;
  --accent-2: #ffb066;
  --accent-deep: #c9530b;
  --accent-soft: rgba(255, 122, 26, 0.13);
  --accent-line: rgba(255, 122, 26, 0.36);
  --accent-ink: #170901;

  --green: #38d39f;
  --amber: #f6c453;
  --red: #ff6b6b;
  --blue: #6aa8ff;
  --violet: #b795ff;
  --cyan: #57d3e0;

  --radius: 14px;
  --radius-sm: 10px;
  --mono: "JetBrains Mono", "SFMono-Regular", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --ring: 0 0 0 3px rgba(255, 122, 26, 0.2);
  --shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 20px 44px -32px rgba(0, 0, 0, 0.95);
  --shadow-lift: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 30px 60px -34px rgba(0, 0, 0, 1);

  --display: "Space Grotesk", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

[hidden],
.hidden {
  display: none !important;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  background-image:
    radial-gradient(1100px 640px at 82% -14%, rgba(255, 122, 26, 0.1), transparent 62%),
    radial-gradient(900px 620px at -8% 108%, rgba(106, 168, 255, 0.05), transparent 64%),
    linear-gradient(180deg, #080a0e 0%, #07080b 40%, #06070a 100%);
  background-attachment: fixed;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 20px;
  font-weight: 680;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 15px;
  font-weight: 640;
  letter-spacing: -0.01em;
}

a {
  color: inherit;
  text-decoration: none;
}

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

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #2a2520;
  border-radius: 99px;
  border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
}

/* ------------------------------------------------------------------ shell */

.app {
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  min-height: 100vh;
  background:
    radial-gradient(1000px 560px at 88% -10%, rgba(255, 122, 26, 0.08), transparent 64%),
    transparent;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 20px 14px 16px;
  background: linear-gradient(180deg, #0b0e13 0%, #090b10 55%, #080a0e 100%);
  border-right: 1px solid var(--line-soft);
  box-shadow: 1px 0 0 rgba(255, 255, 255, 0.025), 24px 0 60px -50px rgba(255, 122, 26, 0.45);
  z-index: 25;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: radial-gradient(circle at 50% 0%, #1f1712, #0c0a09 85%);
  border: 1px solid rgba(255, 122, 26, 0.28);
  box-shadow: 0 4px 18px -4px rgba(255, 122, 26, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  flex: none;
}

.brand-mark svg {
  width: 22px;
  height: 22px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}

.brand-text strong {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-text strong span {
  color: var(--accent);
  font-weight: 600;
}

.brand-text small {
  font-size: 10.5px;
  color: var(--muted-2);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 11px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 13px;
  font-weight: 520;
  border: 1px solid transparent;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease, transform 0.12s ease;
}

.nav-link svg {
  width: 16px;
  height: 16px;
  opacity: 0.85;
}

.nav-link:hover {
  background: var(--surface);
  color: var(--text);
  transform: translateX(1px);
}

.nav-link.active {
  background: linear-gradient(90deg, rgba(255, 122, 26, 0.14), rgba(255, 122, 26, 0.045));
  border-color: var(--accent-line);
  color: var(--accent-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.nav-link.active::before {
  content: "";
  position: absolute;
  left: -15px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, var(--accent-2), var(--accent-deep));
  box-shadow: 0 0 14px rgba(255, 122, 26, 0.6);
}

.nav-link.active svg {
  opacity: 1;
}

.nav-badge {
  margin-left: auto;
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 99px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.nav-link.active .nav-badge {
  background: rgba(255, 122, 26, 0.18);
  color: var(--accent);
}

.sidebar-foot {
  margin-top: auto;
  padding: 0 4px;
}

.side-state {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 11px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.35;
}

.side-state .dot {
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: var(--muted-2);
  flex: none;
}

.side-state.on .dot {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 122, 26, 0.16);
}

.side-state.off .dot {
  background: var(--muted-2);
}

.content {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 32px 14px;
  background: linear-gradient(180deg, rgba(10, 12, 17, 0.94), rgba(8, 10, 14, 0.82));
  backdrop-filter: blur(18px) saturate(130%);
  border-bottom: 1px solid var(--line-soft);
  box-shadow: 0 1px 0 rgba(255, 122, 26, 0.06);
}

/* A quiet label above the page name: the shell always says where you are. */
.topbar-kicker {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.85;
  margin-bottom: 3px;
}

.topbar-left h1, h1, h2, h3 {
  font-family: var(--display);
  letter-spacing: -0.015em;
}

.topbar-left {
  min-width: 0;
}

.topbar-left h1 {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-left p {
  margin-top: 2px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.view {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  max-width: 1320px;
  padding: 24px 32px 72px;
}

/* ------------------------------------------------------------- primitives */

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

.small {
  font-size: 13px;
}

.tiny {
  font-size: 12px;
  line-height: 1.55;
}

.nowrap {
  white-space: nowrap;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.row.wrap {
  flex-wrap: wrap;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.k2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.k3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.k4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.hint {
  font-size: 12px;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}

.section-title {
  font-size: 11px;
  font-weight: 640;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 2px;
}

.divider {
  height: 1px;
  background: var(--line-soft);
  margin: 4px 0;
}

/* ------------------------------------------------------------------ cards */

.card {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.028), rgba(255, 255, 255, 0) 38%), var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent 4%, rgba(255, 122, 26, 0.45), transparent 96%);
  opacity: 0.55;
  pointer-events: none;
}

.card:hover {
  border-color: #3a3129;
  box-shadow: var(--shadow-lift);
}

.card.pad-lg {
  padding: 22px 24px;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.card-head h2 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-head .hint {
  margin-top: 2px;
}

.card-head > .row {
  flex: none;
}

.card-sub {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
}

.kpi {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "label icon"
    "value icon"
    "sub sub";
  align-items: start;
  gap: 2px 12px;
  min-height: 104px;
  overflow: hidden;
}

.kpi-label {
  grid-area: label;
  font-size: 10.5px;
  font-weight: 640;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.kpi-value {
  grid-area: value;
  font-size: 30px;
  font-weight: 720;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  margin-top: 6px;
}

.kpi-value.accent {
  color: var(--accent);
  text-shadow: 0 0 30px rgba(255, 122, 26, 0.28);
}

.kpi-sub {
  grid-area: sub;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.kpi-icon {
  grid-area: icon;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--accent-2);
  background: radial-gradient(120% 120% at 30% 20%, rgba(255, 122, 26, 0.22), rgba(255, 122, 26, 0.05));
  border: 1px solid var(--accent-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  flex: none;
}

.kpi-icon svg {
  width: 17px;
  height: 17px;
}

.kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 7px 16px;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  font-size: 13px;
}

.kv dt {
  color: var(--muted-2);
  font-size: 12px;
}

.kv dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.stat-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}

.stat-line:last-child {
  border-bottom: none;
}

.stat-line .k {
  color: var(--muted);
}

.stat-line .v {
  font-variant-numeric: tabular-nums;
  font-weight: 560;
}

/* ----------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-3), var(--surface-2));
  color: var(--text);
  font-size: 13px;
  font-weight: 560;
  letter-spacing: -0.005em;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease, transform 0.06s ease, box-shadow 0.14s ease;
}

.ico svg {
  display: block;
  width: 100%;
  height: 100%;
}

.btn:hover {
  border-color: #463b30;
  color: #fff6ec;
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.btn.primary {
  background: linear-gradient(180deg, var(--accent-2), var(--accent) 58%, var(--accent-deep));
  border-color: rgba(255, 122, 26, 0.9);
  color: var(--accent-ink);
  font-weight: 680;
  box-shadow: 0 12px 26px -16px rgba(255, 122, 26, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.32);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.12);
}

.btn.primary:hover {
  background: linear-gradient(180deg, #ffb273, var(--accent) 58%, var(--accent-deep));
  border-color: #ffa259;
  color: var(--accent-ink);
  box-shadow: 0 16px 30px -16px rgba(255, 122, 26, 1), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn.ghost {
  background: transparent;
}

.btn.ghost:hover {
  background: var(--surface-2);
}

.btn.danger {
  background: rgba(255, 112, 112, 0.08);
  border-color: rgba(255, 112, 112, 0.38);
  color: var(--red);
}

.btn.danger:hover {
  background: rgba(255, 112, 112, 0.16);
}

.btn.small {
  height: 29px;
  padding: 0 11px;
  font-size: 12px;
  border-radius: 8px;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

.icon-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* ------------------------------------------------------------------ forms */

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 4px;
}

.field > label {
  font-size: 10.5px;
  font-weight: 620;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.input,
.select,
.textarea {
  width: 100%;
  background: #0d0b09;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  padding: 9px 12px;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.input::placeholder,
.textarea::placeholder {
  color: #6b6157;
}

.select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 16px, calc(100% - 12px) 16px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
  cursor: pointer;
}

.textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.6;
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: #3a3229;
}

.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible {
  outline: none;
  border-color: var(--accent-line);
  box-shadow: var(--ring);
  background: #100d0b;
}

input[type="checkbox"] {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: #0d0b09;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  flex: none;
  transition: background 0.12s ease, border-color 0.12s ease;
}

input[type="checkbox"]::after {
  content: "";
  width: 8px;
  height: 4px;
  border-left: 2px solid var(--accent-ink);
  border-bottom: 2px solid var(--accent-ink);
  transform: rotate(-45deg) translateY(-1px) scale(0);
  transition: transform 0.12s ease;
}

input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}

input[type="checkbox"]:checked::after {
  transform: rotate(-45deg) translateY(-1px) scale(1);
}

label.check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}

/* ------------------------------------------------------------------ chips */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 11px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 520;
  cursor: pointer;
  transition: all 0.14s ease;
}

.chip:hover {
  color: var(--text);
  border-color: #3a3229;
  background: var(--surface-3);
}

.chip.active {
  background: var(--accent-soft);
  border-color: rgba(255, 122, 26, 0.35);
  color: var(--accent);
}

.chip:disabled {
  opacity: 0.5;
  cursor: default;
}

/* ----------------------------------------------------------------- badges */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 99px;
  border: 1px solid transparent;
  font-size: 11px;
  font-weight: 620;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: currentColor;
  flex: none;
}

.badge.green {
  color: var(--green);
  background: rgba(95, 220, 156, 0.1);
  border-color: rgba(95, 220, 156, 0.26);
}

.badge.amber {
  color: var(--amber);
  background: rgba(246, 189, 99, 0.1);
  border-color: rgba(246, 189, 99, 0.26);
}

.badge.red {
  color: var(--red);
  background: rgba(255, 112, 112, 0.1);
  border-color: rgba(255, 112, 112, 0.26);
}

.badge.blue {
  color: var(--blue);
  background: rgba(115, 169, 255, 0.1);
  border-color: rgba(115, 169, 255, 0.26);
}

.badge.violet {
  color: var(--violet);
  background: rgba(183, 149, 255, 0.1);
  border-color: rgba(183, 149, 255, 0.26);
}

.badge.cyan {
  color: var(--cyan);
  background: rgba(103, 211, 211, 0.1);
  border-color: rgba(103, 211, 211, 0.26);
}

.badge.gray {
  color: var(--muted);
  background: var(--surface-2);
  border-color: var(--line);
}

/* ---------------------------------------------------------------- notices */

.notice {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  background: var(--surface-2);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
}

.notice strong {
  color: var(--text);
  font-weight: 620;
}

.notice.info {
  border-left-color: var(--blue);
  background: rgba(115, 169, 255, 0.06);
}

.notice.warn {
  border-left-color: var(--amber);
  background: rgba(246, 189, 99, 0.06);
}

.notice.danger {
  border-left-color: var(--red);
  background: rgba(255, 112, 112, 0.06);
}

.notice.ok {
  border-left-color: var(--accent);
  background: var(--accent-soft);
}

/* ----------------------------------------------------------------- tables */

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: linear-gradient(180deg, var(--surface-3), var(--surface-2));
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 640;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  backdrop-filter: blur(8px);
}

.table thead th.num {
  text-align: right;
}

.table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

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

.table tbody tr.clickable {
  cursor: pointer;
  transition: background 0.12s ease;
}

.table tbody tr.clickable:hover {
  background: linear-gradient(90deg, rgba(255, 122, 26, 0.07), rgba(255, 122, 26, 0.015));
  box-shadow: inset 2px 0 0 var(--accent);
}

.table tbody tr.clickable:hover .btn {
  color: var(--accent);
  border-color: rgba(255, 122, 26, 0.35);
}

.table tbody td strong {
  font-weight: 600;
}

.table .cell-strong {
  color: var(--text);
  font-weight: 560;
}

/* --------------------------------------------------------------- messages */

.msg-preview {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
  background: #12100d;
  font-size: 13px;
  line-height: 1.6;
  color: #f0e9df;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-width: 640px;
  min-height: 46px;
}

.chat-image-preview {
  max-width: 280px;
  max-height: 160px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0d0b09;
  margin-top: 8px;
}

/* ------------------------------------------------------------------ empty */

.empty {
  padding: 28px 18px;
  text-align: center;
  color: var(--muted-2);
  font-size: 12.5px;
  line-height: 1.6;
}

.empty strong {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

/* ---------------------------------------------------------------- spinner */

.spinner {
  width: 15px;
  height: 15px;
  border-radius: 99px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
  flex: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 40px;
  color: var(--muted);
  font-size: 13px;
}

/* ------------------------------------------------------- sign-in stage */
/*
 * One press on Connect, then this: a browser opens, a session is handed over
 * and the keys are minted — several seconds where there is nothing useful to
 * read. The animated mark carries the wait instead of a line of technical text
 * that changes three times.
 */

.link-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 18px 12px 10px;
  animation: link-in 0.35s ease both;
}

.link-orbit {
  position: relative;
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
}

.link-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--accent);
  border-right-color: var(--accent-2);
  animation: link-spin 1.1s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite;
}

.link-ring.alt {
  inset: 9px;
  border-top-color: transparent;
  border-right-color: transparent;
  border-bottom-color: var(--accent-line);
  animation-direction: reverse;
  animation-duration: 1.8s;
}

.link-logo {
  width: 46px;
  height: 46px;
  object-fit: contain;
  border-radius: 13px;
  background: #120a05;
  padding: 7px;
  box-shadow: 0 0 0 1px var(--accent-line), 0 0 26px rgba(255, 122, 26, 0.35);
  animation: link-pulse 1.6s ease-in-out infinite;
}

.link-title {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--text);
}

.link-sub {
  color: var(--muted);
  font-size: 12.5px;
  max-width: 34ch;
}

.link-bar {
  width: 190px;
  height: 3px;
  border-radius: 99px;
  overflow: hidden;
  background: var(--line);
  margin-top: 2px;
}

.link-bar span {
  display: block;
  height: 100%;
  width: 45%;
  border-radius: 99px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent);
  animation: link-sweep 1.35s ease-in-out infinite;
}

@keyframes link-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes link-pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 1px var(--accent-line), 0 0 18px rgba(255, 122, 26, 0.22);
  }
  50% {
    transform: scale(1.06);
    box-shadow: 0 0 0 1px var(--accent-line), 0 0 34px rgba(255, 122, 26, 0.45);
  }
}

@keyframes link-sweep {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(240%);
  }
}

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

@media (prefers-reduced-motion: reduce) {
  .link-ring,
  .link-ring.alt,
  .link-logo,
  .link-bar span {
    animation: none;
  }
  .link-bar span {
    width: 100%;
    opacity: 0.6;
  }
}

/* ---------------------------------------------------------------- conn */

.conn-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 11px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 550;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.conn-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: var(--muted-2);
  flex: none;
}

.conn-pill.live {
  color: var(--accent);
  border-color: rgba(255, 122, 26, 0.3);
  background: var(--accent-soft);
}

.conn-pill.live .dot {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 122, 26, 0.16);
}

.conn-pill.demo {
  color: var(--amber);
  border-color: rgba(246, 189, 99, 0.3);
}

.conn-pill.demo .dot {
  background: var(--amber);
}

.conn-pill.error {
  color: var(--red);
  border-color: rgba(255, 112, 112, 0.3);
}

.conn-pill.error .dot {
  background: var(--red);
}

/* ----------------------------------------------------------------- drawer */

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 60;
  width: min(480px, 100vw);
  height: 100vh;
  overflow-y: auto;
  padding: 22px 24px 40px;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -30px 0 60px -40px rgba(0, 0, 0, 0.9);
  animation: slide-in 0.18s ease;
}

@keyframes slide-in {
  from {
    transform: translateX(18px);
    opacity: 0.4;
  }
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(4, 5, 8, 0.62);
  backdrop-filter: blur(2px);
  animation: fade-in 0.16s ease;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}

.drawer-head h2 {
  font-size: 16px;
  font-weight: 650;
}

/* ------------------------------------------------------------------ toast */

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  max-width: 380px;
  padding: 11px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  background: #16130f;
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.5;
  box-shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.9);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: none;
}

.toast.error {
  border-left-color: var(--red);
}

.toast.ok {
  border-left-color: var(--green);
}

/* --------------------------------------------------------------- auth gate */

.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background:
    radial-gradient(700px 420px at 50% -10%, rgba(255, 122, 26, 0.08), transparent 65%),
    var(--bg);
}

.auth-wrap {
  width: min(424px, 100%);
}

.auth-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px 26px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 34px 80px -46px rgba(0, 0, 0, 0.95);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-brand .brand-mark {
  width: 32px;
  height: 32px;
}

.auth-brand strong {
  display: block;
  font-size: 15px;
  font-weight: 680;
  letter-spacing: -0.02em;
}

.auth-brand small {
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.auth-card h1 {
  font-size: 22px;
  letter-spacing: -0.02em;
}

.auth-submit {
  width: 100%;
  height: 40px;
  margin-top: 2px;
}

.auth-error {
  padding: 9px 12px;
  border-radius: 9px;
  border: 1px solid rgba(255, 112, 112, 0.35);
  background: rgba(255, 112, 112, 0.08);
  color: var(--red);
  font-size: 12.5px;
  line-height: 1.45;
}

.brand-logo {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  vertical-align: -4px;
  flex: 0 0 auto;
}

.brand-logo.small {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  vertical-align: -3px;
}

.card-head h2 .brand-logo {
  margin-right: 8px;
}

.steps {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 5px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}

.auth-toggle {
  align-self: center;
  border: 0;
  background: none;
  padding: 2px 4px;
  font: inherit;
  font-size: 12.5px;
  color: var(--violet, #ff9d4d);
  cursor: pointer;
}

.auth-toggle:hover {
  text-decoration: underline;
}

.auth-note {
  margin-top: 2px;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--muted-2);
}

/* --------------------------------------------------------------- user chip */

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 4px 3px 11px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--surface-2);
  font-size: 11.5px;
  color: var(--muted);
  max-width: 340px;
}

.user-email {
  max-width: 175px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-plan {
  padding: 1px 8px;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 620;
  white-space: nowrap;
}

.user-plan.warn {
  background: rgba(246, 189, 99, 0.14);
  color: var(--amber);
}

.user-plan.admin {
  background: rgba(115, 169, 255, 0.14);
  color: var(--blue);
}

.user-chip .btn {
  height: 24px;
  padding: 0 9px;
  font-size: 11px;
  border-radius: 99px;
}

/* -------------------------------------------------------------- responsive */

@media (max-width: 1180px) {
  .grid.k4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-right: none;
    border-bottom: 1px solid var(--line-soft);
    overflow-x: auto;
  }

  .brand {
    padding: 0;
    flex: none;
  }

  .brand-text small {
    display: none;
  }

  .nav {
    flex-direction: row;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav-link {
    height: 32px;
    padding: 0 10px;
    white-space: nowrap;
  }

  .nav-badge {
    display: none;
  }

  .sidebar-foot {
    display: none;
  }

  .topbar {
    position: static;
    padding: 14px 18px;
    flex-wrap: wrap;
  }

  .topbar-right {
    flex-wrap: wrap;
    justify-content: flex-end;
    width: 100%;
  }

  .user-email {
    max-width: 120px;
  }

  .view {
    padding: 16px 18px 48px;
  }

  .grid.k2,
  .grid.k3 {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 620px) {
  .grid.k4 {
    grid-template-columns: minmax(0, 1fr);
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .card {
    padding: 15px 16px;
  }
}

/* ------------------------------------------------------------- icons */

.empty-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin: 0 auto 10px;
  border-radius: 13px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar-left h1::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(255, 122, 26, 0.75);
  flex: none;
}

.chip.active {
  box-shadow: 0 0 0 1px rgba(255, 122, 26, 0.1), 0 8px 18px -14px rgba(255, 122, 26, 0.9);
}

.brand:hover .brand-mark {
  box-shadow: 0 10px 26px -8px rgba(255, 122, 26, 1), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.brand-mark {
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.brand:hover .brand-mark {
  transform: translateY(-1px);
}

.brand-logo {
  box-shadow: 0 4px 12px -8px rgba(0, 0, 0, 0.9);
  object-fit: contain;
}

.toast {
  border-left-width: 3px;
  background: linear-gradient(180deg, #1b1712, #121010);
  box-shadow: 0 26px 60px -30px rgba(0, 0, 0, 1), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.auth-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 30%), var(--surface);
  border-radius: 20px;
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.8;
}

.notice {
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.table-wrap {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.conn-pill,
.user-chip,
.side-state {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

@media (max-width: 900px) {
  .nav-link.active::before {
    display: none;
  }

  .nav-link {
    border-radius: 99px;
  }

  .kpi {
    min-height: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------------------------------------------------------------- settings */

/* A quiet icon tile on each Settings card: it reads as a section marker, not
   a control, so it never competes with the buttons. */
.settings-badge {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  color: var(--accent-2);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
}

.settings-game-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}


/* ==========================================================================
   Messages — a fixed list column and a thread that takes the rest.
   Grid, not flex: a long buyer name can never squeeze the thread out of view,
   which is what made the first version render as a single column of rows.
   ========================================================================== */

.messages-shell {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

@media (max-width: 960px) {
  .messages-shell {
    grid-template-columns: minmax(0, 1fr);
  }
}

.msg-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 62vh;
  overflow-y: auto;
}

.msg-item {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  font: inherit;
  color: inherit;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 10px;
  cursor: pointer;
}

.msg-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.msg-item.active {
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.msg-item-name {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.msg-item-name strong {
  font-size: 13px;
}

.msg-item-last {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msg-thread {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 220px;
  max-height: 58vh;
  overflow-y: auto;
  padding: 2px;
}

.msg-bubble {
  max-width: 80%;
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  white-space: pre-wrap;
  word-break: break-word;
}

.msg-bubble.mine {
  margin-left: auto;
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
}

.msg-time {
  margin-top: 3px;
  font-size: 11px;
  opacity: 0.65;
}

/* Messages, second pass: a searchable list with avatars, chips and a live
   thread. These rules follow the first block on purpose — the list row became
   a flex row (avatar + text + badge), so the earlier display:block is overridden
   here rather than edited in place. */

.msg-search {
  margin: 10px 0 8px;
}

.msg-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.msg-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.msg-row {
  flex: 1 1 auto;
  min-width: 0;
}

.msg-name {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

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

.msg-chip {
  flex: 0 0 auto;
  font-size: 10px;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-2);
  border: 1px solid var(--accent-line);
}

.msg-avatar {
  position: relative;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #0d0b09;
  overflow: hidden;
}

.msg-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.msg-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.msg-head .msg-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 14px;
}

.msg-unread {
  flex: 0 0 auto;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

.msg-tick {
  color: var(--accent-2);
}

.msg-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--green);
}

.msg-live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(72, 209, 141, 0.16);
}

/* Not live: paired-but-quiet, or never paired. The dot used to stay green and
   say "Live" while the browser had stopped answering. */
.msg-live.off {
  color: var(--amber);
}

.msg-live.off::before {
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(246, 196, 83, 0.16);
}

/* --------------------------------------------------------------------------
   Messages, third pass: the day, the money and the lines a seller sends all
   day. The thread gained an offer bar (price and the floor the AI may go to),
   day dividers, quick replies above the composer, and a counter in the sidebar
   so a waiting buyer is visible without opening the page.
   -------------------------------------------------------------------------- */

.nav-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0;
}

.msg-day {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 2px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.msg-day::before,
.msg-day::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--line-soft);
}

.msg-day span {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
}

.msg-offer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 10px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  font-size: 12px;
}

.msg-offer-label {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 10px;
}

.msg-offer strong {
  font-size: 14px;
}

.msg-offer-floor {
  color: var(--muted);
}

.msg-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.msg-quick .chip {
  cursor: pointer;
}

/* The tail on the newest side of a bubble is what makes a thread read as a
   conversation rather than a stack of boxes. */
.msg-bubble {
  border-radius: 14px;
  animation: msg-in 0.16s ease-out;
}

.msg-bubble.mine {
  border-bottom-right-radius: 4px;
}

.msg-bubble:not(.mine) {
  border-bottom-left-radius: 4px;
}

/* A reply shown before the browser confirmed it: the words are on screen
   immediately so the seller is not typing into a void, and the dashed edge
   says it is still on its way. */
.msg-bubble.pending {
  opacity: 0.75;
  border-style: dashed;
}

.msg-bubble.pending .msg-time {
  font-style: italic;
}

/* A picture in a chat: the photo the buyer sent, or the one your offer carried.
   It used to arrive as a URL in a bubble, which is not a picture. */
.msg-pic {
  display: block;
  max-width: 260px;
  max-height: 320px;
  border-radius: 10px;
  object-fit: cover;
  cursor: zoom-in;
}

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

/* --------------------------------------------------------------------------
   Console: the whole account in one terminal. Monospace, newest first, one
   colour per level — a quiet line is neutral, a waiting line is amber and a
   failure is the only thing that is red.
   -------------------------------------------------------------------------- */

.console {
  margin-top: 4px;
  max-height: min(62vh, 640px);
  overflow-y: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(10, 9, 8, 0.96), rgba(5, 5, 6, 0.96));
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  scrollbar-width: thin;
}

.console-line {
  display: grid;
  grid-template-columns: 68px 52px 62px minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: baseline;
  padding: 4px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.028);
  color: var(--text);
}

.console-line:last-child {
  border-bottom: 0;
}

.console-line:hover {
  background: rgba(255, 255, 255, 0.032);
}

.console-time {
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}

.console-level {
  font-size: 10px;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.console-level.ok {
  color: var(--green);
}

.console-level.info {
  color: var(--muted-2);
}

.console-level.warn {
  color: var(--amber);
}

.console-level.error {
  color: var(--red);
}

.console-src {
  color: var(--accent-2);
  opacity: 0.75;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.06em;
}

.console-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.console-line.error .console-text {
  color: #ffd9d9;
}

.console-line.warn .console-text {
  color: #ffe9c2;
}

.console-price {
  color: var(--green);
  font-variant-numeric: tabular-nums;
}

.console-ms {
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 760px) {
  .console-line {
    grid-template-columns: 60px 46px minmax(0, 1fr);
  }
  .console-src,
  .console-price,
  .console-ms {
    display: none;
  }
}

/* The robot's own reason for being quiet: a hand-off is deliberate, so it says
   so in the thread instead of leaving a chat that never answers. */
.msg-ai {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 194, 71, 0.08);
  border: 1px solid rgba(255, 194, 71, 0.28);
  color: #ffe9c2;
  font-size: 12px;
}

/* ------------------------------------------------------- composer emojis */

.emoji-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 10px;
}

.emoji-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
}

.emoji-btn:hover {
  transform: translateY(-1px);
  border-color: var(--accent-line);
  background: var(--surface-3);
}

/* The × on a muted buyer: a control inside a chip, not another chip. */
.chip-drop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  margin-left: 2px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted-2);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.chip-drop:hover {
  color: var(--red);
  background: rgba(255, 95, 95, 0.12);
}

/* ==========================================================================
   DESIGN PASS — the desk, not a template
   Graphite surfaces, one ember signal, Space Grotesk for names and JetBrains
   Mono for anything that is counted. This section only refines: layout,
   spacing and states that the blocks above already define.
   ========================================================================== */

::selection {
  background: rgba(255, 122, 26, 0.28);
  color: #fff;
}

body {
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1 {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.15;
}

h2 {
  font-size: 16px;
  font-weight: 600;
}

h3 {
  font-size: 14px;
  font-weight: 600;
}

.mono,
.kpi-value,
.table .num,
.nav-badge,
.badge,
.conn-pill,
.topbar-kicker {
  font-variant-numeric: tabular-nums;
}

.section-title {
  letter-spacing: 0.14em;
  font-size: 10px;
  color: var(--muted-2);
}

/* ------------------------------------------------------------- surfaces */

.card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.032), rgba(255, 255, 255, 0) 42%),
    var(--surface);
  border-color: var(--line-soft);
  padding: 20px 22px;
}

.card::before {
  background: linear-gradient(90deg, transparent 8%, rgba(255, 122, 26, 0.5), transparent 92%);
  opacity: 0.4;
}

.card:hover {
  border-color: var(--line);
  box-shadow: var(--shadow-lift);
  transform: translateY(-1px);
}

.card.pad-lg {
  padding: 24px 26px;
}

.card-head {
  margin-bottom: 16px;
}

/* ----------------------------------------------------------------- kpis */

.kpi {
  min-height: 112px;
}

.kpi-label {
  letter-spacing: 0.16em;
  font-size: 9.5px;
  color: var(--muted-2);
}

.kpi-value {
  font-family: var(--display);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-top: 8px;
}

.kpi-value.accent {
  text-shadow: 0 0 34px rgba(255, 122, 26, 0.3);
}

.kpi-icon {
  border-radius: 11px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent-2);
}

.kpi-sub {
  font-size: 12px;
  color: var(--muted);
}

/* ---------------------------------------------------------------- buttons */

.btn {
  gap: 7px;
  height: 35px;
  padding: 0 14px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 560;
  letter-spacing: -0.005em;
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

.btn:hover {
  background: var(--surface-3);
  border-color: #333c4d;
}

.btn.primary {
  background: linear-gradient(180deg, #ff8a34, var(--accent));
  border-color: rgba(255, 138, 52, 0.7);
  color: #1a0b02;
  font-weight: 640;
  box-shadow: 0 8px 24px -14px rgba(255, 122, 26, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn.primary:hover {
  background: linear-gradient(180deg, #ffa257, #ff8330);
}

.btn.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}

.btn.ghost:hover {
  color: var(--text);
  border-color: #333c4d;
  background: var(--surface-2);
}

.btn.small {
  height: 30px;
  border-radius: 8px;
  font-size: 11.5px;
}

.btn:focus-visible,
.chip:focus-visible,
.nav-link:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

/* ----------------------------------------------------------------- forms */

.input,
.select,
.textarea {
  background: #0b0e13;
  border-color: var(--line-soft);
  border-radius: 9px;
  padding: 10px 12px;
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--line);
}

.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible {
  border-color: var(--accent-line);
  box-shadow: var(--ring);
  outline: none;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--muted-2);
}

.field > label {
  letter-spacing: 0.12em;
  font-size: 9.5px;
}

/* ---------------------------------------------------------------- tables */

.table thead th {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
  border-bottom: 1px solid var(--line);
  padding: 9px 12px;
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}

.table tbody td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line-soft);
}

.table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.022);
}

.table .num {
  font-family: var(--mono);
  font-size: 12px;
}

/* ----------------------------------------------------------------- pills */

.badge,
.conn-pill {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 99px;
  padding: 4px 10px;
}

.badge {
  gap: 6px;
}

.conn-pill {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  color: var(--muted);
  padding: 6px 11px;
}

.conn-pill.on {
  color: var(--green);
  border-color: rgba(56, 211, 159, 0.32);
  background: rgba(56, 211, 159, 0.07);
}

.conn-pill.on .dot {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(56, 211, 159, 0.16);
}

.chip {
  border-radius: 99px;
  height: 28px;
  border-color: var(--line-soft);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11.5px;
}

.chip:hover {
  border-color: var(--line);
  color: var(--text);
}

.chip.active {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent-2);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px 5px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 99px;
  background: var(--surface);
  font-size: 11.5px;
  color: var(--muted);
}

.user-chip .user-email {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip .user-plan {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-2);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 99px;
  padding: 2px 7px;
}

.user-chip .btn {
  height: 26px;
  border-radius: 99px;
}

/* --------------------------------------------------------------- notices */

.notice {
  border-radius: 11px;
  border: 1px solid var(--line-soft);
  background: var(--surface-2);
  padding: 11px 13px;
  font-size: 12.5px;
}

.notice.warn {
  border-color: rgba(246, 196, 83, 0.34);
  background: rgba(246, 196, 83, 0.07);
  color: #ffe6b3;
}

.toast {
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface-3);
  box-shadow: var(--shadow-lift);
  font-size: 12.5px;
}

/* ------------------------------------------------------------ messages ui */

.msg-bubble {
  border-radius: 14px;
  border-color: var(--line-soft);
  background: var(--surface-2);
  font-size: 12.5px;
  line-height: 1.55;
  padding: 10px 13px;
}

.msg-bubble.mine {
  background: linear-gradient(180deg, #ff8a34, var(--accent));
  color: #1a0b02;
  border-radius: 14px 14px 4px 14px;
}

.msg-bubble:not(.mine) {
  border-radius: 14px 14px 14px 4px;
}

.msg-day span {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 99px;
  padding: 2px 9px;
}

/* -------------------------------------------------------------- scrollbars */

* {
  scrollbar-width: thin;
  scrollbar-color: #2b3342 transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-thumb {
  background: #2b3342;
  border: 3px solid transparent;
  background-clip: padding-box;
  border-radius: 99px;
}

*::-webkit-scrollbar-thumb:hover {
  background: #3a4557;
  background-clip: padding-box;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

/* -------------------------------------------------------------- responsive */

@media (max-width: 1180px) {
  .app {
    grid-template-columns: 224px minmax(0, 1fr);
  }

  .view {
    padding: 20px 24px 64px;
  }

  .topbar {
    padding: 14px 24px 13px;
  }
}

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