  html, body {
    margin: 0; padding: 0; height: 100%; background: #f7f5f0;
    position: fixed; width: 100%; overflow: hidden; overscroll-behavior: none;
  }
  :root {
    --bg: #f7f5f0;
    --surface: #ffffff;
    --surface-alt: #efeae1;
    --ink: #23281f;
    --ink-soft: #6b7263;
    --accent: #2f6f62;
    --accent-dark: #234f45;
    --accent-soft: #dbeae4;
    --mistake: #b0492b;
    --mistake-soft: #f6e4db;
    --border: #e3ded2;
    --gold: #c88a2e;
  }
  #ep-root {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--ink);
    background: var(--bg);
    height: 100dvh;
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
  }
  #ep-root *, #ep-root *::before, #ep-root *::after { box-sizing: border-box; }
  #ep-root button { font-family: inherit; cursor: pointer; transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .1s ease, box-shadow .15s ease; }
  #ep-root button:active { transform: scale(0.96); }
  #ep-root .heading { font-family: 'Space Grotesk', 'Inter', sans-serif; }

  /* ---------- shell ---------- */
  .ep-shell { display: flex; flex: 1; min-height: 0; }
  .ep-sidebar {
    display: none;
    flex-direction: column;
    width: 240px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 22px 14px;
    flex-shrink: 0;
  }
  .ep-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 20px; }
  .ep-brand-mark {
    width: 48px; height: 48px; border-radius: 12px;
    overflow: hidden; flex-shrink: 0;
  }
  .ep-brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .ep-brand-text { line-height: 1.15; }
  .ep-brand-text b { font-family: 'Space Grotesk', sans-serif; font-size: 15px; display: block; }
  .ep-brand-text span { font-size: 11.5px; color: var(--ink-soft); }

  .ep-nav-btn {
    display: flex; align-items: center; gap: 11px;
    width: 100%; text-align: left; padding: 11px 12px; border-radius: 10px;
    border: none; background: transparent; color: var(--ink-soft); font-size: 14.5px; font-weight: 500;
    margin-bottom: 3px; transition: background .15s, color .15s;
  }
  .ep-nav-btn svg { width: 19px; height: 19px; flex-shrink: 0; }
  .ep-nav-btn.active { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
  .ep-nav-btn:not(.active):hover { background: var(--surface-alt); color: var(--ink); }

  .ep-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

  /* ---------- views ---------- */
  .ep-view { display: none; flex: 1; min-height: 0; flex-direction: column; }
  .ep-view.active { display: flex; }

  .ep-topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px; background: var(--surface); border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }
  .ep-topbar h1 { font-size: 17px; margin: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ep-topbar .ep-sub { font-size: 12px; color: var(--ink-soft); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ep-topbar > div:first-child { min-width: 0; }
  /* Mic / new-chat / settings control row: always a single horizontal line,
     on desktop and mobile alike, at any of the common widths (320–430px)
     down to very narrow ones — never wraps into a vertical stack. */
  .ep-controls {
    display: flex; flex-direction: row; align-items: center; justify-content: center;
    gap: 8px; flex-wrap: nowrap; flex-shrink: 0;
  }
  .ep-icon-btn {
    position: relative;
    width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border);
    background: var(--surface); display: flex; align-items: center; justify-content: center;
    color: var(--ink-soft); flex-shrink: 0;
  }
  .ep-icon-btn:hover { background: var(--accent-soft); color: var(--accent-dark); border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 2px 6px rgba(0,0,0,.08); }
  .ep-icon-btn svg { width: 17px; height: 17px; }
  .ep-live-label { display: none; }
  .ep-icon-btn.voice-on .ep-live-label {
    display: block; position: absolute; top: -6px; right: -5px; background: var(--mistake); color: #fff;
    font-size: 8px; font-weight: 700; line-height: 1; padding: 2.5px 4px; border-radius: 8px; letter-spacing: .4px;
  }

  /* ---------- chat ---------- */
  .ep-key-banner {
    display: none; font-size: 12.5px; color: #8a5a1c; background: #fbeed4;
    border-bottom: 1px solid #f0d9a8; padding: 8px 16px; text-align: center;
  }
  .ep-key-banner.show { display: block; }
  .ep-key-banner button {
    border: none; background: none; color: var(--accent-dark); font-weight: 700; text-decoration: underline; font-size: 12.5px;
  }
  #ep-view-chat {
    background-image: radial-gradient(circle, #eae5d9 1px, transparent 1px);
    background-size: 16px 16px;
  }
  .ep-chat-scroll {
    flex: 1; overflow-y: auto; padding: 16px 12px 8px;
    display: flex; flex-direction: column; gap: 4px; width: 100%;
  }
  .ep-row { display: flex; margin: 5px 0; max-width: 100%; }
  .ep-row.user { justify-content: flex-end; }
  .ep-row.bot { justify-content: flex-start; }
  .ep-row.system { justify-content: center; }

  .ep-bubble-wrap { max-width: 82%; display: flex; flex-direction: column; }
  .ep-row.user .ep-bubble-wrap { align-items: flex-end; }
  .ep-row.bot .ep-bubble-wrap { align-items: flex-start; }

  .ep-quote {
    font-size: 12px; padding: 6px 10px; border-radius: 8px 8px 2px 2px;
    background: rgba(0,0,0,.05); border-left: 3px solid var(--accent);
    color: var(--ink-soft); max-width: 100%; margin-bottom: -2px;
    cursor: pointer;
  }
  .ep-quote b { color: var(--ink); font-weight: 600; }

  .ep-bubble {
    padding: 9px 12px; border-radius: 14px; font-size: 14.5px; line-height: 1.45;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
    word-wrap: break-word; white-space: pre-wrap;
  }
  .ep-row.user .ep-bubble { background: var(--accent-soft); color: var(--accent-dark); border-radius: 14px 14px 3px 14px; }
  .ep-row.bot .ep-bubble { background: var(--surface); border: 1px solid var(--border); border-radius: 14px 14px 14px 3px; }
  .ep-row.system .ep-bubble { background: transparent; color: var(--ink-soft); font-size: 12px; font-style: italic; box-shadow: none; }

  .ep-meta-row { display: flex; align-items: center; gap: 8px; margin-top: 3px; padding: 0 3px; }
  .ep-time { font-size: 10.5px; color: var(--ink-soft); opacity: .8; }
  .ep-msg-actions { display: flex; gap: 4px; opacity: .6; transition: opacity .12s; }
  .ep-row:hover .ep-msg-actions, .ep-row:focus-within .ep-msg-actions { opacity: 1; }
  .ep-msg-actions button {
    border: none; background: transparent; color: var(--ink-soft); padding: 4px;
    display: flex; align-items: center; border-radius: 6px;
  }
  .ep-msg-actions button:hover { color: var(--accent-dark); background: var(--accent-soft); transform: translateY(-1px); }
  .ep-msg-actions svg { width: 13px; height: 13px; }

  .ep-correction {
    margin-top: 6px; background: var(--mistake-soft); border: 1px solid #e6c3b0;
    border-radius: 10px; padding: 9px 11px; font-size: 13px; max-width: 100%;
  }
  .ep-correction .ep-c-row { margin-bottom: 3px; display: flex; gap: 6px; align-items: flex-start; }
  .ep-correction .ep-c-row:last-child { margin-bottom: 0; }
  .ep-correction .ep-x { color: var(--mistake); text-decoration: line-through; opacity: .8; }
  .ep-correction .ep-check { color: var(--accent-dark); font-weight: 600; }
  .ep-correction .ep-explain { color: var(--ink-soft); font-size: 12.5px; margin-top: 4px; }
  .ep-cat-chip {
    display: inline-block; margin-top: 6px; font-size: 10.5px; font-weight: 600;
    background: var(--mistake); color: #fff; padding: 2px 8px; border-radius: 20px;
  }
  .ep-recur {
    margin-top: 5px; font-size: 11.5px; color: var(--gold); font-weight: 600;
  }

  .ep-typing { display: flex; gap: 3px; padding: 10px 13px; }
  .ep-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-soft); opacity: .5; animation: ep-blink 1.2s infinite; }
  .ep-typing span:nth-child(2) { animation-delay: .2s; }
  .ep-typing span:nth-child(3) { animation-delay: .4s; }
  @keyframes ep-blink { 0%,80%,100%{opacity:.3; transform: translateY(0);} 40%{opacity:1; transform: translateY(-2px);} }

  .ep-reply-bar {
    display: none; align-items: center; justify-content: space-between; gap: 8px;
    padding: 8px 14px; background: var(--surface-alt); border-top: 1px solid var(--border);
  }
  .ep-reply-bar.active { display: flex; }
  .ep-reply-bar-text { font-size: 12.5px; color: var(--ink-soft); border-left: 3px solid var(--accent); padding-left: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ep-reply-bar-text b { color: var(--ink); }
  .ep-reply-bar button { background: none; border: none; color: var(--ink-soft); font-size: 16px; padding: 0 4px; }
  .ep-reply-bar button:hover { color: var(--mistake); }

  .ep-inputbar {
    display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px;
    background: var(--surface); border-top: 1px solid var(--border);
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    flex-shrink: 0;
  }
  .ep-input {
    flex: 1; border: 1px solid var(--border); background: var(--bg);
    border-radius: 20px; padding: 10px 15px; font-size: 14.5px; resize: none;
    max-height: 110px; line-height: 1.4; color: var(--ink); font-family: inherit;
  }
  .ep-input:focus { outline: none; border-color: var(--accent); }
  .ep-round-btn {
    width: 40px; height: 40px; border-radius: 50%; border: none; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; color: #fff; background: var(--accent);
  }
  .ep-round-btn svg { width: 18px; height: 18px; }
  .ep-round-btn.mic { background: var(--surface-alt); color: var(--ink-soft); }
  .ep-round-btn.mic.listening { background: var(--mistake); color: #fff; animation: ep-pulse 1.2s infinite; }
  .ep-round-btn.voice-on { background: var(--gold); color: #fff; }
  .ep-icon-btn.voice-on { background: var(--gold); color: #fff; border-color: var(--gold); }
  .ep-icon-btn.voice-on.live-listening { animation: ep-pulse-gold 1.2s infinite; }
  @keyframes ep-pulse-gold { 0%{ box-shadow: 0 0 0 0 rgba(200,138,46,.45);} 70%{ box-shadow: 0 0 0 9px rgba(200,138,46,0);} 100%{box-shadow:0 0 0 0 rgba(200,138,46,0);} }
  @keyframes ep-pulse { 0%{ box-shadow: 0 0 0 0 rgba(176,73,43,.4);} 70%{ box-shadow: 0 0 0 9px rgba(176,73,43,0);} 100%{box-shadow:0 0 0 0 rgba(176,73,43,0);} }
  .ep-round-btn:hover { filter: brightness(1.12); box-shadow: 0 2px 8px rgba(0,0,0,.15); }
  .ep-round-btn.mic:hover { background: var(--border); color: var(--ink); }
  .ep-round-btn:disabled { opacity: .5; }
  .ep-icon-btn:disabled { opacity: .4; cursor: not-allowed; }

  /* ---------- flashcards ---------- */
  .ep-scroll { flex: 1; overflow-y: auto; padding: 14px; }
  .ep-fc-filters { display: flex; gap: 6px; padding: 0 14px 12px; flex-wrap: wrap; }
  .ep-fc-filters button {
    border: 1px solid var(--border); background: var(--surface); color: var(--ink-soft);
    padding: 5px 12px; border-radius: 20px; font-size: 12.5px; font-weight: 500;
  }
  .ep-fc-filters button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
  .ep-fc-filters button:not(.active):hover { border-color: var(--accent); color: var(--accent-dark); }
  .ep-fc-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
  .ep-fc-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
    padding: 16px; cursor: pointer; position: relative; min-height: 108px;
    display: flex; flex-direction: column; justify-content: center;
  }
  .ep-fc-card .ep-fc-cat {
    position: absolute; top: 12px; right: 12px; font-size: 10px; font-weight: 700;
    background: var(--mistake-soft); color: var(--mistake); padding: 2px 8px; border-radius: 20px;
  }
  .ep-fc-card .ep-fc-delete {
    position: absolute; top: 10px; left: 10px; width: 22px; height: 22px; flex-shrink: 0;
    border: 1px solid var(--border); background: var(--bg); color: var(--ink-soft);
    border-radius: 50%; font-size: 13px; line-height: 1; display: flex; align-items: center;
    justify-content: center; padding: 0;
  }
  .ep-fc-card .ep-fc-delete:hover { background: var(--mistake-soft); border-color: var(--mistake); color: var(--mistake); }
  .ep-fc-front .ep-x-line { color: var(--mistake); text-decoration: line-through; font-size: 15px; }
  .ep-fc-hint { font-size: 11px; color: var(--ink-soft); margin-top: 8px; }
  .ep-fc-back { display: none; }
  .ep-fc-card.flipped .ep-fc-front { display: none; }
  .ep-fc-card.flipped .ep-fc-back { display: block; }
  .ep-fc-back .ep-check-line { color: var(--accent-dark); font-weight: 600; font-size: 15px; }
  .ep-fc-back .ep-explain { color: var(--ink-soft); font-size: 12.5px; margin-top: 6px; }
  .ep-fc-actions { display: flex; gap: 8px; margin-top: 12px; }
  .ep-fc-actions button {
    flex: 1; border: 1px solid var(--border); background: var(--bg); border-radius: 8px;
    padding: 6px; font-size: 12px; font-weight: 600; color: var(--ink-soft);
  }
  .ep-fc-actions button.known { color: var(--accent-dark); }
  .ep-fc-actions button.known.active { background: var(--accent-soft); border-color: var(--accent); }
  .ep-fc-actions button:hover { border-color: var(--accent); background: var(--surface-alt); }
  .ep-fc-count { font-size: 10.5px; color: var(--ink-soft); margin-top: 6px; }
  .ep-empty { text-align: center; color: var(--ink-soft); padding: 60px 20px; font-size: 13.5px; }
  .ep-empty svg { width: 40px; height: 40px; margin-bottom: 10px; opacity: .5; }

  /* ---------- settings ---------- */
  .ep-provider-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
    padding: 16px; margin-bottom: 14px;
  }
  .ep-provider-card.is-active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
  .ep-provider-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
  .ep-provider-head b { font-size: 14.5px; }
  .ep-provider-head a { color: var(--accent-dark); font-size: 12px; text-decoration: underline; }
  .ep-provider-head .ep-p-sub { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
  .ep-provider-use {
    flex-shrink: 0; font-size: 12px; font-weight: 700; border-radius: 20px; padding: 6px 13px;
    border: 1px solid var(--border); background: var(--bg); color: var(--ink-soft);
  }
  .ep-provider-use.active { background: var(--accent); border-color: var(--accent); color: #fff; }
  .ep-provider-use:hover { border-color: var(--accent); color: var(--accent-dark); }
  .ep-provider-use.active:hover { filter: brightness(1.1); color: #fff; }
  .ep-provider-card input {
    width: 100%; padding: 9px 11px; border: 1px solid var(--border); background: var(--bg);
    border-radius: 8px; font-size: 13px; font-family: inherit; margin-bottom: 8px; color: var(--ink);
    box-sizing: border-box;
  }
  .ep-provider-actions { display: flex; gap: 8px; margin-top: 2px; }
  .ep-provider-actions button {
    font-size: 12.5px; font-weight: 600; border-radius: 8px; padding: 8px 12px; border: none;
  }
  .ep-provider-actions .ep-p-save { flex: 1; background: var(--accent); color: #fff; }
  .ep-provider-actions .ep-p-save:hover { background: var(--accent-dark); }
  .ep-provider-actions .ep-p-remove { background: var(--bg); border: 1px solid var(--border); color: var(--mistake); }
  .ep-provider-actions .ep-p-remove:hover { background: var(--mistake-soft); border-color: var(--mistake); }
  .ep-p-status { font-size: 11.5px; color: var(--ink-soft); margin-top: 8px; }
  .ep-p-status.has-key { color: var(--accent-dark); font-weight: 600; }
  .ep-settings-note {
    font-size: 12px; color: var(--ink-soft); line-height: 1.5; margin: 0 0 16px;
  }

  /* ---------- history ---------- */
  .ep-hist-item {
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
    padding: 13px 14px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  }
  .ep-hist-item:hover { border-color: var(--accent); }
  .ep-hist-title { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
  .ep-hist-sub { font-size: 12px; color: var(--ink-soft); }
  .ep-hist-open { flex-shrink:0; font-size: 12px; font-weight: 600; color: var(--accent-dark); background: var(--accent-soft); padding: 6px 12px; border-radius: 20px; border: none; }
  .ep-hist-open:hover { background: var(--accent); color: #fff; }
  .ep-hist-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
  .ep-hist-delete { flex-shrink:0; font-size: 12px; font-weight: 600; color: var(--mistake); background: var(--mistake-soft); padding: 6px 10px; border-radius: 20px; border: none; }
  .ep-hist-delete:hover { background: var(--mistake); color: #fff; }
  .ep-clear-data { display:block; margin: 18px auto 4px; font-size: 12px; color: var(--mistake); background: none; border: 1px solid var(--mistake-soft); padding: 7px 14px; border-radius: 20px; }
  .ep-clear-data:hover { background: var(--mistake-soft); border-color: var(--mistake); }

  /* transcript viewer */
  .ep-transcript-backdrop {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 50;
    align-items: flex-end; justify-content: center;
  }
  .ep-transcript-backdrop.active { display: flex; }
  .ep-transcript {
    background: var(--surface); width: 100%; max-width: 560px; max-height: 82vh;
    border-radius: 16px 16px 0 0; display: flex; flex-direction: column; overflow: hidden;
  }
  .ep-transcript-head { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
  .ep-transcript-body { padding: 12px; overflow-y: auto; }

  /* bottom nav (mobile) */
  .ep-bottomnav {
    display: flex; border-top: 1px solid var(--border); background: var(--surface);
    padding-bottom: env(safe-area-inset-bottom); flex-shrink: 0;
  }
  .ep-bottomnav button {
    flex: 1; border: none; background: none; padding: 9px 4px 8px;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    color: var(--ink-soft); font-size: 10.5px; font-weight: 600;
  }
  .ep-bottomnav button svg { width: 21px; height: 21px; }
  .ep-bottomnav button.active { color: var(--accent-dark); }
  .ep-bottomnav button:hover { color: var(--accent-dark); background: var(--surface-alt); }

  .ep-toast {
    position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%) translateY(10px);
    background: var(--ink); color: #fff; padding: 8px 16px; border-radius: 20px; font-size: 12.5px;
    opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60;
  }
  .ep-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

  /* ---------- profile gate ---------- */
  .ep-gate-backdrop {
    position: fixed; inset: 0; background: var(--bg); z-index: 100;
    display: flex; align-items: center; justify-content: center; padding: 20px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--ink); box-sizing: border-box;
  }
  .ep-gate-backdrop *, .ep-gate-backdrop *::before, .ep-gate-backdrop *::after { box-sizing: border-box; }
  .ep-gate-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
    padding: 26px 22px; width: 100%; max-width: 380px;
    box-shadow: 0 6px 24px rgba(35,40,31,.08);
  }
  /* Logo: same image, same 76x76 size/aspect ratio as before — just moved
     out of an inline style into responsive CSS. A block-level element with
     an explicit width and margin:0 auto centers itself horizontally inside
     any width of parent (fluid or fixed), so this holds at every viewport
     from 320px up through desktop without any breakpoints needed. */
  .ep-gate-logo {
    width: 76px; height: 76px; border-radius: 18px;
    display: block; margin: 0 auto 14px;
  }
  .ep-gate-card h2 { margin: 0 0 4px; font-size: 19px; color: var(--ink); }
  .ep-gate-card .ep-gate-sub { font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; margin-bottom: 18px; }
  .ep-gate-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
  .ep-gate-profile-btn {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    border: 1.5px solid var(--border); background: var(--bg); border-radius: 10px;
    padding: 10px 13px; font-size: 14px; font-weight: 600; color: var(--ink);
  }
  .ep-gate-profile-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
  .ep-gate-profile-btn span.tag { font-size: 10.5px; font-weight: 600; color: var(--ink-soft); }
  .ep-gate-card input {
    width: 100%; padding: 11px 13px; border: 1.5px solid var(--border); background: var(--bg);
    border-radius: 8px; font-size: 13.5px; font-family: inherit; margin-bottom: 10px; color: var(--ink);
    box-sizing: border-box;
  }
  .ep-gate-card input::placeholder { color: var(--ink-soft); opacity: .85; }
  .ep-gate-card input:focus {
    outline: none; border-color: var(--accent); background: var(--surface);
    box-shadow: 0 0 0 3px var(--accent-soft);
  }
  .ep-gate-card .ep-gate-go {
    width: 100%; border: 1.5px solid var(--accent-dark); background: var(--accent); color: #fff; border-radius: 10px;
    padding: 12px; font-size: 14.5px; font-weight: 700; letter-spacing: .2px;
    box-shadow: 0 2px 8px rgba(47,111,98,.28);
  }
  .ep-gate-card .ep-gate-go:hover { background: var(--accent-dark); box-shadow: 0 4px 14px rgba(35,79,69,.35); transform: translateY(-1px); }
  .ep-gate-card .ep-gate-go:active { transform: translateY(0); }
  .ep-gate-note { font-size: 11px; color: var(--ink-soft); margin-top: 12px; line-height: 1.5; }
  .ep-gate-toggle { display: block; width: 100%; text-align: center; font-size: 12.5px; color: var(--accent-dark); font-weight: 600; background: none; border: none; padding: 8px 0; margin-bottom: 4px; }
  .ep-gate-toggle:hover { text-decoration: underline; }
  .ep-gate-error { font-size: 12px; color: var(--mistake); margin: -2px 0 8px; display: none; }
  .ep-gate-error.show { display: block; }

  /* ---------- urdu translation ---------- */
  .ep-urdu {
    margin-top: 6px; background: var(--surface-alt); border: 1px solid var(--border);
    border-radius: 10px; padding: 8px 11px; font-size: 14px; line-height: 1.7;
    direction: rtl; text-align: right; max-width: 100%;
    font-family: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', 'Segoe UI', sans-serif;
  }
  .ep-model-pill {
    font-size: 10.5px; color: var(--ink-soft); background: var(--surface-alt);
    border-radius: 20px; padding: 2px 9px; display: inline-block; margin-top: 2px;
  }
  .ep-pref-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
    padding: 14px 16px; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  }
  .ep-pref-card b { font-size: 13.5px; display: block; }
  .ep-pref-card .ep-pref-sub { font-size: 11.5px; color: var(--ink-soft); margin-top: 2px; }
  .ep-persona-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
    padding: 14px 16px; margin-bottom: 14px;
  }
  .ep-persona-card b { font-size: 13.5px; display: block; margin-bottom: 2px; }
  .ep-persona-card .ep-pref-sub { font-size: 11.5px; color: var(--ink-soft); margin-bottom: 12px; }
  .ep-persona-toggle { display: flex; gap: 8px; }
  .ep-persona-btn {
    flex: 1; text-align: left; padding: 10px 12px; border-radius: 12px;
    border: 1px solid var(--border); background: var(--bg); font-family: inherit;
  }
  .ep-persona-btn b { font-size: 13px; display: block; color: var(--ink); }
  .ep-persona-btn span { font-size: 11px; color: var(--ink-soft); display: block; margin-top: 2px; line-height: 1.35; }
  .ep-persona-btn.active { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
  .ep-persona-btn.active b { color: var(--accent-dark); }
  .ep-switch { position: relative; width: 42px; height: 24px; flex-shrink: 0; }
  .ep-switch input { opacity: 0; width: 0; height: 0; }
  .ep-switch .ep-slider {
    position: absolute; inset: 0; background: var(--border); border-radius: 20px; transition: .15s; cursor: pointer;
  }
  .ep-switch .ep-slider:before {
    content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px;
    background: #fff; border-radius: 50%; transition: .15s;
  }
  .ep-switch input:checked + .ep-slider { background: var(--accent); }
  .ep-switch input:checked + .ep-slider:before { transform: translateX(18px); }
  .ep-switch-user-btn {
    display: block; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--border);
    border-radius: 12px; padding: 12px 14px; font-size: 13.5px; font-weight: 600; color: var(--ink); margin-bottom: 16px;
  }
  .ep-switch-user-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
  .ep-switch-user-btn span { display: block; font-size: 11.5px; font-weight: 400; color: var(--ink-soft); margin-top: 2px; }

  @media (min-width: 900px) {
    .ep-sidebar { display: flex; width: 268px; padding: 26px 16px; }
    .ep-bottomnav { display: none; }
    .ep-topbar { padding: 18px 32px; }
    .ep-chat-scroll { padding: 24px 24px 8px; }
    .ep-scroll { align-self: center; width: 100%; max-width: 860px; padding: 24px 20px; }
    .ep-fc-filters { align-self: center; width: 100%; max-width: 860px; padding: 0 20px 4px; margin: 0 auto; box-sizing: border-box; }
    .ep-fc-grid { grid-template-columns: 1fr 1fr; }
    .ep-hist-list-wrap { width: 100%; }
    .ep-transcript-backdrop { align-items: center; }
    .ep-transcript { max-height: 76vh; border-radius: 16px; }
  }
