:root {
  color-scheme: dark light;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: #0b0d0e;
}

body.signal-desk {
  --dark-950: #0e0f10;
  --dark-900: #16181a;
  --dark-800: #1f2124;
  --ivory: #faf7f2;
  --stone: #f1eee8;
  --warm: #e3e0da;
  --copper: #b8734a;
  --copper-2: #cf8a5c;
  --oxblood: #7a1f2d;
  --sage: #7a8464;
  --forest: #2e6b4e;
  --amber: #c98a3a;
  --carmine: #b23a3a;
  --app-bg: #0e0f10;
  --sidebar-bg: #101315;
  --main-bg: #101214;
  --card: rgba(22, 24, 26, 0.82);
  --card-soft: rgba(31, 33, 36, 0.78);
  --input: rgba(14, 15, 16, 0.42);
  --text: #f6efe7;
  --heading: #fffdf9;
  --muted: rgba(246, 239, 231, 0.62);
  --faint: rgba(246, 239, 231, 0.42);
  --line: rgba(227, 224, 218, 0.1);
  --line-strong: rgba(207, 138, 92, 0.32);
  --shadow: rgba(0, 0, 0, 0.35);
  --grid: rgba(207, 138, 92, 0.032);
  margin: 0;
  min-height: 100vh;
  padding: 1.45rem;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 0%, rgba(207, 138, 92, 0.08), transparent 30rem),
    radial-gradient(circle at 100% 14%, rgba(122, 31, 45, 0.09), transparent 28rem),
    linear-gradient(180deg, #0b0d0e 0%, #101315 100%);
  font-family: "Avenir Next", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 13px;
  letter-spacing: 0;
}

body.signal-desk[data-theme="light"] {
  --app-bg: #fffdf9;
  --sidebar-bg: #faf7f2;
  --main-bg: #fffdf9;
  --card: rgba(255, 253, 249, 0.94);
  --card-soft: rgba(241, 238, 232, 0.72);
  --input: rgba(255, 253, 249, 0.82);
  --text: #2a2c2f;
  --heading: #141414;
  --muted: rgba(42, 44, 47, 0.62);
  --faint: rgba(42, 44, 47, 0.42);
  --line: rgba(42, 44, 47, 0.1);
  --line-strong: rgba(184, 115, 74, 0.32);
  --shadow: rgba(31, 25, 20, 0.1);
  --grid: rgba(42, 44, 47, 0.026);
  background:
    radial-gradient(circle at 12% 0%, rgba(184, 115, 74, 0.06), transparent 30rem),
    linear-gradient(180deg, #faf7f2 0%, #f1eee8 100%);
}

body.signal-desk::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    repeating-linear-gradient(90deg, var(--grid) 0 1px, transparent 1px 46px),
    repeating-linear-gradient(0deg, var(--grid) 0 1px, transparent 1px 46px);
  pointer-events: none;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button,
select {
  cursor: pointer;
}

button,
input,
select,
textarea {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  background: var(--input);
}

button {
  min-height: 1.9rem;
  padding: 0.35rem 0.58rem;
  font-size: 0.72rem;
  font-weight: 700;
}

button:hover,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: var(--line-strong);
  outline: 2px solid rgba(207, 138, 92, 0.18);
  outline-offset: 1px;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.52rem 0.6rem;
  font-size: 0.74rem;
}

textarea {
  min-height: 6rem;
  resize: vertical;
}

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

h1 {
  margin-bottom: 0.42rem;
  color: var(--heading);
  font-size: 1.24rem;
  font-weight: 650;
  line-height: 1.08;
}

h2 {
  margin: 0;
  color: var(--heading);
  font-size: 0.78rem;
  font-weight: 760;
  line-height: 1.16;
}

h3 {
  margin: 0 0 0.48rem;
  color: var(--heading);
  font-size: 0.76rem;
}

