/* ============================================================
   Notizen – Design tokens
   Primary: #2f5c2c (Waldgrün) — Basisfarbe der Anwendung
   ============================================================ */
:root {
  --color-primary: #2f5c2c;
  --color-primary-dark: #21400f;
  --color-primary-dark2: #1d3a1a;
  --color-primary-light: #e9f1e5;
  --color-accent: #8fae5d;
  --color-bg: #f4f6f1;
  --color-surface: #ffffff;
  --color-surface-2: #fbfbf8;
  --color-text: #1d2a1a;
  --color-text-muted: #5f6f5a;
  --color-border: #dde4d6;
  --color-danger: #a8442c;
  --color-danger-bg: #f7e9e5;
  --color-warning: #b3792a;
  --color-warning-bg: #f7eede;
  --color-low: #506273;
  --color-low-bg: #e8ecf1;
  --radius-s: 8px;
  --radius: 14px;
  --radius-l: 20px;
  --shadow-1: 0 1px 2px rgba(29, 42, 26, 0.07);
  --shadow-2: 0 6px 20px rgba(29, 42, 26, 0.10);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --header-h: 60px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
}
button { font-family: inherit; }
.icon { width: 20px; height: 20px; flex: none; display: block; }
.icon-s { width: 16px; height: 16px; }
.icon-l { width: 28px; height: 28px; }

a { color: var(--color-primary); }

/* Scrollbar, subtle */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d3ddc9; border-radius: 8px; }

/* ---------- App shell ---------- */
#app { min-height: 100%; display: flex; flex-direction: column; }
.hidden { display: none !important; }

