:root {
  --accent: #1a1a23;
  --accent-soft: #eaf1ff;
  --bg: #ffffff;
  --fg: #0d0d12;
  --muted: #6b6b78;
  --card: #ffffff;
  --border: #e8e8ee;
  --pandas-blue: #c9dcff;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
}

.hidden { display: none !important; }

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 28px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.topbar h1 { margin: 0; font-size: 18px; }
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 18px; letter-spacing: -0.01em;
  color: var(--fg); text-decoration: none;
}
.brand__mark {
  width: 22px; height: 22px; display: inline-block;
}
.brand__name { font-weight: 700; }
.brand__sub {
  margin-left: 4px; padding: 2px 8px;
  font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--border); border-radius: 999px;
}
.topbar .spacer { flex: 1; }
.topnav { display: flex; gap: 4px; margin-left: 12px; }
.topnav__link {
  padding: 6px 12px; border-radius: 6px; color: #555;
  text-decoration: none; font-size: 14px; font-weight: 600;
}
.topnav__link:hover { background: #f2f2f7; color: #111; }
.topnav__link.is-active { background: #f1f1f5; color: var(--fg); }

/* Pandas-themed hero used on the landing page */
.pandas-hero {
  position: relative;
  text-align: center;
  padding: 64px 24px 56px;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, var(--pandas-blue) 0%, rgba(201,220,255,0) 60%),
    linear-gradient(180deg, #f6faff 0%, #ffffff 100%);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.pandas-hero__title {
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0 auto;
  max-width: 760px;
  color: var(--fg);
}
.pandas-hero__sub {
  margin: 16px auto 0;
  max-width: 560px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}
.pandas-hero__cta {
  display: inline-block;
  margin-top: 22px;
  padding: 10px 18px;
  background: var(--fg);
  color: #fff;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
}
.pandas-hero__cta:hover { background: #000; }

.section-eyebrow {
  margin: 36px 0 14px;
  font-size: 12px; font-weight: 700; letter-spacing: .08em;
  color: var(--muted); text-transform: uppercase;
}
.devices-head { margin: 0 0 16px; }
.devices-hint { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.devices-empty {
  border: 1px dashed var(--border); border-radius: 12px;
  padding: 32px 20px; text-align: center; color: var(--muted);
}
.devices-empty p { margin: 4px 0; }

button, .button {
  font: inherit;
  padding: 8px 14px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
}
button.primary {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}
button.primary:hover { filter: brightness(1.05); }
button.danger { color: #b3261e; }
button.link {
  border: none;
  background: transparent;
  padding: 4px 8px;
  color: var(--accent);
}

.container { max-width: 1200px; margin: 0 auto; padding: 24px; }

.empty { color: var(--muted); text-align: center; padding: 40px; }

/* Sessions list + detail */
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 24px 0 6px; }
.section-hint { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
.name-static { font-size: 15px; font-weight: 600; margin: 0; }

.sessions-table { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.sessions-table th, .sessions-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.sessions-table tr:last-child td { border-bottom: 0; }
.sessions-table th { background: #fafafa; font-weight: 600; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.sessions-table .num { font-variant-numeric: tabular-nums; color: var(--muted); }
.sessions-table .muted { color: var(--muted); }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; padding: 16px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.session-path { list-style: none; padding: 0; margin: 8px 0 16px; display: flex; flex-direction: column; gap: 0; }
.session-step { position: relative; display: flex; gap: 12px; padding: 10px 4px; }
.session-step:not(:last-child)::after {
  content: ""; position: absolute;
  left: calc(4px + 13px - 0.75px); top: 50%; bottom: -50%;
  width: 1.5px; background: var(--border); z-index: 0;
}
.session-step__num {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  background: #fff; border: 1.5px solid var(--border);
  position: relative; z-index: 1;
}
.session-step--done .session-step__num { background: #10b981; color: #fff; border-color: #10b981; }
.session-step--current .session-step__num { background: #fff; color: var(--accent, #6C63FF); border-color: var(--accent, #6C63FF); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #6C63FF) 25%, transparent); }
.session-step--visited .session-step__num { background: #fff; color: var(--muted); }
.session-step--pending .session-step__num { background: #fff; color: var(--muted); opacity: 0.55; }
.session-step__body { flex: 1; min-width: 0; padding-top: 2px; }
.session-step__head { display: flex; align-items: baseline; gap: 8px; }
.session-step__type { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.session-step__payload {
  margin-top: 6px;
  padding: 8px 10px;
  background: #f7f7f9;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.5;
  overflow-x: auto;
}
.session-step__summary { margin-top: 4px; font-size: 12px; color: var(--muted); }
.session-step__device {
  margin-top: 8px;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  font-size: 12px;
}
.session-step__device summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--muted);
  list-style: none;
}
.session-step__device summary::-webkit-details-marker { display: none; }
.session-step__device summary::before { content: "▸ "; color: var(--muted); }
.session-step__device[open] summary::before { content: "▾ "; }
.session-step__device .kv {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 4px 12px;
  margin: 8px 0 0;
}
.session-step__device .kv dt { color: var(--muted); }
.session-step__device .kv dd { margin: 0; word-break: break-word; }

.badge--state { background: #ede9fe; color: #5b21b6; }
.badge--passed { background: #dcfce7; color: #166534; }
.badge--failed { background: #fee2e2; color: #b91c1c; }
.badge--pending { background: #f1f5f9; color: #475569; }

.ft-tests { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 4px; }
.ft-test { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; background: #fff; }
.ft-test__name { font-weight: 600; min-width: 100px; }
.ft-test__times { font-size: 12px; flex: 1; }
.ft-test--passed { border-color: #bbf7d0; }
.ft-test--failed { border-color: #fecaca; }
.session-step__ts { font-size: 11px; color: var(--muted); margin-left: auto; font-variant-numeric: tabular-nums; }
.badge--active { background: #dbeafe; color: #1d4ed8; }
.badge--completed { background: #dcfce7; color: #166534; }
.badge--abandoned { background: #fee2e2; color: #b91c1c; }
.badge--visited { background: #f1f5f9; color: #334155; }
.badge--back { background: #fef3c7; color: #92400e; }
.badge--error { background: #fee2e2; color: #b91c1c; }

/* VA results summary inside a session step */
.va-summary { margin-top: 8px; padding: 10px 12px; background: #fafafa; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
.va-summary__head { display: flex; align-items: center; gap: 10px; }
.va-summary__exp { margin-top: 6px; color: var(--muted); line-height: 1.5; }
.va-grid { margin-top: 8px; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.va-photos { margin-top: 10px; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.va-photo { display: flex; flex-direction: column; gap: 4px; background: #fff; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; text-decoration: none; color: inherit; }
.va-photo img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block; background: #f1f5f9; }
.va-photo__label { padding: 4px 8px 6px; font-size: 11px; color: var(--muted); text-transform: capitalize; }
.va-photo:hover { border-color: var(--accent, #6C63FF); }
.va-pill { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; background: #fff; border: 1px solid var(--border); border-radius: 6px; }
.va-pill__label { font-weight: 600; }
.va-defects { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.va-defect { padding: 8px 10px; background: #fff; border: 1px solid var(--border); border-radius: 6px; }
.va-grade {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 22px; padding: 0 8px;
  border-radius: 999px;
  font-weight: 800; font-size: 12px;
}
.va-grade--a { background: #dcfce7; color: #166534; }
.va-grade--b { background: #e0f2fe; color: #075985; }
.va-grade--c { background: #fef3c7; color: #92400e; }
.va-grade--d { background: #fee2e2; color: #b91c1c; }
.va-grade--unknown { background: #f1f5f9; color: #475569; }
.va-sev {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: 2px 6px; border-radius: 999px;
  background: #f1f5f9; color: #475569;
}
.va-sev--minor    { background: #ecfdf5; color: #047857; }
.va-sev--moderate { background: #fef3c7; color: #92400e; }
.va-sev--major,
.va-sev--severe   { background: #fee2e2; color: #b91c1c; }

/* Home page tile grid — each journey is a phone-shaped preview tile. */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}
.tile {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  font: inherit;
  text-align: left;
  padding: 0;
  cursor: pointer;
}
.tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  border-color: #d4d4d8;
}
.tile__link {
  display: flex; flex-direction: column;
  flex: 1;
  text-decoration: none;
  color: inherit;
}
.tile__preview {
  position: relative;
  background: #f5f5f7;
  overflow: hidden;
  aspect-ratio: 9/16;
  border-bottom: 1px solid var(--border);
}
.tile__iframe {
  position: absolute;
  top: 0; left: 0;
  width: 375px;
  height: 666px;
  border: 0;
  transform: scale(0.6);
  transform-origin: 0 0;
  pointer-events: none;
  background: #fff;
}
.tile__head {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tile__name {
  font-size: 14px;
  font-weight: 700;
  color: var(--fg);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tile__head .badge { align-self: flex-start; }

.tile__actions {
  position: absolute;
  top: 8px; right: 8px;
  display: flex; gap: 6px;
  opacity: 0;
  transition: opacity .15s;
  z-index: 2;
}
.tile:hover .tile__actions,
.tile:focus-within .tile__actions { opacity: 1; }
.tile__action {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  background: rgba(17,17,17,0.78);
  color: #fff;
  border: 0;
  border-radius: 6px;
  font-size: 16px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
}
.tile__action:hover { background: rgba(17,17,17,0.92); }
.tile__action--danger:hover { background: #dc2626; }

/* "Create new" tile — dashed outline placeholder */
.tile--new {
  background: transparent;
  border-style: dashed;
  border-width: 2px;
  align-items: stretch;
  cursor: pointer;
}
.tile--new:hover {
  border-color: var(--fg, #111);
  background: rgba(0,0,0,0.02);
}
.tile__preview--new {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  border-bottom: 0;
  background: transparent;
}
.tile__plus {
  font-size: 44px;
  font-weight: 200;
  line-height: 1;
  color: inherit;
}
.tile__new-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  color: inherit;
  text-transform: uppercase;
}

/* Mobile: short, wide tiles instead of phone-tall ones. */
@media (max-width: 600px) {
  .tile-grid { grid-template-columns: 1fr; gap: 10px; }
  .tile { flex-direction: row; }
  .tile__link { flex-direction: row; align-items: stretch; }
  .tile__preview { aspect-ratio: auto; height: 150px; width: 100px; flex-shrink: 0; border-bottom: 0; border-right: 1px solid var(--border); }
  .tile__head { flex: 1; justify-content: center; padding: 10px 14px; }
  .tile--new .tile__preview--new { width: auto; height: 150px; flex-direction: row; padding: 0 16px; }
  .tile__plus { font-size: 30px; }
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-radius: 999px;
  background: #eee;
  color: #555;
}
.badge--draft { background: #fff4d6; color: #7a5d00; }
.badge--published { background: #d6f4e3; color: #137a3f; }

/* studio */
.studio { background: #f0f0f5; }
.back {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  color: var(--muted); text-decoration: none; font-size: 16px; line-height: 1;
  border-radius: 6px;
}
.back:hover { color: var(--fg); background: #f1f1f5; }
.name-input {
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  width: 280px;
}
.name-input:hover, .name-input:focus { background: #fff; border-color: var(--border); outline: none; }

/* Studio topbar — grouped lead (brand · back · journey) and actions (link · save · publish) */
.topbar--studio { gap: 12px; }
.topbar__lead {
  display: flex; align-items: center; gap: 10px; min-width: 0;
}
.topbar__journey {
  display: flex; align-items: center; gap: 8px; min-width: 0;
}
.topbar__divider {
  width: 1px; height: 22px; background: var(--border);
}
.topbar__actions {
  display: flex; align-items: center; gap: 10px;
}
.topbar__link {
  font-size: 13px; font-weight: 600; color: var(--muted);
  text-decoration: none; padding: 6px 10px; border-radius: 6px;
}
.topbar__link:hover { color: var(--fg); background: #f1f1f5; }
.topbar__sep {
  width: 1px; height: 22px; background: var(--border); margin: 0 2px;
}
.topbar__actions > button {
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
}

.studio-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 16px;
  padding: 16px;
  align-items: start;
}
.sidebar, .preview {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
}
.sidebar { display: flex; flex-direction: column; min-width: 0; }
.preview { padding: 16px; }
.sidebar-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}
.sidebar-tabs__tab {
  flex: 1;
  padding: 12px 14px;
  background: transparent;
  border: 0; border-bottom: 2px solid transparent;
  border-radius: 0;
  font: inherit; font-weight: 600; font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.sidebar-tabs__tab:hover { color: #111; }
.sidebar-tabs__tab.is-active {
  color: #111;
  border-bottom-color: var(--accent, #6C63FF);
  background: #fff;
}
.sidebar-panel {
  padding: 14px;
  display: flex; flex-direction: column; gap: 16px;
  max-height: calc(100vh - 130px);
  overflow-y: auto;
}
.sidebar-section { display: flex; flex-direction: column; gap: 8px; }
.sidebar-section__head {
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted);
  margin: 0;
}
.sidebar-section--settings { border-top: 1px solid var(--border); padding-top: 14px; }
.preview h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 10px; }
.palette h2, .preview h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 10px; }

/* Compact blocks list */
.blocks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.block-row {
  display: flex; align-items: center; gap: 4px;
  border: 1px solid var(--border); border-radius: 5px;
  background: #fff;
  opacity: 0.55;
  transition: border-color .15s, background .15s, opacity .15s;
}
.block-row:hover { opacity: 0.85; }
.block-row.is-active {
  border-color: var(--accent, #6C63FF);
  background: #fafafe;
  opacity: 1;
}
.block-row__view {
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  margin-left: 6px;
  background: transparent; border: 0; padding: 0;
  color: var(--muted);
  cursor: pointer;
  border-radius: 4px;
  transition: color .15s;
}
.block-row__view:hover { color: #111; }
.block-row__view.is-previewing { color: var(--accent, #6C63FF); }
.block-row__select {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 8px 10px;
  background: transparent; border: 0; cursor: pointer; font: inherit;
  text-align: left;
}
.block-row__type {
  font-size: 11px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .03em;
}
.block-row__name {
  width: 100%;
  font: inherit; font-weight: 700; font-size: 14px;
  border: 0; padding: 0; background: transparent;
  outline: none;
}
.block-row__name:focus { outline: 1px dashed var(--accent, #6C63FF); outline-offset: 2px; }
.block-row__actions { display: flex; gap: 2px; padding-right: 6px; }
.block-row__actions button {
  width: 24px; height: 24px;
  padding: 0; font-size: 12px; line-height: 1;
  border: 1px solid var(--border); background: #fff;
  border-radius: 6px; cursor: pointer; color: var(--muted);
}
.block-row__actions button:hover:not(:disabled) { background: #f6f6fa; color: #111; }
.block-row__actions button:disabled { opacity: 0.4; cursor: not-allowed; }
.block-row__actions .danger:hover { color: #b91c1c; border-color: #fecaca; }

/* Add block popover */
.add-block-wrap { position: relative; margin-top: 4px; }
.add-block-btn {
  width: 100%;
  padding: 10px 12px;
  border: 1px dashed var(--border); background: #fafbfc;
  border-radius: 8px;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--muted);
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.add-block-btn:hover { color: #111; border-color: var(--accent, #6C63FF); background: #fff; }
.add-block-popover {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px);
  z-index: 30;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  padding: 6px;
  display: flex; flex-direction: column; gap: 2px;
  max-height: min(560px, calc(100vh - 80px)); overflow-y: auto;
}
.add-block-popover .block-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 8px 10px;
  border: 0; background: transparent;
  border-radius: 6px;
  text-align: left;
  cursor: pointer;
}
.add-block-popover .block-tile strong { font-size: 13px; font-weight: 700; }
.add-block-popover .block-tile span { font-size: 11px; color: var(--muted); }
.add-block-popover .block-tile:hover { background: #f5f5f8; }

/* Settings panel inside the sidebar */
.settings-panel { display: flex; flex-direction: column; gap: 10px; }
.settings-panel__head {
  display: flex; flex-direction: column; gap: 2px;
  padding-bottom: 6px; border-bottom: 1px dashed var(--border);
}
.settings-panel__type { font-size: 14px; font-weight: 700; }
.settings-panel__desc { font-size: 12px; color: var(--muted); }
.settings-panel .empty { padding: 16px; font-size: 13px; }

/* Brush button — sits inside text/textarea wrappers to open the
   per-field style editor. */
.block-setting__text-wrap { position: relative; }
.block-setting__text-wrap input[type="text"],
.block-setting__text-wrap textarea { padding-right: 32px; width: 100%; }
.style-brush {
  position: absolute;
  top: 4px; right: 4px;
  width: 24px; height: 24px;
  padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.block-setting__text-wrap--textarea .style-brush { top: 6px; }
.style-brush:hover { color: #111; background: #f1f1f5; }
.style-brush.is-set {
  color: var(--accent, #6C63FF);
  border-color: color-mix(in srgb, var(--accent, #6C63FF) 35%, transparent);
  background: color-mix(in srgb, var(--accent, #6C63FF) 8%, transparent);
}

/* Style editor modal */
.style-editor {
  position: fixed; inset: 0;
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.style-editor.hidden { display: none; }
.style-editor__backdrop {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, 0.45);
}
.style-editor__panel {
  position: relative;
  width: 100%; max-width: 480px; max-height: 90vh;
  display: flex; flex-direction: column;
  background: #fff; border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  overflow: hidden;
}
.style-editor__head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.style-editor__head > div:first-child { flex: 1; min-width: 0; }
.style-editor__title { font-size: 14px; font-weight: 700; }
.style-editor__sub { font-size: 11px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, monospace; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.style-editor__close {
  width: 28px; height: 28px; padding: 0;
  border-radius: 8px; border: 0; background: transparent;
  font-size: 20px; line-height: 1;
  cursor: pointer; color: var(--muted);
}
.style-editor__close:hover { background: #f1f1f5; color: #111; }
.style-editor__preview {
  display: flex; flex-direction: column; gap: 6px;
  padding: 14px 16px;
  background: linear-gradient(180deg, #fafafd 0%, #f3f3f8 100%);
  border-bottom: 1px solid var(--border);
}
.style-editor__preview-label { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.style-editor__preview-box {
  min-height: 48px;
  padding: 10px 12px;
  background: #fff;
  color: #111;
  font-size: 16px;
  font-weight: 500;
  border-radius: 6px;
}
.style-editor__body {
  padding: 14px 16px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px;
}
.style-editor__row { display: flex; gap: 10px; }
.style-editor__row--pair > .style-editor__field { flex: 1; }
.style-editor__row--triple > .style-editor__field { flex: 1; }
.style-editor__field {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 11px;
}
.style-editor__field > span {
  font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
}
.style-editor__field input[type="text"],
.style-editor__field input[type="number"],
.style-editor__field select {
  font: inherit; font-size: 13px;
  padding: 6px 8px;
  border: 1px solid var(--border); border-radius: 6px;
  background: #fff;
}
.style-editor__color { display: inline-flex; gap: 6px; align-items: center; }
.style-editor__color input[type="color"] {
  width: 32px; height: 28px;
  padding: 0; border: 1px solid var(--border); border-radius: 6px;
  background: none;
}
.style-editor__clear-color {
  width: 22px; height: 22px; padding: 0;
  border: 1px solid var(--border); border-radius: 50%;
  background: #fff; cursor: pointer; color: var(--muted); font-size: 12px; line-height: 1;
}
.style-editor__clear-color:hover { color: #111; background: #f1f1f5; }
.style-editor__foot {
  display: flex; gap: 8px; align-items: center;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: #fafafd;
}
.style-editor__foot .spacer { flex: 1; }
.style-editor__btn {
  font: inherit; font-size: 13px;
  padding: 7px 12px;
  border: 1px solid var(--border); border-radius: 8px;
  background: #fff; cursor: pointer;
}
.style-editor__btn:hover { background: #f1f1f5; }
.style-editor__btn--primary {
  border-color: transparent;
  background: var(--accent, #6C63FF);
  color: #fff;
}
.style-editor__btn--primary:hover { filter: brightness(1.05); background: var(--accent, #6C63FF); }
.sidebar label { font-size: 13px; }
.sidebar input[type=color] { width: 36px; height: 28px; border: none; padding: 0; background: none; }

.theme-button { margin-top: 10px; font-size: 13px; }
.theme-button > summary { cursor: pointer; padding: 6px 0; color: var(--muted); font-weight: 600; user-select: none; }
.sidebar .theme-row {
  display: flex; flex-direction: column;
  align-items: stretch; justify-content: flex-start;
  gap: 4px; margin-top: 10px;
  font-size: 12px;
  text-align: left;
}
.sidebar .theme-row > span:first-child {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: 11px;
  font-weight: 600;
}
.sidebar .theme-row input[type="number"],
.sidebar .theme-row input[type="text"] { width: 100%; padding: 6px 8px; border: 1px solid var(--border); border-radius: 4px; font: inherit; }
.sidebar .theme-row select { flex: 1; padding: 6px 8px; border: 1px solid var(--border); border-radius: 4px; font: inherit; min-width: 0; }
.sidebar .theme-row input[type="color"] { width: 36px; height: 28px; border: 1px solid var(--border); border-radius: 4px; padding: 0; background: none; flex-shrink: 0; }
.sidebar .theme-row__inputs { display: flex; gap: 6px; align-items: center; justify-content: flex-start; }
.sidebar .theme-row__btn { padding: 4px 8px; border: 1px solid var(--border); border-radius: 4px; background: #fff; cursor: pointer; font-size: 12px; }
.sidebar .theme-row__btn--clear { padding: 4px 8px; line-height: 1; }
.sidebar .theme-row__pair { display: flex; gap: 8px; }
.sidebar .theme-row__pair > .theme-row { flex: 1; min-width: 0; }

.fonts-list { list-style: none; margin: 8px 0 6px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.fonts-list__item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 4px; font-size: 12px; background: #fff; }
.fonts-list__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fonts-list__empty { font-size: 12px; color: var(--muted); padding: 4px 0; list-style: none; }
.fonts-add { display: flex; gap: 6px; margin-top: 4px; }
.fonts-add input { flex: 1; padding: 6px 8px; border: 1px solid var(--border); border-radius: 4px; font: inherit; font-size: 12px; min-width: 0; }
.fonts-hint { font-size: 11px; color: var(--muted); margin: 6px 0 0; }

.block-tile {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.block-tile strong { display: block; font-size: 14px; }
.block-tile span { font-size: 12px; color: var(--muted); }

.canvas { min-height: 300px; }
.blocks { list-style: none; margin: 0; padding: 0; }
.block-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: #fafafd;
}
.block-card__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.block-card__toggle {
  flex-shrink: 0;
  width: 22px; height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 4px;
  transition: transform .15s, background .12s, color .12s;
}
.block-card__toggle:hover { background: #eee; color: var(--fg); }
.block-card--collapsed .block-card__toggle { transform: rotate(-90deg); }
.block-card--collapsed .block-card__body,
.block-card--collapsed .block-card__settings { display: none; }
.block-card__head > strong { flex: 1; }
.block-card__actions button { padding: 4px 8px; font-size: 12px; }
.block-card__body { font-size: 12px; color: var(--muted); margin-top: 6px; }
.block-card__settings {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  display: flex; flex-direction: column; gap: 10px;
}
/* Section tabs */
.block-tabs {
  top: -15px;
  position: sticky;
  z-index: 10;
  background: white;
  display: flex; gap: 2px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: thin;
}
.block-tabs__tab {
  padding: 8px 12px;
  background: transparent;
  border: 0; border-bottom: 2px solid transparent;
  border-radius: 0;
  font: inherit; font-weight: 600; font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s, border-color .15s, background .15s;
}
.block-tabs__tab:hover { color: #111; background: #f6f6fa; }
.block-tabs__tab.is-active {
  color: #111;
  border-bottom-color: var(--accent, #6C63FF);
}
.block-tabs__check {
  color: var(--accent, #6C63FF);
  font-weight: 800;
  margin-right: 2px;
}
.block-tabs__panel {
  display: flex; flex-direction: column; gap: 8px;
}

/* Groups — inline label, no chrome */
.block-group { display: flex; flex-direction: column; gap: 6px; }
.block-group__head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 4px;
}
.block-group__toggle {
  position: relative;
  display: inline-flex; align-items: center;
  cursor: pointer;
}
.block-group__toggle input {
  position: absolute; opacity: 0; pointer-events: none;
}
.block-group__toggle-track {
  width: 30px; height: 18px; border-radius: 999px;
  background: #d1d5db;
  transition: background .15s;
  display: inline-block; position: relative;
}
.block-group__toggle-knob {
  position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
  transition: transform .15s;
}
.block-group__toggle input:checked + .block-group__toggle-track {
  background: var(--accent, #6C63FF);
}
.block-group__toggle input:checked + .block-group__toggle-track .block-group__toggle-knob {
  transform: translateX(12px);
}
.block-group__body {
  display: flex; flex-direction: column; gap: 6px;
}
.block-setting-row-flex {
  display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap;
}
.block-setting-row-flex > .block-setting { flex: 1 1 140px; min-width: 0; }
@media (max-width: 720px) {
  .block-setting-row-flex { flex-direction: column; align-items: stretch; }
  .block-setting-row-flex > .block-setting { flex-basis: auto; }
}

.block-card__name {
  flex: 1; min-width: 0;
  font: inherit; font-weight: 700; font-size: 14px;
  padding: 4px 6px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: inherit;
}
.block-card__name:hover { border-color: var(--border); background: #fff; }
.block-card__name:focus { border-color: var(--accent); background: #fff; outline: none; }
.block-card__name::placeholder { color: var(--fg); opacity: 1; font-weight: 700; }
.block-setting {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--fg);
  cursor: pointer;
}
.block-setting--stack {
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  cursor: default;
}
.block-setting--stack input[type="text"],
.block-setting--stack textarea {
  width: 100%;
  font: inherit;
  font-size: 13px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  resize: vertical;
}
.block-setting--stack > span {
  font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted);
}

.block-setting-color-row {
  display: inline-flex; align-items: center; gap: 6px;
}

.block-setting-image-row {
  display: flex; align-items: center; gap: 6px;
}
.block-setting-image-row input[type="text"] {
  flex: 1;
  font: inherit;
  font-size: 13px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  min-width: 0;
}
.block-setting-upload {
  flex-shrink: 0;
  padding: 6px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
.block-setting-upload:hover { filter: brightness(1.05); }
.block-setting-upload[disabled] { opacity: .5; cursor: not-allowed; }
.block-setting-image-preview {
  display: block;
  margin-top: 6px;
  max-height: 100px;
  max-width: 100px;
  border-radius: 6px;
  border: 1px solid var(--border);
  object-fit: cover;
}
.block-setting-color-row input[type="color"] {
  width: 36px; height: 28px; padding: 0;
  border: 1px solid var(--border); border-radius: 6px;
  background: #fff; cursor: pointer;
}
.block-setting-clear {
  width: 22px; height: 22px;
  padding: 0; border: 1px solid var(--border); border-radius: 50%;
  background: #fff; color: var(--muted);
  cursor: pointer; line-height: 1;
}
.block-setting-clear:hover { color: var(--fg); }

/* New image picker — preview tile + click/drop empty state */
.image-pick {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 96px;
  padding: 12px;
  border: 1.5px dashed var(--border);
  border-radius: 8px;
  background: #fafbfc;
  cursor: pointer;
  text-align: center;
  transition: border-color .15s, background .15s;
  font: inherit;
}
.image-pick--empty {
  flex-direction: column;
  gap: 4px;
  color: var(--muted);
}
.image-pick--empty:hover,
.image-pick.is-dragover {
  border-color: var(--accent, #6C63FF);
  background: #fff;
  color: #111;
}
.image-pick__icon { font-size: 24px; font-weight: 700; line-height: 1; color: var(--muted); }
.image-pick--empty:hover .image-pick__icon,
.image-pick.is-dragover .image-pick__icon { color: var(--accent, #6C63FF); }
.image-pick__label { font-size: 12px; font-weight: 600; }
.image-pick__hint { font-size: 11px; color: var(--muted); }
.image-pick--filled {
  padding: 0;
  border-style: solid;
  background: #fff;
  overflow: hidden;
}
.image-pick--filled img {
  display: block;
  width: 100%;
  max-height: 140px;
  object-fit: contain;
}
.image-pick__remove {
  position: absolute; top: 6px; right: 6px;
  width: 24px; height: 24px;
  padding: 0;
  border: 0; border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 14px; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.image-pick__remove:hover { background: rgba(0,0,0,0.75); }

.image-blend {
  margin-top: 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
  background: #fafafa;
}
.image-blend summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--muted);
  list-style: none;
}
.image-blend summary::-webkit-details-marker { display: none; }
.image-blend summary::before { content: "▸ "; color: var(--muted); }
.image-blend[open] summary::before { content: "▾ "; }
.image-blend__row {
  display: flex; align-items: center; gap: 6px;
  margin-top: 6px;
}
.image-blend__row select {
  flex: 1; min-width: 0;
  padding: 6px 8px; border-radius: 6px;
  border: 1px solid var(--border); font: inherit; font-size: 12px;
}
.image-blend__row input[type="color"] {
  width: 32px; height: 28px; padding: 0;
  border: 1px solid var(--border); border-radius: 6px;
}

/* Two image fields in the same group: lay them out side-by-side. */
.block-group__images-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.block-group__images-row .block-setting--image { min-width: 0; }

.block-setting--stack select {
  font: inherit;
  font-size: 13px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  width: 100%;
}

.block-setting-stepper {
  display: inline-flex; align-items: stretch;
  align-self: flex-start;
  width: 140px;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}
.block-setting-stepper button {
  width: 36px;
  background: transparent;
  border: 0;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: var(--fg);
  padding: 0;
}
.block-setting-stepper input {
  flex: 1;
  width: 100%;
  border: 0;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  text-align: center;
  font: inherit;
  font-size: 14px;
  padding: 6px 8px;
  outline: none;
  background: transparent;
}
.block-setting-stepper input::-webkit-outer-spin-button,
.block-setting-stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}
.block-setting-stepper input { -moz-appearance: textfield; }
.block-setting-list-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); margin: 4px 0 6px;
}
.block-setting-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex; flex-direction: column; gap: 4px;
}
.block-setting-row {
  display: flex; flex-direction: column; gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
}
.block-setting-row__head { display: flex; align-items: center; gap: 8px; }
.block-setting-row__body {
  display: flex; flex-direction: column; gap: 8px;
  padding: 4px 0 2px 28px;
  border-top: 1px dashed var(--border);
  margin-top: 2px;
}
.block-setting-row__label { flex: 1; }
.block-setting-row button {
  padding: 2px 8px;
  font-size: 12px;
}
.block-setting-row__head input[type="checkbox"]:not(:checked) ~ .block-setting-row__label {
  color: var(--muted);
  text-decoration: line-through;
}

.preview-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.preview-head h2 { margin: 0; }
.device-toggle { display: inline-flex; gap: 4px; }
.device-toggle button {
  padding: 4px 10px; font-size: 14px;
  border: 1px solid var(--border); background: #fff;
}
.device-toggle button.active {
  background: var(--accent); color: #fff; border-color: transparent;
}
.preview-open {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  margin-left: 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  background: #fff;
  cursor: pointer;
  text-decoration: none;
}
.preview-open:hover { color: var(--fg); border-color: #cfcfd4; }

.preview-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 8px 0 12px;
  display: flex;
  justify-content: center;
}
.preview-w-readout {
  margin-left: auto;
  padding: 4px 8px;
  font-size: 11px; font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  background: #f6f6fa;
  border-radius: 6px;
}
.device-frame {
  position: relative;
  display: flex;
  align-items: stretch;
  background: #1a1a23;
  border-radius: 28px;
  padding: 10px;
  margin: 0 auto;
  width: var(--preview-w, 390px);
  height: calc(100vh - 180px);
  min-height: 480px;
  max-height: 900px;
  flex-shrink: 0;
}
.device-frame iframe {
  flex: 1;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 22px;
  background: #fff;
}
.device-frame__resize {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 8px; height: 56px;
  background: #c5c7d0;
  border-radius: 6px;
  cursor: ew-resize;
  z-index: 5;
  transition: background .15s, transform .15s;
}
.device-frame__resize::before {
  content: ""; position: absolute; inset: -16px;
}
.device-frame__resize:hover,
body.preview-resizing .device-frame__resize { background: var(--accent, #6C63FF); }
.device-frame__resize[data-resize="left"]  { left: -14px; }
.device-frame__resize[data-resize="right"] { right: -14px; }
body.preview-resizing { user-select: none; }
body.preview-resizing iframe { pointer-events: none; }

.device-modal {
  position: fixed; inset: 0;
  background: rgba(15, 15, 22, 0.85);
  z-index: 100;
  display: flex; flex-direction: column;
}
.device-modal__bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; color: #fff;
  background: rgba(0,0,0,.4);
}
.device-modal__bar .link { color: #fff; }
.device-modal__stage {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  overflow: auto;
  padding: 24px;
}

/* runtime */
.runtime { background: #000; }
.stage { position: fixed; inset: 0; }
.stage iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.done, .error {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: #fff; color: var(--fg);
  padding: 24px; text-align: center;
}
.error { color: #b3261e; }

/* Resume screen — mirrors the cosmetics block layout:
     header → flex-grow illustration → option cards → action bar
   The journey theme is applied via .bk-btn-primary on the CTA. */
.resume {
  position: fixed; inset: 0;
  background: #f5f5f7;
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.resume.hidden { display: none; }
.resume__stage {
  flex: 1;
  display: flex; flex-direction: column;
  width: 100%; max-width: 540px;
  margin: 0 auto;
  min-height: 100%;
}
.resume__header { padding: 32px 28px 0; }
.resume__title { font-size: 26px; font-weight: 800; line-height: 1.15; letter-spacing: -0.01em; }
.resume__summary { color: #6b7280; margin-top: 8px; font-size: 15px; line-height: 1.5; }

.resume__illu {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  min-height: 0;
  color: var(--accent, #6C63FF);
}
.resume__illu svg {
  width: 100%; max-width: 220px;
  max-height: 100%;
  display: block;
}

.resume__options { display: flex; flex-direction: column; gap: 10px; padding: 0 20px; }
/* The actual option-card styling is the shared .bk-option class in
   blocks-shared.css — same one used by the cosmetics selection page,
   themed via --opt-* CSS variables that applyOptionStyleFromJourney()
   pulls from the cosmetics block's config. */

.resume__actions {
  padding: 16px 20px 24px;
  margin-top: auto;
  display: flex; gap: 10px; align-items: stretch;
}
.resume__actions .bk-btn-primary { flex: 1; }

@media (max-width: 900px) {
  .studio-grid { grid-template-columns: 1fr; }
}

/* Sessions list — drop low-value columns on tablet/phone and tighten layout */
@media (max-width: 900px) {
  .container { padding: 16px; }
  .sessions-table { font-size: 12px; display: block; overflow-x: auto; }
  /* Hide External ID (6), Device (7), IP (8) on narrow screens */
  .sessions-table th:nth-child(6), .sessions-table td:nth-child(6),
  .sessions-table th:nth-child(7), .sessions-table td:nth-child(7),
  .sessions-table th:nth-child(8), .sessions-table td:nth-child(8) { display: none; }
}

@media (max-width: 640px) {
  .sessions-table th, .sessions-table td { padding: 8px 8px; }
  /* Also hide the trailing "open" link — first column already links */
  .sessions-table th:nth-child(9), .sessions-table td:nth-child(9) { display: none; }
  /* Hide Progress (4) too — keep Started, Status, State, Updated */
  .sessions-table th:nth-child(4), .sessions-table td:nth-child(4) { display: none; }
  .sessions-table .badge { font-size: 10px; padding: 2px 6px; }
}

/* Session detail — stack header rows and tighten step list on mobile */
@media (max-width: 640px) {
  .kv { grid-template-columns: 1fr; gap: 2px 0; padding: 12px; }
  .kv dt { margin-top: 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
  .session-step { padding: 8px 2px; gap: 10px; }
  .session-step__ts { display: none; }
  .session-step__payload { font-size: 11px; }
}

@media (max-width: 640px) {
  .topbar {
    flex-wrap: wrap;
    padding: 10px 12px;
    gap: 8px;
  }
  .topbar .spacer { display: none; }
  .topbar .name-input {
    width: 100%;
    background: #fff;
    border: 1px solid var(--border);
    padding: 8px 10px;
  }

  /* Studio: lead becomes row 1 (brand + back + actions), journey name wraps to row 2 */
  .topbar--studio { gap: 6px; }
  .topbar__lead {
    flex: 1 1 auto;
    gap: 6px;
  }
  .topbar__divider { display: none; }
  .brand,
  .topbar--studio .back { display: none; }
  .topbar__journey {
    order: 10;
    flex: 1 1 100%;
    width: 100%;
    flex-wrap: wrap;
    row-gap: 6px;
  }
  .topbar__journey .name-input { flex: 1 1 100%; width: auto; }
  .topbar__journey .badge { flex: 0 0 auto; }
  .topbar__actions { gap: 6px; margin-left: auto; }
  .topbar__link { padding: 6px 8px; font-size: 12px; }
  .topbar__sep { display: none; }
}

/* ── Image picker modal ───────────────────────────────────────────── */
.img-picker__overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(15, 23, 42, 0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.img-picker__sheet {
  width: 100%; max-width: 720px;
  max-height: calc(100vh - 40px);
  background: #fff; border-radius: 14px;
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(0,0,0,0.25);
}
.img-picker__head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.img-picker__tabs { display: flex; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; }
.img-picker__tab {
  background: transparent; border: 0; padding: 6px 10px;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  font: inherit; font-weight: 600; font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.img-picker__tab:hover { color: #111; }
.img-picker__tab.is-active { color: #111; border-bottom-color: var(--accent, #6C63FF); }
.img-picker__close {
  width: 28px; height: 28px;
  border: 0; background: transparent;
  font-size: 22px; line-height: 1; cursor: pointer;
  color: var(--muted); border-radius: 6px;
}
.img-picker__close:hover { background: #f1f5f9; color: #111; }
.img-picker__body {
  flex: 1; min-height: 0;
  padding: 16px;
  overflow-y: auto;
}
.img-picker__upload {
  border: 2px dashed var(--border); border-radius: 12px;
  padding: 36px 20px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: var(--muted);
}
.img-picker__upload.is-over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, #fff); }
.img-picker__hint { font-size: 12px; }
.img-picker__link { display: flex; flex-direction: column; gap: 10px; }
.img-picker__link label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.img-picker__link input {
  padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--border); font: inherit;
}
.img-picker__link-actions { display: flex; justify-content: flex-end; }
.img-picker__search { display: flex; flex-direction: column; gap: 12px; }
.img-picker__search input[type="search"] {
  padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--accent); font: inherit;
}
.img-picker__grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}
.img-picker__cell {
  background: transparent; border: 1px solid var(--border); border-radius: 8px;
  padding: 0; overflow: hidden; cursor: pointer;
  display: flex; flex-direction: column;
  transition: border-color .15s, transform .1s;
}
.img-picker__cell:hover { border-color: var(--accent); }
.img-picker__cell:active { transform: scale(0.98); }
.img-picker__cell img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; }
.img-picker__by { font-size: 10px; color: var(--muted); padding: 4px 6px; text-align: left; }
.img-picker__by a { color: inherit; }
.img-picker__status, .img-picker__error {
  grid-column: 1 / -1;
  text-align: center; color: var(--muted); font-size: 13px; padding: 16px 0;
}
.img-picker__error { color: #b91c1c; }

/* ── Audit log page ───────────────────────────────────────────────── */
.audit-filters {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: end;
  padding: 14px; background: var(--card);
  border: 1px solid var(--border); border-radius: 10px;
}
.audit-filters label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 12px; color: var(--muted);
}
.audit-filters input,
.audit-filters select {
  padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 6px; font: inherit; font-size: 13px;
  min-width: 180px;
}
.audit-payload {
  margin: 0; padding: 6px 8px;
  background: #f7f7f9; border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 11px; line-height: 1.4;
  white-space: pre-wrap; word-break: break-word;
  max-height: 120px; overflow: auto;
}

.audit-action {
  display: inline-block;
  padding: 2px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
  background: #f1f5f9; color: #334155;
}
.audit-action--auth     { background: #ede9fe; color: #5b21b6; }
.audit-action--journey  { background: #dbeafe; color: #1e3a8a; }
.audit-action--secret   { background: #fef3c7; color: #92400e; }
.audit-action--device   { background: #dcfce7; color: #166534; }
.audit-action--upload   { background: #fce7f3; color: #9d174d; }
.audit-target {
  display: inline-block; padding: 1px 6px;
  font-size: 11px; font-weight: 600; color: var(--muted);
  background: #f6f6f8; border-radius: 4px;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.audit-details code {
  font-size: 12px; padding: 1px 5px;
  background: #f3f4f6; border-radius: 4px;
}
.audit-details strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
