:root {
  color-scheme: light;
  --bg: #f8f8f7;
  --surface: #ffffff;
  --surface-2: #f1f3f4;
  --text: #0a0a0a;
  --muted: #5f6368;
  --muted-2: #7d8187;
  --border: #dedede;
  --border-strong: #c7c7c7;
  --accent: #0b6bcb;
  --accent-2: #137333;
  --warning: #b06000;
  --danger: #b3261e;
  --focus: #1a73e8;
  --shadow: 0 18px 55px rgba(10, 10, 10, 0.08);
  --radius: 8px;
  --sidebar-width: 260px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101112;
  --surface: #171819;
  --surface-2: #202224;
  --text: #f4f4f5;
  --muted: #b3b6bb;
  --muted-2: #8b9097;
  --border: #303236;
  --border-strong: #43474d;
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
}

body.locked {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

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

button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 55%, transparent);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand img {
  width: 34px;
  height: 34px;
}

.public-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px clamp(18px, 5vw, 72px);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
}

.public-nav__links,
.public-nav__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.public-nav__links a {
  color: var(--muted);
  font-weight: 650;
  font-size: 0.94rem;
}

.page {
  min-height: 100vh;
}

.container {
  width: min(1160px, calc(100% - 36px));
  margin: 0 auto;
}

.hero {
  position: relative;
  min-height: calc(100vh - 67px);
  padding: clamp(46px, 7vw, 86px) 0 42px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10, 10, 10, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(10, 10, 10, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, black 0%, transparent 92%);
  pointer-events: none;
}

.hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  align-items: center;
  gap: clamp(34px, 6vw, 72px);
}

.hero__copy h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(3rem, 7vw, 6.6rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.hero__copy p {
  max-width: 660px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.24rem);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.hero__proof {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 42px;
  max-width: 690px;
}

.proof-metric {
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

.proof-metric strong {
  display: block;
  font-size: 1.45rem;
}

.proof-metric span {
  color: var(--muted);
  font-size: 0.88rem;
}

.product-preview {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.preview-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 50px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
}

.window-dots {
  display: inline-flex;
  gap: 6px;
}

.window-dots span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--border-strong);
}

.preview-body {
  display: grid;
  grid-template-columns: 170px 1fr;
  min-height: 520px;
}

.preview-rail {
  padding: 18px 14px;
  background: #111;
  color: #fff;
}

.preview-rail span {
  display: block;
  margin-bottom: 10px;
  padding: 9px 10px;
  border-radius: var(--radius);
  color: #d6d6d6;
  font-size: 0.84rem;
}

.preview-rail span:first-child {
  background: #fff;
  color: #111;
}

.preview-main {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.preview-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.preview-search strong {
  font-size: 1.05rem;
}

.preview-map {
  position: relative;
  min-height: 180px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(11, 107, 203, 0.12) 1px, transparent 1px),
    linear-gradient(180deg, rgba(19, 115, 51, 0.12) 1px, transparent 1px),
    #f7faf9;
  background-size: 38px 38px;
}

.pin {
  position: absolute;
  width: 15px;
  height: 15px;
  border: 3px solid #fff;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 5px 18px rgba(11, 107, 203, 0.38);
}

.pin:nth-child(1) { left: 18%; top: 36%; }
.pin:nth-child(2) { left: 44%; top: 58%; background: var(--accent-2); }
.pin:nth-child(3) { left: 68%; top: 28%; background: var(--warning); }
.pin:nth-child(4) { left: 78%; top: 66%; }

.preview-leads {
  display: grid;
  gap: 10px;
}

.preview-lead {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.preview-lead span {
  color: var(--muted);
  font-size: 0.85rem;
}

.score-pill,
.status-pill,
.tag,
.plan-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  white-space: nowrap;
}

.score-pill.high,
.status-pill.success,
.tag.success {
  border-color: rgba(19, 115, 51, 0.22);
  background: rgba(19, 115, 51, 0.08);
  color: var(--accent-2);
}

.score-pill.hot,
.status-pill.warning,
.tag.warning {
  border-color: rgba(176, 96, 0, 0.24);
  background: rgba(176, 96, 0, 0.09);
  color: var(--warning);
}

.score-pill.low,
.status-pill.danger {
  border-color: rgba(179, 38, 30, 0.24);
  background: rgba(179, 38, 30, 0.08);
  color: var(--danger);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 10px 15px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-weight: 750;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: var(--text);
}

.btn:disabled,
.icon-button:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.btn-primary {
  border-color: var(--text);
  background: var(--text);
  color: var(--surface);
}

