:root {
  --bg: #07111f;
  --surface: rgba(13, 25, 43, .86);
  --surface-strong: rgba(16, 31, 52, .98);
  --surface-soft: rgba(255,255,255,.06);
  --line: rgba(172, 198, 233, .20);
  --line-strong: rgba(172, 198, 233, .34);
  --text: #edf5ff;
  --muted: #9fb1cc;
  --muted-2: #71829c;
  --brand: #56d8ff;
  --brand-2: #8cffd2;
  --danger: #ff6b6b;
  --warning: #ffd166;
  --shadow: 0 24px 80px rgba(0, 0, 0, .38);
  --radius: 22px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 8%, rgba(86, 216, 255, .16), transparent 32%),
    radial-gradient(circle at 82% 0%, rgba(140, 255, 210, .11), transparent 30%),
    linear-gradient(135deg, #050a14 0%, #07111f 48%, #0b1628 100%);
  overflow-x: hidden;
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 292px;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  background: rgba(5, 12, 23, .88);
  backdrop-filter: blur(22px);
  border-right: 1px solid var(--line);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 20px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
}
.brand-block strong { display: block; font-size: 16px; letter-spacing: .02em; }
.brand-block span { color: var(--muted); font-size: 13px; }

.side-nav { display: grid; gap: 8px; }
.nav-item {
  border: 1px solid transparent;
  width: 100%;
  text-align: left;
  min-height: 48px;
  border-radius: 16px;
  padding: 0 14px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
  transition: .18s ease;
}
.nav-item:hover, .nav-item.active {
  color: var(--text);
  background: rgba(86, 216, 255, .10);
  border-color: rgba(86, 216, 255, .22);
}
.sidebar-status {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 18px;
  color: var(--muted);
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  font-weight: 800;
  font-size: 13px;
}
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 0 5px rgba(255, 209, 102, .12);
  flex: 0 0 auto;
}
.status-dot.ok {
  background: var(--brand-2);
  box-shadow: 0 0 0 5px rgba(140, 255, 210, .13);
}

.mobile-menu-toggle {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: 12px;
  z-index: 70;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: rgba(7, 17, 31, .86);
  color: var(--text);
  display: none;
  box-shadow: var(--shadow);
}
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(0,0,0,.56);
  backdrop-filter: blur(2px);
}

.app-main {
  min-height: 100vh;
  margin-left: 292px;
  padding: 34px clamp(18px, 3vw, 38px) 44px;
  position: relative;
}

.hero, .panel, .window-frame {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.04));
  box-shadow: var(--shadow);
}
.compact-hero {
  padding: clamp(22px, 4vw, 40px);
  min-height: 238px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  position: relative;
}

.hero-content {
  position: relative;
  z-index: 1;
}
.page-brand-logo {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top, 0px));
  right: clamp(18px, 3vw, 38px);
  z-index: 20;
  width: clamp(150px, 16vw, 230px);
  padding: 7px 9px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .96);
  border: 1px solid rgba(255, 255, 255, .78);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .24);
  pointer-events: none;
}
.page-brand-logo img {
  width: 100%;
  height: auto;
}

.compact-hero::after {
  content: "";
  position: absolute;
  right: -90px;
  top: -80px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(86,216,255,.28), transparent 65%);
}
.hero h1 {
  margin: 10px 0 10px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: .96;
  letter-spacing: -.06em;
}
.hero p {
  margin: 0;
  max-width: 760px;
  color: var(--muted);
  font-size: clamp(15px, 2vw, 18px);
  line-height: 1.55;
}
.eyebrow {
  display: inline-block;
  color: var(--brand);
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: 11px;
}

.critical-note {
  margin: 18px 0;
  padding: 16px 18px;
  border-radius: 20px;
  color: #f4fbff;
  background: rgba(255, 209, 102, .10);
  border: 1px solid rgba(255, 209, 102, .26);
  line-height: 1.5;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}
.metric-card {
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.06);
}
.metric-card span { display: block; color: var(--muted); font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .1em; }
.metric-card strong { display: block; margin: 6px 0; font-size: clamp(28px, 4vw, 42px); letter-spacing: -.04em; }
.metric-card small { color: var(--muted-2); font-weight: 800; }

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
}

.panel { padding: 18px; }
.panel-header, .window-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}
.panel-header h2, .window-header h2 {
  margin: 3px 0 0;
  font-size: 23px;
  letter-spacing: -.035em;
}

