:root {
  color-scheme: dark;
  --bg: #0b0f14;
  --panel: #121922;
  --panel-2: #18212c;
  --line: #283442;
  --text: #f4f7fb;
  --muted: #91a0b2;
  --green: #2fd18b;
  --red: #ff6673;
  --orange: #f3a83b;
  --blue: #5da7ff;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.38);
}

/* Public V1 polish */
.header {
  padding: 18px;
  border: 1px solid rgba(93, 167, 255, 0.22);
  border-radius: 8px;
  background: rgba(18, 25, 34, 0.78);
  box-shadow: var(--shadow);
}

.header h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  letter-spacing: 0;
}

.quick-nav a,
.copy-button,
.refresh-button,
.admin-button {
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.quick-nav a:hover,
.copy-button:hover,
.refresh-button:hover,
.admin-button:hover {
  transform: translateY(-1px);
}

.logout-link {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid rgba(255, 111, 121, 0.42);
  border-radius: 8px;
  color: var(--red);
  background: rgba(255, 111, 121, 0.08);
  text-decoration: none;
  font-weight: 900;
}

.logout-link:hover {
  border-color: var(--red);
  background: rgba(255, 111, 121, 0.14);
}

.logs-panel {
  background: rgba(12, 18, 25, 0.92);
}

.book-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: rgba(17, 16, 13, 0.92);
}

.book-frame {
  width: 100%;
  min-height: calc(100vh - 230px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b0f14;
}

.book-download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 156px;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--gold-line);
  border-radius: 8px;
  color: #0a0804;
  background: var(--gold);
  text-decoration: none;
  font-weight: 950;
  white-space: nowrap;
}

.book-download-link span {
  display: inline-grid;
  place-items: center;
  min-width: 38px;
  min-height: 24px;
  border-radius: 6px;
  color: var(--gold);
  background: rgba(7, 7, 7, 0.86);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
}

.book-download-link:hover {
  filter: brightness(1.06);
}

.clients-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: rgba(17, 16, 13, 0.92);
}

.client-form {
  display: grid;
  grid-template-columns: 1.1fr 1.1fr 0.7fr auto;
  gap: 12px;
  align-items: end;
  margin: 18px 0;
}

.client-admin-status {
  min-height: 22px;
  margin: 0 0 12px;
  color: var(--muted);
  font-weight: 800;
}

.client-admin-status.is-success {
  color: var(--green);
}

.client-admin-status.is-error,
.client-admin-error {
  color: var(--red);
}

.users-list {
  display: grid;
  gap: 10px;
}

.user-card {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto 140px auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 7, 7, 0.42);
}

.user-card.is-disabled {
  opacity: 0.58;
}

.user-card-main {
  display: grid;
  gap: 4px;
}

.user-card-main strong {
  font-size: 1rem;
}

.user-card-main span,
.client-admin-empty {
  color: var(--muted);
}

.compact-toggle {
  margin: 0;
  white-space: nowrap;
}

@media (max-width: 980px) {
  .client-form,
  .user-card {
    grid-template-columns: 1fr;
  }

  .book-panel .logs-title {
    align-items: stretch;
  }

  .book-download-link {
    width: 100%;
  }
}

.pair-stats-block {
  margin-bottom: 14px;
}

.pair-stats-title {
  margin-top: 2px;
  margin-bottom: 10px;
}

.pair-stats-table {
  min-width: 680px;
}

.pair-stats-table th,
.pair-stats-table td {
  padding: 10px;
}

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

.logs-stat-wide {
  grid-column: span 2;
}

.logs-table-wrap {
  background: rgba(8, 12, 17, 0.5);
}

.aconfig-bull::before,
.aconfig-bear::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.75;
}

.aconfig-bull,
.aconfig-bear {
  display: inline-flex;
  align-items: center;
}

@media (max-width: 900px) {
  .header {
    padding: 14px;
  }

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

  .logs-stat-wide {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .logs-stats {
    grid-template-columns: 1fr;
  }

  .pair-stats-table,
  .logs-table {
    min-width: 620px;
  }
}

/* Black & gold final overrides */
:root {
  --bg: #070707;
  --panel: #11100d;
  --panel-2: #191711;
  --line: #3a3120;
  --text: #fff8e7;
  --muted: #b6a985;
  --green: #38d996;
  --red: #ff6f79;
  --orange: #d6a846;
  --blue: #d6a846;
  --gold: #d6a846;
  --gold-soft: rgba(214, 168, 70, 0.16);
  --gold-line: rgba(214, 168, 70, 0.38);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.58);
}

body {
  background: linear-gradient(180deg, #070707 0%, #0f0d09 46%, #050505 100%);
}

body[data-role="client"] [data-admin-only] {
  display: none !important;
}

.app {
  transition: margin-left 0.2s ease, width 0.2s ease;
}

.header {
  padding: 18px;
  border-color: var(--gold-line);
  background: linear-gradient(135deg, rgba(214, 168, 70, 0.14), rgba(17, 16, 13, 0.94));
  box-shadow: var(--shadow);
}

.header h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  letter-spacing: 0;
}

.header,
.controls,
.market-strip,
.bias-panel,
.settings-panel,
.top-section,
.table-card,
.logs-panel {
  border-color: var(--line);
  background-color: rgba(17, 16, 13, 0.92);
}

.eyebrow,
.control-label,
.market-label,
.settings-label,
.logs-stats span {
  color: var(--gold);
}

.market-card,
.usd-bias-card {
  border-color: var(--gold-line);
  background: linear-gradient(145deg, rgba(214, 168, 70, 0.13), var(--panel-2));
}

.sidebar-brand {
  display: none;
}

.sidebar-collapse {
  border: 1px solid var(--gold-line);
  color: var(--gold);
  background: rgba(214, 168, 70, 0.1);
  cursor: pointer;
}

