/* ============================================================
   Safe Q-Web — app shell + screen styles
   Built on the 205 / Entry design tokens.
   ============================================================ */

/* ---------- Frame & body ---------- */
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(circle at 20% 0%, rgba(93,211,200,0.10) 0%, transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(255,157,190,0.12) 0%, transparent 55%),
    #1F2226;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--fg-1);
  overflow-x: hidden;
}

#root {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}

/* ---------- Phone frame ---------- */
.phone {
  width: 390px;
  height: 844px;
  background: var(--bg-1);
  border-radius: 48px;
  box-shadow:
    0 0 0 10px #0B0D10,
    0 0 0 12px #2A2D33,
    0 40px 80px rgba(0,0,0,0.55),
    0 20px 40px rgba(255,157,190,0.10);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

@media (max-width: 500px) {
  body { background: var(--bg-1); }
  #root { padding: 0; }
  .phone {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    box-shadow: none;
  }
}

/* iOS-style status bar */
.status-bar {
  height: 44px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  color: var(--fg-1);
  background: var(--bg-1);
  position: relative;
  z-index: 10;
  flex-shrink: 0;
  white-space: nowrap;
}
.status-bar > span, .status-bar .right span { white-space: nowrap; word-break: normal; }
.status-bar .right {
  display: flex;
  align-items: center;
  gap: 6px;
}
.status-bar .battery {
  width: 26px; height: 13px;
  border: 1.2px solid var(--fg-1);
  border-radius: 3px;
  position: relative;
  padding: 1.5px;
}
.status-bar .battery::after {
  content: ''; position: absolute; right: -3.5px; top: 4px;
  width: 2px; height: 4px; background: var(--fg-1); border-radius: 0 1px 1px 0;
}
.status-bar .battery-fill {
  height: 100%; width: 80%; background: var(--fg-1); border-radius: 1.5px;
}

/* Dynamic Island */
.dynamic-island {
  position: absolute;
  top: 10px; left: 50%; transform: translateX(-50%);
  width: 110px; height: 28px;
  background: #000; border-radius: 999px;
  z-index: 20;
  pointer-events: none;
}

/* Screen viewport (scrollable) */
.screen {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  position: relative;
  background: var(--bg-1);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.screen::-webkit-scrollbar { width: 0; }

/* ---------- Bottom tab bar ---------- */
.tabbar {
  flex-shrink: 0;
  height: 78px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-1);
  display: flex;
  padding: 6px 12px 18px;
  gap: 4px;
}
.tabbar.hidden { display: none; }
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: none;
  background: transparent;
  padding: 6px 4px;
  cursor: pointer;
  color: var(--fg-3);
  font-family: inherit;
  border-radius: var(--radius-md);
  transition: color var(--dur-fast) var(--ease-standard);
}
.tab:hover { color: var(--fg-1); }
.tab svg { width: 24px; height: 24px; }
.tab span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  word-break: normal;
}
.tab.active { color: var(--c205-mint-deep); }
.tab.active svg { stroke-width: 2.2; }

