/* Online feature-parity layer: responsive extensions for the existing prototype. */
.parity-live-summary,
.parity-calendar-summary,
.parity-resource-intro,
.parity-filter-card,
.parity-report-hero,
.parity-settings-card,
.parity-keyword-summary,
.parity-keyword-trend { padding: 22px; }

.parity-live-summary,
.parity-resource-intro,
.parity-calendar-summary,
.parity-report-hero,
.parity-chart-card .card-header,
.parity-chat-card .card-header,
.parity-audio-card .card-header,
.parity-monitor-card .card-header,
.parity-keyword-trend,
.parity-settings-card .card-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; }

.parity-live-summary h3,
.parity-resource-intro h3,
.parity-report-hero h3 { margin: 5px 0 6px; color: var(--text-strong); font-size: 21px; }
.parity-live-summary p,
.parity-resource-intro p,
.parity-report-hero p,
.parity-filter-card p,
.parity-muted-copy { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.parity-summary-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.parity-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin: 24px 0 12px; }
.parity-section-heading h3 { margin: 0 0 5px; color: var(--text-strong); font-size: 18px; }
.parity-section-heading p { margin: 0; color: var(--muted); font-size: 13px; }

.parity-route-list { overflow: hidden; }
.parity-route-row { display: grid; grid-template-columns: minmax(230px, 1fr) minmax(150px, .55fr) auto; align-items: center; gap: 16px; padding: 15px 20px; border-bottom: 1px solid var(--border); }
.parity-route-leading { display: flex; align-items: center; gap: 12px; min-width: 0; }
.parity-room-avatar { display: grid; flex: 0 0 auto; width: 34px; height: 34px; place-items: center; color: var(--primary); background: var(--primary-soft); border-radius: 10px; font-weight: 750; }
.parity-route-leading strong,
.parity-route-meta span { display: block; color: var(--text-strong); font-size: 14px; }
.parity-route-leading small,
.parity-route-meta small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.parity-capacity { display: flex; flex-wrap: wrap; gap: 10px 20px; padding: 13px 20px; color: var(--muted); background: var(--surface-soft); font-size: 12px; }

.parity-metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.parity-metric { display: flex; justify-content: space-between; min-height: 112px; padding: 18px; }
.parity-metric > div { display: grid; align-content: space-between; gap: 5px; }
.parity-metric span { color: var(--muted); font-size: 12px; }
.parity-metric strong { color: var(--text-strong); font-size: 25px; line-height: 1.1; letter-spacing: -.03em; }
.parity-metric small { color: var(--muted-2); font-size: 12px; }
.parity-metric-icon { display: grid; width: 31px; height: 31px; place-items: center; color: var(--primary); background: var(--primary-soft); border-radius: 10px; }
.parity-compact-metrics { margin-bottom: 18px; }
.parity-compact-metrics .parity-metric { min-height: 100px; }

