/* HafenBox Desk 0.5 – größer, volle Breite, Kalender zum Ziehen, eigene Auswahllisten.
   Wird als letzte Datei geladen und überschreibt die älteren Größen aus styles/workspace/glass. */

/* ---------- Größen: alles eine Stufe größer und über die ganze Breite ---------- */
:root { font-size: 16px; --sidebar: 264px; }
@media (min-width: 1700px) { :root { font-size: 17px; } }
body { font-size: 1rem; }
.workspace { max-width: none; padding: 22px 36px 56px 20px; }
.top { padding: 22px 36px 0 20px; }
.module-header h1, .workspace > .flow > .module-header h1 { font-size: 2.1rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.08rem; }
label { font-size: .95rem; }
td { font-size: .97rem; }
th { font-size: .86rem; }
.nav-link { min-height: 44px; font-size: 1rem; gap: 12px; }
.nav-group { font-size: 12px; }
.nav-count, .nav-link.admin .nav-hint { font-size: 12px; }
.tab { padding: 10px 16px; font-size: 1rem; }
.button { min-height: 42px; font-size: .97rem; }
.button.icon-button { min-width: 42px; }
.status-pill { font-size: .84rem; }
.table-note, small { font-size: .88rem; }
.mail-item-heading strong { font-size: .95rem; }
.mail-subject { font-size: .95rem; }
.mail-item .person-initials { width: 36px; height: 36px; font-size: .78rem; }
.task-card h3 { font-size: 1.02rem; }
.task-card .button { font-size: .9rem; min-height: 36px; }
.mail-sidebar h2 { font-size: 1.1rem; }
.mail-sidebar > .button { font-size: .9rem; }
.mail-folder { font-size: .97rem; min-height: 42px; }
.record-footer .button { font-size: .92rem; }
input, textarea, select { font-size: 1rem; min-height: 44px; }
textarea { min-height: 120px; }
.dialog { width: min(720px, calc(100vw - 32px)); }
.dialog.wide { width: min(980px, calc(100vw - 32px)); }
.dialog-content { padding: 1.3rem 1.5rem 1.6rem; }

/* Postfach füllt die Höhe des Fensters */
.mail-layout { min-height: calc(100dvh - 190px); }
.mail-list { max-height: none; min-height: 0; flex: 1; }
.mail-browser { display: flex; flex-direction: column; min-height: 0; }
.mail-reader { min-height: calc(100dvh - 190px); }
.mail-folder.sub { padding-left: calc(10px + var(--depth, 1) * 16px); }
.mail-folder.drop { background: var(--select); outline: 2px dashed var(--accent); outline-offset: -2px; }
.mail-folder-tools { display: flex; gap: 6px; flex-wrap: wrap; padding: 4px 2px; }
.mail-folder-tools .button { min-height: 34px; font-size: .86rem; padding: 4px 10px; }
.mailbox-list { display: grid; gap: 8px; }
.mailbox-list label { display: flex; align-items: center; gap: 10px; font-weight: 500; color: var(--text); }

