/* Histology Slide Portal — shared styles (LMU Medizin corporate design, concept A)
   Spec: docs/design-handoff-concept-a.md */

@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/vendor/roboto/roboto-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/vendor/roboto/roboto-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* brand */
  --accent: #00883A;         /* LMU Grün */
  --accent-hover: #005c40;   /* LMU Tannengrün */
  --accent-soft: #e2ecca;    /* Blassgrün */
  --accent-soft-2: #b0e2c1;  /* Salbeigrün */
  --accent-bright: #92d056;  /* LMU Hellgrün */
  /* neutrals */
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f4f6f5;
  --surface-hover: #eef5f0;
  --stage: #eef1ef;
  --border: #e3e8e5;
  --border-strong: #cfd6d2;
  --text: #1d1d1b;
  --muted: #5b6660;
  /* semantic */
  --warn: #e68200;           /* Orange — always with black text */
  --warn-soft: #fbe9d0;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --ok: #00883A;
  --info: #8BD2F2;           /* Hellblau */
  --ann-1: #00883A; --ann-2: #e68200; --ann-3: #59a3b1; --ann-4: #977eb5; --ann-5: #ee5997; --ann-6: #8BD2F2;
  /* shape */
  --radius: 6px;
  --radius-card: 8px;
  --radius-pill: 999px;
  --shadow-overlay: 0 2px 10px rgba(0, 0, 0, .12);
  --shadow-card-hover: 0 2px 10px rgba(0, 92, 64, .12);
  --space-page-x: 32px;
  --font: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; transition: color .12s ease-out; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 32px; font-weight: 400; color: var(--accent); line-height: 1.15; }
h2 { font-size: 18px; font-weight: 500; }
h3 { font-size: 15px; font-weight: 500; color: var(--accent); }
p { margin: 0 0 .8em; }
code, .mono { font-family: var(--mono); font-size: .9em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.pre { white-space: pre-wrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lead { font-size: 16px; font-weight: 300; margin: 0; }
.label { font-size: 13px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin: 0 0 10px; }

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

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

/* ---------- brand lockup ---------- */

/* Logo plus Einrichtungsname, as the CD manual couples them (5.3): the name sits
   below the wordmark in Roboto Regular, left-aligned with the wordmark (not the
   square), cap height 0.2 L, line height 1.2, at most 3 lines and no wider than 5 L.
   L is the height of the green square = the height of the logo file. The wordmark
   starts at 1.11 L in the official SVG; Roboto's cap height is 0.711 em, so a cap
   height of 0.2 L means a font size of 0.281 L. */
.brand {
  --logo-h: 44px;
  display: inline-flex; flex-direction: column; align-items: flex-start;
  gap: 0; flex: none; color: var(--text); text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand .logo { display: block; height: var(--logo-h); width: auto; }
.brand .brand-site {
  display: block; margin-left: calc(var(--logo-h) * 1.11); max-width: calc(var(--logo-h) * 5);
  /* cap top ~0.06 L under the square: line box starts 0.09 L above the caps (half-leading + ascender) */
  margin-top: calc(var(--logo-h) * -.03);
  font-size: calc(var(--logo-h) * .281); line-height: 1.2; font-weight: 400; color: var(--accent);
}

/* ---------- header, Fokusbalken, footer ---------- */

.topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 0 var(--space-page-x); height: 80px;
  background: var(--surface); /* no hairline: the Fokusbalken below is the separator */
  position: sticky; top: 0; z-index: 10;
}
.topbar .brand { --logo-h: 44px; }
.topbar .spacer { flex: 1; }
.topbar .search { flex: 1 1 320px; max-width: 560px; }
.topbar nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.topbar nav a, .topbar nav .navlink {
  display: inline-flex; align-items: center; padding: 10px 14px; border-radius: var(--radius);
  font-size: 15px; color: var(--text); text-decoration: none;
}
.topbar nav a:hover { background: var(--surface-hover); color: var(--accent-hover); }
.topbar nav a.active, .topbar nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-hover); font-weight: 500; }
.topbar .user { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: var(--accent-hover); color: #fff; font-weight: 500; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
}

