:root {
  /* SeGEC site chrome (teal / blue). GeARS red stays on the logo PNG only. */
  --ink: #202020;
  --ink-soft: #3a3a3a;
  --paper: #eef5f4;
  --paper-2: #e2eeec;
  --accent: #2d8a82;
  --accent-ink: #ffffff;
  --line: rgba(26, 26, 26, 0.12);
  --danger: #b42318;
  --ok: #1f7a4c;
  --shadow: 0 10px 28px rgba(26, 26, 26, 0.10);
  --font-display: "Open Sans", "Segoe UI", sans-serif;
  --font-body: "Open Sans", "Segoe UI", sans-serif;
  --segec-teal: #2d8a82;
  --segec-blue: #1a5f8a;
  --segec-teal-soft: rgba(45, 138, 130, 0.16);
  --radius-sm: 0.4rem;
  --radius-md: 0.55rem;
  --radius-lg: 0.85rem;
  /* Public / client: normal button density */
  --btn-pad-y: 0.65rem;
  --btn-pad-x: 1.15rem;
  --btn-font: 1rem;
  --btn-radius: 999px;
  --icon-size: 0.95rem;
  /* Version type badges (channel) */
  --channel-stable: #1f7a4c;
  --channel-stable-bg: rgba(31, 122, 76, 0.12);
  --channel-beta: #a16207;
  --channel-beta-bg: rgba(161, 98, 7, 0.14);
  --channel-rc: #1d4f91;
  --channel-rc-bg: rgba(29, 79, 145, 0.12);
  --channel-alpha: #5c6570;
  --channel-alpha-bg: rgba(92, 101, 112, 0.14);
}

* { box-sizing: border-box; }
/* Prefer min-height over height:100% — Safari can lock page scroll when html
   has a fixed height and a position:fixed footer (order form sticky bar). */
html {
  min-height: 100%;
  scroll-padding-bottom: 0;
}
body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  font-family: var(--font-body);
  color: var(--ink);
  /* Single top wash → white; page continues on solid #fff (no repeat-y seam). */
  background-color: #fff;
  background-image:
    radial-gradient(1200px 600px at 8% -12%, var(--segec-teal-soft), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(26, 95, 138, 0.12), transparent 50%),
    linear-gradient(180deg, #ffffff 0%, var(--paper) 48%, #ffffff 100%);
  background-repeat: no-repeat;
  background-size: 100% 100vh;
  background-size: 100% 100dvh;
  background-attachment: scroll;
  line-height: 1.5;
  overflow-x: clip;
}

a:not(.btn):not(.brand):not(.tile):not(.shop-card) { color: var(--segec-blue); }
a:not(.btn):not(.brand):not(.tile):not(.shop-card):hover { color: var(--segec-teal); }
.brand,
.tile { color: var(--ink); }
.brand:hover .brand-mark { color: var(--segec-teal); }

.shell {
  /* Slightly wider than the old 1080px so the header nav fits on one row. */
  width: min(1220px, calc(100% - 2rem));
  margin: 0 auto;
}

@media (min-width: 1400px) {
  .shell {
    width: min(1320px, calc(100% - 2.5rem));
  }
}

/* —— Icons —— */
.icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  vertical-align: -0.125em;
}
.btn .icon,
.lang-btn .icon,
.tile-icon .icon,
.empty-state .icon {
  width: var(--icon-size);
  height: var(--icon-size);
}
.icon-lg { width: 1.35rem; height: 1.35rem; }
.icon-xl { width: 2rem; height: 2rem; }
.tile-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-sm);
  background: var(--segec-teal);
  color: var(--accent-ink);
  margin-bottom: 0.55rem;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 0 0.4rem;
}

.brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  min-width: 0;
}
.brand-logo {
  display: block;
  height: clamp(2.25rem, 6vw, 3.25rem);
  width: auto;
  max-width: min(280px, 58vw);
  object-fit: contain;
  object-position: center;
  flex-shrink: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  /* Do not force a square crop or white plate — asset alpha/corners win */
  border-radius: 0;
}
/* GeARS 3 mark: red rounded square on transparent; show cleanly */
.brand-logo--gears3 {
  width: clamp(2.5rem, 7vw, 3.35rem);
  height: clamp(2.5rem, 7vw, 3.35rem);
  max-width: none;
  object-fit: contain;
  object-position: center;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  border-radius: 0; /* keep PNG’s own rounded red square; no CSS white frame */
  overflow: visible;
}
.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.brand-mark {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: clamp(1.1rem, 2.2vw, 1.45rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.brand-sub {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  opacity: 0.75;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 100%;
}

/* Keep the right cluster on one line once the shell is wide enough. */
@media (min-width: 1100px) {
  .site-header {
    gap: 1rem;
  }
  .nav-actions {
    flex-wrap: nowrap;
    gap: 0.5rem;
  }
  .nav-actions .btn-new-order {
    margin-right: 0.1rem;
  }
}

.lang-switch {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 253, 248, 0.65);
}
.lang-form { margin: 0; display: inline; }
.lang-btn {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.32rem 0.55rem;
  cursor: pointer;
  color: var(--ink-soft);
  transition: background 0.15s ease, color 0.15s ease;
}
.lang-btn:hover { background: rgba(15, 28, 26, 0.06); color: var(--ink); }
.lang-btn.is-active {
  background: var(--accent);
  color: var(--accent-ink);
}

/* Default buttons: public + client (normal size) */
.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: var(--btn-radius);
  padding: var(--btn-pad-y) var(--btn-pad-x);
  font: inherit;
  font-size: var(--btn-font);
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 8px 24px rgba(45, 138, 130, 0.28);
}
.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.btn-danger {
  background: #fff5f4;
  border-color: #f0c2bd;
  color: var(--danger);
  border-radius: 0.55rem;
  padding: 0.35rem 0.7rem;
  font-size: 0.85rem;
}
.btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.85rem;
}
.btn-icon {
  padding: 0.45rem;
  min-width: 2.1rem;
  min-height: 2.1rem;
}

/*
 * Compact Previflone density: admin layout only.
 * body.layout-admin = /admin pages; body.role-admin = connected admin (marker).
 * body.admin-ui kept as alias so older Responsive UI deploys still match.
 * Public / shop / login / client: never compact (see guard below).
 */
