:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --panel: #ffffff;
  --panel-strong: #f8fafc;
  --text: #0f172a;
  --muted: #64748b;
  --line: #dbe3ee;
  --accent: #2563eb;
  --accent-dark: #1e40af;
  --success: #0f766e;
  --danger: #be123c;
  --shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.admin-body {
  min-height: 100vh;
  background: #eef2f7;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 70px;
  padding: 12px 24px;
  border-bottom: 1px solid #dbe3ee;
  background: rgba(248, 250, 252, 0.94);
  backdrop-filter: blur(14px);
}

.admin-brand {
  display: inline-flex;
  align-items: center;
  width: min(220px, 45vw);
}

.admin-brand img {
  display: block;
  width: 100%;
  height: auto;
}

.admin-top-actions,
.admin-inline-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.admin-shell {
  display: grid;
  gap: 16px;
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: 20px 24px 42px;
}

.admin-intro,
.admin-section,
.admin-config-panel,
.admin-metric-card {
  min-width: 0;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.admin-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
}

.admin-intro p {
  max-width: 760px;
  margin: 8px 0 0;
  color: #64748b;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.5;
}

.admin-status-box {
  display: flex;
  align-items: center;
  min-height: 42px;
  max-width: 360px;
  padding: 10px 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
}

.admin-status-box[data-tone="success"],
.admin-helper-text[data-tone="success"] {
  border-color: #bbf7d0;
  background: #dcfce7;
  color: #166534;
}

.admin-status-box[data-tone="error"],
.admin-helper-text[data-tone="error"] {
  border-color: #fecdd3;
  background: #fff1f2;
  color: #be123c;
}

