/* ============================================================
   NEC FIELD ASSISTANT — Styles
   Brand: Navy #1B3A5C | Gold #D4A847 | BG #0F1923
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Barlow+Condensed:wght@400;600;700&family=Barlow:wght@400;500;600&display=swap');

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0F1923;
  --bg2: #162030;
  --bg3: #1e2d3d;
  --navy: #1B3A5C;
  --navy-light: #254d79;
  --gold: #D4A847;
  --gold-light: #e8c060;
  --gold-dark: #b08a2e;
  --text: #e8edf2;
  --text-muted: #8a9bb0;
  --pass: #2ecc71;
  --fail: #e74c3c;
  --warn: #f39c12;
  --border: rgba(212,168,71,0.2);
  --shadow: 0 4px 20px rgba(0,0,0,0.5);
  --radius: 12px;
  --radius-sm: 8px;
  --nav-height: 64px;
  --header-height: 60px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Barlow', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

/* ── App Shell ── */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

/* ── Header ── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--navy);
  border-bottom: 2px solid var(--gold);
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
}

.header-logo {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.header-logo .logo-main {
  font-family: 'Bebas Neue', cursive;
  font-size: 22px;
  color: var(--gold);
  letter-spacing: 2px;
}

.header-logo .logo-sub {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.header-bolt {
  font-size: 24px;
  filter: drop-shadow(0 0 6px var(--gold));
  flex-shrink: 0;
}

.header-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.btn-icon {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}

.btn-icon:hover { color: var(--gold); background: rgba(212,168,71,0.1); }

/* ── Main Content ── */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding-bottom: calc(var(--nav-height) + 16px);
}

/* ── Bottom Nav ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 600px;
  height: var(--nav-height);
  background: var(--navy);
  border-top: 2px solid var(--gold);
  display: flex;
  z-index: 100;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.2s, background 0.2s;
  background: none;
  border: none;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  -webkit-tap-highlight-color: transparent;
}

.nav-item .nav-icon { font-size: 22px; }
.nav-item.active { color: var(--gold); }
.nav-item:hover { color: var(--gold-light); background: rgba(212,168,71,0.05); }

/* ── Views ── */
.view { display: none; padding: 16px; }
.view.active { display: block; }

/* ── Search Bar ── */
.search-container {
  position: relative;
  margin-bottom: 20px;
}

.search-bar {
  width: 100%;
  padding: 14px 48px 14px 16px;
  background: var(--bg2);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'Barlow', sans-serif;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
}

.search-bar:focus {
  border-color: var(--gold);
  background: var(--bg3);
}

.search-bar::placeholder { color: var(--text-muted); }

.search-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: var(--text-muted);
  pointer-events: none;
}

/* ── Quick Access Tiles ── */
.quick-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.tile {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  box-shadow: var(--shadow);
}

.tile:hover, .tile:active {
  background: var(--bg3);
  border-color: var(--gold);
  transform: translateY(-2px);
}

.tile-icon { font-size: 32px; }

.tile-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gold);
}

/* ── Section Headers ── */
.section-header {
  font-family: 'Bebas Neue', cursive;
  font-size: 20px;
  letter-spacing: 2px;
  color: var(--gold);
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

/* ── Recent Searches ── */
.recent-searches {
  margin-bottom: 24px;
}

.recent-list { display: flex; flex-direction: column; gap: 4px; }

.recent-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
  font-size: 14px;
  transition: background 0.2s, color 0.2s;
}

.recent-item:hover {
  background: var(--bg3);
  color: var(--text);
}

.recent-item-icon { font-size: 14px; }

/* ── Search Results ── */
.search-results {
  display: none;
  margin-bottom: 24px;
}

.search-results.visible { display: block; }

.result-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.result-card:hover { border-color: var(--gold); background: var(--bg3); }

.result-type {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 4px;
}

.result-title { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.result-snippet { font-size: 13px; color: var(--text-muted); line-height: 1.4; }

mark {
  background: var(--gold-dark);
  color: var(--text);
  border-radius: 2px;
  padding: 0 2px;
}

/* ── Chapter List (Articles View) ── */
.chapter-section { margin-bottom: 20px; }

.chapter-header {
  font-family: 'Bebas Neue', cursive;
  font-size: 16px;
  letter-spacing: 2px;
  color: var(--text-muted);
  background: var(--navy);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  border-left: 3px solid var(--gold);
}

.article-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg2);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-bottom: 6px;
  transition: background 0.2s, border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.article-item:hover {
  background: var(--bg3);
  border-color: var(--border);
}

.article-num {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  min-width: 52px;
  flex-shrink: 0;
}

.article-title {
  font-size: 14px;
  font-weight: 500;
  flex: 1;
  line-height: 1.3;
}

.article-arrow { color: var(--text-muted); font-size: 14px; }

