:root {
  --ink: #172033;
  --muted: #5d6780;
  --line: #d8dfeb;
  --paper: #f6f3ea;
  --panel: rgba(255, 255, 255, 0.82);
  --accent: #115e59;
  --accent-soft: #d7efe7;
  --warn: #9a3412;
  --shadow: 0 22px 55px rgba(23, 32, 51, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(17, 94, 89, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(154, 52, 18, 0.14), transparent 24%),
    linear-gradient(180deg, #fbfaf5, var(--paper));
  font-family: Georgia, "Times New Roman", serif;
}

.app-frame {
  min-height: 100vh;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-height: 4rem;
  padding: 0.55rem 0.85rem;
  background: rgba(255, 255, 255, 0.78);
  border-bottom: 1px solid rgba(216, 223, 235, 0.92);
  box-shadow: 0 10px 28px rgba(23, 32, 51, 0.08);
  backdrop-filter: blur(14px);
}

.app-main {
  min-width: 0;
}

.app-brand {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  flex: 0 0 auto;
  min-height: 2.75rem;
  padding: 0.45rem;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
}

.app-brand:hover,
.app-brand.is-active {
  background: rgba(17, 94, 89, 0.08);
}

.app-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.05rem;
  height: 2.05rem;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.app-brand strong,
.app-brand small {
  display: block;
  line-height: 1.2;
}

.app-brand small {
  margin-top: 0.15rem;
  font-size: 0.74rem;
}

.app-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1 1 auto;
  min-width: 0;
}

.app-nav-menu {
  position: relative;
}

.app-nav-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  min-height: 2.3rem;
  padding: 0.38rem 0.62rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.app-nav-heading::after {
  content: "";
  width: 0.36rem;
  height: 0.36rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-0.12rem) rotate(45deg);
  opacity: 0.72;
}

.app-nav-menu:hover .app-nav-heading::after,
.app-nav-menu:focus-within .app-nav-heading::after {
  transform: translateY(0.1rem) rotate(225deg);
}

.app-nav-menu:hover .app-nav-heading,
.app-nav-menu:focus-within .app-nav-heading {
  background: rgba(17, 94, 89, 0.08);
}

.app-nav-menu.is-active .app-nav-heading {
  background: var(--accent-soft);
  color: #0f3f3b;
}

.app-nav-links {
  position: absolute;
  top: 100%;
  left: 0;
  display: none;
  min-width: 14.5rem;
  padding: 0.5rem 0.35rem 0.35rem;
  border: 1px solid rgba(216, 223, 235, 0.95);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 40px rgba(23, 32, 51, 0.16);
  backdrop-filter: blur(14px);
}

.app-nav-menu:hover .app-nav-links,
.app-nav-menu:focus-within .app-nav-links {
  display: grid;
  gap: 0.12rem;
}

.app-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 2.05rem;
  padding: 0.38rem 0.48rem;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.15;
}

.app-nav-link:hover {
  background: rgba(17, 94, 89, 0.07);
}

.app-nav-link.is-active {
  background: var(--accent-soft);
  color: #0f3f3b;
  font-weight: 700;
}

.app-nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #fee2e2;
  color: #991b1b;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
}

.app-user-menu {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-left: auto;
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.app-sign-out {
  min-height: 2rem;
  padding: 0.32rem 0.68rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--ink);
  cursor: pointer;
  font-size: 0.76rem;
}

.app-sign-out:hover {
  background: #f7f9fc;
}

.auth-header {
  justify-content: center;
}

.auth-shell {
  display: grid;
  place-items: start center;
  min-height: calc(100vh - 4rem);
  padding: 5rem 1rem 3rem;
}

