:root {
  color-scheme: light;
  --ink: #273133;
  --muted: #718078;
  --line: #ded9cf;
  --paper: #fffefa;
  --sand: #f7f3eb;
  --brand: #a66a2c;
  --brand-dark: #33433f;
  --danger: #a53b2d;
}

/* Scalable management inventories: approved table/list pattern. */
.rights-surface { min-height: calc(100vh - 254px); }
.rights-heading { margin-bottom: 22px; }
.rights-tabs { display: flex; gap: 28px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.rights-tabs a { flex: none; padding: 0 2px 12px; border-bottom: 3px solid transparent; color: var(--muted); font-size: .86rem; font-weight: 750; text-decoration: none; }
.rights-tabs a.current { border-bottom-color: var(--brand); color: var(--ink); }
.rights-tabs span { display: inline-grid; min-width: 23px; height: 23px; margin-left: 5px; place-items: center; border-radius: 999px; padding: 0 7px; background: #eee4d4; color: #744a20; font-size: .7rem; }
.rights-user-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 20px; padding: 11px 12px 11px 16px; border: 1px solid var(--line); border-radius: 11px; background: #f3eee5; }
.rights-user-toolbar-title { color: var(--muted); font-size: .68rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.rights-user-actions { display: flex; gap: 9px; }
.rights-user-actions .button { display: inline-flex; min-height: 42px; align-items: center; }
.rights-user-button-icon { display: inline-flex; margin-right: 8px; color: var(--brand); }
.rights-user-button-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rights-workspace { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); gap: 20px; align-items: start; padding-top: 22px; }
.rights-table, .rights-detail { border: 1px solid var(--line); border-radius: 11px; background: var(--paper); }
.rights-table { overflow: hidden; }
.rights-detail { overflow: visible; }
.rights-table-head, .rights-row { display: grid; grid-template-columns: minmax(190px, 1.35fr) minmax(145px, .65fr); gap: 16px; align-items: center; }
.rights-table-head { padding: 11px 16px; background: #f2eee5; color: var(--muted); font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.rights-row { min-height: 69px; padding: 12px 16px; border-top: 1px solid #e6e0d6; color: var(--ink); text-decoration: none; }
.rights-row:hover, .rights-row.selected { background: #f8f5ee; }
.rights-row.selected { box-shadow: inset 3px 0 var(--brand); }
.rights-row strong, .rights-row small { display: block; }
.rights-row small { margin-top: 2px; color: var(--muted); font-size: .75rem; }
.rights-status { display: inline-flex; align-items: center; gap: 7px; color: #52615b; font-size: .78rem; font-weight: 700; }
.rights-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.rights-status.pending::before { background: var(--brand); }
.rights-status.danger::before { background: var(--danger); }
.rights-role-columns { grid-template-columns: minmax(190px, 1.35fr) 120px 92px; }
.rights-role-columns > :nth-child(2) { text-align: center; }
.rights-app-columns { grid-template-columns: minmax(190px, 1.35fr) 100px 80px 100px; }
.rights-log-tools { margin-top: 22px; border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: #f8f5ee; }
.rights-log-tool-grid { display: grid; grid-template-columns: minmax(260px,1.6fr) repeat(3,minmax(150px,.7fr)); gap: 12px; }
.rights-log-field { display: grid; gap: 6px; }
.rights-log-field > span:first-child { color: var(--brand); font-size: .66rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.rights-log-control { position: relative; display: block; }
.rights-log-control input, .rights-log-control select { width: 100%; min-height: 46px; border: 1px solid #cfc4b2; border-radius: 9px; padding: 10px 42px 10px 13px; color: var(--ink); background: #fff; font: 500 .85rem system-ui,sans-serif; }
.rights-log-control select { appearance: none; -webkit-appearance: none; }
.rights-log-control > i { position: absolute; right: 16px; top: 50%; width: 9px; height: 9px; transform: translateY(-65%) rotate(45deg); border-right: 2px solid var(--brand); border-bottom: 2px solid var(--brand); pointer-events: none; }
.rights-log-search svg { position: absolute; left: 14px; top: 50%; z-index: 1; width: 17px; height: 17px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.rights-log-search input { padding-left: 42px; }
.rights-log-tool-state { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; }
.rights-log-tool-state strong { color: var(--ink); }
.rights-log-tool-state button { border: 0; padding: 5px 0; color: var(--danger); background: transparent; font: 750 .75rem system-ui,sans-serif; cursor: pointer; }
.rights-log { margin-top: 18px; overflow-x: auto; }
.rights-log-columns { min-width: 820px; grid-template-columns: 150px minmax(165px, .7fr) minmax(220px, 1.2fr) minmax(160px, .7fr); }
.rights-log .rights-row:hover { background: transparent; }
.rights-log time { color: var(--muted); font: .72rem ui-monospace, monospace; }
.rights-log [data-log-rows] { min-width: 820px; }
.rights-log [data-log-entry][hidden], .rights-log-empty[hidden] { display: none; }
.rights-log-change { display: grid; gap: 3px; }
.rights-log-change strong { font-size: .87rem; }
.rights-log-change small { color: var(--muted); font-size: .72rem; }
.rights-log-empty { margin: 0; padding: 38px; text-align: center; }
@media (max-width: 900px) {
  .rights-log-tool-grid { grid-template-columns: 1fr 1fr; }
  .rights-log-search { grid-column: 1 / -1; }
}
@media (max-width: 540px) {
  .rights-log-tools { padding: 13px; }
  .rights-log-tool-grid { grid-template-columns: 1fr; }
  .rights-log-search { grid-column: auto; }
  .rights-log-tool-state { align-items: flex-start; }
}
.rights-badge { justify-self: start; border-radius: 999px; padding: 5px 9px; background: #e3ebe5; color: var(--brand-dark); font-size: .63rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.rights-badge.test { background: #f3e5d5; color: #81501d; }
.rights-badge.draft, .rights-badge.disabled { background: #ebe9e5; color: #686d69; }
.rights-detail { position: sticky; top: 18px; }
.rights-detail > header { padding: 20px 22px; border-bottom: 1px solid var(--line); border-radius: 10px 10px 0 0; background: linear-gradient(100deg, #f3eee5, #fbfaf6); }
.rights-detail > header span { color: var(--brand); font-size: .63rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.rights-detail h2 { margin: 3px 0 0; font: 500 1.65rem/1.15 Georgia, "Times New Roman", serif; }
.rights-detail header p { margin: 4px 0 0; color: var(--muted); font-size: .8rem; }
.rights-detail-tabs { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); border-bottom: 1px solid var(--line); background: #f7f3eb; }
.rights-detail-tabs button { position: relative; min-width: 0; min-height: 45px; border: 0; padding: 11px 6px; color: var(--muted); background: transparent; font: 750 .73rem/1.2 system-ui,sans-serif; cursor: pointer; }
.rights-detail-tabs button::after { content: ""; position: absolute; right: 14px; bottom: -1px; left: 14px; height: 3px; background: transparent; }
.rights-detail-tabs button.current { color: var(--ink); }
.rights-detail-tabs button.current::after { background: var(--brand); }
.rights-detail-tabs button:focus-visible { z-index: 1; outline: 3px solid rgba(166,106,44,.3); outline-offset: -3px; }
.rights-detail-body { padding: 18px 22px 22px; }
.rights-detail-panel[hidden] { display: none; }
.rights-detail-panel > .delegation-admin-panel, .rights-detail-panel > .rights-editor { margin-top: 0; padding-top: 0; border-top: 0; }
.rights-facts { margin: 0 0 16px; }
.rights-facts div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid #ebe5db; font-size: .8rem; }
.rights-facts dt { color: var(--muted); }
.rights-facts dd { margin: 0; font-weight: 700; text-align: right; }
.rights-group { border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.rights-group + .rights-group { margin-top: 8px; }
.rights-group summary { display: flex; min-height: 49px; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 12px; cursor: pointer; font-size: .78rem; font-weight: 750; list-style: none; }
.rights-group summary::-webkit-details-marker { display: none; }
.rights-group summary > span:last-child { display: grid; min-width: 23px; height: 23px; place-items: center; border-radius: 999px; background: #eee4d4; color: #744a20; font-size: .66rem; }
.rights-summary-main { display: inline-flex; min-width: 0; align-items: center; gap: 6px; }
.rights-group ul { margin: 0; padding: 0 16px 13px 31px; color: var(--muted); font-size: .72rem; }
.rights-action-list { list-style: none; padding-left: 14px !important; }
.rights-action-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 34px; border-top: 1px solid #eee8de; }
.rights-action-list li:first-child { border-top: 0; }
.rights-action-list form { flex: none; }
.role-user-list { padding: 0 !important; }
.role-user-list li { display: block; min-height: 0; }
.role-user-link { display: grid; grid-template-columns: 38px minmax(0, 1fr) 22px; align-items: center; gap: 12px; width: 100%; padding: 13px 14px; color: var(--ink); text-decoration: none; }
.role-user-link:hover { background: #f8f5ef; }
.role-user-avatar { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 50%; background: #e7eee9; color: var(--brand-dark); font-size: .85rem; font-weight: 800; }
.role-user-identity { min-width: 0; }
.role-user-identity strong, .role-user-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-user-identity strong { font: 600 .92rem/1.2 Georgia, "Times New Roman", serif; }
.role-user-identity small { margin-top: 3px; color: var(--muted); font-size: .7rem; }
.role-user-arrow { color: var(--brand); font-size: 1.2rem; line-height: 1; text-align: right; }
.role-user-empty { padding: 12px 14px; }
.text-action { border: 0; padding: 5px 0; color: var(--brand); background: transparent; font: inherit; font-weight: 750; cursor: pointer; }
.danger-text { color: var(--danger) !important; }
.rights-editor { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.rights-editor h3 { margin: 15px 0 8px; color: var(--brand); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; }
.rights-inline-form { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
.rights-editor .button:disabled { border-color: #d8d4cc; background: #e8e6e1; color: #96958f; cursor: not-allowed; opacity: 1; }
.assignment-area { border: 1px solid var(--line); border-left: 3px solid var(--brand); border-radius: 12px; padding: 12px; background: #f7f3eb; }
.assignment-area-extra-rights { border-left-color: var(--brand-dark); background: #f0f4f1; }
.assignment-area + .assignment-area { margin-top: 18px; }
.assignment-area .assignment-current-section { margin-bottom: 14px; background: #fffdfa; }
.assignment-area > h3 { margin-top: 0; }
.assignment-role-overview { overflow: hidden; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 10px; background: #fbfaf7; }
.assignment-role-overview-heading { display: flex; min-height: 52px; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #f3efe7; }
.assignment-section-number, .section-card-count { display: inline-grid; min-width: 23px; height: 23px; place-items: center; border-radius: 999px; background: #eadcc8; color: #78491c; font-size: .7rem; font-weight: 800; }
.assignment-section-number { width: 23px; }
.section-card-count { margin-left: auto; padding: 0 7px; }
.section-card-copy { display: block; min-width: 0; }
.section-card-copy strong, .section-card-copy small { display: block; }
.section-card-copy strong { color: var(--brand); font-size: .7rem; font-weight: 800; letter-spacing: .08em; line-height: 1.25; text-transform: uppercase; }
.section-card-copy small { margin-top: 2px; color: var(--muted); font-size: .66rem; font-weight: 500; letter-spacing: normal; line-height: 1.3; text-transform: none; }
.assignment-role-overview ul { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.assignment-role-overview li { padding: 10px 12px; border-top: 1px solid var(--line); color: var(--ink); font-size: .78rem; font-weight: 700; }
.assignment-role-overview li:first-child { border-top: 0; }
.assignment-role-overview li.empty { color: var(--muted); font-weight: 500; }
.assignment-current-section { overflow: hidden; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 10px; background: #fbfaf7; }
.rights-inline-form + .assignment-current-section { margin-top: 18px; }
.assignment-current-section > .rights-action-list { margin: 0; padding: 0 12px !important; }
.assignment-current-section .rights-action-list li { padding: 9px 0; }
.role-impact-note { display: grid; gap: 3px; margin-bottom: 14px; border-left: 3px solid var(--brand); border-radius: 7px; padding: 10px 12px; background: #f5f1e8; }
.role-impact-note strong { color: var(--brand); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; }
.role-impact-note span { color: var(--muted); font-size: .72rem; line-height: 1.4; }
.rights-stack-form { display: grid; gap: 8px; }
.rights-inline-form select, .rights-stack-form select, .rights-stack-form input, .rights-create-form input { width: 100%; min-height: 42px; border: 1px solid #cbc2b2; border-radius: 8px; padding: 8px 11px; color: var(--ink); background: #fff; font: .82rem system-ui, sans-serif; }
.rights-inline-form .select-shell select, .rights-stack-form .select-shell select { appearance: none; -webkit-appearance: none; padding-right: 2.6rem; }
.rights-stack-form label { display: grid; gap: 4px; color: var(--muted); font-size: .7rem; font-weight: 700; }
.rights-edit-details { margin-bottom: 14px; }
.rights-edit-details > summary { color: var(--brand); font-size: .72rem; font-weight: 800; cursor: pointer; }
.rights-edit-details[open] > summary { margin-bottom: 9px; }
.rights-secondary-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.rights-create-panel { margin-top: 18px; }
.rights-create-panel > summary { display: inline-flex; min-height: 44px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 11px 16px; color: var(--brand-dark); background: #f8f5ee; font-size: .8rem; font-weight: 800; cursor: pointer; list-style: none; }
.rights-create-panel > summary::-webkit-details-marker { display: none; }
.rights-create-panel .open-label { display: none; }
.rights-create-panel[open] .closed-label { display: none; }
.rights-create-panel[open] .open-label { display: inline; }
.rights-create-form { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 4px 16px 17px; background: #f8f5ee; }
.rights-create-form label { display: grid; gap: 5px; padding-top: 12px; color: var(--ink); font-size: .72rem; font-weight: 700; }
.rights-create-form .button { align-self: end; justify-self: start; }
.rights-role-form { display: block; }
.rights-role-form > .rights-primary-field { display: grid; max-width: 520px; gap: 6px; padding-top: 12px; color: var(--ink); font-size: .72rem; font-weight: 700; }
.rights-role-form small, .rights-translation-details > p { color: var(--muted); font-size: .72rem; font-weight: 500; line-height: 1.45; }
.rights-translation-details { max-width: 720px; margin: 14px 0; padding: 0; }
.rights-translation-details > summary { color: var(--brand); cursor: pointer; font-size: .76rem; font-weight: 800; }
.rights-translation-details > p { margin: 8px 0 0; }
.rights-translation-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.rights-translation-grid label { display: grid; gap: 5px; padding-top: 10px; color: var(--ink); font-size: .72rem; font-weight: 700; }
.rights-translation-grid label span { color: var(--muted); font-weight: 500; }
.rights-role-form > .button { margin-top: 2px; }
.plain-action { display: inline-flex; margin-top: 18px; color: var(--brand); font-size: .8rem; font-weight: 750; text-decoration: none; }
.delegation-scope-note { display: grid; gap: 4px; margin-top: 20px; padding: 15px 17px; border-left: 4px solid var(--brand-dark); border-radius: 9px; background: #e7eee9; color: var(--brand-dark); font-size: .8rem; line-height: 1.5; }
.delegation-scope-note strong { font: 600 .96rem/1.25 Georgia, "Times New Roman", serif; }
.delegation-admin-panel { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.delegation-admin-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.delegation-admin-heading .eyebrow { margin: 0 0 3px; }
.delegation-admin-heading h3 { margin: 0; font: 500 1.15rem/1.25 Georgia, "Times New Roman", serif; }
.delegation-eyebrow-line { display: flex; align-items: center; gap: 6px; }
.delegation-eyebrow-line > .rights-help { margin-left: 0; }
.delegation-review-badge { flex: none; border-radius: 999px; padding: 5px 9px; background: #f5ded9; color: #7c3028; font-size: .65rem; font-weight: 800; }
.delegation-admin-form { display: grid; gap: 14px; }
.delegation-admin-form fieldset { min-width: 0; margin: 0; border: 0; padding: 0; }
.delegation-admin-form legend { width: 100%; margin-bottom: 9px; color: var(--brand); font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.delegation-admin-form legend > span:first-child { vertical-align: middle; }
.delegation-admin-form .delegation-section { overflow: visible; border: 1px solid var(--line); border-radius: 11px; padding: 0 12px 14px; }
.delegation-admin-form .delegation-section > legend { display: flex; width: calc(100% + 24px); min-height: 48px; margin: 0 0 13px -12px; align-items: center; padding: 11px 13px; border-bottom: 1px solid var(--line); border-radius: 10px 10px 0 0; }
.delegation-admin-form .delegation-section > legend .rights-help { margin-left: auto; }
.delegation-section-number { display: inline-grid; width: 21px; min-width: 21px; height: 21px; margin-right: 8px; place-items: center; border-radius: 50%; background: #eadcc8; color: #78491c; font-size: .66rem; letter-spacing: normal; }
.delegation-section-system { background: #f7faf8; }
.delegation-section-system > legend { background: #e8efeb; }
.delegation-section-roles { background: #fffdf9; }
.delegation-section-roles > legend { background: #f5ede1; }
.delegation-section-extra { background: #faf8f3; }
.delegation-section-extra > legend { background: #f1eee8; }
.rights-help { position: relative; display: inline-flex; margin-left: 6px; vertical-align: middle; }
.rights-help-button { display: inline-grid; width: 19px; min-width: 19px; height: 19px; min-height: 19px; padding: 0; place-items: center; border: 1px solid #b9aa96; border-radius: 50%; background: var(--paper); color: var(--brand); font: 700 12px/1 Georgia, "Times New Roman", serif; cursor: pointer; }
.rights-help-button:hover { background: #f5f0e7; }
.rights-help-button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.rights-help-tooltip { position: absolute; z-index: 10; top: 27px; right: -8px; width: 280px; max-width: calc(100vw - 64px); padding: 13px 14px; border: 1px solid #cdbda8; border-radius: 9px; background: var(--paper); box-shadow: 0 14px 30px rgba(39,49,51,.15); color: var(--ink); font: 500 .72rem/1.5 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; letter-spacing: normal; text-align: left; text-transform: none; }
.rights-help-tooltip[hidden] { display: none; }
.delegation-system-rights { display: grid; gap: 8px; }
.delegation-switch { display: grid; grid-template-columns: 40px minmax(0,1fr); gap: 12px; align-items: start; padding: 13px; border: 1px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer; }
.delegation-switch input { appearance: none; width: 38px; height: 22px; margin: 0; border-radius: 999px; background: #c7cec9; cursor: pointer; position: relative; }
.delegation-switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s ease; }
.delegation-switch input:checked { background: var(--brand-dark); }
.delegation-switch input:checked::after { left: 19px; }
.delegation-switch input:focus-visible { outline: 3px solid rgba(166,106,44,.3); outline-offset: 2px; }
.delegation-switch strong, .delegation-switch small { display: block; }
.delegation-switch strong { font-size: .8rem; }
.delegation-switch small { margin-top: 3px; color: var(--muted); font-size: .7rem; line-height: 1.4; }
.delegation-boundary { margin-top: 0 !important; }
.delegation-chip-list { display: flex; flex-wrap: wrap; gap: 7px; }
.delegation-chip { position: relative; cursor: pointer; }
.delegation-chip input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.delegation-chip span { display: block; border: 1px solid #d5c4aa; border-radius: 999px; padding: 7px 10px; background: #f8f5ee; color: var(--ink); font-size: .7rem; font-weight: 700; }
.delegation-chip.right span { border-color: #c8d9d0; background: #e7eee9; color: var(--brand-dark); }
.delegation-chip input:not(:checked) + span { border-style: dashed; background: #fff; color: var(--muted); }
.delegation-chip input:focus-visible + span { outline: 3px solid rgba(166,106,44,.3); outline-offset: 2px; }
.delegation-role-picker { display: grid; gap: 9px; }
.delegation-role-summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .7rem; }
.delegation-role-summary strong { font-weight: 750; }
.delegation-role-summary button { border: 0; padding: 0; background: transparent; color: var(--danger); font: 750 .68rem/1.2 system-ui,sans-serif; cursor: pointer; }
.delegation-role-summary button:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.delegation-role-search { display: flex; min-height: 39px; align-items: center; gap: 8px; border: 1px solid #cbc2b2; border-radius: 8px; padding: 0 10px; background: #fff; color: var(--brand); }
.delegation-role-search svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.8; }
.delegation-role-search input { width: 100%; min-width: 0; border: 0; outline: 0; padding: 0; background: transparent; color: var(--ink); font: .75rem system-ui,sans-serif; }
.delegation-role-list { max-height: 286px; overflow-y: auto; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.delegation-role-list label { display: grid; grid-template-columns: 19px minmax(0,1fr); gap: 9px; align-items: center; min-height: 52px; padding: 8px 10px; border-top: 1px solid #eee8de; cursor: pointer; }
.delegation-role-list label:first-child { border-top: 0; }
.delegation-role-list label:has(input:checked) { background: #edf3ef; }
.delegation-role-list input { width: 16px; height: 16px; margin: 0; accent-color: var(--brand-dark); }
.delegation-role-list strong, .delegation-role-list small { display: block; }
.delegation-role-list strong { font-size: .73rem; line-height: 1.25; }
.delegation-role-list small { margin-top: 2px; color: var(--muted); font-size: .65rem; line-height: 1.35; }
.delegation-role-more { margin: 0; color: var(--muted); font-size: .62rem; text-align: center; }
.delegation-summary { overflow: hidden; margin-top: 0; border-radius: 9px; background: var(--brand-dark); color: #fff; }
.delegation-summary > p { margin: 0; border-left: 4px solid #c58a4f; border-bottom: 1px solid rgba(255,255,255,.2); padding: 11px 14px 11px 10px; background: rgba(255,255,255,.08); color: #c58a4f; font-size: .76rem; font-weight: 750; letter-spacing: .025em; }
.delegation-summary dl { margin: 0; padding: 4px 14px 7px; }
.delegation-summary dl > div { display: flex; min-height: 38px; align-items: center; justify-content: space-between; gap: 16px; padding: 7px 0; }
.delegation-summary dl > div + div { border-top: 1px solid rgba(255,255,255,.14); }
.delegation-summary dt { color: rgba(255,255,255,.86); font-size: .72rem; font-weight: 700; }
.delegation-summary dd { display: inline-grid; min-width: 28px; height: 28px; margin: 0; place-items: center; border-radius: 999px; background: rgba(255,255,255,.12); font-size: .76rem; font-weight: 800; }
.delegation-warning { margin-top: 10px; border: 1px solid #d9aaa3; border-left: 4px solid var(--danger); border-radius: 8px; padding: 11px 13px; background: #fbf1ef; color: #73302a; font-size: .72rem; line-height: 1.45; }
.delegation-change-status { display: flex; min-height: 32px; align-items: center; justify-content: flex-end; gap: 7px; color: var(--muted); font-size: .68rem; }
.delegation-change-status > span { display: inline-grid; width: 18px; height: 18px; place-items: center; border-radius: 50%; background: #e5ebe7; color: var(--brand-dark); font-size: .68rem; }
.delegation-change-status.dirty { color: #85531f; }
.delegation-change-status.dirty > span { background: #f4e7d4; color: #a6662c; }
.delegation-change-status.dirty > span::before { content: "•"; }
.delegation-change-status.dirty > span { font-size: 0; }
.delegation-change-status.dirty > span::before { font-size: 1rem; }
.delegation-change-status.saved { color: #365c4f; }
.delegation-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 0; }
.delegation-actions button:disabled { border-color: #d8d4cc; background: #e8e6e1; color: #96958f; cursor: not-allowed; opacity: 1; }
.delegation-empty { margin: 0; border-radius: 8px; padding: 11px 12px; background: #f5f1e8; color: var(--muted); font-size: .73rem; line-height: 1.45; }
.delegation-protected { flex: none; max-width: 150px; border-radius: 7px; padding: 6px 8px; background: #f2eee5; color: var(--muted); font-size: .64rem; font-weight: 700; line-height: 1.3; text-align: center; }
.rights-action-list li > span:first-child small { display: block; margin-top: 2px; color: var(--muted); font-size: .64rem; }
@media (max-width: 900px) { .rights-workspace { grid-template-columns: 1fr; } .rights-detail { position: static; } .rights-create-form { grid-template-columns: 1fr 1fr; } }
@media (max-width: 660px) { .rights-role-columns, .rights-app-columns { grid-template-columns: minmax(0, 1fr) auto; } .rights-table-head { display: none; } .rights-role-columns > :nth-child(2), .rights-app-columns > :nth-child(2), .rights-app-columns > :nth-child(3) { display: none; } .rights-heading .compact-action { width: 100%; text-align: center; } .rights-user-toolbar { align-items: stretch; flex-direction: column; } .rights-user-actions { display: grid; } .rights-user-actions .button { width: 100%; justify-content: center; text-align: center; } .rights-create-form { grid-template-columns: 1fr; } .rights-inline-form, .rights-translation-grid { grid-template-columns: 1fr; } .rights-detail-tabs { overflow-x: auto; grid-template-columns: repeat(3,minmax(102px,1fr)); } .rights-help-tooltip { right: -4px; width: min(260px,calc(100vw - 72px)); } .delegation-actions { display: grid; grid-template-columns: 1fr 1fr; } .delegation-actions button { width: 100%; } .rights-action-list li { align-items: flex-start; flex-direction: column; padding: 9px 0; } .delegation-protected { max-width: none; text-align: left; } }

/* Freigegebene Sicherheits- und Kontaktkarten. */
.security-card { max-width: 960px; margin: 0 auto; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fdfbf7; box-shadow: 0 10px 26px rgba(39,49,51,.055); }
.security-card-head { display: grid; grid-template-columns: 54px minmax(0,1fr) auto; gap: 18px; align-items: center; padding: 22px 24px; border-bottom: 1px solid var(--line); background: linear-gradient(100deg,#f3eee5,#fbfaf6); }
.security-card-head strong, .security-card-head small { display: block; }
.security-card-head strong { margin-bottom: 3px; font: 500 1.38rem/1.2 Georgia,"Times New Roman",serif; }
.security-card-head small { color: var(--muted); font-size: .84rem; }
.security-card-icon { display: grid; width: 54px; height: 54px; place-items: center; border-radius: 12px; color: var(--brand-dark); background: #e8eee9; font-size: 1.45rem; font-weight: 800; }
.security-badge { border-radius: 999px; padding: 6px 10px; color: var(--brand-dark); background: #e3ebe5; font-size: .65rem; font-weight: 800; letter-spacing: .06em; }
.security-card-body { padding: 26px 24px 28px; }
.form-grid { display: grid; gap: 19px 18px; }
.form-grid.two-columns { grid-template-columns: 1fr 1fr; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid .field { margin: 0; }
.form-grid .field-label { display: flex; min-height: 1.35rem; align-items: baseline; gap: .42rem; }
.form-grid .help { margin-top: 6px; color: var(--muted); font-size: .75rem; line-height: 1.4; }
.optional { color: var(--muted); font-size: .75rem; font-weight: 500; }
.input-suffix { display: grid; grid-template-columns: minmax(0,1fr) auto; }
.input-suffix input { border-radius: 9px 0 0 9px; }
.input-suffix span { display: grid; place-items: center; border: 1px solid #cbc2b2; border-left: 0; border-radius: 0 9px 9px 0; padding: 0 .9rem; color: var(--muted); background: #f3eee5; font-weight: 700; }
.select-shell { position: relative; }
.select-shell select { width: 100%; min-height: 49px; appearance: none; -webkit-appearance: none; border: 1px solid #cbc2b2; border-radius: 9px; padding: .8rem 3rem .8rem .9rem; color: var(--ink); background: #fff; font: 16px/1.4 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; }
.select-shell select:disabled { color: var(--muted); background: #f0eee9; }
.select-shell i { position: absolute; top: 50%; right: 16px; width: 8px; height: 8px; border-right: 2px solid var(--brand); border-bottom: 2px solid var(--brand); pointer-events: none; transform: translateY(-68%) rotate(45deg); }
.rights-stack-form .select-shell select { min-height: 42px; padding: .55rem 2.6rem .55rem .8rem; font: .82rem system-ui, sans-serif; }
.security-actions { margin-top: 24px; }
.create-user-layout { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(250px,.75fr); }
.create-user-main { padding: 26px 24px 28px; }
.create-user-actions { display: flex; align-items: center; gap: 13px; margin-top: 21px; padding-top: 20px; border-top: 1px solid var(--line); }
.create-user-actions small { max-width: 330px; color: var(--muted); font-size: .75rem; line-height: 1.4; }
.create-user-actions button:disabled { border-color: #d8d4cc; background: #e8e6e1; color: #96958f; cursor: not-allowed; opacity: 1; }
.field-requirement { margin-left: auto; border-radius: 999px; padding: 3px 7px; font-size: .62rem; font-weight: 800; line-height: 1.2; }
.field-requirement.required { background: #ede5d8; color: #75491e; }
.field-requirement.automatic { background: #e5eee9; color: #365b4e; }
.form-section + .form-section { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.form-section-title { margin: 0 0 15px; color: var(--brand); font-size: .72rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.process-aside { padding: 26px 24px; border-left: 1px solid var(--line); background: #f3eee5; }
.process-aside h2 { margin: 0 0 18px; font: 500 1.18rem/1.2 Georgia,"Times New Roman",serif; }
.process-aside ol { display: grid; gap: 18px; margin: 0; padding: 0; list-style: none; }
.process-aside li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; color: var(--muted); font-size: .8rem; line-height: 1.42; }
.process-aside li b { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; color: #fff; background: var(--brand-dark); font-size: .72rem; }
.delivery-state { margin: 22px 0 0; border-radius: 9px; padding: 13px 14px; color: var(--brand-dark); background: #e3ebe5; font-size: .78rem; line-height: 1.42; }
.two-factor-default-note { margin: 0; border: 1px solid var(--line); border-radius: 9px; padding: 13px 14px; color: var(--muted); background: #f3eee5; font-size: .78rem; line-height: 1.45; }
.settings-summary { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); background: #f3eee5; }
.settings-summary > div { padding: 18px 24px; }
.settings-summary > div + div { border-left: 1px solid var(--line); }
.settings-summary small, .settings-summary strong, .settings-summary em { display: block; }
.settings-summary small { margin-bottom: 5px; color: var(--muted); font-size: .68rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.settings-summary strong { font-size: .9rem; }
.settings-summary em { margin-top: 4px; color: var(--brand); font-size: .72rem; font-style: normal; }
.clean-session { display: grid; grid-template-columns: 54px minmax(0,1fr) auto; gap: 18px; align-items: center; padding: 22px 24px; }
.clean-session + .clean-session { border-top: 1px solid var(--line); }
.clean-session strong, .clean-session p, .clean-session small { display: block; }
.clean-session p { margin: 3px 0; color: var(--muted); font-size: .8rem; }
.clean-session small { color: #87918b; font-size: .72rem; }
.session-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 24px; border-top: 1px solid var(--line); background: #f3eee5; }
.session-card-footer p { margin: 0; color: var(--muted); font-size: .78rem; }
.identity-row { display: flex; align-items: center; gap: 14px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.identity-row strong, .identity-row small { display: block; }
.identity-row small { margin-top: 2px; color: var(--muted); }
.security-hint { display: flex; gap: 10px; margin: 16px 0 0; color: var(--muted); font-size: .8rem; }
.security-hint b { color: var(--brand); }

@media (max-width: 760px) {
  .security-card-head { grid-template-columns: 46px minmax(0,1fr); padding: 18px; }
  .security-card-head .security-badge { grid-column: 2; justify-self: start; }
  .security-card-icon { width: 46px; height: 46px; }
  .security-card-body, .create-user-main { padding: 20px 18px 22px; }
  .create-user-actions { align-items: stretch; flex-direction: column; }
  .create-user-actions button { width: 100%; }
  .form-grid.two-columns, .create-user-layout, .settings-summary { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .process-aside { border-top: 1px solid var(--line); border-left: 0; }
  .settings-summary > div + div { border-top: 1px solid var(--line); border-left: 0; }
  .clean-session { grid-template-columns: 46px minmax(0,1fr); padding: 18px; }
  .clean-session form { grid-column: 1 / -1; }
  .clean-session form button { width: 100%; }
  .session-card-footer { align-items: stretch; flex-direction: column; padding: 18px; }
  .session-card-footer button { width: 100%; }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(145deg, var(--sand) 0%, #f0ebe3 52%, #ecebe3 100%);
  font: 16px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.stage {
  width: min(560px, calc(100% - 2rem));
  margin: clamp(18px, 6vh, 72px) auto 7vh;
  padding: 0;
  overflow: hidden;
  background: rgba(255, 254, 250, 0.98);
  border: 1px solid rgba(222, 217, 207, 0.96);
  border-top: 3px solid var(--brand);
  border-radius: 18px;
  box-shadow: 0 28px 76px rgba(57, 51, 41, 0.13);
}

.hero {
  min-height: 188px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 28px 34px 24px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(145deg, #f4eee3 0%, #faf7f0 52%, #edf1eb 100%);
}

.brand-signature {
  display: grid;
  width: 214px;
  justify-items: center;
}

.brand-logo {
  display: block;
  width: 214px;
  height: auto;
}

.brand-suffix {
  display: flex;
  align-items: center;
  width: 170px;
  margin-top: -2px;
  gap: 7px;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1;
}

.brand-suffix::before,
.brand-suffix::after {
  content: "";
  display: block;
  flex: 1;
  height: 1px;
  background: currentColor;
  opacity: 0.75;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 17px;
}

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  padding: 0.26rem 0.62rem;
  text-decoration: none;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.chip:hover { border-color: rgba(166, 106, 44, 0.5); }

.chip.is-active {
  border-color: #afc4be;
  color: var(--brand-dark);
  background: rgba(255, 254, 250, 0.88);
}

.public-language {
  position: relative;
  z-index: 10;
  margin-top: 17px;
}

.public-language summary {
  min-width: 142px;
  min-height: 39px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 7px 13px;
  border: 1px solid #cfc7ba;
  border-radius: 9px;
  background: rgba(255, 254, 250, .9);
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  font-size: 13px;
  font-weight: 600;
}

.public-language summary::-webkit-details-marker { display: none; }
.public-language summary i {
  width: 8px;
  height: 8px;
  margin: 0 0 4px 3px;
  border-right: 2px solid var(--brand);
  border-bottom: 2px solid var(--brand);
  transform: rotate(45deg);
}
.public-language[open] summary i { margin: 4px 0 0 3px; transform: rotate(225deg); }

.public-language-panel {
  position: absolute;
  top: calc(100% + 5px);
  left: 50%;
  width: 166px;
  overflow: hidden;
  transform: translateX(-50%);
  border: 1px solid #cfc7ba;
  border-radius: 9px;
  background: linear-gradient(155deg, #f4eee3 0%, #faf7f0 100%);
  box-shadow: 0 9px 18px rgba(57, 51, 41, .16);
}
.public-language-panel a {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 9px 14px;
  color: var(--ink);
  font-size: 13px;
  text-decoration: none;
}
.public-language-panel a:hover { background: rgba(255, 254, 250, .75); }

.panel {
  margin: 0;
  padding: 32px 38px 36px;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.panel + .panel { border-top: 1px solid var(--line); }

.panel.narrow { width: 100%; }
.auth-card,
.form-card {
  width: 100%;
  margin: 0;
}

.narrow { max-width: 580px; }

h1 {
  margin: 0 0 .62rem;
  font: 500 2.2rem/1.06 Georgia, "Times New Roman", serif;
}

h1 + p { color: var(--muted); margin: 0 0 1rem; }

p { color: var(--muted); margin: 0 0 0.9rem; }

.eyebrow {
  color: var(--brand-dark);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  margin: 0 0 0.4rem;
}

.field {
  margin: 0 0 1rem;
}

.checkbox-field label {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 36px;
  margin: -0.2rem 0 0.75rem;
  color: var(--ink);
  cursor: pointer;
}

.checkbox-field input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--brand-dark);
}

label {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid #c6c0b0;
  border-radius: 9px;
  padding: 0.75rem;
  background: #fff;
  color: var(--ink);
  font: 16px/1.4 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

input:focus,
textarea:focus {
  border-color: var(--brand);
  outline: 3px solid rgba(166, 106, 44, 0.16);
}

button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  background: var(--brand-dark);
  color: #fffdf7;
  cursor: pointer;
  font: 700 0.96rem/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-decoration: none;
}

button:hover { filter: brightness(0.98); }
button:disabled { opacity: 0.65; cursor: not-allowed; }

.secondary {
  background: transparent;
  color: var(--brand-dark);
  border: 1px solid var(--line);
}

.quiet {
  background: transparent;
  color: var(--brand-dark);
  border: 1px solid var(--line);
}

.danger {
  background: var(--danger);
}

.actions, .button-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin: 1rem 0 0.25rem;
}

.actions form { margin: 0; }

.messages { margin: 0; padding: 24px 38px 0; }

.message {
  border-left: 4px solid var(--brand);
  padding: 0.65rem 0.8rem;
  background: #f4f2ea;
  color: var(--ink);
  margin: 0;
}

.error {
  color: #8e2b25;
  margin: 0.35rem 0 0;
}

.form-alert {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: start;
  gap: 0.75rem;
  margin: 0 0 1.15rem;
  padding: 0.85rem 1rem;
  border: 1px solid #e4c5bd;
  border-left: 4px solid var(--danger);
  border-radius: 9px;
  background: #f8ebe7;
  color: #702b24;
}

.form-alert-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  font-weight: 800;
  line-height: 1;
}

.form-alert strong { display: block; margin: 0 0 0.2rem; }
.form-alert p { margin: 0; color: inherit; font-size: 0.9rem; line-height: 1.45; }

.help {
  color: var(--muted);
  margin-top: 0.45rem;
  font-size: 0.87rem;
}

.help ul { margin: 0.35rem 0 0; padding-left: 1.1rem; }

.back {
  color: var(--brand-dark);
  text-decoration: none;
  font-weight: 700;
}

.back:hover { text-decoration: underline; }

.qr {
  width: min(260px, 100%);
  margin: 1rem 0;
  padding: 0.75rem;
  background: white;
  border: 1px solid var(--line);
}

.qr svg { display: block; width: 100%; height: auto; }

.activation-stage { width: min(980px, calc(100% - 2rem)); }
.activation-setup-card { padding: 38px 42px 44px; }
.activation-setup-card > h1 { font-size: 2.55rem; }
.activation-setup-card > h1 + p { margin-bottom: 1.7rem; }
.activation-step-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: stretch; }
.activation-step { display: flex; min-width: 0; flex-direction: column; border: 1px solid var(--line); border-radius: 11px; background: #faf8f2; }
.activation-step > header { position: relative; min-height: 132px; padding: 17px 18px 15px; border-bottom: 1px solid var(--line); }
.activation-step > header > div { display: flex; align-items: center; gap: 9px; padding-right: 82px; }
.activation-step h2 { margin: 0; font: 500 1.28rem/1.2 Georgia, "Times New Roman", serif; }
.activation-step header p { margin: 7px 0 0; font-size: .78rem; line-height: 1.45; }
.step-number { display: inline-grid; width: 23px; height: 23px; flex: 0 0 23px; place-items: center; border-radius: 50%; background: #eee4d4; color: #744a20; font-size: .72rem; font-weight: 800; }
.requirement { position: absolute; top: 17px; right: 16px; padding: 5px 8px; border-radius: 999px; font-size: .58rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.requirement.required { background: #ede5d8; color: #75491e; }
.requirement.optional { background: #e5eee9; color: #365b4e; }
.activation-step-body { flex: 1; padding: 20px; }
.activation-step-body .field:last-child { margin-bottom: 0; }
.two-factor-choices { display: grid; gap: 12px; }
.two-factor-help { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.two-factor-help > strong { color: var(--brand-dark); font-size: .82rem; }
.two-factor-info { position: relative; display: inline-grid; width: 22px; min-width: 22px; height: 22px; min-height: 22px; padding: 0; place-items: center; border: 1px solid #b9aa96; border-radius: 50%; background: var(--paper); color: var(--brand); font: 700 14px/1 Georgia, "Times New Roman", serif; }
.two-factor-info:hover { background: #f5f0e7; }
.two-factor-info:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.two-factor-tooltip { position: absolute; z-index: 8; top: -12px; right: 31px; left: auto; width: 340px; max-width: calc(100vw - 48px); padding: 16px; border: 1px solid #cdbda8; border-radius: 9px; background: var(--paper); box-shadow: 0 14px 30px rgba(39,49,51,.15); color: var(--ink); font: 400 .78rem/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; text-align: left; }
.two-factor-tooltip[hidden] { display: none; }
.two-factor-tooltip > strong { display: block; margin-bottom: 7px; font: 500 1rem/1.25 Georgia, "Times New Roman", serif; }
.two-factor-tooltip > span { display: block; }
.two-factor-tooltip ol { margin: 8px 0 0; padding-left: 20px; }
.choice-button { display: block; width: 100%; min-height: 76px; padding: 15px 17px; border: 1px solid #cfc5b3; background: #fffefa; color: var(--ink); text-align: left; }
.choice-button strong, .choice-button small { display: block; }
.choice-button small { margin-top: 5px; color: var(--muted); font-size: .76rem; font-weight: 500; line-height: 1.35; }
.choice-button.selected { border-color: #879d95; background: #edf2ed; box-shadow: 0 0 0 2px rgba(51,67,63,.08); }
.two-factor-setup { margin-top: 16px; }
.two-factor-setup[hidden] { display: none; }
.compact-qr { width: min(210px, 100%); margin: 0 auto 16px; }
.activation-submit { display: flex; justify-content: flex-end; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.structured-errors { margin-top: 14px; padding: 13px 15px; border: 1px solid #d9aaa3; border-left: 4px solid var(--danger); border-radius: 8px; background: #fbf1ef; color: #73302a; font-size: .78rem; line-height: 1.45; }
.structured-errors strong { display: block; margin-bottom: 5px; }
.structured-errors ul { margin: 0; padding-left: 18px; }
.security-status-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; max-width: 900px; padding: 22px; border: 1px solid var(--line); border-radius: 11px; background: #f7f4ed; }
.security-status-card h2 { margin: 0; font: 500 1.35rem/1.25 Georgia, "Times New Roman", serif; }
.security-status-card p { margin: 6px 0 0; font-size: .84rem; }
.security-status { display: inline-flex; margin-bottom: 10px; padding: 5px 9px; border-radius: 999px; font-size: .64rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.security-status.active { background: #dfece5; color: #2f634f; }
.security-status.inactive { background: #ede7dc; color: #6f5941; }
.security-actions { display: flex; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.secondary-button { border: 1px solid #cfc5b3; background: #fffefa; color: var(--brand-dark); }
.danger-outline { border: 1px solid #d8aaa2; background: #fffefa; color: var(--danger); }
.security-note { max-width: 900px; margin-top: 15px; font-size: .78rem; line-height: 1.5; }
.two-factor-manage-grid { display: grid; grid-template-columns: minmax(220px, 300px) minmax(300px, 520px); gap: 26px; align-items: start; }
.manage-qr { width: 100%; margin: 0; }
.security-form { max-width: 520px; padding: 22px; border: 1px solid var(--line); border-radius: 11px; background: #f7f4ed; }
.warning-form { border-left: 4px solid var(--danger); }
.danger-button { background: var(--danger); }

.session-list { display: grid; gap: 0.75rem; margin: 1rem 0; }

.session {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.9rem;
}

.session small {
  display: block;
  color: var(--muted);
  margin-top: 0.25rem;
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .two-factor-tooltip { top: 31px; right: -10px; left: auto; width: min(310px, calc(100vw - 72px)); }

  .stage {
    width: calc(100% - 1rem);
    margin: 14px auto 5vh;
    border-radius: 15px;
  }

  .hero {
    min-height: 150px;
    padding: 22px 24px 19px;
  }

  .brand-logo {
    width: 174px;
  }

  .brand-signature { width: 174px; }

  .brand-suffix {
    width: 139px;
    font-size: 7px;
  }

  .panel,
  .panel.narrow,
  .auth-card,
  .form-card {
    padding: 26px 24px 30px;
  }

  h1 {
    font-size: 1.8rem;
  }

  .session { align-items: flex-start; flex-direction: column; }
  .activation-stage { width: calc(100% - 1rem); }
  .activation-setup-card { padding: 26px 20px 30px; }
  .activation-setup-card > h1 { font-size: 2rem; }
  .activation-step-grid { grid-template-columns: 1fr; }
  .activation-step > header { min-height: 0; }
  .activation-submit { align-items: stretch; flex-direction: column; }
}

/* Verbindlicher Rahmen fuer angemeldete interne Anwendungen. */
.internal-stage {
  width: min(1180px, calc(100% - 2rem));
  min-height: calc(100vh - 4rem);
  margin: 2rem auto;
  border-radius: 14px;
}

.internal-header {
  min-height: 132px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 18px 38px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(145deg, #f4eee3 0%, #faf7f0 52%, #edf1eb 100%);
}

.internal-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.internal-title span,
.internal-content .eyebrow,
.internal-section-title {
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.internal-title strong {
  color: var(--ink);
  font: 500 34px/1.08 Georgia, "Times New Roman", serif;
  letter-spacing: -.015em;
}

.internal-brand {
  width: 112px;
  flex: 0 0 112px;
  padding: 9px 0;
}

.internal-brand .brand-logo { width: 104px; }
.internal-brand .brand-suffix {
  width: 84px;
  margin-top: 2px;
  gap: 7px;
  color: var(--danger);
  font-size: 5px;
  font-weight: 650;
}

.internal-brand .brand-suffix::before,
.internal-brand .brand-suffix::after {
  color: #111;
  opacity: .45;
  transform: scaleY(.45);
}

.internal-tools {
  min-height: 58px;
  display: flex;
  align-items: stretch;
  padding-left: 38px;
  border-bottom: 1px solid #cfc9bd;
  background: linear-gradient(90deg, #f7f2e9 0%, #edf1eb 100%);
  box-shadow: 0 3px 9px rgba(57, 51, 41, .06);
}

.breadcrumbs {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
}

.breadcrumbs a { color: var(--ink); text-decoration: none; font-weight: 650; }
.breadcrumbs a:first-child::first-letter { color: var(--brand); }
.breadcrumbs .current { overflow: hidden; text-overflow: ellipsis; }
.breadcrumbs .separator { color: #aaa79f; }

.internal-menus { margin-left: auto; display: flex; align-items: stretch; }
.menu { position: relative; border-left: 1px solid rgba(207, 201, 189, .85); }
.menu summary {
  height: 57px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 18px;
  cursor: pointer;
  list-style: none;
  color: var(--ink);
  font-size: 14px;
}
.menu summary::-webkit-details-marker { display: none; }
.menu summary i {
  width: 8px;
  height: 8px;
  margin-left: 3px;
  border-right: 2px solid var(--brand);
  border-bottom: 2px solid var(--brand);
  transform: rotate(45deg) translateY(-2px);
}
.menu[open] > summary i { transform: rotate(225deg) translate(-2px, -1px); }
.menu-panel {
  position: absolute;
  top: 57px;
  right: 0;
  z-index: 20;
  min-width: 220px;
  overflow: hidden;
  border: 1px solid #cfc7ba;
  border-top: 0;
  border-radius: 0 0 0 10px;
  background: linear-gradient(155deg, #f4eee3 0%, #faf7f0 100%);
  box-shadow: 0 9px 18px rgba(57, 51, 41, .16);
}
.menu-panel a,
.menu-panel button {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: 500 13px/1.3 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-align: left;
  text-decoration: none;
}
.menu-panel a:hover { background: rgba(255, 254, 250, .72); }
.menu-panel form { margin: 0; border-top: 1px solid var(--line); }
.menu-panel form button { color: var(--danger); font-weight: 700; }
.language-panel { min-width: 150px; }
.account-panel { min-width: 250px; }
.account-submenu { border-bottom: 1px solid var(--line); }
.account-submenu > summary {
  min-height: 48px;
  height: auto;
  justify-content: space-between;
  padding: 12px 16px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}
.account-submenu > summary:hover { background: rgba(255, 254, 250, .72); }
.account-submenu > summary i {
  width: 7px;
  height: 7px;
  margin: 0 2px 3px 12px;
}
.account-submenu[open] > summary {
  color: var(--brand-dark);
  background: rgba(232, 238, 233, .75);
}
.account-submenu[open] > summary i {
  margin: 3px 2px 0 12px;
  transform: rotate(225deg) translate(-2px, -1px);
}
.account-submenu-panel { padding: 4px 0 7px; background: rgba(255, 254, 250, .48); }
.account-submenu-panel a {
  min-height: 42px;
  padding: 9px 16px 9px 28px;
  color: var(--muted);
  font-size: 12.5px;
}
.account-submenu-panel a::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--brand);
  opacity: .7;
}
.account-submenu-panel a:hover { color: var(--ink); }

.internal-content {
  min-height: calc(100vh - 254px);
  padding: 58px 38px 88px;
  background: linear-gradient(155deg, rgba(255,254,250,.98) 0%, rgba(247,243,235,.62) 100%);
}
.internal-content.detail-surface {
  background: linear-gradient(155deg, rgba(255,254,250,.98) 0%, rgba(237,241,235,.64) 100%);
}
.internal-content h1 { margin-bottom: 0; font-size: 42px; }
.internal-content h1 + p { margin: 4px 0 44px; }
.internal-section-title { margin: 0 0 14px; }

.nav-card-list { display: grid; gap: 9px; }
.dashboard-section-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 12px;
}
.dashboard-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.member-dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.dashboard-grid .nav-card,
.member-dashboard-grid .nav-card { min-height: 116px; }
.account-overview-grid {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 22px;
  align-items: start;
}
.account-overview-section {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255,254,250,.96);
}
.account-overview-section > header {
  padding: 15px 18px 13px;
  border-bottom: 1px solid var(--line);
  background: #f1ece2;
}
.account-overview-section.personal-section > header { background: #e9efeb; }
.application-overview-section { margin-bottom: 22px; }
.application-overview-section > header { background: #e9efeb; }
.account-overview-section > header .internal-section-title { margin-bottom: 5px; }
.account-overview-section > header small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.account-overview-link {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 24px;
  gap: 13px;
  align-items: center;
  min-height: 82px;
  padding: 14px 18px;
  color: var(--ink);
  text-decoration: none;
}
.account-overview-link + .account-overview-link { border-top: 1px solid #e5dfd5; }
.account-overview-link:hover { background: #f8f5ee; }
.account-overview-link > span:nth-child(2) { min-width: 0; }
.account-overview-link strong { display: block; font: 500 19px/1.2 Georgia, "Times New Roman", serif; }
.account-overview-link small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.overview-icon { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 9px; background: #e8eee9; color: var(--brand-dark); font-size: 18px; }
.administration-section .overview-icon { background: #f3e8d8; color: #9b5e20; }
.overview-arrow { color: var(--brand); font: 500 22px/1 system-ui, sans-serif; text-align: right; }
.member-account-section { max-width: 760px; }
.create-user-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}
.create-user-form .field { margin-bottom: 0; }
.create-user-form > button { grid-column: 1 / -1; justify-self: start; margin-top: 6px; }
.password-form {
  max-width: 680px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f7f4ed;
}
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.section-head h1 + p { margin-bottom: 0; }
.section-head-actions { display: flex; align-items: center; gap: 10px; }
.compact-action { min-height: 40px; padding: 0 14px; font-size: 0.84rem; white-space: nowrap; }
.user-sections { display: flex; gap: 26px; border-bottom: 1px solid var(--line); }
.user-sections a { padding: 0 1px 11px; border-bottom: 3px solid transparent; color: var(--muted); font-size: 0.84rem; font-weight: 750; text-decoration: none; }
.user-sections a.current { border-bottom-color: var(--brand); color: var(--ink); }
.user-sections span { display: inline-flex; min-width: 22px; height: 22px; align-items: center; justify-content: center; margin-left: 5px; padding: 0 7px; border-radius: 999px; background: #eee4d4; color: #744a20; font-size: 0.7rem; }
.user-table { border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.user-table-head, .user-row { display: grid; grid-template-columns: minmax(210px, 1.5fr) minmax(130px, .7fr) 42px; gap: 18px; align-items: center; }
.user-table-head { padding: 11px 16px; border-bottom: 1px solid var(--line); background: #f2eee5; color: var(--muted); font-size: 0.68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.user-row { position: relative; min-height: 68px; padding: 12px 16px; border-bottom: 1px solid #e6e0d6; }
.user-row:last-child { border-bottom: 0; }
.user-row strong, .user-row small { display: block; }
.user-row small { margin-top: 2px; color: var(--muted); font-size: .78rem; }
.user-status { display: inline-flex; align-items: center; gap: 7px; color: #52615b; font-size: .78rem; font-weight: 700; }
.user-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.user-status.pending::before { background: var(--brand); }
.user-status.locked::before { background: var(--danger); }
.user-status.archived::before { background: #8b8e89; }
.row-menu { position: relative; justify-self: end; }
.row-menu summary { display: flex; width: 34px; height: 34px; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 7px; color: #52615b; cursor: pointer; font-size: 1.25rem; font-weight: 800; list-style: none; }
.row-menu summary::-webkit-details-marker { display: none; }
.row-menu summary:hover, .row-menu[open] summary { border-color: #d5cec1; background: #f4f1e9; }
.row-menu-panel { position: absolute; z-index: 30; top: 39px; right: 0; width: 205px; padding: 6px; border: 1px solid #d8d1c5; border-radius: 9px; background: var(--paper); box-shadow: 0 12px 28px rgba(57,51,41,.16); }
.row-menu-panel form { margin: 0; }
.row-menu-panel button { display: flex; width: 100%; min-height: 36px; align-items: center; justify-content: flex-start; border: 0; border-radius: 6px; padding: 0 10px; background: transparent; color: var(--brand-dark); font-size: .8rem; text-align: left; }
.row-menu-panel button:hover { background: #f2eee5; }
.row-menu-panel button.destructive { margin-top: 5px; border-top: 1px solid #e2dbd0; border-radius: 0; color: var(--danger); }
.confirm-backdrop { position: fixed; z-index: 100; inset: 0; display: grid; padding: 20px; place-items: center; background: rgba(39,49,51,.42); backdrop-filter: blur(1.5px); }
.confirm-backdrop[hidden] { display: none; }
.confirm-dialog { width: min(460px, 100%); overflow: hidden; border: 1px solid #d6c7b3; border-radius: 14px; background: var(--paper); box-shadow: 0 24px 70px rgba(24,32,31,.34); }
.confirm-dialog-head { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 15px; align-items: center; padding: 22px 24px 17px; border-bottom: 1px solid var(--line); background: #fbf6ef; }
.confirm-dialog-head h2 { margin: 0; font: 500 1.55rem/1.2 Georgia, "Times New Roman", serif; }
.confirm-dialog-icon { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 12px; background: #f5ded9; color: var(--danger); font-size: 1.35rem; font-weight: 800; }
.confirm-dialog-body { padding: 20px 24px; }
.confirm-dialog-body p { margin: 0; color: #596762; font-size: .92rem; line-height: 1.55; }
.confirm-dialog-body .confirm-dialog-detail { margin-top: 14px; padding: 12px 14px; border-left: 3px solid var(--danger); background: #faf0ed; color: #6f302a; font-size: .82rem; }
.confirm-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px 22px; }
.confirm-dialog-actions button { min-height: 44px; padding: 0 17px; border-radius: 9px; }
.confirm-dialog-actions .danger-button { border: 1px solid var(--danger); background: var(--danger); color: white; }
body.confirm-open { overflow: hidden; }
.empty-state { padding: 22px; color: var(--muted); }
.activation-link-box { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 20px; border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 10px; background: #f7f4ed; }
.activation-link-box strong, .activation-link-box code { display: block; }
.activation-link-box code { margin-top: 5px; overflow-wrap: anywhere; color: var(--muted); }
.copy-link-button { min-width: 120px; }
.copy-link-button.copied { background: #567067; }
.nav-card {
  min-height: 96px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px 64px 20px 23px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,254,250,.96);
  box-shadow: 0 8px 22px rgba(57,51,41,.035);
  color: var(--ink);
  text-decoration: none;
}
.nav-card strong { font: 500 20px/1.2 Georgia, "Times New Roman", serif; }
.nav-card small { margin-top: 5px; color: var(--muted); font-size: 13px; font-weight: 600; }
.nav-card::after {
  content: "→";
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--brand);
  font: 500 25px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.internal-divider { border: 0; border-top: 1px solid var(--line); margin: 24px 0 16px; }

.internal-content .session { background: #f7f4ed; }
.internal-content .back { display: none; }

@media (max-width: 760px) {
  .internal-stage { width: calc(100vw - 1rem); max-width: calc(100vw - 1rem); margin: .5rem auto 1.5rem; }
  .internal-header,
  .internal-tools,
  .internal-content { width: 100%; min-width: 0; }
  .internal-header { min-height: 112px; position: relative; padding: 14px 112px 14px 18px; gap: .5rem; }
  .internal-title { min-width: 0; max-width: 100%; }
  .internal-title strong { font-size: 25px; }
  .internal-title span { font-size: 9px; }
  .internal-brand { width: 76px; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); }
  .internal-brand .brand-logo { width: 74px; }
  .internal-brand .brand-suffix { width: 59px; font-size: 4px; gap: 4px; }
  .internal-tools { min-height: 102px; padding-left: 0; align-items: stretch; flex-wrap: wrap; }
  .breadcrumbs { width: 100%; height: 48px; padding: 0 18px; border-bottom: 1px solid rgba(207,201,189,.7); font-size: 13px; }
  .breadcrumbs .optional { display: none; }
  .internal-menus { width: 100%; height: 53px; justify-content: stretch; }
  .internal-menus .menu { width: 50%; }
  .internal-menus .menu summary { justify-content: center; }
  .menu summary { height: 53px; padding: 0 12px; }
  .account-menu > summary > span { display: none; }
  .account-menu > summary::before { content: "●"; color: var(--brand-dark); font-size: 12px; }
  .account-submenu > summary { justify-content: space-between; }
  .menu-panel { top: 53px; }
  .internal-content { min-height: calc(100vh - 270px); max-width: calc(100vw - 1rem); padding: 38px 22px 62px; overflow-wrap: anywhere; }
  .internal-content h1 { font-size: 34px; }
  .internal-content h1 + p { margin-bottom: 34px; }
  .nav-card-list { width: calc(100vw - 60px); max-width: 100%; }
  .nav-card { width: 100%; min-width: 0; padding-left: 18px; }
  .dashboard-section-grid { display: none; }
  .dashboard-grid,
  .member-dashboard-grid,
  .create-user-form { grid-template-columns: 1fr; }
  .account-overview-grid { grid-template-columns: 1fr; gap: 16px; }
  .password-form { max-width: none; padding: 18px; }
  .section-head { align-items: flex-start; flex-direction: column; gap: 16px; }
  .section-head-actions { width: 100%; flex-wrap: wrap; }
  .user-table-head { display: none; }
  .user-row { grid-template-columns: minmax(0, 1fr) 36px; gap: 9px; }
  .user-row .user-status { grid-column: 1; }
  .row-menu { grid-column: 2; grid-row: 1 / span 2; }
  .confirm-dialog { border-radius: 12px; }
  .confirm-dialog-actions { flex-direction: column-reverse; }
  .confirm-dialog-actions button { width: 100%; }
  .activation-link-box { grid-template-columns: 1fr; }
  .security-status-card { grid-template-columns: 1fr; }
  .security-actions { justify-content: flex-start; }
  .two-factor-manage-grid { grid-template-columns: 1fr; }
}