.floating-window {
  width: min(760px, calc(100vw - 28px));
  max-height: min(88vh, 860px);
  padding: 0;
  color: var(--text);
  border: 0;
  background: transparent;
  overflow: visible;
}
.large-window { width: min(1040px, calc(100vw - 28px)); }
.floating-window::backdrop {
  background: rgba(0,0,0,.68);
  backdrop-filter: blur(7px);
}
.window-frame {
  max-height: min(88vh, 860px);
  overflow: auto;
  padding: clamp(16px, 2.6vw, 24px);
  background: var(--surface-strong);
}

.segmented {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px;
  border-radius: 18px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
  margin-bottom: 16px;
  -webkit-overflow-scrolling: touch;
}
.segment {
  min-height: 42px;
  flex: 0 0 auto;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}
.segment.active {
  background: linear-gradient(135deg, rgba(86,216,255,.18), rgba(140,255,210,.12));
  color: var(--text);
  border-color: rgba(86,216,255,.30);
}

.field { display: grid; gap: 8px; margin: 0 0 14px; }
.field span { color: #dbe9fa; font-weight: 900; font-size: 13px; }
.field small { color: var(--muted-2); font-weight: 800; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  min-height: 48px;
  padding: 12px 14px;
  color: var(--text);
  background: rgba(2, 8, 18, .62);
  outline: none;
}
textarea { resize: vertical; line-height: 1.45; }
input:focus, textarea:focus, select:focus { border-color: rgba(86,216,255,.72); box-shadow: 0 0 0 4px rgba(86,216,255,.12); }
.hidden { display: none !important; }

.file-drop {
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 176px;
  border: 1px dashed rgba(86,216,255,.36);
  border-radius: 20px;
  padding: 20px;
  background: rgba(86,216,255,.07);
  margin-bottom: 14px;
}
.file-drop input { display: none; }
.file-drop__icon { font-size: 32px; color: var(--brand); }
.file-drop strong { margin-top: 6px; }
.file-drop small { color: var(--muted); }

.cloud-help {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(86,216,255,.22);
  background: rgba(86,216,255,.08);
  color: #ddecff;
  margin-bottom: 14px;
  line-height: 1.5;
}

.primary-btn, .secondary-btn, .ghost-btn, .danger-btn, .import-btn, .icon-btn {
  border: 1px solid transparent;
  min-height: 46px;
  padding: 10px 15px;
  border-radius: 15px;
  font-weight: 900;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, opacity .16s ease;
}
.primary-btn:hover, .secondary-btn:hover, .ghost-btn:hover, .danger-btn:hover, .import-btn:hover, .icon-btn:hover { transform: translateY(-1px); }
.primary-btn:disabled, .secondary-btn:disabled, .ghost-btn:disabled { opacity: .48; cursor: not-allowed; transform: none; }
.primary-btn { background: linear-gradient(135deg, var(--brand), #b7f3ff); color: #06101b; }
.secondary-btn, .import-btn { color: var(--text); background: rgba(255,255,255,.08); border-color: var(--line); }
.ghost-btn { color: var(--muted); background: transparent; border-color: var(--line); }
.danger-btn { color: #ffe9e9; background: rgba(255,107,107,.13); border-color: rgba(255,107,107,.32); }
.icon-btn { width: 44px; height: 44px; padding: 0; color: var(--text); background: rgba(255,255,255,.07); border-color: var(--line); font-size: 24px; line-height: 1; }
.small { min-height: 38px; padding: 8px 11px; border-radius: 12px; font-size: 13px; }
.import-btn { position: relative; overflow: hidden; }
.import-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.form-actions, .qr-actions, .backup-actions, .dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.sticky-actions {
  position: sticky;
  bottom: -24px;
  background: linear-gradient(180deg, rgba(16,31,52,0), rgba(16,31,52,1) 30%);
  padding-top: 18px;
  padding-bottom: 2px;
}

.qr-card {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 300px;
  border-radius: 20px;
  background: #fff;
  padding: 16px;
  overflow: hidden;
  margin: 14px 0;
}
#qrCanvas { width: min(100%, 278px); height: auto; display: none; }
.qr-placeholder {
  position: absolute;
  inset: 16px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(0,0,0,.18);
  border-radius: 16px;
  color: #334155;
  text-align: center;
  padding: 20px;
  font-weight: 900;
}
.pill {
  display: inline-flex;
  align-items: center;
  width: max-content;
  padding: 8px 11px;
  border-radius: 999px;
  color: #06101b;
  background: var(--brand);
  font-weight: 900;
  font-size: 12px;
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr 190px;
  gap: 10px;
  margin-bottom: 14px;
}
.records-list { display: grid; gap: 10px; }
.compact-list .record-card:nth-child(n+5) { display: none; }
.record-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.045);
}
.record-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: #06101b;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  font-weight: 1000;
}
.record-content { min-width: 0; }
.record-content h3 { margin: 0 0 4px; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.record-content p { margin: 0 0 6px; color: var(--muted); font-size: 13px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.record-content small { color: var(--muted-2); font-weight: 800; }
.record-actions { display: flex; gap: 8px; }
.empty-state {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
}

.dialog-body { display: grid; gap: 10px; }
.detail-row {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 15px;
  background: rgba(255,255,255,.055);
  border: 1px solid var(--line);
  color: var(--muted);
  word-break: break-word;
}
.detail-row strong { color: var(--text); }
.detail-row a { color: var(--brand); }
.muted-text { color: var(--muted); line-height: 1.5; }
.help-stack { display: grid; gap: 12px; }
.help-stack article {
  padding: 14px;
  border-radius: 17px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.05);
}
.help-stack h3 { margin: 0 0 7px; }
.help-stack p { margin: 0; color: var(--muted); line-height: 1.5; }

@media (max-width: 980px) {
  .mobile-menu-toggle { display: grid; place-items: center; }
  .sidebar {
    transform: translateX(-108%);
    transition: transform .2s ease;
    width: min(292px, calc(100vw - 58px));
  }
  body.menu-open .sidebar { transform: translateX(0); }
  .app-main { margin-left: 0; padding: calc(70px + env(safe-area-inset-top, 0px)) 14px 34px; }
  .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .compact-hero { min-height: 220px; padding: 22px; }
  .dashboard-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric-card { padding: 14px; }
  .quick-actions > * { flex: 1 1 100%; }
  .toolbar { grid-template-columns: 1fr; }
  .record-card { grid-template-columns: 44px minmax(0, 1fr); align-items: start; }
  .record-icon { width: 44px; height: 44px; border-radius: 14px; }
  .record-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; }
  .form-actions, .qr-actions, .backup-actions, .dialog-actions { display: grid; grid-template-columns: 1fr; }
  .floating-window, .large-window { width: calc(100vw - 18px); }
  .window-frame { max-height: 90vh; padding: 14px; border-radius: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

.primary-btn.alt {
  background: linear-gradient(135deg, var(--brand-2), #d9fff3);
  color: #06101b;
}

.custom-segment {
  min-height: 42px;
  flex: 0 0 auto;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}
.custom-segment.active {
  background: linear-gradient(135deg, rgba(140,255,210,.20), rgba(86,216,255,.12));
  color: var(--text);
  border-color: rgba(140,255,210,.32);
}
.cloud-integration-panel {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(140,255,210,.22);
  background: rgba(140,255,210,.08);
  color: #dffef4;
  margin-bottom: 14px;
  line-height: 1.5;
}
.cloud-integration-panel .cloud-ok { color: var(--brand-2); font-weight: 900; }
.cloud-integration-panel .cloud-off { color: var(--warning); font-weight: 900; }
.two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.compact-drop { min-height: 132px; }
.preview-box {
  margin-top: 8px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.045);
  padding: 14px;
}
.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.custom-preview-card {
  border-radius: 18px;
  min-height: 132px;
  padding: 18px;
  background:
    radial-gradient(circle at 12% 0%, rgba(86,216,255,.16), transparent 28%),
    linear-gradient(135deg, rgba(255,255,255,.08), rgba(255,255,255,.035));
  border: 1px solid var(--line);
  color: var(--muted);
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.custom-preview-card article span {
  display: inline-flex;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(86,216,255,.14);
  color: var(--brand);
  font-size: 11px;
  font-weight: 1000;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.custom-preview-card h3 {
  margin: 12px 0 8px;
  color: var(--text);
  font-size: 22px;
  letter-spacing: -.03em;
}
.custom-preview-card p { margin: 0; }
.custom-preview-card strong { color: var(--text); }
.custom-preview-card small { color: var(--muted-2); font-weight: 900; }

@media (max-width: 640px) {
  .two-columns { grid-template-columns: 1fr; gap: 0; }
  .preview-header { align-items: stretch; flex-direction: column; }
}


/* v1.5.0 — Modo compacto mobile-first */
.compact-hero {
  padding: clamp(18px, 3vw, 28px);
}
.compact-hero h1 {
  margin-bottom: 6px;
}
.compact-hero p {
  max-width: 720px;
  margin-bottom: 0;
}
.compact-window .window-frame,
.large-window .window-frame {
  max-height: calc(100dvh - 24px);
  overflow: auto;
  scrollbar-width: none;
}
.compact-window .window-frame::-webkit-scrollbar,
.large-window .window-frame::-webkit-scrollbar {
  display: none;
}
.window-frame {
  gap: 12px;
}
.field {
  gap: 6px;
}
.field textarea {
  min-height: 82px;
}
.field input,
.field select,
.field textarea,
.search-input,
.select-input {
  min-height: 44px;
}
.personalization-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}
.custom-segment,
.segment {
  padding: 10px 8px;
  font-size: 12px;
}
.preview-box {
  padding: 10px;
}
.custom-preview-card {
  max-height: 128px;
  overflow: auto;
  scrollbar-width: none;
}
.custom-preview-card::-webkit-scrollbar {
  display: none;
}
.form-actions,
.compact-actions,
.backup-actions,
.qr-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}
.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn,
.import-btn {
  min-height: 44px;
  padding: 10px 12px;
}
.backup-compact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.mini-note,
.status-card {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.045);
  border-radius: 16px;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}
.status-card.status-ok {
  border-color: rgba(140,255,210,.32);
  color: #b9ffe8;
  background: rgba(40,200,155,.10);
}
.status-card.status-bad {
  border-color: rgba(255,110,110,.38);
  color: #ffd2d2;
  background: rgba(255,80,80,.10);
}
.qr-card {
  padding: 10px;
}
.qr-card canvas {
  max-width: min(66vw, 260px);
  height: auto;
}
.records-list {
  max-height: min(56dvh, 520px);
  overflow: auto;
  scrollbar-width: none;
}
.records-list::-webkit-scrollbar {
  display: none;
}
.help-stack {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}
.help-stack article {
  padding: 10px;
}
.help-stack p {
  font-size: 13px;
  line-height: 1.35;
}
@media (max-width: 760px) {
  .app-main {
    padding: calc(92px + env(safe-area-inset-top, 0px)) 10px 14px;
  }
  .dashboard-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }
  .metric-card {
    padding: 10px 6px;
  }
  .metric-card span,
  .metric-card small {
    font-size: 10px;
  }
  .metric-card strong {
    font-size: 16px;
  }
  .quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .floating-window {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
  }
  .window-frame {
    padding: 12px;
  }
  .window-header h2 {
    font-size: 20px;
  }
  .personalization-tabs {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .custom-segment {
    font-size: 10px;
    padding: 8px 4px;
  }
  .backup-compact-grid,
  .two-columns {
    grid-template-columns: 1fr;
  }
  .form-actions.sticky-actions {
    position: static;
  }
}


/* v1.6.0 — QR Rápido */
.quick-detect-card {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.045);
  color: var(--muted);
  border-radius: 16px;
  padding: 10px 12px;
  font-weight: 800;
  font-size: 13px;
}
.quick-detect-card.ok {
  border-color: rgba(140,255,210,.30);
  color: #b9ffe8;
  background: rgba(40,200,155,.10);
}
#quickWindow textarea {
  min-height: 96px;
}
@media (max-width: 760px) {
  #quickWindow .window-frame {
    max-height: calc(100dvh - 18px);
  }
  #quickWindow textarea {
    min-height: 112px;
  }
}

