/* Assessment Builder prototype — "gallery" screen (Settings › Assessment templates).
 * Every class is prefixed gal-. Colours are tokens only: hsl(var(--token)). */

/* ── Page head ─────────────────────────────────────────── */
.gal-head { margin-bottom: 16px; }
.gal-head-text { min-width: 0; flex: 1 1 420px; }

/* ── Tabs ──────────────────────────────────────────────── */
.gal-tabs .tabs { scrollbar-width: none; }
.gal-tabs .tabs::-webkit-scrollbar { display: none; }
.gal-tabs .tabs button { min-height: 40px; }
.gal-tabs .tabs button .badge { height: 20px; padding: 0 7px; font-variant-numeric: tabular-nums; }
.gal-tab-short { display: none; }
.gal-tabs .tabs button[aria-selected="true"] .badge { background: hsl(var(--primary-soft)); color: hsl(var(--primary-soft-foreground)); }

/* ── Toolbar: search + category chips ──────────────────── */
.gal-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin: 16px 0 10px; }
.gal-search { position: relative; flex: 0 1 340px; min-width: 0; }
.gal-search > .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: hsl(var(--muted-foreground)); pointer-events: none; }
.gal-search .input { height: 40px; padding-left: 34px; padding-right: 40px; background: hsl(var(--card)); }
.gal-search .input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.gal-search-kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.gal-search-clear { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.gal-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; flex: 1 1 320px; min-width: 0; }
.gal-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px 0 12px; border-radius: 999px;
  border: 1px solid hsl(var(--border-strong)); background: hsl(var(--card)); color: hsl(var(--foreground) / 0.85);
  font-size: 12.5px; font-weight: 550; white-space: nowrap; transition: background 120ms, border-color 120ms;
}
.gal-chip:hover { border-color: hsl(var(--primary) / 0.55); }
.gal-chip .icon { width: 13px; height: 13px; stroke-width: 2.4; }
.gal-chip[aria-pressed="true"] { background: hsl(var(--primary-soft)); border-color: hsl(var(--primary) / 0.55); color: hsl(var(--primary-soft-foreground)); }
.gal-chip-count { font-size: 11.5px; color: hsl(var(--muted-foreground)); min-width: 10px; text-align: center; }
.gal-chip[aria-pressed="true"] .gal-chip-count { color: inherit; opacity: 0.8; }
.gal-link {
  border: 0; background: none; padding: 4px 2px; min-height: 24px; color: hsl(var(--primary-soft-foreground)); font-weight: 600;
  font-size: 12.5px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: hsl(var(--primary) / 0.4);
}
.gal-link:hover { text-decoration-color: currentColor; }

