@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@600;700&family=Inter:wght@400;500;600;700;800&display=swap');

/* Frontline PIO — styles.css */
/* Mobile-first, 390px optimized, dark mode, 48px touch targets */

/* ===== CUSTOM PROPERTIES ===== */
/* Brand: #00182A navy · #1B263B mid-navy · #E63946 red accent · #F4F4F4 bg · #FFFFFF white */
:root {
  --navy: #00182A;
  --navy-dark: #000d17;
  --navy-mid: #1B263B;
  --accent: #E63946;
  --accent-light: #ff6b74;

  --bg: #F4F4F4;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --bg-subtle: #EBEBEB;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #6b7280;
  --text-inverse: #ffffff;

  --border: #d1d5db;
  --border-focus: #00182A;

  --success: #16a34a;
  --success-bg: #dcfce7;
  --warning: #d97706;
  --warning-bg: #fef3c7;
  --danger: #E63946;
  --danger-bg: #fee2e2;
  --info: #2563eb;
  --info-bg: #dbeafe;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow: 0 2px 8px rgba(0,0,0,0.10);
  --shadow-lg: 0 4px 20px rgba(0,0,0,0.14);

  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;

  --touch-target: 48px;
  --font-base: 16px;

  --status-bar-h: 40px;
  --bottom-h: 80px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #00182A;
    --bg-card: #1B263B;
    --bg-input: #1B263B;
    --bg-subtle: #0f2236;

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-inverse: #00182A;

    --border: #2d3d4f;
    --border-focus: #E63946;

    --success-bg: #14532d;
    --warning-bg: #451a03;
    --danger-bg: #4a0e0e;
    --info-bg: #1e3a5f;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow: 0 2px 8px rgba(0,0,0,0.4);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.5);
  }
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: var(--font-base);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  padding-top: var(--status-bar-h);
  padding-bottom: env(safe-area-inset-bottom);
}

/* ===== STATUS BAR ===== */
#status-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--status-bar-h);
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  padding-top: env(safe-area-inset-top);
  gap: 8px;
}

#status-left, #status-right { display: flex; align-items: center; gap: 8px; min-width: 80px; }
#status-right { justify-content: flex-end; }
#status-center {
  flex: 1;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 99px;
  white-space: nowrap;
}

.badge-online  { background: rgba(22,163,74,0.2);  color: #4ade80; }
.badge-offline { background: rgba(220,38,38,0.2);  color: #f87171; }
.badge-saving  { background: rgba(201,164,73,0.2); color: var(--accent); }

.badge-status-active     { background: var(--success-bg); color: var(--success); }
.badge-status-monitoring { background: var(--warning-bg); color: var(--warning); }
.badge-status-closed     { background: var(--bg-subtle);  color: var(--text-muted); }
.badge-status-archived   { background: var(--bg-subtle);  color: var(--text-muted); }

.badge-fact-confirmed     { background: var(--success-bg); color: var(--success); }
.badge-fact-pending       { background: var(--warning-bg); color: var(--warning); }
.badge-fact-working       { background: var(--info-bg);    color: var(--info); }
.badge-fact-do_not_release { background: var(--danger-bg); color: var(--danger); }
.badge-fact-superseded    { background: var(--bg-subtle);  color: var(--text-muted); }
.badge-fact-archived      { background: var(--bg-subtle);  color: var(--text-muted); }

#autosave-indicator { font-size: 10px; color: var(--accent); font-weight: 600; }

/* ===== MAIN APP CONTAINER ===== */
#app {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 16px calc(var(--bottom-h) + 16px);
  min-height: calc(100vh - var(--status-bar-h));
}

/* ===== LOADING ===== */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 16px;
  color: var(--text-muted);
}
.fp-logo { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.6} }

/* ===== TYPOGRAPHY ===== */
h1 { font-size: 1.5rem; font-weight: 700; line-height: 1.2; color: var(--text-primary); font-family: 'Oswald', sans-serif; letter-spacing: 0.01em; }
h2 { font-size: 1.2rem; font-weight: 700; line-height: 1.3; color: var(--text-primary); font-family: 'Oswald', sans-serif; }
h3 { font-size: 1rem;   font-weight: 600; color: var(--text-primary); }
p  { font-size: 1rem;   color: var(--text-secondary); }
small { font-size: 0.8rem; color: var(--text-muted); }

