:root {
  /* Palette: Sage #5E8B7E · Soft Blue #A7C7E7 · Deep Slate #2F3E46 · Cloud White #F1F5F4 */
  --bg: #1c282e;
  --tile: #2f3e46;
  --tile-alt: #3a4d56;
  --tile-blue: #5e8b7e;
  --tile-blue-hover: #6f9e90;
  --tile-stone: #234f44;
  --ink: #f1f5f4;
  --ink-dark: #f1f5f4;
  --muted: #8fa3ab;
  --line: rgba(241, 245, 244, 0.1);
  --line-strong: rgba(241, 245, 244, 0.2);
  --green: #5e8b7e;
  --red: #c4786a;
  --font: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  --display: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  --radius: 2px;
  --radius-sm: 2px;
  --gutter: 8px;
  --input-bg: #25353d;
  --th-bg: #263640;
  --chart-bg: #263640;
}

[data-theme="light"] {
  --bg: #dfe6e3;
  --tile: #f1f5f4;
  --tile-alt: #e4ece9;
  --tile-blue: #5e8b7e;
  --tile-blue-hover: #4d7569;
  --tile-stone: #234f44;
  --ink: #2f3e46;
  --ink-dark: #f1f5f4;
  --muted: #5a717a;
  --line: rgba(47, 62, 70, 0.12);
  --line-strong: rgba(47, 62, 70, 0.24);
  --green: #5e8b7e;
  --red: #c24132;
  --input-bg: #ffffff;
  --th-bg: #e8f0ee;
  --chart-bg: #f7faf9;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: var(--font);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  color-scheme: dark;
}
html[data-theme="light"],
html[data-theme="light"] body {
  color-scheme: light;
}
/* Author display rules otherwise override the hidden attribute */
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }

/* Pure matte black backdrop — no glow, pure Swiss bento contrast */
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--bg);
}

.shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: var(--gutter);
  padding: var(--gutter);
  min-height: 100vh;
  background: var(--bg);
}

/* Sidebar tile */
.sidebar {
  background: var(--tile);
  color: var(--ink);
  padding: 0 0 18px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  position: sticky;
  top: var(--gutter);
  height: calc(100vh - (var(--gutter) * 2));
  border-radius: var(--radius);
  overflow: hidden;
}

.side-brand {
  padding: 18px 16px 16px;
  background: #234f44;
  border-bottom: 0;
}

.side-brand .brand {
  color: #f1f5f4;
}

.side-brand .brand-sub {
  color: rgba(241, 245, 244, 0.7);
}

.brand {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.15;
  color: var(--ink);
  white-space: nowrap;
}

.brand-sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
}

.nav {
  display: grid;
  gap: 4px;
  padding: 0 10px;
}

.nav-item {
  appearance: none;
  border: 1px solid transparent;
  text-align: left;
  background: transparent;
  color: var(--muted);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.nav-item:hover {
  background: var(--tile-alt);
  color: var(--ink);
}
.nav-item.active {
  background: var(--tile-blue);
  color: #f1f5f4;
}

.side-foot-wrap {
  margin-top: auto;
  display: grid;
  gap: 10px;
  padding: 0 10px;
}
.side-foot {
  padding: 12px 6px 0;
  border-top: 1px solid var(--line);
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.6;
}

/* Main workspace */
.main {
  padding: 0 0 24px;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: var(--gutter);
  z-index: 20;
  background: #234f44;
  color: var(--ink-dark);
  border-radius: var(--radius);
  padding: 14px 22px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: var(--gutter);
  box-shadow: 0 -8px 0 var(--bg), 0 8px 0 var(--bg);
}

.topbar h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.1;
  color: var(--ink-dark);
}

.page-sub {
  margin: 5px 0 0;
  color: rgba(241, 245, 244, 0.72);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
}

.topbar-end {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-left: auto;
}

.top-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.top-actions .field {
  margin: 0;
  display: grid;
  gap: 4px;
  align-content: end;
}
.top-actions .field span {
  color: rgba(241, 245, 244, 0.72);
  font-size: 9.5px;
  line-height: 1;
  letter-spacing: 0.12em;
}
.top-actions .field input {
  height: 36px;
  min-width: 116px;
  background: rgba(28, 40, 46, 0.35);
  border-color: rgba(241, 245, 244, 0.24);
  color: var(--ink-dark);
}
.top-actions .btn {
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  background: #2f3e46;
  color: #f1f5f4;
  border-color: #2f3e46;
  align-self: flex-end;
}
.top-actions .btn:hover {
  background: #3a4d56;
}
.top-actions .btn-primary {
  background: #2f3e46;
  border-color: #2f3e46;
  color: #f1f5f4;
}
.top-actions .btn-primary:hover {
  background: #243338;
}

