.english-page { padding-top: 8.25rem; padding-bottom: 5rem; min-height: 78vh; }
.english-heading { max-width: 720px; margin: 0 auto 2rem; }
.english-heading h1 { font-size: clamp(2rem, 5vw, 3.1rem); font-weight: 800; letter-spacing: -.04em; margin: .65rem 0; }
.english-heading p { color: var(--secondary-text-color); font-size: 1.05rem; margin: 0; }
.english-kicker { display: inline-flex; align-items: center; gap: .45rem; border-radius: 999px; padding: .4rem .8rem; color: #087f5b; background: #dcfce7; font-weight: 700; font-size: .86rem; }
.english-layout { max-width: 1160px; margin: auto; display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 1rem; align-items: stretch; }
.english-settings, .english-chat { border: 1px solid var(--card-border); border-radius: 20px; background: var(--card-bg); box-shadow: 0 10px 35px rgba(35, 50, 65, .08); }
.english-settings { padding: 1.2rem; }
.settings-title, .chat-character { display: flex; align-items: center; gap: .75rem; }
.settings-title { padding-bottom: 1rem; margin-bottom: 1.1rem; border-bottom: 1px solid var(--card-border); }
.settings-title strong, .chat-character strong { display: block; }
.settings-title small, .chat-character small { color: var(--secondary-text-color); }
.character-avatar { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; border-radius: 15px; background: #fff1d6; font-size: 1.45rem; }
.english-settings label { display: block; font-size: .84rem; font-weight: 700; margin: 1rem 0 .4rem; }
.english-settings label span { color: var(--secondary-text-color); font-weight: 400; }
.english-settings .form-select, .english-settings .form-control { border-color: var(--card-border); min-height: 43px; }
.key-note { display: block; color: var(--secondary-text-color); line-height: 1.45; margin-top: .45rem; }
.key-link { display: inline-block; margin-top: .55rem; font-size: .84rem; font-weight: 650; }
.privacy-note { display: flex; gap: .6rem; padding: .75rem; margin-top: 1rem; border-radius: 12px; background: var(--section-alt-bg); color: var(--secondary-text-color); font-size: .78rem; line-height: 1.45; }
.privacy-note i { color: #159a80; margin-top: .15rem; }
.english-chat { min-height: 720px; display: flex; flex-direction: column; overflow: hidden; }
.chat-topbar { padding: .9rem 1rem; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--card-border); }
.topbar-actions { display: flex; align-items: center; gap: .5rem; }
.topbar-actions .btn-success { background: #16846e; border-color: #16846e; color: #fff; }
.topbar-actions .btn-success:hover { background: #106b59; border-color: #106b59; }
.chat-character .character-avatar { width: 42px; height: 42px; flex-basis: 42px; }
.online-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; margin-right: .2rem; }
.character-stage { position: relative; height: 265px; flex: 0 0 265px; overflow: hidden; background: radial-gradient(ellipse at 50% 115%, #baf4e4 0, #d8f8ee 34%, #eafbf5 68%, #f5fffb 100%); border-bottom: 1px solid var(--card-border); }
.stage-lights { position: absolute; inset: 0; opacity: .6; background: radial-gradient(ellipse at 20% 30%, rgba(255,255,255,.9), transparent 35%), radial-gradient(ellipse at 88% 20%, rgba(255,255,255,.8), transparent 32%); }
.stage-caption { position: absolute; z-index: 2; left: 1rem; top: .85rem; display: flex; align-items: center; gap: .55rem; color: #245b50; font-size: .78rem; }
.stage-caption strong { font-size: .9rem; }
.stage-caption span { padding: .25rem .55rem; border-radius: 999px; background: rgba(255,255,255,.78); }
.character-speech { position: absolute; z-index: 2; left: 1rem; top: 3.2rem; width: min(44%, 255px); padding: .75rem .9rem; border-radius: 15px 15px 15px 4px; background: rgba(255,255,255,.92); color: #29444a; box-shadow: 0 7px 22px rgba(33,87,77,.1); font-size: .86rem; line-height: 1.4; }
.character-figure { position: absolute; bottom: -9px; left: 56%; transform: translateX(-50%); width: 230px; height: 260px; }
.character-svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 8px 9px rgba(25,78,68,.12)); }
.character-eyes { transform-origin: center; animation: character-blink 5.2s infinite; }
.character-mouth { transform-origin: 110px 132px; }
.character-sparkle { position: absolute; color: #d6a320; animation: sparkle-float 2.8s ease-in-out infinite; }
.sparkle-one { top: 37%; right: 12%; font-size: 1.2rem; }
.sparkle-two { top: 20%; right: 4%; font-size: 1.55rem; animation-delay: .8s; }
.voice-wave { position: absolute; z-index: 3; left: 50%; bottom: 1rem; display: flex; align-items: center; gap: 4px; height: 20px; transform: translateX(-50%); opacity: 0; transition: opacity .2s; }
.voice-wave i { display: block; width: 4px; height: 6px; border-radius: 5px; background: #158d76; }
.character-stage[data-state="listening"] .voice-wave, .character-stage[data-state="speaking"] .voice-wave { opacity: 1; }
/* listening: the bars follow the real microphone level (set from english.js), not a loop */
.character-stage[data-state="listening"] .voice-wave i { transition: height .08s linear; background: #dc3545; }
.character-stage[data-state="speaking"] .voice-wave i { animation: voice-wave .42s ease-in-out infinite alternate; }
.voice-wave i:nth-child(2), .voice-wave i:nth-child(6) { animation-delay: .12s !important; }
.voice-wave i:nth-child(3), .voice-wave i:nth-child(5) { animation-delay: .24s !important; }
.voice-wave i:nth-child(4) { animation-delay: .36s !important; }
.character-stage[data-state="speaking"] .character-mouth { animation: character-talk .24s ease-in-out infinite alternate; fill: #a94e53; }
.character-stage[data-state="listening"] .character-svg { animation: character-listen 1.8s ease-in-out infinite; }
.character-stage[data-state="thinking"] .character-sparkle { animation-duration: .8s; }
.chat-messages { flex: 1; min-height: 220px; max-height: 36vh; overflow-y: auto; padding: 1.2rem; display: flex; flex-direction: column; gap: .8rem; scroll-behavior: smooth; }
.empty-state { margin: auto; max-width: 350px; text-align: center; padding: 1rem; }
.empty-illustration { font-size: 3.2rem; }
.empty-state h2 { font-size: 1.35rem; font-weight: 750; margin: .5rem 0; }
.empty-state p { color: var(--secondary-text-color); }
.message { max-width: min(84%, 620px); padding: .78rem .95rem; border-radius: 16px; line-height: 1.5; overflow-wrap: anywhere; }
.message.assistant { align-self: flex-start; background: var(--section-alt-bg); border-bottom-left-radius: 5px; }
.message.user { align-self: flex-end; color: #fff; background: #17866f; border-bottom-right-radius: 5px; }
.message-label { display: block; margin-bottom: .2rem; font-size: .72rem; font-weight: 750; opacity: .7; }
.message-copy { white-space: pre-wrap; }
.correction-card { margin-top: .65rem; padding: .6rem .7rem; border-radius: 10px; background: rgba(13, 148, 136, .1); color: var(--text-color); font-size: .89rem; }
.correction-card strong { display: block; color: #0b806c; font-size: .76rem; margin-bottom: .15rem; }
.typing { align-self: flex-start; color: var(--secondary-text-color); font-size: .85rem; padding: .3rem .6rem; }
.chat-tools { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .55rem 1rem; border-top: 1px solid var(--card-border); color: var(--secondary-text-color); font-size: .8rem; }
.message-form { display: flex; align-items: flex-end; gap: .55rem; padding: .65rem 1rem .2rem; }
.message-form textarea { resize: none; max-height: 130px; min-height: 44px; }
.message-form .btn { min-height: 44px; }
.mic-button.listening { color: #fff; background: #dc3545; border-color: #dc3545; animation: mic-pulse 1s infinite; }
@keyframes mic-pulse { 50% { box-shadow: 0 0 0 6px rgba(220,53,69,.15); } }
.input-hint { padding: .2rem 1rem .8rem; text-align: center; color: var(--secondary-text-color); font-size: .72rem; }
@keyframes voice-wave { to { height: 18px; } }
@keyframes character-talk { from { transform: scaleY(.65); } to { transform: scaleY(1.45); } }
@keyframes character-listen { 50% { transform: translateY(-3px) rotate(-1deg); } }
@keyframes character-blink { 0%, 43%, 47%, 100% { transform: scaleY(1); } 45% { transform: scaleY(.12); } }
@keyframes sparkle-float { 50% { transform: translateY(-7px) rotate(16deg); opacity: .65; } }
body.dark-theme .english-kicker { background: #103b2a; color: #94f0bd; }
body.dark-theme .privacy-note { background: rgba(255,255,255,.06); }
body.dark-theme .correction-card { background: rgba(45,212,191,.12); }
body.dark-theme .character-stage { background: radial-gradient(ellipse at 50% 115%, #13564a 0, #123d37 38%, #172d31 100%); }
body.dark-theme .stage-caption { color: #ddfff4; }
body.dark-theme .character-speech { background: rgba(245,255,252,.95); color: #29444a; }
@media (max-width: 767px) {
  .english-page { padding-top: 7rem; }
  .english-layout { grid-template-columns: 1fr; }
  .english-settings { padding: 1rem; }
  .english-chat { min-height: 740px; }
  .character-stage { height: 240px; flex-basis: 240px; }
  .character-figure { left: 67%; width: 206px; height: 235px; }
  .character-speech { left: .75rem; top: 3.3rem; width: 45%; padding: .62rem; font-size: .78rem; }
  .chat-messages { max-height: 34vh; min-height: 190px; padding: .9rem; }
  .message { max-width: 92%; }
  .chat-tools { align-items: flex-start; }
  #speak-toggle { white-space: nowrap; }
  #voice-call span { display: none; }
  #voice-call { width: 40px; padding-inline: 0; }
  #send-button { padding-inline: .8rem; }
  #send-button span { display: none; }
}

/* the live call: the mouth and the bars follow the real voices (set from english.js), a LIVE badge with the clock */
.character-stage[data-live="1"] .character-mouth { animation: none; transition: transform .06s linear; }
.character-stage[data-live="1"] .voice-wave { opacity: 1; }
.character-stage[data-live="1"] .voice-wave i { animation: none !important; transition: height .08s linear; }
.character-stage[data-live="1"][data-state="speaking"] .voice-wave i { background: #158d76; }
.character-stage[data-live="1"][data-state="thinking"] .voice-wave i { background: #9aa7ad; }
.live-badge { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .6rem; border-radius: 999px; background: #dc3545 !important; color: #fff; font-weight: 800; letter-spacing: .04em; }
.live-badge[hidden] { display: none; }
.live-badge i { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: live-blink 1.2s ease-in-out infinite; }
.live-badge b { font-variant-numeric: tabular-nums; font-weight: 700; }
@keyframes live-blink { 50% { opacity: .25; } }
.message.live-partial .message-copy { opacity: .7; }
.message.live-partial .message-copy::after { content: ' …'; }
.message.recap { align-self: stretch; max-width: none; border: 1px dashed var(--card-border); border-radius: 14px; padding: .7rem .9rem; background: rgba(21, 141, 118, .08); }
.message.recap .message-copy { white-space: pre-line; }
.live-note { margin: 0 1rem .4rem; padding: .45rem .7rem; border-radius: 10px; background: rgba(255, 193, 7, .14); color: var(--text-color, #333); font-size: .78rem; line-height: 1.35; }
.live-note[hidden] { display: none; }

/* voice typing: the words being heard (red, italic), and the bar that fills before they go by themselves */
.message-form { position: relative; }
.message-form::after { content: ''; position: absolute; left: 1rem; right: 1rem; bottom: -2px; height: 3px; border-radius: 3px; background: #158d76; transform: scaleX(0); transform-origin: left center; opacity: 0; pointer-events: none; }
.message-form.auto-send::after { opacity: 1; animation: auto-send var(--auto-ms, 1000ms) linear forwards; }
@keyframes auto-send { from { transform: scaleX(0); } to { transform: scaleX(1); } }
#message-input.dictating { border-color: #2fbf9f; box-shadow: 0 0 0 .18rem rgba(47, 191, 159, .2); }

/* the mic in the live call: open (your turn — just talk) or muted while she answers */
.mic-badge { position: absolute; z-index: 3; right: 1rem; bottom: .8rem; display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .7rem; border-radius: 999px; background: rgba(60, 70, 75, .78); color: #fff; font-size: .78rem; font-weight: 700; pointer-events: none; transition: background .2s; }
.mic-badge[hidden] { display: none; }
.mic-badge.open { background: #dc3545; animation: mic-pulse 1.4s infinite; }
.character-stage[data-live="1"][data-state="speaking"] { cursor: pointer; }
@media (max-width: 575.98px) { .mic-badge { right: .6rem; bottom: .6rem; font-size: .7rem; } }

/* every free model spent: the red notice */
.limit-banner { margin: 0 1rem .5rem; padding: .6rem .8rem; border-radius: 10px; background: #dc3545; color: #fff; font-size: .82rem; line-height: 1.4; box-shadow: 0 4px 14px rgba(220, 53, 69, .3); }
.limit-banner[hidden] { display: none; }
.limit-banner strong { display: block; font-size: .9rem; }
