:root {
  /* CI S-A-S Schankanlagenservice-Süd — Marken-Navy/Gold/Kupfer/gedämpftes Rot-Orange */
  --bg: #f2f1ec;
  --panel: #ffffff;
  --ink: #01152b;
  --muted: #6b7686;
  --line: #e6dfd0;
  --brand: #ebb42c;       /* Marken-Gold */
  --brand-dk: #c89620;
  --accent: #b47049;      /* Kupfer, Sekundärakzent (Avatare u.ä.) */
  --ring: rgba(235,180,44,.28);
  --ok-bg: #e6f4ea; --ok-ink: #1e7d3a;
  --err-bg: #f5e3dc; --err-ink: #b24d34;
  --warn-bg: #fff6e0; --warn-ink: #8a6d12;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(1,21,43,.06), 0 4px 16px rgba(1,21,43,.07);
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--brand-dk); text-decoration: none; }
a:hover { text-decoration: underline; }

header.topbar {
  background: linear-gradient(95deg, #01152b 0%, #0e2034 100%);
  color: #fff; padding: 13px 26px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: 0 2px 12px rgba(1,21,43,.18);
  position: sticky; top: 0; z-index: 100;
}
/* Sticky Kopfzeile würde Sprungziele (Direkthilfe-Anker, #hash-Links) sonst verdecken. */
[id] { scroll-margin-top: 80px; }
header.topbar .brand { font-weight: 800; letter-spacing: .5px; font-size: 19px; color: #fff; }
header.topbar .brand b { color: var(--brand); }
header.topbar .sub { color: #9db0c4; font-size: 13px;
  border-left: 1px solid rgba(255,255,255,.25); padding-left: 16px; }
header.topbar nav { margin-left: auto; display: flex; gap: 4px; align-items: center; }
header.topbar nav > a { color: #e8ecf1; font-size: 14px; font-weight: 500; padding: 6px 12px; border-radius: 6px; }
header.topbar nav > a:hover { color: var(--brand); text-decoration: none; background: rgba(255,255,255,.07); }

.nav-user { color: #9db0c4; font-size: 13px; padding: 6px 8px; opacity: .75; }
.nav-logout { margin-left: 2px; color: #d49485 !important; border: 1px solid rgba(255,100,80,.35); }

/* Eigener Tooltip statt Browser-Standard (title-Attribut lässt sich nicht umfärben) */
.icon-tip { position: relative; }
.icon-tip::after {
  content: attr(data-tip);
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(-4px);
  background: #0e2034; color: #fff; font-size: 12px; font-weight: 500; white-space: nowrap;
  padding: 6px 10px; border-radius: 6px; box-shadow: 0 4px 14px rgba(0,0,0,.25);
  opacity: 0; pointer-events: none; transition: opacity .12s, transform .12s; z-index: 300;
}
.icon-tip:hover::after, .icon-tip:focus-visible::after { opacity: 1; transform: translateX(-50%) translateY(0); }
.nav-logout:hover { background: rgba(255,100,80,.12) !important; color: #d49485 !important; }

/* Dropdown */
.dropdown { position: relative; }
.dropbtn {
  color: #e8ecf1; font-size: 14px; font-weight: 500;
  padding: 6px 12px; border-radius: 6px; cursor: pointer;
  display: flex; align-items: center; gap: 5px; white-space: nowrap;
  user-select: none;
}
.dropbtn::after { content: '▾'; font-size: 10px; opacity: .7; transition: transform .15s; }
.dropdown.open .dropbtn { color: var(--brand); background: rgba(255,255,255,.07); }
.dropdown.open .dropbtn::after { transform: rotate(-180deg); }
.dropdown-menu {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 200;
  background: #0e2034; border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.35);
  min-width: 190px; padding: 6px 0; white-space: nowrap;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a {
  display: block; padding: 8px 16px;
  color: #e8ecf1; font-size: 14px; font-weight: 400;
}
.dropdown-menu a:hover { color: var(--brand); background: rgba(255,255,255,.07); text-decoration: none; }
.dropdown-menu .sep { border-top: 1px solid rgba(255,255,255,.1); margin: 5px 0; }

main { max-width: 1080px; margin: 28px auto; padding: 0 20px; }
h1 { font-size: 24px; margin: 0 0 4px; }
.lead { color: var(--muted); margin: 0 0 24px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px,1fr)); gap: 16px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow);
}
.card .num { font-size: 30px; font-weight: 800; color: var(--brand-dk); line-height: 1; }
.card .lbl { color: var(--muted); font-size: 13px; margin-top: 6px; text-transform: uppercase; letter-spacing: .4px; }

.card.filter { cursor: pointer; text-align: left; font: inherit; width: 100%; transition: box-shadow .15s, border-color .15s; }
.card.filter:hover { border-color: var(--brand-dk); }
.card.filter.active { border-color: var(--brand-dk); border-width: 2px; box-shadow: 0 0 0 2px rgba(0,0,0,.04) inset; }

.card.blink { animation: card-blink 1.4s ease-in-out infinite; }
@keyframes card-blink {
  0%, 100% { box-shadow: var(--shadow); background: var(--panel); }
  50%      { box-shadow: 0 0 0 2px var(--err-ink); background: var(--err-bg); }
}

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge.ok { background: var(--ok-bg); color: var(--ok-ink); }
.badge.warn { background: var(--warn-bg); color: var(--warn-ink); }
.badge.err { background: var(--err-bg); color: var(--err-ink); }

table { width: 100%; border-collapse: collapse; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
th { background: #fbf0d9; color: var(--ink); font-weight: 700; }
th a.sortlink { color: inherit; white-space: nowrap; cursor: pointer; }
th a.sortlink:hover { text-decoration: underline; }
tr:last-child td { border-bottom: 0; }
/* Tour ohne hinterlegtes Lokal -> rot markieren */
tr.tour-leer td { background: var(--err-bg); }
tr.tour-leer td, tr.tour-leer input { color: var(--err-ink); }
tbody tr.clickable:hover { background: #fbf0d9; }

.btn { display: inline-block; background: var(--brand); color: #01152b; border: 0; border-radius: 10px;
  padding: 10px 18px; font-weight: 700; font-size: 15px; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--brand-dk); color: #fff; text-decoration: none; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }

.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; font-weight: 500; }
.flash.ok { background: var(--ok-bg); color: var(--ok-ink); }
.flash.err { background: var(--err-bg); color: var(--err-ink); }
.flash.warn { background: var(--warn-bg); color: var(--warn-ink); }

/* Formulare */
form.stack { display: grid; gap: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px 18px; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 3px; font-weight: 600; }
input[type=text], input[type=number], input[type=email], input[type=tel], input[type=url],
input[type=time], input[type=date], input[type=password],
select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ring); border-color: var(--brand); }
textarea { min-height: 60px; resize: vertical; }
.chk { display: flex; align-items: center; gap: 8px; }
.chk input { width: auto; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow); margin-bottom: 20px; }
.panel h2 { margin: 0 0 14px; font-size: 17px; }
.panel details summary { cursor: pointer; margin-bottom: 14px; }
.panel details[open] summary { margin-bottom: 14px; }
.panel details summary h2 { display: inline; margin: 0; }
.notiz-gruppe { margin-bottom: 22px; }
.notiz-gruppe:last-child { margin-bottom: 0; }
.notiz-gruppe summary { cursor: pointer; margin-bottom: 10px; }
.notiz-gruppe h3 { display: inline-flex; align-items: center; gap: 10px; margin: 0; font-size: 15px; }
.notiz-gruppe table { margin-top: 10px; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar input[type=text], .toolbar select { width: auto; min-width: 200px; }
.btn-sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn-icon { padding: 5px 8px; line-height: 1; }
.back-btn { margin-bottom: 16px; }
.btn-active { background: var(--brand); color: #01152b; }
.btn.danger { background: #f5e3dc; color: #b24d34; }
.btn.danger:hover { background: #b24d34; color: #fff; }
.muted { color: var(--muted); font-size: 13px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
code.tok { background: #fbf0d9; padding: 2px 7px; border-radius: 6px; font-size: 13px; }

/* Direkthilfe-Modus: "?" anklicken, dann auf eine Spaltenüberschrift zeigen */
body.hilfe-modus, body.hilfe-modus * { cursor: help !important; }
body.hilfe-modus [data-hilfe]:hover { background: var(--brand); color: #01152b; border-radius: 6px; }
.stack details p { transition: background-color 1.2s ease; border-radius: 6px; }
.hilfe-highlight { background-color: rgba(235, 180, 44, .35) !important; }
mark.hilfe-treffer { background: var(--brand); color: #01152b; border-radius: 3px; padding: 0 1px; }

/* === Tourenplan (optische Ansicht) === */
.tourgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 16px; }
.tourcard { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px; box-shadow: var(--shadow); text-decoration: none; color: var(--ink); transition: transform .08s, box-shadow .12s; }
.tourcard:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 8px 26px rgba(1,21,43,.13); }
.tourcard .tname { font-size: 17px; font-weight: 800; margin-bottom: 10px; line-height: 1.25; }
.tourcard .trow { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.tourcard .av { width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; flex: 0 0 auto; }
.tourcard .bn { font-size: 13.5px; color: var(--muted); }
.tourcard .bn b { color: var(--ink); display: block; font-size: 14.5px; }
.tourcard .stats { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 20px;
  font-size: 12.5px; font-weight: 600; background: #fbf0d9; color: var(--ink); }
.pill.ok { background: var(--ok-bg); color: var(--ok-ink); }
.pill.open { background: var(--warn-bg); color: var(--warn-ink); }
.wd { display: inline-block; background: var(--ink); color: #fff; border-radius: 8px; padding: 2px 9px;
  font-size: 12px; font-weight: 700; margin-left: 6px; vertical-align: middle; }

/* Timeline der Stationen */
.tl { list-style: none; margin: 0; padding: 0; position: relative; }
.tl:before { content: ""; position: absolute; left: 19px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.tl li { position: relative; padding: 0 0 14px 54px; }
.tl .num { position: absolute; left: 0; top: 0; width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px; z-index: 1; box-shadow: 0 0 0 4px var(--bg); }
.tl .num.done { background: var(--ok-ink); color: #fff; }
.stbox { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px;
  box-shadow: var(--shadow); }
.stbox .sh { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.stbox .nm { font-size: 16.5px; font-weight: 700; }
.stbox .zeit { color: var(--brand-dk); font-weight: 700; font-size: 14px; }
.stbox .adr { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.stbox .chips { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 10px; }
.stbox .chips .anlage-zeile { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chip2 { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 8px; background: #fbf0d9; color: var(--ink); }
.chip2.bier { background: #f6e2b8; } .chip2.afg { background: #d9ecf6; } .chip2.postmix { background: #e6dcf6; }
.chip2.wasser { background: #d9f0ee; }
.stbox .extra { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; color: var(--muted); }
.stbox .extra a { color: var(--brand-dk); }
.stbox .key { color: #8a6d12; font-weight: 600; }

/* Kalender — Monatsraster */
.kalender-toolbar { display: flex; align-items: center; gap: 12px; margin: 12px 0; }
.kalender-legende { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.kalender-legende-eintrag { display: flex; align-items: center; gap: 6px; }
.kalender-legende-punkt { width: 11px; height: 11px; border-radius: 50%; display: inline-block; box-shadow: inset 0 0 0 1px rgba(1,21,43,.15); }
.kalender-monat {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
}
.kalender-kopf {
  background: var(--panel); padding: 8px 6px; text-align: center;
  font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px;
}
.kalender-tag {
  background: var(--panel); min-height: 108px; padding: 6px; display: flex; flex-direction: column;
  gap: 3px; overflow-y: auto;
}
.kalender-tag.ausserhalb { background: var(--bg); }
.kalender-tag.ausserhalb .kalender-tag-nummer { color: var(--muted); }
.kalender-tag.heute { box-shadow: inset 0 0 0 2px var(--brand-dk); }
.kalender-tag-kopf { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 2px; }
.kalender-tag-wochentag { display: none; font-size: 11px; color: var(--muted); font-weight: 700; }
.kalender-tag-nummer { font-size: 13px; font-weight: 700; }
.kalender-tag.heute .kalender-tag-nummer {
  background: var(--brand-dk); color: #fff; border-radius: 50%;
  width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; font-size: 12px;
}
.kalender-termin {
  display: block; background: #fbf0d9; color: var(--ink); border-radius: 6px; padding: 2px 6px;
  font-size: 12px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kalender-termin:hover { text-decoration: none; background: var(--brand); }
.kalender-termin.ganztag { background: #d9ecf6; }
.kalender-termin-zeit { font-weight: 700; color: var(--brand-dk); margin-right: 3px; }

@media (max-width: 720px) {
  .kalender-monat { grid-template-columns: 1fr; }
  .kalender-kopf { display: none; }
  .kalender-tag { min-height: 0; flex-direction: row; align-items: flex-start; flex-wrap: wrap; }
  .kalender-tag.ausserhalb { display: none; }
  .kalender-tag-kopf { flex-direction: column; align-items: flex-start; margin: 0 8px 0 0; min-width: 44px; }
  .kalender-tag-wochentag { display: block; }
  .kalender-tag > .kalender-termin { flex: 1 1 auto; }
}

footer.foot { max-width: 1080px; margin: 40px auto 24px; padding: 0 20px; color: var(--muted); font-size: 12.5px; }

/* ==========================================================================
   Touch-Bedienung — greift auf Renés Android-Pad, nicht am Büro-Desktop
   ==========================================================================
   Bewusst über `pointer: coarse` statt über die Bildschirmbreite: ein 10-Zoll-
   Pad im Querformat meldet ~1280 px und bekäme sonst das Maus-Layout mit
   6-px-Tap-Zielen. `coarse` heißt „Finger statt Maus" und trifft damit genau
   den Fall — im Quer- wie im Hochformat.

   Richtwert für Tap-Ziele: 44 px (Apple HIG) bzw. 48 dp (Material Design).
   Wir nehmen 48 px, weil unterwegs oft im Stehen bedient wird.
   ========================================================================== */
@media (pointer: coarse) {

  /* --- Grundgrößen: nichts unter 16px, sonst zoomt Android beim Fokus rein --- */
  body { font-size: 16px; }

  /* --- Navigation --- */
  header.topbar { padding: 10px 20px; }
  header.topbar nav { gap: 4px; }
  header.topbar nav > a,
  .dropbtn {
    font-size: 16px;
    padding: 12px 16px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
  }
  .dropdown-inhalt a { padding: 14px 18px; font-size: 16px; min-height: 48px;
    display: flex; align-items: center; }
  .dropdown-inhalt { min-width: 240px; }

  /* Hover-Tooltips funktionieren auf Touch nicht — Fläche statt Schwebehilfe */
  .icon-tip::after, .icon-tip::before { display: none !important; }
  .icon-tip { min-width: 48px; justify-content: center; }

  /* --- Knöpfe --- */
  .btn {
    min-height: 48px;
    padding: 13px 22px;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .btn-sm { min-height: 44px; padding: 10px 16px; font-size: 15px; }
  .btn-icon { min-width: 48px; min-height: 48px; padding: 10px; font-size: 18px; }
  .toolbar { gap: 12px; }

  /* --- Formulare: große Felder, weil unterwegs oft im Stehen getippt wird --- */
  input[type=text], input[type=number], input[type=email], input[type=tel],
  input[type=url], input[type=time], input[type=date], input[type=password],
  select, textarea {
    min-height: 48px;
    padding: 12px 14px;
    font-size: 16px;          /* unter 16px zoomt Android automatisch hinein */
  }
  select { background-image: none; }         /* Android zeichnet den Pfeil selbst */
  label { font-size: 15px; margin-bottom: 6px; }
  form.stack { gap: 18px; }
  .grid2, .grid3 { gap: 18px 20px; }

  /* Kästchen und Schalter groß genug zum Treffen */
  .chk { min-height: 48px; gap: 14px; }
  .chk input[type=checkbox], .chk input[type=radio] { width: 26px; height: 26px; }

  /* --- Tabellen: mehr Luft, damit Zeilen sicher zu treffen sind --- */
  th, td { padding: 14px 14px; font-size: 15px; }
  tbody tr.clickable td:first-child { position: relative; }
  tbody tr.clickable:active { background: #fbf0d9; }   /* Rückmeldung beim Tippen */

  /* Tabellen, die breiter sind als der Schirm, seitlich scrollbar machen —
     statt die Seite selbst horizontal scrollen zu lassen */
  .tabelle-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* --- Panels etwas luftiger --- */
  .panel { padding: 20px 18px; }
  .panel details summary { min-height: 48px; display: flex; align-items: center; }

  /* --- Zurück-Knopf gut erreichbar --- */
  .back-btn { min-height: 48px; padding: 12px 20px; font-size: 16px; }
}

/* --- Pad im Hochformat: zweispaltige Raster brechen um ------------------- */
@media (pointer: coarse) and (max-width: 820px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar input[type=text], .toolbar select { width: 100%; min-width: 0; }
}

/* ==========================================================================
   Baugruppen und Kalkulation
   ==========================================================================
   Bewusst Karten statt breiter Tabellen: auf dem Pad im Hochformat müsste eine
   Positionstabelle mit Artikel, Formel, Bedingung und Preis seitlich scrollen —
   und dann sieht man beim Vergleichen nie beide Spalten gleichzeitig.
   ========================================================================== */

/* --- Kachelübersicht der Baugruppen --- */
.bg-kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px; margin-bottom: 22px; }
.bg-kachel { display: block; background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; padding: 16px 18px; box-shadow: var(--shadow); color: inherit; }
.bg-kachel:hover { text-decoration: none; border-color: var(--brand); }
.bg-kachel.inaktiv { opacity: .6; }
.bg-kachel-kopf { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 6px; font-size: 16px; }
.bg-kachel p { margin: 8px 0 0; }
.bg-kachel-fuss { display: flex; gap: 14px; margin-top: 12px; padding-top: 10px;
  border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

/* --- Positions- und Parameterkarten --- */
.pos-liste { display: grid; gap: 12px; }
.pos-karte { background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; }
.pos-kopf { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.pos-bez { font-weight: 600; }
.pos-menge { display: inline-block; min-width: 78px; font-weight: 800;
  color: var(--brand-dk); }
.pos-formel { font-size: 14px; color: var(--ink); background: #fbf0d9;
  border-radius: 8px; padding: 6px 10px; display: inline-block; }
.pos-grund { font-size: 13px; margin-top: 6px; line-height: 1.5; }
.pos-preis { font-size: 14px; margin-top: 4px; }
.pos-aktionen { display: flex; gap: 10px; align-items: flex-start; margin-top: 10px;
  flex-wrap: wrap; }
.pos-aktionen details summary { list-style: none; display: inline-flex; }
.pos-aktionen details summary::-webkit-details-marker { display: none; }

/* --- Bedingungen als Chips --- */
.pos-bed { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.bed-chip { display: inline-flex; align-items: center; gap: 6px; background: #e7f0f7;
  border: 1px solid #c5dced; color: #17435f; border-radius: 20px;
  padding: 5px 6px 5px 12px; font-size: 13px; font-weight: 600; }
.bed-x { border: 0; background: transparent; color: #17435f; cursor: pointer;
  font-size: 17px; line-height: 1; padding: 2px 6px; border-radius: 50%; }
.bed-x:hover { background: #c5dced; }
.bed-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.bed-form select, .bed-form input { width: auto; min-width: 120px; }

/* --- Summenzeile --- */
.pos-summe { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 16px;
  padding: 14px 16px; background: #fbf0d9; border-radius: 12px; font-size: 16px; }
.pos-summe strong { font-size: 19px; color: var(--brand-dk); }

/* --- Artikelsuche mit antippbaren Treffern --- */
.treffer { display: grid; gap: 6px; margin-top: 8px; }
.treffer-zeile { display: block; width: 100%; text-align: left; background: #fff;
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
  font: inherit; cursor: pointer; }
.treffer-zeile:hover, .treffer-zeile:active { background: #fbf0d9; border-color: var(--brand); }

@media (pointer: coarse) {
  .pos-karte { padding: 16px 18px; }
  .pos-menge { min-width: 92px; font-size: 17px; }
  .pos-formel { font-size: 15px; padding: 8px 12px; }
  .bed-chip { font-size: 15px; padding: 8px 8px 8px 14px; min-height: 44px; }
  .bed-x { font-size: 20px; min-width: 32px; min-height: 32px; }
  .treffer-zeile { padding: 14px 16px; min-height: 52px; }
  .bed-form select, .bed-form input { min-width: 140px; }
  .pos-summe strong { font-size: 21px; }
}

/* Abgewählte Positionen bleiben sichtbar, treten aber zurück --
   sonst rätselt man später, warum eine Position im Angebot fehlt. */
.pos-karte.abgewaehlt { opacity: .55; background: #f6f7f9; }
.pos-karte.abgewaehlt .pos-menge, .pos-karte.abgewaehlt .pos-bez { text-decoration: line-through; }

/* Werte, die nur fuer eine Unterbaugruppe gelten. Optisch abgesetzt, weil sie erklaeren,
   warum zwei gleiche Baugruppen unterschiedliche Teile liefern. */
.pos-werte { margin-top: 6px; font-size: 14px; color: #35506b; }
.pos-werte .badge { margin-right: 6px; }

/* ---------------------------------------------------------------- Mengenliste
   Eine Zeile im Formular, die Auswahl steckt im Popup. Rene arbeitet auf dem Pad --
   die Tap-Ziele im Dialog sind deshalb bewusst gross. */
.feld-breit { grid-column: 1 / -1; }
.ml-zeile { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ml-text { flex: 1 1 auto; min-width: 0; padding: 8px 10px; border: 1px solid #d5dde5;
           border-radius: 6px; background: #f7fafc; }
.ml-text.ml-leer { color: #8a9099; font-style: italic; }

.ml-dialog { border: none; border-radius: 12px; padding: 0; max-width: 560px; width: 92vw;
             box-shadow: 0 18px 48px rgba(0,0,0,.28); }
.ml-dialog::backdrop { background: rgba(20,30,40,.45); }
.ml-dialog form { padding: 20px; }
.ml-dialog h3 { margin: 0 0 4px; }
.ml-stand { margin: 0 0 14px; font-weight: 600; }
.ml-stand.ml-ok { color: #1d7a44; }
.ml-stand.ml-warn { color: #a8620a; }

.ml-liste { display: flex; flex-direction: column; gap: 6px; max-height: 58vh;
            overflow-y: auto; }
.ml-eintrag { display: flex; align-items: center; gap: 12px; padding: 8px 4px;
              border-bottom: 1px solid #eef2f5; }
.ml-name { flex: 1 1 auto; min-width: 0; line-height: 1.35; }
.ml-name .muted { display: block; font-size: 13px; }
.ml-menge { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.ml-schritt { width: 40px; height: 40px; font-size: 22px; line-height: 1; border-radius: 8px;
              border: 1px solid #c9d4de; background: #fff; cursor: pointer; }
.ml-schritt:active { background: #e8eff5; }
.ml-zahl { width: 58px; text-align: center; }
.ml-fuss { margin-top: 16px; display: flex; justify-content: flex-end; }

/* Abschnitte im Formular -- ohne sie stehen bei der Bierleitung zwanzig Felder untereinander */
.feld-gruppe { border: 1px solid #e3e9ee; border-radius: 10px; margin-bottom: 10px;
               background: #fcfdfe; }
.feld-gruppe > summary { padding: 12px 14px; font-weight: 600; cursor: pointer; }
.feld-gruppe[open] > summary { border-bottom: 1px solid #e3e9ee; }
.feld-gruppe > .grid2 { padding: 14px; }
.feld-hinweis { margin-top: 4px; line-height: 1.35; }

@media (pointer: coarse) {
  .ml-schritt { width: 48px; height: 48px; font-size: 26px; }
  .ml-zahl { width: 66px; min-height: 48px; font-size: 17px; }
  .ml-eintrag { padding: 12px 4px; }
  .feld-gruppe > summary { padding: 16px 14px; min-height: 48px; }
}

/* Einklappbare Panel-Ueberschriften. Die <h2> steckt im <summary>, damit die ganze Zeile
   antippbar ist -- auf dem Pad trifft man ein Dreieck von 12 px sonst nicht. */
.panel > details > summary { cursor: pointer; list-style: none; }
.panel > details > summary::-webkit-details-marker { display: none; }
.panel > details > summary h2 { display: inline-block; margin: 0; }
.panel > details > summary::before { content: ▸; display: inline-block; width: 1.2em;
                                     color: #7b8794; transition: transform .12s; }
.panel > details[open] > summary::before { transform: rotate(90deg); }
.panel > details > summary:hover h2 { color: #1f6feb; }

/* Dasselbe fuer die Baugruppen-Karten im Projekt */
.pos-karte > details > summary { cursor: pointer; list-style: none; }
.pos-karte > details > summary::-webkit-details-marker { display: none; }
.pos-karte > details > summary::before { content: ▸; display: inline-block; width: 1.2em;
                                         color: #7b8794; transition: transform .12s; }
.pos-karte > details[open] > summary::before { transform: rotate(90deg); }

@media (pointer: coarse) {
  .panel > details > summary,
  .pos-karte > details > summary { min-height: 48px; display: flex; align-items: center;
                                   gap: 6px; }
}
.ml-dialog .ml-inhalt { padding: 20px; }
.ml-fuss { gap: 10px; }

/* ------------------------------------------------------ Warnungen als Popup
   Nach dem Berechnen springt der Blick auf die Teileliste; eine Meldung ganz oben wird
   uebersehen. Deshalb modal mit Bestaetigung -- aber ohne Escape-Sperre, wer sie schon
   gelesen hat, soll schnell weiterkommen. */
.hinweis-dialog { border: none; border-radius: 12px; padding: 0; max-width: 640px; width: 92vw;
                  box-shadow: 0 18px 48px rgba(0,0,0,.28); }
.hinweis-dialog::backdrop { background: rgba(20,30,40,.45); }
.hinweis-inhalt { padding: 22px 24px 18px; }
.hinweis-inhalt h3 { margin: 0 0 14px; }
.hinweis-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column;
                 gap: 10px; max-height: 60vh; overflow-y: auto; }
.hinweis-liste .hinweis { padding: 12px 14px; border-radius: 8px; line-height: 1.45;
                          border-left: 4px solid #d99a2b; background: #fdf6e8; }
.hinweis-liste .hinweis.err { border-left-color: #c0392b; background: #fdecea; }
.hinweis-fuss { margin-top: 18px; display: flex; justify-content: flex-end; }

@media (pointer: coarse) {
  .hinweis-liste .hinweis { padding: 14px; font-size: 16px; }
  .hinweis-fuss .btn { min-height: 48px; padding-left: 26px; padding-right: 26px; }
}

/* --------------------------------------------------- Angebotsübergabe an SAS
   Steht direkt bei den Summen: sobald die Zahlen stimmen, ist das Angebot der naechste
   Schritt -- nicht irgendwo weiter unten. */
.angebot-leiste { display: flex; align-items: center; justify-content: space-between;
                  gap: 14px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px;
                  border-top: 1px solid #e3e9ee; }
.angebot-kunde { flex: 1 1 auto; min-width: 0; }
.angebot-knoepfe { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.angebot-knoepfe > details { position: relative; }
.kunde-suche { position: absolute; z-index: 30; right: 0; top: 100%; margin-top: 6px;
               width: min(420px, 88vw); padding: 12px; border: 1px solid #d5dde5;
               border-radius: 10px; background: #fff;
               box-shadow: 0 12px 32px rgba(0,0,0,.16); }
.kunde-suche .treffer { margin-top: 8px; max-height: 42vh; overflow-y: auto; }

@media (pointer: coarse) {
  .angebot-knoepfe .btn { min-height: 48px; }
  .kunde-suche { width: min(420px, 92vw); }
}

/* Link zur Nachbaranwendung SAS. Abgesetzt, damit man sieht: hier verlaesst man Material. */
.nav-extern { border: 1px solid rgba(120,190,255,.35); color: #8fc7f5 !important; }
.nav-extern:hover { background: rgba(120,190,255,.12) !important; }