.parity-live-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .9fr); gap: 18px; }
.parity-chart-card,
.parity-chat-card,
.parity-audio-card,
.parity-monitor-card { overflow: hidden; }
.parity-chart-card .card-header,
.parity-chat-card .card-header,
.parity-audio-card .card-header,
.parity-monitor-card .card-header { padding: 19px 20px 12px; }
.parity-chart { position: relative; min-height: 220px; margin: 0 20px; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: linear-gradient(180deg, var(--surface-soft), transparent); }
.parity-chart svg { width: 100%; height: 225px; color: var(--primary); }
.parity-chart .chart-line { stroke: var(--primary); fill: none; stroke-width: 3; }
.parity-chart .secondary { stroke: var(--purple); }
.parity-chart .chart-grid-line { stroke: var(--border); fill: none; stroke-width: 1; }
.parity-chart-empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; color: var(--muted); text-align: center; font-size: 13px; background: color-mix(in srgb, var(--surface) 62%, transparent); }
.parity-chart-axis { display: flex; justify-content: space-between; padding: 10px 22px 17px; color: var(--muted-2); font-size: 11px; }
.parity-inline-search { display: flex; gap: 8px; padding: 0 20px 14px; }
.parity-inline-search .input { min-width: 0; }
.parity-chat-log { display: grid; gap: 1px; border-top: 1px solid var(--border); }
.parity-chat-log > div { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 12px 20px; }
.parity-chat-log .avatar { width: 28px; height: 28px; font-size: 10px; }
.parity-chat-log p { display: grid; gap: 2px; min-width: 0; margin: 0; }
.parity-chat-log strong { color: var(--text-strong); font-size: 12px; }
.parity-chat-log small { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.parity-chat-log time { color: var(--muted-2); font-size: 11px; }

.parity-audio-layout { display: grid; grid-template-columns: minmax(150px, .5fr) minmax(0, 1fr); border-top: 1px solid var(--border); }
.parity-audio-list { display: grid; border-right: 1px solid var(--border); }
.parity-audio-item { display: grid; grid-template-columns: 44px 1fr; gap: 8px; padding: 13px 16px; color: var(--muted); text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--border); }
.parity-audio-item.active { color: var(--primary); background: var(--primary-soft); }
.parity-audio-item time { font-size: 11px; }
.parity-audio-item span { font-size: 13px; font-weight: 650; }
.parity-transcript { padding: 17px; }
.parity-transcript p { margin: 9px 0; color: var(--text-strong); font-size: 14px; line-height: 1.75; }
.parity-transcript small { color: var(--muted); font-size: 12px; line-height: 1.55; }
.parity-monitor-card { align-self: stretch; }
.parity-monitor-detail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; border-top: 1px solid var(--border); }
.parity-monitor-detail > div { display: grid; gap: 5px; padding: 14px 16px; background: var(--surface-soft); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.parity-monitor-detail span { color: var(--muted); font-size: 11px; }
.parity-monitor-detail strong { color: var(--text-strong); font-size: 13px; }
.parity-monitor-card > .parity-muted-copy { padding: 4px 20px 20px; }

.parity-resource-intro { margin-bottom: 18px; }
.parity-resource-intro p { max-width: 720px; }
.parity-workspace-panel { padding: 0; overflow: visible; }
.parity-table { min-width: 800px; }
.parity-table th { white-space: nowrap; }
.parity-table td { vertical-align: middle; }
.parity-cell-note { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.parity-table .link-action + .link-action { margin-left: 10px; }

.parity-calendar-summary { display: grid; grid-template-columns: minmax(260px, 1.5fr) repeat(3, minmax(105px, .45fr)); gap: 20px; }
.parity-calendar-summary > div { display: grid; align-content: center; gap: 5px; }
.parity-calendar-summary > div:not(:first-child) { padding-left: 20px; border-left: 1px solid var(--border); }
.parity-calendar-summary strong { color: var(--text-strong); font-size: 19px; }
.parity-calendar-summary > div:not(:first-child) strong { font-size: 21px; }
.parity-calendar-summary small,
.parity-calendar-summary span { color: var(--muted); font-size: 12px; }
.parity-calendar-shell { overflow: hidden; }
.parity-calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.parity-calendar-toolbar > div { display: flex; gap: 7px; }
.parity-calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(130px, 1fr)); min-width: 910px; }
.parity-calendar-day { min-height: 260px; border-right: 1px solid var(--border); }
.parity-calendar-day:last-child { border-right: 0; }
.parity-calendar-day > header { display: flex; align-items: start; justify-content: space-between; padding: 13px 13px 6px; }
.parity-calendar-day > header span,
.parity-calendar-day > header strong { display: block; }
.parity-calendar-day > header span { color: var(--muted); font-size: 11px; }
.parity-calendar-day > header strong { margin-top: 2px; color: var(--text-strong); font-size: 19px; }
.parity-calendar-day > header button { display: grid; width: 25px; height: 25px; place-items: center; color: var(--primary); background: var(--primary-soft); border: 0; border-radius: 7px; }
.parity-holiday { display: block; min-height: 31px; padding: 0 13px; color: var(--muted-2); font-size: 10px; }
.parity-day-events { display: grid; gap: 7px; padding: 8px; }
.parity-day-events > p { margin: 7px 5px; color: var(--muted-2); font-size: 11px; }
.parity-calendar-event { display: grid; gap: 4px; padding: 9px; color: var(--text-strong); text-align: left; background: var(--primary-soft); border: 1px solid color-mix(in srgb, var(--primary) 20%, var(--border)); border-radius: 9px; }
.parity-calendar-event time { color: var(--primary); font-size: 10px; font-weight: 700; }
.parity-calendar-event strong { font-size: 12px; }
.parity-calendar-event span { color: var(--muted); font-size: 10px; line-height: 1.4; }

