/* Components (templates/ui/_components.html). Patterns after Tabler (MIT) and shadcn/ui (MIT). */

/* ---------- Icon ---------- */
.icon { display: inline-block; vertical-align: -.2em; width: 1.125rem; height: 1.125rem; flex: none; fill: none; stroke: currentColor; }
.icon--sm { width: .95rem; height: .95rem; }
.icon--lg { width: 1.4rem; height: 1.4rem; }

/* ---------- Button ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 2.75rem; padding: .5rem 1.1rem; border: 0; border-radius: var(--r-sm);
  background: #23744A; color: #fff;
  font-weight: 560; font-size: var(--t-base); letter-spacing: -.01em; line-height: 1.2; text-align: center;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  box-shadow: inset 0 0 0 1px #17573A, inset 0 1px 0 rgba(255, 255, 255, .16), 0 1px 2px rgba(28, 27, 25, .18);
  transition: background-color .15s, box-shadow .15s;
}
.btn:hover { color: #fff; background: #1C6440; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline-offset: 3px; border-radius: var(--r-sm); }
.btn--ghost { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px #D5CFC4, 0 1px 2px rgba(28, 27, 25, .07); }
.btn--ghost:hover { background: #FBFAF7; color: var(--ink); box-shadow: inset 0 0 0 1px #C6BFB2, 0 1px 2px rgba(28, 27, 25, .07); }
.btn--quiet { background: transparent; color: var(--ink-2); box-shadow: none; }
.btn--quiet:hover { background: rgba(28, 27, 25, .05); color: var(--ink); }
.btn--danger { background: var(--danger); color: #fff; box-shadow: inset 0 0 0 1px var(--danger-ink), inset 0 1px 0 rgba(255, 255, 255, .16), 0 1px 2px rgba(28, 27, 25, .18); }
.btn--danger:hover { background: var(--danger-ink); }
.btn--ok { background: var(--ok-ink); color: #fff; box-shadow: inset 0 0 0 1px #145234, inset 0 1px 0 rgba(255, 255, 255, .16), 0 1px 2px rgba(28, 27, 25, .18); }
.btn--sm { min-height: 2.25rem; padding: .3rem .85rem; font-size: var(--t-sm); gap: .35rem; }
.btn--sm .icon { width: 1rem; height: 1rem; }
.btn--lg { min-height: 3.4rem; padding: .7rem 1.6rem; font-size: var(--t-md); }
.btn--block { display: flex; width: 100%; }
.btn--icon { width: 2.75rem; padding: 0; }
.btn--icon.btn--sm { width: 2.25rem; }
@media (min-width: 52.01rem) {
  .btn { min-height: 2.5rem; padding: .45rem 1rem; font-size: var(--t-sm); }
  .btn--sm { min-height: 2.25rem; padding: .3rem .8rem; }
  .btn--lg { min-height: 3rem; padding: .6rem 1.4rem; font-size: var(--t-base); }
  .btn--icon { width: 2.5rem; padding: 0; }
  .btn--icon.btn--sm { width: 2.25rem; }
  /* a search field and its button side by side: same height */
  :is(.work-search, .money-search, .inline, .inbox__find) > .btn { min-height: 2.5rem; }
}
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.link { display: inline; background: none; border: 0; padding: .2rem 0; color: var(--brand-ink); text-decoration: underline; text-underline-offset: .18em; cursor: pointer; font-weight: 500; }
.link--danger { color: var(--danger); }
.kbd { display: inline-flex; align-items: center; padding: 0 .35rem; min-width: 1.4rem; height: 1.3rem; border-radius: .3rem; background: var(--soft); box-shadow: inset 0 -1px 0 var(--edge-strong); color: var(--ink-3); font-size: var(--t-2xs); font-weight: 600; font-family: var(--font); }

