:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-subtle: #f8fafb;
  --ink: #17202a;
  --muted: #697586;
  --line: #dce2e8;
  --line-strong: #c4cdd6;
  --teal: #0e8f7b;
  --teal-soft: #e4f5f1;
  --red: #d9485f;
  --red-soft: #fcebef;
  --amber: #c88905;
  --amber-soft: #fff5d8;
  --blue: #2e6fbb;
  --blue-soft: #eaf2fb;
  --shadow: 0 8px 22px rgba(23, 32, 42, 0.07);
  --nav-width: 176px;
  --topbar-height: 72px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
}

button,
select {
  font: inherit;
}

button,
select,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(46, 111, 187, 0.32);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  right: 8px;
  padding: 10px 14px;
  transform: translateY(-150%);
  border-radius: 4px;
  background: var(--ink);
  color: #fff;
}

.skip-link:focus {
  transform: translateY(0);
}

.topbar {
  position: fixed;
  z-index: 20;
  inset: 0 0 auto 0;
  height: var(--topbar-height);
  display: grid;
  grid-template-columns: var(--nav-width) minmax(320px, 1fr) auto;
  direction: rtl;
  align-items: center;
  gap: 22px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.brand,
.market-strip,
.header-actions {
  direction: rtl;
}

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

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 2px solid var(--amber);
  border-radius: 6px;
  color: var(--amber);
  font-size: 20px;
  font-weight: 800;
}

.brand div {
  display: grid;
  gap: 1px;
}

.brand strong {
  font-size: 18px;
}

.brand span:last-child {
  color: var(--muted);
  font-size: 11px;
}

.market-strip {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  min-width: 0;
  font-size: 13px;
}

.market-price b {
  font-size: 18px;
}

.price-change {
  direction: ltr;
  font-weight: 700;
}

.price-change.is-up {
  color: var(--teal);
}

.price-change.is-down {
  color: var(--red);
}

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

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-weight: 600;
}

.status-dot::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  content: "";
}

.status-dot.is-online::before {
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(14, 143, 123, 0.12);
}

.status-dot.is-loading::before {
  background: var(--amber);
  animation: pulse 1.2s ease-in-out infinite;
}

.status-dot.is-offline::before {
  background: var(--red);
}

@keyframes pulse {
  50% { opacity: 0.35; }
}

.header-actions {
  display: flex;
  gap: 8px;
}

.icon-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-size: 22px;
}

.icon-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-subtle);
}

.icon-button.is-busy span {
  animation: spin 0.8s linear infinite;
}

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

.side-nav {
  position: fixed;
  z-index: 15;
  top: var(--topbar-height);
  right: 0;
  bottom: 0;
  width: var(--nav-width);
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 22px 12px;
  border-left: 1px solid var(--line);
  background: var(--surface);
}

.nav-button {
  position: relative;
  min-height: 46px;
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-align: right;
  font-weight: 600;
}

.nav-button:hover {
  background: var(--surface-subtle);
  color: var(--ink);
}

.nav-button.is-active {
  background: var(--ink);
  color: #fff;
}

.nav-icon {
  font-size: 20px;
  text-align: center;
}

.nav-count {
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--line);
  color: var(--ink);
  font-size: 11px;
}

.nav-button.is-active .nav-count {
  background: var(--amber);
  color: #fff;
}

main {
  min-height: 100vh;
  padding: calc(var(--topbar-height) + 28px) calc(var(--nav-width) + 28px) 44px 28px;
}

.app-view {
  display: none;
  max-width: 1480px;
  margin: 0 auto;
}

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

.page-heading,
.section-toolbar,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.page-heading {
  min-height: 56px;
  margin-bottom: 22px;
}

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

h1 {
  margin-bottom: 0;
  font-size: 28px;
  line-height: 1.2;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
  line-height: 1.3;
}

