/* ONEBRIEF — the editor is styled as a marked-up layout proof:
 * a white sheet on a cool drafting desk, non-photo-blue annotations for structure,
 * DEC navy for text and actions, red reserved for problems. */

@font-face {
  font-family: "Archivo";
  src: url("../assets/fonts/archivo-wdth.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("../assets/fonts/plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("../assets/fonts/plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  /* core palette */
  --ink: #1c2940;        /* DEC navy */
  --desk: #e6eaf0;       /* drafting table */
  --sheet: #ffffff;
  --blueline: #2e67bf;   /* non-photo blue: annotations, guides, focus */
  --flag: #c22f2a;       /* out of range / errors */
  --pass: #1d7549;

  /* derived */
  --ink-2: #33415c;
  --muted: #5e6879;
  --faint: #8a93a3;
  --rule: #d6dce5;
  --rule-strong: #b9c2cf;
  --blueline-wash: #e8effa;
  --blueline-soft: #9dbbe6;
  --flag-wash: #fbeceb;
  --pass-wash: #e4f2ea;
  --amber-wash: #fdf4dc;
  --amber-rule: #e2c36b;
  --accent: #c8005a;     /* template highlight colour, preview only */

  --sans: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "Plex Mono", ui-monospace, Consolas, "Liberation Mono", monospace;

  /* type scale */
  --t-xs: 12px;
  --t-sm: 13.5px;
  --t-base: 15px;
  --t-md: 18px;
  --t-lg: 24px;
  --t-xl: 40px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 400 var(--t-base)/1.5 var(--sans);
  font-stretch: 100%;
  color: var(--ink);
  background: var(--desk);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
code { font-family: var(--mono); }
.muted { color: var(--muted); font-weight: 400; }
.small { font-size: var(--t-xs); }
.spacer { flex: 1; }

:focus-visible { outline: 2px solid var(--blueline); outline-offset: 2px; }

.app {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 32px 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- header (on the desk) ---------- */
.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 20px;
}
.app-title {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 12px;
  line-height: 1;
  color: var(--ink);
}
.wordmark {
  font-size: var(--t-xl);
  font-weight: 850;
  font-stretch: 125%;
  letter-spacing: -0.01em;
}
.app-name {
  font-size: var(--t-md);
  font-weight: 500;
  font-stretch: 100%;
  color: var(--ink-2);
}
.app-sub { margin: 10px 0 0; color: var(--muted); }
.logo { height: 72px; width: auto; flex: none; mix-blend-mode: multiply; } /* the PNG has a white background */

/* ---------- the sheet ---------- */
.sheet {
  flex: 1;
  background: var(--sheet);
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  box-shadow: 0 1px 0 var(--rule), 0 18px 36px -24px rgba(28, 41, 64, .35);
  padding: 28px 32px 36px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  background: var(--sheet);
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
  transition: background-color .12s, color .12s;
}
.btn:hover { background: var(--blueline-wash); }
.btn.primary { background: var(--ink); color: #fff; }
.btn.primary:hover { background: var(--ink-2); }
.btn:disabled { opacity: .5; cursor: default; }
.link-btn {
  background: none;
  border: 0;
  padding: 3px 0;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--rule-strong);
  text-underline-offset: 3px;
  cursor: pointer;
  text-align: left;
}
.link-btn:hover { text-decoration-color: var(--ink); }
.link-btn.danger, .danger { color: var(--flag); }
.icon-btn {
  width: 32px; height: 32px;
  display: inline-grid; place-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: none;
  cursor: pointer;
  font-size: 15px;
  color: var(--ink-2);
}
.icon-btn:hover:not(:disabled) { background: var(--blueline-wash); color: var(--ink); }
.icon-btn:disabled { opacity: .25; cursor: default; }

/* ---------- editor layout ---------- */
.layout {
  display: grid;
  grid-template-columns: 216px 1fr;
  gap: 32px;
}
.side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 28px;
  border-right: 1px solid var(--rule);
  align-self: start;
  position: sticky;
  top: 20px;
}
.side-btn { width: 100%; padding-inline: 10px; }
#createBrief { margin-top: 8px; padding-block: 12px; }
.side-sep { height: 1px; background: var(--rule); margin: 10px 0 6px; }
.side-note { margin: 8px 0 0; font-size: var(--t-xs); color: var(--muted); }
.work { min-width: 0; }

/* ---------- metadata: the slug at the top of the sheet ---------- */
.meta-card {
  position: relative;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--blueline);
  border-radius: 3px;
  padding: 16px 20px 6px;
  margin-bottom: 28px;
  background: #fbfcfe;
}
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.card-head h2 { margin: 0; font-size: var(--t-md); font-weight: 700; color: var(--ink); }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.field > span { font-size: var(--t-sm); font-weight: 600; color: var(--ink); display: flex; gap: 10px; align-items: baseline; }
.field input, .field textarea, .link-panel #linkValue {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
}
.field input:focus, .field textarea:focus, .link-panel #linkValue:focus { border-color: var(--blueline); outline: 2px solid var(--blueline-wash); outline-offset: 0; }
.field textarea { resize: vertical; }
.field input.bad, .field textarea.bad { border-color: var(--flag); background: var(--flag-wash); }
.field .req { font-size: var(--t-xs); font-weight: 600; color: var(--flag); text-transform: uppercase; letter-spacing: .04em; }
.field .req[hidden] { display: none; }
.field-tags .missing { background: var(--flag-wash); border-color: #efbdbb; color: var(--flag); font-weight: 600; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.counter {
  font: 500 var(--t-xs)/1.4 var(--mono);
  padding: 1px 7px;
  border-radius: 3px;
  background: #eef1f5;
  color: var(--muted);
}
.counter.ok { background: var(--pass-wash); color: var(--pass); }
.counter.bad { background: var(--flag-wash); color: var(--flag); }
.hint { font-size: var(--t-xs); color: var(--muted); margin: 0 0 10px; }

