:root {
  color-scheme: dark;
  --bg: #101112;
  --panel: #1b1d1f;
  --panel-2: #232628;
  --field: #2d3133;
  --line: #34393b;
  --line-soft: rgba(184, 196, 196, .14);
  --text: #f7f7f7;
  --muted: #b8c4c4;
  --brand: #007c7d;
  --brand-2: #079b9d;
  --cyan-soft: #b9ffff;
  --gold: #d7a32f;
  --red: #d9534f;
  --green: #2fa866;
  --amber: #d7a32f;
  --shadow: 0 18px 44px rgba(0, 0, 0, .28);
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { min-height: 100vh; margin: 0; background: var(--bg); color: var(--text); font-size: 15px; }
a { color: #b9ffff; text-decoration: none; }
button, .button { font: inherit; }

.app-shell { display: block; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 20px;
  background: #242626;
  border-bottom: 4px solid var(--brand);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .2);
}
.brand { display: flex; align-items: center; gap: 13px; min-width: 0; color: #fff; }
.brand img { width: 76px; height: 48px; object-fit: contain; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 22px; line-height: 1.1; }
.brand small { margin-top: 4px; color: var(--muted); font-size: 12px; }
.account { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.account form { margin: 0; }
.version-link { padding: 5px 8px; border-radius: 4px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 800; }
.live-project-status { display: inline-flex; align-items: center; gap: 6px; min-width: 0; color: #aebaba; font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.live-indicator { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(47, 168, 102, .13); }
.live-project-details { display: grid; gap: 2px; line-height: 1.2; }
.live-storage strong, .live-code strong { color: #f1f5f5; font-weight: 800; }
.live-code { color: #b8c4c4; font-size: 10px; text-align: center; }
.logout-button { min-width: 34px; padding: 6px 9px; font-size: 18px; line-height: 1; }
.workspace { display: flex; min-height: calc(100vh - 76px); }
.sidebar {
  position: sticky;
  top: 76px;
  width: 280px;
  height: calc(100vh - 76px);
  flex: 0 0 280px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  background: linear-gradient(180deg, #191b1c 0%, #141617 100%);
  border-right: 1px solid var(--line);
  z-index: 30;
}
.sidebar nav { display: grid; gap: 0; }
.nav-label {
  margin: 12px 8px 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  color: var(--cyan-soft);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.nav-label:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.nav-group {
  display: grid;
  gap: 7px;
  margin-bottom: 5px;
  padding: 8px;
  border: 1px solid rgba(184, 196, 196, .12);
  border-left: 3px solid rgba(185, 255, 255, .36);
  border-radius: 7px;
  background: rgba(32, 35, 37, .42);
}
.sidebar nav a {
  position: relative;
  min-width: 0;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 24px 9px 10px;
  border: 1px solid transparent;
  border-left: 4px solid transparent;
  border-radius: 6px;
  background: #202325;
  color: #fff;
  font-weight: 700;
  transition: background .16s ease, border-color .16s ease;
}
.sidebar nav a:hover { border-color: rgba(7, 155, 157, .35); border-left-color: var(--cyan-soft); background: #25292b; }
.sidebar nav a.active { border-color: rgba(185, 255, 255, .25); border-left-color: var(--cyan-soft); background: linear-gradient(90deg, #233536, #202325); }
.sidebar nav a.active::after { content: ""; position: absolute; right: 10px; width: 7px; height: 7px; border-radius: 50%; background: #c6ffff; }
.sidebar nav a > span:last-child { min-width: 0; white-space: nowrap; }
.nav-icon { display: grid; place-items: center; flex: 0 0 28px; width: 28px; height: 28px; border: 1px solid rgba(185, 255, 255, .14); border-radius: 7px; background: rgba(255, 255, 255, .04); color: #9ee8e8; }
.nav-icon svg { width: 17px; height: 17px; }
.sidebar nav a:hover .nav-icon, .sidebar nav a.active .nav-icon { border-color: rgba(185, 255, 255, .42); background: rgba(7, 155, 157, .2); color: #fff; }
.sidebar-footer { margin-top: auto; display: grid; gap: 4px; padding: 16px 10px 4px; border-top: 1px solid var(--line-soft); color: var(--muted); }
.sidebar-footer span { color: var(--text); font-weight: 700; }
.menu-toggle { display: none; width: 42px; height: 38px; padding: 8px; flex-direction: column; justify-content: center; gap: 4px; }
.menu-toggle span { display: block; width: 20px; height: 2px; background: #fff; }
.menu-backdrop { display: none; }
.main { min-width: 0; flex: 1; padding: 22px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 20px; }
.page-head h1 { margin: 0; font-size: 28px; letter-spacing: -.35px; }
.page-head p { margin: 6px 0 0; color: var(--muted); line-height: 1.5; }
.head-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.panel { margin-bottom: 16px; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); box-shadow: 0 12px 28px rgba(0, 0, 0, .18); }
.onedrive-live-options { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 14px; }
.onedrive-live-options label { display: inline-flex; align-items: center; gap: 8px; }
.onedrive-live-options select { width: auto; }
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; padding-bottom: 10px; border-bottom: 1px solid var(--line-soft); }
.panel h2, .panel h3 { margin-top: 0; }
.version-list { display: grid; gap: 8px; }
.version-entry { padding: 14px 16px; border: 1px solid var(--line); border-left: 3px solid transparent; border-radius: 7px; background: rgba(27, 29, 31, .72); }
.version-entry.current { border-left-color: var(--brand-2); background: linear-gradient(90deg, rgba(0, 124, 125, .14), rgba(27, 29, 31, .72) 42%); }
.version-entry-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.version-title { display: flex; align-items: center; gap: 9px; }
.version-title h2 { margin: 0; font-size: 17px; }
.version-entry-head .hint { margin: 3px 0 0; font-size: 13px; }
.version-deployment { display: grid; gap: 2px; margin: 1px 0 0; color: var(--muted); font-size: 12px; text-align: right; white-space: nowrap; }
.version-deployment strong { color: var(--text); }
.version-summary { margin-top: 11px; }
.eyebrow { display: block; margin-bottom: 5px; color: var(--cyan-soft); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.version-changes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 22px; margin: 0; padding-left: 18px; color: #e5ecec; font-size: 13px; line-height: 1.4; }
.version-changes li::marker { color: var(--brand-2); }
.version-details { margin-top: 11px; border-top: 1px solid var(--line-soft); }
.version-details > summary { padding-top: 10px; color: var(--cyan-soft); font-size: 13px; font-weight: 700; cursor: pointer; list-style: none; }
.version-details > summary::-webkit-details-marker { display: none; }
.version-details > summary::after { content: "+"; margin-left: 7px; color: var(--muted); }
.version-details[open] > summary::after { content: "−"; }
.version-details-content { display: grid; gap: 13px; padding: 10px 0 1px; }
.version-detail-section { display: grid; gap: 7px; }
.version-detail-section h3 { margin: 0; color: var(--text); font-size: 13px; }
.version-detail-section p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.metrics { display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)); gap: 12px; margin-bottom: 16px; }
.case-list-metrics { grid-template-columns: repeat(6, minmax(150px, 1fr)); }
.case-list-sort-mobile { display: none; }
.case-list-year-filter { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; color: var(--muted); font-size: 12px; font-weight: 800; }
.case-list-year-buttons, .table-sort-arrows { display: inline-flex; align-items: center; gap: 3px; }
.case-list-year-button, .table-sort-arrow { min-width: 30px; min-height: 29px; padding: 4px 7px; border: 1px solid rgba(185,255,255,.22); border-radius: 5px; background: rgba(0,0,0,.14); color: #d4e6e6; font-size: 13px; line-height: 1; }
.case-list-year-button:hover, .table-sort-arrow:hover { border-color: var(--cyan-soft); background: rgba(7,155,157,.25); }
.case-list-year-button.is-active, .table-sort-arrow.is-active { border-color: var(--cyan-soft); background: rgba(7,155,157,.45); color: #fff; box-shadow: inset 0 0 0 1px rgba(185,255,255,.25); }
.table-sort-label { display: inline-block; margin-right: 6px; }
.data-table th { white-space: normal; }
.data-table th > .table-sort-arrows { vertical-align: middle; }
.metric { padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); }
.metric strong { display: block; margin-top: 3px; font-size: 25px; }
.metric small { color: var(--muted); }
.grid-2, .grid-3, .grid-4, .stack { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.filters { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.filters label { min-width: 145px; }
.filters .search { min-width: 220px; flex: 1; }
.filter-panel { margin-bottom: 16px; }
.filter-panel details { padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); box-shadow: 0 12px 28px rgba(0, 0, 0, .18); }
.filter-panel summary { display: none; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 700; }
input, select, textarea { width: 100%; padding: 10px; border: 1px solid #444; border-radius: 6px; outline: none; background: var(--field); color: var(--text); font: inherit; }
.currency-input { position: relative; display: block; }
.currency-input input { padding-right: 34px; text-align: right; }
.currency-input > span { position: absolute; top: 50%; right: 12px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
[data-case-price] .grid-4 { grid-template-columns: repeat(4, minmax(0, 205px)); }
textarea { min-height: 100px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(7, 155, 157, .16); }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--brand-2); }
/* Die frühere CC-Option bleibt nur für alte gespeicherte Formulare unsichtbar; sie wird serverseitig nicht mehr ausgewertet. */
label:has(input[name="smtp_customer_cc"]),
label:has(input[name="imap_archive_enabled"]) { display: none; }
label small, .hint, .muted { color: var(--muted); font-weight: 400; line-height: 1.45; }
.button, button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 12px; border: 0; border-radius: 6px; background: var(--brand); color: #fff; font-weight: 800; cursor: pointer; }
.button:hover, button:hover { background: var(--brand-2); }
.primary, .button.primary { background: var(--brand); color: #fff; }
.secondary, .button.secondary { background: var(--brand); color: #fff; }
.secondary:hover, .button.secondary:hover { background: var(--brand-2); }
.danger, .button.danger { background: var(--red); color: #fff; }
.button.small, button.small { padding: 6px 9px; font-size: 12px; }
button:disabled, .button.disabled { opacity: .45; cursor: not-allowed; }
.confirm-dialog { width: min(430px, calc(100vw - 28px)); padding: 0; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); color: var(--text); box-shadow: 0 24px 70px rgba(0, 0, 0, .58); }
.confirm-dialog::backdrop { background: rgba(0, 0, 0, .7); }
.confirm-dialog form { padding: 20px; }
.confirm-dialog h2, .confirm-dialog p { margin: 0; }
.confirm-dialog p { color: var(--muted); line-height: 1.5; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 4px; }
.mail-preview-dialog { width: min(1040px, calc(100vw - 28px)); }
.mail-preview-dialog-content { display: grid; gap: 14px; padding: 20px; }
.mail-preview-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.mail-preview-dialog .mail-design-preview { min-height: min(680px, calc(100vh - 210px)); }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.data-table { width: 100%; min-width: 980px; border-collapse: collapse; }
.data-table th, .data-table td { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.data-table th { position: sticky; top: 0; z-index: 1; background: var(--brand); color: #fff; font-size: 12px; white-space: nowrap; }
.data-table td { background: #222527; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: #2a2e30; }
.data-table .clickable-row { cursor: pointer; }
.data-table .clickable-row:focus { outline: 2px solid var(--brand-2); outline-offset: -2px; }
.data-table .clickable-row:focus td { background: #2a2e30; }
.row-link { color: #fff; font-weight: 800; }
.badges { display: flex; flex-wrap: wrap; gap: 5px; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px; background: #3b4143; color: #dce7e7; font-size: 12px; font-weight: 800; white-space: nowrap; }
.badge.cyan, .status-inquiry { background: rgba(7, 155, 157, .22); color: #b9ffff; }
.badge.gold, .badge.amber, .status-binding_booking_received { background: rgba(215, 163, 47, .22); color: #ffe2a1; }
.badge.red, .status-rejected, .status-cancelled { background: rgba(217, 83, 79, .2); color: #ffc8c8; }
.badge.green, .status-booking { background: rgba(47, 168, 102, .22); color: #bff0d0; }
.badge.gray { background: #3b4143; color: var(--muted); }
.flash { margin-bottom: 15px; padding: 11px 13px; border-radius: 6px; transition: opacity .4s; }
.flash.success { background: rgba(47, 168, 102, .18); color: #c8f2d9; }
.flash.error { background: rgba(217, 83, 79, .18); color: #ffd3d1; }
.flash.info { background: rgba(7, 155, 157, .2); color: #caffff; }
.flash.fade { opacity: .18; }
.flash.floating { position: fixed; top: 20px; left: 50%; z-index: 50; transform: translateX(-50%); }
.system-alert { position: sticky; top: 10px; z-index: 20; display: grid; gap: 4px; margin-bottom: 16px; padding: 14px 16px; border: 2px solid var(--red); border-radius: 7px; background: #4b2020; color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.system-alert strong { font-size: 16px; }
.system-alert a { color: #fff; text-decoration: underline; font-weight: 800; }
.system-alert small { color: #ffd3d1; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.case-tabs { position: sticky; top: 8px; z-index: 12; display: flex; gap: 5px; margin: 0 0 16px; padding: 4px; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); box-shadow: 0 8px 18px rgba(0,0,0,.2); scrollbar-width: thin; }
.case-tabs button { flex: 0 0 auto; min-height: 40px; padding: 8px 13px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--muted); font-weight: 800; white-space: nowrap; }
.case-tabs button:hover { color: #fff; background: #292d2f; }
.case-tabs button[aria-selected="true"] { border-color: var(--brand-2); background: var(--brand); color: #fff; }
.case-tabs button:focus-visible { outline: 2px solid var(--cyan-soft); outline-offset: 2px; }
.case-tab-panels > div:empty { display: none; }
.key-values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.case-data-panel { padding: 0; overflow: hidden; }
.case-data-panel { max-width: 1500px; }
.case-data-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 17px 18px; border-bottom: 1px solid var(--line); }
.case-data-heading h2 { margin: 0; padding: 0; border: 0; }
.case-data-heading span { color: var(--cyan-soft); font-size: 13px; font-weight: 600; }
.case-data-panel > .hint { margin: 16px 18px 0; }
.case-data-sections { display: grid; gap: 18px; padding: 18px; }
.case-data-sections > section { padding-bottom: 18px; border-bottom: 1px solid var(--line-soft); }
.case-data-sections > section:last-child { padding-bottom: 0; border-bottom: 0; }
.case-data-sections h3 { margin: 0 0 10px; font-size: 15px; }
.case-data-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.case-data-item { min-width: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-2); }
.case-data-item dt { color: var(--muted); font-size: 11px; font-weight: 700; }
.case-data-item dd { margin: 3px 0 0; overflow-wrap: anywhere; font-size: 13px; }
.case-data-item dd.is-empty { color: var(--muted); font-style: italic; }
.case-data-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.case-data-panel .case-data-grid { display: flex; flex-wrap: wrap; }
.case-data-panel .case-data-item { box-sizing: border-box; flex: 0 1 280px; max-width: 100%; }
.case-data-panel .case-data-item--compact { flex-basis: 190px; }
.case-data-panel .case-data-item--regular { flex-basis: 320px; }
.case-data-panel .case-data-item--wide { flex-basis: 510px; }
.case-data-panel .case-data-grid.case-data-wide .case-data-item { flex-basis: 510px; }
.case-product-snapshots { display: grid; gap: 8px; }
.case-form { width: min(100%, 1500px); grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 10px; }
.case-form .panel { margin-bottom: 0; padding: 14px; }
.case-form .case-form-wide, .case-form > .head-actions { grid-column: 1 / -1; }
.case-form .panel > h2:first-child { margin-bottom: 10px; padding-bottom: 7px; }
.case-form .grid-2, .case-form .grid-3, .case-form .grid-4, .case-form .stack { gap: 10px; }
.case-form .case-form-wide > .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 1260px; }
.case-product-period-grid { grid-template-columns: minmax(300px, 420px) repeat(2, minmax(280px, 360px)) !important; }
.case-form-compact > label { max-width: 390px; }
.case-form .form-context-hint { margin: 8px 0 0; }
.case-form label { gap: 4px; }
.case-form input, .case-form select, .case-form textarea { padding: 8px; }
.case-form textarea { min-height: 76px; }
.key-value { padding: 12px; border: 1px solid var(--line-soft); border-radius: 7px; background: var(--panel-2); }
.key-value small, .key-value strong, .key-value span { display: block; }
.key-value small, .key-value span { color: var(--muted); }
.key-value strong { margin: 4px 0; }
.timeline { display: grid; gap: 10px; }
.task { display: flex; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-2); }
.task.warning { border-color: rgba(215, 163, 47, .55); background: rgba(215, 163, 47, .08); }
.task.overdue { border-color: rgba(217, 83, 79, .6); background: rgba(217, 83, 79, .08); }
.task.done { opacity: .6; }
.task.done.not-required { opacity: 1; border-style: dashed; background: rgba(215, 163, 47, .07); }
.task-actions { display: flex; align-items: center; gap: 6px; }
.workflow-task { scroll-margin-top: 94px; }
.workflow-task:target { border-color: var(--brand-2); box-shadow: 0 0 0 2px rgba(7, 155, 157, .25); }
.workflow-section-title { margin: 18px 0 9px; color: var(--cyan-soft); font-size: 14px; }
.workflow-section-title:first-of-type { margin-top: 14px; }
.callout { padding: 12px 14px; border-left: 5px solid var(--brand-2); border-radius: 6px; background: rgba(7, 155, 157, .12); line-height: 1.5; }
.callout.warning { border-color: var(--amber); background: rgba(215, 163, 47, .1); }
.callout.error { border-color: var(--red); background: rgba(217, 83, 79, .1); }
.section-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.section-tabs a { padding: 8px 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-2); color: #fff; font-weight: 700; }
.admin-tabs { gap: 4px; flex-wrap: nowrap; overflow-x: auto; margin-bottom: 0; padding: 0 4px; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.admin-tabs a { flex: 0 0 auto; padding: 11px 14px; border-bottom: 0; border-radius: 7px 7px 0 0; color: var(--muted); }
.admin-tabs a:hover { color: #fff; border-color: rgba(7, 155, 157, .48); background: #292d2f; }
.admin-tabs a.active { position: relative; bottom: -1px; border-color: var(--brand-2); background: var(--brand); color: #fff; }
.admin-tabs-grouped { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 6px; overflow: visible; padding: 0 0 10px; border-bottom: 0; }
.admin-tab-group { min-width: 0; padding: 7px 8px; border: 1px solid var(--line); border-left: 3px solid rgba(185, 255, 255, .42); border-radius: 6px; background: var(--panel-2); }
.admin-tab-group > span { display: block; margin-bottom: 5px; color: var(--cyan-soft); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.admin-tab-group > div { display: flex; flex-wrap: wrap; gap: 4px; }
.admin-tabs-grouped a { bottom: auto; min-height: 32px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 5px; color: #fff; background: #202325; font-size: 13px; }
.admin-tabs-grouped a.active { bottom: auto; border-color: var(--brand-2); background: var(--brand); }
.admin-tab-panel { margin-top: 0; border-top-left-radius: 0; }
.admin-tab-panel[hidden], [hidden] { display: none !important; }
.admin-section { max-width: 1560px; }
.admin-section > form.stack { max-width: 1320px; }
.settings-block { display: grid; gap: 12px; max-width: 920px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); }
.settings-block h3 { margin: 0; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.settings-block .hint { margin: -2px 0 0; }
.process-settings > .primary { justify-self: start; min-width: 250px; }
.mail-design-preview { display: block; width: 100%; min-height: 620px; border: 1px solid var(--line); border-radius: 7px; background: #f2f6f7; }
.admin-section { scroll-margin-top: 98px; }
.admin-row { display: grid; grid-template-columns: 1fr 120px 130px auto; gap: 9px; align-items: end; padding: 12px 0; border-top: 1px solid var(--line); }
.admin-row:first-of-type { border-top: 0; }
.product-color-field { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 13px; font-weight: 800; }
.product-color-palette { display: flex; flex-wrap: wrap; gap: 7px; }
.product-color-choice { display: block; cursor: pointer; }
.product-color-choice input { position: absolute; opacity: 0; pointer-events: none; }
.product-color-choice span { display: block; width: 25px; height: 25px; border: 2px solid transparent; border-radius: 50%; background: var(--product-color); box-shadow: 0 0 0 1px rgba(255,255,255,.24); }
.product-color-choice input:checked + span { border-color: #fff; box-shadow: 0 0 0 3px var(--brand), 0 0 0 4px rgba(255,255,255,.7); }
.product-color-choice input:disabled + span { cursor: not-allowed; opacity: .25; filter: grayscale(1); }
.compact-admin-list { max-width: 920px; }
#collages .admin-row { grid-template-columns: minmax(220px, 380px) 140px 120px auto; justify-content: start; }
.collage-create { display: grid; grid-template-columns: minmax(220px, 380px) minmax(180px, 260px) 150px auto; gap: 12px; align-items: end; max-width: 1050px; }
.master-card-grid { display: grid; grid-template-columns: repeat(2, minmax(360px, 1fr)); gap: 16px; }
.master-card { padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); }
.master-card > h3 { margin-bottom: 4px; }
.master-card > p { margin-top: 0; color: var(--muted); }
.compact-edit-row, .compact-create-row { display: grid; grid-template-columns: minmax(180px, 340px) 115px auto; gap: 9px; align-items: end; padding: 11px 0; border-top: 1px solid var(--line-soft); }
.compact-edit-row.ad-channel-row { grid-template-columns: minmax(180px, 300px) minmax(190px, auto) 115px auto; }
.compact-create-row { margin-top: 12px; border-top: 0; }
.compact-create-row.ad-channel-create { grid-template-columns: minmax(180px, 300px) minmax(190px, auto) auto; }
.check-field { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 9px 10px; border: 1px solid #444; border-radius: 6px; background: var(--field); color: var(--text); }
.location-cards details { align-self: start; padding: 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-2); }
.rule-matrix { display: grid; gap: 10px; }

/* Process diagrams stay at reading size; each phase has its own small graph. */
.process-panel { padding:24px; scroll-margin-top:80px; }
.process-toolbar { display:flex; align-items:center; gap:28px; }
.process-toolbar label { width:360px; max-width:100%; flex-shrink:0; font-weight:700; }
.process-toolbar select { margin-top:8px; }
.process-toolbar p { color:var(--muted); max-width:540px; margin:0; }
.process-tabs { display:flex; flex-wrap:wrap; gap:8px; margin:22px 0 16px; }
.process-tabs button { min-height:44px; }
.process-tabs .is-active { color:#fff; background:#087a7c; border-color:#42ceca; box-shadow:0 0 0 1px #42ceca; }
.process-key { display:flex; gap:18px; flex-wrap:wrap; color:var(--muted); font-size:13px; padding:12px 0; border-block:1px solid var(--line); }
.process-key .yes { color:#5ee0ac; }.process-key .no { color:#fda4a4; }.process-key .repeat { color:#f8cd70; }
.process-profile { color:var(--muted); margin:20px 0; }.process-profile strong { color:var(--text); }
.process-article + .process-article { border-top:1px solid var(--line); padding-top:26px; margin-top:28px; }
.process-article h2 { font-size:21px; margin:0 0 8px; }.process-intro { margin:0 0 16px; color:var(--muted); max-width:850px; }
.process-scroll { overflow-x:auto; border:1px solid var(--line); border-radius:12px; background:#131b20; }
.process-scroll:focus-visible { outline:2px solid #42ceca; outline-offset:3px; }
.process-graph { position:relative; display:grid; grid-template-columns:320px 320px; column-gap:200px; row-gap:88px; width:930px; padding:24px 66px 24px 24px; box-sizing:border-box; align-items:start; }
.process-graph.single { width:100%; max-width:760px; grid-template-columns:minmax(0,1fr); padding:24px; margin-inline:auto; row-gap:72px; }
.process-lines { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; z-index:1; overflow:visible; }
.process-node { position:relative; z-index:2; min-height:146px; padding:18px 20px; background:#1d292f; border:1px solid #52616b; border-left:4px solid #42ceca; border-radius:10px; font-size:15px; line-height:1.5; box-shadow:0 3px 10px #0002; }
.process-node strong { display:block; font-size:17px; color:#fff; line-height:1.35; }.process-node p { margin:9px 0 0; color:#c3ced3; font-size:14px; }
.process-owner { display:block; color:#91b9c1; font-size:11px; font-weight:800; letter-spacing:.06em; text-transform:uppercase; margin-bottom:8px; }
.process-node.decision { border-color:#e5b957; border-left-color:#e5b957; background:#2a2922; }.process-node.decision .process-owner { color:#f8cd70; }
.process-node.end { border-left-color:#5ee0ac; }.process-node.parallel { border-left-color:#bb9dff; }
.process-edge { fill:none; stroke:#96a8b5; stroke-width:2; stroke-linejoin:round; }
.process-edge.yes { stroke:#5ee0ac; }.process-edge.no { stroke:#fda4a4; }.process-edge.repeat { stroke:#f8cd70; stroke-dasharray:6 4; }
.process-edge-label { fill:#cbd5dd; font:600 13px system-ui,sans-serif; }.process-edge-label.yes { fill:#5ee0ac; }.process-edge-label.no { fill:#fda4a4; }.process-edge-label.repeat { fill:#f8cd70; }
.process-label-bg { fill:#131b20; }
.process-note { padding:15px 18px; border-left:3px solid #42ceca; background:#079b9d10; color:var(--muted); line-height:1.55; margin:16px 0; }
.process-parallel { padding:18px; border:1px solid #9b80d2; border-radius:10px; background:#a78bfa0c; margin-bottom:25px; }.process-parallel strong { color:#dfd0ff; }.process-parallel p { color:var(--muted); margin:8px 0 0; }
.process-overview-links { display:flex; gap:8px; flex-wrap:wrap; }.process-scroll-hint { display:none; font-size:12px; color:var(--muted); }
.process-exceptions details { padding:14px 0; border-top:1px solid var(--line); }.process-exceptions summary { cursor:pointer; font-weight:700; }.process-exceptions details p { color:var(--muted); max-width:900px; line-height:1.6; }
@media(max-width:1200px) { .process-scroll-hint { display:block; } }
@media(max-width:700px) { .process-panel { padding:16px; }.process-toolbar { display:block; }.process-toolbar label { width:100%; }.process-toolbar p { margin-top:12px; font-size:14px; }.process-tabs { gap:7px; margin-top:18px; }.process-tabs button { flex:1 1 140px; font-size:13px; padding:10px; }.process-key { gap:10px 16px; }.process-graph.single { padding:16px; }.process-node { padding:15px; }.process-article h2 { font-size:19px; } }

.rule-card { padding: 13px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-2); }
.accordion details { margin-bottom: 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-2); }
.accordion summary { padding: 14px 16px; cursor: pointer; font-weight: 800; }
.mail-template { margin: 10px 0; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); }
.mail-template > summary { padding: 14px 16px; cursor: pointer; }
.mail-template > summary small { display: block; margin-top: 4px; color: var(--muted); font-weight: 400; }
.mail-template-content { padding: 0 16px 16px; }
.placeholder-legend { margin: 0 0 16px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); }
.placeholder-legend summary { padding: 12px 14px; cursor: pointer; font-weight: 700; }
.placeholder-legend > p { margin: 0 14px 12px; }
.placeholder-legend dl { margin: 0; padding: 0 14px 14px; }
.placeholder-legend dl > div { display: grid; grid-template-columns: minmax(190px, .8fr) 2fr; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.placeholder-legend dt, .placeholder-legend dd { margin: 0; }
.accordion details > div { padding: 0 16px 16px; }
.compact-empty { display: grid; gap: 6px; padding: 24px; border: 1px dashed #485052; border-radius: 7px; background: var(--panel-2); text-align: center; }
.compact-empty span { color: var(--muted); }
.empty-state { max-width: 560px; margin: 11vh auto; padding: 38px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); box-shadow: var(--shadow); text-align: center; }
.empty-icon { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 15px; border-radius: 50%; background: rgba(215, 163, 47, .18); color: #ffe2a1; font-size: 28px; font-weight: 900; }
.auth-shell { display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 15% 20%, rgba(7, 155, 157, .18), transparent 34%), #101112; }
.login-card { width: min(440px, 100%); padding: 30px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); box-shadow: var(--shadow); }
.login-brand { display: flex; align-items: center; gap: 13px; padding-bottom: 18px; border-bottom: 4px solid var(--brand); }
.login-brand img { width: 86px; height: 54px; object-fit: contain; }
.login-brand strong, .login-brand small { display: block; }
.login-brand strong { font-size: 19px; }
.login-brand small { margin-top: 3px; color: var(--muted); }
.login-card h1 { margin: 24px 0 5px; }
.login-card > p { color: var(--muted); line-height: 1.5; }
.login-card .primary { width: 100%; padding: 12px; }
.inline-form { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.nowrap { white-space: nowrap; }
.text-red { color: #ffaaaa; }
.text-green { color: #bff0d0; }
hr { margin: 20px 0; border: 0; border-top: 1px solid var(--line); }
code { color: #d9ffff; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.panel-heading h2 { margin-top: 0; }
.gallery-view-switcher { padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: rgba(0, 0, 0, .18); }
.gallery-view-switcher .gallery-view-option { border: 1px solid transparent; background: transparent; color: var(--muted); }
.gallery-view-switcher .gallery-view-option:hover { border-color: rgba(185, 255, 255, .3); background: var(--panel-2); color: #fff; }
.gallery-view-switcher .gallery-view-option.active { border-color: var(--cyan-soft); background: var(--cyan-soft); color: #102425; box-shadow: 0 0 0 2px rgba(185, 255, 255, .18); cursor: default; }
.gallery-view-switcher .gallery-view-option.active::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.idea-list { display: grid; gap: 12px; }
.idea-item { padding: 14px; border: 1px solid var(--line); border-left: 4px solid var(--cyan-soft); border-radius: 7px; background: var(--panel-2); }
.idea-item.in_progress { border-left-color: var(--gold); }
.idea-item.done { border-left-color: var(--green); opacity: .82; }
.idea-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.idea-heading > div { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.idea-heading small, .idea-meta { color: var(--muted); }
.idea-reference { padding: 0; border: 0; border-radius: 0; background: transparent; font: inherit; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--cyan-soft); cursor: copy; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; }
.idea-reference:hover, .idea-reference:focus-visible { color: var(--text); }
.idea-reference:focus-visible { outline: 2px solid var(--cyan-soft); outline-offset: 3px; }
.idea-body { margin: 12px 0; white-space: normal; }
.idea-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; }
.idea-item details { margin-top: 13px; }
.idea-item summary { cursor: pointer; color: var(--cyan-soft); font-weight: 700; }
.idea-details { display: grid; gap: 12px; margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--line-soft); }
.idea-details h3 { margin: 4px 0 0; font-size: 15px; }
.idea-comment-list { display: grid; gap: 8px; }
.idea-comment { padding: 10px; border-left: 3px solid rgba(185,255,255,.4); border-radius: 4px; background: rgba(0,0,0,.14); }
.idea-comment > div { display: flex; justify-content: space-between; gap: 10px; }
.idea-comment small { color: var(--muted); }
.idea-comment p { margin: 7px 0 0; }
.idea-history { display: grid; gap: 8px; margin: 0; padding-left: 22px; color: var(--muted); }
.idea-history strong { color: var(--text); }
.idea-form { padding-top: 10px; border-top: 1px solid var(--line-soft); }
.idea-status-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.idea-status-actions form { margin: 0; }
.user-admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.user-admin-card { display: grid; align-content: start; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); }
.user-admin-card > header { display: flex; justify-content: space-between; gap: 12px; }
.user-admin-card > header strong, .user-admin-card > header small { display: block; }
.media-file-list, .count-list { display: grid; gap: 8px; padding: 0; list-style: none; }
.media-file-list li, .count-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-2); }
.media-file-list span, .media-file-list small { display: block; }
.gallery-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-bottom: 14px; }
.gallery-admin-image { display: grid; gap: 7px; padding: 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-2); overflow: hidden; }
.gallery-admin-image img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 5px; background: #111; }
.gallery-admin-image span, .gallery-admin-image small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gallery-admin-set-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; margin-bottom: 14px; align-items: start; }
.gallery-admin-set { padding: 12px; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px; background: rgba(0,0,0,.11); }
.gallery-admin-set > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.gallery-admin-set > header strong, .gallery-admin-set > header small { display: block; }
.gallery-admin-set > header small { margin-top: 3px; color: var(--muted); }
.gallery-admin-set .gallery-admin-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); margin-bottom: 0; }
.gallery-admin-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 14px 0; padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-2); }
.gallery-admin-pagination > span { color: var(--muted); font-size: 13px; }
.gallery-admin-pagination > div, .gallery-admin-pagination .inline-form { display: flex; align-items: center; gap: 6px; }
.gallery-admin-pagination a { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; min-height: 30px; padding: 0 7px; border: 1px solid var(--line); border-radius: 5px; color: var(--text); text-decoration: none; }
.gallery-admin-pagination a:hover { border-color: var(--accent); }
.gallery-admin-pagination strong { font-size: 12px; white-space: nowrap; }
.gallery-admin-pagination label { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; }
.gallery-admin-pagination select { min-height: 30px; }
@media (max-width: 700px) { .gallery-admin-pagination { align-items: flex-start; flex-direction: column; } }
.stats-status-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.stats-status-grid > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-2); }
.stats-status-grid strong { font-size: 22px; }
.stat-bar { display: block; width: 100%; min-width: 130px; height: 8px; border-radius: 999px; background: #121415; overflow: hidden; }
.stat-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.gallery-stat-card { margin-top: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); overflow: hidden; }
.gallery-stat-comparison { display: grid; gap: 14px; margin-top: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 9px; background: linear-gradient(135deg,rgba(11,125,141,.18),rgba(0,0,0,.08)); }
.gallery-stat-comparison-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.gallery-stat-comparison-heading p { margin: 0 0 3px; color: var(--cyan-soft); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.gallery-stat-comparison-heading h3 { margin: 0; font-size: 18px; }
.gallery-stat-comparison-filter { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; color: var(--muted); font-size: 12px; }
.gallery-stat-comparison-filter button { min-height: 30px; padding: 4px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel-2); color: var(--muted); font: inherit; cursor: pointer; }
.gallery-stat-comparison-filter button:hover, .gallery-stat-comparison-filter button.active { border-color: var(--brand-2); background: rgba(11,125,141,.24); color: var(--text); }
.gallery-stat-comparison-chart { display: grid; gap: 8px; }
.gallery-stat-comparison-row { display: grid; grid-template-columns: minmax(130px,1fr) minmax(80px,2fr) auto; align-items: center; gap: 10px; font-size: 12px; }
.gallery-stat-comparison-row > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gallery-stat-comparison-row > i { display: block; width: var(--comparison-size); height: 10px; min-width: 4px; border-radius: 999px; background: linear-gradient(90deg,var(--brand),var(--brand-2)); }
.gallery-stat-comparison-row > strong { color: var(--cyan-soft); font-size: 12px; white-space: nowrap; }
.gallery-stat-comparison-rankings { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.gallery-stat-comparison-rankings > div { padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; background: rgba(0,0,0,.12); }
.gallery-stat-comparison-rankings small, .gallery-stat-comparison-rankings strong { display: block; }
.gallery-stat-comparison-rankings small { color: var(--muted); font-size: 11px; }
.gallery-stat-comparison-rankings strong { margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gallery-stat-year { margin-top: 16px; border: 1px solid var(--line); border-radius: 8px; background: rgba(0,0,0,.08); overflow: hidden; }
.gallery-stat-year > summary, .gallery-stat-month > summary { padding: 12px 14px; cursor: pointer; color: var(--cyan-soft); font-weight: 800; }
.gallery-stat-year > summary { font-size: 15px; }
.gallery-stat-month { margin: 0 10px 10px; border: 1px solid var(--line-soft); border-radius: 6px; background: var(--panel); overflow: hidden; }
.gallery-stat-month > summary { color: var(--text); font-size: 13px; }
.gallery-stat-month > .gallery-stat-card { margin: 0 8px 8px; }
.gallery-statistics-heading .eyebrow { margin: 0 0 4px; color: var(--cyan-soft); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.gallery-stat-card > summary, .gallery-stat-more > summary { cursor: pointer; list-style: none; }
.gallery-stat-card > summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px; }
.gallery-stat-card > summary::-webkit-details-marker, .gallery-stat-more > summary::-webkit-details-marker { display: none; }
.gallery-stat-card summary small { display: block; margin-top: 3px; color: var(--muted); }
.gallery-stat-summary { color: var(--muted); white-space: nowrap; }
.gallery-stat-summary b { color: var(--text); }
.gallery-stat-content { display: grid; gap: 16px; padding: 0 14px 14px; border-top: 1px solid var(--line-soft); }
.gallery-stat-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; padding-top: 14px; }
.gallery-stat-kpis > div { padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: rgba(0,0,0,.12); }
.gallery-stat-kpis small, .gallery-stat-kpis strong { display: block; }
.gallery-stat-kpis small { color: var(--muted); font-size: 11px; }
.gallery-stat-kpis strong { margin-top: 3px; font-size: 19px; }
.gallery-stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.gallery-stat-grid h3, .gallery-stat-content h3 { margin: 0 0 8px; font-size: 14px; }
.gallery-stat-grid .count-list { margin: 0; }
.gallery-stat-grid .count-list small { display: block; color: var(--muted); }
.gallery-stat-grid .count-list a { color: var(--cyan-soft); text-decoration: none; }
.gallery-stat-timeline-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.gallery-stat-timeline-heading > small { padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.gallery-stat-timeline-wrap { overflow-x: auto; overscroll-behavior-x: contain; padding: 2px 2px 8px; scrollbar-color: var(--brand) transparent; }
.gallery-stat-timeline { display: flex; align-items: end; gap: 7px; width: max-content; min-width: 100%; height: 142px; padding: 8px 2px 0; }
.gallery-stat-day { display: grid; grid-template-rows: 1fr auto; min-width: 34px; height: 100%; text-align: center; }
.gallery-stat-gap { align-self: stretch; width: calc(var(--gap-size) * 4px); min-width: 10px; margin: 0 1px 22px; border-bottom: 1px dashed color-mix(in srgb, var(--muted) 45%, transparent); opacity: .7; }
.gallery-stat-day { appearance: none; padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; }
.gallery-stat-day:focus-visible { outline: 2px solid var(--cyan-soft); outline-offset: 2px; }
.gallery-stat-timeline i { align-self: end; display: block; border-radius: 3px 3px 0 0; background: linear-gradient(180deg,var(--brand-2),var(--brand)); }
.gallery-stat-timeline small { margin-top: 4px; color: var(--muted); font-size: 9px; writing-mode: vertical-rl; }
.gallery-stat-top-items li { justify-content: flex-start; }
.gallery-stat-top-items li > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.gallery-stat-top-items li > strong { margin-left: auto; }
.gallery-stat-thumbnail { width: 42px; height: 42px; flex: 0 0 42px; border: 1px solid var(--line); border-radius: 5px; object-fit: cover; background: #151819; }
.gallery-stat-more { padding-top: 2px; }
.gallery-stat-more > summary { color: var(--cyan-soft); font-weight: 700; }
.gallery-stat-more > .gallery-stat-grid { margin-top: 12px; }
.gallery-stat-delete { margin: 0; text-align: right; }
.gallery-day-dialog { width: min(720px,calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text); }
.gallery-day-dialog::backdrop { background: rgba(0,0,0,.65); }
.gallery-day-dialog > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.gallery-day-dialog h2 { margin: 0; }
.gallery-day-kpis { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 8px; margin: 16px 0; }
.gallery-day-kpis > div { padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-2); }
.gallery-day-kpis small, .gallery-day-kpis strong { display: block; }
.gallery-day-kpis small { color: var(--muted); font-size: 11px; }
.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.calendar-toolbar h2 { margin: 0; }
.calendar-shell { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays > div { padding: 9px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 800; text-align: center; }
.calendar-day { min-height: 150px; padding: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #222527; }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day.outside-month { background: #191b1c; color: #777; }
.calendar-day.today { box-shadow: inset 0 0 0 2px var(--brand-2); }
.calendar-day > header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.calendar-events { display: grid; gap: 5px; }
.calendar-event { display: grid; gap: 2px; padding: 6px; border-left: 4px solid var(--amber); border-radius: 4px; background: rgba(215,163,47,.12); color: #fff; font-size: 11px; }
.calendar-event.booking { border-color: var(--green); background: rgba(47,168,102,.14); }
.calendar-event.google { border-color: #4a9cff; background: rgba(74,156,255,.14); }
.calendar-event small, .calendar-event span { color: var(--muted); }
.calendar-event.google { width: 100%; border-top: 0; border-right: 0; border-bottom: 0; text-align: left; cursor: pointer; font: inherit; }
.calendar-event-dialog { width: min(560px, calc(100vw - 28px)); }
.calendar-event-dialog-content { display: grid; gap: 12px; padding: 20px; }
.calendar-event-dialog-content h2, .calendar-event-dialog-content p { margin: 0; }
.calendar-event-dialog-content p { color: var(--muted); line-height: 1.5; white-space: pre-wrap; }

@media (max-width: 1320px) {
  .case-list-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1100px) {
  .metrics { grid-template-columns: repeat(3, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .gallery-stat-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gallery-day-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gallery-stat-grid { grid-template-columns: 1fr; }
  [data-case-price] .grid-4 { grid-template-columns: repeat(2, minmax(0, 205px)); }
  .case-form .case-form-wide > .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-product-period-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .master-card-grid { grid-template-columns: 1fr; }
  #collages .admin-row, .collage-create { grid-template-columns: minmax(180px, 1fr) 140px 120px auto; }
}

@media (max-width: 780px) {
  .gallery-stat-comparison-row { grid-template-columns: minmax(90px,1fr) minmax(55px,1fr) auto; gap: 7px; }
  .gallery-stat-comparison-rankings { grid-template-columns: 1fr; }
  .topbar { min-height: 64px; padding: 8px 12px; }
  .menu-toggle { display: flex; }
  .brand img { width: 58px; height: 36px; }
  .brand strong { font-size: 17px; }
  .brand > span, .account > span:not(.live-project-status), .version-link { display: none; }
  .account { gap: 8px; }
  .live-project-status { gap: 5px; font-size: 10px; }
  .live-project-details { gap: 1px; }
  .live-code { font-size: 9px; }
  .logout-button { min-width: 32px; padding: 6px 8px; font-size: 17px; }
  .workspace { min-height: calc(100vh - 64px); }
  .sidebar { position: fixed; top: 64px; bottom: 0; left: 0; width: min(86vw, 330px); height: calc(100vh - 64px); padding-top: 12px; transform: translateX(-105%); transition: transform .22s ease; box-shadow: 16px 0 42px rgba(0, 0, 0, .55); }
  .sidebar.open { transform: translateX(0); }
  .menu-backdrop { position: fixed; inset: 0; z-index: 25; width: 100%; height: 100%; padding: 0; border-radius: 0; background: rgba(0, 0, 0, .62); }
  .menu-open .menu-backdrop { display: block; }
  .main { padding: 16px 13px; }
  .page-head { display: block; }
  .head-actions { margin-top: 14px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .metric { min-width: 0; padding: 11px; }
  .metric strong { font-size: 21px; overflow-wrap: anywhere; }
  .metric small { display: block; line-height: 1.25; }
  .grid-2, .grid-3, .grid-4, .key-values, .case-data-grid, .case-data-wide { grid-template-columns: 1fr; }
  [data-case-price] .grid-4 { grid-template-columns: minmax(0, 205px); }
  .case-form .case-form-wide > .grid-4 { grid-template-columns: 1fr; }
  .case-product-period-grid { grid-template-columns: 1fr !important; }
  .case-form { grid-template-columns: 1fr; }
  .case-data-heading { align-items: flex-start; padding: 15px; }
  .case-data-heading span { text-align: right; }
  .case-data-sections { padding: 15px; }
  .user-admin-grid, .stats-status-grid { grid-template-columns: 1fr; }
  .panel-heading, .calendar-toolbar { align-items: stretch; flex-direction: column; }
  .version-entry-head { align-items: stretch; flex-direction: column; gap: 4px; }
  .version-deployment { text-align: left; white-space: normal; }
  .version-changes { grid-template-columns: 1fr; gap: 4px; }
  .calendar-shell { overflow-x: auto; }
  .calendar-grid { min-width: 840px; }
  .admin-row { grid-template-columns: 1fr 1fr; }
  .admin-row > *:first-child { grid-column: 1 / -1; }
  #collages .admin-row, .collage-create, .compact-edit-row, .compact-edit-row.ad-channel-row, .compact-create-row, .compact-create-row.ad-channel-create { grid-template-columns: 1fr; }
  #collages .admin-row > *:first-child { grid-column: auto; }
  .panel { padding: 15px; }
  .filters { display: grid; grid-template-columns: 1fr; align-items: stretch; }
  .filters label, .filters .search { min-width: 0; }
  .filters .button, .filters button { min-height: 44px; }
  .filter-panel details { padding: 0; overflow: hidden; }
  .filter-panel summary { display: flex; align-items: center; justify-content: space-between; min-height: 50px; padding: 14px 15px; cursor: pointer; font-weight: 800; list-style: none; }
  .filter-panel summary::-webkit-details-marker { display: none; }
  .filter-panel summary span { color: var(--cyan-soft); font-size: 13px; }
  .filter-panel details[open] summary { border-bottom: 1px solid var(--line); }
  .filter-panel details[open] summary span { font-size: 0; }
  .filter-panel details[open] summary span::after { content: 'ausblenden'; font-size: 13px; }
  .filter-panel .filters { padding: 15px; }
  .data-table { min-width: 700px; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .case-list-sort-mobile { display: grid; grid-template-columns: minmax(0, 1fr) 46px; gap: 7px; align-items: end; margin-bottom: 10px; }
  .case-list-sort-mobile label { grid-column: 1 / -1; }
  .table-sort-direction { min-height: 42px; padding: 8px; font-size: 20px; }
  .case-list-wrap { overflow: visible; border: 0; }
  .case-list { min-width: 0; }
  .case-list thead { display: none; }
  .case-list, .case-list tbody, .case-list tr, .case-list td { display: block; width: 100%; }
  .case-list tr { margin-bottom: 11px; padding: 3px 0; border: 1px solid var(--line); border-radius: 8px; background: #222527; box-shadow: 0 8px 18px rgba(0,0,0,.14); }
  .case-list td { display: grid; grid-template-columns: minmax(92px, .72fr) minmax(0, 1.28fr); gap: 10px; padding: 9px 11px; border-bottom: 1px solid var(--line-soft); background: transparent; }
  .case-list td::before { content: attr(data-label); color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
  .case-list td:first-child { padding-top: 12px; }
  .case-list td:last-child { border-bottom: 0; }
  .case-list .badges { justify-content: flex-start; }
  .task, .task-actions, .media-file-list li, .count-list li, .gallery-admin-set > header { align-items: stretch; flex-direction: column; }
  .gallery-admin-set-list { grid-template-columns: 1fr; }
  .task-actions { width: 100%; }
  .task-actions form, .task-actions button { width: 100%; }
  .section-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 3px; }
  .section-tabs a { flex: 0 0 auto; min-height: 42px; }
  .case-tabs { margin-bottom: 14px; border-radius: 7px; }
  .case-tabs button { min-height: 44px; padding: 8px 12px; }
  .admin-tabs-grouped { grid-template-columns: 1fr; overflow: visible; padding-bottom: 0; }
  .calendar-shell { position: relative; }
  .calendar-shell::after { content: 'Zum Blättern seitlich wischen'; position: sticky; left: 0; display: block; padding: 7px 10px; background: var(--panel-2); color: var(--muted); font-size: 12px; text-align: center; }
}

/* Auf größeren Bildschirmen bleibt die Oberfläche bewusst kompakt, ohne die
   besser lesbare mobile Schriftgröße zu reduzieren. */
@media (min-width: 781px) {
  body { font-size: 14px; }
  .brand strong { font-size: 20px; }
  .page-head h1 { font-size: 26px; }
  .metric strong { font-size: 23px; }
  .stats-status-grid strong { font-size: 20px; }
}

@media (max-width: 440px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-kpis .metric strong { font-size: 18px; }
  .page-head h1 { font-size: 24px; }
  .head-actions .button { width: 100%; min-height: 44px; }
  .login-card { padding: 23px; }
  .account .secondary { padding: 7px 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar, .flash { transition: none; }
}
@media(max-height:1200px){.sidebar{padding:10px 12px}.sidebar nav{display:grid;align-content:start;gap:5px;min-height:0}.sidebar .nav-label{display:flex;align-items:center;min-height:38px;margin:0;padding:0 10px;border:1px solid var(--line-soft);border-radius:7px;background:#1d2021;cursor:pointer;list-style:none}.sidebar .nav-label::after{content:'⌄';margin-left:auto;color:var(--cyan-soft);font-size:16px;transition:transform .16s ease}.sidebar .nav-label[aria-expanded=true]::after{transform:rotate(180deg)}.sidebar .nav-group{margin:0;padding:6px;gap:5px}.sidebar .nav-group[hidden]{display:none}.sidebar nav a{min-height:38px;padding-top:7px;padding-bottom:7px}.sidebar-footer{padding:10px 8px 2px;font-size:12px}}
.sidebar.sidebar-compact { padding: 10px 12px; }
.sidebar.sidebar-compact nav { display: grid; align-content: start; gap: 5px; min-height: 0; }
.sidebar.sidebar-compact .nav-label { display: flex; align-items: center; min-height: 38px; margin: 0; padding: 0 10px; border: 1px solid var(--line-soft); border-radius: 7px; background: #1d2021; cursor: pointer; list-style: none; }
.sidebar.sidebar-compact .nav-label::after { content: '⌄'; margin-left: auto; color: var(--cyan-soft); font-size: 16px; transition: transform .16s ease; }
.sidebar.sidebar-compact .nav-label[aria-expanded=true]::after { transform: rotate(180deg); }
.sidebar.sidebar-compact .nav-group { margin: 0; padding: 6px; gap: 5px; }
.sidebar.sidebar-compact .nav-group[hidden] { display: none; }
.sidebar.sidebar-compact nav a { min-height: 38px; padding-top: 7px; padding-bottom: 7px; }
.sidebar.sidebar-compact .sidebar-footer { padding: 10px 8px 2px; font-size: 12px; }

.process-task-tabs { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:22px; }
.process-task-tabs .button { background:#243039; border:1px solid #52616b; color:#d7e1e5; min-height:44px; }
.process-task-tabs .is-active { background:#353044; border-color:#bb9dff; color:#eee4ff; }
.process-article[hidden] { display:none; }
.process-task-tabs ~ .process-article { border-top:0; margin-top:0; padding-top:0; }
.process-node[data-workflow-node="rejected"] { border-left-color:#fda4a4; }