/* ---------- Card ---------- */
.card { position: relative; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--card); padding: var(--s-5); }
.card + .card { margin-top: var(--s-4); }
:is(.main, .plain-page, .stack, .grid, .grid2, .settings, .dash, .days, .approvals, .meters, .clients, .course, .with-aside__main, .with-aside__side, .inbox__side) > .card { margin-top: 0; }
.card--flush { padding: 0; overflow: hidden; }
.card--well { background: var(--well); box-shadow: var(--well-edge); }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-3); }
.card__title { display: flex; align-items: center; gap: .5rem; font-family: var(--font); font-size: var(--t-base); font-weight: 600; letter-spacing: -.01em; }
.card__title .icon { color: var(--ink-3); }
.card__link { font-size: var(--t-sm); font-weight: 500; text-decoration: none; display: inline-flex; align-items: center; gap: .2rem; }
.card__foot { margin-top: var(--s-4); padding-top: var(--s-3); border-top: 1px solid var(--edge); }
:where(.card > :is(.kpis, .meters, .rows, .kv, .week, .table-wrap, .grid2, form) + *) { margin-top: var(--s-4); }  /* zero specificity: own margins win */
/* lists flush to the card edge: the rows keep the card's inner margin */
.card--flush > .rows > li > .row, .card--flush > .rows > .row { padding-inline: var(--s-4); }
.card--flush > .rows > li > a.row, .card--flush > .rows > a.row { border-radius: 0; }
a.card { display: block; color: inherit; text-decoration: none; transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease); }
a.card:hover { box-shadow: var(--card-hover); transform: translateY(-1px); color: inherit; }

/* ---------- KPI (mockup .kpis) ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-4); }
.kpis--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpis--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { display: grid; align-content: start; gap: .3rem; padding: var(--s-4) var(--s-5); border-radius: var(--r-md); background: #fff; box-shadow: var(--card); color: inherit; text-decoration: none; transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease); }
a.kpi:hover { background: #fff; color: inherit; box-shadow: inset 0 0 0 1px var(--edge-strong), 0 10px 22px -14px rgba(28, 27, 25, .25); transform: translateY(-1px); }
a.kpi:hover .kpi__label { color: var(--brand-ink); }
.kpi__label { color: var(--ink-2); font-size: var(--t-sm); font-weight: 500; }
.kpi__value { font-family: var(--display); font-size: 2rem; font-weight: 650; line-height: 1.1; letter-spacing: -.05em; font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }
.kpi__note { justify-self: start; font-size: var(--t-xs); font-style: normal; color: var(--ink-3); }
.card .kpi { background: var(--well); box-shadow: var(--well-edge); }
.card a.kpi:hover { background: #fff; }
.kpi__note--up { padding: 0 .45rem; border-radius: var(--r-pill); background: var(--ok-soft); color: var(--ok-ink); font-weight: 600; }
.kpi__note--down { padding: 0 .45rem; border-radius: var(--r-pill); background: var(--neutral-soft); color: var(--ink-2); font-weight: 600; }
.kpi__note--brand { padding: 0 .45rem; border-radius: var(--r-pill); background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
@media (max-width: 60rem) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); } .kpi { padding: var(--s-3) var(--s-4); } .kpi__value { font-size: 1.65rem; } }

/* ---------- Badge, pill, status dot ---------- */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .05rem .5rem; border-radius: var(--r-pill); background: var(--neutral-soft); color: var(--ink-2); font-size: var(--t-xs); font-weight: 600; line-height: 1.35rem; white-space: nowrap; vertical-align: middle; }
.badge--ok { background: var(--ok-soft); color: var(--ok-ink); }
.badge--warn { background: var(--warn-soft); color: var(--warn-ink); }
.badge--danger, .badge--urgent { background: var(--danger-soft); color: var(--danger-ink); }
.badge--brand { background: var(--brand-soft); color: var(--brand-ink); }
.badge--handem { background: var(--brand-soft); color: var(--brand-ink); font-size: var(--t-2xs); letter-spacing: .02em; line-height: 1.1rem; }
.badge--count { min-width: 1.35rem; justify-content: center; padding: 0 .4rem; background: var(--brand); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18); font-size: var(--t-2xs); line-height: 1.25rem; }
.badge--anfrage { background: #ECE9E2; color: #5F5951; }
.badge--termin { background: #FBF0D9; color: #7A5408; }
.badge--angebot, .badge--auftrag { background: var(--brand-soft); color: var(--brand-ink); }
.badge--bericht, .badge--rechnung { background: #E6E3DC; color: #37332E; }
.badge--zahlung, .badge--bewertung, .badge--wartung { background: var(--ok-soft); color: var(--ok-ink); }
.badge--abgebrochen { background: var(--soft); color: var(--ink-3); text-decoration: line-through; }
.pill { display: inline-flex; align-items: center; gap: .45rem; min-height: 2.25rem; padding: .3rem .85rem; border-radius: var(--r-pill); background: var(--soft); color: var(--ink-2); font-size: var(--t-sm); font-weight: 600; white-space: nowrap; text-decoration: none; }
.pill--brand { background: var(--brand-soft); color: var(--brand-ink); box-shadow: inset 0 0 0 1px rgba(31, 107, 69, .16); }
a.pill--brand:hover { background: #E2F0BF; color: var(--brand-ink); }
.pill--ok { background: var(--ok-soft); color: var(--ok-ink); box-shadow: inset 0 0 0 1px rgba(46, 154, 98, .18); }
.pill--warn { background: var(--warn-soft); color: var(--warn-ink); box-shadow: inset 0 0 0 1px rgba(217, 164, 65, .25); }
.pill--neutral { background: var(--neutral-soft); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--edge); }
.dot { position: relative; display: inline-block; flex: none; width: .5rem; height: .5rem; border-radius: 50%; background: var(--neutral); }
.dot--ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(46, 154, 98, .16); }
.dot--warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(217, 164, 65, .18); }
.dot--brand { background: var(--brand); box-shadow: 0 0 0 3px rgba(31, 107, 69, .14); }
.dot--neutral { background: var(--neutral); box-shadow: 0 0 0 3px rgba(163, 158, 149, .18); }
.dot--danger { background: var(--danger); box-shadow: 0 0 0 3px rgba(180, 35, 24, .14); }
.dot--ok.dot--pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--ok); animation: pulse 2.4s var(--ease) infinite; }
@keyframes pulse { 0% { transform: scale(1); opacity: .6; } 70%, 100% { transform: scale(2.6); opacity: 0; } }