/* ── Article Detail Modal / Card ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 200;
  overflow-y: auto;
  padding: 20px 16px;
}

.modal-overlay.active { display: flex; align-items: flex-start; justify-content: center; }

.modal-card {
  background: var(--bg2);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  width: 100%;
  max-width: 568px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.7);
  overflow: hidden;
}

.modal-header {
  background: var(--navy);
  padding: 16px 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.modal-art-num {
  font-family: 'Bebas Neue', cursive;
  font-size: 28px;
  color: var(--gold);
  line-height: 1;
  flex-shrink: 0;
}

.modal-art-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
  line-height: 1.2;
}

.modal-chapter-badge {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 4px;
}

.modal-body { padding: 18px; }

.modal-provisions {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.modal-provisions li {
  display: flex;
  gap: 10px;
  font-size: 14px;
  line-height: 1.5;
  padding: 10px 12px;
  background: var(--bg3);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--gold);
}

.modal-provisions li::before {
  content: '⚡';
  font-size: 12px;
  flex-shrink: 0;
  margin-top: 2px;
}

.modal-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
}

.btn-primary {
  flex: 1;
  padding: 12px 20px;
  background: var(--gold);
  color: var(--bg);
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover { background: var(--gold-light); }

.btn-secondary {
  padding: 12px 16px;
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.btn-secondary:hover { background: var(--navy); border-color: var(--gold); }

.btn-bookmark.bookmarked { color: var(--gold); }

/* ── Calculator View ── */
.calc-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 4px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.calc-tabs::-webkit-scrollbar { display: none; }

.calc-tab {
  flex-shrink: 0;
  padding: 8px 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-muted);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.calc-tab.active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--bg);
}

.calc-panel { display: none; }
.calc-panel.active { display: block; }

.calc-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.calc-title {
  font-family: 'Bebas Neue', cursive;
  font-size: 22px;
  letter-spacing: 2px;
  color: var(--gold);
  margin-bottom: 4px;
}

.calc-subtitle {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 20px;
}

/* ── Form Elements ── */
.form-group {
  margin-bottom: 16px;
}

label {
  display: block;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

input[type="number"],
input[type="text"],
select {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Barlow', sans-serif;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238a9bb0' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

input:focus, select:focus {
  border-color: var(--gold);
  background: var(--bg);
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ── Result Badge ── */
.result-area {
  margin-top: 20px;
  padding: 20px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  text-align: center;
  display: none;
}

.result-area.visible { display: block; }

.result-badge {
  display: inline-block;
  padding: 12px 32px;
  border-radius: 40px;
  font-family: 'Bebas Neue', cursive;
  font-size: 36px;
  letter-spacing: 4px;
  margin-bottom: 12px;
}

.result-badge.pass {
  background: rgba(46,204,113,0.15);
  color: var(--pass);
  border: 2px solid var(--pass);
}

.result-badge.fail {
  background: rgba(231,76,60,0.15);
  color: var(--fail);
  border: 2px solid var(--fail);
}

.result-badge.warn {
  background: rgba(243,156,18,0.15);
  color: var(--warn);
  border: 2px solid var(--warn);
}

.result-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg2);
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.result-row .result-key {
  color: var(--text-muted);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.result-row .result-val {
  font-weight: 600;
  color: var(--text);
  font-size: 15px;
}

.result-row .result-val.highlight { color: var(--gold); }

/* ── Box Fill — conductor adder ── */
.conductor-adder {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.conductor-adder select { flex: 1; }
.conductor-adder input { width: 70px; flex-shrink: 0; }

.conductor-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  max-height: 150px;
  overflow-y: auto;
}

.conductor-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg3);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.conductor-chip-remove {
  background: none;
  border: none;
  color: var(--fail);
  cursor: pointer;
  font-size: 16px;
  padding: 0 4px;
}

/* ── Quick Reference ── */
.qref-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.qref-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.qref-header {
  background: var(--navy);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.qref-icon { font-size: 20px; }

.qref-title {
  font-family: 'Bebas Neue', cursive;
  font-size: 18px;
  letter-spacing: 1.5px;
  color: var(--gold);
  flex: 1;
}

.qref-ref {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.qref-chevron {
  color: var(--text-muted);
  font-size: 14px;
  transition: transform 0.25s;
}

.qref-card.expanded .qref-chevron { transform: rotate(180deg); }

.qref-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.qref-card.expanded .qref-body { max-height: 1000px; }

.qref-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.qref-item {
  display: flex;
  gap: 10px;
  font-size: 13px;
  line-height: 1.4;
  padding: 8px 10px;
  background: var(--bg3);
  border-radius: var(--radius-sm);
}

.qref-item-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  min-width: 90px;
  flex-shrink: 0;
}

.qref-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.qref-table th {
  background: var(--bg);
  color: var(--gold);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.qref-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  color: var(--text);
  vertical-align: top;
}

.qref-table tr:last-child td { border-bottom: none; }
.qref-table tr:nth-child(even) td { background: rgba(255,255,255,0.02); }

/* ── Saved / Bookmarks ── */
.saved-section { margin-bottom: 24px; }

.saved-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.saved-empty-icon { font-size: 48px; margin-bottom: 12px; }

.saved-empty-text {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 16px;
  letter-spacing: 0.5px;
}

.bookmark-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.bookmark-card:hover { border-color: var(--gold); background: var(--bg3); }

.bookmark-icon { font-size: 20px; color: var(--gold); flex-shrink: 0; }

.bookmark-info { flex: 1; }

.bookmark-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 2px;
}

.bookmark-meta {
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'Barlow Condensed', sans-serif;
}

.bookmark-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  transition: color 0.2s;
}

.bookmark-remove:hover { color: var(--fail); }

/* ── PWA Install Banner ── */
.install-banner {
  display: none;
  position: fixed;
  bottom: calc(var(--nav-height) + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 568px;
  background: var(--navy);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.4);
  z-index: 150;
  flex-direction: column;
  gap: 10px;
}

.install-banner.visible { display: flex; }

.install-banner-text {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 14px;
  color: var(--text);
}

.install-banner-actions {
  display: flex;
  gap: 8px;
}

/* ── Toast ── */
.toast {
  position: fixed;
  top: calc(var(--header-height) + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(-80px);
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  box-shadow: var(--shadow);
  z-index: 300;
  transition: transform 0.3s ease;
  white-space: nowrap;
}

.toast.visible { transform: translateX(-50%) translateY(0); }

/* ── Calc Btn ── */
.calc-btn {
  width: 100%;
  padding: 16px;
  background: var(--gold);
  color: var(--bg);
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Bebas Neue', cursive;
  font-size: 20px;
  letter-spacing: 3px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  margin-top: 8px;
}

.calc-btn:hover { background: var(--gold-light); }
.calc-btn:active { transform: scale(0.98); }

/* ── Checkbox ── */
.checkbox-group {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
}

.checkbox-group input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--gold);
  cursor: pointer;
  flex-shrink: 0;
}

