/* ==========================================================================
   MCA Compliance — "Professional Ledger" design system
   Data-dense, Swiss-discipline dashboard. IBM Plex Sans/Mono (self-hosted).
   Semantic color is reserved for compliance status: red = overdue,
   amber = due soon, green = filed/ok. One accent (trust blue). No gradients,
   no glass — restraint is the aesthetic.
   Themes: light default, dark via [data-theme=dark] or prefers-color-scheme.
   ========================================================================== */

/* ---- Fonts (latin subsets, web/static/fonts/) --------------------------- */
@font-face {
  font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400;
  font-display: swap; src: url("/static/fonts/ibm-plex-sans-400.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500;
  font-display: swap; src: url("/static/fonts/ibm-plex-sans-500.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600;
  font-display: swap; src: url("/static/fonts/ibm-plex-sans-600.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans"; font-style: normal; font-weight: 700;
  font-display: swap; src: url("/static/fonts/ibm-plex-sans-700.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400;
  font-display: swap; src: url("/static/fonts/ibm-plex-mono-400.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500;
  font-display: swap; src: url("/static/fonts/ibm-plex-mono-500.woff2") format("woff2");
}

/* ---- Design tokens ------------------------------------------------------ */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #eef1f6;
  --text: #101828;
  --muted: #5d6675;
  --line: #e3e8ef;
  --line-strong: #cdd5e0;

  --primary: #1d4ed8;
  --primary-strong: #1e40af;
  --primary-soft: #eaf0fe;
  --on-primary: #ffffff;

  --danger: #b42318;
  --danger-soft: #fef3f2;
  --danger-line: #f6c8c3;
  --warn: #b54708;
  --warn-soft: #fffaeb;
  --ok: #067647;
  --ok-soft: #eefaf3;

  --shadow-1: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-2: 0 4px 12px rgba(16, 24, 40, 0.08);
  --radius: 10px;
  --radius-sm: 7px;
  --font-sans: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", Consolas, monospace;
}

[data-theme="dark"] {
  --bg: #0b1220;
  --surface: #111a2b;
  --surface-2: #192338;
  --text: #e5eaf3;
  --muted: #939dae;
  --line: #223048;
  --line-strong: #33425e;

  --primary: #6d9ef8;
  --primary-strong: #8fb4fa;
  --primary-soft: #16233f;
  --on-primary: #0b1220;

  --danger: #f28b82;
  --danger-soft: #2a1717;
  --danger-line: #4d2626;
  --warn: #fbc054;
  --warn-soft: #2a2113;
  --ok: #5fd39a;
  --ok-soft: #12271d;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 4px 14px rgba(0, 0, 0, 0.5);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220;
    --surface: #111a2b;
    --surface-2: #192338;
    --text: #e5eaf3;
    --muted: #939dae;
    --line: #223048;
    --line-strong: #33425e;

    --primary: #6d9ef8;
    --primary-strong: #8fb4fa;
    --primary-soft: #16233f;
    --on-primary: #0b1220;

    --danger: #f28b82;
    --danger-soft: #2a1717;
    --danger-line: #4d2626;
    --warn: #fbc054;
    --warn-soft: #2a2113;
    --ok: #5fd39a;
    --ok-soft: #12271d;

    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-2: 0 4px 14px rgba(0, 0, 0, 0.5);
  }
}

/* ---- Base --------------------------------------------------------------- */
* { box-sizing: border-box; }
html { font-size: 14px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 1rem/1.55 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-strong); text-decoration: underline; text-underline-offset: 2px; }
code {
  font-family: var(--font-mono); font-size: 0.88em;
  background: var(--surface-2); padding: 0.1rem 0.35rem; border-radius: 5px;
}
.mono { font-family: var(--font-mono); font-size: 0.92em; letter-spacing: -0.01em; }
.muted { color: var(--muted); }
.danger { color: var(--danger); font-weight: 600; }
.warn { color: var(--warn); font-weight: 600; }
.ok { color: var(--ok); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

.ico {
  width: 15px; height: 15px; flex: none;
  stroke: currentColor; stroke-width: 2; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
  vertical-align: -2px;
}

/* ---- Top bar ------------------------------------------------------------ */
.topbar {
  display: flex; align-items: center; gap: 1.25rem;
  background: var(--surface); border-bottom: 1px solid var(--line);
  padding: 0 1.25rem; height: 54px;
  position: sticky; top: 0; z-index: 50;
}
.brand { display: flex; align-items: center; gap: 0.65rem; min-width: 0; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px; flex: none; border-radius: 8px;
  background: var(--primary); color: var(--on-primary);
  display: grid; place-items: center;
  font-weight: 700; font-size: 0.85rem; letter-spacing: 0.02em;
}
.brand-logo { background: none; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-firm {
  color: var(--text); font-weight: 600; font-size: 0.93rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-tool {
  color: var(--muted); font-size: 0.7rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.08em; white-space: nowrap;
}
.nav {
  display: flex; align-items: center; gap: 0.15rem;
  overflow-x: auto; scrollbar-width: none; flex: 1;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  color: var(--muted); font-size: 0.93rem; font-weight: 500;
  padding: 0.38rem 0.72rem; border-radius: var(--radius-sm);
  white-space: nowrap; transition: background 160ms, color 160ms;
}
.nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav a.active { color: var(--primary); background: var(--primary-soft); font-weight: 600; }
[data-theme="dark"] .nav a.active { color: var(--primary-strong); }
.topbar-actions { display: flex; align-items: center; gap: 0.25rem; margin-left: auto; }
.icon-btn {
  display: grid; place-items: center; width: 34px; height: 34px;
  border: none; border-radius: var(--radius-sm); background: transparent;
  color: var(--muted); cursor: pointer; transition: background 160ms, color 160ms;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.icon-btn .ico { width: 17px; height: 17px; }
.theme-icon-sun { display: none; }
[data-theme="dark"] .theme-icon-sun { display: block; }
[data-theme="dark"] .theme-icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-icon-moon { display: none; }
}

/* ---- Layout ------------------------------------------------------------- */
main { max-width: 1180px; margin: 1.4rem auto 3rem; padding: 0 1.25rem; }
h1 {
  font-size: 1.38rem; font-weight: 650; letter-spacing: -0.015em;
  margin: 0.2rem 0 1rem;
}
h1 .muted { font-size: 0.95rem; font-weight: 400; letter-spacing: 0; }
h2 {
  font-size: 0.78rem; font-weight: 650; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--muted);
  margin: 1.9rem 0 0.6rem; display: flex; align-items: center; gap: 0.4rem;
}
h2.danger { color: var(--danger); }

/* ---- Stat cards ---------------------------------------------------------- */
.stat-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.8rem; margin: 1rem 0 1.6rem; max-width: 620px;
}
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 0.75rem 1rem;
  box-shadow: var(--shadow-1);
}
.stat > div:last-child {
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--muted); margin-top: 0.1rem;
}
.stat-num {
  font-size: 1.75rem; font-weight: 700; line-height: 1.15;
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
}
.stat-bad { border-color: var(--danger-line); background: var(--danger-soft); }
.stat-bad .stat-num, .stat-bad > div:last-child { color: var(--danger); }

/* ---- Tables ---------------------------------------------------------------- */
.table-wrap {
  overflow-x: auto; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-1); margin: 0.4rem 0 1rem;
}
table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 0.42rem 0.75rem; text-align: left;
  border-bottom: 1px solid var(--line); font-size: 0.95rem;
}
td { font-variant-numeric: tabular-nums; }
th {
  background: var(--surface-2); color: var(--muted);
  font-weight: 600; font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.06em;
  white-space: nowrap;
}
tr:last-child td { border-bottom: none; }
tr:not(:has(th)):hover td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.row-overdue td { background: var(--danger-soft); }
.row-overdue td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.row-overdue:hover td { background: var(--danger-soft); }