/* iPhone-style Dynamic Island notch */
.island-notch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 38px;
  padding: 3px 4px 3px 6px;
  border-radius: 999px;
  background: #0b1215;
  border: 1px solid rgba(241, 245, 244, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 1px 0 rgba(0, 0, 0, 0.25);
}
.notch-btn {
  appearance: none;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #f1f5f4;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.12s ease, color 0.12s ease;
}
.notch-btn:hover {
  background: rgba(241, 245, 244, 0.1);
}
.notch-btn .icon-moon { display: none; }
html:not([data-theme="light"]) .notch-btn .icon-sun { display: none; }
html:not([data-theme="light"]) .notch-btn .icon-moon { display: block; }
.notch-sep {
  width: 1px;
  height: 14px;
  background: rgba(241, 245, 244, 0.16);
  margin: 0 2px;
}
.notch-profile {
  width: auto;
  padding: 0 2px;
}
.account-menu-wrap {
  position: relative;
}
.account-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 168px;
  padding: 6px;
  background: var(--tile);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  z-index: 40;
  display: grid;
  gap: 2px;
}
.account-menu-item {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.account-menu-item:hover {
  background: var(--tile-alt);
}
.account-menu-danger {
  color: var(--red);
}
.vega-panel {
  min-height: 260px;
}
.vega-panel .vega-embed {
  width: 100%;
}
.broker-fields[hidden] {
  display: none !important;
}
.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--tile-blue);
  color: #f1f5f4;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.btn-icon {
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

[data-theme="light"] .page-sub { color: rgba(241, 245, 244, 0.68); }
[data-theme="light"] .top-actions .field span { color: rgba(241, 245, 244, 0.72); }
[data-theme="light"] .top-actions .field input {
  background: rgba(241, 245, 244, 0.1);
  border-color: rgba(241, 245, 244, 0.24);
  color: var(--ink-dark);
}
[data-theme="light"] .top-actions .btn {
  background: rgba(241, 245, 244, 0.12);
  color: var(--ink-dark);
  border-color: rgba(241, 245, 244, 0.22);
}
[data-theme="light"] .top-actions .btn-primary {
  background: var(--tile-blue);
  color: var(--ink-dark);
  border-color: var(--tile-blue);
}
[data-theme="light"] .island-notch {
  background: #0b1215;
  border-color: rgba(241, 245, 244, 0.12);
}