.parity-filter-card { display: grid; gap: 13px; margin-bottom: 18px; }
.parity-filter-fields { display: grid; grid-template-columns: 1.2fr repeat(3, minmax(150px, 1fr)); gap: 12px; }
.parity-filter-fields label,
.parity-dialog-form label,
.parity-password-grid label { display: grid; gap: 6px; color: var(--text-strong); font-size: 12px; font-weight: 650; }
.parity-session-table { min-width: 1260px; }
.parity-session-actions { position: relative; min-width: 210px; }
.parity-session-actions .btn { min-height: 34px; font-size: 12px; }
.parity-inline-menu { position: absolute; z-index: 4; top: calc(100% - 5px); right: 7px; display: grid; width: 188px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-md); }
.parity-inline-menu button { padding: 9px; color: var(--text); text-align: left; background: transparent; border: 0; border-radius: 7px; font-size: 12px; }
.parity-inline-menu button:hover { background: var(--surface-soft); color: var(--primary); }

.parity-report-hero { margin-bottom: 18px; }
.parity-report-stack { display: grid; gap: 18px; }
.parity-report-callout { padding: 26px; border-left: 4px solid var(--primary); }
.parity-report-callout h3 { max-width: 780px; margin: 8px 0 10px; color: var(--text-strong); font-size: 22px; line-height: 1.45; }
.parity-report-callout p,
.parity-report-copy,
.parity-two-columns p { color: var(--text); font-size: 14px; line-height: 1.75; }
.parity-report-callout ul { display: grid; gap: 7px; margin: 15px 0 0; padding-left: 20px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.parity-two-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
.parity-two-columns > div { padding: 22px; }
.parity-two-columns > div + div { border-left: 1px solid var(--border); }
.parity-two-columns h3,
.parity-report-stack h3,
.parity-timeline-report h3,
.parity-source-list h3 { margin: 0 0 11px; color: var(--text-strong); font-size: 17px; }
.parity-ranked-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.parity-ranked-list li > button,
.parity-ranked-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 7px 0; color: var(--text); background: transparent; border: 0; border-bottom: 1px solid var(--border); text-align: left; }
.parity-ranked-list strong { color: var(--text-strong); }
.parity-timeline-report { padding: 22px; }
.parity-timeline-report article { display: grid; grid-template-columns: minmax(130px, .28fr) 1fr; gap: 18px; padding: 18px 0; border-top: 1px solid var(--border); }
.parity-timeline-report time { color: var(--primary); font-size: 12px; font-weight: 700; }
.parity-timeline-report h4 { margin: 0 0 6px; color: var(--text-strong); font-size: 15px; }
.parity-timeline-report p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.parity-source-list { padding: 22px; }
.parity-source-list dl { display: grid; gap: 0; margin: 0; }
.parity-source-list dl > div { display: grid; grid-template-columns: minmax(170px, .35fr) 1fr; gap: 16px; padding: 15px 0; border-top: 1px solid var(--border); }
.parity-source-list dt { color: var(--text-strong); font-size: 13px; font-weight: 700; }
.parity-source-list dd { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }

.parity-keyword-summary { display: grid; gap: 18px; }
.parity-keyword-summary > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.parity-keyword-summary .parity-metric { min-height: 88px; padding: 15px; }
.parity-keyword-summary .parity-metric strong { font-size: 20px; }
.parity-segmented,
.parity-limit-buttons { display: flex; gap: 7px; flex-wrap: wrap; }
.parity-segmented button,
.parity-limit-buttons button,
.parity-preference-list button { min-height: 32px; padding: 0 11px; color: var(--muted); background: var(--surface-soft); border: 1px solid var(--border); border-radius: 8px; font-size: 12px; }
.parity-segmented button.active,
.parity-limit-buttons button.active,
.parity-preference-list button.active { color: var(--primary); background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 32%, var(--border)); font-weight: 700; }
.parity-keyword-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); gap: 18px; }
.parity-keyword-rank { padding-bottom: 13px; }
.parity-keyword-rank .card-header { padding: 19px 20px 8px; }
.parity-keyword-rank .parity-limit-buttons,
.parity-keyword-rank .parity-ranked-list { margin: 0 20px; }
.parity-keyword-rank .parity-ranked-list { margin-top: 8px; }
.parity-keyword-trend { margin-top: 18px; }
.parity-mini-bars { display: flex; align-items: end; gap: 8px; height: 70px; }
.parity-mini-bars i { display: block; width: 15px; height: var(--bar); min-height: 18px; background: linear-gradient(180deg, var(--primary), var(--purple)); border-radius: 5px 5px 2px 2px; }
.parity-rule-catalog,
.parity-stt-card { padding: 22px; }
.parity-rule-list { display: grid; margin-top: 12px; border-top: 1px solid var(--border); }
.parity-rule-list article { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--border); }
.parity-rule-list strong,
.parity-rule-list small { display: block; }
.parity-rule-list strong { color: var(--text-strong); font-size: 14px; }
.parity-rule-list small { margin-top: 4px; color: var(--muted); font-size: 12px; }
.parity-term-grid { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 20px 18px; }
.parity-term-grid span { padding: 7px 10px; color: var(--primary); background: var(--primary-soft); border-radius: 8px; font-size: 12px; font-weight: 650; }
.parity-stt-card > .parity-muted-copy { padding: 0 20px; }

.parity-settings-tabs { margin-bottom: 18px; overflow-x: auto; }
.parity-settings-card { overflow: hidden; }
.parity-password-grid { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 12px; padding: 0 22px 22px; }
.parity-legal-links { display: grid; border-top: 1px solid var(--border); }
.parity-legal-links button { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 15px 22px; color: var(--text-strong); text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--border); }
.parity-legal-links button:hover { color: var(--primary); background: var(--surface-soft); }
.parity-legal-links small { color: var(--muted); font-size: 12px; }
.parity-capability-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--border); }
.parity-capability-grid article { display: flex; align-items: center; gap: 11px; padding: 17px 22px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.parity-capability-grid article > span { display: grid; width: 28px; height: 28px; place-items: center; color: var(--success); background: var(--success-soft); border-radius: 50%; }
.parity-capability-grid strong,
.parity-capability-grid small { display: block; }
.parity-capability-grid strong { color: var(--text-strong); font-size: 13px; }
.parity-capability-grid small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.parity-settings-card > .parity-muted-copy { padding: 16px 22px 0; }
.parity-preference-list,
.parity-config-list { display: grid; border-top: 1px solid var(--border); }
.parity-preference-list article,
.parity-config-list article { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 17px 22px; border-bottom: 1px solid var(--border); }
.parity-preference-list strong,
.parity-preference-list small,
.parity-config-list strong,
.parity-config-list small { display: block; }
.parity-preference-list strong,
.parity-config-list strong { color: var(--text-strong); font-size: 14px; }
.parity-preference-list small,
.parity-config-list small { max-width: 660px; margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.parity-preference-list article > div:last-child { display: flex; flex-wrap: wrap; justify-content: end; gap: 7px; }

.parity-modal-backdrop { position: fixed; z-index: 60; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(8, 15, 31, .55); }
.parity-modal { display: grid; width: min(760px, 100%); max-height: min(820px, calc(100dvh - 40px)); overflow: hidden; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-md); }
.parity-modal > header,
.parity-modal > footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.parity-modal > header h3 { margin: 0; color: var(--text-strong); font-size: 18px; }
.parity-modal > header p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.parity-modal > footer { justify-content: end; border-top: 1px solid var(--border); border-bottom: 0; }
.parity-dialog-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 20px; overflow: auto; }
.parity-dialog-form label:nth-child(n + 9) { grid-column: 1 / -1; }