body.layout-admin,
body.admin-ui {
  --btn-pad-y: 0.38rem;
  --btn-pad-x: 0.78rem;
  --btn-font: 0.875rem;
  --btn-radius: var(--radius-sm);
}
body.layout-admin .btn-primary,
body.admin-ui .btn-primary {
  box-shadow: 0 2px 8px rgba(45, 138, 130, 0.22);
}
body.layout-admin .btn-danger,
body.admin-ui .btn-danger {
  padding: 0.28rem 0.55rem;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
}
body.layout-admin .btn-sm,
body.admin-ui .btn-sm {
  padding: 0.22rem 0.5rem;
  font-size: 0.8rem;
}
body.layout-admin .btn-icon,
body.admin-ui .btn-icon {
  padding: 0.32rem;
  min-width: 1.85rem;
  min-height: 1.85rem;
}

/* Client UUID (users.id) — dense, copy-friendly, admin-only surfaces */
body.layout-admin .admin-client-id,
body.admin-ui .admin-client-id {
  display: inline;
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  word-break: break-all;
  color: var(--ink-soft);
  background: transparent;
  padding: 0;
}
body.layout-admin input.admin-client-id-field[readonly],
body.admin-ui input.admin-client-id-field[readonly] {
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  letter-spacing: 0.01em;
  background: rgba(15, 28, 26, 0.04);
  color: var(--ink-soft);
  cursor: text;
}

/* Wins over any global compact .btn tokens on public / client / login */
body:not(.layout-admin):not(.admin-ui) {
  --btn-pad-y: 0.65rem;
  --btn-pad-x: 1.15rem;
  --btn-font: 1rem;
  --btn-radius: 999px;
}
body:not(.layout-admin):not(.admin-ui) .btn-primary {
  box-shadow: 0 8px 24px rgba(45, 138, 130, 0.28);
}
body:not(.layout-admin):not(.admin-ui) .btn-danger {
  border-radius: 0.55rem;
  padding: 0.35rem 0.7rem;
  font-size: 0.85rem;
}

.hero {
  display: grid;
  align-items: end;
  /* dvh first: avoid iOS 100vh “taller than visible” cutting CTAs. */
  min-height: calc(100dvh - 6rem);
  min-height: calc(100svh - 6rem);
  padding: 2.5rem 0 3.5rem;
  animation: rise 0.7s ease both;
}
.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 8vw, 5.4rem);
  font-weight: 650;
  letter-spacing: -0.045em;
  line-height: 0.95;
  margin: 0 0 1rem;
  max-width: 11ch;
  color: var(--segec-teal);
}
.hero-lead {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  max-width: 34rem;
  color: var(--ink-soft);
  margin: 0 0 1.75rem;
}
.hero-cta { display: flex; gap: 0.6rem; flex-wrap: wrap; }

.panel {
  background: rgba(255, 252, 246, 0.82);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.15rem 1.25rem;
  backdrop-filter: blur(8px);
  animation: rise 0.55s ease both;
}
.panel-narrow { width: min(420px, 100%); margin: 2.5rem auto 3rem; }
.panel h1 {
  font-family: var(--font-display);
  font-size: 1.85rem;
  letter-spacing: -0.03em;
  margin: 0 0 0.35rem;
}
.panel .lede { color: var(--ink-soft); margin: 0 0 1.25rem; }

label {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  margin: 0.85rem 0 0.35rem;
}
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.7rem;
  font: inherit;
  font-size: 0.925rem;
  background: #fffdf8;
  color: var(--ink);
}
textarea { min-height: 8rem; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(26, 95, 138, 0.55);
  outline-offset: 1px;
}
.check-grid {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.35rem;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  margin: 0;
}
.check-row input { width: auto; }

.alert {
  border-radius: var(--radius-md);
  padding: 0.65rem 0.8rem;
  margin: 0 0 1rem;
  font-size: 0.9rem;
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
}
.alert .icon { margin-top: 0.1rem; }
.alert-error { background: #fff1ef; color: var(--danger); border: 1px solid #f0c2bd; }
.alert-ok { background: #eaf7f0; color: var(--ok); border: 1px solid #b9e0c8; }

/* Admin test-as-client banner (sticky, high contrast, not a card stack) */
.impersonate-banner {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  padding: 0.55rem 1rem;
  background: var(--segec-blue);
  color: #f4f7f6;
  border-bottom: 2px solid var(--segec-teal);
  font-size: 0.9rem;
}
.impersonate-banner-text {
  margin: 0;
  font-weight: 600;
}
.impersonate-banner-email {
  font-weight: 400;
  opacity: 0.85;
  margin-left: 0.35rem;
}
.impersonate-banner-form { margin: 0; }
.impersonate-banner .btn-primary {
  background: var(--segec-teal);
  color: #fff;
  border-color: var(--segec-teal);
}
.impersonate-banner .btn-primary:hover {
  filter: brightness(1.05);
}
body.is-impersonating .shell {
  padding-top: 0.25rem;
}
.inline-form { display: inline; margin: 0; }
.panel-compact { padding: 0.75rem 1rem; }

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
  margin: 1.25rem 0 2rem;
}
.tile {
  display: block;
  text-decoration: none;
  padding: 1rem 1.05rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 252, 246, 0.9);
  box-shadow: var(--shadow);
  transition: transform 0.15s ease;
}
.tile:hover { transform: translateY(-2px); }
.tile h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0 0 0.3rem;
  letter-spacing: -0.02em;
}
.tile p { margin: 0; color: var(--ink-soft); font-size: 0.88rem; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
table.data th, table.data td {
  text-align: left;
  padding: 0.55rem 0.35rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.data th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
  background: var(--paper-2);
  padding: 0.1rem 0.35rem;
  border-radius: 0.35rem;
}

.muted { color: var(--ink-soft); font-size: 0.9rem; }
.flash { margin: 0.6rem 0; padding: 0.55rem 0.75rem; border-radius: 8px; background: #e7f3f1; color: var(--ink); }
.flash-error { background: #fde8e8; }
.stack-sm { display: grid; gap: 0.35rem; }
.row-actions { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.page-title {
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 4vw, 2.2rem);
  letter-spacing: -0.03em;
  margin: 1.25rem 0 0.3rem;
}

.home-block { margin-top: 0.5rem; }
/* Signed-in home: the apps block is the page. No viewport-tall hero above it. */
.home-apps { margin-top: 0.15rem; }
.home-apps > .page-title { margin-top: 0.35rem; }
.home-news { margin-bottom: 2rem; }
.news-list { display: grid; gap: 0.85rem; margin: 0.6rem 0 1.5rem; }
.news-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.25rem 1.35rem;
}
.news-card h3 {
  margin: 0 0 0.25rem;
  color: var(--segec-teal);
  font-size: 1.25rem;
}
.news-date { color: var(--ink-soft); margin: 0 0 0.75rem; }
.news-card p { margin: 0 0 0.75rem; }
.news-html { overflow-wrap: anywhere; }
.news-html img { max-width: 100%; height: auto; }
.news-html a { color: var(--segec-blue); }
.news-html h2, .news-html h3 { color: var(--segec-teal); }
.news-editor-modes { display: flex; gap: 0.4rem; margin: 0.35rem 0 0.6rem; }
textarea.is-html-source {
  display: block;
  width: 100%;
  min-height: 320px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88rem;
  line-height: 1.45;
}
.news-links { margin: 0; padding-left: 1.1rem; }
.news-links a { color: var(--segec-blue); }
.shop-card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0 0 0.2rem;
  letter-spacing: -0.02em;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.85rem;
  margin: 1.1rem 0 2.25rem;
}
.shop-card {
  display: flex;
  gap: 0.9rem;
  text-decoration: none;
  padding: 0.95rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 252, 246, 0.9);
  box-shadow: var(--shadow);
  transition: transform 0.15s ease;
}
.shop-card { color: var(--ink); }
.shop-card:hover {
  transform: translateY(-2px);
  border-color: var(--segec-teal);
}
.shop-card h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0 0 0.2rem;
  letter-spacing: -0.02em;
}
.shop-card-name {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.shop-os {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--segec-teal);
  line-height: 0;
}
.shop-os .icon {
  width: 17px;
  height: 17px;
  vertical-align: 0;
}
.shop-card p { margin: 0.15rem 0; font-size: 0.88rem; color: var(--ink-soft); }
.shop-logo {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: var(--paper-2);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--line);
}
.shop-logo.large { width: 88px; height: 88px; border-radius: 16px; }
.shop-logo picture { display: contents; }
.shop-logo img { width: 100%; height: 100%; object-fit: cover; }
.shop-logo-fallback {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--ink-soft);
}
.shop-detail-head {
  display: flex;
  gap: 1.1rem;
  align-items: flex-start;
  margin-top: 1rem;
  flex-wrap: wrap;
}
.version-block {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line);
}
.version-block:last-child { border-bottom: 0; }
.version-block-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  margin-bottom: 0.35rem;
}

