:root {
  color-scheme: light;
  /* Same palette as the landing page (spotranking.net/ai-visibility-tracker/) */
  --bg: #F6F4EF;          /* paper */
  --surface: #ffffff;
  --ink: #0E1B2C;
  --ink-2: #1E2C40;
  --ink-line: #2A3A50;
  --ink-text: #B9C2CD;
  --muted: #5E6976;
  --line: #E6E3DC;
  --accent: #FF5A36;      /* LP accent */
  --accent-strong: #C93A1B; /* accent for text on white (contrast >= 4.5) */
  --accent-soft: #FFF0EB;
  --blue: #2F6BFF;
  --blue-soft: #EEF3FF;
  --teal: #14A38B;
  --teal-soft: #E8F7F3;
  --purple: #14A38B;
  --purple-soft: #E8F7F3;
  --orange: #FF5A36;
  --orange-soft: #FFF0EB;
  --amber: #B7791F;
  --amber-soft: #FFF8DB;
  --gold: #C6943F;
  --warning: #B65719;
  --danger: #9E2634;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(14, 27, 44, 0.04), 0 8px 24px rgba(14, 27, 44, 0.05);
  --shadow-soft: 0 6px 18px rgba(14, 27, 44, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #fbfcfb 0%, var(--bg) 42%, #f2f6f3 100%);
  color: var(--ink);
  font-family: Inter, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Noto Sans JP", Meiryo, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

.auth-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.auth-brand {
  color: var(--ink);
  margin-bottom: 18px;
}

.auth-tabs {
  width: 100%;
  margin-bottom: 18px;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

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

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mark {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #f6fbf8;
  color: #111614;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(17, 22, 20, 0.06);
}

.brand-block h1 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
  letter-spacing: 0;
}

.brand-block p,
.eyebrow,
.muted,
.metric-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.brand-block p {
  color: #b8c3bd;
}

.api-status {
  color: #b8c3bd;
  font-size: 12px;
}

.api-status.ok {
  color: #c6f2d7;
}

.api-status.error {
  color: #ffd0d5;
}

.api-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.api-retry-button {
  min-height: 26px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
  font-size: 11px;
  font-weight: 800;
}

.text-input,
input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(18, 106, 99, 0.12);
}

input::placeholder,
textarea::placeholder {
  color: #a8afab;
  opacity: 1;
}

.main {
  min-width: 0;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 32px 28px 56px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 30px;
}

.topbar h2 {
  margin: 6px 0 0;
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: 0;
  font-weight: 760;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 26px;
  min-width: 0;
}

.header-brand {
  flex: 0 0 auto;
}

.header-brand .mark {
  background: #111614;
  color: #f7fbf8;
}

.header-brand p {
  color: var(--muted);
}

.toolbar,
.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar .api-status {
  padding-right: 4px;
  color: var(--muted);
}

.primary-button,
.secondary-button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 720;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent) 0%, #0a5f58 100%);
  color: #fff;
  box-shadow: 0 14px 28px rgba(15, 118, 110, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.primary-button:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

.secondary-button {
  background: rgba(255, 255, 255, 0.78);
  border-color: var(--line);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.secondary-button:hover {
  border-color: #cfd8d2;
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
  margin-bottom: 18px;
}

.score-grid {
  max-width: none;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
}

.brand-selection-card,
.hero-report {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 48px;
}

.brand-selection-card {
  display: grid;
  gap: 26px;
  border-color: rgba(18, 106, 99, 0.22);
  background:
    linear-gradient(135deg, rgba(18, 106, 99, 0.08), rgba(255, 255, 255, 0) 36%),
    var(--surface);
  box-shadow: 0 30px 80px rgba(18, 25, 22, 0.1);
}

.brand-selection-card h3 {
  max-width: 860px;
  margin: 8px 0 12px;
  font-size: clamp(42px, 5vw, 68px);
  line-height: 0.98;
  letter-spacing: 0;
  font-weight: 780;
}

.brand-selection-card p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  overflow-wrap: anywhere;
}

.brand-selection-card .hero-description {
  max-width: 820px;
  margin-bottom: 14px;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.65;
}

.brand-selection-card label,
.switch-brand-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.brand-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
  gap: 12px;
  max-width: 880px;
}

.brand-editor .text-input {
  min-height: 64px;
  border-radius: 14px;
  font-size: 19px;
  padding: 0 20px;
}

.provider-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
}

.provider-checklist strong {
  border: 1px solid rgba(18, 106, 99, 0.18);
  border-radius: 999px;
  padding: 8px 12px;
  background: #f3faf6;
  color: var(--accent-strong);
  font-size: 13px;
}

.hero-action {
  min-height: 64px;
  width: 100%;
  font-size: 19px;
  border-radius: 14px;
}

.hero-report {
  display: grid;
  gap: 18px;
  align-content: start;
}

.hero-report p {
  margin: 0;
  color: var(--ink);
  font-size: 19px;
  line-height: 1.65;
}

.report-card p {
  max-width: 980px;
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.65;
}

.onboarding-card {
  margin-top: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
  padding: 26px;
}

.onboarding-step {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  display: grid;
  gap: 12px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.onboarding-step span {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 800;
}

.onboarding-step strong {
  font-size: 21px;
  letter-spacing: 0;
}

.onboarding-step p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.onboarding-arrow {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.advanced-insights,
.history-panel {
  margin-top: 16px;
  padding: 0;
  overflow: hidden;
}

.advanced-insights > summary,
.history-panel > summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  cursor: pointer;
  font-weight: 800;
}

.advanced-insights > summary::-webkit-details-marker,
.history-panel > summary::-webkit-details-marker {
  display: none;
}

.advanced-insights > summary small,
.history-panel > summary small {
  color: var(--muted);
  font-weight: 600;
}

.visibility-details-panel,
.competitor-panel,
.history-heading,
.history-panel .table-wrap {
  margin: 0 20px 20px;
}

.current-brand-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 16px;
  align-items: end;
  margin-bottom: 16px;
}

.current-brand-card strong {
  display: block;
  margin-top: 6px;
  font-size: 28px;
  overflow-wrap: anywhere;
}

