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

:root {
  --bg: #0d1117;
  --surface: #161b24;
  --surface2: #1e2535;
  --surface3: #252d40;
  --border: #2a3348;
  --accent: #3b82f6;
  --accent-h: #2563eb;
  --green: #22c55e;
  --gold: #f59e0b;
  --red: #ef4444;
  --purple: #8b5cf6;
  --teal: #14b8a6;
  --text: #e2e8f0;
  --muted: #64748b;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,.5);
}

html {
  overflow-x: hidden;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
  max-width: 100vw;
}

/* ── LOGO ────────────────────────────────────────────────────────────────── */
.logo-img { height: 36px; width: auto; object-fit: contain; display: block; }
.logo-brand { color: var(--teal); font-weight: 600; }
a.logo { text-decoration: none; }

/* ── HEADER ─────────────────────────────────────────────────────────────── */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  padding-top: env(safe-area-inset-top, 0px);
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-icon { font-size: 28px; }
.logo-text { font-size: 18px; font-weight: 700; color: var(--text); }
.logo-ph {
  background: linear-gradient(135deg, #0038a8, #ce1126);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
}
.logo-sub { font-size: 11px; color: var(--muted); }

.lang-wrap { display: flex; align-items: center; gap: 8px; flex: 1; }
.lang-label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.lang-select {
  flex: 1;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  appearance: auto;
  max-width: 260px;
}
.lang-select:focus { border-color: var(--accent); }

/* Main nav */
.main-nav {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  gap: 2px;
  overflow-x: auto;
}
.nav-tab {
  padding: 10px 18px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all .15s;
  white-space: nowrap;
}
.nav-tab:hover { color: var(--text); }
.nav-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── MAIN ────────────────────────────────────────────────────────────────── */
.main { max-width: 1400px; margin: 0 auto; padding: 20px; width: 100%; flex: 1; }

.view { display: none; }
.view.active { display: block; }

/* ── TWO-COL LAYOUT ─────────────────────────────────────────────────────── */
.two-col {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
  align-items: start;
}

/* ── SIDEBAR ─────────────────────────────────────────────────────────────── */
.sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  position: sticky;
  top: 108px;
}
.sidebar-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin-bottom: 10px;
}
.cat-group-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  padding: 6px 4px 3px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.cat-tabs { display: flex; flex-direction: column; gap: 2px; }
.cat-tab {
  text-align: left;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all .15s;
}
.cat-tab:hover { background: var(--surface2); color: var(--text); }
.cat-tab.active { background: var(--surface2); color: var(--accent); font-weight: 600; border-left: 3px solid var(--accent); }

/* ── CONTENT PANEL ───────────────────────────────────────────────────────── */
.content-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.panel-title { font-size: 15px; font-weight: 700; }
.panel-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ── PHRASE GRID ─────────────────────────────────────────────────────────── */
.phrase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}
.phrase-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all .15s;
}
.phrase-card:hover { border-color: var(--accent); background: var(--surface2); }
.phrase-card.active { border-color: var(--accent); background: rgba(59,130,246,.08); }
.phrase-card-text { flex: 1; font-size: 13px; line-height: 1.4; }
.phrase-card-btn { flex-shrink: 0; color: var(--muted); font-size: 13px; background: none; border: none; cursor: pointer; }
.card-tr { display: block; color: var(--accent); font-size: 12px; margin-top: 4px; }

/* Suggested cards */
.suggested-note {
  grid-column: 1 / -1;
  background: rgba(59,130,246,.08);
  border: 1px solid rgba(59,130,246,.2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12px;
  color: var(--accent);
}
.suggested-card { flex-direction: column; align-items: flex-start; }
.phrase-card-en { font-size: 13px; font-weight: 500; color: var(--text); }
.phrase-card-tr { font-size: 13px; color: var(--teal); margin-top: 4px; }

/* ── INLINE TRANSLATOR ───────────────────────────────────────────────────── */
.inline-trans {
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 4px;
  animation: slideIn .2s ease;
}
@keyframes slideIn { from { opacity:0; transform:translateY(-6px) } to { opacity:1; transform:none } }
.inline-trans-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  align-items: center;
  gap: 14px;
}
.itrans-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 6px; }
.itrans-text { font-size: 14px; color: var(--text); }
.itrans-result { font-size: 18px; color: var(--text); min-height: 28px; word-break: break-word; }
.inline-arrow { font-size: 20px; color: var(--muted); }
.inline-actions { display: flex; flex-direction: column; gap: 5px; }
.inline-status { font-size: 11px; color: var(--muted); margin-top: 8px; }

