:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #081111;
  color: #f2f7f6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #081111;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 40px;
  border: 1px solid rgba(68, 216, 200, 0.42);
  background: rgba(68, 216, 200, 0.12);
  color: #f2f7f6;
  font-weight: 700;
  padding: 0 16px;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

button[data-busy="true"] {
  cursor: wait;
}


.login-gate {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 34px;
  background:
    linear-gradient(90deg, rgba(6, 21, 24, 0.92), rgba(2, 6, 7, 0.42) 28%, rgba(2, 6, 7, 0.42) 72%, rgba(6, 21, 24, 0.92)),
    linear-gradient(135deg, #020607 0%, #081113 48%, #020506 100%);
}

.login-gate::before {
  content: "";
  position: absolute;
  inset: 28px;
  border-radius: 10px;
  background:
    linear-gradient(rgba(68, 216, 200, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(68, 216, 200, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 22%, transparent 78%, rgba(68, 216, 200, 0.08));
  background-size: 42px 42px, 42px 42px, auto;
  opacity: 0.72;
}

.login-gate::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 9%;
  width: min(620px, 70vw);
  height: 80px;
  border-radius: 50%;
  background: rgba(68, 216, 200, 0.18);
  filter: blur(34px);
  transform: translateX(-50%);
  opacity: 0.55;
}

.login-grid {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent, rgba(68, 216, 200, 0.08) 49.8%, rgba(68, 216, 200, 0.08) 50.2%, transparent),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 28%, rgba(68, 216, 200, 0.04));
  opacity: 0.55;
}

.login-terminal {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  min-height: 540px;
  display: grid;
  grid-template-columns: minmax(210px, 0.76fr) minmax(360px, 520px) minmax(210px, 0.76fr);
  gap: 34px;
  align-items: center;
}

.login-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(122, 246, 236, 0.62);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(28, 43, 48, 0.76), rgba(6, 13, 15, 0.94)),
    rgba(9, 19, 22, 0.84);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(68, 216, 200, 0.16),
    0 26px 96px rgba(0, 0, 0, 0.72),
    0 0 48px rgba(68, 216, 200, 0.26);
  padding: 48px 52px 38px;
  text-align: center;
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0%, rgba(255, 255, 255, 0.18) 19%, transparent 39%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 34%);
  transform: translateX(-18%);
  opacity: 0.58;
}

.login-card::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: -20px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(68, 216, 200, 0.82), transparent);
  box-shadow: 0 0 28px rgba(68, 216, 200, 0.75);
}

.login-logo {
  position: relative;
  z-index: 1;
  width: 84px;
  height: 84px;
  display: block;
  margin: 0 auto 18px;
  filter: drop-shadow(0 0 20px rgba(68, 216, 200, 0.58));
}

.login-card .eyebrow {
  position: relative;
  z-index: 1;
  letter-spacing: 0.11em;
}

.login-card h1 {
  position: relative;
  z-index: 1;
  margin-top: 10px;
  font-size: 34px;
  line-height: 1.05;
}

.login-subtitle {
  position: relative;
  z-index: 1;
  margin: 8px 0 28px;
  color: #31e7d3;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.login-message {
  position: relative;
  z-index: 1;
  min-height: 0;
  margin: 0 0 14px;
  border-color: rgba(68, 216, 200, 0.12);
  background: rgba(68, 216, 200, 0.035);
  color: #cce2df;
  text-align: center;
}

.login-form.login-form-gate {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: stretch;
  text-align: left;
}

.login-form.login-form-gate label {
  display: grid;
  gap: 7px;
  color: rgba(243, 199, 95, 0.9);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-form.login-form-gate input {
  min-height: 48px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  border-color: rgba(123, 154, 157, 0.42);
  border-radius: 6px;
  background: rgba(4, 10, 12, 0.56);
  color: #f2f7f6;
  padding: 0 16px;
  box-shadow: inset 0 0 0 1px rgba(68, 216, 200, 0.035);
}

.login-form.login-form-gate input::placeholder {
  color: rgba(204, 226, 223, 0.62);
}

.login-form.login-form-gate input:focus {
  border-color: rgba(68, 216, 200, 0.88);
  outline: none;
  box-shadow: 0 0 0 3px rgba(68, 216, 200, 0.12), inset 0 0 0 1px rgba(68, 216, 200, 0.18);
}

.login-form.login-form-gate button {
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
  border: 0;
  border-radius: 6px;
  background: linear-gradient(180deg, #47eff2, #16c8c4);
  color: #041010;
  box-shadow: 0 0 28px rgba(68, 216, 200, 0.36);
  text-transform: uppercase;
}

.login-foot {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 22px;
  color: #b9cbc8;
  font-size: 12px;
}

.login-foot span::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: #32ef9c;
  box-shadow: 0 0 12px rgba(50, 239, 156, 0.72);
}

.login-side-panel {
  display: grid;
  gap: 14px;
  opacity: 0.74;
  filter: blur(0.15px);
}

.login-status-card {
  min-height: 104px;
  border: 1px solid rgba(68, 216, 200, 0.14);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(17, 33, 37, 0.52), rgba(6, 13, 15, 0.4));
  padding: 18px;
  box-shadow: inset 0 0 28px rgba(68, 216, 200, 0.035), 0 16px 44px rgba(0, 0, 0, 0.18);
}

.login-status-card span,
.login-status-card small {
  display: block;
  color: rgba(204, 226, 223, 0.58);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.login-status-card strong {
  display: block;
  margin: 9px 0 5px;
  color: #f2f7f6;
  font-size: 18px;
}

.login-side-panel.right {
  transform: translateY(4px);
}

body:not(.is-authenticated) .app-shell,
body:not(.is-authenticated) .mobile-nav {
  display: none;
}

body.is-authenticated .login-gate {
  display: none;
}.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  min-height: 100vh;
  border-right: 1px solid rgba(242, 247, 246, 0.12);
  background: #0d1719;
  padding: 22px 16px;
}

