:root {
  /* Brand Guideline v1.5 — official AIOSky palette */
  --brand: #318BF7;
  --brand-deep: #318BF7;
  --brand-soft: rgba(49, 139, 247, 0.10);
  --cta: #F78F43;
  --cta-border: #FDBB5D;
  --cta-soft: rgba(247, 143, 67, 0.12);
  --sub-yellow: #FDBB5D;
  --bg: #f7f9fc;
  --bg-elev: #ffffff;
  --card: #ffffff;
  --card-hover: #f7fbff;
  --ink: #43425D;
  --muted: #6b6a82;
  --task: var(--brand);
  --task-soft: var(--brand-soft);
  --live: #12a06a;
  --live-soft: rgba(18, 160, 106, 0.10);
  --alert: #F78F43;
  --alert-soft: var(--cta-soft);
  --accent: var(--brand);
  --accent-ink: #ffffff;
  --line: #e3eaf3;
  --line-strong: #c9d4e3;
  --danger: #e04856;
  --danger-soft: rgba(224, 72, 86, 0.08);
  --ok-soft: var(--live-soft);
  --shadow: 0 2px 8px rgba(49, 139, 247, 0.06), 0 10px 28px rgba(67, 66, 93, 0.06);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-pill: 100px;
  --font: "Be Vietnam Pro", "Inter", "Segoe UI", Roboto, Arial, sans-serif;
  --focus: 0 0 0 3px rgba(49, 139, 247, 0.25);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100%;
  background-color: var(--bg);
  /* Brand Guideline v1.5: near-white field. Orange is a ~5% CTA accent, not a page wash. */
  background-image:
    radial-gradient(circle at 1px 1px, rgba(49, 139, 247, 0.035) 1px, transparent 0),
    linear-gradient(180deg, #f7f9fc 0%, #ffffff 32%);
  background-size: 24px 24px, auto;
  background-attachment: fixed;
}

a { color: var(--brand-deep); }
a:hover { color: var(--cta); }

.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 14px 16px 100px;
}
body.wide .wrap { max-width: 960px; }
body.theme-live { --accent: var(--live); }
body.theme-alert { --accent: var(--alert); --accent-ink: #fff; }

.door-grid { display: grid; gap: 12px; }

/* —— Top bar —— */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  padding: 10px 0 14px;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
  /* Isolation zone = 1/3 of logo height A (Brand Guideline v1.5) */
  padding: 10px 4px 10px 0;
}
.brand-logo {
  height: 28px;
  width: auto;
  min-width: 60px;
  display: block;
  filter: none;
  box-shadow: none;
}
.brand-logo-ruby {
  height: 42px;
}
.brand-text { display: inline-flex; align-items: baseline; gap: 6px; }
.brand span,
.brand-text {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #fff;
  background: var(--brand);
  padding: 4px 9px;
  border-radius: var(--radius-pill);
  vertical-align: middle;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.top-link {
  font-weight: 650;
  font-size: 0.84rem;
  text-decoration: none;
  color: var(--muted);
}
.top-link:hover { color: var(--ink); }
.top-link.on { color: var(--task); font-weight: 800; }
.dual-role-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.btn:focus-visible,
.top-link:focus-visible,
.door-card:focus-visible,
.nav a:focus-visible,
.hq-nav a:focus-visible,
.helper-pill:focus-visible,
.helper-close:focus-visible,
.helper-send:focus-visible,
.lang-switch a:focus-visible {
  outline: 2px solid var(--task);
  outline-offset: 2px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* HQ menu — mobile bottom bar (desktop: left sidebar, see min-width 768) */
/* 4 links → 2×2 on phone */
.hq-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  margin: 0;
  padding: 6px 6px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 20px rgba(67, 66, 93, 0.06);
  backdrop-filter: blur(12px);
  z-index: 20;
}
.hq-nav a {
  text-decoration: none;
  text-align: center;
  font-weight: 700;
  font-size: 0.68rem;
  color: var(--muted);
  padding: 10px 2px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: background .15s, color .15s;
}
.hq-nav a:hover { color: var(--ink); background: var(--task-soft); }
.hq-nav a.on {
  background: var(--brand);
  color: #fff;
}
.hq-more-links a {
  display: inline-block;
  margin: 0 12px 10px 0;
  font-weight: 700;
}
body.hq-shell .wrap {
  padding-bottom: calc(88px + env(safe-area-inset-bottom));
}

.hq-panel[hidden] { display: none !important; }

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  overflow: hidden;
  background: var(--bg-elev);
}
.lang-switch a {
  padding: 6px 12px;
  font-size: 0.76rem;
  font-weight: 750;
  text-decoration: none;
  color: var(--muted);
}
.lang-switch a.on {
  background: var(--brand);
  color: #fff;
}

/* —— Hero —— */
.hero-banner {
  position: relative;
  margin: 0 0 16px;
  padding: 24px 22px;
  color: #fff;
  background:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,0.22) 1px, transparent 0),
    #318BF7;
  background-size: 16px 16px, auto;
  border: 0;
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(49, 139, 247, 0.28);
  overflow: hidden;
}
.hero-banner::before {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -50px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(247, 143, 67, 0.28);
  pointer-events: none;
}
.hero-banner h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: #fff;
  position: relative;
}
.hero-banner p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.95rem;
  position: relative;
}
.hero-banner .muted,
.hero-banner a:not(.btn) {
  color: rgba(255, 255, 255, 0.88) !important;
}
.hero-banner a:not(.btn):hover {
  color: #fff !important;
}
/* CTAs on the blue hero: white fill + dark text (ghost was invisible) */
.hero-banner a.btn,
.hero-banner a.btn-ghost,
.hero-banner a.btn-primary,
.hero-banner .btn,
.hero-banner .btn-ghost,
.hero-banner .btn-primary {
  position: relative;
  z-index: 1;
  width: auto;
  max-width: none;
  margin: 0;
  background: #fff !important;
  color: #0b5cab !important;
  border: 1.5px solid #fff !important;
  box-shadow: 0 2px 10px rgba(11, 45, 84, 0.18);
}
.hero-banner a.btn:hover,
.hero-banner a.btn-ghost:hover,
.hero-banner a.btn-primary:hover,
.hero-banner .btn:hover,
.hero-banner .btn-ghost:hover,
.hero-banner .btn-primary:hover {
  background: #fff7eb !important;
  color: #084a8a !important;
  border-color: #fff7eb !important;
}
.store-chip {
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.35);
  font-size: 0.74rem;
  font-weight: 700;
  color: #fff;
  position: relative;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.card h2, .card h1 {
  margin: 0 0 8px;
  font-size: 1.08rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}
.card.alert {
  background: var(--alert-soft);
  border-color: rgba(183, 121, 31, 0.25);
}
.card.ok-soft {
  background: var(--live-soft);
  border-color: rgba(13, 159, 110, 0.22);
}

.muted { color: var(--muted); font-size: 0.92rem; }
.break { word-break: break-all; font-size: 0.9rem; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--task-soft);
  color: var(--brand-deep);
  font-size: 0.76rem;
  font-weight: 700;
}

.task-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}
.btn-inline { width: 100%; padding: 12px 16px; min-height: 44px; }

.btn {
  display: block;
  width: 100%;
  border: 1px solid var(--line-strong, #c5d4e8);
  border-radius: var(--radius-pill);
  padding: 13px 20px;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  min-height: 48px;
  transition: filter .12s, background .12s, border-color .12s, transform .12s, box-shadow .12s;
}
.btn-primary {
  background: var(--cta);
  color: #fff;
  box-shadow: 0 8px 18px rgba(247, 143, 67, 0.28);
}
.btn-primary:hover { filter: brightness(1.04); transform: translateY(-1px); }
/* Link-styled buttons: the global a:hover (color: var(--cta)) outranks .btn-primary,
   which made the label vanish on an orange background (Hikaru 17 Sep, /done compare). */
a.btn-primary, a.btn-primary:hover, a.btn-primary:focus { color: #fff; }
a.btn-ghost:hover, a.btn-ghost:focus { color: var(--brand-deep); }
a.btn-danger:hover, a.btn-danger:focus { color: var(--danger); }
.btn-ghost {
  background: #fff;
  color: var(--brand-deep);
  border: 1.5px solid var(--brand);
  margin-top: 8px;
}
.btn-ghost:hover {
  background: var(--brand-soft);
  border-color: var(--brand-deep);
  color: var(--brand-deep);
}
.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid rgba(224, 72, 86, 0.25);
  margin-top: 8px;
}
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 0;
  min-height: 36px;
  padding: 8px 12px;
  font-size: 0.84rem;
  margin-top: 0;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; filter: none; box-shadow: none; }

.stack { display: grid; gap: 8px; }

label {
  display: block;
  font-weight: 650;
  margin: 12px 0 6px;
  color: var(--ink);
  font-size: 0.9rem;
}
input, textarea, select {
  width: 100%;
  font: inherit;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
input[type="radio"],
input[type="checkbox"] {
  width: auto;
  height: auto;
  min-width: 18px;
  padding: 0;
  border: 0;
  box-shadow: none;
  accent-color: var(--brand);
}
input::placeholder, textarea::placeholder { color: rgba(67, 66, 93, 0.45); }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--focus);
}
textarea { min-height: 100px; resize: vertical; }

.mt6 { margin-top: 6px; }
.mt10 { margin-top: 10px; }
.mt14 { margin-top: 14px; }

.nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 6px 8px calc(8px + env(safe-area-inset-bottom));
  backdrop-filter: blur(12px);
  z-index: 20;
  box-shadow: 0 -4px 20px rgba(67, 66, 93, 0.06);
}
.nav.nav-4 { grid-template-columns: repeat(4, 1fr); } /* PATCH-2026-11-02-SAITO2 */
.nav.nav-6 { grid-template-columns: repeat(6, 1fr); } /* PATCH-2026-10-30-CRAWLERSNAV (unused since 2026-11-02 STOREUI) */
.nav .nav-short { display: none; }
.nav .nav-full { display: inline; }
.nav a {
  text-align: center;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 10px 2px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: background .15s, color .15s;
}
.nav a:hover { color: var(--ink); background: var(--task-soft); }
.nav a.active {
  background: var(--brand);
  color: #fff;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--task-soft);
  color: var(--task);
  font-size: 0.76rem;
  font-weight: 700;
}