/* ---------- App-wide buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
  cursor: pointer;
  border: 1.5px solid transparent;
  white-space: nowrap;
  word-break: normal;
  transition: all var(--dur-fast) var(--ease-standard);
  text-decoration: none;
}
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: .45; cursor: not-allowed; pointer-events: none; }

.btn-block { width: 100%; }

.btn-mint { background: var(--c205-mint); color: #fff; border-color: var(--c205-mint); }
.btn-mint:hover { background: var(--c205-mint-hover); box-shadow: var(--shadow-mint-glow); }
.btn-mint-soft { background: var(--c205-mint-soft); color: var(--c205-mint-press); border-color: var(--c205-mint-soft); }
.btn-mint-soft:hover { background: var(--c205-mint-tint); }

.btn-pink { background: var(--c205-pink); color: #fff; border-color: var(--c205-pink); }
.btn-pink:hover { background: var(--c205-pink-hover); box-shadow: var(--shadow-pink-glow); }
.btn-pink-soft { background: var(--c205-pink-soft); color: var(--c205-pink-press); border-color: var(--c205-pink-soft); }

.btn-outline { background: #fff; color: var(--fg-1); border-color: var(--border-2); }
.btn-outline:hover { border-color: var(--c205-mint); color: var(--c205-mint-deep); }

.btn-ghost { background: transparent; color: var(--fg-2); border-color: transparent; }
.btn-ghost:hover { background: var(--bg-3); color: var(--fg-1); }

.btn-danger { background: var(--color-danger); color: #fff; border-color: var(--color-danger); }
.btn-danger:hover { filter: brightness(0.95); }

.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-lg { padding: 16px 22px; font-size: 16px; }

/* ---------- Inputs ---------- */
.field { margin-bottom: 14px; }
.field-label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--fg-1); margin-bottom: 6px;
}
.input {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--border-1);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-family: inherit;
  background: var(--bg-1);
  color: var(--fg-1);
  transition: all var(--dur-fast) var(--ease-standard);
  box-sizing: border-box;
}
.input:focus {
  outline: none;
  border-color: var(--c205-mint);
  box-shadow: 0 0 0 3px var(--c205-mint-soft);
}
.input::placeholder { color: var(--fg-4); }
.input.err { border-color: var(--color-danger); }
.input.err:focus { box-shadow: 0 0 0 3px var(--color-danger-soft); }
.input-with-icon { position: relative; }
.input-with-icon .input { padding-left: 44px; }
.input-with-icon .icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--fg-3);
  pointer-events: none;
}
.input-with-icon .input:focus + .icon,
.input-with-icon:focus-within .icon { color: var(--c205-mint-deep); }