.version-badge {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.2;
  padding: 0.2rem 0.5rem;
  border-radius: 0.3rem;
  border: 1px solid transparent;
  vertical-align: middle;
  white-space: nowrap;
  text-transform: none;
}
/* Beat parent .shop-card p / .muted color inheritance */
.shop-card .version-badge,
.shop-detail .version-badge,
.version-line .version-badge,
.version-block .version-badge,
table.data .version-badge {
  font-size: 0.72rem;
}
.version-badge.version-badge--stable {
  color: var(--channel-stable);
  background: var(--channel-stable-bg);
  border-color: rgba(31, 122, 76, 0.28);
}
.version-badge.version-badge--beta {
  color: var(--channel-beta);
  background: var(--channel-beta-bg);
  border-color: rgba(161, 98, 7, 0.3);
}
.version-badge.version-badge--rc {
  color: var(--channel-rc);
  background: var(--channel-rc-bg);
  border-color: rgba(29, 79, 145, 0.28);
}
.version-badge.version-badge--obsolete {
  color: #6b4e16;
  background: rgba(161, 98, 7, 0.14);
  border-color: rgba(161, 98, 7, 0.35);
}
.version-badge.version-badge--apk {
  color: var(--segec-blue);
  background: rgba(26, 95, 138, 0.12);
  border-color: rgba(26, 95, 138, 0.28);
}
.btn[aria-disabled="true"] {
  opacity: 0.55;
  pointer-events: none;
}
.version-badge.version-badge--alpha {
  color: var(--channel-alpha);
  background: var(--channel-alpha-bg);
  border-color: rgba(92, 101, 112, 0.3);
}
.version-line {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--ink-soft);
}
.empty-state .icon {
  width: 1.75rem;
  height: 1.75rem;
  opacity: 0.7;
}
.empty-state p { margin: 0; font-size: 0.9rem; }

