/* Verwaltungsoberfläche */
:root {
  --accent: #0f4c81;
  --border: #d8dde3;
  --bg: #f5f6f8;
  --text: #1d2530;
  --danger: #b3261e;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.5;
}
.wrap { max-width: 60rem; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.topbar { background: var(--accent); color: #fff; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; padding: .8rem 1rem; }
.brand { color: #fff; font-weight: 700; text-decoration: none; }
.topbar nav { display: flex; gap: 1rem; align-items: center; }
.topbar nav a { color: #fff; text-decoration: none; }
h1 { font-size: 1.5rem; margin: 1rem 0 .5rem; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
.card {
  background: #fff; border: 1px solid var(--border); border-radius: .5rem;
  padding: 1rem 1.25rem; margin: 1rem 0;
}
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .5rem .5rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .85rem; color: #5a6472; }
th.sortable a { color: inherit; text-decoration: none; white-space: nowrap; }
th.sortable a:hover { color: var(--accent); }
th[aria-sort] a { color: #1f2933; }
.sort-arrow { margin-left: .3rem; font-size: .75em; opacity: .45; }
th[aria-sort] .sort-arrow { opacity: 1; }
td.nowrap { white-space: nowrap; }
tr.deleted td { color: #8a919c; text-decoration: line-through; }
code { font-size: .85em; background: #eef0f3; padding: .1rem .3rem; border-radius: .25rem; word-break: break-all; }
button, .button {
  display: inline-block; background: var(--accent); color: #fff; border: none;
  border-radius: .4rem; padding: .45rem .9rem; font-size: .95rem; cursor: pointer;
  text-decoration: none;
}
button.danger { background: var(--danger); }
button.small, .button.small { padding: .2rem .6rem; font-size: .85rem; }
button.link { background: none; color: #fff; padding: 0; text-decoration: underline; }
button:hover { filter: brightness(1.08); }
.actions { display: flex; gap: .75rem; margin: 1rem 0; align-items: center; flex-wrap: wrap; }
.inline { display: inline; }
.inline-form { display: flex; gap: .5rem; align-items: end; flex-wrap: wrap; }
.form p, .form label { margin: .5rem 0; display: block; }
.form label.checkbox { display: flex; align-items: center; gap: .5rem; }
.form label.checkbox input { min-width: 0; }
.form input, .form select, .form textarea { padding: .4rem .55rem; border: 1px solid var(--border); border-radius: .35rem; font: inherit; min-width: 14rem; }
.key-select { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.key-select label { margin: 0; }
.messages { list-style: none; padding: 0; }
.messages li { padding: .6rem 1rem; border-radius: .4rem; margin: .5rem 0; }
.messages .success { background: #e0f0e4; color: #14481f; }
.messages .error { background: #fbe3e1; color: #7a1b15; }
.messages .warning { background: #fdf1d6; color: #6b4600; }
.error { color: var(--danger); }
.warning { color: var(--danger); }
.meta { color: #5a6472; font-size: .9rem; }
.hidden { display: none; }
.dashboard-links { list-style: none; margin: 0; padding: 0; }
.dashboard-links li { margin: .2rem 0; }
.public-link { font-size: .85rem; margin-left: .4rem; }

/* Icon-Picker im Editor */
.icon-picker-trigger { margin-left: .4rem; }
.icon-picker {
  position: fixed; z-index: 60; width: 26rem; max-width: calc(100vw - 1.5rem);
  background: #fff; border: 1px solid var(--border); border-radius: .5rem;
  box-shadow: 0 .5rem 1.5rem rgba(20, 30, 45, .25); padding: .6rem;
  display: flex; flex-direction: column; gap: .5rem;
}
.icon-picker-close {
  position: absolute; top: .3rem; right: .3rem; background: none; color: #5a6472;
  font-size: 1.2rem; line-height: 1; padding: .15rem .45rem;
}
.icon-picker-search { width: 100%; min-width: 0; padding: .4rem .55rem; border: 1px solid var(--border); border-radius: .35rem; font: inherit; }
.icon-picker-tabs { display: flex; gap: .25rem; flex-wrap: wrap; }
.icon-picker-tab {
  background: #eef0f3; color: #2a3240; font-size: .8rem; padding: .25rem .6rem;
}
.icon-picker-tab.active { background: var(--accent); color: #fff; }
.icon-picker-grid {
  display: grid; grid-template-columns: repeat(8, 1fr); gap: .15rem;
  max-height: 16rem; overflow-y: auto; overscroll-behavior: contain;
}
.icon-picker-cell {
  background: none; border: 1px solid transparent; border-radius: .3rem;
  padding: .45rem 0; font-size: 1.05rem; color: #2a3240; text-align: center;
}
.icon-picker-cell:hover { background: #eef0f3; border-color: var(--border); }
.cache-mode { white-space: nowrap; }

/* Results administration shell. Public dashboards do not load this stylesheet.
   Compact content rules deliberately exclude the existing dashboard editor. */
.admin-shell .topbar { background: #fff; color: #1d2530; border-bottom: 1px solid #d8dde3; }
.admin-shell .topbar .wrap { max-width: none; min-height: 48px; padding: 8px 18px; gap: 12px; }
.admin-shell .brand { color: #0f4c81; font-size: 15px; font-weight: 650; letter-spacing: -.3px; }
.admin-shell .brand span { color: #5a6472; font-size: 12px; font-weight: 400; margin-left: 6px; }
.admin-shell .topbar button.link { color: #5a6472; font-size: 12px; min-height: 28px; }
.admin-layout { display: grid; grid-template-columns: 176px minmax(0, 1fr); min-height: calc(100vh - 49px); }
.admin-layout.signed-out { grid-template-columns: minmax(0, 1fr); }
.admin-shell .sidebar { display: flex; flex-direction: column; gap: 3px; padding: 14px 9px; border-right: 1px solid #d8dde3; background: #fff; font: 13px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
.admin-shell .sidebar a { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 5px 8px; color: #1d2530; text-decoration: none; border-radius: 4px; overflow-wrap: anywhere; }
.admin-shell .sidebar i { width: 15px; text-align: center; flex-shrink: 0; color: #5a6472; }
.admin-shell .sidebar a:hover { background: #f5f6f8; }
.admin-shell .sidebar .active { background: #edf2f7; color: #0f4c81; font-weight: 600; }
.admin-shell .sidebar .active i { color: inherit; }
.admin-shell .sidebar .settings-link { margin-top: auto; }
.admin-shell main.admin-content { min-width: 0; width: 100%; max-width: 96rem; padding: 20px 24px 40px; }
.admin-shell .signed-out main.admin-content { max-width: 32rem; margin: 40px auto; }
.skip-link { position: absolute; top: -100px; left: 12px; z-index: 100; background: #fff; color: #0f4c81; padding: 8px 12px; }
.skip-link:focus { top: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.compact-admin { font-size: 13px; line-height: 1.45; }
.compact-admin .admin-content a { color: #0f4c81; }
.compact-admin .admin-content h1 { font-size: 20px; line-height: 1.3; font-weight: 600; letter-spacing: -.35px; margin: 0 0 4px; }
.compact-admin .admin-content h2 { font-size: 14px; font-weight: 600; margin: 0 0 10px; }
.compact-admin .admin-content h3 { font-size: 13px; }
.compact-admin .admin-content p { margin: 0 0 10px; }
.compact-admin .admin-content .meta { font-size: 12px; color: #5a6472; }
.compact-admin .pagehead { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.compact-admin .pagehead p { margin: 4px 0 0; }
.compact-admin .admin-content .card { padding: 14px; border-radius: 6px; margin: 12px 0; min-width: 0; }
.compact-admin .admin-content button, .compact-admin .admin-content .button { font: 500 13px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; border: 1px solid #0f4c81; border-radius: 4px; min-height: 32px; padding: 5px 10px; color: #fff; background: #0f4c81; text-align: center; }
.compact-admin .admin-content .secondary { background: #fff; border-color: #d8dde3; color: #1d2530; min-height: 28px; padding: 4px 9px; }
.compact-admin .admin-content button.danger { color: #b3261e; background: #fff; border-color: #d8dde3; }
.compact-admin .admin-content button:disabled { opacity: .5; cursor: default; }
.compact-admin .admin-content input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
.compact-admin .admin-content select, .compact-admin .admin-content textarea { font: inherit; border: 1px solid #b7c1cc; border-radius: 4px; padding: 5px 8px; min-height: 30px; min-width: 0; max-width: 100%; background: #fff; color: #1d2530; }
.compact-admin .admin-content .form input[type="checkbox"], .compact-admin .admin-content .form input[type="radio"] { min-width: 0; }
.compact-admin .admin-content :focus-visible, .admin-shell .sidebar a:focus-visible, .admin-shell .topbar :focus-visible { outline: 2px solid #0f4c81; outline-offset: 2px; }
.compact-admin .toolbar, .compact-admin .connection-choice { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.compact-admin .toolbar input[type="search"] { width: 220px; }
.compact-admin .connection-choice label { font-size: 12px; font-weight: 500; }
.compact-admin .survey-reload { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.compact-admin .survey-reload .survey-stamp { color: #5a6472; font-size: 11px; margin: 0; }
.compact-admin .survey-group + .survey-group { margin-top: 24px; }
.compact-admin .survey-group h2 .meta { margin-left: 6px; font-weight: 400; }
.compact-admin .search-status:empty { display: none; }
.compact-admin .tablebox { background: #fff; border: 1px solid #d8dde3; border-radius: 6px; overflow: hidden; min-width: 0; }
.compact-admin .table-scroll { overflow-x: auto; }
.compact-admin .admin-content table { font-variant-numeric: tabular-nums; }
.compact-admin .admin-content th, .compact-admin .admin-content td { padding: 7px 12px; border-bottom: 1px solid #e7eaee; vertical-align: middle; overflow-wrap: anywhere; }
.compact-admin .admin-content th { background: #fafbfc; color: #5a6472; font-size: 11px; font-weight: 500; height: 32px; }
.compact-admin .admin-content td { font-size: 12px; }
.compact-admin .admin-content tbody tr:last-child td { border-bottom: 0; }
.compact-admin .overview-table { table-layout: fixed; }
.compact-admin .overview-table th:first-child { width: 26%; }
.compact-admin .overview-table th:last-child { width: 18%; }
.compact-admin .overview-table th:nth-child(3) { width: 19%; }
.compact-admin .dashboard-table th:nth-child(2) { width: 22%; }
.compact-admin .dashboard-table th:nth-child(3) { width: 13%; }
.compact-admin .dashboard-table th:first-child { width: 24%; }
.compact-admin .dashboard-table th:nth-child(4) { width: 17%; }
.compact-admin .dashboard-table th:nth-child(5) { width: 7%; }
.compact-admin .dashboard-table th:last-child { width: 17%; }
.compact-admin .overview-table .row-name { font-size: 13px; }
.compact-admin .row-name > a { font-weight: 500; text-decoration: none; }
.compact-admin .row-name > a:hover { text-decoration: underline; }
.compact-admin .overview-table .row-name p { margin: 0; }
.compact-admin .num { text-align: right; }
.compact-admin .row-actions { text-align: right; }
.compact-admin .row-actions form { margin: 0; }
.compact-admin .row-actions .button, .compact-admin .row-actions button { white-space: normal; }
.compact-admin .status { display: inline-flex; align-items: center; gap: 5px; border: 1px solid #d8dde3; padding: 1px 6px; border-radius: 4px; font-size: 11px; white-space: nowrap; }
.compact-admin .status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #28724f; }
.compact-admin .status.neutral::before { background: #7b8592; }
.compact-admin summary { cursor: pointer; font-weight: 500; }
.compact-admin details[open] > summary { margin-bottom: 10px; }
.compact-admin .row-details { color: #5a6472; font-size: 11px; margin-top: 3px; }
.compact-admin dl { margin: 10px 0; }
.compact-admin dt { font-weight: 500; }
.compact-admin dd { margin: 0 0 6px; overflow-wrap: anywhere; }
.compact-admin .empty { padding: 32px 22px; background: #fff; border: 1px dashed #b7c1cc; border-radius: 6px; max-width: 640px; }
.compact-admin .empty p { color: #5a6472; max-width: 420px; margin: 8px 0 16px; }
.compact-admin .notice { padding: 9px 11px; border: 1px solid #b3261e; border-radius: 4px; background: #fff; margin-bottom: 12px; }
.compact-admin .settings-tabs { display: flex; flex-wrap: wrap; gap: 16px; border-bottom: 1px solid #d8dde3; margin: 12px 0 16px; }
.compact-admin .settings-tabs a { padding: 6px 0 8px; color: #5a6472; text-decoration: none; border-bottom: 2px solid transparent; }
.compact-admin .settings-tabs .active { border-bottom-color: #0f4c81; color: #0f4c81; font-weight: 600; }
.compact-admin .breadcrumb { color: #5a6472; font-size: 12px; }
.compact-admin .narrow-sort { display: none; }
/* Dashboard assistant */
.compact-admin .wizard-steps { display: flex; gap: 4px; list-style: none; margin: 0 0 16px; padding: 0; max-width: 760px; }
.compact-admin .wizard-steps li { flex: 1; min-width: 0; }
.compact-admin .wizard-steps li > * { display: flex; align-items: center; gap: 6px; width: 100%; min-height: 32px; padding: 6px 8px; border: 0; border-bottom: 2px solid #d8dde3; border-radius: 0; background: none; color: #5a6472; font: 12px/1.3 system-ui, -apple-system, "Segoe UI", sans-serif; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compact-admin .admin-content .wizard-steps button { background: none; border-color: #d8dde3; color: #5a6472; min-height: 32px; padding: 6px 8px; text-align: left; font-weight: 400; }
.compact-admin .admin-content .wizard-steps .done { border-bottom-color: #0f4c81; color: #0f4c81; cursor: pointer; }
.compact-admin .admin-content .wizard-steps .current { border-bottom-color: #0f4c81; color: #1d2530; font-weight: 600; }
.compact-admin .admin-content .wizard-steps button:disabled { opacity: 1; }
.compact-admin .wizard-num { display: inline-grid; place-items: center; flex: none; width: 18px; height: 18px; border: 1px solid currentColor; border-radius: 50%; font-size: 11px; }
.compact-admin .wizard-steps .done .wizard-num, .compact-admin .wizard-steps .current .wizard-num { background: #0f4c81; border-color: #0f4c81; color: #fff; }
.compact-admin .wizard-heading { margin: 0 0 2px; }
.compact-admin .admin-content .wizard-heading:focus { outline: none; }
.compact-admin .admin-content .wizard-many { margin: 6px 0 0; }
.compact-admin .wizard-form { max-width: 760px; }
.compact-admin .wizard-form [hidden] { display: none !important; }
.compact-admin .wizard-section + .wizard-section { margin-top: 24px; }
.compact-admin .wizard-form.is-stepped .wizard-section + .wizard-section { margin-top: 0; }
.compact-admin .wizard-list { display: grid; margin: 10px 0 0; padding: 0; border: 1px solid #d8dde3; border-radius: 6px; background: #fff; overflow: hidden; min-width: 0; }
.compact-admin .wizard-row { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: center; gap: 0 10px; min-height: 38px; padding: 4px 12px; border-top: 1px solid #e7eaee; cursor: pointer; }
.compact-admin .wizard-row:first-of-type { border-top: 0; }
.compact-admin .wizard-row.kpi { background: #f6f9fc; }
.compact-admin .wizard-row input { margin: 0; accent-color: #0f4c81; }
.compact-admin .wizard-row:hover { background: #f8fafc; }
.compact-admin .wizard-text { min-width: 0; overflow-wrap: anywhere; cursor: pointer; }
.compact-admin .wizard-text small { color: #5a6472; font-size: 11px; margin-left: 4px; white-space: nowrap; }
.compact-admin .admin-content .wizard-row select { min-height: 26px; padding: 2px 6px; font-size: 12px; }
.compact-admin .wizard-tag { font-size: 11px; padding: 1px 7px; border-radius: 9px; background: #eef1f4; color: #5a6472; white-space: nowrap; }
.compact-admin .wizard-tag.new { background: #fff4d6; color: #6b4600; }
.compact-admin .wizard-tag.bad { background: #fbe3e1; color: #7a1b15; }
.compact-admin .wizard-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.compact-admin .wizard-notice { margin: 10px 0 0; }
.compact-admin .wizard-notice button { margin-left: 6px; }
.compact-admin .wizard-hint { border-color: #d8dde3; background: #f3f5f7; margin: 10px 0 0; }
.compact-admin .wizard-actions { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.compact-admin .wizard-right { display: flex; flex-direction: row-reverse; align-items: center; gap: 8px; margin-left: auto; }
.compact-admin .admin-content button.wizard-link { background: none; border-color: transparent; color: #0f4c81; padding: 4px 6px; min-height: 28px; font-weight: 400; }
.compact-admin .admin-content button.wizard-link:hover { text-decoration: underline; filter: none; }
.compact-admin .wizard-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; margin-top: 10px; }
.compact-admin .wizard-fields p { margin: 0 0 10px; }
.compact-admin .wizard-fields label { display: block; margin: 0 0 3px; font-size: 12px; color: #5a6472; }
.compact-admin .admin-content .wizard-fields input[type="text"], .compact-admin .admin-content .wizard-fields select { width: 100%; }
.compact-admin .wizard-fields .error { display: block; color: #b3261e; font-size: 12px; margin-top: 3px; }
.compact-admin .wizard-layout { border: 0; padding: 0; margin: 0 0 10px; display: flex; flex-wrap: wrap; }
.compact-admin .wizard-layout legend { font-size: 12px; color: #5a6472; padding: 0; margin-bottom: 3px; }
.compact-admin .wizard-layout label.wizard-seg { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 5px 10px; border: 1px solid #d8dde3; background: #fff; color: #1d2530; font-size: 12px; cursor: pointer; }
.compact-admin .wizard-layout label.wizard-seg + label.wizard-seg { border-left: 0; }
.compact-admin .wizard-layout label.wizard-seg:has(input:checked) { background: #edf2f7; border-color: #0f4c81; color: #0f4c81; font-weight: 500; }
.compact-admin .wizard-layout input { margin: 0; accent-color: #0f4c81; }
.compact-admin .wizard-preview { display: grid; gap: 8px; padding: 10px; border: 1px solid #d8dde3; border-radius: 6px; background: #f5f6f8; min-width: 0; }
.compact-admin .wizard-preview strong { font-size: 12px; }
.compact-admin .wizard-preview-grid { display: grid; gap: 6px; grid-template-columns: minmax(0, 1fr); grid-auto-flow: row dense; }
.compact-admin .wizard-preview-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.compact-admin .wizard-tile { display: grid; gap: 5px; min-width: 0; padding: 6px 7px; border: 1px solid #d8dde3; border-radius: 4px; background: #fff; color: #5a6472; font-size: 11px; }
.compact-admin .wizard-tile span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.compact-admin .wizard-tile.full { grid-column: 1 / -1; }
.compact-admin .wizard-tile.empty-tile { padding: 16px 8px; text-align: center; }
.compact-admin .wizard-bars { display: block; height: 18px; background: linear-gradient(#c9d7e6, #c9d7e6) 0 0 / 80% 4px no-repeat, linear-gradient(#c9d7e6, #c9d7e6) 0 7px / 55% 4px no-repeat, linear-gradient(#c9d7e6, #c9d7e6) 0 14px / 30% 4px no-repeat; }
.compact-admin .wizard-bars.donut { width: 18px; border-radius: 50%; background: none; border: 4px solid #c9d7e6; box-sizing: border-box; }
.compact-admin .wizard-bars.wordcloud { background: none; height: auto; }
.compact-admin .wizard-bars.wordcloud::before { content: "Wortwolke"; font-style: normal; color: #8a94a1; }
@media (max-width: 700px) {
  .compact-admin .wizard-columns { grid-template-columns: minmax(0, 1fr); }
  .compact-admin .wizard-row { grid-template-columns: 16px minmax(0, 1fr); }
  .compact-admin .admin-content .wizard-row select, .compact-admin .wizard-row .wizard-tag { grid-column: 2; justify-self: start; margin-top: 3px; }
}
@media (max-width: 1100px) {
  .compact-admin .narrow-sort { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
  .compact-admin .overview-table, .compact-admin .overview-table tbody { display: block; }
  .compact-admin .overview-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .compact-admin .overview-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) auto; gap: 5px 16px; padding: 10px 12px; border-bottom: 1px solid #d8dde3; }
  .compact-admin .overview-table tr:last-child { border: 0; }
  .compact-admin .overview-table td { display: block; height: auto; padding: 0; border: 0; text-align: left; }
  .compact-admin .overview-table td[data-label]:not(.row-name)::before { content: attr(data-label) ": "; color: #5a6472; font-size: 11px; }
  .compact-admin .overview-table .row-name { grid-column: 1 / 3; }
  .compact-admin .overview-table .row-actions { grid-column: 3; grid-row: 1 / span 3; align-self: center; text-align: right; }
}
@media (max-width: 700px) {
  .admin-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .admin-shell .sidebar { flex-direction: row; flex-wrap: wrap; gap: 3px; padding: 6px 10px; border-right: 0; border-bottom: 1px solid #d8dde3; }
  .admin-shell .sidebar .settings-link { margin-top: 0; }
  .admin-shell main.admin-content { padding: 16px 12px 32px; }
  .admin-shell .sidebar a { padding: 5px 7px; }
  .admin-shell .sidebar i { display: none; }
  .compact-admin .overview-table tr { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; }
  .compact-admin .overview-table .row-actions { grid-column: 1 / -1; grid-row: auto; text-align: left; padding-top: 4px; }
  .compact-admin .toolbar input[type="search"] { flex: 1 1 180px; width: auto; }
  .compact-admin .toolbar .narrow-sort { order: 1; flex-basis: 100%; }
  .compact-admin .empty { padding: 24px 16px; }
  .compact-admin .form.inline-form { align-items: stretch; }
}

/* The sign-in page has its own entrance, not the authenticated app shell. */
.login-page .admin-layout { display: flex; align-items: center; min-height: 100svh; }
.login-page .admin-layout main.admin-content { max-width: 760px; margin: auto; padding: 40px 24px; }
.login-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); align-items: center; gap: 48px; }
.login-identity { min-width: 0; }
.login-wordmark { color: var(--accent); font-size: 40px; font-weight: 700; letter-spacing: -1.5px; line-height: 1.1; }
.login-page .admin-content .login-product { color: #5a6472; margin: 8px 0 0; }
.login-page .admin-content .login-description { color: #5a6472; margin: 18px 0 0; }
.login-page .admin-content .login-card { margin: 0; padding: 24px; }
.login-page .admin-content .login-card h1 { margin-bottom: 18px; }
.login-page .login-card .form p { margin: 0 0 14px; }
.login-page .login-card .form label { margin: 0 0 5px; }
.login-page.compact-admin .admin-content .login-card .form input:not([type=hidden]) { width: 100%; min-height: 36px; border-color: #7b8592; }
.login-page .login-card button { width: 100%; min-height: 36px; }
.login-page .login-card .errorlist { list-style: none; margin: 0 0 14px; padding: 10px; background: #fbe3e1; color: #7a1b15; border-radius: 4px; }
@media (max-width: 700px) {
  .login-page .admin-layout main.admin-content { max-width: 360px; padding: 28px 20px; }
  .login-layout { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .login-wordmark { font-size: 36px; }
  .login-page .admin-content .login-description { display: none; }
  .login-page .admin-content .login-card { padding: 20px; }
}
@media (pointer: coarse) {
  .login-page.compact-admin .admin-content .login-card .form input:not([type=hidden]), .login-page .login-card button { min-height: 44px; }
}

/* Account security shares the app's compact forms and the sign-in entrance. */
.admin-shell .topbar .user-nav { flex-wrap: wrap; gap: 6px 16px; }
.admin-shell .topbar .user-nav a { color: #0f4c81; font-size: 12px; }
.admin-shell .topbar .user-nav [aria-current] { font-weight: 600; }
.admin-shell .topbar .wrap { flex-wrap: wrap; }
.compact-admin .admin-content .user-settings { max-width: 760px; }
.compact-admin .account-identity { display: flex; flex-wrap: wrap; gap: 12px 28px; padding-bottom: 12px; margin: 0 0 16px; border-bottom: 1px solid #e7eaee; }
.compact-admin .account-identity dt { font-size: 12px; color: #5a6472; font-weight: 400; }
.compact-admin .account-identity dd { margin: 2px 0 0; }
.user-settings .password-form { max-width: 400px; }
.password-field { margin-bottom: 14px; }
.admin-shell.compact-admin .admin-content .password-form .password-field input { width: 100%; min-height: 36px; border-color: #7b8592; }
.admin-shell.compact-admin .admin-content .password-form .password-field input[aria-invalid=true] { border-color: #b3261e; }
.compact-admin .admin-content .password-notice { padding: 10px 12px; border-radius: 4px; margin-bottom: 14px; }
.password-notice.error { background: #fbe3e1; color: #7a1b15; }
.password-notice.success { background: #e0f0e4; color: #14481f; }
.password-notice.warning { background: #fdf1d6; color: #6b4600; }
.compact-admin .admin-content .password-notice a { color: inherit; text-decoration: underline; }
.password-notice ul, .password-help ul { margin: 6px 0 0; padding-left: 18px; }
.password-field-errors { list-style: none; padding: 0; margin: 4px 0 0; color: #b3261e; font-size: 12px; }
.password-help { margin-top: 5px; }
.compact-admin .admin-content .password-form button[aria-busy=true] { opacity: 1; cursor: wait; }
.compact-admin .admin-content .password-session-note { margin: 12px 0 0; }
.login-page .login-card .auth-link { display: block; width: fit-content; margin-top: 14px; min-height: 24px; text-decoration: underline; }
.login-page .login-card a:not(.button), .password-form .meta a { text-decoration: underline; }
@media (pointer: coarse) {
  .admin-shell.compact-admin .admin-content .password-form .password-field input,
  .compact-admin .admin-content .password-form button, .compact-admin .admin-content .password-form .button,
  .login-page .login-card .auth-link, .login-page .login-card .button,
  .admin-shell .topbar .user-nav a, .admin-shell .topbar .user-nav button,
  .settings-tabs a { min-height: 44px; }
  .login-page .login-card a, .admin-shell .user-nav a, .settings-tabs a { align-content: center; }
}

/* App-wide transactional email editor; the iframe uses the actual mail styles. */
.email-settings-heading { display:flex; gap:12px; align-items:center; justify-content:space-between; flex-wrap:wrap; margin:16px 0; }
.email-settings-heading h2 { margin:0; }
.email-settings-grid { display:grid; grid-template-columns:minmax(0,1.08fr) minmax(0,1fr); gap:18px; max-width:1200px; align-items:start; }
.email-settings-grid > *, .email-settings-form { min-width:0; }
.compact-admin .admin-content .email-settings-grid .card { margin:0; }
.email-settings-form h3 { font-size:13px; font-weight:600; margin:16px 0 6px; }
.compact-admin .admin-content .email-settings-form input:not([type=checkbox]),
.compact-admin .admin-content .email-settings-form textarea { width:100%; min-width:0; border-color:#7b8592; }
.compact-admin .admin-content .email-settings-form textarea { font:12px/1.65 ui-monospace,SFMono-Regular,Consolas,monospace; resize:vertical; }
.compact-admin .admin-content .email-settings-form .email-field-label { display:flex; justify-content:space-between; gap:6px; flex-wrap:wrap; margin-top:14px; }
.email-placeholders { display:grid; grid-template-columns:1fr 1fr; gap:6px; }
.email-placeholders code { background:none; padding:0; border-radius:0; font-size:12px; color:var(--accent); overflow-wrap:anywhere; }
.email-image, .email-restore { border-top:1px solid var(--border); padding-top:12px; margin-top:16px; }
.email-image h3 { margin-top:0; }
.email-headers { display:grid; grid-template-columns:auto minmax(0,1fr); gap:5px 10px; margin:0; padding-bottom:12px; border-bottom:1px solid var(--border); font-size:12px; }
.email-headers dt { color:#5a6472; }.email-headers dd { margin:0; overflow-wrap:anywhere; }
.email-preview iframe { display:block; width:100%; height:620px; border:0; background:#fff; margin-top:12px; }
.email-preview-controls { display:flex; gap:6px; flex-wrap:wrap; margin:10px 0; }
.email-preview-controls [aria-pressed=true] { background:#edf2f7; color:var(--accent); }
.email-settings-form .errorlist { color:var(--danger); font-size:12px; margin:4px 0; padding-left:18px; }
@media(max-width:800px) {
  .email-settings-grid { grid-template-columns:minmax(0,1fr); }
  .email-placeholders { grid-template-columns:minmax(0,1fr); }
}
