:root {
  --bg: #08090b;
  --bg-2: #0c0e12;
  --panel: #101217;
  --panel-2: #14171d;
  --panel-3: #191d25;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.15);
  --text: #f3f0e8;
  --text-2: #b8bac2;
  --muted: #747985;
  --accent: #d8ff54;
  --accent-ink: #101300;
  --ember: #ff7a45;
  --green: #5ee6a8;
  --red: #ff6b6b;
  --amber: #ffd166;
  --blue: #8aa8ff;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --font-display: "Instrument Serif", Georgia, serif;
  --font-sans: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sidebar: 268px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

button {
  color: inherit;
}

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

.hidden {
  display: none !important;
}

.mono {
  font-family: var(--font-mono);
}

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

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(1200px 700px at 12% -10%, rgba(216, 255, 84, 0.08), transparent 58%),
    radial-gradient(900px 600px at 100% 0%, rgba(255, 122, 69, 0.06), transparent 55%),
    linear-gradient(180deg, #08090b 0%, #08090b 60%, #060709 100%);
}

.ambient-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(90px);
  opacity: 0.4;
}

.ambient-orb-a {
  width: 46vw;
  height: 46vw;
  left: -18vw;
  top: -22vw;
  background: rgba(216, 255, 84, 0.12);
}

.ambient-orb-b {
  width: 38vw;
  height: 38vw;
  right: -14vw;
  bottom: -18vw;
  background: rgba(255, 122, 69, 0.10);
}

.ambient-grid {
  position: absolute;
  inset: 0;
  opacity: 0.24;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 80%);
}

.ambient-noise {
  position: absolute;
  inset: 0;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.boot {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  background: var(--bg);
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.boot.is-done {
  opacity: 0;
  visibility: hidden;
}

.boot-mark {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 34px;
  font-style: italic;
}

.boot-label {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.boot-line {
  width: 88px;
  height: 1px;
  overflow: hidden;
  background: var(--line);
  position: relative;
}

.boot-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform-origin: left;
  animation: boot-line 1.2s ease-in-out infinite;
}

@keyframes boot-line {
  0% { transform: scaleX(0); }
  50% { transform: scaleX(1); }
  100% { transform: scaleX(1); opacity: 0; }
}

.auth {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(420px, 0.9fr);
  min-height: 100svh;
}

.auth-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px clamp(32px, 6vw, 96px) 40px;
  border-right: 1px solid var(--line);
  overflow: hidden;
}

.auth-brand::before {
  content: "S";
  position: absolute;
  right: -0.08em;
  bottom: -0.28em;
  color: rgba(255, 255, 255, 0.025);
  font-family: var(--font-display);
  font-size: clamp(420px, 58vw, 860px);
  line-height: 0.7;
  pointer-events: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: max-content;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 24px;
  font-style: italic;
  background: rgba(255, 255, 255, 0.02);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-copy strong {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.brand-large {
  gap: 16px;
}

.brand-large .brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  font-size: 31px;
}

.brand-large .brand-copy strong {
  font-size: 21px;
}

.auth-copy {
  max-width: 720px;
  margin: auto 0;
  padding: 8vh 0;
}

.auth-copy h1 {
  margin: 18px 0 22px;
  max-width: 680px;
  font-family: var(--font-display);
  font-size: clamp(56px, 7.4vw, 116px);
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: -0.045em;
}

.auth-copy h1 em {
  color: var(--accent);
  font-weight: 400;
}

.lede {
  max-width: 500px;
  margin: 0;
  color: var(--text-2);
  font-size: clamp(16px, 1.3vw, 19px);
  font-weight: 300;
  line-height: 1.6;
}

.auth-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line-strong);
}

.auth-panel {
  display: grid;
  place-items: center;
  padding: 40px clamp(24px, 4vw, 64px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent 45%);
}