.card-list {
  display: none;
  gap: 0.65rem;
}
.card-list-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 253, 248, 0.95);
  padding: 0.75rem 0.85rem;
  display: grid;
  gap: 0.35rem;
}
.card-list-item .card-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.card-meta {
  display: grid;
  gap: 0.2rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.card-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
}
.card-meta-row dt {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.8;
  margin: 0;
  flex-shrink: 0;
}
.card-meta-row dd {
  margin: 0;
  text-align: right;
  color: var(--ink);
  word-break: break-word;
}
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--line);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* —— Mobile: hero + nav (Responsive UI + Mobile Hero) —— */
@media (max-width: 720px) {
  .shell { width: min(1220px, calc(100% - 1.25rem)); }

  /* Hero home: brand + CTAs upper viewport (not align-items:end). */
  .hero {
    align-items: start;
    min-height: calc(100dvh - 5.5rem);
    min-height: calc(100svh - 5.5rem);
    padding: clamp(1.75rem, 8vh, 3.25rem) 0 2rem;
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
  }
  .hero-brand {
    font-size: clamp(2.2rem, 11vw, 3.2rem);
    max-width: none;
  }
  .hero-lead { margin-bottom: 1.15rem; }
  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-cta .btn { width: 100%; }

  .site-header {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.55rem;
    padding-top: 0.85rem;
  }
  .brand { gap: 0.5rem; }
  .brand-logo {
    height: 2rem;
    max-width: min(200px, 52vw);
  }
  .brand-logo--gears3 {
    width: 2.35rem;
    height: 2.35rem;
    max-width: none;
  }
  .brand-sub { display: none; }
  .nav-actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }
  .nav-actions .btn {
    flex: 0 1 auto;
  }

  .shop-detail-head { flex-direction: column; }
  .panel { padding: 0.95rem 0.9rem; }
  .panel-narrow { margin: 1.5rem auto 2rem; }

  /* Tables → stacked cards (Previflone pattern) */
  .table-desktop { display: none; }
  .card-list { display: grid; }

  table.data.data-cards thead { display: none; }
  table.data.data-cards,
  table.data.data-cards tbody {
    display: block;
    width: 100%;
  }
  table.data.data-cards tr {
    display: grid;
    gap: 0.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(255, 253, 248, 0.95);
    padding: 0.7rem 0.8rem;
    margin: 0 0 0.65rem;
  }
  table.data.data-cards tr:last-child { margin-bottom: 0; }
  table.data.data-cards td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    border: 0;
    padding: 0.15rem 0;
    text-align: right;
  }
  table.data.data-cards td::before {
    content: attr(data-label);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ink-soft);
    text-align: left;
    flex-shrink: 0;
    max-width: 42%;
  }
  table.data.data-cards td.card-actions-cell,
  table.data.data-cards td[data-label=""] {
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.35rem;
    padding-top: 0.45rem;
    border-top: 1px solid var(--line);
    text-align: left;
  }
  table.data.data-cards td.card-actions-cell::before,
  table.data.data-cards td[data-label=""]::before {
    display: none;
  }
  table.data.data-cards td.card-primary {
    font-weight: 700;
    font-size: 0.95rem;
    justify-content: flex-start;
    text-align: left;
  }
  table.data.data-cards td.card-primary::before { display: none; }

  .admin-grid { grid-template-columns: 1fr; }
  .row-actions .btn { font-size: 0.8125rem; }

  /* Nested / complex tables: horizontal scroll instead of broken layout */
  table.data:not(.data-cards) {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (min-width: 721px) {
  .card-list { display: none !important; }
  .table-desktop { display: block; }
}

/* —— Order form v2 (client, mobile-first) —— */
.order-flow {
  width: min(40rem, 100%);
  margin: 0 auto 5.5rem;
  padding-bottom: env(safe-area-inset-bottom, 0);
  /* Keep document as the only vertical scroller (Safari). */
  overflow: visible;
  touch-action: pan-y;
}
.order-flow__intro { margin-bottom: 1rem; }
#order-form {
  overflow: visible;
}
.order-section {
  margin: 0 0 1.35rem;
  padding: 0 0 1.15rem;
  border-bottom: 1px solid var(--line);
}
.order-section:last-of-type { border-bottom: 0; }
.order-section__title {
  font-family: var(--font-sans, 'Open Sans', sans-serif);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 0.35rem;
}
.order-section__hint { margin: 0 0 0.75rem; font-size: 0.88rem; }
.order-kind {
  display: grid;
  gap: 0.5rem;
}
.order-kind__option {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin: 0;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 253, 248, 0.92);
  font-weight: 600;
  cursor: pointer;
  min-height: 2.75rem;
}
.order-kind__option input { width: auto; margin-top: 0.15rem; flex-shrink: 0; }
.order-kind__option:has(input:checked) {
  border-color: rgba(31, 122, 76, 0.45);
  background: rgba(234, 247, 240, 0.85);
}
.order-pick { display: grid; gap: 0.55rem; }
.order-pick__row {
  display: grid;
  gap: 0.45rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.order-pick__row:last-child { border-bottom: 0; }
.order-pick__label {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin: 0;
  font-weight: 500;
  min-height: 2.5rem;
}
.order-pick__label input { width: auto; margin-top: 0.2rem; flex-shrink: 0; min-width: 1.15rem; min-height: 1.15rem; }
.order-pick__logo {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 10px;
  background: var(--paper-2, #f7f4ee);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
}
.order-pick__logo picture { display: contents; }
.order-pick__logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.order-pick__text { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.order-pick__text strong { font-weight: 700; }
.order-pick__qty {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0 1.8rem;
  font-weight: 500;
}
.order-pick__qty input {
  width: 4.75rem;
  min-height: 2.5rem;
  padding: 0.45rem 0.55rem;
}
.order-pick__row--app .order-pick__logo {
  margin-top: 0.05rem;
}
.order-pick__row--app:has(.order-pick__logo) .order-pick__qty,
.order-pick__row--app:has(.order-pick__logo) .order-license {
  /* checkbox + gaps + 44px logo — keep qty/licence under the name column */
  margin-left: 5.2rem;
}
@media (max-width: 520px) {
  .order-pick__logo {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9px;
  }
  .order-pick__row--app:has(.order-pick__logo) .order-pick__qty,
  .order-pick__row--app:has(.order-pick__logo) .order-license {
    margin-left: 4.85rem;
  }
}
.order-license {
  margin: 0.15rem 0 0 1.8rem;
  display: grid;
  gap: 0.4rem;
}
.order-license__opt {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-weight: 500;
}
.order-license__opt input { width: auto; }
.order-license__days {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}
.order-license__days input { width: 5.5rem; min-height: 2.4rem; }
.order-date-mode {
  border: 0;
  margin: 0 0 0.75rem;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}
.order-date-mode legend {
  font-size: 0.86rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
  padding: 0;
}
.order-travel { margin-top: 0.5rem; }
.order-ack {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin: 0;
  font-weight: 500;
  line-height: 1.45;
}
.order-ack input { width: auto; margin-top: 0.2rem; min-width: 1.15rem; min-height: 1.15rem; }
.order-form input[type="date"],
.order-form input[type="text"],
.order-form input[type="number"] {
  min-height: 2.75rem;
  font-size: 1rem;
}
.order-sticky {
  position: -webkit-sticky;
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 1.25rem -0.15rem 0;
  padding: 0.85rem 0.9rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
  /* Opaque — no backdrop-filter (Safari scroll lock with fixed/sticky bars). */
  background: #fffcf6;
  border: 1px solid var(--line);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  box-shadow: 0 -6px 24px rgba(20, 40, 30, 0.08);
}
.order-sticky__total {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.order-sticky__total strong { font-size: 1.15rem; letter-spacing: -0.02em; }
.order-sticky__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.order-sticky__actions .btn { min-height: 2.75rem; }

@media (max-width: 720px) {
  /*
   * Always-visible price bar (position:fixed).
   * --order-sticky-offset is set by JS to the real bar height (+ buffer).
   * Fallback 14rem covers estimate + hint + dual CTAs on narrow Safari
   * (8.75rem was too short → “Lieu de la manifestation” stayed under the bar).
   */
  .order-flow {
    margin-bottom: 0;
    padding-bottom: var(--order-sticky-offset, 14rem);
  }
  html:has(.order-flow) {
    scroll-padding-bottom: var(--order-sticky-offset, 14rem);
  }
  .order-sticky {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    max-width: none;
    margin: 0;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    /* Avoid transform/filter here — they create containing blocks that
       trap touch scrolling on Safari iOS when paired with position:fixed. */
  }
  .order-sticky__actions { width: 100%; }
  .order-sticky__actions .btn-primary { flex: 1; }
  .order-kind__option { padding: 0.85rem 0.9rem; }
}

@media (min-width: 721px) {
  .order-sticky {
    position: -webkit-sticky;
    position: sticky;
    border-radius: var(--radius-md);
    margin-top: 1.5rem;
  }
}

/* —— Account space (client) —— */
.account-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 1rem 0 1.5rem;
  padding: 0;
  border: none;
}
.account-tabs .btn {
  flex: 0 0 auto;
  text-decoration: none;
}
.account-section {
  margin: 0 0 2.5rem;
}
.account-section:last-child {
  margin-bottom: 1.5rem;
}
.account-section-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0 0 0.65rem;
}
.panel-narrow-account { max-width: 28rem; }

.license-card-list,
.doc-card-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}
.license-card,
.doc-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fffdf8;
  padding: 0.9rem 1rem;
  display: grid;
  gap: 0.45rem;
}
.license-card-main,
.doc-card-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
}
.license-card-title,
.doc-card-title { font-size: 1rem; }
.license-card-status,
.doc-type {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  background: rgba(45, 138, 130, 0.16);
  color: var(--segec-blue);
}
.license-card-meta,
.doc-card-meta {
  margin: 0;
  font-size: 0.85rem;
  word-break: break-word;
}
.license-card-actions,
.doc-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.2rem;
}

