/* Argus Sentinel Guardian Portal - Minimal Enterprise Security Design System */

/* Dark Theme Tokens: Pure Black & Charcoal (Default) */
:root, html.dark {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  --bg-page: #000000;        /* Pure Deep Pitch Black */
  --bg-surface: #121212;     /* Dark Charcoal Surface */
  --bg-subtle: #1a1a1a;      /* Medium Charcoal Surface */
  --bg-input: #181818;       /* Input Box Charcoal */
  --border-main: #2b2b2b;    /* Charcoal Divider Line */
  --border-subtle: #202020;  /* Subtle Line */
  --text-main: #f5f5f5;      /* Pure Crisp White */
  --text-muted: #cccccc;     /* Light Gray Secondary */
  --text-subtle: #888888;    /* Muted Charcoal Text */
  --primary: #3b82f6;        /* Solid Blue Accent */
  --primary-hover: #60a5fa;
  --primary-text: #ffffff;
  --danger: #ef4444;         /* High-contrast Red */
  --danger-bg: #281214;
  --danger-border: #5c1d24;
  --danger-text: #fca5a5;
  --warning: #f59e0b;        /* Readable Solid Amber */
  --warning-bg: #2b1f0e;
  --warning-border: #63330f;
  --warning-text: #fde68a;
  --safe: #22c55e;           /* Readable Clean Green */
  --safe-bg: #0e2417;
  --safe-border: #144e2b;
  --safe-text: #86efac;
  --nav-active-bg: #222222;
  --shadow-soft: 0 4px 24px -2px rgba(0, 0, 0, 0.6);
  --radius-panel: 14px;
  --radius-input: 10px;
  --radius-badge: 6px;

  color: var(--text-main);
  background-color: var(--bg-page);
}

/* Light Theme Tokens: Clean Slate Canvas */
:root.light, html.light {
  --bg-page: #f4f6f9;
  --bg-surface: #ffffff;
  --bg-subtle: #f0f3f6;
  --bg-input: #ffffff;
  --border-main: #d9e1ec;
  --border-subtle: #e6ecf3;
  --text-main: #0f172a;
  --text-muted: #334155;
  --text-subtle: #64748b;
  --primary: #1e40af;
  --primary-hover: #1d4ed8;
  --primary-text: #ffffff;
  --danger: #b91c1c;
  --danger-bg: #fef2f2;
  --danger-border: #fca5a5;
  --danger-text: #991b1b;
  --warning: #b45309;
  --warning-bg: #fffbeb;
  --warning-border: #fcd34d;
  --warning-text: #92400e;
  --safe: #15803d;
  --safe-bg: #f0fdf4;
  --safe-border: #86efac;
  --safe-text: #166534;
  --nav-active-bg: #e2e8f0;
  --shadow-soft: 0 4px 20px -2px rgba(15, 23, 42, 0.05);

  color: var(--text-main);
  background-color: var(--bg-page);
}

*, *::before, *::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  line-height: 1.5;
  color: var(--text-main);
  background-color: var(--bg-page);
  padding-bottom: 72px; /* Clearance for fixed bottom nav on mobile */
  transition: background-color 0.2s ease, color 0.2s ease;
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  body {
    padding-bottom: 24px;
  }
}

button, input, select {
  font: inherit;
}

button {
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease, transform 0.1s ease;
}

button:active:not(:disabled) {
  transform: scale(0.97);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.font-mono {
  font-family: JetBrains Mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.w-full {
  width: 100%;
}

.whitespace-nowrap {
  white-space: nowrap;
}

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

/* Accessibility Skip Link */
.skip-link {
  position: absolute;
  left: 12px;
  top: -64px;
  padding: 10px 14px;
  background: var(--primary);
  color: var(--primary-text);
  z-index: 100;
  border-radius: var(--radius-input);
  font-weight: 600;
}
.skip-link:focus {
  top: 10px;
}

/* Site Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-main);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.header-container {
  max-width: 860px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

/* Brand Identity matching Android app view_brand_title.xml */
button.brand, .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  color: inherit;
  font: inherit;
  text-align: left;
}

button.brand:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
  border-radius: 8px;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  object-fit: cover;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  display: block;
  flex-shrink: 0;
}

