:root {
  --signal-weight: 900;
  color-scheme: dark;
  --bg: #05070a;
  --panel: #091018;
  --panel-2: #0d1823;
  --panel-3: #111f2c;
  --line: rgba(255, 176, 0, .22);
  --hairline: rgba(148, 169, 188, .14);
  --amber: #ffb000;
  --green: #00d084;
  --red: #ff4d5f;
  --blue: #38a8ff;
  --text: #f4f7fa;
  --muted: #9aa7b4;
  --shadow: 0 14px 36px rgba(0, 0, 0, .28);
}

:root[data-color-scheme="teal"] {
  --panel: #07151a;
  --panel-2: #0a1c22;
  --panel-3: #10272d;
  --line: rgba(32, 211, 183, .3);
  --amber: #20d3b7;
  --blue: #58bfff;
}

:root[data-color-scheme="blue"] {
  --panel: #08131f;
  --panel-2: #0c1b2a;
  --panel-3: #12263a;
  --line: rgba(74, 168, 255, .32);
  --amber: #4aa8ff;
  --blue: #8fd0ff;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 "Aptos", "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
}

h1, h2, h3,
button,
.mini-table th,
.brand-mark {
  font-family: "Bahnschrift", "Aptos Display", "Segoe UI Variable Display", "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.app-shell {
  width: min(1880px, calc(100vw - 10px));
  max-width: 100vw;
  margin: 0 auto;
  padding: 8px 10px 20px;
}

.topbar,
.market-read,
.panel,
.upload-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 17, 28, .92);
}

.topbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 9px 11px;
  box-shadow: var(--shadow);
}

.brand-lockup { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 1px solid rgba(255, 176, 0, .55);
  border-radius: 6px;
  background: var(--amber);
  color: #07090c;
  font-size: 15px;
  font-weight: 950;
}
.brand-subline { display: block; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.top-meta { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }

.source-freshness {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.source-date {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(0, 208, 132, .34);
  border-radius: 999px;
  background: rgba(0, 208, 132, .08);
  padding: 4px 8px;
  color: var(--green);
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.source-date-wait { border-color: rgba(255, 176, 0, .35); background: rgba(255, 176, 0, .08); color: var(--amber); }

.top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  max-width: 100%;
}

.top-actions button { min-height: 34px; padding: 6px 10px; border-radius: 6px; font-size: 12px; }
.top-actions .secondary-action { background: var(--panel-3); color: var(--text); }

.sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}
.sync-badge::before { width: 7px; height: 7px; border-radius: 50%; background: currentColor; content: ""; }
.sync-live { border-color: rgba(0, 208, 132, .42); background: rgba(0, 208, 132, .08); color: var(--green); }
.sync-loading { border-color: rgba(56, 168, 255, .42); background: rgba(56, 168, 255, .08); color: var(--blue); }
.sync-cached { border-color: rgba(255, 176, 0, .38); background: rgba(255, 176, 0, .08); color: var(--amber); }
.sync-warning { border-color: rgba(255, 77, 95, .38); background: rgba(255, 77, 95, .08); color: var(--red); }

.top-status {
  display: inline-flex;
  align-items: center;
  margin: 6px 2px 0;
  border: 1px solid rgba(255, 176, 0, .35);
  border-radius: 999px;
  background: rgba(255, 176, 0, .12);
  color: var(--amber);
  font-size: 12px;
  font-weight: 800;
  padding: 5px 9px;
}

.top-status.kite-ok {
  border-color: rgba(0, 208, 132, .55);
  background: rgba(0, 208, 132, .12);
  color: var(--green);
}

.top-status.kite-missing {
  border-color: rgba(255, 77, 95, .5);
  background: rgba(255, 77, 95, .1);
  color: var(--red);
}

.delivery-alert {
  position: fixed;
  top: 74px;
  left: 50%;
  z-index: 20;
  width: min(520px, calc(100vw - 24px));
  transform: translateX(-50%);
  border: 1px solid rgba(255, 77, 95, .62);
  border-radius: 10px;
  background: rgba(20, 5, 10, .96);
  box-shadow: 0 18px 45px rgba(0, 0, 0, .42);
  color: var(--text);
  padding: 12px;
}

.delivery-alert strong {
  display: block;
  color: var(--red);
  font-size: 14px;
  margin-bottom: 4px;
}

.delivery-alert span {
  display: block;
  color: var(--text);
  font-size: 13px;
  margin-right: 64px;
}

.delivery-alert button {
  position: absolute;
  right: 10px;
  top: 50%;
  min-height: 30px;
  padding: 5px 12px;
  transform: translateY(-50%);
}

.topbar p,
.market-read small,
.card small,
.panel-head span {
  margin: 0;
  color: var(--amber);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

h1, h2 { margin: 0; letter-spacing: 0; }
h1 { font-size: 19px; color: var(--amber); }
h2 { font-size: 16px; }

button {
  border: 1px solid rgba(255, 176, 0, .45);
  border-radius: 6px;
  background: var(--amber);
  color: #05080d;
  cursor: pointer;
  font-weight: 900;
  min-height: 36px;
  padding: 7px 11px;
  transition: transform .12s ease, filter .12s ease, box-shadow .12s ease, border-color .12s ease;
  user-select: none;
}

button:hover:not(:disabled) {
  filter: brightness(1.12);
  box-shadow: 0 0 0 3px rgba(255, 176, 0, .16);
  transform: translateY(-1px);
}

button:active:not(:disabled) {
  filter: brightness(.96);
  transform: translateY(1px) scale(.985);
}

button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  filter: saturate(.55) brightness(.75);
  opacity: .72;
}

button.kite-active-btn {
  border-color: rgba(0, 208, 132, .55);
  background: var(--green);
  color: #04100b;
}

button.compact-toggle {
  min-width: 72px;
  background: #0b1724;
  color: var(--amber);
}

.option-alert-action.has-alert {
  border-color: rgba(255, 176, 0, .7);
  background: rgba(255, 176, 0, .16);
  color: var(--amber);
  animation: alertPulse 1.8s ease-in-out infinite;
}

@keyframes alertPulse {
  50% { box-shadow: 0 0 0 3px rgba(255, 176, 0, .12); }
}

.summary-drawer[hidden] {
  display: none;
}

.more-nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  margin-top: 9px;
}

