/* ---------------------------------------------------------------------------
 * Vedic Rishikesh — brand stylesheet (no framework, ~14 KB)
 * Palette: cream / saffron / deep maroon / ink-brown
 * ------------------------------------------------------------------------- */

:root {
  --cream:     #FBF6EE;
  --paper:     #FFFFFF;
  --ink:       #2D1B0E;
  --ink-soft:  #6B5544;
  --saffron:   #C2410C;
  --saffron-d: #9A3412;
  --maroon:    #7C2D12;
  --gold:      #B45309;
  --line:      #EADFCF;
  --ok:        #15803D;
  --bad:       #B91C1C;
  --wait:      #B45309;
  --radius:    14px;
  --shadow:    0 10px 30px rgba(45, 27, 14, .08);
  --shadow-lg: 0 18px 50px rgba(45, 27, 14, .14);
  --serif:     "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans:      "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ------------------------------------------------------------------ layout */

.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 12px 20px;
}

.topbar-inner {
  max-width: 1060px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.main {
  flex: 1;
  width: 100%;
  max-width: 1060px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

.footer {
  background: var(--paper);
  border-top: 1px solid var(--line);
  padding: 18px 20px;
}

.footer-inner {
  max-width: 1060px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 13px;
}

/* ------------------------------------------------------------------ brand */

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--saffron), var(--maroon));
  display: flex; align-items: center; justify-content: center;
  flex: none;
}

.brand-mark svg { width: 20px; height: 20px; display: block; }

.brand-name {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: .2px;
}

.brand-name em {
  font-style: normal;
  color: var(--saffron);
}

.brand-sub {
  display: block;
  font-family: var(--sans);
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: .14em;
  text-transform: uppercase;
}

/* ------------------------------------------------------------------ cards */

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

.card + .card { margin-top: 20px; }

.hero {
  text-align: center;
  padding: 44px 24px 36px;
}

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 700;
  margin: 0 0 10px;
}

.hero h1 em { font-style: normal; color: var(--saffron); }

.hero p {
  color: var(--ink-soft);
  max-width: 560px;
  margin: 0 auto 6px;
  font-size: 16px;
}

.hero .lang-strip {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.entry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.entry-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform .18s ease, box-shadow .18s ease;
}

.entry-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.entry-card .ic {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(194, 65, 12, .09);
  color: var(--saffron);
}

.entry-card h3 {
  font-family: var(--serif);
  font-size: 22px;
  margin: 0;
}

.entry-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  flex: 1;
}

/* ------------------------------------------------------------------ forms */

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 0 0 6px;
  letter-spacing: .02em;
}

input[type="text"], input[type="password"], select, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--saffron);
  box-shadow: 0 0 0 3px rgba(194, 65, 12, .12);
  background: var(--paper);
}

.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .06em; }

.field { margin-bottom: 16px; }
.hint { font-size: 12.5px; color: var(--ink-soft); margin-top: 6px; }
.hint code { background: rgba(194,65,12,.08); padding: 1px 6px; border-radius: 6px; }

/* ------------------------------------------------------------------ buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 10px;
  border: 1.5px solid transparent;
  background: var(--saffron);
  color: #fff;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease, transform .12s ease, box-shadow .15s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover { background: var(--saffron-d); }
.btn:active { transform: translateY(1px); }

.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--line);
}

.btn-ghost:hover { background: rgba(45,27,14,.04); color: var(--ink); }

.btn-danger { background: var(--bad); }
.btn-danger:hover { background: #991B1B; }

.btn-danger-ghost {
  background: transparent;
  color: var(--bad);
  border-color: rgba(185, 28, 28, .35);
}

.btn-danger-ghost:hover { background: rgba(185,28,28,.06); }

.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }

.btn-block { width: 100%; }

/* ------------------------------------------------------------------ chips & badges */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(45,27,14,.05);
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-soft);
  white-space: nowrap;
}

.chip-code { background: rgba(194,65,12,.08); color: var(--saffron-d); border-color: rgba(194,65,12,.2); }
.chip-lang { background: rgba(124,45,18,.08); color: var(--maroon); border-color: rgba(124,45,18,.22); }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .03em;
}

