/* WerkGuru v12 – Seitenfeinschliff: Verwaltung, Posteingang, Auswertung, Material, Konto, Anmeldung. Nur Tokens, keine festen Farben. */

/* ===== 1. Posteingang: Tage als Abschnitt, jede Meldung ein ruhiger grauer Block ===== */
.app-shell .v12-inbox { display: grid; gap: var(--s-6); max-width: 860px; }
.app-shell .v12-day > h2 { margin: 0 0 var(--s-3); font-size: 1.25rem; font-weight: 700; letter-spacing: 0; }
.app-shell .v12-msgs { display: grid; gap: var(--s-2); }
.app-shell .v12-msg { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto; gap: var(--s-2) var(--s-4); align-items: start; padding: var(--s-4) var(--s-5); border-radius: 20px; background: var(--surface-2); }
.app-shell .v12-dot { width: 10px; height: 10px; margin-top: 7px; border-radius: var(--r-full); background: transparent; }
.app-shell .v12-msg.is-new .v12-dot { background: var(--signal-400); }
.app-shell .v12-msg-main { display: grid; gap: 2px; min-width: 0; }
.app-shell .v12-msg-main > strong { font-size: var(--fs-base); font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.app-shell .v12-msg.is-new .v12-msg-main > strong { font-weight: 700; }
.app-shell .v12-msg:not(.is-new) .v12-msg-main > strong { color: var(--text-2); }
.app-shell .v12-msg-main > small { font-size: var(--fs-sm); line-height: 1.45; color: var(--text-2); overflow-wrap: anywhere; }
.app-shell .v12-msg-main .pill { vertical-align: 1px; background: var(--surface); }
.app-shell .v12-msg-time { display: grid; justify-items: end; gap: 2px; padding-top: 2px; font-size: var(--fs-sm); color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.app-shell .v12-msg-state { font-size: 0.8125rem; color: var(--text-3); }
.app-shell .v12-msg.is-new .v12-msg-state { color: var(--text); font-weight: 600; }
.app-shell .v12-msg > form { margin: 0; align-self: center; }
.app-shell .v12-msg .v12-done { background: var(--surface); border-color: transparent; white-space: nowrap; }
.app-shell .v12-msg .v12-done:hover { background: var(--surface-3); }
.app-shell .v12-msg .disclosure { margin-top: var(--s-2); border: 0; background: transparent; padding: 0; }
.app-shell .v12-msg .disclosure > summary { display: inline-flex; align-items: center; gap: var(--s-2); min-height: 36px; padding: 0 var(--s-3); border: 0; border-radius: var(--r-full); background: var(--surface); font-size: var(--fs-sm); font-weight: 600; cursor: pointer; width: auto; }
.app-shell .v12-msg .disclosure .mini-list { margin: var(--s-2) 0 0; padding: 0 var(--s-4); border-radius: var(--r-lg); background: var(--surface); list-style: none; }
.app-shell .v12-msg .disclosure .mini-list li { display: flex; justify-content: space-between; gap: var(--s-3); padding: var(--s-3) 0; border: 0; border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.app-shell .v12-msg .disclosure .mini-list li:first-child { border-top: 0; }
.app-shell .v12-msg .disclosure .mini-list small { flex: none; color: var(--text-2); font-size: 0.8125rem; white-space: nowrap; }
@media (max-width: 700px) {
  .app-shell .v12-msg { grid-template-columns: 10px minmax(0, 1fr) 44px; grid-template-areas: "dot main done" "dot time done"; gap: var(--s-1) var(--s-3); padding: var(--s-4); }
  .app-shell .v12-dot { grid-area: dot; }
  .app-shell .v12-msg-main { grid-area: main; }
  .app-shell .v12-msg-time { grid-area: time; display: flex; gap: var(--s-2); justify-content: flex-start; padding: 0; }
  .app-shell .v12-msg-time .v12-msg-state::before { content: "· "; }
  .app-shell .v12-msg > form { grid-area: done; align-self: start; }
  .app-shell .v12-msg .v12-done { width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; justify-content: center; }
  .app-shell .v12-msg .v12-done > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .app-shell .v12-msg .disclosure .mini-list li { display: grid; gap: 2px; }
}

/* ===== 2. Einstellungen: kompakte Tarifliste und Zeilenliste ===== */
.app-shell .v12-plan-now { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s-1) var(--s-4); margin: 0 0 var(--s-4); font-size: var(--fs-sm); color: var(--text-2); }
.app-shell .v12-plan-now strong { font-family: var(--display); font-stretch: 82%; font-weight: 800; font-size: 1.75rem; line-height: 1.1; color: var(--text); }
.app-shell .v12-tiers { border-radius: var(--r-lg); background: var(--surface); padding: 0 var(--s-4); }
.app-shell .v12-tier { display: grid; grid-template-columns: minmax(0, 1fr) 150px 250px; gap: var(--s-2) var(--s-5); align-items: center; padding: var(--s-3) 0; border-top: 1px solid var(--line); }
.app-shell .v12-tier:first-child { border-top: 0; }
.app-shell .v12-tier-main { display: grid; gap: 2px; min-width: 0; }
.app-shell .v12-tier-main strong { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); font-size: var(--fs-base); font-weight: 600; }
.app-shell .v12-tier-main small { font-size: var(--fs-sm); color: var(--text-2); }
.app-shell .v12-tier-price { display: grid; justify-items: end; font-size: var(--fs-base); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--text-2); }
.app-shell .v12-tier-price small { font-size: 0.8125rem; font-weight: 400; color: var(--text-3); }
.app-shell .v12-tier > form { margin: 0; display: flex; justify-content: flex-end; }
.app-shell .v12-tier[aria-current="true"] .v12-tier-main strong { font-weight: 700; }
.app-shell .v12-tier[aria-current="true"] .v12-tier-price { color: var(--text); font-size: 1.125rem; font-weight: 700; }
@media (max-width: 700px) {
  .app-shell .v12-tier { grid-template-columns: minmax(0, 1fr) auto; padding: var(--s-4) 0; }
  .app-shell .v12-tier > form { grid-column: 1 / -1; }
  .app-shell .v12-tier > form .btn { min-height: 44px; }
  .app-shell .v12-tier[aria-current="true"] > form .btn { width: 100%; min-height: 48px; }
  .app-shell .v12-set-row > .pill { display: none; }
}
.app-shell .v12-set .card-head { margin-bottom: var(--s-2); }
.app-shell .v12-set-list { display: grid; }
.app-shell .v12-set-row { display: flex; align-items: center; gap: var(--s-4); min-height: 64px; padding: var(--s-3) 0; border-top: 1px solid var(--line); color: var(--text); text-decoration: none; }
.app-shell .v12-set-row:first-child { border-top: 0; }
.app-shell .v12-set-main { display: grid; gap: 2px; flex: 1; min-width: 0; }
.app-shell .v12-set-main strong { font-size: var(--fs-base); font-weight: 600; }
.app-shell .v12-set-main small { font-size: var(--fs-sm); line-height: 1.45; color: var(--text-2); }
.app-shell .v12-set-row > .icon { flex: none; color: var(--text-3); }
.app-shell a.v12-set-row:hover .v12-set-main strong { text-decoration: underline; }
.app-shell a.v12-set-row:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-sm); }
.app-shell .v12-set-form { margin: 0; }
.app-shell .v12-set-form .check { margin-top: var(--s-2); align-items: center; min-height: 44px; }
.app-shell .v12-set-form .btn { flex: none; }
@media (max-width: 700px) {
  .app-shell .v12-set-form { flex-direction: column; align-items: stretch; gap: var(--s-2); }
  .app-shell .v12-set-form .btn { min-height: 44px; }
}
.app-shell .module-row { min-height: 60px; }
.app-shell .module-row .row-main strong { font-size: var(--fs-base); font-weight: 600; }
.app-shell .module-row .row-main small { font-size: var(--fs-sm); color: var(--text-2); }