.flash {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-weight: 600;
  font-size: 0.92rem;
  border: 1px solid transparent;
}
.flash.ok { background: var(--live-soft); color: #0a7a55; border-color: rgba(18,160,106,0.22); }
.flash.err { background: var(--danger-soft); color: #b0343d; border-color: rgba(224,72,86,0.25); }
.flash.info { background: var(--brand-soft); color: var(--brand-deep); border-color: rgba(49, 139, 247, 0.22); }
.flash.flash-attention {
  position: relative;
  z-index: 2;
  box-shadow: 0 0 0 3px rgba(18, 160, 106, 0.18);
  animation: flash-attention-pulse 1.2s ease-out 1;
}
@keyframes flash-attention-pulse {
  0% { transform: translateY(-4px); opacity: 0.55; }
  100% { transform: none; opacity: 1; }
}

.score-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 12px; align-items: stretch; }
.score-grid-report {
  grid-template-columns: 1.05fr 1fr;
}
.score-card-impact h2 {
  margin: 0 0 6px;
  font-size: 1rem;
}
.score-card-impact .queue-item {
  margin-top: 10px;
}
.score-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}
.score-card .num {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--live);
  letter-spacing: -0.02em;
}
.score-card .lbl { font-size: 0.8rem; color: var(--muted); font-weight: 700; margin-top: 4px; }
/* vis-hero-20260817 */
.score-card[data-metric="visibility"] {
  border: 1.5px solid rgba(49, 139, 247, 0.38);
  background: linear-gradient(180deg, #f4f9ff 0%, #fff 46%);
  box-shadow: 0 8px 22px rgba(49, 139, 247, 0.08);
}
.score-card[data-metric="visibility"] .num {
  font-size: 2.35rem;
  color: #1d6fd6;
}
.score-card[data-metric="readiness"] {
  background: #f7f7f9;
  border-color: rgba(67, 66, 93, 0.14);
}
.score-card[data-metric="readiness"] .num {
  font-size: 1.45rem;
  color: #5c5b73;
}
.score-card-dual .dual-score-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 10px;
}
.score-card-dual .dual-score .num {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.score-card-dual .dual-score[data-half="ai"] .num { color: #7a2ee6; }
.score-card-dual .dual-score[data-half="web"] .num { color: #0e8fb8; }
.score-card-dual .dual-score .lbl {
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
  margin-top: 4px;
}
.status-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.hq-page-score { white-space: nowrap; font-variant-numeric: tabular-nums; }
.hq-web-score-cell,
.hq-brands-score-cell { white-space: normal; }
.hq-vis-cell .hq-vis-measured,
.hq-web-score-cell .hq-vis-measured,
.hq-web-score-cell .hq-web-scored,
.hq-brands-score-cell .hq-vis-measured,
.hq-brands-score-cell .hq-brands-published {
  display: block;
  margin-top: 4px;
  line-height: 1.25;
  max-width: 4.8rem;
  white-space: normal;
}
.score-card-over {
  font-size: 0.55em;
  font-weight: 700;
  color: var(--muted);
  margin-left: 2px;
}
.score-card-kicker {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #1d6fd6;
}
.score-card[data-metric="readiness"] .score-card-kicker {
  color: #7a7990;
}
.score-card-blurb {
  margin: 8px 0 0;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--ink, #43425d);
  font-weight: 500;
}
.score-card[data-metric="readiness"] .score-card-blurb {
  color: var(--muted);
  font-size: 0.8rem;
}
.score-card > .metric-explain {
  display: block;
  margin-top: 6px;
}

.score-chart-card .score-chart {
  width: 100%;
  max-width: 420px;
  height: auto;
  display: block;
  margin-top: 8px;
}
.score-chart-axis { stroke: var(--line); stroke-width: 1; }
.score-chart-line { stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.score-chart-line.readiness { stroke: #12a06a; }
.score-chart-line.visibility { stroke: #318BF7; }
.score-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}
.score-chart-legend .lg-r::before,
.score-chart-legend .lg-v::before {
  content: "■";
  display: inline-block;
  width: auto;
  height: auto;
  margin-right: 6px;
  vertical-align: 0;
  font-size: 0.85em;
  line-height: 1;
}
.score-chart-legend .lg-r::before { color: #12a06a; background: transparent; }
.score-chart-legend .lg-v::before { color: #318BF7; background: transparent; }

.comp-vis-table { display: grid; gap: 6px; }
.comp-vis-head,
.comp-vis-row {
  display: grid;
  grid-template-columns: minmax(7rem, 1.4fr) repeat(3, minmax(4.5rem, 1fr));
  gap: 6px;
  align-items: center;
  font-size: 0.78rem;
}
.comp-vis-head { color: var(--muted); font-weight: 700; }
.comp-vis-name { font-weight: 600; word-break: break-word; }
.comp-vis-cell {
  text-align: center;
  padding: 4px 6px;
  border-radius: 6px;
  background: var(--bg, #f4f7fb);
  border: 1px solid var(--line);
}
.comp-vis-cell.hit { background: rgba(18,160,106,0.12); color: #0a7a55; font-weight: 700; }
.comp-vis-cell.miss { color: var(--muted); }
@media (max-width: 560px) {
  .comp-vis-head, .comp-vis-row {
    grid-template-columns: 1fr;
  }
  .comp-vis-cell { text-align: left; }
}

.hq-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.hq-metric {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: border-color .15s, transform .12s;
}
.hq-metric:hover {
  border-color: rgba(49, 139, 247, 0.4);
  color: inherit;
  transform: translateY(-1px);
}
.hq-metric.hot {
  border-color: rgba(183, 121, 31, 0.4);
  background: var(--alert-soft);
}
.hq-metric .n {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--task);
  letter-spacing: -0.03em;
}
.hq-metric.hot .n { color: var(--alert); }
.hq-metric.on {
  border-color: rgba(49, 139, 247, 0.75);
  box-shadow: 0 0 0 2px rgba(49, 139, 247, 0.16);
}
.hq-metric .l { font-size: 0.76rem; color: var(--muted); font-weight: 700; margin-top: 4px; }
.hq-funnel-title {
  margin: 0 0 8px;
  font-size: 0.92rem;
  font-weight: 700;
}
.hq-funnel-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}
.hq-funnel-chips a {
  display: inline-block;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 700;
  color: inherit;
  background: var(--card);
}
.hq-funnel-chips a.on {
  border-color: rgba(49, 139, 247, 0.75);
  background: var(--card-hover, #f7fbff);
}
.hq-missing-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.hq-missing-list li + li { margin-top: 2px; }
.vis-simple-sentence {
  margin: 8px 0 0;
  font-size: 1.12rem;
  line-height: 1.45;
  font-weight: 700;
}

.hq-actions { list-style: none; margin: 0; padding: 0; }
.hq-actions li { border-bottom: 1px solid var(--line); }
.hq-actions li:last-child { border-bottom: 0; }
.hq-actions a {
  display: block;
  padding: 13px 2px;
  font-weight: 700;
  text-decoration: none;
  color: var(--task);
}

.store-link { text-decoration: none; color: inherit; }
.store-link:hover { color: var(--task); }
.hq-row-link { cursor: pointer; }
.hq-row-link:hover { background: var(--task-soft); }

.queue-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}
.queue-item:last-child { border-bottom: 0; }
.queue-main { flex: 1; min-width: 160px; }
.queue-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.queue-actions form { margin: 0; }

.hq-layout {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 14px;
  align-items: start;
}
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.hq-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 480px;
}
.hq-table th, .hq-table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
#stores .hq-table td {
  vertical-align: top;
}
#stores .hq-table th.hq-col-page,
#stores .hq-table td.hq-col-page,
#stores .hq-table th.hq-col-issues,
#stores .hq-table td.hq-col-issues,
#stores .hq-table th.hq-col-actions,
#stores .hq-table td.hq-col-actions {
  text-align: center !important;
  vertical-align: middle;
  white-space: nowrap;
  width: 1%;
}
.hq-table th {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 750;
  vertical-align: bottom;
  padding-bottom: 10px;
}
.hq-table .bad { color: var(--danger); font-weight: 700; }
.hq-table th.hq-col-issues,
.hq-table td.hq-col-issues,
.hq-table th.hq-col-actions,
.hq-table td.hq-col-actions {
  text-align: center !important;
  vertical-align: middle;
  white-space: nowrap;
  width: 1%;
}
.hq-row-menu {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  vertical-align: middle;
  text-align: left;
  max-width: 100%;
  margin: 0 auto;
}
.hq-row-menu > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.hq-row-menu > summary::-webkit-details-marker { display: none; }
.hq-row-menu-btn.btn,
.hq-row-menu-btn.btn-ghost,
.hq-row-menu-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 !important;
  box-sizing: border-box;
}
.hq-row-menu-btn::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.75;
}
.hq-row-menu-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  min-width: 12.5rem;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(67, 66, 93, 0.12);
}
.hq-row-menu-panel a,
.hq-row-menu-panel button {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 9px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 650;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.hq-row-menu-panel a:hover,
.hq-row-menu-panel button:hover {
  background: var(--task-soft);
}
.hq-row-menu-panel form { margin: 0; }

.links-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
.links-row a { font-weight: 700; }

.file-form { display: grid; gap: 10px; margin-top: 8px; }
.file-btn {
  display: block;
  border: 1px dashed var(--line-strong);
  background: var(--task-soft);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  cursor: pointer;
  color: var(--task);
  font-weight: 700;
  margin: 0;
}
.file-btn:hover { border-color: var(--task); }
.file-btn input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
}

.note-box {
  background: var(--alert-soft);
  border: 1px solid rgba(183, 121, 31, 0.25);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.9rem;
  margin-bottom: 12px;
  color: #8a5a12;
}

/* —— Auth / login —— */
body.auth-page .wrap {
  max-width: 560px;
  padding-bottom: 48px;
}
.auth-hero {
  position: relative;
  margin: 8px 0 22px;
  padding: 28px 22px 26px;
  text-align: center;
  color: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  background:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,0.22) 1px, transparent 0),
    #318BF7;
  background-size: 16px 16px, auto;
  box-shadow: 0 14px 36px rgba(49, 139, 247, 0.28);
}
.auth-hero::after {
  content: "";
  position: absolute;
  right: -36px;
  bottom: -48px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(247, 143, 67, 0.3);
  pointer-events: none;
}
.auth-kicker {
  position: relative;
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
}
.auth-hero h1 {
  position: relative;
  margin: 0;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: #fff;
}
.auth-sub {
  position: relative;
  margin: 10px auto 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: 1.02rem;
  max-width: 32em;
}

/* Center primary actions on login / auth screens */
body.auth-page .btn,
body.auth-page .btn-ghost,
body.auth-page .btn-danger,
body.auth-page a.btn {
  margin-left: auto;
  margin-right: auto;
  max-width: 360px;
}
body.auth-page .stack .btn,
body.auth-page .stack .btn-ghost {
  width: 100%;
  max-width: 360px;
}

.door-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px;
  margin-bottom: 12px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: border-color .15s, transform .12s, box-shadow .15s;
  min-height: 190px;
}
.door-card:hover {
  border-color: rgba(49, 139, 247, 0.5);
  color: inherit;
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(49, 139, 247, 0.14);
}
.door-store:hover { border-color: rgba(247, 143, 67, 0.55); }
.door-label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand-deep);
  margin-bottom: 8px;
}
.door-store .door-label { color: var(--cta); }
.door-title {
  display: block;
  font-size: 1.28rem;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}
.door-body {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
  flex: 1;
}
.door-cta {
  display: block;
  margin-top: 18px;
  padding: 12px 16px;
  text-align: center;
  font-size: 0.92rem;
  font-weight: 750;
  color: #fff;
  background: var(--brand);
  border-radius: var(--radius-pill);
  box-shadow: 0 6px 14px rgba(49, 139, 247, 0.25);
}
.door-store .door-cta {
  color: #fff;
  background: var(--cta);
  box-shadow: 0 6px 14px rgba(247, 143, 67, 0.28);
}
.door-card:hover .door-cta { filter: brightness(1.04); }
.center-note { text-align: center; margin-top: 14px; font-size: 0.88rem; }

.check-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 14px;
}
.check-list li {
  font-size: 0.88rem;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.check-list li.ok { color: var(--live); }
.check-list .mark { font-weight: 800; width: 1rem; flex: 0 0 auto; }

@media (max-width: 767px) {
  .check-list { grid-template-columns: 1fr; }
  .hq-metrics { grid-template-columns: repeat(2, 1fr); }
  .hq-layout { grid-template-columns: 1fr; }
}

@media (min-width: 768px) {
  .wrap { max-width: 760px; padding: 28px 32px 48px; }
  body.wide .wrap { max-width: 1180px; padding: 28px 40px 48px; }
  body.auth-page .wrap { max-width: 680px; }
  .brand-logo { height: 32px; min-width: 60px; }
  .brand-logo-ruby { height: 48px; }
  .auth-hero h1 { font-size: 2.15rem; }
  .hero-banner { padding: 28px; }
  .hero-banner h1 { font-size: 1.75rem; }
  .door-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
  .door-card { margin-bottom: 0; min-height: 210px; padding: 26px 22px; }
  .card { padding: 20px 22px; }
  .task-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
  }
  .btn-inline { width: auto; min-width: 128px; }
  .btn, .btn-ghost, .btn-danger {
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
  }
  body.wide .btn,
  body.wide .btn-ghost,
  body.wide .btn-danger {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
  }
  body.wide .btn-row .btn,
  body.wide .btn-row .btn-ghost,
  body.wide .queue-actions .btn {
    margin-left: 0;
    margin-right: 0;
  }
  .hq-metric .n { font-size: 1.9rem; }

  /* Desktop store + HQ shell: left sidebar menu */
  body:has(> .nav),
  body:has(> .hq-nav) {
    display: grid;
    grid-template-columns: 232px minmax(0, 1fr);
    align-items: start;
    min-height: 100vh;
  }
  body:has(> .nav) > .nav,
  body:has(> .hq-nav) > .hq-nav {
    position: sticky;
    top: 16px;
    left: auto;
    right: auto;
    bottom: auto;
    width: 216px;
    max-width: none;
    height: calc(100vh - 32px);
    margin: 16px 0 16px 16px;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    grid-column: 1;
    grid-row: 1;
    border: 1px solid var(--line);
    border-top: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
    z-index: 30;
    backdrop-filter: none;
  }
  body:has(> .nav) > .nav a,
  body:has(> .hq-nav) > .hq-nav a {
    text-align: left;
    justify-content: flex-start;
    padding: 12px 14px;
    min-height: 0;
    font-size: 0.92rem;
    border-radius: 12px;
    color: var(--muted);
  }
  body:has(> .nav) > .nav a:hover,
  body:has(> .hq-nav) > .hq-nav a:hover {
    background: var(--brand-soft);
    color: var(--brand-deep);
  }
  body:has(> .nav) > .nav a.active,
  body:has(> .hq-nav) > .hq-nav a.on {
    background: var(--brand);
    color: #fff;
  }
  body:has(> .nav) > .wrap,
  body:has(> .hq-nav) > .wrap {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 28px 32px 48px;
    padding-bottom: 40px;
  }
  body.wide:has(> .hq-nav) > .wrap {
    max-width: 1180px;
    padding: 28px 40px 48px;
  }
  body:has(> .nav) > .canly-helper,
  body:has(> .hq-nav) > .canly-helper {
    /* fixed overlay — keep out of grid flow */
    grid-column: 1 / -1;
  }
  body.hq-shell .wrap {
    padding-bottom: 48px;
  }

  /* Desktop page editor: action bar centered in content column (right of sidebar) */
  body.page-editor-body .wrap {
    padding-bottom: 120px;
  }
  body.page-editor-body .page-actionbar {
    left: calc(232px + (100vw - 232px) / 2);
    right: auto;
    bottom: 20px;
    transform: translateX(-50%);
    width: min(760px, calc(100vw - 232px - 48px));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 12px 16px;
  }
  body.page-editor-body .page-actionbar-btns {
    grid-template-columns: 1fr 1fr 1.2fr;
  }
  body.page-editor-body .page-actionbar-btns-4 {
    grid-template-columns: 1fr 1fr 1.15fr 1.15fr;
  }
  body.page-editor-body .page-actionbar-btns-5 { /* PATCH-2026-10-28-CANLYPAGE */
    grid-template-columns: 1fr 1fr 1.15fr 1fr 1.1fr;
  }
  body.page-editor-body .page-actionbar {
    width: min(920px, calc(100vw - 232px - 48px));
  }
  body.page-editor-body .page-actionbar-hint {
    display: block;
    text-align: center;
    margin: 0 0 8px;
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--muted);
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    max-width: 100%;
  }
}

