/* ==========================================================================
   SYNQRA v2.0 — "OBSIDIAN TITANIUM & LIQUID GOLD" DESIGN SYSTEM
   Executive Minimalism • Hardware-Accelerated 60fps • Zero-Trust Clarity
   ========================================================================== */

:root, [data-theme="dark"] {
  --bg-base: #06070a;
  --bg-ambient:
    radial-gradient(ellipse 85% 42% at 50% -8%, rgba(216, 179, 90, 0.13) 0%, rgba(216, 179, 90, 0.03) 45%, transparent 75%),
    radial-gradient(circle at 88% 22%, rgba(56, 189, 248, 0.035) 0%, transparent 45%),
    linear-gradient(180deg, #090b10 0%, #06070a 100%);
  --surface-1: rgba(15, 18, 25, 0.88);
  --surface-2: rgba(22, 26, 36, 0.92);
  --surface-3: rgba(31, 37, 50, 0.96);
  --surface-elevated: linear-gradient(155deg, rgba(28, 33, 45, 0.95) 0%, rgba(14, 17, 24, 0.98) 100%);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.09);
  --border-light: rgba(255, 255, 255, 0.075);
  --border-titanium: rgba(148, 163, 184, 0.20);
  --border-highlight: rgba(216, 179, 90, 0.38);
  --border-gold: rgba(226, 190, 102, 0.68);
  --text-main: #f8fafc;
  --text-muted: #8e9bb0;
  --text-titanium: #cbd5e1;
  --brand-accent: #d4af37;
  --brand-accent-bright: #f5d67b;
  --brand-glow: rgba(212, 175, 55, 0.24);
  --dock-bg: rgba(10, 12, 18, 0.86);
  --sheet-bg: #0b0e14;
  --splash-bg: #050609;
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.14);
  --online-cyan: #10b981;
  --online-soft: rgba(16, 185, 129, 0.14);
  --offline-red: #f59e0b;
  --shadow-card: 0 10px 28px rgba(0, 0, 0, 0.42);
  --shadow-elevated: 0 20px 48px rgba(0, 0, 0, 0.72);
}

[data-theme="light"] {
  --bg-base: #f3f5f9;
  --bg-ambient:
    radial-gradient(ellipse 85% 40% at 50% -5%, rgba(180, 138, 28, 0.12) 0%, transparent 70%),
    linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  --surface-1: rgba(255, 255, 255, 0.92);
  --surface-2: rgba(247, 249, 252, 0.96);
  --surface-3: rgba(235, 240, 247, 0.98);
  --surface-elevated: linear-gradient(155deg, #ffffff 0%, #f4f6fb 100%);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --border-light: rgba(15, 23, 42, 0.075);
  --border-titanium: rgba(100, 116, 139, 0.22);
  --border-highlight: rgba(180, 138, 28, 0.38);
  --border-gold: rgba(180, 138, 28, 0.68);
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-titanium: #334155;
  --brand-accent: #b08518;
  --brand-accent-bright: #8d680b;
  --brand-glow: rgba(180, 138, 28, 0.15);
  --dock-bg: rgba(255, 255, 255, 0.90);
  --sheet-bg: #ffffff;
  --splash-bg: #050609;
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.10);
  --online-cyan: #059669;
  --online-soft: rgba(5, 150, 105, 0.12);
  --offline-red: #d97706;
  --shadow-card: 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-elevated: 0 20px 44px rgba(15, 23, 42, 0.14);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", system-ui, sans-serif;
}

html, body {
  background-color: var(--bg-base);
  background-image: var(--bg-ambient);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  display: flex;
  justify-content: center;
  padding: calc(max(env(safe-area-inset-top), 24px) + 18px) 14px calc(126px + env(safe-area-inset-bottom, 20px)) 14px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body.comfort-mode {
  font-size: 108%;
  letter-spacing: 0.15px;
}
body.comfort-mode .task-title,
body.comfort-mode .radar-item-title,
body.comfort-mode .smart-item-title {
  font-size: 16.5px !important;
  line-height: 1.44 !important;
}

input, select, textarea, button {
  font-family: inherit;
}

input, select, textarea {
  color: var(--text-main);
  font-size: 14px;
  outline: none;
  width: 100%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--border-gold) !important;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.14);
}

