.bot-route-guild{border:1px solid var(--line,#393033);border-radius:14px;padding:1.1rem;margin:1rem 0}
.bot-route-guild legend{padding:0 .5rem;font-weight:800}
.bot-route-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:.85rem}
.bot-route-grid label{min-width:0}
.task-tag-controls{max-width:280px;min-width:180px}.task-tag-controls summary{cursor:pointer;color:#ff7081;font-size:13px;font-weight:700;padding:10px}.task-tag-controls form{display:grid!important;gap:10px;padding:10px}.task-tag-controls select{width:100%;min-height:110px}.task-tag-controls small{color:#aaa;line-height:1.4}.task-actions{flex-wrap:wrap}.task-actions select{max-width:220px}
.month-calendar{min-width:0;max-width:100%;margin:0 0 28px;border:1px solid #302b2b;border-radius:18px;overflow:hidden;background:#100e0e}
.month-calendar>header{display:flex;justify-content:space-between;align-items:center;gap:20px;padding:24px}
.month-calendar>header p{margin:0 0 8px;color:#ff344e;font-size:12px;font-weight:800;letter-spacing:.14em}
.month-calendar>header h2{margin:0 0 6px;font-size:26px}.month-calendar>header small{color:#aaa}
.month-calendar nav{display:flex;align-items:center;gap:8px}.month-calendar nav a{display:flex;align-items:center;justify-content:center;min-height:42px;min-width:42px;padding:8px 12px;border:1px solid #393030;border-radius:9px;color:#f7f3ef;text-decoration:none}
.month-calendar nav a:hover,.month-calendar nav a:focus-visible{border-color:#ff344e;background:#30151b}
.month-calendar-scroll{max-width:100%;overflow-x:auto}.month-calendar-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));min-width:630px;border-top:1px solid #302b2b}
.month-weekday{padding:14px 10px;text-align:center;color:#aaa;font-size:12px;font-weight:700;border-bottom:1px solid #302b2b}
.month-day{min-height:125px;min-width:0;padding:10px;border-right:1px solid #302b2b;border-bottom:1px solid #302b2b}.month-day:nth-child(7n){border-right:0}.month-day-empty{background:#0b0a0a}.month-day>time{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;margin-bottom:6px;font-size:13px;color:#ddd}.month-day-today>time{background:#ff344e;border-radius:50%;color:#fff;font-weight:800}
.month-entry{display:block;margin:4px 0;padding:7px 8px;border-left:3px solid #ff344e;border-radius:5px;background:#32151b;color:#f7f3ef;text-decoration:none;overflow-wrap:anywhere;line-height:1.3}.month-entry small{display:block;font-size:10px;opacity:.8}.month-entry span{font-size:12px;font-weight:700}.month-entry-birthday{border-color:#d7ae57;background:#2b2415}.month-entry-anniversary{border-color:#67cbb5;background:#152a25}.month-entry:focus-visible{outline:2px solid white;outline-offset:2px}
.month-calendar>footer{display:flex;flex-wrap:wrap;gap:12px 20px;align-items:center;padding:16px 24px;font-size:12px;color:#ff7081}.month-calendar>footer small{color:#aaa}.month-calendar .month-legend-birthday{color:#d7ae57}.month-calendar .month-legend-anniversary{color:#67cbb5}.calendar-event:target{outline:2px solid #ff344e;outline-offset:-2px;scroll-margin-top:24px}
@media(max-width:700px){.month-calendar>header{padding:18px;align-items:flex-start;flex-direction:column;gap:14px}.month-calendar>footer{padding:16px 18px}.month-day{padding:7px;min-height:110px}}
:root {
  color-scheme: dark;
  --bg: #070707;
  --panel: #0e0e0f;
  --panel-2: #141416;
  --panel-3: #1b1b1e;
  --ink: #f6f3ee;
  --muted: #aaa5a0;
  --quiet: #716d69;
  --line: #2b2928;
  --line-hot: #56302b;
  --red: #c73636;
  --orange: #ff7224;
  --green: #5de299;
  --blue: #75a7ff;
  --purple: #bd8cff;
  --signal: linear-gradient(90deg, var(--red), var(--orange));
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --surface-glow: linear-gradient(145deg, rgba(255,255,255,.032), transparent 42%);
  --panel-shadow: 0 18px 55px rgba(0,0,0,.22);
  font-family: Inter, "Inter Tight", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); scrollbar-gutter: stable; }
/* Use ordinary navigation: whole-page snapshot crossfades cause visible
   ghosting and flashes when the old and new layouts overlap. */
@view-transition { navigation: none; }
.vault-picker>summary{cursor:pointer;width:fit-content;margin:12px 0;list-style:none}
.vault-picker>summary::after{content:' +';margin-left:10px}.vault-picker[open]>summary::after{content:' −'}
.vault-picker .vault-file-gallery{margin-top:16px}.task-quick-complete{display:block!important;margin:12px 0}
.task-edit-controls>summary{cursor:pointer;padding:10px 0}.bug-review-link{margin:4px 8px 4px 0}

/* 6.1 personal workspace: readable groups with explicit states and mobile stacking. */
.workspace-columns{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr));gap:24px}
.workspace-columns details,.workspace-columns>article{padding:20px;border:1px solid var(--border,#343438);border-radius:12px;min-width:0}
.workspace-columns summary{font-weight:700;cursor:pointer;display:flex;justify-content:space-between;gap:12px;padding-bottom:16px}
.workspace-columns article{padding:16px 0;overflow-wrap:anywhere}
.workspace-columns article+article{border-top:1px solid var(--border,#343438)}
.workspace-columns small{display:block;margin-top:8px;line-height:1.6}
.workspace-unread{border-left:3px solid #ff414b;padding-left:12px!important}
.health-recent{color:#60d49b}.health-attention{color:#eab65c}
.integration-health .workspace-columns{gap:16px;align-items:start}
.portal-page .integration-health .workspace-columns>article{padding:18px;border:1px solid var(--line);background:var(--panel);border-radius:12px;min-width:0}
.integration-health h3{margin:0 0 12px}
.integration-health .health-count{display:flex;justify-content:space-between;gap:12px;margin-bottom:4px}
.portal-page .integration-health details{padding:0;margin-top:16px;border:0;border-radius:0}
.integration-health summary{padding:10px 0;min-height:44px;display:list-item}
.health-deliveries{list-style:none;padding:0;margin:0;display:grid;gap:12px}
.health-deliveries li{border-top:1px solid var(--line);padding-top:12px}
.health-state{display:inline-block;border:1px solid currentColor;border-radius:6px;padding:5px 8px;font-size:.85rem;line-height:1.5}
.health-state-success{color:#60d49b}.health-state-attention{color:#eab65c}.health-state-queued{color:#9bc9ff}.health-state-neutral{color:var(--muted)}
[data-theme="light"] .health-state-success{color:#17643d}[data-theme="light"] .health-state-attention{color:#7a4a06}[data-theme="light"] .health-state-queued{color:#1d5091}
[data-theme="light"] .integration-health .health-attention{color:#7a4a06}[data-theme="light"] .integration-health .health-recent{color:#17643d}
.feedback-media-note{font-size:.9rem;line-height:1.6;color:var(--muted);overflow-wrap:anywhere}
.feedback-upload-tile{min-width:0;overflow-wrap:anywhere}
.feedback-upload-tile button{min-height:44px}.feedback-upload-tile small{display:block;padding:6px 0}
.feedback-video [role="status"]{margin:0;font-size:.9rem;line-height:1.6;overflow-wrap:anywhere}
@media(max-width:600px){.portal-page .integration-health .workspace-columns>article{padding:14px}.feedback-upload-gallery{grid-template-columns:repeat(2,minmax(0,1fr))}.feedback-image-gallery{grid-template-columns:1fr!important}}
.saved-filter-tools{display:flex;flex-wrap:wrap;align-items:end;gap:12px;padding:16px 0 24px}
.saved-filter-tools label{display:grid;gap:8px}.saved-filter-tools select,.saved-filter-tools input{max-width:280px;padding:10px;background:var(--panel,#141416);color:inherit;border:1px solid var(--border,#343438);border-radius:6px}
.document-reading-tools{display:grid;gap:12px;padding:16px 12px}.document-reading-tools small{line-height:1.6}.document-reading-tools button{white-space:normal;text-align:left}
.document-reading-layout{column-gap:40px!important;grid-template-columns:minmax(240px,300px) minmax(0,1fr)}
.document-outline a{padding:12px 14px!important;line-height:1.6!important}.document-reading-body{min-width:0}
.transcript-person-avatar img{width:100%;height:100%;border-radius:50%;object-fit:cover}
@media(max-width:1100px){.document-reading-layout{grid-template-columns:230px minmax(0,1fr);column-gap:24px!important}}
@media(max-width:950px){.document-reading-layout{display:block!important}.workspace-columns{grid-template-columns:1fr}.saved-filter-tools>*{max-width:100%}.personal-inbox header{flex-wrap:wrap;gap:16px}}
body { min-height: 100vh; margin: 0; color: var(--ink); background: var(--bg); }
button, input, select, textarea { font: inherit; }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

/* Keep navigation visually stable on compact devices while the next view loads. */
@media (max-width: 820px) {
  html { scrollbar-gutter: stable; }
  .portal-main { min-height: 100vh; }
  .portal-content { min-height: 100vh; overflow-x: clip; }
  .page-heading { min-height: 178px; }
}

/* Authentication */
.portal-content .birthday-visibility-note { margin:0 0 24px; line-height:1.6; }
.auth-page { background: radial-gradient(circle at 80% 5%, rgba(199,54,54,.09), transparent 34%), radial-gradient(circle at 10% 90%, rgba(255,114,36,.045), transparent 28%), var(--bg); }
.auth-shell { position: relative; min-height: 100vh; display: grid; grid-template-columns: minmax(0, 650px); align-items: center; justify-content: center; padding: 30px; overflow: hidden; background-image: linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px); background-size: 52px 52px; }
.auth-matrix-field { position: absolute; inset: 0; z-index: 0; display: flex; justify-content: space-around; overflow: hidden; pointer-events: none; opacity: .34; }
.auth-matrix-field::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(180deg, transparent 0, transparent 4px, rgba(255,114,36,.035) 5px); mix-blend-mode: screen; }
.auth-matrix-field::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 0%, rgba(255,114,36,.08) 48%, transparent 58%); animation: matrixScan 5s linear infinite; }
.auth-matrix-field i { width: 54px; margin-top: -30vh; color: var(--orange); font: 700 .62rem/2.2 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .24em; white-space: pre-wrap; writing-mode: vertical-rl; text-orientation: upright; animation: matrixDrop 7s linear infinite; text-shadow: 0 0 8px rgba(255,114,36,.5); }
.auth-matrix-field i:nth-child(2n) { color: var(--red); animation-delay: -2.1s; animation-duration: 10s; }
.auth-matrix-field i:nth-child(3n) { animation-delay: -5s; animation-duration: 12s; }
.auth-command-rail, .auth-card { z-index: 1; }
.auth-command-rail { min-height: 548px; padding: 28px 24px; display: flex; flex-direction: column; background: rgba(10,10,11,.96); border: 1px solid var(--line); border-right: 0; box-shadow: 0 40px 110px rgba(0,0,0,.45); }
.command-rail-kicker { display: flex; align-items: center; gap: 9px; color: var(--quiet); font-size: .62rem; font-weight: 850; letter-spacing: .14em; }
.command-rail-kicker .status-dot { width: 7px; height: 7px; }
.auth-command-rail h2 { margin: 62px 0 8px; font-size: 1.45rem; letter-spacing: -.03em; }
.command-rail-copy { margin: 0; color: var(--muted); font-size: .76rem; line-height: 1.55; }
.command-status-stack { margin-top: 28px; display: grid; gap: 8px; }
.command-status-card { padding: 11px; display: grid; grid-template-columns: 28px minmax(0,1fr) auto; gap: 9px; align-items: center; background: rgba(255,255,255,.025); border: 1px solid rgba(255,255,255,.08); border-left: 2px solid rgba(199,54,54,.42); }
.command-status-icon { color: var(--red); font-size: .58rem; font-weight: 850; }
.command-status-card div { min-width: 0; }
.command-status-card strong, .command-status-card small { display: block; }
.command-status-card strong { overflow: hidden; font-size: .69rem; text-overflow: ellipsis; white-space: nowrap; }
.command-status-card small { margin-top: 3px; color: var(--quiet); font-size: .61rem; }
.command-status-live { color: var(--green); font-size: .56rem; letter-spacing: .08em; }
.command-brief-toggle { margin-top: 18px; padding: 10px 0; display: flex; align-items: center; justify-content: space-between; color: var(--muted); background: transparent; border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; font-size: .68rem; font-weight: 800; text-align: left; }
.command-brief-toggle:hover { color: var(--red); }
.command-brief-toggle span:last-child { color: var(--red); font-size: 1rem; }
.command-brief { padding: 13px 0 0; color: var(--muted); font-size: .69rem; line-height: 1.55; }
.command-brief strong { color: var(--ink); }
.command-brief p { margin: 5px 0 0; }
.command-rail-footer { margin-top: auto; padding-top: 22px; display: flex; justify-content: space-between; color: var(--quiet); font-size: .57rem; font-weight: 800; letter-spacing: .09em; }
.command-status-card { transition: border-color .18s ease, transform .18s ease, background .18s ease; }
.command-status-card:hover { transform: translateX(3px); background: rgba(199,54,54,.055); border-color: rgba(199,54,54,.35); }
.auth-card { position: relative; width: min(100%, 650px); min-height: 548px; padding: clamp(34px, 5vw, 62px); background: rgba(14,14,15,.98); border: 1px solid var(--line); box-shadow: 0 40px 110px rgba(0,0,0,.55); }
.auth-loading { display:flex; align-items:center; gap:12px; margin-top:20px; padding:14px 16px; color:var(--ink); background:var(--panel-2); border:1px solid var(--line); border-radius:10px; text-align:left; }
.auth-loading strong { display:block; font-size:.9rem; font-weight:650; }
.auth-loading-spinner { flex:0 0 auto; width:22px; height:22px; border:2px solid var(--line); border-top-color:#991b1b; border-radius:50%; animation:authOrbit .9s linear infinite; }
.auth-loading .auth-loading-caption { display:block; margin-top:4px; color:var(--muted); font-size:.78rem; line-height:1.5; }
@media(prefers-reduced-motion:reduce) { .auth-loading-spinner { animation:none; } }
.auth-loading-core { position: relative; width: 116px; height: 116px; display: grid; place-items: center; margin-bottom: 28px; }
.auth-loading-mark { width: 48px; height: 48px; display: grid; place-items: center; color: var(--ink); border: 1px solid rgba(199,54,54,.65); border-radius: 50%; font-size: .7rem; font-weight: 900; letter-spacing: .12em; box-shadow: 0 0 24px rgba(199,54,54,.16); }
.auth-loading-orbit { position: absolute; inset: 0; border: 1px solid rgba(199,54,54,.35); border-left-color: transparent; border-radius: 50%; animation: authOrbit 1.4s linear infinite; }
.auth-loading-orbit-two { inset: 12px; border-color: rgba(255,114,36,.3); border-right-color: transparent; animation-direction: reverse; animation-duration: 1s; }
.auth-loading > p { margin: 0 0 10px; color: var(--red); font-size: .66rem; font-weight: 900; letter-spacing: .2em; }
.auth-loading h2 { margin: 0; font-size: clamp(1.7rem, 4vw, 2.5rem); letter-spacing: -.04em; }
.auth-loading-caption { margin-top: 11px; color: var(--muted); font-size: .8rem; }
.auth-loading-progress { width: min(100%, 360px); height: 3px; margin-top: 28px; overflow: hidden; background: #232123; }
.auth-loading-progress span { display: block; width: 36%; height: 100%; background: var(--signal); animation: authProgress 1.5s ease-in-out infinite; }
.auth-loading-steps { width: min(100%, 360px); margin-top: 19px; display: grid; gap: 7px; color: var(--quiet); font-size: .64rem; letter-spacing: .04em; text-align: left; }
.auth-loading-steps span { opacity: .45; transition: color .2s ease, opacity .2s ease; }
.auth-loading-steps span:first-child { color: var(--ink); opacity: 1; }
@keyframes authOrbit { to { transform: rotate(360deg); } }
@keyframes authProgress { 0% { transform: translateX(-120%); } 100% { transform: translateX(320%); } }
@keyframes matrixDrop { from { transform: translateY(-12vh); opacity: 0; } 15% { opacity: .7; } 85% { opacity: .4; } to { transform: translateY(125vh); opacity: 0; } }
@keyframes matrixScan { from { transform: translateY(-100%); } to { transform: translateY(100%); } }
.auth-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 2px; background: var(--signal); }
.classified-strip { margin: -20px 0 30px; display: flex; align-items: center; gap: 12px; color: var(--quiet); font-size: .69rem; font-weight: 800; letter-spacing: .18em; }
.classified-strip span { height: 1px; flex: 1; background: var(--line); }
.staff-brand { display: inline-flex; align-items: center; gap: 13px; color: var(--ink); text-decoration: none; font-weight: 850; letter-spacing: .08em; }
.staff-brand img { width: 28px; height: 48px; object-fit: contain; }
.staff-brand small { margin-left: 5px; color: var(--red); font-size: .62em; }
.auth-heading { margin: 54px 0 32px; }
.auth-heading p, .page-heading > div > p, .action-panel header p, .overview-panel > header p { margin: 0 0 12px; color: var(--red); font-size: .76rem; font-weight: 850; letter-spacing: .16em; }
.auth-heading h1 { max-width: 100%; margin: 0; overflow-wrap: anywhere; font-size: clamp(2.55rem, 5.2vw, 4rem); line-height: .96; letter-spacing: -.045em; }
.auth-heading span { display: block; margin-top: 18px; color: var(--muted); line-height: 1.6; }
.auth-card form { display: grid; gap: 18px; }
.auth-discord { margin-top: 4px; }
.local-login-toggle { width: 100%; margin-top: 14px; padding: 8px; color: var(--quiet); background: transparent; border: 0; cursor: pointer; font-size: .74rem; text-decoration: underline; text-underline-offset: 4px; }
.local-recovery { margin-top: 14px; padding-top: 20px; border-top: 1px solid var(--line); }
.security-grid { margin-top: 30px; padding-top: 20px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; border-top: 1px solid var(--line); color: var(--quiet); font-size: .66rem; font-weight: 800; letter-spacing: .09em; text-align: center; }
.auth-consent { margin: 0 0 14px; color: var(--quiet); font-size: .71rem; line-height: 1.55; text-align: center; }
.auth-consent a { color: #c9c3bd; text-underline-offset: 3px; }
.error-card { overflow: hidden; }
.error-card .auth-heading { margin-top: 10px; }
.error-card .auth-heading h1 { font-size: clamp(2.2rem, 4.8vw, 3.65rem); }
.error-help { margin: -6px 0 24px; padding: 17px 19px; color: var(--muted); background: #09090a; border: 1px solid var(--line); font-size: .8rem; line-height: 1.5; }
.error-help strong { color: var(--ink); }
.error-help p { margin: 8px 0 0; }
.error-help ol { margin: 10px 0 0; padding-left: 19px; }
.error-help li + li { margin-top: 5px; }

/* Forms and buttons */
label { display: grid; gap: 8px; color: #d1ccc6; font-size: .88rem; font-weight: 700; }
input, select, textarea { width: 100%; min-height: 50px; padding: 0 14px; color: var(--ink); background: #09090a; border: 1px solid #393637; border-radius: 2px; outline: none; }
textarea { padding-block: 14px; resize: vertical; line-height: 1.6; }
select { appearance: none; padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px; background-size: 5px 5px; background-repeat: no-repeat; }
input:focus, select:focus, textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(199,54,54,.12); }
.file-picker-control { position: relative; min-height: 58px; padding: 8px; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 14px; color: var(--muted); background: #09090a; border: 1px solid #393637; cursor: pointer; overflow: hidden; }
.file-picker-control:focus-within { border-color: var(--red); box-shadow: 0 0 0 3px rgba(199,54,54,.12); }
.file-picker-control input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; padding: 0; opacity: 0; cursor: pointer; }
.file-picker-button { min-height: 40px; padding: 0 15px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); background: var(--panel-3); border: 1px solid #454143; font-size: .78rem; font-weight: 800; }
.file-picker-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; font-weight: 500; }
button, .primary-link, .secondary-link { border-radius: 2px; }
.primary-button, .primary-link, .discord-button { min-height: 48px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: space-between; gap: 28px; color: #fff; background: var(--red); border: 0; cursor: pointer; font-weight: 800; text-decoration: none; }
.primary-button:hover, .primary-link:hover { background: var(--orange); }
.publish-button { min-height: 48px; padding: 0 20px; display: inline-flex; align-items: center; justify-content: center; gap: 18px; color: #07130d; background: var(--green); border: 1px solid #7cf0ae; cursor: pointer; font-weight: 900; text-decoration: none; }
.publish-button:hover { background: #7cf0ae; }
.publish-button.compact, .primary-button.compact { min-height: 40px; }
.delete-button { min-height: 40px; padding: 0 14px; color: #ff9ca4; background: rgba(199,54,54,.07); border: 1px solid rgba(199,54,54,.35); cursor: pointer; font-size: .8rem; font-weight: 800; }
.delete-button:hover { color: #fff; background: rgba(199,54,54,.17); border-color: var(--red); }
.secondary-button, .secondary-link, .quiet-button, .file-actions > a, .file-actions > button { min-height: 40px; padding: 0 13px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); background: var(--panel-3); border: 1px solid var(--line); cursor: pointer; font-size: .8rem; font-weight: 750; text-decoration: none; }
.secondary-button:hover, .secondary-link:hover, .quiet-button:hover, .file-actions > a:hover, .file-actions > button:hover { border-color: #5b5552; background: #222226; }
button:disabled { cursor: not-allowed; opacity: .4; }
.icon-button { width: 42px; height: 42px; padding: 0; display: grid; place-items: center; color: var(--muted); background: transparent; border: 1px solid var(--line); cursor: pointer; font-size: 1.4rem; }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.alert, .flash { min-width: 0; padding: 14px 16px; overflow-wrap: anywhere; color: #f5d9d5; background: rgba(199,54,54,.09); border-left: 2px solid var(--red); line-height: 1.5; }
.flash { margin: 0 0 28px; color: #ffe1ce; border-color: var(--orange); background: rgba(255,114,36,.08); }
.flash.error { color: #f5d9d5; border-color: var(--red); background: rgba(199,54,54,.09); }
code { color: #fff; background: rgba(255,255,255,.06); padding: .12em .35em; overflow-wrap: anywhere; }

/* Portal frame */
.portal-shell { min-height: 100vh; display: grid; grid-template-columns: 280px minmax(0, 1fr); }
.portal-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 10; width: 280px; padding: 30px 22px 24px; display: flex; flex-direction: column; overflow-y: auto; background: #0a0a0b; border-right: 1px solid var(--line); }
.portal-sidebar::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 2px; background: var(--signal); }
.portal-sidebar .staff-brand { padding: 0 10px; }
.identity-card { position: relative; margin: 36px 0 28px; padding: 18px 14px 44px; display: grid; grid-template-columns: 38px 1fr; gap: 11px; align-items: center; background: var(--panel); border: 1px solid var(--line); }
.identity-link { color: inherit; text-decoration: none; }
.identity-link:hover { border-color: var(--line-hot); background: var(--panel-2); }
.identity-avatar-image { object-fit: cover; }
.identity-avatar { width: 38px; height: 38px; display: grid; place-items: center; color: #fff; background: var(--signal); font-weight: 900; }
.identity-card div { min-width: 0; }
.identity-card strong, .identity-card span { display: block; }
.identity-card div strong { overflow: hidden; font-size: .9rem; text-overflow: ellipsis; white-space: nowrap; }
.identity-card div span { margin-top: 3px; overflow: hidden; color: var(--quiet); font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.role-badge { position: absolute; inset: auto 0 0; height: 31px; padding: 0 13px; display: flex; align-items: center; color: #ff9ca4; background: rgba(199,54,54,.08); border-top: 1px solid rgba(199,54,54,.18); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; }
.role-lead { color: #ffc091; background: rgba(255,114,36,.08); }
.role-staff { color: #a9c7ff; background: rgba(117,167,255,.08); }
.portal-nav { display: grid; gap: 5px; }
.portal-nav a { position: relative; padding: 13px 12px; display: flex; align-items: center; gap: 13px; color: var(--muted); text-decoration: none; font-size: .9rem; font-weight: 700; }
.portal-nav a span { width: 22px; color: #5f5b58; font-size: .67rem; letter-spacing: .08em; }
.portal-nav a:hover { color: var(--red); background: var(--panel); }
.portal-nav a:hover span { color: var(--red); }
.portal-nav a[aria-current="page"] { color: var(--ink); background: var(--panel-2); }
.portal-nav a[aria-current="page"]::after { content: ""; position: absolute; inset: 0 0 0 auto; width: 2px; background: var(--red); }
.portal-nav a[aria-current="page"] span { color: #5f5b58; }
.portal-nav a[aria-current="page"]:hover, .portal-nav a[aria-current="page"]:hover span { color: var(--red); }

.discord-settings-stack > .integration-card form > .primary-button { display: none; }
.discord-settings-stack .staff-role-mapper { display: none; }
.portal-role-map-help { display: flex; justify-content: space-between; gap: 24px; margin: 0 0 18px; padding: 16px 18px; border: 1px solid rgba(199, 54, 54, .2); border-radius: 14px; background: linear-gradient(100deg, rgba(199, 54, 54, .07), rgba(15, 15, 17, .96)); }
.portal-role-map-help strong { color: var(--ink); }
.portal-role-map-help span { max-width: 620px; color: var(--muted); font-size: .85rem; line-height: 1.55; }
.portal-role-map-guilds { display: grid; gap: 14px; }
.portal-role-map-guild { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: rgba(9, 9, 10, .88); }
.portal-role-map-guild > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 18px; border-bottom: 1px solid var(--line); background: rgba(20, 20, 22, .96); }
.portal-role-map-guild > header div { display: grid; gap: 3px; }
.portal-role-map-guild > header small, .portal-role-map-guild > header > span { color: var(--muted); font-size: .72rem; }
.portal-role-map-guild > header > span { padding: 5px 9px; border-radius: 999px; background: var(--panel-2); }
.portal-role-map-rows { display: grid; }
.portal-role-map-rows > label, .fallback-role-map { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(220px, 320px); align-items: center; gap: 18px; margin: 0; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.portal-role-map-rows > label:last-child { border-bottom: 0; }
.portal-role-map-rows > label > span, .fallback-role-map > span { display: grid; gap: 2px; }
.portal-role-map-rows small, .fallback-role-map small { color: var(--muted); font-size: .7rem; font-weight: 500; }
.settings-save-bar { position: sticky; z-index: 8; bottom: 18px; display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 18px; padding: 15px 18px; border: 1px solid rgba(199, 54, 54, .28); border-radius: 16px; background: rgba(14, 14, 16, .96); box-shadow: 0 18px 48px rgba(0, 0, 0, .48); backdrop-filter: blur(16px); }
.settings-save-bar > div { display: grid; gap: 3px; }
.settings-save-bar span { color: var(--muted); font-size: .78rem; }
.settings-save-bar button[aria-busy="true"] { opacity: .72; cursor: wait; }
.discord-security-summary { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin: 16px 0; padding: 14px 18px; border: 1px solid var(--line); border-radius: 14px; background: rgba(12, 12, 14, .9); }
.discord-security-summary > div { display: grid; gap: 2px; min-width: 130px; }
.discord-security-summary span { color: var(--muted); font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.discord-security-summary p { margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.5; }
.mfa-compliance-overview { margin: 24px 0 0; padding: 20px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px 16px 5px 16px; background: radial-gradient(circle at 100% 0, rgba(199,54,54,.07), transparent 34%), rgba(10,10,12,.9); }
.mfa-compliance-overview > header { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.mfa-compliance-overview > header p { margin: 0 0 5px; color: var(--red); font-size: .67rem; font-weight: 850; letter-spacing: .12em; }
.mfa-compliance-overview > header h2 { margin: 0; font-size: 1.35rem; }
.mfa-compliance-overview > header > span { color: var(--muted); font-size: .76rem; }
.mfa-compliance-overview > div { margin-top: 16px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--line); }
.mfa-compliance-overview article { padding: 15px; display: grid; gap: 4px; background: #101012; }
.mfa-compliance-overview article strong { font-size: 1.45rem; }
.mfa-compliance-overview article span { color: var(--muted); font-size: .7rem; }
.mfa-compliance-overview article.complete strong { color: var(--green); }
.mfa-compliance-overview article.attention strong { color: #ff6975; }
.mfa-compliance-overview article.pending strong { color: var(--orange); }
.mfa-compliance-overview > p { margin: 14px 0 0; color: var(--quiet); font-size: .72rem; line-height: 1.5; }
.member-compliance { min-width: 0; display: grid; justify-items: start; gap: 6px; }
.member-compliance .agreement-state { margin: 0 !important; }
.mfa-state { padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: rgba(255,255,255,.025); font-size: .61rem; font-style: normal; font-weight: 800; white-space: nowrap; }
.mfa-state.enabled { color: #91e8b8; border-color: rgba(93,226,153,.25); background: rgba(93,226,153,.07); }
.mfa-state.disabled { color: #ff9ca4; border-color: rgba(199,54,54,.3); background: rgba(199,54,54,.08); }
.mfa-state.unknown { color: #ffc091; border-color: rgba(255,114,36,.28); background: rgba(255,114,36,.07); }
.agreement-history-panel { margin-top: 22px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px 16px 5px 16px; background: rgba(10,10,12,.9); }
.agreement-history-panel > header { padding: 18px 20px; display: flex; align-items: end; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); background: none; }
.agreement-history-panel > header p { margin: 0 0 5px; color: var(--red); font-size: .67rem; font-weight: 850; letter-spacing: .12em; }
.agreement-history-panel > header h2 { margin: 0; font-size: 1.35rem; }
.agreement-history-panel > header > span { color: var(--muted); font-size: .72rem; }
.agreement-history-table { min-width: 0; }
.agreement-history-head, .agreement-history-row { padding: 12px 20px; display: grid; grid-template-columns: 90px minmax(170px,1fr) minmax(140px,.8fr) auto; gap: 16px; align-items: center; border-bottom: 1px solid var(--line); }
.agreement-history-head { color: var(--quiet); font-size: .65rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.agreement-history-row:last-child { border-bottom: 0; }
.agreement-history-row time { color: var(--muted); font-size: .76rem; }
.agreement-history-row code { font-size: .7rem; }
.agreement-snapshot { white-space: normal; line-height: 1.75; }

@media (max-width: 680px) {
  .portal-role-map-help, .settings-save-bar, .discord-security-summary, .mfa-compliance-overview > header { align-items: flex-start; flex-direction: column; }
  .portal-role-map-rows > label, .fallback-role-map { grid-template-columns: 1fr; gap: 8px; }
  .settings-save-bar button { width: 100%; }
  .mfa-compliance-overview > div { grid-template-columns: 1fr 1fr; }
  .agreement-history-head { display: none; }
  .agreement-history-row { grid-template-columns: 1fr; gap: 7px; }
}
.sidebar-foot { margin-top: auto; padding: 16px 10px 0; display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); }
.portal-nav { gap: 3px; }
.portal-nav > .nav-link { min-height: 42px; padding-block: 9px; font-size: .84rem; }
.sidebar-legal { margin: 0 12px 8px; justify-content: flex-start; font-size: .6rem; }
.sidebar-legal a { font-size: .6rem; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 14px rgba(93,226,153,.65); }
.sidebar-foot strong, .sidebar-foot small { display: block; }
.sidebar-foot strong { font-size: .78rem; }
.sidebar-foot small { margin-top: 3px; color: var(--quiet); font-size: .68rem; }
.secure-workspace { padding: 14px 10px 8px; }
.sidebar-legal { padding: 0 10px 4px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.sidebar-legal a { color: var(--quiet); font-size: .64rem; text-decoration: none; }
.sidebar-legal a:hover { color: var(--ink); }
.nav-group { display: grid; }
.nav-folder { margin: 0; }
.nav-folder > summary { min-height: 46px; padding: 10px 12px; display: grid; grid-template-columns: 25px minmax(0, 1fr) auto; align-items: center; gap: 8px; color: var(--muted); border: 1px solid transparent; cursor: pointer; font-size: .92rem; font-weight: 750; list-style: none; }
.nav-folder > summary::-webkit-details-marker { display: none; }
.nav-folder > summary:hover, .nav-folder[open] > summary { color: var(--ink); background: var(--panel); border-color: var(--line); }
.nav-folder > summary span { color: var(--quiet); font-size: .62rem; font-weight: 850; }
.nav-folder > summary b { color: var(--quiet); transition: transform .18s ease; }
.nav-folder[open] > summary b { transform: rotate(180deg); }
.portal-subnav { margin: 2px 0 6px 30px; display: grid; border-left: 1px solid var(--line); }
.portal-subnav .nav-link { min-height: 34px; padding: 7px 10px; font-size: .72rem; }
.portal-subnav .nav-link b { font-size: .6rem; }
.photo-vault-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.photo-vault-grid > article { min-width: 0; overflow: hidden; background: var(--panel); border: 1px solid var(--line); }
.photo-preview { width: 100%; aspect-ratio: 4 / 3; padding: 0; display: block; overflow: hidden; border: 0; background: #050505; cursor: zoom-in; }
.photo-preview img { width: 100%; height: 100%; display: block; object-fit: cover; }
.photo-copy { min-width: 0; padding: 16px; }
.photo-copy h2 { margin: 10px 0 6px; overflow-wrap: anywhere; font-size: 1rem; }
.photo-copy small { color: var(--quiet); }
.photo-actions { padding: 0 16px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.photo-actions > a, .photo-actions > button { color: var(--ink); background: transparent; border: 0; font-size: .72rem; font-weight: 800; text-decoration: none; cursor: pointer; }
.photo-actions form { margin: 0; }
.photo-vault-grid .inline-access { margin: 0 16px 16px; }
.portal-main { grid-column: 2; min-width: 0; }
.portal-topbar { min-height: 80px; padding: 0 clamp(26px, 4vw, 60px); display: flex; align-items: center; justify-content: space-between; gap: 30px; background: rgba(7,7,7,.92); border-bottom: 1px solid var(--line); }
.portal-topbar > div span, .portal-topbar > div strong { display: block; }
.portal-topbar > div span { color: var(--quiet); font-size: .68rem; font-weight: 800; letter-spacing: .14em; }
.portal-topbar > div strong { margin-top: 4px; font-size: .84rem; }
.portal-topbar form { margin: 0; }
.mobile-menu { display: none; }
.portal-content { width: min(calc(100% - 2 * clamp(26px, 4vw, 60px)), 1500px); margin: 0 auto; padding: clamp(44px, 6vw, 84px) 0 100px; }

/* Common content */
.page-heading { display: flex; justify-content: space-between; gap: 50px; align-items: flex-end; }
.page-heading.compact { padding-bottom: 34px; border-bottom: 1px solid var(--line); }
.page-heading h1 { max-width: 900px; margin: 0; font-size: clamp(2.8rem, 6vw, 6.7rem); line-height: .88; letter-spacing: -.065em; }
.page-heading.compact h1 { font-size: clamp(2.6rem, 4.6vw, 5rem); }
.page-heading > div > span { display: block; margin-top: 18px; color: var(--muted); font-size: 1rem; line-height: 1.55; }
.clearance-card { width: min(100%, 300px); min-height: 158px; padding: 26px; display: flex; flex-direction: column; justify-content: flex-end; color: #fff; background: linear-gradient(145deg, rgba(199,54,54,.18), rgba(255,114,36,.05)), var(--panel); border: 1px solid var(--line-hot); font-size: 1.45rem; }
.clearance-card small { margin-bottom: auto; color: var(--red); font-size: .66rem; letter-spacing: .15em; }
.clearance-card span { margin-top: 8px; color: var(--muted); font-size: .78rem; font-weight: 500; }
.metric-grid { margin-top: 54px; display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); }
.metric-grid article { min-height: 190px; padding: 24px; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--panel); }
.metric-grid article:last-child { border-right: 0; }
.metric-grid article > span { color: var(--red); font-size: .68rem; font-weight: 800; }
.metric-grid strong { margin-top: auto; font-size: 2.4rem; letter-spacing: -.04em; }
.metric-grid p { margin: 4px 0; font-weight: 700; }
.metric-grid small { color: var(--quiet); }
.overview-grid { margin-top: 34px; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.overview-panel { border: 1px solid var(--line); background: var(--panel); }
.overview-panel > header { padding: 20px 22px; display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); }
.overview-panel > header p { margin: 0; }
.overview-panel > header a { color: var(--muted); font-size: .75rem; text-decoration: none; }
.activity-panel { margin-top: 24px; }
.activity-panel > header { align-items: end; }
.activity-panel > header h2 { margin: 4px 0 0; font-size: 1.15rem; }
.activity-panel > header > span { color: var(--quiet); font-size: .72rem; }
.activity-feed { display: grid; }
.activity-feed article { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 15px 22px; border-bottom: 1px solid rgba(43,41,40,.72); }
.activity-feed article:last-child { border-bottom: 0; }
.activity-feed article > div { display: grid; gap: 4px; min-width: 0; }
.activity-feed strong { font-size: .84rem; }
.activity-feed small { color: var(--quiet); font-size: .7rem; }
.activity-feed code { max-width: 280px; overflow: hidden; color: var(--quiet); font-size: .66rem; text-overflow: ellipsis; white-space: nowrap; }
.activity-signal { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 12px rgba(255,114,36,.55); }
.command-trigger { margin-left: auto; padding: 9px 12px; display: inline-flex; align-items: center; gap: 8px; color: var(--muted); background: rgba(255,255,255,.02); border: 1px solid var(--line); border-radius: 9px; font: inherit; font-size: .72rem; cursor: pointer; }
.command-trigger:hover, .command-trigger:focus-visible { color: var(--ink); border-color: var(--line-hot); }
.command-trigger span { color: var(--orange); font-size: 1rem; }
.command-trigger kbd { padding: 2px 5px; color: var(--quiet); border: 1px solid var(--line); border-radius: 4px; font-size: .62rem; }
.command-palette { position: fixed; inset: 0; z-index: 30; display: grid; place-items: start center; padding-top: 12vh; background: rgba(0,0,0,.72); backdrop-filter: blur(8px); }
.command-palette-card { width: min(680px, calc(100vw - 32px)); overflow: hidden; border: 1px solid var(--line-hot); border-radius: 16px; background: #101012; box-shadow: 0 28px 100px rgba(0,0,0,.55); }
.command-palette-card > header { padding: 18px 20px; display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); }
.command-palette-card h2 { margin: 4px 0 0; font-size: 1.2rem; }
.command-palette-card header p { margin: 0; color: var(--red); font-size: .68rem; font-weight: 850; letter-spacing: .14em; }
.command-search { margin: 16px 20px; }
.command-search input { padding: 14px 15px; font-size: 1rem; }
.command-tools { padding: 0 20px 12px; display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--quiet); font-size: .68rem; }
.command-results { max-height: 420px; overflow: auto; border-top: 1px solid var(--line); }
.command-results a, .command-results form > button, .command-results .command-history { width: 100%; padding: 13px 20px; display: grid; grid-template-columns: 110px minmax(0, 1fr) minmax(0, 170px); gap: 12px; align-items: center; color: inherit; background: transparent; border: 0; border-bottom: 1px solid rgba(43,41,40,.72); text-align: left; text-decoration: none; font: inherit; cursor: pointer; }
.command-results a:hover, .command-results a:focus-visible, .command-results button:hover, .command-results button:focus-visible { background: rgba(255,114,36,.07); outline-color: var(--orange); }
.command-results a span, .command-results button span, .command-results a small, .command-results button small { color: var(--quiet); font-size: .7rem; }
.command-results a strong, .command-results button strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.command-results .command-history { grid-template-columns: 110px minmax(0, 1fr); }
@media (max-width: 620px) { .command-results a, .command-results form > button { grid-template-columns: 75px minmax(0, 1fr); } .command-results a small, .command-results button small { grid-column: 2; } .command-tools small { display: none; } }
.case-list { margin-top: 28px; display: grid; gap: 14px; }
.case-list article { padding: 20px; border: 1px solid var(--line); border-left: 3px solid var(--orange); border-radius: 12px 5px 12px 5px; background: var(--panel); }
.case-list article > header { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.case-list article > header > div { display: flex; flex-wrap: wrap; gap: 8px; }
.case-list article h2 { margin: 15px 0 8px; font-size: 1.08rem; }
.case-list article p { max-width: 850px; margin: 0; color: var(--muted); line-height: 1.55; white-space: pre-wrap; }
.case-list article small, .case-list article time { color: var(--quiet); font-size: .7rem; }
.case-update-form { margin-top: 17px; padding-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--line); }
.case-update-form select { width: auto; min-width: 130px; }
.case-priority-urgent { color: #ff9da4; border-color: rgba(199,54,54,.35); }
.case-priority-high { color: var(--orange); border-color: rgba(255,114,36,.35); }
.case-status-resolved, .case-status-closed { color: var(--green); border-color: rgba(93,226,153,.3); }
.mini-list > a { min-height: 74px; padding: 12px 18px; display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; align-items: center; border-bottom: 1px solid var(--line); text-decoration: none; }
.mini-list > a:last-child { border-bottom: 0; }
.mini-list > a > span, .file-type { width: 42px; height: 42px; display: grid; place-items: center; color: var(--orange); background: rgba(255,114,36,.07); border: 1px solid rgba(255,114,36,.22); font-size: .62rem; font-weight: 850; }
.mini-list strong, .mini-list small { display: block; }
.mini-list strong { font-size: .87rem; }
.mini-list small { margin-top: 4px; color: var(--quiet); font-size: .72rem; }
.mini-list b { color: var(--quiet); }
.mini-empty, .large-empty { display: grid; place-items: center; color: var(--quiet); }
.mini-empty { min-height: 170px; }
.large-empty { min-height: 360px; align-content: center; border-bottom: 1px solid var(--line); text-align: center; }
.large-empty > span { color: var(--red); font-size: .74rem; font-weight: 800; }
.large-empty h2 { margin: 18px 0 6px; font-size: 2rem; }
.large-empty p { margin: 0; }
.filter-bar { margin-top: 28px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.search-field { width: min(100%, 430px); }
.search-field input { min-height: 44px; }
.filter-count { color: var(--quiet); font-size: .8rem; }
.access-pill, .status-pill, .status-dot-label { width: fit-content; padding: 6px 9px; display: inline-flex; align-items: center; color: #b9d0ff; background: rgba(117,167,255,.08); border: 1px solid rgba(117,167,255,.23); font-size: .65rem; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.access-selected { color: #ffd6dc; background: linear-gradient(135deg,rgba(125,28,52,.28),rgba(55,20,45,.5)); border-color: rgba(255,91,125,.38); letter-spacing: .05em; }
.access-selected::before { content: '\1F512'; margin-right: 5px; font-size: .65rem; }
.access-discord { color: #c9adff; background: rgba(189,140,255,.09); border-color: rgba(189,140,255,.29); }
.status-pill, .status-dot-label { margin-left: 8px; color: #a8e9c5; background: rgba(93,226,153,.07); border-color: rgba(93,226,153,.2); }
.status-dot-label { padding: 0; background: transparent; border: 0; }

/* Documents */
.document-grid { margin-top: 24px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.document-card { min-height: 260px; padding: 24px; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.document-card:hover { border-color: var(--line-hot); transform: translateY(-2px); }
.document-card > p { margin: 36px 0 10px; color: var(--red); font-size: .7rem; font-weight: 800; letter-spacing: .12em; }
.document-card h2 { margin: 0; font-size: 1.55rem; letter-spacing: -.025em; }
.document-card footer { margin-top: auto; padding-top: 24px; display: flex; justify-content: space-between; color: var(--quiet); font-size: .75rem; }
.document-card footer span { color: var(--muted); }
.document-top { margin-bottom: 28px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.document-actions, .inline-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.document-actions form { margin: 0; }
.draft-share-note { max-width: 190px; color: var(--quiet); font-size: .72rem; line-height: 1.35; text-align: right; }
.integration-test-form { margin-top: 12px; }
.back-link { color: var(--muted); text-decoration: none; font-size: .84rem; }
.document-reader { min-width: 0; max-width: 1050px; margin: 0 auto; padding: clamp(34px, 6vw, 76px); overflow: hidden; background: var(--panel); border: 1px solid var(--line); }
.document-reader > header { padding-bottom: 38px; border-bottom: 1px solid var(--line); }
.document-reader > header p { margin: 26px 0 14px; color: var(--red); font-size: .72rem; font-weight: 800; letter-spacing: .12em; }
.document-reader > header h1 { max-width: 100%; margin: 0; overflow-wrap: anywhere; word-break: break-word; font-size: clamp(2.8rem, 6vw, 5.8rem); line-height: .92; letter-spacing: -.055em; }
.document-reader > header h1.long-title { font-size: clamp(2.15rem, 4.5vw, 4.35rem); }
.prose { min-width: 0; max-width: 100%; overflow-wrap: anywhere; color: #d0cbc5; font-size: 1rem; line-height: 1.78; }
.document-reader .prose { padding-top: 38px; }
.prose h2, .prose h3, .prose h4 { color: var(--ink); line-height: 1.15; letter-spacing: -.025em; }
.prose h2 { margin: 2.2em 0 .65em; font-size: 2rem; }
.prose h3 { margin: 1.8em 0 .55em; font-size: 1.45rem; }
.prose h4 { margin: 1.5em 0 .5em; font-size: 1.15rem; }
.prose p { margin: 0 0 1.2em; }
.prose ul, .prose ol { padding-left: 24px; }
.prose li { margin: .5em 0; }
.prose blockquote { margin: 1.5em 0; padding: 18px 22px; color: var(--ink); background: rgba(199,54,54,.05); border-left: 2px solid var(--red); }
.prose a { color: #fff; text-decoration-color: var(--red); text-underline-offset: 3px; }
.prose pre { max-width: 100%; overflow-x: auto; white-space: pre-wrap; word-break: break-word; }
[data-editor-upload-state] { margin-left: auto; color: var(--quiet); font-size: .68rem; white-space: normal; }
.document-action-needed { width: 25px; height: 25px; display: grid; place-items: center; color: #0b0b0c; background: #ffb056; border-radius: 50%; font-size: .75rem; font-weight: 950; }
.collaborator-rules label { grid-template-columns: auto minmax(0, 1fr) 120px; align-items: center; }
.document-owner-access { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 13px 15px; border: 1px solid rgba(255,90,57,.38); border-radius: 12px; background: linear-gradient(110deg, rgba(147,23,32,.17), rgba(184,74,20,.09)); }
.document-owner-access strong { color: var(--ink); }
.document-owner-access span { color: var(--quiet); font-size: .78rem; }
.document-ownership { max-width: 1050px; margin: 22px auto; }
.document-ownership > p { color: var(--quiet); }
.collaborator-rules select { min-height: 38px; padding: 7px 28px 7px 9px; }
.editor-access-note { padding: 16px; display: grid; gap: 5px; background: #09090a; border: 1px solid var(--line); }
.editor-access-note span { color: var(--quiet); font-size: .75rem; }
.document-comments { max-width: 1050px; margin: 22px auto 0; padding: 26px; background: var(--panel); border: 1px solid var(--line); }
.document-comments > header p { margin: 0 0 6px; color: var(--red); font-size: .68rem; font-weight: 850; letter-spacing: .12em; }
.document-comments > header h2 { margin: 0; }
.comment-list { margin: 18px 0; display: grid; gap: 10px; }
.comment-list article { padding: 15px; background: #09090a; border: 1px solid var(--line); }
.comment-list article time { float: right; color: var(--quiet); font-size: .68rem; }
.comment-list article p { margin: 9px 0 0; color: var(--muted); line-height: 1.55; }
.document-comments form { display: grid; gap: 12px; }
.document-comments form button { width: fit-content; }
.masked-ip { display: inline-flex; width: fit-content; gap: 7px; align-items: center; }
.masked-ip[role="button"] { cursor: pointer; }
.masked-ip small { color: var(--red); font-size: .58rem; text-transform: uppercase; }
.image-lightbox { width: min(94vw, 1280px); max-width: none; height: min(92vh, 960px); padding: 46px 20px 20px; overflow: hidden; background: #080809; border: 1px solid var(--line-hot); color: #fff; }
.image-lightbox::backdrop { background: rgba(0,0,0,.88); backdrop-filter: blur(6px); }
.image-lightbox > button { position: absolute; top: 10px; right: 12px; width: 34px; height: 34px; color: #fff; background: #171719; border: 1px solid var(--line); cursor: pointer; }
.image-lightbox img { width: 100%; height: calc(100% - 28px); object-fit: contain; }
.image-lightbox p { margin: 8px 0 0; overflow: hidden; color: var(--muted); text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.document-reader .prose img { cursor: zoom-in; }
.asset-repair-callout { overflow: hidden; }
.asset-failure-list { grid-column: 1 / -1; min-width: 0; padding-top: 18px; border-top: 1px solid rgba(255,114,36,.22); }
.asset-failure-list h3 { margin: 0 0 12px; font-size: 1rem; }
.asset-failure-list article { min-width: 0; padding: 16px; background: rgba(0,0,0,.2); border: 1px solid var(--line); }
.asset-failure-list article + article { margin-top: 10px; }
.asset-failure-list dl { margin: 0; display: grid; gap: 8px; }
.asset-failure-list dl > div { min-width: 0; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; }
.asset-failure-list dt { color: var(--quiet); font-size: .68rem; font-weight: 800; text-transform: uppercase; }
.asset-failure-list dd { min-width: 0; margin: 0; overflow-wrap: anywhere; color: var(--muted); }
.asset-failure-list dd a { color: #fff; }
.asset-failure-list form { margin-top: 14px; padding-top: 14px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 16px; align-items: end; border-top: 1px solid var(--line); }
.asset-failure-list form > p { grid-column: 1 / -1; margin: 0; color: var(--muted); }
.asset-failure-list .file-picker { min-width: 0; }

/* Editor and access */
.editor-shell { margin-top: 28px; background: var(--panel); border: 1px solid var(--line); }
.editor-settings { padding: 24px; display: grid; gap: 20px; border-bottom: 1px solid var(--line); }
.editor-workspace { display: grid; grid-template-columns: 1fr; min-height: 620px; }
.editor-toolbar { grid-column: 1 / -1; min-height: 48px; padding: 6px 10px; display: flex; align-items: center; gap: 6px; background: #0a0a0b; border-bottom: 1px solid var(--line); }
.editor-toolbar button { min-width: 36px; height: 34px; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); cursor: pointer; }
.editor-toolbar select { width: auto; min-width: 130px; min-height: 34px; padding: 5px 28px 5px 9px; }
.editor-toolbar span { margin-left: auto; color: var(--quiet); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; }
.editor-workspace textarea { min-height: 570px; padding: 24px; background: #09090a; border: 0; border-right: 1px solid var(--line); box-shadow: none; line-height: 1.65; }
.editor-preview { min-width: 0; max-height: 620px; padding: 24px 30px; overflow: auto; }
.rich-editor { min-height: 570px; padding: 34px clamp(24px, 5vw, 64px); outline: 0; background: #09090a; }
.rich-editor:focus { box-shadow: inset 0 0 0 1px rgba(199,54,54,.4); }
.rich-editor table, .prose table { width: 100%; border-collapse: collapse; }
.rich-editor th, .rich-editor td, .prose th, .prose td { padding: 10px; border: 1px solid var(--line); text-align: left; }
.editor-submit { padding: 18px 22px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-top: 1px solid var(--line); }
.editor-submit > span { color: var(--quiet); font-size: .74rem; }
.access-builder { margin: 0; padding: 0; border: 0; }
.access-builder legend { margin-bottom: 10px; color: #d1ccc6; font-size: .88rem; font-weight: 700; }
.access-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.access-modes label { position: relative; cursor: pointer; }
.access-modes input { position: absolute; opacity: 0; pointer-events: none; }
.access-modes label > span { min-height: 72px; padding: 14px; display: flex; flex-direction: column; justify-content: center; background: #09090a; border: 1px solid var(--line); }
.access-modes input:checked + span { border-color: var(--red); background: rgba(199,54,54,.06); box-shadow: inset 0 0 0 1px rgba(199,54,54,.18); }
.access-modes b, .access-modes small { display: block; }
.access-modes b { color: var(--ink); font-size: .85rem; }
.access-modes small { margin-top: 4px; color: var(--quiet); font-size: .7rem; }
.access-rules { margin-top: 12px; padding: 15px; display: flex; flex-wrap: wrap; gap: 9px; background: #09090a; border: 1px solid var(--line); }
.access-rules > p { width: 100%; margin: 0 0 4px; color: var(--muted); font-size: .75rem; }
.access-rules label { position: relative; cursor: pointer; }
.access-rules input { position: absolute; opacity: 0; pointer-events: none; }
.access-rules label > span { padding: 8px 10px; display: inline-flex; align-items: center; gap: 8px; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); font-size: .75rem; }
.access-rules input:checked + span { color: #fff; border-color: var(--red); background: rgba(199,54,54,.1); }
.access-rules span small { color: var(--quiet); font-size: .66rem; }

/* Vault */
.action-panel { margin-top: 22px; padding: 24px; background: var(--panel); border: 1px solid var(--line-hot); box-shadow: 0 24px 70px rgba(0,0,0,.25); }
.action-panel > header { margin-bottom: 24px; display: flex; justify-content: space-between; align-items: flex-start; }
.action-panel header p { margin-bottom: 8px; }
.action-panel header h2 { margin: 0; font-size: 1.8rem; }
.action-panel form { display: grid; gap: 18px; }
.drop-field input { padding: 11px; }
.drop-field input::file-selector-button { margin-right: 14px; padding: 10px 13px; color: var(--ink); background: var(--panel-3); border: 0; cursor: pointer; }
.vault-list { margin-top: 20px; border-top: 1px solid var(--line); }
.vault-row { padding: 22px 0; display: grid; grid-template-columns: 50px minmax(0, 1fr) auto; gap: 20px; align-items: center; border-bottom: 1px solid var(--line); }
.file-copy > div { display: flex; align-items: center; gap: 10px; color: var(--quiet); font-size: .7rem; }
.file-copy h2 { margin: 10px 0 0; font-size: 1.08rem; }
.file-copy p { margin: 6px 0; color: var(--muted); line-height: 1.45; }
.file-copy small { color: var(--quiet); }
.file-actions { display: flex; align-items: center; gap: 7px; }
.file-actions form { margin: 0; }
.file-actions .delete-button { min-height: 40px; }
.inline-access { grid-column: 2 / -1; padding: 20px; background: var(--panel); border: 1px solid var(--line); }
.inline-access form { display: grid; gap: 18px; }

/* Users and integrations */
.role-legend { margin-top: 28px; display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); }
.role-legend article { padding: 22px; border-right: 1px solid var(--line); }
.role-legend article:last-child { border-right: 0; }
.role-legend b { color: var(--red); font-size: .72rem; letter-spacing: .1em; }
.role-legend p { margin: 10px 0 0; color: var(--muted); font-size: .84rem; line-height: 1.5; }
.user-table { margin-top: 26px; }
.user-table > header, .user-row { display: grid; grid-template-columns: minmax(220px, 1.5fr) minmax(150px, .8fr) 130px 100px; gap: 18px; align-items: center; }
.user-table > header { padding: 0 18px 12px; color: var(--quiet); font-size: .68rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.user-row { min-height: 82px; padding: 14px 18px; border-top: 1px solid var(--line); }
.user-row:last-child { border-bottom: 1px solid var(--line); }
.user-row > div strong, .user-row > div span { display: block; }
.user-row > div span { margin-top: 4px; color: var(--quiet); font-size: .74rem; }
.user-row select { min-height: 42px; }
.managed-identity small { display: block; margin-top: 6px; color: var(--muted); font-size: .68rem; line-height: 1.45; }
.switch { display: flex; align-items: center; gap: 8px; }
.switch input { width: 18px; min-height: 18px; accent-color: var(--red); }
.switch span { font-size: .75rem; }
.integration-state { padding: 8px 11px; color: #ffae7a; background: rgba(255,114,36,.08); border: 1px solid rgba(255,114,36,.25); font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.integration-state.connected { color: #a7e9c5; background: rgba(93,226,153,.08); border-color: rgba(93,226,153,.25); }
.integration-card { margin-top: 28px; padding: clamp(24px, 4vw, 42px); background: var(--panel); border: 1px solid var(--line); }
.integration-card > header { margin-bottom: 30px; display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: end; }
.integration-card > header > div { display: flex; gap: 16px; align-items: baseline; }
.integration-card > header span { color: var(--red); font-size: .7rem; font-weight: 800; }
.integration-card h2 { margin: 0; font-size: 2rem; }
.integration-card > header p { margin: 0; color: var(--muted); line-height: 1.6; }
.integration-card form { display: grid; gap: 18px; }
.form-note { margin: 0; padding: 12px 14px; color: var(--muted); background: #09090a; border: 1px solid var(--line); font-size: .78rem; }
.secret-status { width: fit-content; padding: 5px 8px; color: #ffae7a; background: rgba(255,114,36,.07); border: 1px solid rgba(255,114,36,.22); font-size: .67rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.secret-status.configured { color: #a7e9c5; background: rgba(93,226,153,.07); border-color: rgba(93,226,153,.24); }
.secret-status.configured::before { content: "✓ "; }
.setup-guide { margin-top: 28px; padding: 20px 22px; color: var(--muted); background: linear-gradient(120deg, rgba(117,167,255,.08), transparent 45%), var(--panel); border: 1px solid rgba(117,167,255,.25); font-size: .82rem; line-height: 1.55; }
.setup-guide strong { color: var(--ink); font-size: 1rem; }
.setup-guide ol { margin: 12px 0; padding-left: 21px; }
.setup-guide li + li { margin-top: 5px; }
.setup-guide p { margin: 0; color: var(--quiet); }
.setup-guide a { color: #c9d9ff; }
.integration-button-row { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 10px; }
.integration-button-row form { margin: 0; }
.guild-config { display: grid; gap: 12px; }
.guild-config h3 { margin: 8px 0 0; font-size: .9rem; }
.guild-config > div { display: grid; grid-template-columns: .7fr 1.3fr; gap: 14px; }
.portal-guild-policy { margin: 0; padding: 18px; display: flex; flex-wrap: wrap; gap: 10px 18px; border: 1px solid var(--line); }
.portal-guild-policy legend { padding: 0 7px; color: var(--ink); font-weight: 800; }
.portal-guild-policy > p { width: 100%; margin: 0 0 5px; color: var(--muted); font-size: .76rem; line-height: 1.5; }
.portal-guild-policy label { display: flex; align-items: center; gap: 8px; }
.portal-guild-policy input { width: 17px; min-height: 17px; accent-color: var(--red); }
.sync-status { margin-top: 16px; display: grid; gap: 8px; color: var(--muted); font-size: .76rem; }
.sync-status strong { color: #ff9ca4; }

/* Role architect, Discord feeds, and policy */
.role-editor { margin-top: 34px; }
.role-editor > header { margin-bottom: 18px; }
.role-editor > header p { margin: 0 0 7px; color: var(--red); font-size: .7rem; font-weight: 850; letter-spacing: .12em; }
.role-editor > header h2 { margin: 0 0 8px; font-size: 2rem; }
.role-editor > header span { color: var(--muted); }
.role-editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.role-editor-card { padding: 22px; display: grid; gap: 18px; background: var(--panel); border: 1px solid var(--line); }
.role-editor-card > header { display: flex; justify-content: space-between; gap: 20px; align-items: end; }
.role-editor-card h3 { margin: 0; font-size: 1.35rem; }
.role-editor-card > header label { width: 90px; }
.role-editor-card fieldset { margin: 0; padding: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; border: 1px solid var(--line); }
.role-editor-card legend { padding: 0 7px; color: var(--muted); font-size: .75rem; }
.role-editor-card fieldset label { display: flex; gap: 8px; align-items: flex-start; font-size: .75rem; line-height: 1.35; }
.role-editor-card fieldset input { width: 15px; min-height: 15px; margin-top: 2px; accent-color: var(--red); }
.punishment-summary { margin: 22px 0 8px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--line); background: var(--panel); }
.punishment-summary article { min-width: 0; padding: 18px 20px; display: grid; gap: 3px; border-right: 1px solid var(--line); }
.punishment-summary article:last-child { border-right: 0; }
.punishment-summary span, .punishment-summary small { color: var(--quiet); font-size: .67rem; }
.punishment-summary span { font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.punishment-summary strong { font-size: 1.8rem; line-height: 1.1; }
.punishment-summary .summary-word { font-size: 1.05rem; padding-top: 6px; }
.punishment-filter-controls { display: grid; grid-template-columns: minmax(220px, 1fr) 132px 132px auto minmax(80px, auto); gap: 10px; align-items: end; }
.punishment-date-filter { display: grid; gap: 5px; }
.punishment-date-filter span { color: var(--quiet); font-size: .62rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.punishment-date-filter input { min-height: 40px; }
.punishment-filter-clear { min-height: 40px; white-space: nowrap; }
.punishment-feed { margin-top: 22px; display: grid; gap: 8px; }
.punishment-date { margin: 20px 0 3px; padding-bottom: 8px; color: var(--muted); border-bottom: 1px solid var(--line); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; }
.punishment-date:first-child { margin-top: 0; }
.punishment-record { min-width: 0; overflow: hidden; background: linear-gradient(120deg, rgba(255,255,255,.025), rgba(255,255,255,.008)); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 24px rgba(0,0,0,.12); transition: border-color .16s ease, background .16s ease, transform .16s ease; }
.punishment-record:hover { background: linear-gradient(120deg, rgba(255,255,255,.05), rgba(255,255,255,.012)); border-color: #3d3d46; transform: translateY(-1px); }
.punishment-primary { min-width: 0; padding: 17px 18px; display: grid; grid-template-columns: 122px minmax(140px,.85fr) minmax(140px,.85fr) minmax(220px,2fr) 64px; gap: 18px; align-items: center; }
.punishment-primary > div { min-width: 0; display: grid; gap: 3px; }
.punishment-primary small { color: var(--quiet); font-size: .61rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.punishment-primary strong, .punishment-primary span { min-width: 0; overflow-wrap: anywhere; }
.punishment-primary strong { font-size: .82rem; }
.punishment-reason span { color: var(--muted); font-size: .76rem; line-height: 1.45; display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.punishment-primary time { color: var(--ink); font-size: .78rem; font-weight: 800; text-align: right; }
.punishment-primary time small { display: block; margin-top: 2px; }
.punishment-action { justify-self: start; padding: 7px 9px; color: #f0d6d8; background: rgba(255,70,83,.09); border: 1px solid rgba(255,70,83,.25); font-size: .66rem; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.punishment-action:empty { display: none; }
.punishment-action.action-warning { color: #ffe49a; background: rgba(245,190,45,.08); border-color: rgba(245,190,45,.24); }
.punishment-action.action-mute { color: #c9baff; background: rgba(135,104,255,.09); border-color: rgba(135,104,255,.25); }
.punishment-action.action-kick { color: #ffc1a0; background: rgba(255,126,58,.09); border-color: rgba(255,126,58,.25); }
.punishment-action.action-ban, .punishment-action.action-permanent-ban { color: #ff9ea5; }
.punishment-record:has(.action-warning) { border-left: 3px solid rgba(245,190,45,.55); }
.punishment-record:has(.action-mute) { border-left: 3px solid rgba(135,104,255,.55); }
.punishment-record:has(.action-kick) { border-left: 3px solid rgba(255,126,58,.55); }
.punishment-record:has(.action-ban), .punishment-record:has(.action-permanent-ban) { border-left: 3px solid rgba(255,70,83,.62); }
.punishment-details { border-top: 1px solid rgba(255,255,255,.07); }
.punishment-details summary { padding: 11px 18px; color: var(--quiet); cursor: pointer; font-size: .68rem; font-weight: 800; list-style-position: inside; }
.punishment-details[open] summary { color: var(--muted); background: #0b0b0c; }
.punishment-details dl { margin: 0; padding: 14px 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; background: #0b0b0c; }
.punishment-details dl > div { min-width: 0; }
.punishment-details dt { margin-bottom: 4px; color: var(--quiet); font-size: .62rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.punishment-details dd { margin: 0; color: var(--muted); font-size: .74rem; overflow-wrap: anywhere; }
.punishment-details a { color: #ff9ca4; }
.punishment-attachments { padding: 0 16px 12px; display: flex; flex-wrap: wrap; gap: 8px; background: #0b0b0c; }
.punishment-attachments a { padding: 6px 8px; border: 1px solid var(--line); font-size: .68rem; }
.discord-record-link { padding: 10px 16px 14px; display: block; background: #0b0b0c; border-top: 1px solid rgba(255,255,255,.04); font-size: .72rem; font-weight: 800; }
.staff-role-mapper { margin: 4px 0 0; padding: 18px; display: grid; gap: 12px; border: 1px solid var(--line); }
.staff-role-mapper legend { padding: 0 8px; color: var(--ink); font-weight: 850; }
.staff-role-mapper > p { margin: 0 0 4px; color: var(--muted); font-size: .75rem; line-height: 1.5; }
.staff-role-mapper > label { padding: 12px; display: grid; grid-template-columns: minmax(160px,.7fr) minmax(240px,1.3fr); gap: 16px; align-items: center; background: #0b0b0c; border: 1px solid rgba(255,255,255,.055); }
.staff-role-mapper > label > span { display: grid; gap: 3px; }
.staff-role-mapper > label small { color: var(--quiet); font-size: .64rem; overflow-wrap: anywhere; }
.staff-role-mapper input { margin: 0; }
.role-map-empty { padding: 14px; color: var(--muted); background: #0b0b0c; font-size: .75rem; }
.roster-grid { margin-top: 22px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.roster-grid article { min-width: 0; padding: 20px; display: flex; gap: 14px; background: var(--panel); border: 1px solid var(--line); }
.roster-grid article > div { min-width: 0; }
.roster-grid small, .roster-grid p { color: var(--quiet); }
.roster-grid h2 { margin: 4px 0; overflow-wrap: anywhere; }
.roster-grid p { margin: 0; }
.role-tags { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.role-tags span { padding: 5px 7px; color: #ffb27d; background: rgba(255,114,36,.07); border: 1px solid rgba(255,114,36,.2); font-size: .66rem; }
.auth-legal { margin: 18px 0 0; color: var(--quiet); font-size: .7rem; line-height: 1.5; text-align: center; }
.auth-legal a, .sidebar-legal { color: var(--muted); }
.sidebar-legal { margin: 0 12px 14px; display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 10px; font-size: .62rem; text-align: center; opacity: .72; }
.sidebar-legal a { color: var(--muted); }
.terms-page { background: radial-gradient(circle at 50% 0, rgba(199,54,54,.1), transparent 28%), var(--bg); }
.terms-shell { width: min(calc(100% - 40px), 960px); margin: 0 auto; padding: 38px 0 70px; }
.terms-header { display: grid; grid-template-columns: 180px 1fr; gap: 50px; align-items: end; padding-bottom: 36px; border-bottom: 1px solid var(--line); }
.terms-header > div p { margin: 0 0 10px; color: var(--red); font-size: .7rem; font-weight: 850; letter-spacing: .12em; }
.terms-header h1 { margin: 0; font-size: clamp(2.6rem, 7vw, 5.5rem); line-height: .92; letter-spacing: -.055em; }
.terms-header > div span { display: block; margin-top: 18px; color: var(--muted); line-height: 1.6; }
.terms-summary { margin: 28px 0; padding: 22px; background: rgba(199,54,54,.05); border: 1px solid rgba(199,54,54,.25); }
.terms-summary strong { color: #fff; }
.terms-summary p { margin: 7px 0 0; color: var(--muted); line-height: 1.6; }
.terms-content { padding: clamp(26px, 5vw, 54px); background: var(--panel); border: 1px solid var(--line); }
.terms-content h2:first-child { margin-top: 0; }
.terms-accept { position: sticky; bottom: 14px; margin: 18px auto 0; padding: 15px 17px; max-width: 920px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 14px; align-items: center; background: rgba(13,13,15,.96); border: 1px solid var(--line-hot); box-shadow: 0 16px 40px rgba(0,0,0,.45); backdrop-filter: blur(12px); }
.terms-accept label { display: flex; align-items: flex-start; gap: 10px; color: var(--muted); font-size: .8rem; line-height: 1.45; }
.terms-accept input { width: 17px !important; height: 17px !important; min-width: 17px; min-height: 17px !important; margin: 1px 0 0; padding: 0; appearance: auto; accent-color: var(--red); }
.terms-shell > footer { margin-top: 18px; color: var(--quiet); font-size: .7rem; text-align: center; }
.terms-return { margin-top: 22px; }
.agreement-page .terms-summary { background: rgba(255,114,36,.06); border-color: rgba(255,114,36,.28); }
.agreement-state { margin-top: 7px !important; color: #ffad76 !important; }
.agreement-state.accepted { color: #8ddfb5 !important; }
.merged-user { opacity: .62; }

/* Profiles and release identity */
.profile-grid { max-width: 1180px; margin-top: 28px; display: grid; grid-template-columns: minmax(320px, .8fr) minmax(430px, 1.2fr); gap: 22px; align-items: start; }
.profile-card { min-width: 0; padding: clamp(24px, 4vw, 38px); background: var(--panel); border: 1px solid var(--line); }
.profile-card > header p, .profile-identity > div > p { margin: 0 0 8px; color: var(--red); font-size: .69rem; font-weight: 850; letter-spacing: .13em; }
.profile-card h2 { margin: 0; font-size: clamp(1.8rem, 3vw, 2.7rem); }
.profile-card > header { margin-bottom: 26px; }
.profile-card form { display: grid; gap: 18px; }
.profile-avatar { width: 92px; height: 92px; margin-bottom: 24px; display: grid; place-items: center; object-fit: cover; color: #fff; background: var(--signal); border: 1px solid var(--line-hot); font-size: 2rem; font-weight: 900; }
.profile-identity > div > span { display: block; margin-top: 6px; color: var(--muted); }
.profile-identity dl { margin: 27px 0; border-top: 1px solid var(--line); }
.profile-identity dl > div { padding: 11px 0; display: flex; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.profile-identity dt { color: var(--quiet); }
.profile-identity dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.link-callout { padding: 18px; background: #09090a; border: 1px solid var(--line); }
.linked-callout { padding: 14px 0 0; display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; align-items: center; border-top: 1px solid var(--line); }
.linked-callout p { margin: 0; grid-column: 1; }
.mc-link-status { display:block; font-size:.7rem; color:var(--muted); line-height:1.5; overflow-wrap:anywhere; }
.mc-link-status code { font-size:inherit; background:transparent; padding:0; }
.mc-link-status.is-missing { color:var(--accent); font-weight:650; }
.member-directory-identity .mc-link-status { white-space:normal; overflow:visible; text-overflow:clip; overflow-wrap:anywhere; }
.welcome-token-chips { display:flex; flex-wrap:wrap; gap:6px; margin:12px 0; }
.welcome-token-chips button { font-size:.72rem; padding:6px 9px; }
.welcome-preview-embed { padding:16px; border:1px solid var(--line); border-left:4px solid #FFAC33; border-radius:8px; min-width:0; }
.welcome-preview-embed > div { display:flex; align-items:center; gap:12px; }
.welcome-preview-embed pre { white-space:pre-wrap; overflow-wrap:anywhere; font:inherit; line-height:1.6; }
.welcome-preview-embed > img { max-width:100%; height:auto; border-radius:6px; margin:12px 0; }
.linked-callout:has(form[action="/staff/profile"]) { grid-template-columns: minmax(0, 1fr); gap: 12px; }
.linked-callout form[action="/staff/profile"] { justify-self: start; margin: 0; }
.linked-callout form[action="/staff/profile"] button { white-space: nowrap; }
.linked-callout .secondary-link { grid-column: 2; grid-row: 1 / span 2; }
.link-callout strong, .linked-callout strong { display: block; }
.link-callout p, .linked-callout p { color: var(--muted); font-size: .8rem; line-height: 1.55; }
.profile-check { padding: 14px; display: flex; align-items: center; gap: 10px; background: #09090a; border: 1px solid var(--line); }
.profile-check input { width: 18px !important; height: 18px !important; min-width: 18px; min-height: 18px !important; flex: 0 0 18px; margin: 0; padding: 0; appearance: auto; accent-color: var(--red); }
.build-version { position: fixed; z-index: 40; right: 14px; bottom: 12px; padding: 6px 9px; color: #8d8883; background: rgba(10,10,11,.9); border: 1px solid var(--line); backdrop-filter: blur(8px); font-size: .61rem; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }

/* Staff workflows */
.staff-channel-panel, .account-merge-panel, .quiz-my-list, .quiz-admin { margin-top: 30px; background: var(--panel); border: 1px solid var(--line); }
.staff-channel-panel > header, .account-merge-panel > header, .quiz-my-list > header, .quiz-admin > header { padding: 22px; border-bottom: 1px solid var(--line); }
.staff-channel-panel > header p, .account-merge-panel > header p, .quiz-my-list > header p, .quiz-admin > header p { margin: 0 0 7px; color: var(--red); font-size: .7rem; font-weight: 850; letter-spacing: .12em; }
.staff-channel-panel h2, .account-merge-panel h2, .quiz-my-list h2, .quiz-admin h2 { margin: 0; font-size: 1.7rem; }
.staff-channel-panel > header span, .account-merge-panel > header span { display: block; margin-top: 8px; color: var(--muted); }
.staff-channel-panel > div > form { padding: 15px 20px; display: grid; grid-template-columns: minmax(170px, .7fr) minmax(260px, 1.3fr) auto; gap: 16px; align-items: end; border-bottom: 1px solid var(--line); }
.staff-channel-panel > div > form:last-child { border-bottom: 0; }
.staff-channel-panel strong, .staff-channel-panel small { display: block; }
.staff-channel-panel small { margin-top: 4px; color: var(--quiet); }
.account-merge-panel > form { padding: 22px; display: grid; gap: 18px; }
.quiz-my-list, .quiz-admin { overflow: hidden; }
.quiz-card-grid { padding: 18px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.quiz-card-grid > article { min-width: 0; padding: 20px; display: flex; flex-direction: column; background: #09090a; border: 1px solid var(--line); }
.quiz-card-grid h3 { margin: 18px 0 8px; font-size: 1.35rem; }
.quiz-card-grid p { color: var(--muted); line-height: 1.55; }
.quiz-card-grid small { color: var(--quiet); }
.quiz-card-grid footer, .quiz-card-grid form { margin-top: auto; padding-top: 18px; display: grid; gap: 12px; }
.quiz-card-grid form + .quiz-status-form { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.quiz-status-form .primary-button, .quiz-status-form .quiet-button { width: 100%; justify-content: center; }
.quiz-card-grid footer strong { font-size: 2rem; }
.quiz-builder { margin-top: 26px; }
.quiz-builder form { display: grid; gap: 18px; }
.quiz-builder-question { margin: 0; padding: 20px; display: grid; gap: 16px; background: #09090a; border: 1px solid var(--line); }
.quiz-question-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.quiz-question-head strong { color: var(--orange); }
.quiz-taker { max-width: 980px; margin: 28px auto 0; display: grid; gap: 18px; }
.quiz-taker fieldset { margin: 0; padding: 24px; background: var(--panel); border: 1px solid var(--line); }
.quiz-taker legend { width: calc(100% + 2px); margin-left: -1px; padding: 18px 24px; display: flex; gap: 12px; align-items: center; background: var(--panel-2); border: 1px solid var(--line); font-weight: 800; }
.quiz-taker legend > span { color: var(--red); }
.quiz-taker legend small { margin-left: auto; color: var(--quiet); }
.quiz-option { position: relative; margin-top: 10px; display: block; cursor: pointer; }
.quiz-option input { position: absolute; opacity: 0; pointer-events: none; }
.quiz-option span { min-height: 48px; padding: 13px 16px; display: block; background: #09090a; border: 1px solid var(--line); }
.quiz-option input:checked + span { border-color: var(--red); background: rgba(199,54,54,.08); }
.quiz-submit { padding: 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; background: var(--panel); border: 1px solid var(--line); }
.quiz-submit p { color: var(--muted); }
.quiz-results { display: grid; }
.quiz-results article { padding: 15px 20px; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 18px; align-items: center; border-bottom: 1px solid var(--line); }
.quiz-results article:last-child { border-bottom: 0; }
.quiz-results strong, .quiz-results span { display: block; }
.quiz-results span { margin-top: 4px; color: var(--quiet); }
.quiz-review-answers { margin-top: 28px; display: grid; gap: 14px; }
.quiz-review-answers article, .review-form { padding: 22px; background: var(--panel); border: 1px solid var(--line); }
.quiz-review-answers header { display: flex; justify-content: space-between; color: var(--quiet); }
.quiz-review-answers h2 { font-size: 1.2rem; }
.quiz-review-answers p { color: var(--muted); }
.review-form { margin-top: 18px; display: grid; gap: 16px; }
.heading-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.quiz-import-panel { margin-top: 26px; }
.quiz-template-links { padding: 18px 22px 0; display: flex; flex-wrap: wrap; gap: 10px; }
.quiz-import-panel > form { display: grid; gap: 18px; }
.quiz-section-label { flex: 0 0 auto; padding: 5px 8px; color: #ffb199; background: rgba(255, 92, 45, .08); border: 1px solid rgba(255, 92, 45, .25); border-radius: 999px; font-size: .63rem; font-style: normal; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.quiz-review-form { max-width: 1050px; margin: 0 auto; }
.quiz-score { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }
.quiz-score > span { color: var(--quiet); font-size: .65rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.quiz-score input { width: 76px; min-height: 38px; padding: 8px 10px; }
.review-guidance { display: block; margin-top: 16px; padding: 12px 14px; color: var(--muted); background: rgba(255,255,255,.025); border-left: 2px solid var(--orange); border-radius: 0 9px 9px 0; line-height: 1.5; }
.review-guidance strong { color: var(--text); }

/* Security operations */
.security-metrics { margin-top: 28px; display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); }
.security-metrics article { min-height: 150px; padding: 22px; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--panel); }
.security-metrics article:last-child { border-right: 0; }
.security-metrics span { color: var(--quiet); font-size: .68rem; font-weight: 800; letter-spacing: .1em; }
.security-metrics strong { margin-top: auto; font-size: 2.4rem; }
.security-metrics small { color: var(--muted); }
.security-alerts { margin-top: 26px; border: 1px solid rgba(199,54,54,.3); background: rgba(199,54,54,.035); }
.security-alerts > header { padding: 20px 22px; border-bottom: 1px solid rgba(199,54,54,.22); }
.security-alerts > header p { margin: 0 0 7px; color: var(--red); font-size: .7rem; font-weight: 850; letter-spacing: .12em; }
.security-alerts > header h2 { margin: 0; font-size: 1.5rem; }
.security-alerts article { padding: 17px 22px; display: grid; grid-template-columns: 70px 1fr; gap: 18px; border-bottom: 1px solid rgba(199,54,54,.14); }
.security-alerts article:last-child { border-bottom: 0; }
.security-alerts article > span { color: #ff9aa2; font-size: .66rem; font-weight: 900; letter-spacing: .08em; }
.security-alerts strong { display: block; }
.security-alerts p { margin: 5px 0 0; color: var(--muted); }
.log-panel { margin-top: 28px; background: var(--panel); border: 1px solid var(--line); }
.log-panel > header { padding: 22px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.log-panel > header p { margin: 0 0 7px; color: var(--red); font-size: .7rem; font-weight: 850; letter-spacing: .12em; }
.log-panel > header h2 { margin: 0; font-size: 1.5rem; }
.log-panel .search-field { width: min(100%, 320px); }
.log-table { min-width: 0; overflow: hidden; }
.log-header, .log-table article { min-width: 0; display: grid; grid-template-columns: minmax(86px,.7fr) minmax(130px,1.2fr) minmax(112px,.75fr) minmax(112px,.8fr) minmax(125px,.8fr); gap: 14px; align-items: center; }
.log-header { padding: 11px 18px; color: var(--quiet); background: #0a0a0b; border-bottom: 1px solid var(--line); font-size: .65rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.log-table article { min-height: 70px; padding: 12px 18px; border-bottom: 1px solid var(--line); font-size: .78rem; }
.log-table article:last-child { border-bottom: 0; }
.log-table article > span strong, .log-table article > span small { display: block; }
.log-table article > span small { margin-top: 4px; color: var(--quiet); }
.log-table code { width: fit-content; color: #c8c2bd; background: #09090a; font-size: .72rem; }
.log-result { padding: 6px 8px; color: #a8e9c5; background: rgba(93,226,153,.08); border: 1px solid rgba(93,226,153,.2); font-size: .65rem; text-transform: uppercase; }
.log-result.failure { color: #ff9ca4; background: rgba(199,54,54,.08); border-color: rgba(199,54,54,.23); }
.event-code { color: #ffb27d; font-size: .66rem; }
.event-code, .log-table article > *, .log-table time { min-width: 0; overflow-wrap: anywhere; }
.agent-cell, .log-table time { color: var(--muted); }
.retention-note { margin: 18px 0 0; color: var(--quiet); font-size: .72rem; }

/* Shared links */
.share-page { background: radial-gradient(circle at 50% 0, rgba(199,54,54,.11), transparent 34%), var(--bg); }
.share-shell { min-height: 100vh; display: grid; place-items: center; padding: 28px; }
.share-gate { width: min(100%, 620px); padding: clamp(34px, 6vw, 64px); background: var(--panel); border: 1px solid var(--line); box-shadow: 0 35px 100px rgba(0,0,0,.45); }
.share-gate > .access-pill { margin-top: 60px; }
.share-gate h1 { margin: 22px 0 14px; font-size: clamp(2.7rem, 7vw, 5rem); line-height: .92; letter-spacing: -.055em; }
.share-gate > p { margin: 0 0 28px; color: var(--muted); line-height: 1.65; }
.share-gate > small { display: block; margin-top: 18px; color: var(--quiet); }
.discord-button { width: 100%; background: #5865f2; }
.discord-button:hover { background: #6d78f5; }
.share-recovery-link { display: block; width: fit-content; margin: 18px auto 0; color: var(--muted); font-size: .82rem; font-weight: 750; text-decoration: underline; text-underline-offset: 4px; }
.shared-document { width: min(calc(100% - 48px), 1120px); margin: 0 auto; padding: 32px 0 70px; }
.shared-document > header { padding-bottom: 24px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.shared-document > header > div { display: flex; align-items: center; gap: 12px; }
.shared-document > header small { color: var(--quiet); }
.document-reader.shared { margin-top: 40px; }
.shared-file { max-width: 750px; margin: 90px auto; text-align: center; }
.shared-file .file-type { margin: 0 auto 26px; }
.shared-file > p { color: var(--red); font-size: .72rem; font-weight: 800; letter-spacing: .14em; }
.shared-file h1 { margin: 12px 0 18px; font-size: clamp(3rem, 7vw, 6rem); line-height: .9; letter-spacing: -.06em; }
.shared-file > div { color: var(--muted); line-height: 1.6; }
.shared-file > small { display: block; margin: 16px 0 28px; color: var(--quiet); }
.shared-document > footer { padding-top: 24px; color: var(--quiet); border-top: 1px solid var(--line); font-size: .72rem; text-align: center; }

.section-tabs { margin: 22px 0 0; display: flex; gap: 8px; border-bottom: 1px solid var(--line); }
.section-tabs a { padding: 12px 16px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; }
.section-tabs a.active { color: #fff; border-bottom-color: var(--red); }
.section-tabs span { margin-left: 7px; color: var(--quiet); }
.feedback-tabs button { padding: 12px 16px; color: var(--muted); background: transparent; border: 0; border-bottom: 2px solid transparent; cursor: pointer; font: inherit; }
.feedback-tabs button.active { color: #fff; border-bottom-color: var(--red); }
.feedback-filters { margin-top: 16px; }
.changelog-card { margin-top: 22px; padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(135deg, rgba(199,54,54,.06), rgba(255,255,255,.018)); }
.changelog-card header { margin-bottom: 14px; }
.changelog-card header p { margin: 0 0 5px; color: var(--red); font-size: .68rem; font-weight: 850; letter-spacing: .14em; }
.changelog-card h2 { margin: 0; font-size: 1.25rem; }
.changelog-card p, .changelog-card li { color: var(--muted); line-height: 1.6; }
.changelog-card ul { margin: 0; padding-left: 20px; }
.changelog-card li + li { margin-top: 8px; }
.changelog-document { margin-top: 22px; padding: clamp(18px, 3vw, 30px); border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(135deg, rgba(199,54,54,.035), rgba(255,255,255,.012)); overflow-wrap: anywhere; }
.changelog-document h2 { margin: 0 0 18px; font-size: clamp(1.3rem, 2.4vw, 1.8rem); }
.changelog-document h3 { margin: 30px 0 10px; padding-top: 22px; border-top: 1px solid var(--line); font-size: clamp(1.08rem, 1.8vw, 1.35rem); }
.changelog-document h4 { margin: 20px 0 8px; color: var(--red); font-size: .95rem; }
.changelog-document h5, .changelog-document h6 { margin: 16px 0 7px; color: var(--muted); font-size: .82rem; }
.changelog-document p, .changelog-document li, .changelog-document blockquote { color: var(--muted); font-size: .86rem; line-height: 1.65; }
.changelog-document p { margin: 0 0 12px; }
.changelog-document ul, .changelog-document ol { margin: 8px 0 18px; padding-left: 22px; }
.changelog-document li + li { margin-top: 7px; }
.changelog-document code { padding: 2px 5px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: rgba(0,0,0,.22); font-size: .9em; overflow-wrap: anywhere; }
.changelog-document a { color: var(--ink); text-decoration-color: var(--red); text-underline-offset: 3px; }
.changelog-document blockquote { margin: 14px 0; padding: 10px 14px; border-left: 2px solid var(--red); background: rgba(255,255,255,.025); }
.suggestion-category-manager { margin: 22px 0; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.suggestion-category-manager > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.suggestion-category-manager > header p { margin: 0 0 5px; color: var(--red); font-size: .65rem; font-weight: 850; letter-spacing: .12em; }
.suggestion-category-manager h2 { margin: 0; font-size: 1rem; }
.suggestion-category-manager > header span { display: block; margin-top: 5px; color: var(--muted); font-size: .75rem; }
.suggestion-category-manager form { display: grid; gap: 12px; }
.suggestion-category-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px auto; gap: 12px; align-items: end; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.suggestion-category-row input[type="color"] { min-height: 42px; padding: 4px; cursor: pointer; }
.suggestion-tag { padding: 5px 9px; color: var(--tag-color); border: 1px solid color-mix(in srgb, var(--tag-color) 48%, transparent); border-radius: 999px; background: color-mix(in srgb, var(--tag-color) 12%, transparent); font-size: .65rem; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.feedback-list > article > header > div { flex-wrap: wrap; }
@media (max-width: 580px) { .suggestion-category-row { grid-template-columns: 1fr auto; } .suggestion-category-row label:first-child { grid-column: 1 / -1; } .suggestion-category-row [data-remove-suggestion-category] { grid-column: 2; } .suggestion-category-manager > header { align-items: flex-start; flex-direction: column; } }
.staff-record-links { padding: 14px 0; display: flex; gap: 8px; overflow-x: auto; }
.staff-record-links a { min-width: 150px; padding: 11px 13px; color: #fff; background: var(--panel); border: 1px solid var(--line); text-decoration: none; }
.staff-record-links strong, .staff-record-links span { display: block; }
.staff-record-links span { margin-top: 3px; color: var(--quiet); font-size: .68rem; }
.guild-membership-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.guild-membership-grid article { padding: 11px 13px; background: #09090a; border: 1px solid var(--line); }
.guild-membership-grid article > div { margin-top: 7px; display: flex; flex-wrap: wrap; gap: 5px; }
.guild-membership-grid span { padding: 4px 6px; color: #b9c5ff; background: rgba(88,101,242,.1); border: 1px solid rgba(88,101,242,.25); font-size: .62rem; }
.guild-membership-grid small { color: var(--quiet); }
.staff-record-grid { display: grid; grid-template-columns: minmax(320px,.85fr) minmax(420px,1.15fr); gap: 22px; }
.staff-record-grid { margin-top: 28px; }
.record-details { margin: 18px 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px 14px 5px 14px; background: rgba(10,10,12,.82); }
.record-details summary { padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; list-style: none; font-weight: 800; }
.record-details summary::-webkit-details-marker { display: none; }
.record-details summary::after { content: '+'; color: var(--red); font-size: 1.2rem; }
.record-details[open] summary::after { content: '−'; }
.record-details summary small { margin-left: auto; color: var(--quiet); font-size: .72rem; font-weight: 500; }
.record-details > .person-history, .record-details > .agreement-history-table, .record-details > .record-summary-list { padding: 0 18px 12px; border-top: 1px solid var(--line); }
.record-summary-list { display: grid; gap: 8px; }
.record-summary-list article { padding: 13px 0; display: grid; grid-template-columns: minmax(160px,1fr) auto auto; gap: 12px; border-bottom: 1px solid var(--line); }
.record-summary-list article span, .record-summary-list article time { color: var(--quiet); font-size: .74rem; }
.record-facts { margin: 0; }
.record-facts > div { padding: 11px 0; display: flex; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.record-facts dt { color: var(--quiet); }
.record-facts dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.merged-history, .staff-note-list { margin-top: 20px; display: grid; gap: 8px; }
.merged-history span, .staff-note-list article { padding: 11px; background: #09090a; border: 1px solid var(--line); }
.staff-note-list p { margin: 0 0 7px; line-height: 1.5; }
.staff-note-list small { color: var(--quiet); }
.person-history { display: grid; gap: 10px; padding-top: 12px !important; }
.person-history-item { padding: 14px 15px; display: grid; gap: 12px; background: linear-gradient(120deg, rgba(255,255,255,.035), rgba(255,255,255,.012)); border: 1px solid var(--line); border-left: 3px solid rgba(255,70,83,.5); border-radius: 11px; }
.person-history-item.action-warning { border-left-color: rgba(245,190,45,.65); }
.person-history-item.action-mute { border-left-color: rgba(135,104,255,.65); }
.person-history-item.action-kick { border-left-color: rgba(255,126,58,.65); }
.person-history-item.action-ban, .person-history-item.action-permanent-ban { border-left-color: rgba(255,70,83,.75); }
.person-history-main { min-width: 0; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 12px; }
.person-history-main > div { min-width: 0; display: grid; gap: 4px; }
.person-history-main strong { overflow-wrap: anywhere; }
.person-history-main small { color: var(--quiet); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-history-main time { color: var(--muted); font-size: .7rem; white-space: nowrap; }
.person-history-item footer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--quiet); font-size: .68rem; }
.person-history-item footer span { padding: 4px 7px; background: rgba(255,255,255,.04); border-radius: 6px; }
.person-history-item footer .secondary-link { margin-left: auto; }
.master-settings-card { max-width: 900px; }
.settings-tabs { margin-bottom: 22px; }
.public-document-option { margin-top: 16px; padding: 14px; display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; background: rgba(93,226,153,.055); border: 1px solid rgba(93,226,153,.22); }
.public-document-option input { width: 18px; height: 18px; min-height: 0; accent-color: var(--red); }
.public-document-option b, .public-document-option small { display: block; }
.public-document-option small { margin-top: 4px; color: var(--quiet); line-height: 1.45; }
.public-link-bar { margin-bottom: 16px; padding: 13px 15px; display: flex; align-items: center; justify-content: space-between; gap: 18px; background: rgba(93,226,153,.05); border: 1px solid rgba(93,226,153,.22); }
.public-link-bar strong, .public-link-bar small { display: block; }
.public-link-bar small { margin-top: 3px; color: var(--quiet); }
.feedback-list { display: grid; gap: 12px; }
.feedback-list > article { padding: 18px 20px; background: var(--panel); border: 1px solid var(--line); }
.feedback-list article > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.feedback-list article > header > div { display: flex; gap: 7px; }
.feedback-list h2 { margin: 16px 0 8px; font-size: 1.1rem; }
.feedback-list p { color: var(--muted); line-height: 1.6; }
.feedback-list small { color: var(--quiet); }
.feedback-list form { margin-top: 14px; display: flex; gap: 8px; }
.document-tree { margin-top: 18px; border: 1px solid var(--line); background: var(--panel); }
.bulk-document-form { margin-top: 18px; }
.bulk-document-form .document-tree { margin-top: 0; }
.bulk-action-bar { position: sticky; top: 0; z-index: 3; min-height: 66px; padding: 10px 14px; display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; background: rgba(14,14,15,.97); border: 1px solid var(--line); border-bottom: 0; backdrop-filter: blur(12px); }
.bulk-action-bar > strong { color: var(--quiet); font-size: .76rem; }
.bulk-action-bar > div { display: flex; flex-wrap: wrap; gap: 8px; }
.bulk-action-bar > div[hidden] { display: none; }
.select-all-control { display: flex; grid-template-columns: none; align-items: center; gap: 9px; font-size: .78rem; cursor: pointer; }
.select-all-control input, .document-checkbox input { width: 17px; height: 17px; min-height: 0; accent-color: var(--red); }
.document-select-row { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: stretch; border-bottom: 1px solid var(--line); }
.document-select-row .document-row { border-bottom: 0; }
.document-checkbox { display: grid; place-items: center; border-right: 1px solid var(--line); cursor: pointer; }
.document-select-row:has(input:checked) { background: rgba(199,54,54,.045); box-shadow: inset 2px 0 var(--red); }
.document-row { min-width: 0; min-height: 72px; padding: 12px 16px; display: grid; grid-template-columns: 24px minmax(220px,1fr) 25px max-content; gap: 12px; align-items: center; color: #fff; text-decoration: none; border-bottom: 1px solid var(--line); }
.document-row .access-pill, .document-row .status-pill, .document-row .status-dot-label { min-width: max-content; max-width: none; margin-left: 0; white-space: nowrap; overflow: visible; text-overflow: clip; }
.document-row-copy { min-width: 0; }
.document-row-copy strong { overflow-wrap: anywhere; }
.document-row-meta { min-width: 0; display: grid; grid-template-columns: max-content max-content 92px; justify-content: end; align-items: center; gap: 12px; }
.document-row-meta time { text-align: right; white-space: nowrap; }
.document-create-menu { position: relative; }
.document-create-menu > summary { list-style: none; cursor: pointer; }
.document-create-menu > summary::-webkit-details-marker { display: none; }
.document-create-menu > div { position: absolute; z-index: 15; top: calc(100% + 8px); right: 0; width: 280px; padding: 7px; display: grid; gap: 3px; background: #111113; border: 1px solid var(--line-bright); box-shadow: 0 22px 60px rgba(0,0,0,.5); }
.document-create-menu > div a, .document-create-menu > div button { width: 100%; padding: 12px 13px; color: var(--ink); background: transparent; border: 0; text-align: left; text-decoration: none; cursor: pointer; }
.document-create-menu > div a:hover, .document-create-menu > div button:hover { background: rgba(255,255,255,.055); }
.document-create-menu strong, .document-create-menu small { display: block; }
.document-create-menu small { margin-top: 3px; color: var(--quiet); font-size: .68rem; }
.document-row:last-child { border-bottom: 0; }
.document-row.depth-1 { padding-left: 38px; background: rgba(255,255,255,.012); }
.document-row.depth-2, .document-row.depth-3 { padding-left: 62px; background: rgba(255,255,255,.022); }
.tree-mark { color: var(--red); }
.document-row-copy strong, .document-row-copy small { display: block; }
.document-row-copy small { margin-bottom: 4px; color: var(--quiet); font-size: .61rem; letter-spacing: .08em; }
.document-row time { color: var(--quiet); font-size: .7rem; }
.import-preview { min-width: 0; padding: 22px; overflow: hidden; }
.import-preview li, .import-preview p { overflow-wrap: anywhere; }
.import-metrics { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; }
.import-metrics article { padding: 15px; background: #09090a; border: 1px solid var(--line); }
.import-metrics strong, .import-metrics span { display: block; }
.import-metrics strong { font-size: 1.7rem; }
.import-metrics span { margin-top: 4px; color: var(--quiet); font-size: .68rem; text-transform: uppercase; }
.ownership-lock { padding: 12px 14px; color: var(--muted); background: rgba(88,101,242,.08); border-left: 2px solid #5865f2; }
.image-import-confirm { padding: 14px; background: rgba(88,101,242,.07); border: 1px solid rgba(88,101,242,.3); }
.image-import-confirm strong, .image-import-confirm small { display: block; }
.image-import-confirm small { margin-top: 4px; color: var(--quiet); line-height: 1.45; }
.import-preview details { margin-top: 12px; padding: 12px 14px; background: #09090a; border: 1px solid var(--line); }
.import-preview form { margin-top: 18px; display: grid; gap: 16px; }
.asset-fetch-form { margin: 18px 22px 0; }
.asset-status-line { margin: 14px 22px; display: flex; flex-wrap: wrap; gap: 8px; }
.asset-status-line span { padding: 7px 10px; color: var(--muted); background: #09090a; border: 1px solid var(--line); font-size: .7rem; text-transform: uppercase; }
.asset-repair-callout { margin: 0 0 22px; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 24px; color: var(--muted); background: rgba(255,114,36,.07); border: 1px solid rgba(255,114,36,.28); }
.asset-repair-callout strong { color: var(--ink); }
.asset-repair-callout p { margin: 5px 0 0; font-size: .8rem; line-height: 1.5; }
.asset-repair-callout form { flex: 0 0 auto; }
.prose a:has(> img) { margin: 8px; display: inline-block; line-height: 0; text-decoration: none; vertical-align: middle; }
.prose img { max-width: min(100%, 680px); max-height: 520px; width: auto; height: auto; margin: 18px auto; display: block; object-fit: contain; background: #070708; border: 1px solid var(--line); }
.recycle-list { margin-top: 28px; }
.recycle-row { min-height: 76px; display: grid; grid-template-columns: 48px minmax(0,1fr) auto; align-items: stretch; background: var(--panel); border: 1px solid var(--line); border-top: 0; }
.recycle-row > div { padding: 16px 18px; align-self: center; }
.recycle-row strong, .recycle-row small { display: block; }
.recycle-row small { margin-top: 5px; color: var(--quiet); }
.recycle-row > .access-pill { margin: auto 16px; }

/* v1.7 interface surfaces */
button, .primary-link, .secondary-link,
.primary-button, .publish-button, .delete-button, .secondary-button, .quiet-button,
.file-actions > a, .file-actions > button, .discord-button, .mobile-menu {
  border-radius: var(--radius-sm);
}
.primary-button, .primary-link, .publish-button, .discord-button {
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.13), 0 8px 24px rgba(0,0,0,.18);
}
.primary-button::after, .primary-link::after, .publish-button::after, .discord-button::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 18%, rgba(255,255,255,.1) 50%, transparent 82%);
  transform: translateX(-110%);
  transition: transform .35s ease;
}
.primary-button:hover::after, .primary-link:hover::after, .publish-button:hover::after, .discord-button:hover::after { transform: translateX(110%); }
.icon-button { border-radius: 50%; }

.identity-card {
  overflow: hidden;
  border-radius: var(--radius-md) var(--radius-md) 6px var(--radius-md);
  background: radial-gradient(circle at 12% 0, rgba(199,54,54,.12), transparent 46%), var(--surface-glow), var(--panel);
  box-shadow: var(--panel-shadow), inset 0 1px 0 rgba(255,255,255,.035);
}
.identity-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 31px 0;
  width: 3px;
  background: var(--signal);
}
.identity-avatar { border-radius: 11px 11px 4px 11px; box-shadow: 0 7px 20px rgba(199,54,54,.2); }
.role-badge { inset: auto 8px 7px; height: 27px; border: 1px solid rgba(199,54,54,.2); border-radius: 999px; }
.nav-folder > summary, .portal-nav a { border-radius: 9px; }
.portal-nav a[aria-current="page"]::after { inset: 9px 5px 9px auto; border-radius: 2px; }

.clearance-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 7px var(--radius-lg);
  background: radial-gradient(circle at 110% -20%, rgba(255,114,36,.24), transparent 48%), linear-gradient(145deg, rgba(199,54,54,.17), rgba(255,114,36,.035)), var(--panel);
  box-shadow: var(--panel-shadow), inset 0 1px 0 rgba(255,255,255,.055);
}
.clearance-card::before {
  content: "";
  position: absolute;
  top: 21px;
  right: 22px;
  width: 36px;
  height: 3px;
  border-radius: 3px;
  background: var(--signal);
  box-shadow: 0 0 22px rgba(199,54,54,.45);
}
.metric-grid, .security-metrics, .punishment-summary, .role-legend {
  gap: 1px;
  overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 7px var(--radius-lg);
  background: var(--line);
  box-shadow: var(--panel-shadow);
}
.metric-grid article, .security-metrics article, .punishment-summary article, .role-legend article {
  position: relative;
  border: 0;
  background: var(--surface-glow), var(--panel);
}
.metric-grid article::after, .security-metrics article::after, .punishment-summary article::after {
  content: "";
  position: absolute;
  left: 22px;
  bottom: 18px;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: rgba(199,54,54,.45);
}

.overview-panel, .action-panel, .integration-card, .profile-card, .document-reader,
.document-comments, .staff-channel-panel, .account-merge-panel, .quiz-my-list, .quiz-admin,
.log-panel, .security-alerts, .share-gate, .terms-content, .feedback-list > article {
  overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 7px var(--radius-lg);
  background: var(--surface-glow), var(--panel);
  box-shadow: var(--panel-shadow), inset 0 1px 0 rgba(255,255,255,.025);
}
.overview-panel > header, .staff-channel-panel > header, .account-merge-panel > header,
.quiz-my-list > header, .quiz-admin > header, .log-panel > header {
  position: relative;
  background: none;
}
.overview-panel > header::before, .staff-channel-panel > header::before,
.account-merge-panel > header::before, .quiz-my-list > header::before,
.quiz-admin > header::before, .log-panel > header::before {
  content: "";
  position: absolute;
  left: 22px;
  bottom: -1px;
  width: 42px;
  height: 2px;
  border-radius: 2px;
  background: var(--signal);
}
.mini-list { padding: 8px; }
.mini-list > a {
  min-height: 68px;
  margin-bottom: 5px;
  border: 1px solid transparent;
  border-radius: 11px;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.mini-list > a:last-child { margin-bottom: 0; border-bottom: 1px solid transparent; }
.mini-list > a:hover { background: rgba(255,255,255,.025); border-color: var(--line); transform: translateX(3px); }
.mini-list > a > span, .file-type {
  border-radius: 12px 12px 4px 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}

.section-tabs { gap: 5px; padding: 5px; width: fit-content; max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 13px; background: #0a0a0b; }
.section-tabs a { padding: 10px 14px; border: 0; border-radius: 9px; white-space: nowrap; }
.section-tabs a.active { background: linear-gradient(145deg, rgba(199,54,54,.16), rgba(255,114,36,.05)); box-shadow: inset 0 0 0 1px rgba(199,54,54,.2); }
.staff-record-links { gap: 10px; }
.staff-record-links a {
  border-radius: 12px 12px 4px 12px;
  background: var(--surface-glow), var(--panel);
  transition: border-color .16s ease, transform .16s ease;
}
.staff-record-links a:hover { border-color: var(--line-hot); transform: translateY(-2px); }
.guild-membership-grid { gap: 10px; }
.guild-membership-grid article, .roster-grid article {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md) var(--radius-md) 5px var(--radius-md);
  background: var(--surface-glow), var(--panel);
  box-shadow: 0 12px 35px rgba(0,0,0,.14);
}
.guild-membership-grid article::before, .roster-grid article::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: linear-gradient(var(--red), transparent 75%);
}
.guild-membership-grid span, .role-tags span, .access-pill, .status-pill, .integration-state,
.secret-status, .asset-status-line span, .punishment-action, .log-result {
  border-radius: 999px;
}

.quiz-card-grid { gap: 16px; }
.quiz-card-grid > article, .quiz-builder-question, .quiz-taker fieldset,
.quiz-review-answers article, .review-form {
  overflow: hidden;
  border-radius: var(--radius-md) var(--radius-md) 5px var(--radius-md);
  background: radial-gradient(circle at 100% 0, rgba(199,54,54,.075), transparent 45%), #09090a;
  box-shadow: 0 12px 34px rgba(0,0,0,.16);
}
.quiz-option span { border-radius: 10px; }
.quiz-taker legend { border-radius: 12px 12px 4px 12px; }
.overview-panel > .mini-empty, .quiz-my-list .mini-empty, .quiz-admin .mini-empty, .large-empty {
  position: relative;
  margin: 14px;
  min-height: 150px;
  overflow: hidden;
  border: 1px dashed #343130;
  border-radius: var(--radius-md);
  background: radial-gradient(circle at 50% 120%, rgba(199,54,54,.07), transparent 44%), repeating-linear-gradient(135deg, transparent 0 20px, rgba(255,255,255,.012) 20px 21px);
}
.large-empty { min-height: 300px; }

.file-picker-control, .file-picker-button, input, select, textarea,
.profile-check, .access-modes label > span, .access-rules,
.access-rules label > span, .form-note, .inline-access, .public-document-option,
.public-link-bar, .terms-summary, .terms-accept, .link-callout, .setup-guide,
.staff-role-mapper, .staff-role-mapper > label, .role-editor-card,
.role-editor-card fieldset, .import-metrics article, .import-preview details,
.asset-repair-callout, .recycle-row, .document-tree, .bulk-action-bar {
  border-radius: var(--radius-md);
}
.file-picker-control { background: linear-gradient(110deg, rgba(199,54,54,.035), transparent 35%), #09090a; }
.file-picker-button { border-radius: 9px; }
.document-tree, .bulk-action-bar { overflow: hidden; }
.bulk-action-bar { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.bulk-action-bar + .document-tree, .bulk-document-form .document-tree { border-top-left-radius: 0; border-top-right-radius: 0; }
.document-row { transition: background .16s ease, padding-left .16s ease; }
.document-row:hover { background: rgba(255,255,255,.025); }
.photo-vault-grid > article, .document-card {
  overflow: hidden;
  border-radius: var(--radius-md) var(--radius-md) 5px var(--radius-md);
  background: var(--surface-glow), var(--panel);
  box-shadow: 0 14px 38px rgba(0,0,0,.17);
}
.auth-card {
  overflow: hidden;
  border-radius: 24px 24px 8px 24px;
  background: radial-gradient(circle at 100% 0, rgba(199,54,54,.11), transparent 38%), var(--surface-glow), rgba(14,14,15,.97);
}
.auth-card::before { border-radius: 24px 24px 0 0; }
.user-table { display: grid; gap: 8px; }
.user-table > header { margin-bottom: -8px; }
.user-row {
  border: 1px solid var(--line);
  border-radius: 12px 12px 4px 12px;
  background: var(--surface-glow), rgba(14,14,15,.72);
}
.user-row:last-child { border-bottom: 1px solid var(--line); }
.vault-list { display: grid; gap: 8px; border-top: 0; }
.vault-row {
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 12px 12px 4px 12px;
  background: var(--surface-glow), rgba(14,14,15,.72);
}
.role-editor-card, .feedback-list > article { border-radius: var(--radius-md) var(--radius-md) 5px var(--radius-md); }
.photo-preview { border-radius: 12px 12px 4px 4px; }
.profile-avatar { border-radius: 22px 22px 7px 22px; box-shadow: 0 16px 38px rgba(199,54,54,.17); }
.build-version {
  padding: 7px 11px 7px 9px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  box-shadow: 0 8px 28px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.04);
  color: #8d8883;
  text-decoration: none;
  cursor: pointer;
}
.build-version:hover, .build-version:focus-visible { color: var(--ink); border-color: var(--line-hot); }
.build-version::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--red); box-shadow: 0 0 9px rgba(199,54,54,.7); }

/* v1.9 visual rhythm and interaction states */
.portal-content { position: relative; isolation: isolate; }
.portal-content::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -36px;
  right: -110px;
  width: min(360px, 32vw);
  height: 280px;
  pointer-events: none;
  background: radial-gradient(ellipse at right, rgba(199,54,54,.055), rgba(255,114,36,.018) 46%, transparent 74%);
  filter: blur(10px);
}
.page-heading { position: relative; min-width: 0; padding-left: 18px; overflow: hidden; }
.page-heading:has(.document-create-menu) { z-index: 20; overflow: visible; }
.page-heading:has(.document-create-menu)::after { overflow: hidden; }
.document-create-menu { z-index: 30; }
.feature-toggle-grid { margin: 28px 0; padding: 22px; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; border: 1px solid var(--line); }
.feature-toggle-grid legend { padding: 0 8px; color: var(--ink); font-weight: 850; }
.feature-toggle-grid > p { grid-column: 1 / -1; margin: 0 0 8px; color: var(--muted); line-height: 1.55; }
.feature-toggle-grid > label { min-width: 0; padding: 13px 14px; display: grid; grid-template-columns: 1fr 42px; gap: 14px; align-items: center; border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.022); cursor: pointer; }
.feature-toggle-grid > label > span { display: grid; gap: 4px; }
.feature-toggle-grid strong, .feature-toggle-grid small { display: block; }
.feature-toggle-grid small { color: var(--quiet); line-height: 1.35; }
.feature-toggle-grid input { position: absolute; width: 1px !important; height: 1px !important; opacity: 0; }
.feature-toggle-grid i { position: relative; width: 42px; height: 24px; border: 1px solid rgba(255,255,255,.16); border-radius: 999px; background: rgba(255,255,255,.07); }
.feature-toggle-grid i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #aaa5a1; transition: transform .2s ease, background .2s ease; }
.feature-toggle-grid input:checked + i { border-color: rgba(93,226,153,.52); background: rgba(93,226,153,.2); }
.feature-toggle-grid input:checked + i::after { transform: translateX(18px); background: var(--green); }
.calendar-shell { margin-top: 32px; border: 1px solid var(--line); background: var(--panel); }
.productivity-tabs { display: flex; gap: 8px; align-items: center; }
.productivity-tabs a { padding: 9px 14px; border: 1px solid var(--line); color: var(--muted); text-decoration: none; font-size: .78rem; }
.productivity-tabs a.active { color: var(--ink); border-color: var(--red); background: rgba(199,54,54,.08); }
.task-shell { margin-top: 32px; border: 1px solid var(--line); background: var(--panel); }
.task-detail { margin-top: 26px; }
.quiz-flow-summary { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; margin:22px 0; }
.quiz-flow-summary > div { padding:22px 26px; border:1px solid var(--line); border-radius:16px; background:linear-gradient(135deg,rgba(251,52,70,.12),var(--panel)); }
.quiz-flow-summary span { display:block; color:var(--red); font-size:.7rem; font-weight:850; letter-spacing:.12em; }
.quiz-flow-summary strong { display:block; margin:10px 0 5px; font-size:clamp(1.35rem,2.4vw,2rem); }
.quiz-flow-summary small { color:var(--muted); }
.quiz-taker,.quiz-review-form { max-width:1100px; margin-inline:auto; }
.quiz-taker fieldset,.quiz-review-answers article { border-radius:16px; box-shadow:0 14px 38px rgba(0,0,0,.14); }
.quiz-review-answers article { margin-bottom:16px; }
.quiz-review-form .review-form { position:sticky; bottom:0; z-index:2; padding:18px; border:1px solid var(--line); border-radius:16px; background:var(--panel); box-shadow:0 -12px 36px rgba(0,0,0,.28); }
@media (max-width:600px) { .quiz-flow-summary { grid-template-columns:1fr; } }
.channel-paired { display:inline-grid; place-items:center; width:1.2rem; height:1.2rem; margin-left:.35rem; border-radius:50%; background:rgba(55,210,139,.16); color:#6ee7ab; font-size:.82rem; vertical-align:middle; }
.task-detail-header { display:flex; justify-content:space-between; align-items:flex-start; gap:20px; padding:26px 30px; border:1px solid var(--line); background:var(--panel); }
.task-detail-header p { margin:0 0 8px; color:var(--red); font-size:.7rem; font-weight:800; letter-spacing:.13em; }
.task-detail-header h1 { margin:0 0 12px; font-size:clamp(1.6rem,3vw,2.6rem); line-height:1.1; overflow-wrap:anywhere; }
.task-detail-grid { display:grid; grid-template-columns:minmax(0,2fr) minmax(260px,1fr); gap:20px; margin-top:20px; align-items:start; }
.task-detail-main,.task-detail-side { display:grid; gap:20px; min-width:0; }
.task-detail .profile-card { padding:24px; border-radius:16px; }
.task-detail .profile-card h2 { font-size:1.2rem; margin:0 0 16px; }
.task-detail .profile-card form { margin:16px 0 0; gap:10px; }
.task-detail .profile-card form > small { color:var(--muted); }
.task-detail .profile-card form button { justify-self:start; }
.task-activity { border-top:1px solid var(--line); padding:15px 0; }
.task-activity strong { display:block; }
.task-activity small { color:var(--muted); }
.task-activity p { margin-bottom:0; overflow-wrap:anywhere; }
@media (max-width:850px) { .task-detail-grid { grid-template-columns:1fr; } .task-detail-header { padding:20px; } }
.task-shell > header { padding: 22px 24px; display: flex; justify-content: space-between; gap: 20px; align-items: end; border-bottom: 1px solid var(--line); }
.task-shell > header p, .task-shell > header h2 { margin: 0; }
.task-shell > header p { color: var(--red); font-size: .69rem; font-weight: 850; letter-spacing: .14em; }
.task-shell > header h2 { margin-top: 5px; font-size: 1.45rem; }
.section-back-link { display: inline-block; margin-top: 10px; color: var(--muted); font-size: .78rem; text-decoration: none; }
.section-back-link:hover { color: var(--ink); }
.task-list { display: grid; }
.task-row { display: grid; grid-template-columns: 18px minmax(0,1fr) auto; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--line); align-items: start; }
.task-row:last-child { border-bottom: 0; }
.task-marker span { display: block; width: 10px; height: 10px; margin-top: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px rgba(199,54,54,.1); }
.task-done .task-marker span { background: #56c596; box-shadow: 0 0 0 4px rgba(86,197,150,.1); }
.task-copy > div { display: flex; flex-wrap: wrap; gap: 8px; }
.task-status, .task-priority { color: var(--red); font-size: .65rem; font-weight: 850; letter-spacing: .1em; }
.task-priority { color: var(--quiet); }
.task-copy h3 { margin: 6px 0 6px; font-size: 1.05rem; }
.task-copy p { margin: 0 0 7px; color: var(--muted); line-height: 1.5; }
.task-copy small { color: var(--quiet); }
.task-actions { display: flex; gap: 8px; align-items: start; }
.task-actions form { display: flex; gap: 6px; align-items: center; }
.task-actions select { min-width: 116px; }
.impersonation-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; align-items: center; justify-content: center; gap: 20px; padding: 10px 18px; color: #fff; background: #8d1823; box-shadow: 0 -6px 24px rgba(0,0,0,.28); }
.impersonation-bar span { font-size: .8rem; }
.impersonation-bar form { margin: 0; }
.impersonation-bar .primary-button { padding: 8px 13px; background: #fff; color: #8d1823; }
@media (max-width: 800px) { .task-row { grid-template-columns: 18px minmax(0,1fr); } .task-actions { grid-column: 2; } .impersonation-bar { justify-content: space-between; } }
.calendar-shell > header { padding: 22px 24px; display: flex; justify-content: space-between; gap: 20px; align-items: end; border-bottom: 1px solid var(--line); }
.calendar-shell > header p, .calendar-shell > header h2 { margin: 0; }
.calendar-shell > header p { color: var(--red); font-size: .69rem; font-weight: 850; letter-spacing: .14em; }
.calendar-shell > header h2 { margin-top: 5px; font-size: 1.45rem; }
.calendar-shell > header > span { color: var(--quiet); font-size: .78rem; }
.calendar-list { display: grid; }
.calendar-event { padding: 22px 24px; display: grid; grid-template-columns: 64px minmax(0,1fr) auto; gap: 20px; align-items: start; border-bottom: 1px solid var(--line); background: linear-gradient(100deg, rgba(199,54,54,.04), transparent 35%); }
.calendar-event:last-child { border-bottom: 0; }
.calendar-event > time { width: 58px; height: 64px; display: grid; place-content: center; text-align: center; border: 1px solid rgba(255,78,67,.28); background: rgba(199,54,54,.07); }
.calendar-event > time strong { font-size: 1.5rem; line-height: 1; }
.calendar-event > time span { margin-top: 5px; color: var(--red); font-size: .66rem; font-weight: 850; letter-spacing: .12em; }
.calendar-event > div > small { color: var(--red); font-weight: 800; }
.calendar-event h2 { margin: 5px 0 8px; font-size: 1.35rem; }
.calendar-event p { margin: 0; color: var(--muted); line-height: 1.55; }
.calendar-event footer { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 10px 22px; color: var(--quiet); font-size: .75rem; }
.event-audience { margin: 18px 0; padding: 18px; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; border: 1px solid var(--line); }
.event-audience legend { padding: 0 8px; font-weight: 800; }
.event-audience label { display: flex; align-items: center; gap: 9px; }
.event-member-targets { grid-column: 1 / -1; padding-top: 12px; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; border-top: 1px solid var(--line); }
.recycle-row a { color: var(--ink); text-decoration: none; }
.recycle-row a:hover { color: var(--red); }
.recycle-preview-action { margin-top: 18px; }
.page-heading > div:first-child { min-width: 0; }
.page-heading::before { content: ""; position: absolute; inset: 4px auto 4px 0; width: 3px; border-radius: 999px; background: linear-gradient(180deg, rgba(255,255,255,.72), rgba(199,54,54,.72) 48%, rgba(255,114,36,.25)); box-shadow: 0 0 18px rgba(199,54,54,.18); }
.page-heading::after { content: ""; position: absolute; top: 8%; right: -54px; width: 160px; height: 84%; pointer-events: none; background: none; }
.page-heading h1 { max-width: min(100%, 720px); color: var(--ink); background: none; font-size: clamp(2.35rem, 4vw, 4.45rem); line-height: .96; letter-spacing: -.05em; overflow-wrap: anywhere; animation: none; }
.page-heading.compact h1 { font-size: clamp(2.15rem, 3.35vw, 3.65rem); }
.portal-content > .page-heading:not(.compact) { margin-bottom: 26px; padding-bottom: 2px; }
.heading-actions form { margin: 0; }
.role-discovery-action { margin: 0 0 18px; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border: 1px solid rgba(255,255,255,.1); border-radius: 16px; background: rgba(255,255,255,.025); }
.role-discovery-action div { display: grid; gap: 4px; }
.role-discovery-action small { color: var(--muted); line-height: 1.45; }
.discovered-role-group { padding: 16px; border: 1px solid rgba(255,255,255,.09); border-radius: 16px; background: rgba(255,255,255,.02); }
.discovered-role-group + .discovered-role-group { margin-top: 12px; }
.discovered-role-group > header { margin-bottom: 12px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.discovered-role-group > header small { color: var(--quiet); }
.discovered-role-group > label { display: grid; grid-template-columns: minmax(170px, .7fr) minmax(240px, 1.3fr); gap: 18px; align-items: center; }
.discovered-role-group > label > span { display: grid; gap: 5px; }
.discovered-role-group > label small { display: block; color: var(--quiet); line-height: 1.4; }
.discovered-role-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.discovered-role-options label { min-width: 0; padding: 10px 12px; display: flex; align-items: center; gap: 9px; border: 1px solid rgba(255,255,255,.08); border-radius: 12px; background: rgba(0,0,0,.16); }
.discovered-role-options input { width: 16px !important; min-width: 16px; height: 16px !important; margin: 0; accent-color: var(--red); }
.discovered-role-options span { min-width: 0; overflow-wrap: anywhere; }
.server-sync-list { display: grid; gap: 10px; }
.server-sync-list > label { min-width: 0; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border: 1px solid rgba(255,255,255,.09); border-radius: 16px; background: rgba(255,255,255,.022); }
.server-sync-list > label > div { min-width: 0; display: grid; gap: 4px; }
.server-sync-list small { color: var(--quiet); line-height: 1.4; overflow-wrap: anywhere; }
.server-toggle { position: relative; flex: 0 0 auto; display: inline-flex; align-items: center; gap: 9px; cursor: pointer; }
.server-toggle input { position: absolute; width: 1px !important; height: 1px !important; opacity: 0; pointer-events: none; }
.server-toggle i { position: relative; width: 42px; height: 24px; border: 1px solid rgba(255,255,255,.16); border-radius: 999px; background: rgba(255,255,255,.07); transition: background .2s ease, border-color .2s ease; }
.server-toggle i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #aaa5a1; transition: transform .2s ease, background .2s ease; }
.server-toggle input:checked + i { border-color: rgba(93,226,153,.52); background: rgba(93,226,153,.2); }
.server-toggle input:checked + i::after { transform: translateX(18px); background: var(--green); }
.server-toggle input:focus-visible + i { outline: 2px solid var(--red); outline-offset: 3px; }
.server-toggle b { min-width: 58px; color: var(--muted); font-size: .72rem; }
.quiz-results article form { margin: 0; }
.quiz-remind-button { min-height: 36px; padding: 8px 13px; }
.quiz-reminder-tools { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.quiz-reminder-tools form { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.quiz-reminder-tools label { display: grid; gap: 4px; color: var(--quiet); font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.quiz-reminder-tools input[type="datetime-local"] { min-height: 36px; }
.quiz-reminder-tools .secondary-button { white-space: nowrap; }
.quiz-card-grid form > label:nth-of-type(2) > span::after { content: 'OPTIONAL'; display: inline-block; margin-left: 8px; color: var(--red); border: 1px solid rgba(199, 54, 54, .45); border-radius: 999px; padding: 3px 7px; font-size: .58rem; letter-spacing: .12em; }
.quiz-results article > div { min-width: 0; }
.quiz-results article > div small { display: block; margin-top: 6px; color: var(--quiet); font-size: .68rem; line-height: 1.45; }
.quiz-result-score { display: grid; gap: 4px; justify-items: end; color: var(--muted); font-size: .72rem; text-align: right; }
.quiz-result-score em { color: var(--quiet); font-size: .64rem; font-style: normal; font-weight: 500; }
.quiz-status-passed { color: #a8e9c5 !important; border-color: rgba(93,226,153,.3) !important; background: rgba(93,226,153,.09) !important; }
.quiz-status-failed { color: #ffaaa5 !important; border-color: rgba(255,90,76,.35) !important; background: rgba(255,90,76,.1) !important; }
.quiz-status-pending { color: #f5d494 !important; border-color: rgba(245,212,148,.3) !important; background: rgba(245,212,148,.08) !important; }
.punishment-enrichment { margin-top: 24px; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: #0d0d0f; }
.punishment-enrichment header { margin-bottom: 16px; }
.punishment-enrichment header p { margin: 0 0 5px; color: var(--red); font-size: .64rem; font-weight: 850; letter-spacing: .12em; }
.punishment-enrichment header h2 { margin: 0; font-size: 1.15rem; }
.punishment-enrichment header span { display: block; margin-top: 7px; color: var(--quiet); font-size: .75rem; }
.punishment-enrichment-grid { display: grid; gap: 10px; }
.punishment-enrichment-grid article { padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.018); }
.punishment-enrichment-grid article > div { display: flex; justify-content: space-between; gap: 14px; }
.punishment-enrichment-grid article > div span { color: var(--quiet); font-size: .75rem; }
.punishment-enrichment-grid article > div strong { color: var(--ink); letter-spacing: .01em; }
.punishment-enrichment-grid article > div { padding-bottom: 2px; }
.punishment-enrichment-grid dl { margin: 12px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.punishment-enrichment-grid dt { color: var(--quiet); font-size: .6rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.punishment-enrichment-grid dd { margin: 3px 0 0; color: var(--muted); font-size: .72rem; overflow-wrap: anywhere; }
.punishment-enrichment-grid dd small { display: block; margin-top: 3px; color: var(--quiet); }
.punishment-enrichment .punishment-attachments { margin: 13px -15px -15px; padding: 12px 15px 15px; background: rgba(0,0,0,.14); }
.punishment-image-preview { min-width: 110px; padding: 0; display: grid; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #090909; }
.punishment-image-preview img { width: 110px; height: 76px; object-fit: cover; background: #151519; }
.punishment-image-preview img.image-load-failed { display: block; position: relative; color: var(--quiet); }
.punishment-image-preview:has(img.image-load-failed)::before { content: 'Evidence unavailable'; min-height: 76px; display: grid; place-items: center; padding: 10px; color: var(--quiet); background: repeating-linear-gradient(135deg, #151519, #151519 8px, #19191e 8px, #19191e 16px); font-size: .66rem; text-align: center; }
.punishment-enrichment-grid article { box-shadow: 0 6px 16px rgba(0,0,0,.1); }
.punishment-image-preview span { padding: 5px 7px; color: var(--muted); font-size: .62rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.punishment-type-breakdown, .profile-punishment-summary, .punishment-embed-gallery { margin-top: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.016); }
.punishment-type-breakdown header, .profile-punishment-summary header, .punishment-embed-gallery header { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.punishment-type-breakdown header p, .profile-punishment-summary header p, .punishment-embed-gallery header p { margin: 0 0 4px; color: var(--red); font-size: .61rem; font-weight: 850; letter-spacing: .12em; }
.punishment-type-breakdown h2, .profile-punishment-summary h2, .punishment-embed-gallery h2 { margin: 0; font-size: 1.05rem; }
.punishment-type-breakdown header > span, .profile-punishment-summary header > span, .punishment-embed-gallery header > span { color: var(--quiet); font-size: .7rem; }
.punishment-type-breakdown > div, .profile-punishment-summary > div { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.punishment-type-breakdown article, .punishment-type-breakdown button, .profile-punishment-summary article { padding: 11px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.018); }
.punishment-type-breakdown button { width: 100%; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: border-color .16s ease, background .16s ease, transform .16s ease; }
.punishment-type-breakdown button strong, .punishment-type-breakdown button span { display: block; }
.punishment-type-breakdown button { display: flex; align-items: baseline; gap: 4px; }
.punishment-type-breakdown button:hover, .punishment-type-breakdown button[aria-pressed="true"] { border-color: rgba(255,92,103,.7); background: rgba(255,70,83,.08); transform: translateY(-1px); }
.punishment-type-breakdown article strong, .profile-punishment-summary article strong { display: block; font-size: 1.2rem; }
.punishment-type-breakdown article span, .profile-punishment-summary article span { color: var(--quiet); font-size: .67rem; }
.punishment-type-warning strong { color: #f5d494; }.punishment-type-note strong { color: #b8c5ff; }.punishment-type-ban strong { color: #ff8580; }.punishment-type-mute strong { color: #c5a8ff; }.punishment-type-kick strong { color: #9de4e8; }
.punishment-embed-gallery > div { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.punishment-embed-gallery article { min-width: 0; display: grid; gap: 8px; }
.punishment-embed-gallery article > div { display: grid; gap: 3px; }
.punishment-embed-gallery article span, .punishment-embed-gallery article small { color: var(--quiet); font-size: .68rem; }
.profile-punishment-evidence { margin-top: 12px; display: flex !important; grid-template-columns: none !important; overflow-x: auto; }
.profile-punishment-evidence .punishment-image-preview { flex: 0 0 140px; }
.profile-punishment-evidence .punishment-image-preview img { width: 140px; height: 88px; }
.metric-grid article, .overview-panel, .quiz-card-grid > article, .member-directory-row {
  background-image: linear-gradient(145deg, rgba(255,255,255,.022), transparent 42%), radial-gradient(circle at 100% 0, rgba(255,73,59,.055), transparent 38%);
  transition: border-color .2s ease, transform .2s ease, background-color .2s ease;
}
.metric-grid article:hover, .quiz-card-grid > article:hover, .member-directory-row:hover { border-color: rgba(255,90,63,.38); transform: translateY(-2px); }
.secure-workspace .status-dot { animation: securePulse 2.1s ease-in-out infinite; }
.primary-button.is-submitting, .secondary-button.is-submitting { cursor: wait; opacity: .82; }
.submit-ack { margin: 0; color: #8ce9b2; font-size: .74rem; font-weight: 750; }

.template-download {
  min-width: 226px;
  padding: 10px 14px;
  display: grid;
  grid-template-columns: 36px 1fr;
  column-gap: 10px;
  align-items: center;
  color: var(--ink);

  text-decoration: none;
  border: 1px solid rgba(255,114,36,.32);
  border-radius: 13px 13px 4px 13px;
  background: linear-gradient(135deg, rgba(199,54,54,.11), rgba(255,114,36,.035));
}
.template-download > span { grid-row: 1 / 3; width: 36px; height: 36px; display: grid; place-items: center; color: #ffb098; border: 1px solid rgba(255,114,36,.3); border-radius: 10px 10px 3px 10px; font-size: .62rem; font-weight: 900; }
.template-download strong, .template-download small { display: block; }
.template-download strong { font-size: .76rem; }
.template-download small { color: var(--quiet); font-size: .63rem; }
.template-download:hover { border-color: var(--orange); background: linear-gradient(135deg, rgba(199,54,54,.18), rgba(255,114,36,.07)); }

@media (max-width: 700px) {
  .record-details summary { align-items: flex-start; }
  .record-details summary small { text-align: right; }
  .record-summary-list article { grid-template-columns: 1fr; gap: 5px; }
  .discovered-role-group > label { grid-template-columns: 1fr; gap: 10px; }
  .server-sync-list > label { align-items: flex-start; flex-direction: column; }
  .server-toggle { align-self: stretch; justify-content: flex-end; }
}

.member-directory { margin-top: 26px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px 16px 5px 16px; background: rgba(10,10,11,.74); }
.member-role-group[hidden] { display: none !important; }
.member-role-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0; padding: 12px 20px; color: var(--ink); background: none; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: .81rem; letter-spacing: .03em; }
.member-role-heading small { color: var(--quiet); font-size: .7rem; font-weight: 600; }
.member-directory > header { padding: 18px 20px; display: flex; justify-content: space-between; align-items: end; gap: 22px; border-bottom: 1px solid var(--line); }
.member-directory > header .search-field { width: min(100%, 390px); }
.member-directory > header > small { color: var(--quiet); }
.member-directory-row { min-width: 0; padding: 15px 18px; display: grid; grid-template-columns: 44px minmax(150px,1.25fr) minmax(110px,.7fr) minmax(150px,1fr) minmax(130px,.75fr) auto; gap: 14px; align-items: center; color: var(--ink); border-bottom: 1px solid var(--line); text-decoration: none; }
.member-directory-row:last-child { border-bottom: 0; }
.member-directory-row.archived { opacity: .68; }
.member-directory-identity, .member-directory-state { min-width: 0; }
.member-directory-identity strong, .member-directory-identity small, .member-directory-state b, .member-directory-state small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-directory-identity small, .member-directory-state small, .member-directory-guilds small { margin-top: 4px; color: var(--quiet); font-size: .68rem; }
.member-directory-state b { font-size: .76rem; }
.member-directory-guilds { display: flex; flex-wrap: wrap; gap: 5px; }
.member-directory-guilds em { padding: 4px 7px; color: #ffb098; background: rgba(255,114,36,.06); border: 1px solid rgba(255,114,36,.2); border-radius: 999px; font-size: .6rem; font-style: normal; font-weight: 800; }
.member-directory .agreement-state { width: fit-content; }
.member-open { color: var(--muted); font-size: .7rem; white-space: nowrap; }
.member-open span { color: var(--orange); }
.staff-record-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.staff-notes-card { grid-column: 1 / -1; }
.member-access-card form { display: grid; gap: 14px; }
.member-access-card form + form { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.role-batch-form { display: grid; gap: 18px; }
.role-batch-form .role-editor-card { margin: 0; }
.role-batch-save { position: sticky; bottom: 18px; z-index: 3; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; gap: 18px; border: 1px solid rgba(255,90,63,.35); border-radius: 14px 14px 5px 14px; background: rgba(12,12,13,.94); box-shadow: 0 18px 50px rgba(0,0,0,.42); backdrop-filter: blur(16px); }
.role-batch-save span { color: var(--muted); font-size: .75rem; }

.quiz-import-panel { overflow: hidden; border-radius: 17px 17px 5px 17px; }
.quiz-import-panel > header { align-items: flex-start; }
.quiz-import-panel > header h2 { font-size: clamp(1.45rem, 2.1vw, 2rem); line-height: 1.08; }
.quiz-import-panel > header span { display: block; margin-top: 7px; color: var(--quiet); font-size: .72rem; }
.quiz-template-links { padding: 16px 22px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, rgba(199,54,54,.045), transparent); }
.quiz-import-panel > form { padding-top: 22px; }
.quiz-card-actions { margin: 16px 0 0; padding: 12px 0; display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.quiz-card-actions small { margin-left: auto; }
.quiz-detail { margin-top: 26px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px 16px 5px 16px; background: var(--panel); }
.quiz-detail > header { padding: 18px 22px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); }
.quiz-detail > header small { margin-left: auto; color: var(--quiet); }
.quiz-detail > .form-note { margin: 18px 22px; }
.quiz-detail-questions article { padding: 20px 22px; display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 16px; border-bottom: 1px solid var(--line); }
.quiz-detail-questions article:last-child { border-bottom: 0; }
.quiz-detail-questions article > span { width: 32px; height: 32px; display: grid; place-items: center; color: var(--orange); border: 1px solid rgba(255,114,36,.28); border-radius: 10px 10px 3px 10px; font-size: .7rem; font-weight: 900; }
.quiz-detail-questions h2 { margin: 7px 0 10px; font-size: 1.1rem; line-height: 1.4; }
.quiz-detail-questions small { color: var(--quiet); }
.quiz-detail-questions ul { margin: 0; padding-left: 20px; color: var(--muted); }
.quiz-detail-questions li.correct { color: #89e5af; font-weight: 800; }
.quiz-editor-panel { max-width: 1100px; }

@keyframes securePulse { 0%, 100% { opacity: .55; transform: scale(.88); box-shadow: 0 0 0 0 rgba(54,211,124,.35); } 50% { opacity: 1; transform: scale(1.08); box-shadow: 0 0 0 6px rgba(54,211,124,0), 0 0 13px rgba(54,211,124,.75); } }

.document-review-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin-top:22px}
.related-document-list,.review-list{display:grid;gap:10px}
.related-document{display:grid;gap:3px;padding:12px 14px;border:1px solid var(--line);border-radius:12px;background:rgba(255,255,255,.02);text-decoration:none}
.related-document:hover{border-color:var(--accent);background:rgba(255,255,255,.04)}
.related-document span{font-size:10px;letter-spacing:.12em;text-transform:uppercase;color:var(--muted)}
.related-document strong{color:var(--ink);font-size:14px}
.related-document small{color:var(--muted)}
.compact-review-form{display:grid;gap:12px;margin-top:16px}
.review-list article{padding:12px 14px;border:1px solid var(--line);border-radius:12px;background:rgba(255,255,255,.02)}
.review-list article>div{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.review-list time{margin-left:auto;color:var(--muted);font-size:11px}
.review-list p{margin:10px 0 0;color:var(--muted)}
.review-approved{border-color:rgba(72,211,137,.45)!important;color:#7ee2a8}
.review-changes_requested{border-color:rgba(245,158,11,.45)!important;color:#fbbf24}
@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-grid article:nth-child(2) { border-right: 0; }
  .metric-grid article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .document-grid { grid-template-columns: 1fr 1fr; }
  .editor-workspace { grid-template-columns: 1fr; }
  .editor-workspace textarea { border-right: 0; border-bottom: 1px solid var(--line); }
  .editor-preview { min-height: 420px; }
  .role-editor-grid, .roster-grid { grid-template-columns: 1fr 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
  .quiz-card-grid { grid-template-columns: 1fr 1fr; }
  .punishment-primary { grid-template-columns: 105px minmax(120px,.8fr) minmax(200px,1.8fr) 60px; }
  .punishment-staff { display: none !important; }
  .document-row { grid-template-columns: 20px minmax(0,1fr) 25px; }
  .document-row-meta { grid-column: 2 / -1; grid-template-columns: max-content max-content max-content; justify-content: start; }
  .document-row-meta time { text-align: left; }
  .member-directory-row { grid-template-columns: 44px minmax(150px,1fr) minmax(110px,.7fr) minmax(130px,.8fr) auto; }
  .member-directory-guilds { display: none; }
}
@media (max-width: 820px) {
  .auth-shell { grid-template-columns: 1fr; max-width: 680px; margin: 0 auto; }
  .auth-command-rail { min-height: 0; border-right: 1px solid var(--line); border-bottom: 0; }
  .auth-command-rail h2 { margin-top: 28px; }
  .command-rail-footer { margin-top: 24px; }
  .auth-card { min-height: 0; }
  .terms-accept { position: static; grid-template-columns: 1fr; }
  .staff-record-grid { grid-template-columns: 1fr; }
  .guild-membership-grid { grid-template-columns: 1fr; }
  .import-metrics { grid-template-columns: 1fr 1fr; }
  .portal-shell { display: block; }
  .portal-sidebar { transform: translateX(-100%); transition: transform .25s ease; }
  .portal-sidebar.open { transform: none; }
  .portal-main { min-width: 0; }
  .mobile-menu { min-height: 40px; padding: 0 12px; display: inline-flex; align-items: center; color: var(--ink); background: var(--panel); border: 1px solid var(--line); }
  .portal-topbar > div { display: none; }
  .page-heading, .integration-card > header { display: grid; grid-template-columns: 1fr; align-items: start; }
  .clearance-card { width: 100%; }
  .overview-grid, .document-grid { grid-template-columns: 1fr; }
  .vault-row { grid-template-columns: 46px 1fr; }
  .file-actions, .inline-access { grid-column: 2; }
  .file-actions { flex-wrap: wrap; }
  .user-table > header { display: none; }
  .user-row { grid-template-columns: 1fr 1fr; }
  .role-legend { grid-template-columns: 1fr; }
  .role-legend article { border-right: 0; border-bottom: 1px solid var(--line); }
  .role-legend article:last-child { border-bottom: 0; }
  .security-metrics { grid-template-columns: 1fr; }
  .security-metrics article { border-right: 0; border-bottom: 1px solid var(--line); }
  .security-metrics article:last-child { border-bottom: 0; }
  .log-panel > header { align-items: stretch; flex-direction: column; }
  .log-header { display: none; }
  .log-table article { grid-template-columns: 110px 1fr; gap: 8px 14px; }
  .log-table article > *::before { display: block; margin-bottom: 3px; color: var(--quiet); font-size: .58rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
  .log-table article > :nth-child(1)::before { content: 'Event'; }
  .log-table article > :nth-child(2)::before { content: 'Actor'; }
  .log-table article > :nth-child(3)::before { content: 'IP address'; }
  .log-table article > :nth-child(4)::before { content: 'Device'; }
  .log-table article > :nth-child(5)::before { content: 'Time'; }
  .role-editor-grid, .roster-grid { grid-template-columns: 1fr; }
  .document-review-grid { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
  .staff-channel-panel > div > form { grid-template-columns: 1fr; align-items: stretch; }
  .quiz-card-grid { grid-template-columns: 1fr; }
  .quiz-submit { align-items: stretch; flex-direction: column; }
  .punishment-summary { grid-template-columns: 1fr 1fr; }
  .punishment-filter-controls { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .punishment-filter-controls .search-field, .punishment-filter-controls .filter-count { grid-column: 1 / -1; }
  .punishment-summary article:nth-child(2) { border-right: 0; }
  .punishment-summary article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .punishment-primary { grid-template-columns: 90px minmax(110px,.7fr) minmax(160px,1.4fr) 54px; gap: 10px; }
  .punishment-details dl { grid-template-columns: 1fr; }
  .staff-role-mapper > label { grid-template-columns: 1fr; gap: 9px; }
  .member-directory-row { grid-template-columns: 44px minmax(0,1fr) auto; }
  .member-directory-state, .member-directory .member-compliance { display: none; }
  .role-batch-save { position: static; align-items: stretch; flex-direction: column; }
}
@media (max-width: 580px) {
  .portal-content { width: min(calc(100% - 36px), 1500px); }
  .portal-topbar { padding-inline: 18px; }
  .page-heading h1 { font-size: 2.45rem; }
  .metric-grid, .two-fields, .access-modes, .guild-config > div { grid-template-columns: 1fr; }
  .metric-grid article { border-right: 0; border-bottom: 1px solid var(--line); }
  .metric-grid article:last-child { border-bottom: 0; }
  .filter-bar { align-items: stretch; flex-direction: column; }
  .document-top, .editor-submit, .shared-document > header { align-items: stretch; flex-direction: column; }
  .document-reader { padding: 26px 20px; }
  .editor-toolbar { flex-wrap: wrap; }
  .user-row { grid-template-columns: 1fr; }
  .shared-document > header > div { align-items: flex-start; flex-direction: column; }
  .role-editor-card fieldset { grid-template-columns: 1fr; }
  .terms-header { grid-template-columns: 1fr; gap: 28px; }
  .terms-header .staff-brand { width: fit-content; }
  .file-picker-control { grid-template-columns: 1fr; gap: 8px; }
  .file-picker-name { padding: 0 7px 4px; }
  .punishment-summary { grid-template-columns: 1fr; }
  .punishment-filter-controls { grid-template-columns: 1fr; }
  .punishment-filter-controls .search-field, .punishment-filter-controls .filter-count { grid-column: auto; }
  .punishment-summary article { border-right: 0; border-bottom: 1px solid var(--line); }
  .punishment-summary article:last-child { border-bottom: 0; }
  .punishment-primary { grid-template-columns: 1fr auto; gap: 10px 14px; }
  .punishment-action { grid-column: 1; }
  .punishment-primary time { grid-column: 2; grid-row: 1; }
  .punishment-player, .punishment-reason { grid-column: 1 / -1; }
  .person-history-main { grid-template-columns: auto minmax(0,1fr); }
  .person-history-main time { grid-column: 2; }
  .person-history-item footer .secondary-link { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }

/* Unified sidebar rhythm: links and disclosure rows share the same footprint. */
.portal-sidebar .identity-card { margin: 24px 0 18px; }
.portal-sidebar .portal-nav { gap: 2px; }
.portal-sidebar .portal-nav > .nav-link,
.portal-sidebar .portal-nav > .nav-folder > summary { min-height: 40px; padding: 8px 12px; font-size: .84rem; }
.portal-sidebar .portal-nav > .nav-folder > summary { grid-template-columns: 25px minmax(0, 1fr) auto; }
.portal-sidebar .portal-subnav { margin-top: 0; margin-bottom: 3px; }

/* 2.0.1 operational controls reuse the existing dark panel language. */
.attention-strip { margin-bottom: 24px; }
.attention-strip > header { align-items: flex-start; gap: 12px 18px; }
.attention-strip > header h2 { margin: 4px 0 0; font-size: 1.2rem; line-height: 1.25; }
.attention-strip > header > div { min-width: 0; }
.attention-strip > header > a { margin-top: 2px; }
.attention-counts { min-height: 72px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 12px; padding: 14px 24px 18px; }
.attention-counts a, .command-saved { display: inline-flex; align-items: center; color: var(--ink); background: rgba(220, 91, 58, .08); border: 1px solid rgba(220, 91, 58, .26); border-radius: 999px; padding: 9px 14px; text-decoration: none; font: inherit; cursor: pointer; }
.attention-counts a:hover, .command-saved:hover { border-color: var(--accent, #df6942); color: var(--accent, #df6942); }
.attention-counts a:focus-visible{outline:2px solid #ff7081;outline-offset:3px}
.attention-counts .attention-inactive{display:inline-flex;align-items:center;padding:9px 14px;border:1px solid #3a2c2f;border-radius:999px;background:#171214;color:#8b8082;cursor:default}
.queue-focus-note{display:flex;align-items:center;flex-wrap:wrap;gap:8px 14px;margin:14px 0;padding:13px 18px;border:1px solid #69303e;border-radius:12px;background:#25151b;color:#eadde0}.queue-focus-note strong{color:#ff798c}.queue-focus-note a{margin-left:auto;color:#ff99a7}.case-list:target,.task-list:target,.quiz-results:target,#discord-event-inbox:target{scroll-margin-top:18px;outline:2px solid #ff7081;outline-offset:3px}
@media (max-width: 560px) {
  .attention-strip > header { align-items: flex-start; }
  .attention-strip > header > a { max-width: 110px; text-align: right; }
  .attention-counts { min-height: 72px; padding: 14px 16px 18px; }
}
.operation-list { display: grid; gap: 8px; padding: 12px 24px 24px; }
.operation-list article { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); }
.operation-list article > div { min-width: 0; display: grid; gap: 5px; }
.operation-list strong { color: var(--ink); overflow-wrap: anywhere; }
.operation-list small, .operation-list span { color: var(--muted); overflow-wrap: anywhere; }
.operation-list a { color: var(--accent, #df6942); }
.operation-form { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; padding: 22px 24px; border-top: 1px solid var(--line); }
.operation-form label { min-width: 160px; flex: 1 1 170px; }
.operation-form label:has(input[type="checkbox"]) { display: flex; align-items: center; gap: 8px; flex: 0 1 auto; }
.operation-form input, .operation-form select { max-width: 100%; }
.document-history { margin-top: 20px; padding: 20px; }
.document-history summary { cursor: pointer; color: var(--ink); font-weight: 700; }
.document-history .operation-list { padding: 16px 0; }
.version-preview { max-height: 360px; overflow: auto; }
.version-preview pre { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); }
.case-source { margin: 24px 0; }
.case-source-body { display: grid; gap: 12px; padding: 12px 24px 24px; overflow-wrap: anywhere; }
.case-source-body dl { display: flex; flex-wrap: wrap; gap: 12px 28px; }
.case-source-body dt { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }
.case-source-body dd { margin: 4px 0 0; color: var(--ink); }
.case-source-body a { color: var(--accent, #df6942); }
.case-embed { padding: 14px 16px; border-left: 2px solid var(--accent, #df6942); background: rgba(255,255,255,.025); border-radius: 0 10px 10px 0; }

/* v2.2.0 moderation: ordinary document flow, explicit padding, no fixed card heights. */
.portal-content > .section-header { display: flex; gap: 24px; align-items: start; margin-bottom: 28px; }
.portal-content > .section-header h1 { margin: 8px 0 14px; font-size: clamp(2rem, 4vw, 3rem); line-height: 1.1; }
.portal-content > .section-header p { margin: 8px 0; }
.portal-content > .section-header .eyebrow { color: var(--red); font-weight: 800; font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; }
.neo-card pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.neo-tabs { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0 24px; }
.neo-tabs a { display: inline-flex; padding: 10px 16px; border: 1px solid #383030; border-radius: 10px; }
.neo-card { min-width: 0; margin: 20px 0; padding: clamp(18px, 3vw, 28px); border: 1px solid #383030; border-radius: 18px; background: linear-gradient(135deg,#171313,#0d0d0d); overflow-wrap: anywhere; }
.neo-card h2 { margin: 0 0 18px; font-size: 1.3rem; }
.neo-fields { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(240px,100%),1fr)); gap: 18px 24px; margin: 20px 0; }
.neo-fields div { min-width: 0; }
.neo-fields dt { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }
.neo-fields dd { margin: 7px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.neo-filters { display: flex; flex-wrap: wrap; gap: 16px; align-items: end; margin: 24px 0; }
.neo-filters label { display: grid; gap: 8px; flex: 1 1 180px; min-width: 0; }
.neo-form { display: grid; gap: 16px; margin: 20px 0 0; }
.neo-form label { display: grid; gap: 8px; }
.neo-form input,.neo-form textarea,.neo-filters input,.neo-filters select { width: 100%; min-width: 0; box-sizing: border-box; }
.neo-form textarea { min-height: 100px; }
.neo-form button { justify-self: start; }
.punishment-card { --punishment-accent: #a5a5ae; border: 1px solid #343033; border-left: 3px solid var(--punishment-accent); border-radius: 16px; padding: 24px; margin: 20px 0; background: linear-gradient(115deg,#171315,#101011 65%); min-width: 0; }
.punishment-card--ban { --punishment-accent: #ff6470; }
.punishment-card--mute { --punishment-accent: #e9b75c; }
.punishment-card--kick { --punishment-accent: #76b6ff; }
.punishment-card--warn { --punishment-accent: #bc9aff; }
.punishment-card-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.punishment-card-top time { color: #b7b2b4; font-size: .82rem; }
.punishment-badges { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.punishment-tag,.punishment-state { display: inline-flex; align-items: center; border-radius: 999px; padding: 6px 11px; font-size: .72rem; font-weight: 700; letter-spacing: .04em; line-height: 1.3; }
.punishment-tag { color: var(--punishment-accent); border: 1px solid var(--punishment-accent); background: #ffffff08; text-transform: uppercase; }
.punishment-state { color: #a7ddb9; border: 1px solid #36523f; background: #19251d; }
.punishment-state.is-archived { color: #bbb6bf; border-color: #514957; background: #242027; }
.punishment-player { display: flex; align-items: center; gap: 14px; margin: 22px 0 18px; min-width: 0; }
.punishment-player > div { min-width: 0; }
.punishment-monogram { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px; color: var(--punishment-accent); background: #ffffff08; border: 1px solid #ffffff12; font-weight: 800; font-size: 1.2rem; }
.punishment-player h2 { margin: 0; font-size: 1.25rem; overflow-wrap: anywhere; }
.punishment-player h2 a { color: #f4f2f0; text-decoration: none; }
.punishment-player h2 a:hover { color: var(--punishment-accent); }
.punishment-player p { margin: 6px 0 0; font-size: .85rem; color: #a9a3a6; overflow-wrap: anywhere; }
.punishment-player strong { color: #ddd8da; font-weight: 600; }
.punishment-reason { padding: 14px 16px; border-radius: 10px; background: #00000026; border: 1px solid #ffffff08; }
.punishment-reason > span { color: #9d959a; font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.punishment-reason p { margin: 7px 0 0; color: #e9e5e7; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap; }
.punishment-card-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 24px; padding-top: 18px; color: #a59da3; font-size: .78rem; }
.punishment-card-footer code { color: #d9d3d7; font: inherit; }
.punishment-card-footer a { margin-left: auto; color: var(--punishment-accent); text-decoration: none; font-weight: 700; padding: 4px 0; }
.punishment-card a:focus-visible { outline: 2px solid var(--punishment-accent); outline-offset: 5px; }
.punishment-detail { border-top: 3px solid var(--punishment-accent); }
.punishment-detail h2 { margin: 20px 0 0; }
@media(max-width:600px) { .punishment-card { padding: 18px; margin: 16px 0; } .punishment-card-top { align-items: flex-start; gap: 12px; } .punishment-card-top time { flex-basis: 100%; } .punishment-card-footer { gap: 12px 16px; } .punishment-card-footer a { flex-basis: 100%; margin-left: 0; padding: 8px 0; } }
.neo-form select { width: 100%; min-width: 0; box-sizing: border-box; }
.neo-form label:has(input[type="checkbox"]) { display: flex; align-items: flex-start; gap: 12px; line-height: 1.5; }
.neo-form input[type="checkbox"] { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 3px; }
.neo-card details { margin-top: 16px; }
.neo-card summary { cursor: pointer; padding: 8px 0; }
.neo-evidence { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 16px 0; border-bottom: 1px solid #383030; }
.neo-evidence .neo-form { margin: 0; }
.neo-note { padding: 20px 0; border-bottom: 1px solid #383030; }
.neo-timeline { display: grid; gap: 24px; margin: 24px 0; padding-left: 24px; }
.neo-timeline li { padding-left: 8px; }
.neo-timeline pre { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; }
@media(max-width:600px) { .neo-fields { grid-template-columns: 1fr; } .neo-tabs a { flex: 1 1 auto; justify-content: center; } .neo-filters button,.neo-form button { width: 100%; } }

/* v2.4.1: keep sidebar identity intact when disclosure menus expand. */
.portal-sidebar > * { flex-shrink: 0; }
.portal-sidebar .identity-card { min-height: 100px; height: auto; }
input[type="file"] { height: auto; min-height: 50px; padding: 10px 12px; line-height: 28px; }
input[type="file"]::file-selector-button { margin: 0 12px 0 0; padding: 6px 12px; border: 1px solid var(--line); border-radius: 7px; background: #242426; color: var(--ink); cursor: pointer; }

/* v2.5.5 sidebar: fixed identity/footer with independently scrolling navigation. */
.portal-page .portal-sidebar{padding:22px 16px 16px;background:linear-gradient(165deg,#171113 0%,#0b0b0d 44%);overflow:hidden;gap:0}
.portal-page .portal-sidebar .staff-brand{padding:0 8px;margin-bottom:4px}
.portal-page .portal-sidebar .identity-card{margin:20px 0 18px;padding:15px;min-height:108px;grid-template-columns:40px minmax(0,1fr);gap:9px 12px;background:linear-gradient(135deg,#25181c,#141214);border:1px solid #493039;border-radius:14px;box-shadow:0 8px 24px #0003}
.portal-page .portal-sidebar .identity-avatar{width:40px;height:40px;border-radius:12px;overflow:hidden}
.portal-page .portal-sidebar .role-badge{position:static;inset:auto;grid-column:1/-1;width:fit-content;max-width:100%;height:auto;min-height:24px;margin-top:3px;padding:4px 10px;border:1px solid #79313e;border-radius:7px;font-size:10px;overflow-wrap:anywhere}
.portal-page .portal-sidebar .portal-nav{display:flex;flex-direction:column;flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;gap:5px;padding:0 3px 16px 0;scrollbar-width:thin;scrollbar-color:#50313a transparent}
.portal-page .portal-sidebar .nav-link,.portal-page .portal-sidebar .nav-folder>summary{border:1px solid transparent;border-radius:10px;min-height:44px;padding:10px 12px;transition:background .15s,border-color .15s;color:#bbb5b7}
.portal-page .portal-sidebar .nav-link:hover,.portal-page .portal-sidebar .nav-folder>summary:hover{background:#23191d;border-color:#463038;color:#fff}
.portal-page .portal-sidebar .nav-link[aria-current="page"]{background:linear-gradient(90deg,#4a202c,#24151b);border-color:#763041;color:#fff}
.portal-page .portal-sidebar .nav-link[aria-current="page"]::after{display:none}
.portal-page .portal-sidebar .nav-link>span,.portal-page .portal-sidebar .nav-folder>summary>span{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:25px;height:25px;border-radius:7px;background:#ffffff06;color:#8e777e;font-size:10px}
.portal-page .portal-sidebar .nav-link[aria-current="page"]>span{background:#ff344e26;color:#ff9aac}
.portal-page .portal-sidebar .nav-folder[open]>summary{color:#eee;background:#1e171a;border-color:#3b2b31}
.portal-page .portal-sidebar .portal-subnav{margin:5px 0 8px 17px;padding:4px 0 4px 8px;border-left:1px solid #50303b}
.portal-page .portal-sidebar .portal-subnav .nav-link{min-height:36px;padding:7px 9px;border-radius:8px;font-size:12px}
.portal-page .portal-sidebar .portal-subnav .nav-link>span{width:18px;height:18px;font-size:9px}
.portal-page .portal-sidebar .portal-subnav{counter-reset:visible-subnav}
.portal-page .portal-sidebar .portal-subnav .nav-link{counter-increment:visible-subnav}
.portal-page .portal-sidebar .portal-subnav .nav-link>span{font-size:0}
.portal-page .portal-sidebar .portal-subnav .nav-link>span::after{content:counter(visible-subnav, upper-alpha);font-size:9px}
.document-workflow-panel>summary{display:flex;align-items:center;justify-content:space-between;gap:20px;cursor:pointer;list-style:none}
.document-workflow-panel>summary::-webkit-details-marker{display:none}
.document-workflow-panel>summary strong{display:block;font-size:1.25rem;margin-top:4px}
.document-workflow-panel>summary small{color:var(--accent);font-weight:800;letter-spacing:.1em}
.workflow-summary-count{color:var(--muted);font-size:.82rem;text-align:right}
.document-workflow-body{border-top:1px solid var(--line);margin-top:22px;padding-top:18px}
.workflow-action{border:1px solid var(--line);border-radius:12px;margin:16px 0;padding:14px}
.workflow-action>summary{cursor:pointer;font-weight:750}
.workflow-action[open]>summary{margin-bottom:16px}
.workflow-editor{min-height:220px;border:1px solid var(--line);border-radius:12px;padding:18px;margin-top:10px}
.workflow-preview{max-height:380px;overflow:auto;border:1px solid var(--line);border-radius:12px;padding:18px}
.portal-page .portal-sidebar .sidebar-foot{margin-top:0;padding:15px 8px 8px;border-top:1px solid #3d2a31}
.portal-page .portal-sidebar .sidebar-legal{margin:0;padding:4px 8px 0;justify-content:flex-start;text-align:left}
.portal-page .portal-sidebar a:focus-visible,.portal-page .portal-sidebar summary:focus-visible{outline:2px solid #ff7589;outline-offset:-2px}
.mention-suggestions{padding:6px;border:1px solid #70404c;background:#191316;border-radius:10px;box-shadow:0 8px 24px #0005;max-height:260px;overflow:auto}
.mention-suggestions[hidden]{display:none}.mention-suggestions button{display:block;width:100%;padding:9px 12px;border:0;border-radius:6px;background:transparent;text-align:left;color:#eee;cursor:pointer}.mention-suggestions button.active,.mention-suggestions button:hover{background:#4a202c}
.punishment-evidence-preview{display:inline-flex;max-width:100%;width:320px;margin:14px 14px 14px 0;flex-direction:column;gap:8px;color:#aaa;font-size:12px;text-decoration:none}.punishment-evidence-preview img{display:block;width:100%;max-height:260px;object-fit:contain;background:#080808;border:1px solid #403039;border-radius:10px}.punishment-evidence-preview:hover img{border-color:#ff344e}

/* v2.5.8: a compact appearance control beside the release link. */
.build-tools { position:fixed; z-index:40; right:14px; bottom:12px; display:flex; align-items:center; gap:7px; max-width:calc(100vw - 28px); }
.build-tools .build-version { position:static; display:inline-flex; align-items:center; min-height:32px; border-radius:9px; color:var(--muted); background:var(--panel); text-decoration:none; white-space:nowrap; }
.theme-control { display:flex; align-items:center; gap:6px; min-height:32px; margin:0; padding:0 7px; border:1px solid var(--line); border-radius:9px; background:var(--panel); font-size:.67rem; font-weight:750; }
.theme-control span { color:var(--muted); }
.theme-control select { width:auto; min-width:66px; min-height:28px; padding:0 18px 0 4px; border:0; background:transparent; color:var(--ink); font-size:.67rem; cursor:pointer; }
.theme-control:focus-within,.build-version:focus-visible { outline:2px solid var(--red); outline-offset:2px; }
@media(max-width:420px){.build-tools{right:8px;bottom:8px;gap:4px}.theme-control span{display:none}}

/* Neutral charcoal and true red replace the old mauve sidebar treatment. */
.portal-page .portal-sidebar { background:linear-gradient(165deg,#191111 0%,#0b0b0c 46%); }
.portal-page .portal-sidebar .identity-card { background:linear-gradient(135deg,#261515,#141112); border-color:#5b2828; }
.portal-page .portal-sidebar .role-badge { border-color:#8d3030; }
.portal-page .portal-sidebar .nav-link:hover,.portal-page .portal-sidebar .nav-folder>summary:hover { background:#261717; border-color:#603030; }
.portal-page .portal-sidebar .nav-link[aria-current="page"] { background:linear-gradient(90deg,#542020,#291414); border-color:#8f3030; }
.portal-page .portal-sidebar .nav-folder[open]>summary { background:#221616; border-color:#593030; }
.portal-page .portal-sidebar .portal-subnav { border-color:#683030; }
.portal-page .portal-sidebar .sidebar-foot { border-color:#482626; }

/* Light appearance retains the Infernis red while lifting every major surface. */
html[data-theme="light"] { color-scheme:light; --bg:#f6f4f2; --panel:#ffffff; --panel-2:#f7f3f1; --panel-3:#eee9e6; --ink:#21191b; --muted:#63595b; --quiet:#766a6d; --line:#dcd2cf; --line-hot:#ceaba6; --red:#bf2432; --orange:#a94518; --green:#166d44; --blue:#285bad; --purple:#65429c; --surface-glow:linear-gradient(145deg,rgba(180,80,70,.035),transparent 42%); --panel-shadow:0 12px 38px rgba(48,25,25,.08); }
html[data-theme="light"] body { color:var(--ink); }
html[data-theme="light"] label,html[data-theme="light"] .access-builder legend { color:var(--ink); }
html[data-theme="light"] input,html[data-theme="light"] select,html[data-theme="light"] textarea,html[data-theme="light"] .file-picker-control { color:var(--ink); background:#fff; border-color:var(--line); }
html[data-theme="light"] input::placeholder,html[data-theme="light"] textarea::placeholder { color:#756d6e; }
html[data-theme="light"] .theme-control select { background:transparent; border:0; }
html[data-theme="light"] .secondary-button:hover,html[data-theme="light"] .secondary-link:hover,html[data-theme="light"] .quiet-button:hover { background:#e9e0dc; border-color:#ae9994; }
html[data-theme="light"] code { color:#70252a; background:#f0e7e5; }
html[data-theme="light"] .flash,html[data-theme="light"] .alert { color:#75341d; }
html[data-theme="light"] .flash.error { color:#8c2530; }
html[data-theme="light"] .portal-topbar { background:rgba(255,255,255,.94); }
html[data-theme="light"] .portal-page .portal-sidebar { background:linear-gradient(165deg,#fff 0%,#f4eeeb 100%); }
html[data-theme="light"] .portal-page .portal-sidebar .identity-card { background:linear-gradient(135deg,#fff,#f8efec); border-color:#dec9c5; box-shadow:0 8px 24px rgba(62,28,28,.08); }
html[data-theme="light"] .portal-page .portal-sidebar .nav-link,html[data-theme="light"] .portal-page .portal-sidebar .nav-folder>summary { color:#4f4244; }
html[data-theme="light"] .portal-page .portal-sidebar .nav-link:hover,html[data-theme="light"] .portal-page .portal-sidebar .nav-folder>summary:hover { color:#8e1e2a; background:#f2dfdb; border-color:#ddb8b1; }
html[data-theme="light"] .portal-page .portal-sidebar .nav-link[aria-current="page"] { color:#8b1e2a; background:linear-gradient(90deg,#f5d9d4,#faefed); border-color:#d7a19c; }
html[data-theme="light"] .portal-page .portal-sidebar .nav-folder[open]>summary { color:#8b1e2a; background:#f8e8e4; border-color:#e3c7c0; }
html[data-theme="light"] .portal-page .portal-sidebar .nav-link>span,html[data-theme="light"] .portal-page .portal-sidebar .nav-folder>summary>span { color:#8a5a5b; background:#eadfdb; }
html[data-theme="light"] .portal-page .portal-sidebar .sidebar-foot { border-color:#d9c8c3; }
html[data-theme="light"] .role-badge,html[data-theme="light"] .role-lead,html[data-theme="light"] .role-staff { color:#8f2730; background:#f8e5e2; border-color:#e6b9b2; }
html[data-theme="light"] .auth-page { background:radial-gradient(circle at 80% 5%,rgba(191,36,50,.08),transparent 34%),var(--bg); }
html[data-theme="light"] .auth-command-rail { color:var(--ink); background:#fff; box-shadow:0 24px 65px rgba(40,20,20,.12); }
html[data-theme="light"] .auth-shell { background-image:linear-gradient(rgba(90,35,35,.035) 1px,transparent 1px),linear-gradient(90deg,rgba(90,35,35,.035) 1px,transparent 1px); }
html[data-theme="light"] .command-palette { background:rgba(45,28,28,.38); }
html[data-theme="light"] .command-palette-card,html[data-theme="light"] .error-help,html[data-theme="light"] .form-note,html[data-theme="light"] .comment-list article,html[data-theme="light"] .editor-toolbar,html[data-theme="light"] .editor-workspace textarea,html[data-theme="light"] .rich-editor,html[data-theme="light"] .access-modes label>span,html[data-theme="light"] .access-rules,html[data-theme="light"] .quiz-card-grid>article,html[data-theme="light"] .quiz-builder-question,html[data-theme="light"] .quiz-option span { background:var(--panel); color:var(--ink); }
html[data-theme="light"] .prose { color:#372e2e; }
html[data-theme="light"] .prose a { color:#9b1d2a; }
html[data-theme="light"] .mfa-compliance-overview article,html[data-theme="light"] .link-callout,html[data-theme="light"] .profile-check,html[data-theme="light"] .role-map-empty,html[data-theme="light"] .staff-role-mapper>label { background:var(--panel-2); }
html[data-theme="light"] .portal-role-map-help { background:linear-gradient(100deg,#fbeae6,#fff); }
html[data-theme="light"] .punishment-details[open] summary,html[data-theme="light"] .punishment-details dl,html[data-theme="light"] .punishment-attachments,html[data-theme="light"] .discord-record-link { background:var(--panel-2); }
html[data-theme="light"] .neo-card,html[data-theme="light"] .punishment-card { background:linear-gradient(120deg,#fff,#f9f4f2); border-color:var(--line); }
html[data-theme="light"] .punishment-player h2 a,html[data-theme="light"] .punishment-player strong,html[data-theme="light"] .punishment-reason p { color:var(--ink); }
html[data-theme="light"] .punishment-card-top time,html[data-theme="light"] .punishment-player p,html[data-theme="light"] .punishment-card-footer,html[data-theme="light"] .punishment-reason>span { color:var(--muted); }
html[data-theme="light"] .punishment-reason { background:#f7f2ef; border-color:var(--line); }
html[data-theme="light"] .punishment-state { color:#146840; background:#e5f4eb; border-color:#9bcaae; }
html[data-theme="light"] .punishment-state.is-archived { color:#6e6267; background:#ede8e9; border-color:#c9bdc2; }
html[data-theme="light"] .punishment-card-footer code { color:var(--ink); }
html[data-theme="light"] .month-calendar { background:var(--panel); border-color:var(--line); }
html[data-theme="light"] .month-calendar-grid,html[data-theme="light"] .month-weekday,html[data-theme="light"] .month-day { border-color:var(--line); }
html[data-theme="light"] .month-day-empty { background:#f5f0ee; }
html[data-theme="light"] .month-day>time { color:var(--ink); }
html[data-theme="light"] .month-calendar nav a { color:var(--ink); border-color:var(--line); }
html[data-theme="light"] .month-entry { color:#6f1a27; background:#fae8e6; }
html[data-theme="light"] .month-entry-birthday { color:#75541f; background:#f8efd9; }
html[data-theme="light"] .month-entry-anniversary { color:#1c674d; background:#e1f3ea; }
html[data-theme="light"] .mention-suggestions { color:var(--ink); background:var(--panel); border-color:var(--line); box-shadow:var(--panel-shadow); }
html[data-theme="light"] .mention-suggestions button { color:var(--ink); }
html[data-theme="light"] .mention-suggestions button.active,html[data-theme="light"] .mention-suggestions button:hover { background:#f7e3df; }

/* Quiz review rows: keep the result readable and give the action room to wrap. */
.quiz-results article { grid-template-columns:minmax(0,1fr) minmax(142px,auto) auto; gap:14px 20px; }
.quiz-results article>div { min-width:0; overflow-wrap:anywhere; }
.quiz-result-score { display:flex; flex-direction:column; align-items:flex-start; justify-self:start; min-width:142px; max-width:100%; padding:10px 13px; border:1px solid var(--line); border-radius:10px; text-align:left; white-space:normal; font-size:.85rem; line-height:1.3; }
.quiz-result-score em { display:block; margin-top:4px; font-size:.72rem; line-height:1.35; white-space:normal; }
.quiz-results article>a.secondary-link { justify-self:end; white-space:nowrap; }
@media(max-width:1050px){.quiz-results article{grid-template-columns:minmax(0,1fr) minmax(142px,auto)}.quiz-results article>a.secondary-link{grid-column:1/-1;justify-self:start}}
@media(max-width:620px){.quiz-results article{grid-template-columns:1fr;align-items:start}.quiz-result-score{grid-column:1;justify-self:start}.quiz-results article>a.secondary-link{grid-column:1}.quiz-results article{padding:18px}}
html[data-theme="light"] .quiz-status-passed { color:#14643d !important; border-color:#9ec9ae !important; background:#e5f3ea !important; }
html[data-theme="light"] .quiz-status-failed { color:#9b2832 !important; border-color:#e6afb1 !important; background:#fae5e5 !important; }
html[data-theme="light"] .auth-card { background:#fff; box-shadow:0 24px 65px rgba(40,20,20,.12); }
html[data-theme="light"] .auth-loading { color:var(--ink); background:var(--panel-2); background-image:none; }
html[data-theme="light"] .auth-consent a { color:#8e2631; }
html[data-theme="light"] .clearance-card { color:#fff; background:linear-gradient(135deg,#8d2730,#59232a); }
html[data-theme="light"] .staff-record-links a { color:var(--ink); }
html[data-theme="light"] .queue-focus-note { color:#5c3337; background:#f8e9e6; border-color:#dba9a2; }
html[data-theme="light"] .queue-focus-note strong,html[data-theme="light"] .queue-focus-note a { color:#9f2934; }
html[data-theme="light"] .review-guidance { background:#f7f1ed; }
html[data-theme="light"] .review-guidance strong { color:var(--ink); }
html[data-theme="light"] input[type="file"]::file-selector-button { background:var(--panel-3); }

/* v2.6.0: accessible two-state appearance control and readable light surfaces. */
.theme-switch { display:inline-flex; align-items:center; gap:2px; padding:3px; border:1px solid var(--line); border-radius:999px; background:var(--panel); box-shadow:var(--panel-shadow); }
.theme-switch button { display:inline-flex; align-items:center; justify-content:center; gap:5px; min-width:62px; min-height:28px; padding:3px 9px; border:0; border-radius:999px; color:var(--muted); background:transparent; cursor:pointer; font-size:.69rem; font-weight:800; }
.theme-switch button[aria-pressed="true"] { color:#fff; background:#b62932; }
.theme-switch button:hover:not([aria-pressed="true"]) { color:var(--ink); background:var(--panel-3); }
.theme-switch button:focus-visible { outline:2px solid var(--red); outline-offset:2px; }
@media(max-width:470px){.theme-switch button{min-width:31px;padding:3px 6px}.theme-switch button span{display:none}}
.quiz-review-form .review-form { position:static; box-shadow:var(--panel-shadow); }
.quiz-review-form .review-form .quiz-flow-summary { margin:0; }
.quiz-final-confirm { display:flex; align-items:flex-start; gap:12px; padding:14px 16px; border:1px solid var(--line-hot); border-radius:12px; background:var(--panel-2); line-height:1.45; cursor:pointer; }
.quiz-final-confirm input { flex:0 0 auto; width:19px; height:19px; margin:2px 0 0; accent-color:var(--red); }
.quiz-draft-status { margin:0; color:var(--muted); font-size:.8rem; }
html[data-theme="light"] .quiz-flow-summary>div { background:linear-gradient(135deg,#fff2ee,#fff); }
html[data-theme="light"] .quiz-review-answers article,html[data-theme="light"] .review-form,html[data-theme="light"] .quiz-taker fieldset { background:#fff; color:var(--ink); }
html[data-theme="light"] .neo-tabs a { border-color:var(--line); background:#fff; color:var(--ink); }
html[data-theme="light"] .neo-tabs a:hover { background:#f8e5e1; border-color:#c98484; }
html[data-theme="light"] .neo-fields dt,html[data-theme="light"] .neo-evidence small { color:var(--muted); }
html[data-theme="light"] .command-status-card,html[data-theme="light"] .section-tabs,html[data-theme="light"] .staff-note-list article,html[data-theme="light"] .merged-history span,html[data-theme="light"] .import-metrics article,html[data-theme="light"] .import-preview details,html[data-theme="light"] .asset-status-line span { background:#fff; color:var(--ink); border-color:var(--line); }
html[data-theme="light"] .file-picker-control,html[data-theme="light"] .punishment-enrichment,html[data-theme="light"] .punishment-image-preview { background:#fff; color:var(--ink); border-color:var(--line); }
html[data-theme="light"] .auth-command-rail .command-status-card { background:#faf5f2; }
.player-match-list { display:grid; gap:8px; }
.player-match-list a { display:flex; flex-wrap:wrap; justify-content:space-between; gap:8px; padding:12px 14px; border:1px solid var(--line); border-radius:10px; text-decoration:none; }
.player-match-list a:hover { border-color:var(--red); }
.player-workbench-head h2 { margin:4px 0 10px; font-size:clamp(1.6rem,3vw,2.5rem); }
.player-workbench-head code { overflow-wrap:anywhere; }
.player-workbench-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.player-workbench-grid>.neo-card { margin:0; }
.player-history-row { display:flex; flex-wrap:wrap; justify-content:space-between; gap:20px; padding:16px 0; border-top:1px solid var(--line); }
.player-history-row h3 { margin:8px 0; font-size:1rem; }
.player-history-row p { margin:6px 0; line-height:1.5; }
.player-history-row small { color:var(--muted); }
.player-history-row aside { display:grid; align-content:start; gap:6px; min-width:130px; font-size:.76rem; }
.player-history-row aside a { color:var(--red); }
.player-history-events { flex-basis:100%; color:var(--muted); font-size:.78rem; }
.player-history-events summary { cursor:pointer; color:var(--red); font-weight:750; }
.player-history-events ol { display:grid; gap:8px; padding-left:20px; }
.player-history-events li strong,.player-history-events li small { display:block; }
@media(max-width:760px){.player-workbench-grid{grid-template-columns:1fr}.player-history-row{flex-direction:column;gap:10px}}

/* v2.6.1: keep light-mode cards, queues, and Discord settings readable. */
html[data-theme="light"] .clearance-card { color:#fff; background:linear-gradient(135deg,#8f2735,#4f2029); border-color:#9b4650; }
html[data-theme="light"] .clearance-card small { color:#ffdce0; }
html[data-theme="light"] .clearance-card span { color:#f4dadd; }
html[data-theme="light"] .attention-strip { background:#fff; border-color:#decfcd; }
html[data-theme="light"] .attention-strip>header { background:#fcf4f2; }
html[data-theme="light"] .attention-counts { background:#fff; }
html[data-theme="light"] .attention-counts a { color:#4c2026; background:#fff5f3; border-color:#dbb5ae; }
html[data-theme="light"] .attention-counts a:hover { color:#922c37; background:#ffece8; }
html[data-theme="light"] .attention-counts .attention-inactive { color:#615557; background:#f5f0ee; border-color:#d7cfcc; }
.settings-save-bar { position:static; margin:24px 0 0; }
html[data-theme="light"] .settings-save-bar { color:var(--ink); background:#fff; border-color:#d7b7b3; box-shadow:var(--panel-shadow); }
html[data-theme="light"] .settings-save-bar span { color:var(--muted); }
html[data-theme="light"] .portal-role-map-guild,html[data-theme="light"] .portal-role-map-guild>header,html[data-theme="light"] .portal-role-map-rows>label { color:var(--ink); background:#fff; border-color:var(--line); }
html[data-theme="light"] .portal-role-map-guild>header { background:#f7efec; }
html[data-theme="light"] .portal-role-map-rows>label:nth-child(even) { background:#fbf8f6; }
html[data-theme="light"] .portal-role-map-rows strong,html[data-theme="light"] .portal-role-map-guild>header strong { color:#302023; }
html[data-theme="light"] .portal-role-map-rows small,html[data-theme="light"] .portal-role-map-guild>header small { color:#625558; }
html[data-theme="light"] .bulk-action-bar { color:var(--ink); background:#f6f0ed; border-color:var(--line); }
html[data-theme="light"] .bulk-action-bar label,html[data-theme="light"] .bulk-action-bar strong { color:var(--ink); }
.workspace-detail { max-width:1100px; margin-inline:auto; }
.workspace-detail>header { display:flex; flex-wrap:wrap; align-items:center; gap:10px 24px; }
.workspace-detail>header h2 { flex:1 1 100%; margin:0; }
.workspace-detail>header .secondary-link { margin-left:auto; }
.workspace-action-form { display:grid; gap:16px; padding:18px; border:1px solid var(--line); border-radius:14px; background:var(--panel-2); }
.workspace-action-form>[data-workspace-field] { display:grid; gap:8px; }
.workspace-action-form>[hidden] { display:none; }
.workspace-action-form>button { justify-self:start; }
html[data-theme="light"] .workspace-action-form { background:#f9f5f3; }
.vault-gallery-native { position:absolute !important; width:1px !important; height:1px !important; padding:0 !important; opacity:0; pointer-events:none; }
.vault-file-gallery { margin:10px 0 14px; }
.vault-gallery-search { margin-bottom:10px; }
.vault-gallery-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(145px,1fr)); gap:10px; max-height:340px; overflow:auto; padding:2px; }
.vault-gallery-card { min-width:0; display:flex; flex-direction:column; padding:0; overflow:hidden; text-align:left; color:var(--ink); background:var(--panel-2); border:2px solid var(--line); border-radius:12px; cursor:pointer; }
.vault-gallery-card:hover,.vault-gallery-card:focus-visible { border-color:var(--red); }
.vault-gallery-card[aria-checked="true"] { border-color:#ff3547; box-shadow:0 0 0 2px rgba(255,53,71,.2); }
.vault-gallery-card img { width:100%; height:105px; object-fit:cover; background:var(--panel-3); }
.vault-gallery-card span { padding:9px; max-height:54px; overflow:hidden; font-size:.78rem; line-height:1.3; overflow-wrap:anywhere; }
.vault-gallery-no-preview::before { content:'FILE'; display:grid; place-items:center; width:100%; height:105px; color:var(--muted); background:var(--panel-3); font-size:.78rem; font-weight:800; letter-spacing:.16em; }
.vault-gallery-empty { color:var(--muted); }
html[data-theme="light"] .member-directory,html[data-theme="light"] .member-directory>header,html[data-theme="light"] .member-directory-row { background:#fff; color:#302428; border-color:#dfd1cd; }
html[data-theme="light"] .member-directory-row:nth-child(even) { background:#fbf7f5; }
html[data-theme="light"] .member-directory-identity strong,html[data-theme="light"] .member-directory-state b,html[data-theme="light"] .member-directory-row .secondary-link { color:#302428; }
html[data-theme="light"] .member-directory-identity small,html[data-theme="light"] .member-directory-state small,html[data-theme="light"] .member-directory-guilds small,html[data-theme="light"] .member-directory>header>small { color:#675a5d; }
html[data-theme="light"] .mfa-compliance-overview,html[data-theme="light"] .mfa-compliance-overview>header { background:#fff; color:#302428; border-color:#dfd1cd; }
html[data-theme="light"] .mfa-compliance-overview h2,html[data-theme="light"] .mfa-compliance-overview strong { color:#302428; }
html[data-theme="light"] .mfa-compliance-overview small { color:#675a5d; }
html[data-theme="light"] .mfa-compliance-overview article { background:#faf6f4; color:#302428; }
html[data-theme="light"] .mfa-compliance-overview article span,html[data-theme="light"] .mfa-compliance-overview>p,html[data-theme="light"] .mfa-compliance-overview>header>span { color:#675a5d; }
html[data-theme="light"] .section-tabs a.active { color:#8e2532; background:#f9e7e4; }
html[data-theme="light"] .section-tabs a:not(.active),html[data-theme="light"] .section-tabs span,html[data-theme="light"] .member-open { color:#675a5d; }
html[data-theme="light"] .vault-gallery-card { background:#fff; color:#302428; }
.month-calendar-controls { display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:10px; }
.month-calendar-controls form { display:flex; align-items:center; gap:8px; }
.month-calendar-controls form label { font-size:.75rem; color:var(--muted); }
.month-calendar-controls input { width:155px; min-height:42px; padding:7px 9px; border:1px solid var(--line); border-radius:9px; color:var(--ink); background:var(--panel); }
.month-calendar-controls button { min-height:42px; padding:7px 13px; border:1px solid var(--line); border-radius:9px; color:var(--ink); background:var(--panel-2); cursor:pointer; }
.month-calendar-controls button:hover { border-color:var(--red); }
@media(max-width:700px){.month-calendar-controls{justify-content:flex-start}.month-calendar-controls form{width:100%;flex-wrap:wrap}.month-calendar-controls input{flex:1}}
.suggestion-category-manager[hidden],.roster-guild[hidden],.roster-role[hidden] { display:none !important; }
.suggestion-settings-toggle { margin:18px 0; }
.roster-directory { display:grid; gap:28px; }
.roster-guild { border:1px solid var(--line); border-radius:16px; padding:22px; background:var(--panel); }
.roster-guild>header { display:flex; align-items:center; justify-content:space-between; gap:16px; border-bottom:1px solid var(--line); margin-bottom:20px; padding-bottom:14px; }
.roster-guild>header h2,.roster-role h3 { margin:0; }
.roster-guild>header span,.roster-role h3 small { color:var(--muted); font-size:.8rem; }
.roster-role { margin-top:22px; }
.roster-role h3 { margin-bottom:12px; font-size:1rem; }
.roster-grid h4 { margin:0 0 3px; font-size:1.05rem; }
.roster-grid .secondary-link { display:inline-block; margin-top:10px; }
.feedback-routing-card .secret-status { display:inline-flex; margin-left:8px; padding:4px 9px; border-radius:99px; border:1px solid var(--line); font-size:.75rem; }
.feedback-routing-card .secret-status.configured { color:#22966f; border-color:#22966f; }
.minecraft-profile-card { margin-top:22px; }
.minecraft-profile-card form { margin-top:20px; max-width:480px; }
html[data-theme="light"] .roster-guild { background:#fff; }
.guide-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));gap:16px;margin-top:24px}
.guide-list-card,.guide-admin-control,.guide-ack-card{border:1px solid var(--line);border-radius:var(--radius-md);background:var(--panel);color:var(--ink)}
.guide-list-card{display:block;padding:24px;text-decoration:none;box-shadow:var(--panel-shadow)}
.guide-list-card:hover,.guide-list-card:focus-visible{border-color:var(--red);transform:translateY(-2px)}
.guide-list-card>span,.guide-ack-card>header>p{color:var(--red);font-size:.75rem;font-weight:800;letter-spacing:.14em}
.guide-list-card h2{margin:18px 0 10px;font-size:1.3rem}.guide-list-card p,.guide-admin-control p,.guide-ack-card>header>span{color:var(--muted);line-height:1.5}.guide-list-card b{color:var(--red)}
.guide-list{display:block}
.guide-tree,.guide-tree-children{list-style:none;padding:0;margin:0}
.guide-tree{display:grid;gap:16px}
.guide-tree-item{min-width:0}
.guide-tree-children{margin:12px 0 0 24px;padding-left:22px;border-left:2px solid var(--red);display:grid;gap:12px}
.guide-tree-children .guide-list-card{padding:18px 22px}
.guide-tree-children .guide-list-card h2{margin:9px 0;font-size:1.1rem}
.guide-placement-control{display:flex;align-items:end;justify-content:space-between;gap:20px;margin:14px 0 24px;padding:20px;border:1px solid var(--line);border-radius:var(--radius-md);background:var(--panel)}
.guide-placement-control p{color:var(--muted);margin:6px 0 0}
.guide-placement-control form{display:flex;align-items:end;gap:10px;flex-wrap:wrap}
.guide-placement-control select{min-width:min(310px,70vw)}
@media(max-width:700px){.guide-placement-control{display:block}.guide-placement-control form{margin-top:16px}.guide-tree-children{margin-left:12px;padding-left:12px}}
.guide-admin-control{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 22px;margin:0 0 16px}.guide-admin-control p{margin:5px 0 0}.guide-admin-control form{flex:none}
.guide-ack-shell{width:min(100% - 32px,960px);margin:48px auto}.guide-ack-card{overflow:hidden;box-shadow:var(--panel-shadow)}.guide-ack-card>header{padding:32px 36px;border-bottom:1px solid var(--line)}.guide-ack-card>header h1{margin:8px 0 12px;font-size:clamp(2rem,4vw,3.5rem)}.guide-ack-content{max-height:min(55vh,680px);overflow:auto;padding:28px 36px}.guide-ack-form{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:24px 36px;border-top:1px solid var(--line)}.guide-ack-form label{display:flex;align-items:center;gap:10px}.guide-ack-form input{width:auto;accent-color:var(--red)}
.guide-ack-steps{display:flex;gap:8px;overflow:auto;padding:14px 36px;border-bottom:1px solid var(--line)}.guide-ack-steps span{flex:0 0 auto;padding:7px 11px;border:1px solid var(--line);border-radius:99px;color:var(--muted);font-size:.8rem}.guide-ack-steps [aria-current]{border-color:var(--red);color:var(--red);font-weight:800}.guide-ack-form form{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px;width:100%}.guide-defer-form{display:flex;align-items:center;gap:12px;padding:0 36px 24px}.guide-defer-form small,.guide-defer-exhausted{color:var(--muted)}.guide-defer-exhausted{padding:0 36px 24px}
@media(max-width:700px){.guide-admin-control,.guide-ack-form{align-items:stretch;flex-direction:column}.guide-ack-card>header,.guide-ack-content,.guide-ack-form{padding:20px}}
@media(max-width:700px){.guide-ack-steps{padding:14px 20px}.guide-defer-form{align-items:flex-start;flex-direction:column;padding:0 20px 20px}.guide-ack-form form{align-items:stretch;flex-direction:column}}

/* v3 workspace: calmer spacing, clearer focus, and panels that adapt without horizontal overflow. */
.portal-content{width:min(calc(100% - 2 * clamp(18px,3vw,54px)),1500px);padding-top:clamp(30px,4.5vw,64px)}
.portal-nav a,.nav-folder>summary,.secondary-button,.primary-button,.quiet-button{transition:background-color .18s ease,border-color .18s ease,transform .18s ease,color .18s ease}
.portal-nav a:hover,.nav-folder>summary:hover{transform:translateX(2px)}
.portal-page .portal-sidebar .portal-nav>.nav-folder,.portal-page .portal-sidebar .portal-nav>.nav-link{width:100%;min-width:0;box-sizing:border-box}.portal-page .portal-sidebar .portal-nav>.nav-folder>summary{width:100%;box-sizing:border-box}.portal-page .portal-sidebar .nav-folder>summary:hover{transform:none}
.document-context-menu{margin:22px 0;border:1px solid var(--line);border-radius:var(--radius-md);background:var(--panel);color:var(--ink);overflow:hidden}.document-context-menu>summary{padding:18px 22px;cursor:pointer;font-weight:800;list-style:none}.document-context-menu>summary::-webkit-details-marker{display:none}.document-context-menu>summary::after{content:'⌄';float:right;color:var(--muted)}.document-context-menu[open]>summary::after{transform:rotate(180deg)}.document-context-content{display:grid;gap:18px;padding:20px;border-top:1px solid var(--line)}.document-context-content>.workspace-detail,.document-context-content>.guide-admin-control,.document-context-content>.guide-placement-control,.document-context-content>.document-history,.document-context-content>.document-review-grid{margin:0;max-width:none}
.portal-content :is(a,button,input,textarea,select):focus-visible{outline:2px solid var(--red);outline-offset:3px}
.page-heading.compact{min-height:0;align-items:center;gap:24px}.page-heading.compact h1{line-height:1.02}
.ai-heading .ai-state{padding:9px 13px;border:1px solid var(--line-hot);border-radius:999px;color:var(--red);font-size:.8rem;font-weight:800;white-space:nowrap}
.ai-layout{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(260px,.8fr);gap:20px;margin-top:30px;align-items:start}
.ai-workspace,.ai-guardrails,.ai-quiz-panel{min-width:0;padding:clamp(22px,3vw,34px);border:1px solid var(--line);border-radius:var(--radius-lg);background:var(--panel);box-shadow:var(--panel-shadow)}
.ai-workspace form{display:grid;gap:14px}.ai-workspace label{font-size:1.1rem;font-weight:800}.ai-workspace textarea{width:100%;min-height:160px;resize:vertical;line-height:1.55}
.ai-prompt-actions{display:flex;align-items:center;justify-content:space-between;gap:18px}.ai-prompt-actions small,.ai-guardrails p,.ai-guardrails li,.ai-quiz-panel p{color:var(--muted);line-height:1.55}.ai-prompt-actions small{max-width:38rem}
.ai-guardrails h2,.ai-quiz-panel h2{margin:0 0 10px;font-size:1.35rem}.ai-guardrails ul{margin:18px 0 0;padding-left:20px}.ai-guardrails li+li{margin-top:9px}
.ai-answer,.ai-quiz-result{margin-top:24px;padding:20px 22px;border:1px solid var(--line-hot);border-radius:var(--radius-md);background:var(--panel-2)}
.ai-answer-label,.ai-quiz-panel>div>span{color:var(--red);font-size:.7rem;font-weight:850;letter-spacing:.15em}.ai-answer p,.ai-quiz-result p{line-height:1.65;white-space:pre-wrap;overflow-wrap:anywhere}
.ai-sources{display:flex;flex-wrap:wrap;align-items:center;gap:10px;padding-top:14px;border-top:1px solid var(--line)}.ai-sources strong{width:100%;font-size:.82rem}.ai-sources a{padding:7px 10px;border:1px solid var(--line);border-radius:8px;text-decoration:none;color:var(--ink)}.ai-sources a:hover{border-color:var(--red);color:var(--red)}
.ai-source{display:grid;gap:8px;flex:1 1 220px;min-width:0;padding:12px;border:1px solid var(--line);border-radius:10px;background:var(--panel)}.ai-source a{padding:0;border:0;font-weight:800}.ai-source small{color:var(--muted);line-height:1.45;overflow-wrap:anywhere}
.ai-quiz-panel{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:16px;margin:0 0 20px}.ai-quiz-panel>div:first-child{max-width:620px}.ai-quiz-panel p{margin:0}.ai-quiz-result{flex-basis:100%;margin:0}.ai-quiz-result ul{color:var(--muted);line-height:1.5}
@media(max-width:850px){.ai-layout{grid-template-columns:1fr}.ai-guardrails{order:2}}
@media(max-width:650px){.ai-prompt-actions{align-items:stretch;flex-direction:column}.ai-prompt-actions button{justify-content:center}.page-heading.compact{align-items:flex-start;flex-direction:column}.ai-heading .ai-state{align-self:flex-start}}
@media(prefers-reduced-motion:reduce){.portal-nav a,.nav-folder>summary,.secondary-button,.primary-button,.quiet-button{transition:none}.portal-nav a:hover,.nav-folder>summary:hover{transform:none}}

.ai-settings-card{margin-top:22px}.ai-settings-card form{display:grid;gap:20px;padding:24px clamp(20px,3vw,34px)}.ai-settings-card .two-fields{align-items:start}.ai-settings-card label small{display:block;margin-top:7px;color:var(--muted);line-height:1.45}.ai-settings-status{display:flex;flex-wrap:wrap;align-items:center;gap:10px;padding:16px clamp(20px,3vw,34px);border-bottom:1px solid var(--line)}.ai-settings-status strong{color:var(--ink)}.ai-settings-status span{padding:6px 10px;border:1px solid var(--line-hot);border-radius:999px;color:var(--muted);font-size:.8rem}.ai-settings-card .profile-check{margin:0}.ai-settings-card .form-note{margin:0}
.ai-connection-check{display:flex;flex-wrap:wrap;align-items:center;gap:14px;padding:16px clamp(20px,3vw,34px);border-bottom:1px solid var(--line)}.ai-connection-check span{color:var(--muted);font-size:.85rem;line-height:1.4}.ai-connection-check[data-connected="yes"] span{color:#1e9b68}.ai-connection-check[data-connected="no"] span{color:var(--red)}

/* v3.1.2: a quieter dashboard, clearer hierarchy, and warm depth across shared surfaces. */
.portal-content>.activity-panel+.priority-work-panel{margin-top:clamp(24px,3vw,38px)}
.portal-content>.page-heading+.priority-work-panel{margin-top:26px}
.portal-content>.priority-work-panel+.overview-panel{margin-top:28px}
.priority-work-panel{padding:0;overflow:hidden}
.priority-work-panel>header{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:5px 18px;margin:0;padding:23px clamp(20px,2.6vw,32px);border-bottom:1px solid var(--line)}
.priority-work-panel>header>p{grid-column:1/-1;margin:0;color:var(--red);font-size:.72rem;font-weight:850;letter-spacing:.13em}
.priority-work-panel>header>h2{grid-column:1;margin:0;font-size:clamp(1.35rem,2.3vw,2rem);line-height:1.12}
.priority-work-panel>header>a{grid-column:2;align-self:end;white-space:nowrap}
.priority-work-panel>p{margin:0;padding:17px clamp(20px,2.6vw,32px) 0;color:var(--muted);font-size:.86rem;line-height:1.5}
.priority-work-panel>.operation-list{padding:20px clamp(20px,2.6vw,32px) 28px;gap:10px}
.priority-work-panel .operation-list article{align-items:flex-start;padding:16px 18px;background:var(--panel-2);transition:transform .18s ease,border-color .18s ease,background .18s ease}
.priority-work-panel .operation-list article:hover{border-color:var(--line-hot);transform:translateY(-2px)}
.priority-work-panel .operation-list strong>a{color:var(--ink);text-decoration:none}.priority-work-panel .operation-list strong>a:hover{text-decoration:underline;text-decoration-color:var(--orange)}
.priority-work-panel .operation-list small{font-size:.75rem}.priority-work-panel .operation-list .queue-rank{flex:0 0 auto;padding:5px 9px;border:1px solid var(--line);border-radius:99px;font-size:.71rem;font-weight:800}
.priority-work-panel .operation-list .queue-rank-1{color:#ff958b;border-color:#87413d}.priority-work-panel .operation-list .queue-rank-2{color:#ffba75;border-color:#805235}
.queue-repeat{display:inline-block;margin-left:5px;padding:3px 7px;border-radius:99px;background:rgba(255,114,36,.12);color:var(--orange)!important;font-size:.7rem;font-weight:800}
.queue-related{margin-top:8px}.queue-related>summary{width:max-content;cursor:pointer;color:var(--orange);font-size:.75rem}.queue-related ul{margin:9px 0 0;padding-left:20px;color:var(--muted);font-size:.75rem;line-height:1.7}.queue-related li>a{color:var(--ink)}
.queue-more{display:inline-flex;align-self:flex-start;margin-top:8px;color:var(--orange)!important;font-size:.8rem;font-weight:800;text-decoration:none}
.operations-tools-menu{margin-top:30px;border:1px solid var(--line);border-radius:var(--radius-lg);background:var(--panel);overflow:hidden}.operations-tools-menu>summary{padding:22px clamp(20px,2.6vw,32px);cursor:pointer;list-style:none;font-size:1rem;font-weight:850}.operations-tools-menu>summary::-webkit-details-marker{display:none}.operations-tools-menu>summary::after{content:'⌄';float:right;color:var(--orange)}.operations-tools-menu[open]>summary::after{transform:rotate(180deg)}.operations-tools-menu>summary span{display:block;margin-top:5px;color:var(--muted);font-size:.75rem;font-weight:500}.operations-tools-body{display:grid;gap:20px;padding:22px;border-top:1px solid var(--line)}.operations-tools-body>.profile-card{margin:0}
.activity-panel>header{padding:22px clamp(20px,2.6vw,32px)}.activity-panel>header>a{align-self:center;font-size:.77rem;font-weight:750}
.activity-feed article{min-height:66px;padding:13px clamp(20px,2.6vw,32px);grid-template-columns:10px minmax(0,1fr) auto;border-color:var(--line)}
.activity-feed article:hover{background:rgba(255,114,36,.035)}.activity-feed strong{font-size:.86rem}.activity-feed small{font-size:.74rem;color:var(--muted)}
.activity-count{display:inline-block;margin-left:7px;padding:2px 7px;border:1px solid var(--line-hot);border-radius:99px;color:var(--orange);font-size:.67rem;vertical-align:middle}
html:not([data-theme="light"]) .portal-main{background:radial-gradient(circle at 90% 8%,rgba(125,28,27,.11),transparent 33%),radial-gradient(circle at 12% 58%,rgba(153,63,15,.065),transparent 38%)}
html:not([data-theme="light"]) :is(.overview-panel,.profile-card,.document-reader,.guide-list-card,.quiz-card-grid>article,.ai-workspace,.ai-guardrails){background:radial-gradient(circle at 96% 0,rgba(131,27,25,.13),transparent 36%),linear-gradient(145deg,rgba(61,13,23,.16),transparent 42%,rgba(132,51,14,.055) 100%),var(--panel)}
html:not([data-theme="light"]) .priority-work-panel{background:radial-gradient(circle at 90% -10%,rgba(180,62,20,.16),transparent 40%),linear-gradient(135deg,#1a1012,#101012 45%,#1b1010)}
html:not([data-theme="light"]) .priority-work-panel .operation-list article{background:linear-gradient(120deg,rgba(83,24,28,.22),rgba(20,18,19,.74) 55%,rgba(85,36,16,.16))}
html:not([data-theme="light"]) :is(.overview-panel,.profile-card,.document-reader,.guide-list-card,.quiz-card-grid>article) > header{background:none}
html[data-theme="light"] .priority-work-panel .operation-list .queue-rank-1{color:#9f2921;border-color:#d9a49d}html[data-theme="light"] .priority-work-panel .operation-list .queue-rank-2{color:#89440f;border-color:#d2b298}
html[data-theme="light"] .priority-work-panel .operation-list article{background:#fbf7f5}html[data-theme="light"] .queue-repeat{color:#92420d!important;background:#f6e5d7}
@media(max-width:700px){.priority-work-panel>header{grid-template-columns:1fr}.priority-work-panel>header>a{grid-column:1;justify-self:start;margin-top:8px}.priority-work-panel .operation-list article{gap:8px}.activity-feed article{grid-template-columns:10px minmax(0,1fr)}.activity-feed code{grid-column:2;max-width:100%}}
@media(prefers-reduced-motion:reduce){.priority-work-panel .operation-list article{transition:none}.priority-work-panel .operation-list article:hover{transform:none}}

/* v3.1.4: role hierarchy, task focus, and on-demand assistance. */
.queue-focus-note{border-color:rgba(200,73,27,.48);background:linear-gradient(110deg,#23100c,#181110 72%,#241409);color:#f3e5dd}.queue-focus-note strong{color:#ff8b54}.queue-focus-note a{color:#ff9c65}
html[data-theme="light"] .queue-focus-note{background:#fff3e9;border-color:#e6b398;color:#563524}html[data-theme="light"] .queue-focus-note strong,html[data-theme="light"] .queue-focus-note a{color:#a5421d}
html[data-theme="light"] .member-role-heading{background: none;color:#302428;border-color:#dfd1cd}html[data-theme="light"] .member-role-heading small{color:#675a5d}
.staff-assistant-float{position:fixed;z-index:39;right:14px;bottom:58px;width:min(380px,calc(100vw - 28px));color:var(--ink)}
.staff-assistant-float>summary{display:block;width:max-content;margin-left:auto;padding:10px 15px;border:1px solid rgba(255,112,54,.55);border-radius:999px;background:linear-gradient(115deg,#91252a,#b44818);color:#fff;box-shadow:0 10px 28px rgba(0,0,0,.24);font-size:.78rem;font-weight:850;cursor:pointer;list-style:none}
.staff-assistant-float>summary::-webkit-details-marker{display:none}.staff-assistant-float[open]>summary{margin-top:10px}
.staff-assistant-float-panel{max-height:min(66vh,620px);overflow:auto;padding:20px;margin-bottom:10px;border:1px solid var(--line-hot);border-radius:16px;background:var(--panel);box-shadow:0 18px 42px rgba(0,0,0,.33)}
.staff-assistant-float-panel h2{margin:0 0 7px;font-size:1.15rem}.staff-assistant-float-panel p,.staff-assistant-float-panel small{color:var(--muted);font-size:.79rem;line-height:1.5}.staff-assistant-float-panel form{display:grid;gap:10px;margin-top:16px}.staff-assistant-float-panel label{font-size:.76rem;font-weight:800}.staff-assistant-float-panel textarea{min-height:90px;resize:vertical}.staff-assistant-float-panel .ai-answer{margin-top:14px;padding:14px}
.ai-document-panel{display:grid;gap:12px;padding:18px;margin:0 0 14px;border:1px solid rgba(255,110,57,.35);border-radius:14px;background:linear-gradient(110deg,rgba(138,26,31,.13),rgba(165,68,23,.06))}.ai-document-panel>div:first-child{display:grid;gap:5px}.ai-document-panel strong{font-size:.88rem}.ai-document-panel small{color:var(--muted);line-height:1.5}.ai-document-panel label{display:grid;gap:7px;font-size:.78rem;font-weight:800}.ai-document-panel textarea{min-height:74px;resize:vertical}.ai-document-panel>button{justify-self:start}.ai-document-result{padding:14px;border:1px solid var(--line);border-radius:10px;background:var(--panel-2)}.ai-document-result p{white-space:pre-wrap;line-height:1.6}.ai-document-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
html[data-theme="light"] .staff-assistant-float-panel,html[data-theme="light"] .ai-document-result{background:#fff;color:#302428}html[data-theme="light"] .ai-document-panel{background:linear-gradient(110deg,#fff3ed,#fffcf8)}
.ai-document-preview{max-height:420px;overflow:auto;margin-top:12px;padding:14px;border:1px solid var(--line);border-radius:10px;background:var(--panel)}.ai-document-preview>:first-child{margin-top:0}.ai-document-preview>:last-child{margin-bottom:0}.ai-document-preview h2{font-size:1.15rem;margin:16px 0 8px}.ai-document-preview ul,.ai-document-preview ol{padding-left:24px;margin:10px 0}.ai-document-preview li{margin:5px 0;line-height:1.5}.ai-document-preview p{margin:10px 0}.ai-document-panel .form-note{display:inline;font-weight:400}
html[data-theme="light"] .ai-document-preview{background:#fffdfb;color:#302428}
@media(max-width:540px){.staff-assistant-float{right:8px;bottom:53px;width:min(380px,calc(100vw - 16px))}.staff-assistant-float-panel{max-height:55vh}}

/* v3.1.10: one navigation geometry and a warmer, more fluid shared interface. */
.portal-page .portal-content::before { right: 0; }
.portal-page .portal-sidebar .portal-nav > .nav-link,
.portal-page .portal-sidebar .portal-nav > .nav-folder > summary {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) 12px;
  align-items: center;
  column-gap: 13px;
  width: 100%;
  min-height: 46px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: .84rem;
  font-weight: 750;
  line-height: 1.35;
  transform: none;
  transition: color .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.portal-page .portal-sidebar .portal-nav > .nav-folder > summary > b {
  justify-self: center;
  font-size: .8rem;
  color: var(--quiet);
}
.portal-page .portal-sidebar .portal-nav > .nav-link,
.portal-page .portal-sidebar .portal-nav > .nav-folder { flex-shrink: 0; }
.portal-page .portal-sidebar :is(a, summary):focus-visible { outline: 2px solid var(--orange); outline-offset: -3px; }
.portal-page .portal-sidebar .portal-nav > .nav-link:hover,
.portal-page .portal-sidebar .portal-nav > .nav-folder > summary:hover {
  transform: none;
  background: linear-gradient(105deg, rgba(161, 39, 25, .24), rgba(149, 61, 17, .12));
  border-color: #753627;
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 165, 95, .035);
}
.portal-page .portal-sidebar .portal-nav > .nav-link[aria-current="page"],
.portal-page .portal-sidebar .portal-nav > .nav-folder[open] > summary {
  background: linear-gradient(105deg, #48201a, #28140f);
  border-color: #87412b;
  color: #fff5ed;
  box-shadow: inset 3px 0 0 #f0652c, inset 0 1px 0 rgba(255, 175, 100, .08);
}
.portal-page .portal-sidebar .portal-nav > .nav-link[aria-current="page"] > span,
.portal-page .portal-sidebar .portal-nav > .nav-folder[open] > summary > span {
  color: #ffb486;
  background: rgba(238, 95, 32, .16);
}
.portal-page .portal-sidebar {
  background: radial-gradient(ellipse at 0 0, rgba(130, 35, 22, .22), transparent 54%), linear-gradient(175deg, #120e0d, #0b0b0c 65%);
  border-right-color: #3d2922;
}
.portal-page .portal-sidebar .identity-card {
  background: radial-gradient(ellipse at 100% 0, rgba(194, 73, 18, .18), transparent 70%), linear-gradient(125deg, #291511, #151110);
  border-color: #713528;
}
.portal-page .portal-sidebar .portal-nav { scrollbar-color: #78422c transparent; }
.portal-page .portal-topbar {
  background: linear-gradient(105deg, rgba(47, 17, 13, .94), rgba(12, 12, 13, .95) 65%);
  border-bottom-color: #3d2922;
}
html:not([data-theme="light"]) .portal-main {
  background: radial-gradient(ellipse at 100% 0, rgba(153, 43, 20, .18), transparent 42%), radial-gradient(ellipse at 8% 65%, rgba(162, 68, 15, .08), transparent 46%), var(--bg);
}
.portal-page :is(.overview-panel, .profile-card, .integration-card, .quiz-my-list, .quiz-admin, .document-reader, .activity-panel, .guide-list-card) {
  border-radius: 18px;
  border-color: var(--line-hot);
  box-shadow: 0 14px 36px rgba(0, 0, 0, .16), inset 0 1px 0 rgba(255, 175, 115, .035);
}
html:not([data-theme="light"]) .portal-page :is(.overview-panel, .profile-card, .integration-card, .quiz-my-list, .quiz-admin, .activity-panel) > header {
  background: none;
}
html:not([data-theme="light"]) .portal-page .metric-grid article {
  background: radial-gradient(ellipse at 100% 0, rgba(171, 54, 25, .22), transparent 68%), linear-gradient(135deg, #201210, #101011);
}
html:not([data-theme="light"]) .portal-page .metric-grid article:nth-child(even) {
  background: radial-gradient(ellipse at 100% 0, rgba(192, 88, 17, .21), transparent 68%), linear-gradient(135deg, #22160e, #101011);
}
.portal-page :is(.primary-button, .primary-link, .publish-button) {
  background: linear-gradient(110deg, #b51d27, #ce3521 55%, #e86222);
  box-shadow: inset 0 1px 0 rgba(255, 205, 165, .18), 0 6px 18px rgba(157, 40, 17, .2);
  transition: box-shadow .18s ease, filter .18s ease;
}
.portal-page :is(.primary-button, .primary-link, .publish-button):hover {
  filter: brightness(1.12);
  box-shadow: inset 0 1px 0 rgba(255, 205, 165, .22), 0 8px 24px rgba(177, 55, 18, .28);
}
.portal-page :is(input, textarea, select) { transition: border-color .18s ease, box-shadow .18s ease; }
.portal-page :is(input, textarea, select):focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; box-shadow: 0 0 0 5px rgba(225, 92, 26, .1); }
.portal-page :is(a, button, summary):focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
html[data-theme="light"] .portal-page .portal-sidebar { background: radial-gradient(ellipse at 0 0, rgba(223, 106, 41, .1), transparent 60%), linear-gradient(175deg, #fffaf6, #f8f4f0); border-right-color: #dfc9bc; }
html[data-theme="light"] .portal-page .portal-sidebar .identity-card { background: linear-gradient(120deg, #fff, #fff0e2); border-color: #dec0aa; }
html[data-theme="light"] .portal-page .portal-topbar { background: linear-gradient(105deg, #fff0e6, #fffaf7 65%); border-bottom-color: #dfc9bc; }
html[data-theme="light"] .portal-page .portal-nav > .nav-link:hover,
html[data-theme="light"] .portal-page .portal-nav > .nav-folder > summary:hover { background: linear-gradient(105deg, #fae6d8, #fff2e7); border-color: #d6ae92; color: #7a3019; }
html[data-theme="light"] .portal-page .portal-nav > .nav-link[aria-current="page"],
html[data-theme="light"] .portal-page .portal-nav > .nav-folder[open] > summary { background: linear-gradient(105deg, #f5dccb, #fff0e2); border-color: #cda082; color: #752719; }
html[data-theme="light"] .portal-page .portal-nav > .nav-link[aria-current="page"] > span,
html[data-theme="light"] .portal-page .portal-nav > .nav-folder[open] > summary > span { background: #efd0ba; color: #7d351e; }
html[data-theme="light"] .portal-page :is(.overview-panel, .profile-card, .integration-card, .quiz-my-list, .quiz-admin, .activity-panel) > header { background: none; }
html[data-theme="light"] .portal-page .metric-grid article { background: linear-gradient(135deg, #fff7ef, #fff); }
@media (prefers-reduced-motion: reduce) {
  .portal-page .portal-sidebar .portal-nav > .nav-link,
  .portal-page .portal-sidebar .portal-nav > .nav-folder > summary,
  .portal-page :is(.primary-button, .primary-link, .publish-button, input, textarea, select) { transition: none; }
  .portal-page :is(.primary-button, .primary-link, .publish-button)::after { transition: none; }
}

/* Keep the inset permission-preview heading on its card's existing surface. */
.portal-page .portal-content .profile-card.permission-lab > header { background: transparent; }

/* Compact reading chrome: emphasis belongs to the content, not the controls. */
.portal-page .portal-content .profile-card.permission-lab > header { background: transparent; }
.portal-page .document-top { max-width: 1050px; margin: 0 auto 18px; padding: 0 2px; gap: 16px; }
.portal-page .document-top .back-link { color: var(--muted); font-size: .85rem; }
.portal-page .document-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.portal-page .document-actions :is(button, a) { min-height: 36px; padding: 9px 13px; font-size: .78rem; }
.portal-page .document-reader { padding: clamp(24px, 4vw, 48px); background: var(--panel); border-radius: 20px; }
.portal-page .portal-content .document-reader > header { background: transparent; padding-bottom: 24px; }
.portal-page .document-reader > header p { margin: 18px 0 10px; color: var(--muted); font-size: .7rem; }
.portal-page .document-reader > header h1,
.portal-page .document-reader > header h1.long-title { font-size: clamp(1.9rem, 3.5vw, 3.2rem); line-height: 1.12; letter-spacing: -.035em; }
.portal-page .document-reader .prose { padding-top: 26px; }
.portal-page .document-ownership { max-width: 1050px; margin: 0 auto 18px; padding: 0; overflow: hidden; }
.portal-page .document-ownership > summary { padding: 16px 20px; cursor: pointer; font-size: .88rem; font-weight: 700; }
.portal-page .document-ownership > :not(summary) { margin: 16px 20px; }
.portal-page .document-context-content > .document-ownership { max-width: none; margin: 0; }
.ai-document-panel [data-ai-selection-status] { display: block; margin-top: 8px; color: var(--muted); }
.ai-document-preview { max-height: 420px; overflow: auto; overflow-wrap: anywhere; }
.ai-document-preview :is(img, video, iframe, table) { max-width: 100%; }
.page-reading-progress { position: fixed; z-index: 1000; left: 280px; right: 0; top: 0; height: 4px; pointer-events: none; background: rgba(105, 31, 17, .12); }
.page-reading-progress > span { display: block; width: 100%; height: 100%; transform: scaleX(0); transform-origin: left; background: linear-gradient(90deg, #9e1625, #e53c22 55%, #ff9b31); box-shadow: 0 0 10px rgba(255, 105, 35, .3); }
@media (max-width: 820px) { .page-reading-progress { left: 0; } }
@media (max-width: 600px) {
  .portal-page .document-top { align-items: flex-start; gap: 12px; }
  .portal-page .document-reader { padding: 24px 20px; border-radius: 14px; }
}

/* Contextual editing tools follow selected text without covering the document. */
.selection-editor-toolbar { position: fixed; z-index: 65; display: flex; gap: 3px; padding: 5px; max-width: calc(100vw - 20px); border: 1px solid var(--line-hot); border-radius: 12px; background: var(--panel-2); box-shadow: 0 8px 28px rgba(0,0,0,.3); }
.selection-editor-toolbar button { width: 36px; height: 34px; padding: 0; border: 0; border-radius: 8px; color: var(--ink); background: transparent; cursor: pointer; font-weight: 800; }
.selection-editor-toolbar button:hover { background: var(--panel-3); }
.selection-editor-toolbar button:nth-child(2) { font-style: italic; }
.selection-editor-toolbar .selection-ai-button { margin-left: 5px; color: #fff; font-size: 1.25rem; background: linear-gradient(120deg,#a62029,#df6b22); }
.selection-editor-toolbar .selection-ai-button:hover { background: linear-gradient(120deg,#c42930,#f58330); }
.selection-ai-popup { position: fixed; z-index: 66; width: min(460px,calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto; border: 1px solid var(--line-hot); border-radius: 16px; background: var(--panel); color: var(--ink); box-shadow: 0 18px 60px rgba(0,0,0,.4); }
.selection-ai-popup > header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); background: none; font-size: .88rem; }
.selection-ai-popup > header button { width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px; color: var(--muted); background: var(--panel-2); cursor: pointer; font-size: 1.4rem; }
.selection-ai-popup .ai-document-panel { margin: 0; padding: 16px; border: 0; border-radius: 0; background: transparent; }
.selection-ai-popup .ai-document-panel > div:first-child { display: none; }
.selection-ai-popup .ai-document-preview { max-height: 220px; }
.selection-ai-popup :is(button, select, textarea):focus-visible,
.selection-editor-toolbar button:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.selection-editor-toolbar button { display: inline-flex; align-items: center; justify-content: center; }
[data-rich-link] { gap: 6px; }
.document-link-picker { width: min(720px,calc(100vw - 24px)); max-height: calc(100dvh - 32px); margin: auto; overflow-y: auto; padding: 22px; border: 1px solid var(--line-hot); border-radius: 18px; color: var(--ink); background: var(--panel); box-shadow: 0 24px 80px rgba(0,0,0,.4); }
.document-link-picker::backdrop { background: rgba(0,0,0,.6); backdrop-filter: blur(3px); }
.document-link-picker > header { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 18px; }
.document-link-picker h2 { margin: 0; font-size: 1.25rem; }
.document-link-picker > header button { padding: 0; width: 32px; height: 32px; border: 0; border-radius: 8px; color: var(--muted); background: var(--panel-2); cursor: pointer; font-size: 1.4rem; }
.document-link-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.document-link-tabs [aria-pressed="true"] { border-color: var(--orange); background: linear-gradient(110deg,rgba(161,32,30,.18),rgba(217,97,23,.12)); }
.document-link-picker label { margin: 14px 0; }
.document-link-gallery { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; max-height: 320px; overflow-y: auto; padding: 3px; }
.document-link-card { display: grid; grid-template-columns: 32px minmax(0,1fr); gap: 6px 10px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--panel-2); cursor: pointer; text-align: left; overflow-wrap: anywhere; }
.document-link-card > span { grid-row: 1 / 3; color: var(--orange); font-size: 1.6rem; }
.document-link-card strong { font-size: .85rem; }
.document-link-card small { color: var(--muted); font-size: .7rem; }
.document-link-card:hover, .document-link-card[aria-pressed="true"] { border-color: var(--orange); box-shadow: inset 0 0 0 1px var(--orange); }
.document-link-picker :is(button,input):focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.document-link-picker [role="status"]:empty { display: none; }
@media (max-width: 540px) { .document-link-gallery { grid-template-columns: 1fr; } .document-link-picker { padding: 16px; } }

/* Focused document editing: quiet paper, grouped tools and a single list menu. */
.portal-page .editor-shell { display: grid; grid-template-columns: minmax(0,1fr); gap: 18px; border: 0; background: transparent; }
.editor-shell .editor-settings { padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.editor-settings > label input[name="title"] { font-size: 1.3rem; font-weight: 750; }
.editor-properties { margin-top: 16px; border-top: 1px solid var(--line); }
.editor-properties > summary,.editor-ai-drawer > summary { display: flex; align-items: center; gap: 12px; padding: 15px 0; cursor: pointer; font-weight: 700; list-style: none; }
.editor-properties > summary::after,.editor-ai-drawer > summary::after { content: '⌄'; margin-left: auto; color: var(--muted); }
.editor-properties > summary span,.editor-ai-drawer > summary span { font-size: .75rem; color: var(--muted); font-weight: 400; }
.editor-properties-body { display: grid; gap: 16px; padding-top: 12px; }
.editor-shell .editor-workspace { min-width: 0; padding: 0; border: 1px solid var(--line); border-radius: 16px; overflow: visible; background: var(--panel); }
.editor-ai-drawer { padding: 0 18px; border-bottom: 1px solid var(--line); }
.editor-ai-drawer > summary { color: var(--orange); }
.editor-ai-drawer .ai-document-panel { margin: 0 0 18px; }
.editor-toolbar-modern { position: sticky; top: 0; z-index: 24; gap: 8px; flex-wrap: wrap; padding: 10px 12px; min-height: 56px; border-radius: 16px 16px 0 0; background: var(--panel-2); box-shadow: 0 4px 12px rgba(0,0,0,.06); }
.editor-toolbar-modern .editor-tool-group { display: flex; align-items: center; gap: 3px; padding-right: 8px; border-right: 1px solid var(--line); }
.editor-toolbar-modern .editor-tool-group:last-of-type { border: 0; }
.editor-toolbar-modern button,.editor-tool-menu > summary { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; min-width: 34px; padding: 0; border: 0; border-radius: 8px; color: var(--ink); background: transparent; cursor: pointer; font-size: .85rem; }
.editor-toolbar-modern button:hover,.editor-tool-menu > summary:hover,.editor-tool-menu[open] > summary,.editor-toolbar-modern button[aria-pressed="true"] { background: var(--panel-3); color: var(--orange); }
.editor-toolbar-modern select { width: 134px; min-width: 0; border: 0; background-color: var(--panel-2); color: var(--ink); font-size: .8rem; border-radius: 8px; }
.editor-toolbar-modern .editor-tool-hint { margin-left: auto; font-size: .7rem; text-transform: none; letter-spacing: 0; color: var(--muted); }
.editor-tool-menu { position: relative; }
.editor-tool-menu > summary { list-style: none; }
.editor-tool-menu > summary::-webkit-details-marker { display: none; }
.editor-menu-items { position: absolute; top: calc(100% + 8px); left: 0; z-index: 72; width: 205px; padding: 6px; border: 1px solid var(--line-hot); border-radius: 12px; background: var(--panel-2); box-shadow: 0 14px 36px rgba(0,0,0,.22); }
.editor-menu-items button { display: flex; justify-content: flex-start; gap: 10px; width: 100%; min-height: 36px; padding: 8px 10px; white-space: nowrap; }
.editor-menu-items button span { margin: 0; color: inherit; font-size: .8rem; letter-spacing: 0; text-transform: none; }
.editor-shell .rich-editor { min-height: 440px; padding: clamp(24px,4vw,52px); color: var(--ink); background: var(--panel); border: 0; outline-offset: -2px; font-size: 1rem; line-height: 1.8; }
.rich-editor :is(ul,ol) { padding-left: 1.8em; }
.rich-editor :is(td,th) { min-width: 60px; min-height: 30px; padding: 10px; border: 1px solid var(--line-hot); }
.rich-editor table { width: 100%; margin: 18px 0; border-collapse: collapse; }
.rich-editor :is(code,pre) { background: var(--panel-3); color: var(--ink); border-radius: 5px; }
.rich-editor code { padding: .12em .3em; }
.rich-editor hr { border: 0; border-top: 1px solid var(--line-hot); margin: 24px 0; }
.editor-status { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 12px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: .72rem; }
.editor-status [data-editor-dirty][data-changed="true"] { color: var(--orange); }
.editor-status [data-editor-upload-state] { margin-right: auto; }
.editor-shell .editor-submit { grid-column: auto; padding: 12px 0; background: transparent; border: 0; }
.editor-dialog-check { display: flex; align-items: center; gap: 10px; }
.editor-dialog-check input { width: auto; min-height: 0; }
.editor-dialog-actions { display: flex; gap: 12px; }
.selection-editor-toolbar .editor-menu-items { top: calc(100% + 9px); left: auto; right: 0; }
.selection-editor-toolbar .editor-menu-items button { width: 100%; height: auto; justify-content: flex-start; }
.document-discussion,.document-activity-menu { max-width: 1050px; margin: 18px auto; }
.document-discussion > summary { display: inline-flex; gap: 12px; align-items: center; padding: 10px 18px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--panel-2); cursor: pointer; font-size: .85rem; font-weight: 700; list-style: none; }
.document-discussion > summary span { color: var(--muted); }
.document-discussion-body { margin-top: 14px; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.document-discussion-body > p { margin-top: 0; color: var(--muted); font-size: .8rem; }
.document-discussion-body form { display: grid; gap: 12px; margin-top: 16px; }
.document-discussion-body form > button { justify-self: start; }
.document-activity-menu > summary { padding: 14px 0; cursor: pointer; color: var(--muted); font-size: .8rem; }
.document-activity-menu article { margin: 10px 0; font-size: .8rem; }
.portal-page .portal-content :is(.document-discussion,.document-workflow-panel,.document-activity-menu) :is(header,h2) { background: transparent; background-image: none; }
.editor-toolbar-modern :is(button,summary,select):focus-visible,.document-discussion > summary:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
@media (max-width: 720px) {
  .editor-toolbar-modern { gap: 5px; padding: 8px; }
  .editor-toolbar-modern .editor-tool-group { padding-right: 4px; }
  .editor-toolbar-modern .editor-tool-hint { display: none; }
  .editor-shell .rich-editor { min-height: 360px; padding: 22px 16px; }
  .editor-shell .editor-settings { padding: 16px; }
  .editor-properties > summary span,.editor-ai-drawer > summary span { display: none; }
  .editor-tool-group:has([data-rich-table]) .editor-menu-items { left: auto; right: 0; }
}

/* Protocol v1 Discord workspace: quiet surfaces, restrained ember accents. */
.bot-filter{display:flex;align-items:end;gap:1rem;flex-wrap:wrap;margin:1rem 0}.bot-filter label{flex:1;min-width:180px}.bot-filter input[type=checkbox]{width:auto}.bot-sync-status{display:flex;gap:1rem;flex-wrap:wrap;padding:1rem;border:1px solid var(--line);border-radius:14px;margin:1rem 0;background:var(--panel)}.bot-section-tabs{display:flex;gap:.5rem;flex-wrap:wrap;margin:1.5rem 0}.bot-section-tabs a{padding:.65rem .85rem;border:1px solid var(--line);border-radius:10px;text-decoration:none;color:var(--ink)}.bot-section-tabs a[aria-current=page]{border-color:#ba4024;background:linear-gradient(120deg,#74201c33,#b9491b22)}.bot-report{margin:.75rem 0;border:1px solid var(--line);border-radius:12px;padding:1rem}.bot-report summary{display:flex;gap:1rem;justify-content:space-between;cursor:pointer}.bot-report dl{display:grid;grid-template-columns:minmax(100px,180px) 1fr;gap:.7rem;margin-top:1rem}.bot-report dd{margin:0;white-space:pre-wrap;overflow-wrap:anywhere}.bot-question{display:grid;grid-template-columns:1fr 2fr auto auto;gap:.65rem;align-items:center;margin:.75rem 0}.bot-question[hidden]{display:none}[data-bot-settings] details{margin:1rem 0;padding:1rem;border:1px solid var(--line);border-radius:12px}[data-bot-settings] summary{cursor:pointer;font-weight:700}[data-bot-settings] fieldset{margin:1rem 0;padding:1rem;border:1px solid var(--line);border-radius:10px}[data-bot-settings] label{margin:.65rem 0}[data-bot-settings] input[type=checkbox]{width:auto}[data-bot-message-preview]{display:block;white-space:pre-wrap;padding:.5rem;color:var(--muted)}@media(max-width:700px){.bot-question{grid-template-columns:1fr}.bot-report dl{grid-template-columns:1fr}.bot-report summary{flex-direction:column}.bot-filter label{min-width:100%}}
/* Discord belongs to Settings; keep its menu explanatory without heavy title gradients. */
.settings-tabs > a { display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; white-space: normal; }
.settings-tabs > a > small { color: var(--muted, #aaa); font-size: .75rem; font-weight: 400; line-height: 1.4; }
.bot-heading { margin-top: 1.5rem; }
.bot-heading h2 { margin: .25rem 0 .7rem; font-size: clamp(1.3rem, 2.5vw, 1.9rem); }
.bot-heading > div { background: none; }
.bot-module-menu { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: .7rem; margin: 1.2rem 0; }
.bot-module-menu > a { display: flex; flex-direction: column; gap: .5rem; min-width: 0; padding: 1rem; border: 1px solid var(--line, #393033); border-radius: 12px; color: var(--ink); background: var(--panel, #141111); text-decoration: none; white-space: normal; transition: border-color .15s, background .15s; }
.bot-module-menu > a:hover, .bot-module-menu > a[aria-current="page"] { border-color: #b73525; background: linear-gradient(135deg, rgba(156, 35, 24, .10), rgba(184, 72, 20, .06)); }
.bot-module-title { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .45rem; font-weight: 700; }
.bot-module-title > small { color: var(--muted, #aaa); font-size: .65rem; font-weight: 500; }
.bot-module-help { color: var(--muted, #aaa); font-size: .78rem; line-height: 1.5; font-weight: 400; }

/* Compact Discord server selection and plain-language reporting controls. */
.bot-server-picker { display: grid; grid-template-columns: minmax(0, 420px) auto 1fr; align-items: end; gap: .65rem 1rem; margin: 1.2rem 0; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.bot-server-picker > label { display: grid; gap: .45rem; min-width: 0; margin: 0; }
.bot-server-picker > label > span { color: var(--muted); font-size: .75rem; }
.bot-server-picker select { min-height: 42px; padding: .65rem .85rem; }
.bot-server-picker > button { min-height: 42px; margin: 0; }
.bot-server-picker > p { align-self: center; margin: 1rem 0 0; color: var(--muted); font-size: .78rem; line-height: 1.5; }
.bot-reporting-settings { margin: 1rem 0; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); overflow: hidden; }
.bot-reporting-settings > summary { display: flex; align-items: center; gap: 1rem; min-height: 64px; padding: .9rem 1.1rem; cursor: pointer; list-style: none; }
.bot-reporting-settings > summary::-webkit-details-marker { display: none; }
.bot-reporting-settings > summary > span:first-child { flex: 1; min-width: 0; display: grid; gap: .25rem; }
.bot-reporting-settings > summary strong { font-size: .85rem; color: var(--ink); }
.bot-reporting-settings > summary small { font-size: .75rem; line-height: 1.45; color: var(--muted); }
.bot-reporting-settings > summary::after { content: "⌄"; color: var(--muted); font-size: 1rem; transition: transform .15s; }
.bot-reporting-settings[open] > summary::after { transform: rotate(180deg); }
.bot-reporting-settings > summary:hover { background: var(--panel-2); }
.bot-reporting-settings > summary:focus-visible { outline: 2px solid var(--orange); outline-offset: -3px; }
.bot-reporting-count { flex-shrink: 0; border: 1px solid var(--line); border-radius: 6px; padding: .3rem .5rem; color: var(--muted); font-size: .7rem; }
.bot-reporting-body { padding: 1rem 1.1rem; border-top: 1px solid var(--line); }
.bot-reporting-body > p { margin: 0 0 1rem; color: var(--muted); font-size: .8rem; line-height: 1.65; }
.bot-reporting-body > .bot-reporting-note { padding: .8rem 1rem; border-left: 2px solid var(--orange); background: var(--panel-2); border-radius: 0 8px 8px 0; }
.bot-reporting-note strong { color: var(--ink); }
.bot-reporting-server { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) auto; gap: 1rem; align-items: start; padding: 1rem 0; border-top: 1px solid var(--line); }
.bot-reporting-server > header { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }
.bot-reporting-server > header > small { color: var(--muted); }
.bot-reporting-server label { margin: 0; min-width: 0; color: var(--ink); }
.bot-reporting-toggle { display: flex; align-items: flex-start; gap: .65rem; }
.bot-reporting-toggle input[type=checkbox] { width: 18px; min-height: 18px; flex-shrink: 0; margin: .15rem 0 0; }
.bot-reporting-toggle > span { display: grid; gap: .45rem; }
.bot-reporting-server label small { color: var(--muted); font-size: .75rem; font-weight: 400; line-height: 1.5; }
.bot-retention-field { display: grid; gap: .45rem; }
.bot-retention-field input { max-width: 120px; }
.bot-reporting-server > button { margin: 0; }
@media (max-width: 1000px) { .bot-server-picker { grid-template-columns: minmax(0,1fr) auto; } .bot-server-picker > p { grid-column: 1 / -1; margin: 0; } .bot-reporting-server { grid-template-columns: minmax(0,1fr) minmax(0,1fr); } .bot-reporting-server > button { justify-self: start; } }
@media (max-width: 600px) { .bot-server-picker, .bot-reporting-server { grid-template-columns: minmax(0,1fr); } .bot-server-picker > button { justify-self: start; } .bot-reporting-settings > summary { gap: .65rem; flex-wrap: wrap; } .bot-reporting-count { order: 3; } .bot-reporting-settings > summary > span:first-child { flex-basis: calc(100% - 2rem); } }

/* Queued staff workflows: preserve the confirmed record; surface pending state separately. */
.bot-conversation, .bot-module-policy, .bot-workflow-history { padding: 1.2rem; margin: 1.2rem 0; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.bot-conversation > header, .bot-module-policy > header { background: none; margin-bottom: 1rem; }
.bot-conversation h2, .bot-module-policy h2 { font-size: 1.35rem; }
.bot-conversation p, .bot-module-policy p, .bot-workflow-history p { line-height: 1.6; }
.bot-conversation form, .bot-workflow-review { display: grid; gap: .8rem; }
.bot-ticket-timeline { display: grid; gap: .65rem; margin: 1rem 0; }
.bot-ticket-timeline > article { padding: .9rem; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; }
.bot-ticket-timeline article > header { display: flex; flex-wrap: wrap; gap: .5rem 1rem; justify-content: space-between; font-size: .75rem; background: none; }
.bot-ticket-timeline article > p { overflow-wrap: anywhere; white-space: normal; }
.bot-ticket-timeline time, .bot-ticket-timeline small, .bot-workflow-history small { color: var(--muted); }
.bot-ticket-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1rem; }
.bot-workflow-review { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.bot-workflow-review input[type=checkbox], .bot-module-policy input[type=checkbox] { width: 18px; min-height: 18px; }
.bot-workflow-history article { border-top: 1px solid var(--line); margin-top: .8rem; padding-top: .8rem; display: grid; gap: .45rem; overflow-wrap: anywhere; }
.bot-workflow-history article dl { display: grid; grid-template-columns: minmax(100px,180px) 1fr; gap: .5rem; }
.bot-workflow-history article dd { margin: 0; }
.bot-module-policy fieldset { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,220px),1fr)); gap: 1rem; padding: 1rem; margin: 1rem 0; border: 1px solid var(--line); border-radius: 10px; }
.bot-module-policy fieldset > label { display: grid; gap: .5rem; margin: 0; min-width: 0; }
.bot-module-policy fieldset > p { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: .8rem; }
@media(max-width:600px) { .bot-workflow-history article dl { grid-template-columns: 1fr; } }

/* Keep Discord module/setup fragment targets clear of the sticky portal header. */
#bot-module-content, #bot-reporting-settings { scroll-margin-top: 6rem; }

/* Discord dialogs use clean text surfaces; keep accent color on borders and controls. */
html:not([data-theme="light"]) .portal-page .integration-card > header,
html[data-theme="light"] .portal-page .integration-card > header,
html:not([data-theme="light"]) .portal-page .bot-module-panel > header,
html[data-theme="light"] .portal-page .bot-module-panel > header { background: transparent; }
.bot-module-dialog { width: min(1100px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); margin: auto; padding: 24px; border: 1px solid var(--line); border-radius: 18px; color: var(--ink); background: var(--panel); overflow: auto; box-shadow: 0 24px 90px rgba(0,0,0,.45); }
.bot-module-dialog::backdrop { background: rgba(0,0,0,.68); }
.bot-module-dialog .bot-module-panel { margin: 0; padding: 0; border: 0; background: transparent; }
.bot-module-dialog .bot-module-panel > header { padding-right: 42px; margin-bottom: 16px; }
.bot-module-dialog .bot-module-panel > header h2 { font-size: clamp(1.3rem,3vw,1.9rem); }
.bot-module-dialog .bot-server-picker { margin: 0 0 18px; }
.bot-module-close { position: sticky; z-index: 2; top: 0; float: right; width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--panel-2); font-size: 1.5rem; cursor: pointer; }
.bot-module-modal-open { overflow: hidden; }
@media (max-width: 650px) {
  .bot-module-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); padding: 16px; border-radius: 12px; }
  .bot-module-dialog .bot-sync-status { display: grid; gap: .65rem; }
  .bot-module-dialog .bot-server-picker { grid-template-columns: 1fr; }
  .bot-module-dialog .bot-report dl { grid-template-columns: 1fr; }
}

/* Required guide navigation and safe, text-only revision comparisons. */
.guide-ack-steps a { display:inline-flex; align-items:center; padding:8px 12px; border:1px solid var(--line); border-radius:999px; color:var(--muted); text-decoration:none; font-size:.8rem; }
.guide-ack-steps a[aria-current="step"] { border-color:var(--red); color:var(--red); font-weight:700; }
.guide-ack-steps a:hover { color:var(--ink); border-color:var(--red); }
.guide-ack-steps a:focus-visible { outline:2px solid var(--red); outline-offset:3px; }
.guide-change-summary { margin:16px 24px; padding:14px 18px; border:1px solid var(--line); border-radius:12px; background:var(--panel); }
.guide-change-summary summary { cursor:pointer; font-weight:700; }
.guide-change-body { padding-top:10px; }
.guide-change-body p { font-size:.85rem; line-height:1.6; color:var(--muted); }
.guide-change-list { display:grid; gap:10px; list-style:none; padding:0; margin:14px 0 0; }
.guide-change-list li { padding:12px; border-radius:8px; border:1px solid var(--line); border-left-width:3px; overflow-wrap:anywhere; }
.guide-change-list strong { display:block; margin-bottom:5px; font-size:.75rem; }
.guide-change-list ins,.guide-change-list del { white-space:pre-wrap; }
.guide-change-added { border-left-color:#54c98a!important; background:rgba(42,155,93,.08); }
.guide-change-removed { border-left-color:#ed8c73!important; background:rgba(196,73,48,.08); }
@media(max-width:600px) { .guide-change-summary { margin:12px; padding:12px; } }

/* Discord workspace: one clear heading, quiet diagnostics and compact controls. */
.bot-module-panel > .bot-module-header { display:block; padding:0 0 20px; margin:0 0 20px; border-bottom:1px solid var(--line); background:transparent!important; }
.bot-module-panel > .bot-module-header h2 { margin:0 0 8px; font-size:clamp(1.3rem,3vw,1.9rem); line-height:1.2; }
.bot-module-panel > .bot-module-header p { margin:0; max-width:72ch; color:var(--muted); line-height:1.6; font-size:.9rem; }
.bot-module-dialog { position:fixed; padding:28px; scrollbar-width:thin; scrollbar-color:var(--line-hot) var(--panel); }
.bot-module-dialog .bot-module-panel { outline:none; box-shadow:none; }
.bot-module-dialog .bot-module-panel > .bot-module-header { padding:0 48px 20px 0; margin:0 0 20px; }
.bot-module-close { position:sticky; top:0; right:auto; float:right; margin:-4px -4px 0 0; }
.bot-module-close:hover { border-color:var(--orange); background:var(--panel-3); }
.bot-module-close:focus-visible { outline:2px solid var(--orange); outline-offset:3px; }
.bot-module-panel .bot-server-picker { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px 16px; align-items:end; margin:0 0 16px; padding:0; border:0; background:transparent; }
.bot-module-panel .bot-server-picker label { margin:0; min-width:0; }
.bot-module-panel .bot-server-picker p { grid-column:1 / -1; margin:0; font-size:.78rem; color:var(--muted); }
.bot-module-panel .bot-sync-status { display:block; padding:0; margin:0 0 22px; background:var(--panel-2); border:1px solid var(--line); border-radius:10px; }
.bot-sync-status > summary { display:flex; align-items:center; flex-wrap:wrap; gap:8px 12px; padding:12px 14px; cursor:pointer; list-style:none; font-size:.8rem; }
.bot-sync-status > summary::-webkit-details-marker { display:none; }
.bot-sync-indicator { width:7px; height:7px; border-radius:50%; background:var(--orange); flex:none; }
.bot-sync-revision { color:var(--muted); }
.bot-sync-toggle { margin-left:auto; color:var(--muted); }
.bot-sync-toggle::after { content:" +"; color:var(--orange); }
.bot-sync-status[open] .bot-sync-toggle::after { content:" −"; }
.bot-sync-status > dl { display:grid; grid-template-columns:minmax(140px,180px) minmax(0,1fr); gap:12px 16px; margin:0; padding:16px; border-top:1px solid var(--line); font-size:.8rem; line-height:1.5; }
.bot-sync-status dt { color:var(--muted); }
.bot-sync-status dd { margin:0; overflow-wrap:anywhere; }
.bot-records { margin:0; padding:0; border:0; background:transparent; }
.bot-workflow-note { margin:0 0 18px; color:var(--muted); font-size:.8rem; line-height:1.6; }
.bot-records > form.bot-filter { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto; align-items:end; gap:14px; margin:0 0 16px; }
.bot-records > form.bot-filter label { margin:0; min-width:0; }
.bot-records > form.bot-filter button { width:auto; min-height:48px; }
.bot-record-count { margin:16px 0; font-size:.8rem; color:var(--muted); }
.bot-record-empty { padding:28px 20px; margin:16px 0; text-align:center; border:1px dashed var(--line); border-radius:12px; }
.bot-record-empty p { max-width:60ch; margin:8px auto 0; color:var(--muted); font-size:.85rem; line-height:1.6; }
@media(max-width:650px) {
 .bot-module-dialog { padding:20px 16px; }
 .bot-module-close { top:0; right:auto; }
 .bot-module-panel .bot-server-picker { grid-template-columns:minmax(0,1fr) auto; }
 .bot-records > form.bot-filter { grid-template-columns:1fr; gap:12px; }
 .bot-records > form.bot-filter button { width:100%; }
 .bot-sync-revision { flex-basis:100%; order:3; padding-left:19px; }
 .bot-sync-status > dl { grid-template-columns:1fr; gap:4px; }
 .bot-sync-status dd { margin-bottom:12px; }
}

/* Settings headings stay on clean surfaces; color belongs on controls and borders. */
.portal-page .master-settings-card > header { background:none!important; }
.portal-page .page-heading:has(+ .settings-tabs),
.portal-page .page-heading:has(+ .settings-tabs) > div { background:none!important; }
.portal-page .page-heading:has(+ .settings-tabs)::after { display:none; }

/* Reserve scrollbar space before navigation or modal scroll locking to avoid sideways reflow. */
html { scrollbar-gutter:stable; }
.portal-page .portal-main { min-height:100dvh; }
.portal-page .settings-tabs { overflow-anchor:none; }
.bot-module-dialog { height:min(780px,calc(100dvh - 48px)); }
.bot-menu-prompt { margin:20px 0; color:var(--muted); font-size:.85rem; }
@media(max-width:650px) { .bot-module-dialog { height:calc(100dvh - 16px); } }

.calendar-leave-status { display:flex; justify-content:space-between; align-items:center; gap:20px; padding:18px 22px; margin:0 0 20px; border:1px solid var(--line); border-radius:14px; background:var(--panel); }
.calendar-leave-status p,.calendar-leave-status small { color:var(--muted); font-size:.8rem; line-height:1.6; }
.calendar-leave-status p { margin:6px 0; }
.month-entry-leave { border-color:var(--purple); background:rgba(155,100,210,.12); color:var(--ink); }
.month-away-count { display:block; margin:0 0 8px; color:var(--purple); font-size:.7rem; font-weight:700; }
.month-calendar .month-legend-leave { color:var(--purple); }
@media(max-width:650px){ .calendar-leave-status { flex-direction:column; align-items:flex-start; } }

/* One heading policy for every panel module, including newly added settings cards.
   Color accents stay on controls, borders and outer surfaces, not title strips. */
.portal-page .portal-content :is(header, .page-heading, .section-header, .bot-heading, .member-role-heading) {
  background: none !important;
}
.portal-page .page-heading::after { content: none; background: none; }

/* Application reading surfaces stay neutral: no gradient behind answers or headings. */
.bot-application-answers dt { margin-top:1.1rem; font-weight:700; }
.bot-application-answers dd { margin:.5rem 0 1.2rem; white-space:normal; overflow-wrap:anywhere; line-height:1.65; }
.bot-application-review,.bot-application-question { padding:1rem; margin-block:.9rem; border:1px solid var(--border, #38302d); border-radius:12px; background:var(--panel, #111); }
.bot-application-review small { display:block; margin-block:.4rem; }
[data-application-questions] .bot-application-question[hidden] { display:none; }

/* GitHub projects are not task rows: task rows reserve a narrow icon column. */
.github-issues-settings { background:var(--panel); }
.github-issues-settings .github-issues-intro { margin:14px 0; color:var(--muted); line-height:1.6; }
.github-connection-state { display:flex; align-items:center; gap:10px; margin:18px 0 26px; color:var(--muted); font-size:.85rem; line-height:1.5; }
.github-connection-state > span { width:8px; height:8px; flex:none; border-radius:50%; background:var(--orange); }
.github-connection-state.is-ready > span { background:#62c99a; }
.github-section-heading { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:12px; margin-bottom:14px; }
.github-section-heading h3 { margin:0; font-size:1rem; }
.github-section-heading > span { color:var(--muted); font-size:.8rem; }
.github-destination-list { display:grid; gap:12px; }
.github-destination-card,.github-tracked-issue,.github-export-row { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:24px; padding:18px 20px; border:1px solid var(--line); border-radius:12px; background:var(--panel); }
.github-destination-copy,.github-tracked-issue > div,.github-export-row > strong { min-width:0; overflow-wrap:anywhere; }
.github-destination-copy > strong { display:block; font-size:1rem; }
.github-destination-copy p,.github-tracked-issue p { margin:7px 0 0; color:var(--muted); font-size:.8rem; line-height:1.5; }
.github-destination-copy code { color:var(--ink); overflow-wrap:anywhere; }
.github-issues-settings .github-disconnect-form { margin:0; justify-self:end; }
.github-disconnect-form .github-disconnect { width:auto; min-width:100px; min-height:40px; color:var(--muted); }
.github-disconnect-form .github-disconnect:hover { color:var(--ink); border-color:var(--red); }
.github-refresh-row { display:flex; flex-wrap:wrap; align-items:center; gap:16px 24px; margin-top:18px; }
.github-refresh-row form { flex:none; }
.github-issues-settings .github-help { margin:0; padding:0; color:var(--muted); font-size:.8rem; line-height:1.6; }
.github-add-project,.github-privacy-help { margin-top:24px; border-top:1px solid var(--line); padding-top:20px; }
.github-add-project > summary,.github-privacy-help > summary { cursor:pointer; font-size:.9rem; font-weight:700; line-height:1.5; }
.github-issues-settings .github-project-form { margin-top:20px; gap:20px; }
.github-project-form label { display:grid; gap:8px; min-width:0; }
.github-project-form label small { color:var(--muted); font-size:.78rem; line-height:1.5; font-weight:400; }
.github-project-form > .primary-button { justify-self:start; justify-content:center; }
.github-project-form [hidden],.bug-report-composer [hidden] { display:none!important; }
.github-privacy-help > div { margin-top:16px; display:grid; gap:12px; color:var(--muted); font-size:.82rem; line-height:1.6; }
.github-privacy-help p { margin:0; }
.github-tracked-issue,.github-export-row { margin-block:12px; }
.github-export-row > span { max-width:280px; color:var(--muted); font-size:.8rem; line-height:1.5; }
@media(max-width:650px) {
  .github-destination-card,.github-tracked-issue,.github-export-row { grid-template-columns:minmax(0,1fr); gap:14px; padding:16px; }
  .github-issues-settings .github-disconnect-form { justify-self:start; }
  .github-refresh-row { align-items:flex-start; flex-direction:column; }
  .github-project-form .two-fields { grid-template-columns:minmax(0,1fr); }
  .github-project-form > .primary-button { width:100%; }
}

.bug-workflow-guide { display:flex; flex-wrap:wrap; gap:12px 24px; margin:0 0 28px; padding:18px 20px; border:1px solid var(--line); border-radius:14px; color:var(--muted); font-size:.83rem; line-height:1.6; background:var(--panel); }
.bug-workflow-guide strong { width:100%; color:var(--ink); }
.bug-section-nav { display:flex; gap:12px; margin:0 0 20px; }
.bug-section-nav a { flex:1; padding:16px 20px; border:1px solid var(--line); border-radius:12px; color:var(--ink); text-decoration:none; font-weight:700; background:var(--panel); }
.bug-section-nav a:hover { border-color:var(--orange); }
.bug-section-nav span { display:block; margin-top:6px; color:var(--muted); font-size:.8rem; font-weight:400; }
.bug-queue-heading { scroll-margin-top:100px; margin:28px 0 20px; }
.bug-queue-heading h2 { margin:0 0 8px; font-size:1.3rem; }
.bug-queue-heading p { color:var(--muted); font-size:.85rem; line-height:1.6; }
.bug-priority-urgent { --bug-priority:#f87171; --bug-tint:rgba(248,113,113,.10); }
.bug-priority-high { --bug-priority:#fb923c; --bug-tint:rgba(251,146,60,.10); }
.bug-priority-normal { --bug-priority:#60a5fa; --bug-tint:rgba(96,165,250,.10); }
.bug-priority-low { --bug-priority:#a1a1aa; --bug-tint:rgba(161,161,170,.10); }
.bug-priority-pill { display:inline-flex; align-items:center; gap:7px; padding:6px 10px; border:1px solid var(--bug-priority); border-radius:8px; color:var(--bug-priority); background:var(--bug-tint); font-size:.72rem; font-weight:750; }
.bug-report-list > article { border-inline-start:3px solid var(--bug-priority); padding:22px!important; border-radius:14px!important; }
.bug-report-list > article > header { gap:12px; flex-wrap:wrap; background:none!important; }
.bug-report-list > article > header > div { display:flex; gap:8px; flex-wrap:wrap; }
.bug-report-excerpt { color:var(--muted); font-size:.87rem; line-height:1.65; margin:14px 0; overflow-wrap:anywhere; }
.bug-location-context { font-size:.8rem; color:var(--muted); overflow-wrap:anywhere; }
.bug-location-context strong { color:var(--ink); margin-right:8px; }
.bug-detail-metadata { display:flex; align-items:center; flex-wrap:wrap; gap:10px; margin:18px 0 24px; color:var(--muted); font-size:.8rem; }
.bug-status-open { color:#93c5fd; border-color:#3b82f6; background:rgba(59,130,246,.08); }
.bug-status-reviewing { color:#fcd34d; border-color:#b45309; background:rgba(180,83,9,.08); }
.bug-status-resolved { color:#86efac; border-color:#15803d; background:rgba(21,128,61,.08); }
.bug-status-closed { color:var(--muted); border-color:var(--line); background:transparent; }
.bug-development-tracking { scroll-margin-top:100px; }
.bug-development-board > header { background:none!important; }
.bug-development-board > form { display:flex; align-items:flex-end; flex-wrap:wrap; gap:12px; margin:18px 0; }
.bug-development-board > form label { display:grid; gap:8px; flex:1 1 220px; max-width:360px; }
.bug-development-board > form button { width:auto; flex:none; }
.bug-progress-explainer { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin:24px 0; }
.bug-progress-explainer > div { padding:16px; border:1px solid var(--line); border-radius:12px; background:var(--panel); }
.bug-progress-explainer strong { font-size:.86rem; }
.bug-progress-explainer p { color:var(--muted); font-size:.8rem; line-height:1.6; margin:8px 0 0; }
.bug-sync-health { padding:14px 16px; border-inline-start:3px solid #22c55e; background:var(--panel); color:var(--ink); font-size:.8rem; overflow-wrap:anywhere; }
.bug-sync-health.is-stale { border-color:#f59e0b; }
.bug-sync-health span { display:block; color:var(--muted); margin-top:8px; line-height:1.6; }
.bug-development-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin:22px 0; }
.bug-development-grid .github-tracked-issue { display:block; margin:0; padding:20px; border-radius:14px; border-inline-start:3px solid var(--outcome); background:var(--panel); }
.bug-outcome-open { --outcome:#60a5fa; }
.bug-outcome-qa { --outcome:#fbbf24; }
.bug-outcome-closed { --outcome:#a1a1aa; }
.bug-outcome-label { color:var(--outcome); font-size:.73rem; font-weight:750; }
.bug-development-grid h3 { margin:12px 0; font-size:1.05rem; line-height:1.5; overflow-wrap:anywhere; }
.bug-development-grid p,.bug-development-grid small { color:var(--muted); font-size:.8rem; line-height:1.6; overflow-wrap:anywhere; }
.bug-development-grid .secondary-link { display:inline-flex; margin-top:16px; }
html[data-theme="light"] .bug-priority-urgent { --bug-priority:#b91c1c; }
html[data-theme="light"] .bug-priority-high { --bug-priority:#9a3412; }
html[data-theme="light"] .bug-priority-normal { --bug-priority:#1d4ed8; }
html[data-theme="light"] .bug-priority-low { --bug-priority:#52525b; }
html[data-theme="light"] .bug-status-open { color:#1d4ed8; }
html[data-theme="light"] .bug-status-reviewing { color:#92400e; }
html[data-theme="light"] .bug-status-resolved { color:#166534; }
html[data-theme="light"] .bug-outcome-open { --outcome:#1d4ed8; }
html[data-theme="light"] .bug-outcome-qa { --outcome:#92400e; }
html[data-theme="light"] .bug-outcome-closed { --outcome:#52525b; }
.bug-synced-outcome { margin-top:18px; padding:16px; border:1px solid var(--line); border-radius:12px; background:var(--panel); }
.bug-synced-outcome p { color:var(--muted); font-size:.83rem; line-height:1.6; }
@media(max-width:720px) { .bug-section-nav { flex-direction:column; } .bug-progress-explainer,.bug-development-grid { grid-template-columns:minmax(0,1fr); } }
html[data-theme="light"] .bug-report-controls .feedback-tabs button.active { color:#8e2532; }
@media(max-width:720px) { .bug-workflow-guide { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; padding:14px; } .bug-workflow-guide strong { grid-column:1/-1; } .bug-report-controls .feedback-tabs { flex-basis:100%; } .bug-report-controls .feedback-tabs button { padding:10px; font-size:.8rem; } }
.bug-report-controls { display:flex; flex-wrap:wrap; align-items:flex-end; gap:18px; margin-bottom:24px; }
.bug-report-controls .feedback-tabs { flex:1 1 300px; margin:0; }
.bug-report-controls > label { display:grid; gap:8px; flex:1 1 180px; color:var(--muted); font-size:.8rem; }
.bug-report-controls > label input,.bug-report-controls > label select { width:100%; }
.bug-report-list > article { background:var(--panel); }
.bug-report-list > article h2 { margin:16px 0 8px; font-size:1.2rem; line-height:1.4; overflow-wrap:anywhere; }
.bug-report-details { margin:18px 0; }
.bug-report-details > summary,.bug-development-review > summary,.bug-development-tracking > summary { cursor:pointer; font-weight:700; line-height:1.5; }
.bug-report-details > div { padding-top:12px; line-height:1.65; overflow-wrap:anywhere; }
.bug-report-list .bug-status-form { display:flex; flex-wrap:wrap; align-items:flex-end; gap:12px; margin:20px 0; }
.bug-status-form label { display:grid; gap:8px; color:var(--muted); font-size:.8rem; }
.bug-development-state,.bug-development-review { margin-top:20px; padding-top:18px; border-top:1px solid var(--line); }
.bug-development-state p,.bug-handoff-note,.bug-development-review > p { color:var(--muted); font-size:.83rem; line-height:1.6; }
.bug-report-list .bug-development-review form { display:grid; gap:16px; margin-top:16px; }
.bug-development-review label:not(.checkbox-row) { display:grid; gap:8px; }
.bug-development-review .checkbox-row { display:flex; align-items:flex-start; gap:10px; font-size:.85rem; line-height:1.5; }
.bug-development-review .checkbox-row input { flex:none; width:18px; min-height:18px; margin-top:3px; }
.bug-approval-actions,.bug-composer-actions { display:flex; flex-wrap:wrap; gap:12px; }
.bug-approval-actions > button,.bug-composer-actions > button { justify-content:center; }
.bug-development-tracking { margin:28px 0; border-top:1px solid var(--line); padding-top:22px; }
.bug-filter-empty { padding:24px; color:var(--muted); }
.bug-report-dialog { width:min(720px,calc(100vw - 32px)); max-height:calc(100dvh - 48px); margin:auto; padding:0; border:1px solid var(--line-hot); border-radius:18px; background:var(--panel); color:var(--ink); overflow:auto; }
.bug-report-dialog::backdrop { background:rgba(0,0,0,.72); }
.bug-report-dialog .bug-report-composer { margin:0; padding:28px; border:0; box-shadow:none; background:var(--panel); }
.bug-report-composer label { display:grid; gap:8px; }
.bug-report-composer > header { align-items:flex-start; gap:16px; }
.bug-report-composer > header > div { min-width:0; }
.bug-report-composer > header > button { flex:none; width:40px; height:40px; }
.bug-report-composer small { color:var(--muted); font-size:.78rem; line-height:1.5; }
.bug-modal-open { overflow:hidden; }
.bug-composer-actions { justify-content:flex-end; }
.bug-detail-panel { padding:28px; }
.bug-detail-panel[hidden] { display:none!important; }
.bug-detail-panel > header { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; }
.bug-detail-panel > header { background:var(--panel)!important; }
.bug-detail-panel > header > div { min-width:0; }
.bug-detail-panel > header h2 { font-size:1.5rem; line-height:1.35; overflow-wrap:anywhere; }
.bug-detail-panel > header p { font-size:.75rem; color:var(--muted); }
.bug-detail-panel > header > button { flex:none; width:40px; height:40px; }
.bug-detail-panel .bug-status-form { display:flex; flex-wrap:wrap; align-items:flex-end; gap:12px; margin:20px 0; }
.bug-detail-panel .bug-development-review form { display:grid; gap:16px; margin-top:16px; }
.bug-detail-panel > button { margin-top:24px; }
.bug-report-list h2 > a { color:var(--ink); text-decoration:none; }
.bug-report-list h2 > a:hover { color:var(--orange); }
.bug-card-open { display:flex; align-items:center; flex-wrap:wrap; gap:16px; margin-top:18px; }
.bug-card-open > span,.bug-delivery-result { color:var(--muted); font-size:.85rem; line-height:1.6; }
@media(max-width:650px) {
  .bug-detail-panel { padding:20px; }
  .bug-report-dialog { width:calc(100vw - 16px); max-height:calc(100dvh - 16px); border-radius:12px; }
  .bug-report-dialog .bug-report-composer { padding:20px; }
  .bug-report-composer .two-fields { grid-template-columns:minmax(0,1fr); }
  .bug-approval-actions { flex-direction:column; }
}

/* Unified GitHub and panel bug queue; no separate development board. */
.bug-source-badge { display:inline-flex; align-items:center; padding:5px 9px; border:1px solid #a78bfa70; border-radius:999px; background:#a78bfa16; color:#c4b5fd; font-size:11px; font-weight:800; letter-spacing:.03em; }
.github-discussion-text { white-space:pre-wrap; overflow-wrap:anywhere; font-family:inherit; line-height:1.65; }
.github-comment { padding:16px; margin:12px 0; border:1px solid var(--border); border-radius:12px; background:var(--surface); }
.github-comment > small { display:block; margin-top:4px; color:var(--muted); }
.bug-source-badge.is-panel { color:var(--muted); background:transparent; border-color:var(--border); }
.bug-priority-pill.bug-priority-unspecified { color:var(--muted); border-color:var(--border); background:transparent; }
.bug-queue-sync { display:flex; align-items:center; gap:16px; margin:18px 0; }
.bug-queue-sync .bug-sync-health { flex:1; margin:0; }
.bug-queue-sync form { flex:none; margin:0; }
.bug-source-filter { display:block; max-width:240px; margin:0 0 16px; }
.bug-report-list > article > header > div { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
html[data-theme="light"] .bug-source-badge { color:#6d28d9; background:#ede9fe; border-color:#c4b5fd; }
@media(max-width:700px) { .bug-queue-sync { flex-direction:column; align-items:stretch; } .bug-source-filter { max-width:none; } }

/* Staff sign-in: calm surfaces, brand color confined to accents. */
.staff-login-page .auth-shell { grid-template-columns:minmax(0,520px); padding:64px 20px; background-image:none; }
.staff-login-page .auth-card { min-height:0; padding:36px; border-radius:24px; background:var(--panel); box-shadow:0 24px 80px rgba(0,0,0,.25); }
.staff-login-page .auth-card::before { height:3px; }
.login-brand-row { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.login-access-badge { flex:none; padding:6px 10px; color:var(--muted); border:1px solid var(--line); border-radius:999px; font-size:.7rem; font-weight:750; }
.staff-login-page .auth-heading { margin:36px 0 16px; background:none; }
.staff-login-page .auth-heading h1 { font-size:clamp(2.3rem,6vw,3.2rem); line-height:1.1; }
.staff-login-page .auth-heading span { margin-top:14px; }
.login-eligibility { margin:0 0 24px; font-size:.85rem; color:var(--muted); line-height:1.65; }
.staff-login-page .auth-discord { display:flex; justify-content:space-between; align-items:center; min-height:50px; border-radius:12px; }
.staff-login-page .local-login-toggle { color:var(--muted); padding:12px; line-height:1.5; }
.staff-login-page .auth-consent { margin:24px 0 0; padding-top:20px; border-top:1px solid var(--line); text-align:left; color:var(--muted); line-height:1.6; }
html[data-theme="light"] .staff-login-page .auth-card { background:#fff; }
@media(max-width:540px) { .staff-login-page .auth-shell { padding:28px 16px 90px; } .staff-login-page .auth-card { padding:24px; border-radius:20px; } .login-access-badge { font-size:.65rem; } }

/* Completed work retains historical priority without competing with active work. */
.bug-report-list > article:is([data-feedback-status="closed"],[data-feedback-status="resolved"]) { border-left-color:var(--line); background:var(--panel); box-shadow:none; }
.bug-report-list > article:is([data-feedback-status="closed"],[data-feedback-status="resolved"]) .bug-priority-pill { color:var(--muted); border-color:var(--line); background:transparent; }
.bug-report-list > article:is([data-feedback-status="closed"],[data-feedback-status="resolved"]) > h2 { color:var(--muted); }

/* Read-only Discord suggestion snapshots; no heading gradients. */
.bot-suggestion-mirror { margin-block: 1.5rem 2rem; padding-block: 1rem; border-block: 1px solid var(--border, #303030); }
.bot-suggestion-card { padding: 1.25rem; border: 1px solid var(--border, #303030); border-radius: 14px; }
.bot-suggestion-card header { display:flex; justify-content:space-between; align-items:start; gap:1rem; flex-wrap:wrap; }
.bot-suggestion-card header > div { display:flex; flex-wrap:wrap; gap:.5rem; }
.bot-suggestion-card p { overflow-wrap:anywhere; }
.bot-suggestion-card[data-suggestion-outcome="approved"] { border-inline-start:3px solid #47b881; }
.bot-suggestion-card[data-suggestion-outcome="rejected"], .bot-suggestion-card[data-suggestion-outcome="resolved"] { opacity:.85; }


/* Compact feedback workspace: neutral surfaces, readable detail text, no suggestion priorities. */
.feedback-page-heading { padding-block:20px; min-height:0; margin-bottom:18px; }
.feedback-page-heading h1 { font-size:clamp(1.8rem,3vw,2.65rem); line-height:1.15; }
.feedback-page-heading > div > span { font-size:.92rem; }
.bug-workflow-help { margin:12px 0 18px; font-size:.82rem; color:var(--muted); }
.bug-workflow-help > summary { cursor:pointer; }
.bug-workflow-help p { max-width:75ch; margin-top:10px; line-height:1.5; }
.bug-queue-heading { margin:16px 0; }
.bug-queue-heading h2 { font-size:1.05rem; margin:0 0 5px; }
.bug-queue-heading p { margin:0; font-size:.82rem; color:var(--muted); }
.bug-report-list { gap:10px; }
.bug-report-list > article { padding:16px 18px; border-radius:12px; min-height:0; }
.bug-report-list > article h2 { font-size:1.05rem; margin:10px 0 4px; }
.bug-report-list > article .bug-report-excerpt { margin:8px 0; font-size:.88rem; line-height:1.45; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.bug-report-list > article .bug-location-context { margin:6px 0; font-size:.78rem; }
.bug-report-list > article .bug-card-open { margin:10px 0 0; gap:10px; }
.bug-report-list > article > p:last-child { margin-bottom:0; }
.bug-report-controls { gap:12px; margin:12px 0; }
.bug-source-filter { max-width:260px; margin:0 0 14px; }
.bug-report-dialog { width:min(680px,calc(100vw - 40px)); max-height:min(800px,84dvh); border-radius:14px; }
.bug-detail-panel, .bug-report-dialog .bug-report-composer { padding:20px; }
.bug-detail-panel > header h2 { font-size:1.25rem; line-height:1.35; margin:4px 0; }
.bug-detail-panel > header { gap:12px; margin-bottom:16px; }
.bug-detail-panel > header p { margin:0 0 5px; }
.bug-detail-panel > header > button { width:34px; height:34px; }
.bug-detail-panel .bug-detail-metadata { margin:8px 0 14px; gap:7px; }
.bug-detail-panel .bug-status-form { margin:14px 0; padding-block:12px; border-block:1px solid var(--line); }
.bug-detail-panel .bug-development-review form { gap:12px; }
.bug-detail-panel .bug-development-review textarea { min-height:130px; }
.github-discussion { display:grid; gap:14px; margin-block:18px; }
.github-description, .github-comments { border:1px solid var(--line); border-radius:10px; padding:12px 14px; }
.github-discussion summary { cursor:pointer; font-size:.9rem; font-weight:700; }
.github-comments summary { display:flex; justify-content:space-between; gap:12px; }
.github-comments summary > span { font-size:.76rem; color:var(--muted); }
.github-discussion-text { white-space:pre-wrap; line-height:1.5; font-size:.88rem; margin:12px 0 0; overflow-wrap:anywhere; }
.github-comment { margin:12px 0 0; padding:12px 0 0; border-top:1px solid var(--line); }
.github-comment header { display:flex; justify-content:space-between; flex-wrap:wrap; gap:8px; font-size:.8rem; }
.github-comment header small { color:var(--muted); }
.feedback-text { white-space:pre-wrap; line-height:1.5; overflow-wrap:anywhere; font-size:.9rem; margin:12px 0; }
.suggestion-guidance { border:1px solid var(--line); border-inline-start:3px solid #5865f2; border-radius:8px; padding:12px 14px; color:var(--muted); font-size:.85rem; line-height:1.5; background:var(--panel); }
.suggestion-guidance strong { color:var(--ink); }
.feedback-section-heading { display:flex; align-items:start; justify-content:space-between; flex-wrap:wrap; gap:12px; margin-bottom:16px; }
.feedback-section-heading h2 { font-size:1.2rem; margin:0 0 5px; }
.feedback-section-heading p { margin:0; color:var(--muted); font-size:.85rem; max-width:75ch; }
.suggestion-controls { display:grid; grid-template-columns:1.25fr 1fr .85fr; align-items:end; gap:12px; margin-block:16px; }
.suggestion-controls label, .suggestion-mirror-controls label { display:grid; gap:7px; color:var(--muted); font-size:.8rem; }
.suggestion-report-list { display:grid; gap:10px; }
.suggestion-report-list > article { padding:16px; border-radius:12px; }
.suggestion-report-list h3 { margin:10px 0 6px; font-size:1.05rem; }
.suggestion-report-list h3 a { color:var(--ink); text-decoration:none; }
.feedback-card-excerpt { color:var(--muted); line-height:1.5; font-size:.87rem; margin:6px 0 12px; }
.feedback-card-footer { display:flex; align-items:center; justify-content:space-between; gap:12px; font-size:.8rem; }
.feedback-card-footer small { color:var(--muted); }
.suggestion-category-manager > summary { cursor:pointer; font-size:.9rem; font-weight:700; }
.suggestion-category-manager form { margin-top:16px; }
.suggestion-composer .suggestion-guidance { margin:12px 0 18px; }
.bot-suggestion-mirror { padding-block:20px; margin-block:22px; }
.suggestion-mirror-controls { display:grid; grid-template-columns:1fr 1fr auto; align-items:end; gap:12px; }
.suggestion-sync-status { display:flex; flex-wrap:wrap; align-items:center; gap:8px 16px; margin:14px 0 8px; font-size:.8rem; color:var(--muted); }
.suggestion-sync-status strong { color:var(--ink); }
.bot-suggestion-list { display:grid; gap:12px; }
.bot-suggestion-card { padding:16px; background:var(--panel); border:1px solid var(--line); border-inline-start:3px solid #5865f2; border-radius:10px; }
.bot-suggestion-card[data-suggestion-outcome="queued"] { border-inline-start-color:#e0ac44; }
.bot-suggestion-card[data-suggestion-outcome="approved"] { border-inline-start-color:#47b881; }
.bot-suggestion-card[data-suggestion-outcome="rejected"] { border-inline-start-color:#d57272; }
.bot-suggestion-card[data-suggestion-outcome="resolved"] { border-inline-start-color:var(--muted); }
.bot-suggestion-card header { display:flex; justify-content:space-between; align-items:start; flex-wrap:wrap; gap:12px; }
.bot-suggestion-card .suggestion-author { display:flex; align-items:center; flex-wrap:nowrap; gap:10px; min-width:0; }
.suggestion-author img, .suggestion-avatar-placeholder { width:44px; height:44px; border-radius:50%; object-fit:cover; flex:none; }
.suggestion-avatar-placeholder { display:grid; place-items:center; background:var(--panel-soft); border:1px solid var(--line); color:var(--muted); font-weight:700; }
.suggestion-author > div { display:grid; gap:3px; min-width:0; }
.suggestion-author strong { overflow-wrap:anywhere; font-size:.92rem; }
.suggestion-author small { color:var(--muted); font-size:.73rem; }
.bot-suggestion-card h3 { font-size:1rem; margin:14px 0 8px; }
.suggestion-outcome { border:1px solid var(--line); padding:4px 8px; border-radius:6px; font-size:.74rem; }
.suggestion-outcome-approved { color:#71cfa0; }
.suggestion-outcome-rejected { color:#ef8e8e; }
.suggestion-outcome-queued { color:#e6bf70; }
.suggestion-decision { border-inline-start:2px solid var(--line); padding-inline-start:12px; margin-top:12px; font-size:.82rem; }
.suggestion-decision p { margin-block:6px; }
.bot-suggestion-card footer { display:flex; align-items:center; flex-wrap:wrap; gap:10px 16px; border-top:1px solid var(--line); padding-top:12px; margin-top:14px; font-size:.76rem; color:var(--muted); }
.suggestion-votes { display:flex; gap:6px; align-items:center; }
.suggestion-votes strong { margin-right:4px; }
.suggestion-votes > span { padding:4px 9px; border-radius:6px; border:1px solid var(--line); font-weight:700; }
.suggestion-votes .vote-up { color:#6cca97; }
.suggestion-votes .vote-down { color:#ea8585; }
.suggestion-profile-unavailable { display:block; font-size:.72rem; color:var(--muted); margin-top:10px; }
.suggestion-full-text summary { cursor:pointer; color:var(--muted); font-size:.82rem; }
.suggestion-pages { display:flex; align-items:center; gap:12px; margin-top:16px; font-size:.82rem; }
@media(max-width:760px) {
  .suggestion-controls, .suggestion-mirror-controls { grid-template-columns:minmax(0,1fr); }
  .feedback-card-footer { align-items:start; flex-wrap:wrap; }
  .bug-report-dialog { width:calc(100vw - 20px); max-height:90dvh; }
  .bug-detail-panel, .bug-report-dialog .bug-report-composer { padding:16px; }
  .feedback-page-heading { gap:14px; }
}


/* Infernis 5.0 - shared Discord-inspired workspace system. */
:root {
  --bg:#2b2d31; --panel:#313338; --panel-2:#383a40; --panel-3:#41434a;
  --ink:#f2f3f5; --muted:#b5bac1; --quiet:#9ca3ad; --line:#45474e;
  --line-hot:#ad5d43; --red:#ff7967; --orange:#ffad78;
  --green:#79dba7; --blue:#9abaff; --purple:#cfafff;
  --workspace-rail:#1e1f22; --workspace-bar:#232428; --workspace-input:#1e1f22;
  --accent-fill:#c5412d; --accent-fill-hover:#a93424; --accent-soft:#4a302e;
  --radius-sm:6px; --radius-md:10px; --radius-lg:12px;
  --surface-glow:none; --panel-shadow:0 8px 24px #0002;
}
html[data-theme="light"] {
  --bg:#f2f3f5; --panel:#fff; --panel-2:#ebedef; --panel-3:#e3e5e8;
  --ink:#232428; --muted:#50545c; --quiet:#616671; --line:#ccd0d6;
  --line-hot:#c78168; --red:#a53225; --orange:#9a3412;
  --green:#166534; --blue:#214f9d; --purple:#6b3296;
  --workspace-rail:#e3e5e8; --workspace-bar:#fff; --workspace-input:#ebedef;
  --accent-fill:#c5412d; --accent-fill-hover:#a93424; --accent-soft:#fce5dc;
  --surface-glow:none; --panel-shadow:0 8px 24px #2324280c;
}
html { scrollbar-color:var(--panel-3) var(--bg); }
body { line-height:1.5; }
::selection { background:#e85d3f66; color:var(--ink); }
.portal-page .portal-sidebar, html[data-theme="light"] .portal-page .portal-sidebar {
  background:var(--workspace-rail)!important; border-right-color:var(--line); padding:20px 14px 14px;
}
.portal-page .portal-sidebar::before { background:var(--accent-fill); width:3px; }
.portal-page .portal-sidebar .identity-card, html[data-theme="light"] .portal-page .portal-sidebar .identity-card {
  background:var(--workspace-bar)!important; border:1px solid var(--line); border-radius:8px; box-shadow:none; min-height:0; padding:12px; margin:18px 0;
}
.portal-page .identity-avatar { border-radius:50%; background:var(--accent-fill); }
.portal-page .portal-sidebar .role-badge { background:var(--accent-soft); color:var(--orange); border-color:var(--line-hot); border-radius:4px; }
.portal-page .portal-sidebar .portal-nav { gap:3px; scrollbar-color:var(--panel-3) transparent; }
.portal-page .portal-sidebar .portal-nav > .nav-link,
.portal-page .portal-sidebar .portal-nav > .nav-folder > summary {
  background:transparent!important; border:1px solid transparent; border-radius:6px; min-height:38px;
  padding:9px 10px; color:var(--muted); font-size:.85rem; font-weight:600; box-shadow:none; transform:none;
}
.portal-page .portal-sidebar .portal-nav > .nav-link:hover,
.portal-page .portal-sidebar .portal-nav > .nav-folder > summary:hover {
  background:var(--panel-2)!important; color:var(--ink); border-color:transparent; transform:none;
}
.portal-page .portal-sidebar .portal-nav > .nav-link[aria-current="page"],
.portal-page .portal-sidebar .portal-nav > .nav-folder[open] > summary {
  background:var(--accent-soft)!important; color:var(--ink); border-color:var(--line-hot);
}
.portal-page .portal-sidebar .portal-nav :is(.nav-link,summary) > span { background:none!important; color:var(--orange)!important; border:0; }
.portal-page .portal-sidebar .nav-link[aria-current="page"]::after { background:var(--orange); width:3px; border-radius:3px; }
.portal-page .nav-folder-links { margin:5px 0 8px 12px; border-inline-start:1px solid var(--line); padding-inline-start:5px; }
.portal-page .nav-folder-links a { padding:7px 9px; font-size:.8rem; border-radius:5px; }
.portal-page .nav-folder-links a:hover, .portal-page .nav-folder-links a[aria-current="page"] { background:var(--panel-2); color:var(--orange); }
.portal-page .portal-main, html:not([data-theme="light"]) .portal-page .portal-main {
  background:var(--bg)!important; background-image:none!important;
}
.portal-page .portal-content::before, .portal-page .portal-content::after { display:none; }
.portal-page .portal-topbar, html[data-theme="light"] .portal-page .portal-topbar {
  background:var(--workspace-bar)!important; min-height:64px; padding-inline:clamp(18px,3vw,36px); gap:16px; border-color:var(--line);
}
.portal-page .portal-topbar > div span { letter-spacing:.08em; font-size:.64rem; color:var(--muted); }
.portal-page .portal-topbar > div strong { font-size:.8rem; margin-top:2px; }
.portal-page .portal-content { width:min(calc(100% - 2 * clamp(18px,3vw,36px)),1500px); padding:28px 0 76px; }
.portal-page .page-heading, .portal-page .page-heading.compact {
  min-height:0; margin:0 0 24px; padding:0 0 20px; gap:16px; border-left:0; border-bottom:1px solid var(--line); background:none!important;
}
.portal-page .page-heading > div { background:none!important; padding:0; }
.portal-page .page-heading h1 { font-size:clamp(1.75rem,3vw,2.5rem); line-height:1.15; letter-spacing:-.035em; }
.portal-page .page-heading > div > p { color:var(--orange); font-size:.67rem; letter-spacing:.11em; margin:0 0 8px; }
.portal-page .page-heading span { font-size:.9rem; line-height:1.5; }
.portal-page :is(.section-header,.integration-card > header,.profile-card > header,.overview-panel > header) h2 { font-size:clamp(1.15rem,2vw,1.5rem); line-height:1.3; letter-spacing:-.02em; }
.portal-page :is(.action-panel,.overview-panel,.profile-card,.integration-card,.document-reader,.activity-panel,.guide-list-card,.quiz-admin,.quiz-my-list,.quiz-card-grid > article,.member-directory-row,.role-card,.vault-row,.task-card,.calendar-event,.bot-conversation,.bot-module-policy,.bot-workflow-history,.github-project-row) {
  background:var(--panel)!important; background-image:none!important; border-color:var(--line); border-radius:10px; box-shadow:none;
}
.portal-page :is(.profile-card,.integration-card,.overview-panel,.activity-panel,.action-panel) { padding:20px; }
.portal-page .portal-content :is(header,.section-header,.page-heading,.bot-heading,.member-role-heading) { background:transparent!important; background-image:none!important; }
.portal-page .metric-grid { margin-top:24px; gap:12px; border:0; background:none; }
.portal-page .metric-grid article { min-height:128px; padding:18px; background:var(--panel)!important; border:1px solid var(--line)!important; border-radius:8px; }
.portal-page .metric-grid article::after { display:none; }
.portal-page .metric-grid strong { font-size:1.9rem; }
.portal-page :is(.metric-grid article,.quiz-card-grid > article,.member-directory-row):hover { transform:none; background:var(--panel-2)!important; }
.portal-page :is(input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),select,textarea),
.auth-page :is(input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),select,textarea) {
  background:var(--workspace-input)!important; color:var(--ink); border:1px solid var(--line); border-radius:6px; box-shadow:none;
}
.portal-page :is(input:not([type="checkbox"]):not([type="radio"]),select), .auth-page :is(input:not([type="checkbox"]):not([type="radio"]),select) { min-height:38px; padding:9px 11px; }
.portal-page :is(input[type="checkbox"],input[type="radio"]), .auth-page :is(input[type="checkbox"],input[type="radio"]) { accent-color:var(--accent-fill); }
.portal-page :is(.primary-button,.primary-link,.publish-button), .auth-page :is(.primary-button,.primary-link) {
  background:var(--accent-fill)!important; color:#fff!important; border:1px solid var(--accent-fill); border-radius:6px; box-shadow:none; min-height:38px; padding:9px 14px; font-size:.86rem; font-weight:650; transform:none;
}
.portal-page :is(.primary-button,.primary-link,.publish-button):hover, .auth-page :is(.primary-button,.primary-link):hover { background:var(--accent-fill-hover)!important; border-color:var(--accent-fill-hover); transform:none; box-shadow:none; }
.portal-page :is(.secondary-button,.secondary-link,.quiet-button,.icon-button,.command-trigger), .auth-page :is(.secondary-button,.secondary-link,.quiet-button) {
  background:var(--panel-2); color:var(--ink); border:1px solid var(--line); border-radius:6px; box-shadow:none; font-weight:600;
}
.portal-page :is(.secondary-button,.secondary-link,.quiet-button) { min-height:36px; padding:8px 12px; font-size:.82rem; }
.portal-page :is(.secondary-button,.secondary-link,.quiet-button,.command-trigger):hover { background:var(--panel-3); border-color:var(--line-hot); transform:none; }
.portal-page :is(button,a,summary,input,select,textarea):focus-visible, .auth-page :is(button,a,summary,input,select,textarea):focus-visible { outline:2px solid var(--orange)!important; outline-offset:3px; box-shadow:none; }
.portal-page button:disabled { opacity:.55; cursor:not-allowed; }
.portal-page :is(.section-tabs,.settings-tabs) { background:var(--workspace-bar); border:1px solid var(--line); border-radius:8px; padding:4px; gap:4px; }
.portal-page :is(.section-tabs,.settings-tabs) :is(a,button) { border-radius:5px; padding:9px 12px; background:none; color:var(--muted); font-size:.85rem; }
.portal-page :is(.section-tabs,.settings-tabs) :is(a,button):is(.active,[aria-current="page"],[aria-selected="true"]) { background:var(--accent-soft)!important; color:var(--ink); border-color:var(--line-hot); }
.portal-page :is(.section-tabs,.settings-tabs) :is(a,button):hover { background:var(--panel-2); }
.portal-page :is(.form-note,.github-help,.empty-state) { background:var(--panel); border-color:var(--line); color:var(--muted); border-radius:6px; }
.portal-page .alert, .auth-page .alert { background:var(--accent-soft); color:var(--ink); border:1px solid var(--line-hot); border-inline-start:3px solid var(--orange); border-radius:6px; }
.portal-page :is(table,fieldset) { border-color:var(--line); }
.portal-page table :is(th,td) { border-color:var(--line); }
.portal-page table th { background:var(--workspace-bar); color:var(--muted); }
.portal-page .document-reader { padding:clamp(20px,4vw,40px); }
.portal-page .document-reader > header h1 { font-size:clamp(1.8rem,4vw,3rem); line-height:1.15; }
.portal-page .document-reader .prose { line-height:1.75; }
.portal-page .editor-workspace, .portal-page .editor-toolbar, .portal-page .selection-editor-toolbar { background:var(--panel); border-color:var(--line); box-shadow:none; }
.portal-page .month-calendar { background:var(--panel); border-color:var(--line); border-radius:10px; }
.portal-page .month-calendar :is(.month-day,.month-weekday) { border-color:var(--line); }
.portal-page .month-day-empty { background:var(--workspace-bar); }
.portal-page .month-calendar nav a { color:var(--ink); border-color:var(--line); border-radius:6px; }
.portal-page .month-calendar .month-entry { background:var(--accent-soft); color:var(--ink); }
.portal-page .bot-health, .portal-page .bot-sync-health, .portal-page .portal-role-map-help { background:var(--panel); background-image:none; border-color:var(--line); border-radius:8px; }
dialog:not(.image-lightbox), .portal-page :is(.bug-detail-panel,.bug-report-composer,.bot-popup-panel,.command-palette) { background:var(--panel)!important; color:var(--ink); border-color:var(--line); border-radius:10px; box-shadow:var(--panel-shadow); }
dialog::backdrop { background:#0009; backdrop-filter:none; }
.auth-page, .staff-login-page { background:var(--bg)!important; background-image:none!important; }
.auth-shell, .staff-login-shell { background:none!important; background-image:none!important; }
.auth-page .auth-card, .staff-login-page .auth-card { background:var(--panel)!important; border:1px solid var(--line); border-radius:12px; box-shadow:var(--panel-shadow); }
.auth-page .auth-card::before { background:var(--accent-fill); }
.auth-page .auth-heading h1 { font-size:clamp(1.8rem,4vw,2.6rem); line-height:1.15; }
.auth-page .auth-command-rail, .guide-ack-card, .terms-card { background:var(--panel); border-color:var(--line); border-radius:10px; }
.portal-page .suggestion-card { background:var(--panel)!important; border-radius:8px; border-color:var(--line); border-inline-start-color:var(--orange); }
.portal-page .suggestion-card[data-suggestion-outcome="approved"] { border-inline-start-color:var(--green); }
.portal-page .suggestion-card[data-suggestion-outcome="rejected"] { border-inline-start-color:var(--red); }
.portal-page .suggestion-card:is([data-suggestion-outcome="closed"],[data-suggestion-outcome="resolved"]) { border-inline-start-color:var(--quiet); }
.portal-page .suggestion-card .suggestion-card-header { display:flex; justify-content:space-between; align-items:start; gap:12px; margin:0; padding:0; }
.portal-page .suggestion-card .suggestion-card-badges { display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
.portal-page .suggestion-card .suggestion-avatar-placeholder { background:var(--accent-soft); color:var(--orange); border-color:var(--line); }
.portal-page .suggestion-card .suggestion-card-footer { margin-top:14px; padding-top:12px; }
.portal-page .suggestion-card .suggestion-card-footer > .secondary-link { margin-inline-start:auto; }
.portal-page .suggestion-outcome { color:var(--muted); background:var(--panel-2); }
.portal-page .suggestion-outcome-approved, .portal-page .suggestion-votes .vote-up { color:var(--green); }
.portal-page .suggestion-outcome-rejected, .portal-page .suggestion-votes .vote-down { color:var(--red); }
.portal-page .suggestion-outcome-queued { color:var(--orange); }
.portal-page .suggestion-votes .suggestion-votes-unavailable { font-weight:400; color:var(--muted); border:0; padding:0; }
.portal-page .suggestion-guidance { border-inline-start-color:var(--orange); background:var(--panel); }
.portal-page .bug-source-badge { color:var(--orange); background:var(--accent-soft); border-color:var(--line-hot); }
@media(max-width:820px) {
  .portal-page .portal-content { width:calc(100% - 32px); padding-top:20px; }
  .portal-page .portal-topbar { padding-inline:16px; gap:10px; min-height:58px; }
  .portal-page .page-heading { min-height:0; }
  .portal-page :is(.profile-card,.integration-card,.overview-panel,.activity-panel,.action-panel) { padding:16px; }
}
@media(prefers-reduced-motion:reduce) {
  .portal-page *, .auth-page * { scroll-behavior:auto!important; animation:none!important; transition:none!important; }
}

/* Remove legacy decorative washes, including dashboard/auth auxiliary surfaces. */
.portal-page .page-heading::before,
.portal-page :is(.overview-panel,.profile-card,.integration-card,.activity-panel,.clearance-card)::before,
.portal-page :is(.overview-panel,.profile-card,.integration-card,.activity-panel,.clearance-card)::after { display:none; }
.portal-page .clearance-card, html[data-theme="light"] .portal-page .clearance-card { width:min(100%,260px); min-height:112px; padding:18px; background:var(--panel)!important; color:var(--ink); border-color:var(--line); border-radius:8px; font-size:1.15rem; box-shadow:none; }
.portal-page .clearance-card small { color:var(--orange); margin-bottom:8px; }
.portal-page .clearance-card span { color:var(--muted); }
.portal-page .portal-sidebar .identity-avatar { border-radius:50%; }
.portal-page .sidebar-foot { border-color:var(--line)!important; }
.portal-page .staff-assistant-float > summary { background:var(--accent-fill); border-color:var(--accent-fill); border-radius:6px; box-shadow:none; padding:9px 12px; }
.portal-page .staff-assistant-float-panel, .portal-page .ai-document-panel { background:var(--panel)!important; border-color:var(--line); border-radius:10px; }
.portal-page .command-palette-card { background:var(--panel); color:var(--ink); border-color:var(--line); border-radius:10px; }
.portal-page :is(.overview-panel,.activity-panel,.profile-card,.integration-card) > header { padding:0 0 14px; margin:0 0 16px; }
.portal-page .section-tabs button.active { color:var(--ink); }

.portal-page .mini-empty { background:var(--panel)!important; background-image:none!important; min-height:100px; }
.portal-page .profile-avatar.fallback { border-radius:50%; background:var(--accent-fill); box-shadow:none; }
.portal-page .portal-subnav .nav-link { background:none!important; border-radius:5px; padding:8px 10px; color:var(--muted); }
.portal-page .portal-subnav .nav-link[aria-current="page"] { background:var(--accent-soft)!important; color:var(--ink); border-color:var(--line-hot); }
.portal-page .portal-subnav .nav-link:hover { background:var(--panel-2)!important; color:var(--orange); }
.portal-page .suggestion-card { border-inline-start-width:3px; }

/* Protected shares, terms, agreements and first-run screens share the same system. */
.share-page, .terms-page { background:var(--bg)!important; background-image:none!important; color:var(--ink); }
.share-page :is(.share-gate,.document-reader,.shared-file), .terms-page :is(.terms-content,.terms-summary,.terms-accept), .auth-page .guide-ack-card {
  background:var(--panel)!important; border:1px solid var(--line); border-radius:10px; box-shadow:none; color:var(--ink);
}
.share-page :is(.share-gate,.document-reader,.shared-file) { padding:clamp(20px,4vw,40px); }
.share-page :is(.share-gate h1,.document-reader h1,.shared-file h1), .terms-page .terms-header h1 { font-size:clamp(1.8rem,4vw,2.8rem); line-height:1.15; letter-spacing:-.035em; }
.share-page :is(.primary-link,.primary-button), .terms-page :is(.primary-button,.primary-link) { background:var(--accent-fill); border-radius:6px; color:#fff; box-shadow:none; }
.terms-page .terms-summary strong { color:var(--ink); }
.terms-page .terms-content { padding:clamp(20px,4vw,40px); }
.terms-page .terms-accept { backdrop-filter:none; }
.share-page :is(button,a,input):focus-visible, .terms-page :is(button,a,input):focus-visible { outline:2px solid var(--orange); outline-offset:3px; }
.auth-page .guide-ack-card :is(header,.guide-ack-steps,.guide-ack-form) { background:var(--panel); border-color:var(--line); }
.guide-ack-form .guide-previous { flex:0 0 auto; display:inline-flex; align-items:center; justify-content:center; gap:8px; white-space:nowrap; min-height:40px; padding:10px 14px; }
.guide-ack-form form { flex:1 1 0; min-width:0; width:auto; margin:0; }
.guide-ack-form form label { flex:1 1 220px; min-width:0; margin:0; }
.guide-ack-form form label input[type=checkbox] { flex:0 0 auto; min-height:0; height:16px; width:16px; margin:0; padding:0; }
.guide-ack-form form .primary-button { flex:0 0 auto; white-space:nowrap; }
@media(max-width:800px) { .guide-ack-form { flex-wrap:wrap; } .guide-ack-form form { flex-basis:100%; } }
@media(max-width:700px) { .guide-ack-form .guide-previous { align-self:flex-start; } .guide-ack-form form label { flex:0 0 auto; } }
.auth-page .guide-ack-content { background:var(--panel); color:var(--ink); }
@media print {
  .portal-page .portal-main, .portal-page .document-reader, .terms-page .terms-content { background:#fff!important; color:#111!important; }
}

.portal-page .bug-report-dialog .bug-report-composer > header h2,
.portal-page .bug-report-dialog .bug-detail-panel > header h2 { font-size:1.25rem; line-height:1.35; }

:root { --signal:var(--accent-fill); }
html[data-theme="light"] .portal-page .bug-source-badge { color:var(--orange); background:var(--accent-soft); border-color:var(--line-hot); }

/* 5.0.1: deeper black surfaces with red-led Infernis accents. */
:root {
  --bg:#09090b; --panel:#141416; --panel-2:#1d1d20; --panel-3:#27272b;
  --ink:#f4f4f5; --muted:#b8b8c0; --quiet:#a1a1aa; --line:#323237; --line-hot:#671420;
  --red:#ee4848; --orange:var(--red); --accent-fill:#990b1b; --accent-fill-hover:#780815;
  --accent-soft:#290b10; --workspace-rail:#070708; --workspace-bar:#101012; --workspace-input:#0c0c0e;
}
html[data-theme="light"] {
  --bg:#f4f4f5; --panel:#fff; --panel-2:#ededf0; --panel-3:#e4e4e8;
  --ink:#232328; --muted:#52525b; --quiet:#62626c; --line:#cfcfd5; --line-hot:#a64131;
  --red:#990b1b; --orange:var(--red); --accent-fill:#990b1b; --accent-fill-hover:#780815;
  --accent-soft:#f5e3e1; --workspace-rail:#e4e4e8; --workspace-bar:#fff; --workspace-input:#ededf0;
}

/* Cohesive workspace: flat reading surfaces, connected lists and one spacing scale. */
.portal-page :is(.ai-workspace,.ai-guardrails,.priority-work-panel,.task-detail-panel,.staff-channel-panel) {
  background:var(--panel)!important; background-image:none!important; border-color:var(--line); border-radius:var(--radius-md); box-shadow:none;
}
.portal-page :is(.profile-card,.integration-card,.overview-panel,.activity-panel,.action-panel) { padding:24px; }
.portal-page :is(.overview-panel,.activity-panel,.profile-card,.integration-card) > header { margin:0 0 16px; padding:0 0 16px; gap:12px; }
.portal-page .priority-work-panel > header { align-items:center; gap:8px 16px; }
.portal-page .priority-work-panel > header > h2 { font-size:clamp(1.2rem,2vw,1.5rem); line-height:1.3; }
.portal-page .priority-work-panel > p { padding:0; margin:0 0 16px; }
.portal-page .operation-list { padding:0; gap:0; }
.portal-page .operation-list article {
  padding:16px 0; border:0; border-bottom:1px solid var(--line); border-radius:0;
  background:transparent!important; background-image:none!important; box-shadow:none; transform:none; transition:none;
}
.portal-page .operation-list article:first-child { padding-top:0; }
.portal-page .operation-list article:last-child { border-bottom:0; padding-bottom:0; }
.portal-page .operation-list article:hover { background:transparent!important; transform:none; }
.portal-page .operation-list article > div { gap:6px; }
.portal-page .operation-list strong { font-size:.95rem; line-height:1.5; }
.portal-page .operation-list a { color:var(--red); }
.portal-page .operation-list strong > a { color:var(--ink); }
.portal-page .operation-list .queue-rank { background:var(--panel-2); border-radius:var(--radius-sm); }
.portal-page .queue-repeat, html[data-theme="light"] .portal-page .queue-repeat { background:var(--accent-soft); color:var(--red)!important; border-radius:var(--radius-sm); }
.portal-page :is(.profile-card,.integration-card,.action-panel) :is(.form-note,.mini-empty) { background:transparent!important; box-shadow:none; }
.portal-page :is(.task-card,.vault-row,.member-directory-row,.quiz-card-grid > article,.suggestion-card) { border-radius:var(--radius-md); }
.portal-page :is(.secondary-button,.secondary-link,.quiet-button,.command-trigger):hover { border-color:var(--line); }
@media(max-width:820px) {
  .portal-page :is(.profile-card,.integration-card,.overview-panel,.activity-panel,.action-panel) { padding:16px; }
  .portal-page .operation-list article { padding-block:14px; }
}

/* Dashboard summary: compact clearance and quieter operations counters. */
.portal-page .portal-content > .page-heading:not(.compact) { padding-bottom:28px; margin-bottom:26px; }
.portal-page .clearance-card, html[data-theme="light"] .portal-page .clearance-card {
  align-self:center; flex:0 1 320px; width:min(100%,320px); min-height:0; padding:24px 26px;
  justify-content:flex-start; gap:14px; font-size:1.15rem; line-height:1.45; border-radius:var(--radius-md);
}
.portal-page .clearance-card small { margin:0; line-height:1.4; }
.portal-page .clearance-card span { margin:0; font-size:.88rem; line-height:1.6; }
.portal-page .attention-counts { display:grid; grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); align-items:stretch; min-height:0; padding:0; gap:12px; }
.portal-page .attention-counts .attention-tile {
  display:grid; grid-template-columns:1fr auto; align-content:start; gap:8px 12px; min-width:0;
  padding:18px; border:1px solid var(--line); border-radius:var(--radius-md); text-decoration:none;
  background:var(--panel-2); color:var(--ink); line-height:1.4; box-shadow:0 3px 8px #0002,inset 0 1px 0 #ffffff0a;
}
.portal-page .attention-counts .attention-value { font-size:1.8rem; line-height:1.1; font-weight:750; }
.portal-page .attention-counts .attention-label { grid-column:1/-1; grid-row:2; font-size:.84rem; }
.portal-page .attention-counts .attention-state { grid-column:2; grid-row:1; align-self:center; font-size:.65rem; font-weight:750; padding:4px 7px; border-radius:4px; background:var(--panel); color:var(--muted); }
.portal-page .attention-counts .attention-open { border-inline-start:3px solid var(--red); }
.portal-page .attention-counts .attention-inactive, html[data-theme="light"] .portal-page .attention-counts .attention-inactive { background:var(--panel); color:var(--quiet); border-color:var(--line); box-shadow:none; }
.portal-page .attention-counts .attention-unread { background:var(--accent-fill); color:#fff; border:2px solid var(--red); box-shadow:0 4px 12px #0003,inset 0 1px 0 #ffffff26; }
.portal-page .attention-counts .attention-unread .attention-state { background:#ffffff26; color:#fff; }
.portal-page .attention-counts a:hover { border-color:var(--red); background:var(--panel-3); color:var(--ink); }
.portal-page .attention-counts a.attention-unread:hover { background:var(--accent-fill-hover); color:#fff; }
.portal-page .attention-strip > header::before, .portal-page .attention-strip > header::after { display:none; }
@media(max-width:700px) {
  .portal-page .clearance-card, html[data-theme="light"] .portal-page .clearance-card { align-self:stretch; flex-basis:auto; width:100%; }
  .portal-page .attention-counts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
  .portal-page .attention-counts .attention-tile { overflow-wrap:anywhere; padding:16px; }
}
@media(max-width:420px) { .portal-page .attention-counts { grid-template-columns:1fr; } }

/* 5.2: compact controls and progressive disclosure, without hiding primary alerts. */
.portal-page :is(.secondary-button,.secondary-link,.quiet-button,.command-trigger) { min-height:34px; padding:7px 11px; font-size:.8rem; border-radius:5px; background:var(--panel); }
.portal-page :is(.primary-button,.primary-link,.publish-button) { border-radius:5px; min-height:36px; padding:8px 13px; }
.portal-page .workspace-disclosure { align-self:start; }
.portal-page .workspace-disclosure > summary { display:flex; align-items:center; gap:12px; min-height:36px; cursor:pointer; list-style:none; font-weight:700; font-size:.94rem; }
.portal-page .workspace-disclosure > summary small { margin-inline-start:auto; font-size:.75rem; font-weight:400; color:var(--muted); }
.portal-page :is(.workspace-disclosure,.workspace-action-menu,.task-tag-controls) > summary::-webkit-details-marker { display:none; }
.portal-page :is(.workspace-disclosure,.workspace-action-menu,.task-tag-controls) > summary::after { content:'›'; display:inline-block; font-size:1.2rem; line-height:1; color:var(--muted); }
.portal-page :is(.workspace-disclosure,.workspace-action-menu,.task-tag-controls)[open] > summary::after { transform:rotate(90deg); }
.portal-page .workspace-disclosure[open] > summary { padding-bottom:16px; border-bottom:1px solid var(--line); }
.portal-page .workspace-disclosure-body { padding-top:12px; }
.portal-page .workspace-section-actions { display:flex; justify-content:flex-end; padding-top:16px; margin-top:12px; border-top:1px solid var(--line); }
.portal-page .workspace-action-menu > summary, .portal-page .task-tag-controls > summary { display:inline-flex; align-items:center; justify-content:space-between; gap:12px; list-style:none; padding:8px 11px; min-height:34px; border:1px solid var(--line); border-radius:5px; background:var(--panel); color:var(--ink); cursor:pointer; font-size:.8rem; font-weight:600; }
.portal-page :is(.workspace-action-menu,.task-tag-controls) > summary:hover { background:var(--panel-2); }
.portal-page .workspace-action-menu-body { display:grid; gap:12px; padding:14px; margin-top:8px; border:1px solid var(--line); border-radius:6px; background:var(--panel-2); }
.portal-page .workspace-action-menu-body form { flex-wrap:wrap; gap:8px; }
.portal-page .workspace-action-menu-body select { max-width:100%; }
.portal-page .workspace-action-menu:not([open]) > .workspace-action-menu-body, .portal-page .workspace-disclosure:not([open]) > .workspace-disclosure-body { display:none; }
.portal-page .task-row { gap:16px; padding-block:18px; }
.portal-page .operation-list article { padding-block:14px; }
@media(max-width:800px) { .portal-page .workspace-action-menu, .portal-page .workspace-action-menu-body { width:100%; } .portal-page .workspace-action-menu-body form { align-items:stretch; flex-direction:column; } }

/* 5.2.1: scannable task workbench, with detail and actions on demand. */
.portal-page .task-shell { background:var(--panel); border:1px solid var(--line); border-radius:10px; overflow:visible; }
.portal-page .task-shell > header { padding:20px 22px; margin:0; align-items:center; gap:16px; border-bottom:1px solid var(--line); }
.portal-page .task-shell > header h2 { font-size:1.3rem; margin:4px 0 8px; }
.portal-page .task-toolbar { display:flex; align-items:end; flex-wrap:wrap; gap:12px; padding:16px 22px; border-bottom:1px solid var(--line); background:var(--workspace-bar); }
.portal-page .task-search { flex:1 1 260px; max-width:520px; }
.portal-page .task-toolbar label > span { display:block; margin-bottom:6px; color:var(--muted); font-size:.75rem; }
.portal-page .task-filter-menu { min-width:100px; }
.portal-page :is(.task-filter-menu,.task-row-details) > summary { cursor:pointer; list-style:none; font-size:.8rem; color:var(--muted); }
.portal-page .task-filter-menu > summary { padding:9px 12px; min-height:38px; border:1px solid var(--line); border-radius:5px; background:var(--panel); color:var(--ink); }
.portal-page :is(.task-filter-menu,.task-row-details) > summary::-webkit-details-marker { display:none; }
.portal-page :is(.task-filter-menu,.task-row-details) > summary::after { content:'›'; display:inline-block; margin-left:10px; }
.portal-page :is(.task-filter-menu,.task-row-details)[open] > summary::after { transform:rotate(90deg); }
.portal-page .task-filter-fields { display:flex; flex-wrap:wrap; gap:12px; padding:14px 0 0; }
.portal-page .task-filter-fields label { flex:1 1 130px; }
.portal-page .task-filter-result { margin-left:auto; color:var(--muted); font-size:.78rem; padding-bottom:10px; }
.portal-page .task-row { padding:16px 22px; gap:12px; align-items:start; }
.portal-page .task-marker { padding-top:6px; }
.portal-page .task-marker span { width:7px; height:7px; box-shadow:none; }
.portal-page .task-copy h3 { font-size:.96rem; line-height:1.45; margin:5px 0 7px; }
.portal-page .task-copy h3 a { text-decoration:none; }
.portal-page .task-copy h3 a:hover { text-decoration:underline; }
.portal-page .task-copy .task-row-meta { display:flex; align-items:center; flex-wrap:wrap; gap:8px 14px; color:var(--muted); font-size:.76rem; }
.portal-page .task-row-meta .task-owner { color:var(--ink); font-weight:650; }
.portal-page .task-row-details { margin-top:10px; }
.portal-page .task-row-details > summary { width:fit-content; padding:3px 0; }
.portal-page .task-description { margin-top:10px; padding:12px 14px; border-inline-start:2px solid var(--line); background:var(--panel-2); overflow-wrap:anywhere; }
.portal-page .task-description p { font-size:.85rem; line-height:1.65; }
.portal-page .task-reference { display:inline-block; padding:1px 6px; border:1px solid var(--line); border-radius:4px; background:var(--panel); color:var(--red); text-decoration:none; }
.portal-page .task-reference:hover { border-color:var(--red); }
.portal-page .task-filter-empty { padding:24px; color:var(--muted); }
.portal-page .task-list:target { outline:none; }
.portal-page .queue-focus-note { background:var(--panel); border-color:var(--line); border-inline-start:3px solid var(--red); color:var(--muted); }
.portal-page .queue-focus-note :is(strong,a) { color:var(--red); }
.portal-page .task-row[hidden], .portal-page [data-task-filters][hidden], .portal-page [data-task-filter-empty][hidden] { display:none!important; }
@media(max-width:800px) { .portal-page .task-toolbar,.portal-page .task-row,.portal-page .task-shell > header { padding-inline:16px; } .portal-page .task-filter-fields { flex-direction:column; } .portal-page .task-filter-fields label { flex-basis:auto; } .portal-page .task-filter-result { margin-left:0; } }

/* AI-only action accents: headings and reading surfaces stay flat. */
.portal-page .mini-list > a { grid-template-columns:32px minmax(0,1fr) auto; padding:14px 0; border-radius:0; background:transparent; transform:none; }
.portal-page .mini-list > a:hover { background:transparent; transform:none; }
.portal-page .mini-list > a > .resource-icon { width:32px; height:32px; color:var(--muted); background:none; border:0; border-radius:0; box-shadow:none; }
.portal-page .resource-icon svg { display:block; width:24px; height:24px; }
.portal-page .mini-list > a:hover .resource-icon { color:var(--red); }
.portal-page .mini-list > a > div { min-width:0; overflow-wrap:anywhere; }
.portal-page :is(.staff-assistant-float > summary,.selection-ai-button,.ai-workspace .primary-button,.staff-assistant-float-panel .primary-button,[data-ai-document-generate],[data-ai-quiz-generate]) {
  background:linear-gradient(115deg,#780815,#b21d39)!important; color:#fff!important; border-color:#b21d39; box-shadow:none;
}
.portal-page :is(.staff-assistant-float > summary,.selection-ai-button,.ai-workspace .primary-button,.staff-assistant-float-panel .primary-button,[data-ai-document-generate],[data-ai-quiz-generate]):hover {
  background:linear-gradient(115deg,#650712,#990b1b)!important; color:#fff!important; border-color:#990b1b;
}
.portal-page .editor-ai-drawer > summary span { color:var(--muted); }
.portal-page :is(.identity-avatar,.profile-avatar,.minecraft-skin-avatar,.status-dot,.activity-signal) { box-shadow:none; filter:none; text-shadow:none; }
.portal-page .secure-workspace .status-dot { animation:none; }

/* Authoritative suggestion merge presentation; no new staff actions. */
.suggestion-merge-badge { color:var(--red); background:var(--accent-soft); border:1px solid var(--line-hot); border-radius:5px; padding:4px 8px; font-size:.75rem; font-weight:750; }
.suggestion-card-header h3 { margin:0 0 4px; }
.suggestion-contributions { display:grid; gap:12px; margin:16px 0; }
.suggestion-contribution { padding:14px; border:1px solid var(--line); border-radius:8px; background:var(--panel-2); min-width:0; }
.suggestion-contribution .suggestion-card-footer { border-top:0; padding-top:6px; }
.suggestion-original-history { margin-top:8px; color:var(--muted); font-size:.8rem; }
.suggestion-merge-history { margin:20px 0; border-top:1px solid var(--line); padding-top:16px; }
.suggestion-merge-history article { margin-top:10px; }
.suggestion-merge-history p { overflow-wrap:anywhere; }

/* Suggestion health: separate controls, context and cards without boxed clutter. */
.suggestion-mirror-controls {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;align-items:end;gap:16px;margin-bottom:20px}
.suggestion-sync-status {padding:12px 0;margin:0 0 12px;border-bottom:1px solid var(--line);gap:10px 20px;line-height:1.6}
.suggestion-sync-context {display:grid;gap:10px;margin:0 0 20px}
.suggestion-sync-context .form-note {margin:0;padding:0;border:0;border-radius:0;background:none;line-height:1.6}
.feedback-markdown {font-size:inherit;overflow-wrap:anywhere;min-width:0}
.feedback-markdown p {margin:8px 0}
.feedback-markdown pre {overflow:auto;max-width:100%;padding:12px;background:var(--panel);border:1px solid var(--line);border-radius:6px}
@media(max-width:650px){.suggestion-mirror-controls{grid-template-columns:1fr}.suggestion-mirror-controls button{width:100%}.suggestion-sync-status{align-items:flex-start;flex-direction:column}}


/* Compact merged suggestions: original contributions stay visible, diagnostics fold away. */
.suggestion-merge-heading > div:first-child {display:flex;flex-direction:column;gap:4px;min-width:0}
.suggestion-merge-heading h3 {font-size:1.05rem;line-height:1.4;margin:0}
.suggestion-contributions-compact {gap:0;margin:16px 0;border:1px solid var(--line);border-radius:8px;overflow:hidden;background:var(--panel)}
.suggestion-contributions-compact .suggestion-contribution {border:0;border-radius:0;background:none;padding:14px 16px}
.suggestion-contributions-compact .suggestion-contribution + .suggestion-contribution {border-top:1px solid var(--line)}
.suggestion-contributions-compact .suggestion-author img,.suggestion-contributions-compact .suggestion-avatar-placeholder {width:32px;height:32px;min-width:32px}
.suggestion-contributions-compact .suggestion-card-header {align-items:center;margin-bottom:8px}
.suggestion-contributions-compact h3 {font-size:.9rem;margin:8px 0}
.suggestion-contributions-compact .feedback-markdown p {margin:6px 0}
.suggestion-contributions-compact .suggestion-outcome {font-size:.7rem}
.suggestion-contribution-date {margin-top:8px;font-size:.72rem;color:var(--muted)}
.suggestion-merge-footer {justify-content:space-between;gap:10px 16px}
.suggestion-merge-details {margin-top:12px;border-top:1px solid var(--line);padding-top:12px;font-size:.8rem;color:var(--muted)}
.suggestion-merge-details summary {cursor:pointer;width:fit-content}
.suggestion-merge-details > .form-note {margin:12px 0;padding:0;border:0;background:none}
.suggestion-merge-snapshot {margin:12px 0}
.suggestion-merge-snapshot dl {display:flex;flex-wrap:wrap;gap:8px 24px;margin:8px 0}
.suggestion-merge-snapshot dl div {display:flex;gap:8px}
.suggestion-merge-snapshot dd {margin:0}
.suggestion-merge-snapshot ul {margin:8px 0;padding-left:20px}
@media(max-width:650px){.suggestion-contributions-compact .suggestion-contribution{padding:12px}.suggestion-merge-footer{align-items:flex-start;flex-direction:column}.suggestion-merge-heading{align-items:flex-start}}


/* 5.0.5: permitted GitHub labels, full-cache totals and explicit follow-ups. */
.github-display-label { display:inline-flex; align-items:center; border:1px solid var(--line); border-radius:5px; padding:3px 8px; color:var(--muted); background:var(--panel-soft); font-size:.72rem; font-weight:650; line-height:1.4; }
.github-total-counts { margin:12px 0; padding:12px 14px; border:1px solid var(--line); border-radius:8px; color:var(--muted); font-size:.85rem; line-height:1.6; }
.github-total-counts strong { color:var(--text); }
.github-label-settings { padding:16px; border:1px solid var(--line); border-radius:8px; display:grid; gap:10px; min-width:0; }
.github-label-settings label, .github-panel-comments label { display:grid; gap:6px; }
.github-panel-comments { border-top:1px solid var(--line); margin-top:16px; padding-top:16px; }
.github-panel-comments h3 { font-size:1rem; margin:0 0 12px; }
.github-panel-comments form { display:grid; gap:12px; }
.github-panel-comments .checkbox-row { display:flex; align-items:flex-start; }
.github-panel-comments textarea { min-height:96px; resize:vertical; }
.github-panel-comments button, .github-label-settings button { justify-self:start; }

.github-panel-comments .checkbox-row input[type="checkbox"] { width:18px; min-width:18px; max-width:18px; height:18px; min-height:18px; flex:0 0 18px; padding:0; margin:2px 0 0; }

/* 5.0.6: readable GitHub discussion and a compact, explicit delivery composer. */
.portal-page .bug-detail-dialog { width:min(1000px,calc(100vw - 40px)); max-height:90dvh; padding:0; }
.portal-page .bug-detail-dialog .bug-detail-panel { padding:0 24px 24px; }
.portal-page .bug-detail-dialog .bug-detail-panel > header { position:sticky; top:0; z-index:3; padding:20px 24px 16px; margin:0 -24px; background:var(--panel)!important; border-bottom:1px solid var(--line); }
.portal-page .bug-detail-dialog .bug-detail-panel > header h2 { max-width:72ch; font-size:1.18rem; }
.github-issue-workspace { display:grid; grid-template-columns:minmax(0,1.65fr) minmax(270px,1fr); gap:20px; align-items:start; padding-block:20px; }
.github-issue-workspace .github-discussion { margin:0; gap:18px; min-width:0; }
.github-description, .github-comments { border-radius:8px; padding:16px; background:var(--workspace-input); }
.github-discussion .github-markdown { white-space:normal; font-size:.92rem; line-height:1.7; color:var(--ink); }
.github-markdown > :first-child { margin-top:0; }
.github-markdown > :last-child { margin-bottom:0; }
.github-markdown p { margin:12px 0; }
.github-markdown :is(h2,h3,h4,h5,h6) { margin:22px 0 10px; font-size:1rem; line-height:1.4; color:var(--ink); border:0; background:none; padding:0; }
.github-markdown :is(ul,ol) { padding-inline-start:22px; margin:10px 0; }
.github-markdown li { margin:5px 0; }
.github-markdown blockquote { margin:12px 0; padding:8px 12px; border-inline-start:3px solid var(--accent-fill); color:var(--muted); }
.github-markdown pre { overflow:auto; padding:12px; border:1px solid var(--line); border-radius:6px; background:var(--panel); white-space:pre; }
.github-markdown code { font-size:.86em; background:var(--panel-2); padding:2px 4px; border-radius:3px; }
.github-markdown pre code { padding:0; background:none; }
.github-comment { border:1px solid var(--line); border-radius:8px; background:var(--panel); padding:14px; margin-top:12px; }
.github-comment > header { align-items:center; justify-content:flex-start; gap:8px; }
.github-comment > header time { margin-inline-start:auto; color:var(--muted); font-size:.74rem; }
.github-comment-mark { width:24px; height:24px; display:grid; place-items:center; background:var(--panel-2); border-radius:50%; }
.github-comment-empty { padding:16px 0 4px; margin:0; color:var(--muted); font-size:.85rem; line-height:1.6; }
.github-issue-number { display:inline-block; font-size:.75em; font-weight:500; color:var(--muted); margin-inline-start:6px; white-space:nowrap; }
a.github-issue-number:hover { color:var(--red); text-decoration:underline; }
.github-issue-workspace .github-panel-comments { margin:0; border:1px solid var(--line); border-top:3px solid var(--accent-fill); border-radius:8px; padding:16px; background:var(--panel); }
.github-panel-comments > header > p { margin:0 0 6px; font-size:.62rem; color:var(--muted); letter-spacing:.1em; font-weight:700; }
.github-panel-comments h3 { font-size:1.05rem; margin:0 0 12px; }
.github-panel-comments .github-posting-as { margin:0; font-size:.8rem; line-height:1.5; color:var(--muted); }
.github-panel-comments .github-posting-as strong { color:var(--ink); }
.github-panel-comments textarea { font:inherit; font-size:.9rem; line-height:1.55; min-height:130px; }
.github-panel-comments .checkbox-row { gap:9px; font-size:.8rem; line-height:1.5; }
.github-composer-hint { display:flex; justify-content:space-between; gap:8px; margin-top:-5px; color:var(--muted); font-size:.68rem; }
.github-panel-comments [data-github-deliveries] { max-height:130px; overflow:auto; }
.github-delivery-state, .github-panel-comments [data-github-deliveries] > p { padding:9px 10px; margin:0 0 10px; border-inline-start:2px solid var(--line); background:var(--panel-2); border-radius:4px; font-size:.76rem; line-height:1.45; }
.github-delivery-state[data-state="published"] { border-color:var(--green); }
.github-delivery-state[data-state="needs_review"] { border-color:#b87827; }
.github-comment-result { margin:0; padding:12px; border:1px solid var(--line); border-radius:6px; line-height:1.5; font-size:.82rem; background:var(--panel-2); }
.github-comment-result[data-state="failed"], .github-comment-result[data-state="unconfirmed"] { border-color:var(--line-hot); }
.github-refresh-progress { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:7px 14px; border:1px solid var(--line); border-inline-start:3px solid var(--accent-fill); border-radius:8px; padding:12px 14px; margin:12px 0; background:var(--panel); font-size:.84rem; }
.github-refresh-progress > span { grid-column:1/-1; color:var(--muted); font-size:.78rem; line-height:1.5; }
.github-refresh-progress progress { width:120px; height:8px; accent-color:var(--accent-fill); align-self:center; }
.github-refresh-progress[data-state="completed"] { border-inline-start-color:var(--green); }
.github-refresh-progress[data-state="failed"] { border-inline-start-color:#b87827; }
@media (max-width:820px) {
 .github-issue-workspace { grid-template-columns:1fr; gap:16px; }
 .portal-page .bug-detail-dialog { width:calc(100vw - 20px); max-height:92dvh; }
 .portal-page .bug-detail-dialog .bug-detail-panel { padding-inline:16px; }
 .portal-page .bug-detail-dialog .bug-detail-panel > header { padding-inline:16px; margin-inline:-16px; }
 .github-comment > header time { width:100%; margin-inline-start:32px; }
}

/* Private intake archive: source identities, readable transcripts, no public-vault sharing. */
.intake-filters { display:grid; grid-template-columns:repeat(3,minmax(150px,1fr)) minmax(200px,2fr) auto; gap:14px; align-items:end; margin:24px 0 16px; }
.bug-share-link { display:flex; flex-wrap:wrap; align-items:center; gap:12px; margin:0 0 18px; font-size:13px; }
.bug-share-link small { color:var(--muted); }
a.github-issue-number { text-decoration:underline; text-underline-offset:3px; color:var(--ink); }
a.github-display-label { text-decoration:none; }
a.github-display-label:hover,a.github-display-label:focus-visible { text-decoration:underline; outline:1px solid currentColor; }
.bug-label-filter { padding:12px 16px; border:1px solid var(--line-hot); border-radius:8px; }
.intake-filters label,.intake-filter-fields label { display:grid; gap:7px; font-size:13px; font-weight:600; }
.intake-advanced { grid-column:1/-1; padding:14px 16px; background:var(--surface,#151517); border:1px solid var(--border,#303034); border-radius:10px; }
.intake-filter-fields { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; margin-top:16px; }
.intake-list-heading,.intake-pagination { display:flex; justify-content:space-between; align-items:center; gap:12px; margin:20px 0; color:var(--muted,#b0b0bb); }
.intake-list { display:grid; gap:10px; }
.intake-card { display:flex; justify-content:space-between; gap:20px; padding:20px; border:1px solid var(--border,#303034); border-inline-start:3px solid #a51b25; border-radius:12px; background:var(--surface,#151517); color:inherit; text-decoration:none; }
.intake-card:hover { border-color:#9e242c; }
.intake-card h2 { font-size:17px; margin:8px 0; }
.intake-card > div:last-child { display:grid; justify-items:end; align-content:space-between; gap:12px; }
.intake-card small,.intake-type { color:var(--muted,#b0b0bb); font-size:12px; }
.intake-card.is-closed { border-inline-start-color:#55555f; }
.intake-state { border:1px solid var(--border,#303034); border-radius:7px; padding:4px 9px; font-size:12px; }
.intake-detail { border:1px solid var(--border,#303034); border-top:3px solid #981b24; padding:24px; border-radius:14px; background:var(--surface,#151517); margin:24px 0 32px; }
.intake-detail > header { display:flex; justify-content:space-between; gap:24px; align-items:start; padding-bottom:22px; }
.intake-detail > header h2 { font-size:24px; margin:6px 0 12px; overflow-wrap:anywhere; }
.intake-detail > header p { font-size:12px; color:var(--muted,#b0b0bb); margin:0; }
.intake-detail > header span,.intake-detail footer { color:var(--muted,#b0b0bb); font-size:13px; }
.intake-detail-grid { display:grid; grid-template-columns:minmax(0,2fr) minmax(260px,1fr); gap:18px; align-items:start; }
.intake-panel { padding:20px; border:1px solid var(--border,#303034); background:var(--bg,#0e0e10); border-radius:10px; margin-bottom:18px; overflow-wrap:anywhere; }
.intake-panel h3 { margin:0 0 16px; font-size:16px; }
.intake-panel h3 small { display:block; font-size:12px; color:var(--muted,#b0b0bb); margin-top:6px; font-weight:400; }
.intake-coverage { border-inline-start:3px solid #97652b; }
.intake-coverage p { font-size:13px; line-height:1.6; }
.intake-message,.intake-decision,.intake-answer { padding:18px 0; border-top:1px solid var(--border,#303034); }
.intake-message header { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:baseline; gap:8px; margin-bottom:8px; }
.intake-message small,.intake-decision small { color:var(--muted,#b0b0bb); font-size:12px; }
.intake-message .prose { font-size:14px; }
.intake-message details { font-size:12px; margin-top:12px; }
.intake-embed { border-inline-start:3px solid #981b24; margin:12px 0; padding:14px; background:var(--surface,#151517); border-radius:6px; }
.intake-evidence { display:grid; gap:8px; padding:16px 0; border-top:1px solid var(--border,#303034); }
.intake-evidence .secondary-button { justify-self:start; }
.intake-evidence small { color:var(--muted,#b0b0bb); }
.intake-decision > small { display:block; margin:8px 0; }
@media(max-width:1000px) { .intake-filters { grid-template-columns:repeat(2,minmax(0,1fr)); } .intake-detail-grid { grid-template-columns:1fr; } }
@media(max-width:600px) { .intake-filters,.intake-filter-fields { grid-template-columns:1fr; } .intake-card,.intake-detail>header { flex-direction:column; } .intake-card>div:last-child { justify-items:start; } .intake-detail { padding:16px; } .intake-panel { padding:16px; } }
.bug-approval-badge { display:inline-flex; align-items:center; padding:5px 9px; margin:4px 0; border:1px solid var(--line); border-radius:6px; font-size:12px; font-weight:700; background:var(--panel); color:var(--text); }
.bug-approval-badge.is-pending,.bug-approval-badge.is-queued { color:#eebc72; background:#70420e26; border-color:#b7791f80; }
.bug-approval-badge.is-published { color:#74cda0; background:#14532d26; border-color:#23865b80; }
.bug-approval-badge.is-sending,.bug-approval-badge.is-review { color:#ee9898; background:#7f1d1d30; border-color:#b91c1c80; }
.bug-approval-badge.is-cancelled { color:var(--muted); }
html[data-theme="light"] .bug-approval-badge.is-pending,html[data-theme="light"] .bug-approval-badge.is-queued { color:#784509; }
html[data-theme="light"] .bug-approval-badge.is-published { color:#166534; }
html[data-theme="light"] .bug-approval-badge.is-sending,html[data-theme="light"] .bug-approval-badge.is-review { color:#991b1b; }
.portal-page .minecraft-skin-avatar { display:block; position:relative; overflow:hidden; image-rendering:pixelated; background:transparent; }
.portal-page .minecraft-skin-avatar img { position:absolute; top:-100%; width:800%; height:auto; max-width:none; margin:0; border:0; border-radius:0; object-fit:fill; image-rendering:pixelated; }
.portal-page .minecraft-skin-avatar .minecraft-skin-base { left:-100%; }
.portal-page .minecraft-skin-avatar .minecraft-skin-overlay { left:-500%; }
.task-onboarding-fields>header { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; }
.task-onboarding-fields form { margin-top:16px; padding-top:16px; border-top:1px solid var(--line); }
.member-team-checks { display:flex; gap:.4rem; flex-wrap:wrap; margin-top:.4rem; }
.team-check { font-size:.72rem; padding:.2rem .4rem; border:1px solid var(--line); border-radius:.35rem; white-space:nowrap; }
.team-check.team-present { color:#a7d6b5; }
.team-check.team-absent { color:var(--muted); }
.member-team-delivery form { display:grid; gap:.8rem; }
.member-team-delivery small { color:var(--muted); line-height:1.5; }
html[data-theme="light"] .team-check.team-present { color:#166534; }
.feedback-image-gallery { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:12px; margin:16px 0; }
.feedback-image-gallery a { display:grid; gap:6px; min-width:0; color:var(--muted); font-size:.8rem; overflow-wrap:anywhere; }
.feedback-image-gallery img { width:100%; max-height:240px; object-fit:contain; background:#090909; border:1px solid var(--border); border-radius:8px; }
.feedback-inline-image { display:block; max-width:100%; max-height:420px; object-fit:contain; margin:12px 0; border-radius:8px; }

.feedback-video { display:grid; gap:8px; min-width:0; }
.feedback-video video { width:100%; max-height:360px; background:#080808; border-radius:8px; }
.feedback-video small { color:var(--muted); }
.feedback-upload-gallery { display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:12px; }
.feedback-upload-tile { display:flex; flex-direction:column; gap:8px; min-width:0; padding:12px; border:1px solid var(--line); border-radius:10px; }
.feedback-upload-tile img,.feedback-upload-tile video { width:100%; height:120px; object-fit:contain; background:var(--panel); }
.feedback-upload-tile span { overflow-wrap:anywhere; }
.bug-card-actions { display:flex; align-items:center; flex-wrap:wrap; gap:12px; margin-top:18px; }
.bug-card-actions .bug-card-open { margin:0; display:flex; align-items:center; flex-wrap:wrap; gap:12px; }
.bug-quick-approve { display:flex; align-items:center; flex-wrap:wrap; gap:10px; margin:0; }
.bug-quick-approve select { width:auto; max-width:240px; min-height:42px; }
.bug-card-actions .secondary-link,.bug-card-actions .bug-quick-button { display:inline-flex; align-items:center; justify-content:center; gap:10px; min-height:42px; padding:10px 16px; border-radius:9px; font-weight:700; transition:background .15s,border-color .15s,box-shadow .15s; }
.bug-card-actions .bug-quick-button { background:var(--accent-fill); border:1px solid #bd152b; color:#fff; box-shadow:none; }
.bug-card-actions .bug-quick-button:hover { background:var(--accent-fill-hover); border-color:#da2038; box-shadow:none; }
.bug-card-actions .secondary-link:hover { border-color:var(--muted); }
.bug-card-actions :is(.secondary-link,.bug-quick-button):focus-visible { outline:2px solid #60a5fa; outline-offset:3px; }
@media(max-width:600px) { .bug-card-actions,.bug-card-actions .bug-card-open,.bug-quick-approve { width:100%; } .bug-card-actions .secondary-link,.bug-card-actions .bug-quick-button { width:100%; } }

/* Compact document tools: disclosures are navigation, not primary actions. */
/* Personal inbox keeps filters, selection and deadlines local to the recipient. */
.portal-page .inbox-v2 { background:var(--panel)!important; background-image:none!important; color:var(--ink); }
.portal-page .inbox-v2,.portal-page .inbox-v2 * { transition:none; }
.inbox-v2 .inbox-filters { display:grid; grid-template-columns:minmax(180px,2fr) minmax(130px,1fr) minmax(120px,1fr) auto auto; gap:12px; align-items:end; margin:20px 0 12px; }
.inbox-v2 .inbox-filters label { display:grid; gap:8px; min-width:0; font-size:.8rem; }
.inbox-v2 .inbox-filters input,.inbox-v2 .inbox-filters select { width:100%; min-width:0; }
.inbox-v2 .inbox-saved-views { display:flex; align-items:start; flex-wrap:wrap; gap:8px; margin-bottom:20px; }
.inbox-v2 .inbox-saved-views details { padding:8px 0; }
.inbox-v2 .inbox-saved-views summary,.inbox-v2 .inbox-item-actions summary { cursor:pointer; font-size:.8rem; }
.inbox-v2 .inbox-saved-views details form { max-width:400px; }
.inbox-v2 .inbox-sections { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:24px; }
.inbox-v2 [data-inbox-section] { min-width:0; border-top:1px solid var(--line); padding:18px 0; }
.inbox-v2 [data-inbox-section] h3 { display:flex; justify-content:space-between; font-size:1rem; margin:0 0 16px; }
.inbox-v2 [data-inbox-row] { min-width:0; padding:16px 0; border-bottom:1px solid var(--line); overflow-wrap:anywhere; }
.inbox-v2 [data-inbox-row][hidden],.inbox-v2 [data-inbox-empty][hidden] { display:none!important; }
.portal-page .inbox-v2 [data-inbox-row] { display:block; }
.portal-page .inbox-v2 [data-inbox-section][hidden] { display:none!important; }
.portal-page .inbox-v2 article > .inbox-item-heading { display:flex; flex-direction:row; align-items:start; justify-content:flex-start; }
.inbox-v2 [data-inbox-section]:has(> [data-inbox-row]:not([hidden])) > [data-inbox-empty] { display:none; }
.inbox-v2 article small { display:block; color:var(--muted); font-size:.78rem; line-height:1.5; margin:8px 0; }
.inbox-v2 .inbox-item-heading { display:flex; align-items:start; gap:10px; }
.inbox-v2 .inbox-item-heading>a { font-weight:650; line-height:1.5; }
.inbox-v2 input[type="checkbox"] { width:17px; height:17px; min-width:17px; margin:3px 0 0; accent-color:var(--red); }
.inbox-v2 .inbox-item-actions { display:flex; flex-wrap:wrap; align-items:start; gap:12px; margin-top:12px; }
.inbox-v2 .inbox-item-actions details { padding:9px 0; min-width:0; }
.inbox-v2 .inbox-action { display:grid; gap:10px; margin:12px 0; min-width:0; }
.inbox-v2 .inbox-action label { display:grid; gap:8px; font-size:.8rem; }
.inbox-v2 .inbox-action input,.inbox-v2 .inbox-action select { min-width:0; max-width:100%; }
.inbox-v2 .inbox-action button { justify-self:start; }
.inbox-v2 .inbox-action small,.inbox-v2 [data-inbox-section]>small { display:block; color:var(--muted); font-size:.75rem; line-height:1.5; }
.inbox-v2 .inbox-badge { display:inline-block; padding:4px 8px; border:1px solid var(--line); border-radius:5px; font-size:.72rem; margin:4px 4px 0 0; }
.inbox-v2 .inbox-badge.overdue { color:#ffb4b4; background:#41171c; border-color:#86333e; }
.inbox-v2 .inbox-badge.snoozed { color:#c4b5fd; background:#2c2342; border-color:#685388; }
.inbox-v2 .inbox-empty { color:var(--muted); font-size:.85rem; padding:12px 0; }
.notification-timing { display:grid; gap:16px; margin:20px 0; padding:18px; border:1px solid var(--line); border-radius:9px; }
.notification-timing label { display:grid; gap:8px; font-size:.85rem; }
.notification-timing small { color:var(--muted); line-height:1.6; }
html[data-theme="light"] .inbox-v2 .inbox-badge.overdue { color:#8b1d32; background:#fff1f2; }
html[data-theme="light"] .inbox-v2 .inbox-badge.snoozed { color:#5b3a8b; background:#f5f0ff; }
@media(max-width:820px) { .inbox-v2 .inbox-filters { grid-template-columns:repeat(2,minmax(0,1fr)); } .inbox-v2 .inbox-filters label:first-child { grid-column:1/-1; } .inbox-v2 .inbox-sections { grid-template-columns:minmax(0,1fr); } }
.portal-page .editor-ai-drawer { padding:12px 18px; background:transparent; }
.portal-page .editor-ai-drawer > summary { width:fit-content; max-width:100%; gap:10px; padding:8px 12px; border:1px solid var(--line); border-radius:8px; background:var(--panel); color:var(--ink); font-size:.85rem; }
.portal-page .editor-ai-drawer > summary:hover { background:var(--panel-2); border-color:var(--muted); }
.portal-page .editor-ai-drawer > summary:focus-visible,.document-detail-action > summary:focus-visible { outline:2px solid #60a5fa; outline-offset:3px; }
.portal-page .editor-ai-drawer > summary .editor-ai-icon { display:inline-grid; place-items:center; color:var(--red); font-size:1rem; }
.portal-page .editor-ai-drawer > summary .editor-ai-hint { font-size:.75rem; font-weight:400; color:var(--muted); }
.portal-page .editor-ai-drawer > summary::after { margin-left:8px; }
.portal-page .editor-ai-drawer[open] > summary::after { transform:rotate(180deg); }
.portal-page .editor-ai-drawer .ai-document-panel { grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; margin:16px 0 0; padding:20px; border-radius:10px; background:var(--panel-2)!important; }
.portal-page .editor-ai-drawer .ai-document-panel > :is(div,small,button),.portal-page .editor-ai-drawer [data-ai-document-prompt-wrap] { grid-column:1/-1; }
.portal-page .editor-ai-drawer .ai-document-panel > div:first-child { gap:7px; max-width:80ch; }
.portal-page .editor-ai-drawer .ai-document-panel label { min-width:0; gap:9px; align-content:start; }
.portal-page .editor-ai-drawer .ai-document-panel label > .form-note { margin:0; padding:0; border:0; border-radius:0; background:transparent; color:var(--muted); box-shadow:none; }
.portal-page .editor-ai-drawer .ai-document-panel select,.portal-page .editor-ai-drawer .ai-document-panel textarea { width:100%; min-width:0; }
.portal-page .document-context-content { display:block; padding:0 20px; }
.portal-page .document-context-content > :is(.document-ownership,.guide-admin-control,.guide-placement-control,.document-history,.document-workflow-panel,.workspace-detail,.document-activity-menu) { margin:0; padding:18px 0; max-width:none; border:0; border-bottom:1px solid var(--line); border-radius:0; background:transparent; box-shadow:none; }
.portal-page .document-context-content > :last-child { border-bottom:0; }
.portal-page .document-context-content > .document-ownership > summary,.portal-page .document-context-content > .document-history > summary { padding:0; font-size:.9rem; }
.portal-page .document-context-content > .document-ownership > :not(summary) { margin:14px 0 0; }
.portal-page .document-context-content .operation-form { margin:16px 0 0; padding:0; }
.portal-page .document-context-content .document-review-grid { gap:24px; margin:0; padding:20px 0; border-bottom:1px solid var(--line); }
.portal-page .document-context-content .document-review-grid > .document-comments { min-width:0; margin:0; padding:0; border:0; border-radius:0; background:transparent; box-shadow:none; }
.portal-page .document-context-content .document-review-grid header { padding:0; margin:0 0 12px; }
.portal-page .document-context-content .document-review-grid header p { display:none; }
.portal-page .document-context-content .document-review-grid h2 { margin:0; font-size:1rem; }
.portal-page .document-context-content .mini-empty { display:block; min-height:0; margin:10px 0 14px; padding:0; text-align:left; font-size:.85rem; }
.document-detail-action > summary { display:inline-flex; gap:10px; align-items:center; padding:8px 12px; border:1px solid var(--line); border-radius:7px; cursor:pointer; font-size:.8rem; font-weight:650; list-style:none; }
.document-detail-action > summary::after { content:'+'; color:var(--muted); }
.document-detail-action[open] > summary::after { content:'−'; }
.document-detail-action > summary::-webkit-details-marker { display:none; }
.document-detail-action .compact-review-form { margin-top:16px; }
.portal-page .document-context-content .document-workflow-panel > summary { gap:12px; flex-wrap:wrap; }
.portal-page .document-context-content .document-workflow-panel > summary small { display:none; }
.portal-page .document-context-content .document-workflow-panel > summary strong { margin:0; font-size:.95rem; }
.portal-page .document-context-content .workflow-summary-count { font-size:.78rem; color:var(--muted); }
@media(max-width:640px) {
  .portal-page .editor-ai-drawer { padding:12px; }
  .portal-page .editor-ai-drawer > summary .editor-ai-hint { display:none; }
  .portal-page .editor-ai-drawer .ai-document-panel { grid-template-columns:minmax(0,1fr); padding:16px; }
  .portal-page .document-context-content { padding:0 16px; }
  .portal-page .document-context-content .document-review-grid { grid-template-columns:minmax(0,1fr); }
}