.eyebrow {
  margin-bottom: 3px;
  color: var(--amber);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.scan-box {
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.scan-box strong {
  direction: ltr;
  color: var(--ink);
  font-size: 20px;
}

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

.metric {
  min-height: 112px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.metric > span,
.metric small {
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  min-height: 32px;
  margin: 5px 0 2px;
  font-size: 24px;
  line-height: 1.25;
}

.metric strong.is-up {
  color: var(--teal);
}

.metric strong.is-down {
  color: var(--red);
}

.chart-section,
.decision-panel,
.levels-panel,
.data-section,
.report-panel {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.chart-section {
  margin-bottom: 16px;
  overflow: hidden;
}

.section-toolbar,
.section-heading {
  padding: 17px 20px;
}

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

.segmented-control {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-subtle);
}

.timeframe-button {
  min-width: 58px;
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.timeframe-button.is-active {
  background: var(--ink);
  color: #fff;
}

.chart-shell {
  position: relative;
  width: 100%;
  height: clamp(360px, 48vh, 570px);
  min-height: 360px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

#marketChart {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
  pointer-events: none;
}

.chart-empty[hidden] {
  display: none;
}

.chart-tooltip {
  position: absolute;
  z-index: 4;
  min-width: 172px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: rgba(23, 32, 42, 0.94);
  color: #fff;
  font-size: 11px;
  line-height: 1.7;
  pointer-events: none;
  box-shadow: var(--shadow);
}

.chart-legend {
  min-height: 42px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding: 9px 20px;
  color: var(--muted);
  font-size: 11px;
}

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

.legend-swatch {
  width: 9px;
  height: 9px;
  display: inline-block;
}

.legend-swatch.bullish {
  background: var(--teal);
}

.legend-swatch.bearish {
  background: var(--red);
}

.legend-line {
  width: 19px;
  height: 0;
  display: inline-block;
  border-top: 2px solid;
}

.legend-line.trend { border-color: var(--blue); }
.legend-line.support { border-color: var(--teal); border-top-style: dashed; }
.legend-line.resistance { border-color: var(--red); border-top-style: dashed; }
.legend-line.current { border-color: var(--amber); border-top-style: dotted; }

.overview-lower {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.75fr);
  gap: 16px;
}

.decision-panel,
.levels-panel {
  min-height: 290px;
}

.score-ring {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 5px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.decision-reason {
  margin: 0;
  padding: 0 20px 15px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.65;
}

.trade-levels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0 20px 15px;
  border: 1px solid var(--line);
}

.trade-levels[hidden] {
  display: none;
}

.trade-levels div {
  display: grid;
  gap: 3px;
  padding: 11px 13px;
  border-left: 1px solid var(--line);
}

.trade-levels div:last-child {
  border-left: 0;
}

.trade-levels span {
  color: var(--muted);
  font-size: 10px;
}

.trade-levels strong {
  direction: ltr;
  text-align: right;
}

.checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 16px;
  margin: 0;
  padding: 0 20px 20px;
  list-style: none;
}

.checklist li {
  position: relative;
  padding-right: 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.checklist li::before {
  position: absolute;
  top: 1px;
  right: 0;
  width: 14px;
  height: 14px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  content: "×";
  background: var(--red-soft);
  color: var(--red);
  font-size: 10px;
  font-weight: 800;
}

.checklist li.is-passed {
  color: var(--ink);
}

.checklist li.is-passed::before {
  content: "✓";
  background: var(--teal-soft);
  color: var(--teal);
}

.level-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 20px 10px;
  padding: 14px;
  border-right: 4px solid;
  background: var(--surface-subtle);
}

.level-row div {
  display: grid;
  gap: 3px;
}

.level-row span,
.level-row small {
  color: var(--muted);
  font-size: 11px;
}

.level-row strong {
  direction: ltr;
  font-size: 20px;
}

.support-row {
  border-color: var(--teal);
}

.resistance-row {
  border-color: var(--red);
}

.channel-position {
  padding: 13px 20px 20px;
}

.channel-labels {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 10px;
}

.channel-labels b {
  color: var(--ink);
}

.channel-track {
  position: relative;
  height: 8px;
  border-radius: 4px;
  background: var(--amber-soft);
  overflow: hidden;
}

.channel-track::before,
.channel-track::after {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 33.333%;
  content: "";
}

.channel-track::before {
  right: 0;
  background: var(--red-soft);
}

.channel-track::after {
  left: 0;
  background: var(--teal-soft);
}

.channel-track i {
  position: absolute;
  top: 50%;
  right: 50%;
  width: 14px;
  height: 14px;
  transform: translate(50%, -50%);
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 1px var(--line-strong);
}

.command-button {
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid var(--ink);
  border-radius: 5px;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

.command-button:hover {
  background: #2b3642;
}

.data-section {
  overflow: hidden;
}

.filter-control {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.filter-control select {
  min-width: 130px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
}

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

table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  text-align: right;
}

th,
td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  font-size: 12px;
}

th {
  background: var(--surface-subtle);
  color: var(--muted);
  font-weight: 700;
}

td {
  color: var(--ink);
}

.trade-status {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
}

.trade-status.open {
  background: var(--blue-soft);
  color: var(--blue);
}

.trade-status.won {
  background: var(--teal-soft);
  color: var(--teal);
}

.trade-status.lost {
  background: var(--red-soft);
  color: var(--red);
}

.empty-state {
  margin: 0;
  padding: 36px 20px;
  color: var(--muted);
  text-align: center;
}

.news-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.date-badge {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: 11px;
}

.event-list {
  border-top: 1px solid var(--line);
}

.event-item {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 14px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
}

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

.event-time {
  direction: ltr;
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
}

.event-body {
  min-width: 0;
}

.event-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.event-title-row h3 {
  margin: 0;
  font-size: 14px;
}

.importance {
  flex: 0 0 auto;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border-radius: 4px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 9px;
  font-weight: 800;
}

.importance.high {
  background: var(--red-soft);
  color: var(--red);
}

.importance.low {
  background: var(--blue-soft);
  color: var(--blue);
}

.event-body p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.event-empty {
  padding: 34px 20px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.schedule-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.schedule-band div {
  display: grid;
  gap: 3px;
  padding: 18px;
  border-left: 1px solid var(--line);
}

.schedule-band div:last-child {
  border-left: 0;
}

.schedule-band strong {
  font-size: 15px;
}

.schedule-band span {
  color: var(--muted);
  font-size: 11px;
}

.notification-state {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.notification-setup {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 16px;
  padding: 16px 18px;
  border: 1px solid var(--line-strong);
  border-right: 4px solid var(--gold);
  background: var(--surface);
}

.notification-setup.is-active {
  border-right-color: var(--teal);
}

.notification-setup > div:first-child {
  display: grid;
  gap: 4px;
}

.notification-setup strong {
  font-size: 14px;
}

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

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

.notification-test-button {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
}

.notification-setup button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

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

.report-panel {
  min-height: 260px;
  padding: 20px;
}

.report-panel.wide {
  grid-column: 1 / -1;
}

.report-panel h2 {
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
}

.report-list {
  display: grid;
  grid-template-columns: 1fr auto;
  margin: 0;
}

.report-list dt,
.report-list dd {
  margin: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.report-list dt {
  color: var(--muted);
}

.report-list dd {
  direction: ltr;
  font-weight: 800;
  text-align: left;
}

.decision-history {
  display: grid;
}

.history-row {
  display: grid;
  grid-template-columns: 82px 150px 80px 1fr;
  gap: 14px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.history-row span {
  color: var(--muted);
}

.history-row p {
  margin: 0;
}

.disclaimer {
  margin: 18px 0 0;
  padding: 13px 16px;
  border-right: 4px solid var(--amber);
  background: var(--amber-soft);
  color: #6f5514;
  font-size: 11px;
  line-height: 1.6;
}

.toast-region {
  position: fixed;
  z-index: 60;
  left: 22px;
  bottom: 22px;
  width: min(390px, calc(100vw - 44px));
  display: grid;
  gap: 9px;
}

.toast {
  padding: 13px 15px;
  border-right: 4px solid var(--blue);
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 12px 28px rgba(23, 32, 42, 0.25);
  font-size: 12px;
  line-height: 1.55;
  animation: toast-in 0.2s ease-out;
}

.toast.success {
  border-color: var(--teal);
}

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

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

@media (max-width: 1050px) {
  :root {
    --nav-width: 82px;
  }

  .topbar {
    grid-template-columns: var(--nav-width) 1fr auto;
  }

  .brand div,
  .nav-button > span:not(.nav-icon):not(.nav-count) {
    display: none;
  }

  .brand {
    justify-content: center;
  }

  .nav-button {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 0;
  }

  .nav-count {
    position: absolute;
    top: 3px;
    left: 6px;
  }

  .overview-lower {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  :root {
    --topbar-height: 64px;
  }

  .topbar {
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    padding: 0 12px;
  }

  .market-strip {
    justify-content: flex-start;
    gap: 8px;
    overflow: hidden;
  }

  .market-strip .status-dot,
  #headerUpdated {
    display: none;
  }

  .market-price b {
    font-size: 16px;
  }

  .header-actions {
    gap: 4px;
  }

  .icon-button {
    width: 36px;
    height: 36px;
  }

  .side-nav {
    top: auto;
    bottom: 0;
    width: 100%;
    height: 66px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    padding: 5px 6px calc(5px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .nav-button {
    min-height: 54px;
    grid-template-rows: 25px 16px;
    grid-template-columns: 1fr;
    gap: 0;
    justify-items: center;
    font-size: 10px;
  }

  .nav-button > span:not(.nav-count) {
    display: block;
  }

  .nav-icon {
    font-size: 19px;
  }

  .nav-count {
    top: 1px;
    left: calc(50% - 25px);
  }

  main {
    padding: calc(var(--topbar-height) + 18px) 12px 90px;
  }

  .page-heading {
    align-items: flex-start;
    margin-bottom: 16px;
  }

  h1 {
    font-size: 23px;
  }

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

  .metric {
    min-height: 101px;
    padding: 13px;
  }

  .metric strong {
    font-size: 20px;
  }

  .section-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .segmented-control {
    width: 100%;
  }

  .timeframe-button {
    min-width: 0;
    flex: 1;
  }

  .chart-shell {
    height: 390px;
    min-height: 390px;
  }

  .chart-legend {
    gap: 10px;
    padding: 9px 12px;
  }

  .checklist {
    grid-template-columns: 1fr;
  }

  .news-layout,
  .reports-grid {
    grid-template-columns: 1fr;
  }

  .report-panel.wide {
    grid-column: auto;
  }

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

  .schedule-band div:nth-child(2) {
    border-left: 0;
  }

  .schedule-band div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .history-row {
    grid-template-columns: 72px 1fr;
  }

  .history-row p {
    grid-column: 1 / -1;
  }
}

@media (max-width: 430px) {
  .notification-setup {
    grid-template-columns: 1fr;
  }

  .notification-actions,
  .notification-actions button {
    width: 100%;
  }

  .notification-actions {
    align-items: stretch;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  #headerChange {
    display: none;
  }

  .scan-box {
    display: grid;
    gap: 0;
    text-align: left;
  }

  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }

  .metric small {
    min-height: 30px;
  }

  .chart-shell {
    height: 350px;
    min-height: 350px;
  }

  .chart-legend {
    font-size: 10px;
  }

  .trade-levels {
    grid-template-columns: 1fr;
  }

  .trade-levels div {
    grid-template-columns: 1fr auto;
    border-bottom: 1px solid var(--line);
    border-left: 0;
  }

  .trade-levels div:last-child {
    border-bottom: 0;
  }

  .event-item {
    grid-template-columns: 52px 1fr;
    padding: 15px 13px;
  }

  .schedule-band {
    grid-template-columns: 1fr;
  }

  .schedule-band div {
    border-bottom: 1px solid var(--line);
    border-left: 0;
  }

  .schedule-band div:last-child {
    border-bottom: 0;
  }
}

/* Professional trading workspace */
:root {
  --bg: #eef1f4;
  --surface: #ffffff;
  --surface-subtle: #f5f7f9;
  --ink: #161c24;
  --muted: #667384;
  --line: #d7dde4;
  --line-strong: #b9c3ce;
  --teal: #087f6b;
  --teal-soft: #e5f4f0;
  --red: #c9364f;
  --red-soft: #fae9ed;
  --amber: #a96f00;
  --amber-soft: #fff3cf;
  --blue: #2866ad;
  --blue-soft: #e8f0fa;
  --shadow: 0 2px 8px rgba(22, 28, 36, 0.06);
  --nav-width: 208px;
  --topbar-height: 68px;
}

[hidden] {
  display: none !important;
}

html {
  letter-spacing: 0;
}

body {
  color-scheme: light;
}

button,
select {
  min-height: 44px;
}

.topbar {
  grid-template-columns: var(--nav-width) minmax(360px, 1fr) auto;
  gap: 18px;
  padding: 0 20px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 1px 0 rgba(22, 28, 36, 0.04);
}

.brand-mark {
  width: 40px;
  height: 40px;
  border: 1px solid #2d3540;
  background: var(--ink);
  color: #f1c55c;
  font-size: 19px;
}

.brand-symbol {
  width: 44px;
  height: 44px;
  display: block;
  flex: 0 0 auto;
  border: 1px solid #2d3540;
  border-radius: 6px;
  object-fit: cover;
}

.brand-copy {
  min-width: 0;
}

.brand-copy strong,
.brand-copy span {
  white-space: nowrap;
}

.brand strong {
  font-size: 17px;
}

.market-strip {
  justify-self: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-subtle);
}

.market-price,
.price-change,
.metric strong,
.event-time,
.scan-box strong,
.level-row strong,
td[dir="ltr"],
.report-list dd {
  font-variant-numeric: tabular-nums;
}

.session-badge,
.chart-state-badge {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.session-badge.is-active,
.chart-state-badge.is-active {
  border-color: #9fd4c9;
  background: var(--teal-soft);
  color: var(--teal);
}

.session-badge.is-paused,
.session-badge.is-closed,
.chart-state-badge.is-paused,
.chart-state-badge.is-closed {
  border-color: #e4c875;
  background: var(--amber-soft);
  color: #785000;
}

.session-badge.is-delayed,
.chart-state-badge.is-delayed {
  border-color: #e2a7b2;
  background: var(--red-soft);
  color: var(--red);
}

.status-dot.is-paused::before {
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(169, 111, 0, 0.12);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-subtle);
}

.icon-button span {
  font-size: 19px;
  line-height: 1;
}

.icon-button.is-busy span {
  animation: spin 0.8s linear infinite;
}

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

.side-nav {
  gap: 3px;
  padding: 18px 12px;
  background: #fbfcfd;
}

.nav-button {
  min-height: 50px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 13px;
}

.nav-button:hover {
  border-color: var(--line);
  background: #fff;
}

.nav-button.is-active {
  border-color: var(--line);
  border-right: 3px solid var(--amber);
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(22, 28, 36, 0.05);
}

.nav-button.is-active .nav-count {
  background: var(--ink);
  color: #fff;
}

main {
  padding: calc(var(--topbar-height) + 24px) calc(var(--nav-width) + 24px) 48px 24px;
}

.app-view {
  max-width: 1540px;
}

.page-heading {
  min-height: 52px;
  margin-bottom: 14px;
}

h1 {
  font-size: 25px;
}

h2 {
  font-size: 17px;
}

.eyebrow {
  margin-bottom: 4px;
  color: #886000;
  font-size: 10px;
}

.scan-box {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
}

.market-notice {
  min-height: 54px;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-right: 4px solid var(--blue);
  background: var(--surface);
}

.market-notice-mark {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--blue);
}

.market-notice > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.market-notice strong {
  font-size: 12px;
}

.market-notice span:not(.market-notice-mark) {
  color: var(--muted);
  font-size: 11px;
}

.market-notice button {
  min-width: 72px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
}

.market-notice.is-active {
  border-right-color: var(--teal);
}

.market-notice.is-active .market-notice-mark {
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(8, 127, 107, 0.1);
}

.market-notice.is-paused,
.market-notice.is-closed {
  border-right-color: var(--amber);
  background: #fffdf7;
}

.market-notice.is-paused .market-notice-mark,
.market-notice.is-closed .market-notice-mark {
  background: var(--amber);
}

.market-notice.is-delayed {
  border-right-color: var(--red);
  background: #fffafb;
}

.market-notice.is-delayed .market-notice-mark {
  background: var(--red);
}

.metric-grid {
  gap: 10px;
  margin-bottom: 14px;
}

.metric {
  position: relative;
  min-height: 98px;
  justify-content: flex-start;
  padding: 14px 16px;
  overflow: hidden;
  box-shadow: none;
}

.metric::before {
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  content: "";
  background: var(--line-strong);
}

.metric-price::before { background: var(--amber); }
.metric-day::before { background: var(--blue); }
.metric-trend::before { background: var(--teal); }
.metric-decision::before { background: var(--red); }

.metric strong {
  margin-top: 7px;
  font-size: 22px;
}

.chart-section,
.decision-panel,
.levels-panel,
.data-section,
.report-panel {
  border-radius: 6px;
  box-shadow: none;
}

.chart-section {
  margin-bottom: 14px;
}

.section-toolbar,
.section-heading {
  padding: 15px 18px;
}

.chart-section .section-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
}

.chart-state-badge {
  justify-self: end;
}

.segmented-control {
  min-height: 42px;
  align-items: center;
  padding: 3px;
}

.timeframe-button {
  height: 34px;
  min-height: 34px;
}

.chart-shell {
  height: clamp(410px, 52vh, 610px);
  min-height: 410px;
  background: #fcfdfe;
}

.chart-legend {
  min-height: 46px;
  gap: 18px;
}

.overview-lower {
  grid-template-columns: minmax(0, 1.55fr) minmax(310px, 0.75fr);
  gap: 14px;
}

.decision-panel,
.levels-panel {
  min-height: 276px;
}

.score-ring {
  width: 56px;
  height: 56px;
  border-width: 4px;
}

.checklist li {
  min-height: 24px;
  display: flex;
  align-items: center;
}

.level-row {
  border-right-width: 3px;
  border-radius: 3px;
}

.command-button {
  min-height: 44px;
}

.filter-control select {
  height: 44px;
}

th,
td {
  height: 46px;
}

.event-item {
  grid-template-columns: 70px 1fr;
  gap: 16px;
}

.event-time {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-subtle);
  font-size: 15px;
}

.event-data {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.event-data span {
  min-height: 25px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: 10px;
}

.event-data b {
  direction: ltr;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.report-panel {
  min-height: 230px;
}

.history-row {
  min-height: 50px;
}

@media (max-width: 1050px) {
  :root {
    --nav-width: 84px;
  }

  .topbar {
    grid-template-columns: var(--nav-width) minmax(0, 1fr) auto;
  }

  .nav-button.is-active {
    border-right-width: 1px;
    border-bottom: 3px solid var(--amber);
  }
}

@media (max-width: 900px) {
  :root {
    --topbar-height: 62px;
  }

  .topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    padding: 0 10px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand-symbol {
    width: 40px;
    height: 40px;
  }

  .market-strip {
    justify-self: stretch;
    justify-content: flex-start;
    min-height: 40px;
    padding: 0 10px;
  }

  .market-strip .status-dot,
  .market-strip #headerUpdated,
  .market-strip #headerChange {
    display: none;
  }

  .session-badge {
    order: 2;
    margin-right: auto;
  }

  .header-actions {
    gap: 4px;
  }

  .icon-button {
    width: 42px;
    height: 42px;
  }

  .side-nav {
    height: 72px;
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.98);
  }

  .nav-button {
    min-height: 60px;
    border: 0;
    border-radius: 4px;
  }

  .nav-button.is-active {
    border: 0;
    border-top: 3px solid var(--amber);
    background: var(--surface-subtle);
    box-shadow: none;
  }

  main {
    padding: calc(var(--topbar-height) + 14px) 10px 92px;
  }

  .page-heading {
    min-height: 48px;
  }

  h1 {
    font-size: 22px;
  }

  .scan-box {
    min-width: 84px;
    justify-content: center;
    padding: 5px 9px;
  }

  .market-notice {
    grid-template-columns: 9px minmax(0, 1fr) auto;
    gap: 9px;
    padding: 10px;
  }

  .market-notice span:not(.market-notice-mark) {
    line-height: 1.45;
  }

  .metric-grid {
    gap: 8px;
  }

  .metric {
    min-height: 96px;
    padding: 13px;
  }

  .metric strong {
    font-size: 19px;
  }

  .chart-section .section-toolbar {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .chart-section .section-toolbar > div:first-child {
    min-width: 0;
  }

  .chart-state-badge {
    align-self: start;
  }

  .segmented-control {
    grid-column: 1 / -1;
    width: 100%;
  }

  .chart-shell {
    height: 340px;
    min-height: 340px;
  }

  .chart-legend {
    max-height: 76px;
    overflow: auto;
  }

  .event-item {
    grid-template-columns: 62px 1fr;
  }

  .table-wrap {
    overflow: visible;
    padding: 10px;
    background: var(--surface-subtle);
  }

  table,
  tbody,
  tr,
  td {
    display: block;
    min-width: 0;
    width: 100%;
  }

  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  tbody {
    display: grid;
    gap: 10px;
  }

  tbody tr {
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
  }

  tbody td {
    min-height: 38px;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    white-space: normal;
  }

  tbody td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
  }

  .history-row {
    padding: 12px 0;
  }
}

@media (max-width: 430px) {
  .header-actions #installButton {
    display: none !important;
  }

  .market-strip {
    border: 0;
    background: transparent;
  }

  .session-badge {
    max-width: 88px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .market-notice {
    grid-template-columns: 9px minmax(0, 1fr);
  }

  .market-notice button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .chart-shell {
    height: 320px;
    min-height: 320px;
  }

  .chart-legend {
    gap: 9px;
  }

  .event-title-row {
    display: grid;
  }

  .importance {
    justify-self: start;
  }
}

.data-cadence {
  min-height: 54px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: -2px 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  overflow: hidden;
}

.data-cadence > div {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  column-gap: 8px;
  padding: 8px 13px;
  border-left: 1px solid var(--line);
}

.data-cadence > div:last-child {
  border-left: 0;
}

.data-cadence span,
.data-cadence strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-cadence span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.data-cadence strong {
  grid-column: 2;
  color: var(--ink);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.cadence-indicator {
  width: 7px;
  height: 7px;
  grid-row: 1 / 3;
  align-self: center;
  border-radius: 50%;
  background: var(--blue);
}

.cadence-indicator.is-live {
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(8, 127, 107, 0.1);
}

#marketChart {
  touch-action: pan-y;
}

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

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

  .data-cadence > div:nth-child(3) {
    border-left: 0;
  }

  .data-cadence > div:nth-child(n + 4) {
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 900px) {
  .side-nav .nav-button > span:not(.nav-icon):not(.nav-count) {
    display: block;
    font-size: 10px;
  }

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

  .data-cadence > div:nth-child(3) {
    border-left: 0;
  }

  .data-cadence > div:nth-child(n + 4) {
    border-top: 1px solid var(--line);
  }

  .chart-shell {
    height: clamp(340px, 52vh, 470px);
    min-height: 340px;
  }
}

@media (max-width: 560px) {
  .data-cadence {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(138px, 1fr);
    grid-template-columns: none;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .data-cadence::-webkit-scrollbar {
    display: none;
  }

  .data-cadence > div,
  .data-cadence > div:nth-child(n + 4) {
    border-top: 0;
    border-left: 1px solid var(--line);
    scroll-snap-align: start;
  }

  .data-cadence > div:last-child {
    border-left: 0;
  }

  .chart-shell {
    height: 330px;
    min-height: 330px;
  }
}

@media (max-height: 620px) and (min-width: 700px) {
  .chart-shell {
    height: 330px;
    min-height: 330px;
  }
}

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

/* Authentication, personal account and localization */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(310px, 0.82fr) minmax(380px, 1.18fr);
  background: #f1f3f5;
}

.auth-brand-panel {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
  padding: clamp(32px, 6vw, 84px);
  background: #151b22;
  color: #fff;
}

.auth-logo {
  width: min(360px, 86%);
  height: auto;
  object-fit: contain;
  object-position: center;
}

.auth-brand-copy {
  max-width: 520px;
}

.auth-brand-copy h1 {
  margin: 0 0 12px;
  color: #fff;
  font-size: clamp(30px, 4vw, 52px);
}

.auth-brand-copy p:last-child {
  max-width: 470px;
  margin: 0;
  color: #c7cdd4;
  font-size: 15px;
  line-height: 1.7;
}

.auth-language {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #c7cdd4;
  font-size: 12px;
  font-weight: 700;
}

.auth-language select,
.header-language select,
.preference-row select {
  height: 42px;
  min-height: 42px;
  padding: 0 34px 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.auth-form-panel {
  width: min(460px, calc(100% - 40px));
  align-self: center;
  justify-self: center;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 16px 42px rgba(22, 28, 36, 0.1);
}

.auth-form-heading h2 {
  margin: 3px 0 8px;
  font-size: 25px;
}

.auth-form-heading > p:last-child {
  min-height: 42px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.auth-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  margin: 24px 0 18px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-subtle);
}

.auth-mode button {
  min-height: 40px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
}

.auth-mode button.is-active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(22, 28, 36, 0.1);
}

.auth-form {
  display: grid;
  gap: 15px;
}

.auth-form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.auth-form input,
.profile-form input {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.auth-form input:focus,
.profile-form input:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(40, 102, 173, 0.13);
}

.auth-form small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.auth-primary-button,
.auth-link-button,
.secondary-command,
.danger-command {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 750;
}

.auth-primary-button {
  border: 1px solid #151b22;
  background: #151b22;
  color: #fff;
}

.auth-primary-button:hover {
  background: #2b333d;
}

.auth-link-button {
  border: 0;
  background: transparent;
  color: var(--blue);
}

.auth-status {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-subtle);
  font-size: 12px;
  line-height: 1.5;
}

.auth-status.is-error {
  border-color: #e7b1ba;
  background: var(--red-soft);
  color: #8e2335;
}

.auth-status.is-success {
  border-color: #acd9d0;
  background: var(--teal-soft);
  color: #076653;
}

.auth-form.is-busy {
  opacity: 0.72;
}

.header-language select {
  width: 58px;
  height: 40px;
  min-height: 40px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 800;
}

.account-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #d6b85b;
  border-radius: 50%;
  background: #fff8dd;
  color: #725100;
  cursor: pointer;
  font-weight: 800;
}

