:root {
  --bg: #f4f5f7; --panel: #ffffff; --panel2: #f9fafb; --line: #e5e7eb; --line2: #d1d5db;
  --text: #111827; --muted: #6b7280; --faint: #9ca3af;
  --accent: #d97706; --accent-soft: #fef3c7; --accent-text: #92400e;
  --blue: #2563eb; --blue-soft: #dbeafe; --green: #16a34a; --green-soft: #dcfce7;
  --red: #dc2626; --red-soft: #fee2e2; --gray-soft: #f3f4f6;
  --side: #0f172a; --side-text: #cbd5e1; --side-active: #1e293b;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.18);
  --r: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0f17; --panel: #131925; --panel2: #182030; --line: #232c3d; --line2: #2f3a4f;
    --text: #e5e7eb; --muted: #9aa4b5; --faint: #6b7588;
    --accent: #f59e0b; --accent-soft: #3a2a0c; --accent-text: #fcd34d;
    --blue: #60a5fa; --blue-soft: #172a4a; --green: #4ade80; --green-soft: #12301d;
    --red: #f87171; --red-soft: #3a1515; --gray-soft: #1c2433;
    --side: #070a10; --side-text: #94a3b8; --side-active: #131925;
    --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 10px 40px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0f17; --panel: #131925; --panel2: #182030; --line: #232c3d; --line2: #2f3a4f;
  --text: #e5e7eb; --muted: #9aa4b5; --faint: #6b7588;
  --accent: #f59e0b; --accent-soft: #3a2a0c; --accent-text: #fcd34d;
  --blue: #60a5fa; --blue-soft: #172a4a; --green: #4ade80; --green-soft: #12301d;
  --red: #f87171; --red-soft: #3a1515; --gray-soft: #1c2433;
  --side: #070a10; --side-text: #94a3b8; --side-active: #131925;
  --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 10px 40px rgba(0,0,0,.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.sm { font-size: 12px; }
.nowrap { white-space: nowrap; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 22px; font-weight: 650; }
h2 { font-size: 15px; font-weight: 650; }
h3 { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

/* Buttons & inputs */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line2); background: var(--panel); padding: 7px 12px; border-radius: 8px; cursor: pointer; font-weight: 500; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--panel2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--gray-soft); }
.btn.danger { color: var(--red); }
.btn.sm { padding: 4px 8px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: default; }
.input, select.input, textarea.input { width: 100%; border: 1px solid var(--line2); background: var(--panel); border-radius: 8px; padding: 8px 10px; outline: none; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.input { resize: vertical; min-height: 90px; }
label.f { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 4px; font-weight: 500; }
kbd { font: 11px ui-monospace, monospace; border: 1px solid var(--line2); border-radius: 4px; padding: 0 4px; color: var(--faint); }

/* Login */
.login { position: fixed; inset: 0; display: grid; place-items: center; background: radial-gradient(circle at 30% 20%, #1e293b, #0b0f17); padding: 16px; }
.login-box { background: var(--panel); padding: 28px; border-radius: 16px; width: min(360px, 100%); box-shadow: var(--shadow-lg); display: grid; gap: 12px; }
.login-box .input, .login-box input { width: 100%; border: 1px solid var(--line2); border-radius: 8px; padding: 10px 12px; background: var(--panel); }
.err { color: var(--red); font-size: 13px; min-height: 18px; }

/* Layout */
.app { display: flex; height: 100vh; height: 100dvh; }
.side { width: 210px; background: var(--side); color: var(--side-text); display: flex; flex-direction: column; flex-shrink: 0; padding: 14px 10px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; color: #fff; padding: 4px 8px 18px; }
.brand.big { font-size: 22px; color: var(--text); padding: 0; }
.logo { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: #f59e0b; color: #0f172a; font-size: 16px; }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; text-decoration: none; font-weight: 500; }
.nav a:hover { background: var(--side-active); color: #fff; }
.nav a.active { background: var(--side-active); color: #fff; box-shadow: inset 3px 0 0 #f59e0b; }
.nav .ic { width: 18px; text-align: center; opacity: .9; }
.side-foot { margin-top: auto; display: flex; gap: 4px; }
.side-foot .btn { color: var(--side-text); }
.side-foot .btn:hover { background: var(--side-active); }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.top { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--panel); }
.search-btn { flex: 1; max-width: 420px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--panel2); border-radius: 8px; padding: 7px 12px; color: var(--faint); cursor: pointer; text-align: left; }
.search-btn kbd { margin-left: auto; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.sync { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.sync.busy { background: var(--accent); }
.sync.err { background: var(--red); }
.view { flex: 1; overflow: auto; padding: 20px; }
.view.full { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head .grow { flex: 1; }

/* Panels */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.panel-h { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.panel-h .grow { flex: 1; }
.panel-b { padding: 14px; }
.grid { display: grid; gap: 16px; }
.g-kpi { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.g-2 { grid-template-columns: 1fr 1fr; }
.g-dash { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.kpi { padding: 14px 16px; cursor: pointer; }
.kpi .v { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--muted); font-size: 12px; font-weight: 500; }
.kpi .bar { height: 4px; border-radius: 2px; margin-top: 10px; background: var(--gray-soft); overflow: hidden; }
.kpi .bar i { display: block; height: 100%; }

/* Funnel */
.funnel { display: grid; gap: 6px; }
.funnel-row { display: grid; grid-template-columns: 150px 1fr 34px; gap: 10px; align-items: center; cursor: pointer; font-size: 13px; }
.funnel-row .track { height: 22px; background: var(--gray-soft); border-radius: 5px; overflow: hidden; }
.funnel-row .fill { height: 100%; border-radius: 5px; min-width: 3px; }
.funnel-row .n { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.funnel-row .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Listen */
.list { display: grid; }
.li { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); cursor: pointer; min-width: 0; }
.li:first-child { border-top: 0; }
.li:hover { background: var(--panel2); }
.li .main-t { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .sub { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .grow { flex: 1; min-width: 0; }
.datebox { width: 44px; text-align: center; border-radius: 8px; background: var(--gray-soft); padding: 4px 0; flex-shrink: 0; line-height: 1.1; }
.datebox b { display: block; font-size: 16px; }
.datebox span { font-size: 10px; text-transform: uppercase; color: var(--muted); }
.datebox.today { background: var(--accent-soft); color: var(--accent-text); }
.empty { padding: 24px; text-align: center; color: var(--faint); }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 99px; font-size: 11px; font-weight: 600; background: var(--gray-soft); color: var(--muted); white-space: nowrap; }
.badge.amber { background: var(--accent-soft); color: var(--accent-text); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.red { background: var(--red-soft); color: var(--red); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* Pipeline */
.pl-bar { display: flex; gap: 8px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; background: var(--panel); }
.seg { display: inline-flex; background: var(--gray-soft); border-radius: 8px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 5px 10px; border-radius: 6px; cursor: pointer; font-weight: 500; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.board { flex: 1; display: flex; gap: 12px; overflow: auto; padding: 16px 20px; align-items: flex-start; }
.col { width: 280px; flex-shrink: 0; background: var(--panel2); border: 1px solid var(--line); border-radius: var(--r); display: flex; flex-direction: column; max-height: 100%; }
.col-h { display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-weight: 600; border-bottom: 1px solid var(--line); }
.col-h .n { margin-left: auto; color: var(--muted); font-weight: 500; font-size: 12px; }
.col-h .add { border: 0; background: transparent; cursor: pointer; color: var(--muted); font-size: 16px; padding: 0 4px; border-radius: 4px; }
.col-h .add:hover { background: var(--gray-soft); color: var(--text); }
.col-b { padding: 8px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 60px; }
.col.drop .col-b { background: var(--accent-soft); border-radius: 0 0 var(--r) var(--r); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 11px; cursor: pointer; box-shadow: var(--shadow); user-select: none; -webkit-user-select: none; touch-action: pan-y; }
.card:hover { border-color: var(--line2); }
.card.dragging { opacity: .4; }
.card .t { font-weight: 600; margin-bottom: 2px; word-break: break-word; }
.card .a { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .n { color: var(--muted); font-size: 12px; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.drag-ghost { position: fixed; pointer-events: none; z-index: 1000; width: 260px; transform: rotate(2deg); box-shadow: var(--shadow-lg); opacity: .95; }
.ph { border: 2px dashed var(--accent); border-radius: 8px; height: 46px; background: var(--accent-soft); }

/* Kunden-Grid */
.cust-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.cust { overflow: hidden; cursor: pointer; display: flex; flex-direction: column; transition: transform .1s; }
.cust:hover { transform: translateY(-1px); border-color: var(--line2); }
.cust .cov { aspect-ratio: 16/9; background: var(--gray-soft) center/cover no-repeat; display: grid; place-items: center; color: var(--faint); font-size: 28px; }
.cust .b { padding: 10px 12px 12px; display: grid; gap: 6px; }
.cust .nm { font-weight: 650; display: flex; align-items: center; gap: 6px; }
.cust .nm span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cust .facts { display: flex; gap: 10px; color: var(--muted); font-size: 12px; flex-wrap: wrap; }
.prog { height: 4px; background: var(--gray-soft); border-radius: 2px; overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--green); }

/* Kundendetail */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.hero { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.hero .av { width: 64px; height: 64px; border-radius: 14px; background: var(--accent-soft) center/cover; display: grid; place-items: center; font-size: 24px; font-weight: 700; color: var(--accent-text); flex-shrink: 0; }
.hero .grow { flex: 1; min-width: 200px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { border: 0; background: transparent; padding: 9px 12px; cursor: pointer; color: var(--muted); font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.tabs .c { font-size: 11px; color: var(--faint); margin-left: 4px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1px; background: var(--line); border-radius: 8px; overflow: hidden; }
.stat { background: var(--panel); padding: 10px 12px; }
.stat .v { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 11px; color: var(--muted); }
.gal { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.gal .ph-img { aspect-ratio: 4/3; border-radius: 8px; background: var(--gray-soft) center/cover no-repeat; cursor: zoom-in; position: relative; overflow: hidden; }
.gal .ph-img .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 4px; font-size: 11px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.65)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transition: opacity .15s; }
.gal .ph-img:hover .cap { opacity: 1; }
.gal .ph-img .play { position: absolute; inset: 0; display: grid; place-items: center; font-size: 32px; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.5); }
.docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.doc { cursor: pointer; overflow: hidden; }
.doc .pv { aspect-ratio: 1/1.2; background: var(--gray-soft) top/cover no-repeat; border-bottom: 1px solid var(--line); display: grid; place-items: center; font-size: 28px; color: var(--faint); }
.doc .nm { padding: 8px 10px; font-size: 12px; font-weight: 550; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.doc .nm small { display: block; color: var(--faint); font-weight: 400; }
.tree { font-size: 13px; }
.tree .row { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 6px; cursor: pointer; }
.tree .row:hover { background: var(--panel2); }
.tree .row .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree .row .acts { display: none; gap: 2px; }
.tree .row:hover .acts { display: flex; }
.tree .kids { padding-left: 18px; border-left: 1px solid var(--line); margin-left: 16px; }
.drop-zone { border: 2px dashed var(--line2); border-radius: var(--r); padding: 16px; text-align: center; color: var(--muted); margin-top: 12px; cursor: pointer; }
.drop-zone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.note-view { white-space: normal; word-break: break-word; }
.note-view p { margin: 0 0 8px; }
.note-view img { max-width: 100%; border-radius: 6px; }
.note-view ul { margin: 0 0 8px; padding-left: 20px; }
.check { display: flex; align-items: flex-start; gap: 8px; padding: 5px 0; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--green); width: 16px; height: 16px; }
.check.done span { color: var(--muted); text-decoration: line-through; }

/* Drawer (Karte) */
.drawer, .modal { position: fixed; inset: 0; z-index: 100; }
.drawer-bg, .modal-bg { position: absolute; inset: 0; background: rgba(15,23,42,.35); backdrop-filter: blur(1px); }
.drawer-panel { position: absolute; right: 0; top: 0; bottom: 0; width: min(560px, 100%); background: var(--panel); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .18s ease-out; }
@keyframes slide { from { transform: translateX(30px); opacity: .5; } }
.dr-h { padding: 16px 18px 12px; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.dr-h .row1 { display: flex; gap: 8px; align-items: flex-start; }
.dr-title { font-size: 19px; font-weight: 650; border: 1px solid transparent; border-radius: 6px; padding: 2px 6px; margin: -3px -6px; flex: 1; background: transparent; outline: none; min-width: 0; }
.dr-title:hover { border-color: var(--line); }
.dr-title:focus { border-color: var(--accent); }
.dr-b { flex: 1; overflow-y: auto; padding: 14px 18px 30px; display: grid; gap: 18px; align-content: start; }
.sec h3 { margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.sec h3 .grow { flex: 1; }
.facts-list { display: grid; gap: 6px; }
.fact { display: flex; gap: 10px; align-items: center; font-size: 13px; }
.fact .k { width: 22px; text-align: center; color: var(--faint); }
.fact a { color: var(--blue); text-decoration: none; }
.todo { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; }
.todo:hover { background: var(--panel2); }
.todo input { accent-color: var(--green); width: 16px; height: 16px; }
.todo .x { margin-left: auto; opacity: 0; border: 0; background: none; cursor: pointer; color: var(--faint); }
.todo:hover .x { opacity: 1; }
.todo.done span { text-decoration: line-through; color: var(--muted); }
.comment { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.comment .h { font-size: 11px; color: var(--faint); display: flex; gap: 6px; }
.comment .h button { margin-left: auto; border: 0; background: none; color: var(--faint); cursor: pointer; }
.timeline { display: grid; gap: 0; font-size: 12px; }
.tl { display: grid; grid-template-columns: 14px 1fr; gap: 8px; position: relative; padding-bottom: 8px; }
.tl::before { content: ""; position: absolute; left: 6px; top: 12px; bottom: 0; width: 1px; background: var(--line); }
.tl:last-child::before { display: none; }
.tl i { width: 9px; height: 9px; border-radius: 50%; background: var(--line2); margin-top: 4px; margin-left: 2px; }
.tl i.spalte { background: var(--accent); }
.tl i.neu { background: var(--green); }
.tl i.todo { background: var(--blue); }
.tl .when { color: var(--faint); }

/* Modal */
.modal { display: grid; place-items: center; padding: 16px; }
.modal-panel { position: relative; background: var(--panel); border-radius: 14px; box-shadow: var(--shadow-lg); width: min(520px, 100%); max-height: 90vh; overflow: auto; padding: 20px; }
.modal-panel.wide { width: min(1100px, 100%); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.search-res { margin-top: 10px; display: grid; max-height: 60vh; overflow: auto; }
.search-res .li.sel { background: var(--accent-soft); }
.canvas-wrap { position: relative; overflow: auto; background: var(--panel2); border-radius: 8px; height: 70vh; }
.canvas-node { position: absolute; border: 1px solid var(--line2); border-radius: 8px; background: var(--panel); padding: 8px; overflow: hidden; font-size: 13px; white-space: pre-wrap; word-break: break-word; }
.canvas-node img { max-width: 100%; display: block; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center; }
.lightbox img, .lightbox video { max-width: 94vw; max-height: 86vh; object-fit: contain; }
.lightbox .lb-bar { position: absolute; top: 0; left: 0; right: 0; display: flex; gap: 8px; align-items: center; padding: 12px 16px; color: #fff; }
.lightbox .lb-bar .grow { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lightbox .lb-bar a, .lightbox .lb-bar button { color: #fff; background: rgba(255,255,255,.12); border: 0; padding: 6px 10px; border-radius: 6px; cursor: pointer; text-decoration: none; }
.lightbox .nav-l, .lightbox .nav-r { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.12); color: #fff; border: 0; font-size: 26px; width: 48px; height: 64px; border-radius: 8px; cursor: pointer; }
.lightbox .nav-l { left: 12px; } .lightbox .nav-r { right: 12px; }
.lightbox iframe { width: 94vw; height: 86vh; border: 0; background: #fff; border-radius: 6px; margin-top: 40px; }

/* Karte */
#map { flex: 1; min-height: 300px; }
.leaflet-popup-content { font: 13px system-ui, sans-serif; }
.map-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.pin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(80px); background: #111827; color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow-lg); transition: transform .2s; z-index: 300; max-width: calc(100% - 32px); }
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--red); }

/* Mobil */
@media (max-width: 1000px) {
  .detail { grid-template-columns: 1fr; }
  .g-dash, .g-2 { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .app { flex-direction: column-reverse; }
  .side { width: auto; flex-direction: row; padding: 4px 6px calc(4px + env(safe-area-inset-bottom)); }
  .brand, .side-foot { display: none; }
  .nav { grid-template-columns: repeat(5, 1fr); width: 100%; }
  .nav a { flex-direction: column; gap: 2px; font-size: 10px; padding: 6px 2px; text-align: center; }
  .nav a.active { box-shadow: inset 0 2px 0 #f59e0b; }
  .nav .ic { font-size: 18px; }
  .top { padding: 10px 16px; }
  .search-btn kbd { display: none; }
  .view { padding: 16px; }
  .board { padding: 12px 16px; scroll-snap-type: x mandatory; }
  .col { width: calc(100vw - 48px); scroll-snap-align: center; }
  .pl-bar { padding: 10px 16px; }
  .funnel-row { grid-template-columns: 110px 1fr 28px; }
  .cust-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .gal { grid-template-columns: repeat(3, 1fr); gap: 4px; }
  .docs { grid-template-columns: repeat(2, 1fr); }
}
