:root {
  --ink: #17231e;
  --muted: #6f7d77;
  --green: #0d5b45;
  --green-2: #15765a;
  --mint: #dff2e9;
  --mint-2: #eff8f4;
  --orange: #ee6c35;
  --orange-2: #ff8d5b;
  --peach: #fff0e8;
  --paper: #f6f2e9;
  --surface: #fffdf8;
  --line: #d9d2c4;
  --danger: #c93636;
  --shadow: 0 18px 55px rgba(28, 52, 42, .10);
  --shadow-soft: 0 8px 26px rgba(28, 52, 42, .08);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --content: 1180px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 10%, rgba(238,108,53,.10), transparent 24rem),
    radial-gradient(circle at 93% 17%, rgba(21,118,90,.10), transparent 26rem),
    var(--paper);
  font-family: Pretendard, "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

button, select, textarea, input { font: inherit; }
button, select { min-height: 46px; }
button { cursor: pointer; }
a { color: inherit; }

:focus-visible {
  outline: 3px solid rgba(238,108,53,.55);
  outline-offset: 3px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 12px max(24px, calc((100vw - var(--content)) / 2));
  color: #fff;
  background: rgba(13, 54, 43, .93);
  border-bottom: 1px solid rgba(255,255,255,.13);
  backdrop-filter: blur(18px);
  box-shadow: 0 8px 28px rgba(11, 42, 33, .16);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-weight: 900;
  letter-spacing: -.045em;
}

.brand::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 7px rgba(238,108,53,.16);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-actions button,
#auth-open-button {
  min-height: 42px;
  padding: 8px 16px;
  color: #fff;
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.23);
  border-radius: 999px;
  font-weight: 800;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}

.top-actions button:hover,
#auth-open-button:hover {
  transform: translateY(-2px);
  background: rgba(255,255,255,.17);
  border-color: rgba(255,255,255,.44);
}

.browser-warning {
  width: min(calc(100% - 32px), var(--content));
  margin: 18px auto 0;
  padding: 12px 16px;
  color: #713c17;
  background: #fff4dc;
  border: 1px solid #edc780;
  border-radius: 12px;
  font-weight: 700;
}

.hero {
  position: relative;
  isolation: isolate;
  width: min(calc(100% - 32px), var(--content));
  margin: 28px auto 22px;
  padding: clamp(40px, 7vw, 84px) clamp(24px, 7vw, 88px);
  color: #fff;
  overflow: hidden;
  border-radius: 34px;
  background:
    linear-gradient(125deg, rgba(5,47,36,.98), rgba(18,96,72,.94)),
    var(--green);
  box-shadow: 0 28px 75px rgba(13, 69, 52, .22);
}

.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 390px;
  aspect-ratio: 1;
  right: -80px;
  top: -170px;
  border: 70px solid rgba(255,255,255,.07);
  border-radius: 50%;
}

.hero::after {
  content: "● ︱ ︱ ▍ ︱ ▍ ︱ ︱ ●";
  position: absolute;
  right: clamp(28px, 6vw, 82px);
  bottom: clamp(24px, 5vw, 58px);
  color: rgba(255,255,255,.34);
  font-size: clamp(.8rem, 1.8vw, 1.2rem);
  letter-spacing: .26em;
  white-space: nowrap;
}

.hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  padding: 7px 12px;
  color: #ffcab2;
  background: rgba(238,108,53,.14);
  border: 1px solid rgba(255,171,132,.28);
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(2.05rem, 5.7vw, 4.8rem);
  line-height: 1.05;
  letter-spacing: -.065em;
  text-wrap: balance;
}

.hero > p:not(.eyebrow) {
  max-width: 610px;
  margin: 22px 0 0;
  color: rgba(255,255,255,.79);
  font-size: clamp(1rem, 2vw, 1.2rem);
  text-wrap: pretty;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, .78fr) minmax(0, 1.42fr);
  align-items: start;
  gap: 22px;
  width: min(calc(100% - 32px), var(--content));
  margin: 0 auto 90px;
}

.workspace > section,
.workspace > article,
.workspace > div,
.settings-card,
.topic-card,
.speak-card,
.feedback-card,
.records-card {
  min-width: 0;
}