/* ---------- Page header ---------- */
.page-header {
  padding: 16px 24px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-1);
  flex-shrink: 0;
}
.page-header h1 {
  font-size: 20px;
  font-weight: 800;
  color: var(--fg-1);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.page-header .actions { display: flex; gap: 8px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--bg-2); border: none;
  color: var(--fg-2); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all var(--dur-fast) var(--ease-standard);
}
.icon-btn:hover { background: var(--bg-3); color: var(--fg-1); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- Tag / chip ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  word-break: normal;
}
.chip-mint { background: var(--c205-mint-soft); color: var(--c205-mint-press); }
.chip-pink { background: var(--c205-pink-soft); color: var(--c205-pink-press); }
.chip-success { background: var(--color-success-soft); color: #0F7A52; }
.chip-warn { background: var(--color-warning-soft); color: #7A5D00; }
.chip-danger { background: var(--color-danger-soft); color: #A62020; }
.chip-neutral { background: var(--bg-3); color: var(--fg-2); }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.7; }

/* ---------- Card ---------- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-1);
  box-shadow: var(--shadow-1);
}

/* ---------- Toast ---------- */
.toast-host {
  position: absolute; left: 0; right: 0;
  top: 60px;
  pointer-events: none;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
}
.toast {
  pointer-events: auto;
  background: rgba(37, 38, 40, 0.95);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 18px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-3);
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 90%;
  animation: toast-in 320ms var(--ease-pop);
}
.toast.success { background: #1E6E48; }
.toast.danger { background: #B81F1F; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-12px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- Modal ---------- */
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(15, 17, 20, 0.55);
  backdrop-filter: blur(2px);
  z-index: 200;
  display: flex; align-items: flex-end;
  animation: fade-in 200ms ease;
}
.modal-backdrop.center { align-items: center; justify-content: center; }
.modal {
  width: 100%;
  background: var(--bg-1);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 24px 24px 32px;
  box-shadow: var(--shadow-4);
  animation: sheet-up 320ms var(--ease-pop);
  max-height: 80%;
  overflow-y: auto;
  box-sizing: border-box;
}
.modal.dialog {
  width: calc(100% - 48px);
  max-width: 340px;
  margin: 24px;
  border-radius: var(--radius-xl);
  padding: 24px;
  animation: pop-in 280ms var(--ease-pop);
}
.modal .handle {
  width: 40px; height: 4px;
  background: var(--neutral-300);
  border-radius: 999px;
  margin: -8px auto 16px;
}
.modal h3 { margin-bottom: 4px; }
.modal p { margin-bottom: 16px; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
@keyframes pop-in {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ============================================================
   Screen-specific styles
   ============================================================ */

/* ---------- Login ---------- */
.login {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px 28px 28px;
  background:
    radial-gradient(circle at 80% 0%, rgba(255,157,190,0.18) 0%, transparent 45%),
    radial-gradient(circle at 0% 100%, rgba(93,211,200,0.12) 0%, transparent 40%),
    var(--bg-1);
  position: relative;
}
.login-brand {
  margin-top: 24px;
  margin-bottom: 32px;
}
.login-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}
.login-mark-icon {
  width: 44px; height: 44px;
  border-radius: 14px;
  background: var(--c205-mint);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: var(--shadow-mint-glow);
}
.login-mark-icon svg { width: 24px; height: 24px; }
.login-mark-text {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--fg-1);
}
.login-mark-text .q {
  color: var(--c205-pink-press);
}
.login-headline {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--fg-1);
  margin-bottom: 12px;
}
.login-headline .accent {
  color: var(--c205-mint-deep);
}
.login-sub {
  font-size: 14px;
  color: var(--fg-3);
  line-height: 1.55;
}

.login-form { display: flex; flex-direction: column; gap: 0; }

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 18px;
}
.checkbox {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--fg-2); cursor: pointer;
  user-select: none;
}
.checkbox input { display: none; }
.checkbox .box {
  width: 18px; height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--border-2);
  background: var(--bg-1);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
  transition: all var(--dur-fast) var(--ease-standard);
}
.checkbox input:checked + .box {
  background: var(--c205-mint);
  border-color: var(--c205-mint);
}
.checkbox .box svg { width: 12px; height: 12px; opacity: 0; }
.checkbox input:checked + .box svg { opacity: 1; }
.link-tiny {
  font-size: 13px;
  color: var(--fg-2);
  cursor: pointer;
  background: none; border: none;
  font-family: inherit;
}
.link-tiny:hover { color: var(--c205-mint-deep); text-decoration: underline; }

.login-error {
  background: var(--color-danger-soft);
  border: 1px solid #FFCCCC;
  color: #A62020;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 14px;
  line-height: 1.45;
}
.login-error svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.login-error .small { font-weight: 400; opacity: 0.85; display: block; margin-top: 2px; }

.login-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 22px 0 14px;
  color: var(--fg-4);
  font-size: 12px;
  font-weight: 500;
}
.login-divider::before, .login-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border-1);
}

.login-foot {
  margin-top: auto;
  padding-top: 28px;
  text-align: center;
  font-size: 13px;
  color: var(--fg-3);
  word-break: keep-all;
}
.login-foot button { white-space: nowrap; }
.login-foot a, .login-foot button {
  color: var(--c205-mint-deep);
  font-weight: 700;
  background: none; border: none; padding: 0; cursor: pointer;
  font-family: inherit; font-size: inherit;
}
.login-foot a:hover, .login-foot button:hover { text-decoration: underline; }

.demo-helper {
  margin-top: 16px;
  padding: 10px 12px;
  background: var(--bg-2);
  border: 1px dashed var(--border-2);
  border-radius: var(--radius-md);
  font-size: 11px;
  color: var(--fg-3);
  text-align: center;
  font-family: var(--font-mono);
}
.demo-helper b { color: var(--c205-mint-deep); }