.brand-text-block {
  display: flex;
  flex-direction: column;
}

.brand-titles {
  display: flex;
  align-items: baseline;
  gap: 4px;
  line-height: 1;
}

.brand-title-main {
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--text-main);
}

.brand-title-sub {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.38em;
  color: var(--text-subtle);
}

.brand-subtitle-tag {
  font-size: 10px;
  color: var(--text-subtle);
  margin-top: 2px;
}

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

.header-btn {
  min-height: 32px;
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 9px;
}

.header-btn.icon-only {
  padding: 4px 8px;
  min-width: 32px;
}

.header-btn-text {
  display: none;
}

@media (min-width: 600px) {
  .header-btn-text {
    display: inline;
  }
}

/* Shell / Container */
.shell {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 14px 16px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

@media (min-width: 900px) {
  .shell {
    max-width: 860px;
    padding: 18px 24px 32px;
  }
}

/* Headings */
h1, h2, h3, p {
  margin-top: 0;
}

/* Notice Banner */
.notice {
  border: 1px solid var(--border-main);
  background: var(--bg-subtle);
  border-radius: var(--radius-input);
  padding: 9px 14px;
  color: var(--text-muted);
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.notice[data-tone="error"] {
  border-color: var(--danger-border);
  background: var(--danger-bg);
  color: var(--danger-text);
  font-weight: 600;
}

.notice[data-tone="success"] {
  border-color: var(--safe-border);
  background: var(--safe-bg);
  color: var(--safe-text);
  font-weight: 600;
}

/* Session Notice Bar */
.session-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-input);
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.session-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-dot {
  width: 7px;
  height: 7px;
  min-width: 7px;
  border-radius: 50%;
  background: var(--safe);
  flex-shrink: 0;
}

.session-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-badge {
  font-size: 10.5px;
  color: var(--text-subtle);
  font-weight: 600;
  flex-shrink: 0;
}

/* Desktop Navigation Tab Bar */
.desktop-nav {
  display: none;
}

@media (min-width: 768px) {
  .desktop-nav {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-main);
    background: var(--bg-subtle);
    padding: 0 12px;
    margin-bottom: 14px;
    border-radius: 12px;
    gap: 4px;
  }
}

.desktop-nav-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-subtle);
  border-radius: 0;
  margin-bottom: -1px;
  transition: all 0.15s ease;
}

.desktop-nav-btn:hover {
  color: var(--text-main);
}

.desktop-nav-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 700;
}

/* Claim Alert */
.claim-alert {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 16px;
  border: 1px solid var(--warning-border);
  border-radius: var(--radius-panel);
  background: var(--warning-bg);
  color: var(--warning-text);
  margin-bottom: 14px;
}

.claim-alert-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
}

.claim-alert p {
  font-size: 12px;
  margin: 0;
  color: var(--warning-text);
  line-height: 1.4;
}

.claim-alert a {
  align-self: flex-start;
  margin-top: 4px;
  padding: 5px 12px;
  border-radius: 8px;
  background: var(--warning);
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
  font-size: 11.5px;
  transition: opacity 0.15s ease;
}

.claim-alert a:hover {
  opacity: 0.9;
  text-decoration: none;
}

/* Integrated Protection Status Strip */
.protection-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-main);
  margin-bottom: 14px;
  box-shadow: var(--shadow-soft);
}

.protection-summary[data-state="attention"] {
  border-color: var(--danger-border);
  background: var(--danger-bg);
}

.protection-summary[data-state="safe"] {
  border-color: var(--safe-border);
  background: var(--safe-bg);
}

.summary-symbol {
  width: 8px;
  height: 8px;
  min-width: 8px;
  min-height: 8px;
  border-radius: 50%;
  font-size: 0;
  display: inline-block;
  background: var(--text-subtle);
  border: none;
  flex-shrink: 0;
}

.protection-summary[data-state="safe"] .summary-symbol {
  background: var(--safe);
}

.protection-summary[data-state="attention"] .summary-symbol {
  background: var(--danger);
}