/* ── Q&A ──────────────────────────────────────────────────────────────────── */
.qa-list { display: flex; flex-direction: column; gap: 8px; }
.qa-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color .15s;
}
.qa-card.open { border-color: var(--accent); }
.qa-question {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  cursor: pointer;
  transition: background .15s;
}
.qa-question:hover { background: var(--surface2); }
.qa-q-icon {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.qa-a-icon {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.qa-q-text { flex: 1; font-size: 14px; font-weight: 500; }
.qa-expand-icon { color: var(--muted); font-size: 12px; }
.qa-answer { padding: 0 16px 14px; border-top: 1px solid var(--border); }
.qa-a-en { display: flex; gap: 10px; align-items: flex-start; padding: 12px 0 10px; font-size: 14px; line-height: 1.6; }
.qa-a-tr { padding-top: 8px; }
.qa-translate-btn { font-size: 12px; }
.qa-tr-block {
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.qa-tr-q { display: flex; gap: 8px; font-size: 13px; color: var(--muted); }
.qa-tr-a { display: flex; gap: 8px; font-size: 15px; color: var(--text); line-height: 1.5; }
.qa-tr-actions { display: flex; gap: 6px; margin-top: 4px; }
.qa-author { font-size: 12px; color: var(--muted); margin-top: 8px; }
.qa-engine-label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.qa-engine-badge { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 10px; text-transform: uppercase; letter-spacing: .04em; }
.claude-badge { background: rgba(139,92,246,.15); color: #8b5cf6; border: 1px solid rgba(139,92,246,.25); }
.mm-badge { background: rgba(100,116,139,.15); color: var(--muted); border: 1px solid var(--border); }

/* ── FULL TRANSLATOR ─────────────────────────────────────────────────────── */
.translator-layout { display: flex; flex-direction: column; gap: 16px; }
.trans-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.trans-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}
.trans-lang-label-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.trans-lang-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.mic-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius-sm);
  padding: 5px 12px; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s;
  font-family: inherit;
}
.mic-btn:hover { background: var(--surface3); border-color: var(--accent); }
.mic-btn.listening {
  background: rgba(239,68,68,.15); border-color: #ef4444;
  color: #ef4444; animation: mic-pulse 1.2s ease-in-out infinite;
}
@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,.4); }
  50%       { box-shadow: 0 0 0 6px rgba(239,68,68,0); }
}
.mic-status {
  font-size: 12px; color: var(--muted); min-height: 18px;
  margin-top: 4px; transition: color .2s;
}
.mic-status.active { color: #ef4444; }
.mic-status.done   { color: var(--teal); }
.trans-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  padding: 12px;
  resize: none;
  transition: border-color .15s;
  line-height: 1.5;
}
.trans-input:focus { outline: none; border-color: var(--accent); }
.trans-input::placeholder { color: var(--muted); }
.trans-divider { font-size: 22px; color: var(--muted); padding-top: 26px; }
.trans-output {
  min-height: 80px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 18px;
  line-height: 1.5;
  word-break: break-word;
}
.trans-romanized { font-size: 12px; color: var(--muted); margin-top: 6px; font-style: italic; }
.trans-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.trans-status { margin-top: 10px; font-size: 12px; color: var(--muted); min-height: 16px; }