.auth-panel {
  width: min(100%, 28rem);
  padding: 2rem;
  border: 1px solid rgba(216, 223, 235, 0.95);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.auth-panel h1 {
  margin-top: 0.35rem;
  font-size: 2.8rem;
}

.auth-form {
  display: grid;
  gap: 1rem;
  margin-top: 1.6rem;
}

.auth-form label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.auth-form input[type="email"],
.auth-form input[type="password"] {
  width: 100%;
  height: 2.7rem;
  padding: 0 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font: inherit;
}

button {
  font: inherit;
}

.flash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1rem auto 0;
  max-width: 1200px;
  padding: 0.85rem 1rem;
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow);
}

.flash-message {
  min-width: 0;
}

.flash-action {
  flex: 0 0 auto;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.flash-action:hover {
  color: var(--accent);
}

.dashboard-shell {
  max-width: 1680px;
  margin: 0 auto;
  padding: 1rem 0.5rem 2rem;
}

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

.eyebrow,
.summary-label,
.panel-header span,
small {
  color: var(--muted);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
}

h1, h2, h3 {
  margin: 0;
}

h1 {
  font-size: clamp(1.85rem, 4vw, 2.9rem);
  line-height: 1.05;
}

.hero-copy {
  max-width: 48rem;
  font-size: 0.98rem;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

.ledger-filters {
  display: flex;
  gap: 0.75rem;
  align-items: end;
  flex-wrap: wrap;
}

.ledger-filters label {
  display: grid;
  gap: 0.2rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.settings-form {
  display: grid;
  gap: 1rem;
  max-width: 42rem;
}

.settings-form label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.settings-form input[type="text"],
.settings-form input[type="password"] {
  width: 100%;
  height: 2.7rem;
  padding: 0 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font: inherit;
}

.settings-callout {
  display: grid;
  gap: 0.55rem;
  max-width: 52rem;
  margin-bottom: 1.35rem;
  padding: 0.85rem 0 0.85rem 1rem;
  border-left: 3px solid var(--accent);
}

.settings-callout p {
  margin: 0.2rem 0 0;
  color: var(--muted);
}

.settings-code {
  display: block;
  width: fit-content;
  max-width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.settings-code-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 100%;
}

.settings-code-row .settings-code {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}

.settings-copy-button {
  flex: 0 0 auto;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 0.9rem 1.2rem;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.button-primary {
  background: var(--ink);
  color: white;
}

.button-secondary {
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
}

.button-secondary:hover {
  background: #f7f9fc;
}

a {
  color: var(--accent);
}

.detail-hero {
  align-items: start;
}

.status-stack {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.summary-card,
.panel,
.recommendation-card {
  backdrop-filter: blur(12px);
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow);
}

.summary-card {
  border-radius: 14px;
  padding: 0.7rem 0.85rem;
}

.summary-card strong {
  display: block;
  margin-top: 0.15rem;
  font-size: 1.4rem;
}

.attribution-requirement {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.8rem;
  margin: 0.75rem 0 1rem;
}

.attribution-requirement > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 0.85rem 1rem;
}

.attribution-requirement strong {
  display: block;
  margin-top: 0.2rem;
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1.2;
}

.assignment-summary {
  margin: 0.75rem 0 1rem;
  display: inline-block;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.assignment-summary table {
  width: auto;
  min-width: 0;
}

.assignment-summary th,
.assignment-summary td {
  padding: 0.45rem 0.65rem;
  white-space: nowrap;
}

.assignment-summary th:nth-child(n + 2),
.assignment-summary td:nth-child(n + 2) {
  width: 4.5rem;
}

.assignment-summary td:nth-child(n + 2) {
  text-align: right;
}

.panel {
  border-radius: 18px;
  padding: 0.65rem 0.55rem;
  margin-bottom: 0.85rem;
  overflow: visible;
}

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

.table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  padding-top: 0;
  padding-bottom: 0.8rem;
}

table {
  width: 100%;
  border-collapse: collapse;
}

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

th {
  color: var(--muted);
  font-weight: 600;
  text-align: center;
}


.ticker-performance-shell .ticker-performance-filter-panel {
  position: sticky;
  top: 4.1rem;
  z-index: 20;
}

.ticker-performance-column-guide {
  display: grid;
  grid-template-columns: 12fr 8fr 8fr 8fr 8fr 8fr 7fr 7fr 8fr 8fr 6fr 12fr;
  gap: 0;
  min-width: 64rem;
  margin-top: 0.55rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
  overflow-x: hidden;
}

.ticker-performance-table {
  table-layout: fixed;
  min-width: 64rem;
}

.ticker-performance-column-guide span {
  padding: 0.2rem 0.45rem;
}

.ticker-performance-col-symbol { width: 12%; }
.ticker-performance-col-open { width: 8%; }
.ticker-performance-col-closed { width: 8%; }
.ticker-performance-col-premium { width: 8%; }
.ticker-performance-col-real-app { width: 8%; }
.ticker-performance-col-unreal-app { width: 8%; }
.ticker-performance-col-div { width: 7%; }
.ticker-performance-col-fees { width: 7%; }
.ticker-performance-col-pl { width: 8%; }
.ticker-performance-col-weekly { width: 8%; }
.ticker-performance-col-days { width: 6%; }
.ticker-performance-col-avg-cost { width: 12%; }

.ticker-performance-column-guide span:not(:first-child) {
  text-align: right;
}

.ticker-performance-closed-only-row > td {
  background: #e2e8f0;
}

.ticker-performance-total-row > th,
.ticker-performance-total-row > td {
  background: #f8fafc;
  border-top: 2px solid var(--line);
  font-weight: 700;
}

.ticker-classifications-table {
  width: auto;
  min-width: min(100%, 24rem);
}

.ticker-classifications-table th,
.ticker-classifications-table td {
  white-space: nowrap;
}

.monitor-shell {
  max-width: 100%;
}

.prompt-workspace-shell {
  max-width: 1480px;
}

.prompt-workspace-hero {
  margin-bottom: 0.9rem;
}

.prompt-workspace-hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
}

.prompt-workspace-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: end;
  padding: 0.7rem 0.75rem;
}

.prompt-workspace-links {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.monitor-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
}


.account-monitor-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.account-monitor-title-row h2 {
  margin: 0;
}

.monitor-table th,
.monitor-table td {
  padding: 0.42rem 0.4rem;
  white-space: nowrap;
}

.monitor-table .table-subtext {
  margin-top: 0.08rem;
  font-size: 0.74rem;
}

.monitor-table .pill,
.monitor-table .strike-badge,
.monitor-table .exp-badge,
.monitor-table .roll-badge,
.monitor-table .pricing-status {
  padding: 0.16rem 0.42rem;
}

.monitor-table .inline-select,
.monitor-table .management-number-input {
  height: 1.75rem;
  border-radius: 6px;
}

.monitor-table .button-compact {
  min-height: 1.75rem;
  padding: 0.22rem 0.55rem;
}

.compact-review-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 0.5rem 2rem;
}