/* Fokusbalken (CD manual 12), geometry from the PowerPoint master's footer bar: two
   segments whose ends point at each other and touch on the centre line, like the
   Fokuspunkt. Point depth 0.28 h; split at two thirds as in the master. Colours
   LMU Grün + Salbeigrün (never the same for both). Square ends: the bar bleeds off
   both page edges. */
.fokusbalken { --fb-h: 10px; display: flex; height: var(--fb-h); }
.fokusbalken > span:first-child {
  flex: 0 0 66.5%; background: var(--accent);
  clip-path: polygon(0 0, calc(100% - var(--fb-h) * .28) 0, 100% 50%, calc(100% - var(--fb-h) * .28) 100%, 0 100%);
}
.fokusbalken > span:last-child {
  flex: 1; background: var(--accent-soft-2);
  clip-path: polygon(calc(var(--fb-h) * .28) 0, 100% 0, 100% 100%, calc(var(--fb-h) * .28) 100%, 0 50%);
}

.container { max-width: 1280px; margin: 0 auto; padding: 28px var(--space-page-x) 40px; }
.page-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 14px var(--space-page-x); border-top: 1px solid var(--border); font-size: 13px; color: var(--muted);
}

/* ---------- surfaces ---------- */

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 20px;
}
.card.soft { background: var(--accent-soft); border-color: var(--accent-soft); }
.card.soft h3 { color: var(--accent-hover); }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; gap: 20px; }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* ---------- forms ---------- */