.gal-metarow { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.gal-note { display: flex; align-items: flex-start; gap: 6px; margin: 0; font-size: 12.5px; color: hsl(var(--muted-foreground)); min-width: 0; flex: 1 1 360px; max-width: 80ch; }
.gal-note .icon { width: 14px; height: 14px; margin-top: 2px; }
.gal-count { margin: 0; font-size: 12.5px; color: hsl(var(--muted-foreground)); white-space: nowrap; font-weight: 550; }

/* ── Card grid: 3 / 2 / 1 columns by the space the page actually has ── */
.gal-gridwrap { container-type: inline-size; }
.gal-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@container (min-width: 600px) { .gal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (min-width: 940px) { .gal-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.gal-card {
  position: relative; display: flex; flex-direction: column; min-width: 0;
  background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) + 4px);
  transition: border-color 140ms, box-shadow 140ms;
}
.gal-card:hover { border-color: hsl(var(--border-strong)); box-shadow: 0 10px 28px -18px hsl(var(--shadow) / 0.45); z-index: 2; }
.gal-card:focus-within { z-index: 2; }
.gal-card.is-arrived { animation: gal-arrive 1.8s ease-out; }
.gal-card[data-retired="true"] { background: hsl(var(--muted) / 0.55); border-style: dashed; }
.gal-card[data-retired="true"] .gal-card-name { color: hsl(var(--foreground) / 0.75); }
.gal-card-body { display: flex; flex-direction: column; gap: 10px; padding: 16px 16px 14px; flex: 1; min-width: 0; }
.gal-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.gal-card-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.gal-card-name { margin: 0; font-size: 15px; line-height: 1.3; font-weight: 650; letter-spacing: -0.005em; min-width: 0; }
.gal-card-open {
  display: block; width: 100%; padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gal-card-open:focus-visible { outline: none; }
.gal-card-open::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; border-radius: calc(var(--radius) + 4px); }
.gal-card-open:focus-visible::after { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }
.gal-card-purpose {
  margin: 0; font-size: 13px; line-height: 1.5; color: hsl(var(--muted-foreground));
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.gal-card-note { display: flex; align-items: flex-start; gap: 6px; margin: 0; font-size: 12.5px; color: hsl(var(--foreground) / 0.78); }
.gal-card-note .icon { width: 13px; height: 13px; margin-top: 2px; color: hsl(var(--muted-foreground)); }
.gal-card-badges { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: auto; padding-top: 2px; }
.gal-card-foot {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 16px;
  border-top: 1px solid hsl(var(--border)); font-size: 12.5px; color: hsl(var(--muted-foreground)); line-height: 1.4;
}
.gal-seg { white-space: nowrap; }
.gal-card-go { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; color: hsl(var(--foreground) / 0.72); white-space: nowrap; transition: color 120ms; }
.gal-card-go .icon { width: 14px; height: 14px; transition: transform 140ms; }
.gal-card:hover .gal-card-go, .gal-card:focus-within .gal-card-go { color: hsl(var(--primary-soft-foreground)); }
.gal-card:hover .gal-card-go .icon { transform: translateX(2px); }

.gal-tile { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.gal-tile .icon { width: 18px; height: 18px; }
.gal-tile[data-origin="agency"] { background: hsl(var(--primary-soft)); color: hsl(var(--primary-soft-foreground)); }
.gal-tile[data-origin="library"] { background: hsl(var(--secondary-soft)); color: hsl(var(--secondary)); }
.gal-tile[data-origin="builtin"] { background: hsl(var(--muted)); color: hsl(var(--foreground) / 0.72); }
.gal-tile-lg { width: 44px; height: 44px; border-radius: 12px; }
.gal-tile-lg .icon { width: 20px; height: 20px; }
.gal-state { flex: none; }
.gal-state .dot { width: 7px; height: 7px; }

/* Licence badge + its popover (hover, focus or tap) */
.gal-lic { display: contents; }
.gal-lic-btn { position: relative; z-index: 2; height: 24px; cursor: help; background: hsl(var(--card)); }
.gal-lic-btn:hover, .gal-lic-btn[aria-expanded="true"] { border-color: hsl(var(--foreground) / 0.45); }
.gal-lic-btn .icon { color: hsl(var(--muted-foreground)); }
.gal-tip {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 5; display: flex; flex-direction: column; gap: 4px;
  padding: 10px 12px; border-radius: 8px; background: hsl(var(--foreground)); color: hsl(var(--background));
  font-size: 12.5px; line-height: 1.45; box-shadow: 0 14px 32px -12px hsl(var(--shadow) / 0.55); animation: fade 120ms ease-out;
}
.gal-tip strong { font-weight: 650; }
.gal-tip-meta { opacity: 0.78; font-size: 12px; }

/* "New template" door at the end of the agency grid */
.gal-new {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 6px; min-height: 196px; padding: 20px;
  border: 1.5px dashed hsl(var(--border-strong)); border-radius: calc(var(--radius) + 4px); background: transparent; text-align: left;
  color: hsl(var(--foreground)); transition: border-color 140ms, background 140ms;
}
.gal-new:hover { border-color: hsl(var(--primary) / 0.6); background: hsl(var(--primary-soft) / 0.6); }
.gal-new-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); margin-bottom: 4px; }
.gal-new-icon .icon { width: 18px; height: 18px; stroke-width: 2.2; }
.gal-new-title { font-size: 15px; font-weight: 650; }
.gal-new-sub { font-size: 13px; color: hsl(var(--muted-foreground)); max-width: 34ch; }

/* Skeleton */
.gal-skel { pointer-events: none; }
.gal-skel .gal-card-body { gap: 12px; }
.gal-skel-tile { width: 36px; height: 36px; border-radius: 10px; display: block; }
.gal-skel-chip { width: 88px; height: 22px; border-radius: 999px; display: block; }
.gal-skel-line { display: block; height: 12px; }

/* Empty search */
.gal-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 44px 20px; }
.gal-empty-icon { width: 44px; height: 44px; border-radius: 999px; display: grid; place-items: center; background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); margin-bottom: 4px; }
.gal-empty-icon .icon { width: 20px; height: 20px; }
.gal-empty h2 { margin: 0; font-size: 16px; line-height: 1.35; max-width: 48ch; overflow-wrap: anywhere; }
.gal-empty p { margin: 0; color: hsl(var(--muted-foreground)); max-width: 52ch; }
.gal-empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }
.gal-empty .gal-empty-else { margin-top: 6px; font-size: 13px; }