@media (max-width: 720px) {
  .account-tabs {
    gap: 0.45rem;
    margin: 0.85rem 0 1.35rem;
  }
  .account-section {
    margin: 0 0 2.15rem;
  }
}

/* Admin list search — append-only zone (Merge Guard: avoid editing body/account blocks above) */
body.layout-admin .admin-list-controls,
body.admin-ui .admin-list-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
  margin: 0 0 0.85rem;
}
body.layout-admin .admin-list-toolbar,
body.admin-ui .admin-list-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.85rem;
  flex: 1 1 14rem;
  min-width: min(100%, 14rem);
}
body.layout-admin .admin-list-controls .admin-list-toolbar,
body.admin-ui .admin-list-controls .admin-list-toolbar {
  margin-bottom: 0;
}
body.layout-admin .admin-list-controls .row-actions,
body.admin-ui .admin-list-controls .row-actions {
  margin: 0;
}
body.layout-admin .admin-search,
body.admin-ui .admin-search {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex: 1 1 11rem;
  min-width: 0;
  max-width: 22rem;
  padding: 0.18rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.55);
}
body.layout-admin .admin-search .icon,
body.admin-ui .admin-search .icon {
  flex: 0 0 auto;
  opacity: 0.65;
}
body.layout-admin .admin-search input[type="search"],
body.admin-ui .admin-search input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0.22rem 0.15rem;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: 0.875rem;
  line-height: 1.25;
}
body.layout-admin .admin-search input[type="search"]:focus,
body.admin-ui .admin-search input[type="search"]:focus {
  outline: none;
}
body.layout-admin .admin-sr-only,
body.admin-ui .admin-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 720px) {
  body.layout-admin .admin-list-toolbar,
  body.admin-ui .admin-list-toolbar,
  body.layout-admin .admin-search,
  body.admin-ui .admin-search {
    max-width: none;
    width: 100%;
  }
}

/* Order form — travel, hours, matériel (service order rules) */
.order-place-suggest {
  position: relative;
}
.order-place-suggest ul {
  list-style: none;
  margin: 0.25rem 0 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface, #fff);
  max-height: 12rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.order-place-suggest li button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.45rem 0.65rem;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}
.order-place-suggest li button:hover,
.order-place-suggest li button:focus {
  background: rgba(0, 0, 0, 0.04);
}
.order-materiel .order-materiel__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
}
.order-hours {
  display: grid;
  gap: 0.65rem;
}
@media (min-width: 520px) {
  .order-hours {
    grid-template-columns: 1fr 1fr;
  }
}
.order-travel-meta {
  font-size: 0.875rem;
  color: var(--muted, #5a5a5a);
  margin: 0.35rem 0 0;
}
.order-indicative {
  font-size: 0.85rem;
  color: var(--muted, #5a5a5a);
  border-left: 3px solid var(--line);
  padding: 0.35rem 0 0.35rem 0.65rem;
  margin: 0.75rem 0;
}
@media (max-width: 720px) {
  .order-materiel .order-materiel__row {
    flex-direction: column;
    align-items: flex-start;
  }
}

/*
 * Site-wide sticky/fixed scroll hygiene (audit 2026-10-24)
 * - Only bottom fixed bar on public/client: .order-sticky (mobile).
 * - Account tabs / admin toolbars are in-flow (no fixed bottom).
 * - Prefer 100dvh/100svh over bare 100vh for full-viewport sections.
 * - Nested overflow lists: overscroll-behavior: contain (travel suggest).
 * Pattern for future fixed bottom bars:
 *   pad host with var(--fixed-bottom-offset, …); measure bar height in JS.
 */

/* —— AbMsg modal / toasts / upload progress (STORE-73, Hannut mechanics) —— */
:root {
  --warn: #a16207;
  --muted-ink: #5a6a66;
}
.msg-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.msg-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}
.msg-modal[hidden] { display: none !important; }
.msg-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 28, 26, 0.42);
}
.msg-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(26rem, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  padding: 1.15rem 1.2rem 1rem;
  transform: translateY(8px) scale(0.98);
  transition: transform 0.22s ease;
  font-family: var(--font-body);
}
.msg-modal.is-open .msg-modal__dialog {
  transform: translateY(0) scale(1);
}
.msg-modal__icon {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.55rem;
  background: rgba(36, 51, 48, 0.08);
  color: var(--ink-soft);
}
.msg-modal__icon--info {
  background: rgba(29, 79, 145, 0.12);
  color: #1d4f91;
}
.msg-modal__icon--danger {
  background: rgba(180, 35, 24, 0.12);
  color: var(--danger);
}
.msg-modal__icon--success {
  background: rgba(31, 122, 76, 0.12);
  color: var(--ok);
}
.msg-modal__title {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}
.msg-modal__body {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  color: var(--muted-ink);
  line-height: 1.45;
  white-space: pre-wrap;
}
.msg-modal__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}
.btn-danger-solid {
  background: var(--danger);
  color: #fff;
  border: 1px solid var(--danger);
}
.btn-danger-solid:hover {
  filter: brightness(0.95);
  color: #fff;
}

