/* =========================================================================
   AUFMASS (seit 2.2.0)
   Alles Übrige kommt aus wissen/assets/style.css und
   projekte3/assets/style.css - die Karten sollen genau so aussehen wie bei
   den Projekten. Hier steht nur, was das Aufmaß anders macht.
   ========================================================================= */

/* --- Gelb: markiert, also neu und noch nicht bearbeitet ---
   Ein kräftiges Gelb hebt sich auf Weiß kaum ab; der Rahmen ist deshalb
   ein dunkleres Goldgelb und eine Spur breiter als der schwarze der
   übrigen Karten - auf dem Handy in der Sonne muss man ihn sehen. */
:root {
  --am-gelb: #f5c400;
  --am-gelb-rahmen: #e0ac00;
}

.wi-kachel.p3-kachel.am-kachel.ist-markiert,
.wi-kachel.p3-kachel.am-kachel.ist-markiert:hover {
  border-width: 3px;
  border-color: var(--am-gelb-rahmen);
}

/* Eine Kategorie, in der noch markierte Aufmaße liegen - wie "Rechnung
   offen" bei den Projekten, nur gelb statt rot. */
.wi-kachel.p3-kategorie.am-hat-markierte,
.wi-kachel.p3-kategorie.am-hat-markierte:hover {
  border-width: 3px;
  border-color: var(--am-gelb-rahmen);
}
.wi-kachel.am-hat-markierte .wi-kachel-seiten {
  background: var(--am-gelb);
  color: #23201d;
}

/* Der Stern VOR dem Kundennamen, in "em" bemessen wie das Notizzeichen
   der Projekte (.p3-notiz-zeichen): Er schrumpft mit, wenn
   assets/kachelschrift.js einen langen Namen verkleinert, und der Name
   gerät nie davor oder dahinter. */
.am-stern {
  display: inline-block;
  width: 1.2em;
  height: 1.2em;
  margin-right: 0.28em;
  vertical-align: -0.22em;
  line-height: 0;
}
.am-stern svg { display: block; width: 100%; height: 100%; }

/* --- Das geöffnete Aufmaß --- */
.am-markierung { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.am-markierung .am-stand { margin: 0; flex: 1 1 260px; color: #4a443d; }
.am-bearbeitet-btn { min-height: 48px; padding: 0 22px; }

/* Das große Textfeld. Viele Zeilen von Anfang an, und es wächst mit dem
   Text (amTextHoehe in app.js): Gescrollt wird die Seite, nicht ein
   kleines Fenster im Fenster. "resize: vertical", falls jemand es am
   Schreibtisch noch größer ziehen will. */
.am-text {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: max(60vh, 30em);
  padding: 12px 14px;
  border: 1px solid #c9c0b4;
  border-radius: 10px;
  background: #fffdf9;
  color: #23201d;
  font: inherit;
  font-size: 1.05rem;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  resize: vertical;
  overflow: hidden;
  tab-size: 4;
}
.am-text:focus { outline: 2px solid #2f6b43; outline-offset: 1px; border-color: #2f6b43; }
.am-text[readonly] { background: #f7f4ef; }

.am-text-fuss {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  margin-top: 6px;
  font-size: 0.85rem;
  color: #6b645d;
}
.am-speicherstand.ist-ok { color: #2f6b43; }
.am-speicherstand.ist-fehler { color: #b5342c; font-weight: 700; }
.am-zaehler.ist-knapp { color: #b5342c; font-weight: 700; }

.am-konflikt {
  margin-top: 12px;
  padding: 12px 14px;
  border: 2px solid #b5342c;
  border-radius: 10px;
  background: #fdf1ef;
}
.am-konflikt[hidden] { display: none; }

/* Seit 576: sichtbarer Speichern-Knopf, Entwurf auf dem Gerät, Snapshots */
.am-speichern-knopf { margin-top: 10px; min-height: 48px; width: 100%; font-weight: 700; }
.am-speichern-knopf[hidden] { display: none; }
.am-speicherstand.ist-fehler { display: block; padding: 8px 10px; border-radius: 8px; background: #fbecea; }
.am-entwurf {
  margin-top: 12px; padding: 12px; border-radius: 10px;
  border: 1.5px solid #d6b25e; background: #fdf6e3;
}
.am-entwurf[hidden] { display: none; }
.am-entwurf p { margin: 0 0 8px; }
.am-snapshot-liste { display: flex; flex-direction: column; gap: 8px; }
.am-snapshot {
  display: flex; flex-direction: column; gap: 2px; text-align: left; cursor: pointer;
  padding: 10px 12px; border-radius: 10px; border: 1px solid #d8d2c8; background: #fff; font: inherit;
}
.am-snapshot:hover { border-color: #2f6b43; }
.am-snapshot-kopf { font-weight: 700; }
.am-snapshot-info { font-size: 0.85rem; color: #6b645d; }
.am-snapshot-anfang { font-size: 0.85rem; color: #3b3631; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.am-snapshot-fenster { width: min(720px, 100%); }
.am-snapshot-text {
  flex: 1 1 auto;
  min-height: 30vh;
  max-height: 55vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 12px 14px;
  border: 1px solid #c9c0b4;
  border-radius: 10px;
  background: #f6f3ee;
  font-size: 1.05rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  tab-size: 4;
}
.am-snapshot-umfang { margin: -6px 0 0; font-size: 0.85rem; }
.am-konflikt p { margin: 0 0 8px; }
.am-konflikt-knoepfe { display: flex; flex-wrap: wrap; gap: 10px; }

.am-leer { max-width: 560px; margin: 24px auto; text-align: center; }

/* Mit-Anlegen im Fenster "Neues Aufmaß" (seit 578) */
.am-neu-mit { display: flex; flex-direction: column; gap: 6px; }
.am-neu-mit > span { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: #6b645d; }
.am-mit-knopf {
  min-height: 44px; padding: 8px 12px; text-align: left; font: inherit; cursor: pointer;
  border: 1.5px solid #c9c0b4; border-radius: 10px; background: #fff; color: #23201d;
}
.am-mit-knopf[aria-pressed="true"] { border-color: #2f6b43; background: #e8f2eb; color: #1f4d2f; font-weight: 700; }
.am-mit-knopf[aria-pressed="true"]::after { content: "  ✓"; }
.am-auch-knoepfe { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.am-auch .dublette-box { margin-bottom: 8px; }
.am-mit-offen { display: block; text-decoration: none; border-color: #2f6b43; background: #e8f2eb; color: #1f4d2f; font-weight: 700; }