/* ---------- rows: the marked-up proof ---------- */
.rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}
/* vertical layout guide running down the sections */
.rows:not(:empty)::before {
  content: "";
  position: absolute;
  top: 6px; bottom: 6px;
  left: 46px; /* centre of the handle column: 26px number + 10px gap + 10px */
  border-left: 1px dashed var(--blueline-soft);
}
.row {
  display: grid;
  grid-template-columns: 26px 20px 96px 1fr auto;
  align-items: stretch;
  gap: 10px;
  position: relative;
  border-radius: 4px;
}
.pos {
  align-self: center;
  text-align: right;
  font: 500 var(--t-sm)/1 var(--mono);
  color: var(--blueline);
  font-variant-numeric: tabular-nums;
}
.handle {
  align-self: center;
  justify-self: center;
  position: relative;
  z-index: 1;
  width: 14px;
  padding: 6px 0;
  background: var(--sheet);
  cursor: grab;
  color: var(--faint);
  font-size: 13px;
  letter-spacing: -3px;
  text-align: center;
  user-select: none;
}
.row:hover .handle { color: var(--blueline); }
.row.dragging { opacity: .35; }
.row.drop-before::before, .row.drop-after::after {
  content: ""; position: absolute; left: 30px; right: 0; height: 2px; background: var(--blueline);
}
.row.drop-before::before { top: -8px; }
.row.drop-after::after { bottom: -8px; }