@media (min-width: 1100px) {
  body.wide .wrap { max-width: 1280px; }
}

@media (prefers-reduced-motion: reduce) {
  .door-card, .hq-metric, .btn, .hq-nav a { transition: none; }
  .door-card:hover, .hq-metric:hover { transform: none; }
}

/* —— AI helper —— */
.canly-helper {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}
.canly-helper[hidden] { display: none !important; }
.canly-helper > * { pointer-events: auto; }

.helper-fab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.helper-dismiss {
  display: none; /* mobile only */
}

.helper-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 11px 16px 11px 13px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.helper-pill:hover { border-color: rgba(49, 139, 247, 0.4); }
.helper-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--task);
  box-shadow: 0 0 0 3px rgba(49, 139, 247, 0.16);
}
.helper-pill-short { display: none; }
.helper-panel {
  width: min(380px, calc(100vw - 28px));
  max-height: min(520px, calc(100vh - 100px));
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 16px 48px rgba(67, 66, 93, 0.14);
  overflow: hidden;
}
.helper-panel[hidden] { display: none !important; }
.helper-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}
.helper-hint { margin: 4px 0 0; color: var(--muted); font-size: 0.78rem; }
.helper-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.4rem;
  cursor: pointer;
  border-radius: 6px;
}
.helper-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 220px;
}
.helper-msg {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.45;
  word-break: break-word;
}
.helper-msg-assistant {
  align-self: flex-start;
  background: var(--task-soft);
  border: 1px solid rgba(49, 139, 247, 0.12);
}
.helper-msg-user {
  align-self: flex-end;
  background: var(--live-soft);
  border: 1px solid rgba(13, 159, 110, 0.18);
}
.helper-thinking { opacity: 0.75; font-style: italic; }
.helper-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: #f8fafc;
}
.helper-input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  padding: 10px 12px;
}
.helper-send {
  border: 0;
  border-radius: 10px;
  background: var(--task);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 10px 14px;
  cursor: pointer;
}
.helper-send:disabled { opacity: 0.55; cursor: wait; }

body:has(> .nav) .canly-helper,
body:has(> .hq-nav) .canly-helper {
  bottom: max(78px, calc(env(safe-area-inset-bottom) + 64px));
}
@media (min-width: 900px) {
  body:has(> .nav) .canly-helper,
  body:has(> .hq-nav) .canly-helper {
    bottom: max(18px, env(safe-area-inset-bottom));
  }
}

.flow-card .flow-step {
  margin: 0 0 10px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--task);
}
.otp-input {
  font-size: 1.35rem !important;
  letter-spacing: 0.35em;
  font-weight: 700;
  text-align: center;
}
.status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 10px;
}
.status-line { margin: 8px 0 0; }
.status-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: #f8fafc;
  margin-right: 6px;
}
a.status-pill-link {
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.15s ease, box-shadow 0.15s ease;
}
a.status-pill-link:hover {
  filter: brightness(0.96);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.55);
}
.hero-banner a.status-pill-link {
  color: inherit !important; /* keep pill colors; don't force white link text */
}
.hero-banner .hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.status-pill.status-open,
.status-pill.status-not_generated,
.status-pill.status-draft {
  color: var(--alert);
  border-color: rgba(183,121,31,0.3);
  background: var(--alert-soft);
}
.status-pill.status-in_progress,
.status-pill.status-awaiting_hq {
  color: var(--task);
  border-color: rgba(49, 139, 247, 0.25);
  background: var(--task-soft);
}
.status-pill.status-done,
.status-pill.status-live {
  color: var(--live);
  border-color: rgba(13,159,110,0.28);
  background: var(--live-soft);
}
.status-pill.status-update_required {
  color: var(--danger);
  border-color: rgba(214,69,80,0.28);
  background: var(--danger-soft);
}
.tiny { font-size: 0.75rem; }
details summary { cursor: pointer; }


/* Store public page editor */
.theme-live textarea[name="summary"] { min-height: 140px; }

.field-attention { outline: 2px solid var(--danger, #c0392b); outline-offset: 2px; }

/* Extra bottom space so fixed action bar never covers inputs */
body.page-editor-body .wrap {
  padding-bottom: calc(240px + env(safe-area-inset-bottom, 0px));
}
/* Mobile: circular free-drag FAB + dismiss X (desktop pill unchanged above) */
@media (max-width: 899px) {
  .canly-helper {
    /* top/left positioning (JS): grow panel ABOVE the circle */
    flex-direction: column-reverse;
    align-items: flex-end;
    z-index: 90;
  }
  .canly-helper.is-dragging {
    z-index: 100;
  }
  .canly-helper.is-dragging .helper-pill {
    box-shadow: 0 10px 28px rgba(67, 66, 93, 0.22);
    transform: scale(1.06);
  }
  .helper-dismiss {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: #fff;
    color: var(--ink);
    font-size: 14px;
    line-height: 1;
    font-weight: 700;
    padding: 0;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(67, 66, 93, 0.12);
    z-index: 2;
  }
  .helper-pill {
    width: 56px;
    height: 56px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
    gap: 0;
  }
  .helper-pill-text { display: none; }
  .helper-pill-short {
    display: inline;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--task);
  }
  .helper-pill-dot {
    position: absolute;
    width: 7px;
    height: 7px;
    top: 10px;
    right: 12px;
  }
  .canly-helper.is-open {
    align-items: stretch;
    /* JS docks left/top/width into visualViewport; keep children inside */
    max-width: calc(100vw - 24px);
    box-sizing: border-box;
  }
  .canly-helper.is-open .helper-fab {
    align-self: flex-end;
  }
  .canly-helper .helper-panel {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    max-height: min(55dvh, 420px);
  }
  .canly-helper.is-open .helper-messages {
    min-height: 120px;
  }
}
body.page-editor-body #page-editor input,
body.page-editor-body #page-editor textarea,
body.page-editor-body #page-editor select,
body.page-editor-body .page-sec {
  scroll-margin-bottom: 190px;
  scroll-margin-top: 12px;
}

.page-hero.hero-banner {
  padding: 18px 18px 16px;
  margin-bottom: 12px;
}
.page-hero.hero-banner h1 { font-size: 1.35rem; }
.page-hero.hero-banner p {
  margin-top: 6px;
  font-size: 0.88rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.page-live-card { padding: 12px 14px; }
.page-live-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}
.page-live-url { margin: 0; flex: 1 1 200px; }
.page-live-card .btn { margin: 0; width: auto; max-width: none; }

/* Compact chip TOC — not sticky (avoids fighting the action bar) */
.page-toc {
  margin: 0 0 12px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.page-toc-links {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2px 2px 8px;
  scrollbar-width: thin;
}
.page-toc-links a {
  display: inline-block;
  flex: 0 0 auto;
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: #fff;
  font-size: 0.82rem;
  font-weight: 650;
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
}
.page-toc-links a:hover {
  border-color: var(--brand);
  color: var(--brand-deep);
  background: var(--brand-soft);
}

/* Fixed action bar above bottom nav — does NOT overlay form mid-scroll */
.page-actionbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  z-index: 28;
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 28px rgba(67, 66, 93, 0.08);
  padding: 8px 12px 10px;
  backdrop-filter: blur(10px);
}
.pack-confirm {
  margin: 12px 0;
  padding: 14px 16px;
  border: 1px solid #d7e2f5;
  border-radius: 12px;
  background: #f7faff;
}
.pack-confirm h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}
.pack-confirm > .muted { margin: 0 0 10px; }
.pack-confirm > .muted.tiny { margin: 0 0 12px; }
.pack-confirm-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 8px;
}
.pack-confirm-pick { margin-top: 10px; }
.page-actionbar-hint {
  display: block;
  text-align: center;
  margin: 0 0 6px;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--muted);
  white-space: normal;
  overflow: visible;
}
.page-publish-status {
  display: block;
  text-align: center;
  margin: 0 0 6px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--task, #318BF7);
}
#page-editor.is-publishing .page-actionbar-btns button {
  opacity: 0.7;
  cursor: wait;
}
#page-editor.is-ai-checking .page-actionbar-btns button {
  opacity: 0.7;
  cursor: wait;
}
#page-editor.is-ai-checking #page-publish-status {
  color: var(--brand-deep, #0b5cad);
}
.page-autosave-status {
  display: block;
  text-align: center;
  margin: 0 0 6px;
  min-height: 1em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--brand, #318BF7);
}
.page-autosave-status:empty,
.page-autosave-status[hidden] {
  display: none;
}
.page-actionbar-btns {
  display: grid;
  grid-template-columns: 1fr 1fr 1.15fr;
  gap: 8px;
  max-width: 760px;
  margin: 0 auto;
}
.page-actionbar-btns-4 {
  grid-template-columns: 1fr 1fr 1.1fr 1.1fr;
  max-width: 920px;
}
/* PATCH-2026-10-28-CANLYPAGE: 5th button (Fill missing fields with AI) */
.page-actionbar-btns-5 {
  grid-template-columns: 1fr 1fr 1.1fr 1fr 1.1fr;
  max-width: 920px;
}
@media (max-width: 767px) {
  .page-actionbar-btns-4 {
    grid-template-columns: 1fr 1fr;
  }
  .page-actionbar-btns-4 .btn-primary {
    grid-column: auto;
    order: 0;
  }
}
.home-vis-card {
  margin: 0 0 16px;
}
.home-glance {
  margin: 0 0 14px;
}
.home-glance-grid {
  grid-template-columns: repeat(3, 1fr);
}
.home-glance #home-open-tasks {
  color: inherit;
  text-decoration: none;
}
.home-glance #home-open-tasks:hover {
  text-decoration: underline;
}
.page-preview-cta {
  margin: 0 0 16px;
}
.page-preview-cta .btn {
  display: flex;
  width: 100%;
  min-height: 52px;
  justify-content: center;
  align-items: center;
  background: #f5c518;
  border: none;
  color: #1a1a1a;
  font-weight: 800;
  font-size: 1rem;
}
.page-preview-cta .btn:hover {
  filter: brightness(0.96);
  color: #1a1a1a;
}
/* Hikaru 17 Sep: "Check questions" under the nearby table, same yellow as the page CTA */
.btn-check-questions {
  display: flex;
  width: 100%;
  min-height: 46px;
  justify-content: center;
  align-items: center;
  background: #f5c518;
  border: none;
  color: #1a1a1a;
  font-weight: 800;
  box-shadow: none;
}
.btn-check-questions:hover {
  filter: brightness(0.96);
  color: #1a1a1a;
}
.page-actionbar .btn,
.page-actionbar .btn-ghost,
.page-actionbar .btn-ai-check,
.page-actionbar .btn-primary {
  width: 100%;
  max-width: none;
  margin: 0;
  min-height: 44px;
  padding: 10px 8px;
  font-size: 0.86rem;
}