.auth-card {
  width: min(100%, 500px);
  padding: clamp(26px, 3vw, 42px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012)),
    rgba(12, 14, 18, 0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.auth-card-head {
  margin-bottom: 26px;
}

.auth-card-head h2 {
  margin: 10px 0 8px;
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 400;
  letter-spacing: -0.03em;
}

.auth-card-head .muted {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.field > span {
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  color: var(--text);
  background: rgba(0, 0, 0, 0.25);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

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

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(216, 255, 84, 0.55);
  background: rgba(0, 0, 0, 0.38);
  box-shadow: 0 0 0 4px rgba(216, 255, 84, 0.08);
}

.field input::placeholder,
.field textarea::placeholder {
  color: #5f6470;
}

.form-error {
  min-height: 18px;
  margin: 0 0 14px;
  color: var(--red);
  font-size: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.07);
}

.btn:active {
  transform: translateY(0) scale(0.99);
}

.btn:focus-visible,
.icon-btn:focus-visible,
.nav-item:focus-visible,
.user-chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.btn-primary {
  border-color: transparent;
  color: var(--accent-ink);
  background: var(--accent);
}

.btn-primary:hover {
  color: var(--accent-ink);
  background: #e4ff82;
}

.btn-ghost {
  background: transparent;
}

.btn-wide {
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
}

.btn-arrow {
  transition: transform 0.2s ease;
}

.btn:hover .btn-arrow {
  transform: translateX(3px);
}

.auth-foot {
  margin: 22px 0 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-align: center;
}

.setup-operators {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 12px;
}

.operator-card {
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.operator-card legend {
  padding: 0 6px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.operator-card .field {
  margin-bottom: 10px;
}

.app {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 100svh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  width: var(--sidebar);
  border-right: 1px solid var(--line);
  background: rgba(8, 9, 11, 0.86);
  backdrop-filter: blur(20px);
}

.sidebar-head {
  padding: 26px 22px 20px;
  border-bottom: 1px solid var(--line);
}

.nav {
  display: grid;
  gap: 4px;
  padding: 16px 14px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
  text-align: left;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.nav-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
}

.nav-item.active {
  color: var(--text);
  border-color: var(--line);
  background: linear-gradient(90deg, rgba(216, 255, 84, 0.08), rgba(255, 255, 255, 0.02));
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: currentColor;
}

.nav-icon svg {
  width: 20px;
  height: 20px;
}

.sidebar-foot {
  display: grid;
  gap: 14px;
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid var(--line);
}

.level-card {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.02);
}

.level-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.level-row .mono {
  color: var(--accent);
  font-size: 10px;
}

.level-track {
  height: 4px;
  margin: 10px 0 8px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.07);
}

.level-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.4s ease;
}

.level-card p {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 13px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.025);
  text-align: left;
}

.user-chip:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
}

.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--accent-ink);
  background: var(--accent);
  font-weight: 700;
}

.user-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.user-meta strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-meta small {
  margin-top: 2px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.user-dot {
  width: 6px;
  height: 6px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px rgba(94, 230, 168, 0.75);
}

.app-main {
  width: calc(100% - var(--sidebar));
  margin-left: var(--sidebar);
  min-height: 100svh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 78px;
  padding: 14px clamp(20px, 3vw, 38px);
  border-bottom: 1px solid var(--line);
  background: rgba(8, 9, 11, 0.72);
  backdrop-filter: blur(20px);
}

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

.topbar h1 {
  margin: 3px 0 0;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1;
}

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

.topbar-date {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.pill-private {
  color: var(--green);
  border-color: rgba(94, 230, 168, 0.22);
  background: rgba(94, 230, 168, 0.06);
}

.pulse {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0 rgba(94, 230, 168, 0.6);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(94, 230, 168, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(94, 230, 168, 0); }
  100% { box-shadow: 0 0 0 0 rgba(94, 230, 168, 0); }
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.03);
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.mobile-menu {
  display: none;
}

.view {
  width: min(100%, 1500px);
  margin: 0 auto;
  padding: clamp(22px, 3vw, 38px);
  animation: view-in 0.35s ease both;
}

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

.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.view-head h2 {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: clamp(38px, 4vw, 62px);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 0.95;
}

.view-head p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

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

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

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

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

.card {
  position: relative;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012)),
    rgba(16, 18, 23, 0.72);
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.card-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.card-value {
  margin: 18px 0 6px;
  font-family: var(--font-display);
  font-size: clamp(30px, 3.2vw, 46px);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
}

.card-value small {
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: 0;
}

.card-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.trend-up { color: var(--green); }
.trend-down { color: var(--red); }
.trend-flat { color: var(--muted); }

.hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.6fr);
  gap: 24px;
  min-height: 280px;
  padding: clamp(24px, 3vw, 38px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(700px 300px at 0% 0%, rgba(216, 255, 84, 0.08), transparent 55%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.01)),
    rgba(16, 18, 23, 0.78);
  overflow: hidden;
}