/* ---------- Eigene Auswahllisten (select.js) in Desk-Farben ---------- */
.hb-auswahl {
  --hba-bg: #142a4a; --hba-ink: #f2f7fc; --hba-muted: #b4c7da; --hba-line: rgba(255, 255, 255, .12);
  --hba-hover: rgba(140, 194, 255, .12); --hba-active: rgba(140, 194, 255, .2); --hba-accent: #8cc2ff; --hba-buoy: #f2c46d;
  --hba-shadow: 0 22px 48px -18px rgba(0, 0, 0, .7), 0 2px 8px -2px rgba(0, 0, 0, .35);
  --hba-thumb: rgba(232, 238, 248, .22); --hba-thumb-hover: rgba(232, 238, 248, .38);
  position: fixed; z-index: 2147483000; box-sizing: border-box; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  padding: 6px; margin: 0; background: var(--hba-bg); color: var(--hba-ink);
  border: 1px solid var(--hba-line); border-radius: 14px; box-shadow: var(--hba-shadow);
  font-size: 15px; line-height: 1.35; text-align: left;
  animation: hba-auf .14s cubic-bezier(.2, .8, .2, 1); transform-origin: top center;
  scrollbar-width: thin; scrollbar-color: var(--hba-thumb) transparent;
}
:root[data-theme="light"] .hb-auswahl {
  --hba-bg: #ffffff; --hba-ink: #0d2342; --hba-muted: #3f5a78; --hba-line: rgba(10, 40, 80, .12);
  --hba-hover: #eef4fd; --hba-active: #e1eefd; --hba-accent: #1f6fd1; --hba-buoy: #e0a92a;
  --hba-shadow: 0 18px 40px -18px rgba(21, 48, 90, .45), 0 2px 6px -2px rgba(21, 48, 90, .12);
  --hba-thumb: rgba(21, 48, 90, .28); --hba-thumb-hover: rgba(21, 48, 90, .45);
}
.hb-auswahl[data-hb-oben] { transform-origin: bottom center; animation-name: hba-auf-oben; }
.hb-auswahl:focus, .hb-auswahl:focus-visible { outline: none; }
.hb-auswahl-option {
  position: relative; box-sizing: border-box; display: flex; align-items: center; gap: 10px; min-height: 40px;
  padding: 8px 34px 8px 12px; border-radius: 10px; cursor: pointer; user-select: none; color: var(--hba-ink); font-weight: 500;
}
.hb-auswahl-option--gruppe { padding-left: 22px; }
.hb-auswahl-text { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.hb-auswahl-option[data-hb-aktiv] { background: var(--hba-hover); }
.hb-auswahl-option[aria-selected="true"] { background: var(--hba-active); font-weight: 600; }
.hb-auswahl-option[aria-selected="true"]::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--hba-buoy); }
.hb-auswahl-option[aria-selected="true"] .hb-auswahl-haken {
  position: absolute; right: 13px; top: 50%; width: 6px; height: 11px; margin-top: -7px;
  border: solid var(--hba-accent); border-width: 0 2.2px 2.2px 0; transform: rotate(45deg);
}
.hb-auswahl-option[aria-disabled="true"] { opacity: .45; cursor: default; }
.hb-auswahl-gruppe { padding: 10px 12px 4px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--hba-muted); }
@keyframes hba-auf { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes hba-auf-oben { from { opacity: 0; transform: translateY(4px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .hb-auswahl { animation: none; } }
select:not([multiple]):not([size]):not([data-hb-native]) {
  appearance: none; -webkit-appearance: none; padding-right: 42px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 21px) 50%, calc(100% - 15px) 50%; background-size: 6px 6px, 6px 6px; background-repeat: no-repeat;
}
select[data-hb-offen] { background-image: linear-gradient(135deg, transparent 50%, currentColor 50%), linear-gradient(45deg, currentColor 50%, transparent 50%); }

/* Scrollleisten schmal und rund */
:root { --scroll: rgba(200, 215, 238, .22); --scroll-hover: rgba(200, 215, 238, .4); }
:root[data-theme="light"] { --scroll: rgba(21, 48, 90, .26); --scroll-hover: rgba(21, 48, 90, .46); }
@supports (-moz-appearance: none) { * { scrollbar-width: thin; scrollbar-color: var(--scroll) transparent; } }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background-color: var(--scroll); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; min-height: 36px; }
::-webkit-scrollbar-thumb:hover { background-color: var(--scroll-hover); }

/* ---------- Kalender ---------- */
.cal-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 16px; min-height: calc(100dvh - 200px); }
.cal-side { padding: 14px; display: flex; flex-direction: column; gap: 14px; align-self: start; position: sticky; top: 12px; max-height: calc(100dvh - 40px); overflow: auto; }
.cal-main { display: flex; flex-direction: column; min-width: 0; padding: 0; overflow: hidden; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-title { font-size: 1.3rem; margin: 0 0 0 8px; white-space: nowrap; }
.cal-body { flex: 1; min-height: 0; display: flex; flex-direction: column; transition: opacity .15s; }
.cal-body.loading { opacity: .6; }
.cal-error { margin: 10px 16px 0; }
.mini-month-grid { gap: 2px; }
.mini-day { position: relative; min-height: 32px; font-size: .9rem; border-radius: 9px; }
.mini-day.busy::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--accent); }
.mini-day[aria-pressed="true"].busy::after { background: var(--on-accent); }
.mini-weekday { font-size: .78rem; color: var(--faint); font-weight: 600; }
.cal-sources { display: flex; flex-direction: column; gap: 14px; }
.cal-section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.cal-section-head h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin: 0; }
.cal-section-head .button { min-height: 32px; min-width: 32px; padding: 2px; }
.cal-source { display: flex; align-items: center; gap: 8px; border-radius: 10px; padding: 2px 2px 2px 6px; }
.cal-source:hover { background: var(--select); }
.cal-source.off .cal-source-name { color: var(--faint); }
.cal-swatch { width: 18px; height: 18px; border-radius: 6px; border: 2px solid var(--c); background: transparent; padding: 0; cursor: pointer; flex: 0 0 auto; }
.cal-swatch.on { background: var(--c); }
.cal-source-name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; border: 0; background: none; color: var(--text); font: inherit; padding: 6px 0; cursor: pointer; text-align: left; }
.cal-source-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-source-name .person-initials, .cal-source-name .avatar { width: 24px; height: 24px; font-size: .62rem; }
.cal-more { opacity: 0; min-height: 30px !important; min-width: 30px !important; }
.cal-source:hover .cal-more, .cal-more:focus-visible { opacity: 1; }
@media (pointer: coarse) { .cal-more { opacity: 1; } }
.cal-hint { font-size: .86rem; color: var(--faint); margin: 2px 0 0; }
.color-row { display: flex; flex-wrap: wrap; gap: 8px; }
.color-dot { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--c); cursor: pointer; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .15); }
.color-dot[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--canvas), 0 0 0 5px var(--c); }
.pick-list { display: grid; gap: 6px; max-height: 50vh; overflow: auto; }
.pick { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.pick:hover:not(:disabled) { background: var(--select); }
.pick:disabled { opacity: .5; cursor: default; }
.pick small { display: block; color: var(--faint); }
.label { font-size: .95rem; font-weight: 600; color: var(--muted); }

/* Woche und Tag */
.cal-week { --gutter: 58px; display: flex; flex-direction: column; flex: 1; min-height: 0; }
.cal-week-head, .cal-allday, .cal-grid { display: grid; grid-template-columns: var(--gutter) repeat(var(--cols), minmax(0, 1fr)); }
.cal-week-head { border-bottom: 1px solid var(--line); }
.cal-gutter { font-size: .74rem; color: var(--faint); padding: 6px 6px 0 0; text-align: right; }
.cal-day-head { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 8px 0; border: 0; background: none; color: var(--muted); cursor: pointer; font: inherit; }
.cal-day-head small { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.cal-day-head strong { font-size: 1.45rem; line-height: 1.2; color: var(--text); width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; }
.cal-day-head.today strong { background: var(--accent); color: var(--on-accent); }
.cal-day-head:hover strong { background: var(--select); }
.cal-day-head.today:hover strong { background: var(--accent); }
.cal-allday { border-bottom: 1px solid var(--line); min-height: 34px; }
.cal-allday-cell { display: flex; flex-direction: column; gap: 3px; padding: 4px; border-left: 1px solid var(--line); min-width: 0; }
.cal-allday-cell.drop, .cal-month-cell.drop { background: var(--select); }
.cal-scroll { flex: 1; overflow-y: auto; min-height: 380px; max-height: calc(100dvh - 330px); position: relative; }
.cal-grid { position: relative; height: calc(var(--hour) * 24); user-select: none; }
.cal-axis { display: grid; grid-template-rows: repeat(24, var(--hour)); }
.cal-axis span { font-size: .76rem; color: var(--faint); text-align: right; padding-right: 8px; transform: translateY(-.6em); font-variant-numeric: tabular-nums; }
.cal-col { position: relative; border-left: 1px solid var(--line); cursor: crosshair;
  background-image: repeating-linear-gradient(to bottom, var(--line) 0, var(--line) 1px, transparent 1px, transparent var(--hour)); }
.cal-col.weekend { background-color: rgba(255, 255, 255, .02); }
:root[data-theme="light"] .cal-col.weekend { background-color: rgba(10, 40, 80, .025); }
.cal-col.today { background-color: color-mix(in srgb, var(--accent) 5%, transparent); }
.cal-now { position: absolute; left: 0; right: 0; top: var(--top); height: 2px; background: #ff6b6b; z-index: 3; pointer-events: none; }
.cal-now::before { content: ""; position: absolute; left: -6px; top: -5px; width: 12px; height: 12px; border-radius: 50%; background: #ff6b6b; }
.cal-event {
  position: absolute; top: var(--top); height: var(--height); left: calc(var(--left) + 2px); width: calc(var(--width) - 5px);
  border-radius: 9px; padding: 4px 8px; overflow: hidden; z-index: 2; cursor: pointer;
  background: color-mix(in srgb, var(--c) 26%, var(--canvas)); color: var(--text);
  box-shadow: inset 3px 0 0 var(--c); font-size: .86rem; line-height: 1.25; display: flex; flex-direction: column;
}
:root[data-theme="light"] .cal-event { background: color-mix(in srgb, var(--c) 30%, #ffffff); }
.cal-event strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.cal-event small { font-size: .76rem; color: var(--muted); }
.cal-event.short { flex-direction: row; gap: 6px; align-items: center; white-space: nowrap; padding-top: 1px; padding-bottom: 1px; }
.cal-event.editable { cursor: grab; }
.cal-event.dragging { cursor: grabbing; opacity: .85; z-index: 5; box-shadow: inset 3px 0 0 var(--c), 0 10px 24px rgba(0, 0, 0, .35); }
.cal-event.private { background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(255, 255, 255, .05) 6px 12px); }
.cal-event:hover { filter: brightness(1.08); }
.cal-event-source { opacity: .85; }
.cal-resize { position: absolute; left: 0; right: 0; bottom: 0; height: 8px; cursor: ns-resize; }
.cal-resize::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 22px; height: 3px; margin-left: -11px; border-radius: 2px; background: var(--c); opacity: 0; }
.cal-event:hover .cal-resize::after { opacity: .9; }
.cal-ghost { position: absolute; left: 2px; right: 3px; top: var(--top); height: var(--height); border-radius: 9px; z-index: 4; pointer-events: none;
  background: color-mix(in srgb, var(--accent) 30%, transparent); outline: 2px solid var(--accent); font-size: .8rem; padding: 3px 8px; color: var(--text); }
.cal-chip {
  display: block; width: 100%; text-align: left; border: 0; border-radius: 7px; padding: 3px 8px; font: inherit; font-size: .84rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; color: var(--text);
  background: color-mix(in srgb, var(--c) 30%, transparent); box-shadow: inset 3px 0 0 var(--c);
}
.cal-chip.editable { cursor: grab; }
.cal-chip.month:not(.allday) { background: transparent; box-shadow: none; padding-left: 4px; }
.cal-chip.month:not(.allday)::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-right: 6px; vertical-align: middle; }
.cal-chip.private { font-style: italic; }
.cal-chip:hover { filter: brightness(1.1); }

/* Monat */
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: auto; flex: 1; }
.cal-month-wd { padding: 8px 10px; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); border-bottom: 1px solid var(--line); }
.cal-month-cell { min-height: 118px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-month-cell:nth-child(7n) { border-right: 0; }
.cal-month-cell.outside { opacity: .5; }
.cal-month-day { align-self: flex-start; width: 30px; height: 30px; border-radius: 50%; border: 0; background: none; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.cal-month-day:hover { background: var(--select); }
.cal-month-cell.today .cal-month-day { background: var(--accent); color: var(--on-accent); }
.cal-more-link { border: 0; background: none; color: var(--accent); font: inherit; font-size: .82rem; text-align: left; cursor: pointer; padding: 2px 4px; }

/* Liste */
.cal-agenda { padding: 8px 16px 20px; display: flex; flex-direction: column; gap: 14px; overflow: auto; max-height: calc(100dvh - 280px); }
.cal-agenda h3 { font-size: .95rem; color: var(--muted); margin: 8px 0 4px; }
.cal-agenda-row { display: grid; grid-template-columns: 130px 12px minmax(0, 1fr); align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 12px; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.cal-agenda-row:hover { background: var(--select); }
.cal-agenda-time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .92rem; }
.cal-agenda-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.cal-agenda-row small { display: block; color: var(--faint); }
.cal-empty { flex: 1; display: grid; place-items: center; align-content: center; gap: 8px; color: var(--faint); padding: 60px 20px; }
.team-day { padding: 12px 16px 20px; overflow: auto; }
.team-day-event.busy { background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(255, 255, 255, .06) 6px 12px); }

@media (max-width: 1100px) {
  .cal-layout { grid-template-columns: 1fr; }
  .cal-side { position: static; max-height: none; }
}
@media (max-width: 760px) {
  .workspace { padding: 14px 14px 110px; }
  .cal-week { --gutter: 44px; }
  .cal-month-cell { min-height: 72px; }
  .cal-agenda-row { grid-template-columns: 90px 10px minmax(0, 1fr); }
}

/* ---------- Team, Support, Aufgaben, Rechnungen (0.5) ---------- */
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.check-card { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-weight: 500; color: var(--text); cursor: pointer; }
.check-card input { min-height: 0; width: 18px; height: 18px; margin-top: 2px; }
.check-card small { display: block; color: var(--faint); font-weight: 400; }
.check-card .scope { margin-top: 6px; min-height: 36px; font-size: .9rem; padding-top: 4px; padding-bottom: 4px; }
.address-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0; }
.address-field input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.address-field span { padding: 0 14px; min-height: 44px; display: grid; place-items: center; border-radius: 0 var(--small-radius) var(--small-radius) 0; background: var(--surface-raised); color: var(--muted); font-weight: 600; }
.one-time { font-family: ui-monospace, Consolas, monospace; font-size: 1.3rem; letter-spacing: .08em; padding: 14px 18px; border-radius: 14px; background: var(--deep); user-select: all; text-align: center; }
.staff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.staff-card { display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
.staff-card.disabled { opacity: .6; }
.staff-card header { display: flex; gap: 12px; align-items: center; }
.staff-card header .person-initials, .staff-card header .avatar { width: 46px; height: 46px; font-size: .95rem; }
.staff-card h3 { margin: 0; }
.staff-card small { color: var(--faint); }
.area-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.area-tag { font-size: .8rem; padding: 3px 10px; border-radius: 999px; background: var(--select); color: var(--text); }

.support-layout { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 16px; min-height: calc(100dvh - 230px); }
.support-list { display: flex; flex-direction: column; gap: 4px; overflow: auto; max-height: calc(100dvh - 300px); padding: 8px; }
.support-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; padding: 12px; border-radius: 14px; border: 0; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.support-item:hover, .support-item[aria-pressed="true"] { background: var(--select); }
.support-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.support-item small { color: var(--faint); grid-column: 1 / -1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.support-item .unread-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); align-self: center; }
.support-thread { display: flex; flex-direction: column; min-width: 0; padding: 0; overflow: hidden; }
.support-thread-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.support-thread-head h2 { margin: 0; }
.support-thread-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.support-thread-meta select { min-height: 38px; font-size: .92rem; width: auto; }
.chat { flex: 1; overflow: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; max-height: calc(100dvh - 430px); min-height: 240px; }
.bubble { max-width: min(680px, 82%); padding: 12px 16px; border-radius: 18px; background: var(--surface-raised); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.bubble.customer { align-self: flex-start; border-bottom-left-radius: 6px; }
.bubble.reply { align-self: flex-end; border-bottom-right-radius: 6px; background: color-mix(in srgb, var(--accent) 24%, transparent); }
.bubble.note { align-self: flex-end; border-bottom-right-radius: 6px; background: color-mix(in srgb, var(--gold) 18%, transparent); }
.bubble.system { align-self: center; background: transparent; color: var(--faint); font-size: .86rem; padding: 2px 10px; text-align: center; }
.bubble-meta { display: block; font-size: .78rem; color: var(--faint); margin-bottom: 4px; white-space: normal; }
.composer { border-top: 1px solid var(--line); padding: 14px 20px 18px; display: flex; flex-direction: column; gap: 10px; }
.composer textarea { min-height: 96px; }
.composer-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
@media (max-width: 1000px) { .support-layout { grid-template-columns: 1fr; } .chat { max-height: none; } }

.task-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.task-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.task-item.done { opacity: .6; }
.task-item.done strong { text-decoration: line-through; }
.task-item input[type="checkbox"] { width: 22px; height: 22px; min-height: 0; margin-top: 2px; }
.task-item p { margin: 4px 0 0; color: var(--muted); white-space: pre-wrap; }
.task-item small { color: var(--faint); }
.task-actions { display: flex; gap: 4px; }
.prio { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; background: var(--faint); }
.prio.p1 { background: var(--danger); }
.prio.p2 { background: var(--gold); }
.prio.p3 { background: var(--mint); }

.invoice-list { display: grid; gap: 10px; }
.invoice-row { display: grid; grid-template-columns: 48px minmax(0, 1.4fr) minmax(0, 1fr) auto auto; gap: 16px; align-items: center; padding: 14px 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.invoice-row .doc-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--select); color: var(--accent); }
.invoice-row strong { display: block; }
.invoice-row small { color: var(--faint); }
.invoice-row .amount { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
@media (max-width: 800px) { .invoice-row { grid-template-columns: 40px minmax(0, 1fr) auto; } .invoice-row > :nth-child(3), .invoice-row > :nth-child(5) { display: none; } }

.user-row { display: grid; grid-template-columns: 44px minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); cursor: pointer; color: var(--text); font: inherit; text-align: left; width: 100%; }
.user-row:hover { background: var(--select); }
.user-row strong { display: block; overflow: hidden; text-overflow: ellipsis; }
.user-row small { color: var(--faint); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meter { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .1); overflow: hidden; }
:root[data-theme="light"] .meter { background: rgba(10, 40, 80, .1); }
.meter span { display: block; height: 100%; width: var(--p, 0%); background: var(--accent); border-radius: 6px; }
@media (max-width: 900px) { .user-row { grid-template-columns: 40px minmax(0, 1fr) auto; } .user-row > :nth-child(3), .user-row > :nth-child(4) { display: none; } }

.health-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.health { display: flex; gap: 14px; align-items: flex-start; padding: 18px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
.health .dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 7px; flex: 0 0 auto; background: var(--faint); }
.health.ok .dot { background: var(--mint); box-shadow: 0 0 0 5px color-mix(in srgb, var(--mint) 20%, transparent); }
.health.warn .dot { background: var(--gold); }
.health.bad .dot { background: var(--danger); box-shadow: 0 0 0 5px color-mix(in srgb, var(--danger) 20%, transparent); }
.health small { color: var(--faint); display: block; }
.cal-event.short strong { flex: 0 1 auto; min-width: 0; white-space: nowrap; }
.cal-event.short small { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-event.short .cal-event-source { display: none; }
.choice-list { display: grid; gap: 10px; }
.choice-list label.checkbox { color: var(--text); font-weight: 500; }
label.checkbox input { min-height: 0; width: 18px; height: 18px; }
.check-card input[type="checkbox"] { flex: 0 0 auto; }
.check-card > span { flex: 1; min-width: 0; }
.check-card .scope { width: 100%; }
.task-item strong, .task-item small { display: block; }
.invoice-row { text-align: left; color: var(--text); font: inherit; width: 100%; cursor: pointer; }
.invoice-row small { display: block; }
button.invoice-row:hover { background: var(--select); }