/* Unterseiten der Einstellungen: Hinweise lesbar, Abstände gleich */
.app-shell form.form > section.card + section.card, .app-shell form.form > section.card + .btn-row { margin-top: var(--s-4); }
.app-shell main .card > .hint, .app-shell main .card > form + .hint { font-size: var(--fs-sm); line-height: 1.5; color: var(--text-2); }
.app-shell main .card > h2 + .hint { margin: var(--s-1) 0 var(--s-3); }

/* ===== 3. Rollen & Rechte: graue Blöcke ohne Rahmen, Pillen ===== */
.app-shell .wg85-list nav { gap: var(--s-2); }
.app-shell .wg85-role { border: 0; border-radius: var(--r-lg); padding: var(--s-3) var(--s-4); background: var(--surface-2); box-shadow: none; gap: 2px; }
.app-shell .wg85-role:hover { background: var(--surface-3); }
.app-shell .wg85-role.is-active { background: var(--ink-950); color: var(--on-ink); box-shadow: none; }
.app-shell .wg85-role-name { font-weight: 600; padding-right: 84px; }
.app-shell .wg85-role-meta { font-size: 0.8125rem; color: var(--text-2); }
.app-shell .wg85-role-tag { top: var(--s-3); right: var(--s-4); font-size: 0.75rem; font-weight: 500; letter-spacing: 0; color: var(--text-3); }
.app-shell .wg85-role.is-active .wg85-role-meta, .app-shell .wg85-role.is-active .wg85-role-tag { color: var(--on-ink); opacity: .78; }
.app-shell .wg85-new summary { min-height: 44px; list-style: none; }
.app-shell .wg85-new summary::-webkit-details-marker { display: none; }
.app-shell .wg85-head h2 { font-size: 1.25rem; font-weight: 700; }
.app-shell .wg85-head #wg85-total { background: var(--surface); }
.app-shell .wg85-members { font-size: var(--fs-sm); color: var(--text-2); }
.app-shell .wg85-filter { border: 0; border-radius: var(--r-full); padding: 0 var(--s-4); background: var(--surface); min-height: 44px; }
.app-shell .wg85-roles .wg85-filter:focus-within { box-shadow: inset 0 0 0 2px var(--focus); }
.app-shell .wg85-roles .wg85-filter input { min-height: 44px; font-size: var(--fs-base); }
.app-shell .wg85-only { min-height: 44px; }
.app-shell .wg85-legend summary, .app-shell .wg85-manage summary { min-height: 36px; display: inline-flex; align-items: center; padding: 0 var(--s-4); border-radius: var(--r-full); background: var(--surface); color: var(--text); font-weight: 600; list-style: none; }
.app-shell .wg85-legend summary::-webkit-details-marker, .app-shell .wg85-manage summary::-webkit-details-marker { display: none; }
.app-shell .wg85-legend summary::after, .app-shell .wg85-manage summary::after { content: "+"; margin-left: var(--s-2); color: var(--text-2); }
.app-shell .wg85-legend[open] summary::after, .app-shell .wg85-manage[open] summary::after { content: "–"; }
.app-shell .wg85-legend dl { padding: var(--s-3) var(--s-4); border-radius: var(--r-lg); background: var(--surface); }
.app-shell .wg85-legend dd { color: var(--text-2); }
.app-shell .wg85-group-head { margin-bottom: var(--s-2); }
.app-shell .wg85-group-head h3 { font-size: 1.125rem; font-weight: 700; letter-spacing: 0; }
.app-shell .wg85-row { padding: var(--s-2) 0; border-left: 0; min-height: 56px; }
.app-shell .wg85-row[data-scope="none"] .wg85-label label { color: var(--text-2); font-weight: 500; }
.app-shell .wg85-row[data-scope="none"] .wg85-ctl select { color: var(--text-2); }
.app-shell .wg85-label label { font-weight: 600; font-size: var(--fs-base); line-height: 1.35; }
.app-shell .wg85-ctl select { min-height: 44px; }
.app-shell .wg85-i { position: relative; flex: none; width: 28px; min-width: 28px; height: 28px; min-height: 28px; border: 0; background: var(--surface); }
.app-shell .wg85-i::after { content: ""; position: absolute; inset: -8px; }
.app-shell .wg85-i:hover, .app-shell .wg85-i[aria-expanded="true"] { background: var(--info-bg); }
.app-shell .wg85-tip { border: 0; border-radius: var(--r-lg); padding: var(--s-4); }
.app-shell .wg85-tip::before { border: 0; }
.app-shell .wg85-stufen { color: var(--text-2); }
.app-shell .wg85-jump { border: 0; min-height: 32px; padding: 0 var(--s-3); border-radius: var(--r-full); background: var(--surface); font-size: 0.8125rem; font-weight: 600; }
.app-shell .wg85-jump:hover { background: var(--surface-3); }
@media (max-width: 860px) {
  .app-shell .wg85-list nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-shell .wg85-role { min-height: 60px; align-content: center; }
  .app-shell .wg85-role-name { padding-right: 0; overflow-wrap: anywhere; }
  .app-shell .wg85-role-tag { display: none; }
  .app-shell .wg85-row { gap: var(--s-2); padding: var(--s-3) 0; }
  .app-shell .wg85-label label { flex: 0 1 auto; max-width: calc(100% - 40px); }
  .app-shell .wg85-legend summary, .app-shell .wg85-manage summary { min-height: 44px; }
  .app-shell .wg85-ctl select { min-height: 48px; }
  .app-shell .wg85-jump { min-height: 44px; }
  .app-shell .wg85-legend dl { grid-template-columns: 1fr; gap: 0; }
  .app-shell .wg85-legend dd { margin-bottom: var(--s-2); }
  .app-shell .wg85-manage-body .flex { flex-wrap: wrap; }
}

