:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f2f4ef;
  color: #14201c;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #f2f4ef;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(248, 247, 240, 0.98), rgba(239, 243, 238, 0.98)),
    linear-gradient(135deg, rgba(45, 118, 101, 0.1), rgba(204, 89, 65, 0.08));
}

button,
input,
textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  touch-action: manipulation;
}

img {
  display: block;
}

.shell {
  width: min(760px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: calc(8px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) calc(96px + env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left));
}

.shell.is-loading {
  display: grid;
  place-items: center;
}

.loading-card,
.auth-card,
.empty-state,
.notice {
  border: 1px solid rgba(20, 32, 28, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 48px rgba(29, 44, 39, 0.1);
}

.loading-card {
  display: grid;
  gap: 12px;
  justify-items: center;
  padding: 26px;
  color: #375c52;
}

.auth-card {
  display: grid;
  width: min(460px, 100%);
  gap: 16px;
  padding: 28px;
}

.auth-card h1 {
  margin: 0;
  font-size: clamp(2rem, 8vw, 3.5rem);
  letter-spacing: 0;
}

.auth-card p {
  margin: 0;
  color: #4f5d57;
  line-height: 1.45;
}

.auth-error {
  color: #a33828 !important;
}

.setup-card {
  display: grid;
  width: min(520px, 100%);
  gap: 16px;
  padding: 28px;
  border: 1px solid rgba(20, 32, 28, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 48px rgba(29, 44, 39, 0.1);
}

.setup-card.is-wide {
  width: min(720px, 100%);
}

.setup-card h1,
.setup-card p {
  margin: 0;
}

.setup-card h1 {
  color: #14201c;
  font-size: clamp(1.8rem, 6vw, 3rem);
  letter-spacing: 0;
}

.setup-muted {
  color: #53625c;
}

.setup-form {
  display: grid;
  gap: 14px;
}

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

.setup-form label {
  display: grid;
  gap: 7px;
  color: #35443f;
  font-size: 0.82rem;
  font-weight: 800;
}

.setup-form input,
.setup-form textarea {
  width: 100%;
  border: 1px solid rgba(20, 32, 28, 0.16);
  border-radius: 10px;
  background: rgba(248, 250, 247, 0.92);
  color: #14201c;
  font-weight: 650;
}

.setup-form input {
  min-height: 44px;
  padding: 0 12px;
}

.setup-form textarea {
  min-height: 92px;
  resize: vertical;
  padding: 11px 12px;
  line-height: 1.4;
}

.setup-span {
  grid-column: 1 / -1;
}

.setup-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #35443f;
  font-size: 0.82rem;
  font-weight: 850;
}

.setup-section-title small {
  color: #65736d;
  font-size: 0.76rem;
}

.ai-settings,
.research-service,
.notification-settings,
.source-settings,
.automation-settings {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(20, 32, 28, 0.12);
  border-radius: 12px;
  padding: 12px;
  background: rgba(248, 250, 247, 0.72);
}

.research-service {
  display: grid;
  gap: 12px;
  border-color: rgba(30, 95, 82, 0.2);
  background: linear-gradient(145deg, rgba(242, 251, 247, 0.94), rgba(248, 250, 247, 0.82));
}

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

.managed-service-card > span:last-child {
  min-width: 0;
}

.managed-service-card strong,
.managed-service-card small {
  display: block;
}

.managed-service-card strong {
  color: #14201c;
  font-size: 0.94rem;
  font-weight: 900;
}

.managed-service-card small {
  margin-top: 3px;
  color: #53625c;
  font-size: 0.79rem;
  font-weight: 700;
  line-height: 1.45;
}

.managed-service-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 11px;
  background: #1e5f52;
  color: #fff;
}

.managed-service-note,
.advanced-settings-note,
.field-help {
  margin: 0;
  color: #58665f;
  font-size: 0.76rem;
  font-weight: 750;
  line-height: 1.4;
  text-transform: none;
}

.managed-service-note {
  border-radius: 9px;
  background: rgba(30, 95, 82, 0.08);
  padding: 8px 10px;
  color: #365f55;
}

.research-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.research-mode-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-content: start;
  align-items: start;
  gap: 10px;
  min-height: 168px;
  border: 1px solid rgba(20, 32, 28, 0.13);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.84);
  padding: 13px;
  color: #14201c;
  text-align: left;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.research-mode-card:hover {
  transform: translateY(-1px);
  border-color: rgba(30, 95, 82, 0.34);
  box-shadow: 0 10px 24px rgba(20, 32, 28, 0.08);
}

