:root {
  --bg: #00100f;
  --bg-deep: #000908;
  --ink: #071113;
  --muted: #5d676a;
  --panel: #fffdf8;
  --soft: #f6f4ee;
  --line: rgba(6, 22, 22, 0.14);
  --line-dark: rgba(214, 174, 83, 0.22);
  --rail: #000d0c;
  --rail-soft: #071917;
  --buy: #079864;
  --sell: #c84635;
  --blue: #1f61d6;
  --gold: #d19a2a;
  --gold-bright: #f1c767;
  --hold: #59646a;
  --white: #fffefa;
  --shadow: 0 22px 45px rgba(0, 0, 0, 0.36);
  --card-shadow: 0 18px 35px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
  background:
    radial-gradient(circle at 18% 18%, rgba(13, 91, 77, 0.22), transparent 36%),
    radial-gradient(circle at 90% 12%, rgba(205, 154, 42, 0.09), transparent 32%),
    linear-gradient(135deg, #000706 0%, #001615 45%, #000907 100%);
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #12201f, #344146);
  color: #fff;
  cursor: pointer;
  font-weight: 900;
  min-height: 44px;
  padding: 11px 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 12px 24px rgba(0, 0, 0, 0.18);
}

button:hover {
  filter: brightness(1.06);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 58px;
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  font-size: 22px;
}

.app-shell {
  display: grid;
  grid-template-columns: clamp(260px, 18vw, 310px) minmax(0, 1fr);
  min-height: 100vh;
  width: min(100%, 1920px);
  margin: 0 auto;
  padding: 18px;
  gap: 18px;
}

.sidebar {
  position: sticky;
  top: 18px;
  height: calc(100vh - 36px);
  min-width: 0;
  overflow: hidden auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(241, 199, 103, 0.58) rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0)),
    radial-gradient(circle at 18% 0%, rgba(17, 142, 102, 0.2), transparent 35%),
    var(--rail);
  color: #edf6f2;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 16px;
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 8px 6px 4px;
}

.brand-mark {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold);
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(209, 154, 42, 0.14), rgba(255, 255, 255, 0.03));
  color: var(--gold-bright);
  font-size: 26px;
  font-weight: 950;
  text-shadow: 0 0 18px rgba(241, 199, 103, 0.32);
}

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

.brand strong {
  color: #fff;
  font-size: 26px;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.brand span {
  color: var(--gold-bright);
  font-weight: 900;
  font-size: 16px;
  margin-top: 5px;
}

.nav-stack {
  display: grid;
  gap: 8px;
}

.nav-stack a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  min-width: 0;
  color: rgba(255, 255, 255, 0.86);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0 14px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  outline: none;
}

.nav-stack a strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-stack a.active,
.nav-stack a:hover,
.nav-stack a:focus-visible {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04));
  border-color: rgba(255, 255, 255, 0.06);
  color: var(--gold-bright);
}

.nav-stack a.active::before,
.nav-stack a:hover::before,
.nav-stack a:focus-visible::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 999px;
  background: var(--gold-bright);
}

.nav-stack span {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(241, 199, 103, 0.42);
  border-radius: 8px;
  color: inherit;
  font-size: 12px;
  font-weight: 950;
}

.safety-chip {
  margin-top: auto;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px 16px;
  min-width: 0;
  border: 1px solid rgba(209, 154, 42, 0.34);
  border-radius: 12px;
  padding: 22px 24px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(209, 154, 42, 0.08), transparent),
    rgba(0, 0, 0, 0.18);
}

.safety-chip span {
  grid-row: 1 / span 2;
  color: var(--gold-bright);
  font-size: 18px;
  font-weight: 950;
  border: 1px solid rgba(241, 199, 103, 0.42);
  border-radius: 8px;
  padding: 10px 8px;
}

.safety-chip strong,
.safety-chip em {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.safety-chip strong {
  font-size: 16px;
}

.safety-chip em {
  color: var(--gold-bright);
  font-style: normal;
  font-size: 15px;
}

.workspace {
  min-width: 0;
  display: grid;
  gap: 20px;
  align-content: start;
}

.page-hidden {
  display: none !important;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  gap: 20px;
  align-items: stretch;
  min-width: 0;
}

.topbar > div:first-child,
.clock-panel,
.panel,
.metric {
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 14px;
  box-shadow: var(--card-shadow);
}

.topbar > div:first-child {
  position: relative;
  min-height: 280px;
  overflow: hidden;
  padding: 42px 48px;
  display: grid;
  align-content: center;
  gap: 16px;
  background:
    linear-gradient(105deg, rgba(255, 253, 248, 0.98) 0%, rgba(255, 253, 248, 0.92) 62%, rgba(245, 231, 199, 0.72) 100%),
    var(--panel);
}

.topbar > div:first-child::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(112deg, transparent 0 12px, rgba(209, 154, 42, 0.16) 13px 14px),
    linear-gradient(90deg, transparent 58%, rgba(209, 154, 42, 0.11));
  clip-path: polygon(58% 100%, 100% 8%, 100% 100%);
  opacity: 0.75;
}

.topbar > div:first-child::after {
  content: "";
  position: absolute;
  right: 34px;
  top: 18px;
  width: 315px;
  height: 210px;
  opacity: 0.2;
  background:
    linear-gradient(90deg, transparent 0 7%, rgba(20, 30, 31, 0.32) 7% 9%, transparent 9% 18%),
    repeating-linear-gradient(90deg, transparent 0 30px, rgba(20, 30, 31, 0.22) 31px 38px, transparent 39px 68px);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 18%, #000 70%, transparent 100%);
}