.current-brand-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric-card,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: fadeInUp 0.34s ease both;
}

.metric-card {
  position: relative;
  overflow: hidden;
  padding: 22px;
  display: grid;
  gap: 11px;
  min-height: 172px;
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), var(--metric-soft, #f6fbf8));
  border-color: color-mix(in srgb, var(--metric-color, var(--accent)) 20%, var(--line));
}

.metric-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, color-mix(in srgb, var(--metric-color, var(--accent)) 16%, transparent), transparent 42%);
  opacity: 0.8;
}

.metric-visibility {
  --metric-color: var(--accent);
  --metric-soft: #ecfdf7;
}

.metric-mention {
  --metric-color: var(--blue);
  --metric-soft: var(--blue-soft);
}

.metric-position {
  --metric-color: var(--purple);
  --metric-soft: var(--purple-soft);
}

.metric-sentiment {
  --metric-color: var(--orange);
  --metric-soft: var(--orange-soft);
}

.metric-icon {
  position: relative;
  z-index: 1;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: color-mix(in srgb, var(--metric-color, var(--accent)) 15%, #fff);
  color: var(--metric-color, var(--accent-strong));
  font-size: 11px;
  font-weight: 850;
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0;
}

.metric-card strong {
  position: relative;
  z-index: 1;
  font-size: clamp(34px, 4.2vw, 58px);
  line-height: 1;
  letter-spacing: 0;
  color: var(--metric-color, var(--ink));
}

.metric-card .metric-label,
.metric-card .metric-note {
  position: relative;
  z-index: 1;
}

.score-breakdown {
  position: relative;
  z-index: 1;
}

.score-breakdown details {
  margin-top: 4px;
}

.score-breakdown summary {
  cursor: pointer;
  color: var(--metric-color, var(--accent-strong));
  font-size: 12px;
  font-weight: 820;
}

.score-breakdown-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--metric-color, var(--accent)) 18%, var(--line));
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.score-breakdown-list > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
  align-items: center;
}

.score-breakdown-list span,
.score-breakdown-list small {
  color: var(--muted);
  font-size: 11px;
}

.score-breakdown-list strong {
  font-size: 16px;
  color: var(--metric-color, var(--accent-strong));
}

.score-breakdown-list small {
  grid-column: 1 / -1;
}

.score-breakdown-final {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.metric-card .metric-note {
  width: fit-content;
  border: 1px solid color-mix(in srgb, var(--metric-color, var(--accent)) 18%, transparent);
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.72);
  color: color-mix(in srgb, var(--metric-color, var(--accent-strong)) 78%, #111);
  font-weight: 760;
}

.content-grid,
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 16px;
}

.dashboard-grid {
  margin-bottom: 16px;
}

.trend-panel,
.history-panel,
.competitive-panel,
.provider-panel,
.recommendations-panel,
.ai-summary-panel,
.analysis-state-panel {
  margin-top: 20px;
}

.analysis-state-panel {
  border-style: dashed;
  background: #fbfcfb;
}

.analysis-state-panel.loading {
  border-style: solid;
  border-color: rgba(18, 106, 99, 0.24);
  background: #fbfdfb;
}

.analysis-state-panel.error {
  border-style: solid;
  border-color: rgba(178, 72, 72, 0.24);
  background: #fffafa;
}

.analysis-state-panel.partial {
  border-style: solid;
  border-color: rgba(181, 127, 42, 0.24);
  background: #fffdf8;
}

.analysis-state-content {
  display: grid;
  gap: 12px;
}

.analysis-state-content h3 {
  margin: 0;
  font-size: 24px;
}

.analysis-state-content p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.analysis-progress-track {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: #eef2ee;
}

.analysis-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.2s ease;
}

.analysis-provider-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.analysis-provider-list span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.analysis-provider-list span.complete,
.analysis-provider-list span.done {
  border-color: rgba(18, 106, 99, 0.22);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.analysis-provider-list span.analyzing {
  border-color: rgba(49, 111, 181, 0.22);
  background: #eff6ff;
  color: #255c9c;
}

.analysis-provider-list span.failed {
  border-color: rgba(178, 72, 72, 0.22);
  background: #fff4f2;
  color: #9c3d35;
}

.scheduler-panel {
  margin-top: 16px;
}

.scheduler-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.scheduler-grid > div {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.scheduler-grid strong {
  overflow-wrap: anywhere;
  font-size: 18px;
}

.scheduler-status {
  margin-top: 12px;
  font-size: 13px;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}

.analytics-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  min-height: 150px;
  display: grid;
  gap: 10px;
}

.analytics-card strong {
  font-size: 30px;
  line-height: 1;
}

.comparison-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.delta-up {
  color: var(--accent-strong);
}

.delta-down {
  color: var(--danger);
}

.delta-flat {
  color: var(--muted);
}

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

.provider-answer-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.competitive-list {
  display: grid;
  gap: 14px;
}

.competitive-panel {
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.07), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 252, 249, 0.98));
}

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

.summary-visibility {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfdfb;
}

.visibility-pill,
.priority-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.visibility-pill.high,
.priority-pill.high {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.visibility-pill.medium,
.priority-pill.medium {
  background: var(--amber-soft);
  color: #8a5600;
}

.visibility-pill.low {
  background: #fdecec;
  color: var(--danger);
}

.priority-pill.low {
  background: var(--blue-soft);
  color: #1d4ed8;
}

.summary-section {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  background: linear-gradient(180deg, #fff, var(--summary-soft, #fbfdfb));
  box-shadow: 0 8px 22px rgba(18, 25, 22, 0.04);
  border-color: color-mix(in srgb, var(--summary-color, var(--accent)) 16%, var(--line));
}

.summary-section h4 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
}

.summary-icon,
.provider-logo {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--summary-color, var(--accent)) 14%, #fff);
  color: var(--summary-color, var(--accent-strong));
  font-size: 11px;
  font-weight: 850;
}

.summary-section.plain {
  --summary-color: var(--blue);
  --summary-soft: #f8fbff;
}

.summary-section.check {
  --summary-color: var(--accent);
  --summary-soft: #f6fffb;
}

.summary-section.warning {
  --summary-color: var(--orange);
  --summary-soft: #fff9f4;
}