.research-mode-card.is-selected {
  border-color: rgba(30, 95, 82, 0.62);
  background: linear-gradient(145deg, #fff, rgba(229, 245, 238, 0.92));
  box-shadow: inset 0 0 0 1px rgba(30, 95, 82, 0.12);
}

.research-mode-card.is-managed.is-selected {
  border-color: rgba(158, 107, 32, 0.58);
  background: linear-gradient(145deg, #fff, rgba(250, 240, 219, 0.9));
  box-shadow: inset 0 0 0 1px rgba(158, 107, 32, 0.12);
}

.research-mode-card > span:nth-child(2),
.research-mode-card strong,
.research-mode-card small {
  min-width: 0;
}

.research-mode-card strong,
.research-mode-card small {
  display: block;
}

.research-mode-card strong {
  font-size: 0.9rem;
  font-weight: 900;
}

.research-mode-card small {
  margin-top: 5px;
  color: #596761;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.43;
}

.research-mode-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: #1e5f52;
  color: #fff;
}

.research-mode-card.is-managed .research-mode-icon {
  background: #936b2e;
}

.research-mode-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.research-mode-heading em {
  border-radius: 999px;
  background: rgba(30, 95, 82, 0.1);
  padding: 3px 7px;
  color: #1e5f52;
  font-size: 0.64rem;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.research-mode-price {
  grid-column: 1 / -1;
  align-self: end;
  justify-self: start;
  border-radius: 999px;
  background: rgba(20, 32, 28, 0.06);
  padding: 5px 9px;
  color: #35443f;
  font-size: 0.7rem;
  font-weight: 900;
}

.advanced-settings {
  overflow: hidden;
  border: 1px solid rgba(20, 32, 28, 0.12);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.72);
}

.advanced-settings > summary {
  display: flex;
  min-height: 50px;
  cursor: pointer;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  color: #35443f;
  list-style: none;
}

.advanced-settings > summary::-webkit-details-marker {
  display: none;
}

.advanced-settings > summary::after {
  content: "+";
  flex: 0 0 auto;
  color: #65736d;
  font-size: 1.15rem;
  font-weight: 800;
}

.advanced-settings[open] > summary::after {
  content: "−";
}

.advanced-settings > summary span,
.advanced-settings > summary strong,
.advanced-settings > summary small {
  display: block;
  min-width: 0;
}

.advanced-settings > summary strong {
  font-size: 0.82rem;
  font-weight: 900;
}

.advanced-settings > summary small {
  margin-top: 2px;
  color: #65736d;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35;
}

.advanced-settings-body {
  display: grid;
  gap: 12px;
  border-top: 1px solid rgba(20, 32, 28, 0.1);
  padding: 12px;
}

.automation-disclosure {
  background: rgba(248, 250, 247, 0.72);
}

.automation-disclosure .automation-settings {
  border: 0;
  padding: 0;
  background: transparent;
}

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

.ai-usage-strip span {
  min-width: 0;
  border: 1px solid rgba(20, 32, 28, 0.1);
  border-radius: 10px;
  background: #fff;
  padding: 9px 10px;
}

.ai-usage-strip small,
.ai-usage-strip em {
  display: block;
  color: #65736d;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 800;
}

.ai-usage-strip strong {
  display: block;
  color: #14201c;
  font-size: 1rem;
  font-weight: 900;
}

.automation-endpoint {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid rgba(20, 32, 28, 0.1);
  border-radius: 10px;
  background: #fff;
  padding: 8px 10px;
  color: #35443f;
}

.automation-endpoint span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: none;
}

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

.automation-actions button,
.automation-token-reveal button,
.automation-token-list button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(20, 32, 28, 0.14);
  border-radius: 10px;
  background: #fff;
  color: #14201c;
  font-size: 0.78rem;
  font-weight: 850;
}

.automation-token-reveal {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(30, 95, 82, 0.2);
  border-radius: 10px;
  background: #f2fbf7;
  padding: 10px;
}

