:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --bg-soft: #ececed;
  --surface: rgba(255,255,255,.86);
  --surface-solid: #fff;
  --surface-raised: #fff;
  --text: #18181a;
  --muted: #6e6e73;
  --subtle: #8e8e93;
  --line: rgba(60,60,67,.13);
  --line-strong: rgba(60,60,67,.22);
  --accent: #2fb65f;
  --accent-strong: #197a3e;
  --accent-soft: #e9f8ee;
  --danger: #d92d3f;
  --danger-soft: #fff0f1;
  --warning: #8a4700;
  --warning-soft: #fff6e6;
  --shadow: 0 12px 38px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
  --shadow-soft: 0 6px 22px rgba(0,0,0,.05);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --sidebar: 276px;
  --topbar: 72px;
  --content-max: 1240px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #08080a;
  --bg-soft: #101012;
  --surface: rgba(28,28,30,.88);
  --surface-solid: #1c1c1e;
  --surface-raised: #252527;
  --text: #f5f5f7;
  --muted: #aeaeb2;
  --subtle: #8e8e93;
  --line: rgba(235,235,245,.12);
  --line-strong: rgba(235,235,245,.2);
  --accent: #30d158;
  --accent-strong: #5de278;
  --accent-soft: rgba(48,209,88,.13);
  --danger: #ff5364;
  --danger-soft: rgba(255,69,85,.12);
  --warning: #ffb340;
  --warning-soft: rgba(255,159,10,.12);
  --shadow: 0 18px 48px rgba(0,0,0,.34), 0 1px 1px rgba(255,255,255,.03) inset;
  --shadow-soft: 0 8px 28px rgba(0,0,0,.26);
}

* { box-sizing: border-box; }
html {
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
  background: var(--bg);
  scrollbar-gutter: stable;
}
body {
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 100%;
  margin: 0;
  overflow-x: hidden;
  overflow-x: clip;
  background:
    radial-gradient(circle at 7% 4%, rgba(52,199,89,.08), transparent 28rem),
    radial-gradient(circle at 98% 92%, rgba(255,159,10,.045), transparent 24rem),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", Inter, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.45;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { border: 0; }
img, svg { max-width: 100%; }
main, section, article, aside, form, fieldset, dl, ol, ul { min-width: 0; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { max-width: 100%; overflow-wrap: anywhere; }
h1 { margin-bottom: 8px; font-size: clamp(1.8rem, 3vw, 2.55rem); line-height: 1.08; letter-spacing: -.035em; }
h2 { margin-bottom: 7px; font-size: 1.22rem; line-height: 1.2; letter-spacing: -.016em; }
p { color: var(--muted); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 38%, transparent); outline-offset: 3px; }

.app-shell { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.app-column { min-width: 0; }
.sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  padding: 22px 16px 18px;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-solid) 82%, transparent);
  backdrop-filter: blur(26px) saturate(1.3);
}
.sidebar-brand-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 54px; padding: 4px 10px 18px; }
.brand > span:last-child { min-width: 0; }
.brand-logo-frame, .auth-logo-frame {
  display: block;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line));
  background: #58c9c8;
  box-shadow: 0 8px 18px rgba(47,182,95,.18), inset 0 1px rgba(255,255,255,.35);
}
.brand-logo-frame { width: 43px; height: 43px; max-width: 43px; max-height: 43px; border-radius: 14px; }
.auth-logo-frame { width: 76px; height: 76px; margin-bottom: 22px; border-radius: 23px; }
.brand-logo-frame img, .auth-logo-frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.brand strong, .brand small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand strong { font-size: .99rem; letter-spacing: -.01em; }
.brand small { margin-top: 2px; color: var(--muted); font-size: .72rem; }
.sidebar-nav {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: 4px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding: 8px 0 18px;
  scrollbar-width: thin;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}
.nav-link { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 9px 12px; border-radius: 14px; color: var(--muted); font-weight: 580; transition: background .18s, color .18s, transform .18s; }
.nav-link:hover { color: var(--text); background: var(--bg-soft); }
.nav-link.active { color: var(--accent-strong); background: var(--accent-soft); }
.nav-link:active { transform: scale(.985); }
.nav-icon { display: grid; place-items: center; width: 27px; height: 27px; font-size: 1.23rem; line-height: 1; }
.nav-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-heading { padding: 23px 12px 6px; color: var(--subtle); font-size: .72rem; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; }
.sidebar-account { display: flex; flex: 0 0 auto; align-items: center; gap: 5px; padding: 6px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); }
.sidebar-account-main { display: grid; flex: 1; min-width: 0; grid-template-columns: 38px minmax(0,1fr); align-items: center; gap: 10px; min-height: 48px; padding: 5px; border-radius: 12px; }
.sidebar-account-main:hover { background: var(--bg-soft); }
.account-copy { min-width: 0; }
.account-copy strong, .account-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-copy strong { font-size: .82rem; }
.account-copy small { margin-top: 2px; color: var(--muted); font-size: .68rem; }
.avatar { display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); font-weight: 750; }
.avatar-small { width: 38px; height: 38px; }

