/* Contact Lens — "see your network clearly". Iris-violet to lens-cyan on ink, light and dark themes. */
:root {
  --bg: #f4f5fb;
  --surface: #ffffff;
  --surface-2: #f7f8fc;
  --text: #0b1020;
  --text-2: #2f3653;
  --muted: #6b7290;
  --line: #e4e6f0;
  --line-2: #cdd1e2;
  --accent: #6d5efc;
  --accent-600: #5847f0;
  --accent-50: #f1efff;
  --accent-100: #e2dcff;
  --cyan: #06b6d4;
  --teal: #0891b2;
  --grad: linear-gradient(135deg, #7c5cff 0%, #22d3ee 100%);
  --ok: #059669; --ok-50: #ecfdf5; --ok-200: #a7f3d0;
  --warn: #b45309; --warn-50: #fffbeb; --warn-200: #fde68a;
  --err: #dc2626; --err-50: #fef2f2; --err-200: #fecaca;
  --info: #0369a1; --info-50: #f0f9ff; --info-200: #bae6fd;
  --side: #0b1020; --side-2: #171d33; --side-text: #c6cbe0; --side-muted: #6b7290;
  --radius: 16px; --radius-sm: 11px;
  --shadow-sm: 0 1px 2px rgba(11, 16, 32, .05);
  --shadow: 0 1px 2px rgba(11, 16, 32, .04), 0 8px 28px rgba(11, 16, 32, .07);
  --c1: #6d5efc; --c2: #06b6d4; --c3: #f59e0b; --c4: #ec4899; --c5: #10b981; --c6: #84cc16; --c7: #a855f7; --c8: #94a3b8;
  --sidebar-w: 248px;
  --tabbar-h: 64px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", "Segoe UI Arabic", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #070a14; --surface: #0f1424; --surface-2: #141a2e; --text: #e8eaf6; --text-2: #c3c8de; --muted: #8a90ad;
    --line: #222943; --line-2: #333b5c; --accent: #8b7dff; --accent-600: #a196ff; --accent-50: #1b1840; --accent-100: #2c2766;
    --ok: #34d399; --ok-50: #0b2a21; --ok-200: #14532d; --warn: #fbbf24; --warn-50: #2b2108; --warn-200: #713f12;
    --err: #f87171; --err-50: #2d1013; --err-200: #7f1d1d; --info: #7dd3fc; --info-50: #0b2233; --info-200: #0c4a6e;
    --side: #05070f; --side-2: #121830; --shadow-sm: none; --shadow: 0 10px 30px rgba(0, 0, 0, .35); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #070a14; --surface: #0f1424; --surface-2: #141a2e; --text: #e8eaf6; --text-2: #c3c8de; --muted: #8a90ad;
  --line: #222943; --line-2: #333b5c; --accent: #8b7dff; --accent-600: #a196ff; --accent-50: #1b1840; --accent-100: #2c2766;
  --ok: #34d399; --ok-50: #0b2a21; --ok-200: #14532d; --warn: #fbbf24; --warn-50: #2b2108; --warn-200: #713f12;
  --err: #f87171; --err-50: #2d1013; --err-200: #7f1d1d; --info: #7dd3fc; --info-50: #0b2233; --info-200: #0c4a6e;
  --side: #05070f; --side-2: #121830; --shadow-sm: none; --shadow: 0 10px 30px rgba(0, 0, 0, .35); color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.01em; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 100; border-radius: 8px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ic { width: 18px; height: 18px; flex: none; }
.ic.big { width: 40px; height: 40px; color: var(--line-2); }
[hidden] { display: none !important; }
[dir="auto"] { unicode-bidi: plaintext; }

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); background: var(--side); color: var(--side-text); position: fixed; inset: 0 auto 0 0; z-index: 40;
  display: flex; flex-direction: column; padding: 18px 14px; gap: 14px; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 1.1rem; padding: 2px 8px; }