.view { display: none; animation: fadeIn 0.16s ease-out; }
.view.active { display: block; }
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Buttons */
.btn {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: var(--tile-alt);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.btn:hover {
  background: #455a64;
  border-color: rgba(241, 245, 244, 0.34);
}
[data-theme="light"] .btn:hover {
  background: #d5e0dd;
  border-color: rgba(47, 62, 70, 0.28);
}
[data-theme="light"] .btn-primary {
  color: var(--ink-dark);
}
.btn:disabled { opacity: 0.45; cursor: wait; }

.btn-primary {
  background: var(--tile-blue);
  border-color: var(--tile-blue);
  color: var(--ink);
}
.btn-primary:hover {
  background: var(--tile-blue-hover);
  border-color: var(--tile-blue-hover);
}
.btn-danger {
  color: var(--red);
  border-color: rgba(196, 120, 106, 0.4);
  background: transparent;
}
.btn-danger:hover {
  background: rgba(196, 120, 106, 0.14);
  border-color: var(--red);
}
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
.btn-ghost:hover {
  background: var(--tile-alt);
  color: var(--ink);
}

/* Bento Metrics Grid */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gutter);
  margin-bottom: var(--gutter);
}
.metric {
  background: var(--tile);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 108px;
  transition: background 0.12s ease;
}
.metric:first-child {
  background: var(--tile-blue);
}
.metric:first-child .label {
  color: rgba(241, 245, 244, 0.78);
}
.metric:first-child .value,
.metric:first-child .value.pos,
.metric:first-child .value.neg {
  color: var(--ink);
}
.metric .label {
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.metric .value {
  margin-top: 14px;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.75rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.metric .value.pos { color: var(--green); }
.metric .value.neg { color: var(--red); }

/* Bento Panels */
.panel {
  background: var(--tile);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: var(--gutter);
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
}
.panel-head strong {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink);
}
.panel-body { padding: 16px 18px; }
.hint {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: var(--gutter);
}
.stack { display: grid; gap: 10px; }

/* Form controls */
.field { display: grid; gap: 6px; }
.field span, .field-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.field input, .field select, .field textarea,
.form-grid input, .form-grid select, .form-grid textarea {
  border: 1px solid var(--line-strong);
  background: var(--input-bg);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  font-size: 12.5px;
  width: 100%;
  outline: none;
  transition: border-color 0.12s ease;
}
.field input:focus, .field select:focus, .field textarea:focus,
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus {
  border-color: var(--tile-blue);
}
.field textarea, .form-grid textarea { min-height: 84px; resize: vertical; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.form-grid .full { grid-column: 1 / -1; }
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 22px;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
}
.check-row input { accent-color: var(--tile-blue); width: 14px; height: 14px; cursor: pointer; }

/* Tables */
.table-wrap { overflow: auto; max-height: 560px; }
.table-wrap::-webkit-scrollbar { width: 6px; height: 6px; }
.table-wrap::-webkit-scrollbar-thumb { background: rgba(241, 245, 244, 0.18); }
.table-wrap::-webkit-scrollbar-track { background: transparent; }

table { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
th, td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}
th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--th-bg);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 10px;
  font-weight: 500;
}
tbody tr { transition: background 0.1s ease; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: var(--tile-alt); }
tbody tr.active {
  background: rgba(94, 139, 126, 0.28);
  box-shadow: inset 3px 0 0 var(--tile-blue);
}
.pos { color: var(--green); font-weight: 500; }
.neg { color: var(--red); font-weight: 500; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 2px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--tile-stone);
  color: var(--ink-dark);
}
.badge.off {
  background: var(--tile-alt);
  color: var(--muted);
}
.badge.token-ready {
  background: color-mix(in srgb, var(--green) 22%, transparent);
  color: var(--green);
}
.badge.token-pending {
  background: color-mix(in srgb, #c4a35a 28%, transparent);
  color: #c4a35a;
}
.badge.token-expired {
  background: color-mix(in srgb, var(--red) 22%, transparent);
  color: var(--red);
}
.badge.token-idle {
  background: var(--tile-alt);
  color: var(--muted);
}
.row-actions { display: flex; gap: 6px; }

/* Backtest workspace */
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--gutter);
}
.workspace > .panel { min-width: 0; }
.chart { height: min(48vh, 480px); width: 100%; background: var(--chart-bg); }
.strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--bg);
  border-top: 1px solid var(--line);
}
.strip .card { background: var(--tile); padding: 12px 16px; }
.strip .label {
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.strip .value {
  margin-top: 5px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
}
#equitySpark { display: block; width: 100%; height: 120px; background: var(--chart-bg); }

/* Toast & Modal */
.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  background: var(--tile-stone);
  color: var(--ink-dark);
  padding: 11px 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: var(--radius);
  max-width: 380px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.72);
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal[hidden], .toast[hidden] { display: none !important; }
.modal-card {
  width: min(560px, 100%);
  background: var(--tile);
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  overflow: hidden;
}
.modal-head, .modal-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.modal-foot { border-bottom: 0; border-top: 1px solid var(--line); justify-content: flex-end; }
.modal-body { padding: 18px; max-height: 60vh; overflow: auto; }
.assign-list { display: grid; gap: 6px; }
.assign-list label {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--input-bg);
}
.assign-list label:hover { border-color: var(--tile-blue); }
.assign-list input { accent-color: var(--tile-blue); }

.empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@media (max-width: 1100px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
  .nav { display: flex; flex-wrap: wrap; }
  .side-foot { display: none; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .workspace { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}

/* Login gate */
.login-screen {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
}
.login-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(145deg, rgba(28, 40, 46, 0.82) 0%, rgba(47, 62, 70, 0.55) 42%, rgba(94, 139, 126, 0.38) 100%),
    linear-gradient(0deg, rgba(28, 40, 46, 0.55), rgba(28, 40, 46, 0.55)),
    url("images/login-bg.jpg") center / cover no-repeat;
  filter: sepia(0.25) hue-rotate(118deg) saturate(0.85) brightness(0.72) contrast(1.08);
  transform: scale(1.04);
}
.login-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 15%, rgba(167, 199, 231, 0.22), transparent 45%),
    radial-gradient(ellipse at 80% 85%, rgba(94, 139, 126, 0.28), transparent 50%);
  mix-blend-mode: soft-light;
  pointer-events: none;
}
.login-card {
  width: min(400px, 100%);
  background: #2f3e46;
  border-radius: 2px;
  padding: 0;
  display: grid;
  border: 1px solid rgba(241, 245, 244, 0.1);
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.42);
  color: #f1f5f4;
  overflow: hidden;
}
.login-head {
  padding: 28px 28px 18px;
  text-align: center;
  border-bottom: 1px solid rgba(241, 245, 244, 0.1);
}
.login-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f1f5f4;
  line-height: 1.1;
}
.login-rule {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}
.login-rule-line {
  height: 1px;
  background: rgba(241, 245, 244, 0.28);
}
.login-rule-text {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(241, 245, 244, 0.78);
  white-space: nowrap;
}
.login-body {
  padding: 22px 28px 28px;
  display: grid;
  gap: 18px;
}
.login-card .field { gap: 10px; }
.login-card .field span {
  color: rgba(241, 245, 244, 0.78);
  letter-spacing: 0.14em;
}
.login-card .field input {
  height: 42px;
  background: #1c282e;
  border: 1px solid rgba(241, 245, 244, 0.16);
  color: #f1f5f4;
  border-radius: 2px;
  padding: 10px 12px;
}
.login-card .field input:focus { border-color: #5e8b7e; }
.login-submit {
  position: relative;
  overflow: hidden;
  width: 100%;
  margin-top: 6px;
  height: 44px;
  background: #5e8b7e;
  border-color: #5e8b7e;
  color: #f1f5f4;
  border-radius: 2px;
  letter-spacing: 0.12em;
}
.login-submit:hover {
  background: #6f9e90;
  border-color: #6f9e90;
}
.login-submit .btn-label { position: relative; z-index: 1; }
.login-submit .btn-shimmer {
  display: none;
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    transparent 20%,
    rgba(241, 245, 244, 0.28) 45%,
    transparent 70%
  );
  background-size: 200% 100%;
  animation: shimmerSlide 1.05s linear infinite;
}
.login-submit.is-loading {
  pointer-events: none;
  opacity: 0.9;
}
.login-submit.is-loading .btn-label { opacity: 0.35; }
.login-submit.is-loading .btn-shimmer { display: block; }
.login-error {
  margin: 0;
  color: #e07a6b;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.password-field {
  position: relative;
  display: grid;
}
.password-field input {
  padding-right: 44px;
}
.password-toggle {
  appearance: none;
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 30px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: #a7c7e7;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.password-toggle:hover { background: rgba(167, 199, 231, 0.12); }
.eye-aperture {
  position: relative;
  width: 18px;
  height: 12px;
  display: block;
}
.eye-lid {
  position: absolute;
  inset: 0;
  border: 1.5px solid currentColor;
  border-radius: 999px / 70%;
  clip-path: polygon(0 35%, 100% 35%, 100% 65%, 0 65%);
  transition: clip-path 0.16s ease;
}
.eye-slot {
  position: absolute;
  left: 1px;
  right: 1px;
  top: 50%;
  height: 1.5px;
  background: currentColor;
  transform: translateY(-50%);
  opacity: 0.85;
}
.eye-core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 1px;
  background: #5e8b7e;
  box-shadow: 0 0 0 1px rgba(241, 245, 244, 0.35);
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.16s ease;
}
.password-toggle[aria-pressed="true"] { color: #5e8b7e; }
.password-toggle[aria-pressed="true"] .eye-lid {
  clip-path: polygon(0 8%, 100% 8%, 100% 92%, 0 92%);
  border-radius: 2px;
}
.password-toggle[aria-pressed="true"] .eye-slot { opacity: 0; }
.password-toggle[aria-pressed="true"] .eye-core {
  transform: translate(-50%, -50%) scale(1);
}

/* Loading shimmer primitives */
@keyframes shimmerSlide {
  0% { background-position: 160% 0; }
  100% { background-position: -40% 0; }
}
.shimmer {
  position: relative;
  overflow: hidden;
  background: var(--tile-alt);
  border-radius: var(--radius-sm);
  color: transparent !important;
  pointer-events: none;
  user-select: none;
}
.shimmer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    transparent 25%,
    rgba(241, 245, 244, 0.16) 45%,
    transparent 65%
  );
  background-size: 200% 100%;
  animation: shimmerSlide 1.15s linear infinite;
}
[data-theme="light"] .shimmer::after {
  background: linear-gradient(
    110deg,
    transparent 25%,
    rgba(47, 62, 70, 0.1) 45%,
    transparent 65%
  );
  background-size: 200% 100%;
}
.view-loading {
  display: grid;
  gap: var(--gutter);
}
.view-loading .shimmer-metric {
  height: 108px;
}
.view-loading .shimmer-panel {
  height: 220px;
}
.view-loading .shimmer-row {
  height: 42px;
}

/* Profile */
.profile-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 8px 0 4px;
}
.profile-hero .user-avatar {
  width: 56px;
  height: 56px;
  font-size: 18px;
  border-radius: 999px;
}
.profile-hero h2 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gutter);
}
.profile-kv {
  display: grid;
  gap: 10px;
}
.profile-kv div {
  display: grid;
  gap: 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.profile-kv .label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.profile-kv .value {
  font-size: 13px;
  color: var(--ink);
}
@media (max-width: 900px) {
  .profile-grid { grid-template-columns: 1fr; }
}