.summary-content {
  flex: 1;
  min-width: 0;
}

.summary-content .eyebrow {
  display: none;
}

.summary-content h2 {
  font-size: 13px;
  font-weight: 700;
  margin: 0;
  color: var(--text-main);
  line-height: 1.35;
}

.protection-summary[data-state="attention"] .summary-content h2 {
  color: var(--danger-text);
}

.protection-summary[data-state="safe"] .summary-content h2 {
  color: var(--safe-text);
}

.summary-content p {
  font-size: 11px;
  margin: 2px 0 0;
  color: var(--text-subtle);
  line-height: 1.35;
}

.protection-summary[data-state="attention"] .summary-content p {
  color: var(--danger-text);
  opacity: 0.9;
}

.protection-summary[data-state="safe"] .summary-content p {
  color: var(--safe-text);
  opacity: 0.9;
}

.summary-count {
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-main);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Tab Header */
.tab-header {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tab-title {
  font-size: 15.5px;
  font-weight: 700;
  margin: 0 0 2px;
  color: var(--text-main);
}

.tab-subtitle {
  font-size: 12px;
  color: var(--text-subtle);
  margin: 0;
}

/* Panels */
.panel {
  min-width: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-panel);
  padding: 16px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 14px;
}

/* Auth Gate Panel Styling (Outside Android / Verification) */
.auth-panel {
  max-width: 480px;
  margin: 32px auto 60px;
  padding: 28px 20px;
  border-radius: 16px;
}

.auth-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  margin-bottom: 18px;
}

.auth-logo {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  object-fit: cover;
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  display: block;
}

.auth-body {
  display: flex;
  flex-direction: column;
  text-align: center;
}

.auth-body .eyebrow {
  margin-bottom: 4px;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-subtle);
  text-transform: uppercase;
  font-weight: 700;
}

.auth-body h1 {
  font-size: clamp(20px, 4vw, 24px);
  margin-bottom: 8px;
  color: var(--text-main);
  font-weight: 700;
}

.auth-body .lede {
  margin: 0 auto 18px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-muted);
  max-width: 42ch;
}

.auth-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.auth-step-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.auth-step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.auth-step-item strong {
  font-size: 12.5px;
  color: var(--text-main);
  display: block;
}

.auth-step-item p {
  margin: 1px 0 0;
  font-size: 11.5px;
  color: var(--text-subtle);
}

/* Badges */
.badge-rounded {
  border-radius: var(--radius-badge);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  line-height: 1.35;
}

.badge-attention {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger-text);
}

.badge-warning {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  color: var(--warning-text);
}

.badge-safe {
  background: var(--safe-bg);
  border: 1px solid var(--safe-border);
  color: var(--safe-text);
}

/* Accordion Dropdown Sections */
.accordion-item {
  border: 1px solid var(--border-main);
  border-radius: var(--radius-panel);
  background: var(--bg-surface);
  margin-bottom: 12px;
  overflow: hidden;
}

.accordion-item summary {
  padding: 13px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  background: var(--bg-surface);
  transition: background-color 0.15s ease;
}

.accordion-item summary::-webkit-details-marker {
  display: none;
}

.accordion-item summary:hover {
  background: var(--bg-subtle);
}

.accordion-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.accordion-icon {
  width: 15px;
  height: 15px;
  color: var(--text-subtle);
  flex-shrink: 0;
}

.accordion-chevron {
  width: 14px;
  height: 14px;
  color: var(--text-subtle);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.accordion-item[open] summary .accordion-chevron {
  transform: rotate(180deg);
}

.accordion-content {
  padding: 14px 16px;
  border-top: 1px solid var(--border-subtle);
}

.text-danger {
  color: var(--danger-text) !important;
}

/* Selection Lists (Approved Children) */
.selection-list {
  list-style: none;
  padding: 0;
  margin: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.selection-list li {
  list-style: none;
}

.selection-list button {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 13px 16px;
  border-radius: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-main);
  color: var(--text-main);
  transition: all 0.15s ease;
  text-align: left;
}

.selection-list button:hover {
  background: var(--bg-subtle);
}

.selection-list button[aria-current="true"] {
  border: 2px solid var(--primary);
  background: var(--bg-surface);
  box-shadow: 0 0 0 1px var(--primary);
}

.child-name {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text-main);
}