.more-nav button { min-height: 38px; background: var(--panel-3); color: var(--text); }

.manual-load {
  display: grid;
  gap: 10px;
  align-content: center;
  min-height: 220px;
  border: 1px dashed rgba(255, 176, 0, .3);
  border-radius: 8px;
  color: var(--muted);
  padding: 24px;
  text-align: center;
}

.manual-load strong {
  color: var(--amber);
  font-size: 18px;
}

.manual-load button {
  justify-self: center;
}

button.refreshing {
  animation: refreshPulse .45s ease-in-out infinite alternate;
}

button.refreshed {
  background: var(--green);
  color: #04100b;
  box-shadow: 0 0 0 3px rgba(0, 208, 132, .18);
}

@keyframes refreshPulse {
  from { filter: brightness(1); }
  to { filter: brightness(1.55); }
}

.market-read {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding: 14px;
  background: var(--panel-2);
}

.market-read strong {
  color: var(--green);
  font-size: 24px;
}

.market-read span,
.upload-panel p {
  color: var(--muted);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.timing-note,
.health-panel {
  border: 1px solid rgba(56, 168, 255, .22);
  border-radius: 8px;
  background: rgba(7, 17, 28, .74);
  margin: 8px 0;
  padding: 10px;
}

.timing-note {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
}

.timing-note strong,
.health-title strong {
  color: var(--amber);
  font-size: 13px;
  text-transform: uppercase;
}

.timing-note span,
.health-title span,
.health-card span {
  color: var(--muted);
  font-size: 12px;
}

.health-title {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 8px;
}

.health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.health-card {
  border: 1px solid rgba(154, 167, 180, .2);
  border-radius: 7px;
  background: rgba(12, 27, 42, .72);
  display: grid;
  gap: 3px;
  min-height: 92px;
  padding: 9px;
}

.health-card small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.health-card strong { font-size: 18px; }
.health-good strong { color: var(--green); }
.health-watch strong { color: var(--amber); }
.health-bad strong { color: var(--red); }

.card {
  min-height: 86px;
  padding: 12px;
  border: 1px solid rgba(56, 168, 255, .2);
  border-radius: 8px;
  background: rgba(7, 17, 28, .84);
}

.card strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
}

.tone-watch strong { color: var(--amber); }
.tone-neutral strong { color: var(--blue); }
.tone-good strong { color: var(--green); }
.tone-bad strong { color: var(--red); }

.tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 210px));
  justify-content: start;
  gap: 6px;
  overflow-x: auto;
  position: sticky;
  top: 0;
  z-index: 30;
  margin: 7px 0;
  padding: 7px 3px;
  background: rgba(5, 7, 10, .97);
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}

.tabs button {
  width: 100%;
  min-height: 34px;
  padding: 6px 10px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 12px;
}

.decision-workspace { display: grid; gap: 10px; }

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

.workspace-toolbar p { max-width: 900px; margin: 0; color: var(--muted); }
.workspace-toolbar > div { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.workspace-universe { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 800; }
.workspace-universe select { min-height: 34px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-2); color: var(--text); padding: 5px 8px; }

.workspace-filter {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(88px, 1fr));
  justify-self: start;
  border: 1px solid var(--hairline);
  border-radius: 7px;
  overflow: hidden;
}