/* ---------- Login / Setup screen ---------- */
.auth-screen {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(1200px 600px at 20% -10%, #3a6b36 0%, transparent 60%),
    linear-gradient(180deg, var(--color-primary-dark2), var(--color-primary));
  padding: 24px;
}
.auth-card {
  background: var(--color-surface);
  border-radius: var(--radius-l);
  padding: 36px 30px 30px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-2);
  text-align: center;
}
.auth-mark {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px;
  color: #fff;
}
.auth-mark .icon { width: 28px; height: 28px; }
.auth-card h1 { font-size: 20px; margin: 0 0 6px; letter-spacing: -0.01em; }
.auth-card p.sub { color: var(--color-text-muted); font-size: 14px; margin: 0 0 24px; }
.field { text-align: left; margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--color-text-muted); }
.field input[type="password"], .field input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-s);
  font-size: 15px;
  background: var(--color-surface-2);
  color: var(--color-text);
}
.field input:focus, textarea:focus, select:focus, button:focus-visible {
  outline: 2.5px solid var(--color-accent);
  outline-offset: 1px;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: var(--radius-s);
  padding: 12px 18px; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: transform .08s ease, background .15s ease;
  background: var(--color-primary); color: #fff;
}
.btn:active { transform: scale(0.97); }
.btn.block { width: 100%; }
.btn.secondary { background: var(--color-primary-light); color: var(--color-primary-dark); }
.btn.ghost { background: transparent; color: var(--color-text-muted); }
.btn.danger { background: var(--color-danger); color: #fff; }
.btn.icon-only { padding: 10px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.auth-error { color: var(--color-danger); font-size: 13.5px; margin: 4px 0 14px; min-height: 1em; }
.auth-foot { margin-top: 18px; font-size: 12.5px; color: var(--color-text-muted); }

/* ---------- Header ---------- */
.appheader {
  position: sticky; top: 0; z-index: 20;
  height: var(--header-h);
  background: var(--color-primary);
  color: #fff;
  display: flex; align-items: center; gap: 10px;
  padding: 0 12px;
  padding-top: env(safe-area-inset-top);
  box-shadow: var(--shadow-1);
}
.appheader .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.appheader .brand .icon { color: #eaf5e6; }
.appheader .spacer { flex: 1; }
.iconbtn {
  background: rgba(255,255,255,.12); border: none; color: #fff;
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.iconbtn:active { background: rgba(255,255,255,.24); }
.iconbtn.active { background: rgba(255,255,255,.32); }
.status-pill {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600;
  background: rgba(255,255,255,.14);
  border-radius: 20px; padding: 6px 10px 6px 8px;
  white-space: nowrap;
}
.status-pill.offline { background: #c98a4a2e; }
.status-pill .icon { width: 15px; height: 15px; }

/* ---------- Toolbar (search / filters) ---------- */
.toolbar {
  position: sticky; top: var(--header-h); z-index: 15;
  background: var(--color-bg);
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--color-border);
}
.searchbar {
  display: flex; align-items: center; gap: 8px;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: 12px;
  padding: 9px 12px;
}
.searchbar .icon { color: var(--color-text-muted); }
.searchbar input {
  border: none; background: transparent; flex: 1; font-size: 15px; color: var(--color-text);
}
.searchbar input:focus { outline: none; }
.searchbar button { border: none; background: none; color: var(--color-text-muted); padding: 2px; cursor: pointer; }

.chiprow { display: flex; gap: 8px; overflow-x: auto; padding: 10px 2px 4px; scrollbar-width: none; }
.chiprow::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px;
  border-radius: 20px;
  background: var(--color-surface);
  border: 1.3px solid var(--color-border);
  font-size: 13.5px; font-weight: 600; color: var(--color-text-muted);
  cursor: pointer; white-space: nowrap;
}
.chip .icon { width: 15px; height: 15px; }
.chip.active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.chip.tagchip.active { background: var(--color-primary-dark2); border-color: var(--color-primary-dark2); }
.chip .count { opacity: .75; font-weight: 500; }

.filterbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 2px 2px;
}
.filterbar .sortsel {
  border: 1.3px solid var(--color-border); border-radius: 10px; background: var(--color-surface);
  padding: 6px 10px; font-size: 13px; color: var(--color-text-muted); font-weight: 600;
}
.result-count { font-size: 12.5px; color: var(--color-text-muted); }

/* ---------- Notes grid ---------- */
.main { flex: 1; padding: 12px 12px 100px; max-width: 1080px; width: 100%; margin: 0 auto; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.empty-state {
  text-align: center; padding: 60px 20px; color: var(--color-text-muted);
}
.empty-state .icon { width: 46px; height: 46px; color: var(--color-border); margin-bottom: 12px; }
.empty-state h3 { margin: 0 0 6px; color: var(--color-text); }
.empty-state p { margin: 0; font-size: 14px; }

.card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  border: 1px solid var(--color-border);
  border-left: 5px solid var(--color-border);
  padding: 14px 14px 12px;
  cursor: pointer;
  display: flex; flex-direction: column; gap: 8px;
  position: relative;
  transition: box-shadow .15s ease, transform .1s ease;
}
.card:hover { box-shadow: var(--shadow-2); }
.card:active { transform: scale(.99); }
.card.prio-high { border-left-color: var(--color-danger); }
.card.prio-medium { border-left-color: var(--color-warning); }
.card.prio-low { border-left-color: var(--color-low); }
.card.archived { opacity: .68; }
.card.trashed { border-left-color: var(--color-border); }
.card.overdue {
  border-left-color: var(--color-danger);
  box-shadow: 0 0 0 2px rgba(168, 68, 44, .22), var(--shadow-1);
  animation: overduePulse 2.4s ease-in-out infinite;
}
@keyframes overduePulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(168, 68, 44, .20), var(--shadow-1); }
  50% { box-shadow: 0 0 0 5px rgba(168, 68, 44, .06), var(--shadow-1); }
}
@media (prefers-reduced-motion: reduce) {
  .card.overdue { animation: none; }
}
.overdue-badge { color: var(--color-danger); font-weight: 700; }
.ack-btn { width: 100%; margin-top: 2px; padding: 9px; font-size: 13.5px; }
.card-top { display: flex; align-items: flex-start; gap: 8px; }
.card-icon { color: var(--color-primary); flex: none; margin-top: 2px; }
.card-title { font-weight: 700; font-size: 15.5px; flex: 1; line-height: 1.3; word-break: break-word; }
.card-menu-btn { background: none; border: none; color: var(--color-text-muted); padding: 4px; cursor: pointer; border-radius: 6px; flex: none; }
.card-menu-btn:hover { background: var(--color-primary-light); }
.card-body { font-size: 13.5px; color: var(--color-text-muted); line-height: 1.45; white-space: pre-wrap; overflow: hidden; max-height: 4.4em; }
.card-list-preview { list-style: none; margin: 0; padding: 0; font-size: 13.5px; color: var(--color-text); display: flex; flex-direction: column; gap: 4px; }
.card-list-preview li { display: flex; align-items: center; gap: 6px; }
.card-list-preview li.done { color: var(--color-text-muted); text-decoration: line-through; }
.card-list-preview .icon { width: 15px; height: 15px; color: var(--color-primary); flex: none; }
.card-list-more { font-size: 12px; color: var(--color-text-muted); }
.card-images { display: flex; gap: 6px; overflow-x: auto; }
.card-images img { width: 62px; height: 62px; object-fit: cover; border-radius: 8px; flex: none; background: var(--color-bg); cursor: zoom-in; }
.card-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.card-tag { font-size: 11.5px; font-weight: 700; color: var(--color-primary-dark2); background: var(--color-primary-light); padding: 3px 8px; border-radius: 10px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }
.card-meta { display: flex; align-items: center; gap: 10px; font-size: 11.5px; color: var(--color-text-muted); }
.card-meta span { display: flex; align-items: center; gap: 4px; }
.card-meta .icon { width: 14px; height: 14px; }
.badge-archived { font-size: 11px; font-weight: 700; color: var(--color-text-muted); background: var(--color-border); padding: 3px 8px; border-radius: 10px; }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-warning); flex: none; }
.sync-dot.synced { background: transparent; }