/* ---- Chips & status ----------------------------------------------------------- */
.chip {
  display: inline-block; font-size: 0.72rem; font-weight: 600;
  padding: 0.1rem 0.55rem; border-radius: 999px;
  background: var(--surface-2); color: var(--muted);
  letter-spacing: 0.02em; white-space: nowrap;
}
.chip-mca { background: var(--primary-soft); color: var(--primary); }
[data-theme="dark"] .chip-mca { color: var(--primary-strong); }
.chip-tax { background: var(--warn-soft); color: var(--warn); }
.chip-meeting { background: var(--ok-soft); color: var(--ok); }
.chip-dsc { background: #f3e8ff; color: #7e22ce; }
[data-theme="dark"] .chip-dsc { background: #271a35; color: #c4a1e8; }
.chip-type-filing { background: #e0f2fe; color: #075985; }
[data-theme="dark"] .chip-type-filing { background: #12293a; color: #7cc4ea; }
.chip-type-payment { background: #fae8ff; color: #86198f; }
[data-theme="dark"] .chip-type-payment { background: #2c1730; color: #dd9ce6; }
.chip-type-internal { background: var(--surface-2); color: var(--muted); }
.critical-badge { color: var(--danger); font-weight: 700; margin-left: 0.15rem; }

.status {
  display: inline-flex; align-items: center; gap: 0.38rem;
  font-size: 0.85rem; font-weight: 600; white-space: nowrap;
}
.status::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: currentColor; flex: none;
}
.status-pending { color: var(--muted); }
.status-in_progress { color: var(--primary); }
[data-theme="dark"] .status-in_progress { color: var(--primary-strong); }
.status-filed, .status-verified { color: var(--ok); }
.status-overdue { color: var(--danger); }
.status-not_applicable { color: var(--muted); opacity: 0.7; }
.status-not_applicable::before { background: transparent; border: 1.5px solid currentColor; }

/* ---- Buttons -------------------------------------------------------------------- */
.btn, button[type="submit"] {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--primary); color: var(--on-primary) !important;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 0.42rem 0.9rem; font: 600 0.9rem/1.3 var(--font-sans);
  cursor: pointer; text-decoration: none;
  transition: background 160ms, box-shadow 160ms;
}
.btn:hover, button[type="submit"]:hover {
  background: var(--primary-strong); text-decoration: none; box-shadow: var(--shadow-1);
}
.btn-outline {
  background: transparent; color: var(--primary) !important;
  border-color: var(--line-strong);
}
.btn-outline:hover { background: var(--primary-soft); border-color: var(--primary); box-shadow: none; }
[data-theme="dark"] .btn-outline { color: var(--primary-strong) !important; }
.btn-sm {
  cursor: pointer; color: var(--primary) !important; font-size: 0.85rem; font-weight: 500;
  list-style: none; user-select: none; background: none !important; border: none;
}
[data-theme="dark"] .btn-sm { color: var(--primary-strong) !important; }
.btn-sm:hover { text-decoration: underline; text-underline-offset: 2px; }

/* Icon-only action buttons (Documents Library) — color comes entirely from
   theme-aware custom properties, so there's no separate dark-mode override
   to drift out of sync with a background/text pairing set elsewhere. */
.icon-action {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: var(--radius-sm);
  color: var(--muted); background: transparent; border: none; padding: 0;
  cursor: pointer; transition: background 120ms, color 120ms;
}
.icon-action .ico { width: 16px; height: 16px; }
.icon-action:hover { background: var(--surface-2); color: var(--primary); }
.icon-action.danger:hover { background: var(--danger-soft); color: var(--danger); }

.status-dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  vertical-align: middle;
}
.status-dot.draft { background: var(--warn); }
.status-dot.signed { background: var(--ok); }

.preview-doc {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-1); padding: 2rem 2.5rem; max-width: 800px;
  font-family: "Segoe UI", var(--font-sans); color: var(--text); line-height: 1.5;
}
.preview-doc table { border-collapse: collapse; margin: 0.75rem 0; }
.preview-doc table td, .preview-doc table th { border: 1px solid var(--line-strong); padding: 0.4rem 0.6rem; }
.preview-doc p { margin: 0 0 0.75rem; }
details[open] .btn-sm { font-weight: 600; }
details > summary::-webkit-details-marker { display: none; }

/* ---- Forms ------------------------------------------------------------------------ */
input, select, textarea {
  font-family: var(--font-sans); color: var(--text);
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); padding: 0.42rem 0.65rem; font-size: 0.95rem;
  transition: border-color 160ms, box-shadow 160ms;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}
::placeholder { color: var(--muted); opacity: 0.75; }
.panel-form, .form-grid {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow-1);
}
.panel-form label, .form-grid label {
  display: block; font-size: 0.8rem; font-weight: 500; color: var(--muted);
  margin-bottom: 0.9rem;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 2rem; }