/* ---------- Home ---------- */
.home {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-2);
}
.home-greet {
  padding: 20px 24px 12px;
  background: var(--bg-1);
}
.home-greet .hi {
  font-size: 13px;
  font-weight: 600;
  color: var(--c205-mint-deep);
  margin-bottom: 4px;
  letter-spacing: 0.02em;
}
.home-greet h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.scan-cta {
  margin: 16px 20px 12px;
  padding: 24px 22px;
  background:
    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.16) 0%, transparent 40%),
    linear-gradient(135deg, var(--c205-mint) 0%, var(--c205-mint-hover) 100%);
  color: #fff;
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-mint-glow);
  cursor: pointer;
  transition: transform var(--dur-base) var(--ease-pop);
}
.scan-cta:hover { transform: translateY(-2px); }
.scan-cta:active { transform: translateY(0) scale(0.98); }
.scan-cta .title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.scan-cta .sub {
  font-size: 13px;
  font-weight: 500;
  opacity: 0.9;
  margin-bottom: 18px;
  line-height: 1.5;
}
.scan-cta .pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.22);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  backdrop-filter: blur(4px);
}
.scan-cta .qr-frame {
  position: absolute;
  right: -10px;
  bottom: -10px;
  width: 130px;
  height: 130px;
  opacity: 0.35;
}