.topbar { position: sticky; top: 0; z-index: 30; display: grid; grid-template-columns: 44px minmax(0,1fr) 44px; align-items: center; height: var(--topbar); padding: 0 clamp(18px,4vw,44px); border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 76%, transparent); backdrop-filter: blur(24px) saturate(1.35); }
.topbar-title { overflow: hidden; text-align: center; text-overflow: ellipsis; white-space: nowrap; font-weight: 680; letter-spacing: -.015em; }
.icon-button { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 13px; background: transparent; color: var(--text); cursor: pointer; }
.icon-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.icon-button:hover { background: var(--bg-soft); }
.menu-button { visibility: hidden; }
.sidebar-close { display: none; }
.theme-button { justify-self: end; font-size: 1.25rem; }
.content { width: min(100%, calc(var(--content-max) + 2 * clamp(18px,4vw,52px))); min-width: 0; margin: 0 auto; padding: clamp(24px,4vw,48px) clamp(18px,4vw,52px) 80px; }

.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-soft); backdrop-filter: blur(18px) saturate(1.14); }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-heading p { max-width: 680px; margin-bottom: 0; }
.eyebrow { margin-bottom: 8px; color: var(--accent-strong); font-size: .72rem; font-weight: 780; letter-spacing: .075em; text-transform: uppercase; }
.button { display: inline-flex; max-width: 100%; align-items: center; justify-content: center; min-height: 46px; padding: 11px 20px; border-radius: 14px; background: linear-gradient(180deg, #3ac969, #27ab56); color: #fff; font-weight: 680; letter-spacing: -.01em; overflow-wrap: anywhere; text-align: center; box-shadow: 0 6px 16px rgba(47,182,95,.18), inset 0 1px rgba(255,255,255,.24); cursor: pointer; transition: transform .17s, filter .17s; }
.button:hover { filter: brightness(1.03); }
.button:active { transform: scale(.98); }
.button-secondary { border: 1px solid var(--line); background: var(--surface-raised); color: var(--text); box-shadow: none; }
.button-danger { border: 1px solid color-mix(in srgb, var(--danger) 24%, transparent); background: var(--danger-soft); color: var(--danger); box-shadow: none; }
.button-wide { width: 100%; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.back-link { display: inline-flex; margin-bottom: 16px; color: var(--muted); font-weight: 620; }
.text-link { display: inline-flex; align-items: center; gap: 5px; color: var(--accent-strong); font-weight: 680; }
.text-link svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.child-switcher { min-width: 220px; }
.child-switcher label { display: block; margin: 0 0 6px 4px; color: var(--muted); font-size: .75rem; }
.child-hero, .profile-header { display: flex; align-items: center; gap: 20px; padding: 22px; margin-bottom: 24px; }
.child-hero-copy, .profile-header > div:nth-child(2) { min-width: 0; flex: 1; }
.child-hero-copy h2, .profile-header h1 { max-width: 100%; overflow-wrap: anywhere; }
.child-hero-copy p, .profile-header p {
  max-width: 100%;
  margin-bottom: 0;
  overflow-wrap: anywhere;
}
.child-portrait-wrap { position: relative; flex: 0 0 auto; }
.child-portrait, .avatar-large { display: grid; place-items: center; object-fit: cover; border: 4px solid var(--surface-solid); border-radius: 50%; box-shadow: 0 8px 22px rgba(0,0,0,.1); }
.child-portrait { width: 88px; height: 88px; font-size: 2rem; }
.avatar-large { width: 68px; height: 68px; font-size: 1.5rem; }
.child-placeholder { color: var(--accent-strong); background: linear-gradient(145deg, var(--accent-soft), var(--surface-solid)); font-weight: 760; }
.status-dot { position: absolute; right: 4px; bottom: 6px; width: 15px; height: 15px; border: 3px solid var(--surface-solid); border-radius: 50%; background: var(--accent); }

.dashboard-profile-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; margin-bottom: 24px; }
.dashboard-profile-card { display: flex; min-height: 248px; flex-direction: column; padding: clamp(20px,3vw,28px); }
.dashboard-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.dashboard-card-heading .eyebrow { margin: 0; }
.dashboard-card-icon { display: grid; flex: 0 0 auto; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-strong); }
.dashboard-card-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dashboard-child-main { display: flex; align-items: center; gap: 17px; min-width: 0; margin: 18px 0; }
.dashboard-child-main .child-portrait { width: 78px; height: 78px; }
.dashboard-child-facts { display: grid; gap: 0; margin: 13px 0 16px; }
.dashboard-child-facts > div { display: grid; grid-template-columns: minmax(112px,.65fr) minmax(0,1fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.dashboard-child-facts > div:last-child { border-bottom: 0; }
.dashboard-child-facts dt { color: var(--muted); font-size: .7rem; }
.dashboard-child-facts dd { min-width: 0; margin: 0; overflow-wrap: anywhere; font-size: .78rem; font-weight: 680; text-align: right; }
.dashboard-card-link { align-self: flex-start; margin-top: auto; }

.child-grid, .module-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.child-card { position: relative; display: flex; align-items: center; gap: 16px; min-height: 112px; padding: 19px; transition: transform .18s, border-color .18s; }
.child-card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.child-card > div { min-width: 0; }
.child-card h2, .child-card p { margin-bottom: 3px; overflow-wrap: anywhere; }
.child-card-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.child-list-avatar, .record-avatar, .child-portrait {
  image-rendering: auto;
  object-position: center;
  filter: saturate(1.04) contrast(1.035);
  backface-visibility: hidden;
}
.child-list-avatar, .record-avatar { border: 3px solid var(--surface-solid); box-shadow: 0 6px 16px rgba(0,0,0,.12); }
.child-gallery-badge { gap: 5px; white-space: normal; }
.child-gallery-badge svg { flex: 0 0 auto; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.card-chevron { display: grid; flex: 0 0 auto; place-items: center; width: 28px; height: 36px; margin-left: auto; color: var(--subtle); }
.card-chevron svg { display: block; width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.profile-header { padding: 26px; }
.profile-header .child-portrait { width: 108px; height: 108px; }
.profile-header-actions { display: flex; align-items: flex-end; flex-direction: column; gap: 10px; }
.profile-location { display: flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--muted); font-size: .78rem; }
.profile-location svg { flex: 0 0 auto; width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.empty-state { display: flex; align-items: center; flex-direction: column; justify-content: center; min-height: 310px; padding: 42px 24px; text-align: center; }
.empty-state p { max-width: 520px; }
.empty-icon { display: grid; flex: 0 0 auto; place-items: center; width: 64px; height: 64px; margin-bottom: 16px; border-radius: 20px; background: var(--accent-soft); color: var(--accent-strong); }
.empty-icon svg, .module-icon svg { display: block; width: 29px; height: 29px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.auth-logo { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 20px; border-radius: 20px; background: var(--accent-soft); color: var(--accent-strong); }
.auth-logo svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.error-state { min-height: 360px; }
.error-code { color: var(--accent); font-size: 4.5rem; letter-spacing: -.06em; }

.narrow-page { width: min(100%, 720px); margin: 0 auto; }
.form-card { padding: clamp(22px,5vw,38px); }
.form-card > p { margin-bottom: 26px; }
.stack-form { display: grid; gap: 17px; }
.stack-form > div { display: grid; gap: 7px; }
.stack-form > .form-actions { display: flex; }
label { font-size: .82rem; font-weight: 650; }
input, select, textarea { width: 100%; min-height: 48px; padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: 13px; outline: 0; background: var(--surface-solid); transition: border-color .16s, box-shadow .16s; }
textarea { min-height: 112px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent); }
input[type="file"] { padding: 10px; }
input[type="checkbox"] { width: 21px; min-height: 21px; padding: 0; accent-color: var(--accent); }
.password-field { position: relative; }
.password-field input { padding-right: 52px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transform: translateY(-50%);
}
.password-toggle:hover { background: var(--bg-soft); color: var(--text); }
.password-toggle:focus-visible { outline-offset: 1px; }
.password-eye { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.password-eye-closed { display: none; }
.password-toggle.is-visible .password-eye-open { display: none; }
.password-toggle.is-visible .password-eye-closed { display: block; }
.helptext, .form-note { color: var(--muted); font-size: .76rem; }
.errorlist { margin: 0; padding: 0; color: var(--danger); font-size: .78rem; list-style: none; }
.auth-shell { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.auth-card { width: min(100%, 440px); padding: 38px; }
.auth-card > p { margin-bottom: 26px; }
.auth-card .form-note { display: block; margin-top: 20px; text-align: center; }

.two-column { display: grid; grid-template-columns: minmax(300px,.75fr) minmax(0,1.5fr); gap: 18px; align-items: start; }
.table-panel { padding: 24px; }
.responsive-table { overflow-x: auto; margin: 0 -8px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; }
td { font-size: .86rem; }
.copy-card { margin-bottom: 18px; padding: 21px; }
.copy-card label { display: block; margin-bottom: 8px; }
.copy-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; }
.copy-card small { display: block; margin-top: 8px; color: var(--muted); }
.invitation-panel { padding: 24px; }
.invitation-panel > h2 { margin-bottom: 14px; }
.invitation-list { display: grid; }
.invitation-row { display: grid; grid-template-columns: 40px minmax(150px,1fr) minmax(120px,.6fr) auto; align-items: center; gap: 12px; min-height: 76px; padding: 11px 3px; border-bottom: 1px solid var(--line); }
.invitation-row:last-child { border-bottom: 0; }
.invitation-avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); font-weight: 750; }
.invitation-copy, .invitation-expiry { display: grid; min-width: 0; gap: 2px; }
.invitation-copy strong, .invitation-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invitation-copy strong { font-size: .82rem; }
.invitation-copy small, .invitation-expiry small { color: var(--muted); font-size: .68rem; }
.invitation-expiry time { font-size: .76rem; }

.metric-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.metric-card { display: flex; align-items: center; gap: 15px; min-width: 0; min-height: 132px; padding: 20px; transition: transform .18s, border-color .18s; }
.metric-card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.metric-card > span:last-child { display: grid; min-width: 0; }
.metric-card small { color: var(--muted); font-size: .73rem; font-style: normal; font-weight: 650; }
.metric-card strong { margin: 1px 0; font-size: 1.85rem; line-height: 1.1; letter-spacing: -.04em; }
.metric-card em { overflow: hidden; color: var(--subtle); font-size: .69rem; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.metric-icon, .institution-icon {
  display: grid; place-items: center; flex: 0 0 auto;
  width: 46px; height: 46px; border-radius: 15px;
  background: var(--accent-soft); color: var(--accent-strong);
}
.metric-icon svg, .institution-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.management-columns { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; align-items: start; }
.action-panel, .activity-panel { padding: 24px; }
.section-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 17px; }
.section-title h2, .section-title p { margin-bottom: 0; }
.action-list, .activity-list { display: grid; gap: 8px; }
.action-list > a {
  display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 12px;
  min-height: 68px; padding: 10px; border-radius: 15px; transition: background .17s, transform .17s;
}
.action-list > a:hover { background: var(--bg-soft); }
.action-list > a:active { transform: scale(.99); }
.action-list > a > span:nth-child(2), .activity-item > span:last-child { min-width: 0; }
.action-list strong, .action-list small, .activity-item strong, .activity-item small { display: block; }
.action-list strong { overflow-wrap: anywhere; font-size: .86rem; }
.action-list small { margin-top: 2px; overflow-wrap: anywhere; color: var(--muted); font-size: .7rem; }
.activity-item strong { overflow: hidden; font-size: .86rem; text-overflow: ellipsis; white-space: nowrap; }
.activity-item small { margin-top: 2px; overflow: hidden; color: var(--muted); font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.action-list b { display: grid; place-items: center; width: 28px; height: 36px; color: var(--subtle); }
.action-list b svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.action-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--accent-soft); color: var(--accent-strong); }
.action-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.activity-item { display: grid; grid-template-columns: 10px minmax(0,1fr); align-items: center; gap: 12px; min-height: 58px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.activity-item:last-child { border-bottom: 0; }
.activity-dot, .audit-result { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.activity-dot.is-error, .audit-result.is-error { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }

.filter-bar { display: grid; grid-template-columns: minmax(240px,1fr) minmax(170px,220px) minmax(160px,190px) auto; gap: 10px; margin-bottom: 16px; padding: 12px; }
.child-filter-bar { margin-bottom: 20px; }
.filter-bar-compact { grid-template-columns: minmax(240px,1fr) auto; }
.filter-bar-audit { grid-template-columns: minmax(240px,1fr) minmax(170px,220px) auto; }
.filter-bar input, .filter-bar select, .filter-bar .button { min-height: 44px; }
.filter-bar .button { white-space: nowrap; }
.search-control { position: relative; min-width: 0; }
.search-control svg { position: absolute; left: 14px; top: 50%; z-index: 1; width: 19px; height: 19px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; transform: translateY(-50%); pointer-events: none; }
.search-control input { padding-left: 42px; }
.record-list { display: grid; gap: 10px; }
.record-row {
  display: grid;
  grid-template-columns: 48px minmax(170px,1.35fr) minmax(150px,1fr) minmax(150px,1fr) 22px;
  align-items: center;
  gap: 14px;
  min-height: 94px;
  padding: 16px 18px;
  transition: transform .17s, border-color .17s;
}
.record-row:hover { transform: translateY(-1px); border-color: var(--line-strong); }
.record-avatar { width: 48px; height: 48px; }
.record-primary, .record-secondary, .record-status { display: grid; min-width: 0; align-content: center; justify-items: start; gap: 4px; }
.record-primary strong, .record-primary small, .record-secondary small, .record-status small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record-primary strong { font-size: .9rem; }
.record-primary small, .record-secondary small, .record-status small { color: var(--muted); font-size: .7rem; }
.record-row .card-chevron { margin-left: 0; justify-self: end; }
.child-management-row .record-avatar { object-fit: cover; }
.pagination { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-top: 20px; }
.pagination-link { justify-self: start; min-height: 42px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); font-size: .79rem; font-weight: 650; }
.pagination-link:last-child { justify-self: end; }
.pagination-link.disabled { opacity: .45; }
.pagination-state { color: var(--muted); font-size: .75rem; }

.management-form-page { width: min(100%, 820px); }
.management-form { margin-top: 26px; }
.form-section { min-width: 0; margin: 0; padding: 0 0 24px; border: 0; border-bottom: 1px solid var(--line); }
.form-section + .form-section { padding-top: 4px; }
.form-section legend { width: 100%; margin-bottom: 14px; padding: 0; font-size: .92rem; font-weight: 720; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 17px; }
.form-field { display: grid; align-content: start; gap: 7px; min-width: 0; }
.form-field-wide { grid-column: 1 / -1; }
.field-errors .errorlist { margin-top: 2px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 4px; }
.toggle-field { position: relative; display: grid; grid-template-columns: 48px minmax(0,1fr); align-items: center; gap: 12px; min-height: 62px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-solid); cursor: pointer; }
.toggle-field input { position: absolute; width: 1px; min-height: 1px; opacity: 0; }
.toggle-visual { position: relative; display: block; width: 46px; height: 28px; border-radius: 999px; background: var(--bg-soft); box-shadow: inset 0 0 0 1px var(--line-strong); transition: background .18s; }
.toggle-visual::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: transform .18s; }
.toggle-field input:checked + .toggle-visual { background: var(--accent); box-shadow: none; }
.toggle-field input:checked + .toggle-visual::after { transform: translateX(18px); }
.toggle-field input:focus-visible + .toggle-visual { outline: 3px solid color-mix(in srgb, var(--accent) 38%, transparent); outline-offset: 3px; }
.toggle-copy strong, .toggle-copy small { display: block; }
.toggle-copy strong { font-size: .82rem; }
.toggle-copy small { margin-top: 3px; color: var(--muted); font-size: .7rem; font-weight: 450; }

.institution-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.institution-card { display: flex; align-items: stretch; flex-direction: column; min-height: 242px; padding: 21px; transition: transform .18s, border-color .18s; }
.institution-card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.institution-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 19px; }
.institution-card h2 { overflow-wrap: anywhere; }
.institution-stats { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; margin: 15px 0 19px; }
.institution-stats span { padding: 11px; border-radius: 13px; background: var(--bg-soft); }
.institution-stats strong, .institution-stats small { display: block; }
.institution-stats strong { font-size: 1.15rem; }
.institution-stats small { color: var(--muted); font-size: .68rem; }
.institution-card .text-link { margin-top: auto; font-size: .78rem; }

.audit-panel { padding: 8px 20px; }
.audit-list { display: grid; }
.audit-row { display: grid; grid-template-columns: 10px minmax(180px,1.3fr) minmax(130px,.7fr) auto; align-items: center; gap: 15px; min-height: 76px; padding: 12px 5px; border-bottom: 1px solid var(--line); }
.audit-row:last-child { border-bottom: 0; }
.audit-copy { display: grid; min-width: 0; gap: 3px; }
.audit-copy strong, .audit-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audit-copy strong { font-size: .86rem; }
.audit-copy small, .audit-object, .audit-row time { color: var(--muted); font-size: .7rem; }
.audit-row time { white-space: nowrap; }
.audit-result.is-success { background: var(--accent); }
.access-page { width: min(100%, 900px); }
.access-page .page-heading { margin-bottom: 18px; }
.access-layout { display: grid; grid-template-columns: minmax(270px,.75fr) minmax(0,1.25fr); gap: 16px; align-items: start; }
.access-list-panel { padding: 24px; }
.access-list-panel > h2 { margin-bottom: 14px; }
.access-list { display: grid; }
.access-row { display: grid; grid-template-columns: 38px minmax(130px,1fr) minmax(250px,auto) auto; align-items: center; gap: 11px; min-height: 78px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.access-row:last-child { border-bottom: 0; }
.access-copy { display: grid; min-width: 0; gap: 2px; }
.access-copy strong, .access-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.access-copy strong { font-size: .82rem; }
.access-copy small { color: var(--muted); font-size: .68rem; }
.access-rights-form { display: grid; grid-template-columns: repeat(2,minmax(112px,1fr)) 44px; align-items: center; gap: 6px; }
.permission-check { position: relative; min-width: 0; cursor: pointer; }
.permission-check input { position: absolute; width: 1px; min-height: 1px; opacity: 0; }
.permission-check span { display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 44px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 11px; background: var(--bg-soft); color: color-mix(in srgb, var(--text) 78%, var(--muted)); font-size: .67rem; font-weight: 680; text-align: center; transition: border-color .16s, background .16s, color .16s; }
.permission-check svg { flex: 0 0 auto; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.permission-check input:checked + span { border-color: color-mix(in srgb, var(--accent) 28%, var(--line)); background: var(--accent-soft); color: var(--accent-strong); }
.permission-check input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--accent) 38%, transparent); outline-offset: 2px; }
.save-icon-button { width: 44px; height: 44px; color: var(--accent-strong); }
.save-icon-button:hover { background: var(--accent-soft); }
.danger-icon-button { color: var(--danger); }
.danger-icon-button:hover { background: var(--danger-soft); }