.workspace-filter button { min-height: 34px; border: 0; border-radius: 0; background: var(--panel-2); color: var(--muted); }
.workspace-filter button + button { border-left: 1px solid var(--hairline); }
.workspace-filter button.active { background: var(--amber); color: #05080d; }

.decision-list { overflow: hidden; border: 1px solid var(--hairline); border-radius: 8px; }
.decision-list-head,
.decision-row {
  display: grid;
  grid-template-columns: 36px 145px minmax(190px, 1fr) 120px 64px 70px;
  gap: 9px;
  align-items: center;
}

.decision-list-head {
  min-height: 38px;
  background: var(--amber);
  color: #05080d;
  padding: 7px 10px;
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.decision-row { min-height: 66px; padding: 9px 10px; border-top: 1px solid var(--hairline); background: rgba(9, 16, 24, .78); }
.decision-row:nth-child(odd) { background: rgba(13, 24, 35, .68); }
.decision-rank { color: var(--muted); font-weight: 800; }
.decision-row .signal-pill { display: inline-flex; font-style: normal; }
.decision-stock { min-width: 0; }
.decision-price { display: grid; gap: 2px; }
.decision-price small { font-size: 10px; font-weight: 800; }
.decision-expand { min-height: 30px; padding: 4px 7px; background: var(--panel-3); color: var(--text); font-size: 10px; }
.decision-reason { grid-column: 3 / 7; margin: -2px 0 0; color: var(--muted); font-size: 11px; line-height: 1.35; }
.decision-details { grid-column: 2 / 7; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; padding-top: 3px; }
.decision-details[hidden] { display: none; }
.decision-details span { min-width: 0; border-left: 2px solid var(--line); padding-left: 7px; }
.decision-details small { display: block; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.decision-details strong { display: block; overflow-wrap: anywhere; font-size: 11px; }

.tabs button.active {
  background: var(--amber);
  color: #05080d;
}

.tabs button.settings-tab {
  margin-left: auto;
  border-color: rgba(56, 168, 255, .5);
  color: var(--blue);
}

.tabs button.settings-tab.active {
  color: #05080d;
}

.settings-page {
  display: grid;
  gap: 14px;
}

.settings-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}

.settings-intro small,
.settings-device-note {
  color: var(--amber);
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 800;
}

.settings-intro h3 {
  margin: 3px 0 4px;
  font-size: 19px;
}

.settings-intro p,
.settings-device-note {
  margin: 0;
  color: var(--muted);
  text-transform: none;
  line-height: 1.45;
}

.breeze-settings { display: grid; gap: 10px; }
.breeze-settings .settings-device-note { color: var(--muted); }
.breeze-controls {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto auto;
  gap: 7px;
}
.breeze-controls input {
  min-width: 0;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #050a10;
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
}
.breeze-message { margin: 0; color: var(--muted); font-size: 12px; }
.breeze-compare-list { display: grid; border: 1px solid var(--hairline); }
.breeze-compare-list > strong { padding: 7px 9px; color: var(--amber); font-size: 11px; text-transform: uppercase; }
.breeze-compare-list span { display: grid; grid-template-columns: minmax(85px, 1fr) repeat(3, minmax(90px, 1fr)); gap: 8px; padding: 7px 9px; border-top: 1px solid var(--hairline); font-size: 12px; }
.breeze-compare-list b { color: var(--green); }
.breeze-compare-list i { color: var(--muted); font-style: normal; }
.breeze-compare-list .positive { color: var(--green); }
.breeze-compare-list .warning { color: var(--amber); }

.settings-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  flex: 0 0 auto;
}

.settings-presets button {
  min-height: 34px;
  padding: 7px 11px;
}

.colour-scheme-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding-top: 9px;
}

.colour-scheme-option {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 3px 10px;
  min-height: 74px;
  padding: 10px;
  border-color: var(--hairline);
  background: var(--panel-2);
  color: var(--text);
  text-align: left;
}

.colour-scheme-option.active { border-color: var(--amber); box-shadow: inset 0 0 0 1px var(--amber); }
.colour-scheme-option strong { font-size: 13px; }
.colour-scheme-option small { grid-column: 2; color: var(--muted); font-family: "Aptos", "Segoe UI", sans-serif; font-weight: 600; line-height: 1.25; }
.scheme-preview { grid-row: 1 / span 2; display: grid; grid-template-columns: repeat(3, 1fr); width: 54px; height: 42px; overflow: hidden; border: 1px solid var(--hairline); border-radius: 5px; background: #07111c; }
.scheme-preview i { display: block; }
.scheme-amber i:nth-child(1) { background: #ffb000; }
.scheme-teal i:nth-child(1) { background: #20d3b7; }
.scheme-blue i:nth-child(1) { background: #4aa8ff; }
.scheme-preview i:nth-child(2) { background: #00d084; }
.scheme-preview i:nth-child(3) { background: #ff4d5f; }

.settings-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px 7px;
  border-bottom: 1px solid var(--line);
}

.settings-group-head h3 { margin: 0; font-size: 14px; color: var(--amber); }
.settings-group-head span { color: var(--muted); font-size: 11px; }
.tab-setting-list { display: grid; }

.tab-setting-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 72px;
  padding: 9px 4px;
  border-bottom: 1px solid var(--hairline);
  background: rgba(7, 17, 28, .46);
}

.tab-order-number {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #152433;
  color: var(--amber);
  font-weight: 900;
}

.tab-setting-copy { min-width: 0; }
.tab-setting-copy strong { display: block; color: var(--text); font-size: 13px; }
.tab-setting-copy small { display: block; margin-top: 3px; color: var(--muted); line-height: 1.3; }
.tab-setting-copy .tab-made-date { color: var(--amber); font-size: 10px; }

.tab-order-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.tab-order-actions button {
  min-height: 31px;
  min-width: 48px;
  padding: 5px 8px;
}

.tab-order-actions button:disabled { opacity: .35; cursor: not-allowed; }

.tab-visibility-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 100px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.tab-setting-row input {
  appearance: none;
  width: 42px;
  height: 22px;
  margin: 0;
  border: 1px solid #44505d;
  border-radius: 12px;
  background: #202934;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease;
}

.tab-setting-row input::after {
  content: "";
  display: block;
  width: 16px;
  height: 16px;
  margin: 2px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform .16s ease, background .16s ease;
}

.tab-setting-row input:checked { background: var(--green); border-color: var(--green); }
.tab-setting-row input:checked::after { transform: translateX(20px); background: #03130d; }
.tab-setting-row input:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.panel,
.upload-panel {
  padding: 10px;
  margin-bottom: 10px;
  max-width: 100%;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--hairline);
}

.panel-head small { display: block; margin-bottom: 1px; color: var(--muted); font-size: 9px; font-weight: 900; text-transform: uppercase; }

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

.segment-filter-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.segment-filter-wrap[hidden] { display: none; }

.segment-filter-wrap select {
  min-height: 32px;
  padding: 5px 26px 5px 8px;
  border: 1px solid rgba(255, 176, 0, .55);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 11px;
  text-transform: none;
}

.content-empty {
  min-height: 180px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed rgba(255, 176, 0, .22);
  border-radius: 8px;
}

.content-body {
  min-height: 0;
  color: var(--text);
}

.desk-section {
  margin-bottom: 14px;
  border: 1px solid rgba(255, 176, 0, .18);
  border-radius: 10px;
  background: rgba(5, 12, 20, .72);
  overflow: hidden;
}

.desk-section > h3 {
  margin: 0;
  padding: 10px 12px;
  color: var(--amber);
  background: rgba(13, 20, 28, .92);
  border-bottom: 1px solid rgba(255, 176, 0, .18);
  font-size: 15px;
  line-height: 1.2;
}

.desk-section .mini-note,
.desk-section .table-scroll,
.desk-section .market-summary,
.desk-section .guide-box {
  margin-left: 10px;
  margin-right: 10px;
}

input[type="file"] {
  width: 100%;
  margin: 8px 0;
  padding: 10px;
  border: 1px solid rgba(255, 176, 0, .24);
  border-radius: 8px;
  background: #05080d;
  color: var(--text);
}

.upload-file-choice {
  display: grid;
  grid-template-columns: auto minmax(150px, 1fr);
  gap: 7px;
  align-items: center;
  min-width: 0;
}

.upload-native-input {
  position: absolute;
  width: 1px !important;
  height: 1px;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 0;
  pointer-events: none;
}

.upload-picker-btn {
  white-space: nowrap;
}

.selected-file-name {
  min-width: 0;
  padding: 10px 11px;
  overflow: hidden;
  border: 1px solid rgba(154, 167, 180, .28);
  border-radius: 7px;
  color: var(--muted);
  background: #05080d;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-file-name.is-selected {
  border-color: rgba(56, 168, 255, .55);
  color: #7cc7ff;
}

.selected-file-name.is-uploaded {
  border-color: rgba(0, 208, 132, .5);
  color: var(--green);
}

.upload-date {
  display: grid;
  gap: 6px;
  width: min(260px, 100%);
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.upload-date input {
  min-height: 40px;
  border: 1px solid rgba(255, 176, 0, .24);
  border-radius: 8px;
  background: #05080d;
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
}

.fno-upload {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(56, 168, 255, .22);
  border-radius: 8px;
  background: rgba(7, 17, 28, .7);
}

.fno-upload-row {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(220px, 1fr) auto auto;
  gap: 8px;
  align-items: end;
}

.macro-input-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(105px, 1fr)) minmax(170px, 1.3fr) auto auto;
  gap: 8px;
  align-items: end;
}

.gift-card strong { color: var(--green); }
.gift-stale strong { color: var(--amber); }

.macro-input-row label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.macro-input-row input {
  min-height: 40px;
  border: 1px solid rgba(255, 176, 0, .24);
  border-radius: 8px;
  background: #05080d;
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
}

.optional-upload {
  margin-bottom: 12px;
  padding: 10px;
  border: 1px dashed rgba(154, 167, 180, .34);
  border-radius: 8px;
  background: rgba(7, 17, 28, .45);
}

.optional-upload summary {
  cursor: pointer;
  color: var(--amber);
  font-weight: 900;
}

.upload-success-note {
  margin: 2px 0 0;
  padding: 9px 10px;
  border: 1px solid rgba(0, 208, 132, .35);
  border-radius: 8px;
  color: var(--green);
  background: rgba(0, 208, 132, .08);
  font-weight: 900;
}

.fno-upload #fnoUploadStatus {
  color: var(--amber);
  font-weight: 800;
}

#uploadStatus {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.cleanup-row {
  display: flex;
  gap: 10px;
  align-items: end;
  margin-top: 14px;
}

.cleanup-row label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.cleanup-row input {
  min-height: 40px;
  border: 1px solid rgba(255, 176, 0, .24);
  border-radius: 8px;
  background: #05080d;
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
}

#cleanupStatus {
  display: block;
  margin-top: 8px;
  color: var(--amber);
}

.mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.mini-table th,
.mini-table td {
  padding: 8px 9px;
  border-bottom: 1px solid var(--hairline);
  text-align: left;
  vertical-align: middle;
}

.mini-table th {
  color: #05080d;
  background: var(--amber);
  font-size: 11px;
  line-height: 1.15;
  text-transform: uppercase;
}

.mini-table thead { position: sticky; top: 16px; z-index: 4; }
.mini-table tbody tr:nth-child(even) { background: rgba(56, 168, 255, .025); }
.mini-table tbody tr:hover { background: rgba(255, 176, 0, .055); }
.mini-table td { height: 48px; }

.decision-overview {
  display: grid;
  grid-template-columns: minmax(230px, 1.55fr) repeat(4, minmax(120px, 1fr));
  gap: 7px;
  margin-bottom: 9px;
}

.decision-overview article {
  min-height: 78px;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  background: var(--panel-2);
  padding: 9px 10px;
}

.decision-overview-main { border-color: rgba(255, 176, 0, .42) !important; background: rgba(255, 176, 0, .07) !important; }
.decision-overview small { display: block; color: var(--muted); font-size: 9px; font-weight: 900; text-transform: uppercase; }
.decision-overview strong { display: block; margin: 5px 0 2px; color: var(--text); font-size: 17px; }
.decision-overview span { display: block; color: var(--muted); font-size: 11px; }
.warn-text { color: var(--amber) !important; }

.sort-head {
  display: inline-flex;
  align-items: center;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 950;
  text-align: left;
  cursor: pointer;
}