.compact-review-shell .compact-review-page-panel {
  border-radius: 18px;
  padding: 0.75rem;
}

.compact-review-shell .compact-review-page-panel > .panel-header {
  margin-bottom: 0.65rem;
}

.compact-review-shell .stack {
  display: grid;
  gap: 0.65rem;
}

.compact-review-shell .compact-review-panel {
  border-radius: 14px;
  padding: 0.6rem 0.65rem;
  margin-bottom: 0;
}

.compact-review-shell .compact-review-panel .panel-header {
  align-items: center;
  margin-bottom: 0.35rem;
}

.compact-review-shell .compact-review-panel h2 {
  font-size: 1.15rem;
}

.compact-review-shell .attribution-requirement {
  gap: 0.45rem;
  margin: 0.35rem 0 0.45rem;
}

.compact-review-shell .attribution-requirement > div {
  padding: 0.45rem 0.6rem;
}

.compact-review-shell .attribution-requirement strong {
  margin-top: 0.08rem;
  font-size: 1.05rem;
}

.compact-review-shell .compact-table-wrap {
  padding-top: 0;
  padding-bottom: 0.45rem;
}

.compact-review-shell .compact-detail-table th,
.compact-review-shell .compact-detail-table td,
.compact-review-shell .compact-review-table th,
.compact-review-shell .compact-review-table td {
  padding: 0.34rem 0.45rem;
  white-space: nowrap;
}

