/*
 * TCMS – Ansichten (AP5): Kalendertage, Monatsansicht, Listen, Tages-, Termin- und Adress-Ansicht, Suche.
 * Nur Variablen aus design.css. Maße und Verhalten nach Mockup 02, Look Studio 2 nach Mockup 04.
 */

/* ---------- Farben je Art (eine Variable, alle Regeln darauf) ---------- */
.s-o, .k-o, .st.o, .d.o, .fc.on.o { --kc: var(--c-opt); --kt: var(--c-opttx); }
.s-z, .k-z, .st.z, .d.z, .fc.on.z, .r-l { --kc: var(--c-zus); --kt: var(--c-zustx); }
.s-v, .k-v, .st.v, .d.v, .fc.on.v, .r-k { --kc: var(--c-ver); --kt: var(--c-vertx); }
.s-a, .k-a, .st.a, .d.a, .fc.on.a { --kc: var(--c-abs); --kt: var(--c-abstx); }
.s-n, .k-n, .st.n, .d.n, .fc.on.n { --kc: var(--c-oth); --kt: var(--c-othtx); }
.r-b { --kc: var(--c-opt); --kt: var(--c-opttx); }
.leg .a { background: var(--c-abs); } .leg .n { background: var(--c-oth); }

/* ---------- Kalender: Monatskarte ---------- */
.mo { container-type: inline-size; }
.wdr { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; padding: 2.4px 6.4px; background: var(--wb-bg); }
.wd { font-size: var(--wd-fs); font-weight: var(--wd-fw); color: var(--wb-tx); text-align: center; text-transform: var(--wd-tt); letter-spacing: var(--wd-ls); }
.mo.old .wdr { background: var(--wb-old-bg); } .mo.old .wd { color: var(--wb-old-tx); }
.mo.cur .wdr { background: var(--wb-cur-bg); } .mo.cur .wd { color: var(--wb-cur-tx); }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; padding: 4.8px 6.4px 6.4px; }
.d {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center; min-width: 0;
  font-size: var(--day-fs); font-weight: var(--day-fw); border-radius: var(--day-rad); color: var(--c-dn);
  text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.d:hover { outline: 1.5px solid var(--c-ring); }
.d.r { color: var(--c-red); }
.d.o, .d.z, .d.v, .d.a, .d.n { background: var(--kc); color: var(--kt); font-weight: var(--day-st-fw); }
.d.a { text-decoration: line-through; }
.mo.old .d:not(.o):not(.z):not(.v):not(.a):not(.n):not(.r) { color: var(--c-odn); }
.d.t { box-shadow: 0 0 0 1.5px var(--c-today); }
.d.hit { outline: 2px solid var(--c-today); outline-offset: 1px; animation: tcms-puls 1s ease 3; }
.mo.hit { box-shadow: 0 0 0 2px var(--c-today), var(--frame-sh); }
@keyframes tcms-puls { 0%, 100% { outline-offset: 1px; } 50% { outline-offset: 3px; } }
@media (prefers-reduced-motion: reduce) { .d.hit { animation: none; } }
.mo.big .mn { font-size: clamp(16px, 9cqw, 33.6px); padding: 6.4px 4.8px; }
.mo.big .wdr { padding: 4.8px 9.6px; }
.mo.big .wd { font-size: clamp(12px, 5.8cqw, 19.2px); }
.mo.big .cal { padding: 8px 9.6px 11.2px; }
.mo.big .d { font-size: clamp(14.4px, 7.6cqw, 30.4px); }
html.hm .mn { font-size: clamp(12px, 7cqw, 15px); padding: 4px 3px; }
html.hm .d { font-size: clamp(12px, 6.2cqw, 14px); }
html.hm .mo.big .d { font-size: clamp(14px, 7cqw, 24px); }
.mn.mnx { cursor: default; }
.mn.mnx:hover { filter: none; }

/* ---------- Sprung zu Jahr/Monat und Datum (Mockup 02) ---------- */
.pop {
  position: absolute; top: calc(100% + 6.4px); left: 0; z-index: 40; width: min(92vw, 304px); background: var(--pop-bg); color: var(--c-tx);
  border: 1px solid var(--c-bd); border-radius: 12.8px; box-shadow: var(--shadow-pop); padding: 9.6px; font-size: 12px; font-weight: 400;
}
.pop.gp { width: min(92vw, 272px); }
.ph { display: flex; align-items: center; justify-content: space-between; gap: 6.4px; margin: 0 0 8px; font-size: 12px; font-weight: 700; }
.ph .nb { min-width: 27.2px; min-height: 27.2px; width: 27.2px; height: 27.2px; font-size: 14.4px; background: color-mix(in srgb, var(--c-tx) 9%, transparent); box-shadow: none; }
.pg { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4.8px; }
.pg.m { grid-template-columns: repeat(4, 1fr); }
.po {
  position: relative; height: 30.4px; border: 0; border-radius: var(--rad-pill); background: color-mix(in srgb, var(--c-tx) 7%, transparent);
  color: var(--c-tx); font-size: 12px; cursor: pointer; padding: 0;
}
.po:hover { background: color-mix(in srgb, var(--c-tx) 14%, transparent); }
.po.on { background: var(--add-bg); color: var(--add-tx); font-weight: 700; }
.po.now { box-shadow: 0 0 0 1.5px var(--c-ring); }
.po.has::after { content: ""; position: absolute; left: 50%; bottom: 3.2px; width: 3.2px; height: 3.2px; margin-left: -1.6px; border-radius: 50%; background: currentColor; opacity: .45; }
.pf { display: flex; justify-content: space-between; align-items: center; gap: 6.4px; margin-top: 8px; color: var(--c-mu); }
.pf button { flex: none; border: 0; border-radius: var(--rad-pill); padding: 4.8px 11.2px; background: color-mix(in srgb, var(--c-tx) 9%, transparent); color: var(--c-tx); font-size: 12px; font-weight: 600; cursor: pointer; }
.pf button:disabled { opacity: .4; cursor: default; }
.gi {
  width: 100%; height: 33.6px; padding: 0 12.8px; border: 0; border-radius: var(--rad-pill); background: color-mix(in srgb, var(--c-tx) 9%, transparent);
  color: var(--c-tx); font-size: 16px; outline: 0;
}
.gi:focus { box-shadow: 0 0 0 2px var(--c-ring); }
.gh { min-height: 1.4em; margin: 6.4px 3.2px 0; color: var(--c-mu); }
.gh.ok { color: var(--c-tx); font-weight: 600; }
html.hm .pop { position: fixed; left: 8px; right: 8px; top: calc(var(--hmt, 100px) - 4px); width: auto; }

/* ---------- Status-Schild ---------- */
.st {
  display: inline-flex; align-items: center; justify-content: center; height: 20px; padding: 0 9.6px; border-radius: var(--rad-pill);
  font-size: var(--st-fs); font-weight: var(--st-fw); white-space: nowrap; background: var(--kc); color: var(--kt); line-height: 1;
}

/* ---------- Tabellen (Raster mit Unterraster) ---------- */
.tb { display: grid; width: max-content; max-width: 100%; column-gap: 18px; align-items: center; }
.tb > * { grid-column: 1 / -1; }
.tr {
  display: grid; grid-template-columns: subgrid; align-items: center; padding: 8px 6.4px; color: var(--c-tx); text-decoration: none;
  border-top: .5px solid var(--c-bd); font-size: clamp(12px, 1vw, 12.8px); min-width: 0;
}
a.tr { cursor: pointer; }
a.tr:focus-visible { outline-offset: -2px; }
.tr > span { min-width: 0; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr.th {
  cursor: default; font-weight: 700; color: var(--c-mu); font-size: var(--tbl-th-fs); text-transform: var(--tbl-th-tt); letter-spacing: var(--tbl-th-ls);
  border-top: 0; border-bottom: 2px solid color-mix(in srgb, var(--c-tx) 28%, transparent);
}
.tr.th + .tr { border-top: 0; }
a.tr:not([class*=" s-"]):not([class*=" r-"]):hover { background: color-mix(in srgb, var(--c-tx) 6%, transparent); }
.tr .m, .tr.th .m { color: var(--c-mu); }
.tr.s-o, .tr.s-z, .tr.s-v, .tr.s-a, .tr.s-n, .tr.r-k, .tr.r-b, .tr.r-l {
  background: linear-gradient(90deg, var(--kc) 0 var(--row-bar), color-mix(in srgb, var(--kc) var(--row-t), transparent) var(--row-bar));
}
.tr.s-o:hover, .tr.s-z:hover, .tr.s-v:hover, .tr.s-a:hover, .tr.s-n:hover, .tr.r-k:hover, .tr.r-b:hover, .tr.r-l:hover {
  background: linear-gradient(90deg, var(--kc) 0 var(--row-bar), color-mix(in srgb, var(--kc) var(--row-th), transparent) var(--row-bar));
}
.tr.ab { opacity: .62; }
.tr.ab .sx { text-decoration: line-through; }
.hmo { display: none; }
.hmy { font-style: normal; }
html.hm .hmy { display: none; }
.tb .pl { padding: 16px 6.4px; }

/* Monatsansicht und Liste: Tag, Datum, Anlass, Programm, Zeit, Ort, Veranstalter, Status, Autor */
.tb.m9w { grid-template-columns: repeat(9, minmax(0, max-content)); }
/* Neueste, Letzte, Suche: Datum, Anlass, Veranstalter, Ort, Status, Angelegt/Geändert */
.tb.t6w { grid-template-columns: repeat(6, minmax(0, max-content)); }
/* Adressen: Nr., Name, Telefon, E-Mail, Letzter Termin, Runder Jahrestag */
.tb.a6w { grid-template-columns: repeat(6, minmax(0, max-content)); }
/* Bisherige Termine einer Adresse */
.tb.a5w { grid-template-columns: repeat(6, minmax(0, max-content)); }
/* Programm im Termin */
.tb.pgw { grid-template-columns: repeat(5, minmax(0, max-content)); }

/* Gruppenkopf (Monat) */
.tgh { display: flex; align-items: center; gap: 8px; padding: 14.4px 6.4px 4.8px; font-weight: 700; font-size: clamp(12px, 1.1vw, 14.4px); }
.tgh .n, .sgh .n { font-size: 12px; font-weight: 600; color: var(--c-mu); background: color-mix(in srgb, var(--c-tx) 9%, transparent); border-radius: var(--rad-pill); padding: 1px 8px; }
.lmb { color: inherit; text-decoration: none; }
.lmb:hover { text-decoration: underline; }
.lmh.lme { opacity: .5; }
.lmh.lmc .lmb { color: var(--acc); }

/* Filter "Anzeige" */
.flt { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 11.2px; }
.fl2 { color: var(--c-mu); font-size: 12px; min-width: 6.5em; }
.fc {
  border: 1px solid var(--sw-bd); border-radius: var(--rad-pill); padding: 5.6px 12.8px; background: color-mix(in srgb, var(--c-tx) 9%, transparent);
  color: var(--c-tx); font-size: 12px; cursor: pointer;
}
.fc:hover { background: color-mix(in srgb, var(--c-tx) 16%, transparent); }
.fc.on { font-weight: 700; background: var(--kc); color: var(--kt); border-color: transparent; }
.rb {
  display: inline-flex; align-items: center; justify-content: center; width: 28.8px; height: 28.8px; padding: 0; border: 0; border-radius: 50%;
  background: color-mix(in srgb, var(--c-tx) 9%, transparent); color: var(--c-tx); cursor: pointer;
}
.rb:hover { background: color-mix(in srgb, var(--c-tx) 18%, transparent); }

/* Zahlenkacheln */
.ms { display: flex; flex-wrap: wrap; gap: 9.6px 38.4px; padding: 17.6px 6.4px 6.4px; }
.msi {
  display: flex; flex-direction: column; align-items: var(--msi-align); text-align: center; background: var(--msi-bg); border: 1px solid var(--msi-bd);
  border-radius: 12px; padding: 4px 10px;
}
.msi.dim { opacity: .5; }
.msi b { font-size: clamp(19.2px, 2.2vw, 25.6px); line-height: 1.1; }
.msi span { color: var(--c-mu); font-size: 12px; }

/* Monatsansicht: Mini-Kalender links */
.mlay { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 16px 22.4px; align-items: start; }
.mini { position: sticky; top: calc(var(--hmt, 118px) + 4px); }
.mo.mini .mn { font-size: 13px; }
.mo.mini .d { font-size: 11.5px; }
@media (max-width: 720px) { .mlay { grid-template-columns: 1fr; } .mini { position: static; max-width: 192px; } }

/* ---------- Tagesansicht ---------- */
.dlist { max-width: var(--max-list); }
/* Name des Feiertags über den Terminen (Hendrik 27.11.2026) */
.hol { max-width: var(--max-list); color: var(--c-red); font-weight: 600; margin: 0 0 8px; }
.evc {
  display: flex; align-items: center; gap: 11.2px; padding: 9.6px 11.2px; margin-bottom: 6.4px; background: var(--c-card); border: 1px solid var(--c-bd);
  border-radius: 9.6px; color: var(--c-tx); text-decoration: none; box-shadow: var(--frame-sh);
}
.evc:hover { background: color-mix(in srgb, var(--c-card) 92%, var(--c-tx)); }
.evc .tm { flex: none; width: 3.4em; text-align: center; font-weight: 700; font-size: clamp(12px, 1.1vw, 14.4px); }
.evc .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.evc .tt { font-weight: 700; font-size: clamp(12px, 1.1vw, 14.4px); }
.evc .sb { font-size: 12px; color: var(--c-mu); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evc .m { color: var(--c-mu); font-weight: 400; }
.none { padding: 22.4px 8px; text-align: center; color: var(--c-mu); font-size: clamp(12px, 1.1vw, 14.4px); }
.pl.hint, .pl.more, .pl.ld { padding: 10px 6.4px; font-size: 12px; }
.pl.err { color: var(--c-err-tx); }
#dnav .dl { min-width: 12em; text-align: center; }
html.hm #dnav .dl { min-width: 0; font-size: 13px; padding: 0 4px; }

/* ---------- Termin und Adresse lesen ---------- */
.rd, #adv { max-width: 1100px; }
.rdhd { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 20px; align-items: flex-start; margin: 6px 0 12px; }
.rddate { font-size: clamp(18px, 2vw, 24px); font-weight: 800; }
.rdtime { color: var(--c-mu); font-size: 14px; margin-top: 2px; }
.rdst { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.rdst .st { height: 24px; font-size: 13px; padding: 0 14px; }
.rdinq { font-size: 12px; color: var(--c-mu); }
.rdinq b { font-size: 18px; color: var(--c-tx); }
.rdan {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 10px 14px; margin-bottom: 12px; border-radius: var(--frame-rad);
  background: color-mix(in srgb, var(--c-abs) 30%, var(--c-card)); border: 1px solid var(--c-bd);
}
.rdan > span:first-child { color: var(--c-mu); font-size: 12px; }
.rdan b { font-size: clamp(16px, 1.8vw, 22px); }
.rdpr { margin-left: auto; color: var(--c-mu); font-size: 12px; }
.rdg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
@media (max-width: 800px) { .rdg { grid-template-columns: minmax(0, 1fr); } }
.rdb { background: var(--c-card); border: 1px solid var(--c-bd); border-radius: var(--frame-rad); box-shadow: var(--frame-sh); padding: 0 0 10px; min-width: 0; }
.rdb.rdw { margin-bottom: 12px; }
.rdh {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 8px; padding: 8px 12px; font-size: 12.8px; font-weight: 800;
  letter-spacing: .08em; background: var(--band-bg); color: var(--band-tx); border-radius: var(--frame-rad) var(--frame-rad) 0 0;
}
.rdbtn {
  font-size: 12px; font-weight: 600; letter-spacing: 0; padding: 2px 10px; border-radius: var(--rad-pill); text-decoration: none;
  background: color-mix(in srgb, var(--band-tx) 18%, transparent); color: inherit;
}
.rdbody { padding: 0 12px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.rdname { font-size: 15px; }
.rdl { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); gap: 6px; }
.rdl span { color: var(--c-mu); font-size: 12px; }
.rdl b { font-weight: 500; overflow-wrap: anywhere; }
.rdl a, .rdkv a { color: var(--link); }
.rddispo { line-height: 1.45; }
.rdsep { border-top: 1px solid var(--c-bd); margin-top: 8px; padding-top: 8px; }
.rdb .tb { margin: 0 6px; max-width: calc(100% - 12px); }
.rdb > .pl { padding: 8px 12px; }
.rdkv { padding: 0 12px; }
.rdkv b { font-weight: 500; }
.efoot { margin-top: 6px; padding: 8px 2px; border-top: 1px solid var(--c-bd); color: var(--c-mu); font-size: 12px; line-height: 1.5; }
.rdb .efoot { margin: 10px 12px 0; }
.rdb.r-k, .rdb.r-b, .rdb.r-l { border-left: 3px solid var(--kc); }
.arl {
  display: inline-block; font-style: normal; font-size: 11px; font-weight: 600; padding: 1px 7px; margin-left: 4px; border-radius: var(--rad-pill);
  background: color-mix(in srgb, var(--c-tx) 10%, transparent); color: var(--c-tx);
}

/* ---------- Adressliste: Filterfeld ---------- */
.afw { position: relative; max-width: 640px; margin: 4px 0 6px; }
.afi {
  width: 100%; height: 34px; padding: 0 12px; border: 1px solid var(--sw-bd); border-radius: 8px; background: var(--sw-bg); color: var(--c-tx); font-size: 14px;
}
.afi:focus { outline: 2px solid var(--acc); outline-offset: 0; }
.afi::placeholder { color: var(--c-mu); }
.afd {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 25; background: var(--pop-bg); border: 1px solid var(--c-bd); border-radius: 10px;
  box-shadow: var(--shadow-pop); padding: 4px; max-height: 320px; overflow: auto;
}
.afo { display: block; width: 100%; text-align: left; border: 0; background: transparent; color: var(--c-tx); padding: 8px 10px; border-radius: 6px; font-size: 13px; cursor: pointer; }
.afo.on, .afo:hover { background: color-mix(in srgb, var(--c-tx) 10%, transparent); }
.afo.hl { font-weight: 700; }
.afc { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.afc:empty { display: none; }
.afp {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 11px; border-radius: var(--rad-pill); font-size: 12px; font-weight: 600;
  background: var(--add-bg); color: var(--add-tx);
}
.afp button, .afr { border: 0; border-radius: var(--rad-pill); cursor: pointer; font-size: 13px; }
.afp button { width: 22px; height: 22px; padding: 0; background: color-mix(in srgb, var(--add-tx) 20%, transparent); color: inherit; }
.afr { padding: 3px 10px; background: color-mix(in srgb, var(--c-tx) 9%, transparent); color: var(--c-tx); font-size: 12px; }
/* Rollen-Schieber mit farbigem Punkt (Entscheidung 22.11.2026) */
#aro button[data-v="kunde"]::before, #aro button[data-v="anbieter"]::before, #aro button[data-v="location"]::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px;
}
#aro button[data-v="kunde"]::before { background: var(--c-ver); }
#aro button[data-v="anbieter"]::before { background: var(--c-opt); }
#aro button[data-v="location"]::before { background: var(--c-zus); }

/* Suche */
.sgh { display: flex; align-items: center; gap: 8px; margin: 14px 0 4px; font-size: 14.4px; }

/* ---------- Handy ---------- */
/* Zurück-Knopf nur als App vom Home-Bildschirm (Entscheidung 27.11.2026), wie Mockup als "‹" */
html.hm.sa .sub .bk { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; padding: 0 12px; font-size: 0; }
html.hm.sa .sub .bk::before { content: "‹"; font-size: 20px; line-height: 1; }
html.hm .tb { width: 100%; column-gap: 6px; }
html.hm .tr { padding: 9px 6px; font-size: 13px; }
html.hm .tr > span { max-width: none; }
html.hm .tb.m9w { grid-template-columns: auto auto minmax(0, 1fr) auto minmax(0, .8fr); }
html.hm .tr.m9 > span:nth-child(n+4):not(.hmo) { display: none; }
html.hm .tr.m9 > .hmo { display: block; }
html.hm .tb.t6w { grid-template-columns: auto minmax(0, 1fr) minmax(0, .7fr); }
html.hm .tr.t6 > span:nth-child(3), html.hm .tr.t6 > span:nth-child(n+5) { display: none; }
html.hm .tb.a5w { grid-template-columns: auto auto minmax(0, 1fr) auto; }
html.hm .tr.a5 > span:nth-child(4), html.hm .tr.a5 > span:nth-child(6) { display: none; }
html.hm .tb.a6w { display: block; }
html.hm .tr.th.a6 { display: none; }
html.hm .tr.a6 { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "h1 h3" "h2 h4"; gap: 2px 10px; padding: 10px 8px; }
html.hm .tr.a6 > span:not(.hmo) { display: none; }
html.hm .tr.a6 > .hmo { display: block; }
html.hm .ah1 { grid-area: h1; } html.hm .ah2 { grid-area: h2; font-size: 12px; color: var(--c-mu); }
html.hm .ah3 { grid-area: h3; text-align: right; font-size: 12px; } html.hm .ah4 { grid-area: h4; text-align: right; }
.acn { color: var(--c-mu); font-weight: 400; font-size: 12px; }
html.hm .mlay { grid-template-columns: 1fr; gap: 10px; }
html.hm .mini { position: static; max-width: 192px; }
html.hm .flt { gap: 6px; }
html.hm .flt .fl2 { display: none; }
html.hm .fc { padding: 5px 10px; }
html.hm .ms { gap: 8px 22px; padding: 14px 6px 6px; }
html.hm .afi { font-size: 16px; }
html.hm #aro button { padding: 0 9px; font-size: 12.5px; }
html.hm #aro button::before { margin-right: 4px; }
html.hm .rdst { align-items: flex-start; }
html.hm .sub .c3 .add[data-act="aedit"], html.hm .sub .c3 .add[data-act="eedit"], html.hm .sub .c3 .add[data-act="anew"] { display: none; }

@media print {
  .tr, .d { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .flt, .afw, .afc { display: none !important; }
}

/* ---------- AP7b-Nachtrag 2: Tagesansicht als Tabelle wie im Altsystem (Hendrik 27.11.2026, 21:18) ---------- */
/* Tag, Datum, Anlass, Programm, Zeit, PLZ Ort, Veranstalter, Autor; Statusfarbe wie Monatsliste, Absagen durchgestrichen */
.tb.d8w { grid-template-columns: repeat(8, minmax(0, max-content)); }
.tr.d8.ab > span { text-decoration: line-through; }
.tr.d8 .m { font-weight: 400; }
/* Handy: keine Spalte weglassen, sinnvoll umbrechen (Kopfzeile entfällt, jede Angabe steht an fester Stelle) */
html.hm .tb.d8w { display: block; }
html.hm .tr.th.d8 { display: none; }
html.hm .tr.d8 {
  grid-template-columns: 2.2em 5.4em minmax(0, 1fr) auto; column-gap: 8px; row-gap: 2px; padding: 9px 8px;
  grid-template-areas: "t d z u" "a a a a" "p p p p" "o o o o" "v v v v";
}
html.hm .tr.d8 > span { white-space: normal; overflow-wrap: anywhere; }
html.hm .tr.d8 .d8t { grid-area: t; }
html.hm .tr.d8 .d8d { grid-area: d; }
html.hm .tr.d8 .d8z { grid-area: z; text-align: right; }
html.hm .tr.d8 .d8u { grid-area: u; }
html.hm .tr.d8 .d8a { grid-area: a; font-size: 14px; }
html.hm .tr.d8 .d8p { grid-area: p; }
html.hm .tr.d8 .d8o { grid-area: o; color: var(--c-mu); }
html.hm .tr.d8 .d8v { grid-area: v; color: var(--c-mu); }
/* Marken in ADRESSEN (Hendrik 29.11.2026): Kontaktpersonen, weitere Datensätze gleicher Firma */
.amk { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: var(--rad-pill); font-size: 11.5px; font-weight: 600; line-height: 18px;
  color: var(--c-mu); background: color-mix(in srgb, var(--c-tx) 9%, transparent); white-space: nowrap; vertical-align: 1px; }
.amk.amd { color: var(--c-tx); background: color-mix(in srgb, var(--acc) 22%, transparent); }
.dym { font-weight: 700; }

/* Sortierung der Adressliste (Hendrik 29.11.2026): Spaltenköpfe als Knöpfe, zweiter Klick kehrt um; am Handy Zeile "Sortieren" */
.tr.th .asrt { all: unset; cursor: pointer; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; white-space: nowrap; }
.tr.th .asrt:hover, .tr.th .asrt.on { color: var(--c-tx); }
.tr.th .asrt:focus-visible { outline: 2px solid var(--c-ring); outline-offset: 2px; border-radius: 3px; }
.asrt i { font-style: normal; font-size: .85em; }
.asb { display: none; }
html.hm .asb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 13px; }
html.hm .asb .asrt { font: inherit; color: var(--c-tx); background: color-mix(in srgb, var(--c-tx) 7%, transparent); border: 0; border-radius: 14px; padding: 6px 11px; min-height: 32px; cursor: pointer; }
html.hm .asb .asrt.on { background: color-mix(in srgb, var(--acc) 22%, transparent); font-weight: 600; }

/* ---------- R30d: Firmengruppen "Dubletten" (API 0.9.0 C29, js/views/dubletten.js, Knopf in ADRESSEN) ---------- */
/* Je Gruppe ein Kasten wie die Blöcke der Adress-Ansicht, darin eine Tabelle wie ADRESSEN. Nur Design-Variablen. */
.adub { text-decoration: none; display: inline-flex; align-items: center; }
/* PC: Knopf in der Schaltzeile. Handy: die Schaltzeile gehört dem Rollen-Schieber (abgenommen), dort neben "Termine ohne Adresse ›" */
.pgx .back.adubh { display: none; }   /* spezifischer als .pgx .back in maske.css */
html.hm .sub .back.adub { display: none; }
html.hm .pgx .back.adubh { display: inline-flex; margin-left: 6px; }
.dgi { margin-top: 2px; }
.dgr { background: var(--c-card); border: 1px solid var(--c-bd); border-radius: var(--frame-rad); box-shadow: var(--frame-sh); margin: 0 0 12px; padding: 0 0 6px; min-width: 0; }
.dgr.dgx { opacity: .8; }
.dgh { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 8px 12px; border-bottom: 1px solid var(--c-bd); }
.dgt { min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.dgt .amk { margin-left: 4px; }
.dgr .tb { margin: 0 6px; max-width: calc(100% - 12px); }
.tb.dgw { grid-template-columns: repeat(7, minmax(0, max-content)); }
.tr.dg > .dg-hm { display: none; }
.tr.dg[data-href] { cursor: pointer; }
.tr.dg[data-href]:hover { background: color-mix(in srgb, var(--c-tx) 6%, transparent); }
.tr.dg.dpk { background: color-mix(in srgb, var(--acc) 16%, transparent); }
.tr.dg .dg-nm a { color: inherit; text-decoration: none; }
.tr.dg .dg-nm a:hover { text-decoration: underline; }
.tr.dg .dg-ec { text-align: right; }
.tr.dg .dg-ec i, .tr.dg .dg-ld i { font-style: normal; }
.tr.dg > .dg-bt { overflow: visible; justify-self: end; }
.dgb { height: 30px; font-size: 12.5px; }
.dgb.on { background: color-mix(in srgb, var(--acc) 22%, transparent); }
.dgb .s { display: none; }
html.hm .dgr { margin: 0 0 10px; }
html.hm .dgh { padding: 8px 8px; }
html.hm .dgr .tb { margin: 0; max-width: 100%; }
html.hm .tb.dgw { display: block; }
html.hm .tr.th.dg { display: none; }
html.hm .tr.dg { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "nm ec bt" "hm ld bt"; gap: 2px 10px; padding: 9px 8px; }
html.hm .tr.dg > .dg-nr, html.hm .tr.dg > .dg-ps, html.hm .tr.dg > .dg-ot { display: none; }
html.hm .tr.dg > .dg-hm { display: block; grid-area: hm; font-size: 12px; }
html.hm .tr.dg > .dg-nm { grid-area: nm; white-space: normal; overflow-wrap: break-word; }   /* Rechtsform ist der Unterschied: nicht abschneiden */
html.hm .tr.dg > .dg-ec { grid-area: ec; font-size: 12px; }
html.hm .tr.dg > .dg-ld { grid-area: ld; font-size: 12px; text-align: right; }
html.hm .tr.dg > .dg-bt { grid-area: bt; align-self: center; }
html.hm .tr.dg .hmo { display: inline; }
html.hm .dgb { height: var(--sz-ctl-hm, 40px); min-width: 44px; padding: 0 10px; font-size: 12.5px; }
html.hm .dgb .l { display: none; }
html.hm .dgb .s { display: inline; }
html.hm .dga .dgb .l { display: inline; }
html.hm .dga .dgb .s { display: none; }
html.hm #dst button { padding: 0 9px; font-size: 12.5px; }