.automation-token-reveal div,
.automation-token-list article,
.automation-events {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.automation-token-reveal strong,
.automation-token-list strong,
.automation-events strong {
  display: block;
  color: #14201c;
  font-size: 0.83rem;
  font-weight: 900;
}

.automation-token-reveal small,
.automation-token-list small,
.automation-events small {
  display: block;
  color: #65736d;
  font-size: 0.72rem;
  font-weight: 800;
}

.automation-token-reveal textarea {
  width: 100%;
  min-height: 72px;
  border: 1px solid rgba(20, 32, 28, 0.14);
  border-radius: 10px;
  background: #fff;
  color: #14201c;
  padding: 9px 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
  font-weight: 650;
  resize: vertical;
}

.automation-token-list {
  display: grid;
  gap: 8px;
}

.automation-list-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.automation-token-list article {
  min-height: 44px;
  border: 1px solid rgba(20, 32, 28, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
  padding: 8px 10px;
}

.automation-token-list span {
  min-width: 0;
}

.automation-token-list em {
  color: #8f5b2f;
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 900;
}

.automation-events {
  align-items: stretch;
  overflow-x: auto;
}

.automation-events span {
  min-width: 150px;
  border: 1px solid rgba(20, 32, 28, 0.1);
  border-radius: 10px;
  background: #fff;
  padding: 8px 10px;
}

.automation-note {
  margin: 0;
  color: #58665f;
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.35;
}

.source-toggle-list {
  display: grid;
  gap: 8px;
}

.source-toggle-list.is-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.source-toggle-list label {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(20, 32, 28, 0.12);
  border-radius: 10px;
  background: #fff;
  padding: 0 12px;
  color: #14201c;
  font-size: 0.9rem;
  font-weight: 850;
  text-transform: none;
}

.source-toggle-list input {
  width: 18px;
  height: 18px;
  accent-color: #14201c;
  order: 2;
}

.taste-calibration {
  display: grid;
  gap: 12px;
}

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

.calibration-group > strong {
  color: #35443f;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

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

.calibration-option {
  min-height: 76px;
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px !important;
  border: 1px solid rgba(20, 32, 28, 0.12);
  border-radius: 10px;
  background: #fff;
  padding: 10px 12px;
  color: #14201c !important;
  text-transform: none;
}

.calibration-option.is-selected {
  border-color: rgba(45, 118, 101, 0.5);
  background: #eef7f2;
}

.calibration-option input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin-top: 2px;
  padding: 0;
  accent-color: #2d7665;
}

.calibration-option span,
.calibration-option b,
.calibration-option small {
  display: block;
  min-width: 0;
}

.calibration-option b {
  font-size: 0.9rem;
  font-weight: 900;
}

.calibration-option small {
  margin-top: 3px;
  color: #58665f;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.32;
}

.source-config-list {
  display: grid;
  gap: 10px;
}

.source-config-card {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(20, 32, 28, 0.12);
  border-radius: 10px;
  background: #fff;
  padding: 11px 12px;
}

.source-config-toggle,
.source-check {
  min-height: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #14201c;
  font-size: 0.9rem;
  font-weight: 850;
  text-transform: none;
}

.source-config-toggle input,
.source-check input {
  width: 18px;
  height: 18px;
  accent-color: #14201c;
  order: 2;
}

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

.source-detail-grid label {
  display: grid;
  gap: 6px;
  color: #58665f;
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.source-detail-grid .source-check {
  align-self: end;
  min-height: 42px;
  border: 1px solid rgba(20, 32, 28, 0.1);
  border-radius: 10px;
  padding: 0 10px;
}

.source-detail-grid .source-notes {
  grid-column: 1 / -1;
}

.source-detail-grid textarea {
  min-height: 68px;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(20, 32, 28, 0.12);
  border-radius: 12px;
  background: #eef3ef;
}

.segmented-control button {
  min-height: 36px;
  border-radius: 9px;
  color: #35443f;
  font-weight: 850;
}

.segmented-control button.is-active {
  background: #14201c;
  color: #fff;
}

.ai-budget-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.account-tools {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  border-top: 1px solid rgba(20, 32, 28, 0.12);
  padding-top: 12px;
}

.account-tools label {
  display: grid;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 850;
  color: #58665f;
  text-transform: uppercase;
}

.account-tools input {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(20, 32, 28, 0.16);
  border-radius: 10px;
  background: rgba(248, 250, 247, 0.92);
  color: #14201c;
  padding: 0 12px;
  font-weight: 650;
  text-transform: none;
}

.account-tool-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.account-tool-row button,
.danger-action {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(20, 32, 28, 0.14);
  border-radius: 10px;
  background: #fff;
  color: #14201c;
  font-weight: 850;
}

.danger-action {
  border-color: rgba(146, 36, 36, 0.24);
  color: #922424;
  background: #fff7f6;
}

.account-tool-row button:disabled,
.danger-action:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.admin-shell {
  width: min(980px, 100%);
  display: grid;
  gap: 14px;
}

.admin-header,
.admin-panel {
  border: 1px solid rgba(20, 32, 28, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 14px 36px rgba(29, 44, 39, 0.08);
}

.admin-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
}

.admin-header h1,
.admin-header p {
  margin: 0;
}

.admin-header h1 {
  font-size: clamp(2rem, 5vw, 3.3rem);
  letter-spacing: 0;
}

.admin-header > span {
  color: #53625c;
  font-weight: 800;
}

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

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

.admin-grid label {
  display: grid;
  gap: 7px;
  color: #35443f;
  font-size: 0.82rem;
  font-weight: 800;
}

.admin-grid input {
  min-height: 42px;
  border: 1px solid rgba(20, 32, 28, 0.16);
  border-radius: 10px;
  background: rgba(248, 250, 247, 0.92);
  padding: 0 12px;
  color: #14201c;
}

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

.admin-actions button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 10px;
  background: #14201c;
  padding: 0 14px;
  color: white;
  font-weight: 850;
}

.admin-actions button:disabled {
  opacity: 0.45;
}

.admin-status {
  margin: 0;
  color: #53625c;
  font-size: 0.9rem;
}

.admin-status.is-error {
  color: #9b3225;
}

.source-cache-grid {
  display: grid;
  gap: 10px;
}

.source-cache-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(20, 32, 28, 0.1);
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(248, 250, 247, 0.78);
}

.source-cache-card strong,
.source-cache-card small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-cache-card small {
  color: #53625c;
  font-size: 0.78rem;
}

.admin-ops-grid,
.source-cache-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.admin-ops-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.beta-calibration-panel {
  background:
    radial-gradient(circle at 100% 0%, rgba(45, 118, 101, 0.13), transparent 38%),
    rgba(255, 255, 255, 0.88);
}

.beta-cohort-table {
  display: grid;
  gap: 8px;
}

.beta-cohort-table article {
  display: grid;
  grid-template-columns: minmax(120px, 1.2fr) repeat(4, minmax(100px, 1fr));
  align-items: stretch;
  gap: 8px;
  border: 1px solid rgba(20, 32, 28, 0.1);
  border-radius: 12px;
  background: rgba(248, 250, 247, 0.78);
  padding: 10px;
}

.beta-cohort-table article > div:first-child {
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 0 4px;
}

.beta-cohort-table article > div:first-child strong {
  color: #14201c;
  font-size: 0.92rem;
  text-transform: capitalize;
}

.beta-cohort-table article > div:first-child small {
  color: #65736d;
  font-size: 0.75rem;
  font-weight: 750;
}

.invite-result {
  display: grid;
  gap: 4px;
  border-radius: 10px;
  background: #edf5f1;
  padding: 12px;
}

.invite-result span,
.invite-result small {
  color: #53625c;
  font-size: 0.78rem;
  font-weight: 800;
}

.invite-result strong {
  overflow-wrap: anywhere;
  color: #14201c;
  font-size: 1.08rem;
}

.admin-table {
  display: grid;
  gap: 8px;
}

.admin-table article {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) auto auto minmax(90px, auto) minmax(130px, auto);
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(20, 32, 28, 0.1);
  border-radius: 10px;
  padding: 10px 12px;
}

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

