/* ==========================================================================
   Registre Vegan — design system
   Mobile first. Tokens → base → components → public site → back office.
   Rules: one control height per density (no misaligned rows), spacing on an 4px grid,
   no element may overlap another (grids/flex with min-width:0, no negative margins).
   ========================================================================== */

/* ---------------------------------------------------------------- tokens */
:root {
  --primary: #a0144f;
  --brand: #1d4632;
  --primary-hover: color-mix(in srgb, var(--primary) 86%, black);
  --primary-soft: color-mix(in srgb, var(--primary) 8%, white);
  --primary-soft-2: color-mix(in srgb, var(--primary) 16%, white);
  --accent: #ef6a2c;            /* « Créer » du back-office */
  --accent-hover: #d95a20;

  --bg: #f5f6f3;
  --surface: #ffffff;
  --surface-2: #f9faf7;
  --surface-3: #f0f2ed;
  --border: #e4e7e0;
  --border-strong: #cfd5ca;
  --text: #17201b;
  --text-2: #434e48;
  --muted: #6a756e;
  --faint: #99a39c;

  --green-bg: #e6f3e5; --green-fg: #2a6a32;
  --amber-bg: #fdf2d8; --amber-fg: #85570a;
  --red-bg: #fde6e8;   --red-fg: #ad1f37;
  --blue-bg: #e6eefa;  --blue-fg: #2858a5;
  --gray-bg: #eef0eb;  --gray-fg: #545f58;
  --rose-bg: var(--primary-soft); --rose-fg: var(--primary);
  --star: #f0a12b;

  /* data-viz (validated categorical slots + reserved status colours) */
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100;
  --chart-grid: #ebede8; --chart-text: #6a756e;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-brand: "Barlow Semi Condensed", "Inter", system-ui, sans-serif;

  --fs-xs: .75rem; --fs-sm: .8125rem; --fs-base: .9375rem; --fs-md: 1rem;
  --fs-lg: 1.125rem; --fs-xl: 1.375rem; --fs-2xl: 1.75rem; --fs-3xl: 2.25rem;

  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px;
  --sp-8: 32px; --sp-10: 40px; --sp-12: 48px; --sp-16: 64px;

  --ctl-h: 44px;      /* champs et boutons des formulaires */
  --ctl-h-sm: 36px;   /* barres d'outils, tableaux */
  --ctl-h-lg: 48px;   /* barre de recherche du registre */

  --radius-xs: 6px; --radius-sm: 8px; --radius: 12px; --radius-lg: 16px; --radius-full: 999px;
  --shadow-xs: 0 1px 2px rgba(16, 28, 20, .05);
  --shadow-sm: 0 1px 2px rgba(16, 28, 20, .04), 0 2px 8px rgba(16, 28, 20, .04);
  --shadow: 0 2px 4px rgba(16, 28, 20, .04), 0 8px 24px rgba(16, 28, 20, .06);
  --shadow-lg: 0 12px 40px rgba(16, 28, 20, .16);
  --ring: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent);

  --header-h: 64px;
  --bottom-nav-h: 64px;
  --container: 1280px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --primary: #e45b8f;
  --brand: #8fd3a7;
  --primary-soft: color-mix(in srgb, var(--primary) 14%, #141917);
  --primary-soft-2: color-mix(in srgb, var(--primary) 24%, #141917);
  --accent: #f07a43; --accent-hover: #f48c5b;
  --bg: #0e1210; --surface: #151a17; --surface-2: #1a201c; --surface-3: #212823;
  --border: #283029; --border-strong: #38423b;
  --text: #e8ece9; --text-2: #c2cac5; --muted: #9aa59e; --faint: #76817a;
  --green-bg: #1b3222; --green-fg: #8ed49b;
  --amber-bg: #392d11; --amber-fg: #f1c56a;
  --red-bg: #3c1c22;   --red-fg: #f2909e;
  --blue-bg: #1a2a40;  --blue-fg: #94b6ee;
  --gray-bg: #242b26;  --gray-fg: #b4bdb7;
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
  --chart-grid: #262d28; --chart-text: #9aa59e;
  --shadow-xs: none; --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow: 0 2px 8px rgba(0,0,0,.45);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.6);
  color-scheme: dark;
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0; font-family: var(--font); font-size: var(--fs-base); line-height: 1.55; color: var(--text);
  background: var(--bg); overflow-x: hidden; font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
body.has-bottom-nav { padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)); }
img, svg { display: block; max-width: 100%; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; color: var(--text); letter-spacing: -.015em; font-weight: 700; }
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); font-weight: 650; }
h4 { font-size: var(--fs-md); font-weight: 650; }
p { margin: 0; }
p + p { margin-top: var(--sp-3); }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--sp-6) 0; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: var(--radius-xs); }
::selection { background: var(--primary-soft-2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: var(--sp-4); top: -60px; z-index: 100; background: var(--surface); padding: var(--sp-2) var(--sp-4); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.skip-link:focus { top: var(--sp-2); }

.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.i-xs { width: 13px; height: 13px; }
.i-sm { width: 15px; height: 15px; }
.i-lg { width: 22px; height: 22px; }

/* layout helpers */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--sp-4); }
.stack { display: grid; gap: var(--sp-4); align-content: start; }
.stack-lg { display: grid; gap: var(--sp-6); align-content: start; }
.stack-sm { display: grid; gap: var(--sp-2); align-content: start; }
.row { display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap; min-width: 0; }
.row-between { justify-content: space-between; }
.row-end { justify-content: flex-end; }
.row-nowrap { flex-wrap: nowrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: var(--fs-sm); }
.xsmall { font-size: var(--fs-xs); }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.hidden { display: none !important; }
.desktop-only { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.pre-line { white-space: pre-line; }

/* ---------------------------------------------------------------- buttons */
.btn {
  --h: var(--ctl-h);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  height: var(--h); padding: 0 var(--sp-4); border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: 600 var(--fs-base)/1 var(--font); white-space: nowrap; cursor: pointer;
  text-decoration: none !important; transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
  box-shadow: var(--shadow-xs);
}
.btn:hover { background: var(--surface-2); border-color: var(--faint); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-outline { border-color: var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary-soft); border-color: var(--primary); }
.btn-ghost { border-color: transparent; background: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); border-color: transparent; color: var(--text); }
.btn-danger { color: var(--red-fg); border-color: color-mix(in srgb, var(--red-fg) 35%, var(--border)); }
.btn-danger:hover { background: var(--red-bg); border-color: var(--red-fg); }
.btn-sm { --h: var(--ctl-h-sm); padding: 0 var(--sp-3); font-size: var(--fs-sm); }
.btn-lg { --h: var(--ctl-h-lg); padding: 0 var(--sp-5); }
.btn-block { width: 100%; }
.btn-icon { width: var(--h); padding: 0; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.btn .i { margin-inline: -2px; }

.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: var(--radius-full);
  border: 0; background: transparent; color: var(--text-2); cursor: pointer; text-decoration: none !important; position: relative;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn-sm { width: 32px; height: 32px; }
.icon-btn[disabled] { opacity: .35; pointer-events: none; }

.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); cursor: pointer; font-weight: 600; }
.link-btn:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- badges */
.pill {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: var(--radius-full);
  font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; background: var(--gray-bg); color: var(--gray-fg);
}
.pill .i { width: 12px; height: 12px; }
.tone-green { background: var(--green-bg); color: var(--green-fg); }
.tone-amber { background: var(--amber-bg); color: var(--amber-fg); }
.tone-red { background: var(--red-bg); color: var(--red-fg); }
.tone-blue { background: var(--blue-bg); color: var(--blue-fg); }
.tone-rose { background: var(--rose-bg); color: var(--rose-fg); }
.tone-gray { background: var(--gray-bg); color: var(--gray-fg); }
.count {
  display: inline-grid; place-items: center; min-width: 24px; height: 20px; padding: 0 7px; border-radius: var(--radius-full);
  font-size: var(--fs-xs); font-weight: 700; background: var(--surface-3); color: var(--muted); font-variant-numeric: tabular-nums;
}
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.stars { display: inline-flex; gap: 1px; color: var(--star); }
.stars .i { width: 15px; height: 15px; }
.stars .empty { color: var(--border-strong); }
.rating { display: inline-flex; align-items: center; gap: 4px; font-weight: 650; font-variant-numeric: tabular-nums; }
.rating .i { width: 14px; height: 14px; color: var(--star); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; overflow: hidden; flex: none;
  background: var(--primary-soft-2); color: var(--primary); font-weight: 700; font-size: var(--fs-sm);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.5rem; }

