/* Minbar app design system - shares brand tokens with the minbar-connect
   marketing site and app so getminbar.com feels like one product.
   Inter for UI/Latin, Amiri for Arabic. Colors in OKLCH, identical to the site. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Amiri:wght@400;700&display=swap');

:root {
  /* --- brand tokens copied from minbar-connect/src/styles.css --- */
  --paper:      oklch(0.968 0.008 85);   /* warm off-white background */
  --ink:        oklch(0.22 0.02 160);    /* deep green ink */
  --card:       oklch(0.985 0.006 85);
  --muted:      oklch(0.45 0.02 140);
  --line:       oklch(0.87 0.013 85);
  --brand:      oklch(0.52 0.11 160);    /* deep emerald #0f7a52 */
  --brand-600:  oklch(0.46 0.115 160);
  --brand-glow: oklch(0.63 0.12 160);
  --brand-050:  oklch(0.95 0.03 160);    /* light emerald tint for callouts */
  --gold:       oklch(0.68 0.09 75);     /* restrained gold #b8894a */
  --deep:       oklch(0.20 0.03 162);    /* dark surfaces (imam console, recap) */
  --deep-2:     oklch(0.27 0.045 162);
  --danger:     oklch(0.55 0.2 27);

  --radius: 16px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px oklch(0.22 0.02 160 / .05), 0 4px 16px oklch(0.22 0.02 160 / .06);
  --shadow-lg: 0 12px 40px oklch(0.22 0.02 160 / .16);
}

* { box-sizing: border-box; border-color: var(--line); }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--paper);
  margin: 0;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Arabic gets classical typography everywhere */
[dir="rtl"], .ar {
  font-family: 'Amiri', 'Noto Naskh Arabic', serif;
  font-feature-settings: "kern" 1, "liga" 1;
  line-height: 1.9;
}

h1, h2, h3, h4 { font-family: 'Inter', sans-serif; letter-spacing: -0.02em; }

.gold-rule { height: 1px; background: linear-gradient(to right, transparent, var(--gold) 30%, var(--gold) 70%, transparent); }

/* ---- App header (sticky brand bar) ---- */
.app-header {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(180deg, var(--deep-2), var(--deep));
  color: #fff;
  padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  box-shadow: 0 1px 0 rgba(255,255,255,.05), var(--shadow);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }
.brand .mark { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%;
  background: var(--brand); color: #fff; }
.brand .mark svg { width: 17px; height: 17px; }
.app-header a { color: color-mix(in oklab, var(--brand-glow) 80%, white); text-decoration: none; font-size: 14px; font-weight: 600; }
.app-header a:hover { color: #fff; }

/* ---- Layout ---- */
.wrap { max-width: 720px; margin: 0 auto; padding: 18px; }
.wrap-wide { max-width: 900px; margin: 0 auto; padding: 18px; }

/* ---- Cards ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card + .card { margin-top: 14px; }

/* ---- Buttons ---- */
.btn { font: inherit; font-weight: 600; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  padding: 10px 18px; border-radius: var(--radius-sm); cursor: pointer; transition: .15s; display: inline-flex; align-items: center; gap: 8px; }
.btn:hover { background: color-mix(in oklab, var(--card) 88%, var(--ink)); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); }
.btn-ghost { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.25); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.2); }

/* ---- Form controls ---- */
.select, .field {
  font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 9px 12px; transition: .15s;
}
.select:focus, .field:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-050); }
textarea.field { width: 100%; resize: vertical; line-height: 1.55; }
label.lbl { font-size: 13px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }

/* ---- Pills / badges ---- */
.pill { font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; }
.pill-live { background: var(--danger); color: #fff; }
.pill-live .dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: pulse 1.6s infinite; }
.pill-wait { background: rgba(255,255,255,.15); color: color-mix(in oklab, var(--brand-glow) 70%, white); }
.badge-ok { color: var(--brand-600); font-weight: 700; }
.badge-gold { color: var(--gold); font-weight: 700; }
.badge-warn { color: oklch(0.55 0.12 70); font-weight: 700; }
.muted { color: var(--muted); }

@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

/* ---- Language chips (segmented control) ---- */
.langbar { display: flex; gap: 4px; background: rgba(255,255,255,.1); padding: 4px; border-radius: 999px; }
.langbar button { font: inherit; font-size: 13px; font-weight: 600; color: color-mix(in oklab, var(--brand-glow) 70%, white); background: transparent;
  border: 0; padding: 6px 13px; border-radius: 999px; cursor: pointer; transition: .15s; white-space: nowrap; }
.langbar button.active { background: #fff; color: var(--ink); }

/* ---- Segment cards (listener + archive transcript) ---- */
.seg-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.seg-ar { color: color-mix(in oklab, var(--muted) 70%, var(--paper)); text-align: right; margin: 0 0 6px; font-size: 16px; }
.seg-tx { margin: 0; font-size: 19px; line-height: 1.55; }
.seg-recap { background: linear-gradient(160deg, var(--deep-2), var(--deep)); color: #eef6f1; border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.seg-recap .k { font-size: 12px; letter-spacing: .18em; font-weight: 700; color: var(--brand-glow); margin: 0 0 10px; }

/* projector mode - big type */
.big .seg-tx { font-size: 34px; font-weight: 500; line-height: 1.45; }
.big .seg-ar { font-size: 23px; }
.big .seg-recap { font-size: 26px; }

@media print { .no-print { display: none !important; } body { background: #fff; } .card { box-shadow: none; border: none; } }