/* ===== Änderungsprotokoll: ruhige Tabelle, am Handy Zeilen statt Spalten ===== */
.app-shell .v12-audit th { font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); letter-spacing: 0; }
.app-shell .v12-audit td { vertical-align: top; }
.app-shell .v12-audit .v12-au-time { white-space: nowrap; color: var(--text-2); }
.app-shell .v12-audit .v12-au-what { font-weight: 600; }
.app-shell .v12-audit .v12-au-detail small { font-size: 0.8125rem; color: var(--text-2); overflow-wrap: anywhere; word-break: break-word; }
@media (max-width: 700px) {
  .app-shell .v12-audit, .app-shell .v12-audit tbody { display: block; width: 100%; }
  .app-shell .v12-audit thead { display: none; }
  .app-shell .v12-audit tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px var(--s-3); padding: var(--s-3) 0; border-top: 1px solid var(--line); }
  .app-shell .v12-audit tr:first-child { border-top: 0; }
  .app-shell .v12-audit td { display: block; padding: 0; border: 0; font-size: var(--fs-sm); min-width: 0; }
  .app-shell .v12-audit .v12-au-what { grid-column: 1; grid-row: 1; font-size: var(--fs-base); }
  .app-shell .v12-audit .v12-au-time { grid-column: 2; grid-row: 1; font-size: 0.875rem; }
  .app-shell .v12-audit .v12-au-who { grid-column: 1 / -1; color: var(--text-2); }
  .app-shell .v12-audit .v12-au-detail { grid-column: 1 / -1; }
  .app-shell .v12-audit .v12-au-detail:has(small:empty) { display: none; }
}

