:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --text: #1c2430;
  --muted: #667085;
  --border: #e3e6eb;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft: #e8efff;
  --danger: #d92d20;
  --danger-soft: #fdecea;
  --ok: #067647;
  --ok-soft: #e7f6ee;
  --warn: #b54708;
  --warn-soft: #fef3e6;
  --radius: 10px;
  --shadow: 0 1px 2px rgb(16 24 40 / 6%), 0 6px 18px rgb(16 24 40 / 6%);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111418;
    --surface: #1a1e24;
    --surface-2: #20252c;
    --text: #e8ebef;
    --muted: #9aa3ae;
    --border: #2c323a;
    --accent: #5b8cff;
    --accent-strong: #7aa2ff;
    --accent-soft: #1d2a45;
    --danger: #ff6b5e;
    --danger-soft: #3a1c1a;
    --ok: #4fd18b;
    --ok-soft: #15301f;
    --warn: #f5a35c;
    --warn-soft: #36260f;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 1.6rem; } h2 { font-size: 1rem; } h3 { font-size: 0.95rem; margin: 18px 0 4px; }
a { color: var(--accent); }
[hidden] { display: none !important; }

button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 34px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap;
}
button:hover:not(:disabled), .button:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
button:disabled { opacity: 0.45; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover:not(:disabled) { background: var(--accent-strong); }
button.ghost, .button.ghost { background: transparent; border-color: transparent; }
button.ghost:hover:not(:disabled), .button.ghost:hover { background: var(--surface-2); border-color: var(--border); }
button.danger { color: var(--danger); }
button.danger:hover:not(:disabled) { background: var(--danger-soft); border-color: var(--danger); }
button.wide { width: 100%; }
button.small { min-height: 28px; padding: 0 10px; font-size: 0.85rem; }
.icon-button { min-height: 30px; min-width: 30px; padding: 0 6px; border-color: transparent; background: transparent; }
.icon-button:hover:not(:disabled) { background: var(--surface-2); border-color: var(--border); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

input, textarea, select {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); font: inherit;
}
textarea { resize: vertical; min-height: 64px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type="color"] { padding: 2px; height: 38px; cursor: pointer; }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field > span { font-weight: 600; font-size: 0.85rem; }
.field small { line-height: 1.4; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.grow { flex: 1; }
.actions { display: flex; justify-content: flex-end; gap: 8px; }
.actions.start { justify-content: flex-start; }
.form-error { margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--danger-soft); color: var(--danger); }
.prefixed { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.prefixed span { padding-left: 10px; color: var(--muted); white-space: nowrap; }
.prefixed input { border: 0; background: transparent; box-shadow: none !important; padding-left: 2px; }
.prefixed:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.small { font-size: 0.7rem; padding: 0 6px; }

.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.05rem; }
.logo img { width: 26px; height: 26px; }

/* Sign in */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; position: relative; }
.auth-card { width: min(400px, 100%); padding: 32px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 1.35rem; margin-top: 8px; }
.auth-card p { margin: 0; }
.auth-lang { position: absolute; top: 16px; right: 16px; }

/* Top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 56px; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.topbar-left, .topbar-actions { display: flex; align-items: center; gap: 6px; min-width: 0; }
.topbar-left strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.save-status { color: var(--muted); font-size: 0.85rem; padding: 0 6px; white-space: nowrap; }
.save-status.pending { color: var(--warn); }
.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; }
.segmented button { min-height: 28px; border: 0; background: transparent; padding: 0 12px; }
.segmented button[aria-pressed="true"] { background: var(--surface); box-shadow: var(--shadow); }

/* Websites */
.sites { width: min(1100px, 100% - 32px); margin: 32px auto; }
.sites-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.site-card { display: grid; gap: 6px; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); }
.site-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.site-card h2 { font-size: 1.1rem; }
.site-card p { margin: 0; overflow-wrap: anywhere; }
.site-card-actions { display: flex; gap: 8px; margin-top: 10px; }
.empty { padding: 60px 0; text-align: center; font-size: 1.05rem; }