.admin-table small,
.admin-table span {
  color: #53625c;
  font-size: 0.82rem;
}

.admin-status-pill {
  border-radius: 999px;
  padding: 5px 8px;
  text-align: center;
  font-weight: 850;
}

.admin-status-pill.is-active {
  background: #dff0e9;
  color: #1d6657;
}

.admin-status-pill.is-ok {
  background: #dff0e9;
  color: #1d6657;
}

.admin-status-pill.is-invited {
  background: #f5e9d8;
  color: #7a4b16;
}

.admin-status-pill.is-disabled {
  background: #f0dedb;
  color: #7a2e24;
}

.admin-status-pill.is-failed {
  background: #f0dedb;
  color: #7a2e24;
}

.eyebrow {
  color: #64706b;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 -2px 8px;
  padding: 4px 2px 8px;
  background: linear-gradient(180deg, rgba(247, 247, 240, 0.98), rgba(247, 247, 240, 0.86));
  backdrop-filter: blur(18px);
}

.brand-line {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 10px;
}

.brand-line strong {
  overflow: hidden;
  color: #14201c;
  font-size: 1.08rem;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-line span {
  color: #53625c;
  font-size: 0.84rem;
  white-space: nowrap;
}

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

.icon-button,
.icon-toggle,
.private-button,
.review-rail button,
.review-rail a,
.filter-sheet button,
.scan-toolbar button {
  border: 1px solid rgba(20, 32, 28, 0.12);
  background: rgba(255, 255, 255, 0.78);
  color: #14201c;
}

.icon-button,
.private-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 12px;
}

.icon-toggle {
  display: flex;
  height: 36px;
  align-items: center;
  gap: 5px;
  border-radius: 12px;
  padding: 0 10px;
  font-size: 0.78rem;
  font-weight: 850;
}

.icon-toggle:disabled {
  cursor: progress;
  opacity: 0.58;
}

.icon-toggle.is-active {
  border-color: #14201c;
  background: #14201c;
  color: white;
}

.private-button {
  overflow: hidden;
  color: #2d7665;
}

.private-button .clerk-user-button,
.private-button .cl-userButton-root {
  width: 22px;
  height: 22px;
}

.mini-signout {
  border: 0;
  background: transparent;
  color: #2d7665;
  font-size: 0;
}

.notice {
  margin: 4px 0 10px;
  padding: 12px 14px;
  color: #7a2e24;
}

.deck-view {
  display: grid;
  gap: 10px;
}

.review-card {
  display: grid;
  gap: 10px;
}

.photo-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid rgba(20, 32, 28, 0.1);
  border-radius: 24px;
  background: #dfe5e0;
  box-shadow: 0 18px 52px rgba(29, 44, 39, 0.12);
  overflow: hidden;
}

.photo-stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.empty-photo {
  display: grid;
  height: 100%;
  place-items: center;
  gap: 10px;
  color: #6d7772;
}

.image-button {
  position: absolute;
  top: 50%;
  display: grid;
  width: 42px;
  height: 54px;
  place-items: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: 999px;
  background: rgba(20, 32, 28, 0.68);
  color: white;
  box-shadow: 0 10px 24px rgba(20, 32, 28, 0.22);
}

.image-button.is-left {
  left: 10px;
}

.image-button.is-right {
  right: 10px;
}

.photo-meta {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 7px 9px;
  background: rgba(20, 32, 28, 0.74);
  color: white;
  font-size: 0.8rem;
  font-weight: 850;
}

.photo-dots {
  display: flex;
  gap: 4px;
}

.photo-dots i {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
}

.photo-dots i.is-active {
  background: white;
}

.decision-strip {
  display: grid;
  grid-template-columns: auto auto minmax(52px, 1fr) auto;
  gap: 7px;
  align-items: center;
  min-height: 46px;
  border: 1px solid rgba(20, 32, 28, 0.11);
  border-radius: 18px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 32px rgba(29, 44, 39, 0.08);
}

.decision-strip > span:first-child,
.time-chip {
  display: inline-flex;
  min-width: 0;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 10px;
  background: #f0f3ef;
  color: #31423c;
  font-size: 0.82rem;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.decision-strip strong {
  min-width: 0;
  justify-self: end;
  color: #143e35;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.time-chip.is-urgent,
.is-urgent {
  color: #be3b26 !important;
}

.badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  width: fit-content;
  border: 1px solid rgba(20, 32, 28, 0.12);
  border-radius: 999px;
  padding: 4px 9px;
  background: #f7f8f5;
  color: #38534c;
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 850;
  white-space: nowrap;
}

.lane-family,
.is-starred {
  border-color: rgba(45, 118, 101, 0.28);
  background: #e6f2ee;
  color: #1e5f52;
}

.lane-solo {
  border-color: rgba(47, 86, 153, 0.24);
  background: #e7edf8;
  color: #284d88;
}

.lane-curiosity {
  border-color: rgba(136, 84, 176, 0.2);
  background: #efe9f8;
  color: #5c3b82;
}

.is-hidden {
  border-color: rgba(110, 119, 114, 0.24);
  background: #ecefed;
  color: #58615d;
}

.is-avoid {
  border-color: rgba(151, 63, 53, 0.24);
  background: #f4e7e5;
  color: #893b33;
}

.listing-primer {
  display: grid;
  gap: 10px;
  padding: 2px 2px 4px;
}

.title-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}

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