.page-sec { scroll-margin-top: 16px; scroll-margin-bottom: 140px; }
.page-sec-advanced > summary {
  list-style: none;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  font-weight: 700;
  padding: 2px 0;
}
.page-sec-advanced > summary::-webkit-details-marker { display: none; }
.page-sec-advanced > summary::after {
  content: "+";
  font-weight: 700;
  color: var(--muted, #667);
  flex: 0 0 auto;
}
.page-sec-advanced[open] > summary::after { content: "−"; }
.page-sec-summary-title { font-size: 1.1rem; }
.page-sec-advanced[open] > summary { margin-bottom: 10px; }

.btn-ai-check {
  border: 1.5px solid var(--brand);
  background: #fff;
  color: var(--brand-deep);
  font-weight: 700;
  border-radius: var(--radius-pill);
}
.btn-ai-check:hover {
  background: var(--brand-soft);
}

/* AI autofill highlight — red text = machine-filled empty fields */
#page-editor input.ai-filled,
#page-editor textarea.ai-filled {
  color: #d32f2f;
  caret-color: #d32f2f;
  border-color: rgba(211, 47, 47, 0.35);
  background: #fff8f8;
}
#page-editor input.ai-filled:focus,
#page-editor textarea.ai-filled:focus {
  outline-color: rgba(211, 47, 47, 0.45);
  border-color: #d32f2f;
}
.page-ai-filled-legend {
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #fff5f5;
  border: 1px solid rgba(211, 47, 47, 0.22);
  color: #b71c1c;
  font-size: 0.92rem;
  font-weight: 600;
}

/* Auth / login hero strip like jp.can-ly.com */
body.auth-page .hero-banner,
body.auth-page .card.hero-banner {
  color: #fff;
}
body.auth-page .wrap {
  max-width: 520px;
}


/* Task cards — copy on top, all actions in one aligned row */
.task-card .task-copy h2 {
  margin: 0 0 6px;
  font-size: 1.12rem;
  line-height: 1.35;
}
.task-card .task-copy > .muted {
  margin: 0;
}
.task-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}
.task-card-actions form {
  margin: 0;
  display: contents;
}
.task-card-actions .btn,
.task-card-actions .btn-ghost,
.task-card-actions .btn-primary {
  width: auto;
  max-width: none;
  margin: 0;
  min-height: 42px;
  padding: 10px 16px;
  flex: 0 1 auto;
}
.task-card-actions .btn-primary {
  margin-left: auto;
}
@media (max-width: 560px) {
  .task-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .task-card-actions .btn-primary {
    grid-column: 1 / -1;
    margin-left: 0;
    width: 100%;
    order: -1;
  }
  .task-card-actions .btn-ghost {
    width: 100%;
  }
}
.more-tasks {
  text-align: center;
  margin: 8px 0 20px;
  font-weight: 600;
}
/* Unified help chat shell */
.help-shell {
  display: flex;
  flex-direction: column;
  min-height: min(72vh, 640px);
  max-height: calc(100vh - 140px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.help-shell-head {
  padding: 16px 18px 14px;
  border-bottom: 1px solid rgba(67, 66, 93, 0.08);
  background: #318BF7;
  color: #fff;
}
.help-shell-head h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
}
.help-shell-head p {
  margin: 4px 0 0;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.9);
}
.help-shell-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background:
    radial-gradient(circle at 1px 1px, rgba(49, 139, 247, 0.06) 1px, transparent 0);
  background-size: 18px 18px;
  background-color: #f6f8fb;
}
.help-empty {
  margin: auto;
  text-align: center;
  color: var(--muted);
  padding: 32px 16px;
  max-width: 280px;
}
.help-dayline {
  display: flex;
  justify-content: center;
  margin: 6px 0 4px;
}
.help-dayline span {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(67, 66, 93, 0.08);
  border-radius: 999px;
  padding: 4px 10px;
}
.help-bubble {
  max-width: min(88%, 440px);
  padding: 10px 12px;
  border-radius: 16px;
  line-height: 1.45;
  box-shadow: 0 4px 12px rgba(67, 66, 93, 0.06);
}
.help-bubble-you {
  align-self: flex-end;
  background: #318BF7;
  color: #fff;
  border-bottom-right-radius: 5px;
}
.help-bubble-support {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  border-bottom-left-radius: 5px;
}
.help-bubble-label {
  font-size: 0.7rem;
  font-weight: 700;
  margin-bottom: 4px;
  opacity: 0.88;
  word-break: break-all;
}
.help-bubble-you .help-bubble-label,
.help-bubble-you .help-bubble-foot .tiny {
  color: rgba(255, 255, 255, 0.88);
}
.help-bubble-body { white-space: pre-wrap; word-break: break-word; }
.help-bubble-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.help-bubble-foot .tiny { font-size: 0.68rem; color: var(--muted); }
.help-bubble-foot form { margin: 0; }
.help-bubble-foot .btn-link {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--brand-deep);
  cursor: pointer;
  text-decoration: underline;
}
.help-waiting {
  align-self: flex-start;
  margin: 0 0 4px 6px;
  font-size: 0.78rem;
  color: var(--muted);
  font-style: italic;
}
.help-composer {
  border-top: 1px solid rgba(67, 66, 93, 0.08);
  padding: 12px 14px 14px;
  background: #fff;
}
.help-composer-topic select {
  width: 100%;
  margin: 0 0 8px;
  min-height: 42px;
}
.help-composer-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
}
.help-composer-row textarea {
  margin: 0;
  min-height: 48px;
  max-height: 120px;
  resize: vertical;
}
.help-composer .help-send {
  width: auto;
  min-width: 112px;
  margin: 0;
  max-width: none;
  min-height: 48px;
  padding: 12px 18px;
}
@media (max-width: 560px) {
  .help-shell {
    min-height: min(68vh, 580px);
    max-height: calc(100vh - 120px);
  }
  .help-composer-row {
    grid-template-columns: 1fr;
  }
  .help-composer .help-send { width: 100%; }
}

/* HQ help desk — collapsible ticket accordion */
.hq-help-desk > .muted { margin-top: 0; }
.hq-help-accordion {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}
.hq-help-acc {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}
.hq-help-acc.open {
  border-color: rgba(49, 139, 247, 0.45);
  box-shadow: 0 8px 22px rgba(49, 139, 247, 0.1);
}
.hq-help-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.hq-help-head h2 { margin: 0; }
.hq-help-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.hq-help-table-head {
  display: grid;
  grid-template-columns: 1.4fr 1.2fr 1.5fr 0.9fr 0.7fr auto;
  gap: 8px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}
.hq-help-row {
  grid-template-columns: 1.4fr 1.2fr 1.5fr 0.9fr 0.7fr auto !important;
  align-items: center !important;
}
.hq-help-who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hq-help-ava {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--task-soft);
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  flex: 0 0 auto;
}
.hq-help-cell { min-width: 0; }
.hq-help-acc-tab {
  width: 100%;
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  text-align: left;
  border: 0;
  background: #fff;
  padding: 12px 14px;
  cursor: pointer;
  font: inherit;
}
.hq-help-acc-tab:hover { background: var(--brand-soft); }
.hq-help-acc.open > .hq-help-acc-tab {
  background: var(--brand-soft);
  border-bottom: 1px solid rgba(67, 66, 93, 0.08);
}
.hq-help-acc-chevron {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  justify-self: center;
  color: var(--brand-deep);
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 20px;
  text-align: center;
}
.hq-help-acc-chevron::before { content: "▸"; }
.hq-help-acc.open .hq-help-acc-chevron::before { content: "▾"; }
.hq-help-acc-main { min-width: 0; }
.hq-help-ticket-email {
  display: block;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--ink);
  word-break: break-all;
}
.hq-help-ticket-meta {
  display: block;
  margin-top: 2px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
}
.hq-help-ticket-preview {
  display: block;
  margin-top: 4px;
  font-size: 0.84rem;
  color: var(--ink);
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hq-help-acc-body {
  display: flex;
  flex-direction: column;
  background: #f7f9fc;
}
.hq-help-acc-body[hidden],
.hq-help-acc:not(.open) .hq-help-acc-body {
  display: none !important;
}
.hq-help-thread-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #fff;
  border-bottom: 1px solid rgba(67, 66, 93, 0.06);
}
.hq-help-messages {
  flex: 1;
  max-height: 320px;
  min-height: 160px;
}
.hq-help-composer {
  border-radius: 0;
  background: #fff;
}
.hq-help-section-title {
  margin: 18px 0 8px;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--ink);
}
.hq-help-history-title { margin-top: 28px; }
.hq-help-acc-archived > .hq-help-acc-tab {
  background: #f8fafc;
}
.hq-help-acc-archived.open > .hq-help-acc-tab {
  background: #eef2f7;
}
.help-bubble-dismissed {
  opacity: 0.55;
}
.edit-dirs { margin: 8px 0 10px; }
.edit-dir-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.edit-dir-chips .chip {
  appearance: none;
  border: 1px solid rgba(49, 139, 247, 0.35);
  background: rgba(49, 139, 247, 0.08);
  color: #0f172a;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.edit-dir-chips .chip:hover {
  background: rgba(49, 139, 247, 0.16);
}
.store-switch select {
  width: 100%;
  margin-top: 4px;
}
/* PATCH-2026-10-28-STOREDD: Windows Chrome draws the open list from option colors; pin literal dark-on-white */
.store-switch select,
.store-switch select option { color: #43425D; background-color: #fff; }
/* PATCH-2026-10-29-DROPDOWN: Hikaru saw white-on-white options again on /report (Windows Chrome). Pin with
   higher specificity + !important, force a light popup, and cover checked/disabled rows. */
.hero-banner .store-switch select,
.store-switch select { color-scheme: light; color: #43425D !important; background-color: #fff !important; -webkit-text-fill-color: #43425D; }
.hero-banner .store-switch select option,
.hero-banner .store-switch select optgroup,
.store-switch select option { color: #43425D !important; background-color: #fff !important; -webkit-text-fill-color: #43425D; }
.hero-banner .store-switch select option:checked { color: #fff !important; background-color: #318BF7 !important; -webkit-text-fill-color: #fff; }
.done-record { align-items: flex-start; }


.status-pill.status-suspended { background: #f3e8e8; color: #8a1f1f; }
.page-sec .muted { display: block; margin-top: 8px; }


/* Wave 5 */
.is-locked, input.is-locked, textarea.is-locked {
  background: #f3f5f8;
  color: #445;
  cursor: not-allowed;
}
.lock-banner { margin: 0 0 12px; padding: 8px 12px; background: #eef5ff; border-radius: 8px; }
.lock-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.lock-grid .chk { display: flex; gap: 8px; align-items: center; font-size: 14px; }

/* iOS Safari zooms the page when a focused field is under 16px. */
@media (max-width: 640px) {
  input, textarea, select, .helper-input { font-size: 16px; }
  .otp-input { font-size: 1.35rem; }
}

/* Comfortable tap targets for the top bar and inline link rows on phones. */
@media (max-width: 640px) {
  .topbar a, .links-row a { display: inline-block; min-height: 32px; line-height: 32px; }
}

/* AI nearby comparison — desktop-only feature */
.desktop-only { display: block; }
.mobile-only-block { display: none; }
.compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.compare-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  cursor: pointer;
}
.compare-card.is-selected {
  border-color: var(--brand);
  box-shadow: var(--focus);
  background: var(--card-hover);
}
.compare-card input.compare-check { align-self: flex-start; }
.compare-photo {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 10px;
  background: var(--brand-soft);
}
.compare-photo-empty { min-height: 120px; }
.compare-page .data-table { width: 100%; border-collapse: collapse; }
.compare-page .data-table th,
.compare-page .data-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}
.compare-page .data-table tr.is-self td { background: var(--ok-soft); font-weight: 600; }

@media (max-width: 899px) {
  .desktop-only,
  a.desktop-only { display: none !important; }
  .mobile-only-block { display: block; }
}

/* Metric explanation links (Hikaru: plain-language help for ①–⑤) */
.metric-explain {
  display: inline-block;
  margin-left: 6px;
  vertical-align: middle;
  position: relative;
  font-weight: 600;
}
.metric-explain.inline { margin-left: 8px; }
.metric-explain > summary {
  list-style: none;
  cursor: pointer;
  color: #1a5fb4;
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  display: inline;
}
.metric-explain > summary::-webkit-details-marker { display: none; }
.metric-explain > summary::before { content: none; }
.metric-explain-body {
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f3f6fb;
  border: 1px solid #d7e0ee;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.45;
  max-width: 28rem;
  text-align: left;
}
.metric-explain-body p {
  margin: 0;
}
.metric-explain-body p + p {
  margin-top: 0.65em;
}
th .metric-explain {
  display: block;
  margin: 4px 0 0;
}
th .metric-explain-body {
  position: absolute;
  z-index: 5;
  min-width: 14rem;
  max-width: 18rem;
  font-weight: 500;
  box-shadow: 0 6px 18px rgba(67, 66, 93, 0.12);
}
.score-card .lbl .metric-explain {
  display: block;
  margin: 4px 0 0;
}
.score-card .lbl .metric-explain-body {
  max-width: none;
}
h2 .metric-explain > summary { font-size: 0.8rem; }

#page-editor.is-ai-checking #page-publish-status {
  display: block;
  margin: 8px 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: #e8f2ff;
  border: 1px solid rgba(49, 139, 247, 0.35);
  color: #0b5cad;
  font-weight: 700;
}
#page-editor.is-ai-checking #page-ai-check-btn {
  min-width: 0;
}

/* ── Impact tracking (chips + chart markers) ── */
.score-chart-wrap {
  position: relative;
}
.impact-markers {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 10px;
  pointer-events: none;
}
.impact-marker {
  position: absolute;
  bottom: 0;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  border-radius: 50%;
  background: var(--brand-deep);
  border: 1.5px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
  pointer-events: auto;
  cursor: default;
}
.impact-marker[data-marked-at] {
  display: none;
}
.impact-marker:focus-visible {
  outline: 2px solid var(--task);
  outline-offset: 2px;
}
.impact-chip {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  vertical-align: middle;
}
.impact-chip.measuring {
  background: #eceff1;
  color: #37474f;
}
.impact-chip.improved {
  background: #e8f5e9;
  color: #1b5e20;
  border-color: rgba(27, 94, 32, 0.22);
}
.impact-chip.no_change {
  background: #f5f5f5;
  color: #424242;
  border-color: var(--line);
}
.impact-chip.declined {
  background: #ffebee;
  color: #b71c1c;
  border-color: rgba(183, 28, 28, 0.22);
}
.impact-chip.inconclusive {
  background: #fafafa;
  color: #616161;
  border-color: var(--line);
}


/* HQ audit UX fixes */
input[type="checkbox"] {
  width: auto !important;
  min-width: 18px;
  height: 18px;
  padding: 0 !important;
  margin: 0;
  flex: 0 0 auto;
}
.lock-grid .chk {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.lock-grid .chk input[type="checkbox"] {
  margin-top: 0;
}
.btn.is-busy,
.btn[disabled][aria-disabled="true"] {
  opacity: 0.65;
  cursor: not-allowed;
}
.btn.is-busy::after {
  content: "";
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  margin-left: 0.5em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -0.1em;
  animation: canly-spin 0.7s linear infinite;
}
@keyframes canly-spin { to { transform: rotate(360deg); } }

/* store /done visibility run button — responsive */
#vis-run-box {
  margin-top: 12px;
  margin-bottom: 8px;
}
#vis-run-box .btn,
#vis-run-box .btn-vis-run {
  width: 100%;
  min-height: 44px;
  justify-content: center;
  box-sizing: border-box;
}
#vis-run-box .muted.tiny {
  margin-top: 8px;
  line-height: 1.4;
}
.vis-simple-score { margin-top: 8px; }
@media (max-width: 1100px) {
  .score-grid-report {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 899px) {
  .score-grid {
    grid-template-columns: 1fr;
  }
  .score-grid-report {
    grid-template-columns: 1fr;
  }
  .score-card-dual .dual-score-row {
    grid-template-columns: 1fr 1fr;
  }
  .status-grid-3 {
    grid-template-columns: 1fr;
  }
  #vis-run-box {
    margin-bottom: 20px;
  }
}
/* store wrap bottom pad: see mobile audit block (max-width 767) */
@media (min-width: 900px) {
  #vis-run-box .btn,
  #vis-run-box .btn-vis-run {
    width: auto;
    min-width: 180px;
  }
}