.brand {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.brand-logo,
.topbar-logo {
  display: block;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  margin-top: 3px;
  color: #9cb0ad;
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-link {
  width: 100%;
  justify-content: start;
  border-color: transparent;
  background: transparent;
  color: #cce2df;
  text-align: left;
}

.nav-link.active {
  border-left: 3px solid #44d8c8;
  background: rgba(68, 216, 200, 0.14);
  color: #44d8c8;
}

.workspace {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 28px;
  border-bottom: 1px solid rgba(242, 247, 246, 0.12);
  background: #081111;
}

.topbar-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar-logo {
  display: none;
}

.topbar-user {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 12px;
  color: #cce2df;
  text-align: right;
}

.topbar-refresh {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 8px;
  min-width: 0;
}

.topbar-refresh select,
.topbar-refresh input[type="number"] {
  min-height: 34px;
  width: auto;
  min-width: 82px;
  padding: 0 8px;
}

.auto-refresh-check {
  min-height: 34px;
  white-space: nowrap;
}

.auto-refresh-status {
  min-width: 84px;
  color: #cce2df;
  font-size: 12px;
  text-align: left;
}

.eyebrow {
  margin: 0;
  color: #44d8c8;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.08;
}

h1 {
  margin-top: 5px;
  font-size: 30px;
}

h2 {
  margin-top: 6px;
  font-size: 28px;
}

.page {
  display: none;
  min-width: 0;
  padding: 28px;
  align-content: start;
  gap: 18px;
}

.page.active {
  display: grid;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.sub-section {
  margin-top: 38px;
}

.small-heading {
  margin-top: 20px;
}

.small-heading h2 {
  font-size: 20px;
}

.summary-grid,
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.settings-grid a {
  color: #44d8c8;
}

.summary-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

article {
  min-height: 112px;
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 20px;
  border: 1px solid rgba(242, 247, 246, 0.14);
  background: rgba(242, 247, 246, 0.05);
}

article span {
  color: #f3c75f;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

article strong {
  overflow-wrap: anywhere;
  color: #f2f7f6;
  font-size: 18px;
}

.message {
  min-height: 24px;
  color: #b9c7c4;
}

.date-filter {
  display: grid;
  grid-template-columns: minmax(170px, 0.7fr) minmax(210px, 1fr) minmax(210px, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin: 14px 0 18px;
}

.date-filter label {
  min-width: 160px;
}

.date-filter input,
.date-filter select {
  min-width: 170px;
}

.date-filter button {
  min-height: 42px;
}

.tracker-summary {
  margin: 12px 0 22px;
}

.tracker-summary article {
  min-height: 86px;
}

.tracker-mini-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin: 10px 0 12px;
}

.tracker-mini-summary article {
  min-height: 70px;
  padding: 12px;
}

.tracker-mini-summary article strong {
  font-size: 16px;
}

.cleanup-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin: 16px 0 18px;
}

.danger-zone {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(255, 114, 114, 0.35);
  background: rgba(255, 114, 114, 0.06);
}

.danger-zone button {
  border-color: rgba(255, 114, 114, 0.5);
  color: #ffd0d0;
}

.tracker-grid {
  display: grid;
  gap: 24px;
}

.tracker-grid h3 {
  margin: 0 0 10px;
  color: #f2f7f6;
  font-size: 18px;
}

.muted-text {
  margin-top: 6px;
  color: #9cb0ad;
  font-size: 12px;
}

.login-form,
.user-form {
  display: grid;
  gap: 12px;
  align-items: end;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.compact-actions {
  justify-content: flex-end;
}

.login-form {
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
}

.user-form {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

label {
  display: grid;
  gap: 8px;
  color: #f3c75f;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

input,
select {
  min-height: 42px;
  width: 100%;
  border: 1px solid rgba(242, 247, 246, 0.18);
  background: #101a1d;
  color: #f2f7f6;
  padding: 0 12px;
}

input:disabled,
select:disabled {
  opacity: 0.62;
}

.check {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #f2f7f6;
  font-size: 13px;
  text-transform: none;
}

.check input {
  width: auto;
  min-height: auto;
}

.prep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.prep-panel {
  border: 1px solid rgba(242, 247, 246, 0.14);
  background: rgba(242, 247, 246, 0.04);
  padding: 16px;
}

.prep-panel h3 {
  margin: 6px 0 8px;
  font-size: 18px;
}

.prep-panel p {
  margin: 0;
  color: #c8d8d5;
  line-height: 1.55;
}

.guide-code-panel {
  display: grid;
  align-content: start;
  gap: 10px;
}

.guide-code-panel span {
  color: #ffd66e;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.guide-code-panel .template-block {
  max-height: 260px;
  margin: 0;
  overflow: auto;
  border-color: rgba(42, 216, 255, 0.18);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(2, 14, 25, 0.94), rgba(1, 9, 17, 0.96)),
    rgba(2, 12, 20, 0.92);
  color: #cdebf5;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid rgba(242, 247, 246, 0.14);
  background: rgba(242, 247, 246, 0.04);
  padding-bottom: 8px;
  scrollbar-color: rgba(0, 245, 224, 0.62) rgba(255, 255, 255, 0.08);
  scrollbar-width: thin;
  overscroll-behavior-x: contain;
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.table-wrap::-webkit-scrollbar {
  height: 12px;
}

.table-wrap::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

.table-wrap::-webkit-scrollbar-thumb {
  border: 2px solid rgba(3, 18, 18, 0.9);
  border-radius: 999px;
  background: linear-gradient(90deg, #00f5e0, #ffd166);
}

th,
td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(242, 247, 246, 0.1);
  font-size: 14px;
}

th {
  color: #f3c75f;
  font-size: 12px;
  text-transform: uppercase;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid rgba(68, 216, 200, 0.35);
  background: rgba(68, 216, 200, 0.1);
  color: #44d8c8;
  font-weight: 700;
}

.status-completed {
  border-color: rgba(85, 214, 137, 0.36);
  background: rgba(85, 214, 137, 0.1);
  color: #55d689;
}

.status-in-progress {
  border-color: rgba(243, 199, 95, 0.42);
  background: rgba(243, 199, 95, 0.12);
  color: #f3c75f;
}

.status-pending {
  border-color: rgba(184, 198, 195, 0.32);
  background: rgba(184, 198, 195, 0.08);
  color: #c8d8d5;
}

.project-table {
  min-width: 1180px;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 230px;
}

.table-actions button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.table-input {
  min-height: 34px;
  min-width: 96px;
  padding: 0 8px;
  font-size: 13px;
}

.symbol-input {
  min-width: 180px;
}

.template-block {
  margin: 10px 0 0;
  max-width: 560px;
  overflow-x: auto;
  padding: 12px;
  border: 1px solid rgba(49, 231, 211, 0.26);
  background: rgba(49, 231, 211, 0.06);
  color: #eaf4f2;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.strategy-execution-grid {
  display: grid;
  grid-template-columns: minmax(95px, 1fr) minmax(95px, 1fr);
  gap: 6px;
  min-width: 230px;
}

.status-active {
  border-color: rgba(85, 214, 137, 0.36);
  background: rgba(85, 214, 137, 0.1);
  color: #55d689;
}

.status-paused {
  border-color: rgba(243, 199, 95, 0.42);
  background: rgba(243, 199, 95, 0.12);
  color: #f3c75f;
}

.status-suspended {
  border-color: rgba(255, 116, 116, 0.42);
  background: rgba(255, 116, 116, 0.1);
  color: #ff9a9a;
}

.status-disabled {
  border-color: rgba(184, 198, 195, 0.32);
  background: rgba(184, 198, 195, 0.08);
  color: #c8d8d5;
}

.status-connected {
  border-color: rgba(85, 214, 137, 0.36);
  background: rgba(85, 214, 137, 0.1);
  color: #55d689;
}

.status-partial {
  border-color: rgba(243, 199, 95, 0.42);
  background: rgba(243, 199, 95, 0.12);
  color: #f3c75f;
}

.status-failed {
  border-color: rgba(255, 116, 116, 0.42);
  background: rgba(255, 116, 116, 0.1);
  color: #ff9a9a;
}

.status-not_tested {
  border-color: rgba(184, 198, 195, 0.32);
  background: rgba(184, 198, 195, 0.08);
  color: #c8d8d5;
}

.success-text {
  color: #3df2c2;
  font-weight: 800;
}
.error-text {
  max-width: 320px;
  margin-top: 6px;
  color: #ffb5b5;
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
}

.small-actions {
  min-width: 96px;
}

.permission-stack {
  display: grid;
  gap: 6px;
  min-width: 92px;
}

.mini-check {
  min-height: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #f2f7f6;
  font-size: 12px;
  font-weight: 700;
  text-transform: none;
}

.mini-check input,
td input[type="checkbox"] {
  width: auto;
  min-height: auto;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 17, 17, 0.78);
}

.modal[hidden] {
  display: none;
}

.modal-panel {
  position: relative;
  width: min(520px, 100%);
  display: grid;
  gap: 14px;
  border: 1px solid rgba(68, 216, 200, 0.34);
  background: #101a1d;
  padding: 24px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  min-height: 36px;
  padding: 0;
}

.modal-body {
  max-height: min(58vh, 520px);
  margin: 0;
  color: #d8e4e1;
  line-height: 1.5;
  overflow: auto;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

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

.modal-actions button:only-child,
.modal-actions button[hidden] + button {
  grid-column: 1 / -1;
}

.mobile-nav {
  display: none;
}

@media (max-width: 860px) {
  body {
    padding-bottom: 68px;
  }

  body:not(.is-authenticated) {
    padding-bottom: 0;
  }

  .login-gate {
    min-height: 100svh;
    padding: 20px;
  }

  .login-terminal {
    grid-template-columns: 1fr;
  }

  .login-side-panel {
    display: none;
  }

  .login-card {
    padding: 28px 20px;
  }

  .login-card h1 {
    font-size: 28px;
  }

  .login-foot {
    align-items: center;
    flex-direction: column;
    gap: 8px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px;
  }

  .topbar-logo {
    display: block;
  }

  .topbar-user {
    justify-content: start;
    text-align: left;
  }

  .topbar-refresh {
    justify-content: start;
    flex-wrap: wrap;
  }

  .topbar-user span {
    display: none;
  }

  .page {
    padding: 18px;
  }

  .section-heading,
  .login-form {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .action-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .section-heading {
    flex-direction: column;
  }

  .summary-grid,
  .summary-grid.compact,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .danger-zone {
    grid-template-columns: 1fr;
  }

  .mobile-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 20;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(74px, 1fr);
    overflow-x: auto;
    border-top: 1px solid rgba(242, 247, 246, 0.14);
    background: #0d1719;
  }

  .mobile-nav .nav-link {
    min-height: 58px;
    display: grid;
    place-items: center;
    padding: 0 6px;
    border-left: 0;
    border-top: 3px solid transparent;
    font-size: 11px;
    text-align: center;
  }

  .mobile-nav .nav-link.active {
    border-top-color: #44d8c8;
    border-left: 0;
  }
}

.danger-button {
  border-color: rgba(255, 114, 114, 0.55);
  color: #ffd0d0;
}

.danger-button:not(:disabled):hover {
  border-color: rgba(255, 114, 114, 0.9);
  background: rgba(120, 28, 28, 0.28);
}

/* Glass Terminal dashboard shell */
body {
  background:
    radial-gradient(circle at 18% 8%, rgba(68, 216, 200, 0.14), transparent 28%),
    radial-gradient(circle at 82% 12%, rgba(243, 199, 95, 0.08), transparent 24%),
    linear-gradient(135deg, #020607 0%, #071214 48%, #020506 100%);
  color: #f2f7f6;
}

body.theme-light {
  color-scheme: light;
  background:
    radial-gradient(circle at 18% 8%, rgba(20, 184, 166, 0.18), transparent 28%),
    radial-gradient(circle at 84% 12%, rgba(235, 179, 52, 0.16), transparent 24%),
    linear-gradient(135deg, #f6fbfa 0%, #eaf5f3 48%, #f9fbfb 100%);
  color: #0a1718;
}

body.theme-light .app-shell,
body.theme-light .workspace,
body.theme-light .topbar,
body.theme-light .sidebar {
  background: transparent;
}

body.theme-light .sidebar,
body.theme-light .topbar,
body.theme-light .glass-panel,
body.theme-light .ops-card,
body.theme-light .message,
body.theme-light .table-wrap,
body.theme-light .settings-grid article,
body.theme-light form,
body.theme-light .date-filter {
  border-color: rgba(10, 23, 24, 0.14);
  background: rgba(255, 255, 255, 0.72);
  color: #0a1718;
  box-shadow: 0 20px 70px rgba(19, 49, 51, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

body.theme-light .nav-link,
body.theme-light .topbar-user,
body.theme-light .auto-refresh-status,
body.theme-light .home-lede,
body.theme-light .ops-card small,
body.theme-light .glass-panel small,
body.theme-light .home-feed-row span,
body.theme-light .login-foot {
  color: #42595b;
}

body.theme-light input,
body.theme-light select,
body.theme-light textarea {
  border-color: rgba(10, 23, 24, 0.18);
  background: rgba(255, 255, 255, 0.82);
  color: #0a1718;
}

body.theme-light .home-feed-row,
body.theme-light .health-list div,
body.theme-light .order-flow-grid > div {
  border-color: rgba(10, 23, 24, 0.11);
  background: rgba(255, 255, 255, 0.58);
}

body.theme-light table th {
  color: #8d640e;
}

.app-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(68, 216, 200, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(68, 216, 200, 0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.72), transparent 82%);
  z-index: 0;
}

.sidebar,
.topbar,
.page {
  position: relative;
  z-index: 1;
}

.sidebar {
  background: rgba(6, 17, 19, 0.78);
  box-shadow: inset -1px 0 0 rgba(68, 216, 200, 0.08);
}

.topbar {
  background: rgba(4, 12, 14, 0.82);
  box-shadow: inset 0 -1px 0 rgba(68, 216, 200, 0.1);
}

.theme-switch button {
  min-width: 78px;
  min-height: 34px;
  border-radius: 999px;
  border-color: rgba(68, 216, 200, 0.44);
  background: linear-gradient(180deg, rgba(68, 216, 200, 0.24), rgba(68, 216, 200, 0.08));
  color: #f2f7f6;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 24px rgba(68, 216, 200, 0.12);
  transition: transform 520ms cubic-bezier(0.32, 0.72, 0, 1), border-color 520ms cubic-bezier(0.32, 0.72, 0, 1), background 520ms cubic-bezier(0.32, 0.72, 0, 1);
}

.theme-switch button:hover {
  transform: translateY(-1px);
  border-color: rgba(68, 216, 200, 0.82);
}

body.theme-light .theme-switch button {
  background: linear-gradient(180deg, rgba(10, 23, 24, 0.08), rgba(10, 23, 24, 0.02));
  color: #0a1718;
}

.home-page {
  gap: 22px;
}

.home-heading {
  align-items: center;
  padding: 10px 0 4px;
}

.home-lede {
  max-width: 860px;
  margin: 10px 0 0;
  color: #a8bebc;
  font-size: 15px;
  line-height: 1.6;
}

.home-live-badge {
  min-width: 170px;
  border: 1px solid rgba(68, 216, 200, 0.22);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(68, 216, 200, 0.12), rgba(4, 12, 14, 0.72));
  padding: 16px 18px;
  text-align: right;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.home-live-badge span,
.ops-card span,
.glass-panel .panel-heading span,
.order-flow-grid span,
.health-list span,
.risk-meter span {
  display: block;
  color: #f3c75f;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-live-badge strong {
  display: block;
  margin-top: 6px;
  color: #34f6c4;
  font-size: 18px;
}

.ops-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.ops-card,
.glass-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(68, 216, 200, 0.18);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(24, 40, 44, 0.72), rgba(5, 14, 16, 0.88)),
    rgba(6, 15, 17, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 18px 60px rgba(0, 0, 0, 0.26);
}

.ops-card::before,
.glass-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.11), transparent 24%, transparent 74%, rgba(68, 216, 200, 0.08));
  opacity: 0.72;
}

.ops-card {
  min-height: 130px;
  padding: 20px;
}

.ops-card.primary {
  border-color: rgba(68, 216, 200, 0.46);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 38px rgba(68, 216, 200, 0.14);
}

.ops-card strong {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 16px;
  color: #f2f7f6;
  font-size: 24px;
  line-height: 1.1;
}

.ops-card small {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 10px;
  color: #9db2b0;
  line-height: 1.45;
}

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

.glass-panel {
  grid-column: span 4;
  min-height: 230px;
  padding: 20px;
}

.panel-wide {
  grid-column: span 8;
}

.panel-large {
  grid-column: span 6;
}

.quick-actions-panel {
  grid-column: span 6;
}

.panel-heading {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.panel-heading.compact {
  margin-bottom: 14px;
}

.panel-heading h3 {
  margin: 7px 0 0;
  color: #f2f7f6;
  font-size: 22px;
  line-height: 1.15;
}

.panel-heading button,
.quick-action-grid button {
  border-radius: 10px;
  white-space: nowrap;
}

.panel-count {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-left: 8px;
  border: 1px solid rgba(68, 216, 200, 0.22);
  border-radius: 999px;
  padding: 2px 9px;
  color: #34f6c4;
  font-size: 12px;
  vertical-align: middle;
}

.home-feed {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 9px;
}

.home-feed-row {
  display: grid;
  grid-template-columns: 1fr 0.75fr 1.3fr auto;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  border: 1px solid rgba(68, 216, 200, 0.1);
  border-radius: 10px;
  background: rgba(4, 12, 14, 0.42);
  padding: 10px 12px;
  color: #cce2df;
}

.home-feed-row strong {
  color: #f2f7f6;
}

.empty-state {
  border: 1px dashed rgba(68, 216, 200, 0.22);
  border-radius: 12px;
  padding: 16px;
  color: #9db2b0;
}

.order-flow-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.order-flow-grid > div,
.health-list div,
.risk-meter {
  border: 1px solid rgba(68, 216, 200, 0.12);
  border-radius: 12px;
  background: rgba(4, 12, 14, 0.38);
  padding: 16px;
}

.order-flow-grid strong,
.health-list strong,
.risk-meter strong {
  display: block;
  margin-top: 10px;
  color: #f2f7f6;
  font-size: 22px;
}

.order-flow-grid small,
.risk-meter small {
  display: block;
  margin-top: 8px;
  color: #9db2b0;
  line-height: 1.45;
}

.health-list {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
}

.health-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.progress-track {
  position: relative;
  z-index: 1;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(68, 216, 200, 0.1);
  margin-bottom: 16px;
}

.progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #34f6c4, #f3c75f);
  transition: width 700ms cubic-bezier(0.32, 0.72, 0, 1);
}

.quick-action-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.positive {
  color: #34f6c4;
}

.negative {
  color: #ff827c;
}

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

  .glass-panel,
  .panel-wide,
  .panel-large,
  .quick-actions-panel {
    grid-column: span 1;
  }
}

@media (max-width: 860px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-refresh,
  .topbar-user {
    justify-content: start;
    flex-wrap: wrap;
  }

  .home-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .home-live-badge {
    text-align: left;
  }

  .ops-status-grid,
  .control-room-grid,
  .order-flow-grid,
  .quick-action-grid {
    grid-template-columns: 1fr;
  }

  .home-feed-row {
    grid-template-columns: 1fr;
  }
}

body.theme-light h1,
body.theme-light h2,
body.theme-light .ops-card strong,
body.theme-light .panel-heading h3,
body.theme-light .order-flow-grid strong,
body.theme-light .health-list strong,
body.theme-light .risk-meter strong,
body.theme-light .home-feed-row strong {
  color: #0a1718;
}

body.theme-light .home-live-badge {
  background: linear-gradient(145deg, rgba(20, 184, 166, 0.16), rgba(255, 255, 255, 0.72));
}

body.theme-light .panel-count,
body.theme-light .home-live-badge strong,
body.theme-light .positive {
  color: #08796f;
}

body.theme-light .negative {
  color: #b43c36;
}

/* R081: Trading Control Room reference layout correction */
.topbar {
  justify-content: flex-start;
  gap: 14px;
}

.topbar-heading {
  flex: 0 0 auto;
}

.topbar-refresh {
  margin-left: auto;
}

.theme-switch {
  flex: 0 0 auto;
}

.theme-switch button {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  min-width: 128px;
  min-height: 38px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(4, 12, 14, 0.86);
  box-shadow: inset 0 0 0 1px rgba(68, 216, 200, 0.3), 0 0 24px rgba(68, 216, 200, 0.2);
}

.theme-switch button::before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: 999px;
  background: linear-gradient(180deg, #41e8f0, #10bcb8);
  box-shadow: 0 0 18px rgba(68, 216, 200, 0.46);
  transition: transform 520ms cubic-bezier(0.32, 0.72, 0, 1);
}

.theme-switch button[aria-pressed="true"]::before {
  transform: translateX(100%);
}

.theme-switch button span {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-height: 30px;
  color: #d9ecea;
  font-size: 12px;
  font-weight: 800;
}

.theme-switch button[aria-pressed="false"] span:first-child,
.theme-switch button[aria-pressed="true"] span:last-child {
  color: #031011;
}

body.theme-light .theme-switch button {
  background: rgba(255, 255, 255, 0.76);
  box-shadow: inset 0 0 0 1px rgba(10, 23, 24, 0.16), 0 12px 34px rgba(18, 49, 50, 0.1);
}

body.theme-light .theme-switch button span {
  color: #486163;
}

body.theme-light .theme-switch button[aria-pressed="true"] span:last-child {
  color: #031011;
}

.control-room-page {
  padding: 22px 24px 36px;
  gap: 14px;
}

.control-room-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 92px;
}

.control-room-hero h2 {
  margin-top: 8px;
  font-size: clamp(30px, 3vw, 44px);
  line-height: 1;
}

.control-room-hero .home-lede {
  max-width: 960px;
  margin-top: 10px;
}

.control-status-rail {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.control-status-card {
  position: relative;
  overflow: hidden;
  min-height: 92px;
  border: 1px solid rgba(68, 216, 200, 0.18);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(18, 32, 36, 0.86), rgba(3, 11, 13, 0.86));
  padding: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 14px 34px rgba(0, 0, 0, 0.18);
}

.control-status-card span,
.mini-feed-heading strong,
.risk-bars span {
  color: #f3c75f;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.control-status-card strong {
  display: block;
  margin-top: 10px;
  color: #f2f7f6;
  font-size: 16px;
  line-height: 1.25;
}

.control-status-card small {
  display: block;
  margin-top: 5px;
  color: #34f6c4;
  font-size: 11px;
}

.control-room-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.glass-panel {
  min-height: auto;
  border-radius: 10px;
  padding: 14px;
}

.incoming-panel,
.risk-overview-panel {
  grid-column: span 7;
}

.order-snapshot-panel,
.system-health-panel {
  grid-column: span 5;
}

.roadmap-panel,
.audit-panel,
.quick-actions-panel {
  grid-column: span 4;
}

.split-panel-grid,
.snapshot-grid {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
}

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

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

.mini-feed-card {
  min-width: 0;
  border: 1px solid rgba(68, 216, 200, 0.12);
  border-radius: 8px;
  background: rgba(2, 10, 12, 0.5);
  padding: 10px;
}

.mini-feed-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.mini-feed-heading span {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  min-height: 20px;
  border: 1px solid rgba(68, 216, 200, 0.2);
  border-radius: 999px;
  padding: 0 7px;
  color: #34f6c4;
  font-size: 11px;
  font-weight: 900;
}

.compact-table-feed {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
}

.compact-table-feed .home-feed-row {
  grid-template-columns: minmax(88px, 0.9fr) minmax(54px, 0.55fr) minmax(120px, 1fr) minmax(112px, auto);
  min-width: 520px;
  min-height: 34px;
  gap: 8px;
  border-radius: 6px;
  padding: 7px 8px;
  font-size: 11px;
  line-height: 1.2;
}

.compact-table-feed .home-feed-row strong,
.compact-table-feed .home-feed-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-table-feed .pill {
  justify-self: end;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-mini-card p {
  margin: 10px 0 0;
  color: #9db2b0;
  font-size: 12px;
}

.risk-dashboard-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 16px;
  align-items: center;
}

.risk-ring {
  display: grid;
  place-items: center;
  min-height: 150px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(6, 17, 19, 0.95) 48%, transparent 50%),
    conic-gradient(#34f6c4 0 68%, rgba(68, 216, 200, 0.14) 68% 100%);
  text-align: center;
}

.risk-ring strong {
  color: #f2f7f6;
  font-size: 24px;
}

.risk-ring span {
  color: #9db2b0;
  font-size: 11px;
}

.risk-bars {
  display: grid;
  gap: 9px;
}

.risk-bars div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(68, 216, 200, 0.1);
  padding-bottom: 8px;
}

.risk-bars strong {
  color: #f2f7f6;
}

.health-list div {
  min-height: 32px;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid rgba(68, 216, 200, 0.1);
  border-radius: 0;
  background: transparent;
}

.health-list strong {
  color: #34f6c4;
  font-size: 12px;
}

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

.quick-action-grid button {
  min-height: 46px;
  padding: 0 10px;
  font-size: 12px;
}

.automation-control-panel {
  min-height: auto;
}

.automation-mode-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.automation-mode-card {
  display: grid;
  min-height: 142px;
  align-content: start;
  gap: 9px;
  border-radius: 14px;
  padding: 16px;
  text-align: left;
  white-space: normal;
}

.automation-mode-card span {
  color: #f3c75f;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.automation-mode-card strong {
  color: #f2f7f6;
  font-size: 18px;
  line-height: 1.15;
}

.automation-mode-card small {
  color: #9db2b0;
  font-size: 12px;
  line-height: 1.5;
}

.automation-mode-card[aria-pressed="true"] {
  border-color: rgba(78, 230, 255, 0.72);
  background:
    radial-gradient(circle at 18% 0%, rgba(78, 230, 255, 0.24), transparent 34%),
    linear-gradient(145deg, rgba(15, 74, 108, 0.72), rgba(3, 20, 36, 0.9));
  box-shadow:
    inset 0 1px 0 rgba(194, 244, 255, 0.22),
    0 0 32px rgba(78, 230, 255, 0.14);
}

.automation-control-message {
  margin: 14px 0 0;
}

body.theme-light .control-status-card,
body.theme-light .mini-feed-card {
  border-color: rgba(10, 23, 24, 0.13);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 12px 30px rgba(19, 49, 51, 0.07);
}

body.theme-light .control-status-card strong,
body.theme-light .risk-bars strong,
body.theme-light .risk-ring strong {
  color: #0a1718;
}

body.theme-light .health-list strong,
body.theme-light .control-status-card small {
  color: #08796f;
}

body.theme-light .automation-mode-card strong {
  color: #0a1718;
}

body.theme-light .automation-mode-card small {
  color: #42595b;
}

body.theme-light .automation-mode-card[aria-pressed="true"] {
  border-color: rgba(37, 99, 235, 0.42);
  background:
    radial-gradient(circle at 18% 0%, rgba(37, 99, 235, 0.14), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(212, 238, 255, 0.88));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 16px 38px rgba(37, 99, 235, 0.12);
}

body.theme-light .risk-ring {
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.96) 48%, transparent 50%),
    conic-gradient(#12a899 0 68%, rgba(10, 23, 24, 0.12) 68% 100%);
}

@media (max-width: 1500px) {
  .control-status-rail {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .incoming-panel,
  .order-snapshot-panel,
  .risk-overview-panel,
  .system-health-panel,
  .roadmap-panel,
  .audit-panel,
  .quick-actions-panel {
    grid-column: span 12;
  }
}

@media (max-width: 1100px) {
  .split-panel-grid,
  .snapshot-grid,
  .risk-dashboard-grid,
  .automation-mode-grid {
    grid-template-columns: 1fr;
  }

  .control-room-hero {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 860px) {
  .topbar-refresh {
    margin-left: 0;
  }

  .theme-switch button {
    min-width: 150px;
  }

  .control-status-rail {
    grid-template-columns: 1fr;
  }

  .quick-action-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* R082: Home alignment and typography correction */
.control-room-page {
  padding: 20px 24px 34px;
}

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

.incoming-panel,
.order-snapshot-panel {
  grid-column: span 12;
}

.risk-overview-panel {
  grid-column: span 7;
}

.system-health-panel {
  grid-column: span 5;
}

.roadmap-panel,
.audit-panel,
.quick-actions-panel {
  grid-column: span 4;
}

.glass-panel {
  padding: 16px;
}

.panel-heading {
  align-items: center;
  margin-bottom: 14px;
}

.panel-heading h3 {
  font-size: 20px;
  line-height: 1.15;
}

.panel-heading button {
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
}

.split-panel-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.snapshot-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.78fr) minmax(0, 0.78fr);
  gap: 12px;
}

.mini-feed-card {
  min-height: 0;
  padding: 10px;
}

.mini-feed-heading {
  min-height: 24px;
}

.mini-feed-heading strong {
  font-size: 10px;
  line-height: 1.15;
}

.compact-table-feed {
  overflow-x: hidden;
}

.compact-table-feed .home-feed-row {
  grid-template-columns: minmax(86px, 0.9fr) minmax(42px, 0.45fr) minmax(105px, 1fr) minmax(78px, 0.7fr);
  min-width: 0;
  min-height: 32px;
  gap: 8px;
  padding: 7px 8px;
  font-size: 11px;
}

.compact-table-feed .home-feed-row strong {
  font-size: 13px;
  line-height: 1.1;
  letter-spacing: 0;
}

.compact-table-feed .home-feed-row span {
  font-size: 11px;
  line-height: 1.15;
}

.compact-table-feed .home-feed-row span:nth-child(2) {
  font-weight: 900;
  text-transform: uppercase;
}

.compact-table-feed .home-feed-row span:nth-child(3) {
  color: #f3c75f;
  font-weight: 800;
  text-transform: uppercase;
}

.compact-table-feed .pill {
  max-width: 100%;
  justify-self: stretch;
  text-align: center;
  font-size: 10px;
  padding: 2px 6px;
}

.empty-state {
  font-size: 13px;
  line-height: 1.4;
}

.metric-mini-card {
  display: grid;
  align-content: start;
}

.metric-mini-card .mini-feed-heading {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
}

.risk-ring {
  min-height: 132px;
}

.risk-ring strong {
  font-size: 22px;
}

.risk-ring span,
.risk-bars span,
.health-list span {
  font-size: 10px;
}

.risk-bars strong,
.health-list strong {
  font-size: 13px;
}

#home-project-progress.compact-feed .home-feed-row {
  grid-template-columns: minmax(82px, 0.8fr) minmax(42px, 0.4fr) minmax(82px, 0.8fr) minmax(52px, 0.4fr);
  min-width: 0;
}

#home-project-progress.compact-feed .home-feed-row span,
#home-audit-feed.compact-table-feed .home-feed-row span {
  font-size: 11px;
}