.multi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.multi-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.multi-header h3 { font-size: 14px; font-weight: 600; }
.multi-table-wrap { overflow-x: auto; }
.multi-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.multi-table th { text-align: left; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.multi-table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.multi-table tr:last-child td { border-bottom: none; }
.multi-table tr:hover td { background: var(--surface2); }
.multi-lang { font-weight: 600; white-space: nowrap; }
.multi-text { font-size: 15px; }
.multi-text.loading { color: var(--muted); animation: pulse 1s infinite; }
.multi-speak { background: transparent; border: none; cursor: pointer; color: var(--muted); font-size: 16px; padding: 4px 6px; border-radius: 4px; transition: color .15s; }
.multi-speak:hover { color: var(--accent); }
.multi-placeholder td { color: var(--muted); text-align: center; font-style: italic; padding: 20px; }

/* ── CONTRIBUTE ─────────────────────────────────────────────────────────── */
.contribute-layout { display: grid; grid-template-columns: 1fr 380px; gap: 16px; align-items: start; }
.contribute-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.contribute-card h2 { font-size: 18px; font-weight: 700; }
.contribute-desc { font-size: 13px; color: var(--muted); line-height: 1.6; }

.tab-toggle {
  display: flex;
  gap: 4px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 4px;
  width: fit-content;
}
.toggle-btn {
  padding: 7px 16px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
}
.toggle-btn.active { background: var(--accent); color: #fff; }

.contribute-form { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: flex; flex-direction: column; gap: 5px; }
.form-row label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.form-input {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  width: 100%;
  transition: border-color .15s;
  line-height: 1.5;
}
.form-input:focus { outline: none; border-color: var(--accent); }
.form-input::placeholder { color: var(--muted); }
select.form-input { cursor: pointer; }
textarea.form-input { resize: vertical; }
.req { color: var(--red); }

.pending-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: sticky;
  top: 108px;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}
.pending-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.pending-header h3 { font-size: 14px; font-weight: 600; }
.pending-list { display: flex; flex-direction: column; gap: 8px; }
.pending-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pending-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 2px 7px;
  border-radius: 10px;
  width: fit-content;
}
.phrase-badge { background: rgba(59,130,246,.15); color: var(--accent); }
.qa-badge { background: rgba(34,197,94,.15); color: var(--green); }
.pending-cat { font-size: 11px; color: var(--muted); }
.pending-text { font-size: 13px; }
.pending-ctx { font-size: 12px; color: var(--muted); font-style: italic; }

/* ── SAVED ─────────────────────────────────────────────────────────────── */
.saved-layout { display: flex; flex-direction: column; gap: 16px; }
.saved-header { display: flex; align-items: center; justify-content: space-between; }
.saved-header h2 { font-size: 18px; font-weight: 700; }
.saved-empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.saved-empty p { margin-top: 8px; font-size: 15px; }
.fav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}
.fav-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fav-lang { font-size: 12px; color: var(--muted); font-weight: 600; }
.fav-en { font-size: 14px; font-weight: 500; }
.fav-tr { font-size: 16px; color: var(--teal); line-height: 1.4; }
.fav-actions { display: flex; gap: 6px; margin-top: 4px; }

/* ── BUTTONS ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-h); }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn-accent { background: rgba(245,158,11,.12); color: var(--gold); border: 1px solid rgba(245,158,11,.25); }
.btn-accent:hover:not(:disabled) { background: rgba(245,158,11,.22); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-ghost:hover:not(:disabled) { color: var(--text); }
.btn-danger { background: rgba(239,68,68,.12); color: var(--red); border: 1px solid rgba(239,68,68,.25); }
.btn-danger:hover:not(:disabled) { background: rgba(239,68,68,.22); }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ── SHARED ─────────────────────────────────────────────────────────────── */
.badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}
.muted { color: var(--muted); }

/* ── TOAST ─────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 22px;
  border-radius: 20px;
  font-size: 13px;
  box-shadow: var(--shadow);
  transition: transform .3s;
  z-index: 999;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ── ANIMATIONS ─────────────────────────────────────────────────────────── */
@keyframes pulse { 0%,100%{opacity:.5} 50%{opacity:1} }

/* ── CHARACTER COUNTER ───────────────────────────────────────────────────── */
.char-counter {
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  margin-bottom: 8px;
  transition: color .2s;
}
.char-counter.warn { color: var(--gold); }
.char-counter.danger { color: var(--red); }