a {
  color: var(--copper-2);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.ja-shell {
  display: grid;
  grid-template-columns: 8.75rem minmax(0, 1fr);
  width: min(1390px, calc(100vw - 2.9rem));
  min-height: min(760px, calc(100vh - 2.9rem));
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(227, 224, 218, 0.13);
  border-radius: 10px;
  background: var(--app-bg);
  box-shadow: 0 28px 80px var(--shadow);
}

body[data-theme="light"] .ja-shell {
  border-color: rgba(42, 44, 47, 0.12);
}

.ja-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.48rem;
  height: 100%;
  min-height: inherit;
  padding: 0.78rem 0.42rem;
  overflow-y: auto;
  color: var(--text);
  background:
    linear-gradient(180deg, var(--sidebar-bg), color-mix(in srgb, var(--sidebar-bg) 90%, #000 10%)),
    repeating-linear-gradient(90deg, rgba(207, 138, 92, 0.035) 0 1px, transparent 1px 38px);
  border-right: 1px solid var(--line);
}

.ja-brand {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  min-width: 0;
  padding: 0.02rem 0.08rem 0.42rem;
}

.ja-brand strong {
  display: block;
  color: var(--heading);
  font-size: 0.68rem;
  font-weight: 780;
  line-height: 1;
  text-transform: uppercase;
}

.ja-brand span:not(.ja-mark) {
  display: block;
  margin-top: 0.24rem;
  color: var(--muted);
  font-size: 0.36rem;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.ja-mark {
  position: relative;
  width: 1.9rem;
  height: 1.9rem;
  flex: 0 0 auto;
}

.ja-mark::before,
.ja-mark::after {
  content: "";
  position: absolute;
  left: 0.34rem;
  top: 0.12rem;
  width: 0.78rem;
  height: 1.52rem;
  border-left: 0.18rem solid var(--copper-2);
  border-bottom: 0.18rem solid var(--copper-2);
  transform: skewX(-23deg);
}

.ja-mark::after {
  left: 0.68rem;
  top: 0.5rem;
  width: 0.34rem;
  height: 0.92rem;
  border-left-color: var(--copper);
  border-bottom-color: var(--copper);
}

.ja-nav,
.ja-tool-nav {
  display: grid;
  gap: 0.12rem;
}

.ja-nav button {
  position: relative;
  display: grid;
  grid-template-columns: 1.08rem minmax(0, 1fr);
  align-items: center;
  gap: 0.28rem;
  min-height: 1.52rem;
  padding: 0.14rem 0.28rem;
  border-color: transparent;
  color: var(--muted);
  background: transparent;
  text-align: left;
  font-size: 0.58rem;
  white-space: nowrap;
}

.ja-nav button span {
  position: relative;
  display: grid;
  place-items: center;
  width: 1rem;
  height: 1rem;
  color: transparent;
  font-size: 0;
}

.ja-nav button span::before,
.ja-nav button span::after {
  content: "";
  position: absolute;
  border-color: color-mix(in srgb, var(--text) 72%, transparent);
}

.ja-nav button:nth-child(1) span::before {
  inset: 0.18rem;
  border: 1px solid;
}

.ja-nav button:nth-child(1) span::after {
  left: 0.32rem;
  right: 0.32rem;
  top: 0.48rem;
  border-top: 1px solid;
}

.ja-nav button:nth-child(2) span::before {
  inset: 0.18rem 0.12rem;
  border-top: 1px solid;
  border-bottom: 1px solid;
}

.ja-nav button:nth-child(2) span::after {
  left: 0.24rem;
  right: 0.24rem;
  top: 0.48rem;
  border-top: 1px solid;
}

.ja-nav button:nth-child(3) span::before {
  inset: 0.18rem;
  border: 1px solid;
  border-radius: 50%;
}

.ja-nav button:nth-child(3) span::after {
  left: 0.48rem;
  top: 0.1rem;
  bottom: 0.1rem;
  border-left: 1px solid;
}

.ja-nav button:nth-child(4) span::before {
  inset: 0.2rem 0.16rem 0.12rem;
  border: 1px solid;
}

.ja-nav button:nth-child(4) span::after {
  left: 0.28rem;
  right: 0.28rem;
  top: 0.34rem;
  border-top: 1px solid;
}

.ja-nav button:nth-child(5) span::before {
  left: 0.16rem;
  right: 0.16rem;
  bottom: 0.2rem;
  height: 0.5rem;
  border-left: 1px solid;
  border-bottom: 1px solid;
}

.ja-nav button:nth-child(5) span::after {
  left: 0.22rem;
  right: 0.18rem;
  top: 0.26rem;
  border-top: 1px solid;
  transform: rotate(-18deg);
}

.ja-nav button:nth-child(6) span::before {
  inset: 0.18rem;
  border: 1px solid;
}

.ja-nav button:nth-child(6) span::after {
  left: 0.3rem;
  right: 0.3rem;
  top: 0.3rem;
  bottom: 0.3rem;
  border: 1px solid;
}

.ja-nav button:nth-child(7) span::before {
  inset: 0.14rem 0.22rem;
  border: 1px solid;
}

.ja-nav button:nth-child(7) span::after {
  left: 0.34rem;
  right: 0.34rem;
  top: 0.38rem;
  border-top: 1px solid;
  box-shadow: 0 0.18rem 0 color-mix(in srgb, var(--text) 72%, transparent);
}

.ja-nav button:nth-child(8) span::before {
  inset: 0.2rem;
  border: 1px solid;
  transform: rotate(45deg);
}

.ja-nav button:nth-child(8) span::after {
  inset: 0.38rem;
  border: 1px solid;
  border-radius: 50%;
}

.ja-nav button:nth-child(8) span::before {
  inset: 0.2rem 0.16rem;
  border: 1px solid;
  transform: none;
}

.ja-nav button:nth-child(8) span::after {
  left: 0.24rem;
  right: 0.24rem;
  top: 0.36rem;
  bottom: auto;
  border: 0;
  border-top: 1px solid;
  border-radius: 0;
  box-shadow:
    0 0.2rem 0 color-mix(in srgb, var(--text) 72%, transparent),
    0 0.4rem 0 color-mix(in srgb, var(--text) 72%, transparent);
}

.ja-nav button:nth-child(9) span::before {
  inset: 0.2rem;
  border: 1px solid;
  transform: rotate(45deg);
}

.ja-nav button:nth-child(9) span::after {
  inset: 0.38rem;
  border: 1px solid;
  border-radius: 50%;
}

.ja-nav button:nth-child(8) span::before {
  left: 0.16rem;
  right: 0.14rem;
  bottom: 0.18rem;
  height: 0.58rem;
  border-left: 1px solid;
  border-bottom: 1px solid;
  transform: none;
}

.ja-nav button:nth-child(8) span::after {
  left: 0.28rem;
  right: 0.16rem;
  top: 0.24rem;
  bottom: auto;
  border: 0;
  border-top: 1px solid;
  border-radius: 0;
  transform: rotate(-24deg);
}

.ja-nav button:nth-child(9) span::before {
  inset: 0.2rem 0.16rem;
  border: 1px solid;
  transform: none;
}

.ja-nav button:nth-child(9) span::after {
  left: 0.24rem;
  right: 0.24rem;
  top: 0.36rem;
  bottom: auto;
  border: 0;
  border-top: 1px solid;
  border-radius: 0;
  box-shadow:
    0 0.2rem 0 color-mix(in srgb, var(--text) 72%, transparent),
    0 0.4rem 0 color-mix(in srgb, var(--text) 72%, transparent);
}

.ja-nav button:nth-child(10) span::before {
  inset: 0.2rem;
  border: 1px solid;
  transform: rotate(45deg);
}

.ja-nav button:nth-child(10) span::after {
  inset: 0.38rem;
  border: 1px solid;
  border-radius: 50%;
}

.ja-nav button[data-view="krown"] span::before {
  inset: 0.16rem 0.22rem 0.16rem 0.24rem;
  border-left: 1px solid;
  border-bottom: 1px solid;
  transform: skewX(-18deg);
}

.ja-nav button[data-view="krown"] span::after {
  left: 0.48rem;
  right: 0.18rem;
  top: 0.24rem;
  bottom: 0.22rem;
  border: 0;
  border-top: 1px solid;
  border-bottom: 1px solid;
  transform: skewX(-18deg);
}

.ja-nav button[data-view="tools"] span::before {
  inset: 0.2rem;
  border: 1px solid;
  transform: rotate(45deg);
}

.ja-nav button[data-view="tools"] span::after {
  inset: 0.38rem;
  border: 1px solid;
  border-radius: 50%;
}

.ja-nav button.active,
.ja-nav button:hover,
.ja-tool-nav button:hover,
.ja-tool-nav button.active {
  color: var(--heading);
  background: rgba(184, 115, 74, 0.18);
}

body[data-theme="light"] .ja-nav button.active,
body[data-theme="light"] .ja-nav button:hover,
body[data-theme="light"] .ja-tool-nav button:hover,
body[data-theme="light"] .ja-tool-nav button.active {
  background: rgba(184, 115, 74, 0.09);
}

.ja-nav button.active::before {
  content: "";
  position: absolute;
  left: -0.42rem;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--copper-2);
}

.ja-tool-nav {
  padding-top: 0.12rem;
}

.ja-tool-nav h2,
.active-deal h2 {
  margin: 0 0 0.16rem;
  color: var(--faint);
  font-size: 0.54rem;
  font-weight: 850;
  text-transform: uppercase;
}

.ja-tool-nav button {
  min-height: 1.24rem;
  padding: 0.1rem 0.28rem;
  border-color: transparent;
  color: var(--muted);
  background: transparent;
  text-align: left;
  font-size: 0.53rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.active-deal {
  display: grid;
  gap: 0.24rem;
  margin-top: 0.18rem;
  padding: 0.32rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: color-mix(in srgb, var(--card) 80%, transparent);
}

.active-deal strong {
  color: var(--heading);
  font-size: 0.62rem;
  line-height: 1.2;
}

.active-deal h2,
.active-deal span {
  display: none;
}

.active-deal button {
  width: 100%;
  min-height: 1.36rem;
  margin-top: 0.1rem;
  padding: 0.12rem 0.32rem;
  font-size: 0.58rem;
  color: var(--copper-2);
  background: transparent;
  border-color: var(--copper);
}

.progress-track {
  height: 0.28rem;
  overflow: hidden;
  background: color-mix(in srgb, var(--text) 12%, transparent);
}

.progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--copper-2);
}

.active-score-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.14rem;
}