.settings-card,
.topic-card,
.speak-card,
.feedback-card,
.records-card {
  position: relative;
  padding: clamp(22px, 3.3vw, 38px);
  background: rgba(255,253,248,.96);
  border: 1px solid rgba(172,161,140,.48);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.settings-card {
  grid-column: 1 / -1;
  overflow: hidden;
}

.settings-card::before {
  content: "STEP 01 · 준비";
  display: inline-block;
  margin-bottom: 14px;
  color: var(--orange);
  font-size: .78rem;
  font-weight: 950;
  letter-spacing: .1em;
}

.settings-card::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -90px;
  top: -90px;
  background: var(--mint);
  border-radius: 50%;
  opacity: .58;
  pointer-events: none;
}

.settings-card h2,
.topic-card h2,
.speak-card h2,
.feedback-card h2,
.records-card h2 {
  margin: 0 0 8px;
  font-size: clamp(1.35rem, 2.7vw, 2rem);
  line-height: 1.25;
  letter-spacing: -.045em;
}

.settings-card > p,
.section-description,
.helper-text,
.privacy-note,
.topic-card p { color: var(--muted); }

.settings-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 26px;
}

.setting-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.setting-group label,
.field-label {
  color: #33453e;
  font-size: .87rem;
  font-weight: 850;
}

.setting-group select,
.setting-group input,
textarea {
  width: 100%;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.setting-group select,
.setting-group input { padding: 12px 14px; }

.setting-group select:hover,
.setting-group input:hover,
textarea:hover { border-color: #9fafa8; }

.setting-group select:focus,
.setting-group input:focus,
textarea:focus {
  outline: none;
  border-color: var(--green-2);
  box-shadow: 0 0 0 4px rgba(21,118,90,.12);
}

.practice-type-group,
.practice-type-setting { grid-column: 1 / -1; }

.practice-options,
.practice-type-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.practice-option,
.practice-type-option {
  position: relative;
  min-height: 74px;
  padding: 14px;
  text-align: left;
  color: #53625c;
  background: var(--mint-2);
  border: 1px solid #d2e3db;
  border-radius: 14px;
  font-size: .86rem;
  font-weight: 800;
  line-height: 1.35;
  transition: transform .2s ease, border-color .2s ease, background .2s ease, color .2s ease;
}

.practice-option:hover,
.practice-type-option:hover { transform: translateY(-3px); }

.practice-option.active,
.practice-option.selected,
.practice-type-option.active,
.practice-type-option.selected,
.practice-option[aria-pressed="true"],
.practice-type-option[aria-pressed="true"] {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
  box-shadow: 0 8px 20px rgba(13,91,69,.18);
}

.practice-option:disabled,
.practice-type-option:disabled,
.practice-option.disabled,
.practice-type-option.disabled {
  cursor: not-allowed;
  transform: none;
  opacity: .58;
}

.topic-card {
  position: sticky;
  top: 94px;
  border-top: 5px solid var(--orange);
}

.topic-card::before {
  content: "오늘의 논제";
  display: inline-block;
  margin-bottom: 14px;
  color: var(--orange);
  font-size: .82rem;
  font-weight: 950;
  letter-spacing: .08em;
}

.topic-text,
#topic-display,
#selected-topic {
  color: var(--ink);
  font-size: clamp(1.25rem, 2.4vw, 1.8rem);
  font-weight: 900;
  line-height: 1.45;
  letter-spacing: -.035em;
}

.concept-box,
.thinking-concepts {
  margin: 22px 0;
  padding: 16px;
  color: #365147;
  background: var(--mint-2);
  border-left: 4px solid var(--green-2);
  border-radius: 4px 12px 12px 4px;
}

.stance-buttons,
.position-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.stance-button,
.position-button {
  min-height: 58px;
  color: #53615b;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  font-weight: 900;
  transition: transform .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
}

.stance-button:hover,
.position-button:hover { transform: translateY(-2px); }

.stance-button.active,
.stance-button.selected,
.position-button.active,
.position-button.selected,
.stance-button[aria-pressed="true"],
.position-button[aria-pressed="true"] {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

.speak-card {
  overflow: hidden;
  border-top: 5px solid var(--green);
}

.speak-card::before {
  content: "STEP 02 · 발언";
  display: block;
  margin-bottom: 12px;
  color: var(--green-2);
  font-size: .78rem;
  font-weight: 950;
  letter-spacing: .1em;
}

.speak-card-head,
.feedback-head,
.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.connection-light,
#live-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 5px 11px;
  color: #65736d;
  background: #eeece5;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 850;
  white-space: nowrap;
}

.connection-light::after,
#live-status::after { content: attr(aria-label); }

.connection-light i,
#live-status i {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #a1aaa5;
  box-shadow: 0 0 0 5px rgba(161,170,165,.14);
}