@media (max-width: 1400px) {
  .risk-overview-panel,
  .system-health-panel,
  .roadmap-panel,
  .audit-panel,
  .quick-actions-panel {
    grid-column: span 12;
  }
}

@media (max-width: 1180px) {
  .split-panel-grid,
  .snapshot-grid {
    grid-template-columns: 1fr;
  }

  .compact-table-feed {
    overflow-x: auto;
  }

  .compact-table-feed .home-feed-row {
    min-width: 440px;
  }
}

.account-access-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.account-access-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(68, 216, 200, 0.2);
  border-radius: 12px;
  background:
    linear-gradient(145deg, rgba(25, 39, 40, 0.86), rgba(3, 18, 18, 0.92)),
    rgba(3, 18, 18, 0.88);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.28);
  padding: 18px;
  min-height: 230px;
}

.account-access-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 18% 8%, rgba(0, 245, 224, 0.12), transparent 34%);
}

.account-card-heading {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  margin-bottom: 14px;
}

.account-card-heading h3 {
  margin: 0;
  color: #eef8f6;
  font-size: 18px;
  line-height: 1.15;
}

.account-card-heading span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid rgba(0, 245, 224, 0.34);
  border-radius: 999px;
  background: rgba(0, 245, 224, 0.08);
  color: #00f5e0;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  padding: 6px 10px;
  text-transform: uppercase;
  white-space: nowrap;
}

.access-point-list {
  position: relative;
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.access-point-list li {
  position: relative;
  color: #c4d8d4;
  font-size: 13px;
  line-height: 1.45;
  padding-left: 18px;
}

.access-point-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #00f5e0;
  box-shadow: 0 0 14px rgba(0, 245, 224, 0.58);
}

.account-card-warning .account-card-heading span {
  border-color: rgba(255, 203, 94, 0.5);
  background: rgba(255, 203, 94, 0.1);
  color: #ffd166;
}

.account-card-warning .access-point-list li::before {
  background: #ffd166;
  box-shadow: 0 0 14px rgba(255, 203, 94, 0.45);
}

.account-card-restricted .account-card-heading span {
  border-color: rgba(255, 96, 96, 0.46);
  background: rgba(255, 96, 96, 0.1);
  color: #ff7474;
}

.account-card-restricted .access-point-list li::before {
  background: #ff7474;
  box-shadow: 0 0 14px rgba(255, 96, 96, 0.42);
}

body.theme-light .account-access-card {
  border-color: rgba(0, 109, 116, 0.2);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(233, 249, 248, 0.86)),
    #ffffff;
  box-shadow: 0 18px 40px rgba(9, 62, 67, 0.1);
}

body.theme-light .account-card-heading h3 {
  color: #12282b;
}

body.theme-light .access-point-list li {
  color: #42595b;
}

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

@media (max-width: 760px) {
  .account-access-grid {
    grid-template-columns: 1fr;
  }

  .account-card-heading {
    grid-template-columns: 1fr;
  }

  .account-card-heading span {
    justify-self: start;
  }
}

.tradingview-command-grid {
  display: grid;
  gap: 16px;
  margin: 18px 0;
}

.tradingview-console-page {
  position: relative;
}

.tradingview-console-hero {
  align-items: center;
  margin-bottom: 16px;
  border: 1px solid rgba(42, 216, 255, 0.32);
  border-radius: 26px;
  background:
    radial-gradient(circle at 8% 0%, rgba(42, 216, 255, 0.22), transparent 34%),
    radial-gradient(circle at 94% 0%, rgba(96, 165, 250, 0.24), transparent 30%),
    linear-gradient(145deg, rgba(7, 34, 55, 0.92), rgba(2, 12, 24, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(194, 244, 255, 0.16),
    0 24px 78px rgba(0, 9, 18, 0.34),
    0 0 44px rgba(42, 216, 255, 0.08);
  padding: 24px;
}

.tradingview-console-hero h2 {
  margin: 4px 0 8px;
}

.tradingview-console-hero p:not(.eyebrow) {
  max-width: 900px;
  margin: 0;
  color: #a9c6d3;
  line-height: 1.6;
}

.tradingview-control-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(360px, 1.18fr);
  gap: 16px;
  margin: 16px 0;
}

.single-control-grid {
  grid-template-columns: 1fr;
}

.tradingview-control-card,
.tradingview-ledger-console {
  border: 1px solid rgba(42, 216, 255, 0.24);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(9, 31, 47, 0.72), rgba(2, 12, 22, 0.88)),
    rgba(3, 15, 25, 0.74);
  box-shadow:
    inset 0 1px 0 rgba(194, 244, 255, 0.12),
    0 18px 54px rgba(0, 8, 16, 0.24);
  padding: 18px;
}

.tradingview-control-card h3 {
  margin: 2px 0 12px;
  color: #f7fbff;
  font-size: 20px;
}

.tradingview-control-card .date-filter {
  margin: 0;
  border-color: rgba(42, 216, 255, 0.18);
  background: rgba(2, 14, 25, 0.54);
}

.tradingview-guide-panel {
  display: grid;
  gap: 10px;
}

.tradingview-guide-panel span {
  color: #ffd66e;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tradingview-guide-panel .template-block {
  max-height: 220px;
  margin: 0;
  border-color: rgba(42, 216, 255, 0.18);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(2, 14, 25, 0.94), rgba(1, 9, 17, 0.96)),
    rgba(2, 12, 20, 0.92);
  color: #cdebf5;
}

.tv-analytics-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 24px;
  align-items: center;
  overflow: hidden;
  border: 1px solid rgba(42, 216, 255, 0.24);
  border-radius: 22px;
  background:
    radial-gradient(circle at 16% 0%, rgba(42, 216, 255, 0.18), transparent 34%),
    linear-gradient(135deg, rgba(9, 31, 47, 0.9), rgba(2, 12, 22, 0.96)),
    rgba(3, 15, 25, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(194, 244, 255, 0.12),
    0 22px 55px rgba(0, 0, 0, 0.28);
  padding: 24px;
}

.tv-analytics-hero h3 {
  margin: 0 0 8px;
  color: #eef8f6;
  font-size: 28px;
  line-height: 1.1;
}

.tv-analytics-hero p:last-child {
  max-width: 860px;
  margin: 0;
  color: #a9bfbb;
  font-size: 14px;
  line-height: 1.55;
}

.tv-orbit-visual {
  display: grid;
  gap: 12px;
  align-content: center;
  min-height: 128px;
  border: 1px solid rgba(42, 216, 255, 0.18);
  border-radius: 16px;
  background:
    linear-gradient(90deg, rgba(42, 216, 255, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(42, 216, 255, 0.06) 1px, transparent 1px),
    rgba(2, 14, 25, 0.72);
  background-size: 18px 18px;
  padding: 22px;
}

.tv-orbit-visual span {
  display: block;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #38bdf8, #60a5fa, rgba(255, 255, 255, 0.22));
  box-shadow: 0 0 26px rgba(42, 216, 255, 0.24);
}

.tv-orbit-visual span:nth-child(1) {
  width: 72%;
}

.tv-orbit-visual span:nth-child(2) {
  width: 52%;
}

.tv-orbit-visual span:nth-child(3) {
  width: 88%;
}

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

.tv-metric-card,
.tv-chart-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(42, 216, 255, 0.22);
  border-radius: 18px;
  background:
    radial-gradient(circle at 10% 0%, rgba(42, 216, 255, 0.11), transparent 36%),
    linear-gradient(145deg, rgba(8, 34, 54, 0.64), rgba(1, 13, 22, 0.82));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 16px 38px rgba(0, 0, 0, 0.22);
}

.tv-metric-card {
  display: grid;
  gap: 9px;
  min-height: 122px;
  padding: 18px;
}

.tv-metric-card span,
.tv-card-heading span {
  color: #ffd166;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tv-metric-card strong {
  color: #eef8f6;
  font-size: 30px;
  line-height: 1;
}

.tv-metric-card small,
.tv-card-heading small {
  color: #99ada9;
  font-size: 12px;
  line-height: 1.4;
}

.tv-metric-cyan {
  border-color: rgba(0, 245, 224, 0.28);
}

.tv-metric-green {
  border-color: rgba(23, 255, 176, 0.22);
}

.tv-metric-amber {
  border-color: rgba(255, 209, 102, 0.34);
}

.tv-metric-purple {
  border-color: rgba(138, 149, 255, 0.26);
}

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

.tv-chart-card {
  min-height: 245px;
  padding: 18px;
}

.tv-chart-wide {
  grid-column: span 2;
}

.tv-card-heading {
  display: grid;
  gap: 5px;
  margin-bottom: 14px;
}

.tv-chart-list {
  display: grid;
  gap: 11px;
}

.tv-chart-row {
  display: grid;
  grid-template-columns: minmax(84px, 0.55fr) minmax(120px, 1fr) 42px;
  gap: 10px;
  align-items: center;
}

.tv-chart-row span {
  overflow: hidden;
  color: #d6e4e1;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tv-chart-row strong {
  color: #38d9ff;
  font-size: 13px;
  text-align: right;
}

.tv-chart-track {
  display: flex;
  overflow: hidden;
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.tv-chart-track i {
  display: block;
  min-width: 2px;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #38bdf8, #60a5fa);
  box-shadow: 0 0 18px rgba(42, 216, 255, 0.24);
}

.tv-stack-track i {
  border-radius: 0;
}

.tv-stack-track i:first-child {
  border-radius: 999px 0 0 999px;
}

.tv-stack-track i:last-child {
  border-radius: 0 999px 999px 0;
}

.tv-stack-1 {
  background: #00f5e0 !important;
}

.tv-stack-2 {
  background: #ffd166 !important;
}

.tv-stack-3 {
  background: #8a95ff !important;
}

.tv-stack-4 {
  background: #ff7474 !important;
}

.tradingview-ledger-console {
  margin-top: 18px;
}

.tradingview-ledger-console .compact-heading {
  align-items: center;
  border-bottom: 1px solid rgba(42, 216, 255, 0.12);
  padding-bottom: 12px;
}

.tradingview-ledger-date {
  margin: 14px 0;
  border-color: rgba(42, 216, 255, 0.18);
  background: rgba(2, 14, 25, 0.54);
}

.compact-heading {
  margin-top: 10px;
}

.compact-heading h3 {
  margin: 0;
  color: #eef8f6;
  font-size: 20px;
}

.settings-panel {
  border: 1px solid rgba(68, 216, 200, 0.18);
  border-radius: 12px;
  background:
    linear-gradient(145deg, rgba(7, 31, 38, 0.76), rgba(2, 16, 19, 0.86)),
    rgba(3, 18, 18, 0.68);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
  padding: 18px;
  margin: 18px 0;
}

.settings-form-panel .user-form {
  margin-top: 14px;
}

.telegram-settings-panel {
  position: relative;
  overflow: hidden;
  border-color: rgba(42, 216, 255, 0.38);
  border-radius: 22px;
  background:
    radial-gradient(circle at 16% 0%, rgba(42, 216, 255, 0.18), transparent 34%),
    linear-gradient(145deg, rgba(9, 31, 47, 0.88), rgba(2, 12, 22, 0.95) 64%),
    rgba(3, 15, 25, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(194, 244, 255, 0.16),
    0 0 0 1px rgba(42, 216, 255, 0.08),
    0 22px 72px rgba(0, 9, 16, 0.42),
    0 0 48px rgba(42, 216, 255, 0.08);
  padding: 22px;
}

.telegram-settings-panel::before {
  content: "";
  position: absolute;
  inset: 1px;
  pointer-events: none;
  border-radius: 20px;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.1), transparent 22%),
    linear-gradient(90deg, transparent, rgba(42, 216, 255, 0.1), transparent);
  opacity: 0.72;
}

.telegram-settings-panel > * {
  position: relative;
  z-index: 1;
}

.telegram-settings-panel .compact-heading {
  align-items: center;
  border-bottom: 1px solid rgba(92, 204, 240, 0.14);
  padding-bottom: 14px;
}

.telegram-settings-panel .eyebrow,
.telegram-settings-panel label,
.telegram-settings-panel .settings-checkbox-group > span {
  color: #ffd66e;
}