.toast-stack {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1300;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  width: min(22rem, calc(100vw - 2rem));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.7rem 0.75rem;
  border-radius: var(--radius-md);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--ink);
  opacity: 0;
  transform: translateX(12px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.toast.is-in {
  opacity: 1;
  transform: translateX(0);
}
.toast.is-out {
  opacity: 0;
  transform: translateX(12px);
}
.toast__icon {
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(36, 51, 48, 0.08);
}
.toast--success { border-color: #b9e0c8; }
.toast--success .toast__icon { background: rgba(31, 122, 76, 0.14); color: var(--ok); }
.toast--error { border-color: #f0c2bd; }
.toast--error .toast__icon { background: rgba(180, 35, 24, 0.12); color: var(--danger); }
.toast--warn { border-color: #e8d4a8; }
.toast--warn .toast__icon { background: rgba(161, 98, 7, 0.14); color: var(--warn); }
.toast--info .toast__icon { background: rgba(29, 79, 145, 0.12); color: #1d4f91; }
.toast__msg {
  flex: 1;
  min-width: 0;
  line-height: 1.4;
}
.toast__close {
  flex-shrink: 0;
  border: 0;
  background: transparent;
  color: var(--muted-ink);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.15rem;
}
.toast__close:hover { color: var(--ink); }

.upload-progress {
  margin: 0.65rem 0 0.85rem;
}
.upload-progress__track {
  height: 0.45rem;
  border-radius: 999px;
  background: rgba(15, 28, 26, 0.08);
  overflow: hidden;
}
.upload-progress__bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--segec-teal), var(--segec-blue));
  transition: width 0.15s ease-out;
}
.upload-progress__label {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
}
body.layout-admin .upload-progress__bar {
  background: linear-gradient(90deg, var(--segec-teal), var(--segec-blue));
}
@media (max-width: 520px) {
  .toast-stack {
    left: 1rem;
    right: 1rem;
    width: auto;
  }
}

/* ——— Resources gallery (auth-only videos + PDFs) ——— */
.resources-page { max-width: 56rem; }
.resources-head { margin-bottom: 1.25rem; }
.resources-filters { flex-wrap: wrap; gap: 0.4rem; margin: 0 0 1.5rem; }
.resources-section { margin: 1.75rem 0; }
.resources-section-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 0 0 0.85rem;
}
.resources-video-list { display: flex; flex-direction: column; gap: 1.5rem; }
.resources-video {
  display: grid;
  gap: 0.85rem;
}
@media (min-width: 720px) {
  .resources-video {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    align-items: start;
  }
}
.resources-video-player {
  background: #0f1c1a;
  border-radius: 0.5rem;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}
.resources-video-player video,
.gallery-dash-player,
.resources-video-player iframe.gallery-youtube-player {
  display: block;
  width: 100%;
  height: 100%;
  background: #0f1c1a;
  border: 0;
}
.gallery-youtube-hint { margin: 0; font-size: 0.9rem; line-height: 1.4; }
.resources-item-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0 0 0.35rem;
}
.resources-item-scope { margin: 0 0 0.35rem; font-size: 0.9rem; }
.resources-item-desc { margin: 0; line-height: 1.45; }
.resources-doc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.resources-doc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(15, 28, 26, 0.08);
}
.resources-doc:last-child { border-bottom: 0; }
.resources-doc-body { flex: 1; min-width: 12rem; }

.gallery-admin-panel { margin: 1.25rem 0; }
.gallery-panel-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0 0 0.75rem;
}
.gallery-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem 0.85rem;
}
.gallery-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.88rem;
}
.gallery-form-grid .span-2 { grid-column: 1 / -1; }
.gallery-form-grid .check-inline {
  flex-direction: row;
  align-items: center;
  gap: 0.45rem;
}
.gallery-form-grid input[type="text"],
.gallery-form-grid input[type="url"],
.gallery-form-grid input[type="number"],
.gallery-form-grid select,
.gallery-form-grid textarea {
  font: inherit;
  padding: 0.4rem 0.5rem;
  border: 1px solid rgba(15, 28, 26, 0.16);
  border-radius: 0.35rem;
  background: #fff;
}
@media (max-width: 640px) {
  .gallery-form-grid { grid-template-columns: 1fr; }
  .gallery-form-grid .span-2 { grid-column: auto; }
}
.gallery-reorder-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.gallery-reorder-item {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: flex-start;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(15, 28, 26, 0.1);
  border-radius: 0.4rem;
  background: rgba(255, 255, 255, 0.55);
}
.gallery-reorder-item.is-dragging { opacity: 0.55; }
.gallery-reorder-handle {
  cursor: grab;
  user-select: none;
  color: var(--muted-ink);
  padding: 0.15rem 0.25rem;
  font-size: 0.95rem;
  letter-spacing: -0.05em;
}
.gallery-reorder-body { flex: 1; min-width: 12rem; }
.gallery-meta-line { font-size: 0.85rem; margin-top: 0.2rem; }
.gallery-url-snip {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  word-break: break-all;
  opacity: 0.75;
}
.gallery-item-actions { flex-shrink: 0; }
.gallery-edit-details {
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem 0.85rem;
  border: 1px dashed rgba(15, 28, 26, 0.14);
  border-radius: 0.4rem;
}
.gallery-edit-details summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* Previflone-style AJAX nav — busy feedback (append EOF; do not reorder above) */
html.store-ajax-busy,
html.store-ajax-busy body {
  cursor: progress;
}
html.store-ajax-busy .store-main {
  opacity: 0.72;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.store-main {
  min-width: 0;
}
.store-main .is-focused {
  outline: 2px solid rgba(159, 214, 58, 0.55);
  outline-offset: 4px;
  border-radius: 6px;
  transition: outline-color 0.3s ease;
}

/* Admin athletes LBFA/VAL filters — append EOF (Merge Guard) */
body.layout-admin .athletes-filters,
body.admin-ui .athletes-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0.35rem 0 0;
  width: 100%;
}
body.layout-admin .athletes-filters .admin-filter,
body.admin-ui .athletes-filters .admin-filter {
  display: inline-flex;
  align-items: center;
  margin: 0;
  min-width: 0;
}
body.layout-admin .athletes-filters select,
body.admin-ui .athletes-filters select {
  margin: 0;
  padding: 0.28rem 0.55rem;
  font-size: 0.8125rem;
  line-height: 1.25;
  max-width: min(100%, 14rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.55);
}
@media (max-width: 720px) {
  body.layout-admin .athletes-filters select,
  body.admin-ui .athletes-filters select {
    max-width: none;
    width: 100%;
  }
  body.layout-admin .athletes-filters .admin-filter,
  body.admin-ui .athletes-filters .admin-filter {
    flex: 1 1 100%;
  }
}