.btn-secondary {
  background: var(--surface-2);
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.icon-button {
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

.section {
  padding: clamp(58px, 8vw, 92px) 0;
  border-top: 1px solid var(--border);
}

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.section-header h2,
.workspace-header h1 {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 3.2rem);
  line-height: 1;
  letter-spacing: 0;
}

.section-header p,
.workspace-header p {
  max-width: 660px;
  margin: 10px 0 0;
  color: var(--muted);
}

.feature-grid,
.metrics-grid,
.pricing-grid,
.report-grid,
.admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.feature,
.metric,
.panel,
.pricing-plan,
.lead-card,
.timeline-item,
.pipeline-column,
.table-wrap,
.auth-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.feature,
.metric,
.panel,
.pricing-plan,
.timeline-item,
.auth-panel {
  padding: 20px;
}

.feature h3,
.panel h2,
.pricing-plan h2 {
  margin: 0 0 8px;
}

.feature p,
.panel p,
.pricing-plan p,
.metric span {
  margin: 0;
  color: var(--muted);
}

.metric strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(1.75rem, 4vw, 2.6rem);
  line-height: 1;
}

.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px;
  background: var(--surface);
  border-right: 1px solid var(--border);
}

.sidebar nav {
  display: grid;
  gap: 5px;
  margin-top: 26px;
}

.sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: var(--radius);
  color: var(--muted);
  font-weight: 700;
}

.sidebar a.active,
.sidebar a:hover {
  background: var(--surface-2);
  color: var(--text);
}

.workspace {
  min-width: 0;
  padding: 26px clamp(18px, 4vw, 42px) 42px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 28px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-menu {
  display: none;
}

.hamburger-button {
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}

.hamburger-button span {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.workspace-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.search-panel {
  margin-bottom: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.form-grid.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.compact-header {
  align-items: start;
  margin-bottom: 16px;
}

.niche-pack-grid,
.asset-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.niche-pack-button,
.asset-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
}

.niche-pack-button {
  text-align: left;
  cursor: pointer;
}

.niche-pack-button strong,
.asset-card strong {
  display: block;
}

.niche-pack-button span,
.asset-card span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.niche-pack-button:hover,
.niche-pack-button:focus-visible {
  border-color: var(--accent);
  outline: 0;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 750;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

.field textarea {
  min-height: 118px;
  resize: vertical;
}

.checkbox-field {
  align-content: end;
  gap: 9px;
}

.checkbox-field label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  color: var(--text);
  font-size: 0.9rem;
}

.checkbox-field input {
  width: 17px;
  min-height: 17px;
  accent-color: var(--accent);
}

.form-actions {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 8px;
}

.leads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.lead-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.lead-card__top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.lead-card h3 {
  margin: 0 0 4px;
}

.lead-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.lead-meta,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.lead-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pagination-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

.pagination-status {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-weight: 750;
}

.pagination-note {
  margin-top: 10px;
  text-align: center;
}

.lead-command-center {
  margin-bottom: 14px;
}

.lead-command-grid,
.local-vault-filters {
  margin-bottom: 12px;
}

.select-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.select-check input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}

.lead-strength {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.lead-strength > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.lead-strength strong {
  font-size: 1.12rem;
}

.lead-strength span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.strength-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface);
}