.hero-card::after {
  content: "";
  position: absolute;
  right: -120px;
  bottom: -180px;
  width: 420px;
  height: 420px;
  border: 1px solid rgba(216, 255, 84, 0.12);
  border-radius: 50%;
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.hero-copy h2 {
  margin: 14px 0 12px;
  font-family: var(--font-display);
  font-size: clamp(44px, 5vw, 76px);
  font-weight: 400;
  letter-spacing: -0.05em;
  line-height: 0.9;
}

.hero-copy h2 em {
  color: var(--accent);
  font-weight: 400;
}

.hero-copy p {
  max-width: 520px;
  margin: 0;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.6;
}

.hero-stats {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: end;
  gap: 14px;
}

.hero-stat {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.hero-stat:last-child {
  border-bottom: 0;
}

.hero-stat span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-stat strong {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.03em;
}

.section {
  margin-top: 26px;
}

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

.section-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.03em;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.chart-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(16, 18, 23, 0.72);
}

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

.chart-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  letter-spacing: -0.03em;
}

.chart-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.chart-wrap {
  position: relative;
  width: 100%;
  min-height: 240px;
}

.chart-wrap svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-legend {
  display: flex;
  gap: 14px;
  margin-top: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.legend-dot.alt {
  background: var(--ember);
}

.firm-row {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr 0.7fr 0.8fr;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.firm-row:last-child {
  border-bottom: 0;
}

.firm-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.firm-glyph {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 16px;
  font-style: italic;
}

.firm-meta {
  color: var(--muted);
  font-size: 11px;
}

.mono-sm {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge-green {
  color: var(--green);
  background: rgba(94, 230, 168, 0.1);
}

.badge-amber {
  color: var(--amber);
  background: rgba(255, 209, 102, 0.1);
}

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

.badge-neutral {
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.06);
}

.scenario-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
}

.scenario-tab {
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.scenario-tab.active {
  color: var(--accent-ink);
  background: var(--accent);
}

.projection-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.75fr) minmax(0, 1.25fr);
  gap: 18px;
  align-items: start;
}

.panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(16, 18, 23, 0.72);
}

.panel h3 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  letter-spacing: -0.03em;
}

.panel .panel-sub {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.range-field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.range-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.range-head span {
  color: var(--text-2);
  font-size: 12px;
}

.range-head output {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
}

input[type="range"] {
  width: 100%;
  height: 4px;
  margin: 4px 0;
  border-radius: 99px;
  outline: none;
  background: rgba(255, 255, 255, 0.1);
  -webkit-appearance: none;
  appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  border: 2px solid var(--bg);
  border-radius: 50%;
  cursor: pointer;
  background: var(--accent);
  -webkit-appearance: none;
  appearance: none;
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 2px solid var(--bg);
  border-radius: 50%;
  cursor: pointer;
  background: var(--accent);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.metric {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(0, 0, 0, 0.16);
}

.metric span {
  display: block;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 400;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.metric small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

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

.data-table th {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-align: right;
  text-transform: uppercase;
}

.data-table th:first-child,
.data-table td:first-child {
  text-align: left;
}

.data-table td {
  padding: 11px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-2);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table td.positive { color: var(--green); }
.data-table td.negative { color: var(--red); }

.risk-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
  align-items: start;
}

.risk-result {
  display: grid;
  align-content: center;
  min-height: 280px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(420px 220px at 100% 0%, rgba(216, 255, 84, 0.1), transparent 60%),
    rgba(16, 18, 23, 0.72);
}

.risk-result .eyebrow {
  margin-bottom: 12px;
}

.risk-result strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(64px, 8vw, 110px);
  font-weight: 400;
  letter-spacing: -0.06em;
  line-height: 0.85;
  font-variant-numeric: tabular-nums;
}

.risk-result p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.risk-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.risk-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.5;
}