.child-subtitle {
  font-family: JetBrains Mono, monospace;
  font-size: 10.5px;
  color: var(--text-subtle);
  margin-left: 6px;
  margin-right: auto;
}

.child-alert {
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger-text);
  margin-left: auto;
}

.child-safe {
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  background: var(--safe-bg);
  border: 1px solid var(--safe-border);
  color: var(--safe-text);
  margin-left: auto;
}

/* Details Grid */
.details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.details-grid dt {
  color: var(--text-subtle);
  font-size: 11px;
  margin: 0;
}

.details-grid dd {
  margin: 2px 0 0;
  color: var(--text-main);
  font-weight: 600;
  font-size: 12.5px;
  word-break: break-all;
}

/* Form Controls */
label, .form-label {
  display: block;
  color: var(--text-main);
  font-size: 12px;
  font-weight: 600;
  margin: 10px 0 5px;
}

input, select {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-input);
  padding: 8px 12px;
  font-size: 12.5px;
  transition: border-color 0.15s ease;
}

input:focus, select:focus {
  border-color: var(--primary);
  outline: none;
}

input::placeholder {
  color: var(--text-subtle);
}

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

.input-with-actions input {
  flex: 1;
}

/* App Search Filter */
.app-search-box {
  margin-bottom: 12px;
}

.app-search-input-wrap {
  position: relative;
  width: 100%;
}

.app-search-input-wrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text-subtle);
  pointer-events: none;
}

.app-search-input-wrap input {
  padding-left: 32px;
}

.app-search-results {
  max-height: 160px;
  overflow-y: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-subtle);
  padding: 4px;
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.app-search-results button {
  width: 100%;
  text-align: left;
  padding: 6px 10px;
  border: none;
  background: transparent;
  color: var(--text-main);
  border-radius: 6px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background-color 0.15s ease;
}

.app-search-results button:hover {
  background: var(--bg-surface);
}

.app-pkg-sub {
  font-family: JetBrains Mono, monospace;
  font-size: 10px;
  color: var(--text-subtle);
}

.app-picker-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.app-picker-row select {
  flex: 1;
  min-width: 0;
}

/* Buttons */
.button {
  border: 1px solid transparent;
  border-radius: var(--radius-input);
  min-height: 38px;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.primary {
  background: var(--primary);
  color: #ffffff;
}
.primary:not(:disabled):hover {
  background: var(--primary-hover);
}

.secondary {
  background: var(--bg-surface);
  color: var(--text-main);
  border-color: var(--border-main);
}
.secondary:not(:disabled):hover {
  background: var(--bg-subtle);
}

.quiet {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border-main);
}
.quiet:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}

.danger {
  background: var(--danger-bg);
  color: var(--danger-text);
  border-color: var(--danger-border);
}
.danger:not(:disabled):hover {
  background: var(--danger);
  color: #ffffff;
}

/* Threat Cards */
.review-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 12px;
}

.review-empty {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--border-main);
  border-radius: var(--radius-input);
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 12.5px;
}

.review-empty[data-state="safe"] {
  border-color: var(--safe-border);
  background: var(--safe-bg);
  color: var(--safe-text);
}

.review-empty[data-state="attention"] {
  border-color: var(--danger-border);
  background: var(--danger-bg);
  color: var(--danger-text);
}

.state-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid var(--border-main);
  border-radius: var(--radius-badge);
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.state-badge[data-state="safe"] {
  border-color: var(--safe-border);
  background: var(--safe-bg);
  color: var(--safe-text);
}

.state-badge[data-state="attention"] {
  border-color: var(--danger-border);
  background: var(--danger-bg);
  color: var(--danger-text);
}

.threat-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
}

.threat-card {
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-panel);
  background: var(--bg-surface);
  padding: 14px 16px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.resolved-list .threat-card {
  border-color: var(--border-main);
  background: var(--bg-subtle);
}

.threat-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
}

.threat-card h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.threat-card .threat-type {
  margin: 2px 0 0;
  color: var(--text-subtle);
  font-size: 11px;
}