/* ===== SCREEN HEADER ===== */
.screen-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding-top: 4px;
}
.screen-header h1 { flex: 1; }
.back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--touch-target);
  height: var(--touch-target);
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
  flex-shrink: 0;
  text-decoration: none;
  transition: background 0.15s;
}
.back-btn:hover { background: var(--bg-subtle); }

/* ===== CARDS ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 12px; }
.card-title { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; color: var(--text-muted); text-transform: uppercase; margin-bottom: 8px; }
.card-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--touch-target);
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: opacity 0.15s, background 0.15s, transform 0.1s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  line-height: 1;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-primary   { background: var(--navy); color: #fff; }
.btn-gold      { background: var(--accent); color: var(--navy); }
.btn-secondary { background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border); }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-success   { background: var(--success); color: #fff; }
.btn-ghost     { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }

.btn-full { width: 100%; }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: 0.875rem; }

.btn-group { display: flex; flex-direction: column; gap: 10px; }
.btn-group-row { display: flex; gap: 10px; }
.btn-group-row .btn { flex: 1; }

/* ===== STICKY BOTTOM ACTION ===== */
.sticky-bottom {
  position: fixed;
  bottom: 0;
  left: 50%;
  right: auto;
  width: min(640px, 100vw);
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 50;
  display: flex;
  gap: 10px;
  transform: translateX(-50%);
}
.sticky-bottom .btn { flex: 1; }

/* ===== FORMS ===== */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-group:last-child { margin-bottom: 0; }

label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}
label .required { color: var(--danger); margin-left: 2px; }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  min-height: var(--touch-target);
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  color: var(--text-primary);
  transition: border-color 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(0,24,42,0.12);
}

textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

.input-with-mic { position: relative; display: flex; gap: 8px; align-items: flex-start; }
.input-with-mic input,
.input-with-mic textarea { flex: 1; }
.mic-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--touch-target);
  min-height: var(--touch-target);
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 20px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.mic-btn:hover { background: var(--bg-subtle); }
.mic-btn.listening { background: rgba(230,57,70,0.15); border-color: var(--accent); animation: mic-pulse 1s ease-in-out infinite; }
@keyframes mic-pulse { 0%,100%{opacity:1} 50%{opacity:0.6} }

.form-hint { font-size: 0.8rem; color: var(--text-muted); }
.form-error { font-size: 0.8rem; color: var(--danger); }

/* ===== ALERTS / BANNERS ===== */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 16px;
  border-left: 4px solid;
}
.alert-warning { background: var(--warning-bg); border-color: var(--warning); color: var(--warning); }
.alert-danger   { background: var(--danger-bg);  border-color: var(--danger);  color: var(--danger); }
.alert-success  { background: var(--success-bg); border-color: var(--success); color: var(--success); }
.alert-info     { background: var(--info-bg);    border-color: var(--info);    color: var(--info); }
.alert p { color: inherit; margin: 0; }

/* ===== DO NOT SAY LIST ===== */
.dns-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.dns-list li { display: flex; align-items: flex-start; gap: 8px; font-size: 0.875rem; color: var(--danger); }
.dns-list li::before { content: '⚠'; flex-shrink: 0; }

/* ===== INCIDENT CARD ===== */
.incident-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}
.incident-card:hover, .incident-card:active { border-color: var(--navy); box-shadow: var(--shadow); }
.incident-card.active-incident { border-color: var(--accent); border-width: 2px; }
.incident-card-title { font-weight: 700; font-size: 1rem; color: var(--text-primary); }
.incident-card-meta { font-size: 0.8rem; color: var(--text-muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.incident-card-elapsed { font-size: 0.75rem; font-weight: 600; color: var(--warning); }

/* ===== DASHBOARD GRID ===== */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}
.dash-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}
.dash-stat-value { font-size: 1.75rem; font-weight: 800; color: var(--navy); line-height: 1; }
@media (prefers-color-scheme: dark) { .dash-stat-value { color: var(--accent); } }
.dash-stat-label { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }

/* ===== ACTION GRID ===== */
.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}
.action-tile {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  min-height: 90px;
  text-align: center;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
  border: none;
  font-family: inherit;
}
.action-tile:hover, .action-tile:active { background: var(--bg-subtle); }
.action-tile.tile-primary { background: var(--navy); color: #fff; border: none; }
.action-tile.tile-gold    { background: var(--accent); color: var(--navy); border: none; }
.action-tile-icon { font-size: 1.5rem; line-height: 1; }
.action-tile-label { font-size: 0.8rem; font-weight: 700; line-height: 1.2; color: inherit; }
.action-tile.tile-primary .action-tile-label,
.action-tile.tile-gold    .action-tile-label { color: #fff; }

/* ===== FACT LIST ===== */
.fact-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fact-item + .fact-item { margin-top: 8px; }
.fact-item.fact-confirmed   { border-left: 4px solid var(--success); }
.fact-item.fact-pending     { border-left: 4px solid var(--warning); }
.fact-item.fact-working     { border-left: 4px solid var(--info); }
.fact-item.fact-dnr         { border-left: 4px solid var(--danger); opacity: 0.7; }
.fact-item.fact-superseded  { border-left: 4px solid var(--text-muted); opacity: 0.5; }
.fact-text { font-size: 0.9rem; color: var(--text-primary); }
.fact-meta { font-size: 0.75rem; color: var(--text-muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ===== TIMELINE ===== */
.timeline-list { display: flex; flex-direction: column; gap: 0; }
.timeline-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.timeline-item:last-child { border-bottom: none; }
.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 5px;
}
.timeline-content { flex: 1; }
.timeline-time { font-size: 0.75rem; color: var(--text-muted); }
.timeline-action { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); }
.timeline-desc { font-size: 0.8rem; color: var(--text-secondary); margin-top: 2px; }

/* ===== DECISION LOG ===== */
.decision-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.decision-item + .decision-item { margin-top: 8px; }
.decision-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.decision-type { font-weight: 700; font-size: 0.875rem; }
.decision-meta { font-size: 0.75rem; color: var(--text-muted); }
.decision-facts { font-size: 0.75rem; color: var(--text-muted); border-top: 1px solid var(--border); padding-top: 6px; margin-top: 4px; }

/* ===== TEMPLATE GRID ===== */
.template-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.template-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 90px;
  transition: border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.template-card:hover, .template-card:active { border-color: var(--navy); }
.template-card.selected { border-color: var(--accent); background: rgba(201,164,73,0.08); }
.template-icon { font-size: 1.5rem; }
.template-name { font-size: 0.875rem; font-weight: 700; color: var(--text-primary); line-height: 1.2; }

/* ===== PRODUCT REVIEW ===== */
.review-header {
  background: var(--warning-bg);
  border: 1px solid var(--warning);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-weight: 700;
  color: var(--warning);
  font-size: 0.875rem;
  margin-bottom: 14px;
  text-align: center;
  letter-spacing: 0.05em;
}

.product-textarea {
  width: 100%;
  min-height: 240px;
  padding: 14px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--text-primary);
  line-height: 1.6;
  resize: vertical;
}

/* ===== TOAST ===== */
#toast-container {
  position: fixed;
  top: calc(var(--status-bar-h) + 16px);
  right: 16px;
  left: auto;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: min(420px, calc(100vw - 32px));
}

.toast {
  background: var(--navy);
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.25s ease, toast-out 0.3s ease 2.7s forwards;
  pointer-events: auto;
}
.toast-success { background: var(--success); }
.toast-error   { background: var(--danger); }
.toast-warning { background: var(--warning); }

@keyframes toast-in  { from { opacity:0; transform: translateY(-12px); } to { opacity:1; transform: translateY(0); } }
@keyframes toast-out { from { opacity:1; } to { opacity:0; transform: translateY(-8px); } }

.mode-banner {
  display: grid;
  gap: 3px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: var(--radius);
  margin: 0 0 16px;
  padding: 10px 12px;
  background: var(--info-bg);
}
.mode-banner strong {
  color: var(--info);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.mode-banner span {
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.35;
}

.workflow-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin: -4px 0 18px;
}
.workflow-step {
  display: grid;
  justify-items: center;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 4px;
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
}
.workflow-step span {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 0.68rem;
}
.workflow-step.active {
  border-color: var(--accent);
  color: var(--text-primary);
  box-shadow: 0 0 0 2px rgba(230,57,70,0.1);
}
.workflow-step.active span {
  background: var(--accent);
  color: #fff;
}
.workflow-step.done span {
  background: var(--success);
  color: #fff;
}