.module-card { padding: 24px; }
.module-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.module-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; background: var(--accent-soft); color: var(--accent-strong); }
.module-card > p { min-height: 46px; overflow-wrap: anywhere; }
.badge { display: inline-flex; align-items: center; min-height: 25px; padding: 4px 9px; border-radius: 999px; font-size: .69rem; font-weight: 720; }
.badge-success { background: var(--accent-soft); color: var(--accent-strong); }
.badge-neutral {
  background: var(--bg-soft);
  color: color-mix(in srgb, var(--text) 76%, var(--muted));
}
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.meta-list { margin: 20px 0 0; }
.meta-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.meta-list dt { color: var(--muted); }
.meta-list dd { margin: 0; }
.hash { min-width: 0; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .78rem; }
.notice { margin-top: 20px; padding: 18px 20px; border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line)); border-radius: var(--radius-md); background: var(--accent-soft); }
.notice p { margin: 4px 0 0; color: var(--muted); }
.alert, .toast { padding: 13px 16px; border-radius: 13px; }
.alert-error, .toast-error { border: 1px solid color-mix(in srgb, var(--danger) 24%, transparent); background: var(--danger-soft); color: var(--danger); }
.toast-success { border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); background: var(--accent-soft); color: var(--accent-strong); }
.toast-info { border: 1px solid var(--line); background: var(--surface-solid); }
.messages { position: fixed; top: 84px; right: 24px; z-index: 90; display: grid; gap: 8px; width: min(380px, calc(100vw - 32px)); }
.toast { box-shadow: var(--shadow); animation: toast-in .22s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

.bottom-nav, .nav-backdrop { display: none; }

.help-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; padding: clamp(22px,4vw,34px); }
.help-hero-copy { min-width: 0; }
.help-hero-copy p { max-width: 720px; margin-bottom: 0; }
.help-downloads { display: flex; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.help-layout { display: grid; grid-template-columns: minmax(220px,280px) minmax(0,1fr); gap: 18px; align-items: start; }
.help-toc { position: sticky; top: calc(var(--topbar) + 18px); display: grid; gap: 4px; padding: 13px; }
.help-toc strong { padding: 8px 10px 5px; font-size: .78rem; }
.help-toc a { min-height: 40px; padding: 10px; border-radius: 11px; color: var(--muted); font-size: .78rem; font-weight: 620; }
.help-toc a:hover { background: var(--bg-soft); color: var(--text); }
.help-content { display: grid; gap: 14px; min-width: 0; }
.help-section { scroll-margin-top: calc(var(--topbar) + 18px); padding: clamp(21px,4vw,30px); }
.help-section h2 { margin-bottom: 12px; }
.help-section h3 { margin: 23px 0 7px; font-size: 1rem; }
.help-section > :last-child { margin-bottom: 0; }
.help-section ul, .help-section ol { margin: 10px 0 0; padding-left: 1.35rem; }
.help-section li { margin: 7px 0; padding-left: 3px; }
.help-section li::marker { color: var(--accent-strong); font-weight: 750; }
.help-steps { display: grid; gap: 10px; margin-top: 16px; counter-reset: help-step; }
.help-step { position: relative; min-height: 58px; padding: 13px 14px 13px 56px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-solid); counter-increment: help-step; }
.help-step::before { content: counter(help-step); position: absolute; left: 13px; top: 12px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-strong); font-weight: 780; }
.help-step strong, .help-step span { display: block; }
.help-step span { margin-top: 2px; color: var(--muted); font-size: .78rem; }
.help-callout { margin-top: 16px; padding: 16px 18px; border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line)); border-radius: 15px; background: var(--accent-soft); }
.help-callout strong, .help-callout span { display: block; }
.help-callout span { margin-top: 4px; color: var(--muted); font-size: .8rem; }
.role-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-top: 15px; }
.role-card { padding: 15px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-solid); }
.role-card strong, .role-card span { display: block; }
.role-card span { margin-top: 4px; color: var(--muted); font-size: .77rem; }