.telegram-settings-panel .compact-heading h3 {
  color: #f7fbff;
  font-size: 22px;
}

.telegram-settings-panel .form-help {
  max-width: 1120px;
  color: #abc4ce;
}

.telegram-settings-panel input,
.telegram-settings-panel select {
  border-color: rgba(93, 201, 236, 0.28);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(3, 18, 30, 0.94), rgba(2, 12, 21, 0.96)),
    rgba(2, 12, 20, 0.92);
  color: #f5fbff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 1px rgba(42, 216, 255, 0.02);
}

.telegram-settings-panel input:focus,
.telegram-settings-panel select:focus {
  border-color: rgba(42, 216, 255, 0.82);
  outline: none;
  box-shadow:
    0 0 0 3px rgba(42, 216, 255, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.telegram-settings-panel .check {
  border: 1px solid rgba(42, 216, 255, 0.18);
  border-radius: 12px;
  background: rgba(3, 20, 32, 0.72);
}

.telegram-settings-panel button {
  border-color: rgba(42, 216, 255, 0.52);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(42, 216, 255, 0.22), rgba(15, 92, 128, 0.22)),
    rgba(5, 30, 48, 0.7);
  color: #f5fbff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: transform 420ms cubic-bezier(0.32, 0.72, 0, 1), border-color 420ms cubic-bezier(0.32, 0.72, 0, 1), background 420ms cubic-bezier(0.32, 0.72, 0, 1);
}

.telegram-settings-panel button:not(:disabled):hover {
  border-color: rgba(94, 232, 255, 0.84);
  background:
    linear-gradient(180deg, rgba(67, 225, 255, 0.34), rgba(20, 117, 160, 0.3)),
    rgba(5, 36, 58, 0.84);
  transform: translateY(-1px);
}

.telegram-channel-rows {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
}

.telegram-channel-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.1fr) minmax(145px, 0.75fr) minmax(190px, 1fr) minmax(170px, 0.9fr) minmax(112px, 0.45fr) auto;
  gap: 12px;
  align-items: end;
  border: 1px solid rgba(55, 190, 224, 0.32);
  border-radius: 16px;
  background:
    radial-gradient(circle at 10% 0%, rgba(42, 216, 255, 0.12), transparent 34%),
    linear-gradient(145deg, rgba(8, 34, 54, 0.72), rgba(1, 13, 22, 0.88)),
    rgba(5, 23, 30, 0.68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  padding: 16px;
}

.channel-row-heading {
  align-self: stretch;
  display: grid;
  align-content: center;
  gap: 4px;
  border-left: 3px solid #2ad8ff;
  padding-left: 12px;
}

.channel-row-heading strong {
  color: #f2f7f6;
  font-size: 14px;
}

.channel-row-heading span {
  overflow: hidden;
  color: #8fb4c4;
  font-size: 11px;
  text-overflow: ellipsis;
}

.form-help {
  max-width: 920px;
  margin: 8px 0 0;
  color: #9fb8b6;
  line-height: 1.55;
}

.wide-check {
  grid-column: 1 / -1;
}

.settings-checkbox-group {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
}

.settings-checkbox-group > span {
  color: #ffd166;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}

.checkbox-grid .check {
  min-height: 42px;
  border: 1px solid rgba(68, 216, 200, 0.16);
  border-radius: 10px;
  background: rgba(0, 16, 18, 0.46);
  padding: 10px 12px;
}

.dual-ledger-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.dual-ledger-grid .table-wrap table {
  min-width: 980px;
}

.telegram-console-page {
  position: relative;
}

.telegram-console-hero {
  align-items: center;
  margin-bottom: 16px;
  border: 1px solid rgba(42, 216, 255, 0.32);
  border-radius: 26px;
  background:
    radial-gradient(circle at 8% 0%, rgba(42, 216, 255, 0.24), transparent 34%),
    radial-gradient(circle at 95% 10%, rgba(96, 165, 250, 0.2), transparent 28%),
    linear-gradient(145deg, rgba(8, 35, 55, 0.9), rgba(2, 13, 25, 0.95));
  box-shadow:
    inset 0 1px 0 rgba(194, 244, 255, 0.16),
    0 24px 78px rgba(0, 9, 18, 0.34),
    0 0 44px rgba(42, 216, 255, 0.08);
  padding: 24px;
}

.telegram-console-hero h2 {
  margin: 4px 0 8px;
}

.telegram-console-hero p:not(.eyebrow) {
  max-width: 820px;
  margin: 0;
  color: #a9c6d3;
  line-height: 1.6;
}

.telegram-control-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  gap: 16px;
  margin: 16px 0;
}

.telegram-control-card,
.telegram-filter-panel,
.telegram-ledger-table {
  border: 1px solid rgba(42, 216, 255, 0.24);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(9, 31, 47, 0.72), rgba(2, 12, 22, 0.88)),
    rgba(3, 15, 25, 0.74);
  box-shadow:
    inset 0 1px 0 rgba(194, 244, 255, 0.12),
    0 18px 54px rgba(0, 8, 16, 0.24);
}

.telegram-control-card {
  padding: 18px;
}

.telegram-control-card h3 {
  margin: 2px 0 12px;
  color: #f7fbff;
  font-size: 20px;
}

.telegram-control-card .date-filter {
  margin: 0;
  border-color: rgba(42, 216, 255, 0.18);
  background: rgba(2, 14, 25, 0.54);
}

.telegram-template-card .template-block {
  max-height: 220px;
  margin: 0;
  border-color: rgba(42, 216, 255, 0.18);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(2, 14, 25, 0.94), rgba(1, 9, 17, 0.96)),
    rgba(2, 12, 20, 0.92);
  color: #cdebf5;
}

.telegram-metric-grid {
  margin: 16px 0;
}

.telegram-metric-grid article {
  min-height: 104px;
  border-color: rgba(42, 216, 255, 0.22);
  border-radius: 18px;
  background:
    radial-gradient(circle at 10% 0%, rgba(42, 216, 255, 0.12), transparent 36%),
    linear-gradient(145deg, rgba(8, 34, 54, 0.62), rgba(1, 13, 22, 0.8));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.telegram-filter-panel {
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: end;
  margin: 16px 0;
  padding: 16px;
}

.telegram-ledger-table {
  margin-top: 16px;
  padding: 18px 18px 14px;
}

.telegram-ledger-table .compact-heading {
  align-items: center;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(42, 216, 255, 0.12);
  padding-bottom: 12px;
}

.telegram-ledger-table table {
  min-width: 1180px;
}

.telegram-ledger-table th {
  color: #ffd66e;
}

@media (max-width: 1100px) {
  .dual-ledger-grid {
    grid-template-columns: 1fr;
  }

  .telegram-control-grid {
    grid-template-columns: 1fr;
  }

  .telegram-console-hero {
    align-items: start;
    flex-direction: column;
  }

  .telegram-channel-row {
    grid-template-columns: 1fr 1fr;
  }

  .telegram-channel-row .action-row {
    grid-column: 1 / -1;
  }
}

.tradingview-alert-table {
  overflow-x: auto;
  border-color: rgba(42, 216, 255, 0.22);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(7, 28, 45, 0.7), rgba(2, 12, 22, 0.88)),
    rgba(3, 15, 25, 0.74);
  box-shadow:
    inset 0 1px 0 rgba(194, 244, 255, 0.1),
    0 18px 54px rgba(0, 8, 16, 0.2);
  padding: 14px 14px 16px;
}

.tradingview-alert-table table {
  min-width: 1760px;
}

.tradingview-alert-table th,
.tradingview-alert-table td {
  vertical-align: top;
}

.alert-filter-form {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin: 12px 0 18px;
  border: 1px solid rgba(42, 216, 255, 0.2);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(8, 34, 54, 0.54), rgba(1, 13, 22, 0.76)),
    rgba(5, 23, 30, 0.58);
  padding: 16px;
}

.alert-filter-form .check {
  align-self: end;
  border-color: rgba(42, 216, 255, 0.18);
  border-radius: 12px;
  background: rgba(3, 20, 32, 0.72);
  min-height: 42px;
}

.simple-payload-cell {
  min-width: 260px;
  max-width: 340px;
  color: #c4d8d4;
  font-size: 12px;
  line-height: 1.45;
}

body.theme-light .tv-analytics-hero,
body.theme-light .tv-metric-card,
body.theme-light .tv-chart-card,
body.theme-light .tradingview-guide-panel,
body.theme-light .tradingview-console-hero,
body.theme-light .tradingview-control-card,
body.theme-light .tradingview-ledger-console,
body.theme-light .alert-filter-form,
body.theme-light .tradingview-alert-table,
body.theme-light .settings-panel {
  border-color: rgba(0, 109, 116, 0.18);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(233, 249, 248, 0.86)),
    #ffffff;
  box-shadow: 0 18px 40px rgba(9, 62, 67, 0.1);
}

body.theme-light .tv-analytics-hero h3,
body.theme-light .tv-metric-card strong,
body.theme-light .tradingview-console-hero h2,
body.theme-light .tradingview-control-card h3,
body.theme-light .compact-heading h3 {
  color: #12282b;
}

body.theme-light .tv-analytics-hero p:last-child,
body.theme-light .tradingview-console-hero p:not(.eyebrow),
body.theme-light .tv-chart-row span,
body.theme-light .tv-metric-card small,
body.theme-light .tv-card-heading small,
body.theme-light .form-help {
  color: #42595b;
}

body.theme-light .tradingview-control-card .date-filter,
body.theme-light .tradingview-ledger-date,
body.theme-light .tradingview-guide-panel .template-block,
body.theme-light .alert-filter-form .check {
  border-color: rgba(14, 133, 180, 0.16);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(231, 247, 253, 0.72)),
    rgba(255, 255, 255, 0.84);
}

body.theme-light .tradingview-guide-panel .template-block {
  color: #21414b;
}

body.theme-light .checkbox-grid .check {
  background: rgba(236, 252, 250, 0.8);
}

body.theme-light .telegram-settings-panel {
  border-color: rgba(14, 133, 180, 0.24);
  background:
    radial-gradient(circle at 16% 0%, rgba(22, 165, 217, 0.16), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(231, 247, 253, 0.9)),
    #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 22px 56px rgba(22, 88, 113, 0.14);
}

body.theme-light .telegram-settings-panel .compact-heading {
  border-bottom-color: rgba(14, 133, 180, 0.14);
}

body.theme-light .telegram-settings-panel .compact-heading h3 {
  color: #102a35;
}

body.theme-light .telegram-settings-panel .eyebrow,
body.theme-light .telegram-settings-panel label,
body.theme-light .telegram-settings-panel .settings-checkbox-group > span {
  color: #9b6a00;
}

body.theme-light .telegram-settings-panel input,
body.theme-light .telegram-settings-panel select {
  border-color: rgba(14, 133, 180, 0.22);
  background: rgba(255, 255, 255, 0.92);
  color: #102a35;
}

body.theme-light .telegram-settings-panel .check,
body.theme-light .telegram-channel-row {
  border-color: rgba(14, 133, 180, 0.18);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(231, 247, 253, 0.72)),
    rgba(255, 255, 255, 0.84);
}

body.theme-light .telegram-settings-panel button {
  border-color: rgba(14, 133, 180, 0.32);
  background: linear-gradient(180deg, rgba(224, 248, 255, 0.94), rgba(200, 234, 246, 0.9));
  color: #102a35;
}

body.theme-light .telegram-console-hero,
body.theme-light .telegram-control-card,
body.theme-light .telegram-filter-panel,
body.theme-light .telegram-ledger-table {
  border-color: rgba(14, 133, 180, 0.22);
  background:
    radial-gradient(circle at 10% 0%, rgba(22, 165, 217, 0.14), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(232, 248, 254, 0.88)),
    #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 18px 48px rgba(22, 88, 113, 0.12);
}

body.theme-light .telegram-console-hero p:not(.eyebrow),
body.theme-light .telegram-control-card h3 {
  color: #102a35;
}

body.theme-light .telegram-control-card .date-filter,
body.theme-light .telegram-template-card .template-block,
body.theme-light .telegram-metric-grid article {
  border-color: rgba(14, 133, 180, 0.16);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(231, 247, 253, 0.72)),
    rgba(255, 255, 255, 0.84);
}

body.theme-light .telegram-template-card .template-block {
  color: #21414b;
}

body.theme-light .telegram-ledger-table .compact-heading {
  border-bottom-color: rgba(14, 133, 180, 0.14);
}

body.theme-light .tv-orbit-visual {
  background:
    linear-gradient(90deg, rgba(0, 109, 116, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(0, 109, 116, 0.06) 1px, transparent 1px),
    rgba(235, 253, 251, 0.8);
  background-size: 18px 18px;
}

body.theme-light .tv-chart-track {
  background: rgba(0, 109, 116, 0.1);
}

body.theme-light .simple-payload-cell {
  color: #42595b;
}

@media (max-width: 1280px) {
  .tv-metric-grid,
  .tv-chart-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tv-chart-wide {
    grid-column: span 2;
  }
}

@media (max-width: 820px) {
  .tv-analytics-hero,
  .tradingview-control-grid,
  .tv-metric-grid,
  .tv-chart-grid {
    grid-template-columns: 1fr;
  }

  .tradingview-console-hero {
    align-items: start;
    flex-direction: column;
  }

  .tv-chart-wide {
    grid-column: span 1;
  }

  .tv-orbit-visual {
    min-height: 92px;
  }
}

.control-room-page {
  --home-blue: #38bdf8;
  --home-blue-strong: #60a5fa;
  --home-blue-deep: #1d4ed8;
  --home-blue-soft: rgba(56, 189, 248, 0.18);
  --home-blue-faint: rgba(56, 189, 248, 0.08);
}

.control-room-page .eyebrow,
.control-room-page .home-live-badge strong,
.control-room-page .home-feed-row .positive,
.control-room-page .home-feed-row strong,
.control-room-page .health-list strong,
.control-room-page .control-status-card small,
.control-room-page .mini-feed-heading span,
.control-room-page .risk-bars strong {
  color: var(--home-blue);
}

.control-room-page .home-live-badge,
.control-room-page .control-status-card,
.control-room-page .glass-panel,
.control-room-page .mini-feed-card,
.control-room-page .home-feed-row,
.control-room-page .pill,
.control-room-page button {
  border-color: var(--home-blue-soft);
}

.control-room-page .home-live-badge,
.control-room-page .glass-panel,
.control-room-page .control-status-card,
.control-room-page .mini-feed-card {
  background:
    linear-gradient(145deg, rgba(14, 35, 52, 0.82), rgba(3, 11, 18, 0.92)),
    rgba(3, 14, 24, 0.86);
}

.control-room-page .glass-panel::before {
  background:
    linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.09), transparent),
    radial-gradient(circle at 18% 0%, rgba(96, 165, 250, 0.13), transparent 34%);
}

.control-room-page .home-feed-row {
  background: rgba(5, 18, 30, 0.72);
}

.control-room-page .pill,
.control-room-page .home-live-badge {
  background: rgba(56, 189, 248, 0.08);
  color: var(--home-blue);
}

.control-room-page button {
  background: rgba(56, 189, 248, 0.1);
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.12);
}

.control-room-page button:hover:not(:disabled) {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(96, 165, 250, 0.42);
}

.control-room-page .risk-ring {
  background:
    radial-gradient(circle at center, rgba(6, 17, 26, 0.95) 48%, transparent 50%),
    conic-gradient(var(--home-blue) 0 68%, rgba(56, 189, 248, 0.14) 68% 100%);
}

.control-room-page .risk-bars div,
.control-room-page .health-list div {
  border-bottom-color: rgba(56, 189, 248, 0.12);
}

body.theme-light .control-room-page .home-live-badge,
body.theme-light .control-room-page .control-status-card,
body.theme-light .control-room-page .glass-panel,
body.theme-light .control-room-page .mini-feed-card {
  border-color: rgba(37, 99, 235, 0.18);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(231, 244, 255, 0.84)),
    #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84), 0 14px 32px rgba(37, 99, 235, 0.08);
}

body.theme-light .control-room-page .eyebrow,
body.theme-light .control-room-page .home-live-badge strong,
body.theme-light .control-room-page .home-feed-row .positive,
body.theme-light .control-room-page .home-feed-row strong,
body.theme-light .control-room-page .health-list strong,
body.theme-light .control-room-page .control-status-card small,
body.theme-light .control-room-page .mini-feed-heading span,
body.theme-light .control-room-page .risk-bars strong {
  color: #1d4ed8;
}

