/* ===== Sivueditori ===== */

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #e2e5ea;
  --border-strong: #cfd4dc;
  --text: #1c2230;
  --muted: #6a7282;
  --accent: #2f54eb;
  --accent-hover: #2445cc;
  --accent-soft: #eaf0ff;
  --ok: #18794e;
  --ok-soft: #e6f6ee;
  --warn: #a35a00;
  --warn-soft: #fff3e0;
  --danger: #c52f2f;
  --danger-soft: #fdecec;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.16);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 1.6rem; font-weight: 700; }
h2 { font-size: 1.1rem; font-weight: 650; }
h3 { font-size: 0.95rem; font-weight: 650; }
p { margin: 0; }
a { color: var(--accent); }
button { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 0.85em; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }
.icon { display: inline-flex; flex: none; }
.spacer { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 8px; align-items: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.narrow { max-width: 560px; }
[hidden] { display: none !important; }

/* ----- painikkeet ----- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  height: 36px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-weight: 550; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.btn:hover { background: var(--surface-2); }
.btn:focus-visible, .icon-btn:focus-visible, .seg:focus-visible, .chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary.btn-quiet { background: var(--surface); color: var(--muted); border-color: var(--border); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #a92626; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-small { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; height: 42px; }
.btn-add { align-self: flex-start; border-style: dashed; color: var(--accent); background: transparent; }
.btn-add:hover { background: var(--accent-soft); border-color: var(--accent); }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--radius-sm);
  border: none; background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.icon-btn.danger:hover:not(:disabled) { background: var(--danger-soft); color: var(--danger); }
.icon-btn:disabled { opacity: 0.3; cursor: default; }

.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px;
  font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); margin-left: 6px; white-space: nowrap;
}
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }

/* ----- lomakekentät ----- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; font-weight: 600; color: #3a4252; display: flex; align-items: center; gap: 8px; }
.field-label.row { justify-content: space-between; }
.field-help { font-size: 12.5px; color: var(--muted); }
.field .count { font-weight: 600; color: var(--muted); background: var(--surface-2); border-radius: 99px; padding: 0 7px; font-size: 11.5px; }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="tel"], input[type="number"], input:not([type]), select, textarea {
  width: 100%; font: inherit; font-size: 14.5px; color: var(--text);
  padding: 8px 11px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff;
  transition: border-color 0.12s, box-shadow 0.12s;
}
textarea { resize: vertical; min-height: 64px; line-height: 1.5; }
textarea.code { font-family: var(--mono); font-size: 12.5px; line-height: 1.45; min-height: 320px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 84, 235, 0.15); }
input:disabled { background: var(--surface-2); color: var(--muted); }
.form-error { color: var(--danger); font-size: 13.5px; min-height: 1em; }
.check { display: flex; gap: 10px; align-items: center; cursor: pointer; padding: 6px 0; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }
.check-list { display: flex; flex-direction: column; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch-track { width: 38px; height: 22px; border-radius: 99px; background: var(--border-strong); position: relative; transition: background 0.15s; }
.switch-track::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.15s; box-shadow: var(--shadow); }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ----- kirjautuminen ----- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(1200px 600px at 20% -10%, #e4ebff 0%, transparent 60%), var(--bg); }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 32px 28px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 16px; }
.login-brand { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 6px; }
.login-brand p { color: var(--muted); }
.brand-mark { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 800; font-size: 17px; }
.brand-mark.big { width: 48px; height: 48px; border-radius: 13px; font-size: 28px; }

/* ----- runko ----- */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 24px; height: 58px; padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); text-decoration: none; font-size: 16px; }
.topnav { display: flex; align-items: center; gap: 4px; flex: 1; }
.nav-link { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: var(--radius-sm); color: var(--muted); text-decoration: none; font-weight: 550; font-size: 14px; }
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active { color: var(--accent); background: var(--accent-soft); }
.user-menu { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.avatar { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #dfe5f3; color: #3a4a78; font-weight: 700; font-size: 12px; }
.page { width: 100%; max-width: 1040px; margin: 0 auto; padding: 32px 24px 64px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; text-decoration: none; margin-bottom: 6px; color: var(--muted); }
.back-link:hover { color: var(--accent); }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); display: flex; flex-direction: column; gap: 14px; align-items: center; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); margin-bottom: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head:only-child { margin-bottom: 0; }
.danger-zone { border-color: #f1c9c9; }

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; padding: 0 10px 10px; }
.table td { padding: 12px 10px; border-top: 1px solid var(--border); vertical-align: middle; }
.row-actions { text-align: right; white-space: nowrap; }
.row-actions > * { vertical-align: middle; }