.summary-section.actions {
  --summary-color: var(--purple);
  --summary-soft: #fbf8ff;
}

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

.summary-section li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--ink);
  line-height: 1.5;
}

.summary-section li span {
  color: var(--accent-strong);
  font-weight: 900;
}

.summary-section.warning li span {
  color: var(--orange);
}

.summary-section.actions {
  grid-column: 1 / -1;
}

.summary-actions {
  display: grid;
  gap: 10px;
}

.summary-action {
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 18px;
  display: grid;
  gap: 8px;
  background: linear-gradient(180deg, #fff, #fbfcff);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.summary-action:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.summary-action strong {
  color: var(--ink);
}

.summary-action p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.summary-toggle {
  justify-self: start;
  grid-column: 1 / -1;
  margin-top: 2px;
}

.visibility-trend-chart.empty-state {
  gap: 8px;
}

.visibility-trend-chart.empty-state strong {
  color: var(--ink);
  font-size: 16px;
}

.visibility-trend-chart.empty-state span {
  max-width: 520px;
  line-height: 1.55;
}

.competitive-row {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.92);
  display: grid;
  gap: 14px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.competitive-row.your-brand {
  border-width: 2px;
  border-color: rgba(18, 106, 99, 0.34);
  background:
    linear-gradient(135deg, rgba(233, 247, 242, 0.95), rgba(255, 255, 255, 0.95));
}

.competitive-row:hover {
  border-color: rgba(15, 118, 110, 0.26);
  box-shadow: 0 18px 42px rgba(18, 25, 22, 0.09);
  transform: translateY(-2px);
}

.competitive-row-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}

.competitive-brand-cell {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

.competitive-row-head strong {
  color: var(--ink);
  font-size: 18px;
}

.competitive-rank {
  display: inline-grid;
  place-items: center;
  min-width: 38px;
  height: 30px;
  border-radius: 999px;
  background: #111614;
  color: #fff;
  font-size: 12px;
  font-weight: 850;
}

.your-brand-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 0 9px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.competitive-stats {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.competitive-stats b {
  color: var(--accent-strong);
  font-size: 19px;
}

.competitive-bar-track {
  height: 18px;
  border-radius: 999px;
  overflow: hidden;
  background: #edf2ee;
  box-shadow: inset 0 1px 2px rgba(18, 25, 22, 0.08);
}

.competitive-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-strong), var(--accent), #48b49d);
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.22);
  transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.competitive-evidence {
  border: 1px solid color-mix(in srgb, var(--competitor-color, var(--accent)) 14%, var(--line));
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.74);
  display: grid;
  gap: 4px;
}

.competitive-evidence strong {
  color: var(--ink);
  font-size: 13px;
}