/* ===== 6. Auswertungen und Material ===== */
.app-shell .kpi-strip { gap: var(--s-3); }
.app-shell .kpi-strip .kpi-tile { padding: var(--s-5); gap: var(--s-1); box-shadow: none; }
.app-shell .kpi-strip .kpi-tile small { font-size: var(--fs-sm); line-height: 1.4; font-weight: 600; color: var(--text-2); }
.app-shell .kpi-strip .kpi-tile strong { font-family: var(--display); font-stretch: 82%; font-weight: 800; font-size: 2.5rem; line-height: 1.05; letter-spacing: 0; }
.app-shell .kpi-strip .kpi-tile.tone-warning strong, .app-shell .kpi-strip .kpi-tile.tone-danger strong { color: var(--text); }
.app-shell .kpi-strip .kpi-tile > span { font-size: var(--fs-sm); line-height: 1.4; color: var(--text-2); }
.app-shell a.kpi-tile:hover { background: var(--surface-3); }
.app-shell .card table.heat { border-spacing: 0; }
.app-shell .card table.heat th, .app-shell .card table.heat td { border: 0; border-top: 1px solid var(--line); padding: var(--s-3) var(--s-2); background: transparent; border-radius: 0; vertical-align: top; }
.app-shell .card table.heat thead th { border-top: 0; font-size: var(--fs-sm); }
.app-shell .card table.heat th:first-child { padding-left: 0; }
.app-shell .card table.heat th small, .app-shell .card table.heat td small { font-size: 0.8125rem; font-weight: 400; }
.app-shell .card table.heat .heat-cell { min-width: 0; }
.app-shell .card table.heat .heat-cell strong { font-size: 1.125rem; font-weight: 700; }
.app-shell .card table.heat .heat-cell.is-low strong { color: var(--text-2); }
.app-shell .card table.heat .heat-cell.is-over strong { color: var(--danger); }
.app-shell .card .item-list .risk-row { border: 0; border-radius: var(--r-lg); background: var(--surface); }
.app-shell .card .mini-list > li > a:only-child { display: flex; align-items: center; min-height: 44px; color: var(--text); text-decoration: none; font-size: var(--fs-sm); font-weight: 500; }
.app-shell .card .mini-list > li > a:only-child:hover { text-decoration: underline; }
.app-shell .card .mini-list > li:has(> a:only-child) { padding: 0; border-top: 1px solid var(--line); }
.app-shell .card .mini-list > li:has(> a:only-child):first-child { border-top: 0; }
.app-shell .card dl.dl-compact dd { font-family: var(--display); font-stretch: 82%; font-weight: 800; font-size: 1.25rem; }
@media (max-width: 700px) {
  .app-shell .kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-shell .kpi-strip .kpi-tile { padding: var(--s-4); }
  .app-shell .kpi-strip .kpi-tile:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .app-shell .kpi-strip .kpi-tile strong { font-size: 2rem; }
  .app-shell .card .table-wrap:has(> table.heat) { overflow-x: visible; }
  .app-shell .card table.heat { table-layout: fixed; }
  .app-shell .card table.heat th:first-child { width: 31%; white-space: normal; overflow-wrap: anywhere; }
  .app-shell .card table.heat th, .app-shell .card table.heat td { padding: var(--s-3) var(--s-1); white-space: normal; }
  .app-shell .card table.heat thead th small { font-size: 0.75rem; }
  .app-shell .card table.heat td.heat-cell small { display: none; }
  .app-shell .card table.heat .heat-cell strong { font-size: 1rem; }
  .app-shell .card .item-list .risk-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: none; }
  .app-shell .card .item-list .risk-row > * { grid-area: auto; }
}
/* Material: Bestandszeilen und Formular */
.app-shell .layout-main-side > .card .list > .row { display: flex; align-items: center; gap: var(--s-3); min-height: 56px; padding: var(--s-3) 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; }
.app-shell .layout-main-side > .card .list > .row:first-child { border-top: 0; }
.app-shell .layout-main-side > .card .list > .row > .pill { order: 2; flex: none; background: var(--surface); }
.app-shell .layout-main-side > .card .list > .row > .row-main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 700px) {
  .app-shell .layout-main-side > .card > form .btn-primary { width: 100%; min-height: 48px; }
}