/* Requirement pack strip */
.gal-pack { display: flex; align-items: center; gap: 12px 14px; flex-wrap: wrap; padding: 14px 16px; margin-top: 20px; }
.gal-pack-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: hsl(var(--success-soft)); color: hsl(var(--success)); }
.gal-pack-text { flex: 1 1 260px; min-width: 0; }
.gal-pack-title { margin: 0; font-weight: 600; font-size: 13.5px; }
.gal-pack-sub { margin: 2px 0 0; font-size: 12.5px; color: hsl(var(--muted-foreground)); }

/* ── Preview sheet ─────────────────────────────────────── */
.gal-scrim { position: fixed; inset: 0; z-index: 49; background: hsl(var(--shadow) / 0.42); animation: fade 140ms ease-out; }
.gal-sheet { width: min(640px, 100%); }
.gal-sheet-head { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px 16px; border-bottom: 1px solid hsl(var(--border)); }
.gal-sheet-titlerow { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.gal-sheet-titles { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.gal-sheet-title { margin: 0; font-size: 18px; line-height: 1.25; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.gal-sheet-title:focus { outline: none; }
.gal-sheet-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.gal-sheet-desc { margin: 0; font-size: 13.5px; line-height: 1.5; color: hsl(var(--foreground) / 0.85); }
.gal-sheet-meta { margin: 0; font-size: 12.5px; color: hsl(var(--muted-foreground)); }

.gal-callout { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 10px 12px; border-radius: 8px; font-size: 13px; line-height: 1.45; border: 1px solid hsl(var(--border)); background: hsl(var(--muted) / 0.6); }
.gal-callout .icon { margin-top: 1px; color: hsl(var(--muted-foreground)); }
.gal-callout.is-warning { background: hsl(var(--warning-soft)); border-color: hsl(var(--warning) / 0.35); }
.gal-callout.is-warning .icon { color: hsl(var(--warning)); }
.gal-callout.is-sample { background: hsl(var(--secondary-soft)); border-color: hsl(var(--secondary) / 0.35); }
.gal-callout.is-sample .icon { color: hsl(var(--secondary)); }

.gal-sheet-body {
  position: relative; flex: 1; min-height: 0; overflow: auto; background: hsl(var(--surface));
  display: grid; grid-template-columns: 176px minmax(0, 1fr); align-items: start;
}
.gal-sheet-nav { position: sticky; top: 0; display: flex; flex-direction: column; gap: 2px; padding: 16px 8px 16px 14px; }
.gal-sheet-navlabel { margin: 0 0 4px; padding: 0 8px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 650; color: hsl(var(--muted-foreground)); }
.gal-sheet-nav button {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 34px; padding: 6px 8px; border: 0; border-radius: 6px;
  background: none; text-align: left; font-size: 13px; color: hsl(var(--foreground) / 0.8); line-height: 1.3;
}
.gal-sheet-nav button:hover { background: hsl(var(--muted)); }
.gal-sheet-nav button[aria-current="true"] { background: hsl(var(--card)); color: hsl(var(--foreground)); font-weight: 600; box-shadow: inset 2px 0 0 hsl(var(--primary)), 0 0 0 1px hsl(var(--border)); }
.gal-sheet-navtitle { flex: 1; min-width: 0; }
.gal-sheet-navcount { font-size: 11.5px; color: hsl(var(--muted-foreground)); font-weight: 500; }

.gal-preview { display: flex; flex-direction: column; gap: 18px; padding: 16px 20px 28px 8px; min-width: 0; }
.gal-preview-banner { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 12.5px; color: hsl(var(--muted-foreground)); }
.gal-preview-banner .icon { width: 14px; height: 14px; }
.gal-sec { display: flex; flex-direction: column; gap: 10px; scroll-margin-top: 12px; }
.gal-sec-head h3 { margin: 0; font-size: 14px; font-weight: 650; }
.gal-sec-head p { margin: 2px 0 0; font-size: 12.5px; color: hsl(var(--muted-foreground)); }
.gal-q { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 10px; border: 1px solid hsl(var(--border)); background: hsl(var(--card)); min-width: 0; }
.gal-q-head { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.gal-q-num {
  flex: none; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 6px; display: grid; place-items: center;
  background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); font-size: 11.5px; font-weight: 650; font-variant-numeric: tabular-nums;
}
.gal-q-num .icon { width: 13px; height: 13px; }
.gal-q-titles { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.gal-q-label { margin: 0; font-size: 13.5px; font-weight: 600; line-height: 1.4; }
.gal-q-req { margin-left: 8px; font-size: 11px; font-weight: 550; color: hsl(var(--muted-foreground)); white-space: nowrap; }
.gal-q-help { margin: 0; font-size: 12.5px; color: hsl(var(--muted-foreground)); line-height: 1.45; }
.gal-q-system { margin-top: 2px; }
.gal-q-review { display: flex; align-items: flex-start; gap: 6px; margin: 0; padding: 8px 10px; border-radius: 8px; background: hsl(var(--warning-soft)); font-size: 12.5px; line-height: 1.4; }
.gal-q-review .icon { color: hsl(var(--warning)); width: 14px; height: 14px; margin-top: 1px; }
.gal-q-ai { margin: 0; font-weight: 550; font-size: 12px; }
.gal-q-ai .icon { width: 13px; height: 13px; }

.gal-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.gal-opt {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px 12px 6px 10px; max-width: 100%;
  border: 1px solid hsl(var(--border-strong)); border-radius: 8px; background: hsl(var(--card)); font-size: 13px; line-height: 1.3;
}
.gal-opt-label { min-width: 0; flex: 1; }
.gal-opts.is-list { flex-direction: column; align-items: stretch; }
.gal-opt-mark { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid hsl(var(--border-strong)); display: grid; place-items: center; flex: none; }
.gal-opt-mark.is-square { border-radius: 4px; }
.gal-opt-mark .icon { width: 11px; height: 11px; stroke-width: 2.8; }
.gal-opt-pts { font-size: 11.5px; color: hsl(var(--muted-foreground)); font-variant-numeric: tabular-nums; white-space: nowrap; }
.gal-opt.is-quiet { border-style: dashed; color: hsl(var(--muted-foreground)); }
.gal-opt.is-quiet .gal-opt-mark { border-style: dashed; }
.gal-opt.is-on { border-color: hsl(var(--primary)); background: hsl(var(--primary-soft)); color: hsl(var(--primary-soft-foreground)); font-weight: 600; }
.gal-opt.is-on .gal-opt-mark { background: hsl(var(--primary)); border-color: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.gal-tight { gap: 8px; }
.gal-follow { display: flex; align-items: flex-start; gap: 6px; margin: 0; padding-left: 10px; border-left: 2px solid hsl(var(--border-strong)); font-size: 12.5px; color: hsl(var(--muted-foreground)); }
.gal-follow .icon { width: 14px; height: 14px; margin-top: 1px; }
.gal-follow b { color: hsl(var(--foreground)); font-weight: 600; }

.gal-faux {
  display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 7px 10px; border-radius: calc(var(--radius) - 1px);
  border: 1px solid hsl(var(--border-strong)); background: hsl(var(--muted) / 0.35); font-size: 13px; color: hsl(var(--muted-foreground)); min-width: 0;
}
.gal-faux.is-multi { min-height: 64px; align-items: flex-start; }
.gal-faux.is-small { min-height: 32px; padding: 5px 9px; font-size: 12.5px; }
.gal-faux.is-filled { color: hsl(var(--foreground)); background: hsl(var(--card)); }
.gal-faux .icon { width: 14px; height: 14px; }
.gal-faux-text { flex: 1; min-width: 0; }
.gal-faux-unit { font-size: 12px; color: hsl(var(--muted-foreground)); white-space: nowrap; }
.gal-q[data-type="number"] .gal-faux, .gal-q[data-type="date"] .gal-faux { max-width: 220px; }

.gal-ext { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.gal-ext-f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: hsl(var(--foreground) / 0.8); min-width: 0; }

.gal-table-wrap { overflow-x: auto; margin: 0 -2px; padding: 0 2px; }
.gal-table { width: 100%; min-width: 380px; border-collapse: collapse; font-size: 12.5px; }
.gal-table th, .gal-table td { padding: 6px 6px; text-align: left; vertical-align: middle; border-bottom: 1px solid hsl(var(--border)); }
.gal-table thead th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: hsl(var(--muted-foreground)); font-weight: 650; }
.gal-table tbody th { font-weight: 550; width: 34%; }
.gal-table tbody tr:last-child th, .gal-table tbody tr:last-child td { border-bottom: 0; }
.gal-table td:last-child, .gal-table thead th:last-child { width: 48px; text-align: center; }
.gal-box { width: 18px; height: 18px; border-radius: 4px; border: 1.5px solid hsl(var(--border-strong)); display: inline-grid; place-items: center; vertical-align: middle; }
.gal-box .icon { width: 12px; height: 12px; stroke-width: 2.8; }
.gal-box.is-on { background: hsl(var(--danger)); border-color: hsl(var(--danger)); color: hsl(var(--primary-foreground)); }

.gal-check { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.gal-check li { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; padding: 8px 0; border-bottom: 1px solid hsl(var(--border)); }
.gal-check li:first-child { padding-top: 0; }
.gal-check li:last-child { border-bottom: 0; padding-bottom: 0; }
.gal-check-label { flex: 1 1 180px; min-width: 0; font-size: 13px; }
.gal-check-marks { display: flex; flex-wrap: wrap; gap: 4px; }
.gal-mini {
  display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 550;
  border: 1px solid hsl(var(--border-strong)); color: hsl(var(--muted-foreground)); background: hsl(var(--card)); white-space: nowrap;
}
.gal-mini .icon { width: 12px; height: 12px; stroke-width: 2.6; }
.gal-mini.is-on { background: hsl(var(--success-soft)); border-color: hsl(var(--success) / 0.5); color: hsl(var(--success)); }
.gal-mini.is-on.is-concern { background: hsl(var(--danger-soft)); border-color: hsl(var(--danger) / 0.5); color: hsl(var(--danger)); }

.gal-score { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 8px; background: hsl(var(--muted) / 0.5); }
.gal-score-from { margin: 0; font-size: 12.5px; color: hsl(var(--muted-foreground)); }
.gal-bands { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.gal-bands li { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px; background: hsl(var(--card)); border: 1px solid hsl(var(--border)); font-size: 12.5px; }
.gal-band-range { padding: 1px 7px; border-radius: 999px; background: hsl(var(--muted)); font-weight: 650; font-size: 11.5px; }
.gal-drop {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 64px; padding: 10px; border-radius: 8px;
  border: 1.5px dashed hsl(var(--border-strong)); color: hsl(var(--muted-foreground)); font-size: 12.5px; text-align: center;
}
.gal-more { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 12px; border-radius: 8px; border: 1px dashed hsl(var(--border-strong)); font-size: 12.5px; color: hsl(var(--muted-foreground)); }
.gal-more .icon { width: 14px; height: 14px; }

.gal-sheet-foot { display: flex; flex-direction: column; gap: 12px; padding: 14px 20px 16px; border-top: 1px solid hsl(var(--border)); background: hsl(var(--card)); }
.gal-attr { display: flex; align-items: flex-start; gap: 8px; margin: 0; font-size: 12.5px; line-height: 1.45; color: hsl(var(--foreground) / 0.8); }
.gal-attr .icon { width: 14px; height: 14px; margin-top: 2px; color: hsl(var(--muted-foreground)); }
.gal-attr b { font-weight: 650; color: hsl(var(--foreground)); }
.gal-attr-holder { color: hsl(var(--muted-foreground)); }
.gal-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.gal-spacer { flex: 1; }
.gal-sheet-foot .btn { min-height: 40px; }
.gal-sheet-foot .btn-primary { min-height: 44px; }
.gal-confirm { display: flex; flex-direction: column; gap: 8px; animation: fade 140ms ease-out; }
.gal-confirm-title { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 650; font-size: 14px; }
.gal-confirm-title .icon { color: hsl(var(--danger)); }
.gal-confirm-body { margin: 0; font-size: 13px; line-height: 1.5; color: hsl(var(--foreground) / 0.82); }
.gal-btn-danger-solid { background: hsl(var(--danger)); border-color: hsl(var(--danger)); color: hsl(var(--primary-foreground)); min-height: 44px; }
.gal-btn-danger-solid:hover { background: hsl(var(--danger) / 0.9); }

@keyframes gal-arrive {
  0% { box-shadow: 0 0 0 3px hsl(var(--primary) / 0.45); background: hsl(var(--primary-soft)); }
  100% { box-shadow: 0 0 0 0 hsl(var(--primary) / 0); background: hsl(var(--card)); }
}

/* ── Narrow widths ─────────────────────────────────────── */
@media (max-width: 640px) {
  .gal-head .actions { margin-left: 0; width: 100%; }
  .gal-head .gal-new-btn { flex: 1; height: 44px; }
  .gal-search { flex: 1 1 100%; }
  .gal-search .input { height: 44px; }
  .gal-chips { flex-basis: 100%; }
  .gal-chip { height: 36px; }
  .gal-count { order: -1; }
  .gal-tabs .tabs button { padding: 9px 10px; }
  .gal-tabs .tabs button .icon { display: none; }
  .gal-tab-full { display: none; }
  .gal-tab-short { display: inline; }
  .gal-new { min-height: 140px; }
  .gal-pack > .btn { width: 100%; height: 40px; }

  .gal-sheet-head { padding: 14px 16px 12px; }
  .gal-sheet-titlerow .gal-tile-lg { display: none; }
  .gal-sheet-body { display: block; }
  .gal-sheet-nav {
    z-index: 1; flex-direction: row; gap: 4px; overflow-x: auto; padding: 8px 12px; background: hsl(var(--surface) / 0.96);
    border-bottom: 1px solid hsl(var(--border)); scrollbar-width: none;
  }
  .gal-sheet-nav::-webkit-scrollbar { display: none; }
  .gal-sheet-navlabel { display: none; }
  .gal-sheet-nav button { width: auto; flex: none; white-space: nowrap; min-height: 36px; border-radius: 999px; padding: 6px 12px; }
  .gal-sheet-nav button[aria-current="true"] { box-shadow: 0 0 0 1px hsl(var(--primary) / 0.5); }
  .gal-preview { padding: 14px 16px 24px; }
  .gal-sec { scroll-margin-top: 64px; }
  .gal-ext { grid-template-columns: minmax(0, 1fr); }
  .gal-sheet-foot { padding: 12px 16px 16px; }
  .gal-actions .btn { flex: 1 1 auto; }
  .gal-actions .gal-spacer { display: none; }
}
.gal-unpub .dot { width: 7px; height: 7px; }
.gal-sheet-title:focus { outline: none; }