.active-score-row div {
  display: grid;
  gap: 0.02rem;
  padding: 0.14rem 0.16rem;
  border: 1px solid var(--line);
  color: var(--faint);
  font-size: 0.5rem;
}

.active-score-row div span {
  display: none;
}

.active-score-row strong {
  color: var(--heading);
  font-size: 0.6rem;
}

.ja-main {
  min-width: 0;
  padding: 1.05rem 1.22rem 1.16rem;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--main-bg) 96%, transparent), var(--main-bg)),
    repeating-linear-gradient(90deg, var(--grid) 0 1px, transparent 1px 46px);
}

.ja-topbar {
  display: grid;
  grid-template-columns: 2.1rem minmax(18rem, 1fr) auto;
  gap: 0.72rem;
  align-items: center;
  margin-bottom: 1.18rem;
}

.menu-button {
  width: 2rem;
  min-height: 2rem;
  padding: 0;
  border-color: transparent;
  color: var(--muted);
  background: transparent;
  font-size: 1rem;
}

.global-search {
  position: relative;
}

.global-search input {
  height: 2.15rem;
  padding-left: 2rem;
  border-color: var(--line);
  background:
    linear-gradient(90deg, transparent 0 1.55rem, var(--line) 1.55rem 1.6rem, transparent 1.6rem),
    var(--input);
}

.search-menu {
  position: absolute;
  z-index: 50;
  top: calc(100% + 0.32rem);
  left: 0;
  right: 0;
  display: grid;
  gap: 0.25rem;
  max-height: 22rem;
  overflow-y: auto;
  padding: 0.35rem;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--card);
  box-shadow: 0 20px 42px var(--shadow);
}

.search-menu button {
  display: grid;
  gap: 0.12rem;
  min-height: 2.42rem;
  text-align: left;
}

.search-menu small {
  color: var(--faint);
}

.topbar-actions {
  display: flex;
  gap: 0.42rem;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.topbar-actions > span:not(.profile-mark) {
  max-width: 11.2rem;
  padding: 0.42rem 0.52rem;
  overflow: hidden;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--input);
  font-size: 0.67rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions button {
  min-height: 1.86rem;
  padding: 0.24rem 0.48rem;
}

.topbar-actions button.active,
.chart-controls button.active {
  color: #fffdf9;
  background: var(--copper);
  border-color: rgba(184, 115, 74, 0.62);
}

.profile-mark {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  color: var(--heading);
  background: color-mix(in srgb, var(--text) 12%, transparent);
  font-size: 0.66rem;
  font-weight: 800;
}

.command-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.command-head p {
  max-width: 48rem;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.date-control {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex: 0 0 auto;
}

.date-control span {
  padding: 0.48rem 0.58rem;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--input);
  font-size: 0.68rem;
}

.date-control button,
.panel-head button,
.drawer-head button,
.tool-primary,
.idea-form button {
  color: #fffdf9;
  background: linear-gradient(180deg, var(--copper-2), var(--copper));
  border-color: rgba(184, 115, 74, 0.72);
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.64rem;
  margin-bottom: 0.64rem;
}

.metric-card,
.ja-card,
.chart-panel {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--card);
  box-shadow: none;
}

.metric-card {
  position: relative;
  display: grid;
  gap: 0.42rem;
  min-height: 5.16rem;
  padding: 0.76rem 0.8rem;
}

.metric-card::before {
  content: "";
  width: 1.62rem;
  height: 1.62rem;
  border: 1px solid rgba(207, 138, 92, 0.22);
  border-radius: 4px;
  background: rgba(184, 115, 74, 0.1);
}