label { display: block; font-weight: 500; font-size: 14px; margin-bottom: 6px; }
.field { margin-bottom: 16px; }
.field .hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
input[type=text], input[type=password], input[type=search], input[type=number], input[type=date], textarea, select {
  width: 100%; font: inherit; color: inherit; font-size: 15px;
  height: 44px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface);
}
textarea { height: auto; min-height: 110px; padding: 12px; line-height: 1.5; resize: vertical; }
select { padding-right: 32px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
input.code { font-family: var(--mono); font-size: 1.4rem; letter-spacing: .3em; text-align: center; height: 52px; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
.checkbox { display: flex; align-items: center; gap: 10px; font-weight: 400; font-size: 14px; min-height: 28px; margin: 0; }
.checkbox input { width: 18px; height: 18px; margin: 0; }
.search-box { position: relative; }
.search-box svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
.search-box input { padding-left: 42px; }

button, .btn {
  font: inherit; font-weight: 500; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 16px; border-radius: var(--radius); cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  white-space: nowrap; text-decoration: none;
  transition: background-color .12s ease-out, border-color .12s ease-out, color .12s ease-out;
}
button:hover, .btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; padding: 0 18px; }
button.primary:hover, .btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
button.danger { color: var(--danger); border-color: #f1c4bf; }
button.danger:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
button.ghost, .btn.ghost { border-color: transparent; background: transparent; }
button.ghost:hover, .btn.ghost:hover { background: var(--surface-hover); border-color: transparent; color: var(--accent-hover); }
button.small, .btn.small { height: 36px; padding: 0 12px; font-size: 13px; }
button.icon, .btn.icon { width: 44px; padding: 0; border-color: transparent; background: transparent; }
button.icon:hover { background: var(--surface-hover); }
button.icon.small { width: 32px; height: 32px; }
button:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: default; pointer-events: none; }
button svg, .btn svg { width: 20px; height: 20px; flex: none; }

.problems { color: var(--danger); font-size: 13px; margin: 6px 0 0; padding-left: 18px; }
.problems:empty { display: none; }

/* ---------- chips, tags, pills, alerts ---------- */

.chips { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chip {
  height: 36px; padding: 0 14px; border-radius: var(--radius-pill); font-weight: 400; font-size: 14px;
}
.chip.active, .chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 500; }

.tag, .badge {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 4px;
  font-size: 12px; font-weight: 500; background: var(--accent-soft); color: var(--accent-hover); white-space: nowrap;
}
.badge { background: var(--surface-2); color: var(--muted); }
.badge.ok { background: var(--accent-soft); color: var(--accent-hover); }
.badge.strong { background: var(--accent-hover); color: #fff; }
.badge.warn { background: var(--warn); color: var(--text); }
.badge.info { background: var(--info); color: var(--text); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: var(--radius-pill); font-size: 13px; font-weight: 500; white-space: nowrap; }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--accent-soft); color: var(--accent-hover); }
.pill.ok::before { background: var(--accent); }
.pill.done { background: var(--accent-hover); color: #fff; }
.pill.done::before { background: var(--accent-bright); }
.pill.progress { background: var(--info); color: var(--text); }
.pill.attention { background: var(--warn); color: var(--text); }

.alert { padding: 14px 16px; border-radius: var(--radius-card); font-size: 14px; line-height: 1.45; }
.alert.warn { background: var(--warn-soft); color: var(--text); border-left: 4px solid var(--warn); }
.alert.danger { background: var(--danger-soft); color: #7a1a11; }
.alert.info { background: var(--accent-soft); color: var(--text); }

#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--accent-hover); color: #fff; padding: 10px 18px; border-radius: var(--radius-card);
  font-size: 14px; box-shadow: var(--shadow-overlay); z-index: 1000;
  opacity: 0; pointer-events: none; transition: opacity .15s;
}
#toast.show { opacity: 1; }
#toast.error { background: var(--danger); }

/* ---------- login ---------- */

.login-wrap { min-height: 100vh; display: flex; flex-wrap: wrap; background: var(--bg); }
.login-form-col {
  flex: 1 1 400px; max-width: 640px; min-width: 0;
  display: flex; flex-direction: column; padding: 40px 56px;
}
.login-form-col .brand { --logo-h: 48px; }
.login-card { max-width: 400px; margin: auto 0; padding: 48px 0; }
.login-card h1 { font-size: 36px; margin-bottom: 8px; }
.login-card .lead { font-size: 17px; margin-bottom: 24px; }
.login-card form button[type=submit] { height: 48px; }
.login-links { display: flex; gap: 20px; flex-wrap: wrap; font-size: 13px; }
.login-links a { color: var(--muted); }
/* Keyvisual as in the PowerPoint master's cover layouts: the vertical Fokuspunkt stands
   between the white surface (form column) and the LMU Grün surface. The SVG keeps its
   intrinsic ratio and is anchored to the left edge of the panel; everything right of the
   element shows the panel colour. */
.login-visual {
  flex: 999 1 400px; min-width: 0; min-height: 420px; position: relative; overflow: hidden;
  background: var(--accent) url("/static/keyvisual.svg") left top / auto 100% no-repeat;
}
.login-visual .claim {
  position: absolute; left: 50%; right: 48px; top: 56px;
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start; text-align: left; color: #fff;
}
.login-visual .claim b { font-size: 28px; font-weight: 400; line-height: 1.2; }
.login-visual .claim span { font-size: 14px; }
.qr { display: flex; justify-content: center; padding: 8px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-card); }
.qr svg { display: block; width: 240px; max-width: 100%; height: auto; }
.secret { font-family: var(--mono); font-size: 13px; word-break: break-all; background: var(--surface-2); padding: 8px; border-radius: var(--radius); }

@media (max-width: 900px) {
  .login-form-col { max-width: none; flex-basis: 100%; }
  .login-visual { flex-basis: 100%; min-height: 200px; }
  .login-visual .claim { top: auto; bottom: 32px; left: 40%; }
}
@media (max-width: 600px) {
  .login-form-col { padding: 28px 20px; }
  .login-visual { display: none; }
}

/* ---------- catalog (students) ---------- */

.catalog { display: flex; flex-wrap: wrap; min-height: calc(100vh - 86px); }
.catalog .filters {
  flex: 0 0 260px; padding: 28px 20px; border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 24px;
}
.catalog .content { flex: 999 1 560px; min-width: 0; padding: 28px var(--space-page-x) 40px; display: flex; flex-direction: column; gap: 24px; }
.navlist { display: flex; flex-direction: column; gap: 2px; }
.navlist a, .navlist button {
  display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px; border-radius: var(--radius);
  color: var(--text); font-size: 15px; font-weight: 400; text-decoration: none; border: 0; background: transparent; width: 100%; text-align: left; justify-content: flex-start;
}
.navlist a:hover, .navlist button:hover { background: var(--surface-hover); color: var(--accent-hover); text-decoration: none; }
.navlist .active, .navlist [aria-current="page"] { background: var(--accent-soft); color: var(--accent-hover); font-weight: 500; }
.navlist .count { margin-left: auto; font-size: 13px; color: var(--muted); font-weight: 400; }
.page-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.page-title h1 { margin: 0 0 6px; }
.page-title .lead { margin: 0; }