/* ---------------------------------------------------------------- cards & alerts */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-xs); min-width: 0; }
.card-pad { padding: var(--sp-5); }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap;
  padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border); min-height: 60px;
}
.card-head h2, .card-head h3 { font-size: var(--fs-md); font-weight: 650; }
.card-head .sub { font-size: var(--fs-sm); color: var(--muted); font-weight: 400; margin-top: 2px; }
.card-body { padding: var(--sp-5); }
.card-foot { padding: var(--sp-4) var(--sp-5); border-top: 1px solid var(--border); display: flex; gap: var(--sp-3); align-items: center; justify-content: space-between; flex-wrap: wrap; }
.card-list > * + * { border-top: 1px solid var(--border); }

.alert { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-3) var(--sp-4); border-radius: var(--radius-sm); font-size: var(--fs-sm); line-height: 1.5; border: 1px solid transparent; }
.alert .i { margin-top: 1px; }
.alert-success { background: var(--green-bg); color: var(--green-fg); border-color: color-mix(in srgb, var(--green-fg) 18%, transparent); }
.alert-error { background: var(--red-bg); color: var(--red-fg); border-color: color-mix(in srgb, var(--red-fg) 18%, transparent); }
.alert-info { background: var(--blue-bg); color: var(--blue-fg); border-color: color-mix(in srgb, var(--blue-fg) 18%, transparent); }
.alert-warning { background: var(--amber-bg); color: var(--amber-fg); border-color: color-mix(in srgb, var(--amber-fg) 18%, transparent); }
.flash-zone { display: grid; gap: var(--sp-2); padding-top: var(--sp-4); }

.callout { display: flex; gap: var(--sp-3); align-items: center; padding: var(--sp-4); border-radius: var(--radius-sm); background: var(--green-bg); color: var(--green-fg); font-size: var(--fs-sm); }
.callout .i { width: 24px; height: 24px; }

.empty-state { display: grid; justify-items: center; gap: var(--sp-2); text-align: center; padding: var(--sp-12) var(--sp-6); color: var(--muted); }
.empty-state .emoji { font-size: 2.25rem; line-height: 1; margin-bottom: var(--sp-2); }
.empty-state strong { color: var(--text); font-size: var(--fs-md); }
.empty-state .btn { margin-top: var(--sp-3); }