/* Athletes sync status tile + journal (Previflone admin density) */
body.layout-admin .athletes-sync-panel,
body.admin-ui .athletes-sync-panel {
  max-width: 52rem;
  width: 100%;
}
body.layout-admin .athletes-sync-status-row,
body.admin-ui .athletes-sync-status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.85rem;
}
body.layout-admin .athletes-trigger-badge,
body.admin-ui .athletes-trigger-badge,
body.layout-admin .athletes-source-badge,
body.admin-ui .athletes-source-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.65);
  white-space: nowrap;
}
body.layout-admin .athletes-trigger-badge.is-manual,
body.admin-ui .athletes-trigger-badge.is-manual {
  border-color: rgba(40, 90, 160, 0.35);
  color: #1e4a7a;
  background: rgba(70, 130, 200, 0.12);
}
body.layout-admin .athletes-trigger-badge.is-auto,
body.admin-ui .athletes-trigger-badge.is-auto {
  border-color: rgba(90, 110, 70, 0.35);
  color: #3a4a22;
  background: rgba(159, 214, 58, 0.18);
}
body.layout-admin .athletes-source-badge.is-changed,
body.admin-ui .athletes-source-badge.is-changed {
  border-color: rgba(180, 110, 20, 0.4);
  color: #7a4a0a;
  background: rgba(240, 170, 60, 0.18);
}
body.layout-admin .athletes-source-badge.is-meta,
body.admin-ui .athletes-source-badge.is-meta {
  border-color: rgba(40, 110, 150, 0.4);
  color: #1a5570;
  background: rgba(70, 160, 200, 0.14);
}
body.layout-admin .athletes-source-badge.is-unchanged,
body.admin-ui .athletes-source-badge.is-unchanged {
  border-color: rgba(100, 110, 100, 0.28);
  color: #555;
  background: rgba(0, 0, 0, 0.04);
}
body.layout-admin .athletes-source-badge.is-unknown,
body.admin-ui .athletes-source-badge.is-unknown {
  color: #777;
}
body.layout-admin .athletes-live-line,
body.admin-ui .athletes-live-line {
  margin: 0 0 0.35rem;
}
body.layout-admin .athletes-meta-line,
body.admin-ui .athletes-meta-line {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
}
body.layout-admin .athletes-run-block,
body.admin-ui .athletes-run-block {
  margin: 1rem 0 0;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}