.panel-form input, .form-grid input {
  display: block; width: 100%; margin-top: 0.25rem;
}
table input { margin: 0; padding: 0.25rem 0.5rem; width: 100%; }
.inline-form { display: flex; gap: 0.3rem; }
.inline-form select, .inline-form button {
  font-size: 0.8rem; padding: 0.2rem 0.45rem;
}
.inline-form button {
  cursor: pointer; background: var(--primary); color: var(--on-primary);
  border: none; border-radius: 5px; font-weight: 600;
  transition: background 160ms;
}
.inline-form button:hover { background: var(--primary-strong); }
.error {
  color: var(--danger); background: var(--danger-soft);
  border: 1px solid var(--danger-line); border-left: 3px solid var(--danger);
  border-radius: var(--radius-sm); padding: 0.55rem 0.8rem; font-size: 0.92rem;
}

/* Alert lines (ok / warn paragraphs) */
p.ok, p.warn {
  display: flex; align-items: center; gap: 0.45rem;
  border-radius: var(--radius-sm); padding: 0.5rem 0.8rem;
  font-weight: 500; font-size: 0.93rem; max-width: max-content;
}
p.ok { background: var(--ok-soft); }
p.warn { background: var(--warn-soft); }

/* ---- Meta grid (company detail) ------------------------------------------------------ */
.meta-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem 2.2rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1rem 1.25rem; box-shadow: var(--shadow-1);
  font-size: 0.95rem;
}
.meta-grid .span-2 { grid-column: span 2; }
.meta-grid .muted {
  display: inline-block; min-width: 130px;
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
}