.checkbox-group label {
  margin: 0;
  font-size: 14px;
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
  color: var(--text);
}

/* ── Scrollbar (desktop) ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--navy); border-radius: 2px; }

/* ── Utility ── */
.text-muted { color: var(--text-muted); }
.text-gold { color: var(--gold); }
.text-pass { color: var(--pass); }
.text-fail { color: var(--fail); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }

/* ── Mobile safe area ── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .bottom-nav {
    height: calc(var(--nav-height) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
  }
  .main-content {
    padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + 16px);
  }
}

/* ══════════════════════════════════════════════════════════════
   VOICE SEARCH
   ══════════════════════════════════════════════════════════════ */

.hidden { display: none !important; }

.voice-section {
  margin-bottom: 20px;
}

.voice-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card-bg);
  border: 2px solid var(--gold);
  border-radius: 12px;
  padding: 16px 20px;
  color: var(--gold);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 16px;
}

.voice-btn.listening {
  border-color: #ef4444;
  background: rgba(239,68,68,0.1);
  animation: pulse 1s infinite;
  color: #ef4444;
}

.voice-transcript {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  border-left: 3px solid var(--gold);
  font-style: italic;
}

.voice-results .article-match {
  background: var(--card-bg);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
  border-left: 3px solid var(--gold);
  cursor: pointer;
}

.voice-results .match-article-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.1rem;
  color: var(--gold);
}

.voice-results .match-title {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.voice-results .match-provision {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.floating-mic {
  position: fixed;
  bottom: 80px;
  right: 16px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--bg);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  z-index: 100;
  transition: all 0.2s;
}

.floating-mic.listening {
  background: #ef4444;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(0,0,0,0.4); }
  50% { box-shadow: 0 4px 24px rgba(239,68,68,0.6); }
}

/* ── Safari Browser Compat Banner ── */
.safari-banner {
  background: #1e3a5f;
  color: white;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  border-bottom: 2px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 200;
}

/* ── AI Query Row ── */
.ai-query-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.ai-query-input {
  flex: 1;
  background: var(--card-bg);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  font-family: 'Barlow', sans-serif;
  font-size: 0.95rem;
  outline: none;
}
.ai-query-input:focus {
  border-color: var(--gold);
}
.ai-query-btn {
  background: var(--gold);
  color: var(--bg);
  border: none;
  border-radius: 10px;
  padding: 12px 18px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.ai-results {
  margin-top: 8px;
}
.ai-results .ai-summary {
  background: rgba(212,168,71,0.1);
  border-left: 3px solid var(--gold);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 12px;
}
.ai-results .ai-article {
  background: var(--card-bg);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 8px;
  cursor: pointer;
}
.ai-results .ai-article:active {
  opacity: 0.8;
}
.ai-loading {
  text-align: center;
  color: var(--text-muted);
  padding: 20px;
  font-size: 0.9rem;
}

/* ── Responsive tweaks ── */
@media (max-width: 380px) {
  .quick-tiles { grid-template-columns: 1fr 1fr; }
  .tile { padding: 16px 12px; }
  .tile-icon { font-size: 26px; }
  .header-logo .logo-main { font-size: 18px; }
}
