:root {
  /* Light, warm "VC/PE" palette: ivory canvas, white cards, ink text. */
  --bg: #f5f2ec;            /* warm ivory canvas */
  --panel: #ffffff;         /* cards / raised surfaces */
  --panel-2: #faf8f3;       /* recessed fields, subtle fills */
  --border: #e7e2d8;        /* warm hairline */
  --border-strong: #d8d1c3; /* hover / emphasis hairline */
  --ink: #1b1a17;           /* near-black text + primary buttons */
  --text: #1b1a17;
  --muted: #6b665e;         /* secondary text */
  --faint: #98928699;       /* very quiet text/icons */
  --accent: #9c6b4e;        /* muted clay: focus rings, small highlights */
  --accent-hover: #855840;
  --accent-soft: rgba(156, 107, 78, .12);
  --link: #4a463f;          /* quiet link text */
  --danger: #b23b2e;
  --ok: #4f7a52;            /* muted success green */

  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(20, 18, 15, .04);
  --shadow: 0 1px 2px rgba(20, 18, 15, .04), 0 12px 40px rgba(20, 18, 15, .07);
  --ui-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  --display-font: "Schibsted Grotesk", "Inter", -apple-system, sans-serif;

  /* Four font sizes only. */
  --fs-title: 26px;   /* page / hero titles (h1) */
  --fs-head: 18px;    /* section headings, brand (h2) */
  --fs-body: 15px;    /* all content: inputs, buttons, rows, folders */
  --fs-small: 12px;   /* labels, captions, small buttons */
}

* { box-sizing: border-box; }

/* The hidden attribute must always win over component display rules. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: var(--ui-font);
  font-size: var(--fs-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--ink); }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  background: transparent;
}
.topbar .brand { font-family: var(--display-font); font-weight: 600;
  font-size: var(--fs-head); color: var(--ink); letter-spacing: -.01em; }
.topbar nav { display: flex; gap: 22px; align-items: center; }
.muted { color: var(--muted); }

.container { max-width: 960px; margin: 0 auto; padding: 48px 32px; }

h1, h2, h3 { text-wrap: balance; }
h1 { font-family: var(--display-font); font-size: var(--fs-title);
  letter-spacing: -.02em; margin: 0 0 6px; }
h2 { font-family: var(--display-font); font-size: var(--fs-head);
  letter-spacing: -.01em; margin: 32px 0 14px; }
.sub { color: var(--muted); margin: 0 0 28px; text-wrap: pretty; }
/* Even wrapping: balance short display text, "pretty" longer body copy. */
.explainer h1, .dr-title, .brand-big, .panel-head h2,
.feature strong { text-wrap: balance; }
.explainer-lead, .feature span, .empty-note, .file-chosen,
p { text-wrap: pretty; }
.explainer { color: var(--muted); font-size: var(--fs-small); margin: 0 0 16px; }

.btn {
  display: inline-block;
  background: var(--ink);
  color: #f5f2ec;
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 11px 20px;
  font-size: var(--fs-body);
  font-weight: 500;
  cursor: pointer;
  box-shadow: none;
  transition: transform .12s ease, background .15s ease, opacity .15s ease;
}
.btn:hover { background: #000; text-decoration: none;
  transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .35; cursor: not-allowed; transform: none; }
.btn.secondary { background: transparent; border: 1px solid var(--border-strong);
  color: var(--ink); }
.btn.secondary:hover { background: var(--panel-2);
  border-color: var(--ink); }
.btn.danger { background: transparent; border: 1px solid var(--danger);
  color: var(--danger); padding: 6px 12px; font-size: var(--fs-small); }
.btn.icon-btn { padding: 9px 11px; display: inline-flex; align-items: center;
  justify-content: center; }