.compact-review-shell .compact-review-table input[type="checkbox"] {
  width: 0.95rem;
  height: 0.95rem;
  accent-color: var(--accent);
}

.compact-review-shell .inline-actions {
  margin-top: 0.35rem;
}

.compact-monitor-shell.dashboard-shell {
  padding-top: 1rem;
}

.compact-monitor-shell .detail-hero {
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.compact-monitor-shell .hero-copy {
  margin: 0.35rem 0 0;
  font-size: 1rem;
}

.compact-monitor-shell .summary-grid {
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.compact-monitor-shell .summary-card {
  border-radius: 14px;
  padding: 0.65rem 0.8rem;
}

.compact-monitor-shell .summary-card strong {
  margin-top: 0.15rem;
  font-size: 1.35rem;
}

.compact-monitor-shell .market-health {
  margin: -0.1rem 0 0.85rem;
  padding: 0.55rem 0.75rem;
}

.compact-monitor-shell .compact-filter-panel,
.compact-monitor-shell .account-monitor-section {
  border-radius: 18px;
  padding: 0.6rem 0.55rem;
  margin-bottom: 0.85rem;
}

.compact-monitor-shell .compact-filter-panel .panel-header,
.compact-monitor-shell .account-monitor-section .panel-header {
  margin-bottom: 0.35rem;
}

.compact-monitor-shell .compact-monitor-table-wrap {
  padding-top: 0;
  padding-bottom: 1rem;
}

.compact-monitor-shell .monitor-table th,
.compact-monitor-shell .monitor-table td {
  padding: 0.34rem 0.35rem;
}

.compact-monitor-shell .monitor-table thead tr:first-child th {
  padding-top: 0.3rem;
  padding-bottom: 0.25rem;
}

.management-text-input {
  width: min(32rem, 100%);
  min-height: 1.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.22rem 0.5rem;
  font: inherit;
}

.stock-price-badge {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 4.5rem;
  padding: 0.16rem 0.42rem;
  border-radius: 999px;
  text-align: right;
}

.stock-price-badge-itm {
  background: #dcfce7;
  color: #166534;
}

.stock-price-badge-otm {
  background: #fee2e2;
  color: #991b1b;
}

.itm-urgent-badge {
  display: inline;
  margin-right: 0.12rem;
  padding: 0;
  border: 0;
  color: #92400e;
  font-size: 0.58rem;
  font-weight: 600;
  line-height: 1;
  vertical-align: super;
}

.ticker-event-symbol {
  cursor: help;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.prompt-workspace-section {
  border-radius: 18px;
}

.prompt-workspace-header {
  align-items: center;
  margin-bottom: 0.55rem;
}

.prompt-workspace-header h2 {
  font-size: 1.45rem;
}

.prompt-workspace-table-wrap {
  padding-top: 0;
  padding-bottom: 0.75rem;
}

.prompt-workspace-table th,
.prompt-workspace-table td {
  padding: 0.45rem 0.45rem;
}

.prompt-workspace-table .pill {
  padding: 0.25rem 0.55rem;
}

.prompt-setting-select {
  min-width: 6.6rem;
  height: 1.75rem;
  border-radius: 6px;
}

.monitor-table thead tr:first-child th {
  padding-top: 0.45rem;
  padding-bottom: 0.35rem;
  border-bottom: 0;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
}

.monitor-table thead tr:nth-child(2) th {
  padding-top: 0.35rem;
}

.monitor-table thead tr:first-child th + th {
  border-left: 2px solid rgba(17, 94, 89, 0.14);
}

.open-options-table thead tr:nth-child(2) th:nth-child(2),
.open-options-table thead tr:nth-child(2) th:nth-child(9),
.open-options-table thead tr:nth-child(2) th:nth-child(11),
.open-options-table thead tr:nth-child(2) th:nth-child(14),
.open-options-table thead tr:nth-child(2) th:nth-child(20),
.open-options-table tbody td:nth-child(2),
.open-options-table tbody td:nth-child(9),
.open-options-table tbody td:nth-child(11),
.open-options-table tbody td:nth-child(14),
.open-options-table tbody td:nth-child(20) {
  border-left: 2px solid rgba(17, 94, 89, 0.14);
}

.uncovered-lots-table thead tr:nth-child(2) th:nth-child(2),
.uncovered-lots-table thead tr:nth-child(2) th:nth-child(9),
.uncovered-lots-table thead tr:nth-child(2) th:nth-child(12),
.uncovered-lots-table thead tr:nth-child(2) th:nth-child(14),
.uncovered-lots-table thead tr:nth-child(2) th:nth-child(18),
.uncovered-lots-table tbody td:nth-child(2),
.uncovered-lots-table tbody td:nth-child(9),
.uncovered-lots-table tbody td:nth-child(12),
.uncovered-lots-table tbody td:nth-child(14),
.uncovered-lots-table tbody td:nth-child(18) {
  border-left: 2px solid rgba(17, 94, 89, 0.14);
}

td.numeric-cell,
th.numeric-cell {
  text-align: right;
}

.dashboard-accounts-table .dashboard-account-meta-cell {
  text-align: right;
}

.prompt-workspace-table thead tr:nth-child(2) th:nth-child(3),
.prompt-workspace-table thead tr:nth-child(2) th:nth-child(10),
.prompt-workspace-table thead tr:nth-child(2) th:nth-child(14),
.prompt-workspace-table tbody td:nth-child(3),
.prompt-workspace-table tbody td:nth-child(10),
.prompt-workspace-table tbody td:nth-child(14) {
  border-left: 2px solid rgba(17, 94, 89, 0.14);
}

.monitor-table th:first-child,
.monitor-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 8px 0 16px rgba(23, 32, 51, 0.08);
  overflow: visible;
}

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

.watch-row {
  background: rgba(255, 237, 213, 0.48);
}

.watch-row td:first-child {
  background: rgba(255, 247, 237, 0.98);
}

.candidate-needs-target {
  background: rgba(239, 246, 255, 0.62);
}

.candidate-needs-target td:first-child {
  background: rgba(247, 251, 255, 0.98);
}

.button-compact {
  padding: 0.35rem 0.7rem;
  min-height: 2rem;
}

.inline-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.grouping-hidden-form {
  display: none;
}

.grouping-header-band {
  width: 2.25rem;
  min-width: 2.25rem;
  padding: 0;
}

.grouping-header-cell {
  width: 2.25rem;
  min-width: 2.25rem;
  padding: 0.25rem;
  text-align: center;
}

.grouping-checkbox {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
}

.grouping-action-button {
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border-color: #cbd5e1;
  color: #475569;
}

.grouping-action-button:hover {
  border-color: #94a3b8;
  color: var(--ink);
  background: #f8fafc;
}

.grouping-action-icon {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.inline-select-form {
  margin: 0;
}

.inline-select {
  min-width: 7.5rem;
  height: 2rem;
  padding: 0 0.45rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
}

.row-refresh-control {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.row-refresh-spinner {
  width: 0.8rem;
  height: 0.8rem;
  border: 2px solid rgba(17, 24, 39, 0.18);
  border-top-color: #0f766e;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
}

.monitor-table tbody tr.row-refreshing .row-refresh-spinner {
  opacity: 1;
  animation: row-refresh-spin 0.75s linear infinite;
}

@keyframes row-refresh-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.row-update-cell {
  animation: row-update-flash 1.8s ease-out;
}

.cell-update-flash {
  display: inline-block;
  border-radius: 6px;
  animation: row-update-flash 1.8s ease-out;
}

@keyframes row-update-flash {
  0% {
    background: #fde68a;
    box-shadow: inset 0 0 0 999px rgba(253, 230, 138, 0.85);
  }

  35% {
    background: #fef3c7;
    box-shadow: inset 0 0 0 999px rgba(253, 230, 138, 0.45);
  }

  100% {
    background: transparent;
    box-shadow: inset 0 0 0 999px rgba(253, 230, 138, 0);
  }
}

.account-import-form {
  display: flex;
  gap: 0.55rem;
  align-items: center;
}

.account-import-name,
.account-import-lookback,
.account-sort-order {
  width: min(100%, 18rem);
  height: 2rem;
  padding: 0 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
}

.account-import-start-date {
  width: 7rem;
}

.account-sort-order {
  width: 5rem;
}

.import-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.5rem;
  margin-right: 0.5rem;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.import-status-imported {
  background: #dcfce7;
  color: #166534;
}

.import-status-new {
  background: #eef2f7;
  color: var(--muted);
}

.exp-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5.5rem;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  font-weight: 600;
}

.exp-badge-urgent {
  background: #fee2e2;
  color: #991b1b;
}

.exp-badge-soon {
  background: #fef3c7;
  color: #92400e;
}

.exp-badge-safe {
  background: #dcfce7;
  color: #166534;
}

.strike-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.5rem;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
}

.strike-badge-recovery {
  background: #ede9fe;
  color: #6d28d9;
}

.roll-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.5rem;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  font-weight: 600;
}

.roll-badge-3 {
  background: #14532d;
  color: #ecfdf5;
}

.roll-badge-2 {
  background: #166534;
  color: #ecfdf5;
}

.roll-badge-1 {
  background: #dcfce7;
  color: #166534;
}

.roll-badge-warn {
  background: #f4c430;
  color: #3f2f00;
}

.roll-badge-low {
  background: #fee2e2;
  color: #b91c1c;
}

.roll-badge-negative {
  background: #991b1b;
  color: #fef2f2;
}

.roll-target-cell {
  position: relative;
}

.roll-target-cell:hover,
.roll-target-cell:focus-within {
  z-index: 30;
}

.premium-cell {
  position: relative;
}

.premium-value {
  display: inline-block;
}

.premium-popover {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  z-index: 8;
  display: none;
  min-width: 26rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  box-shadow: 0 12px 28px rgba(23, 32, 51, 0.16);
}

.monitor-table tbody tr:nth-last-child(-n + 3) .premium-popover {
  top: auto;
  bottom: calc(100% + 0.35rem);
}

.premium-cell:hover .premium-popover,
.premium-cell:focus-within .premium-popover {
  display: block;
}

.premium-popover-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.premium-popover-list {
  display: grid;
  gap: 0.3rem;
}

.premium-popover-row {
  display: grid;
  grid-template-columns: minmax(10rem, 1fr) 4.5rem 4.5rem 4.5rem;
  gap: 0.75rem;
  align-items: baseline;
}

.premium-popover-row > span:not(:first-child) {
  border-left: 1px solid rgba(17, 94, 89, 0.16);
  padding-left: 0.75rem;
}

.premium-row-label {
  color: var(--ink);
}

.premium-positive {
  color: #166534;
}

.premium-negative {
  color: #b91c1c;
}

.roll-target-summary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.pricing-age-cell {
  min-width: 3.25rem;
  text-align: right;
  white-space: nowrap;
}

.pricing-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  padding: 0.18rem 0.4rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.pricing-status-fresh {
  background: #dcfce7;
  color: #166534;
}

.pricing-status-recent {
  background: #ffedd5;
  color: #9a3412;
}

.pricing-status-stale {
  background: #fee2e2;
  color: #991b1b;
}

.pricing-status-empty,
.pricing-status-off {
  background: #f1f5f9;
  color: var(--muted);
}

.market-health {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: -0.25rem 0 1.25rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

.market-health-title {
  color: var(--ink);
  font-size: 0.95rem;
}

.market-health-copy {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
  text-align: right;
}

.market-health-fresh {
  border-left-color: #16a34a;
}

.market-health-recent {
  border-left-color: #f97316;
}

.market-health-stale {
  border-left-color: #dc2626;
  background: #fef2f2;
}

.market-health-error {
  border-left-color: #dc2626;
  background: #fef2f2;
}

.market-health-scheduler-stale {
  border-left-color: #f97316;
  background: #fff7ed;
}

.market-health-closed {
  border-left-color: #64748b;
  background: #f8fafc;
}

.market-health-empty,
.market-health-off {
  border-left-color: #94a3b8;
  background: #f8fafc;
}

.market-health-account {
  margin: 0.35rem 0 0.75rem;
  box-shadow: none;
}

.market-health-compact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  margin: 0;
  min-height: 1.65rem;
  padding: 0.18rem 0.5rem;
  border-left-width: 3px;
  border-radius: 999px;
  box-shadow: none;
  white-space: nowrap;
}

.market-health-compact .market-health-title {
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1;
}

.compact-monitor-shell .market-health.market-health-compact {
  margin: 0;
  padding: 0.18rem 0.5rem;
}

.roll-target-popover {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 40;
  display: none;
  min-width: 16rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  box-shadow: 0 12px 28px rgba(23, 32, 51, 0.16);
}

.monitor-table tbody tr:nth-last-child(-n + 3) .roll-target-popover {
  top: auto;
  bottom: 100%;
}

.monitor-table tbody tr:first-child .roll-target-popover {
  top: 100%;
  bottom: auto;
}

.roll-target-cell:hover .roll-target-popover,
.roll-target-cell:focus-within .roll-target-popover {
  display: block;
}

.roll-target-popover-head {
  margin-bottom: 0.5rem;
}

.roll-target-form {
  display: grid;
  grid-template-columns: 4.25rem 5.5rem auto;
  gap: 0.55rem;
  align-items: end;
}

.roll-target-form label {
  display: grid;
  gap: 0.2rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.roll-target-input {
  width: 100%;
  max-width: 5.5rem;
  height: 2rem;
  padding: 0 0.45rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
}

.option-candidate-strike-input {
  width: 5rem;
  max-width: 5rem;
}

.option-candidate-expiration-input {
  width: 10rem;
  max-width: 10rem;
}

.option-candidate-expiration-input option {
  background: white;
  color: var(--ink);
}

.option-candidate-expiration-input-stale {
  border-color: #dc2626;
  background: #fef2f2;
  color: #991b1b;
}

.option-candidate-expiration-input-future {
  border-color: #f59e0b;
  background: #fffbeb;
  color: #92400e;
}


.strike-target-input-recovery {
  border-color: #c4b5fd;
  background: #ede9fe;
  color: #6d28d9;
}

.roll-target-form .button {
  width: auto;
  white-space: nowrap;
}

.management-number-input {
  width: 100%;
  max-width: 5.5rem;
  height: 2rem;
  padding: 0 0.45rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
}

.target-weeks-input {
  width: 4.25rem;
}

.management-number-input.roll-target-input-forecast {
  border-color: #f59e0b;
  background: #fef3c7;
  color: #92400e;
}

.target-strike-input {
  width: 5.5rem;
}

.prompt-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.prompt-status-fresh {
  background: #dcfce7;
  color: #166534;
}

.prompt-status-recent {
  background: #ffedd5;
  color: #9a3412;
}

.prompt-status-stale {
  background: #e5e7eb;
  color: #4b5563;
}

.recommendation-row td {
  background: #f8fafc;
  color: var(--muted);
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}

.recommendation-row strong {
  color: var(--text);
  margin-right: 0.5rem;
}

.recommendation-row p {
  margin: 0.35rem 0 0;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: white;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.icon-button[data-copied="true"] {
  color: white;
  background: var(--accent);
  border-color: var(--accent);
}

.icon-button[hidden] {
  display: none;
}

.prompt-textarea-hidden {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.prompt-output {
  width: 100%;
  min-height: 28rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
  color: var(--ink);
  font: inherit;
  line-height: 1.5;
  resize: vertical;
}

.table-subtext {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.simple-list {
  margin: 0;
  padding-left: 1.1rem;
}

.prompt-action-cluster {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.prompt-inline-form {
  margin: 0;
}

.prompt-inline-status {
  color: var(--muted);
  font-size: 0.8rem;
}

.debug-output {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
}

.recommendation-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.recommendation-card {
  border-radius: 22px;
  padding: 1rem;
}

.recommendation-topline {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.pill,
.confidence {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.78rem;
}

.pill {
  background: var(--accent-soft);
  color: var(--accent);
}

.pill-neutral {
  background: #eef2f7;
  color: var(--muted);
}

.confidence-high {
  background: #fee2e2;
  color: #991b1b;
}

.confidence-medium {
  background: #ffedd5;
  color: var(--warn);
}

.confidence-low {
  background: #e0f2fe;
  color: #075985;
}

.empty-state {
  margin: 0;
  color: var(--muted);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 800px) {
  .app-header {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.45rem;
    padding: 0.55rem;
  }

  .app-brand {
    display: inline-flex;
    min-width: auto;
  }

  .app-nav {
    flex: 1 1 100%;
    gap: 0.2rem;
    overflow-x: auto;
    padding-bottom: 0.15rem;
  }

  .app-nav-menu {
    position: static;
  }

  .app-nav-links {
    position: fixed;
    top: 6.25rem;
    left: 0.55rem;
    right: 0.55rem;
    min-width: 0;
  }

  .hero {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions {
    width: 100%;
  }

  .hero-actions form {
    flex: 1;
  }

  .button {
    width: 100%;
  }
}

.account-label-with-notice {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.account-transaction-notice-badge,
.account-transaction-notice-warning {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.2rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.account-transaction-notice-badge {
  background: #d7efe7;
  color: #0f3f3b;
}

.account-transaction-notice-badge:hover {
  background: #b8dfd2;
}

.account-transaction-notice-warning {
  border: 1px solid #fed7aa;
  background: #fff7ed;
  color: var(--warn);
}

.account-transaction-notice-warning:hover {
  background: #ffedd5;
}

.account-transaction-notice-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(780px, calc(100vw - 2rem));
  max-height: min(760px, calc(100vh - 2rem));
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: white;
  box-shadow: 0 26px 70px rgba(23, 32, 51, 0.24);
  transform: translate(-50%, -50%);
  z-index: 80;
}

.account-transaction-notice-panel {
  display: grid;
  gap: 1rem;
  max-height: inherit;
  padding: 1rem;
  overflow: auto;
}

.account-transaction-notice-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.75rem;
}

.account-transaction-notice-header h3 {
  margin: 0;
  font-size: 1.2rem;
}

.account-transaction-notice-header span,
.account-transaction-notice-summary {
  color: var(--muted);
}

.account-transaction-notice-close {
  width: 1.8rem;
  height: 1.8rem;
}

.account-transaction-notice-summary,
.account-transaction-notice-error {
  margin: 0;
}

.account-transaction-notice-error {
  border: 1px solid #fed7aa;
  border-radius: 8px;
  padding: 0.75rem;
  background: #fff7ed;
  color: var(--warn);
}

.account-transaction-notice-table-wrap {
  max-height: 22rem;
}

.account-transaction-notice-table td,
.account-transaction-notice-table th {
  white-space: nowrap;
}

.account-transaction-notice-table td:nth-child(4) {
  min-width: 16rem;
  white-space: normal;
}

.account-transaction-notice-actions {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
}