.brand img { border-radius: 9px; }
.scan-cta { margin: 4px 0; }
#nav { display: flex; flex-direction: column; gap: 2px; }
#nav .sec { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--side-muted); margin: 12px 10px 4px; }
#nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px; color: var(--side-text); font-weight: 500; }
#nav a:hover { background: var(--side-2); text-decoration: none; color: #fff; }
#nav a.active { background: var(--side-2); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
#nav a .count { margin-left: auto; background: var(--err); color: #fff; font-size: .7rem; border-radius: 999px; padding: 1px 7px; }
.side-foot { margin-top: auto; border-top: 1px solid var(--side-2); padding-top: 12px; display: flex; align-items: center; gap: 10px; font-size: .85rem; }
.side-foot img, .side-foot .avatar { width: 32px; height: 32px; border-radius: 50%; }
.side-foot .who { min-width: 0; flex: 1; }
.side-foot .who b { display: block; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot .who span { color: var(--side-muted); font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.side-foot button { background: none; border: 0; color: var(--side-muted); cursor: pointer; padding: 6px; border-radius: 8px; }
.side-foot button:hover { color: #fff; background: var(--side-2); }

.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 1.15rem; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.icon-btn.menu-btn { display: none; }
.event-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 46vw; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 12px; font-size: .82rem; cursor: pointer; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event-chip.on { border-color: var(--accent-100); background: var(--accent-50); color: var(--accent-600); }
.event-chip .ic { width: 15px; height: 15px; }
main#view { padding: 24px 28px 64px; max-width: 1280px; width: 100%; margin: 0 auto; outline: none; }
.fab { display: none; }
.scrim { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 35; }

body.login-mode .sidebar, body.login-mode .topbar, body.login-mode .fab { display: none !important; }
body.login-mode .main { margin-left: 0; }
body.login-mode main#view { max-width: none; padding: 0; }

@media (max-width: 1023px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
  .main { margin-left: 0; }
  .icon-btn.menu-btn { display: inline-grid; }
  .topbar { padding: 0 12px; padding-top: env(safe-area-inset-top, 0); height: calc(56px + env(safe-area-inset-top, 0px)); }
  main#view { padding: 16px 14px calc(96px + env(safe-area-inset-bottom, 0px)); }
  .fab {
    display: grid; place-items: center; position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 30;
    width: 58px; height: 58px; border-radius: 50%; background: var(--grad); color: #fff; box-shadow: 0 10px 24px rgba(109, 94, 252, .4);
  }
  .fab .ic { width: 26px; height: 26px; }
}

/* ---------- Primitives ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 18px; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head h2, .card-head h3 { font-size: 1rem; font-weight: 650; }
.card-head .sub { color: var(--muted); font-size: .85rem; }
.card-head .actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .g2, .g3 { grid-template-columns: 1fr; } .span2 { grid-column: auto; } }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.xs { font-size: .75rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.page-head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head p { margin: 2px 0 0; color: var(--muted); }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
code.url { display: inline-block; word-break: break-all; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; margin: 8px 0; font-size: .85rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); background: var(--surface);
  color: var(--text-2); border-radius: var(--radius-sm); padding: 9px 14px; font-weight: 550; cursor: pointer; white-space: nowrap; text-decoration: none !important;
  transition: background .12s, border-color .12s; min-height: 40px;
}
.btn:hover { background: var(--surface-2); border-color: var(--line-2); }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(109, 94, 252, .28); }
.btn.primary:hover { filter: brightness(1.06); background: var(--grad); }
.btn.danger { color: var(--err); border-color: var(--err-200); }
.btn.danger:hover { background: var(--err-50); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 5px 10px; min-height: 32px; font-size: .84rem; border-radius: 8px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent; color: var(--text-2); cursor: pointer; }
.icon-btn:hover { background: var(--line); }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); white-space: nowrap; }
.st-new { background: var(--accent-50); color: var(--accent-600); border-color: var(--accent-100); }
.st-contacted { background: var(--info-50); color: var(--info); border-color: var(--info-200); }
.st-opportunity { background: var(--ok-50); color: var(--ok); border-color: var(--ok-200); }
.st-archived { background: var(--surface-2); color: var(--muted); }
.st-pending { background: var(--warn-50); color: var(--warn); border-color: var(--warn-200); }
.st-completed { background: var(--ok-50); color: var(--ok); border-color: var(--ok-200); }
.st-cancelled { background: var(--surface-2); color: var(--muted); }
.badge.overdue { background: var(--err-50); color: var(--err); border-color: var(--err-200); }
.conf-high { background: var(--ok-50); color: var(--ok); border-color: var(--ok-200); }
.conf-medium { background: var(--warn-50); color: var(--warn); border-color: var(--warn-200); }
.conf-low { background: var(--err-50); color: var(--err); border-color: var(--err-200); }
.tag { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); border-radius: 6px; padding: 1px 8px; font-size: .76rem; margin: 2px 4px 2px 0; }
.score { display: inline-grid; place-items: center; min-width: 36px; height: 26px; border-radius: 8px; font-weight: 700; font-size: .8rem; padding: 0 6px; }
.score.hi { background: var(--ok-50); color: var(--ok); } .score.mid { background: var(--warn-50); color: var(--warn); } .score.lo { background: var(--err-50); color: var(--err); }

.avatar { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--accent-50); color: var(--accent-600); font-weight: 700; font-size: .85rem; flex: none; object-fit: cover; }
.avatar.lg { width: 64px; height: 64px; border-radius: 16px; font-size: 1.3rem; }
.avatar.card-thumb { width: 54px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); }
.avatar.lg.card-thumb { width: 100px; }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); font-size: .9rem; border: 1px solid; margin-bottom: 14px; }
.alert.info { background: var(--accent-50); border-color: var(--accent-100); color: var(--accent-600); }
.alert.warn { background: var(--warn-50); border-color: var(--warn-200); color: var(--warn); }
.alert.err { background: var(--err-50); border-color: var(--err-200); color: var(--err); }
.alert.ok { background: var(--ok-50); border-color: var(--ok-200); color: var(--ok); }
.alert .ic { margin-top: 2px; }

/* ---------- Forms ---------- */
.field { display: block; }
.field > span { display: block; font-size: .8rem; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
.field > span .badge { margin-left: 6px; font-weight: 600; }
input[type=text], input[type=email], input[type=tel], input[type=url], input[type=date], input[type=datetime-local], input[type=search], input[type=number], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); min-height: 40px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-100); }
textarea { min-height: 90px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.multi { display: flex; flex-direction: column; gap: 8px; }
.multi-row { display: flex; gap: 8px; }
.multi-row select { width: 130px; flex: none; }
.check { display: flex; gap: 9px; align-items: flex-start; font-size: .9rem; cursor: pointer; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); }
.field.warned input, .field.warned textarea { border-color: var(--warn); background: var(--warn-50); }
.hint { font-size: .76rem; color: var(--muted); margin-top: 4px; }
.hint.warn { color: var(--warn); }

/* ---------- Dashboard ---------- */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
@media (max-width: 1200px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 4px; }
.kpi .k-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: .82rem; font-weight: 550; }
.kpi .k-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-50); color: var(--accent); }
.kpi .k-ic.teal { background: var(--info-50); color: var(--cyan); } .kpi .k-ic.amber { background: var(--warn-50); color: var(--warn); } .kpi .k-ic.pink { background: color-mix(in srgb, #ec4899 12%, var(--surface)); color: #ec4899; } .kpi .k-ic.sky { background: var(--info-50); color: var(--info); }
.kpi .k-val { font-size: 1.7rem; font-weight: 750; letter-spacing: -0.02em; }
.kpi .k-sub { font-size: .78rem; color: var(--muted); }
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
@media (max-width: 720px) { .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.quick a, .quick button { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); font-weight: 600; cursor: pointer; text-align: left; box-shadow: var(--shadow-sm); text-decoration: none; }
.quick a:hover, .quick button:hover { border-color: var(--accent-100); background: var(--accent-50); }
.quick .q-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--grad); color: #fff; flex: none; }
.quick .q-ic.teal { background: linear-gradient(135deg, #06b6d4, #0891b2); } .quick .q-ic.amber { background: linear-gradient(135deg, #fbbf24, #f59e0b); } .quick .q-ic.slate { background: linear-gradient(135deg, #475569, #1e293b); }
.quick small { display: block; color: var(--muted); font-weight: 400; font-size: .76rem; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; padding-top: 0; }
.list .t { font-weight: 600; }
.list .s { font-size: .8rem; color: var(--muted); }

/* ---------- Charts ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-dasharray: 3 3; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .col { fill: var(--accent); opacity: .9; }
.chart .col:hover { opacity: 1; }
.chart .cum { fill: none; stroke: var(--teal); stroke-width: 2.5; stroke-linejoin: round; }
.barlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.bl-row { display: flex; justify-content: space-between; font-size: .85rem; margin-bottom: 4px; gap: 8px; }
.bl-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bl-val { font-weight: 650; }
.bl-track { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.bl-fill { height: 100%; background: var(--grad); border-radius: 99px; }
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut { width: 140px; height: 140px; transform: rotate(0deg); }
.donut-total { font-size: 7px; font-weight: 700; fill: var(--text); }
.legend { list-style: none; padding: 0; margin: 0; font-size: .85rem; display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 140px; }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend b { margin-left: auto; }
.legend .dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.chart-empty { padding: 24px 0; text-align: center; }

/* ---------- Tables ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar .search { position: relative; flex: 1; min-width: 220px; }
.toolbar .search .ic { position: absolute; left: 11px; top: 11px; color: var(--muted); }
.toolbar .search input { padding-left: 36px; }
.toolbar select { width: auto; min-width: 140px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filters select { width: auto; min-width: 130px; min-height: 36px; padding: 6px 10px; font-size: .86rem; }
.bulkbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px; background: var(--accent-50); border: 1px solid var(--accent-100); border-radius: var(--radius-sm); margin-bottom: 12px; font-size: .9rem; color: var(--accent-600); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
table.data { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.data th { text-align: left; font-weight: 600; color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; padding: 11px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data th button { background: none; border: 0; color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; padding: 0; display: inline-flex; gap: 4px; align-items: center; }
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr { cursor: pointer; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tr.sel { background: var(--accent-50); }
table.data .cb { width: 36px; }
table.data input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.person { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.person .t { font-weight: 600; color: var(--text); }
.person .s { font-size: .78rem; color: var(--muted); }
.pager { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 12px 2px; font-size: .86rem; color: var(--muted); flex-wrap: wrap; }
@media (max-width: 760px) {
  table.data.responsive thead { display: none; }
  table.data.responsive tr { display: grid; grid-template-columns: 30px 1fr auto; gap: 2px 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
  table.data.responsive td { border: 0; padding: 0; }
  table.data.responsive td.hide-sm { display: none; }
  table.data.responsive td.cb { grid-row: span 2; padding-top: 10px; }
  table.data.responsive td.st { grid-column: 3; grid-row: 1; }
}

/* ---------- Scanner ---------- */
.tabs { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 16px; }
.tabs button { border: 0; background: transparent; padding: 8px 16px; border-radius: 9px; font-weight: 600; color: var(--muted); cursor: pointer; display: inline-flex; gap: 7px; align-items: center; }
.tabs button.on { background: var(--grad); color: #fff; }
.camera { position: relative; background: #0b1020; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; display: grid; place-items: center; color: #94a3b8; }
.camera video { width: 100%; height: 100%; object-fit: cover; }
.camera .guide { position: absolute; inset: 14% 8%; border: 2px solid rgba(255, 255, 255, .9); border-radius: 14px; box-shadow: 0 0 0 999px rgba(2, 6, 23, .35); pointer-events: none; }
.camera .guide.qr { inset: 18% 25%; aspect-ratio: 1; margin: auto; }
.camera .cam-ctrl { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; gap: 18px; align-items: center; }
.shutter { width: 66px; height: 66px; border-radius: 50%; border: 4px solid #fff; background: rgba(255, 255, 255, .25); cursor: pointer; }
.shutter:active { background: rgba(255, 255, 255, .6); }
.cam-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(15, 23, 42, .6); color: #fff; display: grid; place-items: center; cursor: pointer; }
.cam-placeholder { text-align: center; padding: 24px; }
.camera:has(> .cam-placeholder:not([hidden])) { aspect-ratio: auto; min-height: 260px; }
.cam-placeholder > .ic { width: 44px; height: 44px; margin-bottom: 8px; color: #64748b; }
@media (max-width: 640px) {
  .tabs { display: flex; width: 100%; }
  .tabs button { flex: 1; padding: 8px 6px; justify-content: center; white-space: nowrap; font-size: .85rem; }
  .tabs button .ic { display: none; }
  .filters select { flex: 1 1 140px; }
}
.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.side-slot { border: 2px dashed var(--line-2); border-radius: var(--radius-sm); aspect-ratio: 1.75; display: grid; place-items: center; text-align: center; color: var(--muted); font-size: .85rem; position: relative; overflow: hidden; background: var(--surface-2); }
.side-slot.active { border-color: var(--accent); background: var(--accent-50); color: var(--accent-600); }
.side-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.side-slot .slot-actions { position: absolute; right: 6px; bottom: 6px; display: flex; gap: 4px; }
.side-slot .slot-actions button { width: 30px; height: 30px; border-radius: 8px; border: 0; background: rgba(15, 23, 42, .75); color: #fff; display: grid; place-items: center; cursor: pointer; }
.side-slot .slot-actions .ic { width: 15px; height: 15px; }
.side-slot .lbl { position: absolute; left: 6px; top: 6px; background: rgba(15, 23, 42, .75); color: #fff; font-size: .7rem; padding: 1px 7px; border-radius: 6px; z-index: 1; }
.ai-note { font-size: .8rem; color: var(--muted); display: flex; gap: 8px; align-items: flex-start; }
.ai-note .ic { width: 16px; height: 16px; margin-top: 2px; }
.qr-result dl { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; margin: 0; font-size: .9rem; }
.qr-result dt { color: var(--muted); }
.qr-result dd { margin: 0; word-break: break-word; }
.raw { white-space: pre-wrap; word-break: break-word; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px; font: .8rem/1.45 ui-monospace, SFMono-Regular, Consolas, monospace; max-height: 220px; overflow: auto; }

/* ---------- Editor ---------- */
.editor-stage { position: relative; display: flex; justify-content: center; background: #0b1020; border-radius: 10px; padding: 10px; touch-action: none; user-select: none; min-height: 200px; }
.editor-stage canvas { display: block; max-width: 100%; }
.crop-box { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 999px rgba(2, 6, 23, .55); cursor: move; touch-action: none; }
.crop-box .h { position: absolute; width: 22px; height: 22px; background: #fff; border-radius: 50%; border: 3px solid var(--accent); }
.crop-box .nw { left: -11px; top: -11px; cursor: nwse-resize; } .crop-box .ne { right: -11px; top: -11px; cursor: nesw-resize; }
.crop-box .sw { left: -11px; bottom: -11px; cursor: nesw-resize; } .crop-box .se { right: -11px; bottom: -11px; cursor: nwse-resize; }
.editor-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* ---------- Contact profile ---------- */
.profile-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.profile-head h2 { font-size: 1.4rem; }
.profile-head .meta { color: var(--muted); }
.qa { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; font-size: .9rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
@media (max-width: 520px) { .kv { grid-template-columns: 1fr; gap: 0; } .kv dt { margin-top: 8px; font-size: .78rem; } }
.cards-row { display: flex; gap: 10px; flex-wrap: wrap; }
.cards-row figure { margin: 0; position: relative; }
.cards-row img { height: 140px; max-width: 100%; border-radius: 10px; border: 1px solid var(--line); cursor: zoom-in; background: #fff; }
.cards-row figcaption { font-size: .75rem; color: var(--muted); margin-top: 4px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 14px 26px; font-size: .88rem; }
.timeline li::before { content: ''; position: absolute; left: 7px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-50); }
.timeline li::after { content: ''; position: absolute; left: 11px; top: 18px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline time { display: block; font-size: .75rem; color: var(--muted); }
.note { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--surface-2); }
.note p { margin: 0; white-space: pre-wrap; }
.note .note-meta { display: flex; justify-content: space-between; align-items: center; font-size: .75rem; color: var(--muted); margin-top: 6px; }
.fu { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.fu:first-child { border-top: 0; }
.fu .t { font-weight: 600; }
.fu.done .t { text-decoration: line-through; color: var(--muted); }
.ai h4 { margin: 14px 0 6px; font-size: .85rem; color: var(--text-2); }
.ai ul, .ai ol { margin: 0; padding-left: 20px; }
.draft { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; font-size: .88rem; }

/* ---------- Duplicates ---------- */
.dup { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.dup > div { padding: 12px; }
.dup > div + div { border-left: 1px solid var(--line); }
@media (max-width: 640px) { .dup { grid-template-columns: 1fr; } .dup > div + div { border-left: 0; border-top: 1px solid var(--line); } }
.cmp { width: 100%; border-collapse: collapse; font-size: .86rem; }
.cmp th, .cmp td { border-bottom: 1px solid var(--line); padding: 8px; text-align: left; vertical-align: top; }
.cmp th { color: var(--muted); font-weight: 600; width: 120px; }
.cmp td label { display: flex; gap: 6px; align-items: flex-start; cursor: pointer; word-break: break-word; }
.cmp td.same { color: var(--muted); }

/* ---------- Dialog ---------- */
dialog.modal { border: 0; padding: 0; border-radius: 16px; width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: 0 20px 60px rgba(15, 23, 42, .3); color: var(--text); }
dialog.modal.wide { width: min(900px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(15, 23, 42, .5); }
.modal-inner { display: flex; flex-direction: column; max-height: calc(100vh - 32px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 1.05rem; }
.modal-body { padding: 18px; overflow: auto; }
.modal-body p:first-child { margin-top: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--line); background: var(--surface-2); flex-wrap: wrap; }
.lightbox { position: fixed; inset: 0; background: rgba(2, 6, 23, .92); z-index: 90; display: grid; place-items: center; cursor: zoom-out; }
.lightbox img { max-width: 96vw; max-height: 92vh; border-radius: 8px; }

/* ---------- Misc ---------- */
.toasts { position: fixed; z-index: 100; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
@media (max-width: 1023px) { .toasts { left: 16px; right: 16px; bottom: calc(90px + env(safe-area-inset-bottom, 0px)); max-width: none; } }
.toast { background: #0b1020; color: #fff; padding: 11px 14px; border-radius: 10px; font-size: .9rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); animation: pop .18s ease; }
.toast.err { background: var(--err); }
@keyframes pop { from { transform: translateY(6px); opacity: 0; } }
.loading { display: grid; place-items: center; padding: 60px 0; }
.spinner { width: 32px; height: 32px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
.spinner.sm { width: 18px; height: 18px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty h3 { color: var(--text); margin: 10px 0 4px; font-size: 1rem; }
.empty p { margin: 0 0 14px; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: radial-gradient(900px 600px at 15% 10%, #3b2f8f 0%, #0b1020 55%), #0b1020; color: #e2e8f0; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.login-art h1 { font-size: 2.3rem; line-height: 1.15; color: #fff; max-width: 520px; margin-top: 40px; }
.login-art ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; color: #cbd5e1; }
.login-art li { display: flex; gap: 10px; align-items: center; }
.login-art li .ic { color: #a5b4fc; }
.login-form { display: grid; place-items: center; padding: 32px 20px; }
.login-box { width: min(380px, 100%); }
.login-box h2 { font-size: 1.5rem; margin-bottom: 6px; }
.gbtn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 12px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); font-weight: 600; color: var(--text); margin-top: 22px; text-decoration: none !important; }
.gbtn:hover { background: var(--surface-2); }
@media (max-width: 860px) { .login { grid-template-columns: 1fr; } .login-art { padding: 28px 24px; } .login-art h1 { font-size: 1.6rem; margin-top: 16px; } .login-art ul { display: none; } }

/* =====================================================================
   Contact Lens UX layer: tab bar, command palette, Today hero, card grid,
   steady-shot capture, save celebration, swipe actions, voice notes.
   ===================================================================== */

/* Brand mark & gradient text */
.brand span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 800; letter-spacing: -0.02em; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Top bar search trigger and theme button */
.search-trigger { display: inline-flex; align-items: center; gap: 8px; min-width: 240px; padding: 7px 12px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 999px; cursor: pointer; font-size: .86rem; }
.search-trigger:hover { border-color: var(--accent-100); }
.search-trigger kbd, .kbd { margin-left: auto; font: 600 .7rem/1 var(--font); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; padding: 3px 6px; color: var(--muted); background: var(--surface-2); }
.theme-btn { border: 1px solid var(--line); background: var(--surface); }

/* Mobile bottom tab bar (thumb zone) */
.tabbar { display: none; }
@media (max-width: 1023px) {
  .icon-btn.menu-btn { display: none; }
  .fab { display: none !important; }
  .search-trigger { min-width: 0; width: 38px; height: 38px; padding: 0; justify-content: center; }
  .search-trigger span, .search-trigger kbd { display: none; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 32;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px);
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--line);
  }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: .68rem; font-weight: 600; color: var(--muted); background: none; border: 0; text-decoration: none; cursor: pointer; position: relative; }
  .tabbar a.active { color: var(--accent); }
  .tabbar a.active::before { content: ''; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--grad); }
  .tabbar .ic { width: 22px; height: 22px; }
  .tabbar .tab-scan .lens-btn { width: 58px; height: 58px; margin-top: -26px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--grad); box-shadow: 0 10px 24px rgba(109, 94, 252, .45), 0 0 0 5px var(--bg); }
  .tabbar .tab-scan .lens-btn .ic { width: 26px; height: 26px; }
  .tabbar .badge-dot { position: absolute; top: 8px; right: calc(50% - 18px); min-width: 16px; height: 16px; border-radius: 99px; background: var(--err); color: #fff; font-size: .62rem; display: grid; place-items: center; padding: 0 4px; }
  main#view { padding-bottom: calc(var(--tabbar-h) + 32px + env(safe-area-inset-bottom, 0px)); }
  .toasts { bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom, 0px)); }
}
body.login-mode .tabbar { display: none !important; }

/* Command palette */
dialog.palette { border: 0; padding: 0; border-radius: 18px; width: min(640px, calc(100vw - 24px)); margin-top: 12vh; background: var(--surface); color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
dialog.palette::backdrop { background: rgba(7, 10, 20, .55); backdrop-filter: blur(3px); }
.pal-input { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.pal-input input { border: 0 !important; box-shadow: none !important; padding: 4px 0; font-size: 1.05rem; background: transparent; min-height: 0; }
.pal-list { max-height: 55vh; overflow: auto; padding: 6px; margin: 0; list-style: none; }
.pal-list .grp { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 10px 10px 4px; }
.pal-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.pal-item .meta { font-size: .78rem; color: var(--muted); }
.pal-item[aria-selected="true"] { background: var(--accent-50); }
.pal-item[aria-selected="true"] .go { opacity: 1; }
.pal-item .go { margin-left: auto; opacity: 0; color: var(--accent); }
.pal-foot { display: flex; gap: 14px; padding: 9px 14px; border-top: 1px solid var(--line); font-size: .74rem; color: var(--muted); flex-wrap: wrap; }

/* Today hero */
.hero { position: relative; overflow: hidden; border-radius: 22px; padding: 22px; color: #e8eaf6; margin-bottom: 18px;
  background: radial-gradient(500px 220px at 85% -10%, rgba(34, 211, 238, .35), transparent 60%), radial-gradient(600px 260px at 0% 120%, rgba(124, 92, 255, .45), transparent 60%), #0b1020; }
.hero h2 { color: #fff; font-size: 1.5rem; }
.hero p { color: #b8bdd6; margin: 4px 0 0; }
.hero a { color: #a5f3fc; }
.hero .hero-row { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; position: relative; z-index: 1; }
.hero .hero-lens { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.hero .btn { border-color: rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .08); color: #fff; }
.hero .btn.primary { background: var(--grad); border-color: transparent; }
.hero .ring { position: absolute; right: -60px; top: -60px; width: 240px; height: 240px; border-radius: 50%; border: 22px solid rgba(255, 255, 255, .05); }
.hero .stats { display: flex; gap: 26px; margin-top: 18px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero .stats b { display: block; font-size: 1.45rem; color: #fff; font-weight: 750; }
.hero .stats span { font-size: .76rem; color: #9aa0bd; }
.today-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); transition: opacity .3s, transform .3s; }
.today-item:first-child { border-top: 0; }
.today-item .chk { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-2); background: transparent; display: grid; place-items: center; cursor: pointer; color: transparent; flex: none; }
.today-item .chk .ic { width: 14px; height: 14px; stroke-width: 3; }
.today-item .chk:hover { border-color: var(--ok); color: var(--ok); }
.today-item.done .chk { background: var(--ok); border-color: var(--ok); color: #fff; }
.today-item.done .t { text-decoration: line-through; color: var(--muted); }
.today-item.leaving { opacity: 0; transform: translateX(30px); }

/* Contact card grid (business-card view) */
.view-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.view-toggle button { border: 0; background: none; padding: 8px 10px; cursor: pointer; color: var(--muted); display: grid; place-items: center; }
.view-toggle button.on { background: var(--accent-50); color: var(--accent); }
.bcard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.bcard { position: relative; aspect-ratio: 1.75; border-radius: 14px; padding: 16px 16px 14px 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; cursor: pointer; overflow: hidden; transition: transform .18s ease, box-shadow .18s ease; color: var(--text); text-decoration: none !important; }
.bcard:hover { transform: translateY(-3px) rotate(-.4deg); box-shadow: 0 16px 40px rgba(11, 16, 32, .14); }
.bcard::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--grad); }
.bcard.st-opportunity::before { background: linear-gradient(180deg, #10b981, #06b6d4); }
.bcard.st-archived { opacity: .65; }
.bcard .bc-name { font-weight: 750; font-size: 1.02rem; letter-spacing: -0.01em; padding-right: 80px; }
.bcard .bc-title { font-size: .8rem; color: var(--muted); padding-right: 80px; }
.bcard .bc-co { margin-top: auto; font-weight: 650; font-size: .86rem; }
.bcard .bc-meta { font-size: .74rem; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.bcard .bc-photo { position: absolute; right: 12px; top: 12px; width: 70px; height: 42px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: #fff; }
.bcard .bc-sel { position: absolute; right: 10px; bottom: 10px; width: 18px; height: 18px; accent-color: var(--accent); }
.bcard.sel { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Steady-shot auto capture */
.steady { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; z-index: 2; pointer-events: none; }
.steady .pill { pointer-events: auto; display: inline-flex; align-items: center; gap: 6px; background: rgba(7, 10, 20, .65); color: #fff; border-radius: 999px; padding: 5px 10px; font-size: .74rem; font-weight: 600; border: 0; cursor: pointer; }
.steady .pill .ic { width: 14px; height: 14px; }
.steady .pill.on { background: rgba(109, 94, 252, .9); }
.steady .hint { background: rgba(7, 10, 20, .65); color: #fff; border-radius: 999px; padding: 5px 10px; font-size: .74rem; }
.camera .guide { transition: border-color .2s; }
.camera .guide.locking { border-color: #22d3ee; }
.camera .guide.locked { border-color: #34d399; }
.shutter { position: relative; }
.shutter svg { position: absolute; inset: -9px; width: calc(100% + 18px); height: calc(100% + 18px); transform: rotate(-90deg); pointer-events: none; }
.shutter circle { fill: none; stroke: #22d3ee; stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset .12s linear; }
.flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 3; }
.flash.go { animation: flash .35s ease; }
@keyframes flash { 0% { opacity: .85; } 100% { opacity: 0; } }

/* Save celebration ("focus" pulse) */
.celebrate { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; pointer-events: none; }
.celebrate .burst { grid-area: 1 / 1; width: 120px; height: 120px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; color: #fff; box-shadow: 0 20px 60px rgba(109, 94, 252, .5); animation: focusIn .6s cubic-bezier(.2, .9, .3, 1.3) both, fadeOut .35s ease 1.1s forwards; }
.celebrate .burst .ic { width: 52px; height: 52px; stroke-width: 3; }
.celebrate .ring2 { grid-area: 1 / 1; width: 120px; height: 120px; border-radius: 50%; border: 3px solid #22d3ee; animation: ripple 1s ease-out forwards; }
.celebrate .label { grid-area: 1 / 1; margin-top: 200px; background: var(--surface); color: var(--text); padding: 8px 16px; border-radius: 999px; font-weight: 650; box-shadow: var(--shadow); animation: focusIn .5s ease .1s both, fadeOut .35s ease 1.1s forwards; }
@keyframes focusIn { from { transform: scale(.4); opacity: 0; filter: blur(6px); } to { transform: scale(1); opacity: 1; filter: blur(0); } }
@keyframes ripple { from { transform: scale(1); opacity: .9; } to { transform: scale(2.6); opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; transform: scale(.9); } }

/* Swipe to complete (touch) */
.swipe { position: relative; overflow: hidden; touch-action: pan-y; border-radius: 10px; }
.swipe-bg { position: absolute; inset: 0; display: flex; align-items: center; padding-left: 18px; background: var(--ok); color: #fff; font-weight: 700; gap: 8px; opacity: 0; }
.swipe-fg { position: relative; background: var(--surface); transition: transform .2s ease; }
.swipe.dragging .swipe-fg { transition: none; }

/* Voice dictation */
.dictate-wrap { position: relative; }
.dictate-wrap textarea { padding-right: 48px; }
.dictate { position: absolute; right: 8px; bottom: 8px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.dictate .ic { width: 16px; height: 16px; }
.dictate.rec { background: var(--err); border-color: var(--err); color: #fff; animation: pulse 1.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .5); } 100% { box-shadow: 0 0 0 12px rgba(220, 38, 38, 0); } }

/* Skeleton loading */
.skel { display: grid; gap: 14px; padding-top: 8px; }
.skel div { height: 18px; border-radius: 8px; background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.skel .big { height: 140px; border-radius: 20px; }
.skel .row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; height: auto; background: none; animation: none; }
.skel .row3 span { height: 90px; border-radius: 16px; background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Gentle page entrance; respect reduced motion */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

@media (max-width: 640px) { .hide-sm { display: none; } }
@media (max-width: 640px) {
  .hero { padding: 18px; border-radius: 18px; }
  .hero h2 { font-size: 1.25rem; }
  .hero .hero-lens { margin-left: 0; width: 100%; }
  .hero .hero-lens .btn { flex: 1; }
  .hero .stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .hero .stats b { font-size: 1.15rem; }
  .hero .stats span { font-size: .68rem; }
}
.filter-toggle { display: none; }
@media (max-width: 640px) {
  .filter-toggle { display: inline-flex; }
  .filters { display: none; }
  .filters.open { display: flex; }
  .toolbar select#sort { flex: 1; }
}