.sort-head.active {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.table-scroll {
  max-width: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid rgba(255, 176, 0, .16);
  border-radius: 8px;
  margin: 8px 0 14px;
}

.intraday-studies .mini-table thead { top: 0; }
#dhanDataPanel { min-width: 0; }
.panel:has(#dhanDataPanel) { overflow: visible; }
#dhanDataPanel label { display: grid; gap: 5px; min-width: 0; color: var(--muted); font-size: 11px; }
#dhanDataPanel select, #dhanDataPanel input { width: 100%; min-width: 0; min-height: 36px; padding: 7px; box-sizing: border-box; background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 5px; font: inherit; }
#dhanDataPanel button { min-height: 36px; }
.dd-statusbar, .dd-toolbar, .dd-selection { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 10px 0; }
.dd-statusbar { border-bottom: 1px solid var(--hairline); }
.dd-statusbar strong { color: var(--text); font-size: 16px; }
.dd-statusbar span { flex: 1; min-width: 150px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.dd-search-dock { position: sticky; top: var(--dd-tabs-height, 50px); z-index: 12; background: var(--panel); border-bottom: 1px solid var(--hairline); padding: 1px 0 5px; }
.dd-search-dock .mini-note { margin: 5px 0; font-size: 11px; }
#dhanDataPanel .dd-selection :is(button, select), #dhanDataPanel .dd-views button, #dhanDataPanel [data-dd-pane] :is(button, select) { scroll-margin-top: calc(var(--dd-tabs-height, 50px) + var(--dd-search-height, 200px) + 10px); }
.dd-search { display: grid; grid-template-columns: minmax(130px, .8fr) minmax(160px, 2fr) auto; align-items: end; gap: 10px; margin-top: 14px; }
.dd-search:has(#ddIndexWrap:not([hidden])) { grid-template-columns: minmax(110px, 1fr) minmax(110px, 1fr) minmax(130px, 1fr) minmax(140px, 1fr) auto; }
#dhanDataPanel [hidden] { display: none; }
.dd-selection label { flex: 1; min-width: 180px !important; }
.dd-toolbar label { min-width: 100px !important; }
#ddMessage { min-height: 20px; color: var(--muted); margin: 5px 0; overflow-wrap: anywhere; }
#ddMessage.dd-error, #ddChainWarning.dd-error { color: var(--red); }
.dd-views { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin: 12px 0 0; }
.dd-views button { background: transparent; color: var(--muted); border: 0; border-radius: 0; padding: 10px 14px; }
.dd-views button[aria-pressed="true"] { color: var(--amber); border-bottom: 2px solid var(--amber); }
#ddBookState { display: block; padding-top: 6px; color: var(--amber); overflow-wrap: anywhere; }
#ddBookState.dd-live { color: var(--green); }
.dd-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); gap: 12px; margin: 8px 0; padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.dd-metrics:empty { display: none; }
.dd-metrics small, .dd-metrics span { display: block; color: var(--muted); font-size: 11px; }
.dd-metrics strong { display: block; color: var(--text); margin: 4px 0; font-size: 14px; overflow-wrap: anywhere; }
#dhanDataPanel .table-scroll { max-height: min(58dvh, 520px); position: relative; margin-top: 6px; }
#dhanDataPanel .mini-table { min-width: 650px; font-variant-numeric: tabular-nums; }
#dhanDataPanel .mini-table thead { top: 0; }
#dhanDataPanel .mini-table td { height: 30px; white-space: nowrap; }
#dhanDataPanel .dd-bid { color: var(--green); }
#dhanDataPanel .dd-ask { color: var(--red); }
#dhanDataPanel .dd-stale .dd-bid, #dhanDataPanel .dd-stale .dd-ask { color: var(--muted); }
#ddChainResult .mini-table { min-width: 1300px; }
#ddChainResult .dd-atm { background: rgba(56, 168, 255, .12); }
.dn-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; padding: 10px 0; }
.dn-filters label { flex: 1; min-width: 160px; }
.dn-filters input, .dn-filters select { width: 100%; min-width: 0; }
#dnMessage { min-height: 20px; overflow-wrap: anywhere; }
#dnMessage.dn-error, .dn-sentiment.negative { color: var(--red); }
.dn-story { padding: 16px 0; border-top: 1px solid var(--hairline); overflow-wrap: anywhere; }
.dn-story header { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12px; }
.dn-story header span, .dn-story p { color: var(--muted); }
.dn-story h3 { margin: 10px 0 6px; font-size: 16px; line-height: 1.5; }
.dn-story p { margin: 0; font-size: 13px; line-height: 1.6; }
.dn-story .dn-sentiment.positive { color: var(--green); }
.dn-story .dn-sentiment.negative { color: var(--red); }
@media (max-width: 640px) {
  .dd-search { grid-template-columns: minmax(105px, 1fr) minmax(125px, 1.4fr); gap: 8px; }
  .dd-search:has(#ddIndexWrap:not([hidden])) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dd-search button { justify-self: start; }
  .dd-views button { padding: 10px 11px; }
  .dd-selection { align-items: end; }
  .dd-selection label { flex-basis: 100%; }
}
.commodity-studies .table-scroll { max-height: min(60dvh, 480px); position: relative; }
.commodity-studies [hidden] { display: none; }
.commodity-studies .commodity-priority { display: grid; gap: 4px; min-width: 150px; color: var(--muted); font-size: 11px; }
.commodity-studies .commodity-priority select { min-height: 36px; max-width: 100%; background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 5px; padding: 6px; }
.commodity-studies #commodityStatus, .commodity-studies #commodityWarning, .commodity-studies #commodityCoverage, .commodity-studies #commodityCacheTimes { overflow-wrap: anywhere; }
.commodity-studies #commodityWarning { color: var(--red); }
.commodity-studies .mini-table thead { top: 16px; }
.commodity-studies .mini-table th:first-child, .commodity-studies .mini-table td:first-child { min-width: 150px; }
.commodity-all-studies .mini-table th:first-child, .commodity-all-studies .mini-table td:first-child { width: 44px; min-width: 44px; max-width: 44px; box-sizing: border-box; }
.commodity-all-studies .mini-table th:nth-child(2), .commodity-all-studies .mini-table td:nth-child(2) { position: sticky; left: 44px; min-width: 160px; z-index: 1; }
.commodity-all-studies .mini-table td:nth-child(2) { background: var(--panel); }
.commodity-all-studies .mini-table th:nth-child(2) { z-index: 2; }
.commodity-sort-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.commodity-sort-controls .sort-head { padding: 6px 8px; min-height: 30px; border: 1px solid var(--hairline); border-radius: 4px; color: var(--text); background: var(--panel-2); white-space: nowrap; }
.commodity-studies .mini-table { min-width: 1700px; }
.commodity-studies td small { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.commodity-studies .workspace-toolbar small { color: var(--muted); }
.commodity-band { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0 4px; border-top: 1px solid var(--hairline); }
.commodity-band h3 { margin: 0; font-size: 15px; }
.commodity-band span { color: var(--muted); font-size: 11px; text-align: right; }
.commodity-studies .commodity-setups .mini-table { min-width: 1000px; }
.commodity-studies .commodity-quotes .mini-table { min-width: 1020px; }
.commodity-studies .commodity-quotes td { height: 38px; padding-top: 6px; padding-bottom: 6px; }
.commodity-side { display: inline-block; padding: 5px 8px; border-radius: 4px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.commodity-buy { color: #45e6b1; background: #073a2b; }
.commodity-sell { color: #ff9da5; background: #461c25; }
.commodity-entry { font-weight: 800; font-variant-numeric: tabular-nums; }
.commodity-studies .commodity-empty { white-space: normal; color: var(--muted); padding: 16px; }
.commodity-old-quote td { color: var(--muted); }
.commodity-signal-row > td:first-child strong { font-weight: var(--signal-weight); }
.commodity-signal-row > td:first-child { border-left: 3px solid var(--green); }
.commodity-studies > details { min-width: 0; }
.commodity-all-studies { margin: 14px 0; }
@media (max-width: 640px) {
  .commodity-studies .commodity-setups .mini-table { min-width: 0; }
  .commodity-studies .commodity-setups .mini-table td:first-child { min-width: 0; }
  .commodity-setups thead, .commodity-setups .top-x-scroll { display: none; }
  .commodity-setups tbody { display: block; }
  .commodity-setups tbody tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--hairline); }
  .commodity-setups tbody td { position: static; height: auto; min-width: 0; max-width: none; border: 0; padding: 9px 8px; overflow-wrap: anywhere; }
  .commodity-setups tbody td:first-child { grid-column: span 2; background: transparent; }
  .commodity-setups tbody td:nth-child(2) { display: flex; align-items: center; justify-content: flex-end; }
  .commodity-setups tbody td[data-label]::before { content: attr(data-label); display: block; color: var(--muted); font-size: 10px; font-weight: 400; }
  .commodity-setups tbody td:last-child { grid-column: 1 / -1; white-space: normal; }
}
.intraday-studies .mini-table { min-width: 1550px; }
.intraday-setup { min-width: 190px; max-width: 260px; white-space: normal; }
.intraday-setup small { display: block; color: var(--muted); font-size: 11px; font-weight: 400; margin-top: 4px; }
.intraday-studies .workspace-toolbar small { color: var(--muted); }

.atm-track-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 170px;
}

.atm-track-actions button {
  min-height: 28px;
  padding: 4px 7px;
  border-radius: 6px;
  font-size: 11px;
}

.atm-track-actions .atm-clear-btn {
  background: var(--red);
  color: #fff;
}

.top-x-scroll {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 5;
  width: 100%;
  height: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  background: #06101a;
  border-bottom: 1px solid rgba(255, 176, 0, .16);
}

.top-x-scroll-inner {
  height: 1px;
}

.delivery-table {
  min-width: 860px;
}

.scanner-table {
  min-width: 1320px;
}

.tl-research-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
  padding: 9px 10px;
  border: 1px solid rgba(0, 208, 180, .34);
  border-radius: 7px;
  background: rgba(0, 120, 112, .12);
}

.tl-research-strip div { min-width: 0; }
.tl-research-strip strong { display: block; color: #25dfc1; }
.tl-research-strip span { display: block; color: var(--muted); font-size: 12px; }
.tl-research-strip button { flex: 0 0 auto; min-height: 34px; padding: 7px 12px; }
.tl-research-actions { display: flex; gap: 8px; }
.tl-check-note { margin: -4px 2px 10px; }
.tl-table { min-width: 1180px; }
.tl-table td { vertical-align: top; white-space: normal; min-width: 120px; }
.tl-table td:last-child { min-width: 260px; }
.tl-pill { min-width: 116px; }
.tl-empty { color: var(--muted); }

.lt-query-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(250px, auto) auto;
  gap: 9px;
  align-items: end;
  margin-bottom: 8px;
}
.lt-query-row label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.lt-query-row input { min-height: 40px; border: 1px solid rgba(255,176,0,.3); border-radius: 7px; background: #05080d; color: var(--text); padding: 8px 10px; font: inherit; }
.lt-mode-control { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.lt-mode-control button { background: var(--panel-2); color: var(--text); border-color: rgba(255,176,0,.3); }
.lt-mode-control button.active { background: var(--amber); color: #090600; }
.lt-history { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 10px 0; color: var(--muted); font-size: 11px; }
.lt-history button { min-height: 28px; padding: 4px 8px; background: var(--panel-2); color: var(--text); }
.lt-result-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 0; padding: 10px; border: 1px solid var(--hairline); border-radius: 7px; background: var(--panel-2); }
.lt-result-head strong, .lt-result-head span { display: block; }
.lt-result-head div > span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.lt-score-grid { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 8px; margin-bottom: 10px; }
.lt-score-grid div { min-height: 72px; padding: 9px; border: 1px solid var(--hairline); border-radius: 7px; background: var(--panel-2); }
.lt-score-grid small { display: block; color: var(--amber); font-size: 10px; font-weight: 900; text-transform: uppercase; }
.lt-score-grid strong { display: block; margin-top: 7px; color: var(--green); font-size: 16px; }
.lt-evidence-table { min-width: 760px; }
.lt-evidence-table td { white-space: normal; vertical-align: top; }
.lt-evidence-table td:first-child { width: 180px; color: var(--amber); }

.research-shortlist-section { margin-top: 14px; padding-top: 4px; border-top: 1px solid rgba(56,168,255,.22); }
.research-shortlist-section h3 { margin-bottom: 2px; color: #38a8ff; }
.research-table { min-width: 1540px; }
.research-table tbody tr { height: auto; }
.research-table thead { position: static; }
.research-table th { white-space: nowrap; }
.research-table td { height: auto; min-width: 95px; max-width: 260px; padding-top: 9px; padding-bottom: 9px; vertical-align: top; white-space: normal; line-height: 1.38; }
.research-table td:nth-child(2) { min-width: 145px; }
.research-short-table { min-width: 1900px; }
.readiness-research-table { min-width: 1320px; }
.research-detail {
  display: -webkit-box;
  max-width: 260px;
  overflow: hidden;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.move-table {
  min-width: 1320px;
}

.move-table th {
  background: var(--green);
  color: #02100a;
}

.scanner-table td,
.delivery-table td {
  white-space: nowrap;
}

.scanner-table small {
  display: block;
  max-width: 180px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-power-cell {
  max-width: 220px;
  white-space: normal !important;
  line-height: 1.25;
  color: var(--text);
}

.scanner-table td:last-child,
.scanner-table td:nth-last-child(2) {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-table th:first-child,
.mini-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
}

.mini-table th:first-child {
  z-index: 2;
}

.mini-table td:first-child {
  background: #07111c;
}

.delivery-table td:nth-child(2) {
  color: var(--green);
}

.scanner-table td strong {
  color: var(--green);
}

.stock-chart-link {
  display: inline-flex;
  max-width: 190px;
  flex-direction: column;
  color: var(--green);
  text-decoration: none;
}

.stock-chart-link:hover strong,
.stock-chart-link:focus-visible strong { color: #69ffd0; text-decoration: underline; text-underline-offset: 3px; }
.stock-chart-link small { color: var(--muted); }

.readiness-grid,
.nifty-decision-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin: 8px 0 12px;
}

.readiness-grid article,
.nifty-decision-grid article {
  min-height: 84px;
  border: 1px solid var(--hairline);
  border-radius: 7px;
  background: var(--panel-2);
  padding: 10px;
}

.readiness-grid small,
.nifty-decision-grid small { display: block; color: var(--amber); font-size: 10px; font-weight: 900; text-transform: uppercase; }
.readiness-grid strong,
.nifty-decision-grid strong { display: block; margin: 5px 0 2px; font-size: 17px; }
.readiness-grid span,
.nifty-decision-grid span { display: block; color: var(--muted); font-size: 11px; }
.readiness-primary { border-color: rgba(255, 176, 0, .45) !important; background: rgba(255, 176, 0, .07) !important; }

.pos { color: var(--green); }
.neg { color: var(--red); }

.score-pill {
  display: inline-flex;
  min-width: 42px;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(0, 208, 132, .16);
  color: var(--green);
  font-weight: 900;
}

.cap-badge {
  display: inline-flex;
  justify-content: center;
  min-width: 78px;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 950;
  white-space: nowrap;
}

.cap-lc { background: rgba(0, 208, 132, .2); color: var(--green); }
.cap-mc { background: rgba(56, 168, 255, .18); color: #8fd0ff; }
.cap-sc { background: rgba(255, 176, 0, .18); color: var(--amber); }
.cap-micro,
.cap-unknown,
.cap-na { background: rgba(255, 77, 95, .18); color: var(--red); }

.signal-pill {
  display: inline-flex;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
  min-width: 68px;
}

.signal-pill.buy,
.bar-track span.buy { background: rgba(0, 208, 132, .86); color: #02100a; }
.signal-pill.watch,
.bar-track span.watch { background: rgba(255, 176, 0, .9); color: #120b00; }
.signal-pill.exit,
.bar-track span.exit { background: rgba(255, 77, 95, .88); color: #170306; }
.signal-pill.neutral { background: rgba(154, 167, 180, .28); color: var(--text); }

.market-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.market-summary article {
  min-height: 82px;
  border: 1px solid rgba(56, 168, 255, .2);
  border-radius: 8px;
  background: rgba(5, 14, 24, .84);
  padding: 10px;
}

.market-summary small {
  color: var(--amber);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.market-summary strong {
  display: block;
  margin: 6px 0 2px;
  color: var(--green);
  font-size: 18px;
}

.market-summary span,
.bar-values {
  color: var(--muted);
  font-size: 12px;
}

.market-bars {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.market-bar-row {
  border: 1px solid rgba(255, 176, 0, .14);
  border-radius: 8px;
  background: rgba(7, 17, 28, .72);
  padding: 10px;
}

.bar-meta,
.bar-values {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.bar-track {
  height: 12px;
  margin: 8px 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(154, 167, 180, .18);
}

.bar-track span {
  display: block;
  height: 100%;
  min-width: 4px;
}

.mini-note {
  color: var(--muted);
  margin: 0 0 10px;
}

.mini-note.stale-note {
  color: #ffd166;
  border: 1px solid rgba(255, 77, 95, .35);
  background: rgba(255, 77, 95, .08);
  border-radius: 8px;
  padding: 8px 10px;
}

.post-power-legend {
  margin: 8px 0 16px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 176, 0, .25);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 176, 0, .04);
}

.post-power-legend summary {
  color: var(--amber);
  font-weight: 900;
  cursor: pointer;
}

.post-power-legend p {
  margin: 8px 0 0;
}

.move-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr)) auto repeat(3, minmax(98px, 1fr));
  gap: 8px;
  align-items: end;
  margin-bottom: 12px;
}

.move-controls label {
  display: grid;
  gap: 5px;
  color: var(--amber);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.move-controls input,
.move-controls select {
  min-height: 38px;
  border: 1px solid rgba(255, 176, 0, .28);
  border-radius: 8px;
  background: #05080d;
  color: var(--text);
  padding: 7px 9px;
  font: inherit;
  font-weight: 800;
}

.move-controls .move-scan,
.move-controls .move-bucket {
  min-height: 38px;
  white-space: nowrap;
}

.move-controls .move-bucket {
  background: #0b1724;
  color: var(--text);
}

.move-controls .move-bucket.active {
  background: var(--amber);
  color: #05080d;
}

h3 {
  margin: 14px 0 8px;
  font-size: 14px;
  color: var(--amber);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}

.login-panel {
  width: min(420px, 100%);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #07111c, #092033);
}

.login-panel p {
  margin: 0 0 4px;
  color: var(--amber);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.login-panel form,
.login-panel label {
  display: grid;
  gap: 10px;
}

.login-panel form {
  margin-top: 18px;
}

.login-panel label {
  color: var(--muted);
  font-weight: 800;
}

.login-panel input {
  min-height: 44px;
  border: 1px solid rgba(255, 176, 0, .35);
  border-radius: 8px;
  background: #05080d;
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
}

#loginStatus {
  color: var(--amber);
  min-height: 20px;
}

@media (max-width: 760px) {
  .tl-research-strip { align-items: stretch; flex-direction: column; }
  .tl-research-actions { width: 100%; }
  .tl-research-strip button { flex: 1 1 0; width: 100%; }
  .lt-query-row { grid-template-columns: 1fr; }
  .lt-score-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-shell { width: 100%; padding: 5px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  h1 { font-size: 16px; }
  .topbar {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 7px;
    padding: 7px;
  }
  .brand-mark { width: 34px; height: 34px; flex-basis: 34px; }
  .brand-subline { max-width: calc(100vw - 70px); }
  .top-meta { display: grid; grid-template-columns: auto 1fr; align-items: center; }
  .source-freshness { grid-column: 1 / -1; justify-content: flex-start; }
  .top-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: auto;
    justify-content: stretch;
  }
  .top-actions button {
    min-width: 0;
    min-height: 34px;
    padding: 6px 5px;
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .sync-badge { justify-self: start; font-size: 10px; }
  .top-status { width: 100%; border-radius: 6px; }
  .tabs { grid-template-columns: repeat(6, minmax(90px, 1fr)); margin: 5px 0; padding: 5px 2px; }
  .tabs button { min-height: 32px; padding: 5px 9px; font-size: 11px; }
  .tabs button.settings-tab { margin-left: 0; }
  .panel { padding: 7px; }
  .panel-head { margin-bottom: 7px; }
  .panel-head-actions { max-width: 62%; flex-wrap: wrap; gap: 5px; }
  .panel-head-actions span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .segment-filter-wrap > span { display: none; }
  .segment-filter-wrap select { min-height: 29px; max-width: 108px; font-size: 10px; }
  .more-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace-toolbar { align-items: stretch; flex-direction: column; }
  .workspace-toolbar > div { justify-content: space-between; }
  .workspace-filter { width: 100%; justify-self: stretch; }
  .decision-list-head,
  .decision-row { grid-template-columns: 24px 82px minmax(78px, 1fr) 70px 0 58px; gap: 5px; }
  .decision-list-head { padding: 6px; }
  .decision-list-head span:nth-child(5),
  .decision-row > .score-pill { display: none; }
  .decision-row { padding: 8px 6px; }
  .decision-reason { grid-column: 3 / 7; }
  .decision-details { grid-column: 2 / 7; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .decision-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .decision-overview-main { grid-column: 1 / -1; }
  .decision-overview article { min-height: 70px; }
  .delivery-alert {
    top: 150px;
  }
  .mini-table {
    font-size: 12px;
  }
  .mini-table th,
  .mini-table td {
    padding: 8px 7px;
  }
  .delivery-table {
    min-width: 760px;
  }
  .fno-upload-row {
    grid-template-columns: 1fr;
  }
  .upload-file-choice {
    grid-template-columns: 1fr;
  }
  .macro-input-row {
    grid-template-columns: 1fr;
  }
  .scanner-table {
    min-width: 1160px;
  }
  .move-table {
    min-width: 1180px;
  }
  .move-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .move-controls .move-scan,
  .move-controls .move-bucket {
    width: 100%;
  }
  .cleanup-row {
    flex-wrap: wrap;
  }
  .settings-intro { display: grid; align-items: start; }
  .breeze-controls { grid-template-columns: 1fr 1fr; }
  .breeze-controls input { grid-column: 1 / -1; grid-row: 1; }
  .breeze-compare-list span { grid-template-columns: 1fr 1fr; }
  .settings-presets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-presets button { min-width: 0; padding: 6px 5px; font-size: 11px; }
  .colour-scheme-grid { grid-template-columns: 1fr; }
  .tab-setting-row {
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: start;
    min-height: 96px;
  }
  .tab-order-actions {
    grid-column: 2;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

@media (min-width: 1200px) {
  .panel { padding: 12px 14px; }
  .scanner-table { min-width: 1500px; }
  .mini-table { font-size: 13px; }
}