.admin-status-box[data-tone="warning"],
.admin-helper-text[data-tone="warning"] {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.admin-tab-list {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 4px;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: #f8fafc;
}

.admin-tab-button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #475569;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

.admin-tab-button:hover,
.admin-tab-button:focus-visible {
  border-color: #bfdbfe;
  color: #1d4ed8;
  outline: none;
}

.admin-tab-button[aria-selected="true"] {
  border-color: #dbeafe;
  background: #fff;
  color: #0f172a;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.admin-tab-panel {
  display: grid;
  gap: 16px;
}

.admin-tab-panel[hidden] {
  display: none;
}

.admin-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.admin-metric-card {
  display: grid;
  gap: 6px;
  min-height: 112px;
  padding: 16px;
}

.admin-metric-card span {
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.admin-metric-card strong {
  color: #0f172a;
  font-size: 28px;
  line-height: 1;
}

.admin-metric-card small,
.admin-config-panel small,
.admin-table small {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.admin-section {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.admin-section-heading,
.admin-config-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.admin-section-heading p {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
}

.admin-mobile-section-toggle {
  display: none;
}

.admin-inline-status {
  color: #475569;
}

.admin-inline-status[data-tone="success"] {
  color: #047857;
}

.admin-inline-status[data-tone="warning"] {
  color: #b45309;
}

.admin-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.admin-recommendation-settings-grid {
  grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.1fr);
}

.admin-ops-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.admin-config-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.admin-config-note {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.5;
}

.admin-slider-row,
.admin-weight-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(120px, 180px) 72px 18px;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 0;
  border-top: 1px solid #edf2f7;
}

.admin-slider-row {
  border-top: 0;
}

.admin-slider-row > span,
.admin-weight-row > span {
  display: grid;
  gap: 3px;
}

.admin-slider-row strong,
.admin-weight-row strong {
  color: #0f172a;
  font-size: 13px;
}

.admin-slider-row em,
.admin-weight-row em {
  color: #64748b;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.admin-slider-row input[type="range"],
.admin-weight-row input[type="range"] {
  width: 100%;
  accent-color: #2563eb;
}

.admin-number-input,
.admin-field input,
.admin-select {
  width: 100%;
  min-height: 36px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
}

.admin-number-input {
  padding: 0 8px;
  text-align: right;
}

.admin-export-text {
  width: 100%;
  min-height: 150px;
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #0f172a;
  color: #dbeafe;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  resize: vertical;
}

.admin-score-config-panel .admin-export-text {
  min-height: 104px;
  max-height: 150px;
}

.admin-formula-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.admin-formula-list div {
  display: grid;
  grid-template-columns: minmax(80px, 0.7fr) minmax(0, 1.4fr);
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid #edf2f7;
}

.admin-formula-list dt {
  color: #0f172a;
  font-size: 13px;
  font-weight: 900;
}

.admin-formula-list dd {
  display: grid;
  gap: 3px;
  min-width: 0;
  margin: 0;
}

.admin-formula-list dd strong {
  color: #2563eb;
  font-size: 16px;
  line-height: 1.1;
}

.admin-formula-list dd span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.admin-formula-caption {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.4;
}

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.admin-table th,
.admin-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #edf2f7;
  color: #0f172a;
  font-size: 13px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.admin-table th {
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.admin-table td strong,
.admin-table td small {
  display: block;
}

.admin-table tr:last-child td {
  border-bottom: 0;
}

.admin-pareto-table-wrap {
  max-height: 620px;
  overflow: auto;
}

.admin-pareto-table {
  min-width: 1480px;
}

.admin-pareto-table tbody tr {
  cursor: pointer;
}

.admin-pareto-table tbody tr:hover,
.admin-pareto-table tbody tr:focus {
  background: #f8fafc;
  outline: none;
}

.admin-pareto-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 0;
}

.admin-pareto-column-paretorank {
  width: 72px;
}

.admin-pareto-column-rankscore {
  width: 108px;
}

.admin-pareto-metric-column {
  width: 112px;
}

.admin-pareto-column-candidate {
  width: 320px;
}

.admin-pareto-column-tier {
  width: 88px;
}

.admin-pareto-column-source,
.admin-pareto-column-family {
  width: 150px;
}

.admin-pareto-candidate-cell {
  min-width: 280px;
  max-width: 340px;
}

.admin-pareto-candidate-cell strong,
.admin-pareto-candidate-cell small {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-pareto-candidate-cell strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.25;
  white-space: nowrap;
}

.admin-pareto-candidate-cell small {
  color: #64748b;
  font-size: 11px;
  line-height: 1.25;
  white-space: nowrap;
}

.admin-pareto-candidate-cell .admin-pareto-candidate-narrative {
  margin-top: 4px;
  color: #334155;
  font-size: 12px;
  font-weight: 850;
}

.admin-pareto-candidate-cell .admin-pareto-candidate-affordance {
  display: inline-flex;
  width: fit-content;
  max-width: none;
  margin-top: 5px;
  padding: 3px 7px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
}

.admin-sort-button {
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 54px;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.admin-sort-button:hover,
.admin-sort-button:focus {
  background: #eef6ff;
  color: #1d4ed8;
  outline: none;
}

.admin-sort-button span,
.admin-sort-button small,
.admin-sort-button em {
  display: block;
}

.admin-sort-button small {
  color: #94a3b8;
  font-size: 10px;
  font-style: normal;
  text-transform: uppercase;
}

.admin-sort-button em {
  color: #64748b;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.admin-pareto-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.admin-pareto-summary-card {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: #f8fafc;
}

.admin-pareto-summary-card span {
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
}

.admin-pareto-summary-card strong {
  color: #0f172a;
  font-size: 17px;
  line-height: 1.15;
}

.admin-pareto-summary-card small {
  color: #64748b;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.35;
}

.admin-runtime-compact-strip,
.admin-pareto-mobile-cards {
  display: none;
}

.admin-pareto-mobile-card {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: #fff;
}

.admin-pareto-mobile-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.admin-pareto-mobile-card-heading small,
.admin-pareto-mobile-card > strong,
.admin-pareto-mobile-card p {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-pareto-mobile-card-heading small {
  color: #64748b;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.admin-pareto-mobile-card > strong {
  color: #0f172a;
  font-size: 15px;
  font-weight: 950;
  line-height: 1.25;
  white-space: nowrap;
}

.admin-pareto-mobile-card p {
  display: -webkit-box;
  margin: 0;
  color: #334155;
  font-size: 12px;
  font-weight: 760;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.admin-pareto-mobile-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.admin-pareto-mobile-metrics div {
  min-width: 0;
  padding: 8px;
  border: 1px solid #e5edf6;
  border-radius: 8px;
  background: #f8fafc;
}

.admin-pareto-mobile-metrics dt {
  color: #64748b;
  font-size: 10px;
  font-weight: 950;
}

.admin-pareto-mobile-metrics dd {
  margin: 3px 0 0;
  color: #0f172a;
  font-size: 14px;
  font-weight: 950;
}

.admin-survivor-list {
  display: grid;
  gap: 10px;
}

.admin-survivor-card {
  min-width: 0;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: #f8fafc;
}

.admin-survivor-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 54px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}

.admin-survivor-card summary::-webkit-details-marker {
  display: none;
}

.admin-survivor-card summary span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.admin-survivor-card summary strong,
.admin-survivor-card summary small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-survivor-card summary strong {
  color: #0f172a;
  font-size: 14px;
}

.admin-survivor-card summary small,
.admin-survivor-card summary em {
  color: #64748b;
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
}

.admin-survivor-card summary em {
  color: #0369a1;
  white-space: nowrap;
}

.admin-survivor-body {
  display: grid;
  gap: 12px;
  padding: 0 12px 12px;
}

.admin-survivor-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 2px 2px 8px;
}

.admin-survivor-title {
  margin: 0 0 2px;
  font-size: 14px;
  font-weight: 850;
  color: #0f172a;
}

.admin-survivor-count {
  color: #64748b;
  font-weight: 700;
}

.admin-survivor-card summary .admin-survivor-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  min-width: 0;
}

.admin-survivor-card summary .admin-survivor-summary-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.admin-survivor-open-button,
.admin-survivor-toggle-all {
  font-size: 12px;
  padding: 5px 10px;
  white-space: nowrap;
}

.admin-feature-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-feature-pill {
  display: inline-grid;
  gap: 2px;
  max-width: 260px;
  padding: 7px 9px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
}

.admin-feature-pill strong,
.admin-feature-pill small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-feature-pill strong {
  color: #0f172a;
  font-size: 12px;
  font-weight: 900;
}

.admin-feature-pill small {
  color: #475569;
  font-size: 11px;
  font-weight: 750;
}

.admin-history-chart {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.admin-history-svg {
  width: 100%;
  min-height: 220px;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: #f8fafc;
}

.admin-history-svg line {
  stroke: #cbd5e1;
  stroke-width: 1;
}

.admin-history-svg polyline {
  fill: none;
  stroke: #0f766e;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.admin-history-svg circle {
  fill: #0f766e;
  stroke: #fff;
  stroke-width: 1.5;
}

.admin-history-svg text {
  fill: #64748b;
  font-size: 10px;
  font-weight: 800;
}

.admin-history-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.admin-empty-cell {
  padding: 22px 12px;
  color: #64748b;
  text-align: center;
}

.admin-field {
  display: grid;
  gap: 7px;
}

.admin-field span {
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.admin-field input {
  padding: 0 10px;
}

.admin-select {
  padding: 0 10px;
  outline: none;
}

.admin-stock-query-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.7fr) repeat(3, minmax(120px, 0.75fr));
  gap: 12px;
  align-items: end;
}

.admin-stock-query-field {
  position: relative;
}

.admin-stock-suggestions {
  position: absolute;
  z-index: 15;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: grid;
  gap: 4px;
  max-height: 300px;
  padding: 8px;
  overflow-y: auto;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.12);
}

.admin-stock-suggestions button {
  display: grid;
  grid-template-columns: minmax(82px, 0.45fr) minmax(0, 1fr);
  gap: 2px 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #0f172a;
  text-align: left;
}

.admin-stock-suggestions button:hover,
.admin-stock-suggestions button:focus {
  background: #eff6ff;
  outline: none;
}

.admin-stock-suggestions strong {
  font-size: 13px;
  font-weight: 950;
}

.admin-stock-suggestions span {
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-stock-suggestions small,
.admin-suggestion-status {
  grid-column: 1 / -1;
  margin: 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.admin-stock-summary {
  display: grid;
  gap: 12px;
  min-height: 92px;
  padding: 14px;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: #f8fafc;
}

.admin-stock-title {
  display: grid;
  gap: 4px;
}

.admin-stock-title strong {
  color: #0f172a;
  font-size: 18px;
  line-height: 1.2;
}

.admin-stock-title span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.admin-stock-detail-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.admin-stock-detail-list div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #e5edf6;
  border-radius: 8px;
  background: #fff;
}

.admin-stock-detail-list dt {
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
}

.admin-stock-detail-list dd {
  min-width: 0;
  margin: 0;
  color: #0f172a;
  font-size: 13px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.admin-stock-table {
  min-width: 960px;
}

.admin-visitor-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(120px, 0.32fr)) auto;
  gap: 12px;
  align-items: end;
}

.admin-visitor-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.admin-visitor-card,
.admin-device-token-panel {
  min-width: 0;
  padding: 12px;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: #f8fafc;
}

.admin-visitor-card {
  display: grid;
  gap: 9px;
}

.admin-visitor-card strong,
.admin-device-token-panel strong {
  display: block;
  color: #0f172a;
  font-size: 14px;
  font-weight: 950;
}

.admin-visitor-card small,
.admin-device-token-panel small {
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.admin-visitor-card p {
  min-height: 32px;
  margin: 0;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.admin-row-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: #334155;
  font-size: 12px;
  font-weight: 900;
}

.admin-mini-button:hover,
.admin-mini-button:focus {
  border-color: #93c5fd;
  color: #1d4ed8;
  outline: none;
}

.admin-icon-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.admin-icon-button:hover,
.admin-icon-button:focus {
  border-color: #93c5fd;
  color: #1d4ed8;
  outline: none;
}

.admin-dialog {
  width: min(980px, calc(100vw - 28px));
  max-height: min(860px, calc(100vh - 28px));
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
}

.admin-dialog::backdrop {
  background: rgba(15, 23, 42, 0.42);
}

.admin-dialog-panel {
  display: grid;
  gap: 0;
  max-height: inherit;
  margin: 0;
}

.admin-dialog-heading,
.admin-dialog-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.admin-dialog-heading h2 {
  margin: 0;
  font-size: 22px;
}

.admin-dialog-heading p:not(.eyebrow) {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 13px;
  font-weight: 750;
}

.admin-dialog-body {
  display: grid;
  gap: 14px;
  max-height: min(620px, calc(100vh - 220px));
  padding: 16px;
  overflow: auto;
}

.admin-dialog-section {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.admin-dialog-section h3 {
  margin: 0;
  font-size: 15px;
}

.admin-dialog-foldout {
  display: grid;
}

.admin-dialog-foldout summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  list-style: none;
}

.admin-dialog-foldout summary::-webkit-details-marker {
  display: none;
}

.admin-dialog-section p {
  margin: 0;
  color: #334155;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.55;
}

.admin-strategy-narrative-highlight {
  padding: 14px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
}

.admin-dialog-kicker {
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 950;
}

.admin-strategy-narrative-highlight p {
  color: #0f172a;
  font-size: 14px;
  font-weight: 850;
}

.admin-dialog-detail-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.admin-dialog-detail-list div {
  min-width: 0;
  padding: 10px;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: #f8fafc;
}

.admin-dialog-detail-list dt {
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
}

.admin-dialog-detail-list dd {
  margin: 4px 0 0;
  color: #0f172a;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.admin-json-block {
  max-height: 260px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 12px;
  line-height: 1.5;
}

.admin-dialog-actions {
  align-items: center;
  border-top: 1px solid #e2e8f0;
  border-bottom: 0;
}

.admin-dialog-actions .admin-helper-text {
  flex: 1 1 260px;
}

.admin-device-token-panel {
  display: grid;
  grid-template-columns: minmax(210px, 0.6fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border-color: #bfdbfe;
  background: #eff6ff;
}

.admin-device-token-panel input {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid #93c5fd;
  border-radius: 8px;
  color: #0f172a;
  font-size: 12px;
  font-weight: 800;
}

.admin-helper-text {
  min-height: 36px;
  margin: 0;
  padding: 9px 10px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.admin-state-list {
  display: grid;
  gap: 0;
  margin: 0;
}

.admin-state-list div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid #edf2f7;
}

.admin-state-list div:first-child {
  border-top: 0;
}

.admin-state-list dt {
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.admin-state-list dd {
  margin: 0;
  color: #0f172a;
  font-size: 13px;
  font-weight: 900;
}

@media (max-width: 1040px) {
  .admin-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-settings-grid,
  .admin-recommendation-settings-grid,
  .admin-ops-grid {
    grid-template-columns: 1fr;
  }

  .admin-visitor-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-pareto-summary,
  .admin-history-summary,
  .admin-dialog-detail-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .admin-topbar {
    position: static;
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
  }

  .admin-brand {
    width: min(190px, 70vw);
    margin: 0 auto;
  }

  .admin-top-actions {
    justify-content: stretch;
  }

  .admin-top-actions .admin-link-button {
    flex: 1;
  }

  .admin-shell {
    padding: 12px 12px 28px;
  }

  .admin-intro,
  .admin-section-heading,
  .admin-config-heading {
    display: grid;
  }

  .admin-status-box {
    max-width: none;
  }

  .admin-metric-grid {
    grid-template-columns: 1fr;
  }

  .admin-stock-query-grid,
  .admin-stock-detail-list,
  .admin-visitor-controls,
  .admin-visitor-summary,
  .admin-pareto-summary,
  .admin-history-summary,
  .admin-dialog-detail-list,
  .admin-device-token-panel {
    grid-template-columns: 1fr;
  }

  .admin-dialog-heading,
  .admin-dialog-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-formula-list div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .admin-slider-row,
  .admin-weight-row {
    grid-template-columns: minmax(0, 1fr) 68px 18px;
    gap: 8px;
  }

  .admin-slider-row input[type="range"],
  .admin-weight-row input[type="range"] {
    grid-column: 1 / -1;
    order: 2;
  }

  .admin-number-input {
    grid-column: 2;
    grid-row: 1;
  }

  .admin-slider-row em,
  .admin-weight-row em {
    grid-column: 3;
    grid-row: 1;
  }

  .admin-table,
  .admin-table tbody,
  .admin-table tr,
  .admin-table th,
  .admin-table td {
    display: table-row-group;
    width: auto;
    min-width: 0;
    min-height: 0;
  }

  .admin-table {
    display: table;
    min-width: 680px;
  }

  .admin-table.admin-pareto-table {
    min-width: 1880px;
    table-layout: fixed;
  }

  .admin-pareto-column-paretorank {
    width: 72px;
  }

  .admin-pareto-column-rankscore {
    width: 108px;
  }

  .admin-pareto-metric-column {
    width: 112px;
  }

  .admin-pareto-column-candidate,
  .admin-pareto-candidate-cell {
    width: 210px;
    max-width: 210px;
  }

  .admin-pareto-column-tier {
    width: 84px;
  }

  .admin-pareto-column-source,
  .admin-pareto-column-family {
    width: 140px;
  }

  .admin-pareto-candidate-cell strong {
    display: -webkit-box;
    max-width: 188px;
    overflow: hidden;
    color: #0f172a;
    font-size: 13px;
    font-weight: 850;
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: anywhere;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .admin-pareto-candidate-cell small {
    max-width: 188px;
    font-size: 10.5px;
    line-height: 1.25;
    white-space: nowrap;
  }

  .admin-table thead {
    display: table-header-group;
  }

  .admin-table tbody {
    display: table-row-group;
  }

  .admin-table tr {
    display: table-row;
    border: 0;
    box-shadow: none;
  }

  .admin-table th,
  .admin-table td {
    display: table-cell;
    padding: 10px 11px;
    border-bottom: 1px solid #edf2f7;
    background: #fff;
    text-align: left;
    white-space: nowrap;
  }

  .admin-table th {
    background: #f8fafc;
  }

  .admin-table td::before,
  .admin-empty-cell::before {
    display: none;
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 16px;
  min-height: 100vh;
  padding: 16px;
}

.mobile-brandbar {
  display: none;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  background: transparent;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--text);
  color: #fff;
  font-weight: 800;
}

.brand-panel {
  display: grid;
  place-items: center;
  height: 71px;
  min-height: 71px;
  padding: 0;
  overflow: hidden;
  background: transparent;
}

.brand-panel img,
.mobile-brandbar img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.brand-panel img {
  width: min(218px, 70%);
  max-width: 100%;
  max-height: 64px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 16px;
}

h3 {
  font-size: 17px;
}

.panel,
.chart-panel,
.table-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel {
  padding: 16px;
}

.panel-title-row,
.chart-heading-row,
.control-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-title-row {
  flex-wrap: wrap;
  min-height: 30px;
}

.panel-title-row h2,
.panel-title-row h3 {
  min-width: 0;
}

.status-pill,
.muted-note {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: #e8eef8;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

.info-dot {
  display: inline-grid;
  place-items: center;
  width: 13px;
  height: 13px;
  margin-left: 3px;
  border: 1px solid #a8b6cc;
  border-radius: 50%;
  color: #7c8da7;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  vertical-align: 2px;
}

.info-button {
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.info-button:hover,
.info-button[aria-expanded="true"] {
  border-color: var(--accent);
  color: var(--accent);
}

.muted-note {
  max-width: 580px;
  background: #f1f5f9;
  color: var(--muted);
  font-weight: 600;
}

.muted-note:empty {
  display: none;
}

.status-pill[data-tone="web"] {
  background: #dcfce7;
  color: #166534;
}

.status-pill[data-tone="local"] {
  background: #e8eef8;
  color: #334155;
}

.status-pill[data-tone="warning"] {
  background: #fef3c7;
  color: #92400e;
}

.search-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
  flex-wrap: wrap;
  min-width: 0;
}

.input-label {
  display: block;
  margin: 16px 0 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.search-box {
  display: grid;
  grid-template-columns: 1fr 56px;
  gap: 10px;
}

.search-box input,
.amount-input,
.date-controls input,
.select-control select {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  outline: none;
}

.search-box input:focus,
.amount-input:focus,
.date-controls input:focus,
.select-control select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.13);
}

.search-box input,
.amount-input,
.date-controls input,
.select-control select {
  height: 38px;
  padding: 0 12px;
}

.search-box button,
.header-action-button,
.segment-button,
.icon-button {
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--text);
  color: #fff;
  font-weight: 800;
}

.data-status {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.data-status[data-tone="success"] {
  color: var(--success);
}

.data-status[data-tone="warning"] {
  color: #b45309;
}

.data-status[data-tone="error"] {
  color: var(--danger);
}

.refresh-button {
  background: var(--accent);
}

.refresh-button:hover {
  background: var(--accent-dark);
}

.watch-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
  flex-wrap: wrap;
  min-width: 0;
}

.secondary-action-button {
  background: #e8eef8;
  color: #334155;
}

.secondary-action-button:hover {
  background: #dbe3ee;
}

.secondary-action-button.active {
  border-color: #cbd5e1;
  background: #dbeafe;
  color: var(--accent-dark);
}

.search-box button:disabled {
  cursor: default;
  background: #cbd5e1;
  color: #64748b;
}

.header-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 11px;
  font-size: 12px;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.header-action-button:disabled {
  cursor: default;
  background: #cbd5e1;
  color: #64748b;
}

.adapter-settings-panel {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.adapter-url-label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.adapter-url-label input {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 0 10px;
  outline: none;
}

.adapter-url-label input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.13);
}

.adapter-url-label input:disabled {
  background: #e2e8f0;
  color: #64748b;
}

.adapter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.adapter-actions .header-action-button {
  min-width: 58px;
}

.adapter-settings-status {
  min-height: 17px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.adapter-settings-status[data-tone="success"] {
  color: var(--success);
}

.adapter-settings-status[data-tone="warning"] {
  color: #b45309;
}

.adapter-settings-status[data-tone="error"] {
  color: var(--danger);
}

.adapter-diagnostics {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.adapter-diagnostics[data-tone="success"] {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.adapter-diagnostics[data-tone="warning"] {
  border-color: #fde68a;
  background: #fffbeb;
}

.adapter-diagnostics[data-tone="error"] {
  border-color: #fecaca;
  background: #fef2f2;
}

.adapter-diagnostics-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--text);
}

.adapter-diagnostics-head strong,
.adapter-diagnostics-head span {
  font-size: 11px;
  font-weight: 900;
}

.adapter-diagnostics p {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
}

.adapter-diagnostics ul {
  display: grid;
  gap: 5px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.adapter-diagnostics li {
  display: grid;
  grid-template-columns: minmax(62px, 0.7fr) auto;
  gap: 4px 8px;
  align-items: center;
}

.adapter-diagnostics li strong {
  justify-self: end;
  color: var(--success);
  font-size: 11px;
}

.adapter-diagnostics li[data-tone="warning"] strong {
  color: #b45309;
}

.adapter-diagnostics li em {
  grid-column: 1 / -1;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-style: normal;
}

.search-results {
  display: none;
  gap: 8px;
  margin-top: 12px;
}

.search-results.has-results {
  display: grid;
}

.search-result,
.watch-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.search-result {
  min-height: 58px;
  padding: 9px 10px;
  text-align: left;
  color: var(--text);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.search-result-copy,
.watch-main div {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.search-result strong,
.watch-main strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result em,
.watch-main em {
  display: block;
  max-width: 185px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.watch-main strong {
  overflow: visible;
  line-height: 1.25;
  white-space: normal;
}

.watch-main em {
  max-width: 100%;
}

.watch-main em.portfolio-allocation-summary {
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  color: #5b6f8d;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.search-result small {
  flex: 0 1 78px;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-message {
  min-height: 42px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.asset-dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.watchlist {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.portfolio-create-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  margin-top: 10px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
}

.portfolio-create-button:hover,
.portfolio-create-button.active {
  border-color: var(--accent);
  background: #dbeafe;
}

.portfolio-create-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.watch-item {
  display: grid;
  align-items: stretch;
  justify-content: stretch;
  gap: 8px;
  min-height: 88px;
  padding: 10px;
}

.watch-item:focus {
  outline: none;
}

.watch-item:focus-visible,
.watch-item.watch-item-target {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.13);
}

.watch-info-row {
  display: grid;
  align-items: start;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.watch-main,
.watch-actions {
  display: grid;
  align-items: center;
  gap: 8px;
}

.watch-main {
  width: 100%;
  min-width: 0;
}

.watch-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.watch-actions {
  width: 100%;
  grid-template-columns: minmax(0, 1fr) 32px;
}

.watch-item.has-recommendation-action .watch-actions {
  grid-template-columns: minmax(0, 1fr) 46px 32px;
}

.watch-item.has-portfolio-edit .watch-actions {
  grid-template-columns: minmax(0, 1fr) 46px 32px;
}

.watch-item.inactive .watch-copy strong,
.watch-item.inactive .watch-copy em {
  color: #94a3b8;
  text-decoration: line-through;
}

.watch-tax-label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.watch-tax-select {
  min-width: 0;
  width: 100%;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #334155;
  padding: 0 10px;
  outline: none;
}

.icon-button {
  width: 100%;
  height: 30px;
  background: #cbd5e1;
  color: #334155;
  font-size: 12px;
  line-height: 1.1;
  white-space: nowrap;
}

.icon-button.active {
  background: var(--accent);
  color: #fff;
}

.icon-button.portfolio-edit-button {
  background: #eff6ff;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 900;
}

.icon-button.watch-recommend-button {
  background: #ecfdf3;
  color: #166534;
  font-size: 11px;
  font-weight: 900;
}

.icon-button.portfolio-edit-button:hover,
.icon-button.watch-recommend-button:hover {
  background: #dbeafe;
}

.icon-button.remove {
  width: 32px;
  background: #fee2e2;
  color: var(--danger);
  font-size: 20px;
  line-height: 1;
}

.workspace {
  min-width: 0;
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 16px;
  padding: 0;
}

.workspace > * {
  min-width: 0;
}

.date-controls {
  display: grid;
  justify-items: start;
  gap: 8px;
  min-width: 0;
}

.date-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.date-controls input {
  width: 138px;
  height: 34px;
  font-weight: 800;
  min-width: 0;
  box-sizing: border-box;
}

.date-controls label,
.select-control label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.date-controls label span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.control-strip {
  display: none;
  grid-template-columns: minmax(250px, 1.05fr) minmax(280px, 1.15fr) minmax(220px, 0.95fr);
  align-items: start;
  gap: 16px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  min-width: 0;
}

body.chart-options-open .control-strip {
  position: fixed;
  right: 20px;
  bottom: 72px;
  z-index: 24;
  display: grid;
  width: min(860px, calc(100vw - 382px));
  max-height: calc(100vh - 104px);
  padding: 12px;
  overflow-y: auto;
  border: 1px solid rgba(203, 213, 225, 0.94);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.22);
  backdrop-filter: blur(14px);
}

.control-cluster {
  display: grid;
  align-items: flex-start;
  align-content: start;
  gap: 8px;
  min-width: 0;
  min-height: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.control-stack {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 8px;
  min-width: 0;
  height: auto;
}

.mini-control-card {
  min-height: 84px;
  padding: 10px 14px;
}

.compact-cluster {
  align-self: start;
}

.option-group {
  display: grid;
  gap: 8px;
}

.parent-option {
  flex: 0 0 auto;
}

.child-option {
  position: relative;
  margin-top: 0;
  padding: 8px 10px 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.child-option::before {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: -11px;
  width: 3px;
  border-radius: 999px;
  background: #dbeafe;
  content: "";
}

.option-group.is-disabled {
  opacity: 0.48;
}

.option-group.is-disabled input,
.option-group.is-disabled button,
.option-group.is-disabled select {
  cursor: default;
}

.option-group.is-disabled input,
.option-group.is-disabled select {
  background: #e2e8f0;
  color: #64748b;
}

.option-group.is-disabled .segmented-control {
  background: #e8eef8;
}

.option-group.is-disabled .segment-button.active {
  background: #cbd5e1;
  color: #475569;
}

.control-help {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.amount-control {
  min-width: 132px;
}

.amount-input-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px;
  gap: 6px;
  min-width: 0;
}

.amount-input-wrap .amount-input {
  padding-right: 10px;
}

.amount-currency-select {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  outline: none;
}

.control-label {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.option-info-button {
  flex: 0 0 auto;
}

.option-info {
  margin: 0;
  padding: 9px 10px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.55;
}

.option-info[hidden] {
  display: none;
}

.segmented-control {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.segment-button {
  flex: 1 1 0;
  height: 28px;
  padding: 0 12px;
  background: transparent;
  color: #475569;
}

.segment-button.active {
  background: var(--accent);
  color: #fff;
}

.select-control select {
  min-width: 170px;
}

.chart-panel {
  padding: 14px 16px 14px;
}

.chart-heading-row {
  align-items: start;
  margin-bottom: 10px;
}

.chart-heading-row > div:first-child {
  min-width: 0;
}

.chart-title-block {
  min-width: 0;
}

@media (min-width: 761px) {
  .control-strip {
    gap: 12px;
  }

  .control-cluster {
    gap: 6px;
    padding: 10px 12px;
  }

  .control-stack {
    gap: 6px;
  }

  .mini-control-card {
    min-height: 72px;
    padding: 8px 12px;
  }

  .option-group {
    gap: 6px;
  }

  .child-option {
    padding: 7px 9px 8px 10px;
  }

  .child-option::before {
    top: 7px;
    bottom: 7px;
    left: -9px;
    width: 2px;
  }

  .control-label {
    font-size: 11px;
  }

  .control-strip .info-dot {
    width: 12px;
    height: 12px;
    font-size: 8px;
  }

  .control-strip .segmented-control {
    gap: 4px;
    min-height: 32px;
    padding: 3px;
    border-radius: 7px;
  }

  .control-strip .segment-button {
    height: 24px;
    padding: 0 10px;
    border-radius: 7px;
    font-size: 13px;
    line-height: 1;
  }

  .control-strip .amount-input,
  .control-strip .amount-currency-select {
    height: 34px;
  }

  .control-strip .amount-input {
    font-size: 15px;
  }

  .control-strip .amount-currency-select {
    font-size: 11px;
  }

  .control-strip .amount-input-wrap {
    grid-template-columns: minmax(0, 1fr) 62px;
  }
}

.analysis-mode-row {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  min-width: 0;
}

.analysis-mode-toggle {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.analysis-mode-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 124px;
  height: 34px;
  border: 0;
  border-right: 1px solid #edf2f7;
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.analysis-mode-button:last-child {
  border-right: 0;
}

.analysis-mode-button.active {
  background: var(--accent);
  color: #fff;
}

.mobile-analysis-mode-card {
  display: none;
}

.recommendation-context-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1 1 360px;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 6px 8px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
}

.recommendation-context-bar > div:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.recommendation-context-bar strong,
.recommendation-context-bar small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recommendation-context-bar strong {
  color: #1e3a8a;
  font-size: 13px;
  font-weight: 900;
}

.recommendation-context-bar small {
  color: #475569;
  font-size: 11px;
  font-weight: 800;
}

.recommendation-context-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.recommendation-group-control {
  display: inline-grid;
  grid-template-columns: auto minmax(112px, 1fr);
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 8px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: #1e3a8a;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.recommendation-group-control select {
  min-width: 0;
  height: 26px;
  padding: 0 26px 0 8px;
  border: 1px solid #dbeafe;
  border-radius: 7px;
  background: #fff;
  color: #1e3a8a;
  font: inherit;
}

.chart-title-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.chart-subtitle {
  margin: 7px 0 9px;
  min-height: 16px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
}

.mobile-chart-subtitle {
  display: none;
}

.chart-view-toggle {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.chart-title-toggle {
  flex: 0 0 auto;
}

.chart-view-button {
  min-width: 118px;
  height: 34px;
  border: 0;
  border-right: 1px solid #edf2f7;
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 900;
}

.chart-view-button:last-child {
  border-right: 0;
}

.chart-view-button.active {
  background: #e8f0ff;
  color: var(--accent);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 35px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 11px;
  font-weight: 800;
  text-align: left;
}

.legend-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 27px;
  padding: 2px 4px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.legend-chip.inactive .legend-toggle {
  opacity: 0.42;
  text-decoration: line-through;
}

.legend-toggle i {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-toggle span {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.legend-toggle strong {
  max-width: 132px;
  overflow: hidden;
  font-size: 11px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legend-toggle small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.1;
}

.legend-benchmark {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 27px;
  padding: 0 6px;
  border-left: 1px solid var(--line);
  color: #475569;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
}

.legend-benchmark input {
  width: 13px;
  height: 13px;
  accent-color: var(--accent);
}

.legend-hidden-toggle {
  display: none;
}

.recommendation-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-width: 176px;
  max-width: 236px;
  min-height: 54px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #334155;
}

.recommendation-card.added {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.recommendation-card.inactive .recommendation-card-copy strong,
.recommendation-card.inactive .recommendation-card-copy em {
  color: #94a3b8;
  text-decoration: line-through;
}

.recommendation-card-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.recommendation-card-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.recommendation-title-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.recommendation-card-copy small,
.recommendation-card-copy strong,
.recommendation-card-copy em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recommendation-card-copy small {
  color: #64748b;
  font-size: 9px;
  font-weight: 900;
}

.recommendation-card-copy strong {
  color: #0f172a;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.15;
}

.recommendation-title-line strong {
  flex: 1 1 auto;
}

.recommendation-score-badge {
  flex: 0 0 auto;
}

.recommendation-card-copy em {
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}

.recommendation-standouts {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.recommendation-standout {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 9px;
  font-weight: 900;
}

.recommendation-standout-rank-1 {
  border: 1px solid #bbf7d0;
  background: #dcfce7;
  color: #166534;
}

.recommendation-standout-rank-2 {
  border: 1px solid #bfdbfe;
  background: #dbeafe;
  color: #1d4ed8;
}

.recommendation-standout-rank-worst {
  border: 1px solid #fecdd3;
  background: #fff1f2;
  color: #be123c;
}

.recommendation-add-button {
  align-self: stretch;
  min-width: 72px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #bfdbfe;
  border-radius: 7px;
  background: #eff6ff;
  color: var(--accent-dark);
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.recommendation-card.added .recommendation-add-button,
.recommendation-add-button.is-added,
.recommendation-add-button:disabled {
  border-color: #bbf7d0;
  background: #dcfce7;
  color: #166534;
}

.recommendation-source-card {
  min-width: 190px;
}

.recommendation-benchmark {
  border-left: 1px solid var(--line);
}

.recommendation-inline-status {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.recommendation-inline-status[data-tone="error"] {
  border-color: #fecdd3;
  background: #fff1f2;
  color: var(--danger);
}

canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 360px;
  border-radius: 8px;
}

.detail-comparison-panel {
  min-width: 0;
}

.detail-table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow-x: auto;
}

.detail-comparison-table {
  min-width: 1240px;
}

.detail-comparison-table td {
  color: var(--text);
}

.detail-comparison-table th {
  overflow: visible;
}

.detail-comparison-table .metric-best {
  color: var(--success);
  font-weight: 900;
}

.detail-comparison-table .metric-worst {
  color: var(--danger);
  font-weight: 900;
}

.detail-mobile-table-wrap {
  display: none;
}

.metric-heading {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.metric-info-button {
  flex: 0 0 auto;
}

.metric-tooltip {
  position: absolute;
  top: calc(100% + 7px);
  left: 50%;
  z-index: 6;
  display: block;
  width: 220px;
  margin-top: 0;
  padding: 8px 9px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
  white-space: normal;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  transform: translateX(-50%);
}

.detail-comparison-table th:nth-last-child(-n + 2) .metric-tooltip {
  right: 0;
  left: auto;
  transform: none;
}

.metric-tooltip[hidden] {
  display: none;
}

.metric-floating-tooltip {
  position: fixed;
  top: var(--metric-tooltip-top, 12px);
  right: auto;
  left: var(--metric-tooltip-left, 12px);
  z-index: 1000;
  width: min(240px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  text-align: left;
  transform: none;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
  gap: 14px;
  min-width: 0;
}

.summary-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 58px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.summary-card-link {
  outline: none;
}

.summary-card div {
  min-width: 0;
}

.summary-label {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.summary-card strong {
  display: block;
  overflow: hidden;
  color: #0f172a;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#summaryPeriod {
  font-size: 13px;
  line-height: 1.25;
  white-space: nowrap;
}

.summary-card small {
  display: block;
  min-height: 13px;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-icon {
  position: relative;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #eef4ff;
}

.summary-icon::before,
.summary-icon::after {
  position: absolute;
  content: "";
}

.summary-icon::before {
  inset: 12px 10px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.summary-icon::after {
  right: 9px;
  bottom: 11px;
  width: 12px;
  height: 8px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(-20deg);
}

.summary-icon-blue {
  background: #eef4ff;
  color: #2563eb;
}

.summary-icon-green {
  background: #ecfdf3;
  color: #16a34a;
}

.summary-icon-purple {
  background: #f4edff;
  color: #7c3aed;
}

.summary-icon-orange {
  background: #fff4ed;
  color: #ea580c;
}

.compact-field {
  display: grid;
  gap: 5px;
  min-width: 74px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.compact-field input,
.compact-field select {
  width: 100%;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  outline: none;
}

.compact-field input {
  max-width: 94px;
  padding: 0 8px;
  text-align: right;
}

.compact-field select {
  min-width: 66px;
  padding: 0 7px;
}

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

.range-buttons {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  scrollbar-width: thin;
}

.range-buttons button,
.chart-option-button {
  height: 34px;
  border: 0;
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.range-buttons button {
  min-width: 52px;
  border-right: 1px solid #edf2f7;
}

.range-buttons button:last-child {
  border-right: 0;
}

.range-buttons button.active {
  background: #e8f0ff;
  color: var(--accent);
}

.chart-option-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 104px;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.chart-option-button.active {
  border-color: rgba(37, 99, 235, 0.24);
  background: #2563eb;
  color: #fff;
}

.table-panel {
  padding: 18px;
}

.table-wrap {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

td span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.data-period strong {
  display: block;
  white-space: nowrap;
}

.data-period.warning strong {
  color: var(--danger);
}

.data-period.warning span {
  color: var(--danger);
  font-weight: 700;
}

.data-period span {
  line-height: 1.35;
}

.numeric {
  font-weight: 900;
}

.positive {
  color: var(--success);
}

.negative {
  color: var(--danger);
}

.benchmark-row {
  background: #f8fafc;
}

.mobile-result-add-button {
  display: none;
}

.empty-cell {
  height: 92px;
  color: var(--muted);
  text-align: center;
}

.mobile-nav {
  display: none;
}

.mobile-sheet-handle {
  display: none;
}

.mobile-add-asset-button,
.mobile-search-sheet,
.recommendation-picker-sheet,
.watch-detail-sheet,
.portfolio-builder-sheet {
  display: none;
}

.recommendation-picker-sheet:not([hidden]),
.watch-detail-sheet:not([hidden]),
.portfolio-builder-sheet:not([hidden]) {
  display: block;
}

.recommendation-picker-overlay,
.watch-detail-overlay,
.portfolio-builder-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  width: 100%;
  border: 0;
  border-radius: 0;
  background: rgba(15, 23, 42, 0.28);
}

.recommendation-picker-panel,
.watch-detail-panel,
.portfolio-builder-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 31;
  display: grid;
  gap: 12px;
  width: min(520px, calc(100vw - 32px));
  max-height: min(86vh, 720px);
  padding: 18px;
  overflow-y: auto;
  border: 1px solid rgba(203, 213, 225, 0.96);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.99);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
  transform: translate(-50%, -50%);
}

.watch-detail-panel {
  width: min(420px, calc(100vw - 32px));
  max-height: min(82vh, 640px);
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  perspective: 1100px;
}

.watch-detail-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(203, 213, 225, 0.96);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.99);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
  transform-origin: center;
  animation: watch-card-flip-in 260ms ease-out both;
}

@keyframes watch-card-flip-in {
  from {
    opacity: 0;
    transform: rotateY(-78deg) scale(0.92);
  }

  to {
    opacity: 1;
    transform: rotateY(0deg) scale(1);
  }
}

.watch-detail-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}

.watch-detail-header small,
.watch-detail-header strong,
.watch-detail-header em {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.watch-detail-header small {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
}

.watch-detail-header strong {
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.2;
}

.watch-detail-header em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.watch-detail-close {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: #f1f5f9;
  color: #475569;
  font-size: 20px;
  line-height: 1;
}

.watch-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.watch-detail-grid div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.watch-detail-grid dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.watch-detail-grid dd {
  min-width: 0;
  overflow: hidden;
  color: #0f172a;
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.watch-detail-note {
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.watch-detail-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.recommendation-picker-panel {
  width: min(560px, calc(100vw - 32px));
}

.recommendation-picker-period {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.recommendation-picker-period > span {
  color: #334155;
  font-size: 12px;
  font-weight: 900;
}

.recommendation-picker-ranges {
  width: 100%;
}

.recommendation-picker-group {
  display: grid;
  gap: 8px;
}

.recommendation-picker-group h3 {
  color: #334155;
  font-size: 13px;
  font-weight: 900;
}

.recommendation-choice-list {
  display: grid;
  gap: 7px;
  max-height: 220px;
  overflow-y: auto;
}

.recommendation-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #334155;
  text-align: left;
}

.recommendation-choice strong,
.recommendation-choice em,
.recommendation-choice small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recommendation-choice strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.recommendation-choice em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.recommendation-choice small {
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
}

.recommendation-empty,
.recommendation-status {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.recommendation-status[data-tone="error"] {
  color: var(--danger);
}

.mobile-recommendation-panel {
  display: none;
}

.portfolio-name-input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.portfolio-builder-summary {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.portfolio-builder-summary span {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.portfolio-builder-summary span[data-tone="success"] {
  color: var(--success);
}

.portfolio-builder-summary span[data-tone="warning"] {
  color: #b45309;
}

.portfolio-builder-summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.portfolio-weight-list {
  display: grid;
  gap: 8px;
}

.portfolio-weight-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.portfolio-cash-row {
  background: #f8fafc;
}

.portfolio-weight-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.portfolio-weight-copy strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portfolio-weight-copy em {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portfolio-weight-input-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
}

.portfolio-weight-input {
  width: 100%;
  height: 38px;
  min-width: 0;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  text-align: right;
}

.portfolio-weight-input-wrap small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.portfolio-builder-status {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.portfolio-builder-status[data-tone="error"] {
  color: var(--danger);
}

.portfolio-builder-status[data-tone="info"] {
  color: var(--muted);
}

.portfolio-builder-actions {
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 1040px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .control-strip {
    grid-template-columns: 1fr;
  }

  body.chart-options-open .control-strip {
    right: 20px;
    left: 20px;
    width: auto;
  }

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

}

@media (max-width: 760px) {
  body {
    padding-bottom: 78px;
    background: #edf2f8;
  }

  .mobile-brandbar {
    position: sticky;
    top: 0;
    z-index: 24;
    display: grid;
    gap: 8px;
    align-items: stretch;
    justify-items: center;
    width: 100%;
    padding: 8px 10px 10px;
    overflow: visible;
    background: #edf2f8;
    transition: padding 160ms ease, box-shadow 160ms ease;
  }

  .mobile-brand-logo {
    display: grid;
    place-items: center;
    width: 100%;
    height: 78px;
    min-height: 78px;
    overflow: hidden;
    opacity: 1;
    transform: translateY(0);
    transition: height 180ms ease, min-height 180ms ease, opacity 140ms ease, transform 180ms ease;
  }

  .mobile-modebar-stuck .mobile-brandbar {
    padding-top: 6px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  }

  .mobile-modebar-stuck .mobile-brand-logo {
    height: 0;
    min-height: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-26px);
  }

  .mobile-brandbar img {
    width: min(230px, 58vw);
    max-width: 100%;
    max-height: 64px;
  }

  .mobile-chart-subtitle {
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: 720px;
    margin: -1px 0 2px;
    padding: 0 5px;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.45;
    text-align: left;
  }

  .desktop-chart-subtitle {
    display: none;
  }

  .app-shell {
    display: block;
    min-height: auto;
    padding: 6px 10px 14px;
  }

  .brand-panel {
    display: none;
  }

  .mobile-nav {
    position: fixed;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 10px;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 7px;
    border: 1px solid rgba(203, 213, 225, 0.92);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(14px);
  }

  .mobile-nav button {
    min-width: 0;
    min-height: 44px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
  }

  .mobile-nav button.active {
    background: var(--accent);
    color: #fff;
  }

  .mobile-add-asset-button {
    display: inline-flex;
    min-height: 34px;
    padding: 0 10px;
  }

  .mobile-add-asset-button.active {
    border-color: #cbd5e1;
    background: #dbeafe;
    color: var(--accent-dark);
  }

  .mobile-search-sheet:not([hidden]) {
    display: block;
  }

  .recommendation-picker-sheet:not([hidden]) {
    display: block;
  }

  .portfolio-builder-sheet:not([hidden]) {
    display: block;
  }

  .mobile-search-overlay,
  .recommendation-picker-overlay,
  .portfolio-builder-overlay {
    position: fixed;
    inset: 0;
    z-index: 26;
    width: 100%;
    border: 0;
    border-radius: 0;
    background: rgba(15, 23, 42, 0.3);
  }

  .mobile-search-panel,
  .recommendation-picker-panel,
  .portfolio-builder-panel {
    position: fixed;
    top: auto;
    right: 10px;
    bottom: calc(max(10px, env(safe-area-inset-bottom)) + 70px);
    left: 10px;
    z-index: 27;
    display: grid;
    gap: 10px;
    width: auto;
    max-height: min(70vh, 520px);
    padding: 10px 12px 12px;
    overflow-y: auto;
    border: 1px solid rgba(203, 213, 225, 0.94);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.99);
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.24);
    backdrop-filter: blur(14px);
    transform: none;
  }

  .mobile-sheet-handle {
    display: block;
    justify-self: center;
    width: 42px;
    height: 4px;
    border-radius: 999px;
    background: #cbd5e1;
  }

  .mobile-search-panel .panel-title-row {
    align-items: center;
  }

  .mobile-search-panel .input-label,
  .recommendation-picker-panel .input-label {
    margin-top: 0;
  }

  .recommendation-picker-period {
    gap: 6px;
  }

  .recommendation-picker-period > span {
    font-size: 11px;
  }

  .recommendation-picker-ranges button {
    height: 30px;
    flex-basis: 48px;
    min-width: 48px;
    font-size: 11px;
  }

  .mobile-search-panel .search-results,
  .recommendation-picker-panel .search-results {
    max-height: 268px;
    overflow-y: auto;
  }

  .recommendation-choice-list {
    max-height: 190px;
  }

  .portfolio-weight-row {
    grid-template-columns: minmax(0, 1fr) 104px;
    gap: 8px;
    min-height: 60px;
  }

  .portfolio-builder-actions .header-action-button {
    width: 100%;
    min-height: 42px;
  }

  .sidebar,
  .workspace,
  .control-strip,
  .summary-grid,
  .chart-panel,
  .table-panel,
  .mobile-recommendation-panel {
    display: none;
  }

  body.mobile-tab-assets .sidebar {
    display: flex;
  }

  body.mobile-tab-chart .workspace {
    display: grid;
  }

  body.mobile-tab-chart .summary-grid {
    display: grid;
  }

  body.mobile-tab-chart .chart-panel {
    display: block;
  }

  body.mobile-tab-chart .table-panel {
    display: block;
  }

  body.mobile-tab-chart.chart-options-open .control-strip {
    position: fixed;
    right: 10px;
    bottom: calc(max(10px, env(safe-area-inset-bottom)) + 70px);
    left: 10px;
    z-index: 24;
    display: grid;
    width: auto;
    max-height: min(68vh, 560px);
    padding: 12px;
    overflow-y: auto;
    border: 1px solid rgba(203, 213, 225, 0.94);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.22);
    backdrop-filter: blur(14px);
  }

  .sidebar,
  .workspace {
    gap: 10px;
  }

  .panel,
  .chart-panel,
  .table-panel,
  .control-cluster,
  .summary-card {
    border-radius: 12px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
  }

  .panel,
  .table-panel {
    padding: 14px;
  }

  .panel-title-row {
    align-items: flex-start;
    gap: 10px;
  }

  .search-panel .panel-title-row {
    gap: 6px;
    min-height: auto;
  }

  .search-panel .search-header-actions {
    display: none;
  }

  .search-panel .input-label {
    margin-top: 8px;
  }

  .search-header-actions,
  .watch-header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .header-action-button {
    min-height: 36px;
    padding: 0 12px;
  }

  .search-box {
    grid-template-columns: minmax(0, 1fr) 62px;
  }

  .search-box button {
    min-height: 42px;
  }

  .search-box input,
  .amount-input,
  .amount-currency-select,
  .date-controls input,
  .select-control select,
  .adapter-url-label input {
    height: 42px;
  }

  .adapter-actions .header-action-button {
    flex: 1 1 70px;
  }

  .search-result {
    min-height: 64px;
  }

  .search-result strong,
  .watch-main strong {
    font-size: 14px;
  }

  .search-result em,
  .watch-main em {
    max-width: 230px;
  }

  .watch-info-row {
    align-items: flex-start;
    gap: 7px;
  }

  .watch-header-actions {
    width: auto;
    margin-left: auto;
    justify-content: flex-end;
  }

  .watch-actions {
    grid-template-columns: minmax(0, 1fr) 36px;
    gap: 6px;
  }

  .watch-item.has-recommendation-action .watch-actions {
    grid-template-columns: minmax(0, 1fr) 44px 36px;
  }

  .watch-item.has-portfolio-edit .watch-actions {
    grid-template-columns: minmax(0, 1fr) 44px 36px;
  }

  .watch-tax-label {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 8px;
  }

  .watch-tax-select {
    height: 38px;
  }

  .icon-button {
    min-width: 0;
    width: 100%;
    height: 34px;
    padding: 0;
  }

  .icon-button.visibility-button {
    min-width: 0;
    width: 100%;
  }

  .icon-button.portfolio-edit-button {
    font-size: 10px;
  }

  .icon-button.remove {
    min-width: 36px;
    width: 36px;
    height: 34px;
  }

  .control-strip {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .control-cluster {
    width: 100%;
    min-height: 0;
    padding: 14px;
  }

  .segmented-control {
    min-height: 44px;
  }

  .segment-button {
    min-height: 34px;
    height: auto;
    padding: 0 10px;
  }

  .child-option {
    width: 100%;
    margin-top: 0;
  }

  .chart-heading-row {
    align-items: stretch;
    flex-direction: column;
  }

  .chart-panel {
    padding: 14px 12px 12px;
  }

  .chart-heading-row {
    gap: 12px;
  }

  .chart-title-block,
  .chart-title-actions {
    width: 100%;
  }

  .chart-title-actions {
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
  }

  .chart-view-toggle {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .chart-title-toggle {
    flex: 1 1 210px;
    width: auto;
    min-width: 0;
  }

  .chart-view-button {
    min-width: 0;
    width: 100%;
    min-height: 38px;
    height: auto;
    padding: 0 8px;
    line-height: 1.2;
    white-space: normal;
  }

  .date-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    max-width: 100%;
    gap: 8px;
    overflow: hidden;
  }

  .date-input-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    max-width: 100%;
    gap: 8px;
  }

  .date-controls label {
    min-width: 0;
    overflow: hidden;
  }

  .date-controls input {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 42px;
    padding: 0 5px;
    font-size: 12px;
    line-height: 42px;
    text-align: center;
  }

  body.recommendation-mode-active .mobile-add-asset-button,
  body.recommendation-mode-active .date-controls {
    display: none;
  }

  .summary-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .summary-grid .summary-card {
    display: none;
  }

  .mobile-analysis-mode-card {
    display: grid;
    width: 100%;
    min-height: 52px;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--panel);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.055);
  }

  .mobile-analysis-mode-toggle {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    min-height: 42px;
    border-radius: 9px;
    background: #f8fafc;
  }

  .mobile-analysis-mode-toggle .analysis-mode-button {
    min-width: 0;
    width: 100%;
    height: 42px;
    min-height: 42px;
    padding: 0 5px;
    overflow: hidden;
    font-size: 11px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .summary-card {
    min-height: 72px;
    padding: 11px 12px;
    gap: 10px;
  }

  .summary-card-link {
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.15s ease;
  }

  .summary-card-link:focus-visible {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.13), var(--shadow);
  }

  .summary-card-link:active {
    transform: translateY(1px);
  }

  .summary-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .summary-label {
    margin-bottom: 4px;
    font-size: 11px;
  }

  .summary-card strong {
    font-size: 15px;
  }

  #summaryPeriod {
    font-size: 12px;
  }

  .summary-card small {
    margin-top: 4px;
    font-size: 10px;
  }

  canvas {
    height: 300px;
  }

  .legend {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    width: 100%;
    max-width: 100%;
    margin: 2px 0 10px;
    padding: 0;
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .legend-chip {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    justify-content: stretch;
    width: 100%;
    min-height: 38px;
    padding: 6px 7px;
  }

  .legend-toggle {
    width: 100%;
  }

  .legend-toggle strong {
    max-width: none;
    font-size: 11px;
  }

  .legend-benchmark {
    margin-left: auto;
  }

  .legend-hidden-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 34px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
  }

  .analysis-mode-row {
    align-items: stretch;
    flex-direction: column;
    margin-bottom: 8px;
  }

  .chart-panel .analysis-mode-row .analysis-mode-toggle:not(.mobile-analysis-mode-toggle) {
    display: none;
  }

  .analysis-mode-toggle:not(.mobile-analysis-mode-toggle) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .analysis-mode-toggle:not(.mobile-analysis-mode-toggle) .analysis-mode-button {
    min-width: 0;
    width: 100%;
    min-height: 38px;
    height: auto;
    padding: 0 8px;
    line-height: 1.2;
    white-space: normal;
  }

  .recommendation-context-bar {
    align-items: stretch;
    flex-direction: column;
    flex: 0 0 auto;
    gap: 7px;
    min-height: 0;
    padding: 8px 9px;
  }

  .recommendation-context-bar > div:first-child {
    align-items: center;
    flex-direction: row;
    gap: 6px;
  }

  .recommendation-context-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(92px, 108px);
    gap: 6px;
    width: 100%;
  }

  .recommendation-context-actions .recommendation-group-control {
    grid-column: auto;
    width: 100%;
    min-height: 34px;
    padding: 0 6px;
  }

  .recommendation-context-actions .header-action-button {
    width: 100%;
    min-height: 34px;
    padding: 0 8px;
  }

  .recommendation-card {
    grid-template-columns: minmax(0, 1fr) minmax(88px, auto);
    gap: 5px 8px;
    max-width: none;
    width: 100%;
    min-height: 46px;
    padding: 7px 8px;
  }

  .recommendation-source-card {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .recommendation-card-toggle {
    min-height: 30px;
    gap: 6px;
  }

  .recommendation-title-line {
    gap: 5px;
  }

  .recommendation-card-copy strong {
    font-size: 12px;
  }

  .recommendation-card-copy small,
  .recommendation-card-copy em {
    font-size: 9px;
  }

  .recommendation-score-badge {
    max-width: 58px;
  }

  .recommendation-benchmark {
    min-height: 30px;
    padding: 0 8px;
  }

  .recommendation-standouts {
    gap: 3px;
  }

  .recommendation-standout {
    min-height: 18px;
    padding: 0 6px;
    font-size: 9px;
  }

  .recommendation-add-button {
    grid-column: 2;
    grid-row: 1;
    min-width: 88px;
    min-height: 30px;
    padding: 0 8px;
  }

  .mobile-recommendation-panel {
    gap: 12px;
  }

  .mobile-recommendation-summary {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    background: #eff6ff;
  }

  .mobile-recommendation-summary strong,
  .mobile-recommendation-summary span,
  .mobile-recommendation-summary em {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-recommendation-summary strong {
    color: #1e3a8a;
    font-size: 14px;
    font-weight: 900;
  }

  .mobile-recommendation-summary span,
  .mobile-recommendation-summary em {
    color: #475569;
    font-size: 11px;
    font-style: normal;
    font-weight: 800;
  }

  .mobile-recommendation-summary em[data-tone="error"] {
    color: var(--danger);
  }

  .mobile-recommendation-group-control {
    width: 100%;
    grid-template-columns: auto minmax(0, 1fr);
    margin-top: 2px;
  }

  .mobile-recommendation-list {
    display: grid;
    gap: 8px;
  }

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

  .chart-option-button {
    display: block;
  }

  .range-buttons {
    width: 100%;
  }

  .range-buttons button {
    flex: 0 0 52px;
  }

  .chart-option-button {
    width: 100%;
  }

  .table-panel .panel-title-row {
    gap: 8px;
  }

  .muted-note {
    width: 100%;
    max-width: none;
  }

  .table-wrap {
    margin-top: 12px;
    border: 0;
    background: transparent;
    overflow: visible;
  }

  table,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 14px;
    font-size: 13px;
  }

  thead {
    display: none;
  }

  tr {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
  }

  tr.result-row-link {
    cursor: pointer;
  }

  tr.result-row-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
  }

  tr.result-row-highlight {
    border-color: rgba(37, 99, 235, 0.55);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14), 0 12px 28px rgba(15, 23, 42, 0.10);
  }

  td {
    display: grid;
    grid-template-columns: minmax(78px, 0.34fr) minmax(0, 1fr);
    gap: 10px;
    min-height: 42px;
    padding: 10px 12px;
    border-bottom: 1px solid #edf2f7;
    align-items: center;
  }

  td.mobile-extra {
    display: none;
  }

  td:last-child {
    border-bottom: 0;
  }

  td::before {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    content: attr(data-label);
  }

  td:first-child {
    grid-template-columns: 1fr;
    gap: 4px;
    min-height: 54px;
    background: #f8fafc;
  }

  .mobile-result-add-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 32px;
    margin-top: 7px;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    background: #eff6ff;
    color: var(--accent-dark);
    font-size: 11px;
    font-weight: 900;
  }

  .mobile-result-add-button.is-added,
  .mobile-result-add-button:disabled {
    border-color: #bbf7d0;
    background: #dcfce7;
    color: #166534;
  }

  td:first-child::before,
  .empty-cell::before {
    display: none;
  }

  td span {
    margin-top: 2px;
  }

  .numeric {
    text-align: right;
  }

  .data-period strong {
    white-space: normal;
  }

  .empty-cell {
    display: block;
    height: auto;
    padding: 24px 12px;
    text-align: center;
  }

  .detail-table-wrap {
    display: none;
  }

  .detail-mobile-table-wrap {
    display: block;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-width: thin;
  }

  .detail-mobile-comparison-table,
  .detail-mobile-comparison-table tbody {
    display: table;
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
  }

  .detail-mobile-comparison-table tbody {
    display: table-row-group;
  }

  .detail-mobile-comparison-table tr {
    display: table-row;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .detail-mobile-comparison-table th,
  .detail-mobile-comparison-table td {
    position: static;
    top: auto;
    z-index: auto;
    display: table-cell;
    width: auto;
    min-width: 108px;
    min-height: 0;
    padding: 8px 9px;
    border-bottom: 1px solid #edf2f7;
    color: var(--text);
    font-size: 11px;
    line-height: 1.25;
    vertical-align: middle;
    white-space: nowrap;
  }

  .detail-mobile-comparison-table tr:last-child th,
  .detail-mobile-comparison-table tr:last-child td {
    border-bottom: 0;
  }

  .detail-mobile-comparison-table td::before {
    display: none;
  }

  .detail-mobile-comparison-table .metric-label-cell {
    position: sticky;
    left: 0;
    z-index: 3;
    min-width: 84px;
    max-width: 84px;
    background: #fff;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
  }

  .detail-mobile-comparison-table .metric-corner-cell,
  .detail-mobile-comparison-table .asset-metric-header {
    background: #f8fafc;
    color: #64748b;
    font-size: 10px;
    text-align: left;
  }

  .detail-mobile-comparison-table .asset-metric-header strong,
  .detail-mobile-comparison-table .asset-metric-header span {
    display: block;
    max-width: 112px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .detail-mobile-comparison-table .asset-metric-header strong {
    color: var(--text);
    font-size: 10px;
    line-height: 1.2;
  }

  .detail-mobile-comparison-table .asset-metric-header span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 8px;
  }

  .detail-mobile-comparison-table .numeric {
    text-align: right;
    font-size: 12px;
    font-weight: 800;
  }

  .detail-mobile-comparison-table .metric-best {
    color: var(--success);
    font-weight: 900;
  }

  .detail-mobile-comparison-table .metric-worst {
    color: var(--danger);
    font-weight: 900;
  }

  .detail-mobile-comparison-table .metric-row-heading {
    display: inline-flex;
    align-items: center;
    gap: 3px;
  }

  .detail-mobile-comparison-table .info-dot {
    width: 11px;
    height: 11px;
    margin-left: 1px;
    font-size: 7px;
    vertical-align: 1px;
  }

  .detail-mobile-comparison-table .metric-tooltip {
    position: fixed;
    top: var(--metric-tooltip-top, 12px);
    right: auto;
    left: var(--metric-tooltip-left, 12px);
    z-index: 40;
    width: min(240px, calc(100vw - 32px));
    margin-top: 0;
    text-align: left;
    transform: none;
  }
}

@media (max-width: 760px) {
  body.admin-body .admin-table,
  body.admin-body .admin-table tbody,
  body.admin-body .admin-table tr,
  body.admin-body .admin-table th,
  body.admin-body .admin-table td {
    width: auto;
    min-width: 0;
    min-height: 0;
  }

  body.admin-body .admin-table {
    display: table;
    min-width: 680px;
    border-collapse: collapse;
    border-spacing: 0;
    font-size: 13px;
  }

  body.admin-body .admin-table.admin-pareto-table {
    min-width: 1880px;
    table-layout: fixed;
  }

  body.admin-body .admin-pareto-column-paretorank {
    width: 72px;
  }

  body.admin-body .admin-pareto-column-rankscore {
    width: 108px;
  }

  body.admin-body .admin-pareto-metric-column {
    width: 112px;
  }

  body.admin-body .admin-pareto-column-candidate,
  body.admin-body .admin-pareto-candidate-cell {
    width: 210px;
    max-width: 210px;
  }

  body.admin-body .admin-pareto-column-tier {
    width: 84px;
  }

  body.admin-body .admin-pareto-column-source,
  body.admin-body .admin-pareto-column-family {
    width: 140px;
  }

  body.admin-body .admin-table thead {
    display: table-header-group;
  }

  body.admin-body .admin-table tbody {
    display: table-row-group;
  }

  body.admin-body .admin-table tr {
    display: table-row;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  body.admin-body .admin-table th,
  body.admin-body .admin-table td {
    display: table-cell;
    grid-template-columns: none;
    gap: 0;
    padding: 10px 11px;
    border-bottom: 1px solid #edf2f7;
    background: #fff;
    color: #0f172a;
    text-align: left;
    vertical-align: top;
    white-space: nowrap;
  }

  body.admin-body .admin-table th {
    background: #f8fafc;
    color: #64748b;
  }

  body.admin-body .admin-table td:first-child {
    min-height: 0;
    background: #fff;
  }

  body.admin-body .admin-table td::before,
  body.admin-body .admin-empty-cell::before {
    display: none;
  }
}

@media (max-width: 760px) {
  body.admin-body .admin-tab-list {
    position: sticky;
    top: 0;
    z-index: 35;
    gap: 6px;
    padding: 5px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
  }

  body.admin-body .admin-tab-button {
    min-height: 36px;
    padding: 0 10px;
    font-size: 12px;
  }

  body.admin-body .admin-autopilot-section {
    gap: 10px;
    padding: 12px;
  }

  body.admin-body .admin-autopilot-section .admin-section-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  body.admin-body .admin-autopilot-section .admin-section-heading h2 {
    font-size: 18px;
    line-height: 1.2;
  }

  body.admin-body .admin-autopilot-section .admin-section-heading p {
    font-size: 12px;
    line-height: 1.35;
  }

  body.admin-body .admin-mobile-section-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    min-width: 78px;
    padding: 0 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #334155;
    font-size: 12px;
    font-weight: 950;
  }

  body.admin-body .admin-mobile-section-toggle:focus-visible {
    border-color: #2563eb;
    outline: 2px solid #bfdbfe;
    outline-offset: 2px;
  }

  body.admin-body .admin-autopilot-section.is-mobile-collapsed > :not(.admin-section-heading) {
    display: none !important;
  }

  body.admin-body .admin-autopilot-section .admin-inline-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }

  body.admin-body .admin-autopilot-section .admin-inline-actions .admin-select {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
  }

  body.admin-body .admin-autopilot-section .admin-inline-actions .admin-link-button,
  body.admin-body .admin-autopilot-section .admin-inline-actions .admin-mobile-section-toggle {
    width: 100%;
    min-height: 40px;
  }

  body.admin-body .admin-runtime-summary,
  body.admin-body .admin-pareto-summary,
  body.admin-body .admin-history-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  body.admin-body .admin-runtime-compact-strip {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    background: #f0f9ff;
    color: #0f172a;
  }

  body.admin-body .admin-runtime-compact-strip strong,
  body.admin-body .admin-runtime-compact-strip span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.admin-body .admin-runtime-compact-strip strong {
    flex: 0 0 auto;
    color: #0369a1;
    font-size: 12px;
    font-weight: 950;
  }

  body.admin-body .admin-runtime-compact-strip span {
    color: #334155;
    font-size: 11px;
    font-weight: 850;
  }

  body.admin-body .admin-pareto-summary-card {
    min-height: 62px;
    padding: 8px;
  }

  body.admin-body .admin-runtime-card strong,
  body.admin-body .admin-pareto-summary-card strong {
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.admin-body .admin-runtime-card small,
  body.admin-body .admin-pareto-summary-card small {
    display: -webkit-box;
    overflow: hidden;
    font-size: 10.5px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  body.admin-body .admin-survivor-card summary {
    min-height: 48px;
    padding: 9px 10px;
  }

  body.admin-body .admin-pareto-desktop-table-wrap {
    display: none;
  }

  body.admin-body .admin-pareto-mobile-cards {
    display: grid;
    gap: 10px;
  }

  body.admin-body .admin-pareto-mobile-card {
    min-height: 0;
  }

  body.admin-body .admin-pareto-mobile-card:focus-visible {
    border-color: #2563eb;
    outline: 2px solid #bfdbfe;
    outline-offset: 2px;
  }

  body.admin-body .admin-history-chart {
    width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  body.admin-body .admin-history-svg {
    width: 100%;
    min-width: 0;
    min-height: 180px;
  }

  body.admin-body .admin-dialog {
    inset: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  body.admin-body .admin-dialog-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    min-height: 100dvh;
    max-height: 100dvh;
  }

  body.admin-body .admin-dialog-heading {
    position: sticky;
    top: 0;
    z-index: 2;
    flex-direction: row;
    align-items: flex-start;
    padding: 12px;
  }

  body.admin-body .admin-dialog-heading h2 {
    font-size: 18px;
    line-height: 1.25;
  }

  body.admin-body .admin-dialog-heading p:not(.eyebrow) {
    font-size: 12px;
    line-height: 1.35;
  }

  body.admin-body .admin-icon-button {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
  }

  body.admin-body .admin-dialog-body {
    gap: 10px;
    min-height: 0;
    max-height: none;
    padding: 12px;
    overflow: auto;
  }

  body.admin-body .admin-strategy-narrative-highlight {
    order: 1;
    padding: 12px;
  }

  body.admin-body .admin-dialog-holdings-section {
    order: 2;
  }

  body.admin-body .admin-dialog-structure-section {
    order: 3;
  }

  body.admin-body .admin-dialog-metrics-section {
    order: 4;
  }

  body.admin-body .admin-dialog-yes-section {
    order: 5;
  }

  body.admin-body .admin-dialog-feature-section {
    order: 6;
  }

  body.admin-body .admin-dialog-json-section {
    order: 7;
  }

  body.admin-body .admin-dialog-foldout {
    gap: 0;
    overflow: hidden;
    border: 1px solid #dbe3ee;
    border-radius: 8px;
    background: #fff;
  }

  body.admin-body .admin-dialog-foldout summary {
    min-height: 44px;
    padding: 10px 12px;
    background: #f8fafc;
  }

  body.admin-body .admin-dialog-foldout summary::after {
    content: "펼치기";
    color: #2563eb;
    font-size: 12px;
    font-weight: 950;
  }

  body.admin-body .admin-dialog-foldout[open] summary::after {
    content: "접기";
  }

  body.admin-body .admin-dialog-foldout > .admin-dialog-detail-list,
  body.admin-body .admin-dialog-foldout > .admin-feature-pill-list,
  body.admin-body .admin-dialog-foldout > .admin-json-block {
    margin: 10px;
  }

  body.admin-body .admin-dialog-detail-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  body.admin-body .admin-dialog-detail-list div {
    padding: 8px;
  }

  body.admin-body .admin-dialog-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px 12px;
  }

  body.admin-body .admin-dialog-actions .admin-helper-text {
    width: 100%;
    min-height: 0;
  }

  body.admin-body .admin-dialog-actions .admin-link-button {
    width: 100%;
    min-height: 44px;
  }

  body.admin-body #autopilotSyntheticPreview {
    max-height: 32vh;
    min-height: 0;
    padding: 0 12px 12px;
    overflow: auto;
  }
}
