/* Focused workflow enhancements. Navy, cobalt and coral share the base theme. */
[hidden] {
  display: none !important;
}
body {
  background-image: radial-gradient(
    ellipse at 80% 0%,
    #dfe7ff70,
    transparent 48%
  );
}
main {
  padding-top: 30px;
}
.heading-row {
  margin-bottom: 19px;
}
h1 {
  font-weight: 600;
}
.data-banner {
  font-size: 11px;
  margin-bottom: 20px;
}
.button,
.chip,
.nav-item,
.review-button,
.pulse-tile {
  transition:
    background 0.18s,
    box-shadow 0.18s,
    transform 0.18s;
}
.button:active,
.pulse-tile:active {
  transform: translateY(1px);
}
.button.primary {
  box-shadow: 0 3px 9px #234fbd10;
}
.signal-card {
  border-radius: 12px;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.signal-card:hover {
  border-color: #aabdea;
  box-shadow: 0 6px 22px #1d30560a;
}
.signal-card.is-read {
  background: #edf2ff;
}
.signal-card.is-read:before {
  background: #aabdea;
}
.signal-title {
  font-size: 17px;
}
.signal-description {
  color: #59677f;
}
.focus-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 190px;
  gap: 28px;
  align-items: center;
  padding: 30px 36px;
  border-radius: 16px;
  background:
    radial-gradient(ellipse at 90% 0%, #345bbe, transparent 65%), #172747;
  color: #ffffff;
  margin: 0 0 26px;
  box-shadow: 0 10px 25px #234fbd10;
}
.focus-hero:before {
  content: "";
  position: absolute;
  right: -100px;
  top: -165px;
  width: 430px;
  height: 430px;
  border: 1px solid #ffffff0c;
  border-radius: 50%;
  pointer-events: none;
}
.hero-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #dbe5ff;
  font-size: 9px;
  font-weight: 550;
  letter-spacing: 1.7px;
}
.hero-kicker > span:last-child {
  color: #dbe5ff;
  font-size: 8px;
  letter-spacing: 0.7px;
  padding-left: 10px;
  border-left: 1px solid #92a8d855;
  margin-left: 4px;
}
.hero-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffb59f;
  box-shadow: 0 0 0 4px #ffb59f12;
}
.hero-copy h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(29px, 3vw, 39px);
  font-weight: 400;
  line-height: 1.13;
  letter-spacing: -1.2px;
  margin: 16px 0 13px;
}
.hero-copy p {
  color: #dbe5ff;
  max-width: 470px;
  font-size: 12px;
  line-height: 1.75;
}
.hero-actions {
  display: flex;
  align-items: center;
  gap: 21px;
  margin-top: 21px;
  flex-wrap: wrap;
}
.hero-actions .button {
  background: #ffb59f;
  border-color: #ffb59f;
  color: #17243f;
  font-size: 11px;
  padding: 11px 15px;
  border-radius: 7px;
}
.hero-actions .button:disabled {
  cursor: default;
  opacity: 0.6;
}
.hero-secondary {
  color: #dbe5ff;
  font-size: 11px;
  padding: 10px 0;
}
.mobile-progress {
  display: none;
}
.hero-progress {
  position: relative;
  text-align: center;
}
.hero-progress svg {
  width: 154px;
  height: 154px;
}
.hero-progress circle {
  fill: none;
  stroke-width: 3;
}
.progress-track {
  stroke: #92a8d83b;
}
.progress-value {
  stroke: #ffb59f;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: center;
  transition: stroke-dasharray 0.35s;
}
.hero-progress text {
  fill: #ffffff;
  font-size: 32px;
  font-weight: 400;
}