.title-row h1 {
  font-size: clamp(1.55rem, 7.5vw, 2.4rem);
  line-height: 1.02;
}

.title-row p {
  display: -webkit-box;
  margin: 6px 0 0;
  overflow: hidden;
  color: #4d5d56;
  line-height: 1.28;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.location-line {
  display: flex !important;
  align-items: center;
  gap: 5px;
  color: #476158 !important;
  font-size: 0.92rem;
  font-weight: 750;
  -webkit-line-clamp: 1 !important;
}

.location-line svg {
  flex: 0 0 auto;
  color: #2d7665;
}

.location-line span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feedback-dot {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 0.72rem;
  font-weight: 850;
}

.valuation-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid rgba(20, 32, 28, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  overflow: hidden;
}

.valuation-row.is-flat {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-radius: 0;
  border-width: 1px 0 0;
  background: transparent;
}

.metric {
  display: grid;
  min-height: 66px;
  align-content: center;
  gap: 4px;
  padding: 10px;
  border-right: 1px solid rgba(20, 32, 28, 0.1);
}

.metric:last-child {
  border-right: 0;
}

.metric span {
  color: #5f6d67;
  font-size: 0.72rem;
  font-weight: 750;
}

.metric strong {
  display: -webkit-box;
  overflow: hidden;
  overflow-wrap: anywhere;
  color: #143e35;
  font-size: 0.96rem;
  line-height: 1.08;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.metric.is-highlight strong {
  color: #c13a23;
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  border: 1px solid rgba(20, 32, 28, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  overflow: hidden;
}

.mini-stats span {
  display: flex;
  min-width: 0;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-right: 1px solid rgba(20, 32, 28, 0.1);
  color: #4d5d56;
  font-size: 0.82rem;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-stats span svg {
  flex: 0 0 auto;
}

.mini-stats span:last-child {
  border-right: 0;
}

.sticky-listing-strip {
  position: sticky;
  top: calc(48px + env(safe-area-inset-top));
  z-index: 12;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 66px;
  margin: 4px -2px 0;
  border: 1px solid rgba(20, 32, 28, 0.1);
  border-radius: 16px;
  padding: 7px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
  box-shadow: 0 10px 28px rgba(29, 44, 39, 0.1);
}

.sticky-listing-strip img,
.mini-empty {
  width: 54px;
  height: 48px;
  border-radius: 11px;
  object-fit: cover;
  background: #dfe6e1;
}

.mini-empty {
  display: grid;
  place-items: center;
  color: #6d7772;
  font-size: 0.68rem;
  font-weight: 800;
}

.sticky-listing-strip strong,
.sticky-listing-strip small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sticky-listing-strip strong {
  font-size: 0.94rem;
}

.sticky-listing-strip small {
  margin-top: 2px;
  color: #5d6a64;
  font-size: 0.78rem;
}

.sticky-listing-strip > span {
  color: #4e5f58;
  font-size: 0.82rem;
  font-weight: 850;
}

.details-sheet {
  display: grid;
  gap: 0;
  margin-top: 2px;
  border-top: 1px solid rgba(20, 32, 28, 0.1);
}

.detail-section {
  display: grid;
  gap: 8px;
  border-bottom: 1px solid rgba(20, 32, 28, 0.1);
  padding: 16px 2px;
}

.detail-section > p {
  margin: 0;
  color: #465b53;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-section div,
.detail-section li {
  color: #26342f;
  line-height: 1.42;
}

.detail-section ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.detail-section li {
  position: relative;
  padding-left: 18px;
}

.detail-section li::before {
  position: absolute;
  top: 0.55em;
  left: 2px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #c95339;
  content: "";
}

.detail-section.is-good li::before {
  background: #2d7665;
}

.stat-line {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
}

.stat {
  display: grid;
  gap: 3px;
  min-width: 0;
  border-right: 1px solid rgba(20, 32, 28, 0.1);
  padding: 4px 8px;
}

.stat:last-child {
  border-right: 0;
}

.stat svg {
  color: #2d7665;
}

.stat span {
  color: #5f6d67;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.stat strong {
  overflow-wrap: anywhere;
  color: #14201c;
  font-size: 0.9rem;
  line-height: 1.08;
}

/* Dossier detail (rich per-car sections) */
.spec-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
  margin-top: 2px;
}

.spec-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(20, 32, 28, 0.1);
}

.spec-cell {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.spec-cell span {
  color: #5f6d67;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.spec-cell strong {
  overflow-wrap: anywhere;
  color: #14201c;
  font-size: 0.9rem;
  line-height: 1.12;
}

.listing-prose {
  display: grid;
  gap: 11px;
}

.listing-prose p {
  margin: 0;
  color: #26342f;
  line-height: 1.5;
}

.value-meter {
  display: grid;
  gap: 7px;
}

.value-scale {
  display: flex;
  justify-content: space-between;
  color: #5f6d67;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.value-bar {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2d7665, #d8a43a 52%, #c95339);
}

.value-thumb {
  position: absolute;
  top: 50%;
  width: 15px;
  height: 15px;
  border: 2px solid #14201c;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 5px rgba(20, 32, 28, 0.3);
  transform: translate(-50%, -50%);
}

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

.fit-cell {
  display: grid;
  gap: 3px;
  border-radius: 12px;
  background: rgba(45, 118, 101, 0.08);
  padding: 10px 12px;
}

.fit-cell span {
  color: #5f6d67;
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
}

.fit-cell strong {
  color: #14201c;
  font-size: 0.88rem;
}

.bid-log {
  display: grid;
}

.bid-row {
  display: grid;
  grid-template-columns: 1fr auto 34px;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid rgba(20, 32, 28, 0.08);
  padding: 8px 0;
}

.bid-row:last-child {
  border-bottom: 0;
}

.bid-bidder {
  overflow: hidden;
  color: #26342f;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bid-row strong {
  color: #14201c;
}

.bid-row.is-top strong {
  color: #2d7665;
}

.bid-ago {
  color: #5f6d67;
  font-size: 0.72rem;
  text-align: right;
}

.comment-thread {
  display: grid;
  gap: 14px;
}

.comment {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
}

.comment-avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(20, 32, 28, 0.08);
  color: #14201c;
  font-size: 0.78rem;
  font-weight: 900;
}

.comment-avatar.is-seller {
  background: #2d7665;
  color: #fff;
}

.comment-body {
  min-width: 0;
}

.comment-head {
  display: flex;
  align-items: center;
  gap: 7px;
}

.comment-head strong {
  overflow: hidden;
  color: #14201c;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comment-head .comment-ago {
  margin-left: auto;
  color: #5f6d67;
  font-size: 0.72rem;
}

.seller-badge {
  border-radius: 5px;
  background: #2d7665;
  padding: 1px 6px;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
}

.comment-body p {
  margin: 3px 0 0;
  color: #26342f;
  line-height: 1.42;
}

.review-rail {
  position: fixed;
  right: max(10px, env(safe-area-inset-right));
  bottom: calc(8px + env(safe-area-inset-bottom));
  left: max(10px, env(safe-area-inset-left));
  z-index: 40;
  display: grid;
  grid-template-columns: 42px repeat(4, minmax(0, 1fr)) 42px;
  gap: 6px;
  width: min(736px, calc(100vw - max(20px, env(safe-area-inset-left) + env(safe-area-inset-right))));
  margin: 0 auto;
  border: 1px solid rgba(20, 32, 28, 0.12);
  border-radius: 22px;
  padding: 7px;
  background: rgba(250, 250, 246, 0.94);
  box-shadow: 0 18px 60px rgba(29, 44, 39, 0.22);
  backdrop-filter: blur(18px);
}

.review-rail button,
.review-rail a {
  display: grid;
  min-width: 0;
  min-height: 46px;
  place-items: center;
  border-radius: 16px;
  color: #14201c;
  text-decoration: none;
}

.review-rail button:first-child,
.review-rail button:last-child {
  background: #f3f5f1;
}

.rail-action {
  gap: 2px;
  font-size: 0.72rem;
  font-weight: 850;
}

.rail-action span {
  line-height: 1;
}

.rail-action.open-action {
  border-color: rgba(45, 118, 101, 0.25);
  background: #e6f2ee;
  color: #174d42;
}

.rail-action.is-selected {
  border-color: #14201c;
  background: #14201c;
  color: white;
}

.rail-action.is-star-action.is-selected {
  border-color: #d79600;
  background: #f2b50f;
  color: #14201c;
}

.rail-action.is-avoid-action.is-selected {
  border-color: #9a382d;
  background: #9a382d;
  color: white;
}

.filter-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  align-items: end;
}

.filter-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(20, 32, 28, 0.32);
}

.filter-sheet {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  width: min(760px, 100%);
  margin: 0 auto;
  border: 1px solid rgba(20, 32, 28, 0.12);
  border-radius: 26px 26px 0 0;
  padding: 10px 16px calc(18px + env(safe-area-inset-bottom));
  background: #fafaf6;
  box-shadow: 0 -18px 60px rgba(20, 32, 28, 0.22);
}

.settings-sheet {
  max-height: min(86vh, 760px);
  overflow-y: auto;
}

.pricing-sheet {
  max-height: min(90vh, 820px);
  overflow-y: auto;
  gap: 16px;
}

.pricing-sheet .sheet-title {
  align-items: flex-start;
}

.pricing-sheet .sheet-title .eyebrow {
  margin-bottom: 4px;
}

.clerk-pricing-table {
  min-height: 330px;
}

.pricing-unavailable {
  display: grid;
  justify-items: start;
  gap: 7px;
  border: 1px solid rgba(30, 95, 82, 0.16);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(242, 251, 247, 0.95), rgba(255, 255, 255, 0.9));
  padding: 20px;
  color: #1e5f52;
}