@media (min-width: 901px) {
  .app {
    width: min(1320px, calc(100% - 292px));
    margin-left: 252px;
    margin-right: 24px;
  }

  .quick-nav-shell {
    position: fixed;
    top: 18px;
    bottom: 18px;
    left: 18px;
    z-index: 60;
    display: grid;
    grid-template-rows: auto 1fr;
    width: 214px;
    margin: 0;
    padding: 12px;
    border: 1px solid var(--gold-line);
    border-radius: 10px;
    background: rgba(10, 9, 7, 0.94);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
  }

  .sidebar-brand {
    display: grid;
    grid-template-columns: 38px 1fr 32px;
    gap: 10px;
    align-items: center;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-brand span {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--gold-line);
    border-radius: 8px;
    color: #0a0804;
    background: var(--gold);
    font-weight: 950;
  }

  .sidebar-brand strong {
    overflow: hidden;
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 950;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sidebar-collapse {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 1.3rem;
    line-height: 1;
  }

  .quick-nav {
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 0;
    border: 0;
    background: transparent;
    backdrop-filter: none;
  }

  .quick-nav a {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 10px 12px;
    border-color: rgba(214, 168, 70, 0.18);
    color: var(--muted);
    background: rgba(25, 23, 17, 0.82);
  }

  .quick-nav a:hover {
    color: var(--text);
    border-color: var(--gold-line);
    background: var(--gold-soft);
  }

  .quick-nav a.gold-nav-link {
    color: var(--gold);
    border-color: rgba(214, 168, 70, 0.58);
    background: linear-gradient(135deg, rgba(214, 168, 70, 0.2), rgba(25, 23, 17, 0.9));
    box-shadow: inset 0 0 0 1px rgba(214, 168, 70, 0.08);
  }

  .is-sidebar-collapsed .app {
    width: min(1320px, calc(100% - 142px));
    margin-left: 102px;
  }

  .is-sidebar-collapsed .quick-nav-shell {
    width: 64px;
    padding: 10px;
  }

  .is-sidebar-collapsed .sidebar-brand {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .is-sidebar-collapsed .sidebar-brand strong {
    display: none;
  }

  .is-sidebar-collapsed .sidebar-brand span,
  .is-sidebar-collapsed .sidebar-collapse {
    width: 42px;
  }

  .is-sidebar-collapsed .sidebar-collapse {
    transform: rotate(180deg);
  }

  .is-sidebar-collapsed .quick-nav a {
    justify-content: center;
    padding: 10px;
    font-size: 0;
  }

  .is-sidebar-collapsed .quick-nav a::before {
    content: attr(data-short);
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    color: var(--gold);
    background: rgba(214, 168, 70, 0.12);
    font-size: 0.84rem;
    font-weight: 950;
  }
}

@media (max-width: 900px) {
  .sidebar-brand {
    display: none;
  }

  .quick-nav {
    border-color: var(--gold-line);
    background: rgba(10, 9, 7, 0.96);
  }

  .quick-nav a {
    color: var(--text);
    border-color: rgba(214, 168, 70, 0.22);
    background: rgba(25, 23, 17, 0.9);
  }
}

/* Final premium override - keep this block at EOF */
body {
  background:
    radial-gradient(circle at 74% 8%, rgba(214, 168, 70, 0.16), transparent 30%),
    radial-gradient(circle at 8% 0%, rgba(214, 168, 70, 0.08), transparent 24%),
    linear-gradient(180deg, #050505 0%, #0b0906 42%, #030303 100%) !important;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(214, 168, 70, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(214, 168, 70, 0.03) 1px, transparent 1px);
  background-size: 78px 78px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.72), transparent 82%);
}

.header {
  min-height: auto !important;
  padding: 12px 14px !important;
  border-color: rgba(214, 168, 70, 0.28) !important;
  border-radius: 10px !important;
  background:
    linear-gradient(90deg, rgba(214, 168, 70, 0.14), rgba(17, 15, 10, 0.94) 42%, rgba(9, 8, 6, 0.96)) !important;
}

.header h1 {
  font-size: clamp(1.08rem, 1.6vw, 1.55rem) !important;
  line-height: 1.05 !important;
}

.header .eyebrow {
  margin-bottom: 3px !important;
}

.quick-nav-toggle {
  border-color: rgba(214, 168, 70, 0.34) !important;
  color: #f8efd6 !important;
  background: rgba(20, 18, 13, 0.94) !important;
}

.quick-nav a {
  position: relative;
  gap: 10px !important;
  overflow: hidden;
  border-color: rgba(214, 168, 70, 0.22) !important;
  color: #cfc3a4 !important;
  background: linear-gradient(135deg, rgba(25, 23, 17, 0.94), rgba(13, 12, 9, 0.92)) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.quick-nav a::before {
  content: attr(data-icon) !important;
  display: grid !important;
  flex: 0 0 32px;
  place-items: center;
  width: 32px !important;
  height: 32px !important;
  border: 1px solid rgba(214, 168, 70, 0.22);
  border-radius: 8px;
  color: #f4c75f !important;
  background: rgba(214, 168, 70, 0.1);
  font-size: 1rem !important;
  font-weight: 950;
}

.quick-nav a:hover,
.quick-nav a.is-active,
.quick-nav a.gold-nav-link.is-active {
  color: #070604 !important;
  border-color: rgba(236, 191, 83, 0.78) !important;
  background: linear-gradient(135deg, #e2b648, #c8932c) !important;
}

.quick-nav a:hover::before,
.quick-nav a.is-active::before {
  color: #0a0804 !important;
  border-color: rgba(10, 8, 4, 0.18);
  background: rgba(255, 255, 255, 0.22);
}

.button,
button,
.copy-button,
.admin-action,
.logout-link {
  border-radius: 8px !important;
}

.controls,
.market-strip,
.bias-panel,
.settings-panel,
.system-panel,
.top-section,
.table-card,
.logs-panel,
.book-panel,
.calendar-panel,
.clients-panel {
  border-color: rgba(214, 168, 70, 0.2) !important;
  background:
    linear-gradient(145deg, rgba(20, 18, 13, 0.92), rgba(7, 7, 6, 0.96)) !important;
  box-shadow: 0 26px 72px rgba(0, 0, 0, 0.42);
}

.market-card,
.usd-bias-card,
.top-card,
.settings-card,
.stat-card {
  border-color: rgba(214, 168, 70, 0.24) !important;
  background:
    linear-gradient(145deg, rgba(214, 168, 70, 0.1), rgba(15, 18, 22, 0.88)) !important;
}

@media (min-width: 901px) {
  .app,
  .is-sidebar-collapsed .app {
    width: min(1320px, calc(100% - 324px)) !important;
    margin-left: 292px !important;
    margin-right: 24px !important;
  }

  .quick-nav-shell,
  .is-sidebar-collapsed .quick-nav-shell {
    position: fixed !important;
    top: 18px !important;
    bottom: 18px !important;
    left: 18px !important;
    z-index: 60 !important;
    display: grid !important;
    grid-template-rows: auto 1fr auto !important;
    width: 240px !important;
    margin: 0 !important;
    padding: 16px !important;
    border: 1px solid rgba(214, 168, 70, 0.32) !important;
    border-radius: 12px !important;
    background:
      linear-gradient(180deg, rgba(9, 8, 6, 0.98), rgba(3, 3, 3, 0.98)) !important;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.62) !important;
    backdrop-filter: blur(18px);
  }

  .quick-nav-toggle,
  .sidebar-collapse,
  .sidebar-show-button {
    display: none !important;
  }

  .sidebar-brand,
  .is-sidebar-collapsed .sidebar-brand {
    display: grid !important;
    grid-template-columns: 42px minmax(0, 1fr) !important;
    gap: 12px !important;
    align-items: center !important;
    padding-bottom: 14px !important;
    margin-bottom: 12px !important;
    border-bottom: 1px solid rgba(214, 168, 70, 0.22) !important;
  }

  .sidebar-brand > span,
  .is-sidebar-collapsed .sidebar-brand > span {
    display: grid !important;
    place-items: center !important;
    width: 42px !important;
    height: 42px !important;
    border: 1px solid rgba(236, 191, 83, 0.64) !important;
    border-radius: 11px !important;
    color: #070604 !important;
    background: linear-gradient(135deg, #e6bb4d, #bd8424) !important;
    box-shadow: 0 10px 26px rgba(214, 168, 70, 0.18) !important;
    font-size: 0.9rem !important;
    font-weight: 950 !important;
  }

  .sidebar-brand strong,
  .is-sidebar-collapsed .sidebar-brand strong {
    display: block !important;
    overflow: hidden !important;
    color: #fff7e7 !important;
    font-size: 1.08rem !important;
    font-weight: 950 !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .quick-nav {
    display: grid !important;
    align-content: start !important;
    gap: 9px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    backdrop-filter: none !important;
  }

  .quick-nav a,
  .is-sidebar-collapsed .quick-nav a {
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    min-height: 50px !important;
    padding: 8px 10px !important;
    font-size: 0.9rem !important;
    font-weight: 950 !important;
  }

  .logout-link {
    margin-top: 14px !important;
  }
}

@media (max-width: 900px) {
  .header {
    padding: 10px 12px !important;
  }

  .header h1 {
    font-size: 1.03rem !important;
  }

  .quick-nav-toggle {
    display: flex !important;
  }

  .quick-nav a::before {
    width: 30px !important;
    height: 30px !important;
  }
}

/* Final mobile server status fit override */
.feed-status {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 8px 10px !important;
}

.feed-status > span:not(.pulse):not(.notification-gate-badge) {
  min-width: 0 !important;
  flex: 1 1 150px !important;
}

.notification-gate-badge {
  flex: 0 1 auto !important;
  max-width: 100% !important;
  line-height: 1.1 !important;
}

@media (max-width: 600px) {
  .header {
    display: grid !important;
    gap: 12px !important;
  }

  .feed-status {
    display: grid !important;
    grid-template-columns: 9px minmax(0, 1fr) !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 0 !important;
    padding: 10px 12px !important;
    align-items: center !important;
  }

  .feed-status .pulse {
    grid-row: 1 / span 2 !important;
  }

  .feed-status > span:not(.pulse):not(.notification-gate-badge) {
    grid-column: 2 !important;
    flex: none !important;
    white-space: normal !important;
    line-height: 1.18 !important;
  }

  .notification-gate-badge {
    grid-column: 2 !important;
    justify-self: start !important;
    min-height: 22px !important;
    padding: 3px 8px !important;
    font-size: 0.66rem !important;
  }
}

/* Mobile server status fit */
.feed-status {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 8px 10px !important;
}

.feed-status > span:not(.pulse):not(.notification-gate-badge) {
  min-width: 0 !important;
  flex: 1 1 150px !important;
}

.notification-gate-badge {
  flex: 0 1 auto !important;
  max-width: 100% !important;
  line-height: 1.1 !important;
}

@media (max-width: 600px) {
  .header {
    display: grid !important;
    gap: 12px !important;
  }

  .feed-status {
    display: grid !important;
    grid-template-columns: 9px minmax(0, 1fr) !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 0 !important;
    padding: 10px 12px !important;
    align-items: center !important;
  }

  .feed-status .pulse {
    grid-row: 1 / span 2 !important;
  }

  .feed-status > span:not(.pulse):not(.notification-gate-badge) {
    grid-column: 2 !important;
    flex: none !important;
    white-space: normal !important;
    line-height: 1.18 !important;
  }

  .notification-gate-badge {
    grid-column: 2 !important;
    justify-self: start !important;
    min-height: 22px !important;
    padding: 3px 8px !important;
    font-size: 0.66rem !important;
  }
}

/* Calendar and sidebar fit fixes */
@media (min-width: 901px) {
  .quick-nav-shell,
  .is-sidebar-collapsed .quick-nav-shell {
    width: 230px !important;
    padding: 14px !important;
  }

  .app,
  .is-sidebar-collapsed .app {
    width: min(1320px, calc(100% - 304px)) !important;
    margin-left: 274px !important;
  }

  .sidebar-brand,
  .is-sidebar-collapsed .sidebar-brand {
    grid-template-columns: 36px minmax(0, 1fr) !important;
    gap: 10px !important;
    padding-bottom: 12px !important;
    margin-bottom: 10px !important;
  }

  .sidebar-brand > span,
  .is-sidebar-collapsed .sidebar-brand > span {
    width: 36px !important;
    height: 36px !important;
    border-radius: 9px !important;
    font-size: 0.78rem !important;
  }

  .sidebar-brand strong,
  .is-sidebar-collapsed .sidebar-brand strong {
    font-size: 0.95rem !important;
  }

  .quick-nav {
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    gap: 7px !important;
    padding-right: 3px !important;
  }

  .quick-nav a,
  .is-sidebar-collapsed .quick-nav a {
    min-height: 42px !important;
    padding: 6px 8px !important;
    font-size: 0.78rem !important;
    line-height: 1.1 !important;
  }

  .quick-nav a::before {
    flex-basis: 28px !important;
    width: 28px !important;
    height: 28px !important;
    border-radius: 7px !important;
    font-size: 0.86rem !important;
  }

  .logout-link {
    min-height: 40px !important;
    padding: 8px 10px !important;
    font-size: 0.78rem !important;
  }
}

.calendar-panel {
  overflow: hidden !important;
}

.calendar-panel .section-title {
  min-width: 0 !important;
}

.calendar-panel .section-title > div {
  min-width: 0 !important;
}

#refreshCalendarButton {
  flex: 0 0 auto !important;
  max-width: 180px !important;
  white-space: nowrap !important;
}

.calendar-filters {
  grid-template-columns: minmax(150px, 0.62fr) minmax(280px, 1.35fr) minmax(220px, 0.92fr) minmax(180px, 0.78fr) !important;
  max-width: 100% !important;
}

.calendar-filter-group,
.calendar-filters .control-group {
  min-width: 0 !important;
  max-width: 100% !important;
}

.calendar-filters input,
.calendar-filters select {
  width: 100% !important;
  min-width: 0 !important;
}

.calendar-check-grid.pairs {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.calendar-check {
  min-height: 28px !important;
  padding: 5px 7px !important;
  font-size: 0.68rem !important;
}

.calendar-status,
.calendar-list,
.calendar-event {
  max-width: 100% !important;
}

@media (max-width: 1280px) {
  .calendar-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 700px) {
  .calendar-panel .section-title {
    align-items: stretch !important;
  }

  #refreshCalendarButton {
    max-width: none !important;
    width: 100% !important;
  }

  .calendar-filters {
    grid-template-columns: 1fr !important;
  }
}

/* Final premium shell override */
body {
  background:
    radial-gradient(circle at 74% 8%, rgba(214, 168, 70, 0.16), transparent 30%),
    radial-gradient(circle at 8% 0%, rgba(214, 168, 70, 0.08), transparent 24%),
    linear-gradient(180deg, #050505 0%, #0b0906 42%, #030303 100%) !important;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(214, 168, 70, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(214, 168, 70, 0.03) 1px, transparent 1px);
  background-size: 78px 78px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.72), transparent 82%);
}

.header {
  min-height: auto !important;
  padding: 12px 14px !important;
  border-color: rgba(214, 168, 70, 0.28) !important;
  border-radius: 10px !important;
  background:
    linear-gradient(90deg, rgba(214, 168, 70, 0.14), rgba(17, 15, 10, 0.94) 42%, rgba(9, 8, 6, 0.96)) !important;
}

.header h1 {
  font-size: clamp(1.08rem, 1.6vw, 1.55rem) !important;
  line-height: 1.05 !important;
}

.header .eyebrow {
  margin-bottom: 3px !important;
}

.quick-nav-toggle {
  border-color: rgba(214, 168, 70, 0.34) !important;
  color: #f8efd6 !important;
  background: rgba(20, 18, 13, 0.94) !important;
}

.quick-nav a {
  position: relative;
  gap: 10px !important;
  overflow: hidden;
  border-color: rgba(214, 168, 70, 0.22) !important;
  color: #cfc3a4 !important;
  background: linear-gradient(135deg, rgba(25, 23, 17, 0.94), rgba(13, 12, 9, 0.92)) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.quick-nav a::before {
  content: attr(data-icon) !important;
  display: grid !important;
  flex: 0 0 32px;
  place-items: center;
  width: 32px !important;
  height: 32px !important;
  border: 1px solid rgba(214, 168, 70, 0.22);
  border-radius: 8px;
  color: #f4c75f !important;
  background: rgba(214, 168, 70, 0.1);
  font-size: 1rem !important;
  font-weight: 950;
}

.quick-nav a:hover,
.quick-nav a.is-active,
.quick-nav a.gold-nav-link.is-active {
  color: #070604 !important;
  border-color: rgba(236, 191, 83, 0.78) !important;
  background: linear-gradient(135deg, #e2b648, #c8932c) !important;
}

.quick-nav a:hover::before,
.quick-nav a.is-active::before {
  color: #0a0804 !important;
  border-color: rgba(10, 8, 4, 0.18);
  background: rgba(255, 255, 255, 0.22);
}

.button,
button,
.copy-button,
.admin-action,
.logout-link {
  border-radius: 8px !important;
}

.controls,
.market-strip,
.bias-panel,
.settings-panel,
.system-panel,
.top-section,
.table-card,
.logs-panel,
.book-panel,
.calendar-panel,
.clients-panel {
  border-color: rgba(214, 168, 70, 0.2) !important;
  background:
    linear-gradient(145deg, rgba(20, 18, 13, 0.92), rgba(7, 7, 6, 0.96)) !important;
  box-shadow: 0 26px 72px rgba(0, 0, 0, 0.42);
}

.market-card,
.usd-bias-card,
.top-card,
.settings-card,
.stat-card {
  border-color: rgba(214, 168, 70, 0.24) !important;
  background:
    linear-gradient(145deg, rgba(214, 168, 70, 0.1), rgba(15, 18, 22, 0.88)) !important;
}

@media (min-width: 901px) {
  .app,
  .is-sidebar-collapsed .app {
    width: min(1320px, calc(100% - 324px)) !important;
    margin-left: 292px !important;
    margin-right: 24px !important;
  }

  .quick-nav-shell,
  .is-sidebar-collapsed .quick-nav-shell {
    position: fixed !important;
    top: 18px !important;
    bottom: 18px !important;
    left: 18px !important;
    z-index: 60 !important;
    display: grid !important;
    grid-template-rows: auto 1fr auto !important;
    width: 240px !important;
    margin: 0 !important;
    padding: 16px !important;
    border: 1px solid rgba(214, 168, 70, 0.32) !important;
    border-radius: 12px !important;
    background:
      linear-gradient(180deg, rgba(9, 8, 6, 0.98), rgba(3, 3, 3, 0.98)) !important;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.62) !important;
    backdrop-filter: blur(18px);
  }

  .quick-nav-toggle,
  .sidebar-collapse,
  .sidebar-show-button {
    display: none !important;
  }

  .sidebar-brand,
  .is-sidebar-collapsed .sidebar-brand {
    display: grid !important;
    grid-template-columns: 42px minmax(0, 1fr) !important;
    gap: 12px !important;
    align-items: center !important;
    padding-bottom: 14px !important;
    margin-bottom: 12px !important;
    border-bottom: 1px solid rgba(214, 168, 70, 0.22) !important;
  }

  .sidebar-brand > span,
  .is-sidebar-collapsed .sidebar-brand > span {
    display: grid !important;
    place-items: center !important;
    width: 42px !important;
    height: 42px !important;
    border: 1px solid rgba(236, 191, 83, 0.64) !important;
    border-radius: 11px !important;
    color: #070604 !important;
    background: linear-gradient(135deg, #e6bb4d, #bd8424) !important;
    box-shadow: 0 10px 26px rgba(214, 168, 70, 0.18) !important;
    font-size: 0.9rem !important;
    font-weight: 950 !important;
  }

  .sidebar-brand strong,
  .is-sidebar-collapsed .sidebar-brand strong {
    display: block !important;
    overflow: hidden !important;
    color: #fff7e7 !important;
    font-size: 1.08rem !important;
    font-weight: 950 !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .quick-nav {
    display: grid !important;
    align-content: start !important;
    gap: 9px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    backdrop-filter: none !important;
  }

  .quick-nav a,
  .is-sidebar-collapsed .quick-nav a {
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    min-height: 50px !important;
    padding: 8px 10px !important;
    font-size: 0.9rem !important;
    font-weight: 950 !important;
  }

  .logout-link {
    margin-top: 14px !important;
  }
}

@media (max-width: 900px) {
  .header {
    padding: 10px 12px !important;
  }

  .header h1 {
    font-size: 1.03rem !important;
  }

  .quick-nav-toggle {
    display: flex !important;
  }

  .quick-nav a::before {
    width: 30px !important;
    height: 30px !important;
  }
}

/* Premium interface polish */
:root {
  --premium-bg: #050607;
  --premium-panel: rgba(16, 17, 17, 0.9);
  --premium-panel-strong: rgba(24, 22, 17, 0.94);
  --premium-stroke: rgba(214, 168, 70, 0.24);
  --premium-stroke-strong: rgba(214, 168, 70, 0.48);
  --premium-glow: 0 24px 80px rgba(0, 0, 0, 0.68), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body {
  background:
    radial-gradient(circle at 74% 9%, rgba(214, 168, 70, 0.14), transparent 26%),
    radial-gradient(circle at 12% 32%, rgba(214, 168, 70, 0.08), transparent 22%),
    linear-gradient(180deg, #060707 0%, #0b0906 48%, #040404 100%);
}

.app::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(214, 168, 70, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(214, 168, 70, 0.035) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
}

.header {
  border-color: rgba(214, 168, 70, 0.32) !important;
  background:
    linear-gradient(110deg, rgba(214, 168, 70, 0.16), transparent 42%),
    linear-gradient(180deg, rgba(28, 25, 18, 0.96), rgba(12, 12, 11, 0.94)) !important;
  box-shadow: var(--premium-glow) !important;
}

.feed-status {
  border-color: rgba(214, 168, 70, 0.28) !important;
  background: rgba(7, 9, 12, 0.84) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.quick-nav-shell {
  border-color: var(--premium-stroke-strong) !important;
  background:
    linear-gradient(180deg, rgba(22, 19, 13, 0.96), rgba(6, 6, 5, 0.96)) !important;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

.sidebar-brand {
  grid-template-columns: 38px minmax(0, 1fr) !important;
  border-bottom-color: rgba(214, 168, 70, 0.24) !important;
}

.sidebar-brand span {
  position: relative;
  isolation: isolate;
  border-color: rgba(255, 229, 160, 0.48) !important;
  background:
    linear-gradient(145deg, #f2ca67, #b98224) !important;
  box-shadow: 0 10px 30px rgba(214, 168, 70, 0.2);
}

.quick-nav {
  gap: 9px !important;
}

.quick-nav a {
  position: relative;
  gap: 11px;
  min-height: 46px !important;
  border: 1px solid rgba(214, 168, 70, 0.18) !important;
  border-radius: 9px !important;
  color: rgba(244, 247, 251, 0.68) !important;
  background:
    linear-gradient(135deg, rgba(214, 168, 70, 0.06), transparent 42%),
    rgba(18, 17, 13, 0.88) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.quick-nav a::before {
  content: attr(data-icon);
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border: 1px solid rgba(214, 168, 70, 0.24);
  border-radius: 8px;
  color: var(--gold);
  background: rgba(214, 168, 70, 0.1);
  font-size: 0.9rem;
  font-weight: 950;
  line-height: 1;
}

.quick-nav a:hover {
  color: var(--text) !important;
  border-color: rgba(214, 168, 70, 0.42) !important;
  background:
    linear-gradient(135deg, rgba(214, 168, 70, 0.14), transparent 52%),
    rgba(26, 23, 17, 0.94) !important;
}

.quick-nav a.is-active {
  color: #0a0804 !important;
  border-color: rgba(255, 232, 175, 0.64) !important;
  background: linear-gradient(145deg, #e5b94d, #c8942f) !important;
  box-shadow: 0 16px 36px rgba(214, 168, 70, 0.18);
}

.quick-nav a.is-active::before {
  color: #f6d57b;
  border-color: rgba(0, 0, 0, 0.18);
  background: rgba(8, 7, 4, 0.86);
}

.logout-link {
  min-height: 48px;
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(255, 102, 115, 0.1), rgba(40, 8, 12, 0.72));
}

.controls,
.market-strip,
.bias-panel,
.settings-panel,
.system-panel,
.calendar-panel,
.book-panel,
.clients-panel,
.top-section,
.table-card,
.logs-panel {
  border-color: var(--premium-stroke) !important;
  background:
    linear-gradient(135deg, rgba(214, 168, 70, 0.055), transparent 34%),
    rgba(13, 14, 13, 0.92) !important;
  box-shadow: var(--premium-glow) !important;
}

.settings-card,
.group-bias-card,
.market-card,
.system-card,
.system-detail-card,
.top-card,
.calendar-filter-group,
.calendar-event,
.user-card,
.logs-stats article {
  border-color: rgba(214, 168, 70, 0.22) !important;
  background:
    linear-gradient(145deg, rgba(214, 168, 70, 0.075), transparent 42%),
    rgba(9, 12, 15, 0.78) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.refresh-button,
.copy-button,
.admin-button,
.book-download-link {
  border-radius: 9px !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 28px rgba(0, 0, 0, 0.26);
}

.refresh-button {
  color: #06100c !important;
  background: linear-gradient(145deg, #42dfa0, #22b879) !important;
}

.copy-button {
  border-color: rgba(93, 167, 255, 0.34) !important;
  background: linear-gradient(145deg, rgba(32, 62, 96, 0.88), rgba(11, 17, 24, 0.94)) !important;
}

.admin-button {
  background: linear-gradient(145deg, rgba(110, 28, 37, 0.72), rgba(35, 12, 15, 0.94)) !important;
}

.log-pill,
.bias-pill,
.top-card > span,
.a-config-badge,
.beta-disclaimer strong {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.table-card tbody tr {
  transition: background 0.16s ease, transform 0.16s ease;
}

.table-card tbody tr:hover {
  background: rgba(214, 168, 70, 0.035);
}

@media (min-width: 901px) {
  .quick-nav a {
    padding: 9px 10px !important;
  }

  .is-sidebar-collapsed .quick-nav a::before {
    content: attr(data-icon) !important;
    width: 31px;
    height: 31px;
    font-size: 0.92rem;
  }
}

@media (max-width: 900px) {
  .quick-nav a::before {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
    font-size: 0.78rem;
  }
}

/* Absolute final sidebar hide behavior */
@media (min-width: 901px) {
  .is-sidebar-collapsed .app {
    width: min(1480px, calc(100% - 48px)) !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .is-sidebar-collapsed .quick-nav-shell {
    display: grid !important;
    border-color: transparent !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    pointer-events: none !important;
  }

  .is-sidebar-collapsed .quick-nav,
  .is-sidebar-collapsed .sidebar-brand strong,
  .is-sidebar-collapsed .sidebar-brand > span,
  .is-sidebar-collapsed .sidebar-show-button {
    display: none !important;
  }

  .is-sidebar-collapsed .sidebar-brand {
    display: grid !important;
    grid-template-columns: 1fr 42px !important;
    padding-bottom: 12px !important;
    margin-bottom: 12px !important;
    border-bottom-color: transparent !important;
    pointer-events: none !important;
  }

  .is-sidebar-collapsed .sidebar-collapse {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 42px !important;
    height: 42px !important;
    transform: none !important;
    pointer-events: auto !important;
  }
}

/* Emergency visible restore button when sidebar is hidden */
@media (min-width: 901px) {
  .is-sidebar-collapsed .sidebar-collapse {
    position: fixed !important;
    top: 223px !important;
    left: 239px !important;
    z-index: 9999 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 42px !important;
    height: 42px !important;
    padding: 0 !important;
    border: 1px solid var(--gold-line) !important;
    border-radius: 8px !important;
    color: var(--gold) !important;
    background: rgba(214, 168, 70, 0.1) !important;
    box-shadow: var(--shadow) !important;
    cursor: pointer !important;
    font-size: 1.3rem !important;
    font-weight: 950 !important;
    line-height: 1 !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: none !important;
  }
}

/* Robust independent reopen button */
.sidebar-show-button {
  display: none !important;
}

.app-view > .controls,
[data-view="watchlist"] > .controls {
  height: auto !important;
  min-height: 0 !important;
  align-content: end;
}

@media (min-width: 901px) {
  .is-sidebar-collapsed .quick-nav-shell {
    display: none !important;
  }

  .is-sidebar-collapsed .sidebar-show-button {
    position: fixed !important;
    top: 30px !important;
    left: 254px !important;
    z-index: 10000 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 42px !important;
    height: 42px !important;
    padding: 0 !important;
    border: 1px solid var(--gold-line) !important;
    border-radius: 8px !important;
    color: var(--gold) !important;
    background: rgba(214, 168, 70, 0.1) !important;
    box-shadow: var(--shadow) !important;
    cursor: pointer !important;
    font-size: 1.3rem !important;
    font-weight: 950 !important;
    line-height: 1 !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }
}

/* Reopen button locked to the opened-sidebar collapse position */
@media (min-width: 901px) {
  .is-sidebar-collapsed .sidebar-show-button {
    top: 30px !important;
    left: 254px !important;
  }
}

/* FINAL HARD OVERRIDES - keep after every previous redesign block */
.header {
  min-height: 42px !important;
  padding: 6px 10px !important;
}

.header .eyebrow {
  margin-bottom: 1px !important;
  font-size: 0.58rem !important;
  line-height: 1 !important;
}

.header h1 {
  max-width: 760px !important;
  font-size: clamp(0.76rem, 1vw, 0.95rem) !important;
  line-height: 1.05 !important;
}

.feed-status {
  min-height: 30px !important;
  padding: 0 9px !important;
  font-size: 0.72rem !important;
}

.beta-disclaimer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  max-width: 780px;
  margin: 3px 0 0;
  color: rgba(244, 247, 251, 0.62);
  font-size: 0.64rem;
  font-weight: 700;
  line-height: 1.2;
}

.beta-disclaimer strong {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 2px 7px;
  border: 1px solid rgba(214, 168, 70, 0.38);
  border-radius: 999px;
  color: #0a0804;
  background: var(--gold);
  font-size: 0.58rem;
  font-weight: 950;
  line-height: 1;
}

@media (min-width: 901px) {
  .sidebar-brand {
    grid-template-columns: minmax(0, 1fr) 42px !important;
  }

  .sidebar-brand > span {
    display: none !important;
  }

  .sidebar-brand strong {
    display: block !important;
    min-width: 0 !important;
    max-width: none !important;
    overflow: visible !important;
    font-size: 1rem !important;
    line-height: 1 !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
  }

  .sidebar-collapse {
    width: 42px !important;
  }

  .is-sidebar-collapsed .sidebar-brand {
    justify-items: center !important;
  }

  .is-sidebar-collapsed .sidebar-brand strong {
    display: none !important;
  }
}

@media (max-width: 900px) {
  .header h1 {
    font-size: 0.76rem !important;
  }
}

/* Full sidebar hide mode */
.sidebar-show-button {
  display: none;
}

.header h1 {
  font-size: clamp(0.95rem, 1.35vw, 1.22rem) !important;
}

@media (min-width: 901px) {
  .is-sidebar-collapsed .quick-nav-shell {
    display: none !important;
  }

  .is-sidebar-collapsed .app {
    width: min(1480px, calc(100% - 48px)) !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .is-sidebar-collapsed .sidebar-show-button {
    position: fixed;
    top: 223px;
    left: 239px;
    z-index: 90;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--gold-line);
    border-radius: 8px;
    color: var(--gold);
    background: rgba(214, 168, 70, 0.1);
    box-shadow: var(--shadow);
    cursor: pointer;
    font-size: 1.3rem;
    font-weight: 950;
    line-height: 1;
  }
}

/* Align hidden-menu button with the sidebar collapse control */
@media (min-width: 901px) {
  .is-sidebar-collapsed .sidebar-show-button {
    top: 223px !important;
    left: 254px !important;
  }
}

@media (max-width: 900px) {
  .header h1 {
    font-size: 0.92rem !important;
  }
}

/* Desktop section navigation */
.app-view {
  min-width: 0;
}

.is-legacy-market-view {
  display: none !important;
}

.watchlist-dxy-strip {
  min-height: 0 !important;
  margin: 0 0 16px;
}

.watchlist-dxy-strip .market-card {
  max-width: 520px;
}

.sidebar-collapse,
.sidebar-show-button {
  display: none !important;
}

@media (min-width: 901px) {
  .app-view {
    display: none;
  }

  .app-view.is-view-active {
    display: block;
  }

  .market-view.is-view-active {
    display: grid;
    gap: 12px;
  }

  .quick-nav a.is-active {
    color: #0a0804;
    border-color: var(--gold);
    background: var(--gold);
  }

  .is-sidebar-collapsed .quick-nav a.is-active::before {
    color: #0a0804;
    background: var(--gold);
  }

  .app-view > .controls,
  .app-view > .table-card,
  .app-view > .bias-panel,
  .app-view > .settings-panel,
  .app-view > .system-panel,
  .app-view > .calendar-panel,
  .app-view > .logs-panel,
  .app-view > .market-strip {
    min-height: calc(100vh - 156px);
  }

  .app-view > .controls {
    min-height: 0;
  }

  .market-view > .controls {
    min-height: 0;
  }

  .market-view > .market-strip {
    min-height: calc(100vh - 236px);
  }
}

@media (max-width: 900px) {
  .app-view {
    display: block;
  }

  .quick-nav a.is-active {
    border-color: var(--gold-line);
  }
}

/* Compact fixed title bar */
.header {
  position: sticky;
  top: 12px;
  z-index: 50;
  min-height: 58px;
  padding: 10px 14px;
  margin-bottom: 12px;
  backdrop-filter: blur(16px);
}

.header .eyebrow {
  margin-bottom: 2px;
  font-size: 0.68rem;
}

.header h1 {
  font-size: clamp(1.05rem, 2.2vw, 1.55rem);
  line-height: 1.05;
}

.feed-status {
  min-height: 36px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.notification-gate-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  color: rgba(226, 232, 240, 0.82);
  background: rgba(15, 23, 42, 0.52);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.notification-gate-badge.is-auto {
  border-color: rgba(96, 165, 250, 0.34);
  color: #bfdbfe;
  background: rgba(37, 99, 235, 0.14);
}

.notification-gate-badge.is-on {
  border-color: rgba(52, 211, 153, 0.35);
  color: #bbf7d0;
  background: rgba(22, 163, 74, 0.14);
}

.notification-gate-badge.is-off {
  border-color: rgba(248, 113, 113, 0.3);
  color: #fecaca;
  background: rgba(185, 28, 28, 0.12);
}

.notification-gate-badge.is-maintenance {
  border-color: rgba(251, 191, 36, 0.38);
  color: #fde68a;
  background: rgba(217, 119, 6, 0.14);
}

.momentum-ticker {
  position: sticky;
  top: 82px;
  z-index: 49;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 42px;
  margin: -2px 0 12px;
  padding: 8px 12px;
  overflow: hidden;
  border: 1px solid rgba(214, 168, 70, 0.42);
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(214, 168, 70, 0.18), rgba(9, 10, 8, 0.96));
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.38);
}

.momentum-ticker.is-hidden {
  display: none;
}

.momentum-ticker > strong {
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 950;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.momentum-ticker-track {
  min-width: 0;
  overflow: hidden;
}

.momentum-ticker-lane {
  display: flex;
  width: max-content;
  gap: 10px;
  animation: momentumTickerScroll 26s linear infinite;
}

.momentum-ticker:hover .momentum-ticker-lane {
  animation-play-state: paused;
}

.momentum-ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 26px;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  color: var(--text);
  background: rgba(18, 25, 34, 0.88);
  white-space: nowrap;
}

.momentum-ticker-item strong {
  font-size: 0.9rem;
}

.momentum-ticker-item em,
.ticker-demo {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 950;
  text-transform: uppercase;
}

.momentum-ticker-item.is-bull em {
  color: #04100b;
  background: var(--green);
}

.momentum-ticker-item.is-bear em {
  color: #160307;
  background: var(--red);
}

.momentum-ticker-item span {
  color: var(--muted);
  font-size: 0.78rem;
}

.ticker-demo {
  color: #0a0804;
  background: var(--gold);
}

@keyframes momentumTickerScroll {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

@media (max-width: 900px) {
  .momentum-ticker {
    top: 72px;
    grid-template-columns: 1fr;
    gap: 6px;
    margin-bottom: 10px;
  }

  .momentum-ticker > strong {
    font-size: 0.7rem;
  }
}

@media (min-width: 901px) {
  .app-view > .table-card,
  .app-view > .bias-panel,
  .app-view > .settings-panel,
  .app-view > .system-panel,
  .app-view > .calendar-panel,
  .app-view > .logs-panel,
  .app-view > .controls,
  .app-view > .market-strip {
    min-height: calc(100vh - 110px);
  }

  .market-view > .market-strip {
    min-height: calc(100vh - 190px);
  }

  .dxy-only-strip {
    grid-template-columns: minmax(280px, 520px);
    align-content: start;
  }

  .top-view-panel {
    border-color: rgba(214, 168, 70, 0.7);
    background: linear-gradient(145deg, rgba(214, 168, 70, 0.14), rgba(17, 16, 13, 0.96));
  }

  .top-view-panel .top-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

@media (max-width: 900px) {
  .header {
    top: 8px;
    align-items: center;
    flex-direction: row;
    padding: 10px;
  }

  .header h1 {
    font-size: 1rem;
  }

  .feed-status {
    max-width: 48%;
    font-size: 0.72rem;
  }
}

/* Compact title and DXY view cleanup */
.header {
  min-height: 46px;
  padding: 7px 12px;
}

.header .eyebrow {
  font-size: 0.62rem;
}

.header h1 {
  font-size: clamp(0.78rem, 1.05vw, 0.98rem);
  line-height: 1.05;
}

.feed-status {
  min-height: 32px;
  font-size: 0.76rem;
}

@media (min-width: 901px) {
  .market-view.is-view-active {
    align-content: start;
  }

  .market-view > .controls,
  .market-view > .market-strip,
  .dxy-only-strip {
    min-height: 0;
  }

  .dxy-only-strip {
    align-items: start;
    margin-bottom: 0;
  }

  .dxy-only-strip .market-card {
    min-height: 146px;
  }
}

@media (max-width: 900px) {
  .header {
    min-height: 44px;
  }

  .header h1 {
    font-size: 0.78rem;
  }
}

@media (min-width: 901px) {
  .sidebar-brand {
    grid-template-columns: 1fr 32px;
  }

  .sidebar-brand strong {
    font-size: 0.9rem;
  }

  .sidebar-brand > span {
    display: none;
  }
}

/* Critical sizing overrides */
.header {
  min-height: 42px;
  padding: 6px 10px;
}

.header .eyebrow {
  margin-bottom: 1px;
  font-size: 0.58rem;
}

.header h1 {
  max-width: 760px;
  font-size: clamp(0.76rem, 1vw, 0.95rem);
  line-height: 1.05;
}

.feed-status {
  min-height: 30px;
  padding: 0 9px;
  font-size: 0.72rem;
}

@media (min-width: 901px) {
  .sidebar-brand {
    grid-template-columns: minmax(0, 1fr) 42px;
  }

  .sidebar-brand strong {
    min-width: 0;
    font-size: 1rem;
    white-space: nowrap;
  }

  .sidebar-collapse {
    width: 42px;
  }

  .is-sidebar-collapsed .sidebar-brand {
    justify-items: center;
  }

  .is-sidebar-collapsed .sidebar-brand strong {
    display: none;
  }
}

@media (max-width: 900px) {
  .header h1 {
    font-size: 0.76rem;
  }
}

/* Black & gold redesign */
:root {
  --bg: #070707;
  --panel: #11100d;
  --panel-2: #191711;
  --line: #3a3120;
  --text: #fff8e7;
  --muted: #b6a985;
  --green: #38d996;
  --red: #ff6f79;
  --orange: #d6a846;
  --blue: #d6a846;
  --gold: #d6a846;
  --gold-soft: rgba(214, 168, 70, 0.16);
  --gold-line: rgba(214, 168, 70, 0.38);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.58);
}

body {
  background:
    linear-gradient(180deg, #070707 0%, #0f0d09 46%, #050505 100%);
}

.app {
  transition: margin-left 0.2s ease, width 0.2s ease;
}

.header,
.controls,
.market-strip,
.bias-panel,
.settings-panel,
.system-panel,
.top-section,
.table-card,
.logs-panel {
  border-color: var(--line);
  background: rgba(17, 16, 13, 0.92);
}

.header {
  border-color: var(--gold-line);
  background: linear-gradient(135deg, rgba(214, 168, 70, 0.14), rgba(17, 16, 13, 0.94));
}

.eyebrow,
.control-label,
.market-label,
.settings-label,
.logs-stats span {
  color: var(--gold);
}

.market-card,
.usd-bias-card {
  border-color: var(--gold-line);
  background: linear-gradient(145deg, rgba(214, 168, 70, 0.13), var(--panel-2));
}

.quick-nav-shell,
.quick-nav {
  transition: width 0.2s ease, transform 0.2s ease;
}

.sidebar-brand {
  display: none;
}

.sidebar-collapse {
  border: 1px solid var(--gold-line);
  color: var(--gold);
  background: rgba(214, 168, 70, 0.1);
  cursor: pointer;
}

@media (min-width: 901px) {
  .app {
    width: min(1320px, calc(100% - 292px));
    margin-left: 252px;
    margin-right: 24px;
  }

  .quick-nav-shell {
    position: fixed;
    top: 18px;
    bottom: 18px;
    left: 18px;
    z-index: 60;
    display: grid;
    grid-template-rows: auto 1fr;
    width: 214px;
    margin: 0;
    padding: 12px;
    border: 1px solid var(--gold-line);
    border-radius: 10px;
    background: rgba(10, 9, 7, 0.94);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
  }

  .sidebar-brand {
    display: grid;
    grid-template-columns: 1fr 32px;
    gap: 10px;
    align-items: center;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-brand strong {
    overflow: hidden;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 950;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sidebar-collapse {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 1.3rem;
    line-height: 1;
  }

  .quick-nav {
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 0;
    border: 0;
    background: transparent;
    backdrop-filter: none;
  }

  .quick-nav a {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 10px 12px;
    border-color: rgba(214, 168, 70, 0.18);
    color: var(--muted);
    background: rgba(25, 23, 17, 0.82);
  }

  .quick-nav a:hover {
    color: var(--text);
    border-color: var(--gold-line);
    background: var(--gold-soft);
  }

  .is-sidebar-collapsed .app {
    width: min(1320px, calc(100% - 142px));
    margin-left: 102px;
  }

  .is-sidebar-collapsed .quick-nav-shell {
    width: 64px;
    padding: 10px;
  }

  .is-sidebar-collapsed .sidebar-brand {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .is-sidebar-collapsed .sidebar-brand strong {
    display: none;
  }

  .is-sidebar-collapsed .sidebar-collapse {
    width: 42px;
  }

  .is-sidebar-collapsed .sidebar-collapse {
    transform: rotate(180deg);
  }

  .is-sidebar-collapsed .quick-nav a {
    justify-content: center;
    padding: 10px;
    font-size: 0;
  }

  .is-sidebar-collapsed .quick-nav a::before {
    content: attr(data-short);
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    color: var(--gold);
    background: rgba(214, 168, 70, 0.12);
    font-size: 0.84rem;
    font-weight: 950;
  }
}

@media (max-width: 900px) {
  .sidebar-brand {
    display: none;
  }

  .quick-nav {
    border-color: var(--gold-line);
    background: rgba(10, 9, 7, 0.96);
  }

  .quick-nav a {
    color: var(--text);
    border-color: rgba(214, 168, 70, 0.22);
    background: rgba(25, 23, 17, 0.9);
  }
}

/* Black & gold final overrides */
:root {
  --bg: #070707;
  --panel: #11100d;
  --panel-2: #191711;
  --line: #3a3120;
  --text: #fff8e7;
  --muted: #b6a985;
  --green: #38d996;
  --red: #ff6f79;
  --orange: #d6a846;
  --blue: #d6a846;
  --gold: #d6a846;
  --gold-soft: rgba(214, 168, 70, 0.16);
  --gold-line: rgba(214, 168, 70, 0.38);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.58);
}

body {
  background: linear-gradient(180deg, #070707 0%, #0f0d09 46%, #050505 100%);
}

.header {
  padding: 18px;
  border-color: var(--gold-line);
  background: linear-gradient(135deg, rgba(214, 168, 70, 0.14), rgba(17, 16, 13, 0.94));
  box-shadow: var(--shadow);
}

.header h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  letter-spacing: 0;
}

.header,
.controls,
.market-strip,
.bias-panel,
.settings-panel,
.system-panel,
.top-section,
.table-card,
.logs-panel {
  border-color: var(--line);
  background-color: rgba(17, 16, 13, 0.92);
}

.eyebrow,
.control-label,
.market-label,
.settings-label,
.logs-stats span {
  color: var(--gold);
}

.market-card,
.usd-bias-card {
  border-color: var(--gold-line);
  background: linear-gradient(145deg, rgba(214, 168, 70, 0.13), var(--panel-2));
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #0b0f14 0%, #0d131a 48%, #080c11 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.app {
  width: min(1320px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 38px;
}

.header,
.controls,
.top-grid,
.quick-nav,
.quick-nav-toggle,
.section-title,
.table-title,
.feed-status,
.badge,
.score-chip,
.status-chip,
.mini-segmented {
  display: flex;
}

.quick-nav-shell {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.quick-nav {
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(11, 15, 20, 0.92);
  backdrop-filter: blur(14px);
}

.quick-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: fit-content;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(18, 25, 34, 0.95);
  font-weight: 900;
}

.menu-icon {
  position: relative;
  display: block;
  width: 16px;
  height: 12px;
  border-top: 2px solid var(--text);
  border-bottom: 2px solid var(--text);
}

.menu-icon::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 0;
  width: 16px;
  height: 2px;
  border-radius: 99px;
  background: currentColor;
}

.quick-nav-toggle strong {
  margin-left: 2px;
}

.quick-nav a {
  min-height: 34px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: var(--panel-2);
  font-size: 0.82rem;
  font-weight: 900;
  text-decoration: none;
}

.quick-nav a:hover {
  color: var(--text);
  border-color: rgba(93, 167, 255, 0.45);
}

.header {
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 0.95;
}

h2 {
  margin-bottom: 0;
  font-size: 1.22rem;
}

.feed-status {
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 25, 34, 0.82);
  color: var(--muted);
}

.pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 5px rgba(243, 168, 59, 0.12);
}

.pulse.is-live {
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(47, 209, 139, 0.12);
}

.pulse.is-error {
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(255, 102, 115, 0.12);
}

.controls,
.market-strip,
.bias-panel,
.settings-panel,
.system-panel,
.calendar-panel,
.top-section,
.table-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 25, 34, 0.9);
  box-shadow: var(--shadow);
}

.market-strip {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  padding: 14px;
  margin-bottom: 12px;
}

.market-strip > *,
.top-section,
.top-grid,
.top-card {
  min-width: 0;
}

#dxy-block,
#watchlist-block,
#bias-block,
#calendar-block,
#top-block,
#settings-block {
  scroll-margin-top: 76px;
}

.market-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid rgba(93, 167, 255, 0.36);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(93, 167, 255, 0.16), var(--panel-2));
}

.compact-top {
  margin-bottom: 0;
  padding: 14px;
  box-shadow: none;
}

.compact-top .top-grid {
  grid-template-columns: repeat(5, minmax(120px, 1fr));
}

.compact-top .top-card {
  min-height: 112px;
}

.market-label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.market-card strong {
  font-size: 1.4rem;
}

.market-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(3, 7, 12, 0.72);
  backdrop-filter: blur(10px);
}

.loading-overlay.is-visible {
  display: grid;
}

.loading-modal {
  width: min(420px, 100%);
  padding: 22px;
  border: 1px solid rgba(93, 167, 255, 0.42);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.loading-modal h2 {
  margin-bottom: 16px;
}

.loading-bar {
  height: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #0e141b;
}

.loading-bar span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--green));
  transition: width 0.25s ease;
}

.loading-modal p:last-child {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.settings-panel {
  padding: 16px;
  margin-bottom: 12px;
}

.system-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 16, 13, 0.92);
}

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

.system-card,
.system-detail-card {
  padding: 14px;
  border: 1px solid rgba(214, 168, 70, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(214, 168, 70, 0.08), transparent 46%),
    rgba(8, 12, 17, 0.72);
}

.system-card span {
  display: block;
  margin-bottom: 9px;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.system-card strong {
  display: block;
  color: var(--text);
  font-size: 1.45rem;
  line-height: 1.1;
}

.system-card p,
.system-detail-card span {
  margin: 9px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.system-card.is-ok {
  border-color: rgba(47, 209, 139, 0.34);
}

.system-card.is-pending {
  border-color: rgba(243, 168, 59, 0.38);
}

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

.system-detail-card strong {
  display: block;
  color: var(--text);
}

.logs-panel {
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 25, 34, 0.82);
}

.logs-title,
.logs-actions,
.logs-filters {
  display: flex;
}

.logs-actions {
  flex-wrap: wrap;
  gap: 8px;
}

.logs-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.logs-stats article {
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.logs-stats span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.logs-stats strong {
  color: var(--text);
  font-size: 1.2rem;
  line-height: 1.25;
}

.logs-filters {
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.logs-filters .control-group {
  flex: 1 1 180px;
}

.logs-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.calendar-panel {
  display: grid;
  gap: 16px;
  padding: 20px;
  margin-bottom: 12px;
}

.calendar-filters {
  display: grid;
  grid-template-columns: minmax(180px, 0.62fr) minmax(380px, 1.55fr) minmax(270px, 0.9fr) minmax(220px, 0.8fr);
  gap: 10px;
  align-items: start;
}

.calendar-filter-group {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(214, 168, 70, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(214, 168, 70, 0.08), transparent 44%),
    rgba(9, 12, 15, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

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

.calendar-filter-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.calendar-filter-actions button {
  min-height: 22px;
  padding: 3px 7px;
  border: 1px solid rgba(214, 168, 70, 0.34);
  border-radius: 5px;
  color: var(--gold);
  background: rgba(214, 168, 70, 0.08);
  font-size: 0.62rem;
  font-weight: 950;
  text-transform: uppercase;
  cursor: pointer;
}

.calendar-filter-actions button:hover {
  color: #0a0804;
  background: var(--gold);
}

.calendar-check-grid {
  display: grid;
  gap: 6px;
  max-height: 128px;
  overflow: auto;
  padding-right: 4px;
}

.calendar-check-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: none;
}

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

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

.calendar-check {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 30px;
  padding: 5px 8px;
  border: 1px solid rgba(214, 168, 70, 0.16);
  border-radius: 6px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.74rem;
  font-weight: 900;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.calendar-check:hover {
  border-color: rgba(214, 168, 70, 0.4);
  color: var(--text);
  transform: translateY(-1px);
}

.calendar-check:has(input:checked) {
  border-color: rgba(214, 168, 70, 0.68);
  color: var(--text);
  background: linear-gradient(135deg, rgba(214, 168, 70, 0.22), rgba(93, 167, 255, 0.08));
}

.calendar-check input {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: var(--gold);
}

.calendar-check span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-status {
  padding: 10px 12px;
  border: 1px solid rgba(214, 168, 70, 0.24);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(18, 25, 34, 0.64);
  font-size: 0.88rem;
}

.calendar-status.is-error {
  border-color: rgba(255, 102, 115, 0.42);
  color: var(--red);
  background: rgba(255, 102, 115, 0.08);
}

.calendar-status.is-warning {
  border-color: rgba(214, 168, 70, 0.42);
  color: var(--gold);
  background: rgba(214, 168, 70, 0.08);
}

.hot-stories-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 102, 115, 0.26);
  border-radius: 8px;
  background:
    linear-gradient(110deg, rgba(255, 102, 115, 0.08), transparent 42%),
    rgba(9, 12, 15, 0.72);
}

.hot-stories-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.hot-stories-heading .eyebrow {
  margin: 0 0 3px;
}

.hot-stories-heading strong {
  color: var(--text);
  font-size: 1rem;
  font-weight: 950;
}

.hot-stories-warning {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-align: right;
}

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

.hot-story-card {
  display: grid;
  gap: 6px;
  min-height: 112px;
  padding: 10px;
  border: 1px solid rgba(214, 168, 70, 0.18);
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  background: rgba(18, 25, 34, 0.66);
}

.hot-story-card:hover {
  border-color: rgba(255, 102, 115, 0.38);
  background: rgba(34, 20, 24, 0.72);
}

.hot-story-card span {
  color: #ffb3bc;
  font-size: 0.72rem;
  font-weight: 900;
}

.hot-story-card strong {
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.25;
}

.hot-story-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.calendar-list {
  display: grid;
  gap: 14px;
}

.calendar-day-group {
  display: grid;
  gap: 8px;
}

.calendar-day-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  padding: 0 2px 6px;
  border-bottom: 1px solid rgba(214, 168, 70, 0.18);
}

.calendar-day-heading strong {
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 950;
  text-transform: capitalize;
}

.calendar-day-heading span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.calendar-day-events {
  display: grid;
  gap: 8px;
}

.calendar-event {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) minmax(170px, auto);
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(214, 168, 70, 0.18);
  border-left-width: 4px;
  border-radius: 8px;
  background: rgba(9, 12, 15, 0.78);
}

.calendar-event.impact-high {
  border-left-color: var(--red);
  background: linear-gradient(90deg, rgba(255, 102, 115, 0.1), rgba(9, 12, 15, 0.78) 34%);
}

.calendar-event.impact-medium {
  border-left-color: var(--orange);
  background: linear-gradient(90deg, rgba(243, 168, 59, 0.1), rgba(9, 12, 15, 0.78) 34%);
}

.calendar-event.impact-low {
  border-left-color: var(--gold);
}

.calendar-time,
.calendar-main,
.calendar-values {
  display: grid;
  gap: 5px;
}

.calendar-time strong,
.calendar-main strong {
  color: var(--text);
}

.calendar-time span,
.calendar-main p,
.calendar-values span {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.calendar-currency,
.calendar-impact {
  display: inline-flex;
  width: fit-content;
  margin-right: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #0a0804;
  background: var(--gold);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.calendar-impact {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.impact-high .calendar-impact {
  color: #ffe4e8;
  border: 1px solid rgba(255, 102, 115, 0.42);
  background: rgba(255, 102, 115, 0.18);
}

.impact-medium .calendar-impact {
  color: #ffe7bf;
  border: 1px solid rgba(243, 168, 59, 0.45);
  background: rgba(243, 168, 59, 0.18);
}

.impact-low .calendar-impact {
  color: #fff0bf;
  border: 1px solid rgba(214, 168, 70, 0.38);
  background: rgba(214, 168, 70, 0.14);
}

.impact-unknown .calendar-impact {
  color: var(--muted);
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(148, 163, 184, 0.08);
}

.calendar-values {
  justify-items: end;
}

.calendar-values strong {
  color: var(--text);
}

.calendar-empty {
  padding: 18px;
  border: 1px solid rgba(214, 168, 70, 0.18);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(9, 12, 15, 0.6);
}

@media (max-width: 900px) {
  .calendar-filters,
  .calendar-event,
  .hot-stories-grid,
  .time-window-grid {
    grid-template-columns: 1fr;
  }

  .calendar-check-grid.pairs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-height: 188px;
  }

  .calendar-values {
    justify-items: start;
  }
}

@media (max-width: 560px) {
  .calendar-check-grid.pairs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

.logs-table {
  min-width: 760px;
}

.logs-table th,
.logs-table td {
  padding: 10px;
}

.log-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  padding: 3px 7px;
  border-radius: 5px;
  color: var(--text);
  background: rgba(93, 167, 255, 0.12);
  font-size: 0.7rem;
  font-weight: 900;
  white-space: nowrap;
}

.trial-badge {
  display: inline-flex;
  width: fit-content;
  margin-top: 5px;
  padding: 4px 8px;
  border: 1px solid rgba(243, 168, 59, 0.42);
  border-radius: 999px;
  color: #ffe7bf;
  background: rgba(243, 168, 59, 0.14);
  font-size: 0.72rem;
  font-weight: 900;
}

.trial-badge.is-expired {
  border-color: rgba(255, 102, 115, 0.42);
  color: #ffe4e8;
  background: rgba(255, 102, 115, 0.14);
}

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

body[data-trial="active"] [data-trial-locked] {
  opacity: 0.5;
  text-decoration: line-through;
  pointer-events: none;
  filter: grayscale(0.5);
}

body[data-trial="active"] [data-trial-locked]::after {
  content: "Essai";
  margin-left: auto;
  padding: 2px 6px;
  border: 1px solid rgba(243, 168, 59, 0.36);
  border-radius: 999px;
  color: #ffe7bf;
  font-size: 0.62rem;
  text-decoration: none;
}

.log-bull {
  background: #137b55;
}

.log-bear {
  background: #a73440;
}

.log-status {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
}

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

.settings-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.settings-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.settings-card pre {
  min-height: 54px;
  max-height: 210px;
  overflow: auto;
  margin: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  background: #0e141b;
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.notification-card {
  align-content: start;
}

.settings-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-weight: 900;
}

.settings-toggle input {
  width: 18px;
  height: 18px;
  min-height: 0;
  accent-color: var(--green);
}

.notification-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.pwa-help {
  display: grid;
  gap: 5px;
  padding: 9px 10px;
  border: 1px solid rgba(214, 168, 70, 0.2);
  border-radius: 8px;
  background: rgba(214, 168, 70, 0.07);
}

.pwa-help p {
  font-size: 0.72rem;
  line-height: 1.4;
}

.pwa-help a {
  color: var(--gold);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.discord-filter-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.discord-filter-block {
  display: grid;
  gap: 8px;
  padding-top: 4px;
}

.discord-filter-block > strong {
  color: var(--text);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.discord-check-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  max-height: 190px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0e141b;
}

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

.discord-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.discord-check input {
  width: 14px;
  height: 14px;
  min-height: 0;
  accent-color: var(--green);
}

.discord-check span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-button {
  min-height: 38px;
  border: 1px solid rgba(93, 167, 255, 0.42);
  border-radius: 7px;
  color: var(--text);
  background: rgba(93, 167, 255, 0.14);
  cursor: pointer;
  font-weight: 900;
}

.controls {
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px;
  margin-bottom: 12px;
}

.control-group {
  display: grid;
  gap: 7px;
}

.control-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(96px, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0e141b;
}

.segment,
.refresh-button,
.admin-button,
input,
select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  background: var(--panel-2);
}

.segment,
.refresh-button {
  cursor: pointer;
}

.segment {
  border-color: transparent;
  background: transparent;
}

.segment.is-active {
  border-color: rgba(93, 167, 255, 0.45);
  background: rgba(93, 167, 255, 0.15);
}

.refresh-button {
  padding: 0 16px;
  color: #071d14;
  border-color: transparent;
  background: var(--green);
  font-weight: 800;
}

.admin-button {
  padding: 0 14px;
  color: var(--text);
  background: rgba(255, 102, 115, 0.14);
  border-color: rgba(255, 102, 115, 0.34);
  cursor: pointer;
  font-weight: 800;
}

.refresh-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

input,
select {
  padding: 0 12px;
}

.search-field {
  flex: 1 1 220px;
}

.search-field input {
  width: 100%;
}

.bias-panel {
  padding: 14px;
  margin-bottom: 12px;
}

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

.group-bias-card {
  display: grid;
  gap: 11px;
  min-height: 118px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.usd-bias-card {
  border-color: rgba(93, 167, 255, 0.42);
  background: linear-gradient(145deg, rgba(93, 167, 255, 0.16), var(--panel-2));
}

.group-bias-card span {
  display: block;
  margin-bottom: 5px;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 900;
}

.group-bias-card small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.mini-segmented {
  align-self: end;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0e141b;
}

.mini-segmented button {
  flex: 1;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
}

.mini-segmented button.is-active {
  color: var(--text);
  border-color: rgba(93, 167, 255, 0.4);
  background: rgba(93, 167, 255, 0.15);
}

.top-section,
.table-card {
  padding: 16px;
  margin-bottom: 12px;
}

.section-title {
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

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

.top-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 132px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(24, 33, 44, 0.98), rgba(18, 25, 34, 0.88));
}

.top-card strong {
  display: block;
  margin-bottom: 6px;
  overflow-wrap: anywhere;
  font-size: 1.18rem;
  line-height: 1.05;
}

.top-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.top-card-badges em,
.aconfig-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 3px 7px;
  border-radius: 5px;
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}

.top-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.top-card > span {
  justify-self: end;
  min-width: 64px;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(93, 167, 255, 0.12);
  font-size: 0.9rem;
  font-weight: 900;
  text-align: center;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
}

.pair-col {
  width: 46%;
}

.daily-col {
  width: 20%;
}

.bias-col {
  width: 34%;
}

.group-separator td {
  padding-top: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(93, 167, 255, 0.28);
  background: rgba(93, 167, 255, 0.07);
}

.group-separator span {
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 900;
}

.group-separator strong {
  margin-left: 10px;
  color: var(--muted);
  font-size: 0.78rem;
}

th,
td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
}

td {
  font-size: 0.93rem;
}

.pair-main {
  display: grid;
  gap: 3px;
}

.pair-main strong {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 1rem;
}

.pair-main em {
  padding: 3px 6px;
  border-radius: 5px;
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.top-daily {
  color: #062418;
  background: var(--green);
}

.force-aconfig {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.force-aconfig input {
  width: 14px;
  height: 14px;
  min-height: 0;
  accent-color: var(--blue);
}

.aconfig-badge {
  color: var(--text);
}

.aconfig-bull {
  background: #137b55;
}

.aconfig-bear {
  background: #a73440;
}

.aconfig-details {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.76rem;
}

.aconfig-details button {
  min-height: 22px;
  padding: 0 6px;
  border: 1px solid rgba(255, 102, 115, 0.34);
  border-radius: 5px;
  color: var(--red);
  background: rgba(255, 102, 115, 0.08);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 900;
}

.pair-main span,
.groups {
  color: var(--muted);
  font-size: 0.78rem;
}

.positive {
  color: var(--green);
}

.negative {
  color: var(--red);
}

.fresh-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 9px;
}

.fresh-dot.is-fresh {
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(47, 209, 139, 0.1);
}

.fresh-dot.is-stale {
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(255, 102, 115, 0.1);
}

.fresh-dot.is-neutral {
  background: var(--gold);
  box-shadow: 0 0 0 5px rgba(214, 168, 70, 0.1);
}

.badge,
.score-chip,
.status-chip {
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.badge.bull,
.badge.bias-bull,
.status-very,
.status-good {
  color: #062418;
  background: var(--green);
}

.badge.bear,
.badge.bias-bear,
.status-bad {
  color: #3a070d;
  background: var(--red);
}

.badge.neutral,
.badge.bias-neutral,
.status-neutral {
  color: #372405;
  background: var(--orange);
}

.score-chip {
  min-width: 40px;
  color: var(--text);
  background: rgba(93, 167, 255, 0.16);
}

#resultCount {
  color: var(--muted);
  font-weight: 800;
}

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

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

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

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

@media (max-width: 900px) {
  .app {
    width: min(100% - 20px, 1320px);
    padding-top: 18px;
    padding-bottom: 86px;
  }

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

  .quick-nav-shell {
    position: fixed;
    right: 0;
    bottom: 12px;
    left: 0;
    top: auto;
    z-index: 80;
    display: grid;
    justify-items: center;
    margin-bottom: 0;
    pointer-events: none;
  }

  .quick-nav-toggle {
    display: flex;
    pointer-events: auto;
    justify-content: center;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.42);
  }

  .quick-nav {
    display: none;
    position: absolute;
    right: auto;
    bottom: calc(100% + 8px);
    left: 50%;
    width: min(300px, calc(100vw - 28px));
    max-height: min(55vh, 360px);
    overflow-y: auto;
    transform: translateX(-50%);
    margin-top: 0;
    pointer-events: auto;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  }

  .logout-link {
    display: none;
    position: absolute;
    right: auto;
    bottom: calc(100% + 8px);
    left: 50%;
    width: min(300px, calc(100vw - 28px));
    transform: translate(-50%, calc(-55vh - 12px));
    pointer-events: auto;
  }

  .is-quick-nav-open .quick-nav {
    display: flex;
  }

  .is-quick-nav-open .logout-link {
    display: flex;
  }

  .quick-nav a {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .table-wrap {
    overflow-x: visible;
  }

  table,
  thead,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  colgroup,
  thead {
    display: none;
  }

  tbody tr {
    padding: 12px;
    border-bottom: 1px solid var(--line);
  }

  tbody tr:not(.group-separator) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
  }

  tbody tr:not(.group-separator) td {
    padding: 0;
    border-bottom: 0;
  }

  tbody tr:not(.group-separator) td:first-child {
    grid-column: 1 / -1;
  }

  tbody tr:not(.group-separator) td:nth-child(2) {
    align-self: center;
    font-weight: 900;
  }

  tbody tr:not(.group-separator) td:nth-child(3) {
    justify-self: end;
  }

  .group-separator td {
    padding: 12px;
  }

  .controls {
    align-items: stretch;
  }

  .control-group,
  .refresh-button {
    width: 100%;
  }

  .bias-panel,
  .bias-grid,
  .settings-grid {
    grid-template-columns: 1fr 1fr;
  }

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

  .logs-stat-wide {
    grid-column: 1 / -1;
  }

  .top-grid {
    grid-template-columns: 1fr;
    max-width: 100%;
    overflow: hidden;
  }

  .compact-top .top-grid {
    grid-template-columns: 1fr;
  }

  .top-card {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .top-card > span {
    min-width: 58px;
  }
}

@media (max-width: 520px) {
  .app {
    width: min(100% - 16px, 1320px);
  }

  .market-strip,
  .compact-top,
  .market-card,
  .table-card,
  .controls,
  .bias-panel,
  .settings-panel,
  .system-panel,
  .logs-panel {
    max-width: 100%;
    overflow: hidden;
  }

  .bias-panel,
  .bias-grid,
  .system-status-grid,
  .system-events,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .logs-title {
    align-items: stretch;
  }

  .logs-actions,
  .logs-actions button,
  .discord-filter-tools button {
    width: 100%;
  }

  .logs-stats {
    grid-template-columns: 1fr;
  }

  .discord-check-grid.pair-grid {
    grid-template-columns: 1fr;
  }

  .top-card {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .top-card > span {
    justify-self: start;
  }

  .loading-overlay {
    align-items: end;
    padding: 12px;
  }

.loading-modal {
    width: 100%;
    max-height: calc(100vh - 24px);
    overflow-y: auto;
    padding: 16px;
  }

  .loading-modal h2 {
    font-size: 1rem;
    line-height: 1.25;
  }

  .loading-modal p:last-child {
    overflow-wrap: anywhere;
    font-size: 0.84rem;
  }
}

/* Public V1 final overrides */
.logs-stats {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.logs-stat-wide {
  grid-column: span 2;
}

.pair-stats-block {
  margin-bottom: 14px;
}

.pair-stats-table {
  min-width: 680px;
}

.pair-stats-table th,
.pair-stats-table td {
  padding: 10px;
}

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

  .logs-stat-wide {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .logs-stats {
    grid-template-columns: 1fr;
  }

  .pair-stats-table,
  .logs-table {
    min-width: 620px;
  }
}

/* Final premium override - keep this block at EOF */
:root {
  --bg: #050505;
  --panel: #11100d;
  --panel-2: #191711;
  --line: #3a3120;
  --text: #fff8e7;
  --muted: #b6a985;
  --green: #38d996;
  --red: #ff6f79;
  --orange: #d6a846;
  --blue: #d6a846;
  --gold: #d6a846;
  --gold-soft: rgba(214, 168, 70, 0.16);
  --gold-line: rgba(214, 168, 70, 0.38);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.58);
}

body {
  background:
    radial-gradient(circle at 74% 8%, rgba(214, 168, 70, 0.16), transparent 30%),
    radial-gradient(circle at 8% 0%, rgba(214, 168, 70, 0.08), transparent 24%),
    linear-gradient(180deg, #050505 0%, #0b0906 42%, #030303 100%) !important;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(214, 168, 70, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(214, 168, 70, 0.03) 1px, transparent 1px);
  background-size: 78px 78px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.72), transparent 82%);
}

.header {
  min-height: auto !important;
  padding: 12px 14px !important;
  border-color: rgba(214, 168, 70, 0.28) !important;
  border-radius: 10px !important;
  background:
    linear-gradient(90deg, rgba(214, 168, 70, 0.14), rgba(17, 15, 10, 0.94) 42%, rgba(9, 8, 6, 0.96)) !important;
}

.header h1 {
  font-size: clamp(1.08rem, 1.6vw, 1.55rem) !important;
  line-height: 1.05 !important;
}

.header .eyebrow {
  margin-bottom: 3px !important;
}

.quick-nav a {
  position: relative;
  gap: 10px !important;
  overflow: hidden;
  border-color: rgba(214, 168, 70, 0.22) !important;
  color: #cfc3a4 !important;
  background: linear-gradient(135deg, rgba(25, 23, 17, 0.94), rgba(13, 12, 9, 0.92)) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.quick-nav a::before {
  content: attr(data-icon) !important;
  display: grid !important;
  flex: 0 0 32px;
  place-items: center;
  width: 32px !important;
  height: 32px !important;
  border: 1px solid rgba(214, 168, 70, 0.22);
  border-radius: 8px;
  color: #f4c75f !important;
  background: rgba(214, 168, 70, 0.1);
  font-size: 1rem !important;
  font-weight: 950;
}

.quick-nav a:hover,
.quick-nav a.is-active,
.quick-nav a.gold-nav-link.is-active {
  color: #070604 !important;
  border-color: rgba(236, 191, 83, 0.78) !important;
  background: linear-gradient(135deg, #e2b648, #c8932c) !important;
}

.quick-nav a:hover::before,
.quick-nav a.is-active::before {
  color: #0a0804 !important;
  border-color: rgba(10, 8, 4, 0.18);
  background: rgba(255, 255, 255, 0.22);
}

.controls,
.market-strip,
.bias-panel,
.settings-panel,
.system-panel,
.top-section,
.table-card,
.logs-panel,
.book-panel,
.calendar-panel,
.clients-panel {
  border-color: rgba(214, 168, 70, 0.2) !important;
  background:
    linear-gradient(145deg, rgba(20, 18, 13, 0.92), rgba(7, 7, 6, 0.96)) !important;
  box-shadow: 0 26px 72px rgba(0, 0, 0, 0.42);
}

.market-card,
.usd-bias-card,
.top-card,
.settings-card,
.stat-card {
  border-color: rgba(214, 168, 70, 0.24) !important;
  background:
    linear-gradient(145deg, rgba(214, 168, 70, 0.1), rgba(15, 18, 22, 0.88)) !important;
}

@media (min-width: 901px) {
  .app,
  .is-sidebar-collapsed .app {
    width: min(1320px, calc(100% - 324px)) !important;
    margin-left: 292px !important;
    margin-right: 24px !important;
  }

  .quick-nav-shell,
  .is-sidebar-collapsed .quick-nav-shell {
    position: fixed !important;
    top: 18px !important;
    bottom: 18px !important;
    left: 18px !important;
    z-index: 60 !important;
    display: grid !important;
    grid-template-rows: auto 1fr auto !important;
    width: 240px !important;
    margin: 0 !important;
    padding: 16px !important;
    border: 1px solid rgba(214, 168, 70, 0.32) !important;
    border-radius: 12px !important;
    background:
      linear-gradient(180deg, rgba(9, 8, 6, 0.98), rgba(3, 3, 3, 0.98)) !important;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.62) !important;
    backdrop-filter: blur(18px);
  }

  .quick-nav-toggle,
  .sidebar-collapse,
  .sidebar-show-button {
    display: none !important;
  }

  .sidebar-brand,
  .is-sidebar-collapsed .sidebar-brand {
    display: grid !important;
    grid-template-columns: 42px minmax(0, 1fr) !important;
    gap: 12px !important;
    align-items: center !important;
    padding-bottom: 14px !important;
    margin-bottom: 12px !important;
    border-bottom: 1px solid rgba(214, 168, 70, 0.22) !important;
  }

  .sidebar-brand > span,
  .is-sidebar-collapsed .sidebar-brand > span {
    display: grid !important;
    place-items: center !important;
    width: 42px !important;
    height: 42px !important;
    border: 1px solid rgba(236, 191, 83, 0.64) !important;
    border-radius: 11px !important;
    color: #070604 !important;
    background: linear-gradient(135deg, #e6bb4d, #bd8424) !important;
    box-shadow: 0 10px 26px rgba(214, 168, 70, 0.18) !important;
    font-size: 0.9rem !important;
    font-weight: 950 !important;
  }

  .sidebar-brand strong,
  .is-sidebar-collapsed .sidebar-brand strong {
    display: block !important;
    overflow: hidden !important;
    color: #fff7e7 !important;
    font-size: 1.08rem !important;
    font-weight: 950 !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .quick-nav {
    display: grid !important;
    align-content: start !important;
    gap: 9px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    backdrop-filter: none !important;
  }

  .quick-nav a,
  .is-sidebar-collapsed .quick-nav a {
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    min-height: 50px !important;
    padding: 8px 10px !important;
    font-size: 0.9rem !important;
    font-weight: 950 !important;
  }

  .logout-link {
    margin-top: 14px !important;
  }
}

@media (max-width: 900px) {
  .header {
    padding: 10px 12px !important;
  }

  .header h1 {
    font-size: 1.03rem !important;
  }

  .quick-nav-toggle {
    display: flex !important;
    border-color: rgba(214, 168, 70, 0.34) !important;
    color: #f8efd6 !important;
    background: rgba(20, 18, 13, 0.94) !important;
  }

  .quick-nav a::before {
    width: 30px !important;
    height: 30px !important;
  }
}

/* Last override: keep server state inside mobile header */
@media (max-width: 600px) {
  .header {
    display: grid !important;
    gap: 12px !important;
  }

  .feed-status {
    display: grid !important;
    grid-template-columns: 9px minmax(0, 1fr) !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 0 !important;
    padding: 10px 12px !important;
    align-items: center !important;
  }

  .feed-status .pulse {
    grid-row: 1 / span 2 !important;
  }

  .feed-status > span:not(.pulse):not(.notification-gate-badge) {
    grid-column: 2 !important;
    min-width: 0 !important;
    white-space: normal !important;
    line-height: 1.18 !important;
  }

  .notification-gate-badge {
    grid-column: 2 !important;
    justify-self: start !important;
    max-width: 100% !important;
    min-height: 22px !important;
    padding: 3px 8px !important;
    font-size: 0.66rem !important;
    line-height: 1.1 !important;
  }
}

/* Mobile calendar/settings fit fixes */
@media (max-width: 600px) {
  #calendar-block .logs-title {
    display: grid !important;
    grid-template-columns: 1fr !important;
    align-items: start !important;
    gap: 12px !important;
  }

  #calendar-block .logs-title > div {
    min-width: 0 !important;
    order: 1;
  }

  #refreshCalendarButton {
    position: static !important;
    order: 2;
    width: 100% !important;
    margin: 0 !important;
  }

  .time-window-grid {
    grid-template-columns: 1fr !important;
  }

  .time-window-grid .control-group,
  .time-window-grid input {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
}