.desk-ask {
  margin: 18px 0 22px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--white);
}
.desk-ask-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.desk-ask-heading h2 {
  margin: 3px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  font-weight: 400;
}
.desk-ask-heading p {
  margin: 0;
  max-width: 360px;
  color: var(--muted);
  font-size: 10px;
}
.desk-ask form {
  display: flex;
  gap: 9px;
}
.desk-ask input {
  flex: 1;
  min-width: 0;
}
.desk-ask-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}
.desk-ask-examples button {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--brand);
  font-size: 10px;
}
.desk-ask-examples button:hover {
  background: var(--brand-soft);
}
#desk-ask-answer {
  margin: 12px 0 0;
  color: var(--ink);
  font-size: 11px;
}
#desk-ask-answer:empty {
  display: none;
}
#filing-list {
  scroll-margin-top: 20px;
}
@media (max-width: 680px) {
  .desk-ask-heading,
  .desk-ask form {
    align-items: stretch;
    flex-direction: column;
  }
  .desk-ask form .button {
    width: 100%;
  }
}
.hero-progress tspan {
  fill: #dbe5ff;
  font-size: 18px;
}
.hero-progress text.progress-caption {
  font-size: 7px;
  letter-spacing: 2px;
  fill: #dbe5ff;
}
.hero-progress > span {
  display: block;
  font-size: 10px;
  color: #dbe5ff;
  margin-top: 4px;
}
.pulse-section {
  margin: 0 0 22px;
}
.pulse-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 11px;
  gap: 15px;
}
.pulse-heading h2 {
  font-size: 14px;
  letter-spacing: -0.1px;
}
.pulse-heading h2 > span {
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 1px;
  margin-left: 11px;
  color: var(--muted);
}
.breadth {
  display: flex;
  gap: 14px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.pulse-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.pulse-tile {
  position: relative;
  text-align: left;
  border: 1px solid #dfe5f0;
  background: #edf2ff;
  padding: 14px 17px;
  border-radius: 10px;
  min-width: 0;
  overflow: hidden;
}
.pulse-tile.down {
  background: #fff0ec;
  border-color: #f4d6ce;
}
.pulse-tile:hover {
  transform: translateY(-2px);
  border-color: #aabdea;
  box-shadow: 0 5px 14px #234fbd08;
}
.pulse-tile.selected {
  outline: 2px solid #234fbd;
  outline-offset: 2px;
}
.pulse-symbol {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.pulse-symbol > span {
  color: #59677f;
}
.pulse-tile strong {
  display: block;
  color: #2452be;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.7px;
  margin: 7px 0 4px;
}
.pulse-tile.down strong {
  color: #ac4438;
}
.pulse-detail,
.pulse-date {
  display: block;
  font-size: 9px;
  color: #59677f;
}
.pulse-date {
  font-size: 8px;
  margin-top: 5px;
  color: #59677f;
}
.pulse-caption {
  margin-top: 9px;
  font-size: 9px;
  color: #59677f;
  line-height: 1.65;
}
.stats {
  border-radius: 10px;
  margin-bottom: 26px;
}
.stat {
  padding: 15px 19px;
}
.stat-value {
  font-size: 25px;
  margin: 6px 0;
}
.stat-label {
  font-size: 9px;
}
.queue-tabs,
.lens-bar {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: #eaf0fb;
  border: 1px solid #dfe5f0;
  border-radius: 9px;
  margin-bottom: 13px;
}
.queue-tabs button,
.lens-bar button {
  flex: 1;
  padding: 9px 8px;
  font-size: 11px;
  color: #59677f;
  border-radius: 6px;
  white-space: nowrap;
}
.queue-tabs button.active,
.lens-bar button.active {
  background: white;
  color: #234fbd;
  box-shadow: 0 2px 5px #1d30560a;
  font-weight: 600;
}
.queue-explainer {
  font-size: 11px;
  color: #59677f;
  margin: -2px 0 15px;
  line-height: 1.65;
}
#queue-tools {
  scroll-margin-top: 20px;
}
.filter-token {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 6px 11px;
  border: 1px solid #aabdea;
  border-radius: 15px;
  font-size: 10px;
  background: #edf2ff;
  margin: 0 0 12px;
}
.review-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 7px;
  flex-wrap: wrap;
}
.review-button {
  font-size: 10px;
  color: #59677f;
  padding: 7px 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.review-button:hover {
  color: #234fbd;
}
.review-button svg {
  width: 13px;
  height: 13px;
  stroke-width: 1.35;
}
.review-button.is-saved {
  color: #6b45b4;
}
.review-button.is-saved svg {
  fill: #dfe7ff;
}
.review-button.is-reviewed {
  color: #234fbd;
}
.review-button.note-indicator {
  margin-left: auto;
}
.filing-workspace {
  background: #edf2ff;
  border: 1px solid #dfe5f0;
  padding: 20px;
  border-radius: 11px;
  margin-top: 23px;
}
.filing-workspace h3 {
  margin: 0;
  font-size: 15px;
}
.filing-workspace .section-heading {
  margin-bottom: 3px;
}
.filing-workspace .review-actions {
  margin-bottom: 14px;
}
.filing-workspace label {
  display: block;
  font-size: 11px;
  font-weight: 550;
  margin-bottom: 8px;
}
textarea {
  width: 100%;
  border: 1px solid #dfe5f0;
  background: #ffffff;
  border-radius: 7px;
  padding: 12px;
  font: inherit;
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink);
  resize: vertical;
  min-height: 100px;
}
textarea:focus-visible {
  outline: 2px solid #234fbd;
  outline-offset: 2px;
}
.note-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}
.note-footer small {
  color: #59677f;
  font-size: 9px;
}
.note-footer .button {
  font-size: 10px;
  white-space: nowrap;
}
.next-question {
  border-top: 1px solid #dfe5f0;
  margin-top: 19px;
  padding-top: 18px;
}
.next-question > span {
  font-size: 8px;
  font-weight: 650;
  letter-spacing: 1.4px;
  color: #234fbd;
}
.next-question p {
  color: #234fbd;
  font-size: 12px;
  margin: 9px 0;
}
.next-question .text-button {
  color: #234fbd;
  font-size: 11px;
  padding: 6px 0;
}
.question-starters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #eaf0fb;
}
.question-starters > span {
  color: #59677f;
  font-size: 8px;
  letter-spacing: 1px;
  margin-right: 5px;
}
.question-starters button {
  background: #f1edff;
  color: #654ca1;
  border: 1px solid #dfd7f3;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 10px;
}
.question-starters button:hover {
  background: #e8defb;
}
.question-starters button span {
  margin-left: 7px;
}
.evidence-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border: 1px solid #dfe5f0;
  background: #edf2ff;
  border-radius: 10px;
  margin: 18px 0;
}
.evidence-icon {
  font-size: 28px;
  color: #234fbd;
}
.evidence-strip > div {
  flex: 1;
}
.evidence-strip strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
}
.evidence-strip small {
  display: block;
  font-size: 10px;
  color: #59677f;
  margin-top: 4px;
}
.evidence-strip button {
  white-space: nowrap;
  font-size: 10px;
  color: #234fbd;
}
.lens-bar {
  margin: 0 0 19px;
}
.research-section {
  border-radius: 11px;
  border-top: 3px solid #aabdea;
}
.research-section .eyebrow {
  color: #59677f;
}
.claim button {
  padding: 6px 9px;
  margin-top: 12px;
  line-height: 1.6;
}
.research-promo {
  border-radius: 12px;
}
.empty {
  border-radius: 12px;
  background: #ffffff;
}
.signal-card,
.research-section {
  animation: settle-in 0.25s ease-out;
}
@keyframes settle-in {
  from {
    opacity: 0.6;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (max-width: 1100px) {
  .focus-hero {
    padding: 26px;
    grid-template-columns: 1fr 140px;
    gap: 18px;
  }
  .hero-progress svg {
    width: 132px;
    height: 132px;
  }
  .hero-actions {
    gap: 12px;
  }
  .pulse-tile {
    padding: 13px;
  }
  .pulse-detail {
    font-size: 8px;
  }
}
@media (max-width: 700px) {
  main {
    padding-top: 23px;
  }
  h1 {
    font-size: 28px;
  }
  .focus-hero {
    display: block;
    padding: 25px 22px 22px;
    border-radius: 13px;
  }
  .hero-copy h2 {
    font-size: 32px;
    margin-top: 18px;
  }
  .hero-copy p {
    font-size: 11px;
    max-width: 320px;
  }
  .hero-kicker {
    font-size: 8px;
    letter-spacing: 1.4px;
  }
  .hero-kicker > span:last-child {
    font-size: 7px;
  }
  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
    margin-top: 19px;
  }
  .hero-actions .button {
    width: 100%;
    min-height: 43px;
  }
  .hero-secondary {
    font-size: 10px;
  }
  .hero-progress {
    display: none;
  }
  .mobile-progress {
    display: grid;
    gap: 7px;
    color: #dbe5ff;
    font-size: 10px;
    margin-top: 12px;
  }
  .mobile-progress progress {
    width: 100%;
    height: 4px;
    border: 0;
    accent-color: #ffb59f;
  }
  .mobile-progress progress::-webkit-progress-bar {
    background: #334b7c;
    border-radius: 4px;
  }
  .mobile-progress progress::-webkit-progress-value {
    background: #ffb59f;
    border-radius: 4px;
  }
  .pulse-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    padding-bottom: 7px;
    gap: 9px;
  }
  .pulse-tile {
    flex: 0 0 44%;
    scroll-snap-align: start;
    padding: 13px 15px;
  }
  .pulse-tile strong {
    font-size: 25px;
  }
  .pulse-detail {
    font-size: 9px;
  }
  .pulse-heading h2 > span {
    display: none;
  }
  .pulse-caption {
    font-size: 9px;
  }
  .stat {
    padding: 12px 15px;
  }
  .stat-value {
    font-size: 23px;
  }
  .stat-note {
    display: none;
  }
  .queue-tabs,
  .lens-bar {
    gap: 2px;
    padding: 3px;
  }
  .queue-tabs button,
  .lens-bar button {
    padding: 9px 5px;
    font-size: 9px;
    min-height: 37px;
  }
  .signal-title {
    font-size: 16px;
  }
  .review-button {
    min-height: 34px;
    font-size: 10px;
  }
  .review-actions {
    gap: 14px;
  }
  .question-starters > span {
    flex-basis: 100%;
    margin-bottom: 3px;
  }
  .question-starters button {
    font-size: 9px;
    padding: 8px;
  }
  .evidence-strip {
    padding: 15px;
    gap: 10px;
    flex-wrap: wrap;
  }
  .evidence-strip strong {
    font-size: 11px;
  }
  .evidence-strip small {
    font-size: 9px;
  }
  .evidence-strip > button {
    margin-left: 33px;
  }
  .evidence-icon {
    font-size: 23px;
  }
  .filing-workspace {
    padding: 16px;
  }
  .note-footer {
    align-items: flex-start;
  }
  .note-footer small {
    max-width: 150px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================= */
/* Institutional Financial Upgrade: Dark Mode, Drawer, Tape & Badges */
/* ============================================================= */

/* Tabular figures for financial readability */
body,
table,
.stat-value,
.ticker,
.timestamp,
.pulse-tile,
.margin-value,
.scorecard-rate {
  font-variant-numeric: tabular-nums lining-nums;
}

.mono-sub,
.ticker-tag,
.score-badge,
.delta-chip,
.key-hint {
  font-family:
    ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

.key-hint {
  font-size: 9px;
  opacity: 0.6;
  margin-left: 4px;
}

/* ------------------------------------------------------------- */
/* Dark Theme Tokens & Overrides                                 */
/* ------------------------------------------------------------- */

[data-theme="dark"] {
  --ink: #f1f5f9;
  --muted: #94a3b8;
  --brand: #4f87ff;
  --brand-soft: #172445;
  --accent: #f59e0b;
  --bg: #0b0f19;
  --line: #22304d;
  --white: #131b2e;
  --orange: #f59e0b;
  --red: #f43f5e;
  --positive: #10b981;
  --shadow: 0 8px 30px #00000045;
}

[data-theme="dark"] body {
  background-color: var(--bg);
  background-image: radial-gradient(
    ellipse at 80% 0%,
    #17244540,
    transparent 48%
  );
  color: var(--ink);
}

[data-theme="dark"] .sidebar {
  background: #0f172a;
  border-right-color: var(--line);
}

[data-theme="dark"] .topbar {
  background: #0b0f19ea;
  border-bottom-color: var(--line);
}

[data-theme="dark"] .signal-card,
[data-theme="dark"] .panel,
[data-theme="dark"] .side-card,
[data-theme="dark"] .stat,
[data-theme="dark"] .research-promo,
[data-theme="dark"] .routine,
[data-theme="dark"] .alert-row,
[data-theme="dark"] .research-landing,
[data-theme="dark"] .research-section,
[data-theme="dark"] .comparison,
[data-theme="dark"] .filing-workspace,
[data-theme="dark"] .margin-card,
[data-theme="dark"] .credibility-scorecard {
  background: var(--white);
  border-color: var(--line);
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: #0d1424;
  border-color: var(--line);
  color: var(--ink);
}

[data-theme="dark"] .signal-card.is-read {
  background: #111a2e;
  border-color: #1e2c48;
}

[data-theme="dark"] .signal-card.is-read:before {
  background: #334b7a;
}

[data-theme="dark"] .signal-card.is-focused {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px #4f87ff40;
}

[data-theme="dark"] .source-quote {
  background: #0d1527;
  border-left-color: var(--brand);
  color: #e2e8f0;
}

[data-theme="dark"] .queue-tabs,
[data-theme="dark"] .lens-bar {
  background: #0d1527;
  border-color: var(--line);
}

[data-theme="dark"] .queue-tabs button.active,
[data-theme="dark"] .lens-bar button.active {
  background: var(--brand);
  color: #ffffff;
}

[data-theme="dark"] dialog {
  background: #0e1526;
  border-color: var(--line);
  color: var(--ink);
}

[data-theme="dark"] th {
  background: #111a2f;
  border-bottom-color: var(--line);
  color: #94a3b8;
}

[data-theme="dark"] td {
  border-bottom-color: var(--line);
}

[data-theme="dark"] .nav-item:hover,
[data-theme="dark"] .nav-item.active {
  background: #1e293b;
  color: #fff;
}

[data-theme="dark"] .chip {
  background: #111a2e;
  border-color: var(--line);
  color: var(--ink);
}

[data-theme="dark"] .tag {
  background: #172445;
  color: #93c5fd;
}

[data-theme="dark"] .tag.amber {
  background: #78350f44;
  color: #fcd34d;
}

/* ------------------------------------------------------------- */
/* Market Ribbon Tape                                            */
/* ------------------------------------------------------------- */

.market-tape {
  height: 46px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 24px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: none;
}
.market-tape::-webkit-scrollbar {
  display: none;
}
.tape-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 5px;
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.5px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  flex-shrink: 0;
}
.tape-status.open {
  background: #10b98118;
  color: #10b981;
}
.tape-status.closed {
  background: #59677f18;
  color: var(--muted);
}
.status-dot {
  font-size: 8px;
}
.status-hours {
  opacity: 0.7;
  font-size: 9px;
}
.tape-track {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.tape-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
  cursor: pointer;
}
.tape-chip:hover,
.tape-chip:focus-visible {
  border-color: var(--brand);
}
.tape-chip:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}
.tape-chip:hover .ticker {
  text-decoration: underline;
}
.tape-link-icon {
  color: var(--muted);
}
.tape-chip .ticker {
  font-weight: 600;
}
.tape-chip .price {
  color: var(--muted);
}
.tape-chip .delta.positive {
  color: var(--positive);
  font-weight: 600;
}
.tape-chip .delta.negative {
  color: var(--red);
  font-weight: 600;
}

/* ------------------------------------------------------------- */
/* Spoken Audio Brief Button                                     */
/* ------------------------------------------------------------- */

.hero-audio-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border-radius: 8px;
  background: #ffffff18;
  color: #ffffff;
  border: 1px solid #ffffff30;
  font-size: 11px;
  font-weight: 550;
  cursor: pointer;
  transition: all 0.2s;
}
.hero-audio-btn:hover {
  background: #ffffff28;
  border-color: #ffffff50;
}
.hero-audio-btn.playing {
  background: #10b98135;
  border-color: #10b981;
  color: #6ee7b7;
}
.audio-wave {
  display: inline-flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 12px;
}
.audio-wave span {
  width: 2.5px;
  height: 4px;
  background: currentColor;
  border-radius: 1px;
}
.hero-audio-btn.playing .audio-wave span:nth-child(1) {
  animation: wavePulse 0.5s infinite ease-in-out alternate;
}
.hero-audio-btn.playing .audio-wave span:nth-child(2) {
  animation: wavePulse 0.5s infinite ease-in-out 0.18s alternate;
}
.hero-audio-btn.playing .audio-wave span:nth-child(3) {
  animation: wavePulse 0.5s infinite ease-in-out 0.36s alternate;
}
@keyframes wavePulse {
  from {
    height: 3px;
  }
  to {
    height: 12px;
  }
}