.account-profile-page { width: min(100%, 1120px); margin: 0 auto; }
.account-profile-hero {
  display: grid;
  grid-template-columns: 84px minmax(0,1fr) auto;
  align-items: center;
  gap: 20px;
  margin-bottom: 18px;
  padding: clamp(22px,4vw,32px);
}
.profile-avatar {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border: 4px solid var(--surface-solid);
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent-soft), var(--surface-raised));
  color: var(--accent-strong);
  box-shadow: 0 10px 26px rgba(0,0,0,.1);
  font-size: 1.85rem;
  font-weight: 780;
}
.account-profile-heading { min-width: 0; }
.account-profile-heading h1 { margin-bottom: 5px; overflow-wrap: break-word; }
.account-profile-heading p:last-child { max-width: 100%; margin-bottom: 0; overflow-wrap: anywhere; }
.profile-role-list { display: flex; max-width: 300px; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.account-profile-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; gap: 18px; }
.profile-panel { min-width: 0; padding: clamp(22px,4vw,30px); }
.profile-panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.profile-panel-heading > div { min-width: 0; }
.profile-panel-heading p:last-child { margin-bottom: 0; }
.security-icon { display: grid; flex: 0 0 auto; place-items: center; width: 48px; height: 48px; border-radius: 15px; background: var(--accent-soft); color: var(--accent-strong); }
.security-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.profile-facts { display: grid; gap: 1px; margin: 22px 0; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: var(--line); }
.profile-fact { display: grid; grid-template-columns: minmax(120px,.72fr) minmax(0,1fr); align-items: center; gap: 14px; min-height: 54px; padding: 12px 14px; background: var(--surface-solid); }
.profile-fact span { color: var(--muted); font-size: .74rem; }
.profile-fact strong { min-width: 0; overflow-wrap: anywhere; font-size: .8rem; text-align: right; }
.profile-form { margin-top: 22px; }
.profile-form .form-actions { margin-top: 2px; }