.btn.icon-btn svg { width: 16px; height: 16px; display: block; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

label { display: block; font-size: var(--fs-small); color: var(--muted);
  margin: 16px 0 6px; }
input[type=text], input[type=email], input[type=password], select {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--ink);
  font-size: var(--fs-body);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input[type=text]:focus, input[type=email]:focus, input[type=password]:focus,
select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.banner {
  background: #f3ecdd;
  border: 1px solid #e2d4b3;
  color: #6b5526;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}
.error { color: var(--danger); margin: 12px 0; }
.empty-note { padding: 14px 2px; color: var(--muted); font-size: var(--fs-body); }

/* ── Data room: a plain, document-like list ──────────────────────────────── */
.dataroom {
  background: var(--dr-bg);
  color: var(--dr-file);
  font-family: var(--dr-file-font, inherit);
}
.dataroom-page { max-width: 720px; margin: 0 auto; padding: 40px 24px 80px; }
.dr-head { display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin-bottom: 8px; }
.dr-title { color: var(--dr-title); font-family: var(--dr-title-font, inherit);
  font-size: var(--dr-title-size, var(--fs-title));
  font-weight: var(--dr-title-weight, 700);
  font-style: var(--dr-title-style, normal); margin: 0; }
.dr-viewer { color: var(--dr-file); opacity: .55; font-size: var(--fs-small);
  white-space: nowrap; }
.dr-section { color: var(--dr-subtitle);
  font-family: var(--dr-subtitle-font, inherit);
  font-size: var(--dr-subtitle-size, var(--fs-head));
  font-weight: var(--dr-subtitle-weight, 700);
  font-style: var(--dr-subtitle-style, normal); margin: 28px 0 6px; }
.dr-files { list-style: none; margin: 0 0 8px; padding: 0; }
.dataroom[data-bullet="bullet"] .dr-files { list-style: disc;
  padding-left: 1.25em; }
.dr-files li { padding: 1px 0; font-size: var(--dr-file-size, var(--fs-body)); }
/* Each document is a full-width row that reads as plain text until hovered,
   when it becomes a subtle button: a background tint with a small, soft
   shadow, lifting slightly out of the page (and sinking back on leave). The
   bullet is rendered inside the row (::before) so the highlight includes it. */
.dr-file { color: var(--dr-file); text-decoration: none;
  font-weight: var(--dr-file-weight, 400);
  font-style: var(--dr-file-style, normal);
  display: block; padding: 10px 14px; border-radius: 10px;
  background: transparent; transform: translateY(0);
  box-shadow: 0 0 0 0 rgba(20, 18, 15, 0);
  transition: background .16s ease, box-shadow .16s ease,
    transform .16s ease; }
.dr-file::before { content: var(--dr-file-bullet, ""); }
.dataroom a.dr-file:hover { opacity: 1;
  background: color-mix(in srgb, var(--dr-hover, var(--accent)) 16%,
    transparent);
  transform: translateY(-1px);
  box-shadow: 0 2px 5px -2px rgba(20, 18, 15, .16); }

/* Banner + logo branding */
.dr-brand { position: relative; width: 100%; text-align: center; }
.dr-banner { display: block; width: 100%; height: auto; }
.dr-logo { display: block; max-width: 50%; height: auto; margin: 16px auto 0; }
.dr-brand.has-both .dr-logo { position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%); margin: 0; max-width: 50%; }

/* ── Dashboard layout (single column; preview appears on demand) ─────────── */
.layout { display: grid; grid-template-columns: 1fr; gap: 24px;
  align-items: start; }
.layout.with-preview { grid-template-columns: 1fr 1fr; }
@media (max-width: 780px) {
  .layout.with-preview { grid-template-columns: 1fr; }
}
.actions { display: flex; gap: 10px; margin-top: 22px; }

/* Data room list */
.room-list { display: flex; flex-direction: column; gap: 8px; }
.room {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 16px; background: var(--panel);
  border: 1px solid var(--border); border-radius: 10px;
}
.room-main { min-width: 0; }
.room-title { display: inline-block; font-weight: 700; color: var(--ink);
  font-size: var(--fs-body); }
.room-url { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.room-url .url-text { color: var(--muted); font-size: var(--fs-small);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy-btn {
  background: transparent; border: 1px solid var(--border); color: var(--muted);
  border-radius: 6px; padding: 2px 8px; font-size: var(--fs-small);
  cursor: pointer;
}
.copy-btn:hover { color: var(--ink); }
.copy-btn.copied { color: var(--ok); border-color: var(--ok); }

/* Customize (collapsible appearance controls) */
.customize { margin-top: 18px; border-top: 1px solid var(--border);
  padding-top: 14px; }
.cz-head { font-size: var(--fs-small); text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; }
.customize-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-top: 12px; }
.customize-grid label { margin: 0; display: flex; align-items: center;
  justify-content: space-between; gap: 8px; }
.customize-grid select { width: auto; font-size: var(--fs-small);
  padding: 6px 8px; }
.customize-grid input[type=color] { width: 44px; height: 30px; padding: 2px;
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 6px; cursor: pointer; }

/* Preview panel: renders the data room as the visitor sees it */
.col-right { position: sticky; top: 24px; }
.preview-panel { position: relative; min-height: 220px; padding: 0;
  overflow: hidden; }
.preview-close { position: absolute; top: 8px; right: 10px; z-index: 2;
  background: rgba(20, 18, 15, .35); border: none; color: #fff; width: 24px;
  height: 24px; border-radius: 50%; font-size: 16px; line-height: 1;
  cursor: pointer; }
.preview-close:hover { background: rgba(20, 18, 15, .6); }
.preview-panel .dataroom-page { max-width: none; padding: 22px 24px 30px; }
.preview-panel .dr-title { font-size: var(--fs-head); }
.preview-panel .dr-section { margin-top: 18px; }

/* Branding pickers (Customize): label column aligned with the font pickers,
   controls (name / Choose / Clear) sitting together in the second column. */
.brand-grid { display: grid; grid-template-columns: 72px 1fr;
  gap: 9px 10px; align-items: center; margin-top: 12px; }
.brand-grid .cz-row-label { font-size: var(--fs-small); color: var(--muted); }
.brand-controls { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand-controls .brand-name { color: var(--text); font-size: var(--fs-small);
  max-width: 110px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.btn.tiny { padding: 4px 9px; font-size: var(--fs-small); }

/* Image-picker modal */
.modal { position: fixed; inset: 0; background: rgba(20, 18, 15, .4);
  display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal[hidden] { display: none; }
.modal-card { width: 440px; max-width: 92vw; background: var(--panel);
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  position: relative; }
.modal-head { display: flex; align-items: center;
  justify-content: space-between; padding: 14px 16px;
  border-bottom: 1px solid var(--border); }
.modal-head .preview-close { position: static; background: transparent;
  color: var(--muted); }
.modal-head .preview-close:hover { color: var(--text); }

/* Confirm dialog (e.g. delete link) */
.confirm-card { width: 400px; padding: 26px 26px 22px; }
.confirm-title { font-family: var(--display-font); font-size: var(--fs-head);
  letter-spacing: -.01em; margin: 0 0 8px; color: var(--ink); }
.confirm-body { margin: 0 0 22px; color: var(--muted); line-height: 1.5; }
.confirm-body strong { color: var(--ink); }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; }
.btn.danger-solid { background: var(--danger); color: #fff;
  border: 1px solid var(--danger); padding: 11px 20px; }
.btn.danger-solid:hover { background: #9a3328; border-color: #9a3328; }

/* ── Drive folder picker ─────────────────────────────────────────────────── */
.picker {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 6px;
}
.breadcrumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  padding: 9px 12px; background: var(--panel-2);
  border-bottom: 1px solid var(--border); font-size: var(--fs-small);
}
.breadcrumb .crumb { color: var(--link); }
.breadcrumb .crumb:last-child { color: var(--text); font-weight: 600; }
.breadcrumb .crumb-sep { color: var(--muted); }
.folder-list {
  list-style: none; margin: 0; padding: 0;
  height: 190px; overflow-y: auto;  /* fixed ~5 folders, then scroll */
}
.folder-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 12px; border-bottom: 1px solid var(--border);
  cursor: pointer; font-size: var(--fs-small);
}
.folder-item:last-child { border-bottom: none; }
.folder-item:hover { color: var(--accent); background: var(--panel-2); }
.folder-icon { width: 15px; text-align: center; font-size: var(--fs-small); }
.folder-empty { padding: 12px; color: var(--muted);
  font-size: var(--fs-small); }

/* ══ Dashboard SPA shell ═══════════════════════════════════════════════════ */
.app-body { height: 100vh; overflow: hidden; }
.app { display: flex; height: 100vh; }

.sidebar {
  flex: 0 0 300px; width: 300px; height: 100vh;
  display: flex; flex-direction: column; gap: 18px; padding: 26px 20px;
  background: var(--panel-2);
  border-right: 1px solid var(--border);
}
.side-brand {
  font-family: var(--display-font);
  background: none; border: none; color: var(--ink); font-size: 22px;
  font-weight: 600; letter-spacing: -.02em;
  text-align: left; cursor: pointer; padding: 2px 6px;
}
.side-brand:hover { color: var(--accent); }
.side-reconnect { font-size: var(--fs-small); color: #8a6d2e; }
/* Sidebar sections (Create new / Previous links), each under a divider. */
.side-section { display: flex; flex-direction: column; gap: 4px;
  border-top: 1px solid var(--border); padding-top: 16px; }
.side-section-grow { flex: 1; min-height: 0; }
.side-label { font-size: var(--fs-small); text-transform: uppercase;
  letter-spacing: .1em; color: var(--muted); margin-bottom: 8px; }
.side-links { overflow-y: auto; display: flex;
  flex-direction: column; gap: 2px; min-height: 40px; }
.side-section-grow .side-links { flex: 1; }
.lcard { position: relative; padding: 10px 34px 10px 12px;
  border-radius: var(--radius-sm); cursor: pointer;
  transition: background .15s ease; }
.lcard:hover { background: rgba(20, 18, 15, .04); }
/* The link/view currently open in the editor. */
.lcard.active { background: rgba(20, 18, 15, .07); }
.lcard.active:hover { background: rgba(20, 18, 15, .09); }
/* "Create new" cards: a subtle + affordance, no link row or delete. */
.ncard { padding-right: 12px; }
.ncard .lcard-title::before { content: "+ "; color: var(--accent);
  font-weight: 700; }
.lcard-main { min-width: 0; }
.lcard-title { color: var(--ink); font-size: var(--fs-body); font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lcard-sub { color: var(--muted); font-size: var(--fs-small);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Link URL row: shown under the kind label, with a copy button on hover. */
.lcard-link { display: flex; align-items: center; gap: 6px; margin-top: 1px; }
.lcard-url { flex: 1; min-width: 0; color: var(--muted);
  font-size: var(--fs-small); opacity: .75;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lcard-copy {
  flex: 0 0 auto; opacity: 0; transition: opacity .15s;
  background: rgba(20, 18, 15, .06); border: none; color: var(--ink);
  width: 22px; height: 22px; border-radius: 6px; cursor: pointer;
  font-size: 12px; line-height: 1;
}
.lcard:hover .lcard-copy { opacity: 1; }
.lcard-copy:hover { background: rgba(20, 18, 15, .12); }
.lcard-copy.copied { color: var(--ok); }
/* Delete button, top-right, revealed on hover. */
.lcard-del {
  position: absolute; right: 7px; top: 10px;
  opacity: 0; transition: opacity .15s, color .15s, background .15s;
  background: transparent; border: none; color: var(--muted);
  width: 24px; height: 24px; border-radius: 6px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.lcard-del svg { width: 14px; height: 14px; }
.lcard:hover .lcard-del { opacity: 1; }
.lcard-del:hover { color: var(--danger); background: rgba(178, 59, 46, .1); }
.side-user { display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding-top: 14px; border-top: 1px solid var(--border);
  font-size: var(--fs-small); }
.side-user .muted { overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }

.stage { flex: 1; height: 100vh; overflow: hidden; background: var(--bg);
  position: relative; }

/* Explainer */
.explainer { height: 100%; display: flex; align-items: center;
  justify-content: center; padding: 64px; overflow-y: auto; }
.explainer-inner { max-width: 680px; }
.explainer-mark { font-size: var(--fs-small); letter-spacing: .26em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 28px;
  font-weight: 600; }
.explainer h1 { font-family: var(--display-font); font-size: 52px;
  line-height: 1.04; margin: 0 0 24px; color: var(--ink); font-weight: 500;
  letter-spacing: -.03em; }
.explainer-lead { color: var(--muted); font-size: 19px; line-height: 1.55;
  margin: 0 0 44px; max-width: 92%; }
.explainer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin-bottom: 44px; }
.feature { display: flex; gap: 15px; align-items: flex-start;
  padding: 22px; border-radius: var(--radius); background: var(--panel);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease; }
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.feature > div { display: flex; flex-direction: column; gap: 4px; }
.feature-icon {
  flex: 0 0 auto; display: flex; align-items: flex-start;
  color: var(--accent);
}
.feature-icon svg { width: 22px; height: 22px; }
.feature strong { color: var(--ink); font-size: var(--fs-body);
  font-weight: 600; }
.feature span { color: var(--muted); font-size: var(--fs-small);
  line-height: 1.5; }
.explainer-cta { display: flex; gap: 12px; }

/* Workspace: form + preview, sliding in */
.workspace { display: grid; grid-template-columns: 1fr 1fr; height: 100vh; }
.stage[data-mode="card"] .form-panel { display: none; }
.stage[data-mode="card"] .workspace { grid-template-columns: 1fr; }
.workspace .panel { opacity: 0; transform: translateY(16px);
  transition: opacity .4s ease, transform .4s ease; }
.workspace.show .panel { opacity: 1; transform: none; }
.workspace.show .preview-panel { transition-delay: .08s; }

.form-panel { height: 100vh; overflow-y: auto; padding: 36px 34px 64px;
  border-right: 1px solid var(--border); }
.panel-head { display: flex; align-items: center;
  justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.panel-head h2 { margin: 0; }
.panel-head-main { min-width: 0; }
.share-sub { display: block; font-size: var(--fs-small); color: var(--link);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-sub:hover { color: var(--ink); }
.preview-panel { height: 100vh; overflow: auto; padding: 0;
  background: var(--panel-2); }
.preview-panel .dataroom { min-height: 100vh; }
.preview-max { position: absolute; top: 10px; right: 12px; z-index: 5;
  width: 32px; height: 32px; border-radius: 8px; border: none; cursor: pointer;
  background: rgba(20, 18, 15, .35); color: #fff; font-size: 16px; }
.preview-max:hover { background: rgba(20, 18, 15, .55); }
.preview-frame { width: 100%; height: 100vh; border: 0; display: block;
  background: var(--panel-2); }
.file-chosen { color: var(--text); font-size: var(--fs-small);
  margin: 8px 0 0; }
.check { display: flex; align-items: center; gap: 10px;
  margin: 14px 0 0; font-size: var(--fs-body); color: var(--text); }
.check label { display: inline; margin: 0; cursor: pointer;
  font-size: var(--fs-body); color: var(--text); }
/* Apple-style toggle switch (replaces the default blue checkbox). */
.check input[type=checkbox] {
  appearance: none; -webkit-appearance: none; margin: 0; flex: 0 0 auto;
  position: relative; width: 38px; height: 22px; border-radius: 999px;
  background: var(--border-strong); border: none; cursor: pointer;
  transition: background .18s ease;
}
.check input[type=checkbox]::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(20, 18, 15, .25);
  transition: transform .18s ease;
}
.check input[type=checkbox]:checked { background: var(--accent); }
.check input[type=checkbox]:checked::after { transform: translateX(16px); }
.check input[type=checkbox]:focus-visible {
  outline: none; box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Extra-security group (watermark + tiling): a plain section like Appearance */
.seclist { margin-top: 18px; border-top: 1px solid var(--border);
  padding-top: 14px; }
.seclist .check { margin: 10px 0 0; }

/* (i) info badge with hover/focus explainer */
.tip { display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto; width: 16px; height: 16px; border-radius: 50%;
  font: italic 700 11px/1 Georgia, "Times New Roman", serif;
  background: var(--panel-2); color: var(--muted);
  border: 1px solid var(--border); cursor: help; position: relative; }
.tip:hover, .tip:focus { color: var(--ink); border-color: var(--accent);
  outline: none; }
.tip::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 8px);
  left: 50%; transform: translateX(-50%); width: 230px; padding: 10px 12px;
  border-radius: var(--radius-sm); background: var(--ink); color: #f5f2ec;
  border: 1px solid var(--ink);
  font: 400 var(--fs-small)/1.45 var(--ui-font); text-align: left;
  letter-spacing: normal; text-transform: none; box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transition: opacity .15s ease;
  z-index: 80; pointer-events: none; }
.tip:hover::after, .tip:focus::after { opacity: 1; visibility: visible; }
.label-row { display: flex; align-items: baseline;
  justify-content: space-between; margin: 16px 0 6px; }
.label-row label { margin: 0; }
.genpw { background: transparent; border: 1px solid var(--border);
  color: var(--link); border-radius: 6px; padding: 3px 9px;
  font-size: var(--fs-small); cursor: pointer; }
.genpw:hover { color: var(--ink); border-color: var(--accent); }

/* Customize grid: label | font | colour | bullet */
.cz-grid { display: grid; grid-template-columns: 72px 1fr auto auto;
  gap: 9px 10px; align-items: center; margin-top: 12px; }
.cz-row-label { font-size: var(--fs-small); color: var(--muted); }
.cz-grid .th-font { width: 100%; font-size: var(--fs-small); padding: 6px 8px; }
.cz-grid input[type=color] { width: 40px; height: 28px; padding: 2px;
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 6px; cursor: pointer; }
.bullet-btn { min-width: 44px; background: var(--panel-2); border: 1px solid
  var(--border); color: var(--ink); border-radius: 6px; padding: 5px 8px;
  cursor: pointer; font-size: var(--fs-small); }
.bullet-btn:hover { border-color: var(--accent); }

/* Bullet popover */
.bullet-pop { position: fixed; z-index: 60; background: var(--panel);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px; width: 220px; max-height: 80vh; overflow-y: auto;
  box-shadow: var(--shadow); }
.bullet-grid { display: grid; grid-template-columns: repeat(6, 1fr);
  gap: 4px; margin-bottom: 8px; }
.bullet-grid button { background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 6px 0; cursor: pointer; font-size: 15px; }
.bullet-grid button:hover { border-color: var(--accent); }
#bullet-custom { margin-bottom: 8px; }
.modal .x { background: transparent; border: none; color: var(--muted);
  font-size: 20px; line-height: 1; cursor: pointer; }
.modal .x:hover { color: var(--ink); }

/* Full-screen document popup */
.docmodal { background: rgba(20, 18, 15, .6); }
.docmodal iframe { width: min(1000px, 94vw); height: 92vh; border: 0;
  border-radius: var(--radius); background: var(--panel);
  box-shadow: var(--shadow); }
.docmodal-x { position: fixed; top: 18px; right: 22px; z-index: 70;
  width: 38px; height: 38px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255, 255, 255, .85); color: var(--ink); font-size: 22px;
  line-height: 1; box-shadow: var(--shadow-sm); }
.docmodal-x:hover { background: #fff; }

/* Maximised data-room preview: the live preview, full-screen at true size.
   z-index stays below the document modal (.modal, z-50) so clicking a file
   opens its viewer above the maximised preview, not hidden behind it. */
.preview-panel.maximised { position: fixed; inset: 0; z-index: 40;
  width: 100vw; height: 100vh; }
.preview-panel.maximised .dataroom-page { max-width: 760px; margin: 0 auto;
  padding: 40px 24px 80px; }
.preview-panel.maximised .dr-title {
  font-size: var(--dr-title-size, var(--fs-title)); }

/* Font dialog (font + size + bold + italic per text role) */
.font-btn { width: 100%; text-align: left; background: var(--panel-2);
  border: 1px solid var(--border); color: var(--ink); border-radius: 6px;
  padding: 6px 8px; cursor: pointer; font-size: var(--fs-small);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.font-btn:hover { border-color: var(--accent); }
.font-pop { position: fixed; z-index: 60; background: var(--panel);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px; width: 232px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 10px; }
.fp-row { display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin: 0; font-size: var(--fs-small); color: var(--muted); }
.fp-row select { flex: 1; min-width: 0; font-size: var(--fs-small);
  padding: 5px 6px; }
.fp-row input[type=number] { width: 66px; font-size: var(--fs-small);
  padding: 5px 6px; }
.fp-toggles { display: flex; gap: 8px; }
.fp-toggle { flex: 1; background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 6px 0; cursor: pointer; color: var(--ink);
  font-size: var(--fs-body); }
.fp-toggle#fp-bold { font-weight: 700; }
.fp-toggle#fp-italic { font-style: italic; font-family: Georgia, serif; }
.fp-toggle:hover { border-color: var(--accent); }
.fp-toggle.on { background: var(--accent); color: #fff;
  border-color: var(--accent); }

/* Image hover preview (logo/banner picker): grows in from the top-left
   (expands right + down) and contracts back out on leave. While a (possibly
   large) image downloads it shows as a small round spinner for instant
   feedback, then swaps to the full picture once decoded. */
.img-hover { position: fixed; z-index: 65; background: var(--panel);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 6px; box-shadow: var(--shadow); pointer-events: none;
  transform-origin: top left; transform: scale(.65); opacity: 0;
  transition: transform .14s ease, opacity .14s ease; }
.img-hover.show { transform: scale(1); opacity: 1; }
.img-hover[hidden] { display: none; }
.img-hover img { display: block; max-width: 300px; max-height: 300px;
  width: auto; height: auto; border-radius: 4px; }
/* Loading state: a small circle with a spinner; the image is hidden. */
.img-hover.loading { width: 32px; height: 32px; padding: 0;
  border-radius: 50%; }
.img-hover.loading img { display: none; }
.img-hover.loading::after { content: ""; position: absolute; inset: 8px;
  border-radius: 50%; border: 2px solid var(--border);
  border-top-color: var(--accent);
  animation: imghover-spin .6s linear infinite; }
@keyframes imghover-spin { to { transform: rotate(360deg); } }

/* Center auth/gate cards */
.centered { max-width: 420px; margin: 10vh auto; }
.brand-big { font-family: var(--display-font); font-size: var(--fs-title);
  font-weight: 600; letter-spacing: -.02em; text-align: center;
  margin-bottom: 24px; }

/* Legal pages (privacy / terms) */
.legal { max-width: 720px; margin: 0 auto; }
.legal h2 { font-size: var(--fs-head); margin: 30px 0 8px; }
.legal p { margin: 0 0 14px; color: var(--muted); line-height: 1.6;
  text-wrap: pretty; }
.legal a { color: var(--ink); text-decoration: underline;
  text-underline-offset: 2px; }
.legal code { background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 5px; font-size: .9em; }
.legal ul { margin: 0 0 14px; padding-left: 1.2em; color: var(--muted);
  line-height: 1.6; }
.legal li { margin: 4px 0; }
.legal table { width: 100%; border-collapse: collapse; margin: 0 0 16px;
  font-size: var(--fs-small); }
.legal th, .legal td { text-align: left; vertical-align: top;
  padding: 9px 12px; border-bottom: 1px solid var(--border); }
.legal th { color: var(--ink); font-weight: 600; }
.legal td { color: var(--muted); line-height: 1.5; }
.legal-note { margin-top: 28px; padding-top: 16px;
  border-top: 1px solid var(--border); font-size: var(--fs-small);
  font-style: italic; }

/* Footer with legal links (home explainer) */
.explainer-foot { margin-top: 36px; display: flex; gap: 18px;
  font-size: var(--fs-small); color: var(--muted); }
.explainer-foot a { color: var(--muted); }
.explainer-foot a:hover { color: var(--ink); }

/* Visitor gate consent note */
.gate-consent { margin-top: 16px; font-size: var(--fs-small);
  color: var(--muted); line-height: 1.5; text-align: center; }
.gate-consent a { color: var(--ink); text-decoration: underline; }