.threat-score {
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-badge);
  padding: 2px 7px;
  background: var(--danger-bg);
  color: var(--danger-text);
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}

.threat-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 4px 0;
}

.threat-detail-grid div {
  padding: 6px 9px;
  border-radius: 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
}

.threat-detail-grid dt {
  color: var(--text-subtle);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}

.threat-detail-grid dd {
  margin: 2px 0 0;
  color: var(--text-main);
  font-size: 12px;
  font-weight: 600;
}

.threat-reason {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
  background: var(--bg-subtle);
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
}

.threat-meta {
  margin: 2px 0 0;
  color: var(--text-subtle);
  font-size: 10.5px;
}

/* Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

th, td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

th {
  background: var(--bg-subtle);
  color: var(--text-subtle);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--bg-subtle);
}

.sub-table-card {
  border: 1px solid var(--border-main);
  border-radius: var(--radius-panel);
  background: var(--bg-surface);
  overflow: hidden;
  margin-top: 14px;
}

.sub-table-header {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

/* Persistent Bottom Navigation Bar (Mobile) */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-main);
  display: flex;
  align-items: stretch;
  z-index: 50;
  user-select: none;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.4);
}

@media (min-width: 768px) {
  .bottom-nav {
    display: none;
  }
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-top: 2px solid transparent;
  color: var(--text-subtle);
  padding: 4px;
  font-size: 10px;
  font-weight: 600;
  gap: 1px;
  transition: all 0.15s ease;
}

.bottom-nav-item .bottom-icon {
  width: 20px;
  height: 20px;
  margin-bottom: 1px;
}

.bottom-nav-item.active {
  color: var(--primary);
  border-top-color: var(--primary);
  background: var(--nav-active-bg);
  font-weight: 700;
}

/* Loading Animations */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.spin-icon {
  animation: spin 0.8s linear infinite;
}

.spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -1px;
}

.button.is-loading {
  pointer-events: none;
  opacity: 0.8;
}

/* Helpers */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.empty-state {
  border: 1px dashed var(--border-main);
  border-radius: var(--radius-input);
  padding: 16px;
  color: var(--text-subtle);
  font-size: 12.5px;
  text-align: center;
}

.field-help {
  font-size: 11.5px;
  color: var(--text-subtle);
  margin: 6px 0 0;
  line-height: 1.4;
}

.section-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 14px 0;
}

.help-details {
  font-size: 11.5px;
  color: var(--text-subtle);
  margin: 8px 0;
}

.help-details summary {
  cursor: pointer;
  color: var(--text-muted);
}

.help-details p {
  margin: 6px 0 0;
  line-height: 1.45;
}

/* Invitation Card */
.invitation-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--border-main);
  border-radius: var(--radius-input);
  background: var(--bg-subtle);
  margin-top: 10px;
}

.invitation-card p {
  margin: 0;
}

.invitation-qr {
  display: block;
  width: min(100%, 220px);
  max-width: 100%;
  height: auto;
  border: 8px solid #ffffff;
  border-radius: 12px;
  margin: 8px auto;
  background: #ffffff;
}

.invitation-code {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  user-select: all;
  color: var(--text-main);
  background: var(--bg-input);
  border: 1px solid var(--border-main);
  padding: 8px 10px;
  border-radius: var(--radius-input);
  font-size: 11px;
  font-family: JetBrains Mono, monospace;
}

/* Family Result Box */
.family-result {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-input);
  background: var(--bg-subtle);
  border: 1px solid var(--border-main);
  font-size: 12px;
}

/* Footer */
footer {
  max-width: 640px;
  margin: 24px auto 16px;
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-subtle);
  font-size: 11px;
  text-align: center;
}
.claim-alert-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #121212;
  background: #f6c344;
  border: none;
  border-radius: var(--radius-button);
  padding: 6px 14px;
  cursor: pointer;
  text-decoration: none;
  transition: opacity var(--anim-fast);
}

.claim-alert-link:hover {
  opacity: 0.9;
}
@media (min-width: 900px) {
  footer {
    max-width: 860px;
  }
}