.competitive-evidence span,
.competitive-evidence p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.competitive-row:not(.your-brand) .competitive-bar-fill {
  background: linear-gradient(90deg, var(--competitor-color, #64748b), color-mix(in srgb, var(--competitor-color, #64748b) 58%, #fff));
  box-shadow: 0 8px 18px color-mix(in srgb, var(--competitor-color, #64748b) 18%, transparent);
}

.competitive-row:nth-child(2) {
  --competitor-color: var(--blue);
}

.competitive-row:nth-child(3) {
  --competitor-color: var(--purple);
}

.competitive-row:nth-child(4) {
  --competitor-color: var(--orange);
}

.competitive-row:nth-child(5) {
  --competitor-color: #0891b2;
}

.competitive-row:nth-child(6) {
  --competitor-color: #4f46e5;
}

.competitive-empty {
  border: 1px dashed #d8ded9;
  border-radius: 12px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
  background: #fbfcfb;
}

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

.brand-profile-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: #fff;
}

.brand-profile-item strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-line;
}

.analysis-error-reason {
  margin: 14px 0 0;
  padding: 14px;
  border: 1px solid #f0c7c7;
  border-radius: 12px;
  background: #fff7f7;
  color: #8f1d1d;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-align: left;
}

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

.recommendation-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  background: #fff;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
}

.recommendation-card > span {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 800;
}

.your-brand-pill.secondary {
  background: #eef2ee;
  color: var(--muted);
}

.your-brand-pill.muted-pill {
  background: #f6f7f6;
  color: #7b8580;
}

.competitor-label {
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.02em;
  background: #eef2ee;
  color: var(--muted);
  white-space: nowrap;
}

.competitor-label.known {
  background: #eff6ff;
  color: #255c9c;
}

.competitor-label.observed {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.competitor-label.discovered {
  background: var(--purple-soft);
  color: var(--purple);
}

.competitor-label.muted {
  background: #f6f7f6;
  color: #7b8580;
}

.recommendation-card strong {
  color: var(--ink);
  font-size: 16px;
}

.recommendation-card p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.provider-answer-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  display: grid;
  gap: 12px;
  background:
    linear-gradient(180deg, #fff 0%, var(--provider-soft, #fbfdfb) 100%);
  border-color: color-mix(in srgb, var(--provider-color, var(--accent)) 16%, var(--line));
  min-height: 230px;
  align-content: start;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.provider-answer-card:hover {
  border-color: color-mix(in srgb, var(--provider-color, var(--accent)) 34%, var(--line));
  box-shadow: 0 18px 44px rgba(18, 25, 22, 0.09);
  transform: translateY(-2px);
}

.provider-chatgpt {
  --provider-color: var(--accent);
  --provider-soft: #f4fffb;
  --summary-color: var(--accent);
}

.provider-claude {
  --provider-color: var(--orange);
  --provider-soft: #fff8f1;
  --summary-color: var(--orange);
}

.provider-gemini {
  --provider-color: var(--purple);
  --provider-soft: #fbf8ff;
  --summary-color: var(--purple);
}

.provider-answer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.provider-answer-head strong {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
}

.provider-answer-card p,
.provider-answer-card blockquote {
  margin: 0;
}

.provider-answer-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

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

.provider-metrics div {
  border: 1px solid color-mix(in srgb, var(--provider-color, var(--accent)) 16%, var(--line));
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.provider-metrics span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.provider-metrics strong {
  display: block;
  margin-top: 5px;
  color: var(--provider-color, var(--accent-strong));
  font-size: 24px;
  line-height: 1;
}

.provider-metrics small,
.provider-quality-note {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.provider-quality-note {
  margin: 0;
}

.provider-insight-block {
  display: grid;
  gap: 9px;
}

.provider-insight-block h4 {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
}

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

.provider-summary-list,
.provider-tag-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.provider-summary-list li,
.provider-tag-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
}

.provider-summary-list li span,
.provider-tag-list li span {
  color: var(--provider-color, var(--accent));
  font-weight: 900;
}

.provider-insight-block.weakness .provider-tag-list li span {
  color: var(--orange);
}

.muted-copy {
  color: var(--muted);
}

.provider-full-answer {
  border-top: 1px solid color-mix(in srgb, var(--provider-color, var(--accent)) 16%, var(--line));
  padding-top: 12px;
}

.provider-full-answer summary {
  cursor: pointer;
  width: fit-content;
  border-radius: 999px;
  padding: 8px 12px;
  color: color-mix(in srgb, var(--provider-color, var(--accent)) 72%, #111);
  background: color-mix(in srgb, var(--provider-color, var(--accent)) 12%, #fff);
  font-size: 13px;
  font-weight: 800;
}

.provider-full-answer[open] summary {
  margin-bottom: 12px;
}

.provider-full-answer-body {
  display: grid;
  gap: 12px;
}

.inline-answer-section {
  background: rgba(255, 255, 255, 0.76);
}

.provider-answer-card blockquote {
  color: #303733;
  font-size: 15px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.read-answer-button {
  align-self: end;
  justify-self: start;
  margin-top: auto;
  border-radius: 999px;
  min-height: 36px;
  padding: 0 14px;
  color: color-mix(in srgb, var(--provider-color, var(--accent)) 72%, #111);
  background: color-mix(in srgb, var(--provider-color, var(--accent)) 12%, #fff);
  border-color: color-mix(in srgb, var(--provider-color, var(--accent)) 22%, transparent);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 17, 15, 0.42);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(820px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 30px 90px rgba(18, 25, 22, 0.24);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.modal-header h3 {
  margin: 5px 0 0;
}

.modal-body {
  padding: 22px;
  overflow: auto;
  color: var(--ink);
  line-height: 1.7;
  display: grid;
  gap: 16px;
}

.answer-section {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: #fbfcff;
}

.answer-section h4 {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 13px;
}

.answer-section p {
  margin: 0;
  white-space: pre-wrap;
}

.answer-section .answer-intent {
  margin-bottom: 12px;
  color: var(--muted);
  font-weight: 700;
}

.trend-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  min-width: 0;
}

.trend-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.trend-title strong {
  color: var(--ink);
}

.chart {
  width: 100%;
  min-height: 168px;
}

.chart svg {
  display: block;
  width: 100%;
  height: 168px;
}

.chart text {
  fill: var(--muted);
  font-size: 11px;
}

.chart-grid {
  stroke: var(--line);
  stroke-width: 1;
}

.chart-line {
  fill: none;
  stroke: var(--trend-color, var(--accent));
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart circle {
  fill: #e8c468;
  stroke: var(--accent-strong);
  stroke-width: 2;
}

.visibility-trends-panel {
  margin-top: 20px;
  padding: 26px;
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--trend-color, var(--accent)) 10%, transparent), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #f8fbf8 100%);
}

.trend-panel-header {
  align-items: flex-start;
}

.trend-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.segmented-control {
  display: inline-flex;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f3f6f4;
}

.segmented-control button {
  border: 0;
  border-radius: 9px;
  padding: 9px 12px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.segmented-control button.active,
.segmented-control button:hover {
  color: var(--trend-color, var(--accent-strong));
  background: #fff;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--trend-color, var(--accent)) 14%, transparent);
}

.compact-select {
  width: auto;
  min-width: 118px;
  padding: 9px 12px;
  font-size: 13px;
}

.visibility-trend-chart {
  width: 100%;
  min-height: 360px;
  border: 1px solid rgba(228, 233, 229, 0.78);
  border-radius: 16px;
  background:
    linear-gradient(180deg, #fff, color-mix(in srgb, var(--trend-color, var(--accent)) 4%, #fff));
  padding: 14px;
}

.visibility-trend-chart svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 330px;
}

.visibility-trend-chart text {
  fill: var(--muted);
  font-size: 12px;
}

.visibility-trend-chart circle {
  fill: #ffffff;
  stroke: var(--trend-color, var(--accent));
  stroke-width: 4;
  filter: drop-shadow(0 4px 8px color-mix(in srgb, var(--trend-color, var(--accent)) 24%, transparent));
  transition: r 0.18s ease, stroke-width 0.18s ease;
}

.visibility-trend-chart circle:hover {
  r: 7;
  stroke-width: 4;
}

.visibility-trend-chart circle.partial {
  stroke-dasharray: 3 3;
  stroke: var(--amber);
}

.visibility-trend-chart .chart-line {
  stroke: var(--trend-color, var(--accent));
  stroke-width: 4;
}

.visibility-trend-chart .chart-grid {
  stroke: #e8eee9;
}

.panel {
  padding: 18px;
}

.panel.advanced-insights,
.panel.history-panel {
  padding: 0;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-header h3 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.prompt-list,
.keyword-list,
.prompt-template-list,
.competitor-list,
.comparison-list {
  display: grid;
  gap: 10px;
}

.prompt-library-tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 6px;
  margin-bottom: 16px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.library-tab {
  border: 0;
  border-radius: 6px;
  padding: 10px 14px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.library-tab.active,
.library-tab:hover {
  background: #ffffff;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.hidden {
  display: none !important;
}

.empty-state {
  color: var(--muted);
  min-height: 120px;
  display: grid;
  place-items: center;
  text-align: center;
  border: 1px dashed #d8ded9;
  border-radius: 12px;
  background: #fbfcfb;
  padding: 22px;
}

.prompt-row,
.keyword-row,
.prompt-template-card,
.competitor-row,
.comparison-row {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.keyword-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.competitor-row,
.comparison-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.comparison-row span {
  font-weight: 800;
  color: var(--accent-strong);
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 12px;
}

.prompt-template-card {
  align-items: stretch;
}

.prompt-template-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.prompt-template-card > p {
  margin: 10px 0;
  color: var(--ink);
  line-height: 1.5;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.compact-button {
  padding: 8px 12px;
}

.keyword-check {
  width: 18px;
  height: 18px;
}

.bulk-actions {
  display: grid;
  grid-template-columns: auto minmax(160px, 220px) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.inline-control {
  display: flex;
  grid-auto-flow: column;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.inline-control input {
  width: 16px;
  height: 16px;
}

.bulk-status {
  min-height: 20px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

.bulk-status.ok {
  color: var(--accent-strong);
}

.bulk-status.error {
  color: var(--danger);
}

.prompt-row p,
.keyword-row p,
.comparison-row p {
  margin: 5px 0 0;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prompt-row span,
.pill {
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.bars {
  display: grid;
  gap: 13px;
}

.bar-row {
  display: grid;
  gap: 6px;
}

.bar-meta {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.bar-track {
  height: 10px;
  background: #eef2ee;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.run-form,
.keyword-form {
  display: grid;
  gap: 16px;
}

.run-form {
  max-width: 920px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px;
  box-shadow: var(--shadow);
}

label {
  display: grid;
  gap: 7px;
  color: #343c38;
  font-weight: 700;
  font-size: 14px;
}

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

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 15px 12px;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

td.prompt-cell {
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mention-yes {
  color: var(--accent-strong);
  font-weight: 800;
}

.mention-no {
  color: var(--warning);
  font-weight: 800;
}

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

  .current-brand-card,
  .dashboard-hero,
  .onboarding-card,
  .brand-editor,
  .metric-grid,
  .ai-summary,
  .content-grid,
  .dashboard-grid,
  .trend-grid,
  .provider-answer-list,
  .scheduler-grid,
  .analytics-grid,
  .form-grid,
  .inline-form,
  .bulk-actions {
    grid-template-columns: 1fr;
  }

  .brand-selection-card {
    padding: 30px;
  }

  .brand-selection-card h3 {
    font-size: 38px;
  }

  .brand-selection-card .hero-description {
    font-size: 17px;
  }

  .onboarding-arrow {
    transform: rotate(0deg);
  }

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

  .topbar-brand {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .toolbar {
    width: 100%;
  }

  .competitive-row-head,
  .competitive-stats,
  .trend-panel-header,
  .trend-toolbar {
    grid-template-columns: 1fr;
    justify-content: flex-start;
    white-space: normal;
  }

  .trend-panel-header,
  .trend-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

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

  .compact-select {
    width: 100%;
  }

  .competitive-stats {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .brand-profile-grid {
    grid-template-columns: 1fr;
  }

  .recommendation-card {
    grid-template-columns: 1fr;
  }

  .summary-visibility,
  .modal-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (min-width: 921px) and (max-width: 1180px) {
  .metric-grid,
  .ai-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .metric-grid,
  .ai-summary,
  .provider-insight-grid,
  .provider-answer-list {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 150px;
  }

  .competitive-row {
    padding: 16px;
  }

  .competitive-row-head,
  .competitive-stats {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .visibility-trends-panel {
    padding: 18px;
  }

  .visibility-trend-chart {
    min-height: 240px;
  }

  .segmented-control {
    width: 100%;
  }

  .modal-content {
    width: min(96vw, 760px);
  }
}


/* ---- Navigation, status banner, Japanese UI (v0.4) ---------------------- */

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.main-nav {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  width: fit-content;
  justify-self: center;
}

.nav-tab {
  min-height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-tab:hover {
  color: var(--ink);
  background: var(--accent-soft);
}

.nav-tab.active {
  background: var(--ink);
  color: #fff;
}

.nav-tab:focus-visible,
.secondary-button:focus-visible,
.primary-button:focus-visible,
.library-tab:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.35);
  outline-offset: 2px;
}

.header-brand p#pageTitle {
  color: var(--muted);
}

.compact-button {
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
}

.status-banner {
  display: none;
  margin: 0 0 18px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
}

.status-banner.visible {
  display: flex;
}

.status-banner.ok {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border: 1px solid #c7eadf;
}

.status-banner.error {
  background: #fdeef0;
  color: var(--danger);
  border: 1px solid #f3c9cf;
}

.status-banner .api-retry-button {
  border-color: currentColor;
  background: transparent;
  color: inherit;
}

.auth-view .api-status {
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
}

.auth-view .api-status.ok {
  color: var(--muted);
}

.auth-view .api-status.error {
  color: var(--danger);
}

.auth-brand p {
  color: var(--muted);
}

.auth-form small {
  color: var(--muted);
  font-weight: 500;
}

.view-intro {
  margin: 0 0 16px;
  color: var(--muted);
}

.brand-selection-card h3 {
  font-size: clamp(32px, 4.2vw, 54px);
  line-height: 1.18;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.analysis-provider-list span b {
  margin-right: 6px;
}

.analysis-state-panel.restored {
  border-color: #d8e6df;
  background: #f9fcfa;
}

.history-prompt {
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-summary.empty-state {
  display: grid;
  gap: 12px;
  justify-items: start;
}

@media (max-width: 920px) {
  .topbar {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand tools"
      "nav nav";
  }

  .topbar .header-brand { grid-area: brand; }
  .topbar .toolbar { grid-area: tools; width: auto; }
  .main-nav {
    grid-area: nav;
    width: 100%;
    justify-self: stretch;
  }

  .nav-tab {
    flex: 1;
  }
}

@media (max-width: 640px) {
  .main {
    padding: 20px 16px 48px;
  }

  .brand-selection-card {
    padding: 22px;
  }

  .brand-selection-card h3 {
    font-size: 28px;
  }

  .brand-selection-card .hero-description {
    font-size: 15px;
  }

  .header-brand h1 {
    font-size: 15px;
  }

  .header-brand .mark {
    width: 36px;
    height: 36px;
  }

  .topbar .toolbar .compact-button {
    padding: 0 10px;
  }

  .history-prompt {
    max-width: 160px;
  }
}

/* Collapsible brand profile (same look as the other details panels) */
.brand-profile-panel {
  margin-top: 16px;
  padding: 0;
  overflow: hidden;
}

.brand-profile-panel > summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  cursor: pointer;
  font-weight: 800;
}

.brand-profile-panel > summary::-webkit-details-marker {
  display: none;
}

.brand-profile-panel > summary small {
  color: var(--muted);
  font-weight: 600;
}

.advanced-insights > summary::after,
.history-panel > summary::after,
.brand-profile-panel > summary::after {
  content: "＋";
  color: var(--muted);
  font-weight: 700;
}

.advanced-insights[open] > summary::after,
.history-panel[open] > summary::after,
.brand-profile-panel[open] > summary::after {
  content: "－";
}

.brand-profile-heading,
.brand-profile-panel .brand-profile-grid {
  margin: 0 20px 20px;
}

.brand-profile-heading {
  align-items: flex-start;
  gap: 12px;
}

@media (max-width: 640px) {
  .score-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .score-grid .metric-visibility {
    grid-column: 1 / -1;
  }

  .score-grid .metric-card:not(.metric-visibility) {
    min-height: 0;
    padding: 16px;
  }

  .score-grid .metric-card:not(.metric-visibility) strong {
    font-size: 30px;
  }

  .score-grid .metric-sentiment {
    grid-column: 1 / -1;
  }

  .brand-profile-heading {
    flex-direction: column;
  }
}

@media (max-width: 920px) {
  .segmented-control {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.ai-summary.empty-state {
  grid-template-columns: 1fr !important;
  justify-items: center;
  text-align: center;
}

@media (max-width: 920px) {
  .competitive-stats {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 12px;
  }

  .competitive-stats b {
    order: -1;
    width: 100%;
    font-size: 22px;
  }
}

/* Sign-up: invite-only notice and request link */
.auth-notice {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.6;
}

.auth-request {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

.auth-request a {
  color: var(--accent);
  font-weight: 700;
}

/* Analysed-brand header shown above the score cards */
.result-brand-header {
  margin-top: 22px;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-left: 6px solid var(--accent);
  border-radius: 16px;
  background: var(--accent-soft);
}
.result-brand-eyebrow {
  display: block;
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.result-brand-title {
  margin: 4px 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  color: var(--ink);
  line-height: 1.2;
}
.result-brand-name {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 800;
  overflow-wrap: anywhere;
}
.result-brand-suffix {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--muted);
}
.result-brand-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}
.result-brand-facts li {
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}
.result-brand-header + .metric-grid {
  margin-top: 14px;
}

/* Saved analyses (all companies) */
.analysis-history-intro {
  margin: 0 20px 10px;
  font-size: 0.85rem;
}
.analysis-history-panel .table-wrap {
  margin-bottom: 12px;
}
.analysis-history-panel table {
  min-width: 640px;
}
.analysis-history-panel td {
  vertical-align: middle;
}
.analysis-history-panel tr.is-current td {
  background: var(--accent-soft);
}
.analysis-history-brand strong {
  overflow-wrap: anywhere;
}
.analysis-history-score b {
  color: var(--accent-strong);
  font-size: 1.05rem;
}
.analysis-history-current {
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}
#analysisHistoryMore {
  margin: 0 20px 20px;
}
/* Phones: keep company, date, score and the open button; drop the rest. */
@media (max-width: 640px) {
  .analysis-history-panel th:nth-child(4),
  .analysis-history-panel td:nth-child(4),
  .analysis-history-panel th:nth-child(5),
  .analysis-history-panel td:nth-child(5),
  .analysis-history-panel th:nth-child(6),
  .analysis-history-panel td:nth-child(6) {
    display: none;
  }
  .analysis-history-panel table {
    min-width: 0;
  }
  .analysis-history-panel th,
  .analysis-history-panel td {
    padding: 10px 6px;
  }
  .analysis-history-panel .table-wrap {
    margin-left: 12px;
    margin-right: 12px;
  }
}
.analysis-history-brand {
  min-width: 6.5em;
  word-break: keep-all;
}
.analysis-history-panel td .compact-button {
  white-space: nowrap;
}

/* Analysis step checklist */
.analysis-stage-list {
  display: grid;
  gap: 6px;
  margin: 14px 0 10px;
  padding: 0;
  list-style: none;
}
.analysis-stage-list li {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  font-size: 0.9rem;
}
.analysis-stage-list li b {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--line);
  color: var(--muted);
  font-size: 0.75rem;
}
.analysis-stage-list li small {
  font-size: 0.75rem;
  white-space: nowrap;
}
.analysis-stage-list li.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
  font-weight: 700;
}
.analysis-stage-list li.active b {
  background: var(--accent);
  color: #fff;
  animation: analysis-stage-pulse 1.2s ease-in-out infinite;
}
.analysis-stage-list li.done {
  color: var(--ink);
}
.analysis-stage-list li.done b {
  background: var(--accent);
  color: #fff;
}
.analysis-stage-list li.failed b {
  background: #f3c86b;
  color: #5b3b00;
}
@keyframes analysis-stage-pulse {
  50% { opacity: 0.45; }
}
@media (prefers-reduced-motion: reduce) {
  .analysis-stage-list li.active b { animation: none; }
}

/* Ask for a business description when the AI does not know the company */
.brand-description-form label {
  display: block;
  margin: 14px 0 6px;
  font-weight: 700;
}
.brand-description-form textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
}
.brand-description-actions {
  margin-top: 12px;
}
.brand-profile-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}
.brand-description-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}


/* ==== LP theme (v0.6): navy / paper / orange, Noto Sans JP, pill buttons ==== */

body {
  background: var(--bg);
  font-family: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", Meiryo, system-ui, sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  letter-spacing: -0.01em;
}

h3 {
  font-weight: 900;
}

.mark,
.header-brand .mark {
  background: var(--ink);
  color: var(--accent);
  font-weight: 900;
  border-radius: 12px;
}

/* Sticky header so the menu stays reachable on long result pages */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  margin: -32px -28px 18px;
  padding: 14px 28px;
  background: rgba(246, 244, 239, 0.92);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}

.main-nav {
  border-radius: 999px;
  background: #fff;
  border-color: var(--line);
}

.nav-tab {
  border-radius: 999px;
}

.nav-tab:hover {
  background: var(--bg);
}

.nav-tab.active {
  background: var(--ink);
  color: #fff;
}

/* Buttons */
.primary-button,
.secondary-button {
  border-radius: 999px;
  font-weight: 700;
}

.primary-button {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 24px rgba(255, 90, 54, 0.3);
}

.primary-button:hover {
  background: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(255, 90, 54, 0.38);
}

.secondary-button {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
  box-shadow: none;
}

.secondary-button:hover {
  border-color: var(--ink);
  box-shadow: none;
}

.nav-tab:focus-visible,
.secondary-button:focus-visible,
.primary-button:focus-visible,
.library-tab:focus-visible,
.text-input:focus-visible,
.result-nav a:focus-visible {
  outline: 3px solid rgba(255, 90, 54, 0.45);
  outline-offset: 2px;
}

.text-input:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgba(14, 27, 44, 0.08);
}

/* Panels and cards: flat white cards like the LP */
.panel,
.metric-card,
.hero-report {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.panel-header h3 {
  font-weight: 900;
}

/* Hero: the LP's navy block */
.brand-selection-card {
  position: relative;
  overflow: hidden;
  background: var(--ink);
  border: 0;
  color: #fff;
  box-shadow: 0 24px 60px rgba(14, 27, 44, 0.18);
}

.brand-selection-card::before {
  content: "";
  position: absolute;
  width: 760px;
  height: 760px;
  right: -300px;
  top: -340px;
  border-radius: 50%;
  border: 2px solid #25344A;
  box-shadow: 0 0 0 112px var(--ink), 0 0 0 114px var(--ink-2);
  pointer-events: none;
}

.brand-selection-card > * {
  position: relative;
}

.hero-badge {
  display: inline-block;
  background: var(--accent);
  color: var(--ink);
  font-weight: 700;
  font-size: 13px;
  padding: 4px 14px;
  border-radius: 999px;
}

.brand-selection-card h3 {
  color: #fff;
  font-weight: 900;
  line-height: 1.25;
}

.brand-selection-card h3 em {
  font-style: normal;
  color: var(--accent);
}

.brand-selection-card p,
.brand-selection-card .hero-description {
  color: var(--ink-text);
}

.brand-selection-card label,
.brand-selection-card .switch-brand-field {
  color: var(--ink-text);
}

.brand-editor .text-input {
  border: 1px solid transparent;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 0 26px;
}

.brand-editor .text-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 90, 54, 0.25);
}

.hero-action {
  border-radius: 999px;
}

.provider-checklist {
  color: var(--ink-text);
}

.provider-checklist strong {
  background: transparent;
  border: 1px solid var(--ink-line);
  color: #fff;
}

/* Compact hero once a result is on screen */
.dashboard-hero.is-compact .brand-selection-card {
  padding: 22px 28px;
  gap: 14px;
}

.dashboard-hero.is-compact .brand-selection-card h3,
.dashboard-hero.is-compact .hero-description,
.dashboard-hero.is-compact .hero-badge {
  display: none;
}

.dashboard-hero.is-compact .brand-editor .text-input,
.dashboard-hero.is-compact .hero-action {
  min-height: 52px;
  font-size: 17px;
}

/* Metric cards: white with a coloured number, as on the LP */
.metric-card {
  background: #fff;
}

.metric-card::after {
  display: none;
}

.metric-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  height: 4px;
  background: var(--metric-color, var(--accent));
}

.metric-visibility { --metric-color: var(--accent); --metric-soft: var(--accent-soft); }
.metric-mention { --metric-color: var(--blue); --metric-soft: var(--blue-soft); }
.metric-position { --metric-color: var(--teal); --metric-soft: var(--teal-soft); }
.metric-sentiment { --metric-color: var(--ink); --metric-soft: #EEF0F3; }

.metric-card strong {
  font-weight: 900;
}

.metric-visibility strong {
  color: var(--accent-strong);
}

.metric-label {
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* AI providers: ChatGPT = teal, Claude = orange, Gemini = blue */
.provider-chatgpt { --provider-color: var(--teal); --provider-soft: #F5FBF9; --summary-color: var(--teal); }
.provider-claude { --provider-color: #E2492A; --provider-soft: #FFF8F5; --summary-color: #E2492A; }
.provider-gemini { --provider-color: var(--blue); --provider-soft: #F6F8FF; --summary-color: var(--blue); }

/* Analysed-brand header */
.result-brand-header {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 6px solid var(--accent);
}

.result-brand-eyebrow {
  color: var(--accent-strong);
  letter-spacing: 0.12em;
}

.result-brand-name {
  font-weight: 900;
}

.result-brand-facts li {
  background: var(--bg);
}

/* In-page result navigation (sticky under the header) */
.result-nav {
  position: sticky;
  top: 72px;
  z-index: 30;
  display: flex;
  gap: 6px;
  margin: 12px 0 0;
  padding: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
}

.result-nav::-webkit-scrollbar {
  display: none;
}

.result-nav a {
  flex: 0 0 auto;
  padding: 6px 14px;
  border-radius: 999px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.result-nav a:hover {
  background: var(--bg);
}

#scoreSection,
#aiSummarySection,
#providerSection,
#competitiveSection,
#trendSection,
#brandProfilePanel,
#resultBrandHeader {
  scroll-margin-top: 140px;
}

/* Progress, chips, pills */
.analysis-progress-fill,
.competitive-bar-fill {
  background: var(--accent);
}

.analysis-stage-list li.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.analysis-stage-list li.active b,
.analysis-stage-list li.done b {
  background: var(--ink);
}

.your-brand-pill,
.competitive-rank {
  background: var(--ink);
  color: #fff;
}

.competitive-row.your-brand {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.analysis-history-panel tr.is-current td {
  background: var(--accent-soft);
}

.analysis-history-score b,
.analysis-history-current {
  color: var(--accent-strong);
}

/* Login screen: navy background like the LP hero */
.auth-view {
  background: var(--ink);
}

.auth-card {
  border: 0;
  border-radius: 24px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

.auth-brand h1 {
  font-weight: 900;
}

.library-tab.active {
  background: var(--ink);
  color: #fff;
}

@media (max-width: 640px) {
  .topbar {
    margin: -20px -16px 14px;
    padding: 10px 16px;
  }
  .result-nav {
    top: 112px;
    border-radius: 14px;
  }
  .brand-selection-card::before {
    width: 420px;
    height: 420px;
    right: -220px;
    top: -220px;
    box-shadow: 0 0 0 60px var(--ink), 0 0 0 62px var(--ink-2);
  }
  .dashboard-hero.is-compact .brand-selection-card {
    padding: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .primary-button:hover,
  .secondary-button:hover {
    transform: none;
  }
}

/* Competitors in neutral navy-grey so only the own brand is orange */
.competitive-row:not(.your-brand) .competitive-bar-fill {
  background: #8D98A6;
  box-shadow: none;
}

.competitive-row.your-brand .competitive-bar-fill {
  background: var(--accent);
  box-shadow: 0 6px 14px rgba(255, 90, 54, 0.25);
}

.competitive-panel,
.visibility-trends-panel,
.ai-summary-panel,
.provider-panel {
  background: #fff;
}

.competitive-stats b {
  color: var(--ink);
}

.competitive-row.your-brand .competitive-stats b {
  color: var(--accent-strong);
}

/* Metric notes as plain captions, not pills */
.metric-card .metric-note {
  width: auto;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: none;
  color: var(--muted);
  font-weight: 500;
  font-size: 13px;
  line-height: 1.6;
}

.nav-tab {
  white-space: nowrap;
}

.result-brand-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 640px) {
  /* Phones: header scrolls away (it is tall), the result menu sticks to the top */
  .topbar {
    position: static;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .header-brand p#pageTitle,
  #refreshData {
    display: none;
  }
  .nav-tab {
    padding: 0 10px;
  }
  .result-nav {
    top: 8px;
  }
  #scoreSection,
  #aiSummarySection,
  #providerSection,
  #competitiveSection,
  #trendSection,
  #brandProfilePanel,
  #resultBrandHeader {
    scroll-margin-top: 70px;
  }
}

/* ---- Accounts and organization ------------------------------------------ */
.link-button {
  justify-self: center;
  border: 0;
  background: none;
  color: var(--accent-strong);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px;
}

.link-button:hover {
  text-decoration: underline;
}

.auth-lead {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

#resendVerification {
  margin-top: 8px;
}

.organization-chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.plan-pill {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.organization-panel,
.operator-panel {
  padding: 22px;
  margin-bottom: 18px;
}

.member-list h4 {
  margin: 16px 0 8px;
  font-size: 14px;
}

.member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.member-main {
  flex: 1;
  min-width: 0;
  display: grid;
}

.member-main strong {
  overflow-wrap: anywhere;
}

.member-main small {
  color: var(--muted);
}

.member-you {
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.member-role {
  width: auto;
  min-height: 36px;
  padding: 0 10px;
}

.member-role-label {
  color: var(--muted);
  font-size: 13px;
}

.invite-member-form,
.create-organization-form {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.invite-member-form .text-input,
.create-organization-form .text-input {
  flex: 1 1 200px;
  width: auto;
}

.invite-member-form select.text-input {
  flex: 0 0 auto;
}

.invite-link code {
  word-break: break-all;
  font-size: 12px;
}

.operator-table {
  min-width: 640px;
}

@media (max-width: 640px) {
  .organization-chip {
    display: none;
  }
  .member-row {
    flex-wrap: wrap;
  }
}

.member-main {
  display: block;
}

.member-main small {
  display: block;
}

.auth-notice {
  background: var(--bg) !important;
  border-color: var(--line) !important;
  color: var(--ink) !important;
  font-weight: 500 !important;
}

.inline-link {
  margin-left: 8px;
  font-size: 12px;
}

/* App icon (same design as the favicon) */
.mark.mark-icon,
.header-brand .mark.mark-icon {
  display: block;
  width: 42px;
  height: 42px;
  padding: 0;
  background: none;
  box-shadow: none;
  border-radius: 10px;
}

/* Page-load placeholder while the last analysis is restored */
.boot-skeleton {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.boot-skeleton span {
  height: 86px;
  border-radius: 14px;
  background: linear-gradient(90deg, #EEEBE4 0%, #F8F6F1 50%, #EEEBE4 100%);
  background-size: 200% 100%;
  animation: boot-shimmer 1.2s ease-in-out infinite;
}

@keyframes boot-shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

@media (max-width: 640px) {
  .boot-skeleton {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .boot-skeleton span {
    animation: none;
  }
}

/* Plan usage (monthly analyses) */
/* Shown inside the dark hero card. */
.usage-quota {
  margin: 10px 0 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
}

.usage-quota.is-empty {
  color: var(--accent);
  font-weight: 700;
}

.usage-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 4px 0 18px;
}

.usage-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}

.usage-item span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.usage-item strong {
  font-size: 20px;
}

.usage-bar {
  height: 6px;
  margin-top: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 70%, transparent);
  overflow: hidden;
}

.usage-bar i {
  display: block;
  height: 100%;
  background: var(--accent);
}

.usage-bar.is-full i {
  background: var(--accent-strong);
}

.operator-table select.text-input {
  min-width: 140px;
  padding: 6px 8px;
}

/* Weekly auto analysis */
.weekly-analysis-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  margin-top: 4px;
}

.weekly-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  cursor: pointer;
}

.weekly-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.weekly-weekday {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.weekly-weekday select {
  width: auto;
  min-width: 120px;
}

.history-source-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
}

/* Operator: API cost */
.operator-costs {
  margin-top: 24px;
}

.operator-costs h4 {
  margin: 0 0 4px;
}

.cost-alert-banner {
  margin: 12px 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 700;
}

.cost-over {
  color: var(--accent-strong);
  font-weight: 700;
}

.cost-total {
  font-size: 22px;
  font-weight: 800;
}

.operator-costs td.num,
.operator-costs th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

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

.operator-costs h4 {
  margin-top: 22px;
}

.cost-cards {
  margin-top: 12px;
}

.cost-over-row td {
  background: var(--accent-soft);
}