.account-identity {
  min-height: 92px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  background: #fff;
}

.profile-avatar {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid #d6b85b;
  border-radius: 50%;
  background: #fff8dd;
  color: #725100;
  font-size: 22px;
  font-weight: 800;
}

.account-identity > div:last-child {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.account-identity strong {
  font-size: 18px;
}

.account-identity span {
  direction: ltr;
  color: var(--muted);
  overflow-wrap: anywhere;
  text-align: start;
}

.account-badge {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
}

.account-badge.is-verified {
  border-color: #9fd4c9;
  background: var(--teal-soft);
  color: var(--teal);
}

.account-badge.is-pending {
  border-color: #e4c875;
  background: var(--amber-soft);
  color: #785000;
}

.account-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 14px;
}

.account-panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  background: #fff;
}

.account-panel .section-heading {
  padding: 0 0 16px;
}

.profile-form {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.profile-form > label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.profile-form > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.account-details {
  display: grid;
  gap: 0;
  margin: 0 0 18px;
}

.account-details > div,
.preference-row {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--line);
}

.account-details dt,
.preference-row > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.account-details dd {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  text-align: end;
}

.secondary-command {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
}

.danger-command {
  width: 100%;
  margin-top: 18px;
  border: 1px solid #e2a7b2;
  background: var(--red-soft);
  color: #8e2335;
}