/* Editor: menu bar, toolbar, icon rail, panels, canvas */
.icon { display: inline-flex; width: 20px; height: 20px; }
.icon svg { width: 100%; height: 100%; }
.menubar { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 48px; padding: 0 12px; background: var(--surface); border-bottom: 1px solid var(--border); }
.menubar-left, .menubar-right { display: flex; align-items: center; gap: 2px; min-width: 0; }
.menubar-logo { width: 28px; height: 28px; margin-right: 10px; }
.menubar-site { margin-left: 14px; padding-left: 14px; border-left: 1px solid var(--border); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.menu-button { border: 0; background: transparent; min-height: 32px; padding: 0 12px; font-weight: 500; }
.menu-button:hover:not(:disabled) { background: var(--surface-2); }
.menu-button.accent { color: var(--accent); }
.menu-anchor { position: relative; }
button.pill { border-radius: 999px; padding: 0 20px; margin-left: 6px; }
.dropdown { position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; min-width: 220px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 32px rgb(16 24 40 / 16%); display: grid; }
.dropdown hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
.dropdown-item { justify-content: flex-start; border: 0; background: transparent; min-height: 34px; }
.dropdown-item:hover { background: var(--surface-2); }
.dropdown-item.danger { color: var(--danger); }

.toolbar { display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 12px; background: var(--surface); border-bottom: 1px solid var(--border); }
.page-picker { display: flex; align-items: center; gap: 8px; padding-right: 12px; border-right: 1px solid var(--border); }
.page-picker span { color: var(--muted); white-space: nowrap; }
.page-picker select { width: 180px; border: 0; background: transparent; font-weight: 600; padding: 4px 6px; }
.device-toggle { display: flex; gap: 2px; padding-right: 12px; border-right: 1px solid var(--border); }
.device-toggle [aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }
.address { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; height: 32px; padding: 0 12px; border-radius: 8px; background: var(--surface-2); color: var(--muted); }
.address .icon { width: 16px; height: 16px; flex: none; }
.address span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.toolbar-right { display: flex; align-items: center; gap: 4px; padding-left: 12px; border-left: 1px solid var(--border); }
.zoom { width: auto; border: 0; background: transparent; padding: 4px; }

.workspace { display: flex; height: calc(100vh - 94px); }
.rail { flex: none; width: 60px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 0; background: var(--surface); border-right: 1px solid var(--border); }
.rail button { width: 42px; height: 42px; padding: 0; border: 0; border-radius: 12px; background: transparent; color: var(--text); }
.rail button:hover { background: var(--surface-2); }
.rail button.active { background: var(--accent-soft); color: var(--accent); }
.rail .icon { width: 22px; height: 22px; }
.panel { flex: none; width: 340px; display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--border); border-top: 3px solid var(--accent); box-shadow: 4px 0 16px rgb(16 24 40 / 6%); z-index: 2; }
.panel.wide { width: 600px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.panel-head h2 { font-size: 1.02rem; }
.panel-body { flex: 1; overflow-y: auto; padding: 14px; }
.panel.wide .panel-body { padding: 0; overflow: hidden; }
.panel-foot { position: sticky; bottom: -14px; display: flex; gap: 8px; padding: 12px 0 14px; background: var(--surface); }
.panel-foot button { flex: 1; }

.menu-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.menu-entry { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.menu-entry.active { border-color: var(--accent); background: var(--accent-soft); }
.menu-entry.is-hidden .menu-title { color: var(--muted); }
.menu-entry.drop { border-style: dashed; border-color: var(--accent); }
.menu-row { display: flex; align-items: center; gap: 2px; padding: 0 6px 0 4px; min-height: 42px; }
.menu-title { flex: 1; justify-content: flex-start; gap: 10px; min-width: 0; border: 0; background: transparent; padding: 0 6px; text-transform: uppercase; letter-spacing: 0.02em; font-size: 0.85rem; }
.menu-title .icon { width: 16px; height: 16px; flex: none; color: var(--muted); }
.menu-title span:last-child { overflow: hidden; text-overflow: ellipsis; }
.menu-entry .drag { width: 12px; cursor: grab; }
.icon-button.subtle { color: var(--muted); opacity: 0; }
.menu-entry:hover .icon-button.subtle, .menu-entry.active .icon-button.subtle { opacity: 1; }
.icon-button.active { background: var(--accent-soft); color: var(--accent); }
.icon-button .icon { width: 18px; height: 18px; }
.menu-options { padding: 10px 12px 14px; border-top: 1px solid var(--border); }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { width: auto; margin-top: 3px; }
.check span { display: grid; gap: 2px; font-weight: 600; font-size: 0.85rem; }
.check small { font-weight: 400; }

.side-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 2px; }
.side-list li { display: flex; align-items: center; border-radius: 8px; border: 1px solid transparent; cursor: grab; }
.side-list li:hover { background: var(--surface-2); }
.side-list li.active { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.side-list li.drop { border-color: var(--accent); border-style: dashed; }
.side-item { flex: 1; justify-content: flex-start; gap: 8px; min-width: 0; border: 0; background: transparent; padding: 0 8px; text-align: left; }
.side-item span:last-child { overflow: hidden; text-overflow: ellipsis; }
.drag { color: var(--muted); }
.block-icon { width: 20px; text-align: center; }
.color-field { grid-template-columns: 1fr 64px; align-items: center; }

/* Site design panel */
.design { display: grid; gap: 10px; }
.design h3 { margin: 10px 0 2px; font-size: 0.9rem; }
.design-top { display: grid; gap: 8px; justify-items: center; padding: 4px 0 14px; border-bottom: 1px solid var(--border); }
.theme-card { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; border-radius: 10px; box-shadow: var(--shadow); border: 1px solid var(--border); text-align: left; }
.theme-card div { display: grid; gap: 4px; min-width: 0; }
.theme-card strong { font-size: 1.15rem; }
.theme-card small { font-size: 0.78rem; line-height: 1.3; opacity: 0.85; }
.swatches { display: flex; gap: 4px; flex: none; }
.swatch { width: 18px; height: 22px; border-radius: 4px; border: 1px solid rgb(0 0 0 / 12%); }
.swatch.big { width: 38px; height: 38px; padding: 0; min-height: 0; border-radius: 8px; cursor: pointer; }
.swatch.big.active { outline: 3px solid var(--accent); outline-offset: 2px; }
.swatch-row { display: flex; flex-wrap: wrap; gap: 10px; }
.link-button { border: 0; background: transparent; color: var(--accent); min-height: 28px; }
.design-row { justify-content: flex-start; gap: 12px; min-height: 48px; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: transparent; padding: 0 4px; }
.design-row:hover { background: var(--surface-2); }
.design-row-icon { width: 22px; text-align: center; color: var(--muted); font-size: 1.05rem; }
.design-row-go { margin-left: auto; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--accent); color: var(--accent); font-size: 1rem; line-height: 1; }
.design-back { justify-self: start; border: 0; background: transparent; padding: 0 4px; font-weight: 600; color: var(--accent); }
.theme-option { width: 100%; padding: 0; border: 0; background: transparent; height: auto; display: block; text-align: left; white-space: normal; }
.theme-option:hover .theme-card { box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }
.choice { display: grid; justify-items: start; gap: 2px; height: auto; padding: 12px 14px; text-align: left; white-space: normal; }
.choice.active { border-color: var(--accent); background: var(--accent-soft); }
.color-field > span { display: grid; gap: 2px; }
.color-field small { font-weight: 400; }

.design h4 { margin: 0 0 8px; font-size: 0.85rem; font-weight: 600; }
.design-section { padding: 12px 0; border-top: 1px solid var(--border); }
.tile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.color-tile { position: relative; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px; border-radius: 6px; border: 1px solid rgb(0 0 0 / 12%); cursor: pointer; font-size: 0.8rem; overflow: hidden; }
.color-tile input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.color-tile-label { opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shade-bar { height: 12px; margin-top: 10px; border-radius: 3px; }
.design-advanced { border-top: 1px solid var(--border); padding-top: 10px; }
.design-advanced summary { cursor: pointer; font-weight: 500; color: var(--muted); margin-bottom: 8px; }
.design-foot { display: flex; justify-content: center; padding-top: 18px; }
.font-select { font-size: 0.95rem; }
.font-sample { margin-top: 8px; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); }
.font-sample.heading { font-size: 1.3rem; font-weight: 700; } .font-sample.body { font-size: 0.92rem; line-height: 1.5; }
.bg-preview { height: 110px; border-radius: 8px; border: 1px solid var(--border); }
.bg-tabs { display: flex; justify-content: center; gap: 8px; padding: 10px; border-radius: 8px; background: var(--accent-soft); }
.bg-tabs button { border-radius: 999px; min-height: 30px; }
.bg-tabs button.active { border-color: var(--accent); color: var(--accent); }

.transition-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 10px; }
.transition-tile { display: grid; justify-items: center; gap: 6px; height: auto; padding: 0; border: 0; background: transparent; white-space: normal; }
.transition-icon { position: relative; display: block; width: 72px; height: 72px; border-radius: 10px; background: var(--accent-soft); overflow: hidden; }
.transition-icon.none::after { content: ""; position: absolute; left: -10%; top: 50%; width: 120%; border-top: 2px solid var(--danger); transform: rotate(-45deg); }
.transition-icon .sheet { position: absolute; left: 26px; top: 20px; width: 22px; height: 28px; border-radius: 3px; background: color-mix(in srgb, var(--accent) 55%, transparent); }
.transition-icon .sheet.back { left: 34px; top: 14px; background: color-mix(in srgb, var(--accent) 30%, transparent); }
.transition-icon.horizontal .sheet { box-shadow: -10px 0 0 -6px var(--accent), -16px 6px 0 -8px var(--accent); }
.transition-icon.vertical .sheet { box-shadow: 0 -10px 0 -7px var(--accent); }
.transition-icon.zoom .sheet { transform: scale(0.85); } .transition-icon.zoom .sheet.back { transform: scale(1.1); }
.transition-tile:hover .transition-icon { box-shadow: 0 0 0 2px var(--accent); }
.transition-tile.active .transition-icon { background: var(--accent); }
.transition-tile.active .sheet { background: #fff; } .transition-tile.active .sheet.back { background: rgb(255 255 255 / 60%); }
.transition-label { font-size: 0.8rem; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 90px; }

/* Catalog of elements ("Add") */
.catalog { display: grid; grid-template-columns: 170px minmax(0, 1fr); height: 100%; }
.catalog-categories { padding: 12px 10px; background: var(--surface-2); border-right: 1px solid var(--border); overflow-y: auto; display: grid; align-content: start; gap: 2px; }
.catalog-categories button { justify-content: flex-start; border: 0; background: transparent; border-radius: 999px; min-height: 32px; font-weight: 500; }
.catalog-categories button:hover { background: var(--surface); }
.catalog-categories button.active { background: var(--accent-soft); color: var(--accent); }
.catalog-items { padding: 14px 16px 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.catalog-items > * { flex: none; }
.catalog-items h3 { margin: 0; padding-bottom: 6px; border-bottom: 1px solid var(--border); font-size: 0.85rem; color: var(--muted); font-weight: 500; }
.catalog-tile { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 10px; height: auto; padding: 14px; border-radius: 10px; text-align: left; white-space: normal; border: 1px solid var(--border); }
.catalog-tile > :first-child { align-self: flex-start; max-width: 100%; }
.catalog-tile > .sample-strip, .catalog-tile > .sample-cols, .catalog-tile > .sample-line, .catalog-tile > .sample-space { align-self: stretch; }
.catalog-tile:hover:not(:disabled) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.catalog-tile .tile-label { font-size: 0.8rem; color: var(--muted); font-weight: 500; }
.sample-h1 { font: 700 1.9rem/1.15 Georgia, serif; } .sample-h2 { font: 700 1.4rem/1.2 Georgia, serif; } .sample-h3 { font: 700 1.1rem/1.2 Georgia, serif; }
.sample-text { font: 400 0.95rem/1.5 Georgia, serif; } .sample-quote { font: italic 1.05rem/1.4 Georgia, serif; padding-left: 12px; border-left: 3px solid var(--accent); }
.sample-button { display: inline-block; padding: 8px 18px; border-radius: 6px; font-weight: 600; }
.sample-button.primary { background: var(--accent); color: #fff; } .sample-button.secondary { border: 2px solid var(--accent); color: var(--accent); }
.sample-strip { width: 100%; display: grid; gap: 6px; padding: 14px; border-radius: 8px; background: var(--surface-2); }
.sample-strip.dark { background: #1d232b; color: #fff; } .sample-strip.accent { background: var(--accent); color: #fff; }
.sample-strip.center { justify-items: center; }
.sample-bar { width: 100%; height: 8px; border-radius: 4px; background: currentColor; opacity: 0.25; }
.sample-bar.short { width: 55%; } .sample-bar.title { height: 12px; width: 70%; opacity: 0.6; }
.sample-cols { display: grid; gap: 6px; width: 100%; } .sample-cols div { height: 34px; border-radius: 6px; background: color-mix(in srgb, var(--accent) 22%, transparent); }
.sample-line { width: 100%; border-top: 2px solid var(--border); } .sample-space { width: 100%; border: 1px dashed var(--border); border-radius: 6px; }
.sample-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-size: 1.3rem; }

/* Canvas and the floating settings panel */
.canvas { position: relative; flex: 1; min-width: 0; overflow: hidden; background: var(--bg); }
.frame { --zoom: 1; position: absolute; top: 16px; left: 50%; width: calc((100% - 32px) / var(--zoom)); height: calc((100% - 32px) / var(--zoom)); transform: translateX(-50%) scale(var(--zoom)); transform-origin: top center; }
.frame iframe { width: 100%; height: 100%; border: 1px solid var(--border); border-radius: 6px; background: #fff; box-shadow: var(--shadow); }
.canvas[data-device="mobile"] .frame { width: 406px; }
.canvas.has-inspector .frame { left: calc(50% - 178px); width: calc((100% - 388px) / var(--zoom)); }
.canvas.has-inspector[data-device="mobile"] .frame { width: 406px; }
.canvas[data-device="mobile"] .frame iframe { border: 8px solid #1b1f24; border-radius: 30px; }
.inspector { position: absolute; top: 16px; right: 16px; bottom: 16px; z-index: 5; width: 340px; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 16px 40px rgb(16 24 40 / 18%); }
.float-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.float-head h2 { font-size: 1rem; }
.float-body { flex: 1; overflow-y: auto; padding: 14px; }
.float-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--border); }
.float-tabs button { border: 0; border-radius: 0; background: transparent; min-height: 42px; color: var(--muted); border-bottom: 2px solid transparent; }
.float-tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.block-type { margin: 0 0 12px; }
.context-menu { position: fixed; z-index: 70; min-width: 240px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 16px 40px rgb(16 24 40 / 22%); display: grid; }
.context-menu hr { border: 0; border-top: 1px solid var(--border); margin: 6px 4px; }
.context-item { justify-content: space-between; gap: 24px; min-height: 32px; border: 0; background: transparent; padding: 0 10px; font-weight: 400; }
.context-item:hover:not(:disabled) { background: var(--surface-2); }
.context-item.danger { color: var(--danger); }
.context-item kbd { border: 0; background: transparent; color: var(--muted); font-weight: 500; }
.block-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 16px; }
.block-actions button { font-size: 0.85rem; padding: 0 8px; }
.image-field-preview { display: grid; place-items: center; min-height: 70px; border: 1px dashed var(--border); border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.image-field-preview img { width: 100%; max-height: 160px; object-fit: cover; }
.list-field { display: grid; gap: 8px; }
.list-item { border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.list-item summary { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 8px; cursor: pointer; font-weight: 600; }
.list-item[open] summary { border-bottom: 1px solid var(--border); }
.list-item > .field { padding: 8px 10px; }
.list-item-actions { display: flex; }
.list-item-actions .icon-button { min-height: 24px; min-width: 24px; }
.add-item { justify-self: start; }
.keys { border-collapse: collapse; }
.keys td { padding: 5px 12px 5px 0; }
kbd { padding: 2px 7px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; background: var(--surface-2); font: 600 0.8rem ui-monospace, Consolas, monospace; }

/* Dialogs */
.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgb(10 14 20 / 45%); }
.dialog { width: min(460px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; padding: 20px 22px; background: var(--surface); border-radius: 16px; box-shadow: 0 20px 60px rgb(0 0 0 / 25%); }
.dialog.wide { width: min(760px, 100%); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.dialog-head h2 { font-size: 1.15rem; }
.danger-title { color: var(--danger); border-top: 1px solid var(--border); padding-top: 16px; }
.color-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.palette-item { flex-direction: column; align-items: flex-start; gap: 4px; height: auto; padding: 14px; text-align: left; white-space: normal; }
.palette-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-size: 1.1rem; margin-bottom: 4px; }
.media { display: grid; gap: 14px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.media-item { position: relative; }
.media-pick { padding: 0; width: 100%; aspect-ratio: 1; overflow: hidden; border-radius: 10px; }
.media-pick img { width: 100%; height: 100%; object-fit: cover; }
.media-delete { position: absolute; top: 6px; right: 6px; background: var(--surface); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; padding: 10px 18px; border-radius: 999px; background: var(--text); color: var(--surface); font-weight: 600; box-shadow: var(--shadow); }
.toast.success { background: var(--ok); color: #fff; }
.toast.error { background: var(--danger); color: #fff; }

@media (max-width: 1100px) {
  .menubar-site, .address { display: none; }
  .panel { width: 300px; } .panel.wide { width: 480px; }
  .inspector { width: 300px; }
}
@media (max-width: 860px) {
  .workspace { height: auto; flex-wrap: wrap; }
  .panel, .panel.wide { width: calc(100% - 60px); }
  .canvas { flex-basis: 100%; height: 75vh; }
  .inspector { position: static; width: auto; margin: 12px; }
  .menubar, .toolbar { height: auto; flex-wrap: wrap; padding: 6px 10px; }
}

/* Photo studio */
.studio { position: fixed; inset: 0; z-index: 60; display: grid; grid-template-rows: auto 1fr; background: var(--bg); }
.studio-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
.studio-head .row { align-items: center; }
.studio-cancel { color: var(--accent); }
.studio-body { display: grid; grid-template-columns: 220px 300px 1fr; min-height: 0; }
.studio-nav { display: grid; align-content: start; gap: 2px; padding: 12px 8px; background: var(--surface); border-right: 1px solid var(--border); }
.studio-nav button { justify-content: flex-start; border-color: transparent; background: transparent; white-space: pre; }
.studio-nav button.active { background: var(--accent-soft); color: var(--accent); }
.studio-panel { overflow-y: auto; padding: 16px 18px 24px; background: var(--surface); border-right: 1px solid var(--border); }
.studio-panel h2 { margin: 0 0 12px; font-size: 1.05rem; }
.studio-panel h3 { margin: 18px 0 8px; font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.studio-slider { display: grid; gap: 4px; margin-bottom: 10px; font-size: 0.85rem; }
.studio-slider > span { display: flex; justify-content: space-between; }
.studio-slider output { color: var(--muted); font-variant-numeric: tabular-nums; }
.studio-slider input[type="range"] { width: 100%; accent-color: var(--accent); }
.studio-tint { display: flex; align-items: center; gap: 8px; }
.studio-tint input[type="color"] { width: 34px; height: 28px; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: none; }
.studio-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.studio-chips button { min-height: 30px; padding: 0 10px; font-size: 0.85rem; }
.studio-chips button.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.studio-filters { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.studio-filter { display: grid; gap: 6px; height: auto; padding: 0; border: 0; background: transparent; font-size: 0.85rem; }
.studio-thumb { width: 100%; aspect-ratio: 1; border-radius: 8px; object-fit: cover; }
.studio-filter:hover .studio-thumb { box-shadow: 0 0 0 2px var(--accent); }
.studio-stage { display: grid; place-items: center; min-width: 0; min-height: 0; padding: 32px; overflow: hidden;
  background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--bg) 0 50%) 0 0 / 20px 20px; }
.studio-canvas { max-width: 100%; max-height: calc(100vh - 140px); box-shadow: 0 8px 30px rgb(0 0 0 / 20%); }
@media (max-width: 900px) {
  .studio-body { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; }
  .studio-nav { display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .studio-panel { max-height: 40vh; border-right: 0; border-bottom: 1px solid var(--border); }
  .studio-canvas { max-height: 40vh; }
}

/* CMS */
.catalog-tile > .sample-entries { align-self: stretch; }
.sample-entries { display: grid; gap: 6px; padding: 10px; border-radius: 8px; background: var(--surface-2); color: var(--text); }
.sample-entries > div { display: grid; grid-template-columns: 34px 1fr; gap: 8px; align-items: center; padding: 6px; border-radius: 6px; background: var(--surface); }
.sample-entries i { display: block; height: 26px; border-radius: 4px; background: color-mix(in srgb, var(--accent) 35%, transparent); }
.sample-entries.grid { grid-template-columns: repeat(3, 1fr); } .sample-entries.grid > div { grid-template-columns: 1fr; }
.sample-entries.compact { padding: 12px; gap: 9px; }
.cms { position: fixed; inset: 0; z-index: 45; display: grid; grid-template-rows: auto 1fr; background: var(--bg); }
.cms-top { display: flex; align-items: center; justify-content: space-between; padding: 8px 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
.cms-body { position: relative; overflow: auto; padding: 24px clamp(16px, 3vw, 44px) 40px; }
.cms-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.cms-head h1 { margin: 4px 0 0; font-size: 1.7rem; }
.cms-head .row { align-items: center; }
.cms-name button { padding: 0; min-height: 0; border: 0; border-bottom: 1px dashed var(--muted); border-radius: 0; background: none; font: inherit; color: inherit; }
.cms-crumbs { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--muted); }
.cms-crumbs .link-button { padding: 0; min-height: 0; color: var(--text); }
.cms-outline { border-color: var(--border); background: var(--surface); color: var(--accent); }
.cms-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.cms-empty { padding: 48px; text-align: center; color: var(--muted); }
.cms-collections { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.cms-card { display: grid; justify-items: start; gap: 4px; height: auto; padding: 18px; text-align: left; white-space: normal; background: var(--surface); }
.cms-card:hover:not(:disabled) { box-shadow: 0 0 0 3px var(--accent-soft); }
.cms-card strong { font-size: 1.05rem; }
.cms-card-icon { font-size: 1.4rem; color: var(--accent); }
.cms-templates { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.cms-template { display: grid; justify-items: start; gap: 2px; height: auto; padding: 10px 12px; text-align: left; white-space: normal; }
.cms-template.active { border-color: var(--accent); background: var(--accent-soft); }
.cms-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.cms-toolbar strong { margin-right: 4px; }
.cms-spacer { flex: 1; }
.cms-chip { min-height: 30px; padding: 0 14px; border-radius: 999px; border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); background: var(--surface); color: var(--accent); font-size: 0.85rem; }
.cms-chip.on { background: var(--accent-soft); border-color: var(--accent); }
.cms-search { width: 190px; min-height: 30px; padding: 0 12px; border-radius: 999px; font-size: 0.85rem; }
.cms-table-wrap { overflow: auto; }
.cms-table { border-collapse: collapse; min-width: 100%; font-size: 0.88rem; }
.cms-table th, .cms-table td { border: 1px solid var(--border); padding: 0; height: 40px; text-align: left; white-space: nowrap; }
.cms-table th { padding: 0 12px; background: var(--accent-soft); font-weight: 500; position: sticky; top: 0; z-index: 1; }
.cms-table td { max-width: 260px; min-width: 150px; }
.cms-table td.primary-col, .cms-table th.primary-col { min-width: 280px; }
.cms-table td.system { padding: 0 12px; background: var(--surface-2); color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.cms-table .cms-num { min-width: 70px; width: 70px; padding: 0 8px; color: var(--muted); font-size: 0.8rem; }
.cms-table td.cms-num > * { vertical-align: middle; margin-right: 6px; }
.cms-type { color: var(--muted); font-size: 0.8rem; }
.cms-table tr.selected td:not(.system) { background: color-mix(in srgb, var(--accent-soft) 60%, var(--surface)); }
.cms-table tr.drop td, .cms-list-row.drop, .cms-field-list li.drop { box-shadow: inset 0 2px 0 var(--accent); }
.cms-table tr.is-hidden td:not(.cms-num), .cms-list-row.is-hidden, .cms-tile.is-hidden { opacity: 0.55; }
.cms-hidden-mark { color: var(--warn); }
.cms-cell { width: 100%; height: 39px; min-height: 0; padding: 0 12px; border: 0; border-radius: 0; background: transparent; font: inherit; color: inherit; }
.cms-cell:focus { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--surface); }
.cms-cell-text { display: block; overflow: hidden; text-overflow: ellipsis; text-align: left; font-weight: 400; }
.cms-thumb { display: block; width: 44px; height: 30px; margin: 4px 12px; padding: 0; min-height: 0; border: 0; border-radius: 4px; background: var(--accent-soft); overflow: hidden; }
.cms-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cms-thumb.small { width: 40px; height: 40px; margin: 0; border-radius: 6px; }
.cms-path { font-size: 0.85rem; }
.drag { cursor: grab; color: var(--muted); }
.cms-table td.cms-open-cell { min-width: 0; width: 80px; border-left: 0; }
.cms-open { visibility: hidden; min-height: 26px; margin: 0 8px; padding: 0 12px; border-radius: 999px; border: 0; background: var(--accent); color: #fff; font-size: 0.8rem; }
.cms-table tr:hover .cms-open, .cms-table tr.selected .cms-open { visibility: visible; }
.cms-table th.cms-add-col { background: var(--surface); } .cms-add-col .link-button { white-space: nowrap; }
.cms-add-row td { border-left: 0; border-right: 0; } .cms-add-row .link-button { margin-left: 8px; }
.cms-list-head, .cms-list-row { display: grid; grid-template-columns: 70px 60px 1fr 50px; align-items: center; gap: 12px; padding: 0 20px; }
.cms-list-head { min-height: 40px; background: var(--accent-soft); font-size: 0.88rem; }
.cms-list-row { min-height: 66px; border-bottom: 1px solid var(--border); }
.cms-list-title { justify-content: flex-start; border: 0; background: transparent; font-weight: 700; text-align: left; white-space: normal; }
.cms-more { justify-self: end; border-radius: 999px; border: 1px solid var(--border); color: var(--accent); }
.cms-add-center { display: block; margin: 14px auto; }
.cms-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; padding: 20px; }
.cms-tile { display: grid; grid-template-columns: 100%; grid-template-rows: auto 1fr; align-content: start; align-items: stretch; height: auto; padding: 0; overflow: hidden; text-align: left; font-weight: 500; }
.cms-tile-image { display: grid; place-items: center; aspect-ratio: 1.15; background: var(--accent-soft); color: var(--accent); font-size: 1.6rem; overflow: hidden; }
.cms-tile-image img { width: 100%; height: 100%; object-fit: cover; }
.cms-tile-title { padding: 12px 14px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cms-tile-add { border-style: dashed; color: var(--accent); }
.cms-menu { z-index: 75; }
.cms-menu-heading { padding: 6px 10px; color: var(--muted); font-size: 0.8rem; font-weight: 600; }
.context-item.active { background: var(--accent); color: #fff; }
.cms-popover { position: fixed; z-index: 75; display: grid; gap: 8px; width: 360px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 16px 40px rgb(16 24 40 / 22%); font-size: 0.9rem; }
.cms-popover p { margin: 0; }
.cms-popover .link-button { justify-self: start; padding: 0; }
.cms-sort-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; }
.cms-used { margin: 0; padding: 0 0 0 4px; list-style: none; display: grid; gap: 4px; color: var(--accent); }
.cms-note { padding: 10px 12px; border-radius: 8px; background: var(--accent-soft); }
.cms-drawer { position: fixed; top: 49px; right: 0; bottom: 0; z-index: 46; width: min(420px, 100%); display: grid; grid-template-rows: auto 1fr auto; background: var(--surface); border-left: 1px solid var(--border); box-shadow: -12px 0 30px rgb(16 24 40 / 10%); }
.cms-drawer-head { display: flex; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.cms-drawer-head h2 { margin: 0 0 4px; font-size: 1.05rem; }
.cms-field-list { margin: 0; padding: 0; list-style: none; overflow: auto; }
.cms-field-list li { display: grid; grid-template-columns: 16px 20px 22px 1fr auto 32px; align-items: center; gap: 8px; padding: 10px 20px; border-bottom: 1px solid var(--border); }
.cms-field-list input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }
.cms-field-name { min-height: 30px; padding: 0 8px; border-color: transparent; background: transparent; font-weight: 500; }
span.cms-field-name { display: flex; align-items: center; }
input.cms-field-name:hover, input.cms-field-name:focus { border-color: var(--border); background: var(--surface); }
.cms-badge { padding: 1px 8px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); font-size: 0.72rem; white-space: nowrap; }
.cms-badge.muted { background: var(--surface-2); color: var(--muted); }
.cms-drawer-foot { display: flex; justify-content: center; padding: 14px; border-top: 1px solid var(--border); }
.cms-form-head { max-width: 1060px; margin-inline: auto; }
.cms-form-wrap { display: grid; grid-template-columns: 1fr minmax(0, 860px) 1fr; gap: 16px; align-items: start; }
.cms-step { display: flex; justify-content: center; padding-top: 220px; }
.cms-nav { width: 40px; height: 40px; padding: 0; border-radius: 50%; background: var(--surface); color: var(--accent); font-size: 1.3rem; box-shadow: var(--shadow); }
.cms-form-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.cms-card-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; border-bottom: 1px solid var(--border); }
.cms-form { padding: 24px; gap: 20px; }
.cms-date input { max-width: 280px; }
.cms-address { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; min-height: 40px; padding: 4px 6px 4px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); font-size: 0.9rem; }
.cms-address input { flex: 1; min-width: 120px; min-height: 30px; }
.cms-address-url { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.cms-pill, .cms-pill-ghost { min-height: 26px; padding: 0 12px; border-radius: 999px; font-size: 0.78rem; }
.cms-pill { border-color: var(--accent); background: var(--accent); color: #fff; }
.cms-pill-ghost { background: var(--surface); color: var(--muted); }
.cms-editor { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.cms-editor:focus-within { border-color: var(--accent); }
.cms-editor-tools { display: flex; gap: 2px; padding: 6px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.cms-tool { min-width: 32px; min-height: 30px; padding: 0 8px; border: 0; background: transparent; font-weight: 700; }
.cms-tool:hover { background: var(--surface); }
.cms-editor textarea { width: 100%; border: 0; border-radius: 0; resize: vertical; }
.cms-image-drop { width: 180px; height: 180px; border: 1px dashed var(--accent); background: var(--accent-soft); color: var(--accent); font-size: 2.4rem; font-weight: 300; }
.cms-image img { max-width: 320px; max-height: 240px; border-radius: 8px; }
.cms-add-field { justify-self: start; padding: 0; }
@media (max-width: 900px) {
  .cms-form-wrap { grid-template-columns: 1fr; } .cms-step { display: none; }
  .cms-search { width: 100%; } .cms-templates { grid-template-columns: 1fr; }
}

/* Section shapes */
.shape-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.shape-tile { height: 46px; padding: 0; overflow: hidden; border-radius: 8px; background: color-mix(in srgb, var(--accent) 55%, var(--surface)); }
.shape-tile.active { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.shape-preview { display: flex; width: 100%; height: 100%; }
.shape-preview.bottom { align-items: flex-end; } .shape-preview.top { align-items: flex-start; }
.shape-preview svg { width: 100%; height: 55%; fill: var(--surface); }
.shape-preview.top svg { transform: scaleY(-1); }
.shape-preview.none { align-items: center; justify-content: center; color: var(--surface); font-size: 1.2rem; }
.cms-filter-box { width: 520px; max-width: calc(100vw - 16px); }
.cms-filter-list { display: grid; gap: 6px; }
.cms-filter-row { display: grid; grid-template-columns: 1fr 1fr 1.2fr auto; gap: 6px; }

/* Inbox and e-mail */
.rail button { position: relative; }
.rail-badge { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 0.68rem; font-weight: 700; line-height: 18px; text-align: center; }
.inbox { display: grid; gap: 14px; }
.inbox-notify-row { flex-wrap: nowrap; align-items: center; } .inbox-notify-row input { flex: 1; min-width: 0; }
.inbox-mail { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); }
.inbox-mail p { margin: 0; }
.inbox-title { margin: 6px 0 0; font-size: 0.9rem; }
.inbox-list { display: grid; gap: 6px; }
.inbox-item { display: grid; grid-template-columns: 100%; gap: 3px; justify-items: stretch; height: auto; padding: 10px 12px; text-align: left; white-space: normal; font-weight: 400; }
.inbox-item.unread { border-color: var(--accent); background: var(--accent-soft); }
.inbox-item.unread strong::before { content: "● "; color: var(--accent); }
.inbox-row { display: flex; justify-content: space-between; gap: 8px; } .inbox-row time { color: var(--muted); font-size: 0.78rem; white-space: nowrap; }
.inbox-preview { color: var(--muted); font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-warn { color: var(--warn); font-size: 0.78rem; }
.message-text { white-space: pre-wrap; padding: 14px; border-radius: 8px; background: var(--surface-2); margin: 0; }
.message-view .actions { flex-wrap: wrap; }
.mail-row { display: grid; grid-template-columns: 1fr 120px; gap: 12px; }
.mail-test { display: grid; gap: 8px; padding-top: 10px; border-top: 1px solid var(--border); }
.mail-test h3 { margin: 0; font-size: 0.9rem; } .mail-test .row { flex-wrap: nowrap; align-items: center; } .mail-test input { flex: 1; min-width: 0; }
.sample-form { display: grid; gap: 5px; width: 100%; padding: 10px; border-radius: 8px; background: var(--surface-2); }
.sample-form i { display: block; height: 10px; border-radius: 3px; border: 1px solid color-mix(in srgb, var(--text) 25%, transparent); background: var(--surface); }
.sample-form i.tall { height: 24px; } .sample-form b { width: 40%; height: 12px; border-radius: 4px; background: var(--accent); }
.button.primary { background: var(--accent); border-color: var(--accent); color: #fff; } .button.primary:hover { background: var(--accent-strong); }
.menu-entry.is-child { margin-left: 22px; }
.menu-entry.is-child .menu-title::before { content: "↳ "; color: var(--muted); }
.layout-item { color: var(--muted); }

/* Documents and export */
.media-grid.documents { grid-template-columns: 1fr; }
.media-item.doc { grid-column: 1 / -1; } .media-item.doc .media-delete { top: 50%; transform: translateY(-50%); }
.media-pick.media-doc { aspect-ratio: auto; }
.media-doc { display: grid; grid-template-columns: 36px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; justify-items: start; width: 100%; height: auto; padding: 10px 44px 10px 12px; text-align: left; white-space: normal; }
.media-doc .doc-icon { grid-row: span 2; font-size: 1.6rem; }
.media-doc .doc-name { font-weight: 600; overflow-wrap: anywhere; }
.link-row { display: flex; gap: 6px; align-items: center; } .link-row input { flex: 1; min-width: 0; }
.sites-head .row { align-items: center; } label.button { cursor: pointer; }
.media-pick video { width: 100%; height: 100%; object-fit: cover; }
.media-pick { position: relative; } .video-badge { position: absolute; left: 6px; bottom: 6px; padding: 1px 6px; border-radius: 4px; background: rgb(0 0 0 / 60%); color: #fff; font-size: 0.7rem; }
.image-field-preview video { width: 100%; max-height: 140px; object-fit: cover; border-radius: 8px; }
.sample-strip.image { background: linear-gradient(rgb(0 0 0 / 45%), rgb(0 0 0 / 45%)), linear-gradient(135deg, #7aa7d9, #3b6ea5 60%, #24476b); color: #fff; }

/* Page templates */
.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.template-tile { display: grid; justify-items: start; align-content: start; gap: 6px; height: auto; padding: 16px; text-align: left; white-space: normal; }
.template-tile:hover:not(:disabled) { box-shadow: 0 0 0 3px var(--accent-soft); }
.template-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-size: 1.2rem; font-weight: 700; }
.device-mark { margin-left: auto; font-size: 0.85rem; }

/* Statistics */
.stats { display: grid; gap: 16px; }
.stats h3 { margin: 0 0 8px; font-size: 0.9rem; }
.stats-range { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 3px; border-radius: 10px; background: var(--surface-2); }
.stats-range button { min-height: 30px; padding: 0; border: 0; background: transparent; font-size: 0.8rem; }
.stats-range button.active { background: var(--surface); box-shadow: var(--shadow); color: var(--accent); }
.stats-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stats-tile { display: grid; gap: 2px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; }
.stats-tile strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.stats-chart { position: relative; height: 150px; padding-top: 18px; border-bottom: 1px solid var(--border); }
.stats-max { position: absolute; top: 0; left: 0; font-variant-numeric: tabular-nums; }
.stats-chart::before { content: ""; position: absolute; left: 0; right: 0; top: 18px; border-top: 1px dashed var(--border); }
.stats-bars { display: flex; align-items: flex-end; gap: 2px; height: 100%; }
.stats-bars.dense { gap: 0; }
.stats-col { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; outline: none; cursor: default; }
.stats-bar { width: 100%; min-height: 0; border-radius: 4px 4px 0 0; background: var(--accent); }
.stats-bar.zero { height: 2px !important; background: var(--border); border-radius: 0; }
.stats-col:hover .stats-bar, .stats-col:focus-visible .stats-bar { background: var(--accent-strong); }
.stats-col:hover::after, .stats-col:focus-visible::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 2; padding: 6px 9px; border-radius: 6px;
  background: var(--text); color: var(--surface); font-size: 0.75rem; white-space: nowrap; pointer-events: none;
}
.stats-bars .stats-col:first-child:hover::after, .stats-bars .stats-col:nth-child(-n+3):hover::after { left: 0; transform: none; }
.stats-bars .stats-col:last-child:hover::after, .stats-bars .stats-col:nth-last-child(-n+3):hover::after { left: auto; right: 0; transform: none; }
.stats-axis { display: flex; justify-content: space-between; margin-top: 4px; }
.stats-table summary { cursor: pointer; font-size: 0.8rem; color: var(--accent); margin-top: 6px; }
.stats-table table { width: 100%; margin-top: 6px; font-size: 0.8rem; } .stats-table th { text-align: left; color: var(--muted); font-weight: 500; }
.stats-list ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.stats-list li { position: relative; display: flex; justify-content: space-between; gap: 8px; padding: 5px 8px; font-size: 0.85rem; border-radius: 6px; overflow: hidden; }
.stats-key { position: relative; z-index: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats-num { position: relative; z-index: 1; font-variant-numeric: tabular-nums; color: var(--muted); }
.stats-share { position: absolute; inset: 0 auto 0 0; background: var(--accent-soft); }

/* Page search settings, accordion and table samples */
.page-seo { display: grid; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.page-seo summary { cursor: pointer; font-weight: 600; font-size: 0.88rem; }
.page-seo[open] summary { margin-bottom: 4px; }
.page-seo .field, .page-seo .check { margin-top: 8px; }
.serp { display: grid; gap: 2px; padding: 10px 12px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); font-family: Arial, sans-serif; }
.serp-url { color: #4d5156; font-size: 0.75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.serp-title { color: #1a0dab; font-size: 1rem; line-height: 1.3; }
.serp-text { color: #4d5156; font-size: 0.8rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.page-actions { align-items: center; margin-top: 4px; }
.sample-accordion { display: grid; gap: 6px; width: 100%; }
.sample-accordion > div { display: flex; align-items: center; gap: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.sample-accordion b { color: var(--accent); }
.sample-tabs { display: grid; gap: 8px; width: 100%; } .sample-tabs > div { display: flex; gap: 6px; border-bottom: 1px solid var(--border); }
.sample-tabs i { width: 28%; height: 8px; margin-bottom: 4px; border-radius: 3px; background: currentColor; opacity: 0.2; } .sample-tabs i.on { opacity: 0.7; box-shadow: 0 6px 0 -3px var(--accent); }
.sample-table { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; width: 100%; }
.sample-table i { height: 12px; border-radius: 2px; background: var(--surface-2); border: 1px solid var(--border); } .sample-table i.head { background: var(--accent-soft); }
.sample-entries.agenda > div { grid-template-columns: 26px 1fr; } .sample-entries.agenda i { height: 30px; background: var(--accent); }

/* Website history */
.history-save { flex-wrap: nowrap; align-items: center; } .history-save input { flex: 1; min-width: 0; }
.history-list { display: grid; gap: 6px; max-height: 60vh; overflow-y: auto; padding-right: 4px; }
.history-day { margin: 12px 0 2px; font-size: 0.82rem; color: var(--muted); font-weight: 600; }
.history-row { display: grid; grid-template-columns: 30px 1fr auto auto; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.history-row.current { grid-template-columns: 30px 1fr auto; background: var(--accent-soft); border-color: transparent; }
.history-row.kind-publish { border-left: 3px solid var(--ok); } .history-row.kind-manual { border-left: 3px solid var(--accent); }
.history-icon { font-size: 1.1rem; text-align: center; }
.history-main { display: grid; gap: 1px; min-width: 0; } .history-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Link field and dialog */
.link-row { display: flex; gap: 6px; align-items: center; }
.link-value { flex: 1; min-width: 0; justify-content: space-between; gap: 8px; min-height: 40px; padding: 0 12px; text-align: left; font-weight: 400; background: var(--surface); }
.link-summary { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .link-edit { color: var(--muted); }
.link-layout { display: grid; grid-template-columns: 210px 1fr; gap: 18px; min-height: 250px; }
.link-types { display: grid; align-content: start; gap: 2px; padding-right: 14px; border-right: 1px solid var(--border); }
.link-type { justify-content: flex-start; gap: 10px; min-height: 36px; border: 0; background: transparent; font-weight: 500; }
.link-type.active { background: var(--accent-soft); color: var(--accent); }
.link-type-icon { width: 20px; text-align: center; }
.link-form { display: grid; align-content: start; gap: 14px; }
.link-dialog .actions { margin-top: 16px; }
@media (max-width: 640px) { .link-layout { grid-template-columns: 1fr; } .link-types { border-right: 0; padding-right: 0; grid-template-columns: repeat(2, 1fr); } }
.sample-button.text { background: none; border-color: transparent; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.sample-button.soft { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.sample-button.pill { border-radius: 999px; } .sample-button.large { padding: 10px 22px; font-size: 0.95rem; }

.custom-font { display: grid; gap: 8px; }
.font-file { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 6px; }
.font-file > .small:first-child { grid-column: 1 / -1; font-weight: 600; }
.font-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.redirects { display: grid; gap: 6px; }
.redirect-row { display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 6px; align-items: center; } .redirect-row input { min-width: 0; }

.users { display: grid; gap: 14px; }
.users-table { width: 100%; border-collapse: collapse; } .users-table th, .users-table td { padding: 8px 6px; text-align: left; border-bottom: 1px solid var(--line, rgb(127 127 127 / 20%)); vertical-align: middle; }
.users-table th { font-size: 0.8rem; font-weight: 600; opacity: 0.7; } .users-table select { min-width: 130px; }
.users-pending { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; } .users-pending li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .users-pending li > span { flex: 1; }
.users-invite { display: grid; grid-template-columns: 1fr 1.3fr auto auto; gap: 8px; } .users-invite input { min-width: 0; }
@media (max-width: 700px) { .users-invite { grid-template-columns: 1fr; } }
.users-roles ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 6px; }

.users-top { display: flex; justify-content: flex-end; }
.users-invite { grid-template-columns: 1fr 1.3fr auto auto; } .users-invite .access-button { grid-column: 1 / -1; justify-self: start; }
.access-button { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.access-list { display: grid; gap: 6px; max-height: 300px; overflow: auto; padding-left: 4px; }

/* Preview mode: a slim bar on top of the page as visitors see it. */
.preview-mode { position: fixed; inset: 0; z-index: 90; display: grid; grid-template-rows: 48px minmax(0, 1fr); background: var(--bg); }
.preview-mode-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 0 12px; background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow); z-index: 1; }
.preview-mode-left { display: flex; align-items: center; } .preview-mode-left .device-toggle { padding-left: 10px; padding-right: 0; border-right: 0; border-left: 1px solid var(--border); }
.preview-mode-label { font-size: 0.85rem; color: var(--text); white-space: nowrap; }
.preview-mode-right { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.preview-mode-stage { display: flex; justify-content: center; min-height: 0; overflow: hidden; }
.preview-mode-frame { width: 100%; height: 100%; border: 0; background: #fff; }
.preview-mode-stage[data-device="mobile"] { padding: 20px 0; }
.preview-mode-stage[data-device="mobile"] .preview-mode-frame { width: 390px; max-width: 100%; border-radius: 18px; box-shadow: 0 0 0 1px var(--border), 0 12px 40px rgb(0 0 0 / 18%); }
@media (max-width: 700px) { .preview-mode-label { display: none; } .preview-mode-bar { grid-template-columns: auto 1fr; } }