.eyebrow,
.subtitle,
.topbar h1 {
  position: relative;
  z-index: 1;
}

.eyebrow {
  color: #a16f12;
  font-size: 15px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.topbar h1::after {
  content: "";
  display: block;
  width: 58px;
  height: 3px;
  margin-top: 22px;
  background: var(--gold);
}

.subtitle {
  color: #3f474a;
  line-height: 1.55;
  max-width: 62ch;
  font-size: 18px;
}

.clock-panel {
  position: relative;
  overflow: hidden;
  min-height: 280px;
  display: grid;
  align-content: center;
  gap: 16px;
  padding: 34px 36px;
  background:
    radial-gradient(circle at 84% 42%, rgba(2, 150, 118, 0.24), transparent 23%),
    radial-gradient(circle at 76% 35%, rgba(255, 255, 255, 0.05) 0 1px, transparent 2px) 0 0 / 13px 13px,
    linear-gradient(145deg, #001413, #000908 70%);
  border-color: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.clock-panel::after {
  content: "";
  position: absolute;
  right: 24px;
  top: 34px;
  width: 155px;
  height: 180px;
  opacity: 0.32;
  background:
    radial-gradient(circle, #04a77f 0 2px, transparent 2px) 0 0 / 10px 10px;
  clip-path: polygon(22% 0, 100% 7%, 88% 25%, 100% 43%, 62% 44%, 58% 72%, 20% 100%, 0 70%, 22% 50%, 8% 24%);
}

.clock-panel span {
  position: relative;
  z-index: 1;
  color: var(--gold-bright);
  font-size: 17px;
  font-weight: 950;
  text-transform: uppercase;
}

.clock-panel strong {
  position: relative;
  z-index: 1;
  font-size: 52px;
  line-height: 1;
  letter-spacing: 0;
}

.clock-panel em {
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, 0.72);
  font-size: 17px;
  font-style: normal;
  text-transform: uppercase;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 12px;
  align-items: stretch;
}

.metric {
  position: relative;
  min-width: 0;
  min-height: 260px;
  padding: 34px 28px 26px;
  overflow: hidden;
  background:
    radial-gradient(circle at 80% 88%, rgba(209, 154, 42, 0.1), transparent 32%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(247, 246, 241, 0.96));
  box-shadow: var(--card-shadow);
}

.metric::before {
  content: "";
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-bright), #a87817);
  box-shadow: 0 8px 18px rgba(209, 154, 42, 0.3);
}

.metric:nth-child(2)::before,
.metric:nth-child(3)::before,
.metric.server-ok::before {
  background: linear-gradient(135deg, #13b66f, #077f55);
}

.metric:nth-child(4)::before {
  background: linear-gradient(135deg, #2b73e2, #174ca9);
}

.metric.rejected::before,
.metric.news::before,
.metric.server-offline::before {
  background: linear-gradient(135deg, #db6a55, #ad2e22);
}

.metric::after {
  content: "";
  position: absolute;
  inset: auto 20px 20px auto;
  width: 140px;
  height: 90px;
  opacity: 0.16;
  background: linear-gradient(135deg, transparent 25%, var(--gold) 26% 28%, transparent 29% 44%, var(--gold) 45% 47%, transparent 48%);
}

.metric.decision {
  border-left: 4px solid var(--gold);
}

.metric span,
.panel-header span,
.level-grid span,
.gate span,
.playbook span,
.queue-card span,
.timing-card span,
.history-card header span,
.file-drop span,
.image-analysis-result span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.35px;
}

.metric span {
  color: #a1701a;
  font-size: 15px;
}

.metric:nth-child(2) span,
.metric:nth-child(3) span,
.metric.server-ok span {
  color: #087e50;
}

.metric:nth-child(4) span {
  color: #1f61d6;
}

.metric strong {
  display: block;
  margin-top: 18px;
  font-size: 34px;
  line-height: 1.08;
  max-width: 100%;
  overflow-wrap: break-word;
}

.metric p {
  color: #30393c;
  font-size: 15px;
  line-height: 1.38;
  margin-top: 12px;
  overflow-wrap: anywhere;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(340px, 0.9fr) minmax(420px, 1.1fr);
  gap: 18px;
  align-items: stretch;
}

.panel {
  overflow: hidden;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(247, 246, 241, 0.97));
  min-width: 0;
}

.panel-header {
  position: relative;
  padding: 28px 32px 20px;
  border-bottom: 0;
  background: transparent;
}

.panel-header.split {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

.panel-header p {
  color: #566064;
  font-size: 14px;
  line-height: 1.35;
  margin-top: 7px;
}

.panel-header h2 {
  color: var(--ink);
}

#profile-badge,
#chart-vision-badge,
.panel-header > span {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  border-radius: 999px;
  background: #eaf2ff;
  color: var(--blue);
  padding: 9px 15px;
  white-space: normal;
  font-size: 13px;
  line-height: 1.2;
}

#score-badge {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  border: 7px solid var(--buy);
  background: #fff;
  color: var(--ink);
  padding: 0;
  font-size: 21px;
  box-shadow: inset 0 0 0 6px #edf5ef;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 4px 22px 8px;
}

.quick-actions button {
  min-height: 58px;
  font-size: 18px;
  min-width: 0;
  white-space: normal;
}

.quick-actions button:nth-child(1) {
  background: linear-gradient(135deg, #cb4938, #9e2f24);
}

.quick-actions button:nth-child(2) {
  background: linear-gradient(135deg, #0eb37b, #046d4e);
}

.quick-actions button:nth-child(3) {
  grid-column: 1 / span 1;
  background: linear-gradient(135deg, #7c878e, #424c52);
}

.signal-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
  column-gap: 18px;
  row-gap: 0;
  padding: 18px 32px 28px;
}

.signal-form label {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 12px 0;
  border-bottom: 1px solid rgba(7, 17, 19, 0.16);
  color: #566064;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.signal-form input,
.signal-form select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-weight: 800;
  padding: 10px 0;
  outline: none;
}

.signal-form input:focus,
.signal-form select:focus,
textarea:focus {
  border-color: rgba(209, 154, 42, 0.4);
  padding-left: 10px;
  padding-right: 10px;
  background: #fff;
}

.signal-form button {
  grid-column: 1 / -1;
  align-self: end;
  margin-top: 18px;
  background: linear-gradient(135deg, #d49b25, #7c5512);
}

.decision-panel .panel-header {
  padding-bottom: 14px;
}

.verdict-card {
  position: relative;
  overflow: hidden;
  min-height: 220px;
  margin: 0 16px 16px;
  border: 1px solid rgba(209, 154, 42, 0.22);
  border-radius: 12px;
  background:
    radial-gradient(circle at 84% 22%, rgba(241, 199, 103, 0.3), transparent 10%),
    radial-gradient(circle at 86% 50%, rgba(241, 199, 103, 0.13), transparent 23%),
    repeating-radial-gradient(circle at 84% 42%, rgba(209, 154, 42, 0.16) 0 1px, transparent 2px 16px),
    linear-gradient(145deg, #00100f, #020605 66%, #061210);
  padding: 34px;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.verdict-card::after {
  content: "";
  position: absolute;
  right: 34px;
  bottom: 18px;
  width: 150px;
  height: 150px;
  border: 6px solid rgba(241, 199, 103, 0.58);
  border-radius: 50%;
  opacity: 0.72;
  box-shadow: inset 0 0 0 28px rgba(0, 0, 0, 0.18);
}

.verdict-card.ready {
  border-color: rgba(7, 152, 100, 0.45);
}

.verdict-card.sell,
.verdict-card.rejected,
.verdict-card.news {
  border-color: rgba(200, 70, 53, 0.48);
}

.verdict-card span {
  position: relative;
  z-index: 1;
  display: inline-block;
  border: 1px solid rgba(209, 154, 42, 0.54);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.42);
  color: var(--gold-bright);
  font-size: 13px;
  font-weight: 950;
  padding: 9px 17px;
}

.verdict-card strong {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 18px;
  max-width: min(74%, 560px);
  color: #fff;
  font-size: 31px;
}

.verdict-card p {
  position: relative;
  z-index: 1;
  max-width: min(72%, 620px);
  color: rgba(255, 255, 255, 0.86);
  line-height: 1.48;
  margin-top: 10px;
  font-size: 15px;
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  padding: 0 16px 16px;
}

.level-grid article {
  min-width: 0;
  border: 1px solid rgba(7, 17, 19, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.75);
  padding: 13px;
}

.level-grid strong {
  display: block;
  margin-top: 6px;
  font-size: 19px;
  overflow-wrap: anywhere;
}

#trade-map {
  display: block;
  width: calc(100% - 32px);
  min-height: 250px;
  margin: 0 16px 16px;
  border: 1px solid rgba(7, 17, 19, 0.12);
  border-radius: 12px;
  background: #fffdf8;
}

.gate-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  gap: 10px;
  padding: 0 16px 18px;
}

.gate,
.queue-card,
.timing-card,
.history-card,
.brief-card,
.playbook article,
.image-analysis-result article {
  min-width: 0;
  border: 1px solid rgba(7, 17, 19, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
  padding: 14px;
  box-shadow: inset 4px 0 0 var(--hold);
}

.gate.pass,
.timing-card.active,
.history-card.trade-ready,
.queue-card.ready,
.image-analysis-result article.ready {
  box-shadow: inset 4px 0 0 var(--buy);
}

.gate.fail,
.history-card.rejected,
.queue-card.rejected,
.image-analysis-result article.rejected {
  box-shadow: inset 4px 0 0 var(--sell);
}

.gate.wait,
.gate.check,
.history-card.ready,
.queue-card.watch,
.timing-card.next {
  box-shadow: inset 4px 0 0 var(--gold);
}

.gate strong,
.queue-card strong,
.timing-card strong,
.history-card strong,
.playbook strong,
.brief-card strong {
  display: block;
  margin-top: 6px;
  font-size: 15px;
}

.gate p,
.queue-card p,
.timing-card p,
.history-card p,
.brief-card p,
.playbook p,
.image-analysis-result p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.43;
  margin-top: 6px;
  overflow-wrap: anywhere;
}

.assurance-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  gap: 0;
  align-items: stretch;
  border: 1px solid var(--line-dark);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(1, 18, 17, 0.98), rgba(0, 8, 7, 0.96));
  color: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.assurance-bar article {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 16px 22px;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.assurance-bar span {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(241, 199, 103, 0.36);
  border-radius: 10px;
  color: var(--gold-bright);
  font-size: 13px;
  font-weight: 950;
}

.assurance-bar strong {
  display: block;
  color: rgba(255, 255, 255, 0.64);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.assurance-bar p {
  color: #fff;
  font-size: 15px;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.assurance-bar article:nth-child(2) p,
.assurance-bar article:nth-child(3) p,
.assurance-bar article:nth-child(4) p {
  color: #11c184;
}

.assurance-bar a {
  display: grid;
  place-items: center;
  margin: 10px 14px;
  border: 1px solid rgba(209, 154, 42, 0.56);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(209, 154, 42, 0.28), rgba(209, 154, 42, 0.1));
  color: var(--gold-bright);
  text-decoration: none;
  font-weight: 900;
  min-height: 54px;
}

.chart-image-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.2fr) minmax(280px, 0.8fr);
  gap: 16px;
  padding: 0 22px 22px;
}

.scanner-panel .panel-header button {
  background: linear-gradient(135deg, #d49b25, #7c5512);
}

.scanner-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  gap: 12px;
  padding: 0 22px 16px;
}

.scanner-summary article {
  min-width: 0;
  border: 1px solid rgba(7, 17, 19, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  padding: 16px;
}

.scanner-summary span,
.scanner-card span,
.scanner-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.35px;
}

.scanner-summary strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 27px;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.scanner-summary p,
.scanner-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.42;
  margin-top: 7px;
  overflow-wrap: anywhere;
}

.scanner-note {
  margin: 0 22px 16px;
  border: 1px solid rgba(209, 154, 42, 0.22);
  border-radius: 10px;
  background: rgba(241, 199, 103, 0.1);
  color: #8a6418;
  line-height: 1.45;
  padding: 13px 16px;
  text-transform: none;
  letter-spacing: 0;
}

.scanner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 12px;
  padding: 0 22px 22px;
}

.scanner-card {
  min-width: 0;
  border: 1px solid rgba(7, 17, 19, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
  padding: 16px;
  box-shadow: inset 4px 0 0 var(--hold);
}

.scanner-card.ready {
  box-shadow: inset 4px 0 0 var(--buy);
}

.scanner-card.watch {
  box-shadow: inset 4px 0 0 var(--gold);
}

.scanner-card.rejected,
.scanner-card.stale {
  box-shadow: inset 4px 0 0 var(--sell);
}

.scanner-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.scanner-card strong {
  display: block;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.1;
}

.scanner-tag {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #eaf2ff;
  color: var(--blue);
  font-size: 11px;
  font-weight: 950;
  padding: 7px 10px;
  text-transform: uppercase;
}

.scanner-card.ready .scanner-tag {
  background: rgba(7, 152, 100, 0.12);
  color: var(--buy);
}

.scanner-card.watch .scanner-tag {
  background: rgba(241, 199, 103, 0.16);
  color: #9b6a13;
}

.scanner-card.rejected .scanner-tag,
.scanner-card.stale .scanner-tag {
  background: rgba(200, 70, 53, 0.12);
  color: var(--sell);
}

.market-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.market-strip span {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(7, 17, 19, 0.1);
  border-radius: 8px;
  background: rgba(7, 17, 19, 0.04);
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  padding: 8px;
}

.market-strip b {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.market-strip.live span {
  border-color: rgba(7, 152, 100, 0.18);
  background: rgba(7, 152, 100, 0.08);
}

.market-strip.wide span {
  border-color: rgba(209, 154, 42, 0.24);
  background: rgba(241, 199, 103, 0.13);
}

.market-strip.bad span,
.market-strip.offline span {
  border-color: rgba(200, 70, 53, 0.16);
  background: rgba(200, 70, 53, 0.07);
}

.scanner-levels {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.scanner-levels span {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(7, 17, 19, 0.1);
  border-radius: 8px;
  background: rgba(246, 244, 238, 0.88);
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  padding: 8px;
}

.scanner-levels b {
  color: var(--ink);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.scanner-card footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.scanner-card button {
  min-height: 38px;
  padding: 9px 12px;
  background: linear-gradient(135deg, #12201f, #344146);
  font-size: 13px;
}

.chart-upload-box,
.chart-analysis-card {
  min-width: 0;
  border: 1px solid rgba(7, 17, 19, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.64);
  overflow: hidden;
}

.chart-upload-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid rgba(7, 17, 19, 0.12);
  background: rgba(255, 255, 255, 0.52);
}

.chart-upload-actions.drag-ready {
  outline: 2px solid rgba(209, 154, 42, 0.65);
  outline-offset: -6px;
  background: rgba(241, 199, 103, 0.12);
}

.file-drop {
  display: grid;
  gap: 7px;
  min-width: 0;
  cursor: pointer;
  overflow: hidden;
}

.file-drop input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.file-drop strong {
  font-size: 18px;
}

#choose-chart-image {
  background: linear-gradient(135deg, #d49b25, #7c5512);
  white-space: nowrap;
}

#chart-preview {
  display: block;
  width: 100%;
  height: clamp(260px, 34vw, 420px);
  min-height: 0;
  background: #fffdf8;
}

.analysis-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid rgba(7, 17, 19, 0.12);
}

.analysis-actions button:first-child,
.alert-template-panel button {
  background: linear-gradient(135deg, #2b72e3, #123f9a);
}

.analysis-actions button:last-child {
  background: linear-gradient(135deg, #0eb37b, #046d4e);
}

.image-analysis-result,
.pair-queue,
.timing-grid,
.signal-history,
.playbook {
  display: grid;
  gap: 12px;
  padding: 16px;
  min-width: 0;
}

.image-level-row,
.history-levels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 120px), 1fr));
  gap: 8px;
  margin-top: 12px;
}

.image-level-row span,
.history-levels span {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(7, 17, 19, 0.1);
  border-radius: 8px;
  background: rgba(246, 244, 238, 0.88);
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  padding: 9px;
  text-transform: uppercase;
}

.image-level-row b,
.history-levels b {
  color: var(--ink);
  font-size: 13px;
}

.pair-queue {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.score-bar {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: #dfe7e2;
  margin-top: 12px;
}

.score-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--buy));
}

