:root {
    --pd: #8c252a;
    --pd-dark: #6e1d21;
    --pale: #f6eced;
    --text: #262626;
    --muted: #5f5f5f;
    --grey: #7f7f7f;
    --line: #dcdcdc;
    --surface: #f3f3f3;
    --font: "Source Sans 3", "Segoe UI", Arial, sans-serif;
    --display: "Montserrat", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body.toolbox-app { margin: 0; background: #fff; color: var(--text); font: 16px/1.5 var(--font); }
.toolbox-app a { color: var(--pd); text-decoration: none; }
.toolbox-app a:hover { text-decoration: underline; }
.toolbox-app :is(a, button, input, textarea, select):focus-visible { outline: 2px solid var(--pd); outline-offset: 3px; }
.toolbox-app h1[tabindex="-1"]:focus { outline: none; }

/* Real specificity is intentional. MudBlazor's reset must not turn native
   labels into inline elements or remove button padding. Mud controls opt out. */
.toolbox-app button:not([class*="mud-"]), .toolbox-app .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid var(--pd);
    border-radius: 7px;
    background: white;
    color: var(--pd);
    font: 600 14px/1.5 var(--font);
    cursor: pointer;
    text-decoration: none;
}
.toolbox-app button:not([class*="mud-"]):hover, .toolbox-app .button:hover { background: var(--pale); text-decoration: none; }
.toolbox-app button.primary, .toolbox-app .button.primary { background: var(--pd); border-color: var(--pd); color: white; }
.toolbox-app button.primary:hover, .toolbox-app .button.primary:hover { background: var(--pd-dark); }
.toolbox-app button:disabled { opacity: .5; cursor: not-allowed; }

/* Native forms are explicitly marked; none of these rules enter MudForm,
   MudTextField, MudSelect, MudCheckBox or the data-grid's filter controls. */
.toolbox-app .html-form { display: block; min-width: 0; }
.toolbox-app .html-form label { display: block; width: 100%; margin: 0 0 8px; font: 600 16px/1.4 var(--font); color: var(--text); }
.toolbox-app .html-form > label { margin-top: 22px; }
.toolbox-app .html-form :is(input:not([type="checkbox"]):not([type="hidden"]), textarea, select) {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: auto;
    min-height: 44px;
    margin: 8px 0 0;
    padding: 10px 12px;
    border: 1px solid #b3b3b3;
    border-radius: 8px;
    background: white;
    color: var(--text);
    font: 400 16px/1.5 var(--font);
}
.toolbox-app .html-form textarea { resize: vertical; }
.toolbox-app .html-form input:disabled { background: var(--surface); color: var(--muted); }
.toolbox-app .html-form :is(input, textarea, select):focus { border-color: var(--pd); outline: 2px solid var(--pd); outline-offset: 1px; }
.toolbox-app .html-form input[type="file"] { padding: 10px; font-size: 15px; }
.toolbox-app .html-form input::file-selector-button { margin-right: 12px; padding: 7px 12px; border: 1px solid #b3b3b3; border-radius: 3px; background: var(--surface); color: var(--text); font: 600 14px var(--font); cursor: pointer; }
.toolbox-app .html-form .form-field { display: block; min-width: 0; margin: 22px 0 0; }
.toolbox-app .html-form .form-field > small { display: block; margin-top: 8px; color: var(--muted); font-size: 14px; }
.toolbox-app .html-form .check { display: flex; align-items: flex-start; gap: 10px; margin-top: 18px; font-weight: 400; }
.toolbox-app .html-form input[type="checkbox"] { flex: 0 0 auto; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--pd); }
.toolbox-app .html-form .form-section { min-width: 0; margin: 0 0 32px; padding: 22px 0 0; border: 0; border-top: 1px solid var(--line); }
.toolbox-app .html-form .form-section > legend { display: flex; align-items: center; gap: 12px; float: none; width: auto; margin: 0; padding: 0 0 0; font: 600 20px/1.3 var(--display); }
.toolbox-app .html-form fieldset.form-section { padding-top: 20px; }
.toolbox-app .html-form .form-section > p { margin-top: 12px; color: var(--muted); }
.toolbox-app .html-form h2 { display: flex; align-items: center; gap: 12px; }
.toolbox-app .html-form .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.nr { flex: 0 0 auto; display: inline-flex; align-items: center; width: 34px; height: 26px; padding-left: 10px; background: var(--pd); color: white; font: 700 14px var(--display); clip-path: polygon(0 0,70% 0,100% 50%,70% 100%,0 100%); }

/* Header, typography and page rhythm follow the supplied Ratingfinder HTML. */
.topbar { background: white; border-bottom: 1px solid var(--line); }
.topbar-inner, .header-nav { max-width: 1180px; margin: 0 auto; padding-left: 28px; padding-right: 28px; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 20px; padding-bottom: 18px; }
.brand { display: block; flex-shrink: 0; }
.brand img { display: block; width: auto; height: 52px; max-width: 100%; }
.header-nav { display: flex; align-items: stretch; flex-wrap: wrap; gap: 2px; }
.toolbox-app .header-nav a { display: block; padding: 12px 16px 10px; margin-bottom: -1px; border-bottom: 3px solid transparent; color: var(--muted); font: 600 14px/1.5 var(--display); }
.toolbox-app .header-nav a:hover { color: var(--text); text-decoration: none; }
.toolbox-app .header-nav a.active { color: var(--pd); border-bottom-color: var(--pd); }
.workspace { background: #f7f6f5; }
.page { width: 100%; max-width: 1180px; min-height: calc(100vh - 230px); margin: 0 auto; padding: 36px 28px 64px; }
.toolbox-app .page h1, .toolbox-app .public-main h1 { margin: 0 0 16px; color: var(--grey); font: 700 clamp(30px, 3.3vw, 42px)/1.12 var(--display); letter-spacing: -.015em; overflow-wrap: anywhere; }
.toolbox-app .page h2 { margin: 0 0 12px; font: 600 20px/1.35 var(--display); color: var(--text); }
.toolbox-app .page h3 { margin: 0 0 10px; font: 600 18px/1.35 var(--display); }
.toolbox-app .page p { margin: 0 0 16px; line-height: 1.6; }
.page > h1 + p { max-width: 76ch; color: var(--muted); margin-bottom: 32px !important; }
.page > .mud-container { padding: 0; }
.muted, .meta { color: var(--muted); }
.small, small { font-size: 14px; }
.intro { max-width: 800px; margin-bottom: 36px; }
.toolbox-app .intro p { margin: 0; color: #444; font-size: 18px; }
.bank-label { display: inline-block; margin-top: 18px; padding: 5px 12px; border-left: 3px solid var(--pd); background: var(--surface); font-weight: 600; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 36px 0 18px; }
.toolbox-app .section-heading h2 { margin: 0; }
.section-heading > a, .section-heading > span { font-size: 15px; }
.page-heading { align-items: flex-start; margin-top: 0; margin-bottom: 36px; }
.page-heading > div { max-width: 780px; }
.page-heading > button { flex-shrink: 0; margin-top: 0; }
.toolbox-app .page-heading p { margin: 0; color: var(--muted); font-size: 17px; }
.back-link { display: inline-block; margin-bottom: 10px; font-size: 13px; line-height: 20px; }
.page:has(.back-link, .article-breadcrumbs) { padding-top: 8px; }

/* Quiet white cards and a warm canvas, following the supplied dashboard. */
.news-grid, .admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.news-card { min-width: 0; overflow: hidden; border: 1px solid #e8e5e3; border-radius: 12px; background: white; box-shadow: 0 1px 3px #302c2b04; }
.news-card.featured { border-top: 3px solid var(--pd); }
.news-card-content { padding: 24px; }
.toolbox-app .news-card h3 { margin: 12px 0; }
.toolbox-app .news-card p { color: var(--muted); white-space: pre-line; }
.news-card a { font-weight: 600; }
.news-hero { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; background: var(--surface); }
.meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 14px; }
.badge { display: inline-block; padding: 3px 8px; background: var(--pale); color: var(--pd); font-size: 12px; line-height: 1.5; }
.tool-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.tool-card { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; padding: 24px; border: 1px solid #e8e5e3; border-radius: 12px; background: white; box-shadow: 0 1px 3px #302c2b04; }
.tool-card-top { display: flex; align-items: flex-start; justify-content: space-between; width: 100%; gap: 12px; }
.tool-icon { flex: 0 0 auto; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 9px; background: var(--pd); color: white; }
.toolbox-app .tool-card h3 { margin: 18px 0 10px; }
.toolbox-app .tool-card p { margin-bottom: 22px; color: var(--muted); font-size: 15px; }
.tool-card > a:last-child { margin-top: auto; }
.tool-card > a:last-child:not(.button) { padding-top: 12px; font-weight: 600; }
.tool-card.locked { background: #fcfbfa; }
.locked .tool-icon, .coming .tool-icon { background: #eeecea; color: var(--grey); }
.tool-card.coming { border-style: dashed; background: transparent; box-shadow: none; }
.admin-grid { gap: 0 48px; }
.toolbox-app .admin-card { display: flex; flex-direction: column; align-items: flex-start; padding: 28px 0; border-top: 1px solid var(--line); color: var(--text); }
.toolbox-app .admin-card:hover { text-decoration: none; }
.card-kicker { color: var(--grey); font: 600 12px/1.4 var(--display); }
.toolbox-app .admin-card h2 { margin: 12px 0; }
.toolbox-app .admin-card:hover h2 { color: var(--pd); }
.toolbox-app .admin-card p { max-width: 48ch; color: var(--muted); margin-bottom: 18px; }
.card-link { margin-top: auto; color: var(--pd); font-weight: 600; }
.panel { min-width: 0; padding: 24px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.page > .panel + .panel { margin-top: 24px; }
.empty { padding: 24px; background: var(--surface); border-left: 4px solid var(--grey); color: var(--muted); }
.news-editor { max-width: 820px; margin-inline: auto; }
.news-editor .actions .mud-icon-root { width: 20px; height: 20px; }
.news-directory { margin-top: 20px; }
.news-directory-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.news-directory-row > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.toolbox-app .news-directory-row h2 { margin: 8px 0 4px; font-size: 18px; }
.news-row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; flex-shrink: 0; max-width: 50%; }
.toolbox-app .html-form textarea[readonly] { background: var(--surface); color: var(--muted); }
.news-upload-preview { display: block; width: 240px; max-width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; margin-top: 16px; }
.news-preview { margin-top: 40px; border-top: 1px solid var(--line); }
.news-preview > .section-heading { flex-wrap: wrap; }
.hero-fields > button { margin-top: 16px; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.mail-page { max-width: 780px; margin-inline: auto; }
.mail-form { margin-bottom: 40px; }
.mail-form > label:first-of-type { margin-top: 0; }
.mail-form > small { display: block; margin-top: 10px; color: var(--muted); }
.confirmation-panel { margin: 20px 0; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.error, .validation-message, .validation-errors { color: #a4161a; }
.validation-errors { margin: 16px 0; padding-left: 20px; }
.validation-errors:empty { display: none; }
.validation-message { display: block; margin-top: 6px; font-size: 14px; }
.impersonation { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 14px max(28px, calc((100vw - 1124px)/2)); background: var(--pale); border-bottom: 1px solid var(--line); }
.impersonation strong, .impersonation span { display: block; }
.impersonation span { margin-top: 3px; font-size: 14px; color: var(--muted); }
.impersonation form { flex-shrink: 0; }
.access-row { padding: 20px 0; border-bottom: 1px solid var(--line); }
.access-row strong { display: block; margin-bottom: 8px; }
.contact { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.site-footer > div { display: flex; flex-wrap: wrap; gap: 10px 24px; max-width: 1180px; margin: auto; padding: 24px 28px 32px; }
.site-footer span { margin-right: auto; }
.public-main { display: grid; align-content: center; min-height: calc(100vh - 190px); padding: 56px 24px; }
.login-card { width: 100%; max-width: 460px; margin: auto; border-top: 4px solid var(--pd); padding-top: 28px; }
.toolbox-app .login-card h1 { font-size: 34px; }
.login-card > p { margin: 0 0 24px; font-size: 18px; }
.login-card > .small { margin-top: 28px; font-size: 15px; }
.toolbox-app .login-card button { justify-content: space-between; width: 100%; margin-top: 28px; }
.article-page { max-width: 1000px; margin: 0 auto; }
.article-breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; color: var(--muted); font-size: 13px; line-height: 20px; }
.reading-card { overflow: hidden; min-width: 0; border: 1px solid #e8e5e3; border-radius: 16px; background: white; box-shadow: 0 8px 32px #302c2b05; }
.article-heading { padding: 48px 56px 36px; }
.article-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; color: var(--muted); font-size: 13px; }
.toolbox-app .article-heading h1 { margin: 0; color: var(--text); font: 700 clamp(27px, 3.3vw, 40px)/1.23 var(--display); }
.article-visual { margin: 0; background: var(--pale); }
.article-visual img { display: block; width: 100%; max-height: 460px; aspect-ratio: 2.2; object-fit: cover; }
.article-content { max-width: 800px; margin: 0 auto; padding: 36px 40px 48px; }
.article-content .news-body { font-size: 17px; line-height: 1.85; color: #49413c; }
.news-body { line-height: 1.8; overflow-wrap: anywhere; }
.toolbox-app .news-body :is(p, ul) { margin: 16px 0; }
.news-body ul { padding-left: 24px; list-style: disc; }
.toolbox-app .news-body h3 { margin-top: 28px; }
.article-source { margin-top: 36px; padding: 24px; border-left: 3px solid var(--pd); background: #faf6f6; }
.article-source > span { display: block; margin-bottom: 10px; font-size: 11px; letter-spacing: .1em; color: var(--muted); }
.article-source > a { display: inline-flex; gap: 10px; align-items: center; font-weight: 600; }
.article-source .mud-icon-root { flex-shrink: 0; width: 18px; height: 18px; }
.article-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding: 24px 40px; border-top: 1px solid #eee8e4; color: var(--muted); font-size: 14px; background: #fdfcfb; }
.article-footer a { font-weight: 600; }
.article-unavailable { padding: 40px; }
#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; z-index: 2000; width: 100%; padding: 16px 24px; border-top: 1px solid var(--line); background: var(--pale); color: var(--text); }

/* Account menu. Native details/summary works with keyboard and without JS. */
.account-header { display: flex; align-items: center; gap: 18px; min-width: 0; }
.bank-identity { min-width: 0; text-align: right; }
.bank-identity strong { display: block; max-width: 320px; color: var(--text); font: 600 16px/1.35 var(--display); overflow-wrap: anywhere; }
.bank-identity > span { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }
.profile-menu, .row-menu { position: relative; flex: 0 0 auto; }
summary { list-style: none; cursor: pointer; }
summary::-webkit-details-marker { display: none; }
summary:focus-visible { outline: 2px solid var(--pd); outline-offset: 3px; }
.profile-avatar, .person-avatar { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; background: var(--pale); color: var(--pd); font: 600 14px/1 var(--display); }
.profile-avatar { background: var(--pd); color: white; border: 3px solid white; box-shadow: 0 0 0 1px #e7d6d7; }
.profile-menu[open] > summary { box-shadow: 0 0 0 2px var(--pd); }
.dropdown-panel { position: absolute; z-index: 100; top: calc(100% + 10px); right: 0; width: 260px; max-width: calc(100vw - 40px); padding: 8px; border: 1px solid #e8e5e3; border-radius: 12px; background: white; box-shadow: 0 10px 36px #302c2b1a; }
.toolbox-app .dropdown-panel :is(a, button) { display: flex; align-items: center; justify-content: flex-start; gap: 10px; width: 100%; min-height: 42px; padding: 10px 12px; border: 0; border-radius: 6px; background: white; color: var(--text); font: 400 15px/1.4 var(--font); text-align: left; text-decoration: none; }
.toolbox-app .dropdown-panel :is(a, button):hover { background: var(--surface); text-decoration: none; }
.dropdown-panel .mud-icon-root { flex-shrink: 0; width: 19px; height: 19px; color: var(--muted); }
.toolbox-app .dropdown-panel .menu-separated { margin-top: 6px; border-top: 1px solid var(--line); border-radius: 0 0 6px 6px; padding-top: 14px; }
.profile-panel { width: 300px; }
.profile-summary { display: flex; flex-direction: column; gap: 4px; padding: 12px 12px 16px; margin-bottom: 6px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.profile-summary strong { font-weight: 600; }
.profile-summary > span { font-size: 14px; color: var(--muted); }
.toolbox-app .danger { color: #a4161a !important; }

/* Dashboard hierarchy: one lead story, two concise stories, then the tools. */
.toolbox-app .dashboard-welcome h1 { margin: 0 0 8px; color: var(--text); font-size: clamp(25px, 2.6vw, 32px); line-height: 1.25; }
.toolbox-app .dashboard-welcome p { color: var(--muted); margin: 0; font-size: 16px; }
.dashboard-welcome { margin-bottom: 38px; }
.dashboard .section-heading { margin-top: 34px; margin-bottom: 18px; }
.dashboard .section-heading > a { font-size: 14px; font-weight: 600; }
.news-showcase { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 20px; }
.news-side { display: grid; align-content: start; gap: 14px; }
.news-visual { position: relative; min-width: 0; background: #f3e9ea; }
.news-visual .news-hero { aspect-ratio: auto; height: 216px; }
.news-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; height: 216px; color: var(--pd); }
.news-placeholder .mud-icon-root { width: 44px; height: 44px; }
.news-placeholder > span { max-width: 100%; padding: 0 20px; text-align: center; overflow-wrap: anywhere; font-size: 14px; }
.pinned-label { position: absolute; top: 16px; left: 16px; padding: 4px 10px; border-radius: 20px; color: white; background: var(--pd); font-size: 12px; font-weight: 600; }
.source-label { padding: 2px 8px; border-radius: 20px; background: #f0efee; color: #555; font-size: 12px; line-height: 1.3; font-weight: 600; }
.news-card .meta { gap: 8px; font-size: 12px; }
.toolbox-app .news-card h3 > a { color: var(--text); }
.toolbox-app .news-card h3 > a:hover { color: var(--pd); }
.toolbox-app .news-lead h3 { margin: 14px 0 12px; font-size: 21px; line-height: 1.4; }
.toolbox-app .news-lead p { margin-bottom: 24px; font-size: 15px; }
.news-read-link { display: inline-flex; align-items: center; gap: 8px; color: var(--pd); font-size: 14px; font-weight: 600; }
.news-read-link[aria-disabled="true"] { cursor: default; }
.news-compact .news-read-link { margin-top: 12px; }
.news-archive-card { display: flex; flex-direction: column; }
.news-archive-card .news-card-content { display: flex; flex: 1; flex-direction: column; align-items: flex-start; }
.news-archive-card .news-read-link { margin-top: auto; }
.news-compact .news-card-content { padding: 18px 20px; }
.toolbox-app .news-compact h3 { margin: 10px 0 8px; font-size: 15px; line-height: 1.45; }
.toolbox-app .news-compact p { margin: 0; font-size: 14px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-showcase.single { grid-template-columns: 1fr; }
.news-showcase.single .news-lead { display: grid; grid-template-columns: 1fr 1fr; }
.news-showcase.single .news-visual .news-hero, .news-showcase.single .news-placeholder { min-height: 100%; height: 260px; }
.news-archive { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.status-chip, .role-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; border-radius: 20px; background: #eeecea; color: #66615e; font: 600 12px/1.35 var(--font); }
.status-chip .mud-icon-root { width: 13px; height: 13px; }
.status-chip.enabled { background: #edf4ef; color: #35624b; }
.tool-card-top .status-chip { margin-top: 2px; text-align: center; }
.dashboard .button { border-radius: 6px; font-family: var(--font); font-size: 15px; }
.dashboard .contact { padding-top: 20px; font-size: 14px; }

/* Shared management directories. No dense grids, floating controls or icon rows. */
.toolbox-app .directory-page h1 { color: var(--text); font-size: 32px; }
.directory-page .page-heading { margin-bottom: 22px; }
.directory-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 24px; margin-bottom: 28px; color: var(--muted); font-size: 14px; }
.directory-summary strong { color: var(--text); font-weight: 600; }
.toolbox-app .directory-toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(180px, 240px); gap: 16px; align-items: end; padding: 20px; border: 1px solid #e8e5e3; border-radius: 12px; background: white; }
.directory-toolbar:has(#user-bank-filter) { grid-template-columns: minmax(220px, 1fr) minmax(180px, 280px); }
.toolbox-app .directory-toolbar.user-toolbar:not(:has(#user-bank-filter)) { grid-template-columns: 1fr; }
.search-field { position: relative; min-width: 0; }
.search-field > .mud-icon-root { position: absolute; left: 14px; top: 12px; width: 20px; height: 20px; color: #8b8581; pointer-events: none; }
.toolbox-app .directory-toolbar.html-form .search-field input { margin: 0; padding: 10px 12px 10px 44px; border-color: #e2ddda; border-radius: 7px; background: #fcfbfa; height: 44px; min-height: 44px; }
.filter-field { min-width: 0; }
.toolbox-app .directory-toolbar .filter-field label { margin-bottom: 6px; font-size: 12px; color: var(--muted); }
.toolbox-app .directory-toolbar.html-form .filter-field select { margin-top: 0; padding: 10px 30px 10px 12px; height: 44px; min-height: 44px; border-color: #e2ddda; border-radius: 7px; background: #fcfbfa; font-size: 14px; }
.directory-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 24px 0 12px; color: #6b625e; font-size: 13px; }
.bank-directory { display: grid; gap: 12px; }
.bank-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(180px, .8fr) auto; gap: 24px; align-items: center; padding: 24px; border: 1px solid #e8e5e3; border-radius: 12px; background: white; }
.bank-row-identity, .user-row-identity { display: flex; align-items: center; gap: 14px; min-width: 0; }
.bank-row-identity > div, .user-row-identity > div { min-width: 0; }
.bank-symbol { display: grid; place-items: center; flex: 0 0 auto; width: 46px; height: 46px; border-radius: 10px; background: var(--pale); color: var(--pd); }
.toolbox-app .bank-row h2, .toolbox-app .user-row h2 { margin: 0 0 6px; font-size: 16px; overflow-wrap: anywhere; }
.toolbox-app .bank-row p { margin: 0; color: var(--muted); font-size: 14px; }
.contact-separator { padding: 0 3px; color: #b5aca7; }
.bank-row-access { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.toolbox-app .user-count { display: flex; align-items: center; gap: 6px; color: #6b625e; font-size: 14px; }
.user-count .mud-icon-root { width: 17px; height: 17px; }
.tool-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.row-actions { display: flex; align-items: center; gap: 10px; }
.toolbox-app button.quiet-button { min-height: 40px; padding: 9px 12px; border-color: #e5dfdc; border-radius: 6px; font: 600 14px/1.4 var(--font); white-space: nowrap; }
.row-menu > summary { display: grid; place-items: center; width: 36px; height: 40px; border-radius: 6px; color: var(--muted); }
.row-menu > summary:hover { background: var(--surface); }
.directory-empty { padding: 52px 24px; border: 1px dashed #ded7d2; border-radius: 12px; text-align: center; color: var(--muted); background: #fcfbfa; }
.directory-empty > .mud-icon-root { width: 36px; height: 36px; margin-bottom: 16px; color: #a39790; }
.directory-empty > button { margin-top: 10px; }
.toolbox-app .directory-empty h2 { margin-bottom: 10px; }
.directory-pagination { display: flex; align-items: center; justify-content: center; gap: 18px; padding-top: 24px; color: var(--muted); font-size: 14px; }
.user-directory { display: grid; gap: 10px; }
.user-column-headings, .user-row-summary { display: grid; grid-template-columns: minmax(240px, 1.5fr) minmax(140px, 1fr) 230px; align-items: center; gap: 24px; padding: 20px 24px; }
.user-column-headings { padding-top: 4px; padding-bottom: 4px; color: #8b817b; font-size: 12px; }
.user-row { min-width: 0; border: 1px solid #e8e5e3; border-radius: 12px; background: white; }
.user-row.expanded { border-color: #d5babc; }
.user-row-identity .person-avatar { width: 40px; height: 40px; font-size: 12px; }
.user-email { display: block; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.self-label { display: inline-block; margin-top: 4px; color: var(--pd); font-size: 11px; font-weight: 600; }
.user-bank { color: #68605c; font-size: 14px; overflow-wrap: anywhere; }
.role-chip { justify-self: start; max-width: 100%; background: #f3f1ef; color: #685f5a; }
.user-row-actions { display: flex; flex-direction: row; align-items: center; justify-content: flex-end; gap: 16px; min-width: 0; }
.user-row-actions > button .mud-icon-root { width: 18px; height: 18px; }
.toolbox-app .user-org-link { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; min-height: 36px; font: 600 13px/1.4 var(--font); }
.user-org-link > .mud-icon-root { flex-shrink: 0; width: 17px; height: 17px; }
.user-details { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 36px; padding: 24px; border-top: 1px solid #ece6e2; background: #fcfbfa; border-radius: 0 0 12px 12px; }
.toolbox-app .user-permissions .form-field { margin-top: 0; }
.user-detail-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-width: 0; }
.detail-label { margin-bottom: 4px; color: #8a7c74; font-size: 11px; letter-spacing: .1em; }
.toolbox-app .user-detail-actions :is(button, .button) { justify-content: flex-start; min-height: 36px; padding: 4px 0; border: 0; background: transparent; font: 600 14px/1.5 var(--font); text-align: left; }
.user-detail-actions .mud-icon-root { width: 18px; height: 18px; }
.user-detail-actions > a:last-child:not(.button) { margin-top: 6px; font-size: 14px; }
.loading-state { padding: 32px 0; color: var(--muted); }

/* Account settings use the same cards and typography as the directories. */
.settings-page { max-width: 940px; margin-inline: auto; }
.settings-card { min-width: 0; padding: 28px; border: 1px solid #e8e5e3; border-radius: 12px; background: white; }
.settings-card > .mud-icon-root { width: 28px; height: 28px; margin-bottom: 18px; color: var(--pd); }
.settings-card > .button { margin-top: auto; }
.profile-details { display: flex; align-items: flex-start; gap: 24px; margin-bottom: 24px; }
.person-avatar.large { width: 64px; height: 64px; font-size: 21px; }
.profile-details > div { min-width: 0; overflow-wrap: anywhere; }
.toolbox-app .profile-details p { color: var(--muted); }
.profile-details small { color: var(--muted); }
.profile-facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 24px; margin: 20px 0; font-size: 14px; }
.profile-facts dt { color: var(--muted); }
.profile-facts dd { margin: 0; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.settings-grid .settings-card { display: flex; flex-direction: column; align-items: flex-start; }
.settings-grid p { color: var(--muted); font-size: 15px; }
.password-page { max-width: 680px; margin-inline: auto; }
.kapa-management-page { max-width: 980px; margin-inline: auto; }
.kapa-management-page > .settings-card { margin-bottom: 24px; }
.settings-section-heading { display: flex; align-items: flex-start; gap: 16px; }
.settings-section-heading > div { min-width: 0; overflow-wrap: anywhere; }
.context-label { display: block; margin-bottom: 6px; color: var(--muted); font: 600 12px/1.4 var(--font); letter-spacing: .07em; }
.fixed-clone-target { min-width: 0; padding-bottom: 10px; overflow-wrap: anywhere; }
.fixed-clone-target > strong { display: block; font-weight: 600; }
.toolbox-app .settings-section-heading h2 { margin: 0 0 8px; }
.toolbox-app .settings-section-heading p { margin: 0; color: var(--muted); font-size: 15px; }
.bank-configuration-summary { display: flex; flex-wrap: wrap; gap: 18px 36px; padding: 20px 0; margin: 20px 0; border-top: 1px solid #eee8e4; border-bottom: 1px solid #eee8e4; }
.bank-configuration-summary > div { min-width: 0; }
.bank-configuration-summary > div > span, .bank-configuration-summary strong { display: block; overflow-wrap: anywhere; }
.bank-configuration-summary > div > span { margin-bottom: 6px; color: var(--muted); font-size: 13px; }
.bank-configuration-summary strong { font-size: 16px; font-weight: 600; }
.bank-version-value { display: flex; align-items: center; gap: 6px; min-width: 0; }
.bank-version-value > strong { min-width: 0; }
.toolbox-app .bank-version-change { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 32px; width: 32px; height: 32px; min-width: 32px; min-height: 32px; padding: 6px; border-radius: 50%; color: var(--pd); }
.toolbox-app .bank-version-change:hover { background: var(--pale); }
.toolbox-app .bank-version-change:focus-visible { outline: 2px solid var(--pd); outline-offset: 2px; }
.version-preview { margin-top: 24px; }
.version-preview-summary { display: flex; align-items: flex-start; gap: 12px; padding: 16px; margin-bottom: 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); }
.version-preview-summary > .mud-icon-root { flex-shrink: 0; width: 22px; height: 22px; }
.version-preview-summary p { margin: 0; font-size: 14px; line-height: 1.5; }
.version-preview-summary .quiet-button { margin-top: 12px; }
.kapa-setting-block { padding-top: 12px; margin-top: 20px; }
.kapa-setting-block + .kapa-setting-block { padding-top: 28px; border-top: 1px solid #eee8e4; }
.kapa-setting-block > small { display: block; margin-top: 8px; color: var(--muted); }
.toolbox-app .kapa-setting-block p { color: var(--muted); font-size: 15px; }
.toolbox-app .bank-clone-card .security-hint { margin: 24px 0 0; padding: 16px; border-radius: 8px; background: var(--surface); color: var(--muted); font-size: 14px; }
.clone-selection-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end; gap: 24px; }
.bank-clone-card .clone-selection-grid { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 20px; }
.clone-arrow { padding-bottom: 10px; color: var(--pd); font-size: 23px; }
.clone-preview { margin-top: 24px; padding: 20px; border: 1px solid #e8e5e3; border-radius: 8px; background: #fcfbfa; overflow-wrap: anywhere; }
.clone-preview > strong { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-weight: 600; }
.toolbox-app .clone-preview p { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.version-impact { max-height: 350px; overflow-y: auto; margin-bottom: 24px; }
.version-impact section { padding: 16px 0; border-top: 1px solid #eee8e4; }
.version-impact h3 { margin-bottom: 10px; font: 600 16px/1.4 var(--display); }
.version-impact ul { margin: 0; padding-left: 20px; list-style: disc; color: var(--muted); font-size: 14px; }
.permission-role-description { margin-top: 20px; }
.permission-role-description p { margin-top: 10px !important; }
.permission-person { display: flex; align-items: flex-start; gap: 16px; }
.permission-person > div { min-width: 0; overflow-wrap: anywhere; }
.toolbox-app .permission-person p { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.permission-tree { border: 1px solid #e8e5e3; border-radius: 8px; overflow: hidden; }
.permission-position { padding: 14px 20px 14px calc(20px + var(--level) * 22px); border-bottom: 1px solid #eee8e4; }
.permission-position:last-child { border-bottom: 0; }
.toolbox-app .html-form .permission-choice { display: flex; align-items: flex-start; gap: 12px; margin: 0; cursor: pointer; }
.permission-choice > span { min-width: 0; overflow-wrap: anywhere; }
.permission-choice strong { display: block; font-weight: 600; }
.permission-choice small { display: block; margin-top: 5px; color: var(--muted); font-size: 13px; font-weight: 400; }
.permission-position.inherited { background: #faf9f8; }
.toolbox-app .password-card .security-hint { margin: 20px 0 0; padding: 14px 16px; border-radius: 8px; background: var(--surface); color: var(--muted); font-size: 14px; }
.toolbox-app .directory-dialog { border-radius: 12px; }
.directory-dialog .mud-dialog-title { padding: 26px 28px 16px; }
.directory-dialog .mud-dialog-title .mud-typography { font: 600 21px/1.4 var(--display); }
.directory-dialog .mud-dialog-content { padding: 8px 28px 24px; }
.directory-dialog .mud-dialog-actions { padding: 16px 28px 22px; gap: 10px; border-top: 1px solid #eee8e4; }
.directory-dialog .dialog-intro { margin-bottom: 20px; color: var(--muted); font-size: 15px; line-height: 1.6; }
.directory-dialog .mud-button-root { text-transform: none; letter-spacing: 0; }
.toolbox-app .tool-access-list.html-form { display: grid; gap: 16px; min-width: 0; }
.tool-access-card { min-width: 0; padding: 20px; border: 1px solid #e8e5e3; border-radius: 10px; background: #fcfbfa; }
.toolbox-app .tool-access-card h3 { margin: 0 0 16px; font: 600 17px/1.4 var(--display); overflow-wrap: anywhere; }
.toolbox-app .html-form .access-field { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.toolbox-app .html-form .access-field select { width: 100%; margin: 0; font-size: 14px; }
.toolbox-app .tool-access-unavailable { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.toolbox-app .tool-access-card .check { margin: 0; }
.toolbox-app .kapa-user-role .check { margin-top: 18px; }
.toolbox-app .page .kapa-org-heading { margin: 32px 0 0; }
.user-account-data > button { margin-top: 16px; }
.grant-context { display: flex; flex-direction: column; gap: 6px; overflow-wrap: anywhere; }
.grant-context > span { color: var(--muted); font-size: 14px; }
.grant-options { padding: 0; border: 0; margin-top: 24px; }
.grant-options legend { margin-bottom: 14px; font: 600 17px/1.4 var(--display); }
.toolbox-app .html-form .grant-option { display: flex; align-items: flex-start; gap: 12px; padding: 16px; border: 1px solid #e5dedb; border-radius: 9px; margin-bottom: 10px; cursor: pointer; }
.grant-option.selected { background: var(--pale); border-color: #bd8f92 !important; }
.toolbox-app .html-form .grant-option input[type=radio] { flex: 0 0 auto; width: 18px; min-height: 18px; height: 18px; max-width: 18px; padding: 0; margin: 2px 0 0; accent-color: var(--pd); }
.grant-option > span, .grant-person > span { display: flex; flex-direction: column; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.grant-option small, .grant-person small { font-size: 13px; line-height: 1.5; font-weight: 400; color: var(--muted); }
.grant-people { max-height: 280px; overflow: auto; padding: 4px 0; border: 1px solid #e5dedb; border-radius: 8px; margin-top: 20px; }
.toolbox-app .html-form .grant-person { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; margin: 0; cursor: pointer; }
.grant-person + .grant-person { border-top: 1px solid #f0ece9; }
.grant-selection-count { font-size: 13px; color: var(--muted); margin-top: 12px; }
.request-list { display: grid; gap: 14px; }
.request-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, .8fr) auto; gap: 24px; align-items: center; padding: 26px; background: white; border: 1px solid #e8e5e3; border-radius: 12px; }
.request-row.focused { border-color: #b7787d; box-shadow: 0 0 0 2px var(--pale); }
.request-person { display: flex; align-items: flex-start; gap: 14px; min-width: 0; }
.request-person > div { min-width: 0; overflow-wrap: anywhere; }
.toolbox-app .request-person h2 { margin-bottom: 6px; font-size: 17px; }
.request-person span:not(.person-avatar), .toolbox-app .request-person p { font-size: 14px; color: var(--muted); }
.toolbox-app .request-person p { margin: 8px 0 0; }
.request-tool { min-width: 0; overflow-wrap: anywhere; }
.request-tool > strong, .request-tool time { display: block; }
.request-tool time { margin: 6px 0 10px; color: var(--muted); font-size: 13px; }
.request-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; max-width: 245px; }
.request-mail-status { flex-basis: 100%; font-size: 12px; color: var(--muted); text-align: right; }
.request-context-changed { grid-column: 1 / -1; font-size: 13px; color: var(--muted); margin: 0 !important; }
.request-pending { display: inline-flex; align-items: center; gap: 8px; margin-top: auto; color: var(--pd); font-size: 14px; font-weight: 600; }
.request-pending .mud-icon-root { width: 18px; height: 18px; }
.tool-card .request-tool-button { margin-top: auto; }
.tool-card .impersonation-request-tooltip { max-width: 100%; margin-top: auto; }
.disabled-request-trigger { display: inline-flex; max-width: 100%; cursor: not-allowed; }
.disabled-request-trigger > button { pointer-events: none; }
.toolbox-app .disabled-request-trigger > button:disabled { background: #f1efee; border-color: #d7d0cc; color: #857c76; opacity: 1; }

@media (max-width: 900px) {
    .request-row { grid-template-columns: minmax(0, 1fr) auto; }
    .request-person { grid-column: 1 / -1; }
    .directory-toolbar:has(#user-bank-filter) { grid-template-columns: 1fr 1fr; }
    .bank-row { grid-template-columns: minmax(0, 1fr) auto; gap: 20px; }
    .bank-row-identity { grid-column: 1; }
    .bank-row-access { grid-column: 1; grid-row: 2; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 10px 20px; }
    .row-actions { grid-column: 2; grid-row: 1 / 3; }
    .user-column-headings { display: none; }
    .user-row-summary { grid-template-columns: minmax(0, 1fr) auto; gap: 10px 20px; }
    .user-row-identity { grid-column: 1; }
    .user-bank { grid-column: 1; margin-left: 54px; }
    .user-row-summary > .role-chip { grid-column: 1; margin-left: 54px; }
    .user-row-summary > .user-row-actions { grid-column: 2; grid-row: 1 / 3; }
    .news-showcase { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
    .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .impersonation { flex-wrap: wrap; }
}
@media (max-width: 600px) {
    .request-row { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 20px; }
    .request-actions { max-width: none; justify-content: space-between; }
    .request-mail-status { text-align: left; }
    .article-heading { padding: 28px 24px; }
    .article-content { padding: 12px 24px 28px; }
    .article-content .news-body { font-size: 16px; }
    .article-visual img { aspect-ratio: 1.5; }
    .article-footer { padding: 20px 24px; }
    .clone-selection-grid, .bank-clone-card .clone-selection-grid { grid-template-columns: 1fr; gap: 0; }
    .clone-arrow { display: none; }
    .settings-section-heading { gap: 12px; }
    .settings-section-heading .bank-symbol { width: 38px; height: 38px; }
    .permission-position { padding: 14px 12px 14px calc(12px + var(--level) * 12px); }
    .brand { min-width: 0; flex-shrink: 1; }
    .bank-identity strong { font-size: 13px; max-width: 145px; }
    .bank-identity > span { display: none; }
    .account-header { gap: 10px; }
    .profile-avatar { width: 38px; height: 38px; font-size: 12px; }
    .account-header .profile-panel { position: absolute; right: 0; width: min(300px, calc(100vw - 32px)); }
    .directory-page .page-heading { gap: 18px; }
    .toolbox-app .directory-page h1 { font-size: 28px; }
    .toolbox-app .directory-toolbar, .directory-toolbar:has(#user-bank-filter) { grid-template-columns: 1fr; padding: 16px; }
    .directory-summary { gap: 8px 20px; }
    .directory-list-heading { font-size: 12px; }
    .bank-row { grid-template-columns: 1fr; padding: 20px; gap: 18px; }
    .bank-row-access { grid-column: 1; grid-row: auto; padding-left: 60px; }
    .row-actions { grid-column: 1; grid-row: auto; justify-content: space-between; padding-top: 16px; border-top: 1px solid #eee8e4; }
    .row-actions > form { flex: 1; }
    .row-actions > form > button { width: 100%; }
    .user-row-summary { padding: 20px; }
    .user-row-summary > .user-row-actions { grid-column: 1 / -1; grid-row: auto; width: 100%; margin-top: 8px; justify-content: space-between; }
    .user-row-actions > button { width: 100%; justify-content: space-between; }
    .toolbox-app .user-org-link { justify-content: center; min-height: 40px; }
    .fixed-clone-target { margin-top: 20px; padding-bottom: 0; }
    .user-details { grid-template-columns: 1fr; gap: 28px; padding: 20px; }
    .news-showcase, .news-showcase.single .news-lead, .news-archive, .settings-grid { grid-template-columns: 1fr; }
    .news-side { gap: 12px; }
    .news-directory-row { align-items: flex-start; flex-direction: column; }
    .news-row-actions { justify-content: flex-start; max-width: 100%; }
    .news-showcase.single .news-visual .news-hero, .news-showcase.single .news-placeholder { height: 200px; }
    .toolbox-app .dashboard-welcome h1 { font-size: 25px; }
    .dashboard-welcome { margin-bottom: 28px; }
    .dashboard .section-heading { flex-direction: row; align-items: center; }
    .dashboard .section-heading h2 { font-size: 19px; }
    .dashboard .section-heading > a { font-size: 12px; }
    .settings-card { padding: 22px; }
    .profile-details { flex-direction: column; gap: 18px; }
    .topbar-inner { padding: 20px 16px 16px; gap: 16px; }
    .brand img { height: 40px; width: auto; }
    .header-nav { padding: 0 8px; }
    .toolbox-app .header-nav a { padding: 10px 8px; font-size: 11px; }
    .page { padding: 30px 16px 48px; }
    .news-grid, .tool-grid, .admin-grid { grid-template-columns: 1fr; gap: 20px; }
    .admin-grid { gap: 0; }
    .section-heading { align-items: flex-start; flex-direction: column; gap: 12px; }
    .page-heading > button { margin-top: 0; }
    .toolbox-app .html-form .form-grid { grid-template-columns: 1fr; gap: 0; }
    .panel, .news-card-content, .tool-card { padding: 20px; }
    .directory-dialog .mud-dialog-title { padding: 22px 20px 14px; }
    .directory-dialog .mud-dialog-content { padding: 8px 20px 20px; }
    .directory-dialog .mud-dialog-actions { padding: 14px 20px 20px; flex-wrap: wrap; }
    .site-footer > div { padding-left: 16px; padding-right: 16px; }
    .impersonation { padding: 16px; }
}
/* Administration: short, searchable destinations grouped by task. */
.admin-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 24px; margin-bottom: 40px; }
.toolbox-app .admin-heading h1 { margin: 0; color: var(--text); font-size: clamp(28px, 3.3vw, 38px); }
.admin-search { display: flex; align-items: center; gap: 10px; width: 340px; max-width: 100%; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--muted); }
.admin-search > .mud-icon-root { width: 21px; height: 21px; flex-shrink: 0; }
.admin-search input { width: 100%; min-width: 0; min-height: 46px; border: 0; background: transparent; color: var(--text); font: 400 16px var(--font); }
.admin-search input::placeholder { color: var(--muted); }
.admin-search:focus-within { outline: 2px solid var(--pd); outline-offset: 2px; }
.admin-search input:focus-visible { outline: none; }
.admin-sections { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.admin-section:first-child { grid-row: span 2; }
.toolbox-app .admin-section h2 { margin: 0 0 12px; font: 600 13px/1.5 var(--display); color: var(--muted); }
.admin-menu { border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.toolbox-app .admin-menu-item { display: flex; align-items: center; gap: 16px; min-height: 86px; padding: 20px; color: var(--text); font: 600 16px/1.4 var(--font); text-decoration: none; }
.admin-menu-item + .admin-menu-item { border-top: 1px solid var(--line); }
.admin-menu-item:first-child { border-radius: 12px 12px 0 0; }
.admin-menu-item:last-child { border-radius: 0 0 12px 12px; }
.admin-menu-item:only-child { border-radius: 12px; }
.toolbox-app .admin-menu-item:hover { background: var(--pale); color: var(--pd); text-decoration: none; }
.admin-menu-icon { display: grid; place-items: center; width: 42px; height: 42px; flex-shrink: 0; border-radius: 10px; background: var(--pale); color: var(--pd); }
.admin-menu-icon .mud-icon-root { width: 23px; height: 23px; }
.admin-menu-arrow { margin-left: auto; color: var(--muted); width: 20px; flex-shrink: 0; }
.profile-details { position: relative; padding-right: 136px; }
.toolbox-app button.profile-theme-switch { position: absolute; top: 28px; right: 28px; display: flex; gap: 4px; width: 84px; min-height: 44px; padding: 4px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); }
.profile-theme-switch span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--muted); transition: background .2s, color .2s; }
.profile-theme-switch svg { width: 20px; height: 20px; }
.profile-theme-switch[aria-checked="false"] .theme-switch-sun, .profile-theme-switch[aria-checked="true"] .theme-switch-moon { background: var(--pd); color: var(--paper); }
.profile-theme-switch:focus-visible { outline: 2px solid var(--pd); outline-offset: 3px; }
@media (max-width: 700px) {
    .admin-sections { grid-template-columns: 1fr; gap: 28px; }
    .admin-heading { align-items: stretch; flex-direction: column; gap: 20px; margin-bottom: 28px; }
    .admin-search { width: 100%; }
    .profile-details { padding-right: 24px; }
    .profile-details > .person-avatar { margin-right: 96px; }
    .toolbox-app button.profile-theme-switch { top: 24px; right: 24px; }
}

/* Dark surfaces include native controls, editorial content and admin dialogs. */
[data-theme="dark"] .toolbox-app :is(.news-card, .tool-card, .panel, .reading-card, .settings-card, .directory-toolbar, .bank-row, .user-row, .request-row, .dropdown-panel) { background: var(--paper); border-color: var(--line); box-shadow: none; }
[data-theme="dark"] .toolbox-app :is(button:not([class*="mud-"]), .button, .dropdown-panel a) { background: var(--paper); color: var(--pd); border-color: var(--line); }
[data-theme="dark"] .toolbox-app .html-form :is(input:not([type="checkbox"]):not([type="radio"]), textarea, select) { background: var(--paper); color: var(--text); border-color: #737c8e; }
[data-theme="dark"] .toolbox-app :is(button:not([class*="mud-"]), .button, .dropdown-panel a):hover { background: var(--pale); }
[data-theme="dark"] .toolbox-app :is(button.primary, .button.primary, .nr, .tool-icon, .pinned-label) { background: var(--brand-fill); color: var(--on-brand); }
[data-theme="dark"] .toolbox-app :is(button.primary, .button.primary):hover { background: #b13f4c; }
[data-theme="dark"] .toolbox-app :is(.user-details, .tool-card.locked, .directory-empty, .clone-preview, .permission-position.inherited, .tool-access-card, .article-footer) { background: var(--surface); border-color: var(--line); }
[data-theme="dark"] .toolbox-app :is(.intro p, .article-content .news-body) { color: var(--text); }
[data-theme="dark"] .toolbox-app :is(.source-label, .role-chip, .tool-chip, .bank-symbol, .locked .tool-icon, .coming .tool-icon) { background: var(--surface); color: var(--muted); }
[data-theme="dark"] .toolbox-app :is(.user-count, .user-bank, .detail-label, .user-column-headings, .directory-list-heading, .directory-summary) { color: var(--muted); }
[data-theme="dark"] .toolbox-app :is(.news-visual, .article-source) { background: var(--pale); }
[data-theme="dark"] .toolbox-app :is(.error, .validation-message, .validation-errors, .danger) { color: var(--error) !important; }
[data-theme="dark"] .toolbox-app :is(.bank-configuration-summary, .kapa-setting-block, .permission-tree, .permission-position, .version-impact section, .directory-dialog .mud-dialog-actions, .grant-people, .grant-person, .row-actions, .grant-option) { border-color: var(--line); }
[data-theme="dark"] .toolbox-app .grant-option.selected { background: var(--pale); border-color: var(--pd) !important; }
[data-theme="dark"] .toolbox-app :is(.html-form input:disabled, .html-form textarea[readonly], .disabled-request-trigger > button:disabled) { background: var(--surface); color: var(--muted) !important; border-color: var(--line); }
[data-theme="dark"] .toolbox-app .tool-card.coming { background: transparent; }
[data-theme="dark"] .toolbox-app .status-chip { background: var(--surface); color: var(--muted); }
[data-theme="dark"] .toolbox-app .status-chip.enabled { background: #223b30; color: #96d5ad; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
@media print { .header-nav, .impersonation, .site-footer { display: none; } }