.parity-legal-shell { min-height: 100vh; color: var(--text); background: var(--page); }
.parity-legal-shell > header { display: flex; align-items: center; justify-content: space-between; gap: 20px; max-width: 1040px; padding: 20px 28px; margin: 0 auto; }
.parity-legal-shell nav { display: flex; gap: 8px; flex-wrap: wrap; }
.parity-legal-shell nav button,
.parity-legal-back { padding: 8px 10px; color: var(--muted); background: transparent; border: 0; border-radius: 8px; font-size: 13px; }
.parity-legal-shell nav button.active,
.parity-legal-shell nav button:hover,
.parity-legal-back:hover { color: var(--primary); background: var(--primary-soft); }
.parity-legal-shell > main { width: min(860px, calc(100% - 40px)); padding: clamp(28px, 5vw, 58px); margin: 12px auto 56px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-sm); }
.parity-legal-shell h1 { margin: 8px 0 10px; color: var(--text-strong); font-size: clamp(28px, 4vw, 38px); }
.parity-legal-intro { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.75; }
.parity-legal-notice { margin: 24px 0; padding: 14px 16px; color: var(--warning); background: var(--warning-soft); border: 1px solid color-mix(in srgb, var(--warning) 20%, var(--border)); border-radius: 10px; font-size: 13px; line-height: 1.65; }
.parity-legal-shell section { padding: 21px 0; border-top: 1px solid var(--border); }
.parity-legal-shell h2 { margin: 0 0 8px; color: var(--text-strong); font-size: 18px; }
.parity-legal-shell section p { margin: 0; color: var(--text); font-size: 14px; line-height: 1.85; }

@media (max-width: 1180px) {
  .parity-metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .parity-live-grid,
  .parity-keyword-layout { grid-template-columns: 1fr; }
  .parity-calendar-summary { grid-template-columns: minmax(220px, 1.2fr) repeat(3, minmax(90px, .45fr)); }
}

@media (max-width: 820px) {
  .parity-live-summary,
  .parity-resource-intro,
  .parity-report-hero,
  .parity-keyword-trend { align-items: start; flex-direction: column; }
  .parity-section-heading { align-items: start; flex-direction: column; }
  .parity-route-row { grid-template-columns: 1fr auto; }
  .parity-route-meta { grid-column: 1; }
  .parity-route-row .tag { grid-column: 2; grid-row: 1 / span 2; }
  .parity-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .parity-calendar-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .parity-calendar-summary > div:first-child { grid-column: 1 / -1; }
  .parity-calendar-summary > div:not(:first-child) { padding-left: 0; border-left: 0; }
  .parity-filter-fields,
  .parity-password-grid { grid-template-columns: 1fr 1fr; }
  .parity-password-grid .btn { grid-column: 1 / -1; }
  .parity-two-columns,
  .parity-capability-grid { grid-template-columns: 1fr; }
  .parity-two-columns > div + div { border-top: 1px solid var(--border); border-left: 0; }
  .parity-timeline-report article,
  .parity-source-list dl > div { grid-template-columns: 1fr; gap: 7px; }
  .parity-capability-grid article { border-right: 0; }
  .parity-preference-list article,
  .parity-config-list article { align-items: start; flex-direction: column; }
  .parity-preference-list article > div:last-child { justify-content: start; }
}