/* ===== 4. Dialoge: Suche und Erfassen ===== */
dialog.cmdk .cmdk-input input::placeholder { text-overflow: ellipsis; }
dialog.cmdk .cmdk-input input { text-overflow: ellipsis; min-width: 0; }
dialog.sheet .wg71-sheet-section { font-size: var(--fs-sm); font-weight: 600; letter-spacing: 0; color: var(--text-2); }
}

/* ===== 5. Anmeldung, Registrierung (auth.html lädt diese Datei ohne .app-shell) ===== */
.auth-page { --display: "WG Display", "Inter", system-ui, sans-serif; }
.auth-page .auth-art .display { font-family: var(--display); font-stretch: 78%; font-weight: 800; letter-spacing: 0; line-height: 1.04; font-size: clamp(2.25rem, 3vw + 1rem, 3.75rem); }
.auth-page .auth-art .brand, .auth-page .auth-art .brand-word { font-family: var(--display); font-stretch: 88%; }
.auth-page .auth-form h1 { font-family: var(--display); font-stretch: 82%; font-weight: 800; letter-spacing: 0; font-size: clamp(1.875rem, 1.2vw + 1.4rem, 2.5rem); line-height: 1.05; }
.auth-page .auth-form > header p, .auth-page .auth-form > p:not(.hint):not(.auth-switch) { font-size: var(--fs-base); line-height: 1.5; color: var(--text-2); }
.auth-page .auth-form .field { font-size: var(--fs-sm); }
.auth-page .auth-form .field > small, .auth-page .auth-form .field .hint { font-size: 0.875rem; color: var(--text-2); }
.auth-page .auth-form input:where(:not([type="checkbox"])), .auth-page .auth-form select { min-height: 52px; padding-inline: var(--s-4); border: 1px solid transparent; border-radius: var(--r-lg); background-color: var(--surface-2); font-size: 1rem; }
.auth-page .auth-form input:where(:not([type="checkbox"])):hover, .auth-page .auth-form select:hover { background-color: var(--surface-3); }
.auth-page .auth-form input:where(:not([type="checkbox"])):focus-visible, .auth-page .auth-form select:focus-visible { background-color: var(--surface); border-color: var(--focus); }
.auth-page .auth-form .btn { border-radius: var(--r-full); }
.auth-page .auth-form .btn-lg { min-height: 52px; font-size: 1rem; font-weight: 700; }
.auth-page .auth-form .check { align-items: flex-start; padding: var(--s-4); border-radius: var(--r-lg); background: var(--surface-2); font-size: 0.875rem; }
.auth-page .auth-form .hint { font-size: 0.875rem; line-height: 1.5; color: var(--text-2); }
.auth-page .auth-form .hint a { display: inline-flex; align-items: center; min-height: 44px; }
.auth-page .auth-switch { font-size: var(--fs-base); }
.auth-page .auth-switch a { display: inline-block; padding-block: var(--s-2); }
@media (min-width: 901px) {
  /* dunkler Rahmen wie in der App: Formular als weißes Blatt */
  .auth-page { background: var(--ink-950); grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
  .auth-page .auth-main { margin: var(--s-4) var(--s-4) var(--s-4) 0; border-radius: 28px; background: var(--surface); }
}
@media (max-width: 900px) {
  /* dunkle Kopfzone, darunter das weiße Blatt */
  .auth-page { background: var(--ink-950); grid-template-rows: auto 1fr; }
  .auth-page .auth-art { padding: var(--s-5) var(--gutter) var(--s-6); gap: var(--s-4); }
  .auth-page .auth-art .art-copy { display: block; }
  .auth-page .auth-art .art-copy ul { display: none; }
  .auth-page .auth-art .display { font-size: 1.875rem; }
  .auth-page .auth-art .legal-mini { font-size: 0.875rem; }
  .auth-page .auth-art .legal-mini a { display: inline-flex; align-items: center; min-height: 44px; }
  .auth-page .auth-main { margin-top: calc(-1 * var(--s-3)); padding: var(--s-6) var(--gutter) var(--s-7); border-radius: 28px 28px 0 0; background: var(--surface); place-items: start center; }
}
.app-shell .wg85-roles .wg85-label button.wg85-i { width: 28px; min-width: 28px; height: 28px; min-height: 28px; padding: 0; border-radius: var(--r-full); }