.metric-card span,
.panel-head span,
.drawer-head span,
.state-label,
.score-cell span,
.source-line span {
  color: var(--faint);
  font-size: 0.6rem;
  font-weight: 850;
  text-transform: uppercase;
}

.metric-card strong {
  color: var(--heading);
  font-size: 1.05rem;
  line-height: 1;
}

.metric-card small {
  color: var(--muted);
  font-size: 0.64rem;
  line-height: 1.25;
}

.view-panel {
  min-width: 0;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18.3rem;
  gap: 0.64rem;
  align-items: stretch;
}

.right-stack {
  display: grid;
  gap: 0.64rem;
}

.ja-card {
  min-width: 0;
  padding: 0.72rem;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
  margin-bottom: 0.58rem;
}

.panel-head button {
  min-height: 1.65rem;
  padding: 0.22rem 0.46rem;
  font-size: 0.62rem;
  background: transparent;
  color: var(--copper-2);
  border-color: transparent;
}

.table-frame {
  width: 100%;
  overflow-x: auto;
  border-top: 1px solid var(--line);
}

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

th,
td {
  padding: 0.53rem 0.42rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--faint);
  font-size: 0.57rem;
  font-weight: 850;
  text-transform: uppercase;
  white-space: nowrap;
}

td {
  color: var(--muted);
  font-size: 0.69rem;
}

td strong {
  color: var(--heading);
}

td button.link-button,
.compact-list button.link-button {
  min-height: 1.25rem;
  padding: 0;
  border: 0;
  color: var(--heading);
  background: transparent;
  text-align: left;
}

.state-label,
.score-cell {
  display: inline-grid;
  place-items: center;
  min-width: 2rem;
  min-height: 1.22rem;
  padding: 0.12rem 0.3rem;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--text) 5%, transparent);
  color: var(--muted);
}

.score-good,
.change-up {
  color: var(--forest);
}

.score-warn {
  color: var(--amber);
}

.score-bad,
.change-down {
  color: var(--carmine);
}

.compact-list,
.event-stack,
.review-stack,
.activity-feed {
  display: grid;
  gap: 0.38rem;
  margin-top: 0;
}

.compact-item,
.event-item,
.review-item,
.activity-item,
.note-row,
.tool-result,
.source-line {
  display: grid;
  gap: 0.32rem;
  padding: 0.48rem;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.compact-item:last-child,
.event-item:last-child,
.review-item:last-child,
.activity-item:last-child,
.tool-result:last-child,
.source-line:last-child {
  border-bottom: 0;
}

.compact-item header,
.event-item header,
.review-item header,
.activity-item header,
.tool-result header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.5rem;
}

.compact-item strong,
.event-item strong,
.review-item strong,
.activity-item strong,
.tool-result strong,
.source-line strong {
  color: var(--heading);
  font-size: 0.72rem;
}

.compact-item p,
.event-item p,
.review-item p,
.activity-item p,
.tool-result p,
.empty-state,
.note-row p {
  margin: 0;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.34;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.meta-row span {
  padding: 0.12rem 0.26rem;
  border: 1px solid var(--line);
  color: var(--muted);
  background: color-mix(in srgb, var(--sage) 8%, transparent);
  font-size: 0.56rem;
  font-weight: 850;
  text-transform: uppercase;
}

.meta-grid {
  display: grid;
  grid-template-columns: minmax(5.8rem, 0.42fr) minmax(0, 1fr);
  gap: 0.18rem 0.5rem;
  min-width: 0;
}

.meta-grid span {
  color: var(--faint);
  font-size: 0.58rem;
  font-weight: 850;
  text-transform: uppercase;
}

.meta-grid strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--heading);
  font-size: 0.65rem;
  font-weight: 680;
}

.lower-grid {
  display: grid;
  grid-template-columns: 0.78fr 1.15fr 0.8fr;
  gap: 0.64rem;
  margin-top: 0.64rem;
}

.regime-box {
  display: grid;
  grid-template-columns: 5.7rem minmax(0, 1fr);
  gap: 0.64rem;
  align-items: center;
  min-height: 10.3rem;
}

.regime-box p {
  margin: 0.34rem 0 0;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.38;
}

.donut {
  display: grid;
  place-items: center;
  width: 5.25rem;
  height: 5.25rem;
  border-radius: 50%;
  background: conic-gradient(var(--copper-2) 0deg, var(--card-soft) 0deg);
}

.donut span {
  display: grid;
  place-items: center;
  width: 3.48rem;
  height: 3.48rem;
  border-radius: 50%;
  color: var(--heading);
  background: var(--card);
  font-size: 0.98rem;
  font-weight: 900;
}

.mini-score-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.32rem;
  margin-top: 0.52rem;
}

.mini-score-grid div {
  display: grid;
  gap: 0.08rem;
  padding: 0.28rem 0.34rem;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--text) 4%, transparent);
}

.mini-score-grid span {
  color: var(--faint);
  font-size: 0.55rem;
  font-weight: 850;
  text-transform: uppercase;
}

.mini-score-grid strong {
  color: var(--heading);
  font-size: 0.74rem;
}

.chart-panel {
  display: grid;
  gap: 0.44rem;
}

.chart-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  align-items: center;
  justify-content: flex-end;
}

.chart-controls select {
  width: 10.5rem;
  min-height: 1.66rem;
  padding: 0.2rem 0.4rem;
}

.chart-controls button {
  min-height: 1.66rem;
  padding: 0.2rem 0.38rem;
}

.chart-controls button.active {
  border-color: color-mix(in srgb, var(--copper-bright) 72%, transparent);
  color: var(--heading);
  background: color-mix(in srgb, var(--copper) 18%, transparent);
}

.mini-chart-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.34rem;
}

.mini-chart-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto 2.62rem auto;
  gap: 0.12rem 0.34rem;
  min-height: 4.72rem;
  padding: 0.38rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: color-mix(in srgb, var(--panel-2) 84%, transparent);
  color: var(--muted);
  text-align: left;
}

.mini-chart-card.active {
  border-color: color-mix(in srgb, var(--copper-bright) 70%, transparent);
  background: color-mix(in srgb, var(--copper) 12%, var(--panel-2));
}