@media (max-width: 520px) {
  .parity-live-summary,
  .parity-calendar-summary,
  .parity-resource-intro,
  .parity-filter-card,
  .parity-report-hero,
  .parity-settings-card,
  .parity-rule-catalog,
  .parity-stt-card { padding: 16px; }
  .parity-metric-grid,
  .parity-keyword-summary > div,
  .parity-filter-fields,
  .parity-password-grid { grid-template-columns: 1fr; }
  .parity-metric { min-height: 92px; }
  .parity-metric strong { font-size: 22px; }
  .parity-route-row { padding: 14px 16px; }
  .parity-capacity { padding: 12px 16px; }
  .parity-calendar-toolbar { align-items: start; flex-wrap: wrap; }
  .parity-calendar-toolbar > div { width: 100%; }
  .parity-audio-layout { grid-template-columns: 1fr; }
  .parity-audio-list { grid-template-columns: repeat(3, 1fr); border-right: 0; border-bottom: 1px solid var(--border); }
  .parity-audio-item { grid-template-columns: 1fr; padding: 10px; }
  .parity-monitor-detail { grid-template-columns: 1fr; }
  .parity-keyword-rank .parity-ranked-list,
  .parity-keyword-rank .parity-limit-buttons { margin-inline: 16px; }
  .parity-rule-list article { grid-template-columns: 1fr auto; }
  .parity-rule-list .link-action { grid-column: 1 / -1; justify-self: start; }
  .parity-dialog-form { grid-template-columns: 1fr; padding: 16px; }
  .parity-dialog-form label:nth-child(n + 9) { grid-column: auto; }
  .parity-legal-shell > header { align-items: start; flex-direction: column; padding: 16px 20px; }
  .parity-legal-shell > main { width: min(100% - 24px, 860px); padding: 28px 20px; }
}

/* -------------------------------------------------------------------------- */
/* Dark theme reconciliation                                                   */
/* The operator visual layer defines its own light palette.  Keep those       */
/* values in the same token system as the base theme so every route switches  */
/* together instead of leaving a light content canvas beneath dark cards.     */
/* -------------------------------------------------------------------------- */
[data-theme="dark"] .app-shell {
  --operator-page: #0d1425;
  --operator-heading-color: #f5f8ff;
  --operator-copy-color: #aebdd1;
  --operator-border: #2c3e5b;
  --operator-soft-blue: #172f5d;
  --page: #0d1425;
  --surface: #162238;
  --surface-soft: #111c30;
  --surface-blue: #172d55;
  --text: #d7e1ef;
  --text-strong: #f5f8ff;
  --muted: #aebdd1;
  --muted-2: #8294ad;
  --border: #2c3e5b;
  --border-strong: #3d5274;
  --primary-soft: #17386f;
  --success-soft: #10382d;
  --warning-soft: #3a2b13;
  --danger-soft: #3c2027;
}

[data-theme="dark"] body:not(.auth-page),
[data-theme="dark"] .app-shell,
[data-theme="dark"] .app-shell .main,
[data-theme="dark"] .parity-legal-shell {
  background: #0d1425;
}

[data-theme="dark"] .app-shell .topbar {
  background: rgba(16, 27, 47, .96);
  border-bottom-color: var(--operator-border);
}