.badge-live  { background: rgba(21,128,61,.12); color: var(--ok); }
.badge-wait  { background: rgba(180,83,9,.12); color: var(--wait); }
.badge-off   { background: rgba(45,27,14,.07); color: var(--ink-soft); }

/* ------------------------------------------------------------------ tables */

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid var(--line);
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(45,27,14,.02); }

.muted { color: var(--ink-soft); }

/* ------------------------------------------------------------------ tabs */

.tabs {
  display: flex;
  gap: 6px;
  border-bottom: 2px solid var(--line);
  margin-bottom: 22px;
  overflow-x: auto;
}

.tabbtn {
  padding: 10px 18px;
  border: none;
  background: transparent;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
}

.tabbtn:hover { color: var(--ink); }

.tabbtn.active {
  color: var(--saffron);
  border-bottom-color: var(--saffron);
}

/* ------------------------------------------------------------------ stats */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

.stat {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}

.stat .n {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 700;
  color: var(--saffron-d);
  line-height: 1.1;
}

.stat .l {
  font-size: 12.5px;
  color: var(--ink-soft);
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* ------------------------------------------------------------------ call room */

.call-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.call-head .timer {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 14px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--ink-soft);
}

.dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #C8B9A5;
  flex: none;
}

.dot-on   { background: var(--ok); box-shadow: 0 0 0 3px rgba(21,128,61,.15); }
.dot-wait { background: var(--wait); box-shadow: 0 0 0 3px rgba(180,83,9,.15); }
.dot-bad  { background: var(--bad); }
.dot-off  { background: #C8B9A5; }

.status-text.st-on  { color: var(--ok); font-weight: 600; }
.status-text.st-wait{ color: var(--wait); }
.status-text.st-bad { color: var(--bad); font-weight: 600; }
.status-text.st-off { color: var(--ink-soft); }

.session-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.caps-shell {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 380px;
  max-height: 58vh;
}

.caps-head {
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.caps-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  scroll-behavior: smooth;
}

.caps-scroll::-webkit-scrollbar { width: 8px; }
.caps-scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }

.caps-hidden .caps-scroll, .caps-hidden .caps-empty { display: none; }

.caps-empty {
  margin: auto;
  text-align: center;
  color: var(--ink-soft);
  padding: 40px 20px;
}

.caps-empty .big {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--ink);
  margin-bottom: 6px;
}

.rec-notice {
  font-size: 12px;
  color: var(--ink-soft);
  background: rgba(180,83,9,.06);
  border: 1px dashed rgba(180,83,9,.3);
  border-radius: 10px;
  padding: 8px 14px;
  margin-bottom: 12px;
  text-align: center;
}

/* caption blocks */

.cap {
  margin: 0 0 16px;
  max-width: 88%;
  border-radius: 14px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  background: var(--cream);
}

.cap-pandit {
  margin-right: auto;
  border-left: 4px solid var(--saffron);
}

.cap-client {
  margin-left: auto;
  border-right: 4px solid var(--maroon);
  background: rgba(124,45,18,.04);
}

.cap-quick {
  border-style: dashed;
  border-color: var(--gold);
  background: rgba(180,83,9,.06);
}

.cap-who {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.cap-quicktag { color: var(--gold); }

.cap-src {
  font-size: 13.5px;
  color: var(--ink-soft);
  margin-bottom: 4px;
}

.cap-dst {
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
}

.cap-live .cap-dst { min-height: 24px; }

.cap-live::after {
  content: "";
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--saffron);
  margin-left: 8px;
  animation: vv-pulse 1.1s infinite;
  vertical-align: middle;
}

@keyframes vv-pulse {
  0%, 100% { opacity: .25; }
  50%      { opacity: 1; }
}

/* controls bar */

.controls {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin-top: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.ctl {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  min-height: 44px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
}

.ctl:hover { border-color: var(--saffron); color: var(--saffron-d); }

.ctl-active {
  background: rgba(194,65,12,.1);
  border-color: var(--saffron);
  color: var(--saffron-d);
}

.ctl-danger { color: var(--bad); border-color: rgba(185,28,28,.3); }
.ctl-danger:hover { background: rgba(185,28,28,.06); color: var(--bad); border-color: var(--bad); }

.ctl-label { font-size: 13px; }

.ctl svg { width: 18px; height: 18px; flex: none; }

.vol-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  min-height: 44px;
}