.strength-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.contact-action-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.local-lead-tools {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.local-lead-tools textarea {
  min-height: 84px;
}

.empty-state,
.error-state,
.skeleton {
  display: grid;
  place-items: center;
  min-height: 190px;
  padding: 22px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.skeleton {
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.25s infinite linear;
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

.chart {
  display: grid;
  gap: 12px;
}

.map-preview {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
}

.map-preview iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.bar-row {
  display: grid;
  grid-template-columns: 110px 1fr 52px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.pipeline {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(250px, 1fr);
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 12px;
}

.pipeline-column {
  min-height: 420px;
  padding: 14px;
}

.pipeline-column h2 {
  margin: 0 0 14px;
  font-size: 1rem;
}

.deal-card {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.deal-card strong,
.deal-card span {
  min-width: 0;
}

.deal-card span {
  color: var(--muted);
  font-size: 0.86rem;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 15px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 0.82rem;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 14px;
}

.audit-list {
  display: grid;
  gap: 10px;
}

.audit-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.auth-page {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
}

.auth-visual {
  position: relative;
  display: grid;
  align-content: center;
  padding: clamp(30px, 6vw, 74px);
  background: #0d0d0d;
  color: #fff;
  overflow: hidden;
}

.auth-visual::after {
  content: "";
  position: absolute;
  inset: 28px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius);
}

.auth-visual h1 {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 22px 0 0;
  font-size: clamp(2.4rem, 7vw, 5.8rem);
  line-height: 0.95;
}

.auth-visual p {
  position: relative;
  z-index: 1;
  max-width: 560px;
  color: #c7c7c7;
}

.auth-panel {
  display: grid;
  align-content: center;
  border: 0;
  border-left: 1px solid var(--border);
  border-radius: 0;
  padding: clamp(24px, 5vw, 52px);
}

.auth-panel form {
  display: grid;
  gap: 14px;
}

.auth-panel h2 {
  margin: 0;
  font-size: 2rem;
}

.auth-panel p {
  margin: 8px 0 22px;
  color: var(--muted);
}

.notice {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--muted);
}

.notice.success {
  border-color: rgba(19, 115, 51, 0.22);
  background: rgba(19, 115, 51, 0.08);
  color: var(--accent-2);
}

.notice.error {
  border-color: rgba(179, 38, 30, 0.24);
  background: rgba(179, 38, 30, 0.08);
  color: var(--danger);
}

.code-block {
  max-height: 420px;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.84rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.copy-brief {
  max-height: 560px;
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.muted-value {
  color: var(--muted-2);
  font-weight: 650;
}

.public-footer {
  padding: 34px clamp(18px, 5vw, 72px);
  border-top: 1px solid var(--border);
  color: var(--muted);
}

@media (max-width: 1040px) {
  .hero__grid,
  .detail-layout,
  .auth-page {
    grid-template-columns: 1fr;
  }

  .preview-body {
    grid-template-columns: 1fr;
  }

  .preview-rail {
    display: none;
  }

  .feature-grid,
  .metrics-grid,
  .pricing-grid,
  .report-grid,
  .admin-grid,
  .niche-pack-grid,
  .asset-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .public-nav__links {
    display: none;
  }

  .app-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    width: min(86vw, var(--sidebar-width));
    transform: translateX(-100%);
    transition: transform 180ms ease;
    box-shadow: var(--shadow);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-menu {
    display: inline-flex;
  }

  .workspace-header,
  .section-header {
    align-items: start;
    flex-direction: column;
  }

  .feature-grid,
  .metrics-grid,
  .pricing-grid,
  .report-grid,
  .admin-grid,
  .niche-pack-grid,
  .asset-grid,
  .local-lead-tools,
  .form-grid,
  .form-grid.compact,
  .hero__proof {
    grid-template-columns: 1fr;
  }

  .auth-visual {
    min-height: 360px;
  }
}

@media (max-width: 540px) {
  .public-nav {
    padding: 12px 16px;
  }

  .public-nav__actions .btn-secondary {
    display: none;
  }

  .container {
    width: min(100% - 24px, 1160px);
  }

  .hero {
    min-height: auto;
  }

  .hero__copy h1 {
    font-size: 3rem;
  }

  .preview-main {
    padding: 12px;
  }

  .preview-search,
  .preview-lead {
    grid-template-columns: 1fr;
  }

  .workspace {
    padding: 18px 12px 32px;
  }

  .topbar-actions .btn {
    display: none;
  }

  .bar-row {
    grid-template-columns: 1fr;
  }

  .pagination-controls {
    align-items: stretch;
    flex-direction: column;
  }

  th,
  td {
    padding: 11px 12px;
  }
}

/* ===== PWA Install Button ===== */
.pwa-install-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.pwa-install-btn:hover {
  background: var(--surface-2);
  border-color: var(--accent);
  color: var(--accent);
}
.pwa-install-btn svg {
  flex-shrink: 0;
}

/* ===== PWA Update Toast ===== */
.pwa-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 9999;
  font-size: 14px;
  transition: transform 0.3s ease;
  max-width: 90vw;
}
.pwa-toast--visible {
  transform: translateX(-50%) translateY(0);
}
.pwa-toast .btn-sm {
  padding: 6px 14px;
  font-size: 13px;
  flex-shrink: 0;
}

/* ===== Standalone App Adjustments ===== */
@media (display-mode: standalone) {
  .topbar {
    padding-top: max(12px, env(safe-area-inset-top));
  }
  .sidebar {
    padding-top: max(16px, env(safe-area-inset-top));
  }
  .pwa-install-btn {
    display: none !important;
  }
  body {
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior: none;
  }
  a, button, [role="button"] {
    cursor: default;
  }
}

/* ===== iOS Splash Screen ===== */
@media (display-mode: standalone) and (orientation: portrait) {
  body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    z-index: -1;
  }
}