body.layout-admin .athletes-run-head,
body.admin-ui .athletes-run-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.55rem;
}
body.layout-admin .athletes-run-title,
body.admin-ui .athletes-run-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}
body.layout-admin .athletes-run-previous,
body.admin-ui .athletes-run-previous {
  opacity: 0.78;
}
body.layout-admin .athletes-run-previous .athletes-stat-num,
body.admin-ui .athletes-run-previous .athletes-stat-num {
  font-size: 1.05rem;
}
body.layout-admin .athletes-fed-grid,
body.admin-ui .athletes-fed-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}
body.layout-admin .athletes-fed-card,
body.admin-ui .athletes-fed-card {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.45);
}
body.layout-admin .athletes-fed-card.is-primary,
body.admin-ui .athletes-fed-card.is-primary {
  background: rgba(255, 255, 255, 0.72);
}
body.layout-admin .athletes-fed-card.is-secondary,
body.admin-ui .athletes-fed-card.is-secondary {
  background: transparent;
}
body.layout-admin .athletes-fed-head,
body.admin-ui .athletes-fed-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}
/* Federation logos (VAL / LBFA) — local assets, Previflone density */
body.layout-admin .athletes-fed-badge,
body.admin-ui .athletes-fed-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  max-width: 100%;
  vertical-align: middle;
  line-height: 1.15;
}
body.layout-admin .athletes-fed-logo,
body.admin-ui .athletes-fed-logo {
  display: block;
  flex: 0 0 auto;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
}
/* Explicit sizes: SVG <img> collapses to 0×0 with width/height:auto in Chromium. */
body.layout-admin .athletes-fed-badge--mark .athletes-fed-logo,
body.admin-ui .athletes-fed-badge--mark .athletes-fed-logo {
  width: 1.35rem;
  height: 1.35rem;
}
body.layout-admin .athletes-fed-badge--val.athletes-fed-badge--mark .athletes-fed-logo,
body.admin-ui .athletes-fed-badge--val.athletes-fed-badge--mark .athletes-fed-logo {
  width: 1.55rem;
  height: 1.05rem;
}
body.layout-admin .athletes-fed-badge--lockup .athletes-fed-logo,
body.admin-ui .athletes-fed-badge--lockup .athletes-fed-logo {
  width: auto;
  height: 2.35rem;
}
body.layout-admin .athletes-fed-badge--val.athletes-fed-badge--lockup .athletes-fed-logo,
body.admin-ui .athletes-fed-badge--val.athletes-fed-badge--lockup .athletes-fed-logo {
  height: 1.7rem;
  width: 7.4rem;
  max-width: min(100%, 9.5rem);
}
body.layout-admin .athletes-fed-badge--lbfa.athletes-fed-badge--lockup .athletes-fed-logo,
body.admin-ui .athletes-fed-badge--lbfa.athletes-fed-badge--lockup .athletes-fed-logo {
  height: 2.65rem;
  width: 4.7rem;
  max-width: min(100%, 7.5rem);
}
body.layout-admin .athletes-fed-code,
body.admin-ui .athletes-fed-code {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #222;
  white-space: nowrap;
}
body.layout-admin .athletes-fed-head-logo,
body.admin-ui .athletes-fed-head-logo {
  min-width: 0;
}
body.layout-admin .athletes-live-by-fed,
body.admin-ui .athletes-live-by-fed {
  display: inline;
}
body.layout-admin .athletes-live-fed,
body.admin-ui .athletes-live-fed {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin: 0 0.1rem;
  vertical-align: middle;
}
body.layout-admin .athletes-live-fed-n,
body.admin-ui .athletes-live-fed-n {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #333;
}
body.layout-admin .athletes-journal-source-row,
body.admin-ui .athletes-journal-source-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.45rem;
}
body.layout-admin .data-cards td .athletes-fed-badge,
body.admin-ui .data-cards td .athletes-fed-badge {
  margin: 0.05rem 0;
}
body.layout-admin .athletes-journal-table thead th .athletes-fed-badge,
body.admin-ui .athletes-journal-table thead th .athletes-fed-badge {
  gap: 0.28rem;
}
body.layout-admin .athletes-journal-table thead th .athletes-fed-code,
body.admin-ui .athletes-journal-table thead th .athletes-fed-code {
  font-size: 0.75rem;
}
body.layout-admin .athletes-fed-stats,
body.admin-ui .athletes-fed-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem 0.4rem;
  margin: 0;
}
body.layout-admin .athletes-fed-stats dt,
body.admin-ui .athletes-fed-stats dt {
  margin: 0;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #666;
}
body.layout-admin .athletes-fed-stats dd,
body.admin-ui .athletes-fed-stats dd {
  margin: 0.1rem 0 0;
}
body.layout-admin .athletes-stat-num,
body.admin-ui .athletes-stat-num {
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  color: #1a1a1a;
}
body.layout-admin .athletes-run-latest .athletes-stat-num,
body.admin-ui .athletes-run-latest .athletes-stat-num {
  font-size: 1.55rem;
}
body.layout-admin .athletes-source-mtime,
body.admin-ui .athletes-source-mtime {
  margin: 0.5rem 0 0;
  font-size: 0.78rem;
}
body.layout-admin .athletes-journal-sources,
body.admin-ui .athletes-journal-sources {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8125rem;
}
body.layout-admin .athletes-result-ok,
body.admin-ui .athletes-result-ok {
  font-weight: 600;
  color: #2f6b12;
}
body.layout-admin .athletes-result-fail,
body.admin-ui .athletes-result-fail {
  font-weight: 600;
  color: #8a1f1f;
}
body.layout-admin .athletes-journal-err,
body.admin-ui .athletes-journal-err {
  display: block;
  font-size: 0.75rem;
  margin-top: 0.15rem;
}
@media (max-width: 720px) {
  body.layout-admin .athletes-fed-grid,
  body.admin-ui .athletes-fed-grid {
    grid-template-columns: 1fr;
  }
  body.layout-admin .athletes-fed-stats,
  body.admin-ui .athletes-fed-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* TinyMCE mail editor — admin density (Previflone); append EOF */
body.layout-admin .tox-tinymce {
  border-radius: 8px;
  border-color: rgba(15, 28, 26, 0.18);
  margin: 0.35rem 0 0.75rem;
}
body.layout-admin .tox .tox-toolbar,
body.layout-admin .tox .tox-menubar {
  background: #fafafa;
}
body.layout-admin .tox .tox-edit-area__iframe {
  background: #ffffff;
}

/* Admin order detail — side actions (resend / status / suivi / delete) */
.order-admin-side-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  margin: 1rem 0 1.25rem;
}
.order-admin-side-actions > .panel {
  margin: 0;
  max-width: none;
}
.order-admin-side-actions > .panel > h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin: 0 0 0.55rem;
}
.order-admin-side-actions > .panel > .muted {
  margin: 0 0 0.45rem;
}
.order-admin-side-actions .check-row {
  margin-top: 0.55rem;
}
.order-admin-side-actions__submit {
  margin: 0.75rem 0 0;
}
.order-admin-side-actions__final {
  margin: 0;
  align-self: center;
}
.order-admin-suivi {
  list-style: none;
  margin: 0;
  padding: 0;
}
.order-admin-suivi > li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border, #e5e8e0);
}
.order-admin-suivi > li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.order-admin-suivi > li > p {
  margin: 0 0 0.15rem;
}
.order-admin-suivi__comment {
  margin: 0.3rem 0 0;
  white-space: pre-line;
}
@media (min-width: 1000px) {
  .order-admin-side-actions {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.75rem 1rem;
    align-items: start;
  }
  body.layout-admin .order-admin-side-actions > .panel,
  body.admin-ui .order-admin-side-actions > .panel {
    padding: 0.8rem 0.95rem;
  }
  body.layout-admin .order-admin-side-actions > .panel > h2,
  body.admin-ui .order-admin-side-actions > .panel > h2 {
    font-size: 1.02rem;
    margin: 0 0 0.4rem;
  }
  body.layout-admin .order-admin-side-actions label,
  body.admin-ui .order-admin-side-actions label {
    margin-top: 0.5rem;
    margin-bottom: 0.25rem;
  }
  body.layout-admin .order-admin-side-actions textarea,
  body.admin-ui .order-admin-side-actions textarea {
    min-height: 4.25rem;
  }
  body.layout-admin .order-admin-side-actions__submit,
  body.admin-ui .order-admin-side-actions__submit {
    margin-top: 0.6rem;
  }
}


/* —— GeARS wordmark on SeGEC chrome / discreet SeGEC footer —— */
.brand-mark {
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  color: var(--segec-teal);
}
.brand-sub {
  max-width: 18rem;
  line-height: 1.25;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.82rem;
  color: var(--ink-soft);
}
.lang-btn.is-active {
  background: var(--segec-teal);
  color: #fff;
  border-color: var(--segec-teal);
}
.site-footer {
  margin: 2.5rem auto 1.5rem;
  width: min(1220px, calc(100% - 2rem));
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
}
.site-footer-segec {
  height: 1.65rem;
  width: auto;
  opacity: 0.72;
  object-fit: contain;
}
.site-footer-label {
  font-size: 0.75rem;
  color: var(--ink-soft);
}
@media (min-width: 1400px) {
  .site-footer { width: min(1320px, calc(100% - 2.5rem)); }
}