.inline-control-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.inline-control-row input {
  min-width: 0;
  flex: 1;
}

/* ===== CONFIRM DIALOG ===== */
.overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.overlay.hidden { display: none; }
.confirm-dialog {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 320px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}
.confirm-dialog p { font-size: 1rem; margin-bottom: 20px; color: var(--text-primary); }
.confirm-buttons { display: flex; gap: 10px; }
.confirm-buttons .btn { flex: 1; }

/* ===== SECTIONS ===== */
.section-title {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
  margin-top: 20px;
}
.section-title:first-child { margin-top: 0; }

/* ===== EMPTY STATE ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  text-align: center;
  gap: 12px;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 2.5rem; }
.empty-state h3 { color: var(--text-secondary); }

/* ===== SPINNER ===== */
.spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}
.spinner-dark {
  border: 3px solid var(--border);
  border-top-color: var(--navy);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== HOME / INCIDENT LIST ===== */
.home-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-top: 8px;
}
.home-logo h1 { font-size: 1.4rem; }
.home-logo p { font-size: 0.8rem; color: var(--text-muted); }

.incident-list { display: flex; flex-direction: column; gap: 10px; }

/* ===== EMERGENCY FACTS ===== */
.efact-step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}
.efact-step-label {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}
.efact-step h3 { margin-bottom: 8px; }

/* ===== PRODUCT TYPE GRID ===== */
.product-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.product-type-btn {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 10px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  min-height: var(--touch-target);
  transition: border-color 0.15s;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 8px;
}
.product-type-btn:hover, .product-type-btn:active { border-color: var(--navy); }
.product-type-btn.selected { border-color: var(--accent); background: rgba(201,164,73,0.08); }
.product-type-btn .ptb-icon { font-size: 1.1rem; }

/* ===== FACT CHECKBOX LIST ===== */
.fact-check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.fact-check-item:last-child { border-bottom: none; }
.fact-check-item input[type="checkbox"] {
  width: 20px; height: 20px;
  min-height: auto;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--navy);
}
.fact-check-label { font-size: 0.875rem; color: var(--text-primary); line-height: 1.4; }
.fact-check-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