/* ── SECONDARY ACTION ROW ────────────────────────────────────────────────── */
.trans-actions-secondary { margin-top: 8px; }
.btn-customer {
  background: linear-gradient(135deg, #0f3f4b, #1a6070);
  color: #fff;
  border: 1px solid rgba(42,159,181,.4);
  font-weight: 700;
  width: 100%;
  justify-content: center;
  font-size: 14px;
  letter-spacing: .02em;
}
.btn-customer:hover:not(:disabled) { background: linear-gradient(135deg, #1a5a6b, #256880); border-color: #2a9fb5; }
.btn-customer:disabled { opacity: .35; }

/* ── CUSTOMER MODE OVERLAY ───────────────────────────────────────────────── */
.customer-overlay {
  position: fixed;
  inset: 0;
  background: #0a1628;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.customer-overlay-inner {
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}
.customer-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.customer-lang {
  font-size: 14px;
  font-weight: 700;
  color: #2a9fb5;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.customer-close {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  color: rgba(255,255,255,.7);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}
.customer-close:hover { background: rgba(255,255,255,.15); color: #fff; }
.customer-text {
  font-size: clamp(32px, 8vw, 64px);
  font-weight: 700;
  color: #fff;
  text-align: center;
  line-height: 1.3;
  word-break: break-word;
  letter-spacing: -.01em;
}
.customer-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.customer-speak-btn, .customer-copy-btn {
  padding: 14px 28px;
  border-radius: 50px;
  border: none;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  min-height: 52px;
  transition: all .15s;
}
.customer-speak-btn { background: #2a9fb5; color: #fff; }
.customer-speak-btn:hover { background: #3ab8d0; }
.customer-copy-btn { background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.2); }
.customer-copy-btn:hover { background: rgba(255,255,255,.18); }
.customer-footer {
  font-size: 13px;
  color: rgba(255,255,255,.35);
  letter-spacing: .04em;
}

/* ── HISTORY CARD ────────────────────────────────────────────────────────── */
.history-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.history-header h3 { font-size: 13px; font-weight: 600; color: var(--muted); }
.history-list { display: flex; flex-direction: column; gap: 6px; }
.history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color .15s;
}
.history-item:hover { border-color: var(--accent); }
.history-flag { font-size: 16px; flex-shrink: 0; }
.history-en { font-size: 12px; color: var(--muted); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-tr { font-size: 13px; color: var(--text); flex: 2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── SAVED HEADER ACTIONS ────────────────────────────────────────────────── */
.saved-header-actions { display: flex; gap: 8px; align-items: center; }

/* ── TOUR PROMO BAR ─────────────────────────────────────────────────────── */
.promo-bar {
  background: linear-gradient(135deg, #0f3f4b 0%, #1a6070 100%);
  border-top: 1px solid rgba(42,159,181,.3);
  padding: 12px 20px;
  position: sticky;
  bottom: 0;
  z-index: 90;
}
.promo-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
}
.promo-logo-wrap { flex-shrink: 0; }
.promo-logo { height: 32px; width: auto; filter: brightness(0) invert(1); opacity: .9; }
.promo-text { flex: 1; min-width: 0; }
.promo-label { font-size: 13px; font-weight: 700; color: #fff; }
.promo-desc { font-size: 12px; color: rgba(255,255,255,.7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-gold {
  background: #c9a961;
  color: #0f3f4b;
  font-weight: 700;
  font-size: 13px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .15s;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}
.btn-gold:hover { background: #dbbf77; }

/* ── PWA INSTALL BANNER ──────────────────────────────────────────────────── */
.install-banner {
  background: linear-gradient(135deg, #0f3f4b 0%, #1a6070 100%);
  border-bottom: 1px solid rgba(42,159,181,.3);
  padding: 10px 16px;
  position: sticky;
  top: 0;
  z-index: 200;
}
.install-banner-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.install-banner-logo { height: 32px; width: 32px; border-radius: 8px; flex-shrink: 0; }
.install-banner-text { flex: 1; min-width: 0; font-size: 13px; color: #fff; display: flex; flex-direction: column; gap: 1px; }
.install-banner-text strong { font-weight: 700; }
.install-banner-text span { font-size: 11px; color: rgba(255,255,255,.65); }
.install-banner-btn { padding: 7px 16px; font-size: 12px; flex-shrink: 0; }
.install-banner-close {
  background: none; border: none; color: rgba(255,255,255,.5);
  font-size: 16px; cursor: pointer; padding: 4px 6px; flex-shrink: 0;
  line-height: 1;
}
.install-banner-close:hover { color: #fff; }

.ios-install-tip {
  background: #1e2535;
  border-bottom: 1px solid rgba(42,159,181,.2);
  padding: 10px 16px;
}
.ios-tip-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: rgba(255,255,255,.8);
}
.ios-tip-icon { font-size: 20px; flex-shrink: 0; }

/* ── CEBU OK TRAVEL PROMO CARD ──────────────────────────────────────────── */
.cot-promo {
  background: linear-gradient(135deg, #0f3f4b 0%, #1a5a6b 100%);
  border-top: 1px solid rgba(42,159,181,.25);
  border-bottom: 1px solid rgba(42,159,181,.15);
  padding: 28px 20px;
}
.cot-promo-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 32px;
}
.cot-promo-body { flex: 1; min-width: 0; }
.cot-promo-headline {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 6px;
  letter-spacing: -.01em;
}
.cot-promo-text {
  font-size: 13px;
  color: rgba(255,255,255,.8);
  margin: 0 0 8px;
  line-height: 1.55;
}
.cot-promo-trust {
  font-size: 12px;
  color: #c9a961;
  margin: 0;
  font-weight: 500;
}
.cot-promo-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  flex-shrink: 0;
}
.cot-promo-secondary {
  font-size: 13px;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  white-space: nowrap;
}
.cot-promo-secondary:hover { color: #fff; text-decoration: underline; }

/* Inline translator nudge */
.tour-nudge {
  margin-top: 14px;
  padding: 10px 14px;
  background: rgba(42,159,181,.08);
  border: 1px solid rgba(42,159,181,.2);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--muted);
}
.tour-nudge a { color: #2a9fb5; text-decoration: none; font-weight: 500; }
.tour-nudge a:hover { text-decoration: underline; }

/* ── SITE FOOTER ─────────────────────────────────────────────────────────── */
.site-footer {
  background: #0a0e16;
  border-top: 1px solid var(--border);
  padding: 32px 20px 16px;
  margin-top: 0;
}
.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.footer-brand { display: flex; gap: 14px; align-items: flex-start; }
.footer-logo { height: 44px; width: auto; }
.footer-title { font-size: 15px; font-weight: 700; color: #fff; margin-bottom: 3px; }
.footer-sub { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.footer-links-inline { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.footer-links-inline a { color: #2a9fb5; text-decoration: none; }
.footer-links-inline a:hover { color: #5cc4d9; text-decoration: underline; }
.footer-links-inline span { color: var(--border); }

.footer-tours-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 10px; }
.footer-tours-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; }
.footer-tour-link {
  font-size: 13px;
  color: #94a3b8;
  text-decoration: none;
  padding: 5px 0;
  border-bottom: 1px solid transparent;
  transition: color .15s, border-color .15s;
  display: block;
}
.footer-tour-link:hover { color: #2a9fb5; border-bottom-color: #2a9fb5; }

.footer-bottom {
  max-width: 1400px;
  margin: 14px auto 0;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.footer-sep { color: var(--border); }

/* ── BOTTOM NAV — hidden on desktop ───────────────────────────────────────── */
.bottom-nav { display: none; }

/* ── TABLET (≤960px) ─────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .two-col { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .cat-group-label { display: none; }
  .contribute-layout { grid-template-columns: 1fr; }
  .pending-card { position: static; max-height: none; }
  .trans-top { grid-template-columns: 1fr; }
  .trans-divider { display: none; }
  .inline-trans-inner { grid-template-columns: 1fr; }
  .inline-arrow { display: none; }
  .phrase-grid { grid-template-columns: 1fr; }
  .fav-grid { grid-template-columns: 1fr; }
}

/* ── MOBILE (≤768px) ────────────────────────────────────────────────────── */
@media (max-width: 768px) {

  /* Header */
  .header { padding: 0; }
  .header-inner {
    padding: 10px 14px 8px;
    gap: 10px;
    flex-wrap: nowrap;
    align-items: center;
  }
  .logo-text { font-size: 15px; }
  .logo-sub { display: none; }

  /* Language pills — horizontal scroll strip */
  .lang-wrap { flex-direction: row; align-items: center; gap: 8px; width: 100%; }
  .lang-label { display: none; }
  .lang-select { max-width: 100%; width: 100%; }
  .lang-pills-scroll {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .lang-pills-scroll::-webkit-scrollbar { display: none; }
  .lang-pills { display: flex; flex-wrap: nowrap; gap: 5px; width: max-content; padding: 2px 0 6px; }
  .lang-pill { font-size: 12px; padding: 6px 12px; flex-shrink: 0; min-height: 36px; }

  /* Desktop nav hidden */
  .main-nav { display: none; }

  /* Bottom nav */
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 300;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .bnav-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 4px;
    background: transparent;
    border: none;
    border-top: 2px solid transparent;
    color: var(--muted);
    font-family: inherit;
    cursor: pointer;
    transition: all .15s;
    min-height: 58px;
  }
  .bnav-tab.active { color: var(--accent); border-top-color: var(--accent); }
  .bnav-icon { font-size: 20px; line-height: 1; }
  .bnav-label { font-size: 10px; font-weight: 600; }

  /* Main — pad bottom for nav bar */
  .main { padding: 12px 12px calc(72px + env(safe-area-inset-bottom, 0px)) 12px; }

  /* Toast — sits above bottom nav */
  .toast { bottom: calc(72px + env(safe-area-inset-bottom, 0px) + 12px); }

  /* Sidebar → horizontal scroll category pills */
  .sidebar { background: transparent; border: none; border-radius: 0; padding: 0 0 8px; }
  .sidebar-title { display: none; }
  .cat-tabs {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 5px;
    padding-bottom: 6px;
  }
  .cat-tabs::-webkit-scrollbar { display: none; }
  .cat-tab {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 9px 14px;
    font-size: 13px;
    border-radius: 20px;
    border-left: none !important;
    background: var(--surface);
    border: 1px solid var(--border);
    min-height: 40px;
  }
  .cat-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

  /* Phrase cards */
  .phrase-card { min-height: 54px; padding: 14px 12px; border-radius: 10px; }
  .phrase-card-text { font-size: 14px; }

  /* Inline translator — sticky above bottom nav */
  .inline-trans {
    position: sticky;
    bottom: calc(58px + env(safe-area-inset-bottom, 0px));
    z-index: 50;
    margin: 8px 0 0;
    border-radius: 14px;
    box-shadow: 0 -4px 24px rgba(0,0,0,.6);
  }
  .inline-trans-inner { display: flex; flex-direction: column; gap: 10px; }
  .inline-actions { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .itrans-result { font-size: 22px; }

  /* Q&A */
  .qa-question { padding: 16px 14px; min-height: 58px; }
  .qa-q-text { font-size: 15px; }
  .qa-answer { padding: 0 14px 14px; }

  /* Full Translator — optimised for mobile voice use */
  .trans-card { padding: 14px; }
  .trans-input {
    font-size: 16px; /* prevents iOS auto-zoom */
    min-height: 110px;
  }
  .trans-output {
    font-size: 22px;
    min-height: 90px;
    line-height: 1.4;
  }
  .trans-actions { gap: 6px; flex-wrap: nowrap; }
  .trans-actions .btn { flex: 1; justify-content: center; font-size: 12px; padding: 0 6px; }
  .mic-btn { min-height: 44px; font-size: 13px; padding: 8px 16px; }
  .multi-card { padding: 14px; }

  /* Contribute */
  .contribute-card { padding: 16px; }
  .contribute-card h2 { font-size: 16px; }
  .form-input { font-size: 16px; } /* prevents iOS auto-zoom */
  .toggle-btn { padding: 9px 14px; min-height: 44px; }

  /* Saved */
  .saved-header h2 { font-size: 16px; }
  .fav-card { padding: 14px; }
  .fav-tr { font-size: 18px; }
  .fav-actions { flex-wrap: wrap; gap: 6px; }
  .fav-actions .btn { flex: 1; justify-content: center; }

  /* All buttons — minimum 44px touch target */
  .btn { min-height: 44px; }
  .btn-sm { min-height: 38px; }

  /* Panel header */
  .panel-header { flex-wrap: wrap; gap: 8px; }
  .panel-title { font-size: 14px; }

  /* Customer overlay */
  .customer-overlay { padding: 20px 16px; justify-content: flex-start; padding-top: 60px; }
  .customer-text { font-size: clamp(28px, 9vw, 52px); }
  .customer-speak-btn, .customer-copy-btn { font-size: 15px; padding: 12px 22px; }

  /* History */
  .history-card { padding: 14px; }
  .history-item { padding: 10px; }
  .history-en { display: none; }

  /* Saved header */
  .saved-header-actions { gap: 6px; }
  .trans-actions-secondary { margin-top: 6px; gap: 6px; }
  .btn-customer { font-size: 13px; min-height: 48px; }

  /* Category dropdown — show on mobile, hide sidebar pills */
  .cat-dropdown-wrap { display: block; margin-bottom: 12px; }
  .sidebar { display: none; }

  /* Direction toggle — slightly smaller on mobile */
  .dir-btn { font-size: 12px; padding: 9px 6px; gap: 4px; }
  .dir-flag { font-size: 15px; }

  /* Cultural tips */
  .ctips-card { padding: 12px 14px; margin-bottom: 12px; }
  .ctips-title { font-size: 12px; }
  .ctip-text { font-size: 12px; }

  /* Emergency */
  .emerg-card { padding: 16px; }
  .emerg-card h2 { font-size: 16px; }
  .emerg-phrase-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
  .emerg-phrase-btn { font-size: 12px; padding: 10px 8px; min-height: 44px; }
  .emerg-result-text { font-size: 20px; }

  /* Quick chips */
  .quick-phrases-wrap { margin-bottom: 8px; }

  /* QR modal */
  .qr-modal-inner { padding: 18px; }

  /* Source label row */
  .trans-lang-label-row { flex-wrap: wrap; gap: 6px; }

  /* Promo bar — static (not sticky) on mobile, trimmed */
  .promo-bar { padding: 10px 12px; position: static; }
  .promo-logo { display: none; }
  .promo-desc { display: none; }
  .promo-label { font-size: 12px; }
  .btn-gold { font-size: 12px; padding: 8px 14px; }

  /* Promo card */
  .cot-promo-inner { flex-direction: column; gap: 18px; align-items: stretch; }
  .cot-promo-actions { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 12px; }
  .cot-promo-headline { font-size: 16px; }

  /* Footer */
  .footer-inner { grid-template-columns: 1fr; gap: 20px; }
  .footer-tours-grid { grid-template-columns: 1fr 1fr; }
  .footer-logo { height: 36px; }
  .site-footer { padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
}

/* ── VERY SMALL (≤380px — iPhone SE, older Androids) ────────────────────── */
@media (max-width: 380px) {
  .lang-pill { font-size: 11px; padding: 5px 9px; }
  .cat-tab { font-size: 12px; padding: 8px 11px; }
  .bnav-label { font-size: 9px; }
  /* Action buttons: wrap into 2 columns so nothing clips */
  .trans-actions { flex-wrap: wrap; }
  .trans-actions .btn { flex: 1 1 calc(50% - 6px); min-width: 0; font-size: 11px; padding: 0 4px; }
  .trans-input { font-size: 15px; }
  .trans-output { font-size: 18px; }
  .quick-chip { font-size: 11px; padding: 6px 10px; }
}

/* ── TABLET CENTERING (≥769px ≤1024px) ──────────────────────────────────── */
@media (min-width: 769px) and (max-width: 1024px) {
  .translator-layout,
  .saved-layout,
  .contribute-layout {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* ── CATEGORY DROPDOWN (mobile only, hidden on desktop) ─────────────────── */
.cat-dropdown-wrap { display: none; }
.cat-dropdown {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  min-height: 48px;
}
.cat-dropdown:focus { outline: none; border-color: var(--accent); }

/* ── DIRECTION TOGGLE ────────────────────────────────────────────────────── */
.direction-toggle {
  display: flex;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 12px;
}
.dir-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
  min-height: 44px;
}
.dir-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(59,130,246,.35);
}
.dir-flag { font-size: 16px; line-height: 1; }
.dir-arrow { font-size: 12px; opacity: .7; }
.dir-btn:not(.active):hover { background: var(--surface3); color: var(--text); }

/* ── CULTURAL TIPS CARD ──────────────────────────────────────────────────── */
.ctips-card {
  background: linear-gradient(135deg, rgba(20,184,166,.08), rgba(59,130,246,.06));
  border: 1px solid rgba(20,184,166,.25);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.ctips-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.ctips-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--teal);
  letter-spacing: .01em;
}
.ctips-toggle {
  background: none;
  border: 1px solid rgba(20,184,166,.35);
  color: var(--teal);
  border-radius: 6px;
  font-size: 11px;
  padding: 3px 10px;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}
.ctips-toggle:hover { background: rgba(20,184,166,.1); }
.ctips-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ctip-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.ctip-icon {
  font-size: 16px;
  flex-shrink: 0;
  line-height: 1.4;
}
.ctip-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.55;
}

/* ── QUICK-TAP PHRASE BAR ────────────────────────────────────────────────── */
.quick-phrases-wrap {
  margin-bottom: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.quick-phrases-wrap::-webkit-scrollbar { display: none; }
.quick-phrases {
  display: flex;
  gap: 6px;
  width: max-content;
  padding: 2px 0 4px;
}
.quick-chip {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
  flex-shrink: 0;
  min-height: 36px;
}
.quick-chip:hover { border-color: var(--teal); color: var(--teal); }
.quick-chip.active { background: var(--teal); border-color: var(--teal); color: #fff; }

/* ── FLIP DIRECTION BUTTON ───────────────────────────────────────────────── */
.flip-btn {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 8px;
  min-height: 32px;
  margin-left: auto;
}
.flip-active .trans-lang-label { color: var(--teal); }
.flip-active .trans-input::placeholder { color: var(--teal); opacity: .6; }

/* ── QR MODAL ────────────────────────────────────────────────────────────── */
.qr-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.qr-modal-inner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 340px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.qr-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.qr-modal-header h3 { font-size: 16px; }
.qr-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
}
.qr-close:hover { color: var(--text); }
.qr-instruction { font-size: 13px; color: var(--muted); text-align: center; line-height: 1.5; }
.qr-canvas-wrap {
  background: #fff;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qr-canvas-wrap canvas, .qr-canvas-wrap img { display: block; }
.qr-text-preview {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  max-height: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

/* ── EMERGENCY VIEW ──────────────────────────────────────────────────────── */
.emergency-layout {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.emerg-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.emerg-card h2 { font-size: 18px; margin-bottom: 8px; }
.emerg-desc { font-size: 13px; color: var(--muted); margin-bottom: 16px; line-height: 1.5; }
.emerg-form { display: flex; flex-direction: column; gap: 12px; }
.emerg-field { display: flex; flex-direction: column; gap: 4px; }
.emerg-field label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.emerg-phrase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
.emerg-phrase-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all .15s;
  min-height: 48px;
}
.emerg-phrase-btn:hover { border-color: var(--red); color: var(--red); }
.emerg-phrase-btn.active { background: var(--red); border-color: var(--red); color: #fff; }
.emerg-result {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.emerg-result-lang { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.emerg-result-text { font-size: 22px; font-weight: 600; color: var(--text); line-height: 1.4; }
.emerg-result-actions { display: flex; gap: 8px; }
.bnav-emergency { color: var(--red) !important; }
.bnav-emergency.active { color: var(--red) !important; border-top-color: var(--red) !important; }

/* ── ROMANIZATION ─────────────────────────────────────────────────────────── */
.trans-romanized {
  font-size: 13px;
  color: var(--teal);
  font-style: italic;
  margin-top: 6px;
  min-height: 18px;
  letter-spacing: 0.02em;
}

/* ── BROADCAST LANGUAGE CHIPS ─────────────────────────────────────────────── */
.bc-lang-wrap { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.bc-chip {
  padding: 5px 10px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
}
.bc-chip.active {
  border-color: var(--accent);
  background: rgba(59,130,246,.15);
  color: var(--text);
}
.multi-desc { font-size: 12px; color: var(--muted); margin-bottom: 8px; }

/* ── BROADCAST MODAL ──────────────────────────────────────────────────────── */
.broadcast-modal {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.75);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.broadcast-modal-inner {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  width: 100%; max-width: 700px;
  max-height: 90vh; overflow-y: auto;
  padding: 20px;
}
.broadcast-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.broadcast-modal-header h3 { font-size: 16px; }
.broadcast-hint { font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.broadcast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.bc-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  align-items: center; text-align: center;
}
.bc-lang { font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.bc-text { font-size: 26px; font-weight: 700; color: var(--text); line-height: 1.35; word-break: break-word; }
.bc-speak-btn {
  background: var(--accent); color: #fff;
  border: none; border-radius: 8px;
  padding: 8px 16px; font-size: 16px; cursor: pointer;
}
.bc-speak-btn:disabled { opacity: .5; cursor: default; }

/* ── TOUR SCRIPT VIEW ─────────────────────────────────────────────────────── */
.script-layout { display: flex; flex-direction: column; gap: 16px; padding: 16px; max-width: 900px; margin: 0 auto; }
.script-header-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.script-header-card h2 { margin-bottom: 6px; }
.script-desc { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.script-controls select { width: 100%; }
.script-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.script-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; max-height: 480px; overflow-y: auto; }
.script-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  background: var(--surface2);
  cursor: pointer;
  transition: all .15s;
}
.script-item:hover { border-color: var(--accent); }
.script-item.active {
  border-color: var(--accent);
  background: rgba(59,130,246,.1);
}
.script-num {
  min-width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--surface3);
  color: var(--muted);
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.script-item.active .script-num { background: var(--accent); color: #fff; }
.script-content { flex: 1; min-width: 0; }
.script-en { font-size: 14px; color: var(--text); line-height: 1.5; }
.script-tr { font-size: 13px; color: var(--teal); margin-top: 4px; font-style: italic; }
.script-speak-btn {
  background: none; border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 8px;
  font-size: 14px; cursor: pointer; color: var(--text);
  flex-shrink: 0; align-self: center;
}
.script-nav-btns { display: flex; gap: 8px; }
.script-nav-btns .btn { flex: 1; }
.script-output {
  background: linear-gradient(135deg, var(--surface), var(--surface2));
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}
.script-output-lang { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; margin-bottom: 10px; }
.script-output-text { font-size: 28px; font-weight: 700; color: var(--text); line-height: 1.4; margin-bottom: 16px; word-break: break-word; }
.script-output-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

@media (max-width: 480px) {
  .broadcast-grid { grid-template-columns: 1fr 1fr; }
  .bc-text { font-size: 20px; }
  .script-output-text { font-size: 22px; }
}
