:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --line: #e2e5ea;
  --line-strong: #cdd2da;
  --text: #1b1e24;
  --text-2: #3b414c;
  --muted: #5b6270;
  --primary: #2f5bea;
  --primary-dark: #1e40b8;
  --primary-soft: #eef2fd;
  --ok: #1f7a4d;
  --ok-soft: #e9f5ef;
  --warn-text: #7a4b00;
  --warn-soft: #fff4db;
  --warn-line: #f0d48a;
  --danger: #b4232f;
  --danger-soft: #fdecee;
  --radius: 14px;
  --font: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 400 15px/1.5 var(--font); }
a { color: var(--primary); }
a:hover { color: var(--primary-dark); }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 10; background: #fff; padding: 8px 12px; border-radius: 8px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.loading { padding: 40px 24px; color: var(--muted); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-strong); background: #fff; color: var(--text); font-weight: 500; font-size: 14px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: #f7f8fa; color: var(--text); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-quiet { border-color: transparent; background: transparent; }
.btn-danger { color: var(--danger); }
.btn-small { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 8px; }

/* Top bar */
.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 12px 24px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.brand img { width: 36px; height: 36px; display: block; }
.brand-name { font-weight: 600; font-size: 16px; }
.brand-sub { font-size: 13px; color: var(--muted); }
.back { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text-2); font-size: 13px; font-weight: 500; min-height: 44px; }
.sep { width: 1px; height: 28px; background: var(--line); }
.site-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.site-title strong { font-size: 16px; font-weight: 600; }
.site-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.dot { display: inline-flex; align-items: center; gap: 6px; }
.dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.user { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-2); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--line); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; }
.publish-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.publish-bar .count { font-size: 13px; color: var(--muted); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; border-radius: 8px; color: var(--text-2); font-weight: 500; font-size: 14px; text-decoration: none; }
.tabs a[aria-current="page"] { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }

/* Pills */
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 600; }
.pill-warn { background: var(--warn-soft); color: var(--warn-text); }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-info { background: var(--primary-soft); color: var(--primary-dark); }
.pill-danger { background: var(--danger-soft); color: var(--danger); }