/* ux-copy-scores-distinction */
.scores-distinction{margin:8px 2px 0;line-height:1.45}

/* AI check in progress — visible banner; do NOT block nav/sidebar */
.page-ai-check-banner {
  position: sticky;
  top: 0;
  z-index: 90;
  margin: 0;
  padding: 10px 14px;
  background: #e8f2ff;
  border-bottom: 1px solid rgba(49, 139, 247, 0.45);
  color: #0b5cad;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
}
.page-ai-check-banner[hidden] { display: none !important; }
body.is-ai-checking-page .nav a,
body.is-ai-checking-page .topbar a {
  pointer-events: auto;
}

/* HQ Action needed — polished Yes/No confirm (JA/EN) */
.hq-confirm-dialog {
  border: 0;
  outline: none;
  padding: 0;
  margin: auto;
  width: min(400px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  color: var(--ink);
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(67, 66, 93, 0.22), 0 0 0 1px var(--line);
}
.hq-confirm-dialog::backdrop {
  background: rgba(67, 66, 93, 0.42);
  backdrop-filter: blur(2px);
}
.hq-confirm-inner {
  margin: 0;
  padding: 22px 22px 18px;
  border-top: 3px solid var(--brand);
  border-radius: inherit;
}
.hq-confirm-title {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand-deep);
}
.hq-confirm-msg {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.45;
  color: var(--ink);
}
.hq-confirm-note {
  margin: 8px 0 0;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.45;
  color: #5b6578;
}
.hq-confirm-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: stretch;
  align-items: stretch;
  gap: 16px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.hq-confirm-dialog .hq-confirm-btn.btn,
.hq-confirm-dialog .hq-confirm-btn.btn-ghost,
.hq-confirm-dialog .hq-confirm-btn.btn-primary {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex: 1 1 0;
  width: auto !important;
  min-width: 0;
  max-width: none !important;
  min-height: 44px;
  margin: 0 !important;
  margin-top: 0 !important;
  padding: 11px 20px;
  font-size: 0.95rem;
  box-sizing: border-box;
}
.hq-confirm-dialog .hq-confirm-btn.btn-ghost {
  margin-top: 0 !important;
}

/* HQ Manual */
.manual-hero h1 { margin: 0 0 8px; }
.manual-toc { margin-top: 14px; }
.manual-toc-title {
  display: block;
  margin-bottom: 12px;
  font-size: 0.95rem;
}
.manual-toc-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}
@media (min-width: 720px) {
  .manual-toc-list {
    grid-template-columns: 1fr 1fr;
    gap: 8px 20px;
  }
}
/* Store manual: column 1 = 1..n/2 down, column 2 = rest (not zigzag 1,3,5 / 2,4,6). */
.manual-toc-list.store-toc-cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}
@media (min-width: 720px) {
  .manual-toc-list.store-toc-cols {
    grid-template-columns: 1fr 1fr;
    gap: 8px 20px;
  }
}
.manual-toc-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.manual-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
}
.manual-toc-link {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  font-weight: 650;
  line-height: 1.35;
  border: 1px solid transparent;
}
.manual-toc-link:hover {
  background: var(--task-soft);
  border-color: var(--line);
}
.manual-toc-num {
  flex: 0 0 auto;
  min-width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.manual-toc-label { min-width: 0; }

.manual-section { margin-top: 14px; scroll-margin-top: 18px; }
.manual-section h2 { margin: 0 0 8px; }
.manual-figure {
  margin: 14px 0 10px;
  padding: 0;
}
.manual-figure img {
  display: block;
  width: 100%;
  max-width: 960px;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.manual-figure figcaption { margin-top: 6px; }

.manual-legend {
  margin: 14px 0 0;
  display: grid;
  gap: 12px;
}
.manual-legend-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
/* Screen-description numbers: rounded squares (TOC numbers stay circles). */
.manual-legend-num {
  flex: 0 0 auto;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 6px;
  background: #fff;
  color: var(--brand);
  border: 2px solid var(--brand);
  font-size: 0.85rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  box-sizing: border-box;
}
.manual-legend-body { min-width: 0; }
.manual-legend-body strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.98rem;
}
.manual-legend-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

/* Store list bulk buttons when nothing selected */
#bulk-stores-form .btn.is-disabled,
#bulk-stores-form .btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
  box-shadow: none;
  pointer-events: auto;
}
#bulk-select-hint { margin-top: 6px; }

/* Manual nav light-bulb icon (HQ + Store) — solid yellow */
.nav-manual-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25em;
  height: 1.25em;
  margin-right: 0.4em;
  vertical-align: -0.22em;
  flex: 0 0 auto;
  line-height: 0;
}
.nav-manual-ico svg {
  width: 1.25em;
  height: 1.25em;
  display: block;
}
.hq-nav a.on .nav-manual-ico path,
.nav a.active .nav-manual-ico path {
  fill: #FFD84D;
}

/* Store Completed: use full content column on desktop (Public page stays narrow) */
@media (min-width: 768px) {
  body.wide:has(> .nav) > .wrap {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 28px 40px 48px;
  }
}

/* ===== AIOSky mobile UI audit fix (2026-08-12) =====
   Bottom nav is phone-only (<768). Desktop sidebar starts at 768.
*/
:root {
  --store-nav-h: 64px;
  --hq-nav-h: 148px;
  --page-actionbar-h: 120px;
}

html,
body {
  overflow-x: clip;
}

/* Phone / small tablet portrait: fixed bottom nav */
@media (max-width: 767px) {
  :root {
    --store-nav-h: 84px; /* 5 store tabs; AI page uses short label */
    --hq-nav-h: 220px; /* 7 links → 4 rows */
    --page-actionbar-h: 150px;
  }

  /* Store: Home / AI page / Tasks / Report / Status — 5 columns. */
  .nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 6px 4px calc(8px + env(safe-area-inset-bottom, 0px));
    gap: 2px;
  }
  .nav .nav-full { display: none; }
  .nav .nav-short { display: inline; }
  .nav a {
    flex-direction: column;
    gap: 0;
    font-size: 0.58rem;
    line-height: 1.2;
    padding: 6px 2px;
    min-height: 52px;
    letter-spacing: 0;
    white-space: normal;
    text-wrap: balance;
    overflow-wrap: anywhere;
    word-break: break-word;
    min-width: 0;
  }
  .nav-manual-ico {
    width: 1.05em;
    height: 1.05em;
    margin-right: 0;
    margin-bottom: 1px;
    vertical-align: 0;
  }
  .nav-manual-ico svg {
    width: 1.05em;
    height: 1.05em;
  }

  /* HQ bottom bar: tighter labels for 3-row grid */
  .hq-nav a {
    font-size: 0.62rem;
    padding: 8px 2px;
    min-height: 46px;
    line-height: 1.15;
  }
  .hq-nav .nav-manual-ico {
    width: 0.95em;
    height: 0.95em;
    margin-right: 0.15em;
  }
  body.hq-shell .wrap {
    padding-bottom: calc(var(--hq-nav-h) + env(safe-area-inset-bottom, 0px));
  }

  /* Content clearance above store bottom nav
     (overrides older 132px rule; page editor needs more) */
  body:has(> .nav) .wrap {
    padding-bottom: calc(var(--store-nav-h) + 56px + env(safe-area-inset-bottom, 0px)) !important;
  }
  body.page-editor-body:has(> .nav) .wrap {
    padding-bottom: calc(
      var(--store-nav-h) + var(--page-actionbar-h) + 28px + env(safe-area-inset-bottom, 0px)
    ) !important;
  }

  .page-actionbar {
    bottom: calc(var(--store-nav-h) + env(safe-area-inset-bottom, 0px));
  }

  body:has(> .nav) .canly-helper {
    bottom: calc(var(--store-nav-h) + 14px + env(safe-area-inset-bottom, 0px));
  }
  body:has(> .hq-nav) .canly-helper {
    bottom: calc(var(--hq-nav-h) + 14px + env(safe-area-inset-bottom, 0px));
  }

  .page-actionbar-btns {
    grid-template-columns: 1fr 1fr;
    max-width: none;
  }
  .page-actionbar-btns .btn-primary {
    grid-column: 1 / -1;
  }

  .help-shell {
    max-height: calc(100dvh - 96px - var(--store-nav-h) - env(safe-area-inset-bottom, 0px));
    min-height: min(52vh, 420px);
  }

  .hq-table {
    min-width: 0;
  }
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .hq-row-menu-panel {
    left: auto;
    right: 0;
    transform: none;
  }

  .manual-section:last-child {
    margin-bottom: 16px;
  }

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