/* ---------- Avatar ---------- */
.avatar { display: inline-grid; place-items: center; flex: none; width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--cream); color: var(--brand-ink); font-size: var(--t-sm); font-weight: 600; letter-spacing: -.02em; box-shadow: inset 0 0 0 1px var(--edge); }
.avatar--sm { width: 1.75rem; height: 1.75rem; font-size: var(--t-2xs); }
.avatar--lg { width: 2.75rem; height: 2.75rem; font-size: var(--t-md); }
.avatar--brand { background: var(--brand); color: var(--lime); box-shadow: inset 0 0 0 1px var(--brand-ink); border-radius: var(--r-sm); }

/* ---------- Rows (lists of things) ---------- */
.rows { display: grid; }
.rows > li + li, .rows > .row + .row { border-top: 1px solid var(--edge); }
.row { display: flex; align-items: center; gap: var(--s-3); min-height: 3.5rem; padding: var(--s-3) var(--s-1); color: inherit; text-decoration: none; }
a.row:hover, .row--link:hover { background: var(--surface-2); color: inherit; }
a.row { border-radius: var(--r-sm); }
.row__main { display: grid; gap: .1rem; min-width: 0; flex: 1; }
.row__title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.row__title a, a.row__title { color: inherit; text-decoration: none; }
.row__title a:hover, a.row__title:hover { color: var(--brand-ink); text-decoration: underline; }
.row__meta { color: var(--ink-3); font-size: var(--t-sm); overflow: hidden; text-overflow: ellipsis; }
.row__side { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: var(--s-2); flex: none; text-align: right; }
.row__lead { flex: none; display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: var(--r-sm); background: var(--soft); color: var(--ink-2); }
.row__lead--brand { background: var(--brand-soft); color: var(--brand-ink); }
.row__lead--ok { background: var(--ok-soft); color: var(--ok-ink); }
.row__lead--warn { background: var(--warn-soft); color: var(--warn-ink); }
.row__time { flex: none; width: 3.4rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.row .chev { color: var(--ink-3); }
/* list rows of older pages */
.list { display: grid; list-style: none; }
.list > li + li { border-top: 1px solid var(--edge); }
.list__item { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); min-height: 3.25rem; padding: var(--s-3) 0; color: inherit; text-decoration: none; }
a.list__item:hover { color: inherit; background: var(--surface-2); }
.list__item--wrap { flex-wrap: wrap; }
.list__main { display: grid; gap: .1rem; min-width: 0; flex: 1 1 14rem; }
.list__side { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: var(--s-2); }
.list__side > form { display: contents; }

