/* Farben wie die Desktop-Version (ui/farben.py) */
:root {
  --hintergrund: #f0f2f5; --karte: #ffffff; --rand: #dddfe2; --text: #1c1e21;
  --gedaempft: #65676b; --primaer: #1877f2; --primaer-dunkel: #166fe5; --weiss: #ffffff;
  --erfolg: #42b72a; --erfolg-dunkel: #36a420; --gefahr: #e41e3f; --leer: #e4e6eb;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--hintergrund); color: var(--text);
  font: 15px/1.45 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; }
.seite { max-width: 860px; margin: 0 auto; padding: 20px 16px 40px; }
.kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
h1 { color: var(--primaer); font-size: 26px; margin: 0; }
.unter { color: var(--gedaempft); margin: 4px 0 16px; }
.zeile { display: flex; gap: 8px; }
input[type=text], input[type=password], input[type=url], textarea {
  font: inherit; border: 1px solid var(--rand); border-radius: 6px; background: var(--karte);
  padding: 10px 12px; color: var(--text); min-width: 0; }
.zeile input { flex: 1; font-size: 17px; }
input:focus, textarea:focus { outline: 2px solid var(--primaer); border-color: var(--primaer); }
button, .knopf { font: inherit; border: 1px solid var(--rand); background: var(--karte); color: var(--text);
  border-radius: 6px; padding: 8px 14px; cursor: pointer; text-decoration: none; display: inline-flex;
  align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
button:hover, .knopf:hover { background: var(--hintergrund); }
button:disabled { opacity: .55; cursor: default; }
.primaer { background: var(--primaer); border-color: var(--primaer); color: var(--weiss); font-weight: 600; padding: 10px 18px; }
.primaer:hover { background: var(--primaer-dunkel); }
.laden { background: var(--erfolg); border-color: var(--erfolg); color: var(--weiss); font-weight: 600; padding: 10px 16px; }
.laden:hover { background: var(--erfolg-dunkel); }
.link { color: var(--primaer); cursor: pointer; display: inline-block; margin: 8px 0 14px; background: none; border: 0; padding: 0; }
.link:hover { background: none; text-decoration: underline; }
.karte { background: var(--karte); border: 1px solid var(--rand); border-radius: 8px; padding: 16px;
  display: flex; gap: 16px; min-height: 212px; }
.vorschau { width: 320px; height: 180px; flex: none; background: var(--leer); border-radius: 4px;
  object-fit: contain; }
.inhalt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.titel { font-weight: 600; overflow-wrap: anywhere; }
.details { color: var(--gedaempft); margin-top: 6px; font-size: 14px; }
.knoepfe { margin-top: auto; padding-top: 12px; display: grid; grid-template-columns: auto auto auto;
  gap: 6px 8px; justify-content: start; }
.status { color: var(--gedaempft); margin-top: 10px; min-height: 1.4em; }
.status.fehler { color: var(--gefahr); }
.status.ok { color: var(--erfolg-dunkel); }
.balken { height: 6px; border-radius: 3px; background: var(--leer); overflow: hidden; margin-top: 14px; visibility: hidden; }
.balken.an { visibility: visible; }
.balken span { display: block; height: 100%; width: 30%; background: var(--primaer); animation: lauf 1.1s infinite ease-in-out; }
@keyframes lauf { from { margin-left: -30%; } to { margin-left: 100%; } }
.unten { margin-top: 22px; display: flex; justify-content: space-between; color: var(--gedaempft); font-size: 13px; }
/* Dialoge */
.schleier { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); display: none; align-items: center;
  justify-content: center; padding: 16px; z-index: 10; }
.schleier.offen { display: flex; }
.dialog { background: var(--karte); border-radius: 8px; width: 100%; max-width: 720px; max-height: 90vh;
  display: flex; flex-direction: column; padding: 16px; gap: 10px; }
.dialog h2 { margin: 0; font-size: 18px; color: var(--primaer); }
.dialog textarea { flex: 1; min-height: 240px; font: 12px Consolas, monospace; }
.dialog .rechts { display: flex; justify-content: flex-end; gap: 8px; }
.hilfetext { overflow: auto; white-space: pre-wrap; }
.hilfetext h3 { color: var(--primaer); font-size: 15px; margin: 4px 0 6px; white-space: normal; }
/* Anmeldung */
.anmeldung { max-width: 340px; margin: 14vh auto 0; background: var(--karte); border: 1px solid var(--rand);
  border-radius: 8px; padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.anmeldung h1 { font-size: 20px; color: var(--text); }
@media (max-width: 640px) {
  h1 { font-size: 21px; }
  .zeile { flex-wrap: wrap; }
  .zeile input { flex-basis: 100%; }
  .zeile button { flex: 1; }
  .karte { flex-direction: column; }
  .vorschau { width: 100%; height: auto; max-height: 260px; aspect-ratio: 16 / 9; }
  .knoepfe { grid-template-columns: 1fr auto auto; }
  .knoepfe .laden, .knoepfe .primaer { width: 100%; }
}
/* Archiv */
.archiv { margin-top: 26px; }
.archivkopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.archivkopf h2 { margin: 0; font-size: 18px; }
.archivkopf h2 span { color: var(--gedaempft); font-weight: 400; font-size: 14px; }
.archivkopf input { width: 240px; padding: 7px 10px; }
.kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.kachel { position: relative; background: var(--karte); border: 1px solid var(--rand); border-radius: 8px;
  overflow: hidden; cursor: pointer; display: flex; flex-direction: column; transition: box-shadow .15s; }
.kachel:hover { box-shadow: 0 2px 10px rgba(0, 0, 0, .12); }
.kachel .mini { width: 100%; aspect-ratio: 16 / 9; background: var(--leer); object-fit: contain; display: block; }
.kachel .dauer { position: absolute; top: 6px; left: 6px; background: rgba(0, 0, 0, .7); color: var(--weiss);
  font-size: 12px; padding: 1px 6px; border-radius: 4px; }
.kachel .weg { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; padding: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .9); font-size: 13px; opacity: 0; transition: opacity .15s; }
.kachel:hover .weg { opacity: 1; }
.kachel .text { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 4px; }
.kachel .ktitel { font-size: 13px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; }
.kachel .kinfo { font-size: 12px; color: var(--gedaempft); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.marke { background: var(--erfolg); color: var(--weiss); border-radius: 4px; padding: 0 5px; font-size: 11px; font-weight: 600; }
.marke.privat { background: var(--gedaempft); }
.archivleer { color: var(--gedaempft); padding: 18px 0; display: none; }
.archivleer.an { display: block; }
@media (max-width: 640px) {
  .archivkopf { flex-wrap: wrap; }
  .archivkopf input { width: 100%; }
  .kacheln { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kachel .weg { opacity: 1; }
}
.knoepfe .abspielen { padding: 8px 12px; }
.balken.fest span { animation: none; margin-left: 0; width: 0; transition: width .4s; }
/* Inkognito */
.kopfknoepfe { display: flex; gap: 8px; }
.inkognitoleiste { display: none; background: var(--text); color: var(--weiss); text-align: center;
  padding: 8px 16px; font-size: 14px; }
body.inkognito .inkognitoleiste { display: block; }
body.inkognito .archiv { display: none; }
body.inkognito #inkognitoKnopf { background: var(--text); color: var(--weiss); border-color: var(--text); }