@media (max-width: 560px) {
  :root {
    --page-actionbar-h: 172px;
  }
  .page-actionbar-btns {
    grid-template-columns: 1fr;
  }
  .page-actionbar-btns .btn-primary {
    grid-column: auto;
    order: -1;
  }
  .page-actionbar-btns-4 {
    grid-template-columns: 1fr 1fr;
  }
  .page-actionbar-btns-4 .btn-primary {
    grid-column: auto;
    order: 0;
  }
  .page-actionbar-hint {
    font-size: 0.68rem;
    text-align: left;
  }
  .hq-metrics {
    grid-template-columns: 1fr 1fr;
  }
}
/* ===== AIOSky mobile UI audit v2 (2026-08-12) =====
   Store + HQ phone layout: topbar, hero, page actionbar, FAB, HQ table/nav.
*/

@media (max-width: 767px) {
  :root {
    --store-nav-h: 84px;
    --hq-nav-h: 168px;
    --page-actionbar-h: 168px;
  }

  /* —— Top bar: logo on row 1, actions wrap on row 2 (HQ dual-role + account + logout) —— */
  .topbar {
    gap: 8px 10px;
    margin-bottom: 12px;
    padding: 6px 0 10px;
    flex-wrap: wrap;
    align-items: center;
  }
  .brand-logo {
    height: 24px;
    min-width: 60px;
  }
  .brand-logo-ruby { height: 36px; }
  .brand-text {
    font-size: 0.62rem;
    padding: 3px 7px;
  }
  .top-actions {
    flex: 1 1 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px 12px;
    min-width: 0;
  }
  .top-link {
    font-size: 0.78rem;
    white-space: nowrap;
    min-height: 44px;
    padding: 8px 4px;
    display: inline-flex;
    align-items: center;
  }
  .top-actions > a.top-link[href*="explore"] {
    display: none;
  }
  .lang-switch a {
    padding: 8px 10px;
    font-size: 0.72rem;
    min-height: 44px;
  }
  .dual-role-switch {
    gap: 10px;
  }

  /* —— Heroes: less vertical bulk so first task CTAs clear nav —— */
  .hero-banner {
    padding: 14px 14px 12px;
    margin-bottom: 12px;
  }
  .hero-banner h1 {
    font-size: 1.22rem;
  }
  .hero-banner p {
    font-size: 0.86rem;
    margin-top: 4px;
  }
  .store-chip {
    margin-bottom: 6px;
    font-size: 0.7rem;
    padding: 3px 10px;
  }
  .page-hero.hero-banner h1 {
    font-size: 1.18rem;
  }

  /* —— Task cards —— */
  .card.task-card {
    padding: 14px 14px 16px;
    margin-bottom: 18px;
  }
  .task-card .task-copy h2 {
    font-size: 1.02rem;
  }
  .task-card-actions {
    margin-top: 12px;
    margin-bottom: 4px;
  }
  .task-card-actions .btn,
  .task-card-actions .btn-ghost,
  .task-card-actions .btn-primary {
    min-height: 40px;
    padding: 8px 12px;
  }

  /* Content clearance */
  body:has(> .nav) .wrap {
    padding-bottom: calc(var(--store-nav-h) + 88px + env(safe-area-inset-bottom, 0px)) !important;
  }
  body.page-editor-body:has(> .nav) .wrap {
    padding-bottom: calc(
      var(--store-nav-h) + var(--page-actionbar-h) + 36px + env(safe-area-inset-bottom, 0px)
    ) !important;
  }
  body.hq-shell .wrap {
    padding-bottom: calc(var(--hq-nav-h) + 24px + env(safe-area-inset-bottom, 0px));
  }

  /* —— Page editor actionbar: shrink hint + buttons —— */
  .page-actionbar {
    bottom: calc(var(--store-nav-h) + env(safe-area-inset-bottom, 0px));
    padding: 6px 10px 8px;
  }
  .page-actionbar-hint {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    font-size: 0.64rem;
    line-height: 1.35;
    margin: 0 0 4px;
    text-align: left;
  }
  .page-autosave-status,
  .page-publish-status {
    font-size: 0.68rem;
    margin: 0 0 4px;
    min-height: 0;
  }
  .page-actionbar-btns {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .page-actionbar-btns .btn-primary {
    order: -1;
    grid-column: auto;
  }
  .page-actionbar .btn,
  .page-actionbar .btn-ghost,
  .page-actionbar .btn-ai-check,
  .page-actionbar .btn-primary {
    min-height: 40px;
    padding: 8px 10px;
    font-size: 0.82rem;
  }

  /* FAB above nav; on page editor above actionbar; keep clear of CTAs */
  body:has(> .nav) .canly-helper {
    bottom: calc(var(--store-nav-h) + 12px + env(safe-area-inset-bottom, 0px));
  }
  body.page-editor-body:has(> .nav) .canly-helper {
    bottom: calc(
      var(--store-nav-h) + var(--page-actionbar-h) + 10px + env(safe-area-inset-bottom, 0px)
    );
  }
  body:has(> .hq-nav) .canly-helper {
    bottom: calc(var(--hq-nav-h) + 10px + env(safe-area-inset-bottom, 0px));
  }

  /* —— HQ bottom nav: 3×3 (was 4+4+1 orphan) —— */
  .hq-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 4px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    gap: 2px;
  }
  .hq-nav a {
    font-size: 0.6rem;
    padding: 7px 2px;
    min-height: 44px;
    line-height: 1.15;
  }

  /* —— HQ store list table: keep Actions on-screen ——
     cols: 1 select, 2 store, 3 owner, 4 aio, 5 vis, 6 page, 7 issues, 8 actions */
  #stores .hq-table th:nth-child(3),
  #stores .hq-table td:nth-child(3),
  #stores .hq-table th:nth-child(5),
  #stores .hq-table td:nth-child(5),
  #stores .hq-table th:nth-child(6),
  #stores .hq-table td:nth-child(6),
  #stores .hq-table th:nth-child(7),
  #stores .hq-table td:nth-child(7) {
    display: none;
  }
  #stores .hq-table {
    min-width: 0;
    width: 100%;
  }
  #stores .hq-table th,
  #stores .hq-table td {
    padding: 8px 6px;
    font-size: 0.78rem;
  }
  #stores .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -4px;
    padding: 0 4px;
  }

  /* Bulk actions stack cleanly */
  #stores .queue-actions,
  #bulk-actions-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  #stores .queue-actions .btn,
  #bulk-actions-row .btn {
    width: 100%;
  }

  .hq-metrics {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .hq-metric {
    padding: 12px 10px;
  }

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

  .nav a {
    font-size: 0.72rem;
    padding: 8px 6px;
    min-height: 56px;
  }
}

@media (max-width: 560px) {
  :root {
    --page-actionbar-h: 176px;
  }
}


/* ===== AIOSky mobile UI audit v2b ===== */
@media (max-width: 767px) {
  :root {
    --page-actionbar-h: 128px;
  }

  html {
    scroll-padding-bottom: calc(var(--store-nav-h) + 24px);
  }
  body.page-editor-body {
    scroll-padding-bottom: calc(var(--store-nav-h) + var(--page-actionbar-h) + 24px);
  }
  body.hq-shell {
    scroll-padding-bottom: calc(var(--hq-nav-h) + 24px);
  }

  /* Publish on top, Save + AI check side by side */
  .page-actionbar-btns {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .page-actionbar-btns .btn-primary {
    grid-column: 1 / -1;
    order: -1;
  }
  body.page-editor-body {
    --page-actionbar-h: 168px;
  }
  body.page-editor-body .page-actionbar-btns-4 {
    grid-template-columns: 1fr 1fr;
  }
  body.page-editor-body .page-actionbar-btns-4 .btn-primary {
    grid-column: auto;
    order: 0;
  }

  .pack-confirm {
    margin-bottom: calc(var(--page-actionbar-h) + 12px);
  }

  #vis-run-box {
    margin-bottom: 40px;
  }
  #vis-run-box .btn-vis-run,
  #vis-run-box .btn {
    margin-bottom: 10px;
  }
  .task-card-actions,
  #vis-run-box .btn-vis-run {
    scroll-margin-bottom: calc(var(--store-nav-h) + 20px);
  }
}
@media (max-width: 560px) {
  :root {
    --page-actionbar-h: 132px;
  }
}