.history-panel button {
  background: linear-gradient(135deg, #6f7a82, #3f484d);
}

.history-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.timing-grid {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.bottom-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(300px, 0.72fr);
  gap: 20px;
}

.playbook {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.playbook span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--gold), #7f5715);
  color: #fff;
}

.webhook-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  padding: 0 22px 14px;
  align-items: end;
}

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

.webhook-row input {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(7, 17, 19, 0.14);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--ink);
  font-weight: 800;
  padding: 12px;
  outline: none;
}

.webhook-note {
  padding: 0 22px 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
}

#alert-template {
  border: 0;
  border-top: 1px solid rgba(7, 17, 19, 0.12);
  border-radius: 0;
  min-height: 320px;
  resize: vertical;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.45;
  padding: 16px;
}

@media (max-width: 1600px) {
  .app-shell {
    grid-template-columns: 270px minmax(0, 1fr);
    gap: 14px;
    padding: 14px;
  }

  .sidebar {
    width: auto;
  }

  .workspace {
    padding: 0;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 14px;
  }

  .topbar > div:first-child,
  .clock-panel {
    min-height: 230px;
  }

  .clock-panel strong {
    font-size: 42px;
  }

  .status-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 10px;
  }

  .metric {
    min-height: 240px;
    padding: 26px 20px;
  }

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

  .metric p {
    font-size: 14px;
  }

  .main-grid,
  .bottom-grid,
  .chart-image-grid {
    grid-template-columns: 1fr;
  }

  .decision-panel,
  .signal-form-panel,
  .chart-image-panel,
  .queue-panel,
  .history-panel,
  .timing-panel,
  .bottom-grid > .panel {
    width: 100%;
  }
}