body.theme-light .control-room-page .home-feed-row,
body.theme-light .control-room-page .pill {
  border-color: rgba(37, 99, 235, 0.16);
  background: rgba(232, 244, 255, 0.8);
}

body.theme-light .control-room-page .risk-ring {
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.96) 48%, transparent 50%),
    conic-gradient(#2563eb 0 68%, rgba(37, 99, 235, 0.12) 68% 100%);
}

body[data-active-page="home"] {
  background:
    radial-gradient(circle at 86% 12%, rgba(0, 163, 255, 0.24), transparent 34%),
    radial-gradient(circle at 4% 86%, rgba(0, 199, 255, 0.18), transparent 38%),
    linear-gradient(135deg, #020713 0%, #031322 48%, #020711 100%);
  color: #e9f7ff;
}

body[data-active-page="home"] .app-shell {
  background:
    radial-gradient(circle at 88% 4%, rgba(0, 178, 255, 0.18), transparent 30%),
    radial-gradient(circle at 6% 92%, rgba(0, 199, 255, 0.14), transparent 34%),
    linear-gradient(135deg, #020713 0%, #031322 54%, #020711 100%);
}

body[data-active-page="home"] .workspace {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(0, 177, 255, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(0, 177, 255, 0.05) 1px, transparent 1px),
    radial-gradient(circle at 74% 18%, rgba(0, 194, 255, 0.22), transparent 28%),
    linear-gradient(135deg, rgba(2, 7, 19, 0.98), rgba(3, 19, 34, 0.98));
  background-size: 64px 64px, 64px 64px, auto, auto;
}

body[data-active-page="home"] .workspace::before,
body[data-active-page="home"] .workspace::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
}

body[data-active-page="home"] .workspace::before {
  inset: 0 0 0 250px;
  opacity: 0.72;
  background:
    radial-gradient(circle at 84% 8%, rgba(93, 213, 255, 0.95) 0 2px, transparent 3px),
    radial-gradient(circle at 92% 14%, rgba(93, 213, 255, 0.9) 0 1px, transparent 2px),
    radial-gradient(circle at 72% 28%, rgba(93, 213, 255, 0.75) 0 2px, transparent 3px),
    radial-gradient(circle at 10% 78%, rgba(93, 213, 255, 0.85) 0 2px, transparent 3px),
    radial-gradient(circle at 16% 86%, rgba(93, 213, 255, 0.7) 0 1px, transparent 2px),
    linear-gradient(145deg, transparent 0 50%, rgba(0, 184, 255, 0.24) 50.2%, transparent 50.8%),
    linear-gradient(25deg, transparent 0 58%, rgba(0, 184, 255, 0.18) 58.2%, transparent 58.7%),
    linear-gradient(156deg, transparent 0 64%, rgba(0, 184, 255, 0.16) 64.2%, transparent 64.8%);
}

body[data-active-page="home"] .workspace::after {
  right: 28px;
  bottom: 28px;
  width: 28px;
  height: 28px;
  opacity: 0.9;
  clip-path: polygon(0 46%, 100% 0, 70% 100%, 48% 62%);
  background: #f4fbff;
  box-shadow: 0 0 28px rgba(0, 194, 255, 0.44);
}

body[data-active-page="home"] .sidebar,
body[data-active-page="home"] .topbar {
  position: relative;
  z-index: 2;
  border-color: rgba(70, 179, 224, 0.18);
  background:
    linear-gradient(180deg, rgba(2, 12, 25, 0.96), rgba(2, 8, 18, 0.88)),
    #020713;
}

body[data-active-page="home"] .topbar {
  box-shadow: 0 1px 0 rgba(66, 203, 255, 0.11), 0 18px 54px rgba(0, 0, 0, 0.24);
}

body[data-active-page="home"] .brand strong,
body[data-active-page="home"] .topbar-heading h1,
body[data-active-page="home"] .control-room-hero h2,
body[data-active-page="home"] .glass-panel h2,
body[data-active-page="home"] .glass-panel h3 {
  color: #f1fbff;
  text-shadow: 0 0 24px rgba(64, 196, 255, 0.18);
}

body[data-active-page="home"] .brand span,
body[data-active-page="home"] .topbar-user span,
body[data-active-page="home"] .auto-refresh-status,
body[data-active-page="home"] .home-lede,
body[data-active-page="home"] .control-room-hero .home-lede,
body[data-active-page="home"] .metric-mini-card p,
body[data-active-page="home"] .risk-ring span {
  color: rgba(205, 230, 244, 0.76);
}

body[data-active-page="home"] .nav-link.active {
  border-left-color: #42d9ff;
  background: rgba(42, 180, 255, 0.13);
  color: #7ee8ff;
  box-shadow: inset 0 0 22px rgba(0, 194, 255, 0.08);
}

body[data-active-page="home"] .control-room-page {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 76px);
  padding: 30px 34px 42px;
  background:
    radial-gradient(circle at 78% 4%, rgba(45, 202, 255, 0.18), transparent 28%),
    radial-gradient(circle at 14% 88%, rgba(45, 202, 255, 0.12), transparent 32%),
    linear-gradient(135deg, rgba(0, 9, 22, 0.28), rgba(0, 20, 38, 0.18));
}

body[data-active-page="home"] .control-room-hero {
  min-height: 118px;
}

body[data-active-page="home"] .control-room-hero .eyebrow {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border-radius: 999px;
  background: rgba(0, 13, 27, 0.62);
  box-shadow: 0 0 36px rgba(0, 194, 255, 0.16);
  color: #ffffff;
  padding: 0 18px;
  letter-spacing: 0.12em;
}

body[data-active-page="home"] .control-status-card,
body[data-active-page="home"] .glass-panel,
body[data-active-page="home"] .mini-feed-card,
body[data-active-page="home"] .home-live-badge {
  border: 1px solid rgba(118, 209, 255, 0.34);
  background:
    linear-gradient(180deg, rgba(18, 39, 58, 0.72), rgba(5, 18, 34, 0.74)),
    rgba(4, 16, 31, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(180, 233, 255, 0.16),
    inset 0 -1px 0 rgba(0, 194, 255, 0.08),
    0 0 0 1px rgba(0, 194, 255, 0.04),
    0 22px 70px rgba(0, 0, 0, 0.34);
}

body[data-active-page="home"] .control-status-card::before,
body[data-active-page="home"] .glass-panel::before,
body[data-active-page="home"] .mini-feed-card::before {
  content: "";
  position: absolute;
  left: 16%;
  right: 16%;
  top: -2px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #35d8ff, transparent);
  box-shadow: 0 0 18px rgba(53, 216, 255, 0.92);
}

body[data-active-page="home"] .glass-panel,
body[data-active-page="home"] .mini-feed-card {
  position: relative;
}

body[data-active-page="home"] .control-status-card span,
body[data-active-page="home"] .mini-feed-heading strong,
body[data-active-page="home"] .risk-bars span,
body[data-active-page="home"] .glass-panel .panel-heading span,
body[data-active-page="home"] .home-live-badge span {
  color: rgba(192, 222, 236, 0.74);
}

body[data-active-page="home"] .control-status-card small,
body[data-active-page="home"] .mini-feed-heading span,
body[data-active-page="home"] .health-list strong,
body[data-active-page="home"] .risk-bars strong,
body[data-active-page="home"] .home-live-badge strong,
body[data-active-page="home"] .pill {
  color: #4ee6ff;
}

body[data-active-page="home"] .home-feed-row {
  border: 1px solid rgba(77, 190, 239, 0.12);
  background: rgba(3, 15, 29, 0.66);
  box-shadow: inset 0 1px 0 rgba(159, 225, 255, 0.06);
}

body[data-active-page="home"] .home-feed-row strong {
  color: #f4fbff;
}

body[data-active-page="home"] .home-feed-row span,
body[data-active-page="home"] .empty-state {
  color: rgba(205, 230, 244, 0.78);
}

body[data-active-page="home"] .home-feed-row .positive {
  color: #4ee6ff;
}

body[data-active-page="home"] .home-feed-row .negative {
  color: #ff7b9c;
}

body[data-active-page="home"] .pill,
body[data-active-page="home"] .home-live-badge {
  background: rgba(14, 161, 220, 0.12);
  border-color: rgba(90, 213, 255, 0.28);
  box-shadow: inset 0 0 18px rgba(0, 194, 255, 0.05);
}

body[data-active-page="home"] button {
  border-color: rgba(88, 211, 255, 0.36);
  background: linear-gradient(180deg, rgba(33, 185, 234, 0.2), rgba(8, 72, 112, 0.28));
  color: #f1fbff;
  box-shadow: 0 0 24px rgba(0, 194, 255, 0.12);
}

body[data-active-page="home"] button:hover:not(:disabled) {
  border-color: rgba(120, 228, 255, 0.64);
  background: linear-gradient(180deg, rgba(55, 205, 255, 0.28), rgba(12, 92, 139, 0.34));
}

body[data-active-page="home"] .risk-ring {
  background:
    radial-gradient(circle at center, rgba(4, 15, 29, 0.96) 47%, transparent 49%),
    conic-gradient(#4ee6ff 0 68%, rgba(78, 230, 255, 0.11) 68% 100%);
  box-shadow:
    inset 0 0 30px rgba(0, 194, 255, 0.08),
    0 0 42px rgba(0, 194, 255, 0.1);
}

body[data-active-page="home"] .risk-bars div,
body[data-active-page="home"] .health-list div {
  border-bottom-color: rgba(79, 197, 244, 0.13);
}

body[data-active-page="home"] .topbar-refresh select,
body[data-active-page="home"] .topbar-refresh input[type="number"],
body[data-active-page="home"] .theme-switch button,
body[data-active-page="home"] .topbar-user {
  border-color: rgba(89, 203, 255, 0.24);
  background: rgba(3, 16, 31, 0.7);
}

body[data-active-page="home"].theme-light .app-shell,
body[data-active-page="home"].theme-light .workspace,
body[data-active-page="home"].theme-light .sidebar,
body[data-active-page="home"].theme-light .topbar {
  background:
    radial-gradient(circle at 84% 8%, rgba(60, 172, 244, 0.2), transparent 34%),
    linear-gradient(135deg, #eaf7ff, #d9effc);
}

body[data-active-page="home"].theme-light .control-status-card,
body[data-active-page="home"].theme-light .glass-panel,
body[data-active-page="home"].theme-light .mini-feed-card,
body[data-active-page="home"].theme-light .home-live-badge {
  border-color: rgba(37, 99, 235, 0.22);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(226, 244, 255, 0.76)),
    #ffffff;
}

body.is-authenticated {
  --dashboard-bg: #020713;
  --dashboard-panel: rgba(5, 18, 34, 0.76);
  --dashboard-panel-strong: rgba(8, 28, 48, 0.84);
  --dashboard-border: rgba(118, 209, 255, 0.24);
  --dashboard-border-strong: rgba(118, 209, 255, 0.42);
  --dashboard-line: rgba(79, 197, 244, 0.13);
  --dashboard-blue: #4ee6ff;
  --dashboard-blue-soft: rgba(78, 230, 255, 0.12);
  --dashboard-blue-deep: #2563eb;
  --dashboard-text: #e9f7ff;
  --dashboard-muted: rgba(205, 230, 244, 0.76);
  --dashboard-muted-strong: rgba(225, 242, 250, 0.88);
  --dashboard-danger: #ff7b9c;
  background:
    radial-gradient(circle at 86% 12%, rgba(0, 163, 255, 0.24), transparent 34%),
    radial-gradient(circle at 4% 86%, rgba(0, 199, 255, 0.18), transparent 38%),
    linear-gradient(135deg, #020713 0%, #031322 48%, #020711 100%);
  color: var(--dashboard-text);
}

body.is-authenticated .app-shell {
  background:
    radial-gradient(circle at 88% 4%, rgba(0, 178, 255, 0.16), transparent 30%),
    radial-gradient(circle at 6% 92%, rgba(0, 199, 255, 0.12), transparent 34%),
    linear-gradient(135deg, #020713 0%, #031322 54%, #020711 100%);
}

body.is-authenticated .workspace {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(0, 177, 255, 0.055) 1px, transparent 1px),
    linear-gradient(0deg, rgba(0, 177, 255, 0.04) 1px, transparent 1px),
    radial-gradient(circle at 74% 18%, rgba(0, 194, 255, 0.18), transparent 28%),
    linear-gradient(135deg, rgba(2, 7, 19, 0.98), rgba(3, 19, 34, 0.98));
  background-size: 64px 64px, 64px 64px, auto, auto;
}

body.is-authenticated .workspace::before {
  content: "";
  position: fixed;
  inset: 0 0 0 250px;
  z-index: 0;
  pointer-events: none;
  opacity: 0.45;
  background:
    radial-gradient(circle at 84% 8%, rgba(93, 213, 255, 0.86) 0 2px, transparent 3px),
    radial-gradient(circle at 92% 14%, rgba(93, 213, 255, 0.66) 0 1px, transparent 2px),
    radial-gradient(circle at 72% 28%, rgba(93, 213, 255, 0.52) 0 2px, transparent 3px),
    linear-gradient(145deg, transparent 0 50%, rgba(0, 184, 255, 0.18) 50.2%, transparent 50.8%),
    linear-gradient(25deg, transparent 0 58%, rgba(0, 184, 255, 0.13) 58.2%, transparent 58.7%);
}

body.is-authenticated .page,
body.is-authenticated .topbar,
body.is-authenticated .sidebar {
  position: relative;
  z-index: 1;
}

body.is-authenticated .sidebar {
  border-right: 0;
  background:
    linear-gradient(180deg, rgba(2, 12, 25, 0.98), rgba(2, 8, 18, 0.92)),
    #020713;
  box-shadow: inset -1px 0 0 rgba(66, 203, 255, 0.08), 18px 0 70px rgba(0, 0, 0, 0.26);
}

body.is-authenticated .brand {
  margin-bottom: 18px;
  padding: 8px 8px 16px;
  border-bottom: 1px solid rgba(91, 209, 255, 0.08);
}

body.is-authenticated .brand strong,
body.is-authenticated .topbar-heading h1,
body.is-authenticated .section-heading h2,
body.is-authenticated article strong,
body.is-authenticated .tracker-grid h3 {
  color: #f1fbff;
  text-shadow: 0 0 24px rgba(64, 196, 255, 0.16);
}

body.is-authenticated .brand span,
body.is-authenticated .topbar-user span,
body.is-authenticated .message,
body.is-authenticated .muted-text,
body.is-authenticated .prep-panel p {
  color: var(--dashboard-muted);
}

body.is-authenticated .nav-list {
  gap: 8px;
}

body.is-authenticated .nav-link {
  min-height: 42px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--dashboard-muted-strong);
  padding: 0 14px;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

body.is-authenticated .nav-link:hover {
  background: rgba(42, 180, 255, 0.08);
  color: #f1fbff;
  box-shadow: inset 0 0 20px rgba(0, 194, 255, 0.05);
  transform: translateX(2px);
}

body.is-authenticated .nav-link.active {
  border-left: 0;
  background:
    linear-gradient(90deg, rgba(42, 180, 255, 0.22), rgba(42, 180, 255, 0.08)),
    rgba(42, 180, 255, 0.1);
  color: #7ee8ff;
  box-shadow: inset 0 0 24px rgba(0, 194, 255, 0.1), 0 0 22px rgba(0, 194, 255, 0.08);
}

body.is-authenticated .topbar {
  border-bottom: 1px solid rgba(70, 179, 224, 0.16);
  background:
    linear-gradient(180deg, rgba(2, 12, 25, 0.96), rgba(2, 8, 18, 0.88)),
    #020713;
  box-shadow: 0 1px 0 rgba(66, 203, 255, 0.1), 0 18px 54px rgba(0, 0, 0, 0.22);
}

body.is-authenticated .eyebrow,
body.is-authenticated article span,
body.is-authenticated label,
body.is-authenticated th,
body.is-authenticated .mini-feed-heading strong,
body.is-authenticated .glass-panel .panel-heading span,
body.is-authenticated .risk-bars span,
body.is-authenticated .health-list span,
body.is-authenticated .tv-card-heading span,
body.is-authenticated .tv-metric-card span {
  color: #95c7df;
}

body.is-authenticated .settings-grid a,
body.is-authenticated .success-text,
body.is-authenticated .pill,
body.is-authenticated .status-active,
body.is-authenticated .status-connected,
body.is-authenticated .status-completed,
body.is-authenticated .positive,
body.is-authenticated .health-list strong,
body.is-authenticated .risk-bars strong {
  color: var(--dashboard-blue);
}

body.is-authenticated .negative,
body.is-authenticated .status-failed,
body.is-authenticated .error-text {
  color: var(--dashboard-danger);
}

body.is-authenticated button,
body.is-authenticated input,
body.is-authenticated select,
body.is-authenticated .topbar-user,
body.is-authenticated .theme-switch button,
body.is-authenticated .message,
body.is-authenticated .date-filter,
body.is-authenticated .table-wrap,
body.is-authenticated article,
body.is-authenticated .prep-panel,
body.is-authenticated .template-block,
body.is-authenticated .account-access-card,
body.is-authenticated .tv-analytics-hero,
body.is-authenticated .tv-metric-card,
body.is-authenticated .tv-chart-card,
body.is-authenticated .tradingview-guide-panel,
body.is-authenticated .cleanup-panel,
body.is-authenticated .danger-zone,
body.is-authenticated .glass-panel,
body.is-authenticated .mini-feed-card,
body.is-authenticated .control-status-card,
body.is-authenticated .home-live-badge {
  border-color: var(--dashboard-border);
}

body.is-authenticated article,
body.is-authenticated .prep-panel,
body.is-authenticated .table-wrap,
body.is-authenticated .date-filter,
body.is-authenticated .message,
body.is-authenticated .account-access-card,
body.is-authenticated .tv-analytics-hero,
body.is-authenticated .tv-metric-card,
body.is-authenticated .tv-chart-card,
body.is-authenticated .tradingview-guide-panel,
body.is-authenticated .cleanup-panel {
  background:
    linear-gradient(180deg, rgba(18, 39, 58, 0.62), rgba(5, 18, 34, 0.68)),
    var(--dashboard-panel);
  box-shadow: inset 0 1px 0 rgba(180, 233, 255, 0.12), 0 20px 56px rgba(0, 0, 0, 0.22);
}

body.is-authenticated button {
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(33, 185, 234, 0.2), rgba(8, 72, 112, 0.28));
  color: #f1fbff;
  box-shadow: 0 0 24px rgba(0, 194, 255, 0.1);
}

body.is-authenticated button:hover:not(:disabled) {
  border-color: rgba(120, 228, 255, 0.64);
  background: linear-gradient(180deg, rgba(55, 205, 255, 0.28), rgba(12, 92, 139, 0.34));
}

body.is-authenticated input,
body.is-authenticated select,
body.is-authenticated .topbar-refresh select,
body.is-authenticated .topbar-refresh input[type="number"],
body.is-authenticated .theme-switch button,
body.is-authenticated .topbar-user {
  border-radius: 8px;
  background: rgba(3, 16, 31, 0.7);
  color: var(--dashboard-text);
}

body.is-authenticated input:focus,
body.is-authenticated select:focus {
  border-color: rgba(88, 211, 255, 0.72);
  outline: none;
  box-shadow: 0 0 0 3px rgba(78, 230, 255, 0.1);
}

body.is-authenticated tr:hover td,
body.is-authenticated .home-feed-row,
body.is-authenticated .compact-table-feed .home-feed-row {
  background: rgba(3, 15, 29, 0.66);
}

body.is-authenticated td,
body.is-authenticated th,
body.is-authenticated .risk-bars div,
body.is-authenticated .health-list div {
  border-bottom-color: var(--dashboard-line);
}

body.is-authenticated .table-wrap {
  scrollbar-color: rgba(78, 230, 255, 0.72) rgba(255, 255, 255, 0.08);
}

body.is-authenticated .table-wrap::-webkit-scrollbar-thumb,
body.is-authenticated .progress-track span,
body.is-authenticated .tv-chart-track i {
  background: linear-gradient(90deg, #38bdf8, #60a5fa, rgba(255, 255, 255, 0.28));
}

body.is-authenticated .settings-panel,
body.is-authenticated .settings-grid article,
body.is-authenticated .telegram-settings-panel,
body.is-authenticated .telegram-control-card,
body.is-authenticated .telegram-filter-panel,
body.is-authenticated .telegram-ledger-table,
body.is-authenticated .telegram-metric-grid article,
body.is-authenticated .tradingview-control-card,
body.is-authenticated .tradingview-ledger-console,
body.is-authenticated .alert-filter-form,
body.is-authenticated .account-access-card,
body.is-authenticated .prep-panel,
body.is-authenticated .cleanup-panel,
body.is-authenticated .danger-zone,
body.is-authenticated .tv-metric-card,
body.is-authenticated .tv-chart-card,
body.is-authenticated .table-wrap,
body.is-authenticated .table-view-controls,
body.is-authenticated .date-filter,
body.is-authenticated .message {
  position: relative;
  min-width: 0;
  border: 1px solid var(--dashboard-border);
  border-radius: 18px;
  background:
    radial-gradient(circle at 12% 0%, rgba(78, 230, 255, 0.12), transparent 34%),
    linear-gradient(145deg, rgba(8, 28, 48, 0.82), rgba(3, 13, 26, 0.9)),
    var(--dashboard-panel);
  box-shadow:
    inset 0 1px 0 rgba(180, 233, 255, 0.12),
    0 18px 60px rgba(0, 0, 0, 0.24),
    0 0 38px rgba(42, 180, 255, 0.06);
}

body.is-authenticated .settings-panel,
body.is-authenticated .telegram-settings-panel,
body.is-authenticated .telegram-control-card,
body.is-authenticated .telegram-filter-panel,
body.is-authenticated .telegram-ledger-table,
body.is-authenticated .tradingview-control-card,
body.is-authenticated .tradingview-ledger-console,
body.is-authenticated .alert-filter-form,
body.is-authenticated .account-access-card,
body.is-authenticated .prep-panel,
body.is-authenticated .cleanup-panel,
body.is-authenticated .danger-zone,
body.is-authenticated .tv-metric-card,
body.is-authenticated .tv-chart-card,
body.is-authenticated .table-view-controls {
  overflow: hidden;
}

body.is-authenticated .settings-panel::before,
body.is-authenticated .settings-grid article::before,
body.is-authenticated .telegram-settings-panel::before,
body.is-authenticated .telegram-control-card::before,
body.is-authenticated .telegram-filter-panel::before,
body.is-authenticated .telegram-ledger-table::before,
body.is-authenticated .telegram-metric-grid article::before,
body.is-authenticated .tradingview-control-card::before,
body.is-authenticated .tradingview-ledger-console::before,
body.is-authenticated .alert-filter-form::before,
body.is-authenticated .account-access-card::before,
body.is-authenticated .prep-panel::before,
body.is-authenticated .cleanup-panel::before,
body.is-authenticated .danger-zone::before,
body.is-authenticated .tv-metric-card::before,
body.is-authenticated .tv-chart-card::before,
body.is-authenticated .table-view-controls::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.11), transparent 25%, transparent 74%, rgba(78, 230, 255, 0.08)),
    linear-gradient(90deg, transparent, rgba(78, 230, 255, 0.05), transparent);
  opacity: 0.72;
}

