/* Layouts of the web UI (Profil/Einstellungen → Darstellung). style.css is the shared base; this file holds
 *   1. parts every layout has (header, list head, reading pane sections, action bars),
 *   2. the dashboard as an app shell on wide screens (panes scroll on their own),
 *   3. per layout, scoped by the class on <body>: .layout-a (Drei Spalten), .layout-b (Kompakt), .layout-c (Ruhig).
 * Markup and scripts are the same for all three; only B has its command bar (_ribbon.html) and table cells (_row.html).
 */

/* ======================================================================== 1. shared parts */
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--primary); color: #fff; display: grid; place-items: center; flex: none; }
.nav-toggle { display: none; }
.who-link { display: inline-flex; align-items: center; gap: 8px; }
.who .who-av { width: 28px; height: 28px; font-size: 11px; margin: 0; }
header.top { gap: 18px; }
header.top nav { gap: 4px; }
header.top nav a { padding: 5px 10px; white-space: nowrap; }
header.top > .search { flex: 0 1 520px; }

/* filled buttons: --btn-bg (darker than the link colour in dark mode, so white text keeps a 4.5:1 contrast) */
button.primary, .button.primary, .cmdbar button.cmd-send, .rb-big.primary { background: var(--btn-bg, var(--primary)); }

/* list head: view, count, „Nächste offene“ */
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; padding: 4px 6px 12px; }
.list-title-wrap { display: flex; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; min-width: 0; }
.list-title { margin: 0; font-size: 17px; }
.list-count { font-size: 12.5px; }
.next-open-btn { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.list-cols { display: none; }
.swipe-hint { display: none; }
.urg-mark { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 4px; background: var(--c-red); color: #fff;
            font-size: 11px; font-weight: 800; line-height: 1; margin-right: 6px; vertical-align: 1px; flex: none; }
.att-n { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; }
.row-box { margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40%; }
.conf-n { font-variant-numeric: tabular-nums; }

/* reading pane */
.card-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.card-bar .bar-gap { flex: 1; }
.card-bar .bar-btn, .card-bar .next-open-btn { display: inline-flex; align-items: center; gap: 6px; }
.card-bar .nav-btn { color: var(--text); border-color: var(--line); }
.card-head { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.card-head .head-main { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.card-head .subject { font-size: 18px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; margin: 0; }
.card-head .head-from { overflow-wrap: anywhere; }
.card-head .meta { flex: 0 1 270px; justify-content: flex-end; }
.card-av { width: 40px; height: 40px; font-size: 14px; }
.card-account { margin: 0; }
.card-body { min-width: 0; }
.card-main, .card-reply { min-width: 0; }
details.mail-orig > summary { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
details.mail-orig pre { font: inherit; font-size: 14.5px; line-height: 1.55; max-height: none; }
.questions, .points { list-style: none; padding-left: 0; display: grid; gap: 3px; }
.questions li, .points li { display: flex; gap: 6px; align-items: flex-start; }
.questions li > svg, .points li > svg { flex: none; margin-top: 3px; }
.questions .q-ok > svg { color: var(--c-green); }
.questions .q-open { color: var(--c-amber-ink); }
.points li > svg { color: var(--c-amber); }
.research-note svg, .att-line svg, p.working svg { vertical-align: -2px; }
.team-row.claimed-other { background: var(--c-amber-bg); border-color: transparent; }

/* draft form */
.draft-head { display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; margin-top: 12px; }
form.draft label.draft-title { display: inline; margin: 0; font-size: 13px; font-weight: 700; color: var(--text); }
.draft-state { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--tone-ink); font-weight: 600; }
.draft-state .dot { background: var(--tone); }
.draft-src { margin-left: auto; text-decoration: none; }
.draft-to { margin-top: 8px; font-size: 14px; overflow-wrap: anywhere; }
form.draft textarea { width: 100%; margin-top: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card);
                      color: var(--text); font: inherit; line-height: 1.55; resize: vertical; }
form.draft .row button svg, .row.actions .primary svg, .compose-btn svg { vertical-align: -2px; }
.compose-btn, .compose-hint, .send-hint { display: none; }
.send-hint kbd, .statusline kbd { font: 600 11px/1 ui-monospace, Menlo, Consolas, monospace; border: 1px solid var(--line);
                                  border-bottom-width: 2px; border-radius: 4px; padding: 1px 5px; }

/* search filters behind „Filter“ in the list column (A, C) – as on the phone */
@media (min-width: 701px) {
  .layout-a #search-form .search-filter-toggle, .layout-c #search-form .search-filter-toggle { display: inline-block; }
  .layout-a #search-form .search-filters, .layout-c #search-form .search-filters { display: none; }
  .layout-a #search-form.filters-open .search-filters, .layout-c #search-form.filters-open .search-filters { display: flex; }
}
@media (max-width: 1100px) { .send-hint { display: none !important; } }

/* phone and tablet: action bar under the open mail (all layouts) */
.cmdbar { display: none; }
@media (max-width: 1100px) {
  .cmdbar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 3;
            padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line); }
  .cmdbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 6px 2px;
                   border: 0; box-shadow: none; background: transparent; color: var(--text); font-size: 11.5px; line-height: 1.2; border-radius: var(--r); }
  .cmdbar button.cmd-send { color: var(--primary-text); font-weight: 600; }
  .cmdbar button:disabled { opacity: .35; cursor: default; }
  #detail-pane { padding-bottom: 96px; }
  .card-bar [data-act], .card-bar .next-open-btn { display: none; }
  .card-bar { position: sticky; top: -12px; z-index: 2; margin: -12px -12px 12px; padding: 8px 12px; background: var(--bg); border-bottom: 1px solid var(--line); }
}