.pricing-unavailable strong {
  color: #14201c;
}

.pricing-unavailable small,
.pricing-footnote {
  color: #5a6862;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.45;
}

.pricing-footnote {
  margin: 0;
  text-align: center;
}

.sheet-grabber {
  justify-self: center;
  width: 46px;
  height: 5px;
  border-radius: 999px;
  background: #d3d9d4;
}

.sheet-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sheet-title strong {
  font-size: 1.1rem;
}

.sheet-title button {
  min-height: 36px;
  border-radius: 12px;
  padding: 0 12px;
  color: #1e5f52;
  font-weight: 850;
}

.search-box {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(20, 32, 28, 0.14);
  border-radius: 16px;
  padding: 0 13px;
  background: rgba(255, 255, 255, 0.82);
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #14201c;
}

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

.chip,
.toggle {
  min-height: 42px;
  border: 1px solid rgba(20, 32, 28, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
  color: #14201c;
  font-weight: 850;
}

.chip.is-active {
  border-color: #14201c;
  background: #14201c;
  color: white;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
}

.toggle input {
  accent-color: #2d7665;
}

.toggle span {
  min-width: 0;
  flex: 1;
}

.toggle small {
  display: grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: #e2e9e5;
  color: #38534c;
}

.scan-view {
  display: grid;
  gap: 10px;
}

.scan-toolbar {
  position: sticky;
  top: calc(48px + env(safe-area-inset-top));
  z-index: 20;
  display: flex;
  gap: 8px;
  padding: 4px 0 8px;
  background: linear-gradient(180deg, rgba(247, 247, 240, 0.98), rgba(247, 247, 240, 0.86));
  backdrop-filter: blur(18px);
}

.scan-toolbar button {
  min-height: 38px;
  border-radius: 14px;
  padding: 0 12px;
  font-size: 0.82rem;
  font-weight: 850;
}

.listing-list {
  display: grid;
  border-top: 1px solid rgba(20, 32, 28, 0.1);
}

.scan-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 84px;
  border: 0;
  border-bottom: 1px solid rgba(20, 32, 28, 0.1);
  padding: 8px 2px;
  background: transparent;
  color: #14201c;
  text-align: left;
}