body.is-authenticated .settings-panel > *,
body.is-authenticated .settings-grid article > *,
body.is-authenticated .telegram-settings-panel > *,
body.is-authenticated .telegram-control-card > *,
body.is-authenticated .telegram-filter-panel > *,
body.is-authenticated .telegram-ledger-table > *,
body.is-authenticated .telegram-metric-grid article > *,
body.is-authenticated .tradingview-control-card > *,
body.is-authenticated .tradingview-ledger-console > *,
body.is-authenticated .alert-filter-form > *,
body.is-authenticated .account-access-card > *,
body.is-authenticated .prep-panel > *,
body.is-authenticated .cleanup-panel > *,
body.is-authenticated .danger-zone > *,
body.is-authenticated .tv-metric-card > *,
body.is-authenticated .tv-chart-card > *,
body.is-authenticated .table-view-controls > * {
  position: relative;
  z-index: 1;
}

body.is-authenticated .settings-panel,
body.is-authenticated .telegram-settings-panel,
body.is-authenticated .telegram-control-card,
body.is-authenticated .telegram-filter-panel,
body.is-authenticated .telegram-ledger-table,
body.is-authenticated .tradingview-control-card,
body.is-authenticated .tradingview-ledger-console,
body.is-authenticated .alert-filter-form,
body.is-authenticated .account-access-card,
body.is-authenticated .prep-panel,
body.is-authenticated .cleanup-panel,
body.is-authenticated .danger-zone,
body.is-authenticated .tv-metric-card,
body.is-authenticated .tv-chart-card {
  padding: 20px;
}

body.is-authenticated .table-wrap {
  padding: 14px;
  overflow: auto;
}

body.is-authenticated .pill,
body.is-authenticated .status-active,
body.is-authenticated .status-connected,
body.is-authenticated .status-completed {
  border-color: rgba(78, 230, 255, 0.34);
  background: rgba(78, 230, 255, 0.1);
}

body.is-authenticated .status-in-progress,
body.is-authenticated .status-paused,
body.is-authenticated .status-partial {
  border-color: rgba(96, 165, 250, 0.42);
  background: rgba(96, 165, 250, 0.12);
  color: #93c5fd;
}

body.is-authenticated .status-pending,
body.is-authenticated .status-disabled,
body.is-authenticated .status-not_tested {
  border-color: rgba(148, 191, 216, 0.28);
  background: rgba(148, 191, 216, 0.08);
  color: rgba(205, 230, 244, 0.78);
}

.home-filter-form {
  grid-template-columns: minmax(210px, 1.4fr) repeat(4, minmax(140px, 0.8fr)) auto auto;
  align-items: end;
  margin: 18px 0 18px;
  padding: 16px;
  border: 1px solid var(--dashboard-border);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(18, 39, 58, 0.64), rgba(5, 18, 34, 0.7)),
    rgba(5, 18, 34, 0.76);
  box-shadow: inset 0 1px 0 rgba(180, 233, 255, 0.12), 0 18px 54px rgba(0, 0, 0, 0.22);
}

.home-date-filter {
  margin: 18px 0 0;
  padding: 14px 16px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(18, 39, 58, 0.64), rgba(5, 18, 34, 0.7)),
    rgba(5, 18, 34, 0.76);
  box-shadow: inset 0 1px 0 rgba(180, 233, 255, 0.12), 0 18px 54px rgba(0, 0, 0, 0.2);
}

.home-filter-form label {
  color: #95c7df;
}

.home-filter-form button {
  min-height: 42px;
}

.table-view-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(116px, max-content));
  gap: 10px;
  align-items: end;
  margin: 14px 0 8px;
  padding: 12px;
  max-width: 100%;
  justify-content: start;
  overflow-x: auto;
  border: 1px solid var(--dashboard-border, rgba(42, 216, 255, 0.22));
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(18, 39, 58, 0.56), rgba(5, 18, 34, 0.68)),
    rgba(5, 18, 34, 0.72);
  box-shadow: inset 0 1px 0 rgba(180, 233, 255, 0.1), 0 12px 34px rgba(0, 0, 0, 0.16);
}

.table-view-controls label {
  color: #95c7df;
  font-size: 11px;
  min-width: 112px;
}

.table-view-controls input[type="number"] {
  min-height: 38px;
}

.table-view-controls .check {
  min-width: 116px;
  min-height: 38px;
  align-items: center;
  border: 1px solid rgba(42, 216, 255, 0.16);
  border-radius: 12px;
  background: rgba(3, 20, 32, 0.54);
  padding: 10px 12px;
}

.table-view-controls button {
  min-width: 104px;
  min-height: 38px;
}

.table-wrap.table-limited {
  max-height: calc(130px + (var(--table-visible-rows, 10) * 54px));
  overflow: auto;
}

.table-wrap.table-show-all {
  max-height: none;
  overflow-x: scroll;
  overflow-y: hidden;
}

.table-wrap.table-wrap-text th,
.table-wrap.table-wrap-text td {
  max-width: 340px;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  line-height: 1.45;
}

.table-wrap.table-wrap-text td:first-child,
.table-wrap.table-wrap-text th:first-child,
.table-wrap.table-wrap-text td:last-child,
.table-wrap.table-wrap-text th:last-child {
  max-width: 220px;
}

.table-wrap:not(.table-wrap-text) th,
.table-wrap:not(.table-wrap-text) td {
  white-space: nowrap;
}

.table-wrap th[style*="sticky"],
.table-wrap td[style*="sticky"] {
  background:
    linear-gradient(180deg, rgba(10, 35, 55, 0.98), rgba(3, 16, 31, 0.98)),
    #061827;
  box-shadow: 1px 0 0 rgba(42, 216, 255, 0.12), 0 1px 0 rgba(42, 216, 255, 0.08);
}

.table-wrap.table-sticky-head thead th {
  background:
    linear-gradient(180deg, rgba(11, 38, 60, 0.98), rgba(5, 20, 36, 0.98)),
    #071b2d;
}

body.theme-light.is-authenticated .table-view-controls {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(226, 244, 255, 0.76)),
    #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84), 0 12px 26px rgba(37, 99, 235, 0.08);
}

body.theme-light.is-authenticated .table-view-controls label {
  color: rgba(7, 24, 39, 0.72);
}

body.theme-light.is-authenticated .table-view-controls .check {
  border-color: rgba(37, 99, 235, 0.14);
  background: rgba(255, 255, 255, 0.72);
}

body.theme-light.is-authenticated .table-wrap th[style*="sticky"],
body.theme-light.is-authenticated .table-wrap td[style*="sticky"],
body.theme-light.is-authenticated .table-wrap.table-sticky-head thead th {
  background:
    linear-gradient(180deg, rgba(243, 250, 255, 0.98), rgba(224, 242, 254, 0.98)),
    #f8fcff;
}

@media (max-width: 1280px) {
  .table-view-controls {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }
}

@media (max-width: 760px) {
  .table-view-controls {
    grid-template-columns: 1fr;
  }
}

body.theme-light.is-authenticated {
  --dashboard-bg: #eaf7ff;
  --dashboard-panel: rgba(255, 255, 255, 0.78);
  --dashboard-panel-strong: rgba(238, 248, 255, 0.9);
  --dashboard-border: rgba(37, 99, 235, 0.18);
  --dashboard-border-strong: rgba(37, 99, 235, 0.3);
  --dashboard-line: rgba(37, 99, 235, 0.12);
  --dashboard-blue: #1d4ed8;
  --dashboard-blue-soft: rgba(37, 99, 235, 0.1);
  --dashboard-text: #071827;
  --dashboard-muted: rgba(7, 24, 39, 0.68);
  --dashboard-muted-strong: rgba(7, 24, 39, 0.82);
  color: var(--dashboard-text);
}