/* Dashboard */
.page { max-width: 1200px; margin: 0 auto; padding: 28px 24px; display: flex; flex-direction: column; gap: 18px; }
.page h1 { margin: 0; font-size: 26px; font-weight: 600; }
.lede { margin: 0; color: var(--muted); font-size: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.site-table { overflow: hidden; }
.site-row { display: grid; grid-template-columns: 20px minmax(0, 2.2fr) minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: center; padding: 16px 20px; border-top: 1px solid var(--line); }
.site-row.head { border-top: 0; padding: 12px 20px; background: #f7f8fa; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.site-row .name { font-weight: 600; font-size: 15px; display: block; }
.site-row .url { font-size: 13px; }
.site-row .status { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; font-size: 13px; }
.site-row .when { font-size: 13px; color: var(--text-2); }
.site-row .go { justify-self: end; }
.note { margin: 0; font-size: 13px; color: var(--muted); }
@media (max-width: 760px) {
  .site-row { grid-template-columns: 20px 1fr auto; }
  .site-row.head { display: none; }
  .site-row .when { display: none; }
  .site-row > input { grid-row: 1 / span 3; align-self: start; margin-top: 4px; }
  .site-row .status, .site-row .visitors { grid-column: 2; }
  .site-row .go { grid-row: 1 / span 3; grid-column: 3; }
}

/* Editor */
.editor { display: flex; flex-wrap: wrap; gap: 20px; padding: 20px 24px; align-items: stretch; min-height: calc(100vh - 77px - 88px); }
.chat { flex: 1 1 360px; max-width: 480px; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.chat-head { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.chat-head label { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.chat-head select { min-height: 44px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; }
.messages { flex: 1; display: flex; flex-direction: column; gap: 14px; padding: 18px 16px; overflow-y: auto; min-height: 240px; max-height: calc(100vh - 360px); }
.msg-me { align-self: flex-end; max-width: 88%; background: var(--primary-soft); border-radius: 14px 14px 4px 14px; padding: 10px 14px; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-ai { display: flex; flex-direction: column; gap: 8px; max-width: 94%; font-size: 14px; }
.msg-ai ul { margin: 0; padding: 10px 14px 10px 30px; background: #f7f8fa; border: 1px solid var(--line); border-radius: 10px; }
.msg-ai .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.msg-ai.error { color: var(--danger); }
.msg-ai .muted { color: var(--text-2); }
.empty-chat { color: var(--muted); font-size: 14px; }
.empty-chat ul { padding-left: 18px; margin: 8px 0 0; }
.thinking { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--line-strong); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

.pending { border-top: 1px solid var(--line); padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.pending summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--warn-text); min-height: 32px; display: flex; align-items: center; }
.pending ol { margin: 0; padding-left: 20px; font-size: 13px; color: var(--text-2); }
.pending .row { display: flex; gap: 8px; flex-wrap: wrap; }

.composer { border-top: 1px solid var(--line); padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.composer label { font-size: 13px; color: var(--muted); }
.composer-box { display: flex; align-items: flex-end; gap: 8px; border: 1px solid var(--line-strong); border-radius: 12px; padding: 8px; background: #fff; }
.composer-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47, 91, 234, .15); }
.composer textarea { flex: 1; min-width: 0; border: 0; resize: none; outline: none; background: transparent; font-size: 14px; line-height: 1.5; min-height: 44px; max-height: 200px; }
.send { width: 44px; height: 44px; border: 0; border-radius: 10px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.send[disabled] { opacity: .5; cursor: not-allowed; }
.hint { font-size: 12px; color: var(--muted); }

.preview { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.preview-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.preview-state { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.seg { display: inline-flex; gap: 4px; background: var(--bg); border-radius: 10px; padding: 4px; }
.seg button { min-height: 36px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); font-size: 13px; font-weight: 500; cursor: pointer; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.frames { flex: 1; display: flex; gap: 12px; padding: 12px; background: #eceef2; min-height: 520px; }
.frame { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; position: relative; }
.frame-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.frame iframe { flex: 1; width: 100%; border: 1px solid var(--line); border-radius: 8px; background: #fff; min-height: 480px; }
.frames.phone .frame iframe { width: 390px; max-width: 100%; align-self: center; }
.frame .overlay { position: absolute; inset: 24px 0 0 0; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .75); border-radius: 8px; font-size: 14px; color: var(--text-2); gap: 10px; }

/* History */
.history { max-width: 920px; }
.version { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-top: 1px solid var(--line); }
.version:first-child { border-top: 0; }
.version .what { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.version .what strong { font-weight: 600; font-size: 15px; }
.version .when { font-size: 13px; color: var(--muted); }
.draft-box { border-color: var(--warn-line); padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.draft-box ol { margin: 0; padding-left: 20px; font-size: 14px; }

/* Dialog */
dialog { border: 0; border-radius: var(--radius); padding: 0; max-width: 520px; width: calc(100% - 32px); box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
dialog::backdrop { background: rgba(20, 24, 33, .45); }
.dialog-body { padding: 22px 24px; display: flex; flex-direction: column; gap: 12px; }
.dialog-body h2 { margin: 0; font-size: 18px; }
.dialog-body p { margin: 0; color: var(--text-2); font-size: 14px; }
.dialog-body ol { margin: 0; padding-left: 20px; font-size: 14px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding-top: 6px; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: calc(100% - 32px); }
#toast.show { opacity: 1; }

.banner { margin: 0; padding: 12px 16px; border-radius: 10px; font-size: 14px; }
.banner.error { background: var(--danger-soft); color: var(--danger); }
.banner.info { background: var(--primary-soft); color: var(--primary-dark); }

@media (max-width: 900px) {
  .chat { max-width: none; }
  .messages { max-height: 50vh; }
}

/* AI cost */
.cost { font-size: 12px; color: var(--muted); }
.usage-box { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; overflow-x: auto; }
.usage-box h2 { margin: 0; font-size: 16px; font-weight: 600; }
.usage-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.usage-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); }
.usage-table td { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.usage-table .num { text-align: right; white-space: nowrap; }

/* backups and visitors */
.list-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.site-row input[type="checkbox"] { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }
.visitors { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text); text-decoration: none; }
.visitors strong { min-width: 2.5ch; }
a.visitors:hover strong { color: var(--primary-dark); text-decoration: underline; }
.spark { fill: var(--primary); opacity: .75; }
.backup-list { list-style: none; margin: 8px 0 0; padding: 0; }
.backup-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.stats-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 7px 12px; font: inherit; font-size: 13px; cursor: pointer; color: var(--text-2); }
.seg button + button { border-left: 1px solid var(--line-strong); }
.seg button.on { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.tile { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.tile strong { font-size: 26px; font-weight: 650; }
.stat-chart { padding: 16px 18px; }
.stat-chart h2, .stat-list h2 { font-size: 15px; margin: 0 0 12px; }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 140px; border-bottom: 1px solid var(--line); }
.bar { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.bar span { display: block; width: 100%; background: var(--primary); border-radius: 2px 2px 0 0; opacity: .85; }
.bar:hover span { opacity: 1; }
.bar-axis { display: flex; justify-content: space-between; margin-top: 6px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.stat-list { padding: 16px 18px; }
.stat-list table { width: 100%; border-collapse: collapse; font-size: 13px; }
.stat-list th { text-align: right; font-weight: 600; color: var(--muted); font-size: 12px; padding: 0 0 6px 8px; }
.stat-list td { text-align: right; padding: 6px 0 6px 8px; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.stat-list th:first-child, .stat-list td:first-child { text-align: left; padding-left: 0; overflow-wrap: anywhere; }
.visitors-on { font-size: 13px; }
@media (max-width: 760px) { .site-row .visitors-on { grid-column: 2; } }

/* site check */
.check-form { display: flex; gap: 10px; padding: 14px; flex-wrap: wrap; }
.url-input { flex: 1 1 260px; min-width: 0; font: inherit; font-size: 15px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 8px; }
.url-input:focus { outline: 3px solid var(--primary); outline-offset: 1px; }
.check-row { display: grid; grid-template-columns: minmax(0, 2fr) auto minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line); }
.check-row:first-child { border-top: 0; }
.check-row .name { display: block; font-weight: 600; }
@media (max-width: 760px) { .check-row { grid-template-columns: 1fr auto; } .check-row .when { display: none; } }
.report-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.verdict { display: flex; align-items: center; gap: 12px; padding: 16px 18px; }
.verdict p { margin: 0; font-size: 15px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; padding: 16px 18px; }
.fact { display: flex; flex-direction: column; gap: 2px; }
.fact strong { font-size: 16px; }
.findings { list-style: none; margin: 0; padding: 0; }
.findings li { display: flex; gap: 10px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.findings li:first-child { border-top: 0; }
.findings .pill { flex: none; min-width: 64px; text-align: center; }
.page-list { margin: 0; padding-left: 18px; font-size: 14px; }
.page-list li { padding: 3px 0; }

/* Small icons beside labels */
.ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-small .ico { width: 15px; height: 15px; }
.back { display: inline-flex; align-items: center; gap: 6px; }
.back span { display: inline-flex; align-items: center; gap: 4px; }

/* Progress bars for long jobs */
.progress { display: grid; gap: 6px; margin-top: 8px; }
.progress-track { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 99px; background: var(--primary); transition: width .4s ease; }
.progress-card { padding: 14px 16px; }

/* Several forms, each with its own address */
.forms-list { display: grid; gap: 12px; margin: 0; }
.form-recipient { display: grid; gap: 6px; }
.form-recipient .url-input { max-width: 480px; }
.forms-list .btn { justify-self: start; }

/* Comparing with the original */
.compare-list { display: grid; gap: 8px; margin-top: 12px; }
.compare-page { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; }
.compare-page summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.compare-page .findings { margin: 8px 0 0; }
.wide-dialog { width: min(1400px, 96vw); max-width: none; }
.side-by-side { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; max-height: 75vh; overflow: auto; }
.side-by-side figure { margin: 0; }
.side-by-side figcaption { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.side-by-side img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 6px; }

/* Migration steps: dimmed until the step before is done; progress shown inside the running step */
.step-locked { opacity: .35; background: transparent; box-shadow: none; border-style: dashed; filter: grayscale(1); }
.step-locked a, .step-locked input, .step-locked button { pointer-events: none; }
.step-progress { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.own-change { display: grid; gap: 8px; margin-top: 6px; }
.own-change-page select { margin-left: 4px; }
.own-change textarea { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }

/* A step made of parts (Rebuild the site; Make adjustments) */
.phase { gap: 0; }
.phase-title { font-size: 16px; margin: 0 0 6px; }
.phase-part { padding: 14px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.phase-title + .phase-part { border-top: 0; padding-top: 4px; }
.phase-part:last-child { padding-bottom: 0; }
.phase-part.step-locked { background: none; border: 0; border-top: 1px solid var(--line); filter: grayscale(1); opacity: .45; }
.phase-title + .phase-part.step-locked { border-top: 0; }
.mode-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin-top: 4px; }
.mode-option { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 12px; cursor: pointer; }
.mode-option.is-on { border-color: var(--accent, #3b5bdb); background: rgba(59, 91, 219, .05); }
.mode-option input { margin-top: 3px; }

/* Top bar: Komphi's logo, All sites, and the account */
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.brand-logo { height: 30px; width: auto; display: block; }
.brand img.brand-logo { width: auto; height: 30px; }
.all-sites[aria-current="page"] { background: var(--line); }
.account { position: relative; }
.account > summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; color: var(--text-2); padding: 4px; border-radius: 10px; }
.account > summary::-webkit-details-marker { display: none; }
.account > summary:hover { background: var(--line); }
.account .who { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account .credit { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: rgba(34, 139, 34, .1); color: #1f6f2b; white-space: nowrap; }
.account .credit.is-low { background: rgba(200, 120, 0, .12); color: #8a5300; }
.account-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 100; width: 300px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.12); padding: 14px 16px; }
@media (max-width: 640px) { .account .who { display: none; } }

/* Sortable list headings */
.sort-head { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; }
.sort-head:hover, .sort-head.is-on { color: var(--text); }
.sort-head:focus-visible { outline: 2px solid var(--accent, #3b5bdb); outline-offset: 2px; border-radius: 4px; }
.sort-arrow { font-size: 10px; opacity: .55; }
.sort-head.is-on .sort-arrow { opacity: 1; }
.attach { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; cursor: pointer; color: var(--text-2); flex: none; }
.attach:hover { background: var(--line); }
.attached { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 12px 0; }
.attached .chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 4px 6px 4px 10px; border-radius: 999px; background: var(--line); }
.attached .chip button { all: unset; cursor: pointer; padding: 0 6px; font-size: 15px; }
.composer-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.composer .upload-btn { font-size: 13px; color: var(--text); cursor: pointer; }
.upload-btn:focus-within { outline: 2px solid var(--accent, #3b5bdb); outline-offset: 2px; }
.seg button { display: inline-flex; align-items: center; gap: 6px; }
/* The chosen option stands out: accent border and text, not just a lighter background */
.seg button { border: 1px solid transparent; }
.seg button[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
/* Inside a site: the tabs sit in the middle of the bar, whatever is on either side */
@media (min-width: 1100px) {
  .topbar-site { display: grid; grid-template-columns: 1fr auto 1fr; }
  .topbar-site > :first-child { justify-self: start; }
  .topbar-site > .tabs { justify-self: center; }
  .topbar-site > :last-child { justify-self: end; }
}
/* Mobile view: just the phone on the dimmed page, Close beside it */
.phone-dialog { background: transparent; border: 0; padding: 0; width: fit-content; margin: auto; inset: 0; max-width: none; max-height: none; overflow: visible; box-shadow: none; }
.phone-dialog::backdrop { background: rgba(15, 23, 42, .6); }
.phone-wrap { width: max-content; position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 0; }
.phone-body { border: 10px solid #111; border-radius: 36px; overflow: hidden; background: #fff; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.phone-frame { display: block; width: 390px; height: min(800px, calc(100vh - 110px)); border: 0; }
.phone-close { position: absolute; top: 0; left: calc(100% + 14px); white-space: nowrap; }
.phone-note { margin: 0; font-size: 13px; color: rgba(255,255,255,.85); }
@media (max-width: 560px) { .phone-close { left: auto; right: 0; top: -44px; } .phone-frame { width: calc(100vw - 40px); } }

/* Waiting: Komphi's K, its halves taking turns */
.loader { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; min-height: 50vh; text-align: center; color: var(--muted); font-size: 15px; padding: 24px; }
.loader p { margin: 0; max-width: 460px; }
.k-mark .k-top, .k-mark .k-bottom { transform-box: fill-box; transform-origin: center; animation: k-pulse 1.2s ease-in-out infinite; }
.k-mark .k-bottom { animation-delay: .6s; }
@keyframes k-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.88); } }
/* The small waiting sign in buttons and progress lines is the K too */
.spinner { border: 0 !important; border-radius: 0 !important; background: url("/brand/komphi-icon.svg") center / contain no-repeat; animation: k-small 1.2s ease-in-out infinite !important; width: 18px; height: 18px; display: inline-block; flex: none; }
@keyframes k-small { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.85); } }
@media (prefers-reduced-motion: reduce) { .k-mark .k-top, .k-mark .k-bottom, .spinner { animation-duration: 3s !important; } }
/* Inside a live site, the tabs and Publish need the room: the account shows its email only on wide screens */
@media (max-width: 1500px) { .account.is-tight .who { display: none; } }
@media (max-width: 1250px) { .account.is-tight .credit { display: none; } }

/* Migration: the steps, with Results and Cancel beside them on wide screens */
.page.history:has(.move-layout) { max-width: 1320px; }
.move-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.move-main, .move-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.move-side { position: sticky; top: 16px; max-height: calc(100vh - 32px); }
.move-side .results-box { overflow-y: auto; min-height: 0; flex: 0 1 auto; }
.move-side .results-box .banner { font-size: 13px; }
.move-side .draft-box { flex: none; }
@media (max-width: 1100px) {
  .page.history:has(.move-layout) { max-width: 920px; }
  .move-layout { grid-template-columns: minmax(0, 1fr); }
  .move-side { position: static; max-height: none; }
}
.move-side .draft-box > div { flex-direction: column; align-items: flex-start !important; gap: 4px !important; }
.move-side .draft-box .btn-danger { margin-left: -10px; }

/* Domain being pointed: propagating box */
.dns-wait { margin: 12px 0 0; padding: 14px 16px; border: 1px solid #bfdbfe; background: #eff6ff; border-radius: 12px; color: #1e3a8a; font-size: 14px; }
.dns-wait-head { display: flex; align-items: center; gap: 10px; }
.dns-wait-head .k-mark { width: 22px; height: 22px; flex: none; }
.dns-wait-head .dns-clock { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; }
.dns-wait .note { color: #3b5bab; }

/* Migration steps fold away (accordion) */
.fold-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.fold-toggle { display: flex; align-items: baseline; gap: 10px; flex: 1 1 auto; min-width: 0; background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; flex-wrap: wrap; }
.fold-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; border-radius: 6px; }
.fold-chev { display: inline-block; width: 12px; font-size: 20px; line-height: 1; color: var(--muted, #6b7280); transition: transform .15s; transform: translateY(1px); }
.fold.is-open .fold-chev { transform: rotate(90deg) translateX(1px); }
.fold-title { font-weight: 700; font-size: 18px; }
.phase .fold-title { font-size: 18px; }
.fold-sum { color: var(--muted, #6b7280); font-size: 14px; font-weight: 400; }
.fold:not(.is-open) { padding-top: 16px; padding-bottom: 16px; }
.fold.is-open > .fold-head { margin-bottom: 4px; }

/* Copyright line at the bottom of every screen */
.app-footer { max-width: 1320px; margin: 0 auto; padding: 8px 24px 28px; text-align: center; font-size: 13px; color: var(--muted, #6b7280); }
.editor + .app-footer, div:has(> .editor) + .app-footer { padding: 0 24px 16px; }

/* The original site turning Komphi's browser away: the fix first, the pages folded below */
.turned-away { display: block; margin-top: 10px; padding: 14px 16px; border: 1px solid #f59e0b; border-left-width: 5px; background: #fffbeb; border-radius: 10px; color: #78350f; font-size: 14px; }
.turned-away-title { display: block; font-size: 15px; margin-bottom: 4px; }
.turned-away .ta-p { display: block; margin: 6px 0 0; }
.turned-away-list { margin-top: 10px; color: #92400e; }
.turned-away-list summary { cursor: pointer; font-weight: 600; }
.turned-away-list span { font-size: 13px; }

/* People who can edit a site */
.people-list { list-style: none; margin: 0 0 16px; padding: 0; }
.people-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.people-who { display: flex; flex-direction: column; flex: 1 1 240px; min-width: 0; }
.people-who strong { overflow-wrap: anywhere; }
.people-add { margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.people-card { padding: 18px 22px; }
.people-card .people-list li:first-child { padding-top: 0; }
.people-list li:last-child { border-bottom: 0; }

/* Messages sent through a site's forms */
.msg-row { display: grid; grid-template-columns: 24px minmax(160px, 1fr) minmax(0, 2.4fr) 150px; gap: 14px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.msg-row.head { font-size: 13px; color: var(--muted, #6b7280); font-weight: 600; }
.msg-row:last-child { border-bottom: 0; }
.msg-row.not-sent { background: #fffbeb; }
.msg-open { display: flex; flex-direction: column; gap: 2px; min-width: 0; text-align: left; background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.msg-open > span, .msg-open > strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-open:hover strong, .msg-open:hover > span:first-child { color: var(--primary); }
.msg-row .when { font-size: 13px; color: var(--muted, #6b7280); }
.message-dialog { width: min(760px, calc(100% - 32px)); max-width: none; }
.msg-fields { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 14px; }
.msg-fields dt { color: var(--muted, #6b7280); }
.msg-fields dd { margin: 0; overflow-wrap: anywhere; }
.msg-text { white-space: pre-wrap; background: #f9fafb; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 0 0 14px; max-height: 50vh; overflow: auto; }
.msg-files { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; }
.btn.is-disabled { opacity: .5; pointer-events: none; }
@media (max-width: 760px) { .msg-row { grid-template-columns: 24px 1fr; } .msg-row > :nth-child(3), .msg-row .when { grid-column: 2; } .msg-row.head { display: none; } }

/* Sites list: the name opens the site in Komphi, the address the real site (new tab) */
.site-row .site-open { display: flex; width: fit-content; align-items: center; gap: 8px; margin-bottom: 2px; color: var(--text); text-decoration: none; }
.site-row .site-open:hover { color: var(--primary); }
.site-row .site-open:hover .name-text, .site-row .site-open:focus-visible { text-decoration: underline; }
.site-open-icon { display: inline-flex; color: var(--muted); opacity: .75; }
.site-row .site-open:hover .site-open-icon { color: var(--primary); opacity: 1; }
.site-open-icon svg { width: 15px; height: 15px; }
.site-row .url { display: inline-flex; align-items: center; gap: 4px; }
.site-row .url .ext svg { width: 12px; height: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* SEO: one card per page, with a search-result preview beside the fields */
.seo-page .seo-card { padding: 18px 22px; display: grid; gap: 12px; }
.seo-card.has-suggestion { border-color: #b9c8f7; box-shadow: inset 3px 0 0 var(--primary); }
.seo-card-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; }
.seo-card-head > div { display: grid; gap: 2px; min-width: 0; }
.seo-card-head a.note { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; }
.seo-card-head a.note:hover { text-decoration: underline; }
.seo-card-head .ext .ico { width: 12px; height: 12px; }
.seo-use { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--primary-dark); background: var(--primary-soft); padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.seo-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.seo-fields { display: grid; gap: 6px; }
.seo-fields textarea, .seo-card textarea { resize: vertical; min-height: 0; padding: 10px 12px; line-height: 1.45; font: inherit; }
.seo-card textarea.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.seo-label { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 600; color: var(--text-2); margin-top: 4px; }
.seo-count { font-weight: 500; font-size: 12px; font-variant-numeric: tabular-nums; }
.seo-count.is-ok { color: var(--ok); }
.seo-count.is-long { color: var(--warn-text); }
.seo-count.is-over, .seo-count.is-empty { color: var(--danger); }
.seo-why { display: flex; gap: 6px; align-items: flex-start; margin: 2px 0 0; font-size: 13px; color: var(--primary-dark); }
.seo-why .ico { width: 15px; height: 15px; flex: none; margin-top: 2px; }
.seo-was { font-size: 13px; color: var(--muted); }
.seo-was summary { cursor: pointer; }
.seo-was p { margin: 4px 0 0; }
.seo-noindex { display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; cursor: pointer; }
.g-preview { display: grid; gap: 3px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-family: Arial, sans-serif; min-width: 0; }
.g-url { font-size: 12px; color: #4d5156; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-title { font-size: 18px; line-height: 1.3; color: #1a0dab; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.g-desc { font-size: 13px; line-height: 1.5; color: #4d5156; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.seo-files { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.seo-files a { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.seo-files .ext .ico { width: 12px; height: 12px; }
.seo-savebar { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; align-items: center; gap: 14px; padding: 12px 16px; margin: 0 -4px; background: rgba(244, 245, 247, 0.92); backdrop-filter: blur(6px); border-top: 1px solid var(--line); }
@media (max-width: 760px) {
  .seo-grid { grid-template-columns: 1fr; }
  .seo-page .seo-card { padding: 16px; }
}
.seo-pill { background: var(--primary-soft); color: var(--primary-dark); }
.seo-pill .ico { width: 13px; height: 13px; }

/* Visitors: Statistics | Search & AI */
.visitors-head { display: grid; gap: 6px; }
.eyebrow { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.subtabs a { display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--text-2); font-weight: 500; font-size: 15px; text-decoration: none; white-space: nowrap; }
.subtabs a:hover { color: var(--text); }
.subtabs a[aria-current="page"] { border-bottom-color: var(--primary); color: var(--primary-dark); font-weight: 600; }
.h1-aside { font-size: 13px; font-weight: 600; color: var(--muted); background: var(--line); border-radius: 6px; padding: 2px 8px; vertical-align: middle; }

/* Komphi Studio */
.studio-form { display: grid; gap: 14px; max-width: 760px; }
.studio-field { display: flex; flex-direction: column; gap: 4px; }
.studio-field textarea, .studio-field select { font: inherit; font-size: 15px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 8px; width: 100%; }
.studio-field textarea:focus, .studio-field select:focus { outline: 3px solid var(--primary); outline-offset: 1px; }
.studio-label { font-weight: 600; }
.studio-pics { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 8px; }
.studio-pic { margin: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel); }
.studio-pic.is-logo, .studio-pic.is-icon { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
.studio-pic img { display: block; width: 100%; height: 100px; object-fit: contain; background: repeating-conic-gradient(#f2f2f2 0% 25%, #fff 0% 50%) 50% / 16px 16px; }
.studio-pic figcaption { padding: 6px 8px; font-size: 12px; }
.studio-pic-name { word-break: break-all; }
.studio-pic-actions { display: block; margin-top: 2px; }
.studio-designs { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; padding: 14px 0 0; border-top: 1px solid var(--line); }
.studio-design { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--panel); }
.studio-design.is-chosen { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
.studio-shot { display: flex; align-items: center; justify-content: center; height: 300px; overflow: hidden; background: #f4f4f4; border-bottom: 1px solid var(--line); }
.studio-shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.studio-shot:focus-visible { outline: 3px solid var(--primary); outline-offset: -3px; }
.studio-design-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.studio-design-body h3 { margin: 0; font-size: 16px; }
.studio-design-body p { margin: 0; }
.studio-swatches { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.swatch { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .15); }
.studio-design-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.studio-feedback { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.studio-feedback textarea { width: 100%; font: inherit; font-size: 14px; line-height: 1.45; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 8px; resize: vertical; min-height: 90px; }
.studio-feedback textarea:focus { outline: 3px solid var(--primary); outline-offset: 1px; }
.studio-feedback .url-input { flex: 1 1 160px; font-size: 14px; padding: 7px 10px; }
.studio-field .url-input { flex: none; width: 100%; }
.studio-form { gap: 12px; }
.studio-feedback .url-input { flex: 1 1 100%; }
.studio-group { border: 0; border-top: 1px solid var(--line); margin: 6px 0 0; padding: 14px 0 0; display: grid; gap: 12px; min-width: 0; }
.studio-group legend { font-weight: 700; font-size: 15px; padding: 0 8px 0 0; }
.studio-example { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-top: 6px; }
.studio-likes { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.studio-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 3px 7px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 13px; cursor: pointer; }
.studio-chip:has(input:checked) { background: color-mix(in srgb, var(--primary) 12%, transparent); border-color: var(--primary); }
.studio-chip input { margin: 0; }
.studio-savebar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 16px 0 2px; border-top: 1px solid var(--line); margin-top: 6px; position: sticky; bottom: 0; background: var(--panel, #fff); z-index: 2; }
.studio-savebar .note { margin: 0; }
.icon-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 10px; }
.icon-tab { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border: 1px solid var(--line); border-bottom: 0; border-radius: 10px 10px 0 0; background: var(--panel, #fff); font-size: 13px; box-shadow: 0 1px 0 var(--line); min-width: 160px; }
.icon-tab img { width: 16px; height: 16px; object-fit: contain; }
.icon-big { width: 64px; height: 64px; object-fit: contain; border: 1px solid var(--line); border-radius: 14px; padding: 6px; background: #fff; }
.icon-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.polish { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.polish-note { margin: 0; }
.studio-field .polish { margin-top: 2px; }
.composer-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.undo-last { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.undo-last .note { margin: 0; }
.site-account { display: inline-flex; align-items: center; gap: 4px; margin: 3px 0 0 10px; font-size: 12px; color: var(--muted, #667); }
.site-account svg { width: 13px; height: 13px; }
.account-filter { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.account-filter select { font: inherit; font-size: 14px; padding: 5px 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; }
.account-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 13px; }

.dialog-choices { display: grid; gap: 8px; margin: 12px 0; }
.dialog-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; height: auto; padding: 10px 14px; }

/* Komphi is working: a layer over the page with what's happening and how far along it is */
.working-layer { position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; padding: 24px;
  background: rgba(255, 255, 255, .72); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: working-in .2s ease-out; }
.working-card { width: min(440px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, .14); padding: 26px 26px 20px; text-align: center; }
.working-card .k-mark { margin: 0 auto 10px; display: block; }
.working-words { margin: 0 0 16px; font-size: 16px; line-height: 1.45; color: var(--ink, #111); }
.working-track { height: 8px; }
.working-track .progress-fill { transition: width .9s linear; }
.working-meta { display: flex; justify-content: space-between; gap: 10px; margin: 8px 0 0; }
@keyframes working-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .working-layer { animation: none; } .working-track .progress-fill { transition: none; } }

/* Early access: connecting a Cloudflare account */
.connect-page { max-width: 760px; }
.connect-step, .connect-card { padding: 18px 22px; }
.connect-step h2 { display: flex; align-items: center; gap: 10px; font-size: 18px; margin: 0 0 10px; }
.connect-step .step-num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-dark); font-size: 14px; font-weight: 700; flex: none; }
.connect-accounts { display: grid; gap: 8px; }
.connect-account { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.connect-account-actions { display: flex; align-items: center; gap: 8px; }
.connect-r2 + .connect-r2 { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.connect-step.is-done .step-num { background: #dcfce7; color: #166534; }
.connect-step ol, .connect-step ul { margin: 0 0 12px; padding-left: 20px; }
.connect-step li { margin: 0 0 4px; }
.scope-list strong { font-weight: 500; }
.connect-card { display: grid; gap: 8px; }
.help summary { cursor: pointer; color: var(--primary-dark); font-size: 14px; }
.help ol { margin-top: 8px; }
.beta-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.beta-add .url-input { flex: 1 1 260px; }
.beta-row { grid-template-columns: minmax(0,1fr) minmax(0,1fr) auto !important; align-items: center; gap: 16px; }
.beta-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.give-credits { display: flex; gap: 6px; align-items: center; margin: 0; }
.give-credits input { width: 76px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.beta-status { min-width: 0; }
.credits-note { flex-basis: 100%; }
.beta-row > div { text-align: left; justify-self: start; }

/* Account branding: their logo, Komphi credited beside it */
.brand-account { gap: 10px; }
.by-komphi { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); white-space: nowrap; padding-left: 10px; border-left: 1px solid var(--line); }
.by-komphi img { height: 14px; width: auto; display: block; }
.brand-form { display: grid; gap: 10px; max-width: 520px; margin-top: 10px; }
.brand-preview { min-height: 48px; display: flex; align-items: center; padding: 10px; border: 1px dashed var(--line); border-radius: 10px; background: #fff; }
.brand-preview img { max-height: 44px; max-width: 260px; }
.account-card { padding: 18px 22px; }
.account-card.is-suspended { border-color: #f3c58b; background: #fffaf2; }
.account-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.account-head h2 { font-size: 17px; margin: 0 0 4px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.account-actions { display: flex; gap: 6px; }
.account-head .pill { background: var(--primary-soft); color: var(--primary-dark); }
.account-head .pill-warn { background: #fff1d6; color: #8a5300; }
.manager-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--line); max-width: 520px; }

/* Credits page */
.credit-balance { font-size: 26px; margin: 0 0 6px; }
.credit-packs { margin-top: 12px; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.credit-pack { display: grid; gap: 6px; justify-items: start; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; }
.credit-pack strong { font-size: 20px; }
.credit-history { width: 100%; border-collapse: collapse; font-size: 14px; }
.credit-history th, .credit-history td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); }
.credit-history .num { text-align: right; white-space: nowrap; }
.credit-history .is-plus { color: var(--ok); font-weight: 600; }
.studio-keep { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 14px; color: var(--muted, #555); cursor: pointer; }
.studio-keep input { width: 16px; height: 16px; }

/* Site pictures in the list */
.site-cell { display: flex; align-items: center; gap: 14px; min-width: 0; }
.site-cell-text { min-width: 0; }
.site-thumb { text-decoration: none; flex: none; width: 120px; height: 75px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: #f1f3f6; display: grid; place-items: center; box-shadow: 0 1px 2px rgba(16, 24, 40, .06); transition: box-shadow .15s, transform .15s; }
.site-thumb:hover { box-shadow: 0 4px 12px rgba(16, 24, 40, .12); transform: translateY(-1px); }
.site-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.site-thumb-letter { font-size: 26px; font-weight: 700; color: #b7bdc8; }
@media (max-width: 760px) { .site-thumb { width: 84px; height: 53px; } }

/* Signing in */
.signin-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; gap: 22px; }
.signin-brand img { display: block; height: 36px; width: auto; }
.signin-brand-agency { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.signin-brand-agency .signin-agency-logo { height: 48px; max-width: 320px; object-fit: contain; }
.signin-agency-name { font-size: 24px; font-weight: 700; }
.signin-brand-agency .by-komphi { border-left: 0; padding-left: 0; font-size: 12px; }
.signin-brand-agency .by-komphi img { height: 16px; }
.agency-host-status { margin-top: 10px; }
.dns-table { border-collapse: collapse; margin: 6px 0 10px; font-size: 13px; }
.dns-table td { border: 1px solid var(--line); padding: 6px 10px; vertical-align: top; }
.dns-table code { word-break: break-all; }
.signin-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 28px 28px 24px; box-shadow: 0 10px 30px rgba(16, 24, 40, .06); }
.signin-card h1 { font-size: 24px; margin: 0 0 6px; }
.signin-card form { display: grid; gap: 12px; margin-top: 16px; }
.signin-card .url-input { width: 100%; }
.signin-code { font: 600 24px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 6px; text-align: center; }
.signin-btn { justify-content: center; }
.signin-msg { min-height: 1.2em; margin: 10px 0 0; font-size: 14px; }
.signin-msg.is-error { color: var(--danger, #b42318); }
.signin-help { margin-top: 14px; }
.signin-foot { margin: 0; }

/* Deleting a site */
.danger-zone { border-color: #f3c2bd; }
.danger-zone h2 { color: var(--danger, #b42318); font-size: 17px; margin: 0 0 4px; }
.dialog-body .url-input { flex: none; }
.dialog-body ul { margin: 0; padding-left: 20px; font-size: 14px; }
.danger-zone { padding: 18px 20px; margin-top: 16px; }
.danger-zone .note { margin: 0 0 12px; }

/* Editor: where to start, and the catalogue of things to add */
.starter { display: grid; gap: 10px; }
.starter h2 { font-size: 16px; margin: 0 0 2px; }
.starter-choice { display: flex; gap: 12px; align-items: flex-start; text-align: left; width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font: inherit; color: inherit; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.starter-choice:hover, .starter-choice:focus-visible { border-color: var(--primary); box-shadow: 0 2px 8px rgba(47, 91, 234, .12); }
.starter-choice strong { display: block; font-size: 14px; }
.starter-choice .note { display: block; font-size: 13px; margin-top: 2px; }
.starter-icon { flex: none; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: #eef2fe; color: var(--primary); }
.starter-icon .ico { width: 18px; height: 18px; }
.starter-examples { display: flex; flex-wrap: wrap; gap: 6px; margin: -2px 0 4px; }
.chip-btn { font: inherit; font-size: 12.5px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); background: #f7f8fa; color: var(--text-2); cursor: pointer; text-align: left; }
.chip-btn:hover { border-color: var(--primary); color: var(--primary); }
.starter-safe { margin: 6px 0 0; font-size: 12.5px; }
.quick-bar { display: flex; gap: 6px; flex-wrap: nowrap; width: 100%; }
.quick-bar .btn { flex: 1 1 0; justify-content: center; padding-left: 8px; padding-right: 8px; white-space: nowrap; }
.catalogue-dialog { width: min(860px, 96vw); }
.catalogue-dialog .dialog-body { max-height: 88vh; overflow: auto; }
.catalogue-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.catalogue-head h2 { display: flex; align-items: center; gap: 10px; }
.catalogue-group h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 6px 0 8px; }
.catalogue-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.catalogue-card { display: grid; gap: 6px; justify-items: start; text-align: left; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font: inherit; color: inherit; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.catalogue-card:hover, .catalogue-card:focus-visible { border-color: var(--primary); box-shadow: 0 4px 12px rgba(47, 91, 234, .12); transform: translateY(-1px); }
.catalogue-card strong { font-size: 14px; }
.catalogue-card .note { font-size: 12.5px; }
.catalogue-form { display: grid; gap: 14px; }
.catalogue-field { display: grid; gap: 6px; font-size: 14px; }
.catalogue-field > span:first-child { font-weight: 600; }
.catalogue-field .url-input { flex: none; width: 100%; }
.catalogue-form .dialog-actions { align-items: center; }

/* Pointing at something in the preview */
.picked { margin: 0 16px 10px; padding: 10px 12px; border: 1px solid #c9d6fb; background: #f4f7ff; border-radius: 12px; display: grid; gap: 8px; }
.picked.picking { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--primary); }
.picked.picking .ico { width: 16px; height: 16px; }
.picked.picking .btn { margin-left: auto; }
.picked-head { display: flex; align-items: center; gap: 10px; }
.picked-label { flex: 1; min-width: 0; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; }
.picked-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.quick-bar .btn.is-on { border-color: var(--primary); color: var(--primary); background: #eef2fe; }

/* The conversation always fits the window: its messages scroll, the box stays in view */
@media (min-width: 900px) {
  .editor { align-items: flex-start; }
  .chat { position: sticky; top: 16px; height: calc(100vh - var(--bar-h, 130px) - 40px); max-height: calc(100vh - 32px); }
  .chat .messages { max-height: none; min-height: 120px; }
  .chat .picked, .chat .pending, .chat .attached { flex: none; }
  /* The preview is as tall as the conversation and fits the window too: only the page inside it scrolls */
  .preview { position: sticky; top: 16px; height: calc(100vh - var(--bar-h, 130px) - 40px); min-height: 420px; }
  .preview .frames { min-height: 0; }
  .preview .frame iframe { min-height: 0; }
  div:has(> .editor) + .app-footer { display: none; }
}
.editor.chat-hidden .preview { flex-basis: 100%; }
.chat-toggle .ico { width: 16px; height: 16px; }

/* The site's header: name and Publish on one line, its sections (tabs) on the next, at any width */
.topbar-editor .tabs { order: 3; flex: 1 0 100%; margin: 0 -14px -12px; padding: 4px 0 6px; border-top: 1px solid var(--line); }
.topbar-editor .tabs a { padding: 8px 12px; }

/* Help: a button bottom right, a panel above it */
.help-fab { position: fixed; right: 20px; bottom: 20px; z-index: 900; width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--primary); color: #fff; font: 700 22px/1 inherit; box-shadow: 0 6px 20px rgba(47, 91, 234, .35); cursor: pointer; transition: transform .15s, box-shadow .15s; }
.help-fab:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(47, 91, 234, .4); }
.help-fab.is-open { background: var(--text); }
.help-panel { position: fixed; right: 20px; bottom: 80px; z-index: 900; width: min(380px, calc(100vw - 40px)); max-height: min(640px, calc(100vh - 110px)); display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 20px 50px rgba(16, 24, 40, .2); overflow: hidden; }
.help-panel[hidden] { display: none; }
.help-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.help-head strong { font-size: 15px; }
.help-head .note { flex: 1; font-size: 12.5px; }
.help-body { padding: 12px 16px; overflow-y: auto; display: grid; gap: 10px; }
.help-body h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 4px 0 0; }
.help-tips { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13.5px; }
.help-tips p, .help-a p { margin: 0; }
.help-thread { display: grid; gap: 8px; }
.help-q { justify-self: end; max-width: 85%; background: var(--primary-soft, #eef2fe); padding: 8px 10px; border-radius: 10px; font-size: 13.5px; }
.help-a { display: grid; gap: 6px; font-size: 13.5px; justify-items: start; }
.help-a.is-error { color: var(--danger, #b42318); }
.help-ask { display: flex; gap: 8px; align-items: flex-end; }
.help-ask .url-input { flex: 1; resize: vertical; font-size: 14px; }
.help-foot { margin: 0; font-size: 12px; }
.help-support { padding: 10px 16px; border-top: 1px solid var(--line); font-size: 13px; background: #f9fafb; }
@media (max-width: 600px) { .help-fab { right: 12px; bottom: 12px; } .help-panel { right: 12px; bottom: 70px; } }

/* Changes waiting to be published: the list folds, Undo stays in view */
.pending-head { display: flex; align-items: flex-start; gap: 10px; }
.pending-head details { flex: 1; min-width: 0; }
.pending-head > .btn { flex: none; }

/* Statistics by email */
.reports-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 16px; margin: 0 0 16px; }
.reports-every { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.reports-every select { min-height: 36px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; font: inherit; font-size: 14px; }

/* Get started: two ways in, with or without a Cloudflare account */
.cf-choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin: 6px 0 14px; }
.cf-choice-card { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; background: #fff; }
.cf-choice-card h3 { margin: 0 0 6px; font-size: 16px; }
.cf-choice-card p, .cf-choice-card ol { margin: 0 0 10px; }
.cf-choice-card ol { padding-left: 20px; }
.cf-choice-card li { margin: 4px 0; }

/* Sign-in: what happens next, for newcomers */
.signin-next { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.signin-next h2 { font-size: 15px; margin: 0 0 8px; }
.signin-next ol { margin: 0 0 10px; padding-left: 20px; font-size: 14px; line-height: 1.5; color: var(--text, #333); }
.signin-next li { margin: 6px 0; }
.signin-next .note { font-size: 13px; margin: 0; }

/* Moving a checked site: as it is, or redesigned */
.move-choose { display: grid; gap: 14px; }
.move-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.move-choice { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.move-choice.is-primary { border-color: var(--primary); }
.move-choice-title { display: flex; align-items: center; gap: 8px; }
.move-choice-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 14px; color: var(--muted, #555); flex: 1; }
.move-choice .btn { align-self: flex-start; }