.connection-light.connected i,
.connection-light.is-connected i,
#live-status.connected i,
#live-status.is-connected i {
  background: #1ba06f;
  box-shadow: 0 0 0 5px rgba(27,160,111,.14);
}

.connection-light.connecting i,
.connection-light.is-connecting i,
#live-status.connecting i,
#live-status.is-connecting i {
  background: #eca52f;
  animation: status-pulse 1.2s infinite;
}

.connection-light.error i,
.connection-light.is-error i,
#live-status.error i,
#live-status.is-error i { background: var(--danger); }

.mic-topic,
#mic-topic,
.feedback-topic,
#feedback-topic {
  margin: 18px 0;
  padding: 14px 16px;
  color: #314b41;
  background: var(--mint-2);
  border: 1px solid #dbe9e3;
  border-radius: 14px;
  font-weight: 800;
}

.timer,
.speech-timer,
#speech-timer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: fit-content;
  margin: 18px auto 24px;
  padding: 10px 18px;
  color: var(--green);
  background: var(--mint-2);
  border: 1px solid #dcece5;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  font-weight: 950;
}

.mic-zone,
.recording-zone {
  display: grid;
  place-items: center;
  min-height: 180px;
  margin: 8px 0 22px;
}

.mic-button,
#mic-button,
#start-button {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(106px, 15vw, 138px);
  aspect-ratio: 1;
  min-height: 0;
  color: #fff;
  background: linear-gradient(145deg, var(--orange-2), var(--orange));
  border: 0;
  border-radius: 50%;
  box-shadow: 0 18px 40px rgba(238,108,53,.31), 0 0 0 13px rgba(238,108,53,.09);
  transition: transform .2s ease, box-shadow .2s ease;
}

.mic-button::before,
#mic-button::before,
#start-button::before {
  content: "";
  width: 28%;
  aspect-ratio: 1;
  background: #fff;
  border-radius: 50%;
}

.mic-button:hover,
#mic-button:hover,
#start-button:hover {
  transform: translateY(-4px) scale(1.025);
  box-shadow: 0 22px 52px rgba(238,108,53,.38), 0 0 0 17px rgba(238,108,53,.10);
}

.mic-button.recording,
.mic-button.active,
#mic-button.recording,
#mic-button.active,
#start-button.recording,
#start-button.active { animation: record-pulse 1.5s infinite; }

.mic-label,
.recording-label {
  margin: 16px 0 0;
  text-align: center;
  font-size: clamp(1.18rem, 2.5vw, 1.55rem);
  font-weight: 950;
  letter-spacing: -.03em;
}

textarea {
  min-height: 190px;
  padding: 18px;
  resize: vertical;
  line-height: 1.7;
}

.textarea-meta,
.counter-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 8px 2px 18px;
  color: #83908b;
  font-size: .88rem;
}

.primary-button,
.submit-button,
#submit-button,
.export-button,
.save-button,
#export-button,
#cloud-save-button {
  width: 100%;
  min-height: 58px;
  padding: 14px 20px;
  color: #fff;
  background: var(--green);
  border: 1px solid var(--green);
  border-radius: 14px;
  font-weight: 950;
  box-shadow: 0 10px 22px rgba(13,91,69,.16);
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}

.primary-button:hover,
.submit-button:hover,
#submit-button:hover,
.export-button:hover,
.save-button:hover,
#export-button:hover,
#cloud-save-button:hover {
  transform: translateY(-2px);
  background: #084a37;
  box-shadow: 0 14px 30px rgba(13,91,69,.22);
}

button:disabled {
  cursor: not-allowed;
  transform: none !important;
  opacity: .52;
  box-shadow: none !important;
}

.feedback-card,
.records-card { grid-column: 1 / -1; }