/* phone header: brand, menu button, avatar; the menu opens the navigation below */
@media (max-width: 700px) {
  header.top { flex-wrap: wrap; gap: 8px 10px; }
  .nav-toggle { display: inline-grid; place-items: center; order: 2; margin-left: auto; padding: 6px; color: var(--text); }
  .who { order: 3; margin-left: 0; }
  .who-name, .who form { display: none; }
  header.top nav { display: none; order: 9; flex: 1 1 100%; }
  body.nav-open header.top nav { display: flex; }
  body.nav-open .who form { display: inline; }
  header.top > .search { order: 8; flex: 1 1 100%; }
  .card-head .meta { justify-content: flex-start; }
}

/* ======================================================================== 2. dashboard as app shell (wide screens) */
@media (min-width: 1101px) {
  body.page-dashboard { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
  body.page-dashboard > header.top { flex: none; position: relative; }
  body.page-dashboard > main { flex: 1; min-height: 0; max-width: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
  body.page-dashboard .layout { flex: 1; min-height: 0; gap: 0; align-items: stretch; }
  body.page-dashboard #sidebar { position: static; top: auto; overflow: auto; min-height: 0; }
  body.page-dashboard #list-pane { overflow: auto; min-height: 0; }
  body.page-dashboard #detail-pane { position: static; top: auto; max-height: none; overflow: auto; min-height: 0; }
}

/* ======================================================================== 3a. Layout A – Drei Spalten */
.layout-a { --bg: #f6f7f9; --primary: #2459d6; --primary-ink: #1a44a8; --primary-soft: #e8eefc; --line: #e3e7ed; --hover: #f2f5f9;
            --muted: #5d6879; --side-bg: #f8f9fb; --sel: #edf2fd; }
@media (prefers-color-scheme: dark) {
  .layout-a { --btn-bg: #2f62d0; --bg: #0f141c; --primary: #4b82f0; --primary-ink: #b3cbff; --primary-soft: #1b2b4a; --line: #263243; --hover: #1a2333;
              --muted: #9aa6ba; --side-bg: #131a25; --sel: #1a2840; }
}
.layout-a header.top { padding: 10px 16px; box-shadow: none; background: var(--side-bg); }
.layout-a .brand { font-size: 15px; min-width: 200px; }
.layout-a header.top nav a.active { background: var(--card); box-shadow: inset 0 0 0 1px var(--line); color: var(--primary-ink); }

@media (min-width: 1101px) {
  .layout-a .layout { grid-template-columns: 248px minmax(340px, 440px) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); background: var(--card); }
  .layout-a .layout > #search-form { grid-column: 2; grid-row: 1; padding: 12px 14px 8px; border-right: 1px solid var(--line); }
  .layout-a #sidebar { background: var(--side-bg); border-right: 1px solid var(--line); padding: 14px 10px; }
  .layout-a #list-pane { border-right: 1px solid var(--line); }
  .layout-a #detail-pane { padding: 0 28px 28px; }
}
.layout-a .side-block { background: transparent; border: 0; box-shadow: none; padding: 0; margin-bottom: 14px; }
.layout-a .side-title { padding: 2px 8px 4px; }
.layout-a .side-item { padding: 6px 10px; border-radius: 6px; }
.layout-a .side-label, .layout-a .side-name { display: inline-flex; align-items: center; gap: 8px; }
.layout-a .side-name > svg, .layout-a .side-label > svg { color: var(--muted); flex: none; }
.layout-a .side-item .pill { background: transparent; border-color: transparent; color: var(--muted); }
.layout-a .side-item .pill.tint { background: var(--tone-bg); color: var(--tone-ink); }
.layout-a .open-counter { padding: 4px 8px 6px; }
.layout-a .open-n { color: var(--text); }
.layout-a .legend { border-top: 1px solid var(--line); padding-top: 10px; border-radius: 0; }

/* list: plain rows, state as coloured dot before the sender and as label */
.layout-a .list-head { padding: 10px 16px; border-bottom: 1px solid var(--line); margin: 0; }
.layout-a .list-head .next-open-btn { display: none; }
.layout-a .list-toolbar { padding: 10px 16px; border-bottom: 1px solid var(--line); }
.layout-a .group + .group { margin-top: 0; }
.layout-a .group-head { padding: 6px 16px; background: var(--side-bg); border-bottom: 1px solid var(--line); font-size: 11.5px; color: var(--muted); }
.layout-a .group-head .pill { background: transparent; border-color: transparent; }
.layout-a .mail { margin: 0; border-radius: 0; box-shadow: none; border-bottom: 1px solid var(--line); }
.layout-a .mail-card { border: 0; border-radius: 0; padding: 10px 16px 10px 16px; gap: 0; }
.layout-a .mail-card::before { display: none; }
.layout-a .mail .avatar { display: none; }
.layout-a .row-from::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--tone); margin-right: 8px; vertical-align: 1px; }
.layout-a .mail.urgent .row-from::before { display: none; }
.layout-a .row-summary { -webkit-line-clamp: 1; }
.layout-a .row-badges { margin-top: 5px; gap: 4px; }
.layout-a .row-badges .badge { font-size: 11.5px; line-height: 16px; padding: 1px 7px; }
.layout-a .row-questions { margin-top: 4px; }
@media (hover: hover) { .layout-a .mail:hover { transform: none; box-shadow: none; } .layout-a .mail:hover .mail-card { background: var(--hover); } }
.layout-a .mail.selected { box-shadow: inset 3px 0 0 var(--primary); }
.layout-a .mail.selected .mail-card { background: var(--sel); }
.layout-a .swipe-under { border-radius: 0; }
.layout-a .search-results { padding: 0 8px; }

/* reading pane: bar above the mail, original in a box, the draft as reply composer below */
.layout-a #detail .card { background: transparent; border: 0; box-shadow: none; border-radius: 0; padding: 0; margin: 0; }
@media (min-width: 1101px) {
  .layout-a .card-bar { position: sticky; top: 0; z-index: 2; margin: 0 -28px 18px; padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
}
.layout-a .card-bar .bar-btn { border: 1px solid var(--line); background: var(--card); box-shadow: none; }
.layout-a .card-head .subject { font-size: 20px; }
.layout-a .card-av { width: 44px; height: 44px; }
.layout-a details.mail-orig { border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px 14px; background: var(--card); margin: 14px 0 10px; }
.layout-a details.mail-orig pre { border: 0; background: transparent; padding: 6px 0 0; margin: 0; }
.layout-a form.draft { border: 1px solid var(--line); border-radius: 10px; background: var(--card); margin-top: 14px; overflow: hidden; }
.layout-a form.draft > * { margin-left: 14px; margin-right: 14px; }
.layout-a form.draft > .draft-head { margin: 0; padding: 8px 14px; background: var(--side-bg); border-bottom: 1px solid var(--line); }
.layout-a form.draft > .draft-to { margin: 0; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.layout-a form.draft > .draft-subject { margin: 0; padding: 4px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.layout-a form.draft > .draft-subject input { border: 0; padding: 6px 0; box-shadow: none; background: transparent; }
.layout-a form.draft > textarea { margin: 0; width: 100%; border: 0; border-radius: 0; padding: 14px; font-size: 14.5px; }
.layout-a form.draft > .row.actions { margin: 10px 0 0; padding: 10px 14px; background: var(--side-bg); border-top: 1px solid var(--line); }
.layout-a form.draft > .regen-row { margin: 0; padding: 0 14px 12px; background: var(--side-bg); }
.layout-a form.draft > .sender-note { margin: 0; padding: 0 14px 8px; background: var(--side-bg); }

/* ======================================================================== 3b. Layout B – Kompakt */
.layout-b { --bg: #f4f6f8; --primary: #1f5f7a; --primary-ink: #174a60; --primary-soft: #e3eef3; --line: #e1e5ea; --hover: #f1f4f7;
            --muted: #5a6573; --side-bg: #f3f5f7; --bar: #1d2b36; --bar-ink: #e9eef2; --r: 4px; --r-lg: 6px; --r-sm: 3px; }
@media (prefers-color-scheme: dark) {
  .layout-b { --btn-bg: #24617d; --bg: #10161d; --primary: #3a8bb0; --primary-ink: #a9d6ea; --primary-soft: #183444; --line: #263240; --hover: #18222d;
              --muted: #9aa6b4; --side-bg: #141c25; --bar: #0b1218; }
}
.layout-b { font-size: 14px; }
.layout-b header.top { background: var(--bar); color: var(--bar-ink); border-bottom: 0; box-shadow: none; padding: 0 16px; min-height: 44px; flex-wrap: wrap; row-gap: 0; }
.layout-b .brand { color: #fff; font-size: 14px; }
.layout-b .brand-mark { background: #2f7da0; }
.layout-b .who a { color: #fff; }
.layout-b .who .ghost { color: var(--bar-ink); border-color: transparent; }
.layout-b .who .ghost:hover { background: rgba(255, 255, 255, .1); }
.layout-b .nav-toggle { color: #fff; }
.layout-b header.top nav { order: 10; flex: 1 1 100%; margin: 0 -16px; padding: 0 12px; gap: 2px; background: var(--side-bg); border-bottom: 1px solid var(--line); }
.layout-b header.top nav a { border-radius: 0; padding: 7px 12px 6px; color: var(--text); border-bottom: 2px solid transparent; }
.layout-b header.top nav a:hover { background: var(--hover); }
.layout-b header.top nav a.active { background: transparent; color: var(--primary-ink); border-bottom-color: var(--primary); }
/* search box in the dark bar, filters drop down below it */
.layout-b header.top > .search { position: relative; margin: 6px 0; }
.layout-b header.top .search-box { background: #2a3a47; border-color: #3a4c5a; box-shadow: none; padding: 1px 6px 1px 10px; border-radius: 4px; }
.layout-b header.top .search-box input[type=search] { color: #fff; padding: 5px 4px; }
.layout-b header.top .search-box input[type=search]::placeholder { color: #b9c4cd; }
.layout-b header.top .search-icon, .layout-b header.top .search-kbd { color: #b9c4cd; }
.layout-b header.top .search-kbd { background: transparent; border-color: #4a5c6b; }
.layout-b header.top .search-filter-toggle { display: inline-block; color: var(--bar-ink); padding: 3px 8px; }
.layout-b header.top .search-filters { display: none; }
.layout-b header.top .search.filters-open .search-filters { display: flex; position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; min-width: 100%;
  background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow-md); padding: 10px; }
/* command bar */
.ribbon { display: flex; align-items: stretch; gap: 0; padding: 6px 8px 2px; background: var(--card); border-bottom: 1px solid var(--line); overflow-x: auto; flex: none; }
.rb-group { display: flex; flex-direction: column; justify-content: space-between; padding: 0 10px; border-right: 1px solid var(--line); }
.rb-group:last-child { border-right: 0; }
.rb-items { display: flex; align-items: center; gap: 6px; flex: 1; }
.rb-col { display: flex; flex-direction: column; gap: 2px; align-items: stretch; }
.rb-label { font-size: 11px; color: var(--muted); text-align: center; padding: 3px 0 2px; white-space: nowrap; }
.ribbon button { box-shadow: none; border: 1px solid transparent; background: transparent; color: var(--text); border-radius: 4px; font-size: 12.5px; }
.ribbon button:hover:not(:disabled) { background: var(--hover); border-color: var(--line); }
.ribbon button:disabled { opacity: .4; cursor: default; }
.rb-big { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 5px 8px; min-width: 62px; max-width: 96px; line-height: 1.15; text-align: center; }
.rb-big.primary { color: #fff; font-weight: 600; min-width: 64px; }
.rb-big.primary:hover:not(:disabled) { background: var(--btn-bg, var(--primary)); filter: brightness(1.1); }
.rb-big.rb-accent { background: var(--primary-soft); color: var(--primary-ink); border-color: color-mix(in srgb, var(--primary) 40%, transparent); font-weight: 600; }
.rb-small { display: flex; align-items: center; gap: 6px; padding: 3px 8px; white-space: nowrap; text-align: left; }
.rb-hint { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--muted); }
.rb-hint input { width: 170px; font: inherit; font-size: 12.5px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--card); color: var(--text); }
@media (max-width: 1100px) { .ribbon { display: none; } }

@media (min-width: 1101px) {
  .layout-b .layout { grid-template-columns: 220px minmax(0, 1fr); grid-template-rows: minmax(150px, 40%) minmax(0, 1fr); background: var(--card); }
  .layout-b #sidebar { grid-column: 1; grid-row: 1 / span 2; background: var(--side-bg); border-right: 1px solid var(--line); padding: 8px 0 34px; display: flex; flex-direction: column; }
  .layout-b #list-pane { grid-column: 2; grid-row: 1; }
  .layout-b #detail-pane { grid-column: 2; grid-row: 2; border-top: 2px solid var(--line); padding: 0 0 30px; }
  .layout-b .list-head { display: none; }
  .layout-b .open-counter { display: none; }
  .layout-b .card-bar { display: none; }
  body.layout-b.page-dashboard > main { padding-bottom: 24px; }
}
.layout-b .side-block { background: transparent; border: 0; box-shadow: none; padding: 0 6px; margin-bottom: 8px; border-radius: 0; }
.layout-b .side-views { order: -1; }
.layout-b .side-title { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 700; color: var(--text); padding: 6px 8px 2px; }
.layout-b .side-item { padding: 3px 8px; font-size: 13px; border-radius: 3px; }
.layout-b .side-item .pill { background: transparent; border: 0; padding: 0 2px; }
.layout-b .side-item.active { background: var(--primary-soft); }
.layout-b .side-name > svg, .layout-b .side-label > svg { display: none; }
.layout-b .legend ul { font-size: 11.5px; }
/* table */
.layout-b .list-cols, .layout-b #list .mail-card { grid-template-columns: 26px 18px minmax(110px, 190px) minmax(0, 1fr) minmax(110px, 150px) minmax(100px, 160px) 92px; }
.layout-b .list-cols { display: grid; position: sticky; top: 0; z-index: 2; align-items: center; height: 28px; padding: 0 8px; background: var(--side-bg);
                       border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--muted); }
.layout-b .list-cols span { padding: 0 6px; }
.layout-b .group + .group { margin-top: 0; }
.layout-b .group-head { padding: 3px 14px; font-size: 12px; background: var(--side-bg); border-bottom: 1px solid var(--line); }
.layout-b .group-head .pill { margin-left: 0; background: transparent; border: 0; padding: 0; }
.layout-b .group-head .pill::before { content: "("; } .layout-b .group-head .pill::after { content: ")"; }
.layout-b .mail { margin: 0; border-radius: 0; box-shadow: none; }
.layout-b #list .mail-card { display: grid; align-items: center; gap: 0; min-height: 28px; padding: 0 8px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; font-size: 13px; }
.layout-b .mail-card::before { display: none; }
.layout-b .search-hit .mail-card { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 8px 14px; }
.layout-b .search-hit .avatar { display: none; }
.layout-b .search-results .search-head, .layout-b .search-results .search-chips { padding: 8px 14px 6px; }
.layout-b .cell { padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.layout-b .c-dot .dot { background: var(--tone); }
.layout-b .c-from { font-weight: 600; }
.layout-b .c-subj .badge { font-size: 11px; line-height: 14px; padding: 0 6px; }
.layout-b .subj-sum { font-size: 12px; }
.layout-b .c-status { color: var(--tone-ink); font-weight: 600; }
.layout-b .c-team .claim-text { color: var(--c-amber-ink); }
.layout-b .c-team .claim-text.mine, .layout-b .c-team .assignee-text { color: var(--c-blue-ink); }
.layout-b .c-team .row-forward { padding: 0 8px; line-height: 20px; }
.layout-b .c-date { display: flex; align-items: center; justify-content: flex-end; gap: 2px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.layout-b .c-date .icon-btn { padding: 2px; }
.layout-b .lang-tag { font-size: 10.5px; font-weight: 700; color: var(--c-violet-ink); margin-left: 4px; }
.layout-b .mail.state-sent .mail-card > *, .layout-b .mail.state-ignored .mail-card > *, .layout-b .mail.state-no_reply .mail-card > * { opacity: .75; }
@media (hover: hover) { .layout-b .mail:hover { transform: none; box-shadow: none; } .layout-b .mail:hover .mail-card { background: var(--hover); } }
.layout-b .mail.selected { box-shadow: none; }
.layout-b #list .mail.selected .mail-card { background: var(--btn-bg, var(--primary)); color: #fff; border-color: transparent; }
.layout-b .search-hit.selected .mail-card { background: var(--primary-soft); }
.layout-b #list .mail.selected .mail-card * { color: #fff !important; opacity: 1; }
.layout-b #list .mail.selected .c-dot .dot { box-shadow: 0 0 0 1.5px #fff; }
.layout-b #list .mail.selected .badge { background: transparent; border-color: rgba(255, 255, 255, .6); }
.layout-b #list .mail.selected .row-forward { background: #fff; color: var(--primary) !important; }
.layout-b .swipe-under { border-radius: 0; }
/* reading pane: one line head, mail left, draft right */
.layout-b #detail .card { background: transparent; border: 0; box-shadow: none; border-radius: 0; padding: 0; margin: 0; }
.layout-b .card-head { position: sticky; top: 0; z-index: 2; align-items: center; gap: 4px 12px; padding: 7px 14px; background: var(--side-bg); border-bottom: 1px solid var(--line); }
.layout-b .card-head .avatar { display: none; }
.layout-b .card-head .head-main { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.layout-b .card-head .subject { font-size: 15px; }
.layout-b .card-head .head-from, .layout-b .card-account { font-size: 12.5px; }
.layout-b .card-head .meta .badge { font-size: 11.5px; line-height: 16px; border-radius: 3px; }
.layout-b #detail .card > .flash, .layout-b #detail .card > .readonly-note, .layout-b #detail .card > .urgent-note, .layout-b #detail .card > .team-row { margin: 8px 14px 0; }
.layout-b .card-main, .layout-b .card-reply { padding: 10px 14px; }
@media (min-width: 1101px) {
  .layout-b .card-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .layout-b .card-main { border-right: 1px solid var(--line); min-height: 100%; }
}
.layout-b details.mail-orig pre { border: 0; background: transparent; padding: 4px 0 0; font-size: 13.5px; }
.layout-b details.mail-orig > summary::marker { content: ""; }
.layout-b .draft-head { margin-top: 0; }
.layout-b form.draft label { margin-top: 6px; }
.layout-b form.draft textarea { font-size: 13.5px; min-height: 220px; }
.layout-b .send-hint { display: block; margin: 6px 0 0; }
/* status line */
.statusline { display: none; }
@media (min-width: 1101px) {
  .layout-b .statusline { display: flex; align-items: center; gap: 22px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; height: 24px; padding: 0 12px;
                          background: var(--bar); color: #dde5eb; font-size: 12px; white-space: nowrap; overflow: hidden; }
  .layout-b .statusline .sl-keys { margin-left: auto; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; }
  .layout-b .statusline kbd { color: #fff; border-color: #4a5c6b; padding: 0 4px; }
  .layout-b .statusline .sl-warn { color: #ffd58a; }
}

/* ======================================================================== 3c. Layout C – Ruhig */
.layout-c { --bg: #ffffff; --primary: #3346b8; --primary-ink: #2a3a9c; --primary-soft: #e9ebfa; --line: #e7e9ee; --hover: #f5f6f9;
            --muted: #5f6878; --side-bg: #f6f7f9; --r: 10px; --r-lg: 14px; }
@media (prefers-color-scheme: dark) {
  .layout-c { --bg: #10141b; --primary: #7c8cf0; --primary-text: #0d1020; --primary-ink: #c3cbff; --primary-soft: #232a4d; --line: #252c38; --hover: #191f2a;
              --muted: #9ba5b6; --side-bg: #141922; --card: #161b24; }
}
.layout-c { font-size: 15px; }
.layout-c header.top { box-shadow: none; padding: 12px 22px; }
.layout-c section, .layout-c details.account { box-shadow: none; border-color: var(--line); }
@media (min-width: 1101px) {
  .layout-c .layout { grid-template-columns: 236px minmax(360px, 404px) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .layout-c #sidebar { grid-row: 1 / span 2; background: var(--side-bg); padding: 18px 12px; border-right: 1px solid var(--line); }
  .layout-c .layout > #search-form { padding: 18px 12px 6px; border-right: 1px solid var(--line); }
  .layout-c #list-pane { padding: 0 10px 20px; border-right: 1px solid var(--line); }
  .layout-c #detail-pane { padding: 18px 44px 40px; }
}
.layout-c .side-block { background: transparent; border: 0; box-shadow: none; padding: 0; margin-bottom: 18px; }
.layout-c .side-title { text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--muted); font-weight: 500; padding: 2px 10px 6px; }
.layout-c .side-item { padding: 8px 10px; border-radius: 10px; font-size: 15px; }
.layout-c .side-label, .layout-c .side-name { display: inline-flex; align-items: center; gap: 10px; font-weight: 400; }
.layout-c .side-name > svg, .layout-c .side-label > svg { color: var(--primary); flex: none; }
.layout-c .side-item.active { background: color-mix(in srgb, var(--primary) 12%, var(--side-bg)); color: var(--text); }
.layout-c .side-item .pill { background: transparent; border: 0; color: var(--muted); }
.layout-c .side-item .pill.tint { background: transparent; color: var(--c-red-ink); }
.layout-c .open-counter { padding: 0 10px 4px; }
.layout-c .open-n { color: var(--primary); }
.layout-c .search-box { background: var(--side-bg); border-color: transparent; box-shadow: none; border-radius: 10px; }
/* list: large rows with initials, state as dot + text */
.layout-c .list-head { padding: 14px 6px 12px; }
.layout-c .list-title { font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
.layout-c .list-title-wrap { flex-direction: column; gap: 0; flex: 1 1 auto; }
.layout-c .list-head { flex-wrap: nowrap; }
@media (max-width: 700px) { .layout-c .list-head { flex-wrap: wrap; } }
.layout-c .next-open-btn { border-radius: 999px; padding: 7px 14px; }
.layout-c .next-open-btn .nob-long { display: none; }
.layout-c .group-head { font-weight: 500; color: var(--muted); font-size: 13px; padding: 10px 10px 4px; }
.layout-c .group-head .pill { background: transparent; border: 0; }
.layout-c .mail { margin: 0 0 2px; border-radius: 12px; box-shadow: none; }
.layout-c .mail-card { border: 0; border-radius: 12px; padding: 12px 12px; gap: 12px; background: transparent; }
.layout-c .mail-card::before { display: none; }
.layout-c .avatar { width: 40px; height: 40px; font-size: 14px; }
.layout-c .row-from { font-size: 15px; }
.layout-c .row-subject { font-size: 14.5px; }
.layout-c .row-summary { font-size: 13.5px; }
.layout-c .row-badges .badge { background: transparent; border: 0; padding: 0; font-size: 12.5px; }
.layout-c .row-badges .badge.st, .layout-c .row-badges .badge.tint { color: var(--tone-ink); }
.layout-c .row-badges .badge.urgent { color: var(--c-red-ink); background: transparent; }
.layout-c .row-badges .badge.lang { color: var(--c-violet-ink); }
.layout-c .row-badges .badge.cc { border: 0; color: var(--muted); }
.layout-c .row-badges .badge.tint.tone-green { display: none; }   /* „vollständig“: the green dot says it */
@media (hover: hover) { .layout-c .mail:hover { transform: none; box-shadow: none; } .layout-c .mail:hover .mail-card { background: var(--hover); } }
.layout-c .mail.selected { box-shadow: none; }
.layout-c .mail.selected .mail-card { background: var(--primary-soft); }
.layout-c .urg-mark { display: none; }
/* reading pane: large type, claim as notice, the draft as a suggestion card */
.layout-c #detail .card { background: transparent; border: 0; box-shadow: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.layout-c .card-bar { order: -2; justify-content: flex-end; margin-bottom: 6px; }
.layout-c .card-bar .bar-gap { display: none; }
.layout-c .card-bar .bar-btn { border: 0; box-shadow: none; padding: 7px; border-radius: 999px; }
.layout-c .card-bar .bar-btn .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.layout-c .card-bar .nav-btn { border: 0; }
.layout-c .card-bar .next-open-btn { border-radius: 999px; }
.layout-c .team-row { order: -1; padding: 12px 16px; border-radius: 14px; }
.layout-c .card-head { flex-wrap: wrap; }
.layout-c .card-av { width: 48px; height: 48px; font-size: 16px; }
.layout-c .card-head .head-from { order: -1; font-size: 15px; }
.layout-c .card-head .subject { order: 1; font-size: 24px; margin-top: 10px; letter-spacing: -.01em; }
.layout-c .card-head .card-account { order: 0; }
.layout-c .card-head .meta { flex-basis: 100%; justify-content: flex-start; }
.layout-c details.mail-orig { margin: 14px 0; }
.layout-c details.mail-orig > summary { color: var(--muted); }
.layout-c details.mail-orig pre { border: 0; background: transparent; padding: 6px 0 0; font-size: 16px; line-height: 1.65; max-width: 72ch; }
.layout-c form.draft { margin-top: 16px; padding: 16px 20px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--card);
                       box-shadow: 0 6px 20px -10px rgba(16, 24, 40, .2); }
.layout-c .draft-head { margin-top: 0; }
.layout-c form.draft label.draft-title { font-size: 14px; }
.layout-c form.draft:not(.composing) .composer-only { display: none; }
.layout-c form.draft:not(.composing) textarea { border-color: transparent; background: transparent; padding: 8px 0; resize: none; font-size: 15.5px; cursor: text; }
.layout-c form.draft:not(.composing) .compose-btn { display: inline-flex; align-items: center; gap: 6px; }
.layout-c form.draft:not(.composing) .compose-hint { display: block; }
.layout-c form.draft:not(.composing) .row.actions { border-top: 0; }
.layout-c form.draft:not(.composing) .regen-row { display: inline-flex; margin-top: 10px; }
.layout-c form.draft textarea { font-size: 15.5px; }
.layout-c form.draft button { border-radius: 999px; }
.layout-c .compose-hint { margin: 10px 0 0; }

/* ======================================================================== phones and tablets per layout */
@media (max-width: 1100px) {
  .layout-a .layout, .layout-c .layout { gap: 12px; }
  .layout-b #sidebar { display: flex; flex-direction: column; }
}
@media (max-width: 700px) {
  /* A: list → mail; rows stay plain */
  .layout-a main { padding: 0 0 40px; }
  .layout-a .layout { gap: 0; }
  .layout-a .layout > #search-form { padding: 10px 12px 6px; }
  .layout-a #sidebar { padding: 4px 8px; }
  .layout-a .side-block { margin-bottom: 4px; }
  .layout-a #list-pane { background: var(--card); border-top: 1px solid var(--line); }
  .layout-a .card-head .subject { font-size: 19px; }
  /* B: dense list, filter chips, big „Nächste offene Mail“ */
  .layout-b main { padding: 0 0 86px; }
  .layout-b .layout { gap: 0; }
  .layout-b #sidebar { padding: 6px 8px 2px; }
  .layout-b .side-block { margin-bottom: 4px; padding: 0; }
  .layout-b .open-counter { display: none; }
  .layout-b .list-head { padding: 8px 12px; background: var(--side-bg); border-bottom: 1px solid var(--line); margin: 0; }
  .layout-b .list-head .next-open-btn { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 4; justify-content: center;
                                        padding: 13px 16px; font-size: 15px; border-radius: 8px; background: var(--bar); color: #fff; }
  .layout-b .list-cols { display: none; }
  .layout-b #list .mail-card { grid-template-columns: 14px minmax(0, 1fr) auto; grid-template-areas: "dot from date" "dot subj status" "dot team team"; padding: 8px 12px; row-gap: 1px; }
  .layout-b .c-urg { display: none; }
  .layout-b .c-dot { grid-area: dot; align-self: start; padding: 6px 0 0; }
  .layout-b .c-from { grid-area: from; padding: 0; }
  .layout-b .c-subj { grid-area: subj; padding: 0; }
  .layout-b .subj-sum, .layout-b .c-subj .row-box { display: none; }
  .layout-b .c-status { grid-area: status; padding: 0; font-size: 12px; text-align: right; }
  .layout-b .c-team { grid-area: team; padding: 0; font-size: 12px; }
  .layout-b .c-team:has(> [aria-hidden="true"]:only-child) { display: none; }
  .layout-b .c-date { grid-area: date; padding: 0; }
  .layout-b .mail.urgent .c-from::before { content: "!"; display: inline-grid; place-items: center; width: 15px; height: 15px; margin-right: 5px; border-radius: 3px;
                                           background: var(--c-red); color: #fff; font-size: 10px; font-weight: 800; vertical-align: 1px; }
  /* C: large title, swipe hint, „Nächste offene“ at the bottom */
  .layout-c main { padding: 0 6px 96px; }
  .layout-c header.top { padding: 10px 14px; }
  .layout-c .list-title { font-size: 32px; }
  .layout-c .list-head { padding: 10px 8px; }
  .layout-c .list-head .next-open-btn { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 4; padding: 12px 18px; font-size: 15px;
                                        box-shadow: var(--shadow-md); }
  .layout-c .swipe-hint { display: block; order: 3; flex-basis: 100%; }
  .layout-c .mail-card { padding: 12px 8px; }
  .layout-c .side-item { font-size: 14px; padding: 6px 10px; }
  .layout-c .mail.reveal-archive .swipe-under { background: var(--primary); }
  .layout-c .card-head .subject { font-size: 21px; }
  body.detail-open .list-head .next-open-btn, body.detail-open .swipe-hint { display: none; }
}
@media (max-width: 1100px) {
  body.detail-open .list-head .next-open-btn { visibility: hidden; }
}

/* ======================================================================== „Darstellung“ (profile, settings) */
.layout-choice fieldset { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; min-width: 0; }
.lc-opt { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-lg);
          background: var(--card); cursor: pointer; }
.lc-opt:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.lc-opt input { position: absolute; top: 12px; right: 12px; margin: 0; accent-color: var(--primary); width: 18px; height: 18px; }
.lc-opt:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.lc-thumb { width: 100%; max-width: 200px; height: auto; }
.lc-text { display: flex; flex-direction: column; gap: 2px; }
.lc-frame { fill: var(--card); stroke: var(--line); }
.lc-bar, .lc-side { fill: var(--side-bg, var(--bg)); }
.lc-dark { fill: #1d2b36; }
.lc-line { stroke: var(--line); stroke-width: 1; }
.lc-ink { fill: var(--muted); }
.lc-soft { fill: var(--line); }
.lc-box { fill: var(--bg); stroke: var(--line); }
.lc-box.lc-accent { stroke: var(--primary); }
.lc-accent-fill { fill: var(--primary-soft); }
@media (min-width: 1101px) { .layout-b.page-dashboard .toast { bottom: 40px; } }
@media (min-width: 701px) and (max-width: 1100px) {
  .layout-b .list-cols, .layout-b #list .mail-card { grid-template-columns: 22px 16px minmax(90px, 150px) minmax(150px, 1fr) 118px minmax(80px, 130px) 84px; }
  .layout-b .subj-sum { display: none; }
}