@media (max-width: 1100px) {
  .app-shell { display: block; }
  .icon-button { width: 44px; height: 44px; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 80;
    width: min(86vw, 310px);
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    padding-top: max(14px, env(safe-area-inset-top));
    padding-bottom: max(14px, env(safe-area-inset-bottom));
    overflow: hidden;
    transform: translateX(-105%);
    transition: transform .24s cubic-bezier(.22,.72,.25,1);
    box-shadow: var(--shadow);
  }
  body.nav-open { overflow: hidden; }
  body.nav-open .sidebar { transform: translateX(0); }
  .sidebar-close { display: grid; align-self: start; margin-top: 6px; }
  .brand { padding-right: 4px; }
  .sidebar .brand-logo-frame { width: 38px; height: 38px; max-width: 38px; max-height: 38px; border-radius: 12px; }
  .sidebar .brand { min-height: 48px; gap: 9px; padding-top: 2px; padding-bottom: 12px; }
  .sidebar .brand strong { font-size: .9rem; }
  .sidebar .brand small { font-size: .67rem; }
  .sidebar-nav { padding-bottom: 16px; scrollbar-gutter: stable; }
  .sidebar-account { margin-top: 2px; }
  .nav-backdrop { position: fixed; inset: 0; z-index: 70; width: 100%; height: 100%; padding: 0; background: rgba(0,0,0,.32); backdrop-filter: blur(5px); cursor: pointer; }
  body.nav-open .nav-backdrop { display: block; }
  .menu-button { visibility: visible; justify-self: start; }
  .content { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .bottom-nav { position: fixed; left: 12px; right: 12px; bottom: max(10px, env(safe-area-inset-bottom)); z-index: 60; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; min-height: 66px; padding: 6px; border: 1px solid var(--line); border-radius: 22px; background: color-mix(in srgb, var(--surface-solid) 88%, transparent); box-shadow: var(--shadow); backdrop-filter: blur(24px) saturate(1.35); transition: opacity .18s, transform .22s; }
  body.form-control-focus .bottom-nav { opacity: 0; pointer-events: none; transform: translateY(calc(100% + 28px)); }
  .bottom-link { display: flex; align-items: center; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; padding: 4px 2px; border-radius: 16px; background: transparent; color: var(--muted); cursor: pointer; }
  .bottom-link span { font-size: 1.2rem; line-height: 1; }
  .bottom-link svg { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .bottom-link svg circle { fill: currentColor; stroke: none; }
  .bottom-link small { max-width: 100%; overflow: hidden; font-size: .62rem; font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }
  .bottom-link.active { background: var(--accent-soft); color: var(--accent-strong); }
  .two-column { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .management-columns { grid-template-columns: 1fr; }
  .access-layout { grid-template-columns: 1fr; }
  .access-row { grid-template-columns: 38px minmax(0,1fr) auto; }
  .access-rights-form { grid-column: 2 / 4; }
  .access-row > form:last-child { grid-column: 3; grid-row: 1; }
  .help-layout { grid-template-columns: 1fr; }
  .help-toc { position: static; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .help-toc strong { grid-column: 1 / -1; }
  .filter-bar { grid-template-columns: minmax(0,1fr) minmax(170px,.65fr); }
  .filter-bar .button { width: 100%; }
  .record-row { grid-template-columns: 48px minmax(0,1.4fr) minmax(140px,1fr) 22px; }
  .record-status { grid-column: 2 / 4; grid-row: 2; display: flex; align-items: center; gap: 8px; }
  .record-row .card-chevron { grid-column: 4; grid-row: 1 / 3; }
  .institution-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .account-profile-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  :root { --topbar: 62px; --radius-lg: 19px; }
  .content { padding-top: 22px; }
  .topbar { padding: 0 14px; }
  .page-heading { align-items: stretch; flex-direction: column; gap: 16px; margin-bottom: 20px; }
  .page-heading .button { width: 100%; }
  .child-switcher { width: 100%; }
  .dashboard-profile-grid { grid-template-columns: 1fr; }
  .dashboard-profile-card { min-height: 0; }
  .child-hero, .profile-header { align-items: flex-start; flex-wrap: wrap; gap: 15px; padding: 18px; }
  .child-hero .button, .profile-header .button { width: 100%; }
  .profile-header-actions { width: 100%; align-items: stretch; }
  .profile-header-actions .child-gallery-badge { justify-content: center; }
  .child-portrait { width: 72px; height: 72px; }
  .profile-header .child-portrait { width: 82px; height: 82px; }
  .child-grid, .module-grid { grid-template-columns: 1fr; }
  .copy-row { grid-template-columns: 1fr; }
  .copy-row .button { width: 100%; }
  .auth-card { padding: 28px 22px; }
  .form-card { padding: 24px 18px; }
  .table-panel { padding: 18px; }
  .messages { top: 70px; right: 16px; }
  .filter-bar, .filter-bar-compact, .filter-bar-audit { grid-template-columns: 1fr; }
  .filter-bar { padding: 10px; }
  .record-row { grid-template-columns: 46px minmax(0,1fr) 20px; gap: 11px; padding: 14px; }
  .record-avatar { width: 46px; height: 46px; }
  .record-secondary { grid-column: 2; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
  .record-status { grid-column: 2; grid-row: auto; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
  .record-row .card-chevron { grid-column: 3; grid-row: 1 / 4; }
  .form-grid { grid-template-columns: 1fr; }
  .form-field-wide { grid-column: auto; }
  .stack-form > .form-actions { flex-direction: column-reverse; }
  .stack-form > .form-actions .button { width: 100%; }
  .audit-panel { padding: 6px 14px; }
  .audit-row { grid-template-columns: 10px minmax(0,1fr) auto; gap: 11px; }
  .audit-object { display: none; }
  .institution-grid { grid-template-columns: 1fr; }
  .invitation-panel { padding: 18px; }
  .invitation-row { grid-template-columns: 40px minmax(0,1fr) auto; }
  .invitation-expiry { grid-column: 2; }
  .invitation-row > .badge { grid-column: 3; grid-row: 1 / 3; }
  .access-list-panel { padding: 18px; }
  .access-row { grid-template-columns: 38px minmax(0,1fr) 44px; align-items: start; }
  .access-rights-form { grid-column: 1 / -1; grid-template-columns: repeat(2,minmax(0,1fr)) 44px; }
  .access-row > form:last-child { grid-column: 3; grid-row: 1; }
  .help-hero { flex-direction: column; }
  .help-downloads { width: 100%; justify-content: stretch; }
  .help-downloads .button { flex: 1 1 180px; }
  .role-list { grid-template-columns: 1fr; }
  .account-profile-hero { grid-template-columns: 64px minmax(0,1fr); gap: 14px; padding: 19px; }
  .profile-avatar { width: 64px; height: 64px; border-width: 3px; font-size: 1.35rem; }
  .account-profile-heading h1 { font-size: 1.45rem; }
  .profile-role-list { grid-column: 1 / -1; max-width: none; justify-content: flex-start; }
  .profile-panel { padding: 21px 18px; }
}

@media (max-width: 390px) {
  .content { padding-left: 13px; padding-right: 13px; }
  h1 { font-size: clamp(1.6rem, 7.5vw, 1.8rem); }
  .bottom-nav { left: 7px; right: 7px; }
  .bottom-link small { font-size: .58rem; }
  .child-card { padding: 15px; }
  .avatar-large { width: 58px; height: 58px; }
  .dashboard-profile-card { padding: 18px 15px; }
  .dashboard-child-main { align-items: flex-start; gap: 13px; }
  .dashboard-child-main .child-portrait { width: 66px; height: 66px; }
  .dashboard-child-facts > div { grid-template-columns: 1fr; gap: 3px; }
  .dashboard-child-facts dd { text-align: left; }
  .access-rights-form { grid-template-columns: 1fr; }
  .access-rights-form .save-icon-button { grid-column: 1; width: 100%; border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line)); }
  .child-card-badges { gap: 5px; }
  .child-gallery-badge { font-size: .63rem; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 108px; }
  .action-panel, .activity-panel { padding: 18px 15px; }
  .section-title { align-items: flex-start; flex-direction: column; }
  .pagination { grid-template-columns: 1fr 1fr; }
  .pagination-state { grid-column: 1 / -1; grid-row: 1; text-align: center; }
  .pagination-link { grid-row: 2; }
  .audit-row { grid-template-columns: 9px minmax(0,1fr); }
  .audit-row time { grid-column: 2; }
  .help-toc { grid-template-columns: 1fr; }
  .help-downloads .button { flex-basis: 100%; }
  .sidebar { width: min(89vw, 300px); padding-left: 12px; padding-right: 12px; }
  .sidebar .brand-logo-frame { width: 34px; height: 34px; max-width: 34px; max-height: 34px; border-radius: 10px; }
  .sidebar .brand { gap: 8px; padding-left: 7px; }
  .sidebar .brand strong { font-size: .84rem; }
  .sidebar .brand small { font-size: .63rem; }
  .account-profile-hero { grid-template-columns: 56px minmax(0,1fr); padding: 17px 15px; }
  .profile-avatar { width: 56px; height: 56px; font-size: 1.15rem; }
  .account-profile-heading h1 { font-size: 1.25rem; }
  .profile-fact { grid-template-columns: 1fr; gap: 3px; }
  .profile-fact strong { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