.risk-list li:last-child {
  border-bottom: 0;
}

.check {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: transparent;
  font-size: 11px;
}

.check.on {
  color: var(--accent-ink);
  border-color: var(--accent);
  background: var(--accent);
}

.firm-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.firm-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(16, 18, 23, 0.72);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.firm-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.firm-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.firm-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  letter-spacing: -0.03em;
}

.firm-card .firm-type {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.firm-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.firm-fact {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.firm-fact span {
  display: block;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.firm-fact strong {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 500;
}

.firm-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.journal-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.7fr) minmax(0, 1.3fr);
  gap: 18px;
  align-items: start;
}

.journal-form {
  display: grid;
  gap: 10px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.journal-list {
  display: grid;
  gap: 8px;
}

.journal-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.journal-item:last-child {
  border-bottom: 0;
}

.journal-item h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}

.journal-item p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.journal-r {
  font-family: var(--font-mono);
  font-size: 13px;
}

.rules-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
  align-items: start;
}

.rule-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: rule;
}

.rule-list li {
  position: relative;
  padding: 13px 0 13px 34px;
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.5;
  counter-increment: rule;
}

.rule-list li:last-child {
  border-bottom: 0;
}

.rule-list li::before {
  content: counter(rule, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 13px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10px;
}

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

.consequence-table th,
.consequence-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.consequence-table th {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.consequence-table td {
  color: var(--text-2);
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.setting-row:last-child {
  border-bottom: 0;
}

.setting-row span {
  color: var(--muted);
  font-size: 12px;
}

.setting-row strong {
  font-size: 12px;
  font-weight: 500;
}

.empty {
  padding: 26px 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 30;
  max-width: min(360px, calc(100vw - 44px));
  padding: 12px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  opacity: 0;
  color: var(--text);
  background: rgba(20, 23, 29, 0.95);
  box-shadow: var(--shadow);
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  border-color: rgba(255, 107, 107, 0.4);
  color: #ffb4b4;
}

.palette {
  width: min(560px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  color: var(--text);
  background: rgba(16, 18, 23, 0.98);
  box-shadow: var(--shadow);
}

.palette::backdrop {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}

.palette-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.palette-head input {
  flex: 1;
  padding: 10px 12px;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

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

.palette-list {
  display: grid;
  gap: 2px;
  padding: 8px;
}

.palette-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  color: var(--text-2);
  background: transparent;
  text-align: left;
}

.palette-item:hover,
.palette-item.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.palette-item kbd {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
}

.sidebar-scrim {
  display: none;
}

@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .firm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .projection-layout,
  .risk-layout,
  .journal-layout,
  .rules-grid,
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand {
    min-height: 46svh;
    padding: 28px 24px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .auth-copy { padding: 5vh 0 3vh; }
  .auth-copy h1 { font-size: clamp(48px, 12vw, 80px); }
  .auth-panel { padding: 24px; }
  .auth-meta { font-size: 9px; }

  .sidebar {
    transform: translateX(-102%);
    transition: transform 0.25s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 9;
    display: block;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
  }
  .sidebar-scrim.show { opacity: 1; visibility: visible; }
  .app-main { width: 100%; margin-left: 0; }
  .mobile-menu { display: grid; }
  .topbar-date { display: none; }
  .hero-card { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .view { padding: 18px; }
  .topbar { min-height: 68px; padding: 12px 16px; }
  .topbar h1 { font-size: 26px; }
  .topbar-right .pill-private { display: none; }
  .grid-4, .grid-3, .grid-2, .firm-grid, .metric-grid, .form-row, .setup-operators, .hero-stats { grid-template-columns: 1fr; }
  .view-head { align-items: flex-start; flex-direction: column; gap: 10px; }
  .view-head h2 { font-size: 42px; }
  .auth-card { border-radius: 18px; }
  .card-value { font-size: 34px; }
  .firm-row { grid-template-columns: 1fr 1fr; }
  .firm-row .firm-meta:nth-child(3) { display: none; }
}

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