.mini-chart-card span {
  color: var(--heading);
  font-size: 0.68rem;
  font-weight: 850;
}

.mini-chart-card small {
  justify-self: end;
  font-size: 0.58rem;
  font-weight: 850;
}

.mini-chart-card em {
  grid-column: 1 / -1;
  overflow: hidden;
  color: var(--faint);
  font-size: 0.52rem;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-chart-card svg {
  grid-column: 1 / -1;
  width: 100%;
  height: 2.62rem;
}

.mini-chart-card svg polygon {
  fill: color-mix(in srgb, var(--copper) 14%, transparent);
}

.mini-chart-card svg polyline,
.mini-chart-card svg path {
  fill: none;
  stroke: var(--copper-bright);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.chart-stage {
  position: relative;
  height: 8.6rem;
  min-height: 8.6rem;
  overflow: hidden;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card-soft) 80%, transparent);
}

.tv-chart,
.cached-chart {
  width: 100%;
  height: 8.6rem;
}

.chart-panel.chart-large .chart-stage,
.chart-panel.chart-large .tv-chart,
.chart-panel.chart-large .cached-chart {
  height: min(52vh, 31rem);
  min-height: 24rem;
}

.chart-panel.chart-fullscreen {
  position: fixed;
  inset: 0.6rem;
  z-index: 90;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
}

.chart-panel.chart-fullscreen .chart-stage,
.chart-panel.chart-fullscreen .tv-chart,
.chart-panel.chart-fullscreen .cached-chart {
  height: auto;
  min-height: 0;
}

.chart-overlay-open {
  overflow: hidden;
}

.tv-workspace {
  display: grid;
  min-height: calc(100vh - 11rem);
}

.tv-workspace-layout {
  --tv-rail-width: 14rem;
  display: grid;
  grid-template-columns: minmax(8rem, var(--tv-rail-width)) 0.46rem minmax(0, 1fr);
  gap: 0.36rem;
  align-items: stretch;
  min-height: min(62vh, 42rem);
}

.tv-command-rail {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  align-content: stretch;
  gap: 0.52rem;
  min-width: 0;
  min-height: 0;
  padding: 0.52rem;
  overflow: hidden;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-2) 86%, transparent);
}

.tv-search-field,
.tv-command-rail label {
  display: grid;
  gap: 0.24rem;
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 850;
  text-transform: uppercase;
}

.symbol-search-results,
.watchlist-stack,
[data-tv-watchlist] {
  display: grid;
  gap: 0.28rem;
  min-height: 0;
}

.symbol-search-results {
  max-height: 8rem;
  overflow: auto;
}

.watchlist-stack {
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

[data-tv-watchlist] {
  align-content: start;
  overflow: auto;
  padding-right: 0.06rem;
}

.symbol-search-results button,
.watchlist-symbol {
  display: grid;
  gap: 0.08rem;
  min-height: 2.35rem;
  padding: 0.34rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.symbol-search-results button strong,
.watchlist-symbol strong {
  color: var(--heading);
  font-size: 0.68rem;
}

.symbol-search-results button span,
.watchlist-symbol span {
  overflow: hidden;
  font-size: 0.54rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.watchlist-symbol.active {
  border-color: color-mix(in srgb, var(--copper-bright) 70%, transparent);
  background: color-mix(in srgb, var(--copper) 13%, transparent);
}

.watchlist-head {
  display: flex;
  gap: 0.42rem;
  align-items: center;
  justify-content: space-between;
}

.watchlist-head strong {
  color: var(--heading);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.tv-split-handle {
  position: relative;
  display: grid;
  place-items: center;
  width: 0.46rem;
  min-width: 0.46rem;
  min-height: 100%;
  padding: 0;
  border-color: transparent;
  border-radius: 3px;
  background: transparent;
  cursor: col-resize;
  touch-action: none;
}

.tv-split-handle::before {
  content: "";
  position: absolute;
  inset: 0.34rem 0.16rem;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

.tv-split-handle span {
  position: relative;
  width: 0.18rem;
  height: 2.6rem;
  border-radius: 999px;
  background:
    linear-gradient(var(--copper-2), var(--copper-2)) 50% 25% / 0.18rem 0.18rem no-repeat,
    linear-gradient(var(--copper-2), var(--copper-2)) 50% 50% / 0.18rem 0.18rem no-repeat,
    linear-gradient(var(--copper-2), var(--copper-2)) 50% 75% / 0.18rem 0.18rem no-repeat;
  opacity: 0.7;
}

.tv-split-handle:hover,
.tv-split-handle:focus-visible,
.tv-split-handle.is-dragging {
  border-color: var(--line-strong);
  background: color-mix(in srgb, var(--copper) 12%, transparent);
}

.tv-split-handle.is-dragging span {
  opacity: 1;
}

.tv-workspace-chart {
  min-width: 0;
  min-height: min(62vh, 42rem);
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card-soft) 80%, transparent);
}

.tv-workspace-fullscreen {
  position: fixed;
  inset: 0.6rem;
  z-index: 92;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
}

.tv-workspace-fullscreen .tv-workspace-layout,
.tv-workspace-fullscreen .tv-workspace-chart {
  min-height: 0;
}

.tv-workspace-fullscreen [data-tv-watchlist] {
  max-height: none;
}

.tv-caveat {
  margin: 0;
  color: var(--faint);
  font-size: 0.62rem;
}

.chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  color: var(--muted);
  text-align: center;
}

.timeline-strip {
  display: grid;
  gap: 0.28rem;
}

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

.timeline-item {
  display: grid;
  gap: 0.12rem;
  padding: 0.38rem 0.44rem;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--sage) 10%, transparent);
}

.timeline-item time {
  color: var(--copper-2);
  font-size: 0.56rem;
  font-weight: 850;
  text-transform: uppercase;
}

.timeline-item strong {
  color: var(--heading);
  font-size: 0.62rem;
}

.timeline-item span {
  display: block;
  color: var(--muted);
  font-size: 0.56rem;
  line-height: 1.24;
}