@media (max-width: 1180px) {
  .app-shell {
    display: block;
    padding: 12px;
  }

  .sidebar {
    position: sticky;
    top: 8px;
    z-index: 10;
    width: auto;
    height: auto;
    max-height: none;
    margin: 0 0 14px;
    padding: 14px;
    gap: 12px;
    overflow: visible;
  }

  .brand {
    padding: 0 2px;
  }

  .brand-mark {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    font-size: 20px;
  }

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

  .brand span {
    font-size: 14px;
    margin-top: 2px;
  }

  .nav-stack {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 2px 8px;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: rgba(241, 199, 103, 0.64) rgba(255, 255, 255, 0.06);
  }

  .nav-stack a {
    flex: 0 0 auto;
    min-width: 168px;
    min-height: 52px;
    scroll-snap-align: start;
  }

  .nav-stack a.active::before,
  .nav-stack a:hover::before,
  .nav-stack a:focus-visible::before {
    left: 12px;
    right: 12px;
    top: auto;
    bottom: -5px;
    width: auto;
    height: 3px;
  }

  .safety-chip {
    display: none;
  }

  .workspace {
    padding: 0;
  }

  .topbar,
  .status-grid,
  .main-grid,
  .scanner-summary,
  .scanner-grid,
  .chart-image-grid,
  .bottom-grid {
    grid-template-columns: 1fr;
  }

  .assurance-bar article {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 8px;
  }

  h1 {
    font-size: 38px;
    line-height: 1;
  }

  h2 {
    font-size: 20px;
  }

  .sidebar {
    top: 0;
    border-radius: 14px;
    padding: 12px;
  }

  .brand {
    gap: 10px;
  }

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

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

  .nav-stack a {
    min-width: 142px;
    min-height: 48px;
    gap: 9px;
    padding: 0 10px;
    font-size: 14px;
  }

  .nav-stack span {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }

  .topbar > div:first-child,
  .clock-panel {
    min-height: auto;
    padding: 22px;
  }

  .clock-panel strong {
    font-size: 38px;
  }

  .metric {
    padding: 22px;
  }

  .metric::after {
    display: none;
  }

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

  .panel-header {
    padding: 22px 18px 14px;
  }

  .quick-actions,
  .chart-image-grid {
    padding-left: 14px;
    padding-right: 14px;
  }

  .scanner-summary,
  .scanner-grid {
    padding-left: 14px;
    padding-right: 14px;
  }

  .scanner-note {
    margin-left: 14px;
    margin-right: 14px;
  }

  .market-strip,
  .scanner-levels {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .scanner-card footer,
  .scanner-card header {
    align-items: flex-start;
    flex-direction: column;
  }

  .quick-actions button {
    min-height: 50px;
    font-size: 15px;
  }

  .signal-form {
    padding: 10px 18px 22px;
  }

  .chart-upload-actions {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  #choose-chart-image {
    width: 100%;
  }

  #chart-preview {
    height: 300px;
  }

  .signal-form,
  .quick-actions,
  .analysis-actions,
  .image-level-row,
  .history-levels,
  .webhook-row,
  .level-grid,
  .gate-list,
  .playbook {
    grid-template-columns: 1fr;
  }

  .signal-form label:not(:nth-child(4n)) {
    padding-right: 0;
  }

  .panel-header.split {
    align-items: flex-start;
    flex-direction: column;
  }

  #score-badge {
    width: 68px;
    height: 68px;
    border-width: 6px;
  }

  .metric {
    min-height: auto;
  }

  .verdict-card strong,
  .verdict-card p {
    max-width: none;
  }

  .verdict-card::after {
    display: none;
  }
}