/* ------------------------------------------------------------- */
/* Command Palette Dialog & Trigger                              */
/* ------------------------------------------------------------- */

.command-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 7px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  transition: all 0.15s;
}
.command-trigger-btn:hover {
  border-color: var(--brand);
  color: var(--ink);
}
.command-trigger-btn kbd {
  font-size: 10px;
  padding: 2px 6px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-family: inherit;
}
.theme-toggle-btn {
  font-size: 15px;
  padding: 6px 10px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
}

.command-dialog {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.45);
  padding: 0;
  width: min(640px, calc(100vw - 32px));
  max-height: 80vh;
  overflow: hidden;
}
.command-dialog::backdrop {
  background: rgba(10, 15, 25, 0.7);
  backdrop-filter: blur(5px);
}
.command-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.cmd-icon-big {
  font-size: 18px;
  color: var(--brand);
}
.command-header input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 4px 0;
  font-size: 15px;
  color: var(--ink);
  outline: none;
}
.command-list {
  max-height: 380px;
  overflow-y: auto;
  padding: 8px;
}
#command-status:empty {
  display: none;
}
.command-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s;
}
.command-item:hover,
.command-item.selected {
  background: var(--brand-soft);
  color: var(--ink);
}
.cmd-item-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.cmd-item-cat {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
}
.cmd-item-title {
  font-size: 13px;
  font-weight: 550;
  overflow-wrap: anywhere;
}
.cmd-item-tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: inherit;
}
.command-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 18px;
  background: var(--bg);
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}
.command-footer kbd {
  font-size: 10px;
  padding: 2px 5px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 3px;
}
.empty-commands {
  padding: 30px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* ------------------------------------------------------------- */
/* Shortcuts Cheatsheet Dialog                                   */
/* ------------------------------------------------------------- */

.shortcuts-dialog {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
  padding: 24px;
  width: min(600px, calc(100vw - 32px));
}
.shortcuts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 16px;
}
.shortcut-group h4 {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.shortcut-row kbd {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 4px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-family: ui-monospace, "SF Mono", monospace;
}

/* ------------------------------------------------------------- */
/* Management Credibility Scorecard & Visual Delta Badges        */
/* ------------------------------------------------------------- */

.credibility-scorecard {
  padding: 20px 24px;
  border-radius: 12px;
  background: var(--white);
  border: 1px solid var(--line);
  margin-bottom: 20px;
}
.scorecard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.scorecard-tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--brand);
}
.scorecard-header h3 {
  margin: 4px 0 0;
  font-size: 16px;
}
.scorecard-metric {
  text-align: right;
}
.scorecard-rate {
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
}
.scorecard-rate.good {
  color: var(--positive);
}
.scorecard-rate.mixed {
  color: var(--orange);
}
.scorecard-rate.poor {
  color: var(--red);
}
.scorecard-caption {
  font-size: 11px;
  color: var(--muted);
}
.scorecard-summary-bars {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.score-pill {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  font-family: ui-monospace, "SF Mono", monospace;
}
.score-pill.beat {
  background: #10b98118;
  color: #10b981;
  border: 1px solid #10b98135;
}
.score-pill.met {
  background: #3b82f618;
  color: #3b82f6;
  border: 1px solid #3b82f635;
}
.score-pill.miss {
  background: #f43f5e18;
  color: #f43f5e;
  border: 1px solid #f43f5e35;
}
.scorecard-explainer {
  font-size: 11px;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

.score-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.score-badge.beat {
  background: #10b98120;
  color: #10b981;
  border: 1px solid #10b98140;
}
.score-badge.miss {
  background: #f43f5e20;
  color: #f43f5e;
  border: 1px solid #f43f5e40;
}
.score-badge.met {
  background: #3b82f620;
  color: #3b82f6;
  border: 1px solid #3b82f640;
}

.val-pill {
  font-weight: 600;
  font-family: ui-monospace, "SF Mono", monospace;
}
.val-pill.actual {
  color: var(--ink);
}
.val-pill.target {
  color: var(--muted);
}

/* ------------------------------------------------------------- */
/* Margin Trajectory & Delta Highlights                          */
/* ------------------------------------------------------------- */

.margin-trajectory-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin: 14px 0 20px;
}
.results-chart {
  margin: 17px 0 22px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
}
.filters .chip[aria-pressed="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.results-chart figcaption {
  display: grid;
  gap: 2px;
  margin-bottom: 12px;
}
.results-chart figcaption strong {
  font-size: 12px;
}
.results-chart figcaption small {
  color: var(--muted);
  font-size: 10px;
}
.result-bars-row {
  display: grid;
  grid-template-columns: minmax(80px, 125px) minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.result-bars-row > strong {
  font-size: 11px;
}
.result-bars-row > div {
  display: grid;
  gap: 5px;
}
.result-bar {
  display: grid;
  grid-template-columns: minmax(75px, 115px) minmax(0, 1fr) 60px;
  align-items: center;
  gap: 7px;
  font-size: 10px;
}
.result-bar span {
  color: var(--muted);
}
.result-bar b {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.result-bar-track {
  display: block;
  width: 100%;
  height: 8px;
  border-radius: 6px;
  background: var(--brand-soft);
  overflow: hidden;
}
.result-bar-fill {
  fill: #a7b8db;
}
.result-bar-fill.current {
  fill: var(--brand);
}
.result-bar-fill.loss {
  fill: #c65347;
}
.result-bar-zero {
  stroke: var(--muted);
  vector-effect: non-scaling-stroke;
}
@media (max-width: 540px) {
  .result-bars-row {
    grid-template-columns: 1fr;
    gap: 5px;
  }
  .result-bar {
    grid-template-columns: minmax(65px, 100px) minmax(0, 1fr) 55px;
  }
}
.margin-card {
  padding: 14px 16px;
  border-radius: 9px;
  background: var(--white);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.margin-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--muted);
}
.margin-value {
  font-size: 22px;
  font-weight: 700;
}
.margin-delta {
  font-size: 11px;
  font-weight: 600;
}
.margin-delta.positive {
  color: var(--positive);
}
.margin-delta.negative {
  color: var(--red);
}
.margin-sub {
  font-size: 10px;
  color: var(--muted);
}

.delta-chip {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.delta-chip.positive {
  background: #10b98118;
  color: var(--positive);
}
.delta-chip.negative {
  background: #f43f5e18;
  color: var(--red);
}
.delta-chip.neutral {
  background: #59677f18;
  color: var(--muted);
}

.financial-table {
  width: 100%;
  border-collapse: collapse;
}
.financial-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.financial-table td {
  padding: 11px 14px;
  font-size: 12px;
  border-bottom: 1px solid var(--line);
}
.financial-table td.num {
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, "SF Mono", monospace;
}
.financial-table td.delta-cell {
  text-align: left;
}

.evidence-quote-hl {
  background: #f59e0b25;
  color: inherit;
  padding: 1px 3px;
  border-radius: 3px;
  font-weight: 600;
}

/* ------------------------------------------------------------- */
/* Slide-Over Drawer on Desktop & Bottom Sheet on Mobile         */
/* ------------------------------------------------------------- */

#detail-dialog {
  padding: 24px 28px;
  overflow-y: auto;
}
@media (min-width: 820px) {
  #detail-dialog {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    margin: 0;
    width: 640px;
    max-width: 90vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 16px 0 0 16px;
    border-right: none;
    box-shadow: -12px 0 45px rgba(0, 0, 0, 0.35);
    animation: drawerSlideIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  }
}
@keyframes drawerSlideIn {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}
@media (max-width: 819px) {
  #detail-dialog {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    margin: 0;
    width: 100vw;
    max-width: 100vw;
    max-height: 90vh;
    border-radius: 20px 20px 0 0;
    border-bottom: none;
    animation: sheetSlideUp 0.22s ease-out;
  }
  .shortcuts-grid {
    grid-template-columns: 1fr;
  }
  .command-trigger-btn .cmd-text,
  .command-trigger-btn kbd {
    display: none;
  }
}
@keyframes sheetSlideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}