input::placeholder, textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.72;
}

/* Verhindert iOS Safari Passwort-Autofill auf API-Key-Feldern */
.masked-key-input {
  -webkit-text-security: disc;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 1px;
}

.app-core {
  width: 100%;
  max-width: 452px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

/* ==========================================================================
   1. EXECUTIVE TITANIUM MONOLITH v2.0 (SPLASH & DOCK)
   ========================================================================== */

.titanium-monolith-wrap {
  position: relative;
  width: 176px;
  height: 228px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
}

.titanium-monolith-wrap::before {
  content: "";
  position: absolute;
  width: 160px;
  height: 190px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.26) 0%, transparent 70%);
  filter: blur(18px);
  animation: aura-breathe 4s ease-in-out infinite alternate;
  pointer-events: none;
}

.titanium-monolith {
  position: relative;
  width: 140px;
  height: 202px;
  border-radius: 26px;
  background: linear-gradient(158deg, #2d323e 0%, #141720 44%, #06070b 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  border-left: 1px solid rgba(255, 255, 255, 0.10);
  border-right: 1px solid rgba(0, 0, 0, 0.85);
  border-bottom: 1px solid rgba(0, 0, 0, 0.95);
  box-shadow:
    inset 0 0 28px rgba(0, 0, 0, 0.92),
    0 28px 56px rgba(0, 0, 0, 0.95),
    0 0 0 1px rgba(216, 179, 90, 0.34);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.titanium-monolith:active {
  transform: scale(0.95);
}

.titanium-monolith::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 26px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.11) 0%, transparent 42%);
  z-index: 3;
  pointer-events: none;
}

.titanium-monolith::after {
  content: "";
  position: absolute;
  inset: -55%;
  background: linear-gradient(90deg, transparent, rgba(245, 214, 123, 0.18), transparent);
  transform: rotate(45deg) translateX(-150%);
  animation: glass-sweep 5.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  z-index: 4;
  pointer-events: none;
}

.monolith-core-ring {
  position: absolute;
  z-index: 1;
  width: 54px;
  height: 54px;
  border-radius: 13px;
  transform: rotate(45deg);
  background: rgba(12, 14, 20, 0.72);
  border: 1.2px solid rgba(226, 190, 102, 0.52);
  box-shadow:
    inset 0 0 16px rgba(0, 0, 0, 0.92),
    0 0 24px rgba(212, 175, 55, 0.22);
}

.monolith-core-line {
  position: relative;
  z-index: 2;
  width: 2.5px;
  height: 68px;
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(245,214,123,0.15), #fff0b8, #d4af37, rgba(245,214,123,0.15));
  box-shadow: 0 0 16px #f5d67b, 0 0 32px #d4af37;
  animation: core-breathe 3s ease-in-out infinite alternate;
}

/* DOCK MONOLITH */
.dock-monolith {
  position: relative;
  width: 54px;
  height: 70px;
  margin-top: -30px;
  border-radius: 16px;
  background: linear-gradient(160deg, #2e3340 0%, #141720 46%, #06070a 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.24);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  border-right: 1px solid rgba(0, 0, 0, 0.85);
  border-bottom: 1px solid rgba(0, 0, 0, 0.95);
  box-shadow:
    inset 0 0 12px rgba(0, 0, 0, 0.9),
    0 14px 28px rgba(0, 0, 0, 0.85),
    0 0 0 1px rgba(216, 179, 90, 0.38);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: all 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.dock-monolith::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.16) 0%, transparent 45%);
  z-index: 3;
  pointer-events: none;
}

.dock-monolith::after {
  content: "";
  position: absolute;
  inset: -50%;
  background: linear-gradient(90deg, transparent, rgba(245, 214, 123, 0.24), transparent);
  transform: rotate(45deg) translateX(-150%);
  animation: glass-sweep 5.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  z-index: 4;
  pointer-events: none;
}

.dock-core-ring {
  position: absolute;
  z-index: 1;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  transform: rotate(45deg);
  background: rgba(14, 16, 22, 0.7);
  border: 1px solid rgba(226, 190, 102, 0.55);
}