/* ===== SETTINGS ===== */
.settings-section { margin-bottom: 24px; }
.settings-section-title {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

/* ===== MISC ===== */
.separator { height: 1px; background: var(--border); margin: 16px 0; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-0  { margin-bottom: 0; }

.product-content-display {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}


/* ===== TEMPLATE CATEGORIES ===== */
.template-category { margin-bottom: 20px; }
.template-cat-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.template-grid { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 400px) { .template-grid { grid-template-columns: 1fr 1fr; } }
.template-card { min-height: 80px; padding: 12px 10px; gap: 6px; }
.template-svg-icon {
  width: 28px;
  height: 28px;
  color: var(--navy);
  flex-shrink: 0;
}
@media (prefers-color-scheme: dark) {
  .template-svg-icon { color: var(--accent); }
}
.template-svg-icon svg { width: 100%; height: 100%; }
.template-name { font-size: 0.75rem; font-weight: 700; line-height: 1.2; }

/* ===== HOME LOGO BRANDING ===== */
.home-logo h1 { font-family: 'Oswald', sans-serif; letter-spacing: 0.02em; }
.home-logo h1 span { color: var(--accent); }
.tagline { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }

/* ===== HERO SCREEN ===== */
.hero-screen {
  min-height: calc(100vh - 40px);
  width: 100vw;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background: #00182A;
  position: relative;
  left: 50%;
  margin: -16px 0 0;
  padding: 56px clamp(24px, 8vw, 120px) 64px;
  transform: translateX(-50%);
}
.hero-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 17% 18%, rgba(230,57,70,0.24), transparent 28%),
    linear-gradient(90deg, rgba(0,24,42,0.96) 0%, rgba(0,24,42,0.78) 36%, rgba(0,24,42,0.38) 68%, rgba(0,13,23,0.34) 100%);
}
.hero-slider {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  background-position: center;
  background-size: cover;
  animation: heroSlide 18s infinite;
}
.hero-slide-one {
  background:
    linear-gradient(90deg, rgba(0,24,42,0.78), rgba(0,24,42,0.08) 58%),
    url('hero-police.jpg') center center / cover no-repeat;
}
.hero-slide-two {
  background:
    linear-gradient(90deg, rgba(0,24,42,0.84), rgba(0,24,42,0.1) 60%),
    url('hero-fire.jpg') center center / cover no-repeat;
  animation-delay: 6s;
}
.hero-slide-three {
  background:
    linear-gradient(90deg, rgba(0,24,42,0.88), rgba(0,24,42,0.12) 62%),
    url('hero-corporate.jpg') center center / cover no-repeat;
  animation-delay: 12s;
}
@keyframes heroSlide {
  0%, 28% { opacity: 1; transform: scale(1); }
  34%, 94% { opacity: 0; transform: scale(1.04); }
  100% { opacity: 1; transform: scale(1); }
}
.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  width: 100%;
  max-width: min(480px, 100%);
}
.hero-brand-lockup {
  display: grid;
  justify-items: start;
  gap: 10px;
  margin-bottom: 14px;
}
.hero-shield {
  width: 84px;
  height: 84px;
  filter: drop-shadow(0 0 18px rgba(230,57,70,0.42));
}
.hero-parent-mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 999px;
  padding: 5px 10px 5px 7px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.66);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.hero-parent-mark img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
}
.hero-wordmark {
  font-family: 'Bebas Neue', 'Oswald', sans-serif;
  font-size: clamp(3.4rem, 7vw, 6.4rem);
  color: #ffffff;
  letter-spacing: 0.08em;
  line-height: 1;
  margin-bottom: 6px;
}
.hero-pio { color: #E63946; }
.hero-tagline {
  font-family: 'Oswald', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin-bottom: 20px;
}
.hero-headline {
  font-family: 'Bebas Neue', 'Oswald', sans-serif;
  max-width: 460px;
  color: #fff;
  font-size: clamp(2.2rem, 4.2vw, 4.4rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 0.98;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.hero-subcopy {
  max-width: 390px;
  color: rgba(255,255,255,0.75);
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.5;
  margin-bottom: 22px;
}
.hero-red { color: #E63946; }
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 7px;
  margin-bottom: 32px;
}
.hero-badge {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 4px 10px;
  border-radius: 3px;
  background: rgba(255,255,255,0.04);
}
.hero-actions {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
}
.hero-start-btn {
  font-family: 'Oswald', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 14px;
}
.hero-incidents-btn {
  color: rgba(255,255,255,0.7);
  border-color: rgba(255,255,255,0.2);
}
.hero-incidents-btn:hover { color: #fff; border-color: rgba(255,255,255,0.5); }
.hero-setup-link {
  background: none;
  border: none;
  color: rgba(255,255,255,0.35);
  font-size: 0.78rem;
  cursor: pointer;
  padding: 4px;
  font-family: 'Inter', sans-serif;
}
.hero-setup-link:hover { color: rgba(255,255,255,0.65); }
.hero-footer-tagline {
  font-family: 'Oswald', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.25);
  line-height: 1.6;
}

@media (prefers-reduced-motion: reduce) {
  .hero-slide {
    animation: none;
  }

  .hero-slide-one {
    opacity: 1;
  }
}

@media (max-width: 720px) {
  .hero-screen {
    justify-content: center;
    padding: 40px 24px 56px;
  }

  .hero-screen::before {
    background:
      radial-gradient(circle at 50% 18%, rgba(230,57,70,0.24), transparent 30%),
      linear-gradient(180deg, rgba(0,24,42,0.66) 0%, rgba(0,24,42,0.84) 58%, rgba(0,13,23,0.96) 100%);
  }

  .hero-slide-one,
  .hero-slide-two,
  .hero-slide-three {
    background-position: 62% center;
  }

  .hero-content,
  .hero-brand-lockup {
    align-items: center;
    justify-items: center;
    text-align: center;
  }

  .hero-badges {
    justify-content: center;
  }
}

/* ===== PRINT ===== */
@media print {
  #status-bar, .sticky-bottom, #toast-container { display: none !important; }
  body { background: #fff; color: #000; padding: 0; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}