.two-col-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.64rem;
  margin-top: 0.64rem;
}

.three-col-panels,
.market-card-grid,
.tool-launch-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.64rem;
}

.krown-shell {
  display: grid;
  gap: 0.64rem;
}

.krown-command {
  display: grid;
  gap: 0.55rem;
}

.krown-readout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 5.2rem;
  gap: 0.64rem;
  align-items: stretch;
}

.krown-readout > div:first-child {
  display: grid;
  gap: 0.28rem;
  align-content: center;
  min-height: 5.1rem;
  padding: 0.58rem;
  border: 1px solid var(--line);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--copper) 11%, transparent), transparent),
    color-mix(in srgb, var(--panel-2) 88%, transparent);
}

.krown-readout span,
.krown-card span,
.krown-matrix-row span {
  color: var(--faint);
  font-size: 0.58rem;
  font-weight: 850;
  text-transform: uppercase;
}

.krown-readout strong {
  color: var(--heading);
  font-size: 1.12rem;
  line-height: 1;
}

.krown-readout p {
  max-width: 56rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.38;
}

.krown-score {
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  color: var(--heading);
  background: color-mix(in srgb, var(--text) 7%, transparent);
  font-size: 2.1rem;
  font-weight: 900;
}

.krown-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.64rem;
}

.krown-card {
  display: grid;
  gap: 0.58rem;
  min-height: 11.2rem;
}

.krown-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.krown-card header strong {
  color: var(--heading);
  font-size: 1.24rem;
  line-height: 1;
}

.krown-card.krown-good {
  border-color: color-mix(in srgb, var(--forest) 38%, var(--line));
}

.krown-card.krown-warn {
  border-color: color-mix(in srgb, var(--amber) 42%, var(--line));
}

.krown-card.krown-bad {
  border-color: color-mix(in srgb, var(--carmine) 46%, var(--line));
}

.krown-matrix {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.42rem;
}

.krown-matrix-row {
  display: grid;
  gap: 0.24rem;
  min-height: 6.2rem;
  padding: 0.5rem;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-2) 82%, transparent);
}

.krown-matrix-row.pass {
  border-color: color-mix(in srgb, var(--forest) 34%, var(--line));
}

.krown-matrix-row.fail {
  border-color: color-mix(in srgb, var(--carmine) 35%, var(--line));
}

.krown-matrix-row strong {
  color: var(--heading);
  font-size: 0.72rem;
}

.krown-matrix-row em {
  color: var(--copper-2);
  font-size: 0.67rem;
  font-style: normal;
}

.krown-matrix-row p,
.krown-source-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.64rem;
  line-height: 1.32;
}

.krown-level-table {
  min-width: 720px;
}

.market-card-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 0.64rem;
}

.market-card {
  display: grid;
  gap: 0.38rem;
  min-height: 8.3rem;
  padding: 0.62rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--card);
}

.market-card header {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.market-card strong {
  color: var(--heading);
}

.market-card .big-number {
  color: var(--heading);
  font-size: 1rem;
  font-weight: 900;
}

.strategy-grid {
  display: grid;
  grid-template-columns: 16.5rem minmax(0, 1fr) 18.5rem;
  gap: 0.64rem;
  align-items: start;
}

.strategy-book-list {
  display: grid;
  gap: 0.24rem;
}

.strategy-book {
  display: grid;
  gap: 0.18rem;
  width: 100%;
  min-height: 4.5rem;
  padding: 0.48rem;
  border-color: var(--line);
  background: transparent;
  text-align: left;
}

.strategy-book.active,
.strategy-book:hover {
  border-color: var(--line-strong);
  background: color-mix(in srgb, var(--copper) 14%, transparent);
}

.strategy-book > span {
  color: var(--copper-2);
  font-size: 0.54rem;
  font-weight: 900;
  text-transform: uppercase;
}

.strategy-book strong {
  color: var(--heading);
  font-size: 0.72rem;
  line-height: 1.18;
}

.strategy-book small {
  color: var(--muted);
  font-size: 0.62rem;
}

.strategy-book div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
}

.strategy-book em {
  padding: 0.1rem 0.22rem;
  border: 1px solid var(--line);
  color: var(--faint);
  font-size: 0.5rem;
  font-style: normal;
  font-weight: 850;
  text-transform: uppercase;
}

.strategy-detail,
.strategy-copy {
  display: grid;
  gap: 0.5rem;
}

.strategy-score-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.36rem;
}

.strategy-score-grid div {
  display: grid;
  gap: 0.08rem;
  min-height: 3.15rem;
  padding: 0.44rem;
  border: 1px solid var(--line);
  background: var(--card-soft);
}

.strategy-score-grid span {
  color: var(--faint);
  font-size: 0.55rem;
  font-weight: 850;
  text-transform: uppercase;
}

.strategy-score-grid strong {
  color: var(--heading);
  font-size: 1.02rem;
}

.strategy-copy p,
.strategy-rules p {
  margin: 0;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.38;
}

.strategy-rules {
  display: grid;
  gap: 0.32rem;
}

.strategy-rules p {
  padding: 0.42rem 0.48rem;
  border-left: 2px solid var(--copper);
  background: color-mix(in srgb, var(--text) 4%, transparent);
}

.strategy-positions-card,
.strategy-rules-card {
  margin-top: 0.64rem;
}

.notebook-grid {
  display: grid;
  grid-template-columns: minmax(18rem, 0.72fr) minmax(0, 1fr);
  gap: 0.64rem;
}

.idea-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 8rem;
  gap: 0.4rem;
  margin-top: 0.58rem;
}

.idea-form input[name="tags"],
.idea-form textarea,
.idea-form button {
  grid-column: 1 / -1;
}

.note-editor {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.58rem;
}

.note-row {
  grid-template-columns: minmax(7.6rem, 0.28fr) minmax(0, 1fr);
  border: 1px solid var(--line);
  background: var(--card-soft);
}

.note-fields {
  display: grid;
  gap: 0.36rem;
}

.note-fields .field-row {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 0.36rem;
}