/* Modern minimal visual pass */
:root {
  --bg: #f4f6f8;
  --bg-deep: #e9edf2;
  --ink: #111827;
  --muted: #667085;
  --panel: #ffffff;
  --soft: #f8fafc;
  --line: #e5e7eb;
  --line-dark: #d7dde5;
  --rail: #0b0f14;
  --rail-soft: #111827;
  --buy: #07966a;
  --sell: #c24136;
  --blue: #2563eb;
  --gold: #b88728;
  --gold-bright: #d99a26;
  --hold: #64748b;
  --white: #ffffff;
  --shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
  --card-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  --radius: 12px;
}

html,
body {
  background: var(--bg);
  color: var(--ink);
}

body {
  font-family: "Segoe UI", Inter, Arial, sans-serif;
}

button {
  min-height: 40px;
  border: 1px solid #111827;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  font-weight: 800;
  box-shadow: none;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

button:hover {
  filter: none;
  background: #1f2937;
  border-color: #1f2937;
}

button:active {
  transform: translateY(1px);
}

h1 {
  font-size: clamp(38px, 5vw, 54px);
  line-height: 1;
  font-weight: 850;
}

h2 {
  font-size: 20px;
  letter-spacing: 0;
}

.app-shell {
  width: min(100%, 1720px);
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
}

.sidebar {
  top: 16px;
  height: calc(100vh - 32px);
  gap: 18px;
  padding: 18px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  background: var(--rail);
  color: #e5e7eb;
  box-shadow: none;
}

.brand {
  gap: 12px;
  padding: 4px 4px 10px;
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  border-color: rgba(217, 154, 38, 0.48);
  background: rgba(217, 154, 38, 0.09);
  color: #f4c15f;
  font-size: 18px;
  text-shadow: none;
}

.brand strong {
  font-size: 22px;
  font-weight: 850;
}

.brand span {
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 700;
}

.nav-stack {
  gap: 5px;
}

.nav-stack a {
  min-height: 46px;
  border-radius: 9px;
  padding: 0 10px;
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 700;
}

.nav-stack span {
  width: 30px;
  height: 30px;
  border-color: rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  color: #94a3b8;
  font-size: 10px;
}

.nav-stack a.active,
.nav-stack a:hover,
.nav-stack a:focus-visible {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-stack a.active span,
.nav-stack a:hover span,
.nav-stack a:focus-visible span {
  border-color: rgba(217, 154, 38, 0.45);
  color: #f4c15f;
}

.nav-stack a.active::before,
.nav-stack a:hover::before,
.nav-stack a:focus-visible::before {
  left: -2px;
  width: 3px;
  border-radius: 999px;
  background: var(--gold-bright);
}

.safety-chip {
  grid-template-columns: auto 1fr;
  gap: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.safety-chip span {
  border-color: rgba(217, 154, 38, 0.34);
  border-radius: 8px;
  color: #f4c15f;
  font-size: 13px;
}

.safety-chip strong {
  color: #f8fafc;
  font-size: 13px;
  letter-spacing: 0;
}

.safety-chip em {
  color: #94a3b8;
  font-size: 12px;
  letter-spacing: 0;
}

.workspace {
  gap: 16px;
}

.topbar {
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 16px;
}

.topbar > div:first-child,
.clock-panel,
.panel,
.metric {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
}

.topbar > div:first-child {
  min-height: 188px;
  padding: 30px;
  gap: 12px;
  background: var(--panel);
}

.topbar > div:first-child::before,
.topbar > div:first-child::after,
.clock-panel::after,
.metric::after,
.verdict-card::after {
  display: none;
}

.eyebrow {
  color: var(--gold);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.topbar h1::after {
  width: 42px;
  height: 2px;
  margin-top: 16px;
  background: var(--gold);
}

.subtitle {
  max-width: 58ch;
  color: #475467;
  font-size: 16px;
  line-height: 1.55;
}

.clock-panel {
  min-height: 188px;
  gap: 10px;
  padding: 24px;
  background: #111827;
  border-color: #1f2937;
  color: #fff;
}

.clock-panel span {
  color: #f4c15f;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.clock-panel strong {
  font-size: clamp(32px, 3vw, 42px);
  font-weight: 850;
}

.clock-panel em {
  color: #cbd5e1;
  font-size: 13px;
}

.status-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  gap: 12px;
}

.metric {
  min-height: 154px;
  padding: 18px;
  background: var(--panel);
  overflow: visible;
}

.metric::before {
  width: 9px;
  height: 9px;
  margin-bottom: 14px;
  border-radius: 999px;
  background: var(--gold);
  box-shadow: none;
}

.metric:nth-child(2)::before,
.metric:nth-child(3)::before,
.metric.server-ok::before {
  background: var(--buy);
}

.metric:nth-child(4)::before {
  background: var(--blue);
}

.metric.rejected::before,
.metric.news::before,
.metric.server-offline::before {
  background: var(--sell);
}

.metric.decision {
  border-left: 3px solid var(--gold);
}

.metric span,
.metric:nth-child(2) span,
.metric:nth-child(3) span,
.metric:nth-child(4) span,
.metric.server-ok span,
.panel-header span,
.level-grid span,
.gate span,
.playbook span,
.queue-card span,
.timing-card span,
.history-card header span,
.file-drop span,
.image-analysis-result span,
.scanner-summary span,
.scanner-card span,
.scanner-note {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.metric strong {
  margin-top: 8px;
  font-size: 25px;
  line-height: 1.1;
  font-weight: 850;
}

.metric p {
  color: #475467;
  font-size: 13px;
  line-height: 1.42;
  margin-top: 8px;
}

.main-grid {
  grid-template-columns: minmax(320px, 0.95fr) minmax(420px, 1.05fr);
  gap: 16px;
}

.panel {
  overflow: hidden;
  background: var(--panel);
}

.panel-header {
  padding: 22px 22px 14px;
  border-bottom: 1px solid var(--line);
}

.panel-header p {
  color: var(--muted);
  font-size: 13px;
}

.panel-header h2 {
  color: var(--ink);
  font-weight: 850;
}

#profile-badge,
#chart-vision-badge,
.panel-header > span,
.scanner-tag {
  border: 1px solid #dbeafe;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--blue);
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 850;
}

#score-badge {
  width: 64px;
  height: 64px;
  border: 5px solid var(--buy);
  background: #fff;
  color: var(--ink);
  font-size: 18px;
  box-shadow: none;
}

.quick-actions {
  gap: 10px;
  padding: 16px 22px 0;
}

.quick-actions button {
  min-height: 46px;
  font-size: 15px;
}

.quick-actions button:nth-child(1) {
  background: var(--sell);
  border-color: var(--sell);
}

.quick-actions button:nth-child(2) {
  background: var(--buy);
  border-color: var(--buy);
}

.quick-actions button:nth-child(3),
.history-panel button {
  background: #475467;
  border-color: #475467;
}

.signal-form {
  column-gap: 14px;
  padding: 14px 22px 22px;
}

.signal-form label,
.webhook-row label {
  border-bottom: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.signal-form input,
.signal-form select,
textarea,
.webhook-row input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  padding: 10px 12px;
}

.signal-form input:focus,
.signal-form select:focus,
textarea:focus,
.webhook-row input:focus {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  padding-left: 12px;
  padding-right: 12px;
}

.signal-form button,
.scanner-panel .panel-header button,
#choose-chart-image,
.assurance-bar a {
  background: #111827;
  border-color: #111827;
  color: #fff;
}

.decision-panel .panel-header {
  padding-bottom: 14px;
}

.verdict-card {
  min-height: 188px;
  margin: 16px;
  border: 1px solid #1f2937;
  border-radius: 10px;
  background: #111827;
  padding: 26px;
  color: #fff;
  box-shadow: none;
}

.verdict-card.ready {
  border-color: rgba(7, 150, 106, 0.65);
}

.verdict-card.sell,
.verdict-card.rejected,
.verdict-card.news {
  border-color: rgba(194, 65, 54, 0.7);
}

.verdict-card span {
  border: 1px solid rgba(244, 193, 95, 0.34);
  background: rgba(244, 193, 95, 0.08);
  color: #f4c15f;
  font-size: 11px;
  padding: 7px 10px;
}

.verdict-card strong {
  max-width: 100%;
  margin-top: 14px;
  font-size: 28px;
  font-weight: 850;
}

.verdict-card p {
  max-width: 72ch;
  color: #d1d5db;
  font-size: 14px;
}

.level-grid {
  gap: 10px;
  padding: 0 16px 16px;
}

.level-grid article,
.scanner-summary article,
.market-strip span,
.scanner-levels span,
.scanner-analysis span,
.image-level-row span,
.history-levels span {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.level-grid article {
  padding: 12px;
}

.level-grid strong {
  font-size: 18px;
  font-weight: 850;
}

#trade-map,
#chart-preview {
  background: #fff;
}

#trade-map {
  border-color: var(--line);
  border-radius: 10px;
}

.gate,
.queue-card,
.timing-card,
.history-card,
.brief-card,
.playbook article,
.image-analysis-result article,
.scanner-card {
  border: 1px solid var(--line);
  border-left: 3px solid var(--hold);
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
}

.gate.pass,
.timing-card.active,
.history-card.trade-ready,
.queue-card.ready,
.scanner-card.ready,
.image-analysis-result article.ready {
  border-left-color: var(--buy);
}

.gate.fail,
.history-card.rejected,
.queue-card.rejected,
.scanner-card.rejected,
.scanner-card.stale,
.image-analysis-result article.rejected {
  border-left-color: var(--sell);
}

.gate.wait,
.gate.check,
.history-card.ready,
.queue-card.watch,
.timing-card.next,
.scanner-card.watch {
  border-left-color: var(--gold);
}

.gate strong,
.queue-card strong,
.timing-card strong,
.history-card strong,
.playbook strong,
.brief-card strong {
  color: var(--ink);
  font-weight: 850;
}

.gate p,
.queue-card p,
.timing-card p,
.history-card p,
.brief-card p,
.playbook p,
.image-analysis-result p,
.scanner-summary p,
.scanner-card p {
  color: var(--muted);
}

.assurance-bar {
  border-color: var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  box-shadow: var(--card-shadow);
}

.assurance-bar article {
  border-right: 1px solid var(--line);
  padding: 14px 18px;
}

.assurance-bar span {
  width: 34px;
  height: 34px;
  border-color: var(--line);
  border-radius: 8px;
  color: var(--gold);
  font-size: 11px;
}

.assurance-bar strong {
  color: var(--muted);
}

.assurance-bar p,
.assurance-bar article:nth-child(2) p,
.assurance-bar article:nth-child(3) p,
.assurance-bar article:nth-child(4) p {
  color: var(--ink);
  font-size: 14px;
}

.assurance-bar a {
  margin: 10px;
  border-radius: 8px;
  min-height: 48px;
  text-decoration: none;
}

.scanner-summary {
  gap: 10px;
  padding: 16px 22px;
}

.scanner-summary article {
  padding: 14px;
}

.scanner-summary strong {
  color: var(--ink);
  font-size: 23px;
  font-weight: 850;
}

.scanner-note {
  margin: 0 22px 16px;
  border-color: #fde68a;
  border-radius: 8px;
  background: #fffbeb;
  color: #92400e;
  font-size: 13px;
  font-weight: 700;
}

.scanner-grid,
.pair-queue,
.timing-grid,
.signal-history,
.playbook,
.image-analysis-result {
  gap: 10px;
}

.scanner-card {
  padding: 14px;
}

.scanner-card strong {
  color: var(--ink);
  font-size: 22px;
  font-weight: 850;
}

.scanner-card.ready .scanner-tag {
  border-color: #bbf7d0;
  background: #ecfdf3;
  color: var(--buy);
}

.scanner-card.watch .scanner-tag {
  border-color: #fde68a;
  background: #fffbeb;
  color: #a16207;
}

.scanner-card.rejected .scanner-tag,
.scanner-card.stale .scanner-tag {
  border-color: #fecaca;
  background: #fff1f2;
  color: var(--sell);
}

.market-strip,
.scanner-levels,
.scanner-analysis {
  gap: 8px;
}

.scanner-analysis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 14px;
}

.scanner-analysis span {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  padding: 8px;
}

.scanner-analysis b {
  color: var(--ink);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.market-strip.live span {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.market-strip.wide span {
  border-color: #fde68a;
  background: #fffbeb;
}

.market-strip.bad span,
.market-strip.offline span {
  border-color: #fecaca;
  background: #fff1f2;
}

.score-bar {
  height: 6px;
  background: #e5e7eb;
}

.score-bar i {
  background: linear-gradient(90deg, var(--gold), var(--buy));
}

.scanner-card button,
.analysis-actions button:first-child,
.alert-template-panel button {
  background: #111827;
  border-color: #111827;
}

.chart-image-grid {
  gap: 14px;
  padding: 16px 22px 22px;
}

.chart-upload-box,
.chart-analysis-card {
  border-color: var(--line);
  border-radius: 10px;
  background: #fff;
}

.chart-upload-actions,
.analysis-actions {
  border-bottom-color: var(--line);
  background: var(--soft);
}

.chart-upload-actions.drag-ready {
  outline: 2px solid rgba(37, 99, 235, 0.3);
  background: #eff6ff;
}

.file-drop strong {
  color: var(--ink);
  font-size: 17px;
}

.analysis-actions button:last-child {
  background: var(--buy);
  border-color: var(--buy);
}

.playbook span {
  background: #111827;
  color: #fff;
}

.webhook-row {
  gap: 10px;
  padding: 16px 22px;
}

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

#alert-template {
  border-top-color: var(--line);
  background: #0b1020;
  color: #d1d5db;
}

@media (max-width: 1600px) {
  .app-shell {
    grid-template-columns: 236px minmax(0, 1fr);
    padding: 14px;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) 270px;
  }

  .metric {
    min-height: 148px;
  }
}

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

  .sidebar {
    top: 8px;
    margin-bottom: 14px;
    height: auto;
    padding: 12px;
  }

  .nav-stack {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
    gap: 7px;
    overflow: visible;
    padding-bottom: 0;
    scroll-snap-type: none;
  }

  .nav-stack a {
    min-width: 0;
  }

  .topbar,
  .main-grid,
  .bottom-grid,
  .chart-image-grid {
    grid-template-columns: 1fr;
  }

  .assurance-bar article {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 8px;
  }

  .sidebar {
    border-radius: 12px;
  }

  .topbar > div:first-child,
  .clock-panel {
    min-height: auto;
    padding: 20px;
  }

  .metric {
    min-height: auto;
    padding: 16px;
  }

  .panel-header {
    padding: 18px 16px 12px;
  }

  .quick-actions,
  .signal-form,
  .scanner-summary,
  .scanner-grid,
  .chart-image-grid,
  .webhook-row {
    padding-left: 16px;
    padding-right: 16px;
  }

  .scanner-note {
    margin-left: 16px;
    margin-right: 16px;
  }

  .quick-actions,
  .analysis-actions,
  .webhook-row {
    grid-template-columns: 1fr;
  }

  .verdict-card {
    padding: 20px;
  }

  .verdict-card strong {
    font-size: 24px;
  }

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