/* Die nachgebauten Elemente in den Abschnitten der Startseite. Aufbau: werkzeuge/abschnitte.py, Verhalten: elemente.js.
   Nur was in BetterShelf ein Flyout ist, trägt die Flyout-Fläche (.fly); Farben, Dateien und Papier liegen frei. */

/* ---- Zwischenablage: Streifen mit großen Karten, darunter ein Blatt zum Einfügen ---- */
.kop { position: relative; width: 100%; justify-self: stretch; }
.ab > .ding.kop { justify-self: stretch; }
.streifen { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; border-radius: 10px; background: #202020; box-shadow: 0 16px 48px rgba(0, 0, 0, .45); }
.suchfeld { display: flex; align-items: center; gap: 8px; flex: 0 0 220px; height: 40px; padding: 0 10px; border-radius: 6px; background: var(--zone); color: var(--w2); }
.suchfeld input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: 0; font-size: 13px; color: var(--w); }
.suchfeld:focus-within { box-shadow: inset 0 -2px 0 var(--akzent); }
.suchfeld input::-webkit-search-cancel-button { display: none; }
.karten.gross { flex-wrap: wrap; overflow: visible; flex: 1 1 320px; }
.gross .clip { height: 40px; width: 236px; font-size: 13px; flex: 1 1 200px; max-width: 320px; }
.nichts { margin: 0; align-self: center; padding: 0 8px; color: var(--w2); font-size: 13px; }
.vorschau { position: absolute; z-index: 4; width: 280px; padding: 10px; display: grid; gap: 4px; pointer-events: none; }
.vbild { height: 120px; border-radius: 4px; margin-bottom: 6px; background: linear-gradient(160deg, #1C63DB, #122F66); position: relative; overflow: hidden; }
.vbild::before { content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 22px; border-radius: 4px 4px 0 0; background: #202020; }
.vbild::after { content: ""; position: absolute; left: 14px; top: 16px; width: 46%; height: 34px; border-radius: 3px; background: linear-gradient(#fff 0 10px, transparent 10px 16px, rgba(255, 255, 255, .6) 16px 20px, transparent 20px 25px, rgba(255, 255, 255, .6) 25px 29px, transparent 29px); }
.vorschau p { margin: 0; color: var(--w2); font-size: 12px; }
.vorschau code { font: 11px var(--mono); color: var(--w3); }
.blatt {
  margin: 36px 0 0 auto; width: min(100%, 620px); min-height: 250px; padding: 30px 36px 34px; border-radius: 3px; background: #fff; color: #111A2B;
  font-size: 15px; line-height: 1.55; box-shadow: 0 18px 50px rgba(8, 16, 34, .5); rotate: 1deg; user-select: text;
}
.blatt > b { display: block; font: 600 20px var(--display); margin-bottom: 14px; }
.blatt p { margin: 0 0 10px; overflow-wrap: anywhere; }
.blatt .leer { color: #8892A4; }
.blatt .leer::before { content: ""; display: inline-block; width: 1.5px; height: 1.1em; margin-right: 6px; vertical-align: -3px; background: #1F6FEB; }
.blatt .bildchen { display: block; width: 180px; height: 90px; border-radius: 4px; margin-bottom: 10px; background: linear-gradient(135deg, #EEF2F7 0 55%, #B9CDF2 55% 80%, #1F6FEB 80%); }
@media (prefers-reduced-motion: no-preference) {
  .blatt .leer::before, .tippt::after { animation: blink 1.1s steps(1) infinite; }
  @keyframes blink { 50% { opacity: 0; } }
  .blatt p.neu { animation: reinfall .35s ease-out; }
  @keyframes reinfall { from { background: #FFD600; } to { background: transparent; } }
}

/* ---- Notizen ---- */
.notiz, .baust { width: min(100%, 400px); }
.notiz.fest { border-color: var(--akzent); }
.notiz-inhalt { min-height: 236px; padding: 14px 4px 10px; display: grid; gap: 7px; align-content: start; }
.notiz-inhalt h3 { margin: 0 0 2px; font: 600 17px var(--display); }
.notiz-inhalt p { margin: 0; }
.notiz-inhalt .pkt { padding-left: 26px; position: relative; }
.notiz-inhalt .pkt::before { content: ""; position: absolute; left: 6px; top: .55em; width: 5px; height: 5px; border-radius: 50%; background: var(--w2); }
.haken { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.haken input {
  appearance: none; flex: none; width: 16px; height: 16px; margin: 1px 0 0; border: 1.5px solid var(--w3); border-radius: 4px; cursor: pointer;
}
.haken input:checked {
  border-color: var(--akzent);
  background: var(--akzent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.4l3 3 6-6.6' fill='none' stroke='%23fff' stroke-width='2'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.haken input:checked + span { color: var(--w3); text-decoration: line-through; }
.tippt::after { content: ""; display: inline-block; width: 1.5px; height: 1em; margin-left: 2px; vertical-align: -2px; background: #fff; }
.notiz-eingabe { width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--strich); border-radius: 6px; background: rgba(255, 255, 255, .06); font-size: 13px; }
.notiz-eingabe:focus, .term:focus-within { outline: 0; border-color: var(--akzent); }
.schirm ::placeholder { color: var(--w3); opacity: 1; }

/* ---- Textbausteine ---- */
.baust-liste { display: grid; gap: 6px; margin-top: 12px; }
.bst { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px 10px; border: 0; border-radius: 6px; background: rgba(255, 255, 255, .053); color: var(--w); text-align: left; font-size: 13px; }
.bst:hover { background: var(--hover); }
.bst span { flex: 1; min-width: 0; white-space: pre-line; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.bst .i { color: var(--w3); }
.bst.blitz { background: var(--akzent); }
.bst.blitz .i { color: #fff; }

/* ---- Terminal ---- */
.term { width: min(100%, 940px); border: 1px solid var(--strich); border-radius: 8px; background: #161616; color: #D6D6D6; box-shadow: 0 24px 70px rgba(0, 0, 0, .6); overflow: hidden; }
.ab > .ding.term { justify-self: start; }
.griff { height: 12px; display: grid; place-items: center; background: #1D1D1D; }
.griff::before { content: ""; width: 44px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .22); }
.term .tabs { padding: 0 8px 6px; background: #1D1D1D; }
.term-aus { height: 268px; overflow-y: auto; padding: 12px 16px 2px; font: 13px/20px var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; scrollbar-width: thin; scrollbar-color: #444 transparent; user-select: text; }
.term-aus .p, .prompt { color: #7FAAF5; }
.term-aus .gr { color: #4ADE80; } .term-aus .ge { color: #FFD600; } .term-aus .ro { color: #F87171; } .term-aus .le { color: #8A8A8A; }
.term-zeile { display: flex; gap: 8px; padding: 0 16px 14px; font: 13px/20px var(--mono); cursor: text; }
.prompt { flex: none; white-space: pre; max-width: 60%; overflow: hidden; text-overflow: ellipsis; }
.term-zeile input { flex: 1; min-width: 0; padding: 0; border: 0; outline: 0; background: none; font: inherit; color: #fff; caret-color: #fff; }

/* ---- Screenshot-Editor ---- */
.shot { width: min(100%, 604px); padding: 12px; }
.werkzeuge { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; margin-bottom: 10px; }
.trenn { width: 1px; height: 20px; margin: 0 8px; background: rgba(255, 255, 255, .14); }
.punkt { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: none; display: grid; place-items: center; }
.punkt::before { content: ""; width: 18px; height: 18px; border-radius: 50%; background: var(--f, #888); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3); }
.punkt[aria-pressed="true"]::before { box-shadow: 0 0 0 2px #2A2A2A, 0 0 0 4px #fff; }
.buehne { display: block; width: 100%; height: auto; border-radius: 6px; cursor: crosshair; touch-action: none; user-select: none; font-family: var(--fliess); }
.knoepfe { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.status { margin-left: auto; color: var(--w2); font-size: 12px; }
.ocr { margin-top: 12px; padding: 12px; border-radius: 6px; background: rgba(0, 0, 0, .32); }
.ocr pre { margin: 6px 0 10px; font: 12px/1.5 var(--mono); white-space: pre-wrap; color: var(--w2); user-select: text; }

/* ---- Farbwähler: Farben liegen frei, die Lupe folgt dem Zeiger ---- */
.farbfeld { position: relative; width: min(100%, 540px); aspect-ratio: 13 / 9; touch-action: pan-y; }
@media (hover: hover) { .farbfeld { cursor: crosshair; } }
.scheibe { position: absolute; aspect-ratio: 1; border-radius: 50%; box-shadow: 0 14px 34px rgba(8, 16, 34, .38); }
.s0 { left: 3%; top: 8%; width: 34%; background: #1F6FEB; }
.s1 { left: 29%; top: 40%; width: 26%; background: #7FAAF5; }
.s2 { left: 50%; top: 2%; width: 30%; background: #FFD600; }
.s3 { left: 70%; top: 46%; width: 25%; background: #22C55E; }
.s4 { left: 8%; top: 60%; width: 21%; background: #EC4899; }
.s5 { left: 45%; top: 68%; width: 17%; background: #F59E0B; }
.s6 { left: 83%; top: 16%; width: 15%; background: #7C3AED; }
.s7 { left: 61%; top: 44%; width: 11%; background: #FFFFFF; }
.lupe { position: absolute; left: 0; top: 0; z-index: 3; display: grid; justify-items: center; gap: 6px; pointer-events: none; }
.lupe canvas { width: 92px; height: 92px; border-radius: 50%; border: 3px solid #fff; background: #122F66; image-rendering: pixelated; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }
.lupe::before { content: ""; position: absolute; left: 50%; top: 49px; width: 10px; height: 10px; margin: -6px 0 0 -6px; border: 1px solid #fff; outline: 1px solid #111; z-index: 1; }
.lupe output { padding: 3px 9px; border-radius: 6px; background: #202020; font: 12px var(--mono); color: #fff; }

/* ---- Ablage: Dateien zum Ziehen ---- */
.ablage-feld { min-height: 250px; display: grid; justify-items: center; align-content: center; gap: 30px; }
.dateien { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 34px; }
.datei { display: grid; justify-items: center; gap: 10px; width: 116px; padding: 0; border: 0; background: none; color: #fff; font-size: 13px; cursor: grab; touch-action: none; position: relative; }
.datei svg { width: 84px; height: auto; filter: drop-shadow(0 12px 22px rgba(8, 16, 34, .5)); }
.datei span { max-width: 100%; padding: 1px 6px; border-radius: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.datei:hover span { background: rgba(255, 255, 255, .18); }
.d0 { rotate: -6deg; } .d1 { rotate: 4deg; margin-top: 22px; } .d2 { rotate: -2deg; }
.datei.zieht { z-index: 70; cursor: grabbing; }
.datei.fort { visibility: hidden; }
@media (prefers-reduced-motion: no-preference) { .datei:not(.zieht) { transition: translate .25s, scale .25s, opacity .2s; } .datei.fliegt { scale: .2; opacity: 0; } }

/* ---- Fensterlayouts ---- */
.lay { width: min(100%, 380px); display: grid; gap: 4px; }
.karte { position: relative; height: 156px; margin-bottom: 8px; border-radius: 6px; background: rgba(0, 0, 0, .28); }
.mon { position: absolute; border: 1px solid rgba(255, 255, 255, .25); border-bottom: 3px solid var(--akzent); border-radius: 3px; background: #151a22; overflow: hidden; transition: left .4s cubic-bezier(.3, .7, .2, 1); }
.m0 { left: 5%; top: 30%; width: 25%; height: 44%; }
.m1 { left: 33%; top: 20%; width: 34%; height: 58%; }
.m2 { left: 70%; top: 30%; width: 25%; height: 44%; }
.getauscht .m1 { left: 61%; } .getauscht .m2 { left: 33%; }
.mon b { position: absolute; right: 5px; bottom: 2px; font: 600 11px var(--fliess); color: var(--w3); }
.fen { position: absolute; border-radius: 2px; transition: all .4s cubic-bezier(.3, .7, .2, 1); }
.fen.a { left: 8%; top: 10%; width: 56%; height: 52%; background: #3B82F6; }
.fen.b { left: 34%; top: 34%; width: 56%; height: 52%; background: #E8A33D; }
.m1 .fen.a { left: 26%; top: 22%; } .m1 .fen.b { left: 12%; top: 38%; width: 44%; }
.m2 .fen.a { left: 30%; top: 8%; width: 60%; } .m2 .fen.b { left: 6%; top: 40%; }
.l0 .fen.a, .l1 .fen.a { left: 4%; top: 7%; height: 84%; }
.l0 .fen.b, .l1 .fen.b { top: 7%; height: 84%; }
.l0 .fen.a { width: 44.5%; } .l0 .fen.b { left: 51.5%; width: 44.5%; }
.l1 .fen.a { width: 62%; } .l1 .fen.b { left: 69%; width: 27%; }
.l1 .m2 .fen.a { left: 4%; top: 7%; width: 92%; height: 40%; } .l1 .m2 .fen.b { left: 4%; top: 53%; width: 92%; height: 38%; }
@media (prefers-reduced-motion: reduce) { .mon, .fen { transition: none; } }
.zeile { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px; border: 0; border-radius: 6px; background: none; color: var(--w); text-align: left; font-size: 13px; }
.zeile:hover { background: var(--hover); }
.zeile[aria-pressed="true"] { background: var(--gewaehlt); }
.zeile span { display: grid; }
.zeile b { font-weight: 600; }
.zeile small { font-size: 12px; color: var(--w2); }
.lay > .kn { justify-self: start; margin-top: 8px; }

/* ---- Taskleiste: Schalter für den Bearbeiten-Modus ---- */
.schalterzeile { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 22px; margin-top: 30px; }
.schalter { display: inline-flex; align-items: center; gap: 14px; padding: 6px 0; border: 0; background: none; color: #fff; font: 600 19px var(--display); }
.bahn { position: relative; width: 52px; height: 28px; border-radius: 14px; border: 1.5px solid rgba(255, 255, 255, .75); flex: none; }
.knubbel { position: absolute; left: 4px; top: 4px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: translate .18s; }
.schalter[aria-checked="true"] .bahn { background: #fff; border-color: #fff; }
.schalter[aria-checked="true"] .knubbel { translate: 24px 0; background: #1F6FEB; }
.schalterzeile .kuerzel { margin: 0; }

/* ---- Schnellstart ---- */
.raster { width: max-content; max-width: 100%; }
.kacheln { display: grid; grid-template-columns: repeat(4, minmax(0, 96px)); gap: 6px; margin-bottom: 12px; }
.kachel { display: grid; justify-items: center; align-content: center; gap: 8px; height: 86px; padding: 0 4px; border: 0; border-radius: 6px; background: none; color: var(--w); font-size: 11px; line-height: 1.2; text-align: center; }
.kachel:hover { background: var(--hover); }
.kachel.start { background: var(--gewaehlt); }
.kq { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; color: #fff; }
.kq .i { width: 18px; height: 18px; }
.k0 { background: #E8A33D; } .k1 { background: #3B82F6; } .k2 { background: #7C3AED; } .k3 { background: #0EA5E9; }
.k4 { background: #22C55E; } .k5 { background: #64748B; } .k6 { background: #EC4899; } .k7 { background: #F59E0B; }
.k8 { background: #475569; } .k9 { background: #0F766E; } .k10 { background: #1F6FEB; } .k11 { background: #DB2777; }
@media (max-width: 480px) {
  .kacheln { grid-template-columns: repeat(3, minmax(0, 96px)); }
  .suchfeld { flex-basis: 100%; }
  .blatt { padding: 22px 20px 26px; rotate: none; }
}

/* ---- Schnellstart bearbeiten: Kacheln aus- und einblenden ---- */
.kachel.aus { display: none; }
.kacheln.edit .kachel { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); }
.kacheln.edit .kachel.aus { display: grid; opacity: .32; }
#start-edit[aria-pressed="true"] { background: var(--akzent); color: #fff; }