.feedback-card {
  border-top: 5px solid var(--orange);
}

.feedback-card::before {
  content: "STEP 03 · 코칭";
  display: block;
  margin-bottom: 12px;
  color: var(--orange);
  font-size: .78rem;
  font-weight: 950;
  letter-spacing: .1em;
}

.conversation-log,
#conversation-log {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 560px;
  overflow-y: auto;
  margin: 24px 0;
  padding: clamp(14px, 3vw, 24px);
  background: #f2eee5;
  border: 1px solid #e0d9cc;
  border-radius: 18px;
  scroll-behavior: smooth;
  scrollbar-color: #a8bdb4 transparent;
}

.message,
.conversation-item,
.chat-message {
  max-width: min(82%, 760px);
  padding: 14px 17px;
  border-radius: 18px;
  line-height: 1.72;
  box-shadow: 0 4px 14px rgba(31,50,42,.06);
}

.message.user,
.conversation-item.user,
.chat-message.user,
.student-message {
  align-self: flex-end;
  color: #fff;
  background: var(--green);
  border-bottom-right-radius: 5px;
}

.message.ai,
.conversation-item.ai,
.chat-message.ai,
.ai-message {
  align-self: flex-start;
  color: var(--ink);
  background: #fff;
  border: 1px solid #e5ded2;
  border-bottom-left-radius: 5px;
}

.feedback-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.feedback-box,
.feedback-section,
.strength-box,
.improvement-box {
  min-height: 150px;
  padding: 20px;
  border-radius: 16px;
}

.strength-box,
.feedback-box:first-child,
#strength {
  color: #234c3c;
  background: var(--mint-2);
  border: 1px solid #cfe5dc;
}

.improvement-box,
.feedback-box:nth-child(2),
#improvement {
  color: #68412c;
  background: var(--peach);
  border: 1px solid #f2d5c5;
}

.feedback-box h3,
.feedback-section h3 { margin: 0 0 8px; font-size: 1rem; }

.question-box,
#question {
  margin-top: 16px;
  padding: clamp(20px, 3vw, 30px);
  color: var(--ink);
  background: #fff;
  border-left: 5px solid var(--orange);
  border-radius: 4px 16px 16px 4px;
  font-size: clamp(1.08rem, 2vw, 1.35rem);
  font-weight: 850;
  line-height: 1.65;
}

.download-actions,
.record-actions,
.export-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 22px;
}

.secondary-button,
.download-actions button:nth-child(2),
.export-actions button:nth-child(2) {
  color: var(--green);
  background: #fff;
  border: 1px solid var(--green);
  box-shadow: none;
}

.secondary-button:hover,
.download-actions button:nth-child(2):hover,
.export-actions button:nth-child(2):hover {
  color: #fff;
  background: var(--green);
}

.records-list,
#records-list {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.record-item {
  padding: 17px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: transform .2s ease, border-color .2s ease;
}

.record-item:hover { transform: translateY(-2px); border-color: #9eb8ad; }

.fixed-mic-dock,
.bottom-recorder,
#fixed-mic-dock {
  position: fixed;
  z-index: 55;
  right: max(18px, calc((100vw - var(--content)) / 2));
  bottom: max(18px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: min(440px, calc(100vw - 32px));
  padding: 10px 12px 10px 18px;
  color: var(--ink);
  background: rgba(255,253,248,.94);
  border: 1px solid rgba(172,161,140,.54);
  border-radius: 999px;
  box-shadow: 0 18px 55px rgba(25,52,41,.19);
  backdrop-filter: blur(18px);
}

.fixed-mic-dock .mic-button,
.fixed-mic-dock #mic-button,
.bottom-recorder .mic-button,
.bottom-recorder #mic-button {
  width: 68px;
  flex: 0 0 68px;
  box-shadow: 0 8px 22px rgba(238,108,53,.3);
}