/* ===== AIOSky mobile UI audit v2c =====
   Pack-confirm + done visibility card clearance; tighter page hero.
*/
@media (max-width: 767px) {
  /* Page hero still tall (URL + status + switcher) — compress hard */
  .page-hero.hero-banner {
    padding: 12px 12px 10px;
  }
  .page-hero.hero-banner > p.muted,
  .page-hero.hero-banner > p.muted.tiny {
    display: none;
  }
  .page-hero.hero-banner > p {
    font-size: 0.8rem;
    margin-top: 4px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }
  .page-live-card {
    padding: 8px 10px;
    margin-bottom: 8px;
  }
  .page-live-card .page-live-url {
    font-size: 0.72rem;
    margin: 0;
  }
  .page-toc {
    margin-bottom: 8px;
  }
  .page-toc-links {
    gap: 4px;
  }
  .page-toc-links a {
    font-size: 0.68rem;
    padding: 4px 8px;
  }

  /* While industry-pack confirm is open, hide publish bar (not needed yet) */
  body.page-editor-body:has(.pack-confirm) .page-actionbar {
    display: none !important;
  }
  body.page-editor-body:has(.pack-confirm) .wrap {
    padding-bottom: calc(var(--store-nav-h) + 72px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .pack-confirm {
    padding: 12px 12px 14px;
    margin: 8px 0 16px;
  }
  .pack-confirm > .muted.tiny {
    display: none;
  }
  .pack-confirm h3 {
    font-size: 0.98rem;
    margin-bottom: 4px;
  }
  .pack-confirm > .muted {
    font-size: 0.82rem;
    margin-bottom: 8px;
  }

  /* Done: trim visibility card copy so Update CTA clears nav */
  .score-card[data-metric="visibility"] > p.muted.tiny {
    display: none;
  }
  .score-card[data-metric="visibility"] > p.muted.mt6 {
    display: none;
  }
  .score-card[data-metric="visibility"] > p.muted.mt6:first-of-type {
    display: block;
    font-size: 0.78rem;
  }
  .score-card {
    padding: 14px 12px;
  }
  .score-card .num {
    font-size: 2rem;
  }

  /* Slightly tighter topbar (still 2 rows for dual-role users) */
  .topbar {
    margin-bottom: 10px;
    padding: 4px 0 8px;
  }
}

/* HQ visibility measure progress */
.hq-vis-progress {
  margin: 12px 0 14px;
  padding: 12px 14px;
  border: 1px solid rgba(49, 139, 247, 0.28);
  border-radius: var(--radius, 12px);
  background: #f3f8ff;
}
.hq-vis-progress-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}
.hq-vis-progress-title { font-size: 0.95rem; }
.hq-vis-progress-help {
  margin: 0 0 10px;
  line-height: 1.45;
  max-width: 52rem;
}
.hq-vis-progress-track {
  height: 8px;
  background: #e8eef5;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}
.hq-vis-progress-fill {
  height: 100%;
  width: 8%;
  background: #318BF7;
  border-radius: 999px;
  transition: width 0.4s ease;
}
.hq-vis-progress-tick {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 700;
  color: #0b5cad;
}
.hq-vis-measuring {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  font-weight: 700;
  color: #0b5cad;
}
.hq-vis-measuring-clock { font-variant-numeric: tabular-nums; }

/* HQ visibility score link + evidence */
a.hq-vis-score-link {
  font-weight: 800;
  color: var(--brand-deep, #0b5cad);
  text-decoration: underline;
  text-underline-offset: 2px;
}
a.hq-vis-score-link:hover { color: var(--brand, #318BF7); }
.hq-vis-evidence { display: flex; flex-direction: column; gap: 10px; }
.hq-vis-ev-row {
  border: 1px solid var(--line, #e5e9f0);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
}
.hq-vis-ev-row.hit { border-color: rgba(13, 159, 110, 0.35); background: #f3fbf7; }
.hq-vis-ev-row.miss { border-color: rgba(224, 72, 86, 0.22); background: #fff8f8; }
.hq-vis-ev-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.hq-vis-ev-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: #334155;
}
.hq-vis-ev-row.hit .hq-vis-ev-badge { background: #d9f5e9; color: #0b7a4b; }
.hq-vis-ev-row.miss .hq-vis-ev-badge { background: #fde4e7; color: #b42332; }
.hq-vis-ev-q { margin: 0 0 6px; font-weight: 650; line-height: 1.4; }
.hq-vis-ev-ex { margin: 0; line-height: 1.45; word-break: break-word; }

/* Visibility attention badges / callouts */
.hq-vis-badge {
  margin-top: 4px;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.2;
}
.hq-vis-badge.awaiting { color: #0b5cad; }
.hq-vis-badge.attention { color: #b42332; }
.vis-attention-callout {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.84rem;
  line-height: 1.45;
  font-weight: 600;
}
.vis-attention-callout.awaiting {
  background: #eef6ff;
  border: 1px solid rgba(49, 139, 247, 0.28);
  color: #0b5cad;
}
.vis-attention-callout.attention {
  background: #fff5f5;
  border: 1px solid rgba(224, 72, 86, 0.28);
  color: #9b1c1c;
}
@media (max-width: 767px) {
  .score-card[data-metric="visibility"] .vis-attention-callout {
    display: block;
  }
}


/* ===== AIOSky full audit clearance 2026-08-12 ===== */
@media (max-width: 767px) {
  body:has(> .nav) .wrap {
    padding-bottom: calc(var(--store-nav-h) + 88px + env(safe-area-inset-bottom, 0px)) !important;
  }
}


/* ===== AIOSky P2 fold clearance 2026-08-12 =====
   Mid-scroll task/done CTAs can land under the fixed bottom nav.
   Stronger scroll-padding/margins + card spacing; JS clears on focus/pointer.
*/
@media (max-width: 767px) {
  html {
    scroll-padding-bottom: calc(var(--store-nav-h) + 72px + env(safe-area-inset-bottom, 0px));
  }
  body.hq-shell {
    scroll-padding-bottom: calc(var(--hq-nav-h) + 48px + env(safe-area-inset-bottom, 0px));
  }
  body.page-editor-body {
    scroll-padding-bottom: calc(
      var(--store-nav-h) + var(--page-actionbar-h) + 48px + env(safe-area-inset-bottom, 0px)
    );
  }

  .card.task-card {
    scroll-margin-bottom: calc(var(--store-nav-h) + 28px);
    margin-bottom: 14px;
  }
  .task-card-actions,
  .task-card-actions .btn,
  .task-card-actions .btn-primary,
  #vis-run-box,
  #vis-run-box .btn-vis-run,
  #vis-run-box .btn {
    scroll-margin-bottom: calc(var(--store-nav-h) + 28px);
  }

  body:has(> .nav) .wrap {
    padding-bottom: calc(var(--store-nav-h) + 96px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

.img-upload{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:6px 0 8px;padding:10px;border:1px dashed #c5d4e8;border-radius:8px;background:#f7fbff}
.img-upload.on{border-color:#318BF7;background:#eef7ff}
.img-upload .bad{color:#b42318}

.cov-list{margin:0;padding-left:0;list-style:none}
.cov-q{display:flex;gap:8px;align-items:flex-start;margin:6px 0;font-size:13px;line-height:1.45}
.cov-mark{flex:0 0 1.2em;font-weight:700}
.cov-ok .cov-mark{color:#1a7f37}
.cov-thin .cov-mark{color:#b45309}
.cov-missing .cov-mark{color:#b42318}
#gap-confirm textarea{min-height:88px}

/* Gallery caption: short field, visible limit */
body.page-editor-body #page-editor textarea.gal-cap { min-height: 72px; }
.char-count { text-align: right; margin: 0 0 10px; }
.char-count.is-max { color: #b45309; font-weight: 600; }

/* split-score-charts-20260816 */
.score-chart-card .score-chart {
  max-width: 560px;
}
.score-chart-block {
  margin-top: 16px;
}
.score-chart-block:first-of-type {
  margin-top: 8px;
}
.score-chart-block h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--ink);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.score-chart-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}
.score-chart-swatch.readiness { background: #12a06a; }
.score-chart-swatch.visibility { background: #318BF7; }
.score-chart-scale {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}
.score-chart-dates {
  margin: 4px 0 0;
}
.score-chart-wrap {
  overflow: visible;
}
.score-chart-card .score-chart {
  overflow: visible;
}
.score-chart-label {
  font-size: 9px;
  fill: #6b7280;
}
.score-chart-dot {
  stroke: #fff;
  stroke-width: 1.2;
}
.score-chart-dot.readiness { fill: #12a06a; }
.score-chart-dot.visibility { fill: #318BF7; }

.bot-hit-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 14px;
}
.bot-hit-table th,
.bot-hit-table td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line, #e5e7eb);
}
.bot-hit-table th { color: var(--muted, #6b7280); font-weight: 600; }
.fill-missing-list { margin-top: 8px; }
.score-card-dual .lbl a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

.form-wait-banner {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm, 12px);
  background: #e8f2ff;
  border: 1px solid #9cc4f5;
  color: #0b3d7a;
  font-weight: 700;
  line-height: 1.45;
}
.form-wait-banner[hidden] { display: none !important; }
.quota-out-banner { margin-top: 10px; }

.home-prepublish { padding-top: 14px; }
.home-status-title {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.home-stat {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.4;
}
.home-stat-mark {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  flex-shrink: 0;
}
.home-stat-label { flex: 1; }
.home-stat-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.home-stat-ok { color: #1a7f4b; }
.home-stat-ok .home-stat-mark { background: #e5f6ec; color: #1a7f4b; }
.home-stat-miss { color: #b0343d; }
.home-stat-miss .home-stat-mark { background: #fde8ea; color: #b0343d; }
.home-prepublish .btn { width: 100%; }
.home-preview-link {
  display: block;
  text-align: center;
  margin: 12px 0 0;
  font-weight: 700;
  font-size: 14px;
}
.home-lock-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #f4f6f8;
  color: var(--muted);
}
.home-lock-note p { margin: 0; font-size: 13px; font-weight: 600; line-height: 1.45; }
.home-lock-icon { font-size: 16px; line-height: 1.4; }

body.page-editor-body .card {
  box-shadow: none;
  border-color: #e6edf5;
}
body.page-editor-body .page-sec {
  border-color: #e6edf5;
}
.page-review { position: relative; padding-top: 20px; }
.page-edit-tips {
  position: absolute;
  top: 16px;
  right: 18px;
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
}
.page-steps { margin: 8px 0 22px; padding: 0; }
.page-steps h2 { margin-bottom: 4px; }
.page-steps-list {
  list-style: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
}
.page-steps-list li {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
  text-align: center;
}
.page-step-n {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef2f6;
  color: #43425D;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}
.page-steps-list li.on { color: var(--ink); }
.page-steps-list li.on .page-step-n {
  background: var(--brand);
  color: #fff;
}
.page-review-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
}
.page-review-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid #eef2f6;
}
.page-review-row:last-child { border-bottom: 0; }
.page-review-copy { min-width: 0; flex: 1; }
.page-review-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 4px;
}
.page-review-value {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.45;
  word-break: break-word;
}
.page-review-row.is-empty .page-review-value { color: var(--muted); font-weight: 600; }
.page-review-confirm {
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 800;
  color: var(--brand);
  white-space: nowrap;
  padding-top: 16px;
}
.page-publish-this { margin-top: 18px; }
form.js-busy-form.is-busy button[type="submit"],
form.js-busy-form.is-busy button:not([type]) {
  cursor: wait;
  opacity: 0.88;
}

.page-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}
@media (max-width: 767px) {
  /* 4 HQ pills → 2×2. 3 store /more pills stay a single row. */
  .page-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  #more-tabs.page-tabs {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .page-tab {
    justify-content: center;
    text-align: center;
    white-space: normal;
    line-height: 1.25;
    min-height: 44px;
    padding: 8px 10px;
  }
}
.page-tab {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.page-tab.on {
  border-color: rgba(49, 139, 247, 0.75);
  background: var(--task-soft);
  color: var(--brand);
}
.more-count {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.more-task-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--task-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  vertical-align: middle;
}
.account-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.account-help-link {
  font-size: 13px;
  font-weight: 700;
}
.account-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #eef2f6;
}
.account-row-copy { min-width: 0; flex: 1; }
.account-row-copy strong { display: block; margin-top: 2px; }
.account-lock-badge {
  flex-shrink: 0;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef2f6;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.done-metrics {
  margin: 0 0 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}
.done-metrics-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 800;
}
.done-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.done-metric-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.done-metric-num {
  display: block;
  margin-top: 4px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.done-compact .done-long-copy { display: none; }
.hq-metric-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-bottom: 6px;
  border-radius: 6px;
  background: var(--task-soft);
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
}
.hq-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 8px;
}
.hq-toolbar input[type="search"],
.hq-toolbar select {
  min-width: 0;
  flex: 1 1 180px;
}
.hq-status-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2f6;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.hq-status-live { background: #e7f6ee; color: #1b7a45; }
.hq-status-draft,
.hq-status-not_generated { background: #eef2f6; color: var(--muted); }
.hq-status-awaiting_hq,
.hq-status-update_required { background: #fff4dc; color: #8a5a10; }
.hq-status-archived { background: #f3eef8; color: #5b4a78; }
.hq-kebab-btn.hq-row-menu-btn::after { display: none; }
.hq-kebab {
  display: inline-block;
  width: 1.1em;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}
@media (max-width: 640px) {
  .done-metrics-grid { grid-template-columns: 1fr; }
  .done-metrics.home-glance .home-glance-grid { grid-template-columns: repeat(3, 1fr); }
  .done-metrics.home-glance .done-metric-num { font-size: 16px; }
}
.manual-info-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid rgba(49, 139, 247, 0.28);
  border-radius: 10px;
  background: var(--task-soft);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
}
.manual-info-note::before {
  content: "i";
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
}
.manual-toc-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.manual-toc-tiles .manual-toc-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  text-decoration: none;
  color: inherit;
}
.manual-toc-tiles .manual-toc-link::after {
  content: "›";
  margin-left: auto;
  color: var(--brand);
  font-size: 18px;
  font-weight: 800;
}
.hq-faq-acc {
  border-bottom: 1px solid #eef2f6;
  padding: 8px 0;
}
.hq-faq-acc > summary {
  cursor: pointer;
  font-weight: 700;
}
.hq-edit-fold > summary {
  cursor: pointer;
  list-style: none;
}
.hq-edit-fold > summary::-webkit-details-marker { display: none; }
.hq-edit-fold > summary h2 { display: inline; }
#hq-store-metrics .done-metrics-grid { grid-template-columns: repeat(4, 1fr); }
.hq-more-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.hq-more-grid a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  color: inherit;
}
.hq-more-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 10px;
  background: var(--task-soft);
}
.hq-count-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e7f6ee;
  color: #1b7a45;
  font-size: 12px;
  font-weight: 800;
}
.hq-count-warn { background: #fff4dc; color: #8a5a10; }
.hq-csv-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 12px 0;
}
.hq-csv-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 12px;
}
.hq-csv-specs span {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--task-soft);
  font-size: 12px;
  font-weight: 700;
}
.hq-csv-drop {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.hq-csv-drop.is-over { border-color: var(--brand); background: var(--task-soft); }
.hq-csv-upload { width: 100%; }
.hq-alert-kpis { margin: 10px 0 14px; }
.hq-domain-ok { padding: 10px 12px; border-radius: 10px; background: #e7f6ee; }
.hq-report-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.hq-bar-row { display: flex; align-items: center; gap: 8px; }
.hq-bar {
  display: inline-block;
  width: 72px;
  height: 8px;
  background: #e8eef5;
  border-radius: 999px;
  overflow: hidden;
  vertical-align: middle;
}
.hq-bar i { display: block; height: 100%; max-width: 100%; border-radius: 999px; }
.hq-bar-blue i { background: #318BF7; }
.hq-bar-green i { background: #2a9d5c; }
.hq-bar-orange i { background: #e08a1a; }
.hq-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
}
.hq-pager-nav { display: flex; gap: 6px; }
.hq-brand-list { display: flex; flex-direction: column; gap: 10px; }
.hq-brand-card {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.hq-brand-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--task-soft);
  color: var(--brand);
  font-weight: 800;
}
.hq-brand-stats {
  display: flex;
  gap: 14px;
  margin: 0;
}
.hq-brand-stats div { margin: 0; }
.hq-brand-stats dt { font-size: 11px; color: var(--muted); }
.hq-brand-stats dd { margin: 2px 0 0; font-weight: 800; }
.hq-host-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.hq-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2f6;
  font-size: 12px;
  font-weight: 700;
}
.hq-chip-x { border: 0; cursor: pointer; }
.hq-chip-req { background: var(--task-soft); color: var(--brand); }
.hq-csv-checks { margin: 10px 0 0; padding-left: 0; list-style: none; }
.hq-csv-checks li { padding: 4px 0 4px 22px; position: relative; }
.hq-csv-checks li::before { content: "✓"; position: absolute; left: 0; color: #1b7a45; font-weight: 800; }
.hq-csv-after { margin-top: 16px; padding: 12px; border-radius: 10px; background: #fff8e8; }
.hq-invite-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 12px 0 16px;
  padding: 12px;
  border-radius: 10px;
  background: var(--task-soft);
}
.hq-invite-flow > span { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.hq-field-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  margin-right: 4px;
  border-radius: 6px;
  background: var(--task-soft);
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
}
.hq-store-hero { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.hq-store-hero .store-chip { vertical-align: middle; }
.hq-store-meta { margin: 6px 0; }
.hq-store-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.hq-contact-row { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.hq-contact-row > span { display: inline-flex; align-items: center; gap: 6px; }
.hq-intro-text.is-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hq-invite-how summary { list-style: none; cursor: pointer; }
.hq-invite-how summary::-webkit-details-marker { display: none; }
.hq-brand-actions { display: flex; justify-content: flex-end; gap: 8px; }
.hq-crumb { margin: 0 0 8px; }
@media (max-width: 800px) {
  .hq-more-grid { grid-template-columns: repeat(2, 1fr); }
  .hq-csv-fields { grid-template-columns: 1fr; }
  .hq-report-kpis { grid-template-columns: 1fr 1fr; }
  .hq-brand-card { grid-template-columns: auto 1fr auto; }
  .hq-brand-stats { grid-column: 1 / -1; }
  .hq-help-row,
  .hq-help-table-head { grid-template-columns: 1fr 1fr !important; }
}
@media (max-width: 640px) {
  .manual-toc-tiles { grid-template-columns: 1fr; }
  #hq-store-metrics .done-metrics-grid { grid-template-columns: 1fr 1fr; }
}

/* Login polish (Akira) — keep OTP + magic link; no fake sidebar */
body.auth-page .card,
body.auth-page .door-card {
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(20, 40, 80, 0.08);
}
body.auth-page .btn,
body.auth-page .btn-ghost,
body.auth-page a.btn {
  min-height: 48px;
}
.door-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-bottom: 10px;
  border-radius: 12px;
  background: var(--brand-soft, #e8f2fe);
  color: var(--brand);
  font-size: 0.95rem;
  font-weight: 800;
}
.door-store .door-ico {
  background: rgba(247, 143, 67, 0.14);
  color: var(--cta);
}
body.auth-page .door-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-top: 18px;
  padding: 12px 16px;
  border-radius: 12px;
}
.chooser-help {
  margin: 18px auto 0;
  max-width: 36em;
}
.chooser-help summary {
  cursor: pointer;
  color: var(--brand-deep);
  font-weight: 700;
  text-align: center;
  list-style: none;
}
.chooser-help summary::-webkit-details-marker { display: none; }
.chooser-help p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}
body.auth-page .note-box.auth-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #fff8ee;
  border-color: rgba(183, 121, 31, 0.16);
}
.auth-note-ico {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(183, 121, 31, 0.14);
  color: #8a5a12;
  font-size: 0.78rem;
  font-weight: 800;
}
.login-field { position: relative; }
.login-field input { padding-left: 42px; }
.login-field-ico {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 800;
  pointer-events: none;
}
.auth-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}
.auth-or::before,
.auth-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.auth-signup-card { margin-top: 14px; }
@media (max-width: 767px) {
  .door-grid { grid-template-columns: 1fr; }
}

label.vis-q-opt,
.vis-q-opt {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 10px;
  margin: 8px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  background: #fff;
}
.vis-q-opt:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft, #e8f2fe);
}
.vis-q-opt input[type="radio"] {
  display: inline-block;
  width: 18px;
  height: 18px;
  min-width: 18px;
  max-width: 18px;
  margin: 3px 0 0;
  flex: 0 0 18px;
}
.vis-q-opt span {
  flex: 1;
  line-height: 1.45;
}
.vis-q-fieldset {
  border: 0;
  padding: 0;
  margin: 14px 0 0;
}
.vis-q-fieldset legend {
  font-weight: 700;
  margin-bottom: 4px;
}



/* 16 Sep 2026 — AI visibility answer-count card (Hikaru spec: answers, not a score) */
.vis-ans-main { font-size: 1.35rem; font-weight: 700; line-height: 1.45; margin: 6px 0 2px; }
.vis-ans-lines { list-style: none; padding: 0; margin: 8px 0 0; }
.vis-ans-lines li { padding: 6px 10px; margin: 4px 0; border-radius: 8px; background: rgba(49, 139, 247, 0.06); font-size: 0.95rem; }
.vis-ans-h { margin: 10px 0 6px; font-size: 0.95rem; }
.vis-ans-table-wrap { overflow-x: auto; }
.vis-ans-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.vis-ans-table th, .vis-ans-table td { border: 1px solid #e3e8f0; padding: 6px 8px; text-align: left; vertical-align: top; }
.vis-ans-table th { background: #f4f7fb; font-weight: 600; }
.vis-ans-q { min-width: 160px; }
.vis-ans-cell { white-space: nowrap; text-align: center; }
.vis-ans-mentioned { background: #e8f7ee; color: #157347; font-weight: 600; }
.vis-ans-not_mentioned { color: #6b7280; }
.vis-ans-no_overview, .vis-ans-failed, .vis-ans-not_run { color: #9aa3af; font-style: italic; }
.vis-ans-self td { font-weight: 700; background: #fff7e6; }
/* --- Oct 2026 fixes ------------------------------------------------------ */
/* Logout is a POST form now; keep it looking like the other top links. */
.logout-form { display: inline; margin: 0; }
.top-link-btn {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font-family: inherit;
  cursor: pointer;
  line-height: inherit;
}
@media (max-width: 767px) {
  .top-link-btn { min-height: 44px; padding: 8px 4px; }
}
.flash.login-reason { margin: 12px 0 16px; }
.narrow-card { max-width: 520px; margin: 40px auto; }
.door-svg { display: block; }
.vis-prepublish { display: block; margin-top: 2px; font-weight: 600; }
.status-steps { margin: 0 0 6px; padding-left: 1.3em; line-height: 1.7; }

/* Low fix (Oct 2026): HQ store list - keep Page / Issues / Actions on screen.
   EN headers and long owner/status text pushed the last columns out of the
   scroll box at desktop width; the mobile rules still used the old 8-column
   numbering after columns were added. */
#stores #hq-stores-table th { letter-spacing: 0; text-transform: none; overflow-wrap: normal; word-break: normal; hyphens: manual; }
#stores #hq-stores-table td:nth-child(2) { max-width: 190px; overflow-wrap: break-word; }
#stores #hq-stores-table td:nth-child(3) { max-width: 150px; overflow-wrap: anywhere; word-break: break-word; }
#stores #hq-stores-table th:nth-child(n+5):nth-child(-n+8) { max-width: 84px; }
#stores #hq-stores-table td.hq-col-page { white-space: normal; }
#stores #hq-stores-table td.hq-col-page .hq-status-pill { white-space: normal; display: inline-block; max-width: 112px; line-height: 1.25; }
#stores #hq-stores-table th, #stores #hq-stores-table td { padding-left: 7px; padding-right: 7px; }
@media (max-width: 767px) {
  /* cols: 1 select, 2 store, 3 owner, 4 rep, 5 missing, 6 vis, 7 ai, 8 web,
     9 page, 10 issues, 11 actions -> phones show 1, 2, 9, 10, 11 */
  #stores #hq-stores-table th:nth-child(4),
  #stores #hq-stores-table td:nth-child(4),
  #stores #hq-stores-table th:nth-child(8),
  #stores #hq-stores-table td:nth-child(8) {
    display: none;
  }
  #stores #hq-stores-table td:nth-child(2) { max-width: 110px; }
  #stores #hq-stores-table th, #stores #hq-stores-table td { padding-left: 5px; padding-right: 5px; }
  #stores #hq-stores-table td.hq-col-page .hq-status-pill { max-width: 70px; font-size: 0.68rem; padding-left: 6px; padding-right: 6px; }
  #stores #hq-stores-table th { overflow-wrap: anywhere; font-size: 0.66rem; }
  /* archived-stores table: keep its last column (restore action) visible */
  #stores .hq-table:not(#hq-stores-table) th:nth-child(5),
  #stores .hq-table:not(#hq-stores-table) td:nth-child(5) { display: table-cell; }
}

/* AIOSky 2026-10-26: keep the page URL visible on phones (duplicate green box removed). */
@media (max-width: 9999px){.page-hero.hero-banner > p.page-hero-url{display:block !important;word-break:break-all}}

/* PATCH-2026-10-28-CANLYPAGE: phone layout for the 5-button action bar (last so it wins the cascade).
   Row 1: Save | AI check; row 2: Fill (full width); row 3: Preview | Publish. */
@media (max-width: 767px) {
  body.page-editor-body .page-actionbar-btns-5 {
    grid-template-columns: 1fr 1fr;
  }
  body.page-editor-body .page-actionbar-btns-5 .btn-primary {
    grid-column: auto;
    order: 0;
  }
  body.page-editor-body .page-actionbar-btns-5 .btn-ai-fill {
    grid-column: 1 / -1;
  }
  body.page-editor-body:has(.page-actionbar-btns-5) {
    --page-actionbar-h: 200px;
  }
}

/* PATCH-2026-10-29-CUSTOMDD: custom store switcher (see /static/store-switch.js). Native select stays as no-JS fallback. */
.store-switch select.cdd-native { display: none !important; }
.cdd { position: relative; margin-top: 4px; width: 100%; }
.cdd-btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 44px;
  padding: 10px 40px 10px 14px; font: inherit; font-size: 16px; text-align: left; cursor: pointer; position: relative;
  color: #43425D; background: #fff; border: 1px solid var(--line-strong, #c5d4e8); border-radius: 10px; color-scheme: light; }
.cdd-btn::after { content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; margin-top: -6px;
  border-right: 2px solid #43425D; border-bottom: 2px solid #43425D; transform: rotate(45deg); }
.cdd-btn[aria-expanded="true"]::after { margin-top: -2px; transform: rotate(-135deg); }
.cdd-btn:focus-visible { outline: none; border-color: #318BF7; box-shadow: 0 0 0 3px rgba(49,139,247,.35); }
.cdd-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cdd-list { position: fixed; z-index: 10000; margin: 0; padding: 4px; list-style: none; overflow-y: auto; box-sizing: border-box;
  background: #fff; color: #43425D; color-scheme: light; border: 1px solid #c5d4e8; border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15,23,42,.18); }
.cdd-list[hidden] { display: none; }
.cdd-opt { padding: 10px 12px; border-radius: 8px; cursor: pointer; color: #43425D; background: #fff; font-size: 15px;
  line-height: 1.35; overflow-wrap: anywhere; }
.cdd-opt.is-active { background: #eef1f5; color: #43425D; }
.cdd-opt[aria-selected="true"] { background: #318BF7; color: #fff; font-weight: 600; }
.cdd-opt[aria-selected="true"].is-active { background: #2479e0; color: #fff; }

/* PATCH-2026-11-02-STOREUI: Preview link (<a>) in the page action bar — center label like the <button>s */
.page-actionbar-btns > a.btn, #page-preview-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* PATCH-2026-11-02-SAITO2: store menu now 4 items on phones */
@media (max-width: 767px) {
  .nav.nav-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* NIGHT1106: heading notes and point labels; no client data or measurement changes. */
.settings-note-heading{display:flex;align-items:center;flex-wrap:wrap;gap:8px 12px}
.settings-edit-note{display:inline-flex;align-items:center;gap:6px;max-width:100%;padding:5px 12px;border-radius:999px;background:#fbd9cc;color:#91320e;font-size:.78rem;font-weight:500;line-height:1.5}
.settings-edit-note svg{flex:none}
.comps-flow-step .comps-radius-note{font-size:.88rem;color:#555;font-weight:400;line-height:1.6;max-width:100%}
.score-chart-value{font-size:8px;font-weight:700;fill:#1d58a4;paint-order:stroke;stroke:#fff;stroke-width:2.5px;stroke-linejoin:round}
.score-chart-value-leader{stroke:#9cb8de;stroke-width:.55}
.monthly-records{border-top:1px solid var(--line,#dfe6f0);margin-top:22px;padding-top:16px;min-width:0}
.monthly-record-form{display:flex;gap:8px;flex-wrap:wrap;align-items:end;margin:12px 0}
.monthly-record-form label{margin:0;min-width:0;flex:1 1 150px}
.monthly-record-form select{margin-top:5px}
.monthly-record-scroll{overflow-x:auto;max-width:100%;border:1px solid var(--line,#dfe6f0);border-radius:8px}
.monthly-record-table{min-width:610px;table-layout:fixed;width:100%}
.monthly-record-table th:first-child{width:46%;overflow-wrap:anywhere}
.monthly-record-table td{text-align:center;font-size:.85rem;overflow-wrap:anywhere;padding:10px 5px}
.monthly-record-table .vq-ic{display:inline-flex;margin-bottom:4px}
.monthly-record-status{display:block}