.scan-row.is-active {
  background: rgba(45, 118, 101, 0.06);
}

.scan-row img {
  width: 76px;
  height: 66px;
  border-radius: 12px;
  object-fit: cover;
  background: #dfe6e1;
}

.scan-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.scan-copy > span {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.scan-copy strong {
  overflow: hidden;
  font-size: 0.96rem;
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scan-copy .badge {
  min-height: 22px;
  padding: 2px 7px;
  font-size: 0.67rem;
}

.scan-copy small,
.scan-copy em {
  overflow: hidden;
  color: #5d6a64;
  font-size: 0.78rem;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scan-copy small {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 4px;
}

.scan-copy small svg {
  flex: 0 0 auto;
  color: #2d7665;
}

.scan-price {
  display: grid;
  min-width: 76px;
  justify-items: end;
  gap: 4px;
}

.scan-price strong {
  font-size: 0.92rem;
  white-space: nowrap;
}

.scan-price small {
  color: #5d6a64;
  font-size: 0.78rem;
  white-space: nowrap;
}

.scan-activity {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.scan-activity span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border-radius: 999px;
  background: rgba(20, 32, 28, 0.06);
  padding: 2px 5px;
  color: #4e5b55;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.scan-activity svg {
  width: 12px;
  height: 12px;
  color: #2d7665;
}

.budget-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  justify-self: end;
  border-radius: 999px;
  padding: 3px 6px;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.budget-chip svg {
  width: 12px;
  height: 12px;
}

.budget-chip.is-near {
  background: rgba(224, 166, 41, 0.16);
  color: #705116;
}

.budget-chip.is-stretch,
.budget-chip.is-over {
  background: rgba(179, 70, 47, 0.13);
  color: #8f3328;
}

.scan-price svg {
  color: #9aa49f;
}

.scan-price svg.is-lit {
  color: #e1a500;
  fill: #e1a500;
}

.empty-state {
  display: grid;
  min-height: 52vh;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 28px;
  text-align: center;
}

.empty-state h2 {
  margin: 0;
  font-size: 1.35rem;
}

.empty-state p {
  max-width: 420px;
  margin: 0;
  color: #65736d;
}

.source-link {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(20, 32, 28, 0.12);
  border-radius: 14px;
  background: #14201c;
  color: white;
  font-weight: 850;
  text-decoration: none;
}

.run-status-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin: 0 0 10px;
}

.run-status-main,
.run-now-action {
  border: 1px solid rgba(20, 32, 28, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  color: #14201c;
}

.run-status-main {
  display: flex;
  min-width: 0;
  min-height: 46px;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  text-align: left;
}

.run-status-main svg {
  flex: 0 0 auto;
  color: #2d7665;
}

.run-status-main span,
.run-status-main strong,
.run-status-main small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.run-status-main strong {
  font-size: 0.9rem;
  font-weight: 900;
}

.run-status-main small {
  margin-top: 2px;
  color: #5c6963;
  font-size: 0.76rem;
  font-weight: 750;
}

.run-now-action {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  font-size: 0.8rem;
  font-weight: 900;
}

.run-now-action:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.run-detail-sheet {
  max-height: min(88vh, 800px);
  overflow-y: auto;
}

.run-detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(20, 32, 28, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  padding: 14px;
}

.run-detail-hero h2,
.run-detail-hero p {
  margin: 0;
}

.run-detail-hero h2 {
  font-size: 1.28rem;
}

.run-detail-hero span {
  display: block;
  margin-top: 4px;
  color: #53625c;
  font-size: 0.88rem;
  font-weight: 750;
}

.run-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid rgba(20, 32, 28, 0.1);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.run-timeline,
.run-detail-section {
  display: grid;
  gap: 10px;
  border-top: 1px solid rgba(20, 32, 28, 0.1);
  padding-top: 12px;
}

.timeline-row {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.timeline-row > span {
  width: 12px;
  height: 12px;
  margin-top: 4px;
  border: 2px solid #a9b4ae;
  border-radius: 999px;
  background: #fafaf6;
}

.timeline-row.is-ok > span {
  border-color: #2d7665;
  background: #2d7665;
}

.timeline-row.is-running > span {
  border-color: #d79600;
  background: #f2b50f;
}

.timeline-row.is-warn > span {
  border-color: #9a382d;
  background: #9a382d;
}

.timeline-row strong,
.timeline-row small {
  display: block;
  min-width: 0;
}

.timeline-row strong {
  color: #14201c;
  font-size: 0.92rem;
}

.timeline-row small {
  margin-top: 2px;
  color: #5d6a64;
  line-height: 1.28;
}

.source-check-list,
.runner-task-list {
  display: grid;
  gap: 7px;
}

.source-check-list article,
.runner-task-list article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 46px;
  border: 1px solid rgba(20, 32, 28, 0.1);
  border-radius: 11px;
  background: #fff;
  padding: 8px 10px;
}

.runner-task-list article {
  grid-template-columns: auto minmax(0, 1fr);
}

.source-check-list strong,
.source-check-list small,
.runner-task-list strong,
.runner-task-list small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-check-list strong,
.runner-task-list strong {
  color: #14201c;
  font-size: 0.88rem;
}

.source-check-list small,
.runner-task-list small {
  margin-top: 2px;
  color: #65736d;
  font-size: 0.76rem;
}

.source-check-list .source-diagnostic-line,
.runner-task-list .source-diagnostic-line {
  color: #4d5e57;
  font-size: 0.72rem;
  line-height: 1.25;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.source-check-list em {
  color: #42524c;
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 900;
}

.source-status-dot {
  display: inline-flex;
  min-width: 58px;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 8px;
  background: #ecefed;
  color: #58615d;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.source-status-dot.is-ok {
  background: #dff0e9;
  color: #1d6657;
}

.source-status-dot.is-running {
  background: #f5e9d8;
  color: #7a4b16;
}

.source-status-dot.is-warn {
  background: #f0dedb;
  color: #7a2e24;
}

.run-ai-row,
.run-id-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.run-id-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.run-ai-row span,
.run-id-list span {
  min-width: 0;
  border: 1px solid rgba(20, 32, 28, 0.1);
  border-radius: 10px;
  background: #fff;
  padding: 9px 10px;
}

.run-ai-row small,
.run-id-list small {
  display: block;
  color: #65736d;
  font-size: 0.7rem;
  font-weight: 850;
  text-transform: uppercase;
}

.run-ai-row strong,
.run-id-list strong {
  display: block;
  min-width: 0;
  margin-top: 2px;
  overflow: hidden;
  color: #14201c;
  font-size: 0.88rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .settings-sheet {
    max-height: calc(100svh - 12px);
  }

  .research-mode-grid {
    grid-template-columns: 1fr;
  }

  .research-mode-card {
    min-height: 0;
  }
}

@media (min-width: 820px) {
  .shell {
    padding-top: 18px;
  }

  .photo-stage {
    aspect-ratio: 16 / 10;
  }
}

@media (max-width: 430px) {
  .shell {
    padding-right: max(10px, env(safe-area-inset-right));
    padding-left: max(10px, env(safe-area-inset-left));
  }

  .brand-line {
    display: grid;
    gap: 0;
  }

  .brand-line strong {
    font-size: 1.02rem;
  }

  .brand-line span {
    font-size: 0.76rem;
  }

  .icon-toggle {
    padding: 0 8px;
  }

  .icon-toggle:first-child span {
    max-width: 34px;
    overflow: hidden;
  }

  .private-button {
    display: none;
  }

  .setup-grid {
    grid-template-columns: 1fr;
  }

  .ai-budget-grid,
  .ai-usage-strip,
  .automation-actions,
  .calibration-grid,
  .run-status-strip,
  .run-detail-hero,
  .run-ai-row,
  .run-id-list {
    grid-template-columns: 1fr;
  }

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

  .setup-card {
    padding: 22px;
  }

  .admin-grid,
  .admin-ops-grid,
  .source-cache-card,
  .source-cache-metrics,
  .admin-table article {
    grid-template-columns: 1fr;
  }

  .beta-cohort-table article {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .beta-cohort-table article > div:first-child {
    grid-column: 1 / -1;
  }

  .admin-header {
    align-items: start;
    flex-direction: column;
  }

  .photo-stage {
    border-radius: 22px;
  }

  .image-button {
    width: 38px;
    height: 50px;
  }

  .decision-strip {
    grid-template-columns: auto auto minmax(46px, 1fr) minmax(58px, auto);
    gap: 5px;
  }

  .decision-strip > span:first-child,
  .time-chip {
    padding: 0 8px;
    font-size: 0.76rem;
  }

  .decision-strip strong {
    font-size: 0.86rem;
  }

  .valuation-row.is-flat {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-line {
    grid-template-columns: 1fr;
  }

  .stat {
    border-right: 0;
    border-bottom: 1px solid rgba(20, 32, 28, 0.1);
    padding: 8px 0;
  }

  .stat:last-child {
    border-bottom: 0;
  }

  .review-rail {
    grid-template-columns: 40px repeat(4, minmax(0, 1fr)) 40px;
    gap: 5px;
    padding: 6px;
  }

  .review-rail button,
  .review-rail a {
    min-height: 44px;
    border-radius: 14px;
  }

  .rail-action {
    font-size: 0.68rem;
  }

  .scan-row {
    grid-template-columns: 70px minmax(0, 1fr) auto;
    gap: 8px;
  }

  .scan-row img {
    width: 70px;
    height: 62px;
  }

  .scan-price {
    min-width: 68px;
  }
}
