/* TACI Digital Campus — design system.
   Brand colours are tokens (--brand, --accent) and can be changed in Administration → System settings.
   The default palette is a proposal, NOT an official TACI brand identity. */

:root {
  --brand: #14305f;
  --accent: #b8893a;
  --brand-700: color-mix(in srgb, var(--brand) 82%, black);
  --brand-900: color-mix(in srgb, var(--brand) 55%, black);
  --brand-100: color-mix(in srgb, var(--brand) 10%, white);
  --brand-50: color-mix(in srgb, var(--brand) 5%, white);
  --accent-100: color-mix(in srgb, var(--accent) 16%, white);
  --accent-700: color-mix(in srgb, var(--accent) 75%, black);

  --bg: #f4f6fa;
  --surface: #ffffff;
  --ink: #1b2433;
  --ink-soft: #4b5668;
  --ink-faint: #7a8496;
  --line: #e3e8f0;
  --success: #12805c;
  --success-bg: #e6f5ee;
  --warn: #9a6700;
  --warn-bg: #fff4d6;
  --danger: #b42318;
  --danger-bg: #fdeceb;
  --info-bg: #e8f0fb;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(16, 30, 54, .06);
  --shadow: 0 1px 2px rgba(16, 30, 54, .05), 0 8px 24px -8px rgba(16, 30, 54, .12);
  --shadow-lg: 0 2px 4px rgba(16, 30, 54, .06), 0 20px 40px -12px rgba(16, 30, 54, .22);
  --sidebar-w: 264px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
img, svg, video { max-width: 100%; }
a { color: var(--brand); text-decoration-color: color-mix(in srgb, var(--brand) 30%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
h1, h2, h3 { font-family: var(--font-display); color: var(--brand-900); line-height: 1.25; margin: 0 0 .4em; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 1.85rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 70%, white); outline-offset: 2px; border-radius: 6px; }
.icon { flex: none; vertical-align: -.2em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-soft); } .faint { color: var(--ink-faint); } .small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }

/* ---------- App shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--brand-700), var(--brand-900)); color: #dbe4f4; padding: 22px 14px 16px;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 10px 22px; color: #fff; text-decoration: none; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; overflow: hidden;
  background: linear-gradient(145deg, var(--accent), var(--accent-700)); color: #fff; font: 700 17px var(--font-display); letter-spacing: .02em;
  box-shadow: 0 6px 14px -4px rgba(0, 0, 0, .35);
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.brand-name { font: 600 1.05rem/1.2 var(--font-display); }
.brand-sub { display: block; font: 500 .68rem/1.3 var(--font); letter-spacing: .1em; text-transform: uppercase; color: #aebcd8; margin-top: 2px; }
.nav-label { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: #8fa1c4; padding: 18px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #cfd9ee; text-decoration: none;
  font-weight: 500; position: relative; transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav a[aria-current="page"] { background: rgba(255, 255, 255, .12); color: #fff; }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent); }
.sidebar-foot { margin-top: auto; padding: 16px 12px 0; font-size: .75rem; color: #8fa1c4; border-top: 1px solid rgba(255, 255, 255, .1); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 12px 32px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid var(--line);
}
.menu-toggle { display: none; }
.search { flex: 1; max-width: 460px; position: relative; }
.search .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-faint); pointer-events: none; }
.search input { width: 100%; padding: 10px 14px 10px 40px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); font: inherit; }
.search input:focus { background: #fff; border-color: var(--brand); outline: none; box-shadow: 0 0 0 4px var(--brand-100); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid transparent; background: transparent; color: var(--ink-soft); cursor: pointer; }
.icon-btn:hover { background: var(--bg); }
.badge-dot { position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font: 700 .68rem/18px var(--font); text-align: center; }

details.menu { position: relative; }
details.menu > summary { list-style: none; cursor: pointer; }
details.menu > summary::-webkit-details-marker { display: none; }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 280px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 8px; z-index: 30;
}
.menu-panel a, .menu-panel button.link { display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 10px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; background: none; border: 0; font: inherit; text-align: left; cursor: pointer; }
.menu-panel a:hover, .menu-panel button.link:hover { background: var(--bg); }
.menu-head { padding: 10px 12px 8px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-100); color: var(--brand); font-weight: 700; font-size: .85rem; border: 2px solid #fff; box-shadow: var(--shadow-sm); }
.profile-btn { display: flex; align-items: center; gap: 10px; padding: 3px 10px 3px 3px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.profile-btn:hover { box-shadow: var(--shadow-sm); }

.content { padding: 30px 32px 60px; max-width: 1240px; width: 100%; margin: 0 auto; }
.page-head { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; justify-content: space-between; margin-bottom: 26px; }
.page-head p { margin: 0; color: var(--ink-soft); }
.crumbs { font-size: .82rem; color: var(--ink-faint); margin-bottom: 6px; }
.crumbs a { color: var(--ink-soft); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 10px; border: 1px solid transparent;
  font: 600 .92rem var(--font); text-decoration: none; cursor: pointer; transition: transform .12s, box-shadow .15s, background .15s; min-height: 42px;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--brand) 70%, transparent); }
.btn-primary:hover { background: var(--brand-700); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-700); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-sm { padding: 6px 12px; min-height: 34px; font-size: .84rem; border-radius: 8px; }
.btn[disabled], .btn.is-disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
form.inline { display: inline; }

/* ---------- Cards & grids ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 22px; }
.card + .card { margin-top: 20px; }
.grid > .card + .card, .list-plain > li.card + li.card { margin-top: 0; }
.grid { display: grid; gap: 20px; }
.grid-cards { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); }
.section { margin-top: 38px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.section-head h2 { margin: 0; }

.hero {
  position: relative; overflow: hidden; border-radius: 20px; padding: 34px 36px; color: #fff; margin-bottom: 8px;
  background: radial-gradient(900px 300px at 100% 0, color-mix(in srgb, var(--accent) 45%, transparent), transparent 60%),
    linear-gradient(120deg, var(--brand-900), var(--brand));
  box-shadow: var(--shadow);
}
.hero::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(135deg, rgba(255,255,255,.035) 0 2px, transparent 2px 22px); pointer-events: none; }
.hero h1 { color: #fff; font-size: 2rem; margin-bottom: 6px; position: relative; }
.hero p { color: #d3def2; margin: 0; position: relative; max-width: 56ch; }
.hero-meta { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; position: relative; }
.chip-light { padding: 4px 12px; border-radius: 999px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.2); font-size: .8rem; }

.app-card { display: flex; flex-direction: column; gap: 14px; padding: 22px; transition: transform .18s, box-shadow .18s, border-color .18s; position: relative; }
.app-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--brand) 25%, var(--line)); }
.app-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(145deg, var(--brand-100), #fff); color: var(--brand); border: 1px solid var(--line); }
.app-card h3 { margin: 0 0 4px; font-size: 1.12rem; }
.app-card p { margin: 0; color: var(--ink-soft); font-size: .9rem; flex: 1; }
.app-card .btn-row { margin-top: 2px; }
.app-card.is-inactive { opacity: .7; background: repeating-linear-gradient(135deg, #fafbfd 0 10px, #f3f5f9 10px 20px); }
.app-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }

.t-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; transition: transform .18s, box-shadow .18s; }
.t-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.t-thumb { position: relative; aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--brand-100), color-mix(in srgb, var(--accent) 22%, white)); display: grid; place-items: center; color: var(--brand); overflow: hidden; }
.t-thumb img { width: 100%; height: 100%; object-fit: cover; }
.t-thumb .play { position: absolute; width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,.92); display: grid; place-items: center; color: var(--brand); box-shadow: var(--shadow); }
.t-dur { position: absolute; right: 10px; bottom: 10px; background: rgba(10, 20, 40, .78); color: #fff; font-size: .75rem; padding: 2px 8px; border-radius: 6px; }
.t-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.t-body h3 { margin: 0; font-size: 1.02rem; }
.t-body h3 a { color: inherit; text-decoration: none; }
.t-body h3 a::after { content: ""; position: absolute; inset: 0; }
.t-card { position: relative; }
.t-body p { margin: 0; color: var(--ink-soft); font-size: .88rem; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Badges, progress ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--brand-100); color: var(--brand); white-space: nowrap; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-muted { background: #eef1f6; color: var(--ink-soft); }
.badge-accent { background: var(--accent-100); color: var(--accent-700); }
progress { width: 100%; height: 8px; border-radius: 99px; overflow: hidden; border: 0; background: #e8ecf3; appearance: none; -webkit-appearance: none; }
progress::-webkit-progress-bar { background: #e8ecf3; }
progress::-webkit-progress-value { background: linear-gradient(90deg, var(--brand), var(--accent)); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--brand); border-radius: 99px; }

/* ---------- Alerts / flash ---------- */
.flashes { display: grid; gap: 10px; margin-bottom: 22px; }
.alert { display: flex; gap: 12px; padding: 13px 16px; border-radius: 12px; border: 1px solid; align-items: flex-start; }
.alert-success { background: var(--success-bg); border-color: #b9e3d0; color: #0d5f44; }
.alert-error { background: var(--danger-bg); border-color: #f5c6c2; color: #8a1a11; }
.alert-info { background: var(--info-bg); border-color: #c8dcf5; color: #1a4a85; }
.alert-warn { background: var(--warn-bg); border-color: #f0dc9c; color: #6f4a00; }
.alert strong { font-weight: 650; }
.alert-important { border-left: 5px solid var(--accent); background: var(--accent-100); border-color: color-mix(in srgb, var(--accent) 35%, white); color: var(--ink); }

/* ---------- Forms ---------- */
.form { display: grid; gap: 20px; max-width: 760px; }
.field { display: grid; gap: 6px; }
.field > label, .legend { font-weight: 600; font-size: .9rem; color: var(--ink); }
.hint { font-size: .8rem; color: var(--ink-faint); }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=date], input[type=datetime-local], select, textarea {
  width: 100%; padding: 10px 13px; border: 1px solid #cfd7e4; border-radius: 10px; background: #fff; font: inherit; color: var(--ink);
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-100); }
input[type=color] { width: 56px; height: 42px; padding: 3px; border: 1px solid #cfd7e4; border-radius: 10px; background: #fff; }
input[type=file] { font: inherit; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.check:hover { border-color: var(--brand); }
.check input { margin-top: 3px; accent-color: var(--brand); width: 16px; height: 16px; }
.check span small { display: block; color: var(--ink-faint); }
fieldset { border: 0; padding: 0; margin: 0; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 6px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; align-items: center; }
.filters input[type=text] { width: 260px; } .filters select { width: auto; min-width: 170px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; padding: 12px 16px; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); background: #fafbfd; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafcff; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- Player ---------- */
.watch { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.player { aspect-ratio: 16 / 9; width: 100%; background: #0b1426; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); position: relative; }
.player iframe, .player video { width: 100%; height: 100%; border: 0; display: block; background: #000; }
.player-fallback { aspect-ratio: 16 / 9; border-radius: var(--radius); display: grid; place-items: center; text-align: center; padding: 30px; background: linear-gradient(135deg, var(--brand-900), var(--brand)); color: #fff; }
.player-fallback h3 { color: #fff; }
.side-list { display: grid; gap: 4px; }
.doc { display: flex; gap: 12px; align-items: center; padding: 11px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); border: 1px solid var(--line); }
.doc:hover { border-color: var(--brand); background: var(--brand-50); }
.doc .icon { color: var(--brand); }
.meta-list { display: grid; gap: 10px; margin: 0; }
.meta-list div { display: flex; justify-content: space-between; gap: 12px; font-size: .88rem; }
.meta-list dt { color: var(--ink-faint); } .meta-list dd { margin: 0; text-align: right; font-weight: 550; }

.empty { text-align: center; padding: 48px 24px; border: 2px dashed var(--line); border-radius: var(--radius); color: var(--ink-soft); background: var(--surface); }
.empty .icon { color: var(--ink-faint); margin-bottom: 8px; }
.empty h3 { margin-bottom: 4px; }
.prose p { max-width: 70ch; } .prose { line-height: 1.7; }
.list-plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.result-group { margin-top: 28px; }
.admin-tile { display: flex; gap: 16px; align-items: flex-start; text-decoration: none; color: inherit; transition: transform .18s, box-shadow .18s; }
.admin-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.admin-tile .app-icon { width: 46px; height: 46px; }
.admin-tile h3 { margin: 0 0 2px; font-size: 1.05rem; }
.stat { font: 600 1.7rem var(--font-display); color: var(--brand); }
.tab-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 22px; }
.tab-nav a { padding: 7px 14px; border-radius: 999px; text-decoration: none; color: var(--ink-soft); border: 1px solid var(--line); background: var(--surface); font-size: .88rem; font-weight: 550; }
.tab-nav a[aria-current="true"] { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ---------- Auth pages ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art {
  position: relative; color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden;
  background: radial-gradient(700px 420px at 90% 8%, color-mix(in srgb, var(--accent) 50%, transparent), transparent 62%), linear-gradient(150deg, var(--brand-900), var(--brand));
}
.auth-art::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(135deg, rgba(255,255,255,.04) 0 2px, transparent 2px 26px); pointer-events: none; }
.auth-art > * { position: relative; z-index: 1; }
.auth-art h1 { color: #fff; font-size: 2.6rem; max-width: 14ch; }
.auth-art p { color: #cfdbf2; max-width: 42ch; font-size: 1.05rem; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; background: var(--surface); }
.auth-box { width: 100%; max-width: 400px; }
.auth-box h2 { font-size: 1.7rem; }
.error-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; text-align: center; }
.error-code { font: 600 5rem/1 var(--font-display); color: var(--brand-100); }

.overlay { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .watch { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 50; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .overlay { display: block; position: fixed; inset: 0; background: rgba(8, 16, 34, .5); z-index: 40; }
  .menu-toggle { display: grid; }
  .topbar { padding: 10px 16px; }
  .content { padding: 22px 16px 48px; }
  .hero { padding: 26px 22px; } .hero h1 { font-size: 1.6rem; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .profile-name { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .filters input[type=text], .filters select { width: 100%; }
}
@media (max-width: 560px) {
  h1 { font-size: 1.5rem; }
  .menu-panel { position: fixed; left: 12px; right: 12px; top: 64px; min-width: 0; }
  .grid-cards { grid-template-columns: 1fr; }
  th, td { padding: 10px 12px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print { .sidebar, .topbar { display: none; } .shell { display: block; } }

/* ---------- Utilities (no inline styles: the CSP forbids them) ---------- */
.p-sm { padding: 10px 12px; margin: 0; }
.mb-sm { margin-bottom: 10px; }
.mt-md { margin-top: 18px; }
.narrow { max-width: 640px; }
.section.group { margin-top: 0; margin-bottom: 34px; }
.auth-note { margin: 0; color: #9fb1d3; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.stack > * + * { margin-top: 16px; }
[hidden] { display: none !important; }
/* wide prose */ .narrow-wide { max-width: 820px; }

/* access matrix */
.matrix { border-collapse: separate; border-spacing: 0; width: 100%; }
.matrix th, .matrix td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: center; vertical-align: middle; }
.matrix thead th { background: var(--brand-50); font-size: .78rem; color: var(--ink-soft); vertical-align: bottom; }
.matrix .matrix-app { text-align: left; min-width: 220px; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.matrix thead .matrix-app { background: var(--brand-50); }
.matrix .matrix-all { background: var(--accent-100); min-width: 110px; }
.matrix .matrix-all small { display: block; font-weight: 400; color: var(--ink-faint); }
.matrix-role { display: inline-block; max-width: 110px; line-height: 1.25; }
.matrix tr.is-everyone .matrix-cell { opacity: .4; }
.matrix tbody tr:hover td, .matrix tbody tr:hover th { background-color: var(--brand-50); }
.tick { display: inline-flex; cursor: pointer; position: relative; }
.tick input { position: absolute; opacity: 0; width: 22px; height: 22px; margin: 0; cursor: pointer; }
.tick span { width: 22px; height: 22px; border-radius: 7px; border: 2px solid #b9c3d3; background: #fff; display: inline-block; transition: all .15s; }
.tick input:checked + span { background: var(--brand); border-color: var(--brand); box-shadow: inset 0 0 0 4px #fff; }
.tick input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.matrix tbody .matrix-app { text-transform: none; letter-spacing: normal; font-size: .95rem; color: var(--ink); font-weight: 400; }
.matrix tbody .matrix-app .small { color: var(--ink-faint); }
.matrix thead th { white-space: normal; min-width: 96px; } .matrix thead .matrix-app { white-space: nowrap; }

.pem { margin: 6px 0 0; padding: 10px 12px; background: var(--brand-50); border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: .72rem; line-height: 1.35; white-space: pre-wrap; word-break: break-all; user-select: all; }