body.theme-light.is-authenticated .app-shell,
body.theme-light.is-authenticated .workspace,
body.theme-light.is-authenticated .sidebar,
body.theme-light.is-authenticated .topbar {
  background:
    radial-gradient(circle at 84% 8%, rgba(60, 172, 244, 0.2), transparent 34%),
    linear-gradient(135deg, #eaf7ff, #d9effc);
}

body.theme-light.is-authenticated .workspace::before {
  opacity: 0.2;
}

body.theme-light.is-authenticated article,
body.theme-light.is-authenticated .prep-panel,
body.theme-light.is-authenticated .table-wrap,
body.theme-light.is-authenticated .date-filter,
body.theme-light.is-authenticated .message,
body.theme-light.is-authenticated .account-access-card,
body.theme-light.is-authenticated .settings-panel,
body.theme-light.is-authenticated .settings-grid article,
body.theme-light.is-authenticated .telegram-settings-panel,
body.theme-light.is-authenticated .telegram-control-card,
body.theme-light.is-authenticated .telegram-filter-panel,
body.theme-light.is-authenticated .telegram-ledger-table,
body.theme-light.is-authenticated .telegram-metric-grid article,
body.theme-light.is-authenticated .tv-analytics-hero,
body.theme-light.is-authenticated .tv-metric-card,
body.theme-light.is-authenticated .tv-chart-card,
body.theme-light.is-authenticated .tradingview-control-card,
body.theme-light.is-authenticated .tradingview-ledger-console,
body.theme-light.is-authenticated .tradingview-guide-panel,
body.theme-light.is-authenticated .cleanup-panel,
body.theme-light.is-authenticated .danger-zone,
body.theme-light.is-authenticated .home-filter-form,
body.theme-light.is-authenticated .alert-filter-form,
body.theme-light.is-authenticated .table-view-controls {
  background:
    radial-gradient(circle at 12% 0%, rgba(37, 99, 235, 0.08), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(226, 244, 255, 0.78)),
    #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 16px 38px rgba(37, 99, 235, 0.1);
}

body:not(.is-authenticated) {
  background:
    radial-gradient(circle at 82% 10%, rgba(0, 163, 255, 0.24), transparent 34%),
    radial-gradient(circle at 8% 86%, rgba(0, 199, 255, 0.16), transparent 38%),
    linear-gradient(135deg, #020713 0%, #031322 48%, #020711 100%);
  color: #e9f7ff;
}

body:not(.is-authenticated) .login-gate {
  min-height: 100dvh;
  padding: 48px;
  background:
    linear-gradient(120deg, rgba(0, 177, 255, 0.06) 1px, transparent 1px),
    linear-gradient(0deg, rgba(0, 177, 255, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 74% 18%, rgba(0, 194, 255, 0.22), transparent 30%),
    radial-gradient(circle at 16% 84%, rgba(14, 165, 233, 0.18), transparent 34%),
    linear-gradient(135deg, #020713 0%, #031322 52%, #020711 100%);
  background-size: 64px 64px, 64px 64px, auto, auto, auto;
}

body:not(.is-authenticated) .login-gate::before {
  inset: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 84% 8%, rgba(93, 213, 255, 0.92) 0 2px, transparent 3px),
    radial-gradient(circle at 92% 14%, rgba(93, 213, 255, 0.7) 0 1px, transparent 2px),
    radial-gradient(circle at 72% 28%, rgba(93, 213, 255, 0.56) 0 2px, transparent 3px),
    radial-gradient(circle at 12% 78%, rgba(93, 213, 255, 0.74) 0 2px, transparent 3px),
    linear-gradient(145deg, transparent 0 50%, rgba(0, 184, 255, 0.18) 50.2%, transparent 50.8%),
    linear-gradient(25deg, transparent 0 58%, rgba(0, 184, 255, 0.14) 58.2%, transparent 58.7%);
  opacity: 0.58;
}

body:not(.is-authenticated) .login-gate::after {
  bottom: 7%;
  width: min(760px, 76vw);
  height: 92px;
  background: rgba(0, 194, 255, 0.2);
  filter: blur(42px);
}

body:not(.is-authenticated) .login-grid {
  background:
    linear-gradient(90deg, transparent, rgba(78, 230, 255, 0.1) 49.8%, rgba(78, 230, 255, 0.1) 50.2%, transparent),
    radial-gradient(circle at 50% 42%, rgba(96, 165, 250, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 28%, rgba(78, 230, 255, 0.045));
  opacity: 0.68;
}

body:not(.is-authenticated) .login-terminal {
  width: min(1220px, 100%);
  grid-template-columns: minmax(220px, 0.7fr) minmax(390px, 540px) minmax(220px, 0.7fr);
  gap: 36px;
}

body:not(.is-authenticated) .login-card {
  border-color: rgba(118, 209, 255, 0.5);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(18, 39, 58, 0.78), rgba(5, 18, 34, 0.86)),
    rgba(4, 16, 31, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(180, 233, 255, 0.18),
    inset 0 -1px 0 rgba(0, 194, 255, 0.12),
    0 30px 110px rgba(0, 0, 0, 0.64),
    0 0 58px rgba(0, 194, 255, 0.22);
  padding: 50px 54px 40px;
}

body:not(.is-authenticated) .login-card::before {
  background:
    linear-gradient(115deg, transparent 0%, rgba(255, 255, 255, 0.2) 18%, transparent 38%),
    radial-gradient(circle at 50% 0%, rgba(78, 230, 255, 0.16), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 34%);
}

body:not(.is-authenticated) .login-card::after,
body:not(.is-authenticated) .login-status-card::before {
  background: linear-gradient(90deg, transparent, #35d8ff, transparent);
  box-shadow: 0 0 22px rgba(53, 216, 255, 0.9);
}

body:not(.is-authenticated) .login-logo {
  filter: drop-shadow(0 0 24px rgba(78, 230, 255, 0.58));
}

body:not(.is-authenticated) .login-card .eyebrow,
body:not(.is-authenticated) .login-subtitle {
  color: #4ee6ff;
}

body:not(.is-authenticated) .login-card h1 {
  color: #f1fbff;
  text-shadow: 0 0 28px rgba(64, 196, 255, 0.22);
}

body:not(.is-authenticated) .login-message {
  border-color: rgba(118, 209, 255, 0.18);
  background: rgba(5, 18, 34, 0.62);
  color: rgba(205, 230, 244, 0.84);
}

body:not(.is-authenticated) .login-form.login-form-gate label {
  color: #95c7df;
}

body:not(.is-authenticated) .login-form.login-form-gate input {
  min-height: 50px;
  border-color: rgba(118, 209, 255, 0.26);
  border-radius: 10px;
  background: rgba(3, 16, 31, 0.72);
  color: #e9f7ff;
  box-shadow: inset 0 1px 0 rgba(180, 233, 255, 0.06);
}

body:not(.is-authenticated) .login-form.login-form-gate input::placeholder {
  color: rgba(205, 230, 244, 0.58);
}

body:not(.is-authenticated) .login-form.login-form-gate input:focus {
  border-color: rgba(88, 211, 255, 0.76);
  box-shadow: 0 0 0 3px rgba(78, 230, 255, 0.12), inset 0 0 0 1px rgba(78, 230, 255, 0.12);
}

body:not(.is-authenticated) .login-form.login-form-gate button {
  border-radius: 10px;
  background: linear-gradient(180deg, #6ee7ff, #38bdf8 48%, #2563eb);
  color: #020713;
  box-shadow: 0 0 32px rgba(56, 189, 248, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.42);
  transition: transform 220ms cubic-bezier(0.32, 0.72, 0, 1), box-shadow 220ms cubic-bezier(0.32, 0.72, 0, 1);
}

body:not(.is-authenticated) .login-form.login-form-gate button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 0 44px rgba(56, 189, 248, 0.52), inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

body:not(.is-authenticated) .login-form.login-form-gate button:active {
  transform: translateY(0) scale(0.99);
}

body:not(.is-authenticated) .login-foot {
  color: rgba(205, 230, 244, 0.78);
}

body:not(.is-authenticated) .login-foot span::before {
  background: #4ee6ff;
  box-shadow: 0 0 13px rgba(78, 230, 255, 0.76);
}

body:not(.is-authenticated) .login-side-panel {
  opacity: 0.9;
  filter: none;
}

body:not(.is-authenticated) .login-status-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(118, 209, 255, 0.22);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(18, 39, 58, 0.58), rgba(5, 18, 34, 0.68)),
    rgba(5, 18, 34, 0.68);
  box-shadow: inset 0 1px 0 rgba(180, 233, 255, 0.1), 0 18px 54px rgba(0, 0, 0, 0.22);
}

body:not(.is-authenticated) .login-status-card::before {
  content: "";
  position: absolute;
  left: 20%;
  right: 20%;
  top: -2px;
  height: 3px;
  border-radius: 999px;
}

body:not(.is-authenticated) .login-status-card span,
body:not(.is-authenticated) .login-status-card small {
  color: rgba(192, 222, 236, 0.7);
}

body:not(.is-authenticated) .login-status-card strong {
  color: #f1fbff;
}

@media (max-width: 1240px) {
  .date-filter,
  .home-filter-form {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
}

/* R091 mobile alignment and reliable horizontal scrolling */
html,
body {
  max-width: 100%;
}

body.is-authenticated {
  overflow-x: auto;
}

.app-shell,
.workspace,
.page {
  min-width: 0;
}

.page.active {
  overflow-x: auto;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: scroll;
  overflow-y: hidden;
  padding-bottom: 14px;
  -webkit-overflow-scrolling: touch;
}

.table-wrap table {
  width: max-content;
  min-width: 100%;
}

.table-wrap th,
.table-wrap td {
  white-space: nowrap;
}

.table-wrap td .error-text,
.table-wrap td pre,
.table-wrap td code,
.table-wrap td .template-block {
  white-space: normal;
}

.table-wrap::-webkit-scrollbar {
  height: 14px;
}

.table-wrap::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

.table-wrap::-webkit-scrollbar-thumb {
  border: 2px solid rgba(3, 18, 34, 0.94);
  border-radius: 999px;
  background: linear-gradient(90deg, #38bdf8, #60a5fa, rgba(255, 255, 255, 0.34));
}

@media (max-width: 860px) {
  body {
    min-width: 0;
    padding-bottom: 74px;
  }

  body:not(.is-authenticated) {
    padding-bottom: 0;
    overflow-x: hidden;
  }

  body:not(.is-authenticated) .login-gate {
    min-height: 100dvh;
    align-items: start;
    padding: 18px 14px 28px;
  }

  body:not(.is-authenticated) .login-terminal {
    width: 100%;
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 16px;
  }

  body:not(.is-authenticated) .login-side-panel {
    display: none;
  }

  body:not(.is-authenticated) .login-card {
    width: min(100%, 430px);
    margin: 0 auto;
    padding: 30px 20px 24px;
    border-radius: 20px;
  }

  body:not(.is-authenticated) .login-logo {
    width: 72px;
    height: 72px;
    margin-bottom: 14px;
  }

  body:not(.is-authenticated) .login-card h1 {
    font-size: 28px;
    overflow-wrap: anywhere;
  }

  body:not(.is-authenticated) .login-subtitle {
    margin-bottom: 20px;
    font-size: 12px;
  }

  body:not(.is-authenticated) .login-form.login-form-gate {
    gap: 12px;
  }

  body:not(.is-authenticated) .login-form.login-form-gate input,
  body:not(.is-authenticated) .login-form.login-form-gate button {
    min-height: 48px;
  }

  body:not(.is-authenticated) .login-foot {
    flex-wrap: wrap;
    gap: 8px 12px;
    font-size: 11px;
  }

  body.is-authenticated .app-shell {
    display: block;
    width: 100%;
  }

  body.is-authenticated .workspace {
    width: 100%;
    overflow-x: hidden;
  }

  body.is-authenticated .topbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    align-items: stretch;
    padding: 16px;
  }

  body.is-authenticated .topbar-heading,
  body.is-authenticated .topbar-refresh,
  body.is-authenticated .theme-switch,
  body.is-authenticated .topbar-user {
    width: 100%;
  }

  body.is-authenticated .topbar-refresh {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  body.is-authenticated .topbar-refresh .auto-refresh-check,
  body.is-authenticated .topbar-refresh .auto-refresh-status {
    grid-column: 1 / -1;
  }

  body.is-authenticated .topbar-refresh select,
  body.is-authenticated .topbar-refresh input[type="number"] {
    width: 100%;
    min-width: 0;
  }

  body.is-authenticated .theme-switch button,
  body.is-authenticated .topbar-user button {
    width: 100%;
  }

  body.is-authenticated .topbar-user {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    text-align: left;
  }

  body.is-authenticated .page {
    width: 100%;
    padding: 16px 12px 22px;
  }

  body.is-authenticated .section-heading {
    align-items: stretch;
    gap: 12px;
  }

  body.is-authenticated .section-heading button,
  body.is-authenticated .panel-heading button {
    width: 100%;
  }

  body.is-authenticated .summary-grid,
  body.is-authenticated .summary-grid.compact,
  body.is-authenticated .settings-grid,
  body.is-authenticated .split-panel-grid,
  body.is-authenticated .snapshot-grid,
  body.is-authenticated .risk-dashboard-grid,
  body.is-authenticated .quick-action-grid,
  body.is-authenticated .control-status-rail,
  body.is-authenticated .control-room-grid,
  body.is-authenticated .tradingview-command-grid,
  body.is-authenticated .tv-metric-grid,
  body.is-authenticated .tv-chart-grid,
  body.is-authenticated .account-access-grid,
  body.is-authenticated .tracker-mini-summary,
  body.is-authenticated .cleanup-panel,
  body.is-authenticated .home-filter-form,
  body.is-authenticated .home-date-filter {
    grid-template-columns: 1fr;
  }

  body.is-authenticated .control-room-hero,
  body.is-authenticated .panel-heading,
  body.is-authenticated .panel-heading.compact {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: stretch;
  }

  body.is-authenticated .home-live-badge {
    justify-self: stretch;
  }

  body.is-authenticated article,
  body.is-authenticated .glass-panel,
  body.is-authenticated .mini-feed-card,
  body.is-authenticated .control-status-card {
    min-width: 0;
    padding: 16px;
  }

  body.is-authenticated .compact-table-feed {
    overflow-x: auto;
    padding-bottom: 8px;
  }

  body.is-authenticated .compact-table-feed .home-feed-row {
    min-width: 620px;
  }

  body.is-authenticated .table-wrap {
    margin-right: -12px;
    margin-left: -12px;
    width: calc(100% + 24px);
    max-width: calc(100% + 24px);
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  body.is-authenticated .table-wrap table {
    min-width: 1100px;
  }

  body.is-authenticated .mobile-nav {
    grid-auto-columns: minmax(84px, max-content);
    gap: 4px;
    padding: 8px 8px 10px;
    border-top-color: rgba(118, 209, 255, 0.2);
    background:
      linear-gradient(180deg, rgba(4, 18, 34, 0.94), rgba(2, 8, 18, 0.98)),
      #020713;
    box-shadow: 0 -18px 54px rgba(0, 0, 0, 0.32);
  }

  body.is-authenticated .mobile-nav .nav-link {
    min-height: 48px;
    border-top: 0;
    border-radius: 14px;
    padding: 0 12px;
    color: rgba(225, 242, 250, 0.82);
  }

  body.is-authenticated .mobile-nav .nav-link.active {
    border-top: 0;
    background: rgba(42, 180, 255, 0.16);
    color: #7ee8ff;
  }
}

@media (max-width: 420px) {
  body:not(.is-authenticated) .login-gate {
    padding: 12px 10px 22px;
  }

  body:not(.is-authenticated) .login-card {
    padding: 24px 16px 20px;
  }

  body:not(.is-authenticated) .login-card h1 {
    font-size: 24px;
  }

  body.is-authenticated .topbar-refresh {
    grid-template-columns: 1fr;
  }
}

/* R106: Home layout recovery after global card/table styling. Keep Home as a clean vertical control room. */
body.is-authenticated[data-active-page="home"] .home-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-flow: row;
  gap: 18px;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 28px 34px 42px;
  overflow: visible;
}

body.is-authenticated[data-active-page="home"] .home-page > * {
  grid-column: 1 / -1;
  min-width: 0;
  width: 100%;
}

body.is-authenticated[data-active-page="home"] .control-room-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 190px);
  align-items: end;
  gap: 22px;
  min-height: auto;
  width: 100%;
}

body.is-authenticated[data-active-page="home"] .control-room-hero > div:first-child {
  min-width: 0;
}

body.is-authenticated[data-active-page="home"] .control-room-hero .eyebrow {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  white-space: normal;
}

body.is-authenticated[data-active-page="home"] .control-room-hero h2 {
  max-width: 760px;
  font-size: clamp(34px, 3.4vw, 58px);
  line-height: 0.98;
}

body.is-authenticated[data-active-page="home"] .control-room-hero .home-lede {
  max-width: 960px;
  font-size: 15px;
}

body.is-authenticated[data-active-page="home"] .home-live-badge {
  justify-self: end;
  width: 100%;
  max-width: 190px;
  min-width: 150px;
}

body.is-authenticated[data-active-page="home"] .home-date-filter,
body.is-authenticated[data-active-page="home"] .home-filter-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 220px));
  justify-content: start;
  align-items: end;
  gap: 10px;
  padding: 14px 16px;
  overflow-x: auto;
  overflow-y: visible;
}

body.is-authenticated[data-active-page="home"] .home-date-filter input,
body.is-authenticated[data-active-page="home"] .home-date-filter select,
body.is-authenticated[data-active-page="home"] .home-date-filter button,
body.is-authenticated[data-active-page="home"] .home-filter-form input,
body.is-authenticated[data-active-page="home"] .home-filter-form select,
body.is-authenticated[data-active-page="home"] .home-filter-form button {
  min-width: 130px;
  max-width: 220px;
}

body.is-authenticated[data-active-page="home"] .home-filter-form label {
  min-width: 150px;
  max-width: 220px;
}

body.is-authenticated[data-active-page="home"] .control-status-rail {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

body.is-authenticated[data-active-page="home"] .control-status-card {
  min-width: 0;
  min-height: 98px;
  padding: 14px;
}

body.is-authenticated[data-active-page="home"] .control-status-card strong,
body.is-authenticated[data-active-page="home"] .control-status-card small {
  overflow-wrap: anywhere;
}

body.is-authenticated[data-active-page="home"] .automation-control-panel {
  padding: 18px;
}

body.is-authenticated[data-active-page="home"] .automation-control-panel .panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

body.is-authenticated[data-active-page="home"] .automation-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

body.is-authenticated[data-active-page="home"] .automation-mode-card {
  min-height: 132px;
  padding: 16px;
}

body.is-authenticated[data-active-page="home"] .automation-mode-card small {
  display: block;
  overflow-wrap: anywhere;
}

body.is-authenticated[data-active-page="home"] .control-room-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

body.is-authenticated[data-active-page="home"] .incoming-panel,
body.is-authenticated[data-active-page="home"] .order-snapshot-panel {
  grid-column: span 12;
}

body.is-authenticated[data-active-page="home"] .risk-overview-panel {
  grid-column: span 7;
}

body.is-authenticated[data-active-page="home"] .system-health-panel {
  grid-column: span 5;
}

body.is-authenticated[data-active-page="home"] .roadmap-panel,
body.is-authenticated[data-active-page="home"] .audit-panel,
body.is-authenticated[data-active-page="home"] .quick-actions-panel {
  grid-column: span 4;
}

body.is-authenticated[data-active-page="home"] .split-panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

body.is-authenticated[data-active-page="home"] .snapshot-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.85fr) minmax(0, 0.85fr);
  gap: 12px;
}