/* ---- Calendar -------------------------------------------------------------------------- */
.cal-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.cal-nav { display: flex; gap: 0.9rem; font-size: 0.93rem; font-weight: 500; }
.cal-filters {
  display: flex; gap: 0.6rem; align-items: center; margin: 0.8rem 0 1.2rem; flex-wrap: wrap;
}
.cal-filters select { padding: 0.35rem 0.5rem; font-size: 0.9rem; }
.cal-grid { table-layout: fixed; min-width: 660px; }
.cal-grid th { text-align: center; }
.cal-cell { vertical-align: top; height: 92px; padding: 0.3rem 0.35rem; }
.cal-date {
  font-size: 0.78rem; font-weight: 600; color: var(--muted);
  font-variant-numeric: tabular-nums; margin-bottom: 0.2rem;
}
.cal-other { background: color-mix(in srgb, var(--surface-2) 40%, transparent); }
.cal-other .cal-date { opacity: 0.45; font-weight: 400; }
.cal-today { box-shadow: inset 0 0 0 2px var(--primary); }
.cal-today .cal-date { color: var(--primary); font-weight: 700; }
[data-theme="dark"] .cal-today .cal-date { color: var(--primary-strong); }
.cal-event {
  display: block; font-size: 0.74rem; font-weight: 500; line-height: 1.35;
  margin-bottom: 2px; padding: 0.06rem 0.4rem; border-radius: 5px;
  text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: var(--surface-2); color: var(--text);
  transition: filter 160ms;
}
.cal-event:hover { text-decoration: none; filter: brightness(0.94); }
[data-theme="dark"] .cal-event:hover { filter: brightness(1.18); }
.cal-event.chip-MCA { background: var(--primary-soft); color: var(--primary); }
[data-theme="dark"] .cal-event.chip-MCA { color: var(--primary-strong); }
.cal-event.chip-Tax { background: var(--warn-soft); color: var(--warn); }
.cal-event.chip-Meeting { background: var(--ok-soft); color: var(--ok); }
.cal-event.chip-DSC { background: #f3e8ff; color: #7e22ce; }
[data-theme="dark"] .cal-event.chip-DSC { background: #271a35; color: #c4a1e8; }
.cal-event .cal-co { color: inherit; opacity: 0.65; }
.cal-overdue { box-shadow: inset 0 0 0 1px var(--danger); font-weight: 600; }

/* ---- Progress (tracker) ------------------------------------------------------------------ */
.progress-list {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 0.8rem 1.25rem; margin-bottom: 1.2rem;
  box-shadow: var(--shadow-1);
}
.progress-item {
  display: grid; grid-template-columns: 200px 1fr 170px;
  gap: 1rem; align-items: center; padding: 0.32rem 0;
}
.progress-item > a { font-weight: 500; }
.progress-item .muted { font-variant-numeric: tabular-nums; font-size: 0.88rem; }
.bar { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--ok); border-radius: 4px; transition: width 300ms ease; }
.bar-warn { background: var(--warn); }

.file-form {
  display: flex; flex-direction: column; gap: 0.35rem; margin-top: 0.45rem;
  padding: 0.6rem; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--radius-sm); min-width: 185px;
}
.file-form input { font-size: 0.8rem; padding: 0.28rem 0.45rem; margin: 0; background: var(--surface); }
.file-form button {
  cursor: pointer; background: var(--ok); color: #fff; border: none;
  border-radius: 5px; padding: 0.32rem; font-size: 0.8rem; font-weight: 600;
  transition: filter 160ms;
}
.file-form button:hover { filter: brightness(1.08); }
[data-theme="dark"] .file-form button { color: #0b1220; }

/* ---- Documents page checkboxes -------------------------------------------------------------- */
.doc-checks { display: flex; gap: 2rem; flex-wrap: wrap; }
.check-label {
  display: flex !important; align-items: center; gap: 0.45rem;
  margin: 0 !important; color: var(--text) !important; font-size: 0.95rem !important;
  cursor: pointer;
}
.check-label input { width: auto !important; margin: 0 !important; accent-color: var(--primary); }

/* ---- Login ------------------------------------------------------------------------------------ */
.login-wrap { display: flex; justify-content: center; padding: 13vh 1.25rem 0; }
.login-box { width: 360px; padding: 1.75rem; }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; margin-bottom: 1.4rem; }
.login-brand .brand-mark { width: 44px; height: 44px; border-radius: 11px; font-size: 1.1rem; }
.login-brand .login-firm { font-size: 1.05rem; font-weight: 650; color: var(--text); }
.login-brand .brand-tool { font-size: 0.72rem; }
.login-box button[type="submit"] { width: 100%; justify-content: center; margin-top: 0.3rem; }
.login-box .error { margin-bottom: 1rem; }

