/* GreenCo website editor.
   Colours are the website's own, from public/css/default.css: teal #085059,
   olive #8F993E, orange #FFA300, ink #25282A. Apercu is the font already in
   public/assets/fonts. */

@font-face { font-family: 'Apercu'; src: url('/assets/fonts/apercu/apercu-light-italic-pro.woff2') format('woff2'); font-weight: 300; font-style: italic; font-display: swap; }
@font-face { font-family: 'Apercu'; src: url('/assets/fonts/apercu/apercu-regular-pro.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Apercu'; src: url('/assets/fonts/apercu/apercu-medium-pro.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Apercu'; src: url('/assets/fonts/apercu/apercu-bold-pro.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --teal: #085059;
  --teal-600: #0a6470;
  --teal-dark: #063f46;
  --teal-darker: #052f34;
  --teal-50: #edf5f6;
  --teal-100: #d3e6e8;
  --teal-200: #a9cdd1;
  --olive: #8F993E;
  --olive-dark: #6b7330;
  --olive-50: #f3f5e4;
  --olive-100: #e4e9c4;
  --orange: #FFA300;
  --orange-dark: #8a5800;
  --orange-50: #fff5df;
  --pink: #A73A64;
  --pink-50: #fbeef3;
  --danger: #b42318;
  --danger-50: #fdeceb;
  --ink: #25282A;
  --ink-2: #464c4f;
  --ink-3: #697074;
  --line: #dde2e3;
  --line-2: #eceff0;
  --bg: #f3f6f6;
  --card: #ffffff;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(5, 47, 52, .06);
  --shadow: 0 1px 3px rgba(5, 47, 52, .08), 0 4px 12px rgba(5, 47, 52, .05);
  --shadow-lg: 0 12px 40px rgba(5, 47, 52, .18);
  --font: 'Apercu', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --sidebar: 264px;
  --focus: 0 0 0 3px rgba(255, 163, 0, .55);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: var(--teal); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--ink-3); }

/* ---------------------------------------------------------------- shell */

.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: linear-gradient(180deg, var(--teal-dark) 0%, var(--teal-darker) 100%);
  color: #fff; display: flex; flex-direction: column; padding: 20px 14px;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 20px; text-decoration: none; color: #fff; }
.sidebar .brand img { width: 118px; height: auto; display: block; }
.sidebar .brand span { font-size: 13px; line-height: 1.2; color: var(--teal-200); border-left: 1px solid rgba(255,255,255,.25); padding-left: 10px; }
.nav-label { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--teal-200); padding: 14px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: 2px 0;
  color: #e6f0f1; text-decoration: none; border-radius: 10px; font-weight: 500; font-size: 15px;
}
.nav a svg { width: 20px; height: 20px; flex: none; opacity: .9; }
.nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav a[aria-current="page"] { background: #fff; color: var(--teal-dark); box-shadow: var(--shadow-sm); }
.nav a[aria-current="page"] svg { color: var(--olive); opacity: 1; }
.nav .badge { margin-left: auto; background: var(--orange); color: var(--ink); border-radius: 999px; font-size: 12px; font-weight: 700; padding: 1px 8px; min-width: 22px; text-align: center; }
.sidebar .me { margin-top: auto; padding: 14px 10px 4px; border-top: 1px solid rgba(255,255,255,.14); display: grid; gap: 2px; }
.sidebar .me strong { font-weight: 500; }
.sidebar .me small { color: var(--teal-200); }
.sidebar .me button { justify-self: start; margin-top: 8px; background: none; border: 1px solid rgba(255,255,255,.3); color: #fff; border-radius: 8px; padding: 6px 12px; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; font-size: 14px; }
.sidebar .me button:hover { background: rgba(255,255,255,.1); }
.sidebar .me button svg { width: 16px; height: 16px; }

.topbar { display: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.page { padding: 28px 36px 120px; max-width: 1240px; width: 100%; margin: 0 auto; }
.page.wide { max-width: none; }

.test-mode { background: var(--orange-50); color: var(--orange-dark); border-bottom: 1px solid #f3dca8; padding: 8px 36px; font-size: 14px; display: flex; gap: 8px; align-items: center; }
.test-mode svg { width: 18px; height: 18px; flex: none; }

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 60; transform: translateX(-100%); transition: transform .2s ease; }
  .shell.menu-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .shell.menu-open::after { content: ''; position: fixed; inset: 0; background: rgba(5,47,52,.4); z-index: 50; }
  .topbar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--teal-dark); color: #fff; position: sticky; top: 0; z-index: 40; }
  .topbar button { background: none; border: 0; color: #fff; padding: 6px; cursor: pointer; }
  .topbar button svg { width: 26px; height: 26px; display: block; }
  .topbar img { height: 34px; width: auto; }
  .page { padding: 20px 16px 140px; }
  .test-mode { padding: 8px 16px; }
}

/* ---------------------------------------------------------------- type */

h1, h2, h3, h4 { line-height: 1.2; margin: 0; font-weight: 500; }
h1 { font-size: 30px; letter-spacing: -.01em; }
h2 { font-size: 20px; }
h3 { font-size: 17px; }
.muted { color: var(--ink-3); }
.small { font-size: 14px; }
p { margin: 0 0 12px; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head .intro { display: grid; gap: 6px; max-width: 720px; }
.page-head .intro p { color: var(--ink-3); margin: 0; }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); text-decoration: none; font-size: 15px; margin-bottom: 8px; }
.crumb:hover { color: var(--teal); }
.crumb svg { width: 16px; height: 16px; }

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent;
  font-weight: 500; font-size: 15px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--teal-600); }