/* ---------------------------------------------------------------- forms */
.form-grid { display: grid; gap: var(--sp-5) var(--sp-4); grid-template-columns: minmax(0, 1fr); align-items: start; }
.form-field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.form-field.full { grid-column: 1 / -1; }
/* a switch sits on the same line as the inputs next to it (label 18px + gap + 44px control) */
.form-grid.cols-2 .form-field.is-switch { min-height: 68px; align-content: end; padding-bottom: 10px; }
.label, .form-field > label { font-size: var(--fs-sm); font-weight: 600; color: var(--text); line-height: 1.3; }
.req { color: var(--primary); }
.help { font-size: var(--fs-xs); color: var(--muted); line-height: 1.45; }
.error-text { font-size: var(--fs-xs); color: var(--red-fg); font-weight: 600; }
.input, .select, .textarea {
  width: 100%; height: var(--ctl-h); padding: 0 var(--sp-3); border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: 400 var(--fs-base)/1.4 var(--font);
  transition: border-color .15s, box-shadow .15s; box-shadow: var(--shadow-xs);
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.textarea { height: auto; min-height: 112px; padding: var(--sp-3); resize: vertical; line-height: 1.55; }
.select {
  appearance: none; padding-right: 38px; cursor: pointer; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236a756e' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--faint); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.input-sm, .select-sm { height: var(--ctl-h-sm); font-size: var(--fs-sm); }
.input-lg, .select-lg { height: var(--ctl-h-lg); }
.has-error .input, .has-error .select, .has-error .textarea { border-color: var(--red-fg); }
.input-icon { position: relative; min-width: 0; }
.input-icon > .i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon > .input { padding-left: 40px; }

.check { display: flex; gap: var(--sp-3); align-items: flex-start; cursor: pointer; font-size: var(--fs-sm); line-height: 1.45; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--primary); flex: none; }
.switch { display: inline-flex; align-items: center; gap: var(--sp-3); cursor: pointer; font-size: var(--fs-sm); min-height: 24px; }
.switch input { appearance: none; width: 38px; height: 22px; flex: none; margin: 0; border-radius: var(--radius-full); background: var(--border-strong); position: relative; cursor: pointer; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked { background: var(--primary); }
.switch input:checked::after { transform: translateX(16px); }
.switch input:focus-visible { box-shadow: var(--ring); outline: none; }
.switch-list { display: grid; gap: var(--sp-3); }

fieldset.form-section { border: 1px solid var(--border); border-radius: var(--radius); padding: 0; margin: 0 0 var(--sp-5); background: var(--surface); min-width: 0; box-shadow: var(--shadow-xs); }
fieldset.form-section > legend { float: left; width: 100%; padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border); font-weight: 650; font-size: var(--fs-md); }
fieldset.form-section > legend + * { clear: both; }
.form-section-body { padding: var(--sp-5); }
.form-actions { display: flex; gap: var(--sp-3); flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.form-actions.sticky {
  position: sticky; bottom: var(--sp-4); z-index: 5; padding: var(--sp-3) var(--sp-4); margin-top: var(--sp-5);
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
body.has-bottom-nav .form-actions.sticky { bottom: calc(var(--bottom-nav-h) + var(--sp-3)); }
.image-input { display: flex; gap: var(--sp-4); align-items: flex-start; flex-wrap: wrap; }
.image-input .thumb { width: 80px; height: 80px; }
.image-input .grow { display: grid; gap: var(--sp-2); min-width: 200px; }
input[type="file"] { font: inherit; font-size: var(--fs-sm); color: var(--muted); max-width: 100%; }
input[type="file"]::file-selector-button { height: var(--ctl-h-sm); padding: 0 var(--sp-3); margin-right: var(--sp-3); border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: 600 var(--fs-sm) var(--font); cursor: pointer; }

/* segmented control & tabs */
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: var(--radius-sm); background: var(--surface-3); max-width: 100%; }
.seg a, .seg button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 var(--sp-3); border: 0; border-radius: 6px; background: none; color: var(--muted); font: 600 var(--fs-sm) var(--font); text-decoration: none !important; cursor: pointer; white-space: nowrap; }
.seg a:hover, .seg button:hover { color: var(--text); }
.seg .active, .seg [aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.utabs { display: flex; gap: var(--sp-5); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.utabs a, .utabs button { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0; border: 0; background: none; color: var(--muted); font: 600 var(--fs-sm) var(--font); cursor: pointer; text-decoration: none !important; white-space: nowrap; }
.utabs a:hover, .utabs button:hover { color: var(--text); }
.utabs .active, .utabs [aria-selected="true"] { color: var(--primary); }
.utabs .active::after, .utabs [aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--primary); }

/* dropdowns */
.dropdown { position: relative; }
.dropdown > summary { list-style: none; cursor: pointer; }
.dropdown > summary::-webkit-details-marker { display: none; }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 220px; max-width: min(320px, calc(100vw - 32px));
  padding: 6px; display: grid; gap: 1px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.menu.left { right: auto; left: 0; }
.menu a, .menu button { display: flex; align-items: center; gap: var(--sp-3); min-height: 38px; padding: 0 var(--sp-3); border: 0; border-radius: var(--radius-xs); background: none; color: var(--text); font: 500 var(--fs-sm) var(--font); text-align: left; width: 100%; cursor: pointer; text-decoration: none !important; }
.menu a:hover, .menu button:hover { background: var(--surface-3); }
.menu .i { color: var(--muted); }
.menu-sep { height: 1px; background: var(--border); margin: 4px 6px; }
.menu-head { padding: var(--sp-2) var(--sp-3) var(--sp-3); border-bottom: 1px solid var(--border); margin-bottom: 4px; display: grid; gap: 2px; min-width: 0; }
.menu-title { padding: 6px var(--sp-3) 2px; font-size: var(--fs-xs); color: var(--faint); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }

/* tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th { text-align: left; font-weight: 600; font-size: var(--fs-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: var(--sp-3) var(--sp-4); background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions > * + * { margin-left: var(--sp-2); }
.table tr.is-off td { opacity: .55; }
.table .check-col { width: 44px; }
.table input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--primary); }
.inline-form { display: inline; }
.cell-main { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.cell-main .t { font-weight: 600; color: var(--text); display: block; }
.cell-main .s { font-size: var(--fs-xs); color: var(--muted); display: block; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8em; background: var(--surface-3); padding: 2px 6px; border-radius: 4px; }
.flags { display: flex; gap: 4px; flex-wrap: wrap; }
.flag { font-size: 11px; font-weight: 600; height: 20px; display: inline-flex; align-items: center; padding: 0 7px; border-radius: 4px; background: var(--surface-3); color: var(--faint); }
.flag.on { background: var(--green-bg); color: var(--green-fg); }

/* pagination */
.pager { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; justify-content: center; }
.pager a, .pager span { min-width: 36px; height: 36px; display: inline-grid; place-items: center; padding: 0 8px; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 600; font-size: var(--fs-sm); text-decoration: none !important; font-variant-numeric: tabular-nums; }
.pager a:hover { background: var(--surface-3); color: var(--text); }
.pager .current { background: var(--primary); color: #fff; }
.pager .disabled { color: var(--faint); pointer-events: none; }
.list-footer { display: flex; flex-direction: column; gap: var(--sp-3); align-items: center; justify-content: space-between; padding: var(--sp-4) var(--sp-5); color: var(--muted); font-size: var(--fs-sm); border-top: 1px solid var(--border); }

/* thumbnails */
.thumb {
  width: 52px; height: 52px; flex: none; display: grid; place-items: center; overflow: hidden; border-radius: 10px;
  background: linear-gradient(145deg, var(--surface-3), var(--surface-2)); border: 1px solid var(--border); font-size: 1.5rem; line-height: 1;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-sm { width: 40px; height: 40px; font-size: 1.15rem; border-radius: 8px; }
.thumb-lg { width: 96px; height: 96px; font-size: 2.5rem; border-radius: 14px; }

/* ==========================================================================
   PUBLIC SITE
   ========================================================================== */
.site-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; gap: var(--sp-4); height: var(--header-h); min-width: 0; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--brand); text-decoration: none !important; min-width: 0; flex: none; }
.brand-logo { width: 32px; height: 32px; flex: none; color: var(--brand); fill: none; stroke-linecap: round; }
.brand-name { font: 700 1.45rem/1 var(--font-brand); letter-spacing: -.01em; color: var(--brand); white-space: nowrap; }
.main-nav { display: none; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: var(--sp-1); flex: none; }
.header-tagline { display: none; }
.lang-switch > summary { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; border-radius: var(--radius-full); color: var(--text-2); font-size: var(--fs-sm); font-weight: 600; text-transform: uppercase; }
.lang-switch > summary:hover { background: var(--surface-3); }
.lang-switch .menu { min-width: 170px; }
.lang-switch .menu a[aria-current="true"] { color: var(--primary); font-weight: 650; }
.auth-actions { display: none; }

/* bottom navigation (mobile app) */
.bottom-nav { position: fixed; inset: auto 0 0 0; z-index: 50; background: var(--surface); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -2px 16px rgba(16,28,20,.06); }
.bottom-nav ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); height: var(--bottom-nav-h); }
.bottom-nav a { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 600; text-decoration: none !important; position: relative; min-width: 0; }
.bottom-nav a span:not(.nav-badge) { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
.bottom-nav .i { width: 22px; height: 22px; }
.bottom-nav a.active { color: var(--primary); }
.bottom-nav a.active::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--primary); }
.nav-badge { position: absolute; top: 7px; left: calc(50% + 5px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: var(--radius-full); background: var(--primary); color: #fff; font-size: 10px; display: grid; place-items: center; }
.nav-badge:empty, .nav-badge[data-count="0"] { display: none; }

/* page sections */
.page { padding-block: var(--sp-6) var(--sp-12); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; margin-bottom: var(--sp-6); }
.page-head > div { min-width: 0; }
.page-head p { color: var(--muted); margin-top: 6px; max-width: 64ch; }
.eyebrow { display: inline-block; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); margin-bottom: var(--sp-2); }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: var(--fs-sm); color: var(--muted); margin-bottom: var(--sp-4); }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--text); }
.narrow { max-width: 760px; margin-inline: auto; }

/* catalogue hero */
.hero { padding-block: var(--sp-8) var(--sp-6); }
.hero h1 { font-size: var(--fs-2xl); letter-spacing: -.025em; max-width: 22ch; }
.hero p { color: var(--muted); margin-top: var(--sp-3); max-width: 60ch; font-size: var(--fs-md); }
.hero-stats { display: flex; gap: var(--sp-6); flex-wrap: wrap; margin-top: var(--sp-5); }
.hero-stats div { display: grid; }
.hero-stats strong { font-size: var(--fs-xl); font-variant-numeric: tabular-nums; }
.hero-stats span { font-size: var(--fs-sm); color: var(--muted); }