body.is-authenticated[data-active-page="home"] .mini-feed-card {
  min-width: 0;
  min-height: 0;
  padding: 12px;
}

body.is-authenticated[data-active-page="home"] .compact-table-feed {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

body.is-authenticated[data-active-page="home"] .compact-table-feed .home-feed-row {
  grid-template-columns: minmax(96px, 1fr) minmax(58px, 0.5fr) minmax(118px, 1fr) minmax(120px, auto);
  min-width: 520px;
  max-width: none;
  gap: 8px;
}

body.is-authenticated[data-active-page="home"] .compact-table-feed .home-feed-row strong,
body.is-authenticated[data-active-page="home"] .compact-table-feed .home-feed-row span {
  min-width: 0;
  white-space: nowrap;
}

body.is-authenticated[data-active-page="home"] .compact-table-feed .pill {
  justify-self: end;
  max-width: 160px;
}

body.is-authenticated[data-active-page="home"] .risk-dashboard-grid {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 16px;
}

body.is-authenticated[data-active-page="home"] .quick-action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 1200px) {
  body.is-authenticated[data-active-page="home"] .control-status-rail {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.is-authenticated[data-active-page="home"] .automation-mode-grid,
  body.is-authenticated[data-active-page="home"] .split-panel-grid,
  body.is-authenticated[data-active-page="home"] .snapshot-grid,
  body.is-authenticated[data-active-page="home"] .risk-dashboard-grid {
    grid-template-columns: 1fr;
  }

  body.is-authenticated[data-active-page="home"] .risk-overview-panel,
  body.is-authenticated[data-active-page="home"] .system-health-panel,
  body.is-authenticated[data-active-page="home"] .roadmap-panel,
  body.is-authenticated[data-active-page="home"] .audit-panel,
  body.is-authenticated[data-active-page="home"] .quick-actions-panel {
    grid-column: span 12;
  }
}

@media (max-width: 760px) {
  body.is-authenticated[data-active-page="home"] .home-page {
    padding: 18px 14px 30px;
  }

  body.is-authenticated[data-active-page="home"] .control-room-hero,
  body.is-authenticated[data-active-page="home"] .control-status-rail,
  body.is-authenticated[data-active-page="home"] .quick-action-grid {
    grid-template-columns: 1fr;
  }

  body.is-authenticated[data-active-page="home"] .home-live-badge {
    justify-self: start;
  }

  body.is-authenticated[data-active-page="home"] .home-date-filter,
  body.is-authenticated[data-active-page="home"] .home-filter-form {
    grid-template-columns: 1fr;
  }

  body.is-authenticated[data-active-page="home"] .home-date-filter input,
  body.is-authenticated[data-active-page="home"] .home-date-filter select,
  body.is-authenticated[data-active-page="home"] .home-date-filter button,
  body.is-authenticated[data-active-page="home"] .home-filter-form input,
  body.is-authenticated[data-active-page="home"] .home-filter-form select,
  body.is-authenticated[data-active-page="home"] .home-filter-form button,
  body.is-authenticated[data-active-page="home"] .home-filter-form label {
    width: 100%;
    max-width: none;
  }

body.is-authenticated[data-active-page="home"] .automation-control-panel .panel-heading {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: start;
  }
}

/* R107: Analysis reports command room */
body.is-authenticated[data-active-page="analysis"] .analysis-console-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  padding: 28px 34px 42px;
}

body.is-authenticated[data-active-page="analysis"] .analysis-console-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: end;
  gap: 22px;
  border: 1px solid rgba(75, 195, 255, 0.3);
  border-radius: 24px;
  background:
    radial-gradient(circle at 88% 10%, rgba(39, 228, 255, 0.18), transparent 28%),
    linear-gradient(145deg, rgba(11, 35, 53, 0.86), rgba(3, 12, 23, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 28px 90px rgba(0, 0, 0, 0.32);
  padding: 26px;
}

body.is-authenticated[data-active-page="analysis"] .analysis-console-hero h2 {
  margin-top: 8px;
  font-size: clamp(32px, 4vw, 58px);
  line-height: 0.98;
}

body.is-authenticated[data-active-page="analysis"] .analysis-console-hero p:not(.eyebrow) {
  max-width: 920px;
  margin-top: 12px;
  color: #9ec6d8;
  font-size: 15px;
  line-height: 1.6;
}

body.is-authenticated[data-active-page="analysis"] .analysis-filter-shell,
body.is-authenticated[data-active-page="analysis"] .analysis-report-card,
body.is-authenticated[data-active-page="analysis"] .analysis-kpi-card {
  border: 1px solid rgba(75, 195, 255, 0.26);
  background:
    linear-gradient(145deg, rgba(16, 43, 66, 0.88), rgba(4, 13, 25, 0.95)),
    rgba(4, 13, 25, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 24px 72px rgba(0, 0, 0, 0.26);
}

body.is-authenticated[data-active-page="analysis"] .analysis-filter-shell {
  display: grid;
  gap: 12px;
  border-radius: 22px;
  padding: 16px;
}

body.is-authenticated[data-active-page="analysis"] .analysis-filter-shell .date-filter,
body.is-authenticated[data-active-page="analysis"] .analysis-filter-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 220px));
  justify-content: start;
  align-items: end;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.is-authenticated[data-active-page="analysis"] .analysis-filter-form label {
  min-width: 150px;
  max-width: 280px;
}

body.is-authenticated[data-active-page="analysis"] .analysis-export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 2px;
}

body.is-authenticated[data-active-page="analysis"] .analysis-export-actions button {
  min-height: 40px;
  border-color: rgba(75, 195, 255, 0.38);
  background: linear-gradient(145deg, rgba(14, 70, 105, 0.78), rgba(3, 20, 36, 0.92));
  color: #eaf8ff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 12px 32px rgba(0, 196, 255, 0.1);
}

body.is-authenticated[data-active-page="analysis"] .analysis-export-actions button:hover {
  border-color: rgba(61, 217, 255, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 16px 40px rgba(0, 196, 255, 0.18);
}

body.is-authenticated[data-active-page="analysis"] .analysis-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

body.is-authenticated[data-active-page="analysis"] .analysis-kpi-card {
  min-height: 132px;
  border-radius: 22px;
  padding: 18px;
}

body.is-authenticated[data-active-page="analysis"] .analysis-kpi-card span,
body.is-authenticated[data-active-page="analysis"] .analysis-mini-grid span,
body.is-authenticated[data-active-page="analysis"] .analysis-report-card .panel-heading span {
  color: #ffd166;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

body.is-authenticated[data-active-page="analysis"] .analysis-kpi-card strong {
  display: block;
  margin-top: 14px;
  color: #f4fbff;
  font-size: 28px;
  line-height: 1.05;
}

body.is-authenticated[data-active-page="analysis"] .analysis-kpi-card small,
body.is-authenticated[data-active-page="analysis"] .analysis-mini-grid small {
  display: block;
  margin-top: 10px;
  color: #94bace;
  line-height: 1.45;
}

body.is-authenticated[data-active-page="analysis"] .analysis-kpi-positive strong {
  color: #22f2c7;
}

body.is-authenticated[data-active-page="analysis"] .analysis-kpi-negative strong,
body.is-authenticated[data-active-page="analysis"] .analysis-kpi-warning strong {
  color: #ff8da1;
}

body.is-authenticated[data-active-page="analysis"] .analysis-chart-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

body.is-authenticated[data-active-page="analysis"] .analysis-chart-grid .analysis-chart-card:first-child {
  grid-column: span 2;
}

body.is-authenticated[data-active-page="analysis"] .analysis-briefing-card {
  padding: 18px;
}

body.is-authenticated[data-active-page="analysis"] .analysis-briefing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

body.is-authenticated[data-active-page="analysis"] .analysis-briefing-item {
  min-height: 142px;
  border: 1px solid rgba(75, 195, 255, 0.18);
  border-radius: 16px;
  background:
    radial-gradient(circle at 88% 8%, rgba(39, 228, 255, 0.12), transparent 42%),
    rgba(3, 14, 26, 0.7);
  padding: 14px;
}

body.is-authenticated[data-active-page="analysis"] .analysis-briefing-item span {
  color: #9bd7ef;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

body.is-authenticated[data-active-page="analysis"] .analysis-briefing-item strong {
  display: block;
  margin-top: 10px;
  color: #f4fbff;
  font-size: 24px;
  line-height: 1.1;
}

body.is-authenticated[data-active-page="analysis"] .analysis-briefing-item p {
  margin: 10px 0 0;
  color: #a8c9d9;
  font-size: 13px;
  line-height: 1.45;
}

body.is-authenticated[data-active-page="analysis"] .analysis-briefing-positive strong {
  color: #22f2c7;
}

body.is-authenticated[data-active-page="analysis"] .analysis-briefing-negative strong {
  color: #ff8da1;
}

body.is-authenticated[data-active-page="analysis"] .analysis-briefing-warning strong {
  color: #ffd166;
}

body.is-authenticated[data-active-page="analysis"] .analysis-report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

body.is-authenticated[data-active-page="analysis"] .analysis-insight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

body.is-authenticated[data-active-page="analysis"] .analysis-report-card {
  min-width: 0;
  border-radius: 22px;
  padding: 18px;
}

body.is-authenticated[data-active-page="analysis"] .analysis-report-grid .analysis-report-card:last-child {
  grid-column: 1 / -1;
}

body.is-authenticated[data-active-page="analysis"] .analysis-chart-canvas,
body.is-authenticated[data-active-page="analysis"] .analysis-bar-chart {
  min-height: 220px;
}

body.is-authenticated[data-active-page="analysis"] .analysis-chart-canvas svg {
  width: 100%;
  height: 220px;
  display: block;
}

body.is-authenticated[data-active-page="analysis"] .analysis-axis {
  stroke: rgba(126, 232, 255, 0.22);
}

body.is-authenticated[data-active-page="analysis"] .analysis-equity-line {
  fill: none;
  stroke: #27e4ff;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 10px rgba(39, 228, 255, 0.28));
}

body.is-authenticated[data-active-page="analysis"] .analysis-drawdown-line {
  fill: none;
  stroke: #ff6f91;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.is-authenticated[data-active-page="analysis"] .analysis-svg-label {
  fill: #eaf8ff;
  font-size: 15px;
  font-weight: 900;
}

body.is-authenticated[data-active-page="analysis"] .analysis-svg-muted {
  fill: #94bace;
  font-size: 11px;
}

body.is-authenticated[data-active-page="analysis"] .analysis-chart-row {
  display: grid;
  grid-template-columns: minmax(82px, 0.9fr) minmax(0, 1.3fr) minmax(58px, auto);
  align-items: center;
  gap: 10px;
  min-height: 34px;
  color: #b9d5e4;
  font-size: 12px;
}

body.is-authenticated[data-active-page="analysis"] .analysis-chart-row div {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(126, 232, 255, 0.1);
}

body.is-authenticated[data-active-page="analysis"] .analysis-chart-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #27e4ff, #2587ff);
}

body.is-authenticated[data-active-page="analysis"] .analysis-chart-row i.negative {
  background: linear-gradient(90deg, #ff6f91, #ffb86b);
}

body.is-authenticated[data-active-page="analysis"] .analysis-chart-row strong {
  color: #eaf8ff;
  text-align: right;
}

body.is-authenticated[data-active-page="analysis"] .analysis-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

body.is-authenticated[data-active-page="analysis"] .analysis-mini-grid article {
  border: 1px solid rgba(75, 195, 255, 0.16);
  border-radius: 14px;
  background: rgba(3, 14, 26, 0.66);
  padding: 12px;
}

body.is-authenticated[data-active-page="analysis"] .analysis-mini-grid strong {
  display: block;
  margin-top: 8px;
  color: #eaf8ff;
  font-size: 20px;
}

body.is-authenticated[data-active-page="analysis"] .analysis-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

body.is-authenticated[data-active-page="analysis"] .analysis-table-wrap table {
  min-width: 1180px;
}

body.is-authenticated[data-active-page="analysis"] .analysis-compact-table table {
  min-width: 760px;
}

body.is-authenticated[data-active-page="analysis"] .analysis-compact-table td,
body.is-authenticated[data-active-page="analysis"] .analysis-compact-table th {
  font-size: 12px;
  line-height: 1.35;
}

body.is-authenticated[data-active-page="analysis"] .analysis-drilldown-row {
  cursor: pointer;
}

body.is-authenticated[data-active-page="analysis"] .analysis-drilldown-row:hover,
body.is-authenticated[data-active-page="analysis"] .analysis-drilldown-row:focus {
  outline: 1px solid rgba(39, 228, 255, 0.42);
  background: rgba(39, 228, 255, 0.08);
}

@media (max-width: 1280px) {
  body.is-authenticated[data-active-page="analysis"] .analysis-kpi-grid,
  body.is-authenticated[data-active-page="analysis"] .analysis-chart-grid,
  body.is-authenticated[data-active-page="analysis"] .analysis-briefing-grid,
  body.is-authenticated[data-active-page="analysis"] .analysis-insight-grid,
  body.is-authenticated[data-active-page="analysis"] .analysis-report-grid {
    grid-template-columns: 1fr;
  }

  body.is-authenticated[data-active-page="analysis"] .analysis-report-grid .analysis-report-card:last-child {
    grid-column: auto;
  }

  body.is-authenticated[data-active-page="analysis"] .analysis-chart-grid .analysis-chart-card:first-child {
    grid-column: auto;
  }
}

@media (max-width: 760px) {
  body.is-authenticated[data-active-page="analysis"] .analysis-console-page {
    padding: 18px 14px 30px;
  }

  body.is-authenticated[data-active-page="analysis"] .analysis-console-hero,
  body.is-authenticated[data-active-page="analysis"] .analysis-filter-shell .date-filter,
  body.is-authenticated[data-active-page="analysis"] .analysis-filter-form,
  body.is-authenticated[data-active-page="analysis"] .analysis-mini-grid {
    grid-template-columns: 1fr;
  }

  body.is-authenticated[data-active-page="analysis"] .analysis-filter-form label,
  body.is-authenticated[data-active-page="analysis"] .analysis-filter-shell input,
  body.is-authenticated[data-active-page="analysis"] .analysis-filter-shell select,
  body.is-authenticated[data-active-page="analysis"] .analysis-filter-shell button {
    width: 100%;
    max-width: none;
  }
}