/* ----- sivustolista ----- */
.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.site-card { display: flex; align-items: center; gap: 14px; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: inherit; box-shadow: var(--shadow); transition: border-color 0.12s, box-shadow 0.12s, transform 0.12s; }
.site-card:hover { border-color: var(--accent); box-shadow: 0 6px 18px rgba(47, 84, 235, 0.12); transform: translateY(-1px); }
.site-card-icon { width: 44px; height: 44px; flex: none; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 750; font-size: 19px; }
.site-card-main { flex: 1; min-width: 0; }
.site-card-main p { font-size: 13.5px; }

/* ----- editori ----- */
.editor { height: 100vh; display: flex; flex-direction: column; }
.editor-top { height: 56px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 14px; background: var(--surface); border-bottom: 1px solid var(--border); }
.editor-site { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.editor-site strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.save-status { font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.save-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); }
.status-saved::before { background: var(--ok); }
.status-saving::before, .status-unsaved::before { background: var(--accent); animation: pulse 1s infinite; }
.status-unpublished::before { background: #e8a33a; }
.status-error { color: var(--danger); }
.status-error::before { background: var(--danger); }
@keyframes pulse { 50% { opacity: 0.3; } }
.mobile-tabs { display: none; }

.editor-body { flex: 1; min-height: 0; display: flex; }
.doc-nav { width: 210px; flex: none; border-right: 1px solid var(--border); background: var(--surface); padding: 14px 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.doc-nav-title { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 650; padding: 0 10px 8px; }
.doc-link { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; border: none; background: transparent; padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; font-size: 14px; color: #3a4252; }
.doc-link:hover { background: var(--surface-2); }
.doc-link.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #e8a33a; flex: none; }

.panel { width: 440px; flex: none; display: flex; flex-direction: column; background: var(--bg); border-right: 1px solid var(--border); min-height: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px 10px; }
.panel-title { font-size: 17px; }
.panel-actions { display: flex; align-items: center; gap: 4px; }
.panel-scroll { flex: 1; overflow-y: auto; padding: 4px 18px 80px; scroll-behavior: smooth; }

.sections { display: flex; flex-direction: column; gap: 10px; }
.section-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.section-head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 13px 16px; border: none; background: transparent; cursor: pointer; text-align: left; }
.section-head:hover { background: #fafbfc; }
.section-title { font-weight: 650; font-size: 14.5px; flex: none; }
.section-sub { font-size: 12.5px; color: var(--muted); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.section-head .icon { margin-left: auto; color: var(--muted); transition: transform 0.15s; }
.section-card.open > .section-head .icon { transform: rotate(90deg); }
.section-body { padding: 4px 16px 18px; display: flex; flex-direction: column; gap: 16px; }
.section-card:not(:has(.section-head)) > .section-body { padding-top: 16px; }

.object-fields { display: flex; flex-direction: column; gap: 14px; }
.group { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0; margin: 0; }
.group-toggle { width: 100%; display: flex; align-items: center; gap: 6px; padding: 9px 12px; border: none; background: var(--surface-2); cursor: pointer; font-weight: 600; font-size: 13.5px; border-radius: var(--radius-sm); text-align: left; }
.group-toggle .icon { transition: transform 0.15s; color: var(--muted); }
.group.open > .group-toggle { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.group.open > .group-toggle .icon { transform: rotate(90deg); }
.group-body { padding: 14px 12px; display: flex; flex-direction: column; gap: 14px; }

.list-wrap, .list-field { display: flex; flex-direction: column; gap: 10px; }
.list { display: flex; flex-direction: column; gap: 6px; }
.list-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); transition: box-shadow 0.12s, opacity 0.12s; position: relative; }
.list-item.dragging { opacity: 0.4; }
.list-item.drop-before::before, .list-item.drop-after::after { content: ""; position: absolute; left: 0; right: 0; height: 3px; background: var(--accent); border-radius: 2px; }
.list-item.drop-before::before { top: -5px; }
.list-item.drop-after::after { bottom: -5px; }
.inline-item { display: flex; align-items: center; gap: 4px; padding: 4px 4px 4px 2px; }
.inline-item .inline-input { flex: 1; min-width: 0; }
.inline-item input, .inline-item textarea { border-color: transparent; background: transparent; padding: 6px 8px; }
.inline-item input:hover, .inline-item textarea:hover { border-color: var(--border); }
.inline-item input:focus, .inline-item textarea:focus { background: #fff; border-color: var(--accent); }
.drag-handle { display: inline-grid; place-items: center; width: 22px; height: 30px; color: #a3aab6; cursor: grab; flex: none; }
.drag-handle:active { cursor: grabbing; }
.item-controls { display: flex; flex: none; }
.item-controls .icon-btn { width: 28px; height: 28px; }
.card-item .item-head { display: flex; align-items: center; gap: 2px; padding: 4px 4px 4px 2px; }
.item-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; border: none; background: transparent; cursor: pointer; padding: 6px 4px; text-align: left; font-weight: 550; font-size: 14px; }
.item-title span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-title .icon { color: var(--muted); transition: transform 0.15s; }
.card-item.open .item-title .icon { transform: rotate(90deg); }
.item-body { padding: 6px 14px 16px 30px; border-top: 1px solid var(--border); padding-top: 14px; }
.empty-list { font-size: 13px; color: var(--muted); }

.image-field { display: flex; gap: 12px; align-items: center; }
.image-thumb { width: 96px; height: 72px; border-radius: var(--radius-sm); background: var(--surface-2); display: grid; place-items: center; overflow: hidden; color: #a3aab6; border: 1px solid var(--border); flex: none; }
.image-thumb img { width: 100%; height: 100%; object-fit: cover; }
.image-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; min-width: 0; }
.image-name { font-size: 12px; color: var(--muted); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.gallery-item { position: relative; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); aspect-ratio: 4 / 3; border: 1px solid var(--border); cursor: grab; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.gallery-item.dragging { opacity: 0.35; }
.gallery-item.drop-before { box-shadow: -4px 0 0 var(--accent); }
.gallery-item.drop-after { box-shadow: 4px 0 0 var(--accent); }
.gallery-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: space-between; padding: 2px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.55)); opacity: 0; transition: opacity 0.15s; }
.gallery-item:hover .gallery-bar, .gallery-item:focus-within .gallery-bar { opacity: 1; }
.gallery-bar .icon-btn { color: #fff; width: 26px; height: 26px; }
.gallery-bar .icon-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.2); color: #fff; }
.gallery-bar .icon-btn.danger:hover { background: var(--danger); color: #fff; }
.gallery-num { color: #fff; font-size: 12px; font-weight: 700; }
.gallery-add { aspect-ratio: 4 / 3; border: 1.5px dashed var(--border-strong); border-radius: var(--radius-sm); background: transparent; color: var(--accent); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; font-size: 13px; font-weight: 550; }
.gallery-add:hover { background: var(--accent-soft); border-color: var(--accent); }

.flash { animation: flash 1.5s ease; border-radius: var(--radius-sm); }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 3px rgba(47, 84, 235, 0.35); background: var(--accent-soft); } 100% { box-shadow: 0 0 0 3px transparent; } }

/* esikatselu */
.preview-pane { flex: 1; min-width: 0; display: flex; flex-direction: column; background: #e9ebef; }
.preview-toolbar { height: 48px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 12px; background: var(--surface); border-bottom: 1px solid var(--border); }
.preview-page { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.segmented { display: inline-flex; background: var(--surface-2); border-radius: 8px; padding: 2px; }
.seg { border: none; background: transparent; height: 28px; min-width: 34px; padding: 0 10px; border-radius: 6px; cursor: pointer; color: var(--muted); display: inline-grid; place-items: center; font-size: 13px; font-weight: 600; }
.seg.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 550; cursor: pointer; white-space: nowrap; }
.chip.active { border-color: #c4d2ff; background: var(--accent-soft); color: var(--accent); }
.preview-stage { flex: 1; min-height: 0; overflow: auto; display: flex; justify-content: center; }
.device-frame { width: 100%; height: 100%; background: #fff; transition: width 0.25s ease; }
.preview-frame { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.device-mobile { padding: 20px; }
.device-mobile .device-frame { width: 390px; max-width: 100%; height: 100%; border-radius: 22px; box-shadow: 0 0 0 9px #1c2230, var(--shadow-lg); overflow: hidden; }

/* ----- modaali ja ilmoitukset ----- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(20, 26, 38, 0.45); display: grid; place-items: center; padding: 16px; z-index: 100; animation: fade 0.12s; }
.modal { width: 100%; max-width: 480px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); animation: pop 0.15s ease; }
.modal-wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 10px; }
.modal-body { padding: 6px 20px 18px; overflow-y: auto; }
.modal-body ul { margin: 0; padding-left: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.modal-actions .btn-danger:first-child { margin-right: auto; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(6px) scale(0.98); opacity: 0; } }
.history { list-style: none; padding: 0 !important; display: flex; flex-direction: column; }
.history li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.file-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-sm); max-height: 260px; overflow-y: auto; }
.file-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.file-row:last-child { border-bottom: none; }
.file-row .mono { flex: 1; }

.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 200; align-items: center; width: max-content; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 14px; background: #1c2230; color: #fff; padding: 11px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: 14px; animation: pop 0.15s ease; }
.toast.leaving { opacity: 0; transition: opacity 0.2s; }
.toast-success { background: #135e3d; }
.toast-error { background: #a52626; }
.toast-action { background: transparent; border: none; color: #9fb6ff; font-weight: 700; cursor: pointer; padding: 0; }

/* ----- kapeat näytöt ----- */
@media (max-width: 1180px) {
  .doc-nav { width: 180px; }
  .panel { width: 390px; }
}
@media (max-width: 900px) {
  .topbar { padding: 0 14px; gap: 10px; }
  .user-name, .hide-sm { display: none; }
  .page { padding: 22px 16px 48px; }
  .grid-2 { grid-template-columns: 1fr; }
  .mobile-tabs { display: inline-flex; background: var(--surface-2); border-radius: 8px; padding: 2px; }
  .editor-site { display: none; }
  .editor-body { position: relative; }
  .panel, .preview-pane { position: absolute; inset: 0; width: auto; border: none; }
  .editor.has-nav .panel { inset: 46px 0 0 0; }
  .doc-nav { position: absolute; top: 0; left: 0; right: 0; height: 46px; width: auto; flex-direction: row; overflow-x: auto; padding: 6px 10px; border-right: none; border-bottom: 1px solid var(--border); align-items: center; }
  .doc-nav-title { display: none; }
  .doc-link { white-space: nowrap; flex: none; }
  .editor.show-form .preview-pane, .editor.show-form .preview-pane * { visibility: hidden; }
  .editor.show-form .preview-pane { z-index: -1; }
  .editor.show-preview .panel, .editor.show-preview .doc-nav { display: none; }
  .preview-page { display: none; }
  .table td { padding: 10px 6px; }
}
@media (max-width: 520px) {
  .editor-top .btn-ghost { display: none; }
  .chip { padding: 0 9px; font-size: 12px; }
}
@media (max-width: 900px) {
  .preview-toolbar .segmented { display: none; }
}