html[dir="ltr"] .topbar,
html[dir="ltr"] .brand,
html[dir="ltr"] .market-strip,
html[dir="ltr"] .header-actions {
  direction: ltr;
}

html[dir="ltr"] .side-nav {
  right: auto;
  left: 0;
  border-right: 1px solid var(--line);
  border-left: 0;
}

html[dir="ltr"] .nav-button {
  text-align: left;
}

html[dir="ltr"] main {
  padding-right: 24px;
  padding-left: calc(var(--nav-width) + 24px);
}

html[dir="ltr"] .nav-button.is-active {
  border-right: 1px solid var(--line);
  border-left: 3px solid var(--amber);
}

html[dir="ltr"] .market-notice,
html[dir="ltr"] .level-row {
  border-right-width: 1px;
  border-left-width: 4px;
}

html[dir="ltr"] .channel-marker,
html[dir="ltr"] #channelMarker {
  transform: scaleX(-1);
}

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

  .auth-brand-panel {
    min-height: auto;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 18px;
  }

  .auth-logo {
    width: 90px;
  }

  .auth-brand-copy h1 {
    margin: 0;
    font-size: 23px;
  }

  .auth-brand-copy p,
  .auth-brand-copy .eyebrow {
    display: none;
  }

  .auth-form-panel {
    margin: 28px auto;
  }

  .side-nav {
    grid-template-columns: repeat(5, 1fr);
  }

  html[dir="ltr"] .side-nav {
    left: 0;
    right: 0;
    border-right: 0;
  }

  html[dir="ltr"] main {
    padding: calc(var(--topbar-height) + 14px) 10px 92px;
  }

  html[dir="ltr"] .nav-button.is-active {
    border: 0;
    border-top: 3px solid var(--amber);
  }

  .header-language {
    display: none;
  }

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

@media (max-width: 560px) {
  .auth-brand-panel {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .auth-language {
    grid-column: 1 / -1;
    justify-content: space-between;
  }

  .auth-form-panel {
    width: calc(100% - 24px);
    margin: 16px auto 28px;
    padding: 22px 18px;
  }

  .auth-form-heading h2 {
    font-size: 21px;
  }

  .brand-copy {
    display: none !important;
  }

  .account-button,
  .icon-button {
    width: 38px;
    height: 38px;
  }

  .profile-form > div {
    grid-template-columns: 1fr;
  }

  .profile-form .command-button {
    width: 100%;
  }

  .account-details > div,
  .preference-row {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: 9px 0;
  }

  .preference-row select,
  .preference-row button {
    width: 100%;
  }
}