/* catalogue tabs: equal columns on mobile, never cut */
.cat-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2); margin-bottom: var(--sp-4); }
.cat-tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-width: 0; min-height: 88px; padding: var(--sp-2) 6px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text-2);
  font-weight: 600; font-size: .8125rem; text-decoration: none !important; box-shadow: var(--shadow-xs); transition: border-color .15s, color .15s;
}
.cat-tab:hover { border-color: var(--border-strong); color: var(--text); }
.cat-tab .lbl { display: flex; flex-direction: column; align-items: center; gap: 4px; max-width: 100%; min-width: 0; }
.cat-tab .lbl span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-tab .i { width: 20px; height: 20px; }
.cat-tab.active { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.cat-tab.active .count { background: var(--primary); color: #fff; }

.catalog-layout { display: grid; gap: var(--sp-5); grid-template-columns: minmax(0, 1fr); align-items: start; }
.list-card { overflow: hidden; }

/* filters: labels above, every control the same height, aligned on one baseline */
.filters { padding: var(--sp-4); border-bottom: 1px solid var(--border); background: var(--surface); }
.filter-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--sp-3); align-items: end; }
.filter-field { display: grid; gap: 6px; min-width: 0; align-content: end; }
.filter-field > .label { font-size: var(--fs-xs); font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.filter-field .input, .filter-field .select { height: var(--ctl-h-lg); }
.filter-main { display: none; }
.filter-actions { display: flex; gap: var(--sp-2); align-items: center; }
.filter-actions .btn { height: var(--ctl-h-lg); }
.filter-toggle { position: relative; }
.filter-toggle .badge { min-width: 20px; height: 20px; border-radius: var(--radius-full); background: var(--primary); color: #fff; font-size: 11px; display: inline-grid; place-items: center; padding: 0 5px; }
.reset-link { display: none; }
.filter-panel { display: none; margin-top: var(--sp-4); padding-top: var(--sp-4); border-top: 1px dashed var(--border-strong); }
.filters.open .filter-panel { display: block; }
.filter-panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.filter-panel-head h3 { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.filter-grid { display: grid; gap: var(--sp-3); grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
.filter-grid + .filter-grid { margin-top: var(--sp-3); }
.check-tile { display: flex; align-items: center; gap: var(--sp-3); height: var(--ctl-h-lg); padding: 0 var(--sp-3); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); cursor: pointer; font-size: var(--fs-sm); font-weight: 500; min-width: 0; background: var(--surface); }
.check-tile span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check-tile input { width: 18px; height: 18px; accent-color: var(--primary); flex: none; margin: 0; }
.check-tile:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; padding: var(--sp-3) var(--sp-4) 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px 0 12px; border-radius: var(--radius-full); background: var(--primary-soft); color: var(--primary); font: 600 var(--fs-xs) var(--font); border: 0; cursor: pointer; max-width: 100%; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* registry list: cards on mobile, table on desktop */
.results.htmx-request { opacity: .55; transition: opacity .2s; }
.registry { width: 100%; border-collapse: collapse; }
.registry thead { display: none; }
.registry tbody { display: block; }
.registry tr.item-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 6px var(--sp-3); align-items: start; padding: var(--sp-4); border-bottom: 1px solid var(--border); cursor: pointer; }
.registry tr.item-row:hover { background: var(--surface-2); }
.registry tr.item-row.selected { background: var(--primary-soft); }
.registry td { padding: 0; min-width: 0; }
.registry .col-check, .registry .col-owner, .registry .col-field { display: none; }
.registry .col-main { grid-column: 1 / 3; grid-row: 1; }
.registry .col-rating { grid-column: 3; grid-row: 1; padding-top: 2px; }
.registry .col-badges { grid-column: 2 / 3; grid-row: 2; display: flex; gap: 6px; flex-wrap: wrap; }
.registry .col-actions { grid-column: 3; grid-row: 2; justify-self: end; align-self: end; }
.item-main { display: flex; gap: var(--sp-3); align-items: center; min-width: 0; }
.item-text { min-width: 0; display: grid; gap: 1px; }
.item-name { font-weight: 650; color: var(--text); text-decoration: none !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-name:hover { color: var(--primary); }
.item-sub { font-size: var(--fs-sm); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-owner { font-size: var(--fs-xs); color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-sort { background: none; border: 0; padding: 0; font: inherit; color: inherit; display: inline-flex; gap: 4px; align-items: center; cursor: pointer; text-transform: inherit; letter-spacing: inherit; }
.th-sort.active { color: var(--primary); }
.bulk-bar { display: none; position: sticky; top: calc(var(--header-h) + 8px); z-index: 6; margin: var(--sp-3) var(--sp-4) 0; padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-4); align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; border-radius: var(--radius-sm); background: var(--text); color: var(--surface); font-weight: 600; font-size: var(--fs-sm); box-shadow: var(--shadow); }
.bulk-bar.show { display: flex; }
.bulk-bar .btn { background: var(--surface); color: var(--text); border-color: var(--surface); }

/* detail panel (desktop aside / mobile bottom sheet) */
.detail-aside { display: none; min-width: 0; }
.detail-aside.open { display: block; position: fixed; inset: 0; z-index: 70; background: rgba(10, 18, 14, .5); animation: fade .2s ease; }
.detail-aside.open .panel-sheet { position: absolute; inset: auto 0 0 0; max-height: 92vh; overflow-y: auto; overscroll-behavior: contain; background: var(--surface); border-radius: 20px 20px 0 0; animation: slide-up .25s ease; padding-bottom: env(safe-area-inset-bottom); }
.sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--border-strong); margin: 10px auto 0; }
@keyframes slide-up { from { transform: translateY(32px); opacity: .5; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
body.sheet-open { overflow: hidden; }
.panel { padding: var(--sp-5); position: relative; display: grid; gap: var(--sp-4); }
.panel-close { position: absolute; top: var(--sp-3); right: var(--sp-3); }
.panel-head { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: var(--sp-4); align-items: start; padding-right: 36px; }
.panel-head .thumb { width: 96px; height: 108px; font-size: 2.5rem; border-radius: 12px; }
.panel-title { font-size: var(--fs-xl); margin-top: var(--sp-2); overflow-wrap: anywhere; }
.panel-sub { color: var(--muted); font-size: var(--fs-sm); margin-top: 2px; }
.panel-owner { display: flex; gap: 6px; align-items: center; font-size: var(--fs-sm); margin-top: var(--sp-2); min-width: 0; }
.panel-owner a, .panel-owner span { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-meta { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.panel-rating { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-md); }
.panel-rating .count-txt { font-size: var(--fs-sm); color: var(--muted); }
.panel-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.ptabs { display: flex; gap: var(--sp-5); border-bottom: 1px solid var(--border); margin-inline: calc(-1 * var(--sp-5)); padding-inline: var(--sp-5); overflow-x: auto; scrollbar-width: none; }
.ptabs::-webkit-scrollbar { display: none; }
.ptab { position: relative; height: 42px; padding: 0; border: 0; background: none; font: 600 var(--fs-sm) var(--font); color: var(--muted); cursor: pointer; white-space: nowrap; }
.ptab:hover { color: var(--text); }
.ptab.active { color: var(--primary); }
.ptab.active::after { content: ""; position: absolute; inset: auto 0 -1px 0; height: 2px; border-radius: 2px; background: var(--primary); }
.ptab-pane { display: none; }
.ptab-pane.active { display: grid; gap: var(--sp-4); }
.desc { font-size: var(--fs-sm); color: var(--text-2); line-height: 1.65; }
.kv { display: grid; }
.kv-row { display: grid; grid-template-columns: 20px minmax(96px, 38%) minmax(0, 1fr); gap: var(--sp-3); align-items: center; min-height: 40px; padding-block: 6px; font-size: var(--fs-sm); }
.kv-row + .kv-row { border-top: 1px solid var(--border); }
.kv-row .k { color: var(--muted); }
.kv-row .v { color: var(--text); font-weight: 500; overflow-wrap: anywhere; min-width: 0; }
.kv-row .v.multiline { white-space: pre-line; }
.kv-row > .i { color: var(--faint); width: 16px; height: 16px; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.checklist li { display: flex; gap: var(--sp-2); align-items: flex-start; font-size: var(--fs-sm); }
.checklist .i { color: var(--green-fg); width: 16px; height: 16px; margin-top: 2px; }
.section-title { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.panel-actions { display: grid; gap: var(--sp-2); }
.detail-aside.open .panel-actions { position: sticky; bottom: 0; z-index: 2; grid-template-columns: 1fr 1fr; margin: 0 calc(-1 * var(--sp-5)) calc(-1 * var(--sp-5)); padding: var(--sp-3) var(--sp-5) calc(var(--sp-3) + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border); }
.detail-aside.open .panel-actions > a { grid-column: 1 / -1; }
.panel-page .panel-close, .panel-page .panel-actions > a { display: none; }
.cta-card { margin: 0 var(--sp-5) var(--sp-5); padding: var(--sp-5); border-radius: var(--radius); background: var(--surface-3); display: grid; gap: var(--sp-4); }
.cta-card .row { flex-wrap: nowrap; align-items: flex-start; }
.cta-card h3 { font-size: var(--fs-md); }
.cta-card p { font-size: var(--fs-sm); color: var(--muted); margin-top: 4px; }
.cta-logo { width: 36px; height: 36px; flex: none; color: var(--brand); fill: none; stroke-linecap: round; --bg: var(--surface-3); }
.panel-placeholder { display: grid; justify-items: center; gap: var(--sp-3); padding: var(--sp-10) var(--sp-6); text-align: center; color: var(--muted); font-size: var(--fs-sm); }
.panel-placeholder .i { width: 36px; height: 36px; color: var(--border-strong); }

/* reviews */
.review-summary { display: flex; align-items: center; gap: var(--sp-4); }
.review-summary .big { font-size: 2.25rem; font-weight: 750; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.review { display: grid; gap: var(--sp-2); padding-block: var(--sp-4); border-top: 1px solid var(--border); }
.review-head { display: flex; gap: var(--sp-3); align-items: center; min-width: 0; }
.review-meta { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; font-size: var(--fs-xs); color: var(--muted); }
.review p { font-size: var(--fs-sm); color: var(--text-2); }
.owner-reply { padding: var(--sp-3) var(--sp-4); border-left: 3px solid var(--primary); background: var(--surface-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: var(--fs-sm); display: grid; gap: 4px; }
.review-form, .review-login { display: grid; gap: var(--sp-3); padding: var(--sp-4); border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.star-input { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; border: 0; padding: 0; margin: 0; }
.star-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-input label { cursor: pointer; color: var(--border-strong); }
.star-input label .i { width: 28px; height: 28px; }
.star-input input:checked ~ label, .star-input label:hover, .star-input label:hover ~ label { color: var(--star); }
.star-input input:focus-visible + label { outline: 2px solid var(--primary); border-radius: 4px; }

/* detail page */
.detail-layout { display: grid; gap: var(--sp-5); grid-template-columns: minmax(0, 1fr); align-items: start; }
.mini-list { display: grid; }
.mini-item { display: flex; gap: var(--sp-3); align-items: center; padding: var(--sp-3) var(--sp-5); color: var(--text); text-decoration: none !important; min-width: 0; }
.mini-item + .mini-item { border-top: 1px solid var(--border); }
.mini-item:hover { background: var(--surface-2); }
.mini-item .t { font-weight: 600; font-size: var(--fs-sm); display: block; }
.mini-item .s { font-size: var(--fs-xs); color: var(--muted); display: block; }

/* lists (favourites, whitelist) */
.list-item { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: var(--sp-2) var(--sp-4); align-items: center; padding: var(--sp-4) var(--sp-5); }
.list-item + .list-item { border-top: 1px solid var(--border); }
.list-item .note-form { grid-column: 2 / -1; }
.list-item .note-form .input { height: var(--ctl-h-sm); font-size: var(--fs-sm); }

/* blog & pages */
.article-grid { display: grid; gap: var(--sp-5); grid-template-columns: minmax(0, 1fr); }
.article-card { display: flex; flex-direction: column; overflow: hidden; color: var(--text); text-decoration: none !important; transition: box-shadow .2s, transform .2s; }
.article-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.article-card:hover h3 { color: var(--primary); }
.article-cover { aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--green-bg), var(--primary-soft)); display: grid; place-items: center; font-size: 2.5rem; overflow: hidden; }
.article-cover img { width: 100%; height: 100%; object-fit: cover; }
.article-card .card-body { display: grid; gap: var(--sp-2); align-content: start; flex: 1; }
.article-card h3 { font-size: var(--fs-md); line-height: 1.35; }
.article-card p { font-size: var(--fs-sm); color: var(--muted); }
.article-meta { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; font-size: var(--fs-xs); color: var(--muted); }
.article-hero { aspect-ratio: 21 / 9; border-radius: var(--radius-lg); overflow: hidden; margin-block: var(--sp-6); background: linear-gradient(135deg, var(--green-bg), var(--primary-soft)); }
.article-hero img { width: 100%; height: 100%; object-fit: cover; }
.blog-search { width: 100%; }
@media (min-width: 640px) { .blog-search { width: 320px; } }
.article-title { font-size: clamp(1.75rem, 1.3rem + 2vw, 2.5rem); line-height: 1.2; letter-spacing: -.02em; margin-bottom: var(--sp-4); }
.article-meta { margin-bottom: var(--sp-6); }
.lead { font-size: var(--fs-lg); line-height: 1.6; color: var(--text); font-weight: 500; margin-bottom: var(--sp-6); }
.list-link { color: var(--text); text-decoration: none !important; }
.list-link:hover { background: var(--surface-2); }
.list-link:hover .item-name { color: var(--primary); }
.card-pad-lg { padding: var(--sp-6); }
@media (min-width: 640px) { .card-pad-lg { padding: var(--sp-8); } }
.error-page { min-height: 100vh; display: grid; place-items: center; padding: var(--sp-6) var(--sp-4); background: var(--bg); }
.error-card { width: 100%; max-width: 480px; display: grid; justify-items: center; gap: var(--sp-3); text-align: center; }
.error-card img { margin-bottom: var(--sp-2); }
.error-code { font: 800 var(--fs-xs) var(--font); letter-spacing: .12em; color: var(--primary); text-transform: uppercase; }
.error-card .btn { margin-top: var(--sp-3); }
.chip-nav { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-6); }
.chip-nav a { display: inline-flex; align-items: center; height: 34px; padding: 0 var(--sp-4); border-radius: var(--radius-full); background: var(--surface); border: 1px solid var(--border); color: var(--text-2); font-weight: 600; font-size: var(--fs-sm); text-decoration: none !important; }
.chip-nav a:hover { border-color: var(--border-strong); color: var(--text); }
.chip-nav a.active { background: var(--text); border-color: var(--text); color: var(--surface); }
.prose { font-size: 1.0625rem; line-height: 1.75; color: var(--text-2); }
.prose > * + * { margin-top: 1em; }
.prose h2 { margin-top: 1.8em; font-size: var(--fs-xl); color: var(--text); }
.prose h3 { margin-top: 1.5em; color: var(--text); }
.prose img { border-radius: var(--radius); height: auto; }
.prose blockquote { margin-inline: 0; padding: var(--sp-3) var(--sp-5); border-left: 4px solid var(--primary); background: var(--surface-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.prose iframe { max-width: 100%; border-radius: var(--radius); }
.prose ul, .prose ol { padding-left: 1.3em; }

/* auth */
.auth-wrap { display: grid; gap: var(--sp-6); grid-template-columns: minmax(0, 1fr); max-width: 1040px; margin-inline: auto; align-items: stretch; }
.auth-card { padding: var(--sp-6); display: grid; gap: var(--sp-5); align-content: start; }
.auth-aside { display: none; }
.auth-title h1 { font-size: var(--fs-xl); }
.auth-title p { color: var(--muted); margin-top: 6px; font-size: var(--fs-sm); }
.code-input { height: 56px !important; text-align: center; font-size: 1.6rem !important; letter-spacing: .5em; font-weight: 700; font-variant-numeric: tabular-nums; padding-left: .5em !important; }
.divider { display: flex; align-items: center; gap: var(--sp-3); color: var(--faint); font-size: var(--fs-xs); }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* account menu list */
.menu-list { list-style: none; margin: 0; padding: 0; }
.menu-list li + li { border-top: 1px solid var(--border); }
.menu-list a, .menu-list button { display: flex; align-items: center; gap: var(--sp-3); min-height: 52px; padding: 0 var(--sp-5); width: 100%; border: 0; background: none; color: var(--text); font: 500 var(--fs-base) var(--font); text-align: left; cursor: pointer; text-decoration: none !important; }
.menu-list a:hover, .menu-list button:hover { background: var(--surface-2); }
.menu-list .i { color: var(--muted); }
.menu-list .chev { margin-left: auto; color: var(--faint); }

/* footer */
.site-footer { margin-top: var(--sp-12); background: var(--surface); border-top: 1px solid var(--border); color: var(--muted); font-size: var(--fs-sm); }
.footer-grid { display: grid; gap: var(--sp-8); grid-template-columns: minmax(0, 1fr); padding-block: var(--sp-10) var(--sp-8); }
.footer-brand p { margin-top: var(--sp-3); max-width: 36ch; }
.footer-col h4 { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--text); margin-bottom: var(--sp-3); }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }
.footer-col a { color: var(--muted); }
.footer-col a:hover { color: var(--text); }
.footer-bottom { display: flex; flex-wrap: wrap; gap: var(--sp-3); justify-content: space-between; align-items: center; padding-block: var(--sp-5); border-top: 1px solid var(--border); }

/* share dialog, toasts */
dialog.sheet { border: 0; padding: 0; width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 20px 20px 0 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
dialog.sheet::backdrop { background: rgba(10, 18, 14, .5); }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-5) var(--sp-5) var(--sp-3); }
.share-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2); padding: 0 var(--sp-5) var(--sp-4); }
.share-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: var(--sp-3) var(--sp-2); border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); color: var(--text); font: 600 var(--fs-xs) var(--font); text-decoration: none !important; cursor: pointer; min-width: 0; }
.share-btn:hover { border-color: var(--primary); }
.share-btn .ico { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; }
.share-copy { display: flex; gap: var(--sp-2); padding: 0 var(--sp-5) var(--sp-5); }
.toast-zone { position: fixed; left: var(--sp-4); right: var(--sp-4); bottom: calc(var(--bottom-nav-h) + var(--sp-4)); z-index: 90; display: grid; gap: var(--sp-2); justify-items: center; pointer-events: none; }
.toast { background: var(--text); color: var(--surface); padding: 10px var(--sp-4); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); font-weight: 600; font-size: var(--fs-sm); animation: slide-up .25s ease; }

/* ==========================================================================
   BACK OFFICE
   ========================================================================== */
.bo-body { background: var(--surface-3); }
:root[data-theme="dark"] .bo-body { background: var(--bg); }
.bo { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 100vh; }
.bo-side {
  position: fixed; inset: 0 auto 0 0; z-index: 80; width: 272px; max-width: 86vw; transform: translateX(-100%); transition: transform .25s ease;
  display: flex; flex-direction: column; gap: var(--sp-4); padding: var(--sp-5) var(--sp-4); background: var(--surface-2); border-right: 1px solid var(--border); overflow-y: auto;
}
.bo.nav-open .bo-side { transform: none; box-shadow: var(--shadow-lg); }
.bo-overlay { display: none; position: fixed; inset: 0; z-index: 79; background: rgba(10, 18, 14, .45); }
.bo.nav-open .bo-overlay { display: block; }
.bo-brand { display: flex; align-items: center; gap: var(--sp-3); padding: 0 var(--sp-2); color: var(--text); text-decoration: none !important; min-width: 0; }
.bo-brand-logo { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--green-bg); flex: none; }
.bo-brand-logo .brand-logo { width: 22px; height: 22px; }
.bo-brand strong { display: block; font-size: var(--fs-base); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bo-brand small { display: block; font-size: var(--fs-xs); color: var(--muted); }
.bo-nav { display: grid; gap: 2px; }
.bo-nav-title { margin: var(--sp-4) var(--sp-3) var(--sp-1); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); }
.bo-nav-title:first-child { margin-top: 0; }
.bo-nav a { display: flex; align-items: center; gap: var(--sp-3); height: 40px; padding: 0 var(--sp-3); border-radius: var(--radius-sm); color: var(--text-2); font-weight: 500; font-size: var(--fs-sm); text-decoration: none !important; min-width: 0; }
.bo-nav a span:not(.count) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bo-nav a:hover { background: var(--surface-3); color: var(--text); }
.bo-nav a.active { background: var(--surface); color: var(--text); font-weight: 650; box-shadow: var(--shadow-sm); }
.bo-nav a.active .i { color: var(--primary); }
.bo-nav a .count { margin-left: auto; }
.bo-nav a .count.alert-count { background: var(--accent); color: #fff; }
.bo-create { position: relative; }
.bo-create > summary { width: 100%; justify-content: space-between; }
.bo-create .menu { left: 0; right: 0; min-width: 0; }
.bo-side-foot { margin-top: auto; display: grid; gap: var(--sp-3); }
.bo-app-link { display: flex; gap: var(--sp-3); align-items: center; padding: var(--sp-3); border-radius: var(--radius-sm); color: var(--text); text-decoration: none !important; }
.bo-app-link:hover { background: var(--surface-3); }
.bo-app-link strong { display: block; font-size: var(--fs-sm); }
.bo-app-link small { display: block; font-size: var(--fs-xs); color: var(--muted); }

.bo-main { min-width: 0; display: flex; flex-direction: column; }
.bo-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: var(--sp-3); min-height: 64px; padding: 0 var(--sp-4); background: var(--surface); border-bottom: 1px solid var(--border); }
.bo-top-title { font-weight: 650; font-size: var(--fs-md); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bo-tabs { display: none; }
.bo-tabs-mobile { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-4); padding: 0 var(--sp-4); background: var(--surface); border-bottom: 1px solid var(--border); }
.bo-tabs-mobile:empty { display: none; }
.bo-tabs-mobile a { position: relative; display: inline-flex; align-items: center; height: 42px; color: var(--muted); font-weight: 600; font-size: var(--fs-sm); text-decoration: none !important; white-space: nowrap; }
.bo-tabs-mobile a.active { color: var(--primary); }
.bo-tabs-mobile a.active::after { content: ""; position: absolute; inset: auto 0 -1px 0; height: 2px; background: var(--primary); border-radius: 2px; }
.bo-top-actions { margin-left: auto; display: flex; align-items: center; gap: var(--sp-1); flex: none; }
.bo-user > summary { display: flex; align-items: center; gap: var(--sp-2); height: 40px; padding: 0 4px 0 4px; border-radius: var(--radius-full); }
.bo-user > summary:hover { background: var(--surface-3); }
.bo-user-name { display: none; font-size: var(--fs-sm); font-weight: 600; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bo-content { padding: var(--sp-5) var(--sp-4) var(--sp-12); width: 100%; max-width: 1440px; margin-inline: auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-5); align-content: start; }
.bo-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; }
.bo-head > div { min-width: 0; }
.bo-head h1 { font-size: var(--fs-xl); }
.bo-head p { color: var(--muted); font-size: var(--fs-sm); margin-top: 4px; }
.bo-split { display: grid; gap: var(--sp-5); grid-template-columns: minmax(0, 1fr); align-items: start; }
.toolbar { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border); }
.toolbar .input, .toolbar .select { height: var(--ctl-h-sm); font-size: var(--fs-sm); width: auto; flex: 1 1 170px; min-width: 0; }
.toolbar .input-icon { flex: 2 1 220px; }
.toolbar .input-icon .input { width: 100%; }
.lookup-results { display: grid; gap: 6px; }
.lookup-results label { display: flex; gap: var(--sp-3); align-items: center; min-height: 48px; padding: 6px var(--sp-3); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; min-width: 0; }
.lookup-results label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.lookup-results input { accent-color: var(--primary); }
.editor { min-height: 340px; background: var(--surface); }
.ql-toolbar.ql-snow, .ql-container.ql-snow { border-color: var(--border-strong) !important; }
.ql-toolbar.ql-snow { border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: var(--surface-2); }
.ql-container.ql-snow { border-radius: 0 0 var(--radius-sm) var(--radius-sm); font: inherit !important; font-size: 1rem !important; }
:root[data-theme="dark"] .ql-snow .ql-stroke { stroke: var(--text); }
:root[data-theme="dark"] .ql-snow .ql-fill { fill: var(--text); }
:root[data-theme="dark"] .ql-snow .ql-picker { color: var(--text); }