.dock-core-line {
  position: relative;
  z-index: 2;
  width: 2px;
  height: 26px;
  border-radius: 2px;
  background: #f5d67b;
  box-shadow: 0 0 8px #d4af37, 0 0 16px #d4af37;
  animation: dock-core-breathe 2.6s ease-in-out infinite alternate;
}

.dock-monolith:hover,
.has-unread .dock-monolith {
  transform: translateY(-3px);
  box-shadow:
    inset 0 0 12px rgba(0, 0, 0, 0.9),
    0 16px 32px rgba(0, 0, 0, 0.92),
    0 0 0 1.5px rgba(245, 214, 123, 0.85),
    0 0 24px rgba(212, 175, 55, 0.42);
}

.dock-monolith:active {
  transform: scale(0.90) translateY(3px);
}

@keyframes aura-breathe {
  0%   { opacity: 0.45; transform: scale(0.92); }
  100% { opacity: 0.95; transform: scale(1.08); }
}

@keyframes glass-sweep {
  0%, 18%  { transform: rotate(45deg) translateX(-150%); }
  82%, 100% { transform: rotate(45deg) translateX(150%); }
}

@keyframes core-breathe {
  0%   { height: 52px; opacity: 0.58; filter: brightness(0.88); }
  100% { height: 112px; opacity: 1; filter: brightness(1.28); }
}

@keyframes dock-core-breathe {
  0%   { height: 19px; opacity: 0.65; }
  100% { height: 34px; opacity: 1; }
}

@keyframes view-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   2. NAVIGATION, HEADER & SURFACES
   ========================================================================== */

.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 54px;
  padding: 4px 2px;
}

.header-sub {
  font-size: 10.5px;
  color: var(--text-titanium);
  font-weight: 700;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.version-tag {
  color: var(--brand-accent-bright);
  font-weight: 800;
  background: rgba(212, 175, 55, 0.13);
  border: 1px solid rgba(212, 175, 55, 0.32);
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 9.5px;
}

.status-dot {
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  background: var(--online-cyan);
  display: inline-block;
  box-shadow: 0 0 8px var(--online-cyan);
}

.greeting {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-main);
}

.tour-pill-btn {
  height: 34px;
  padding: 0 11px;
  border-radius: 99px;
  background: rgba(212, 175, 55, 0.13);
  border: 1px solid var(--border-highlight);
  color: var(--brand-accent-bright);
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  box-shadow: var(--glass-highlight);
  transition: transform 0.16s ease, border-color 0.2s ease;
}
.tour-pill-btn:active { transform: scale(0.94); }

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(140deg, #2b3140 0%, #10131b 100%);
  border: 1.5px solid var(--border-gold);
  color: var(--brand-accent-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  transition: transform 0.16s ease;
}
.avatar:active { transform: scale(0.92); }

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--surface-1);
  border: 1px solid var(--border-titanium);
  box-shadow: var(--glass-highlight);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.2s ease;
}
.icon-btn:active { transform: scale(0.92); }

/* DOCK */
.nexus-dock-shield {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: calc(84px + env(safe-area-inset-bottom, 12px));
  background: linear-gradient(180deg, rgba(6, 7, 10, 0) 0%, rgba(6, 7, 10, 0.88) 48%, rgba(6, 7, 10, 0.99) 100%);
  pointer-events: none;
  z-index: 990;
}

.nexus-dock {
  position: fixed;
  bottom: max(env(safe-area-inset-bottom, 12px), 12px);
  left: 12px; right: 12px;
  max-width: 440px;
  margin: 0 auto;
  background: var(--dock-bg);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid var(--border-titanium);
  border-top: 1px solid rgba(226, 190, 102, 0.38);
  border-radius: 26px;
  padding: 8px 10px 7px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  z-index: 1000;
  box-shadow: var(--shadow-elevated);
}