.tool-launch-grid button {
  display: grid;
  gap: 0.36rem;
  min-height: 7.2rem;
  padding: 0.72rem;
  text-align: left;
  background: var(--card);
}

.tool-launch-grid strong {
  color: var(--heading);
  font-size: 0.86rem;
}

.tool-launch-grid span {
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.35;
}

.tool-drawer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(22rem, 37rem);
  animation: drawerFade 160ms ease-out;
}

.drawer-scrim {
  width: 100%;
  min-height: 100vh;
  border: 0;
  border-radius: 0;
  background: rgba(0, 0, 0, 0.48);
}

.drawer-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100vh;
  min-width: 0;
  padding: 1rem;
  overflow: hidden;
  border-left: 1px solid var(--line-strong);
  background: var(--app-bg);
  box-shadow: -18px 0 46px var(--shadow);
  animation: drawerSlide 190ms cubic-bezier(0.2, 0.85, 0.22, 1);
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  align-items: center;
  padding-bottom: 0.72rem;
  border-bottom: 1px solid var(--line);
}

.drawer-body {
  display: grid;
  align-content: start;
  gap: 0.62rem;
  min-width: 0;
  overflow-y: auto;
  padding-top: 0.72rem;
}

.tool-card {
  display: grid;
  gap: 0.5rem;
  padding: 0.68rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--card);
}

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

.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.42rem;
}

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

.check-row {
  display: flex;
  gap: 0.42rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.72rem;
}

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

.inline-admin-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 7rem auto;
  gap: 0.36rem;
  align-items: end;
}

.inline-admin-form input,
.inline-admin-form select {
  min-width: 0;
}

.admin-list {
  max-height: 21rem;
  overflow: auto;
}

.admin-row {
  gap: 0.42rem;
}

.watchlist-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
}

.watchlist-pills button {
  min-height: 1.65rem;
  padding: 0.22rem 0.45rem;
}

.watchlist-pills button.active {
  border-color: color-mix(in srgb, var(--copper-bright) 72%, transparent);
  color: var(--heading);
  background: color-mix(in srgb, var(--copper) 16%, transparent);
}

.tool-card textarea[name="symbols"] {
  min-height: 12rem;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.7rem;
  line-height: 1.5;
}

.tool-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.42rem;
}

.tool-stat {
  display: grid;
  gap: 0.12rem;
  padding: 0.5rem;
  border: 1px solid var(--line);
  background: var(--card-soft);
}

.tool-stat span {
  color: var(--faint);
  font-size: 0.6rem;
  font-weight: 850;
  text-transform: uppercase;
}

.tool-stat strong {
  color: var(--heading);
  font-size: 0.9rem;
}

.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.34rem;
}

.tool-result textarea {
  min-height: 16rem;
}

pre {
  margin: 0;
  padding: 0.68rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--card-soft);
  color: var(--text);
  white-space: pre-wrap;
}

.empty-state {
  padding: 0.7rem;
  border: 1px dashed var(--line);
  color: var(--muted);
  background: color-mix(in srgb, var(--text) 4%, transparent);
}

@keyframes drawerFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes drawerSlide {
  from { transform: translateX(1.8rem); }
  to { transform: translateX(0); }
}

[hidden] {
  display: none !important;
}