/* ---- Responsive --------------------------------------------------------------------------------- */
@media (max-width: 860px) {
  .brand-firm { display: none; }
  .brand-text { line-height: 1; }
  .brand-tool { font-size: 0.78rem; color: var(--text); font-weight: 600; }
  .progress-item { grid-template-columns: 1fr; gap: 0.3rem; padding: 0.5rem 0; }
  .progress-item + .progress-item { border-top: 1px solid var(--line); }
}
@media (max-width: 640px) {
  html { font-size: 15px; }
  .topbar { padding: 0 0.8rem; gap: 0.8rem; }
  main { padding: 0 0.8rem; margin-top: 1rem; }
  .form-grid, .meta-grid { grid-template-columns: 1fr; }
  .meta-grid .span-2 { grid-column: span 1; }
  .stat-row { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
  th, td { padding: 0.45rem 0.6rem; }
}

/* ---- Documents library accordion ------------------------------------------------------------------ */
.lib-fy {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); margin-bottom: 0.75rem; overflow: hidden;
}
.lib-fy > summary {
  cursor: pointer; list-style: none; user-select: none; font-weight: 700;
  padding: 0.75rem 1.1rem; display: flex; align-items: center; gap: 0.4rem;
}
.lib-fy > summary .ico { width: 16px; height: 16px; transition: transform 160ms; }
.lib-fy[open] > summary .ico { transform: rotate(180deg); }
.lib-meeting {
  border-top: 1px solid var(--line); padding: 0.6rem 1.1rem 0.9rem;
}
.lib-meeting > summary {
  cursor: pointer; list-style: none; user-select: none; font-weight: 600;
  font-size: 0.9rem; color: var(--muted); padding: 0.4rem 0;
  display: flex; align-items: center; gap: 0.35rem;
}
.lib-meeting > summary .ico { width: 14px; height: 14px; transition: transform 160ms; }
.lib-meeting[open] > summary .ico { transform: rotate(180deg); }
.lib-meeting table td, .lib-meeting table th { vertical-align: middle; }
.actions-cell { display: flex; align-items: center; gap: 0.15rem; flex-wrap: wrap; }
.actions-cell form.inline-form { display: inline-flex; }
.actions-cell .upload-details { display: inline-block; position: relative; }
.upload-details { display: inline-block; }
.upload-details .file-form { display: inline-flex; gap: 0.3rem; align-items: center; margin-top: 0.3rem; }

/* ---- Motion & print ------------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  .topbar { display: none; }
  body { background: #fff; }
  main { max-width: none; margin: 0; }
  .table-wrap { box-shadow: none; }
}