.dock-action {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  width: 64px;
  padding: 2px 0;
  transition: color 0.2s ease, transform 0.16s ease;
}
.dock-action:active { transform: scale(0.92); }
.dock-action svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.95;
  fill: none;
}
.dock-action.active {
  color: var(--brand-accent-bright);
}
.dock-action.active::after {
  content: "";
  position: absolute;
  bottom: -4px;
  width: 16px;
  height: 2.5px;
  border-radius: 99px;
  background: var(--brand-accent-bright);
  box-shadow: 0 0 8px var(--brand-accent);
}
.dock-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.dock-badge {
  position: absolute;
  top: -5px;
  right: 11px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: linear-gradient(135deg, var(--brand-accent-bright), var(--brand-accent));
  color: #000;
  font-size: 10px;
  font-weight: 900;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

/* ==========================================================================
   3. VIEWS, CARDS & WIDGETS
   ========================================================================== */

.view-container {
  display: none;
  flex-direction: column;
  gap: 12px;
}
.view-container.active {
  display: flex;
  animation: view-fade-up 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.seg-tabs, .view-mode-bar {
  display: flex;
  background: var(--surface-1);
  border: 1px solid var(--border-light);
  box-shadow: var(--glass-highlight);
  border-radius: 15px;
  padding: 3.5px;
  gap: 4px;
}
.seg-tab, .mode-btn {
  flex: 1;
  padding: 8px 10px;
  border-radius: 11px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.seg-tab.active, .mode-btn.active {
  background: var(--surface-2);
  color: var(--brand-accent-bright);
  border-color: var(--border-highlight);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.briefing-card {
  background: var(--surface-elevated);
  border: 1px solid var(--border-highlight);
  box-shadow: var(--glass-highlight), var(--shadow-card);
  border-radius: 20px;
  padding: 13px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.2s ease;
}
.briefing-card:active { transform: scale(0.985); }

.widget-grid-2x2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.widget-box {
  position: relative;
  background: var(--surface-1);
  border: 1px solid var(--border-titanium);
  box-shadow: var(--glass-highlight), var(--shadow-card);
  border-radius: 20px;
  padding: 13px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 102px;
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.2s ease;
}
.widget-box::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245, 214, 123, 0.35), transparent);
  pointer-events: none;
}

.radar-box, .glass-panel {
  background: var(--surface-1);
  border: 1px solid var(--border-light);
  box-shadow: var(--glass-highlight), var(--shadow-card);
  border-radius: 22px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.radar-filter-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.radar-filter-row::-webkit-scrollbar { display: none; }

.radar-tab-btn {
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  padding: 6px 11px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.18s ease;
}
.radar-tab-btn.active {
  border-color: var(--brand-accent);
  color: var(--brand-accent-bright);
  background: rgba(212, 175, 55, 0.14);
}

.radar-item, .task-card, .list-card {
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  box-shadow: var(--glass-highlight);
  border-radius: 17px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.16s ease, background 0.2s ease;
}
.radar-item:active, .task-card:active, .list-card:active {
  transform: scale(0.99);
}
.task-card, .list-card {
  flex-direction: column;
  align-items: stretch;
}
.radar-item.due-today, .task-card.due-today {
  border-color: var(--border-gold);
  background: linear-gradient(145deg, rgba(212, 175, 55, 0.07), var(--surface-2));
}
.radar-item.overdue, .task-card.overdue {
  border-color: rgba(239, 68, 68, 0.55);
}
.task-card.done {
  opacity: 0.55;
}

.quick-check-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.6px solid var(--border-gold);
  background: transparent;
  color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.18s ease;
}
.quick-check-circle.done {
  background: var(--brand-accent);
  color: #000;
}

.radar-item-left { flex: 1; overflow: hidden; }
.radar-item-title, .task-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
}
.radar-item-meta, .task-sub-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.privacy-pill, .meta-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--border-light);
  color: var(--text-titanium);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.privacy-pill.shared {
  border-color: var(--border-highlight);
  color: var(--brand-accent-bright);
  background: rgba(212, 175, 55, 0.10);
}