.btn-go { background: var(--olive); color: #fff; }
.btn-go:hover:not(:disabled) { background: var(--olive-dark); }
.btn-secondary { background: #fff; color: var(--teal-dark); border-color: var(--teal-200); }
.btn-secondary:hover:not(:disabled) { background: var(--teal-50); border-color: var(--teal); }
.btn-ghost { background: transparent; color: var(--teal-dark); }
.btn-ghost:hover:not(:disabled) { background: var(--teal-50); }
.btn-danger { background: #fff; color: var(--danger); border-color: #f1c1bc; }
.btn-danger:hover:not(:disabled) { background: var(--danger-50); }
.btn-danger-solid { background: var(--danger); color: #fff; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 8px; }
.btn-icon { width: 40px; min-height: 40px; padding: 0; }
.btn.busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.busy::after { content: ''; position: absolute; width: 18px; height: 18px; border: 2px solid currentColor; border-color: rgba(255,255,255,.9) rgba(255,255,255,.9) transparent transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn-secondary.busy::after, .btn-ghost.busy::after, .btn-danger.busy::after { border-color: var(--teal) var(--teal) transparent transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- cards */

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 22px 24px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line-2); }
.card-head h2 { font-size: 18px; display: flex; align-items: center; gap: 10px; }
.card-head h2 svg { width: 20px; height: 20px; color: var(--olive); }
.card-body { padding: 18px 22px; }
.empty { padding: 28px 22px; text-align: center; color: var(--ink-3); }
.empty svg { width: 32px; height: 32px; color: var(--teal-200); display: block; margin: 0 auto 8px; }

/* ---------------------------------------------------------------- status */

.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px 3px 8px; font-size: 13px; font-weight: 500; white-space: nowrap; line-height: 1.4; }
.chip::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.chip-live { background: var(--olive-50); color: #56601c; }
.chip-draft { background: #eef0f1; color: var(--ink-2); }
.chip-review { background: var(--orange-50); color: var(--orange-dark); }
.chip-changes { background: var(--pink-50); color: var(--pink); }
.chip-remove { background: var(--danger-50); color: var(--danger); }
.chip-plain { background: var(--teal-50); color: var(--teal-dark); }
.chip-plain::before { display: none; }

.banner { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: var(--radius); border: 1px solid; margin-bottom: 20px; }
.banner > svg { width: 22px; height: 22px; flex: none; margin-top: 1px; }
.banner .text { display: grid; gap: 4px; flex: 1; }
.banner .text strong { font-weight: 500; font-size: 16px; }
.banner .text p { margin: 0; }
.banner .text .quote { background: rgba(255,255,255,.7); border-radius: 8px; padding: 10px 12px; margin-top: 6px; font-style: italic; }
.banner .banner-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.banner-info { background: var(--teal-50); border-color: var(--teal-100); color: var(--teal-dark); }
.banner-live { background: var(--olive-50); border-color: var(--olive-100); color: #4a5318; }
.banner-review { background: var(--orange-50); border-color: #f5dca6; color: #6e4700; }
.banner-changes { background: var(--pink-50); border-color: #efc9d7; color: #7e2449; }
.banner-danger { background: var(--danger-50); border-color: #f3c3be; color: #8a1c12; }

/* ---------------------------------------------------------------- dashboard */

.hello { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 26px; }
.hello h1 { font-size: 32px; }
.hello p { color: var(--ink-3); margin: 6px 0 0; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 28px; }
.tile {
  display: grid; grid-template-columns: 48px 1fr; gap: 4px 14px; align-items: center;
  padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: var(--ink); box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s, transform .15s;
}
.tile:hover { border-color: var(--teal-200); box-shadow: var(--shadow); transform: translateY(-1px); }
.tile .ico { grid-row: span 2; width: 48px; height: 48px; border-radius: 12px; background: var(--teal-50); color: var(--teal); display: grid; place-items: center; }
.tile .ico svg { width: 24px; height: 24px; }
.tile strong { font-weight: 500; font-size: 16px; }
.tile span { color: var(--ink-3); font-size: 14px; line-height: 1.35; }
.tile.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.tile.primary .ico { background: rgba(255,255,255,.14); color: #fff; }
.tile.primary span { color: var(--teal-100); }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 20px; }
@media (max-width: 600px) { .grid-2 { grid-template-columns: 1fr; } }

.rows { list-style: none; margin: 0; padding: 0; }
.rows li + li { border-top: 1px solid var(--line-2); }
.row { display: flex; align-items: center; gap: 14px; padding: 14px 22px; text-decoration: none; color: var(--ink); }
a.row:hover { background: #f8fafa; }
.row .thumb { width: 52px; height: 52px; border-radius: 8px; background: var(--teal-50) center/cover no-repeat; flex: none; display: grid; place-items: center; color: var(--teal-200); overflow: hidden; }
.row .thumb svg { width: 22px; height: 22px; }
.row .thumb.face { width: 48px; height: 48px; border-radius: 50%; }
.row .what { flex: 1; min-width: 0; display: grid; gap: 2px; }
.row .what strong { font-weight: 500; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.row .what small { color: var(--ink-3); font-size: 14px; }
.row .end { display: flex; align-items: center; gap: 10px; flex: none; }
.row .end > svg { width: 18px; height: 18px; color: var(--ink-3); }
.row .note { display: block; margin-top: 4px; font-style: italic; color: var(--ink-2); font-size: 14px; }

.alert-strip { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }

/* ---------------------------------------------------------------- lists */

.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.search { position: relative; flex: 1 1 280px; max-width: 460px; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-3); pointer-events: none; }
.search input { width: 100%; height: 46px; border: 1px solid var(--line); border-radius: 10px; padding: 0 14px 0 42px; background: #fff; }
.search input:focus { border-color: var(--teal); box-shadow: var(--focus); outline: none; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 14px; cursor: pointer; font-size: 14px; color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center; }
.pill:hover { border-color: var(--teal-200); }
.pill[aria-pressed="true"] { background: var(--teal); border-color: var(--teal); color: #fff; }
.pill .n { font-weight: 700; font-size: 12px; opacity: .8; }

.year { font-size: 13px; font-weight: 700; letter-spacing: .06em; color: var(--ink-3); text-transform: uppercase; padding: 18px 22px 6px; background: #fafbfb; border-top: 1px solid var(--line-2); }
.rows .year:first-child { border-top: 0; }

.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.person { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; box-shadow: var(--shadow-sm); transition: box-shadow .15s, transform .15s, border-color .15s; }
.person:hover { box-shadow: var(--shadow); transform: translateY(-1px); border-color: var(--teal-200); }
.person .photo { aspect-ratio: 500 / 408; background: var(--teal-50) center/cover no-repeat; position: relative; display: grid; place-items: center; color: var(--teal-200); }
.person .photo svg { width: 40px; height: 40px; }
.person .photo .chip { position: absolute; top: 10px; left: 10px; box-shadow: var(--shadow-sm); }
.person .who { padding: 12px 14px 14px; display: grid; gap: 2px; }
.person .who strong { font-weight: 500; }
.person .who small { color: var(--ink-3); font-size: 13px; line-height: 1.35; }

.country-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.country { padding: 22px; display: grid; gap: 10px; text-decoration: none; color: var(--ink); }
.country:hover { border-color: var(--teal-200); box-shadow: var(--shadow); }
.country .flag { display: flex; gap: 4px; }
.country .flag i { width: 22px; height: 8px; border-radius: 3px; display: block; }

/* ---------------------------------------------------------------- editor */

.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.editor-layout.no-preview { grid-template-columns: minmax(0, 860px); justify-content: center; }
.editor-form { display: grid; gap: 18px; min-width: 0; }
/* Grid and flex children default to their content's width, which lets a long
   word or a row of swatches push a card under the preview. */
.editor-form > *, .section .fields > *, .field, .field > *, .rep, .rep-item, .rep-item > .body > * { min-width: 0; }
.preview-pane { position: sticky; top: 16px; height: calc(100vh - 130px); min-height: 480px; display: flex; flex-direction: column; overflow: hidden; }
.preview-pane .pv-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line-2); }
.preview-pane .pv-head strong { font-weight: 500; margin-right: auto; display: flex; gap: 8px; align-items: center; }
.preview-pane .pv-head strong svg { width: 18px; height: 18px; color: var(--olive); }
.preview-pane .pv-hint { padding: 8px 14px; font-size: 13px; color: var(--ink-3); background: #fafbfb; border-bottom: 1px solid var(--line-2); }
.preview-pane .pv-stage { flex: 1; background: #e9eeef; display: grid; place-items: stretch; overflow: hidden; position: relative; }
.preview-pane iframe { width: 100%; height: 100%; border: 0; background: #fff; }
/* Computer view: the page is laid out at a desktop width, then scaled to fit. */
.preview-pane .pv-stage.desktop iframe { position: absolute; top: 0; left: 0; width: 1366px; transform-origin: 0 0; }
.preview-pane .pv-stage.phone { place-items: center; padding: 16px; }
.preview-pane .pv-stage.phone iframe { width: 390px; max-width: 100%; height: 100%; border-radius: 22px; box-shadow: 0 0 0 10px #1c2224, var(--shadow-lg); }
.preview-pane .pv-busy { position: absolute; top: 10px; right: 12px; background: rgba(5,47,52,.8); color: #fff; font-size: 12px; padding: 4px 10px; border-radius: 999px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { background: #fff; border: 0; padding: 6px 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button svg { width: 16px; height: 16px; }
.seg button[aria-pressed="true"] { background: var(--teal-50); color: var(--teal-dark); font-weight: 500; }

.mobile-tabs { display: none; }
@media (max-width: 1180px) {
  .editor-layout { grid-template-columns: minmax(0, 1fr); }
  .preview-pane { position: relative; top: 0; height: 78vh; }
  .mobile-tabs { display: flex; margin-bottom: 16px; }
  .mobile-tabs button { flex: 1; justify-content: center; padding: 12px; font-size: 15px; }
  .editor-layout[data-tab="edit"] .preview-pane { display: none; }
  .editor-layout[data-tab="preview"] .editor-form { display: none; }
}

.section { padding: 0; }
.section > h2 { padding: 16px 22px; border-bottom: 1px solid var(--line-2); font-size: 17px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.section > h2 .opt { font-size: 13px; color: var(--ink-3); font-weight: 400; }
.section .fields { padding: 18px 22px 22px; display: grid; gap: 22px; }

.field { display: grid; gap: 6px; }
.field > label, .field > .label { font-weight: 500; font-size: 15px; display: flex; align-items: baseline; gap: 8px; }
.field .req { color: var(--danger); font-weight: 400; font-size: 13px; }
.field .help { color: var(--ink-3); font-size: 14px; line-height: 1.45; margin: 0; }
.field .count { font-size: 13px; color: var(--ink-3); justify-self: end; }
.field .count.over { color: var(--danger); font-weight: 500; }
.field .error { color: var(--danger); font-size: 14px; display: flex; gap: 6px; align-items: flex-start; }
.field .error svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.field.invalid input, .field.invalid textarea, .field.invalid .rt, .field.invalid .drop { border-color: var(--danger); }
.field .line { display: flex; gap: 8px; align-items: center; }
.field .line > input { flex: 1; }
.field .shown-as { font-size: 14px; color: var(--teal-dark); }

.input, .field input[type="text"], .field input[type="url"], .field input[type="date"], .field input[type="email"], .field input[type="number"], .field select, .field textarea {
  width: 100%; border: 1px solid #cfd6d8; border-radius: 10px; background: #fff; padding: 11px 13px; min-height: 46px; font-size: 16px;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; line-height: 1.5; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--teal); box-shadow: var(--focus); outline: none; }
.field input[readonly] { background: #f6f8f8; color: var(--ink-2); }
.field input[type="date"] { max-width: 240px; }

.toggle { display: flex; align-items: flex-start; gap: 14px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle .track { width: 48px; height: 28px; border-radius: 999px; background: #c9d1d3; position: relative; flex: none; transition: background .15s; margin-top: 1px; }
.toggle .track::after { content: ''; position: absolute; width: 22px; height: 22px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.toggle input:checked + .track { background: var(--olive); }
.toggle input:checked + .track::after { transform: translateX(20px); }
.toggle input:focus-visible + .track { box-shadow: var(--focus); }
.toggle .t { display: grid; gap: 2px; }
.toggle .t strong { font-weight: 500; }

.checks { display: flex; gap: 10px; flex-wrap: wrap; }
.check { display: inline-flex; align-items: center; gap: 10px; border: 1px solid #cfd6d8; border-radius: 10px; padding: 10px 14px; cursor: pointer; background: #fff; }
.check input { width: 18px; height: 18px; accent-color: var(--teal); margin: 0; }
.check:has(input:checked) { border-color: var(--teal); background: var(--teal-50); color: var(--teal-dark); }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { position: relative; }
.swatch input { position: absolute; opacity: 0; }
.swatch span { display: flex; align-items: center; gap: 8px; border: 1px solid #cfd6d8; border-radius: 10px; padding: 7px 12px 7px 8px; cursor: pointer; font-size: 14px; background: #fff; }
.swatch i { width: 22px; height: 22px; border-radius: 6px; border: 1px solid rgba(0,0,0,.15); }
.swatch input:checked + span { border-color: var(--teal); box-shadow: 0 0 0 2px var(--teal) inset; background: var(--teal-50); }
.swatch input:focus-visible + span { box-shadow: var(--focus); }

/* pictures and files */
.drop { border: 2px dashed #c3ced0; border-radius: var(--radius); padding: 18px; display: flex; gap: 18px; align-items: center; background: #fafcfc; transition: border-color .15s, background .15s; flex-wrap: wrap; }
.drop.over { border-color: var(--teal); background: var(--teal-50); }
.drop .pic { width: 180px; aspect-ratio: 16 / 10; border-radius: 10px; background: #e9eeef center/cover no-repeat; flex: none; display: grid; place-items: center; color: var(--ink-3); overflow: hidden; border: 1px solid var(--line); }
.drop .pic.team { aspect-ratio: 500 / 408; width: 150px; }
.drop .pic svg { width: 30px; height: 30px; color: #b2bec1; }
.drop .pic.doc { aspect-ratio: auto; width: auto; height: auto; padding: 14px 16px; background: #fff; display: flex; gap: 10px; align-items: center; color: var(--ink); max-width: 100%; }
.drop .pic.doc svg { color: var(--danger); width: 26px; height: 26px; }
.drop .pic.doc span { word-break: break-word; font-size: 14px; }
.drop .side { display: grid; gap: 8px; flex: 1; min-width: 200px; }
.drop .side .btns { display: flex; gap: 8px; flex-wrap: wrap; }
.drop .side p { margin: 0; color: var(--ink-3); font-size: 14px; }
.progress { height: 6px; background: var(--teal-100); border-radius: 999px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--teal); width: 0; transition: width .2s; }

/* lists and repeaters */
.list-items { display: grid; gap: 8px; }
.list-item { display: flex; gap: 6px; align-items: flex-start; }
.list-item .grip { color: var(--ink-3); font-size: 13px; min-width: 22px; text-align: right; padding-top: 13px; }
.list-item > input, .list-item > textarea { flex: 1; }
.list-item .mv { display: flex; gap: 2px; }
.icon-btn { background: none; border: 1px solid transparent; border-radius: 8px; width: 38px; height: 44px; display: grid; place-items: center; cursor: pointer; color: var(--ink-3); flex: none; }
.icon-btn:hover:not(:disabled) { background: var(--teal-50); color: var(--teal-dark); }
.icon-btn.del:hover:not(:disabled) { background: var(--danger-50); color: var(--danger); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.icon-btn svg { width: 18px; height: 18px; }
.add-btn { justify-self: start; }

.rep { display: grid; gap: 12px; }
.rep-item { border: 1px solid var(--line); border-radius: var(--radius); background: #fcfdfd; }
.rep-item > header { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--line-2); }
.rep-item > header .n { width: 26px; height: 26px; border-radius: 50%; background: var(--teal-50); color: var(--teal-dark); font-size: 13px; font-weight: 700; display: grid; place-items: center; flex: none; }
.rep-item > header .t { flex: 1; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-item > .body { padding: 14px; display: grid; gap: 16px; }
.stat-card { border-radius: 10px; padding: 14px 16px; min-height: 92px; display: grid; align-content: end; gap: 2px; position: relative; overflow: hidden; }
.stat-card b { font-size: 26px; font-weight: 500; line-height: 1.1; }
.stat-card small { font-size: 14px; }
.stat-card .num { position: absolute; top: 6px; right: 12px; font-size: 30px; font-weight: 700; opacity: .25; }

/* heading highlight */
.hl-preview { background: var(--teal-dark); color: #fff; border-radius: 10px; padding: 18px 20px; font-size: 28px; line-height: 1.2; font-weight: 300; }
.hl-preview mark { background: none; color: #d4dd8a; font-weight: 500; }
.hl-words { display: flex; flex-wrap: wrap; gap: 6px; }
.hl-words button { border: 1px solid #cfd6d8; background: #fff; border-radius: 8px; padding: 5px 10px; cursor: pointer; font-size: 15px; }
.hl-words button[aria-pressed="true"] { background: var(--olive); border-color: var(--olive); color: #fff; }

/* rich text */
.rt { border: 1px solid #cfd6d8; border-radius: 10px; background: #fff; }
.rt:focus-within { border-color: var(--teal); box-shadow: var(--focus); }
.rt-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; border-bottom: 1px solid var(--line-2); background: #fafbfb; border-radius: 10px 10px 0 0; position: sticky; top: 0; z-index: 2; align-items: center; }
.rt-bar button { background: none; border: 0; border-radius: 7px; min-width: 38px; height: 38px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; color: var(--ink-2); font-size: 14px; }
.rt-bar button:hover { background: var(--teal-50); color: var(--teal-dark); }
.rt-bar button[aria-pressed="true"] { background: var(--teal-100); color: var(--teal-dark); }
.rt-bar button svg { width: 18px; height: 18px; }
.field .rt-bar select { width: auto; height: 38px; min-height: 38px; border: 1px solid var(--line); border-radius: 7px; padding: 0 28px 0 10px; background-color: #fff; font-size: 14px; }
.rt-bar .sep { width: 1px; height: 24px; background: var(--line); margin: 0 4px; }
.rt-content { min-height: 320px; max-height: 70vh; overflow-y: auto; padding: 18px 20px; outline: none; font-size: 16.5px; line-height: 1.65; }
.rt-content { position: relative; }
.rt-content.is-empty::before { content: attr(data-placeholder); color: #9aa3a6; position: absolute; left: 20px; top: 18px; pointer-events: none; }
.rt-content h3 { font-size: 21px; margin: 1.2em 0 .5em; font-weight: 500; }
.rt-content h4 { font-size: 18px; margin: 1.1em 0 .4em; font-weight: 500; }
.rt-content p { margin: 0 0 1em; }
.rt-content blockquote { border-left: 4px solid var(--olive); margin: 1em 0; padding: 4px 16px; color: var(--ink-2); background: var(--olive-50); border-radius: 0 8px 8px 0; }
.rt-content img { max-width: 100%; height: auto; border-radius: 6px; }
.rt-content a { color: var(--teal); }
.rt-content table { border-collapse: collapse; max-width: 100%; }
.rt-content td, .rt-content th { vertical-align: top; }
.rt-foot { display: flex; justify-content: space-between; gap: 10px; padding: 6px 12px; font-size: 13px; color: var(--ink-3); border-top: 1px solid var(--line-2); }

/* action bar */
.actionbar {
  position: fixed; left: var(--sidebar); right: 0; bottom: 0; z-index: 30;
  background: rgba(255,255,255,.97); border-top: 1px solid var(--line); box-shadow: 0 -4px 20px rgba(5,47,52,.08);
  display: flex; align-items: center; gap: 10px; padding: 12px 36px; flex-wrap: wrap;
}
.actionbar .state { margin-right: auto; display: flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: 14px; }
.actionbar .state svg { width: 18px; height: 18px; }
.actionbar .state.dirty { color: var(--orange-dark); font-weight: 500; }
.actionbar .state.saved { color: #56601c; }
@media (max-width: 960px) { .actionbar { left: 0; padding: 10px 16px; } .actionbar .state { width: 100%; } }

/* changes */
.changes { display: grid; gap: 0; }
.change { padding: 14px 22px; border-top: 1px solid var(--line-2); display: grid; gap: 6px; }
.change:first-child { border-top: 0; }
.change > strong { font-weight: 500; font-size: 14px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.diff { line-height: 1.7; }
.diff ins { background: #e4efc2; text-decoration: none; border-radius: 3px; padding: 0 2px; }
.diff del { background: #f8d7d3; color: #7d2019; border-radius: 3px; padding: 0 2px; }
.diff.long { max-height: 320px; overflow-y: auto; padding: 10px 12px; background: #fafbfb; border-radius: 8px; border: 1px solid var(--line-2); }
.before-after { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.before-after img { width: 140px; border-radius: 8px; border: 1px solid var(--line); }
.before-after .arrow { color: var(--ink-3); }

/* ---------------------------------------------------------------- menus */

details.menu { position: relative; }
details.menu > summary { list-style: none; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu .menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 260px; display: grid; }
details.menu .menu-list button { display: flex; align-items: center; gap: 10px; background: none; border: 0; text-align: left; padding: 11px 12px; border-radius: 8px; cursor: pointer; font-size: 15px; color: var(--ink); }
details.menu .menu-list button:hover { background: var(--danger-50); color: var(--danger); }
details.menu .menu-list button svg { width: 18px; height: 18px; }
details.card > summary::-webkit-details-marker { display: none; }

/* ---------------------------------------------------------------- dialogs */

dialog { border: 0; border-radius: 16px; padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); color: var(--ink); }
dialog.wide { width: min(980px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(5, 47, 52, .45); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px 8px; }
.dlg-head h2 { font-size: 21px; }
.dlg-body { padding: 8px 24px 8px; display: grid; gap: 14px; max-height: 70vh; overflow-y: auto; }
.dlg-body p { margin: 0; color: var(--ink-2); }
.dlg-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px 22px; flex-wrap: wrap; }

.library { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.library button { border: 2px solid transparent; border-radius: 10px; padding: 0; background: #eef2f3; cursor: pointer; overflow: hidden; display: grid; text-align: left; }
.library button:hover, .library button:focus-visible { border-color: var(--teal); }
.library button img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.library button span { font-size: 12px; padding: 6px 8px; background: #fff; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.library .doc-row { display: flex; gap: 10px; padding: 12px; background: #fff; align-items: center; }
.library.docs { grid-template-columns: 1fr; }

.versions { list-style: none; margin: 0; padding: 0; }
.versions li { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line-2); }
.versions li:first-child { border-top: 0; }
.versions .v { flex: 1; display: grid; gap: 2px; }
.versions .v small { color: var(--ink-3); }

.view-version { display: grid; gap: 16px; }
.view-version dt { font-weight: 500; font-size: 14px; color: var(--ink-3); }
.view-version dd { margin: 4px 0 0; }
.view-version iframe { width: 100%; height: 360px; border: 1px solid var(--line); border-radius: 10px; }

/* ---------------------------------------------------------------- toasts */

.toasts { position: fixed; bottom: 92px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 100; width: min(520px, calc(100vw - 32px)); pointer-events: none; }
.toast { background: var(--teal-darker); color: #fff; border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow-lg); display: flex; gap: 12px; align-items: flex-start; pointer-events: auto; animation: rise .2s ease; }
.toast svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.toast.ok svg { color: #c8d27a; }
.toast.err { background: #7a1d14; }
.toast.warn { background: #6e4700; }
.toast .x { margin-left: auto; background: none; border: 0; color: inherit; opacity: .7; cursor: pointer; padding: 0 0 0 8px; font-size: 18px; line-height: 1; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }

/* ---------------------------------------------------------------- sign in */

.signin { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 600px at 10% 0%, #0b6a75 0%, transparent 60%), linear-gradient(160deg, var(--teal) 0%, var(--teal-darker) 100%); }
.signin .box { background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); width: min(460px, 100%); padding: 34px 32px 28px; display: grid; gap: 18px; }
.signin .box img.logo { width: 170px; }
.signin h1 { font-size: 26px; }
.signin p { color: var(--ink-3); margin: 0; }
.signin .ms { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 52px; font-size: 16px; }
.signin .ms svg { width: 20px; height: 20px; }
.signin .picker { display: grid; gap: 8px; }
.signin .picker button { display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 12px 16px; cursor: pointer; }
.signin .picker button:hover { border-color: var(--teal); background: var(--teal-50); }
.signin .picker small { color: var(--ink-3); }
.signin .foot { font-size: 13px; color: var(--ink-3); text-align: center; }
.signin .test { background: var(--orange-50); border: 1px solid #f5dca6; color: #6e4700; padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.signin .err { background: var(--danger-50); border: 1px solid #f3c3be; color: #8a1c12; padding: 10px 12px; border-radius: 10px; font-size: 14px; }

/* ---------------------------------------------------------------- tables */

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 13px; color: var(--ink-3); font-weight: 500; text-transform: uppercase; letter-spacing: .05em; padding: 12px 22px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 22px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table select { border: 1px solid #cfd6d8; border-radius: 8px; padding: 8px 10px; background: #fff; }
@media (max-width: 700px) { .table th:nth-child(2), .table td:nth-child(2) { display: none; } }

.roles { display: grid; gap: 8px; }
.role-opt { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: pointer; }
.role-opt input { margin-top: 4px; accent-color: var(--teal); }
.role-opt:has(input:checked) { border-color: var(--teal); background: var(--teal-50); }
.role-opt small { display: block; color: var(--ink-3); }

/* ---------------------------------------------------------------- help */

.help-list { display: grid; gap: 12px; }
.help-list details { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.help-list summary { cursor: pointer; padding: 16px 20px; font-weight: 500; font-size: 17px; list-style: none; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.help-list summary::-webkit-details-marker { display: none; }
.help-list summary svg { width: 18px; height: 18px; transition: transform .15s; color: var(--ink-3); }
.help-list details[open] summary svg { transform: rotate(90deg); }
.help-list .a { padding: 0 20px 18px; color: var(--ink-2); }
.help-list .a ol, .help-list .a ul { padding-left: 22px; margin: 0 0 10px; }
.help-list .a li { margin: 4px 0; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 26px; }
.step { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 8px; align-content: start; }
.step .n { width: 32px; height: 32px; border-radius: 50%; background: var(--teal); color: #fff; display: grid; place-items: center; font-weight: 700; }
.step strong { font-weight: 500; }
.step p { margin: 0; color: var(--ink-3); font-size: 14px; }

.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: flex; gap: 14px; padding: 14px 22px; border-top: 1px solid var(--line-2); align-items: flex-start; }
.activity li:first-child { border-top: 0; }
.activity .dot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--teal-50); color: var(--teal); }
.activity .dot svg { width: 17px; height: 17px; }
.activity .dot.published { background: var(--olive-50); color: #56601c; }
.activity .dot.submitted { background: var(--orange-50); color: var(--orange-dark); }
.activity .dot.rejected { background: var(--pink-50); color: var(--pink); }
.activity .dot.removed { background: var(--danger-50); color: var(--danger); }
.activity .txt { flex: 1; display: grid; gap: 2px; }
.activity .txt small { color: var(--ink-3); }
.activity .txt a { color: var(--ink); font-weight: 500; text-decoration: none; }
.activity .txt a:hover { color: var(--teal); text-decoration: underline; }
.activity .txt .note { font-style: italic; color: var(--ink-2); font-size: 14px; }

.skeleton { background: linear-gradient(90deg, #eef2f3 25%, #f6f8f8 50%, #eef2f3 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

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