.topic { scroll-margin-top: 100px; }
.topic-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.topic-head h2 { margin: 0; }
.case-card {
  display: flex; flex-direction: column; color: inherit; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-card); overflow: hidden;
  transition: border-color .12s ease-out, box-shadow .12s ease-out;
}
.case-card:hover { text-decoration: none; color: inherit; border-color: var(--accent); box-shadow: var(--shadow-card-hover); }
.case-card .thumb { aspect-ratio: 4 / 3; background: var(--surface-2) center / cover no-repeat; display: block; width: 100%; object-fit: cover; }
.case-card .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.case-card .title { font-weight: 500; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.case-card .meta { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.empty { text-align: center; color: var(--muted); padding: 48px 20px; font-size: 20px; font-weight: 300; }
.empty.card { font-size: 15px; font-weight: 400; }

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

table.list { width: 100%; border-collapse: collapse; background: var(--surface); }
table.list th, table.list td { text-align: left; padding: 10px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; font-size: 14px; }
table.list th { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 500; background: var(--surface-2); }
table.list tr:last-child td { border-bottom: 0; }
table.list tbody tr:hover td { background: var(--surface-hover); }
table.list .thumb-cell img { width: 96px; height: 64px; object-fit: cover; border-radius: 4px; background: var(--surface-2); display: block; }
.table-wrap { border: 1px solid var(--border); border-radius: var(--radius-card); overflow: auto; }

.progress { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; min-width: 120px; }
.progress > div { height: 100%; background: var(--accent); transition: width .3s; }

/* ---------- modal ---------- */

.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 92, 64, .35); display: grid; place-items: center; z-index: 500; padding: 20px; }
.modal { background: var(--surface); border-radius: 14px; width: 100%; max-width: 560px; max-height: 90vh; overflow: auto; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.modal header { padding: 16px 20px; border-bottom: 1px solid var(--border); font-weight: 500; font-size: 15px; color: var(--accent); }
.modal .content { padding: 20px; }
.modal footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- staff console ---------- */

.console { display: grid; grid-template-columns: 260px 1fr; min-height: calc(100vh - 86px); }
.sidenav { background: var(--surface); border-right: 1px solid var(--border); padding: 28px 20px; }
.sidenav a {
  display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px; border-radius: var(--radius);
  color: var(--text); font-size: 15px; margin-bottom: 2px;
}
.sidenav a:hover { background: var(--surface-hover); color: var(--accent-hover); text-decoration: none; }
.sidenav a.active { background: var(--accent-soft); color: var(--accent-hover); font-weight: 500; }
.sidenav .sep { height: 1px; background: var(--border); margin: 16px 0; }
.main { padding: 28px var(--space-page-x) 60px; max-width: 1280px; min-width: 0; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { margin: 0; flex: 1; }
.stat { font-size: 30px; font-weight: 300; line-height: 1; margin-bottom: 6px; }
.stat-card { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; color: inherit; text-decoration: none; }
.stat-card:hover { border-color: var(--accent); text-decoration: none; color: inherit; }

.steps { display: flex; gap: 24px; flex-wrap: wrap; margin-bottom: 20px; }
.steps span { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.steps b { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 500; background: var(--border); color: var(--muted); }
.steps .done, .steps .active { color: var(--text); font-weight: 500; }
.steps .done b, .steps .active b { background: var(--accent); color: #fff; }

.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  min-height: 200px; border: 2px dashed var(--accent); border-radius: var(--radius-card); padding: 24px; text-align: center;
  background: #f4f9f5; color: var(--muted); transition: border-color .15s, background .15s;
}
.dropzone svg { width: 40px; height: 40px; color: var(--accent); }
.dropzone .dz-title { font-size: 17px; font-weight: 500; color: var(--accent-hover); }
.dropzone .dz-hint { font-size: 14px; }
.dropzone.over { border-style: solid; background: var(--accent-soft); }

.upload-queue { border: 1px solid var(--border); border-radius: var(--radius-card); overflow: hidden; }
.upload-queue .head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: 14px; font-weight: 500; flex-wrap: wrap; }
.upload-row { display: grid; grid-template-columns: 40px 1fr 200px 40px; gap: 14px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.upload-row:last-child { border-bottom: 0; }
.upload-row .kind { width: 40px; height: 30px; border-radius: 3px; background: var(--accent-soft); color: var(--accent-hover); font-size: 10px; font-weight: 500; display: flex; align-items: center; justify-content: center; }
.upload-row .name { font-size: 14px; font-weight: 500; }
.upload-row .meta { font-size: 12px; color: var(--muted); }
.upload-row .status { font-size: 12px; color: var(--muted); margin-top: 6px; }
.upload-row .status.ok { color: var(--accent); font-weight: 500; }
.upload-row .status.err { color: var(--danger); font-weight: 500; }
.upload-row.failed { background: var(--danger-soft); }

.slide-pick { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin-bottom: 6px; flex-wrap: wrap; }
.slide-pick img { width: 72px; height: 54px; object-fit: cover; border-radius: 4px; background: var(--surface-2); }
.slide-pick .grow { flex: 1; min-width: 140px; }
.case-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); align-items: start; }

/* ---------- responsive ---------- */

@media (max-width: 1279px) {
  .grid.cols-4 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}
@media (max-width: 1023px) {
  .catalog .filters { flex-basis: 100%; border-right: 0; border-bottom: 1px solid var(--border); flex-direction: row; flex-wrap: wrap; padding: 16px 20px; gap: 12px; }
  .catalog .filters .navlist { flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .catalog .filters .navlist a, .catalog .filters .navlist button { height: 36px; width: auto; border-radius: var(--radius-pill); border: 1px solid var(--border-strong); }
  .catalog .filters .navlist .active { border-color: var(--accent); }
  .catalog .filters .navlist svg { display: none; }
  .catalog .filters .count { margin-left: 6px; }
}
@media (max-width: 800px) {
  .console { grid-template-columns: 1fr; }
  .sidenav { display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); padding: 8px 12px; gap: 4px; }
  .sidenav a { margin: 0; white-space: nowrap; }
  .sidenav .sep { display: none; }
}
@media (max-width: 767px) {
  :root { --space-page-x: 20px; }
  .topbar { height: auto; min-height: 64px; padding-top: 10px; padding-bottom: 10px; gap: 8px 12px; flex-wrap: wrap; }
  .topbar .brand { --logo-h: 32px; }
  .topbar .brand-site { display: none; }
  .topbar .search { flex: 1 1 140px; order: 3; max-width: none; }
  .topbar nav { flex-wrap: wrap; justify-content: flex-end; }
  .topbar nav a { padding: 8px 10px; font-size: 14px; }
  .topbar nav button { height: 36px; padding: 0 10px; }
  .topbar .user span:not(.avatar) { display: none; }
  .main { padding: 20px var(--space-page-x) 40px; }
  .upload-row { grid-template-columns: 40px 1fr 40px; }
  .upload-row .prog { grid-column: 1 / -1; }
}

/* ---------------------------------------------------------------- language switch */
.lang-switch { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: var(--radius-pill); padding: 2px; margin-left: 8px; }
.lang-switch button {
  height: 26px; min-width: 34px; padding: 0 8px; border: 0; border-radius: var(--radius-pill); background: transparent;
  font-size: 12px; font-weight: 500; letter-spacing: .04em; color: var(--muted); cursor: pointer;
}
.lang-switch button:hover { background: var(--surface-hover); color: var(--accent-hover); }
.lang-switch button.active { background: var(--accent); color: #fff; }
.lang-switch.login-lang { position: fixed; right: 24px; bottom: 24px; z-index: 20; margin: 0; background: #fff; }