/* KANBAN & GANTT */
.kanban-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kanban-col { background: var(--surface-1); border: 1px solid var(--border-light); border-radius: 16px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.kanban-col-header { font-size: 11px; font-weight: 800; text-transform: uppercase; color: var(--brand-accent); letter-spacing: 0.5px; display: flex; justify-content: space-between; }

.gantt-wrap { background: var(--surface-1); border: 1px solid var(--border-light); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.gantt-row { display: flex; flex-direction: column; gap: 4px; padding-bottom: 6px; border-bottom: 1px solid var(--border-light); cursor: pointer; }
.gantt-track { width: 100%; height: 8px; background: var(--surface-2); border-radius: 99px; position: relative; overflow: hidden; }
.gantt-bar { position: absolute; top: 0; bottom: 0; border-radius: 99px; background: linear-gradient(90deg, var(--brand-accent), var(--brand-accent-bright)); }

/* CATEGORIES */
.category-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.category-card {
  background: var(--surface-1);
  border: 1px solid var(--border-light);
  box-shadow: var(--glass-highlight), var(--shadow-card);
  border-radius: 19px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.2s ease;
}
.category-card:active { transform: scale(0.98); }
.cat-top-row { display: flex; justify-content: space-between; align-items: center; }
.cat-icon-wrap { width: 36px; height: 36px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border-light); display: flex; align-items: center; justify-content: center; font-size: 17px; }
.cat-title { font-size: 15px; font-weight: 800; }
.cat-meta { font-size: 11px; color: var(--text-muted); }
.cat-progress { height: 4px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.cat-fill { height: 100%; background: linear-gradient(90deg, var(--brand-accent), var(--brand-accent-bright)); transition: width 0.35s ease; }
.add-category-btn { grid-column: 1 / -1; background: var(--surface-1); border: 1px dashed var(--border-highlight); border-radius: 16px; padding: 13px; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--brand-accent-bright); font-size: 13px; font-weight: 700; cursor: pointer; }

/* ==========================================================================
   4. SMART-EINKAUFSMODUS & LIVE-WARENKORB (OFFLINE-READY v2.0)
   ========================================================================== */

.pinned-list-banner {
  background: var(--surface-elevated);
  border: 1px solid var(--border-gold);
  box-shadow: var(--glass-highlight), var(--shadow-card);
  border-radius: 22px;
  padding: 16px;
}

.smart-cart-dashboard {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 7px;
  margin: 10px 0 12px;
}

.smart-cart-kpi {
  background: var(--surface-1);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 8px 9px;
  text-align: center;
}
.smart-cart-kpi.in-cart {
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.08);
}
.smart-cart-kpi-label {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-muted);
}
.smart-cart-kpi-val {
  font-size: 13.5px;
  font-weight: 900;
  margin-top: 2px;
  color: var(--text-main);
}

.aisle-group-header {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--brand-accent-bright);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 2px 3px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.18);
  margin-top: 4px;
}

.list-item-row, .subtask-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7.5px 0;
  border-bottom: 1px solid var(--border-light);
}

.list-item-row input[type="checkbox"],
.subtask-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--brand-accent);
  flex-shrink: 0;
  cursor: pointer;
}

.qty-stepper {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--surface-1);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 2px 4px;
  flex-shrink: 0;
}
.qty-stepper button {
  background: transparent;
  border: none;
  color: var(--brand-accent-bright);
  font-size: 12px;
  font-weight: 900;
  width: 18px;
  height: 18px;
  cursor: pointer;
}
.qty-stepper span {
  font-size: 11px;
  font-weight: 800;
  min-width: 18px;
  text-align: center;
  color: var(--text-main);
}

.item-price-chip {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 8px;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.32);
  color: var(--brand-accent-bright);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ==========================================================================
   5. FINANZ-COCKPIT, SWIPE & PROJEKT-BUDGETS
   ========================================================================== */

.receipt-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 11px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: all 0.18s ease;
}
.receipt-item-row.shared {
  background: rgba(212, 175, 55, 0.12);
  border-color: var(--brand-accent);
}

.fin-swipe-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 17px;
  user-select: none;
}
.fin-swipe-action {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 96px;
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  z-index: 1;
  border-radius: 0 17px 17px 0;
}
.fin-swipe-card {
  position: relative;
  z-index: 2;
  background: var(--surface-2);
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}
.fin-swipe-wrap.swiped-open .fin-swipe-card {
  transform: translateX(-94px);
}