.vol-wrap input[type="range"] { width: 110px; accent-color: var(--saffron); }
.vol-wrap svg { width: 18px; height: 18px; color: var(--ink-soft); }

select.lang-select {
  width: auto;
  min-width: 150px;
  min-height: 44px;
  padding: 8px 34px 8px 12px;
  font-weight: 600;
}

/* quick phrase popover */

.quick-wrap { position: relative; }

.quick-panel {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 0;
  width: min(92vw, 340px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 14px;
  display: none;
  z-index: 20;
}

.quick-panel.open { display: block; }

.quick-panel h4 {
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.quick-item {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
}

.quick-item:hover { border-color: var(--saffron); }

.quick-item span { display: block; font-size: 11.5px; color: var(--ink-soft); margin-top: 2px; }

.quick-custom-row { display: flex; gap: 8px; margin-top: 10px; }
.quick-custom-row input { flex: 1; }

/* misc */

.fatal {
  display: none;
  background: rgba(185,28,28,.06);
  border: 1px solid rgba(185,28,28,.3);
  color: var(--bad);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 16px;
  font-weight: 600;
}

.uploading {
  display: none;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--wait);
}

.uploading.show { display: inline-flex; }

.uploading .spin {
  width: 14px; height: 14px;
  border: 2px solid rgba(180,83,9,.25);
  border-top-color: var(--wait);
  border-radius: 50%;
  animation: vv-rot .8s linear infinite;
}

@keyframes vv-rot { to { transform: rotate(360deg); } }

.pulse { animation: vv-attention 1.4s ease infinite; }

@keyframes vv-attention {
  0%, 100% { box-shadow: 0 0 0 0 rgba(194,65,12,.4); }
  50%      { box-shadow: 0 0 0 8px rgba(194,65,12,0); }
}

/* toasts */

#vv-toasts {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.vv-toast {
  background: var(--ink);
  color: #FBF6EE;
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 14px;
  max-width: min(90vw, 380px);
  opacity: 0;
  transform: translateY(8px);
  transition: all .3s ease;
  box-shadow: var(--shadow-lg);
}

.vv-toast.show { opacity: 1; transform: translateY(0); }
.vv-toast-error { background: var(--bad); }

/* dialog (link dialog) */

.dlg {
  position: fixed;
  inset: 0;
  background: rgba(45,27,14,.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 90;
  padding: 20px;
}

.dlg.open { display: flex; }

.dlg-card {
  background: var(--paper);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 24px;
  width: min(92vw, 520px);
}

.dlg-card h3 {
  font-family: var(--serif);
  margin: 0 0 12px;
  font-size: 22px;
}

.dlg-url {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 13px;
  word-break: break-all;
  margin-bottom: 16px;
}

.dlg-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* login */

.login-card { max-width: 400px; margin: 8vh auto 0; }
.login-err { display: none; color: var(--bad); font-size: 13.5px; margin-top: 8px; }

/* ------------------------------------------------------------------ responsive */

@media (max-width: 640px) {
  .main { padding: 18px 14px 40px; }
  .card { padding: 20px; }
  .hero { padding: 32px 16px 28px; }
  .caps-shell { min-height: 300px; max-height: 46vh; }
  .cap { max-width: 100%; }
  .controls { padding: 10px; gap: 8px; }
  .ctl { padding: 9px 12px; font-size: 13px; }
  .ctl-label { display: none; }             /* icons only on phones */
  .ctl-danger .ctl-label, .ctl .ctl-label-solo { display: inline; }
  .vol-wrap input[type="range"] { width: 80px; }
  .timer { font-size: 16px; }
  .footer-inner { flex-direction: column; text-align: center; }
}

@media print {
  .topbar, .footer, .no-print, .controls, .tabs { display: none !important; }
  body { background: #fff; }
}

.cap-bookmarked {
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 2px rgba(180, 83, 9, 0.18);
}
.trow-bookmarked {
  background: rgba(180, 83, 9, 0.05);
  border-left: 3px solid var(--gold);
  padding-left: 10px;
}