.stat-strip {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin: 4px 20px 16px;
}
.stat {
  padding: 14px 12px;
  background: var(--bg-1);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-1);
  text-align: center;
}
.stat .num {
  font-family: var(--font-num);
  font-size: 22px;
  font-weight: 700;
  color: var(--fg-1);
  line-height: 1;
  margin-bottom: 4px;
}
.stat.danger .num { color: var(--color-danger); }
.stat.warn .num { color: #B88200; }
.stat.safe .num { color: var(--color-success); }
.stat .label {
  font-size: 11px;
  font-weight: 600;
  color: var(--fg-3);
  letter-spacing: 0.02em;
}

.section-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px 8px;
}
.section-head h3 {
  font-size: 15px; font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.section-head .more {
  font-size: 12px;
  color: var(--fg-3);
  background: none; border: none;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 2px;
}
.section-head .more:hover { color: var(--c205-mint-deep); }

.history-list {
  padding: 0 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.history-item {
  background: var(--bg-1);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-standard);
}
.history-item:hover { box-shadow: var(--shadow-2); border-color: var(--border-2); }
.history-icon {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.history-icon.safe { background: var(--color-success-soft); color: #0F7A52; }
.history-icon.warn { background: var(--color-warning-soft); color: #8A6800; }
.history-icon.danger { background: var(--color-danger-soft); color: var(--color-danger); }
.history-body { flex: 1; min-width: 0; }
.history-body .domain {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--fg-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}
.history-body .meta {
  font-size: 11px;
  color: var(--fg-3);
}

/* ---------- Scan result ---------- */
.scan {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
}
.scan > .scan-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
.scan > .scan-scroll::-webkit-scrollbar { width: 0; }

/* Top demo bar - segmented control to switch risk levels */
.demo-bar {
  background: var(--bg-2);
  padding: 12px 16px 14px;
  border-bottom: 1px solid var(--border-1);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 5;
}
.demo-bar-label {
  font-size: 10px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-3);
  margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap;
  font-weight: 700;
}
.demo-bar-label .key {
  background: var(--bg-3);
  color: var(--fg-2);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 9px;
  letter-spacing: 0;
}
.demo-bar-label .led {
  width: 6px; height: 6px;
  background: var(--c205-pink); border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}
.segment {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  background: var(--bg-1);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-1);
}
.seg-btn {
  border: none;
  background: transparent;
  padding: 8px 4px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  color: var(--fg-2);
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: all var(--dur-fast) var(--ease-standard);
  white-space: nowrap;
  word-break: normal;
}
.seg-btn:hover { color: var(--fg-1); }
.seg-btn.active {
  background: var(--fg-1);
  color: #fff;
}
.seg-btn.active.safe { background: var(--color-success); }
.seg-btn.active.warn { background: #E8A700; }
.seg-btn.active.danger { background: var(--color-danger); }

/* Risk hero */
.risk-hero {
  padding: 28px 24px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.risk-hero.safe {
  background: linear-gradient(180deg, var(--color-success-soft) 0%, transparent 100%);
}
.risk-hero.warn {
  background: linear-gradient(180deg, var(--color-warning-soft) 0%, transparent 100%);
}
.risk-hero.danger {
  background: linear-gradient(180deg, var(--color-danger-soft) 0%, transparent 100%);
}
.risk-shield {
  position: relative;
  width: 120px; height: 120px;
  margin: 0 auto 14px;
}
.risk-shield .ring {
  position: absolute; inset: 0;
  transform: rotate(-90deg);
}
.risk-shield .ring circle {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
}
.risk-shield .ring .bg { stroke: var(--bg-3); }
.risk-shield .center {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
}
.risk-shield .center .icon {
  width: 36px; height: 36px;
}
.risk-shield .score {
  font-family: var(--font-num);
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
}
.risk-shield .score-label {
  font-size: 10px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-3);
  margin-top: 2px;
}
.risk-hero.safe .ring .fg { stroke: var(--color-success); }
.risk-hero.warn .ring .fg { stroke: #E8A700; }
.risk-hero.danger .ring .fg { stroke: var(--color-danger); }
.risk-hero.safe .center .icon { color: var(--color-success); }
.risk-hero.warn .center .icon { color: #E8A700; }
.risk-hero.danger .center .icon { color: var(--color-danger); }
.risk-hero.safe .score { color: var(--color-success); }
.risk-hero.warn .score { color: #B88200; }
.risk-hero.danger .score { color: var(--color-danger); }

.risk-level {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.risk-hero.safe .risk-level { color: #0F7A52; }
.risk-hero.warn .risk-level { color: #8A6800; }
.risk-hero.danger .risk-level { color: #A62020; }
.risk-tagline {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg-2);
  line-height: 1.5;
}

.confidence-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 11px;
  color: var(--fg-3);
  font-family: var(--font-mono);
  white-space: nowrap;
}

/* URL card */
.url-card {
  margin: -8px 16px 16px;
  background: var(--bg-1);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-2);
  position: relative;
  z-index: 1;
}
.url-card .domain-row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
}
.url-card .domain {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--fg-1);
  letter-spacing: -0.01em;
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.url-card .full-url {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-3);
  word-break: break-all;
  line-height: 1.45;
  padding: 8px 10px;
  background: var(--bg-2);
  border-radius: var(--radius-sm);
}
.url-card .meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px;
  font-size: 11px;
  color: var(--fg-3);
  white-space: nowrap;
}
.url-card .meta .copy {
  background: none; border: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--fg-3); font-family: inherit; font-size: 11px;
  font-weight: 600;
}
.url-card .meta .copy:hover { color: var(--c205-mint-deep); }

/* Preview card */
.preview-card {
  margin: 0 16px 16px;
  background: var(--bg-1);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.preview-card .image {
  height: 140px;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-3);
  position: relative;
}
.preview-card .image .lock {
  position: absolute;
  inset: 0;
  background: rgba(166, 32, 32, 0.6);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  gap: 6px;
  color: #fff;
  backdrop-filter: blur(3px);
  font-size: 12px; font-weight: 700;
}
.preview-card .image .lock span { white-space: nowrap; }
.preview-card .image .lock svg { width: 28px; height: 28px; }
.preview-card .body { padding: 12px 14px; }
.preview-card .title {
  font-size: 14px;
  font-weight: 700;
  color: var(--fg-1);
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}
.preview-card .desc {
  font-size: 12px;
  color: var(--fg-3);
  line-height: 1.5;
}

/* Reason list */
.section {
  margin: 0 16px 16px;
}
.section h4 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 8px;
  font-family: var(--font-mono);
}
.reason-list {
  background: var(--bg-1);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.reason-row {
  padding: 12px 14px;
  display: flex; align-items: flex-start; gap: 10px;
  border-bottom: 1px solid var(--border-1);
  font-size: 13px;
  line-height: 1.5;
  color: var(--fg-1);
}
.reason-row:last-child { border-bottom: none; }
.reason-row .bullet {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800;
  font-family: var(--font-num);
}
.reason-row.safe .bullet { background: var(--color-success-soft); color: #0F7A52; }
.reason-row.warn .bullet { background: var(--color-warning-soft); color: #8A6800; }
.reason-row.danger .bullet { background: var(--color-danger-soft); color: var(--color-danger); }
.reason-row.neutral .bullet { background: var(--bg-3); color: var(--fg-2); }
.reason-row .text { flex: 1; }
.reason-row .text strong { font-weight: 700; color: var(--fg-1); }
.reason-row .stat-num {
  font-family: var(--font-num);
  font-weight: 700;
  color: inherit;
}

/* Action bar at bottom */
.scan-actions {
  flex-shrink: 0;
  padding: 12px 16px 16px;
  background: rgba(255,255,255,0.96);
  border-top: 1px solid var(--border-1);
  backdrop-filter: blur(20px);
  display: flex;
  gap: 8px;
}
.scan-actions .btn { flex: 1; padding: 14px; font-size: 14px; white-space: nowrap; }
.scan-actions .btn-icon {
  width: 48px;
  flex: 0 0 48px;
  padding: 0;
}

/* Loading screen */
.scan-loading {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  gap: 16px;
  text-align: center;
}
.scan-loading .ring-spinner {
  width: 80px; height: 80px;
  border-radius: 50%;
  border: 4px solid var(--bg-3);
  border-top-color: var(--c205-mint);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.scan-loading .scan-line {
  position: relative;
  width: 120px; height: 120px;
  border: 2px solid var(--c205-mint);
  border-radius: 24px;
  overflow: hidden;
}
.scan-loading .scan-line::before {
  content: '';
  position: absolute;
  left: 8px; right: 8px;
  height: 2px;
  background: var(--c205-mint);
  box-shadow: 0 0 8px var(--c205-mint);
  top: 10px;
  animation: scan-y 1.6s ease-in-out infinite;
}
@keyframes scan-y {
  0%, 100% { top: 10px; }
  50% { top: calc(100% - 12px); }
}
.scan-loading h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  margin-top: 12px;
}
.scan-loading p { color: var(--fg-3); font-size: 13px; }
.scan-loading .url-tag {
  margin-top: 8px;
  padding: 8px 14px;
  background: var(--bg-2);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-2);
  max-width: 90%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Error / invalid states */
.scan-error {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 40px 32px;
  text-align: center;
}
.scan-error .icon-circle {
  width: 80px; height: 80px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-danger-soft);
  color: var(--color-danger);
}
.scan-error .icon-circle svg { width: 36px; height: 36px; }
.scan-error h3 { font-size: 18px; font-weight: 700; }
.scan-error p { color: var(--fg-3); font-size: 13px; line-height: 1.6; max-width: 280px; }
.scan-error .row { display: flex; gap: 8px; width: 100%; margin-top: 8px; }
.scan-error .row .btn { flex: 1; }

/* ---------- Map screen ---------- */
.map-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--bg-2);
  min-height: 0;
}
.map-canvas {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0;
}
#leaflet-map {
  position: absolute; inset: 0;
  background: #DDE3E8;
}
/* Leaflet override */
.leaflet-container {
  font-family: var(--font-sans) !important;
  background: #E5EAEE !important;
}
.leaflet-control-attribution { font-size: 9px !important; }

.map-marker {
  width: 40px; height: 40px;
  position: relative;
  cursor: pointer;
}
.map-marker-dot {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  transition: transform var(--dur-base) var(--ease-pop);
}
.map-marker:hover .map-marker-dot { transform: translate(-50%, -50%) scale(1.2); }
.map-marker-pulse {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 40px; height: 40px;
  border-radius: 50%;
  animation: marker-pulse 1.8s ease-out infinite;
}
@keyframes marker-pulse {
  0% { transform: translate(-50%, -50%) scale(0.4); opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(1.4); opacity: 0; }
}
.map-marker.high .map-marker-dot,
.map-marker.high .map-marker-pulse { background: var(--color-danger); }
.map-marker.medium .map-marker-dot,
.map-marker.medium .map-marker-pulse { background: #E8A700; }
.map-marker.low .map-marker-dot,
.map-marker.low .map-marker-pulse { background: var(--color-success); }
.map-marker.current .map-marker-dot {
  background: var(--brand-blue);
  width: 16px; height: 16px;
}
.map-marker.current .map-marker-pulse { background: var(--brand-blue); }

/* Map top controls */
.map-top {
  position: absolute;
  top: 12px; left: 12px; right: 12px;
  z-index: 600;
  display: flex; flex-direction: column; gap: 10px;
}
.map-search {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(12px);
  border-radius: var(--radius-full);
  padding: 12px 16px;
  box-shadow: var(--shadow-2);
  font-size: 13px;
}
.map-search svg { width: 16px; height: 16px; color: var(--fg-3); flex-shrink: 0; }
.map-search input {
  flex: 1; border: none; background: transparent; outline: none;
  font-family: inherit; font-size: 14px; color: var(--fg-1);
}
.map-search input::placeholder { color: var(--fg-4); }
.map-search .live {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px;
  font-weight: 700; letter-spacing: 0.04em;
  color: var(--c205-mint-deep);
  font-family: var(--font-mono);
  text-transform: uppercase;
}
.map-search .live .led {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--c205-mint); animation: pulse 1.4s ease-in-out infinite;
}

.map-filters {
  display: flex; gap: 6px;
  overflow-x: auto;
}
.filter-chip {
  flex-shrink: 0;
  padding: 7px 14px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  border: none;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--fg-2);
  cursor: pointer;
  box-shadow: var(--shadow-1);
  display: inline-flex; align-items: center; gap: 6px;
  transition: all var(--dur-fast) var(--ease-standard);
  white-space: nowrap;
  word-break: normal;
}
.filter-chip:hover { background: #fff; color: var(--fg-1); }
.filter-chip.active {
  background: var(--fg-1);
  color: #fff;
}
.filter-chip .dot {
  width: 7px; height: 7px; border-radius: 50%;
}
.filter-chip .dot.high { background: var(--color-danger); }
.filter-chip .dot.medium { background: #E8A700; }
.filter-chip .dot.low { background: var(--color-success); }

/* Map FAB - re-center */
.map-fab {
  position: absolute;
  bottom: 20px; right: 14px;
  z-index: 600;
  width: 48px; height: 48px;
  border-radius: 16px;
  background: #fff;
  border: none;
  box-shadow: var(--shadow-3);
  cursor: pointer;
  color: var(--brand-blue);
  display: inline-flex; align-items: center; justify-content: center;
}
.map-fab:hover { background: var(--bg-2); }

/* Map zone count */
.map-counter {
  position: absolute;
  bottom: 20px; left: 14px;
  z-index: 600;
  background: rgba(37, 38, 40, 0.92);
  backdrop-filter: blur(8px);
  color: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex; align-items: center; gap: 8px;
  white-space: nowrap;
}
.map-counter .num {
  font-family: var(--font-num);
  font-size: 16px;
  font-weight: 700;
}

/* Zone detail sheet */
.zone-sheet {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: var(--bg-1);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 16px 20px 24px;
  box-shadow: var(--shadow-4);
  z-index: 700;
  max-height: 60%;
  overflow-y: auto;
  animation: sheet-up 280ms var(--ease-pop);
}
.zone-sheet .handle {
  width: 40px; height: 4px;
  background: var(--neutral-300);
  border-radius: 999px;
  margin: 0 auto 14px;
}
.zone-sheet .head {
  display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px;
}
.zone-sheet .level-icon {
  width: 44px; height: 44px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.zone-sheet .level-icon.high { background: var(--color-danger-soft); color: var(--color-danger); }
.zone-sheet .level-icon.medium { background: var(--color-warning-soft); color: #8A6800; }
.zone-sheet .level-icon.low { background: var(--color-success-soft); color: #0F7A52; }
.zone-sheet .head .info { flex: 1; }
.zone-sheet .head .name {
  font-size: 18px; font-weight: 800; letter-spacing: -0.01em;
  margin-bottom: 2px;
}
.zone-sheet .head .updated {
  font-size: 11px; color: var(--fg-3);
}
.zone-sheet .close {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--bg-3);
  border: none;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--fg-2);
}
.zone-sheet .stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}
.zone-sheet .stat-card {
  background: var(--bg-2);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.zone-sheet .stat-card .label {
  font-size: 11px;
  color: var(--fg-3);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.zone-sheet .stat-card .value {
  font-family: var(--font-num);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.zone-sheet .stat-card .value.danger { color: var(--color-danger); }
.zone-sheet .stat-card .value.warn { color: #B88200; }
.zone-sheet .stat-card .value.success { color: var(--color-success); }
.zone-sheet h5 {
  font-size: 12px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg-3);
  margin: 14px 0 8px;
}
.zone-sheet .url-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-1);
  font-family: var(--font-mono);
  font-size: 12px;
}
.zone-sheet .url-row:last-child { border-bottom: none; }
.zone-sheet .url-row .url-text {
  flex: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--fg-1); font-weight: 600;
}

/* Empty / permission states overlay */
.map-empty {
  position: absolute;
  top: 80px; left: 14px; right: 14px;
  z-index: 500;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(10px);
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  font-size: 13px;
  display: flex; align-items: center; gap: 10px;
  color: var(--fg-2);
}
.map-empty .icon-circle {
  width: 32px; height: 32px;
  border-radius: 10px;
  background: var(--color-warning-soft);
  color: #8A6800;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.map-empty strong { color: var(--fg-1); display: block; font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.map-empty .small { font-size: 11px; color: var(--fg-3); }

/* ---------- Placeholder pages ---------- */
.placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.ph-header {
  padding: 8px 16px;
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--border-1);
}
.ph-back {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--bg-2); border: none;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.ph-header h2 { font-size: 16px; font-weight: 700; }
.ph-body {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 40px 32px;
  gap: 16px;
}
.ph-body .ph-icon {
  width: 80px; height: 80px;
  border-radius: 24px;
  background: var(--c205-mint-soft);
  color: var(--c205-mint-deep);
  display: inline-flex; align-items: center; justify-content: center;
}
.ph-body h3 { font-family: var(--font-display); font-size: 22px; font-weight: 700; }
.ph-body p { color: var(--fg-3); font-size: 13px; line-height: 1.6; max-width: 260px; }

/* External-link mock page */
.ext-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #000;
  color: #fff;
  padding: 40px 32px;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
}
.ext-page .url-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 6px 12px;
  background: rgba(255,255,255,0.1);
  border-radius: 999px;
  color: #fff;
  word-break: break-all;
  max-width: 100%;
}

/* Group share modal */
.group-list {
  display: flex; flex-direction: column; gap: 6px;
  margin: 12px 0;
}
.group-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--border-1);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-standard);
  background: var(--bg-1);
}
.group-row:hover { border-color: var(--c205-mint); background: var(--c205-mint-soft); }
.group-row.selected { border-color: var(--c205-mint); background: var(--c205-mint-soft); }
.group-row .g-icon {
  width: 36px; height: 36px;
  border-radius: 12px;
  background: var(--bg-2);
  color: var(--c205-mint-deep);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.group-row.selected .g-icon { background: var(--c205-mint); color: #fff; }
.group-row .name { flex: 1; font-size: 14px; font-weight: 700; }
.group-row .count { font-size: 11px; color: var(--fg-3); font-family: var(--font-mono); }
.group-row .check { color: var(--c205-mint-deep); opacity: 0; }
.group-row.selected .check { opacity: 1; }

/* misc utility */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