/* ---------- Key/value ---------- */
.kv { display: grid; grid-template-columns: minmax(7rem, max-content) 1fr; gap: .45rem var(--s-4); }
.kv dt { color: var(--ink-3); font-size: var(--t-sm); padding-top: .05rem; }
.kv dd { min-width: 0; overflow-wrap: anywhere; }
.kv .kv { grid-template-columns: minmax(5rem, max-content) 1fr; }
.kv--compact { gap: .3rem var(--s-3); font-size: var(--t-sm); }
@media (max-width: 30rem) { .kv { grid-template-columns: 1fr; gap: 0; } .kv dd { margin-bottom: .5rem; } }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); box-shadow: inset 0 0 0 1px var(--edge); background: #fff; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.table th, .table td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--edge); vertical-align: top; }
.table th { position: sticky; top: 0; background: var(--surface-2); color: var(--ink-3); font-size: var(--t-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .num { text-align: right; }

/* ---------- Empty state ---------- */
.empty { display: grid; justify-items: center; gap: var(--s-2); padding: var(--s-10) var(--s-5); text-align: center; border-radius: var(--r-lg); background: var(--well); box-shadow: var(--well-edge); }
.empty__icon { display: grid; place-items: center; width: 3rem; height: 3rem; margin-bottom: var(--s-1); border-radius: 50%; background: #fff; box-shadow: var(--icon-well); color: var(--brand); }
.empty__title { font-family: var(--display); font-size: var(--t-lg); font-weight: 650; letter-spacing: -.03em; }
.empty__text { max-width: 34rem; color: var(--ink-2); }
.empty .btn { margin-top: var(--s-2); }
.empty--sm { gap: var(--s-1); padding: var(--s-4) var(--s-4); }
.empty--sm .empty__icon { width: 2.25rem; height: 2.25rem; }
.empty--sm .empty__icon .icon { width: 1rem; height: 1rem; }
.empty--sm .empty__title { font-size: var(--t-md); }
.empty--sm .empty__text { font-size: var(--t-sm); }

/* ---------- Kanban (mockup .board) ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(13rem, 1fr); gap: var(--s-3); overflow-x: auto; padding-bottom: var(--s-2); scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.col { display: flex; flex-direction: column; gap: var(--s-2); min-height: 12rem; padding: var(--s-2); border-radius: var(--r-md); background: var(--well); box-shadow: var(--well-edge); scroll-snap-align: start; }
.col__head { display: flex; align-items: center; gap: .5rem; padding: .3rem .4rem .35rem; font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); }
.col__head a { color: inherit; text-decoration: none; }
.col__dot { width: .45rem; height: .45rem; border-radius: 50%; background: var(--c, var(--neutral)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c, var(--neutral)) 16%, transparent); flex: none; }
.col__count { margin-left: auto; color: var(--ink-3); font-weight: 500; font-variant-numeric: tabular-nums; }
.col--anfrage { --c: var(--st-anfrage); }
.col--termin { --c: var(--st-termin); }
.col--angebot, .col--auftrag { --c: var(--st-angebot); }
.col--rechnung, .col--bericht { --c: var(--st-rechnung); }
.col--bezahlt, .col--zahlung, .col--bewertung, .col--wartung { --c: var(--st-bezahlt); }
.col__more { padding: .2rem .45rem; font-size: var(--t-xs); font-weight: 500; text-decoration: none; }
.col__empty { padding: var(--s-3) .45rem; color: var(--ink-3); font-size: var(--t-xs); }
.kcard { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: .2rem; padding: .7rem .8rem .75rem; border-radius: var(--r-sm); background: #fff; color: inherit; text-decoration: none; box-shadow: inset 0 0 0 1px var(--edge), 0 1px 2px rgba(28, 27, 25, .05), 0 4px 10px -6px rgba(28, 27, 25, .1); transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease); }
a.kcard:hover, .kcard:has(> a.kcard__link:hover) { color: inherit; box-shadow: inset 0 0 0 1px var(--edge-strong), 0 2px 4px rgba(28, 27, 25, .05), 0 10px 20px -10px rgba(28, 27, 25, .2); transform: translateY(-1px); }
.kcard__title { font-weight: 600; font-size: var(--t-sm); line-height: 1.3; letter-spacing: -.005em; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: anywhere; }
.kcard__link { color: inherit; text-decoration: none; }
.kcard__link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.kcard__meta { color: var(--ink-3); font-size: var(--t-xs); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kcard__chips { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .2rem; }
.kcard__actions { position: relative; z-index: 1; margin-top: .35rem; }
.kcard--done .kcard__title { color: var(--ink-2); }
.kcard--live { box-shadow: inset 0 0 0 1px var(--brand), 0 0 0 3px rgba(31, 107, 69, .12), 0 8px 18px -8px rgba(31, 107, 69, .45); margin-top: .35rem; }
.kcard__tag { position: absolute; top: -.55rem; right: .5rem; padding: 0 .45rem; border-radius: var(--r-pill); background: var(--grad); box-shadow: 0 0 0 2px #fff, 0 2px 6px -2px rgba(31, 107, 69, .6); color: #fff; font-size: var(--t-2xs); font-weight: 600; letter-spacing: .02em; line-height: 1.05rem; }

/* ---------- Tabs (sub navigation) ---------- */
.subtabs { display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none; padding: .25rem; border-radius: var(--r-pill); background: var(--soft); box-shadow: var(--well-edge); width: max-content; max-width: 100%; }
.subtabs::-webkit-scrollbar { display: none; }
.subtabs a { display: inline-flex; align-items: center; gap: .4rem; flex: none; min-height: 2.25rem; padding: .3rem .9rem; border-radius: var(--r-pill); color: var(--ink-2); font-size: var(--t-sm); font-weight: 500; text-decoration: none; white-space: nowrap; }
.subtabs a:hover { color: var(--ink); background: rgba(255, 255, 255, .6); }
.subtabs a[aria-current] { background: #fff; color: var(--ink); box-shadow: var(--icon-well); font-weight: 600; }
.subtabs__count { color: var(--ink-3); font-weight: 500; font-variant-numeric: tabular-nums; }

/* ---------- Drawer and modal (<dialog>) ---------- */
dialog { color: inherit; }
dialog::backdrop { background: rgba(28, 27, 25, .32); backdrop-filter: blur(2px); }
.modal { width: min(32rem, 100% - 2rem); max-height: min(44rem, 100% - 2rem); margin: auto; padding: 0; border: 0; border-radius: var(--r-lg); background: #fff; box-shadow: var(--shadow-lg); overflow: auto; }
.modal[open] { animation: rise .25s var(--ease); }
.drawer { position: fixed; inset: 0 0 0 auto; width: min(28rem, 100%); height: 100%; max-height: none; max-width: none; margin: 0 0 0 auto; padding: 0; border: 0; background: #fff; box-shadow: var(--shadow-lg); overflow: auto; }
.drawer[open] { animation: slidein .3s var(--ease); }
.dialog__head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-4) var(--s-5); background: #fff; border-bottom: 1px solid var(--edge); }
.dialog__head h2 { font-size: var(--t-lg); }
.dialog__body { padding: var(--s-5); }
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes slidein { from { transform: translateX(100%); } to { transform: none; } }

/* ---------- Toast and alerts ---------- */
.toasts { position: fixed; z-index: var(--z-toast); right: var(--s-4); bottom: var(--s-4); display: grid; gap: var(--s-2); width: min(24rem, 100% - 2rem); pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: var(--s-3); padding: var(--s-3) var(--s-3) var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--ink); color: #fff; box-shadow: var(--shadow-lg); pointer-events: auto; animation: rise .3s var(--ease); }
.toast .icon { margin-top: .15rem; color: var(--lime); }
.toast__text { flex: 1; font-weight: 500; }
.toast__close { display: grid; place-items: center; width: 1.9rem; height: 1.9rem; margin: -.2rem -.2rem 0 0; border: 0; border-radius: var(--r-sm); background: transparent; color: rgba(255, 255, 255, .7); }
.toast__close:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.toast.is-leaving { opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s; }
.alert { display: flex; align-items: flex-start; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--ok-soft); color: var(--ok-ink); box-shadow: inset 0 0 0 1px rgba(46, 154, 98, .22); }
.alert .icon { margin-top: .15rem; }
.alert--error, .flash--error { background: var(--danger-soft); color: var(--danger-ink); box-shadow: inset 0 0 0 1px rgba(180, 35, 24, .22); }
.alert--warn { background: var(--warn-soft); color: var(--warn-ink); box-shadow: inset 0 0 0 1px rgba(217, 164, 65, .28); }
.alert--info { background: var(--soft); color: var(--ink-2); box-shadow: var(--well-edge); }
.flash { display: block; padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--ok-soft); color: var(--ok-ink); box-shadow: inset 0 0 0 1px rgba(46, 154, 98, .22); }
.note { padding: var(--s-3) var(--s-4); border-radius: var(--r-sm); background: var(--cream); color: var(--ink-2); }

/* ---------- Timeline ---------- */
.timeline { display: grid; list-style: none; }
.tl { position: relative; display: grid; grid-template-columns: 1.5rem 1fr auto; gap: var(--s-3); align-items: start; padding: .55rem 0; }
.tl::before { content: ""; position: absolute; left: .7rem; top: 1.75rem; bottom: -.55rem; width: 1px; background: var(--line); }
.tl:last-child::before { display: none; }
.tl__mark { display: grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--soft); color: var(--ink-3); box-shadow: 0 0 0 3px #fff; }
.tl__mark .icon { width: .85rem; height: .85rem; }
.tl__mark--handem { background: var(--brand-soft); color: var(--brand); }
.tl__mark--ok { background: var(--ok-soft); color: var(--ok-ink); }
.tl__text { min-width: 0; padding-top: .1rem; }
.tl__text a { color: inherit; text-decoration: none; }
.tl__text a:hover { color: var(--brand-ink); text-decoration: underline; }
.tl__when { padding-top: .15rem; color: var(--ink-3); font-size: var(--t-xs); white-space: nowrap; }

/* ---------- Steps (job path) ---------- */
.steps, .path { display: flex; flex-wrap: wrap; gap: .3rem; list-style: none; }
.steps li, .path li { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .65rem; border-radius: var(--r-pill); background: var(--soft); color: var(--ink-3); font-size: var(--t-xs); font-weight: 600; }
.steps .done, .path .done { background: var(--ok-soft); color: var(--ok-ink); }
.steps .current, .path .current { background: var(--brand); color: #fff; }

/* ---------- Meter ---------- */
.bar { display: block; width: 100%; height: .6rem; border: 0; border-radius: var(--r-pill); overflow: hidden; background: var(--soft); appearance: none; }
.bar::-webkit-progress-bar { background: var(--soft); border-radius: var(--r-pill); }
.bar::-webkit-progress-value { background: var(--ok); border-radius: var(--r-pill); }
.bar::-moz-progress-bar { background: var(--ok); border-radius: var(--r-pill); }
.bar--high::-webkit-progress-value { background: var(--warn); }
.bar--high::-moz-progress-bar { background: var(--warn); }
.bar--full::-webkit-progress-value { background: var(--danger); }
.bar--full::-moz-progress-bar { background: var(--danger); }

/* ---------- Chips (filters) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chips a, .chips .chip { display: inline-flex; align-items: center; gap: .35rem; min-height: 2.25rem; padding: .25rem .8rem; border-radius: var(--r-pill); background: #fff; box-shadow: inset 0 0 0 1px var(--edge-strong); color: var(--ink-2); font-size: var(--t-sm); font-weight: 500; text-decoration: none; }
.chips a:hover { color: var(--ink); box-shadow: inset 0 0 0 1px rgba(28, 27, 25, .22); }
.chips a[aria-current] { background: var(--ink); color: #fff; box-shadow: none; }
.chips a span { color: inherit; opacity: .7; font-variant-numeric: tabular-nums; }
.chips--static { align-items: center; color: var(--ink-3); font-size: var(--t-sm); }

/* ---------- Bausteine (ready text pieces next to a message box: app/_bausteine.html) ---------- */
.bst { display: grid; gap: .4rem; min-width: 0; }
.bst__title { display: flex; align-items: center; gap: .4rem; font-family: var(--font); font-size: var(--t-sm); font-weight: 600; }
.bst__title .icon { color: var(--ink-3); }
.bst__hint { color: var(--ink-3); font-size: var(--t-xs); }
.bst__list { display: grid; gap: .35rem; margin: 0; padding: 0; list-style: none; }
.bst__item { display: grid; gap: .1rem; width: 100%; padding: .45rem .6rem; border: 0; border-radius: var(--r-sm); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--edge); color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: box-shadow .15s, background-color .15s; }
.bst__item:hover { background: #fff; box-shadow: inset 0 0 0 1px var(--brand-light), 0 4px 12px -8px rgba(28, 27, 25, .3); }
.bst__item:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.bst__item.is-used { background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand-light); }
.bst__label { display: inline-flex; align-items: center; gap: .3rem; color: var(--brand-ink); font-size: var(--t-xs); font-weight: 600; }
.bst__text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; color: var(--ink-2); font-size: var(--t-xs); line-height: 1.4; overflow-wrap: anywhere; white-space: pre-line; }