@media (max-width: 1100px) {
  body.signal-desk {
    padding: 0.75rem;
  }

  .ja-shell {
    grid-template-columns: 8.55rem minmax(0, 1fr);
    width: calc(100vw - 1.5rem);
    min-height: calc(100vh - 1.5rem);
  }

  .ja-sidebar {
    gap: 0.34rem;
    padding: 0.56rem 0.42rem;
  }

  .ja-brand {
    gap: 0.34rem;
    padding-bottom: 0.38rem;
  }

  .ja-mark {
    width: 1.82rem;
    height: 1.82rem;
  }

  .ja-mark::before {
    left: 0.34rem;
    top: 0.12rem;
    width: 0.76rem;
    height: 1.48rem;
    border-left-width: 0.18rem;
    border-bottom-width: 0.18rem;
  }

  .ja-mark::after {
    left: 0.66rem;
    top: 0.5rem;
    width: 0.34rem;
    height: 0.9rem;
    border-left-width: 0.18rem;
    border-bottom-width: 0.18rem;
  }

  .ja-brand strong {
    font-size: 0.62rem;
  }

  .ja-brand span:not(.ja-mark) {
    font-size: 0.36rem;
  }

  .ja-nav button {
    grid-template-columns: 1.06rem minmax(0, 1fr);
    min-height: 1.48rem;
    gap: 0.26rem;
    padding: 0.16rem 0.3rem;
    font-size: 0.58rem;
  }

  .ja-tool-nav h2,
  .active-deal h2 {
    margin-bottom: 0.16rem;
    font-size: 0.54rem;
  }

  .ja-tool-nav button {
    min-height: 1.28rem;
    padding: 0.12rem 0.3rem;
    font-size: 0.54rem;
  }

  .active-deal {
    padding: 0.34rem;
  }

  .active-deal span {
    display: none;
  }

  .progress-track {
    height: 0.22rem;
  }

  .ja-main {
    padding: 0.72rem;
  }

  .ja-topbar {
    grid-template-columns: 1.8rem minmax(10rem, 1fr) auto;
    gap: 0.42rem;
    margin-bottom: 0.68rem;
  }

  .topbar-actions {
    gap: 0.24rem;
  }

  .topbar-actions > span:not(.profile-mark) {
    max-width: 8rem;
    padding: 0.32rem 0.38rem;
    font-size: 0.58rem;
  }

  .topbar-actions > span:not(.profile-mark):first-child {
    display: none;
  }

  .topbar-actions button {
    min-height: 1.58rem;
    padding: 0.14rem 0.32rem;
    font-size: 0.58rem;
  }

  .profile-mark {
    width: 1.7rem;
    height: 1.7rem;
  }

  .command-head {
    gap: 0.55rem;
    margin-bottom: 0.6rem;
  }

  h1 {
    font-size: 1.02rem;
  }

  .command-head p {
    font-size: 0.64rem;
    line-height: 1.34;
  }

  .date-control {
    gap: 0.28rem;
  }

  .date-control span,
  .date-control button {
    padding: 0.3rem 0.38rem;
    font-size: 0.58rem;
  }

  .metric-row {
    gap: 0.42rem;
    margin-bottom: 0.42rem;
  }

  .metric-card {
    min-height: 4.12rem;
    padding: 0.48rem;
  }

  .metric-card::before {
    width: 1.2rem;
    height: 1.2rem;
  }

  .metric-card span,
  .panel-head span {
    font-size: 0.52rem;
  }

  .metric-card strong {
    font-size: 0.86rem;
  }

  .metric-card small {
    font-size: 0.56rem;
  }

  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr) 14.4rem;
    gap: 0.42rem;
  }

  .krown-grid,
  .krown-matrix {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.42rem;
  }

  .krown-readout {
    grid-template-columns: minmax(0, 1fr) 4.4rem;
    gap: 0.42rem;
  }

  .krown-score {
    font-size: 1.7rem;
  }

  .strategy-grid {
    grid-template-columns: 13.4rem minmax(0, 1fr) 14rem;
    gap: 0.42rem;
  }

  .strategy-score-grid {
    gap: 0.28rem;
  }

  .strategy-score-grid div {
    min-height: 2.7rem;
    padding: 0.34rem;
  }

  .right-stack,
  .lower-grid {
    gap: 0.42rem;
  }

  .lower-grid {
    grid-template-columns: 0.75fr 1.1fr 0.72fr;
    margin-top: 0.42rem;
  }

  .ja-card {
    padding: 0.52rem;
  }

  .panel-head {
    gap: 0.42rem;
    margin-bottom: 0.4rem;
  }

  table {
    min-width: 580px;
  }

  .recent-table table {
    min-width: 0;
  }

  .recent-table th:nth-child(3),
  .recent-table td:nth-child(3),
  .recent-table th:nth-child(4),
  .recent-table td:nth-child(4),
  .recent-table th:nth-child(7),
  .recent-table td:nth-child(7) {
    display: none;
  }

  th,
  td {
    padding: 0.38rem 0.3rem;
  }

  .compact-item,
  .event-item,
  .review-item,
  .activity-item {
    padding: 0.36rem;
  }

  .event-item p,
  .review-item p,
  .activity-item p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .regime-box {
    grid-template-columns: 4.2rem minmax(0, 1fr);
    gap: 0.42rem;
    min-height: 8.1rem;
  }

  .donut {
    width: 4rem;
    height: 4rem;
  }

  .donut span {
    width: 2.7rem;
    height: 2.7rem;
    font-size: 0.8rem;
  }

  .chart-stage,
  .tv-chart,
  .cached-chart {
    height: 7.2rem;
    min-height: 7.2rem;
  }

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

  .tv-workspace-layout {
    --tv-rail-width: 12.2rem;
  }

  .chart-panel.chart-large .chart-stage,
  .chart-panel.chart-large .tv-chart,
  .chart-panel.chart-large .cached-chart {
    min-height: 20rem;
  }

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

@media (max-width: 860px) {
  body.signal-desk {
    padding: 0.55rem;
  }

  .ja-shell {
    width: calc(100vw - 1.1rem);
    min-height: calc(100vh - 1.1rem);
  }

  .dashboard-grid,
  .lower-grid,
  .strategy-grid {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .right-stack,
  .lower-grid {
    grid-template-columns: repeat(3, minmax(14rem, 1fr));
    overflow-x: auto;
  }

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

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

@media (max-width: 680px) {
  body.signal-desk {
    padding: 0.45rem;
    font-size: 12px;
  }

  .ja-shell {
    grid-template-columns: minmax(0, 1fr);
    width: calc(100vw - 0.9rem);
    border-radius: 8px;
  }

  .ja-sidebar {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.55rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .ja-main,
  .ja-sidebar {
    padding: 0.7rem;
  }

  .active-deal {
    margin-top: 0;
    padding: 0.46rem;
  }

  .active-deal span {
    -webkit-line-clamp: 1;
  }

  .ja-sidebar,
  .command-head,
  .panel-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .ja-nav,
  .ja-tool-nav {
    display: flex;
    overflow-x: auto;
    padding-bottom: 0.1rem;
  }

  .ja-nav button,
  .ja-tool-nav button {
    flex: 0 0 11rem;
  }

  .ja-tool-nav h2 {
    flex: 0 0 3.8rem;
    align-self: center;
  }

  .metric-row,
  .right-stack,
  .lower-grid,
  .two-col-panels,
  .three-col-panels,
  .market-card-grid,
  .strategy-book-list,
  .strategy-score-grid,
  .strategy-grid,
  .tool-launch-grid,
  .krown-readout,
  .krown-grid,
  .krown-matrix,
  .notebook-grid,
  .tool-grid,
  .tool-stats,
  .mini-score-grid,
  .compact-timeline {
    grid-template-columns: minmax(0, 1fr);
  }

  .chart-controls,
  .date-control {
    justify-content: start;
    flex-wrap: wrap;
  }

  .chart-controls select {
    width: 100%;
  }

  .mini-chart-grid,
  .tv-workspace-layout,
  .inline-admin-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .tv-split-handle {
    display: none;
  }

  .tv-workspace-chart,
  .tv-workspace-layout {
    min-height: 24rem;
  }

  .chart-stage,
  .tv-chart,
  .cached-chart {
    height: 12rem;
    min-height: 12rem;
  }

  .note-row,
  .note-fields .field-row,
  .regime-box {
    grid-template-columns: minmax(0, 1fr);
  }

  .tool-drawer {
    grid-template-columns: minmax(0, 1fr);
  }

  .drawer-scrim {
    display: none;
  }
}

@media (max-width: 460px) {
  .topbar-actions > span:not(.profile-mark),
  .topbar-actions button,
  .date-control button,
  .date-control span {
    flex: 1 1 100%;
    max-width: none;
  }

  .idea-form {
    grid-template-columns: minmax(0, 1fr);
  }
}