.switch-ctl { min-height: var(--ctl-h); }
.tr-lang { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.tr-lang > summary { display: flex; align-items: center; gap: var(--sp-3); min-height: 48px; padding: 0 var(--sp-4); cursor: pointer; font-weight: 600; font-size: var(--fs-sm); list-style: none; }
.tr-lang > summary::-webkit-details-marker { display: none; }
.tr-lang > summary .chev { margin-left: auto; transition: transform .15s; color: var(--muted); }
.tr-lang[open] > summary { border-bottom: 1px solid var(--border); }
.tr-lang[open] > summary .chev { transform: rotate(180deg); }
.tr-lang > .form-grid { padding: var(--sp-4); }
.mod-card { overflow: hidden; }
.mod-head { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; justify-content: space-between; padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border); }
.mod-head .review-head { min-width: 0; flex: 1 1 240px; }
.mod-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.mod-body { display: grid; gap: var(--sp-2); padding: var(--sp-4) var(--sp-5); }
.pre-line { white-space: pre-line; }
@media (min-width: 960px) { .sticky-side { position: sticky; top: calc(64px + var(--sp-6)); } }
fieldset.form-section > .card-foot { clear: both; }
.color-input { display: flex; gap: var(--sp-2); align-items: center; }
.color-input input[type="color"] { width: var(--ctl-h); height: var(--ctl-h); flex: none; padding: 4px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }
.switch-list .switch { align-items: flex-start; }
.switch-list .switch input { margin-top: 1px; }
.form-narrow { max-width: 980px; width: 100%; }
/* dashboard */
.seg-sm a, .seg-sm button { height: 28px; padding: 0 10px; font-size: var(--fs-xs); }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.data-table { border-top: 1px solid var(--border); }
.data-table > summary { cursor: pointer; padding: var(--sp-3) var(--sp-5); font-size: var(--fs-sm); font-weight: 600; color: var(--muted); list-style: none; }
.data-table > summary::-webkit-details-marker { display: none; }
.data-table > summary:hover { color: var(--text); }
.table-sm td, .table-sm th { padding: 8px var(--sp-4); }
.table .num, .table-sm .num { text-align: right; font-variant-numeric: tabular-nums; }
.cell-text { display: grid; min-width: 0; }
.cell-text a { font-weight: 600; color: var(--text); }
.cell-text a:hover { color: var(--primary); }
.hide-sm { display: none; }
@media (min-width: 640px) { .hide-sm { display: revert; } span.hide-sm { display: inline; } }
.btn-danger-ghost { color: var(--red-fg); }
.btn-danger-ghost:hover { background: var(--red-bg); border-color: var(--red-fg); }
.mini-review { display: grid; gap: 4px; padding: var(--sp-3) var(--sp-5); min-width: 0; }
.mini-review + .mini-review { border-top: 1px solid var(--border); }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kpi-grid { display: grid; gap: var(--sp-4); grid-template-columns: minmax(0, 1fr); }
.kpi { padding: var(--sp-4) var(--sp-5); display: grid; gap: var(--sp-3); }
.kpi-top { display: flex; justify-content: space-between; gap: var(--sp-3); align-items: flex-start; }
.kpi-label { font-size: var(--fs-sm); color: var(--muted); font-weight: 500; }
.kpi-value { display: flex; align-items: center; gap: var(--sp-2); margin-top: 4px; }
.kpi-value strong { font-size: var(--fs-xl); font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.delta { display: inline-flex; align-items: center; gap: 2px; height: 20px; padding: 0 6px; border-radius: 4px; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.delta.up { background: var(--green-bg); color: var(--green-fg); }
.delta.down { background: var(--red-bg); color: var(--red-fg); }
.delta.flat { background: var(--gray-bg); color: var(--gray-fg); }
.spark { width: 112px; height: 40px; flex: none; color: var(--series-1); }
.spark path.line { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark path.area { fill: currentColor; opacity: .1; stroke: none; }
.kpi-compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--border); font-size: var(--fs-xs); color: var(--muted); }
.kpi-compare strong { display: block; color: var(--text); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.summary { display: grid; gap: var(--sp-5); grid-template-columns: minmax(0, 1fr); align-items: center; padding: var(--sp-5); }
.summary-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.summary-table td { padding: 10px 0; border-bottom: 1px solid var(--border); }
.summary-table tr:last-child td { border-bottom: 0; }
.summary-table td:first-child { display: flex; align-items: center; gap: var(--sp-2); }
.summary-table .n { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.summary-table .p { text-align: right; color: var(--muted); width: 64px; font-variant-numeric: tabular-nums; }
.donut-box { position: relative; width: 100%; max-width: 260px; aspect-ratio: 1; margin-inline: auto; }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.donut-center strong { font-size: var(--fs-2xl); font-variant-numeric: tabular-nums; }
.donut-center span { font-size: var(--fs-xs); color: var(--muted); }
.chart-box { position: relative; height: 300px; padding: var(--sp-4) var(--sp-5) var(--sp-5); }
.legend { display: flex; gap: var(--sp-4); flex-wrap: wrap; font-size: var(--fs-sm); color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.todo { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-5); color: var(--text); text-decoration: none !important; min-width: 0; }
.todo + .todo { border-top: 1px solid var(--border); }
.todo:hover { background: var(--surface-2); }
.todo-ico { width: 36px; height: 36px; flex: none; border-radius: 10px; display: grid; place-items: center; }

/* ==========================================================================
   ≥ 640px
   ========================================================================== */
@media (min-width: 640px) {
  .container { padding-inline: var(--sp-6); }
  .form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .list-footer { flex-direction: row; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cat-tab { flex-direction: row; min-height: 56px; gap: var(--sp-2); font-size: var(--fs-base); }
  .cat-tab .lbl { flex-direction: row; gap: var(--sp-2); }
  dialog.sheet { max-width: 440px; margin: auto; border-radius: var(--radius-lg); }
  .toast-zone { left: auto; right: var(--sp-6); justify-items: end; }
  .auth-card { padding: var(--sp-8); }
  .hero h1 { font-size: var(--fs-3xl); }
  .bo-content { padding: var(--sp-6) var(--sp-6) var(--sp-12); }
  .bo-top { padding: 0 var(--sp-6); }
  .bo-tabs-mobile { padding: 0 var(--sp-6); }
  .bo-user-name { display: block; }
}

/* ==========================================================================
   ≥ 960px : desktop
   ========================================================================== */
@media (min-width: 960px) {
  :root { --header-h: 72px; }
  body.has-bottom-nav { padding-bottom: 0; }
  body.has-bottom-nav .form-actions.sticky { bottom: var(--sp-4); }
  .container { padding-inline: var(--sp-8); }
  .bottom-nav { display: none; }
  .toast-zone { bottom: var(--sp-6); }
  .brand-logo { width: 36px; height: 36px; }
  .brand-name { font-size: 1.5rem; }
  .main-nav { display: flex; align-items: center; gap: 2px; margin-left: var(--sp-4); min-width: 0; }
  .main-nav > a, .main-nav > .dropdown > summary { display: inline-flex; align-items: center; gap: 4px; height: 38px; padding: 0 var(--sp-2); border-radius: var(--radius-sm); color: var(--text-2); font-weight: 500; font-size: var(--fs-sm); white-space: nowrap; text-decoration: none !important; }
  .main-nav > a:hover, .main-nav > .dropdown > summary:hover { background: var(--surface-3); color: var(--text); }
  .main-nav > a.active { color: var(--primary); background: var(--primary-soft); font-weight: 600; }
  .auth-actions { display: flex; gap: var(--sp-2); margin-left: var(--sp-2); }
  .mobile-only { display: none !important; }
  .desktop-only { display: revert !important; }

  .hero { padding-block: var(--sp-10) var(--sp-8); }
  .cat-tabs { display: flex; gap: var(--sp-3); }
  .cat-tab { flex: 0 1 auto; padding: 0 var(--sp-5); min-height: 52px; }


  .filter-bar { grid-template-columns: minmax(180px, 1.4fr) repeat(var(--main-count, 3), minmax(120px, 1fr)) auto; }
  .filter-main { display: contents; }
  .filter-panel .mobile-main { display: none; }
  .filter-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

  .registry { display: table; }
  .registry thead { display: table-header-group; }
  .registry tbody { display: table-row-group; }
  .registry thead th { text-align: left; padding: var(--sp-3) var(--sp-3); font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
  .registry thead th:first-child { padding-left: var(--sp-5); }
  .registry tr.item-row { display: table-row; padding: 0; }
  .registry tr.item-row td { display: table-cell; padding: var(--sp-3) var(--sp-3); border-bottom: 1px solid var(--border); vertical-align: middle; font-size: var(--fs-sm); }
  .registry tr.item-row td:first-child { padding-left: var(--sp-5); }
  .registry tr.item-row td:last-child { padding-right: var(--sp-4); }
  .registry .col-check { display: table-cell; width: 44px; }
  .registry .col-check input { width: 17px; height: 17px; accent-color: var(--primary); }
  .registry .col-owner, .registry .col-field { display: table-cell; color: var(--text-2); }
  .registry .col-badges { display: none !important; }
  .registry .col-rating { white-space: nowrap; }
  .registry .col-actions { width: 48px; text-align: right; }
  .registry .col-main { min-width: 220px; }
  .registry-wrap { overflow-x: auto; }
  .registry .item-owner { display: none; }

  .detail-layout { grid-template-columns: minmax(0, 1fr) 340px; gap: var(--sp-6); }
  .article-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1.6fr repeat(3, minmax(0, 1fr)); }
  .auth-wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .auth-wrap.single { grid-template-columns: minmax(0, 520px); justify-content: center; }
  .auth-aside { display: grid; align-content: center; gap: var(--sp-5); padding: var(--sp-10); border-radius: var(--radius-lg); background: linear-gradient(160deg, var(--brand), color-mix(in srgb, var(--brand) 70%, black)); color: #e9f2ec; }
  .auth-aside h2 { color: #fff; font-size: var(--fs-2xl); }
  .auth-aside ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); }
  .auth-aside li { display: flex; gap: var(--sp-3); align-items: flex-start; }
  .auth-aside .i { color: #9fe0b3; margin-top: 2px; }

  /* back office: fixed sidebar */
  .bo { grid-template-columns: 256px minmax(0, 1fr); }
  .bo-side { position: sticky; top: 0; height: 100vh; transform: none; width: auto; max-width: none; box-shadow: none !important; }
  .bo-overlay, .bo-menu-btn { display: none !important; }
  .bo-top { padding: 0 var(--sp-8); }
  .bo-top-title { display: none; }
  .bo-tabs { display: flex; gap: var(--sp-6); align-self: stretch; min-width: 0; overflow: hidden; }
  .bo-tabs a { position: relative; display: inline-flex; align-items: center; color: var(--muted); font-weight: 600; font-size: var(--fs-sm); text-decoration: none !important; white-space: nowrap; }
  .bo-tabs a:hover { color: var(--text); }
  .bo-tabs a.active { color: var(--primary); }
  .bo-tabs a.active::after { content: ""; position: absolute; inset: auto 0 -1px 0; height: 2px; background: var(--primary); border-radius: 2px; }
  .bo-tabs-mobile { display: none; }
  .bo-content { padding: var(--sp-8) var(--sp-8) var(--sp-16); gap: var(--sp-6); }
  .summary { grid-template-columns: minmax(0, 1fr) 240px; gap: var(--sp-8); }
}

@media (min-width: 1200px) {
  .brand-name { font-size: 1.7rem; }
  .main-nav > a, .main-nav > .dropdown > summary { padding: 0 var(--sp-3); }
  .bo-split { grid-template-columns: minmax(0, 1fr) 360px; gap: var(--sp-6); }
  .catalog-layout { grid-template-columns: minmax(0, 1fr) 340px; gap: var(--sp-6); }
  .detail-aside { display: block; position: sticky; top: calc(var(--header-h) + var(--sp-4)); }
  .detail-aside .panel-sheet { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
  .detail-aside.open { position: sticky; inset: auto; background: none; animation: none; z-index: auto; }
  .detail-aside.open .panel-sheet { position: static; max-height: none; overflow: visible; border-radius: var(--radius); animation: none; }
  .detail-aside.open .panel-actions { position: static; grid-template-columns: 1fr; margin: 0; padding: 0; border: 0; background: none; }
  .sheet-grip { display: none; }
  .header-tagline { display: block; margin-right: var(--sp-3); font-size: var(--fs-sm); color: var(--muted); font-style: italic; white-space: nowrap; }
  .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .catalog-layout { grid-template-columns: minmax(0, 1fr) 360px; }
  .summary { grid-template-columns: minmax(0, 1fr) 280px; }
}

@media (min-width: 1440px) {
  .reset-link { display: inline-flex; }
}
/* next to the detail column, keep at most three configurable columns (all of them from 1440px) */
@media (min-width: 1200px) and (max-width: 1439px) {
  .registry .col-field ~ .col-field ~ .col-field ~ .col-field { display: none; }
}

/* tablet & small desktop: the detail opens as a side drawer instead of a bottom sheet */
@media (min-width: 640px) and (max-width: 1199px) {
  .detail-aside.open .panel-sheet { inset: 0 0 0 auto; width: min(460px, 92vw); max-height: none; height: 100%; border-radius: 0; animation: slide-left .25s ease; }
  .detail-aside.open .sheet-grip { display: none; }
}
@keyframes slide-left { from { transform: translateX(100%); } to { transform: none; } }

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