.fin-intra-group-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  background: rgba(212, 175, 55, 0.14);
  border: 1px solid var(--border-highlight);
  color: var(--brand-accent-bright);
}

.scanner-route-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  background: var(--surface-1);
  padding: 4px;
  border-radius: 13px;
  border: 1px solid var(--border-light);
}
.scanner-route-btn {
  padding: 7px 4px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
  transition: all 0.18s ease;
}
.scanner-route-btn.active {
  background: rgba(212, 175, 55, 0.16);
  border-color: var(--border-gold);
  color: var(--brand-accent-bright);
}

/* ==========================================================================
   6. SHEETS, BUTTONS, TRESOR & CHAT
   ========================================================================== */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 5, 9, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 4500;
  display: none;
  opacity: 0;
  transition: opacity 0.26s ease;
}

.bottom-sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  max-width: 468px;
  margin: 0 auto;
  max-height: 82vh;
  max-height: 82dvh;
  scroll-padding-bottom: 120px;
  overflow-y: auto;
  background: var(--sheet-bg);
  border-top: 1.5px solid var(--border-gold);
  border-radius: 28px 28px 0 0;
  padding: 16px 18px calc(30px + env(safe-area-inset-bottom, 16px));
  z-index: 4501;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.8);
}

.sheet-handle {
  width: 42px;
  height: 4px;
  background: rgba(148, 163, 184, 0.3);
  border-radius: 99px;
  margin: 0 auto 2px;
  flex-shrink: 0;
}

.sheet-close-btn {
  background: var(--surface-2);
  border: 1px solid var(--border-titanium);
  color: var(--text-titanium);
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.form-label {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--text-titanium);
  text-transform: uppercase;
  letter-spacing: 0.45px;
  margin-bottom: 4px;
  display: block;
}

.form-input {
  padding: 11px 12px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-light);
}

.grid-2x2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn-full {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border-gold);
  background: linear-gradient(135deg, var(--brand-accent-bright) 0%, var(--brand-accent) 100%);
  color: #08090c;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.22);
  transition: transform 0.15s ease, filter 0.2s ease;
}
.btn-full:active { transform: scale(0.98); filter: brightness(0.95); }

.btn-secondary {
  width: 100%;
  padding: 11px 13px;
  border-radius: 13px;
  border: 1px solid var(--border-titanium);
  background: var(--surface-2);
  box-shadow: var(--glass-highlight);
  color: var(--text-main);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.2s ease;
}
.btn-secondary:active { transform: scale(0.98); }

.share-user-chip {
  padding: 7px 12px;
  border-radius: 99px;
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.16s ease;
}
.share-user-chip.selected {
  background: rgba(212, 175, 55, 0.16);
  border-color: var(--brand-accent);
  color: var(--brand-accent-bright);
}

.magic-chip {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid var(--border-highlight);
  color: var(--brand-accent-bright);
}

.voice-monolith { width: 96px; height: 130px; margin: 0 auto; border-radius: 22px; cursor: pointer; }
.voice-monolith.listening {
  border-color: var(--online-cyan);
  box-shadow: 0 0 32px rgba(16, 185, 129, 0.45), inset 0 0 18px rgba(16, 185, 129, 0.25);
}

.vault-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.vault-card { position: relative; background: var(--surface-2); border: 1px solid var(--border-light); border-radius: 15px; padding: 10px; cursor: pointer; }
.vault-media-box { height: 88px; border-radius: 10px; background: var(--surface-1); display: flex; align-items: center; justify-content: center; overflow: hidden; margin-bottom: 6px; font-size: 26px; }
.vault-media-box img, .vault-media-box video { width: 100%; height: 100%; object-fit: cover; }
.vault-del-btn { position: absolute; top: 6px; right: 6px; width: 23px; height: 23px; border-radius: 50%; border: none; background: rgba(0, 0, 0, 0.68); color: var(--danger); font-size: 11px; cursor: pointer; }