/* v1.7.0 — ajustes premium, Supabase direto e tela pública inteligente */
.settings-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(170, 194, 229, .18);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(13, 26, 48, .92), rgba(10, 18, 34, .72));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.settings-card strong { color: var(--text); font-size: .95rem; }
.settings-card small { color: var(--muted); line-height: 1.35; }
.compact-actions.thin { gap: 8px; }
.compact-actions.thin .secondary-btn,
.compact-actions.thin .ghost-btn { min-height: 38px; padding: 9px 12px; font-size: .82rem; }
.public-route-active .sidebar,
.public-route-active .mobile-menu-toggle,
.public-route-active .sidebar-backdrop,
.public-route-active .app-main,
.public-route-active dialog.floating-window { display: none !important; }
.public-route-view {
  min-height: 100vh;
  padding: max(22px, env(safe-area-inset-top)) 16px max(22px, env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 12%, rgba(74, 144, 226, .34), transparent 36%),
    radial-gradient(circle at 78% 86%, rgba(31, 214, 161, .20), transparent 34%),
    linear-gradient(145deg, #050a13, #07111f 52%, #0d1d35);
}
.public-card-shell { width: min(680px, 100%); position: relative; }
.public-glow {
  position: absolute;
  inset: -50px;
  filter: blur(55px);
  background: linear-gradient(135deg, rgba(78, 156, 255, .18), rgba(31, 214, 161, .16));
  opacity: .85;
}
.public-card {
  position: relative;
  border: 1px solid rgba(210, 226, 255, .18);
  border-radius: 30px;
  padding: clamp(22px, 5vw, 42px);
  background: linear-gradient(150deg, rgba(12, 23, 42, .94), rgba(7, 13, 25, .88));
  box-shadow: 0 30px 90px rgba(0, 0, 0, .44), inset 0 1px 0 rgba(255,255,255,.08);
  color: #edf5ff;
}
.public-card-error { border-color: rgba(255, 122, 122, .35); }
.public-topline { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 18px; }
.public-icon {
  width: 54px;
  height: 54px;
  display: inline-grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(78, 156, 255, .30), rgba(31, 214, 161, .18));
  border: 1px solid rgba(210, 226, 255, .20);
  font-weight: 950;
  letter-spacing: .06em;
}
.public-card h1 {
  margin: 0;
  font-size: clamp(1.9rem, 6vw, 3.1rem);
  line-height: .96;
  letter-spacing: -.05em;
}
.public-description { color: #aebbd1; font-weight: 700; line-height: 1.5; }
.public-value {
  margin: 22px 0;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(210, 226, 255, .13);
  display: grid;
  gap: 10px;
  overflow-wrap: anywhere;
}
.public-value strong { font-size: 1.05rem; }
.public-value p { margin: 0; white-space: pre-wrap; line-height: 1.55; color: #dce8f8; }
.public-value span { color: #aebbd1; }
.public-value a { color: #8cc4ff; font-weight: 900; }
.public-image {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  border-radius: 18px;
  background: rgba(0,0,0,.22);
}
.public-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: 10px;
  align-items: stretch;
}
.public-action { justify-content: center; text-align: center; text-decoration: none; }
.public-footnote { display: block; margin-top: 18px; color: #7f8ba0; text-align: center; font-weight: 800; }
@media (max-width: 720px) {
  .public-route-view { align-items: stretch; padding-inline: 12px; }
  .public-card-shell { margin: auto 0; }
  .public-card { border-radius: 24px; }
  .public-actions { grid-template-columns: 1fr; }
}

/* v1.8.0 — Câmera → Google Drive → QR Code e home mais enxuta */
.action-hub {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
}
.hero-action {
  min-height: 50px;
  text-align: center;
}
.compact-cloud {
  margin-bottom: 12px;
}
.camera-frame {
  overflow-x: hidden;
}
.camera-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr);
  gap: 14px;
  align-items: start;
}
.camera-stage {
  display: grid;
  gap: 12px;
  min-width: 0;
}
.camera-video,
.camera-preview {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 22px;
  border: 1px solid rgba(172,198,233,.22);
  background: rgba(0,0,0,.42);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.camera-preview {
  object-fit: contain;
  background: rgba(0,0,0,.24);
}
.camera-manual-drop {
  min-height: 126px;
  margin-bottom: 0;
}
.camera-controls {
  min-width: 0;
  display: grid;
  gap: 12px;
}
.camera-action-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.manual-link-field {
  margin-bottom: 0;
}
.camera-result {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(140,255,210,.24);
  background: rgba(140,255,210,.07);
  border-radius: 20px;
  padding: 12px;
}
.compact-camera-qr {
  min-height: 238px;
  margin: 0;
}
.compact-camera-qr canvas {
  display: block;
  width: min(100%, 220px);
  height: auto;
}
.status-card.status-ok,
.mini-note.status-ok {
  border-color: rgba(140,255,210,.32);
  color: #b9ffe8;
  background: rgba(40,200,155,.10);
}
.status-card.status-bad,
.mini-note.status-bad {
  border-color: rgba(255,110,110,.38);
  color: #ffd2d2;
  background: rgba(255,80,80,.10);
}
@media (max-width: 820px) {
  .page-brand-logo {
    top: calc(16px + env(safe-area-inset-top, 0px));
    right: 12px;
    width: 136px;
    padding: 4px 7px;
    border-radius: 13px;
  }
  .camera-grid {
    grid-template-columns: 1fr;
  }
  .camera-action-grid {
    grid-template-columns: 1fr;
  }
  .camera-video,
  .camera-preview {
    max-height: 42dvh;
  }
}
@media (max-width: 520px) {

  .page-brand-logo {
    top: calc(16px + env(safe-area-inset-top, 0px));
    right: max(12px, env(safe-area-inset-right, 0px));
    width: min(128px, 34vw);
    padding: 4px 7px;
    border-radius: 13px;
    overflow: visible;
  }
  .action-hub {
    grid-template-columns: 1fr 1fr;
  }
  .hero-action {
    min-height: 46px;
    font-size: 13px;
  }
  .compact-hero {
    min-height: 174px;
  }
  .compact-hero .eyebrow {
    max-width: 100%;
  }
}


/* v1.9.0-light — interface enxuta, abertura por QR com botão único de opções */
.light-tag {
  display: inline-block;
  margin-left: .18em;
  padding: .02em .22em .08em;
  border-radius: .5em;
  font-family: "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;
  font-size: .72em;
  font-weight: 900;
  letter-spacing: .01em;
  color: #06101b;
  background: linear-gradient(135deg, #ffed4a, #ff5eca 58%, #56d8ff);
  transform: rotate(-4deg) translateY(-.04em);
  box-shadow: 0 8px 26px rgba(255, 94, 202, .26);
  text-shadow: none;
  vertical-align: middle;
}
.light-tag-mini {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px 3px;
  border-radius: 999px;
  font-family: "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;
  font-size: 12px;
  line-height: 1;
  color: #06101b;
  background: #ffed4a;
  font-style: normal;
  transform: rotate(-5deg);
}
.light-shell .window-frame {
  border-radius: 24px;
}
.light-shell .window-header {
  margin-bottom: 12px;
}
.light-shell .field {
  margin-bottom: 12px;
}
.dialog-options-trigger,
.public-options-trigger {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 16px;
}
.dialog-options-btn,
.public-options-btn {
  min-width: 168px;
  border-radius: 999px;
  box-shadow: 0 12px 32px rgba(86, 216, 255, .18);
}
.dialog-options-btn.is-open,
.public-options-btn.is-open {
  background: linear-gradient(135deg, #ffed4a, #ff5eca);
  color: #06101b;
}
.dialog-options-panel,
.public-options-panel {
  margin-top: 14px;
  padding: 12px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.045);
}
.dialog-details-panel {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.record-lite-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(210,226,255,.16);
  background: linear-gradient(145deg, rgba(255,255,255,.075), rgba(255,255,255,.035));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.record-lite-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  color: #06101b;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  font-weight: 1000;
  letter-spacing: .04em;
}
.record-lite-content {
  min-width: 0;
  display: grid;
  gap: 6px;
}
.record-lite-content span {
  color: var(--brand);
  font-size: 11px;
  font-weight: 1000;
  text-transform: uppercase;
  letter-spacing: .12em;
}
.record-lite-content strong {
  color: var(--text);
  font-size: clamp(1.12rem, 4vw, 1.55rem);
  line-height: 1.06;
  overflow-wrap: anywhere;
}
.record-lite-content small,
.record-lite-content p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.record-lite-content a { color: var(--brand); font-weight: 900; }
.light-public-shell { width: min(540px, 100%); }
.public-card-light {
  padding: clamp(20px, 4vw, 34px);
  border-radius: 28px;
}
.public-topline-light {
  margin-bottom: 14px;
}
.public-card-light h1 {
  font-size: clamp(1.7rem, 5.4vw, 2.55rem);
}
.public-value-file strong {
  display: block;
  margin-bottom: 2px;
}
.public-value-file a {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.public-options-panel[hidden] { display: none !important; }
.public-options-panel .public-actions {
  grid-template-columns: 1fr;
}
@media (max-width: 640px) {
  .light-tag {
    display: table;
    margin: 8px 0 0;
    font-size: .68em;
  }
  .record-lite-card {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .record-lite-icon {
    margin-inline: auto;
  }
  .dialog-options-panel .dialog-actions {
    grid-template-columns: 1fr;
  }
}