.fixed-mic-dock p,
.bottom-recorder p {
  margin: 0;
  overflow: hidden;
  font-size: .86rem;
  font-weight: 800;
  line-height: 1.4;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

footer {
  display: flex;
  justify-content: center;
  padding: 34px 24px 120px;
  color: #73807a;
  text-align: center;
  border-top: 1px solid rgba(172,161,140,.35);
}

.pdf-export,
#pdf-content { background: #fff; color: #111; }

@keyframes record-pulse {
  0%, 100% { box-shadow: 0 18px 40px rgba(238,108,53,.31), 0 0 0 12px rgba(238,108,53,.08); }
  50% { box-shadow: 0 18px 48px rgba(238,108,53,.4), 0 0 0 24px rgba(238,108,53,.02); }
}

@keyframes status-pulse {
  50% { opacity: .35; }
}

@media (max-width: 1024px) {
  .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .practice-options, .practice-type-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .workspace { grid-template-columns: minmax(250px, .8fr) minmax(0, 1.2fr); }
}

@media (max-width: 800px) {
  body { padding-bottom: 108px; }
  .topbar { min-height: 62px; padding: 10px 16px; }
  .topbar .user-name, .topbar .auth-label { display: none; }
  .hero { margin-top: 16px; border-radius: 24px; }
  .hero::after { display: none; }
  .workspace { grid-template-columns: 1fr; gap: 16px; }
  .settings-card, .feedback-card, .records-card { grid-column: 1; }
  .topic-card { position: relative; top: auto; }
  .practice-options, .practice-type-options { display: flex; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
  .practice-option, .practice-type-option { min-width: 220px; scroll-snap-align: start; }
  .feedback-grid { grid-template-columns: 1fr; }
  .message, .conversation-item, .chat-message { max-width: 90%; }
  .fixed-mic-dock, .bottom-recorder, #fixed-mic-dock {
    left: 12px;
    right: 12px;
    bottom: max(10px, env(safe-area-inset-bottom));
    max-width: none;
  }
  footer { padding-bottom: 48px; }
}

@media (max-width: 540px) {
  .topbar { gap: 8px; }
  .brand { font-size: 1.05rem; }
  .top-actions button, #auth-open-button { min-height: 40px; padding: 7px 11px; font-size: .82rem; }
  .browser-warning, .hero, .workspace { width: min(calc(100% - 20px), var(--content)); }
  .hero { padding: 34px 22px 72px; }
  .hero h1 { font-size: clamp(2rem, 12vw, 3.25rem); }
  .hero::before { width: 260px; right: -110px; top: -120px; border-width: 48px; }
  .settings-card, .topic-card, .speak-card, .feedback-card, .records-card { padding: 21px 18px; border-radius: 20px; }
  .settings-grid { grid-template-columns: 1fr; gap: 14px; }
  .practice-type-group, .practice-type-setting { grid-column: 1; }
  .stance-buttons, .position-buttons, .download-actions, .record-actions, .export-actions { grid-template-columns: 1fr; }
  .speak-card-head, .feedback-head, .card-heading { flex-direction: column; gap: 10px; }
  .connection-light, #live-status { align-self: flex-start; }
  textarea { min-height: 170px; }
  .conversation-log, #conversation-log { max-height: 480px; padding: 12px; }
  .message, .conversation-item, .chat-message { max-width: 94%; font-size: .94rem; }
  .fixed-mic-dock, .bottom-recorder, #fixed-mic-dock { min-height: 82px; padding-left: 15px; }
  .fixed-mic-dock .mic-button, .fixed-mic-dock #mic-button, .bottom-recorder .mic-button, .bottom-recorder #mic-button { width: 60px; flex-basis: 60px; }
}

@media (max-width: 370px) {
  .topbar { padding-inline: 10px; }
  .hero, .workspace, .browser-warning { width: calc(100% - 14px); }
  .hero { padding-inline: 18px; }
  .settings-card, .topic-card, .speak-card, .feedback-card, .records-card { padding-inline: 15px; }
  .timer, .speech-timer, #speech-timer { width: 100%; padding-inline: 10px; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@media print {
  .topbar, .hero, .settings-card, .topic-card, .fixed-mic-dock, .bottom-recorder, footer, button { display: none !important; }
  body { background: #fff; }
  .workspace { display: block; width: 100%; margin: 0; }
  .speak-card, .feedback-card, .records-card { box-shadow: none; border: 0; padding: 0; }
}

/* Current application markup compatibility */
.hidden { display: none !important; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.unit { color: rgba(255,255,255,.68); font-size: .82rem; font-weight: 700; }
.auth-button { min-height: 42px; padding: 8px 16px; color: #fff; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.23); border-radius: 999px; font-weight: 850; }
.brand { color: #fff; text-decoration: none; }
.brand span { color: #ff9b70; }
.hero h1 em { color: #ffb18f; font-style: normal; }
.settings-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.settings-head span { color: var(--orange); font-size: .76rem; font-weight: 900; letter-spacing: .08em; }
.settings-head h2 { margin: 3px 0 0; }
.settings-head p { max-width: 440px; margin: 0; color: var(--muted); font-size: .88rem; }
.setting-item { min-width: 0; margin: 0; padding: 17px; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 15px; }
.setting-item > label { display: block; }
.setting-item > label b, .setting-item legend { color: #31463d; font-size: .9rem; font-weight: 900; }
.setting-item > label span { display: block; margin-top: 4px; color: var(--muted); font-size: .76rem; line-height: 1.5; }
.setting-item > select { width: 100%; margin-top: 11px; padding: 11px 13px; color: var(--ink); background: #faf9f5; border: 1px solid var(--line); border-radius: 11px; }
.setting-item > select:focus { outline: none; border-color: var(--green-2); box-shadow: 0 0 0 4px rgba(21,118,90,.11); }
.settings-card .end-mode { border: 1px solid var(--line); }
.settings-card .end-mode legend { padding: 0; }
.mode-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.end-option { display: flex; gap: 8px; padding: 11px; background: #faf9f5; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; }
.end-option.active, .end-option:has(input:checked) { background: var(--mint-2); border-color: var(--green-2); box-shadow: 0 0 0 1px var(--green-2); }
.end-option input { margin-top: 3px; accent-color: var(--green); }
.end-option b { display: block; font-size: .8rem; }
.end-option em { margin-left: 4px; padding: 2px 5px; color: #fff; background: var(--green); border-radius: 99px; font-size: .62rem; font-style: normal; }
.end-option small { display: block; margin-top: 4px; color: var(--muted); font-size: .68rem; line-height: 1.45; }
.silence-setting { margin-top: 10px; padding: 12px; color: #704927; background: #fff5e8; border-radius: 10px; }
.silence-setting select { margin-left: 6px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; }
.silence-setting p { margin: 7px 0 0; font-size: .7rem; }
.practice-setting { grid-column: 1 / -1; position: relative; padding-right: 150px; }
.available-badge { position: absolute; right: 17px; bottom: 25px; padding: 5px 9px; color: var(--green); background: var(--mint); border-radius: 99px; font-size: .68rem; font-weight: 900; }
.topic-label { color: var(--orange); font-size: .76rem; font-weight: 900; letter-spacing: .09em; }
.topic-card h2 { margin: 12px 0 22px; font-size: clamp(1.28rem,2.3vw,1.7rem); line-height: 1.55; word-break: keep-all; }
.topic-concepts { margin: 0 0 22px; padding: 14px; color: #53655d; background: var(--mint-2); border-left: 4px solid var(--green-2); border-radius: 4px 12px 12px 4px; font-size: .78rem; }
.topic-concepts b, .topic-concepts span { display: block; }
.topic-concepts b { margin-bottom: 4px; color: var(--green); }
.stance-label { margin-bottom: 8px; color: var(--muted); font-size: .78rem; font-weight: 850; }
.stance-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.stance { min-height: 54px; color: #5c6a64; background: #fff; border: 1px solid var(--line); border-radius: 13px; font-weight: 900; }
.stance span { display: inline-grid; place-items: center; width: 25px; height: 25px; margin-right: 7px; background: #e6e1d6; border-radius: 50%; font-size: .7rem; }
.stance.active { color: #fff; background: var(--green); border-color: var(--green); }
.stance.active span { background: rgba(255,255,255,.16); }
.step { color: #31443c; text-align: left; font-size: .87rem; font-weight: 950; letter-spacing: .03em; }
.step span { margin-right: 8px; color: var(--orange); }
.connection-light { margin: 12px auto 0; }
.connection-light.ready i { background: #1ba06f; box-shadow: 0 0 0 5px rgba(27,160,111,.14); }
.connection-light.listening i { background: var(--orange); animation: status-pulse .7s infinite; }
.connection-light.thinking i { background: #eca52f; animation: status-pulse 1.2s infinite; }
.connection-light.error i { background: var(--danger); }
.mic-topic span, .feedback-topic > span { display: block; margin-bottom: 4px; color: var(--orange); font-size: .68rem; font-weight: 900; letter-spacing: .08em; }
.mic-topic b { display: block; }
.mic-wrap { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 160px; }
.mic { position: relative; display: grid; place-items: center; width: 112px; height: 112px; padding: 0; color: #fff; background: linear-gradient(145deg,var(--orange-2),var(--orange)); border: 0; border-radius: 50%; box-shadow: 0 18px 40px rgba(238,108,53,.31),0 0 0 13px rgba(238,108,53,.09); transition: transform .2s ease,box-shadow .2s ease; }
.mic:hover { transform: translateY(-4px) scale(1.025); }
.mic-icon { font-size: 1.4rem; }
.waves { display: none; align-items: center; gap: 4px; }
.listening .waves { display: flex; }
.waves i { width: 3px; height: 22px; background: var(--orange); animation: wave .7s infinite alternate; }
.waves i:nth-child(2), .waves i:nth-child(4) { animation-delay: .2s; }
.waves i:nth-child(3) { animation-delay: .4s; }
@keyframes wave { to { height: 52px; } }
.record-title { display: block; margin-top: 2px; font-size: 1.35rem; text-align: center; }
.permission-note { max-width: 580px; margin: 10px auto 4px; padding: 9px 12px; color: #744a2c; background: var(--peach); border-radius: 10px; font-size: .75rem; }
.notice { min-height: 28px; margin: 7px 0 16px; color: var(--muted); font-size: .82rem; text-align: center; }
.input-footer { display: flex; justify-content: space-between; margin: 7px 2px 16px; color: #84908b; font-size: .78rem; }
.submit { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 58px; color: #fff; background: var(--green); border: 0; border-radius: 14px; font-weight: 950; }
.mode { padding: 6px 10px; color: var(--green); background: var(--mint); border-radius: 99px; font-size: .7rem; font-weight: 900; }
.live-transcript { margin: 0 0 18px; padding: 13px 15px; color: #3c5e50; background: var(--mint-2); border-left: 4px solid var(--green); border-radius: 4px 12px 12px 4px; }
.chat-message.student { align-self: flex-end; color: #fff; background: var(--green); border-bottom-right-radius: 5px; }
.chat-message.ai { align-self: flex-start; color: var(--ink); background: #fff; border: 1px solid #e5ded2; border-bottom-left-radius: 5px; }
.feedback-grid article { display: flex; gap: 13px; min-height: 150px; padding: 20px; border-radius: 16px; }
.feedback-grid article > span { display: grid; place-items: center; flex: 0 0 29px; width: 29px; height: 29px; color: #fff; border-radius: 50%; font-weight: 950; }
.strength { background: var(--mint-2); border: 1px solid #cfe5dc; }
.strength > span { background: var(--green); }
.improve { background: var(--peach); border: 1px solid #f2d5c5; }
.improve > span { background: var(--orange); }
.feedback-grid h3 { margin: 2px 0 7px; font-size: .95rem; }
.feedback-grid p { margin: 0; color: #45534c; font-size: .9rem; line-height: 1.7; }
.question-topic { margin: -5px 0 16px; padding-bottom: 13px; border-bottom: 1px solid #e5ded2; }
.question-topic p { margin: 4px 0 0 !important; color: #4b5953; font-size: .78rem !important; font-weight: 700 !important; }
.export-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.export-row div { text-align: left; }
.export-row b, .export-row span, .export-row small { display: block; }
.export-row span { margin-top: 4px; color: var(--muted); font-size: .78rem; }
.export-row small { margin-top: 4px; color: #967058; }
.export-row button, .cloud-save button, .records-head button { min-height: 48px; padding: 10px 15px; color: #fff; background: var(--green); border: 0; border-radius: 12px; font-weight: 900; white-space: nowrap; }
.cloud-save { display: flex; align-items: center; gap: 14px; margin-top: 14px; padding: 15px; background: var(--mint-2); border-radius: 14px; }
.cloud-save span { color: var(--muted); font-size: .8rem; }
.records-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.records-head span { color: var(--orange); font-size: .7rem; font-weight: 900; letter-spacing: .09em; }
.records-head h2 { margin: 3px 0 0; }
.fixed-mic-dock { display: none; }
.pdf-document { position: fixed; left: -10000px; top: 0; width: 720px; padding: 44px; background: #fff; color: #17221d; }

@media (max-width: 800px) {
  .unit { display: none; }
  .settings-head { align-items: flex-start; flex-direction: column; gap: 7px; }
  .mode-options { grid-template-columns: 1fr; }
  .speak-card .mic-wrap { position: fixed; z-index: 58; right: 23px; bottom: max(22px,env(safe-area-inset-bottom)); min-height: 0; margin: 0; }
  .speak-card .mic { width: 76px; height: 76px; box-shadow: 0 10px 32px rgba(32,38,35,.28); }
  .fixed-mic-dock { display: block; min-height: 106px; padding: 18px 112px 18px 20px; border-radius: 22px; }
  .fixed-mic-dock span { display: -webkit-box; overflow: hidden; color: #40534b; font-size: .78rem; font-weight: 800; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
}

@media (max-width: 540px) {
  .practice-setting { grid-column: 1; padding-right: 17px; padding-bottom: 58px; }
  .available-badge { right: auto; left: 17px; bottom: 17px; }
  .export-row, .cloud-save { align-items: stretch; flex-direction: column; }
  .export-row button, .cloud-save button { width: 100%; }
}

#fixed-mic-dock { display: none; }
.study-panel {
  margin: 16px 0;
  padding: 16px 18px;
  text-align: left;
  background: var(--mint-2);
  border: 1px solid #cfe5dc;
  border-radius: 14px;
}
.study-panel h3 { margin: 0 0 10px; font-size: 1.05rem; }
.study-panel a { color: var(--green); text-underline-offset: 3px; }
.study-panel p, .study-panel ol { margin: 12px 0 0; }
.study-panel ol { padding-left: 1.6em; }
.study-panel li + li { margin-top: 6px; }
.study-panel label { display: block; font-weight: 700; }
.study-panel select { width: 100%; border: 1px solid var(--line); background: white; border-radius: 9px; padding: 8px; }
#evidence-values { display: flex; flex-wrap: wrap; gap: 10px; }
#evidence-values div { padding: 8px 12px; background: white; border-radius: 10px; }
#evidence-values dt { font-size: .82rem; }
#evidence-values dd { margin: 0; font-weight: 800; font-variant-numeric: tabular-nums; }
#related-stat { font-size: .84rem; }
.access-panel { width: min(calc(100% - 24px), var(--content)); margin: 14px auto; padding: 18px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.access-panel h2, .access-panel p { margin: 0 0 8px; }
.access-panel form { margin: 12px 0; }
.access-panel label { display: block; font-weight: 700; }
.access-panel button, .access-panel input, .access-panel a { padding: 9px 14px; margin: 4px 0; max-width: 100%; border: 1px solid var(--green); border-radius: 10px; }
.access-panel button, .access-panel a { background: var(--green); color: white; font-weight: 700; }
.access-panel a:not([hidden]) { display: inline-block; }

@media (max-width: 800px) {
  body { height: 100vh; height: 100dvh; display: flex; flex-direction: column; padding: 0; overflow: hidden; }
  .topbar { flex: none; position: static; }
  main { flex: 1; min-height: 0; overflow-y: auto; scroll-padding-block: 12px; }
  #fixed-mic-dock {
    display: flex; position: static; flex: none; justify-content: space-between;
    width: 100%; max-width: none; min-height: 0; border-radius: 0;
    padding: 8px 18px max(8px, env(safe-area-inset-bottom)); box-shadow: 0 -3px 16px #123e2a12;
  }
  #fixed-mic-dock .mic-wrap { position: static; min-height: 0; flex: none; }
  #fixed-mic-dock .mic { width: 60px; height: 60px; box-shadow: none; }
  #fixed-mic-dock .mic:hover { transform: none; }
  #fixed-mic-dock .waves { display: none; }
  #fixed-mic-dock .mic-icon { display: block; color: white; font-size: 1.3rem; }
  #fixed-mic-dock #dock-topic { min-width: 0; }
}