/* block tag: an annotation label in non-photo blue */
.chip {
  border: 1px solid var(--blueline);
  border-radius: 3px;
  background: var(--sheet);
  color: var(--blueline);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 6px;
  min-height: 58px;
  text-align: center;
}
.chip:hover { background: var(--blueline-wash); }
.chip.empty { border-style: dashed; }
.chip.static { cursor: default; min-width: 72px; padding: 8px 10px; }
.chip-code {
  font-weight: 700;
  font-stretch: 75%;
  font-size: var(--t-base);
  line-height: 1.1;
  word-break: break-word;
}
.chip.empty .chip-code { font-weight: 600; font-size: var(--t-xs); font-stretch: 100%; word-break: normal; }
.chip-emoji { font-size: 12px; }

/* content frame */
.box {
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  background: var(--sheet);
  padding: 10px 14px;
  min-height: 58px;
  text-align: left;
  cursor: pointer;
  min-width: 0;
  display: flex;
  align-items: center;
  transition: border-color .12s, box-shadow .12s;
}
.box:hover { border-color: var(--blueline); box-shadow: 0 0 0 3px var(--blueline-wash); }
.box:has(.placeholder:only-child) { border-style: dashed; border-color: var(--blueline-soft); background: #fcfdff; }
.box-content { display: block; width: 100%; min-width: 0; }
.html-snippet {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-2);
}
.placeholder { color: var(--muted); }
.field-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.html-snippet + .field-tags { margin-top: 8px; }
.field-tags span {
  font-size: var(--t-xs);
  background: #f1f3f7;
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 1px 7px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-actions { display: flex; align-items: center; gap: 0; opacity: .55; transition: opacity .12s; }
.row:hover .row-actions, .row:focus-within .row-actions { opacity: 1; }

/* the one piece of motion: a new or copied section flashes so you can see where it landed */
.row.just-added { animation: landed 1.4s ease-out; }
@keyframes landed {
  0%, 25% { background: var(--blueline-wash); box-shadow: 0 0 0 6px var(--blueline-wash); }
  100% { background: transparent; box-shadow: 0 0 0 6px transparent; }
}

.add-bottom {
  width: calc(100% - 66px);
  margin: 16px 0 0 66px;
  border: 1px dashed var(--blueline);
  color: var(--blueline);
  background: var(--sheet);
  padding-block: 12px;
}
.add-bottom:hover { background: var(--blueline-wash); }
.empty-state { margin-left: 66px; padding: 28px 24px 8px; color: var(--muted); max-width: 60ch; }
.empty-state p { margin: 4px 0; }
.empty-state strong { color: var(--ink); font-size: var(--t-md); }

/* ---------- footer (on the desk) ---------- */
.foot { margin-top: 20px; font-size: var(--t-xs); color: var(--muted); text-align: center; }
.foot a { color: inherit; }

/* ---------- dialogs ---------- */
.modal {
  border: 0;
  border-radius: 10px;
  padding: 22px 24px;
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  box-shadow: 0 24px 60px rgba(28, 41, 64, .35);
  color: var(--ink);
}
.modal::backdrop { background: rgba(28, 41, 64, .5); }
.modal.wide { width: min(1100px, calc(100vw - 32px)); }
.modal.editor { width: min(1180px, calc(100vw - 32px)); }
.modal.editor.compact { width: min(640px, calc(100vw - 32px)); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.modal-head h2 { margin: 0; font-size: var(--t-md); font-weight: 700; color: var(--ink); }
.modal-head p { margin: 2px 0 0; font-size: var(--t-sm); }
.modal-foot { display: flex; align-items: center; gap: 10px; margin-top: 18px; }
.bd-title { display: flex; gap: 14px; align-items: center; }
.emoji { font-weight: 400; }

.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.pick {
  display: flex; flex-direction: column; gap: 4px;
  border: 1px solid var(--rule); border-radius: 4px; background: #fff;
  padding: 10px; text-align: left; cursor: pointer;
}
.pick:hover { border-color: var(--blueline); box-shadow: 0 0 0 3px var(--blueline-wash); }
.pick.selected { border-color: var(--blueline); box-shadow: 0 0 0 2px var(--blueline) inset; }
.pick-img { height: 130px; display: grid; place-items: center; background: #f7f8fa; border-radius: 2px; overflow: hidden; margin-bottom: 6px; }
.pick-img img { max-width: 100%; max-height: 130px; object-fit: contain; }
.pick-name { font-weight: 700; color: var(--ink); font-size: var(--t-base); }
.pick-sum { font-size: var(--t-sm); color: var(--muted); }

.bd-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.bd-fields .field.wide { grid-column: 1 / -1; }
.bd-rich { position: relative; }
.color-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.swatches { display: flex; gap: 6px; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--rule-strong); cursor: pointer; padding: 0; }
.swatch.on { outline: 2px solid var(--blueline); outline-offset: 2px; }
.color-row input[type="color"] { width: 40px; height: 32px; padding: 2px; border: 1px solid var(--rule-strong); border-radius: 4px; background: #fff; cursor: pointer; }
.field .color-row .color-hex { width: 110px; font-family: var(--mono); text-transform: uppercase; }

.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px;
  padding: 6px; border: 1px solid var(--rule-strong); border-bottom: 0; border-radius: 4px 4px 0 0; background: #f6f8fb;
}
.toolbar button, .toolbar select {
  border: 1px solid transparent; background: none; border-radius: 4px; padding: 4px 9px; cursor: pointer; font-size: var(--t-sm); color: var(--ink);
}
.toolbar select { border-color: var(--rule-strong); background: #fff; }
.toolbar button:hover { background: #fff; border-color: var(--rule); }
.toolbar button.on { background: var(--ink); color: #fff; }
.tb-sep { width: 1px; height: 20px; background: var(--rule); margin: 0 4px; }
.rt-flash { position: absolute; top: 48px; left: 12px; z-index: 3; background: var(--ink); color: #fff; font-size: var(--t-sm); padding: 6px 12px; border-radius: 4px; }
.panes { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--rule-strong); border-radius: 0 0 4px 4px; }
.pane { display: flex; flex-direction: column; min-width: 0; }
.pane + .pane { border-left: 1px solid var(--rule-strong); }
.pane-label { font-size: var(--t-xs); font-weight: 700; color: var(--ink); padding: 6px 12px; border-bottom: 1px solid var(--rule); background: #fbfcfe; }
.rt-visual, .rt-code { height: min(52vh, 480px); overflow: auto; padding: 14px 18px; }
.rt-visual { outline: none; line-height: 1.6; max-width: none; }
.rt-visual:focus-visible { box-shadow: inset 0 0 0 2px var(--blueline-wash); }
.rt-visual:empty::before { content: "Start writing or paste your text here…"; color: var(--muted); }
.rt-visual h2 { font-size: 21px; margin: .6em 0 .3em; }
.rt-visual h3 { font-size: 17px; margin: .6em 0 .3em; }
.rt-visual h4 { font-size: 15px; margin: .6em 0 .3em; }
.rt-visual p { margin: 0 0 .75em; }
.rt-visual a { color: var(--blueline); text-decoration: underline; }
.rt-code { border: 0; resize: none; font: 12.5px/1.6 var(--mono); color: var(--ink-2); background: #fbfcfe; white-space: pre-wrap; }
.rt-code:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--blueline-wash); }

.link-panel {
  position: absolute; top: 44px; right: 16px; z-index: 4;
  width: min(420px, calc(100% - 32px));
  background: #fff; border: 1px solid var(--blueline); border-radius: 6px;
  padding: 14px 16px; box-shadow: 0 14px 30px rgba(28, 41, 64, .22);
}
.link-panel h3 { margin: 0 0 8px; font-size: var(--t-base); color: var(--ink); }
.link-types { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; margin-bottom: 10px; font-size: var(--t-sm); }
.link-types label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.link-panel .hint { margin: 6px 0; }
.link-preview { display: block; font-size: var(--t-xs); background: var(--blueline-wash); color: var(--ink-2); border-radius: 3px; padding: 6px 8px; word-break: break-all; margin-bottom: 8px; }
.field select { font: inherit; padding: 8px 10px; border: 1px solid var(--rule-strong); border-radius: 4px; background: #fff; color: var(--ink); }
.set-result { font-size: var(--t-xs); color: var(--muted); margin: -4px 0 12px; }
.set-result code { font-family: var(--mono); color: var(--ink-2); }
.check { display: flex; gap: 8px; align-items: center; font-size: var(--t-sm); margin: 6px 0; }
.link-actions { display: flex; gap: 8px; align-items: center; margin-top: 8px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50;
  max-width: calc(100vw - 32px);
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 6px;
  display: flex; gap: 14px; align-items: center; box-shadow: 0 10px 24px rgba(28, 41, 64, .3);
}
.toast button { background: none; border: 0; color: #fff; font-weight: 700; text-decoration: underline; cursor: pointer; }

/* ---------- export view ---------- */
.export-bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--rule); }
.export-file { flex: 1; display: flex; flex-direction: column; min-width: 200px; }
.export-file span { font-size: var(--t-xs); }
.export-file code { font-size: var(--t-sm); word-break: break-all; color: var(--ink); }
.export-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.notice { background: var(--flag-wash); border: 1px solid #efbdbb; border-left: 3px solid var(--flag); color: #7a1c19; border-radius: 3px; padding: 12px 16px; margin-bottom: 12px; }
.checks { background: var(--amber-wash); border: 1px solid var(--amber-rule); border-radius: 3px; padding: 10px 16px; margin-bottom: 20px; }
.checks summary { cursor: pointer; font-weight: 600; }
.checks ul { margin: 8px 0 4px; padding-left: 20px; }
.section-title { font-size: var(--t-md); color: var(--ink); margin: 8px 0 12px; }
.preview-frame { border: 1px solid var(--rule); border-radius: 3px; background: var(--desk); padding: 24px; }

/* ---------- page preview (generic template look, not the app's style) ---------- */
.preview { max-width: 860px; margin: 0 auto; background: #fff; padding: 28px 40px 40px; font-family: Lato, "Helvetica Neue", Arial, sans-serif; color: #444; box-shadow: 0 2px 10px rgba(0, 0, 0, .06); }
.preview > * + * { margin-top: 26px; }
.preview a { color: var(--accent); }
.pv-crumbs { font-size: 13px; font-weight: 700; color: #777; }
.pv-h1 { font-size: 32px; color: #111; margin: 10px 0 0; line-height: 1.2; }
.pv-byline { font-size: 13px; color: #888; margin-top: 4px !important; }
.pv-toc { border: 1px solid #ddd; padding: 12px 18px; display: inline-block; min-width: 50%; }
.pv-toc ol { margin: 6px 0 0; padding-left: 20px; }
.pv-toc li.lv3, .pv-toc li.lv4 { list-style: none; counter-increment: list-item 0; font-size: .92em; }
.pv-toc li.lv3 { margin-left: 18px; }
.pv-toc li.lv4 { margin-left: 36px; }
.pv-toc li.lv3::before, .pv-toc li.lv4::before { content: "– "; color: #999; }
.pv-text h2 { font-size: 22px; color: #111; margin: 0 0 8px; }
.pv-text h3 { font-size: 18px; color: #111; margin: 12px 0 6px; }
.pv-text p { margin: 0 0 10px; line-height: 1.6; }
.pv-intro { font-size: 16px; }
.pv-empty { color: #aaa; font-style: italic; }
.pv-img { margin: 0; }
.pv-img.center { max-width: 50%; margin-left: auto; margin-right: auto; }
.pv-img figcaption { font-size: 13px; margin-top: 6px; color: #555; }
.pv-ph { background: #d9d9d9; aspect-ratio: 16 / 9; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #222; padding: 10px; text-align: center; }
.pv-img.full .pv-ph { aspect-ratio: 21 / 9; }
.pv-img:not(.full) .pv-ph { aspect-ratio: 1 / 1; }
.pv-ph svg { width: 56px; height: 56px; }
.pv-ph.small { aspect-ratio: 1 / 1; width: 120px; }
.pv-ph.small svg { width: 36px; height: 36px; }
.pv-ph.small .pv-file { font-size: 10px; max-width: 100%; overflow-wrap: anywhere; }
.pv-file { font-family: var(--mono); font-size: 12px; background: rgba(255, 255, 255, .7); padding: 1px 6px; border-radius: 4px; }
.pv-alt { font-size: 11px; color: #555; }
.pv-split { display: grid; grid-template-columns: 1fr 1.2fr; gap: 28px; align-items: start; }
.pv-split:has(> .pv-text:first-child) { grid-template-columns: 1.2fr 1fr; }
.pv-split.product { grid-template-columns: 180px 1fr; }
.pv-split.product:has(> .pv-text:first-child) { grid-template-columns: 1fr 180px; }
.pv-product { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; font-size: 13px; }
.pv-pname { color: #222; }
.pv-pid { font-family: var(--mono); font-size: 11px; color: #888; }
.pv-stars { font-size: 11px; color: #222; letter-spacing: 1px; }
.pv-btn { background: #111; color: #fff; font-size: 11px; text-transform: uppercase; padding: 6px 18px; border-radius: 4px; }
.pv-cards h3 { font-size: 20px; color: #111; margin: 0 0 14px; }
.pv-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.pv-row.one { grid-template-columns: 1fr; }
.pv-highlight { padding: 20px 26px; text-align: center; font-weight: 700; }
.pv-highlight .pv-text p { margin: 0; }
.pv-highlight a { color: inherit; }
.pv-news { border: 1px solid #ddd; padding: 16px 20px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.pv-input { border: 1px solid #555; padding: 3px 8px; width: 260px; max-width: 100%; font-size: 13px; }
.pv-quote { margin: 0; text-align: center; color: var(--accent); padding: 0 40px; }
.pv-quote p { font-size: 19px; font-weight: 700; line-height: 1.4; margin: 0 0 12px; }
.pv-quote cite { font-weight: 700; font-size: 13px; text-transform: uppercase; }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .app { padding: 16px 16px 12px; }
  .top { align-items: flex-start; }
  .wordmark { font-size: 30px; }
  .app-name { font-size: var(--t-base); }
  .logo { height: 48px; }
  .sheet { padding: 18px 16px 24px; border-radius: 3px; }
  .layout { grid-template-columns: 1fr; gap: 20px; }
  .side {
    position: static; border-right: 0; padding-right: 0; border-bottom: 1px solid var(--rule); padding-bottom: 18px;
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px;
  }
  #seeBlocks, #createBrief, .side-sep, .side-note { grid-column: 1 / -1; }
  #createBrief { margin-top: 2px; }
  .side-sep { margin: 4px 0; }
  .side-note { margin-top: 0; }
  .rows:not(:empty)::before { display: none; }
  .row { grid-template-columns: 20px 72px 1fr; gap: 8px; }
  .handle { display: none; }
  .row-actions { grid-column: 2 / -1; justify-content: flex-end; opacity: 1; }
  .add-bottom { width: 100%; margin-left: 0; }
  .empty-state { margin-left: 0; padding-inline: 0; }
  .panes { grid-template-columns: 1fr; }
  .pane + .pane { border-left: 0; border-top: 1px solid var(--rule-strong); }
  .field-row { grid-template-columns: 1fr; }
  .preview-frame { padding: 10px; }
  .preview { padding: 18px; }
  .pv-split, .pv-split.product, .pv-split:has(> .pv-text:first-child), .pv-split.product:has(> .pv-text:first-child), .pv-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