/* ---------- FAB ---------- */
.fab-wrap { position: fixed; right: 18px; bottom: 22px; z-index: 30; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.fab {
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--color-primary); color: #fff; border: none;
  box-shadow: var(--shadow-2); display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.fab:active { transform: scale(.94); }
.fab-menu { display: none; flex-direction: column; gap: 8px; align-items: flex-end; }
.fab-wrap.open .fab-menu { display: flex; }
.fab-wrap.open .fab { transform: rotate(45deg); }
.fab-option {
  display: flex; align-items: center; gap: 10px;
  background: var(--color-surface); color: var(--color-text);
  border: 1px solid var(--color-border); box-shadow: var(--shadow-1);
  border-radius: 30px; padding: 10px 16px 10px 14px; font-weight: 600; font-size: 14px;
  cursor: pointer; white-space: nowrap;
}
.fab-option .icon { color: var(--color-primary); }

/* ---------- Modal / Editor ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(20, 28, 18, .45);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 50; backdrop-filter: blur(1px);
}
@media (min-width: 720px) {
  .modal-overlay { align-items: center; }
}
.modal {
  background: var(--color-surface);
  width: 100%; max-width: 620px; max-height: 94dvh;
  border-radius: 20px 20px 0 0;
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-2);
}
@media (min-width: 720px) {
  .modal { border-radius: 20px; max-height: 88dvh; }
}
.modal-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 14px 10px; border-bottom: 1px solid var(--color-border);
}
.modal-head h2 { display: flex; align-items: center; gap: 8px; font-size: 16px; margin: 0; flex: 1; }
.modal-body { padding: 14px 16px 20px; overflow-y: auto; flex: 1; }
.modal-foot { display: flex; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--color-border); }
.modal-foot .btn { flex: 1; }

.title-input {
  width: 100%; border: none; font-size: 19px; font-weight: 700; padding: 6px 0 10px;
  border-bottom: 2px solid var(--color-border); margin-bottom: 12px; background: transparent; color: var(--color-text);
}
.title-input:focus { outline: none; border-color: var(--color-primary); }
.typeswitch { display: flex; gap: 8px; margin-bottom: 14px; }
.typeswitch button {
  flex: 1; border: 1.5px solid var(--color-border); background: var(--color-surface-2);
  border-radius: 10px; padding: 9px; font-weight: 600; font-size: 13.5px; color: var(--color-text-muted);
  display: flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer;
}
.typeswitch button.active { border-color: var(--color-primary); background: var(--color-primary-light); color: var(--color-primary-dark2); }

.content-textarea {
  width: 100%; min-height: 140px; border: 1.5px solid var(--color-border); border-radius: 12px;
  padding: 12px; font-size: 15px; font-family: inherit; resize: vertical; color: var(--color-text);
  background: var(--color-surface-2); line-height: 1.5;
}
.content-textarea:focus { outline: none; border-color: var(--color-primary); }

.listitems { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.listitem { display: flex; align-items: center; gap: 8px; background: var(--color-surface); }
.listitem .draghandle {
  border: none; background: none; color: var(--color-text-muted);
  padding: 4px; cursor: grab; touch-action: none; flex: none; display: flex;
}
.listitem .draghandle:active { cursor: grabbing; }
.listitem.dragging {
  position: relative; z-index: 5;
  background: var(--color-surface); box-shadow: var(--shadow-2);
  border-radius: 10px; opacity: .97;
}
.listitem .check {
  width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--color-border);
  display: flex; align-items: center; justify-content: center; flex: none; cursor: pointer; color: #fff;
  background: var(--color-surface);
}
.listitem .check.done { background: var(--color-primary); border-color: var(--color-primary); }
.listitem .check .icon { width: 15px; height: 15px; }
.listitem input {
  flex: 1; border: none; border-bottom: 1.5px solid transparent; padding: 7px 2px; font-size: 15px;
  background: transparent; color: var(--color-text);
}
.listitem input:focus { outline: none; border-color: var(--color-border); }
.listitem.done input { color: var(--color-text-muted); text-decoration: line-through; }
.listitem .rm { border: none; background: none; color: var(--color-text-muted); padding: 5px; cursor: pointer; flex: none; }
.add-item-row { display: flex; align-items: center; gap: 8px; color: var(--color-primary); font-weight: 600; cursor: pointer; padding: 8px 2px; }

.section-label { font-size: 12.5px; font-weight: 700; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .04em; margin: 18px 0 8px; display: flex; align-items: center; gap: 6px; }

.tageditor { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.tag-pill {
  display: inline-flex; align-items: center; gap: 6px; background: var(--color-primary-light); color: var(--color-primary-dark2);
  font-weight: 600; font-size: 13px; padding: 6px 8px 6px 12px; border-radius: 20px;
}
.tag-pill button { border: none; background: none; color: var(--color-primary-dark2); cursor: pointer; padding: 2px; display: flex; }
.tag-input-inline {
  border: 1.3px dashed var(--color-border); border-radius: 20px; padding: 6px 12px; font-size: 13px;
  background: transparent; min-width: 110px; color: var(--color-text);
}
.tag-input-inline:focus { outline: none; border-color: var(--color-primary); }
.tag-suggestions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag-suggestion { font-size: 12.5px; color: var(--color-text-muted); background: var(--color-surface-2); border: 1px solid var(--color-border); padding: 4px 10px; border-radius: 14px; cursor: pointer; }

.prio-row { display: flex; gap: 8px; }
.prio-btn {
  flex: 1; border: 1.5px solid var(--color-border); background: var(--color-surface-2); border-radius: 10px;
  padding: 9px; font-weight: 700; font-size: 13px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px;
  color: var(--color-text-muted);
}
.prio-btn.high.active { border-color: var(--color-danger); background: var(--color-danger-bg); color: var(--color-danger); }
.prio-btn.medium.active { border-color: var(--color-warning); background: var(--color-warning-bg); color: var(--color-warning); }
.prio-btn.low.active { border-color: var(--color-low); background: var(--color-low-bg); color: var(--color-low); }
.prio-btn.none.active { border-color: var(--color-text-muted); background: var(--color-border); color: var(--color-text); }

.imagegrid { display: flex; flex-wrap: wrap; gap: 8px; }
.imagegrid .thumb { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; background: var(--color-surface-2); border: 1px solid var(--color-border); }
.imagegrid .thumb img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.imagegrid .thumb button { position: absolute; top: 3px; right: 3px; background: rgba(20,20,20,.55); border: none; color: #fff; border-radius: 50%; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.imagegrid .addbtn { width: 84px; height: 84px; border-radius: 10px; border: 1.5px dashed var(--color-border); background: var(--color-surface-2); color: var(--color-primary); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 11px; font-weight: 600; cursor: pointer; }

.reminder-row { display: flex; gap: 8px; align-items: center; }
.reminder-row input[type="datetime-local"] {
  flex: 1; border: 1.5px solid var(--color-border); border-radius: 10px; padding: 9px 10px; font-size: 14px; background: var(--color-surface-2); color: var(--color-text);
}
.reminder-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--color-primary-light); color: var(--color-primary-dark2); border-radius: 20px; padding: 6px 12px; font-size: 13px; font-weight: 600; }

/* ---------- Toast ---------- */
.toastwrap { position: fixed; left: 0; right: 0; bottom: 18px; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 90; pointer-events: none; padding: 0 16px; }
.toast {
  background: #1d2a1a; color: #fff; padding: 11px 18px; border-radius: 30px; font-size: 13.5px; font-weight: 600;
  box-shadow: var(--shadow-2); display: flex; align-items: center; gap: 8px; max-width: 92vw;
}
.toast.error { background: var(--color-danger); }

/* ---------- Share sheet ---------- */
.sheet-list { display: flex; flex-direction: column; }
.sheet-item {
  display: flex; align-items: center; gap: 12px; padding: 13px 4px; border-bottom: 1px solid var(--color-border);
  background: none; border-left: none; border-right: none; border-top: none; text-align: left; cursor: pointer; font-size: 15px; color: var(--color-text); width: 100%;
}
.sheet-item:last-child { border-bottom: none; }
.sheet-item .icon { color: var(--color-primary); }
.sheet-item.danger { color: var(--color-danger); }
.sheet-item.danger .icon { color: var(--color-danger); }

/* ---------- Detail view read-only ---------- */
.detail-body { font-size: 15px; line-height: 1.6; white-space: pre-wrap; }

/* ---------- Linkvorschau (WhatsApp-artige Karten) ---------- */
.linkcards { display: flex; flex-direction: column; gap: 8px; }
.linkcard {
  display: flex; align-items: stretch;
  border: 1px solid var(--color-border); border-radius: 12px;
  overflow: hidden; text-decoration: none; color: inherit;
  background: var(--color-surface-2);
  transition: background .15s ease;
}
a.linkcard:hover, a.linkcard:active { background: var(--color-primary-light); }
.linkcard-img { width: 76px; height: 76px; object-fit: cover; flex: none; background: var(--color-border); }
.linkcard-img-placeholder { display: flex; align-items: center; justify-content: center; color: var(--color-text-muted); }
.linkcard-body { padding: 8px 10px; min-width: 0; flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.linkcard-title {
  font-weight: 700; font-size: 13.5px; color: var(--color-text);
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 1; -webkit-box-orient: vertical;
}
.linkcard-desc {
  font-size: 12px; color: var(--color-text-muted);
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.linkcard-site { font-size: 11px; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .03em; }
.linkcard-url { font-size: 12px; color: var(--color-primary); word-break: break-all; text-decoration: none; }
.linkcard-url:hover { text-decoration: underline; }
.linkcard.loading .linkcard-desc, .linkcard.loading .linkcard-title { color: var(--color-text-muted); }
.linkcard.fallback { align-items: center; }
.linkcard-retry { border: none; background: none; color: var(--color-text-muted); padding: 0 12px; cursor: pointer; flex: none; }

/* ---------- Hilfe (Accordion) ---------- */
.help-list { display: flex; flex-direction: column; }
.help-item { border-bottom: 1px solid var(--color-border); }
.help-item:last-child { border-bottom: none; }
.help-item-head {
  width: 100%; display: flex; align-items: center; gap: 12px;
  background: none; border: none; text-align: left; cursor: pointer;
  padding: 13px 2px; font-size: 15px; font-weight: 700; color: var(--color-text);
}
.help-item-icon { color: var(--color-primary); flex: none; display: flex; }
.help-item-head .chev { margin-left: auto; color: var(--color-text-muted); transition: transform .15s ease; flex: none; }
.help-item.open .chev { transform: rotate(180deg); }
.help-item-body {
  display: none;
  padding: 0 4px 16px 38px;
  font-size: 14px; line-height: 1.6; color: var(--color-text-muted);
}

/* ---------- Bild-Lightbox ---------- */
.lightbox-overlay {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(10, 14, 8, .93);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.lightbox-img {
  max-width: 92vw; max-height: 84vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0,0,0,.5);
}
.lightbox-btn {
  position: absolute;
  background: rgba(255,255,255,.14);
  border: none; color: #fff;
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  text-decoration: none;
}
.lightbox-btn:active { background: rgba(255,255,255,.28); }
.lightbox-btn .icon { width: 22px; height: 22px; }
.lightbox-close { top: 16px; right: 16px; }
.lightbox-download { top: 16px; right: 70px; }
.lightbox-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 12px; top: 50%; transform: translateY(-50%); }
.lightbox-counter {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  color: #fff; font-size: 13px; font-weight: 600;
  background: rgba(255,255,255,.14); padding: 5px 14px; border-radius: 14px;
}
@media (max-width: 480px) {
  .lightbox-prev { left: 4px; }
  .lightbox-next { right: 4px; }
  .lightbox-download { right: 62px; }
}

/* ---------- Misc ---------- */
.row { display: flex; align-items: center; gap: 8px; }
.between { justify-content: space-between; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.small-muted { font-size: 12.5px; color: var(--color-text-muted); }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 420px) {
  .auth-card { padding: 30px 22px 24px; }
}