/* CHAT */
.chat-fullscreen { position: fixed; inset: 0; background: var(--bg-base); z-index: 2500; display: none; flex-direction: column; }
.chat-fullscreen.active { display: flex; }
.chat-bubble { max-width: 79%; background: var(--surface-2); border: 1px solid var(--border-light); border-radius: 18px 18px 18px 4px; padding: 10px 13px; box-shadow: var(--shadow-card); }
.chat-bubble.mine { background: linear-gradient(145deg, rgba(212, 175, 55, 0.18), rgba(212, 175, 55, 0.08)); border-color: var(--border-highlight); border-radius: 18px 18px 4px 18px; }
.chat-bubble-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 5px; }
.chat-to-task-btn { background: transparent; border: none; color: var(--brand-accent-bright); font-size: 10px; font-weight: 800; cursor: pointer; }
.chat-time { font-size: 10px; color: var(--text-muted); }

/* ==========================================================================
   7. LIVE CAMERA SCANNER & CINEMATIC HOW-TO VIDEO PLAYER
   ========================================================================== */

@keyframes live-laser-sweep {
  0%   { top: 6%; opacity: 0.85; }
  50%  { top: 92%; opacity: 1; }
  100% { top: 6%; opacity: 0.85; }
}
@keyframes scanner-pulse-border {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.35), inset 0 0 24px rgba(16, 185, 129, 0.18); }
  50%      { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0), inset 0 0 36px rgba(16, 185, 129, 0.32); }
}

#live-camera-scanner-modal {
  position: fixed; inset: 0; background: #040507; z-index: 4800;
  display: none; flex-direction: column; justify-content: space-between; overflow: hidden;
}
#live-scanner-video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1;
}
.live-scanner-overlay {
  position: relative; z-index: 2; flex: 1; display: flex; flex-direction: column;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 20px) + 12px) 18px calc(env(safe-area-inset-bottom, 20px) + 18px);
  background: radial-gradient(circle at center, transparent 42%, rgba(4, 5, 8, 0.80) 100%);
}
.live-scanner-viewfinder {
  position: relative; width: 84%; max-width: 340px; height: 62vh; max-height: 510px;
  margin: auto; border-radius: 24px; border: 2px solid rgba(212, 175, 55, 0.68);
  box-shadow: 0 0 0 2000px rgba(4, 5, 8, 0.54); overflow: hidden;
  transition: border-color 0.25s ease;
}
.live-scanner-viewfinder.locking {
  border-color: var(--online-cyan);
  animation: scanner-pulse-border 1.1s infinite;
}
.live-scanner-laser-line {
  position: absolute; left: 4%; right: 4%; height: 3px; border-radius: 99px;
  background: linear-gradient(90deg, transparent, #10b981, #f5d67b, #10b981, transparent);
  box-shadow: 0 0 16px #10b981, 0 0 30px #d4af37;
  animation: live-laser-sweep 2.2s ease-in-out infinite;
}

/* CINEMATIC HOW-TO VIDEO PLAYER */
#howto-video-modal {
  position: fixed;
  inset: 0;
  z-index: 5200;
  background: rgba(4, 5, 8, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: none;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 20px) + 14px) 16px calc(env(safe-area-inset-bottom, 20px) + 16px);
}

.howto-stage-card {
  width: 100%;
  max-width: 430px;
  margin: auto;
  background: linear-gradient(160deg, #161a24 0%, #090b10 100%);
  border: 1px solid var(--border-gold);
  border-radius: 26px;
  padding: 20px 18px;
  box-shadow: 0 28px 65px rgba(0, 0, 0, 0.9), 0 0 40px rgba(212, 175, 55, 0.14);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.howto-visual-canvas {
  min-height: 225px;
  border-radius: 18px;
  background: radial-gradient(circle at 50% 0%, rgba(212, 175, 55, 0.14), rgba(6, 7, 10, 0.95) 75%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.howto-chapter-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
}
.howto-dot {
  height: 5px;
  flex: 1;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
  cursor: pointer;
}
.howto-dot-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--brand-accent), var(--brand-accent-bright));
  transition: width 0.2s linear;
}

.subtle-brand-footer {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.78;
}
.subtle-brand-footer a, .subtle-brand-footer button {
  color: var(--text-titanium);
  text-decoration: none;
  background: transparent;
  border: none;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.subtle-brand-footer a:hover, .subtle-brand-footer button:hover {
  color: var(--brand-accent-bright);
}