[data-theme="dark"] .app-shell .sidebar {
  background: linear-gradient(180deg, #0e1d38 0%, #09162d 100%);
  border-right-color: var(--operator-border);
}

[data-theme="dark"] .app-shell .sidebar-brand,
[data-theme="dark"] .app-shell .sidebar-user {
  border-color: var(--operator-border);
}

[data-theme="dark"] .app-shell .org-switcher,
[data-theme="dark"] .app-shell .sidebar-user .btn {
  background: #14233d;
  border-color: #304564;
}

[data-theme="dark"] .app-shell .org-switcher:hover,
[data-theme="dark"] .app-shell .sidebar-user .btn:hover,
[data-theme="dark"] .app-shell .nav-item:hover {
  background: #172b4b;
  border-color: #41618b;
}

[data-theme="dark"] .app-shell .nav-title { color: #8296b4; }
[data-theme="dark"] .app-shell .nav-item { color: #c0cee1; }
[data-theme="dark"] .app-shell .nav-item svg { color: #94a9c7; }
[data-theme="dark"] .app-shell .nav-item.active {
  color: #f7faff;
  background: linear-gradient(100deg, #1b417f, #183362);
}

[data-theme="dark"] .app-shell .breadcrumb,
[data-theme="dark"] .app-shell .table th,
[data-theme="dark"] .app-shell .operator-advanced-details > summary {
  color: var(--operator-copy-color);
}

[data-theme="dark"] .app-shell .card,
[data-theme="dark"] .app-shell .operator-advanced-details,
[data-theme="dark"] .app-shell .readiness,
[data-theme="dark"] .app-shell .topbar-search,
[data-theme="dark"] .app-shell .input,
[data-theme="dark"] .app-shell .select,
[data-theme="dark"] .app-shell .textarea,
[data-theme="dark"] .app-shell input,
[data-theme="dark"] .app-shell select,
[data-theme="dark"] .app-shell textarea {
  color: var(--text);
  background: var(--surface);
  border-color: var(--operator-border);
}

[data-theme="dark"] .app-shell .readiness {
  background: linear-gradient(105deg, #16253d 0%, #142239 68%, #172d52 100%);
}

[data-theme="dark"] .app-shell .operator-advanced-details[open] > summary {
  background: #172b4b;
  border-bottom-color: var(--operator-border);
}

[data-theme="dark"] .app-shell .table td,
[data-theme="dark"] .app-shell .page-title h2,
[data-theme="dark"] .app-shell .card-title,
[data-theme="dark"] .app-shell .summary-copy strong,
[data-theme="dark"] .app-shell .metric-value,
[data-theme="dark"] .app-shell .readiness-main strong,
[data-theme="dark"] .app-shell .monitor-session-head strong,
[data-theme="dark"] .app-shell .setting-copy h4,
[data-theme="dark"] .app-shell .usage-card-top strong {
  color: var(--operator-heading-color);
}

[data-theme="dark"] .app-shell .page-title p,
[data-theme="dark"] .app-shell .card-subtitle,
[data-theme="dark"] .app-shell .metric-foot,
[data-theme="dark"] .app-shell .cell-sub,
[data-theme="dark"] .app-shell .summary-copy span,
[data-theme="dark"] .app-shell .metric-label,
[data-theme="dark"] .app-shell .readiness-main span,
[data-theme="dark"] .app-shell .setting-copy p,
[data-theme="dark"] .app-shell .plan-desc {
  color: var(--operator-copy-color);
}

[data-theme="dark"] .app-shell .btn:not(.btn-primary):not(.btn-danger),
[data-theme="dark"] .app-shell .tab,
[data-theme="dark"] .app-shell .settings-tabs button {
  color: var(--text);
  border-color: var(--operator-border);
}

[data-theme="dark"] .app-shell .btn-ghost { background: transparent; }
[data-theme="dark"] .app-shell .btn:hover:not(.btn-primary):not(.btn-danger) { background: #1b2d49; }

/* The original cloud uses saturated light-theme ink.  Lift each hue on the
   dark canvas so all words remain discoverable before a user hovers them. */
[data-theme="dark"] .app-shell .word-cloud-item.blue { --word-color: #77aaff; }
[data-theme="dark"] .app-shell .word-cloud-item.purple { --word-color: #b8aaff; }
[data-theme="dark"] .app-shell .word-cloud-item.cyan { --word-color: #5dd9e7; }
[data-theme="dark"] .app-shell .word-cloud-item.orange { --word-color: #f5bd63; }
[data-theme="dark"] .app-shell .word-cloud-item:hover,
[data-theme="dark"] .app-shell .word-cloud-item:focus-visible,
[data-theme="dark"] .app-shell .word-cloud-item.selected,
[data-theme="dark"] .app-shell .word-cloud-item.is-hovered {
  background: color-mix(in srgb, var(--word-color) 18%, var(--surface));
  box-shadow: 0 8px 22px color-mix(in srgb, var(--word-color) 26%, transparent);
}

/* The operator layer resets button typography.  Restore the per-word scale so
   the cloud continues to communicate frequency in both themes. */
.app-shell .word-cloud-item {
  font-size: clamp(15px, var(--word-size), 44px);
  font-weight: 780;
}

@media (max-width: 520px) {
  .app-shell .word-cloud-item { font-size: calc(var(--word-size) * .74); }
}

[data-theme="dark"] .parity-modal,
[data-theme="dark"] .parity-inline-menu,
[data-theme="dark"] .parity-legal-shell > main {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .parity-modal-backdrop { background: rgba(3, 8, 19, .72); }
