:root {
  color-scheme: light;
  --bg: #eef0f3;
  --surface: #ffffff;
  --ink: #111827;
  --muted: #667085;
  --line: #d9dde3;
  --dark: #141516;
  --dark-2: #202124;
  --soft: #eef2f7;
  --accent: #2563eb;
  --accent-2: #0f766e;
  --danger: #b42318;
  --warn: #a16207;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Noto Sans TC", "Noto Sans Thai", "Noto Sans Myanmar", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

input,
select {
  min-height: 48px;
  padding: 0 14px;
}

input[type="range"] {
  padding: 0;
  accent-color: var(--accent);
}

textarea {
  min-height: 0;
  padding: 18px;
  border: 0;
  resize: none;
  outline: none;
  font-size: 1.25rem;
  line-height: 1.55;
}

.primary,
.chip.active,
.languageButtons button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.accessGate {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(238, 240, 243, 0.92);
  backdrop-filter: blur(10px);
}

.accessGate[hidden] {
  display: none;
}

.accessCard {
  display: grid;
  gap: 14px;
  width: min(430px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.accessCard p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.accessError {
  min-height: 24px;
  color: var(--danger);
  font-weight: 900;
}

.pinDisplay {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
  letter-spacing: 0.12em;
}

.pinDisplay[data-pin-length="0"] {
  color: var(--muted);
  letter-spacing: 0;
}

.pinPad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.pinPad button {
  min-height: 46px;
  border-radius: 8px;
  background: var(--soft);
  font-size: 1.05rem;
}

.appShell {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 12px;
  width: min(1120px, calc(100vw - 28px));
  height: calc(100vh - 28px);
  margin: 14px auto;
}

.appHeader {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.brandBlock {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--accent-2);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(1.55rem, 3vw, 2.4rem);
}

h2 {
  font-size: 1rem;
}

.iconButton {
  display: grid;
  place-items: center;
  width: 46px;
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  background: var(--dark);
  color: white;
  font-size: 1.35rem;
}

.headerTools {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.uiLangButtons,
.modeTabs,
.actionBar,
.dialogueActions,
.importBox {
  display: flex;
  gap: 8px;
}

.uiLangButtons {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.utilityMenu {
  position: relative;
}

.utilityMenu summary {
  list-style: none;
  cursor: pointer;
}

.utilityMenu summary::-webkit-details-marker {
  display: none;
}

.utilityMenuPanel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 12;
  display: grid;
  gap: 8px;
  min-width: 180px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.utilityMenu:not([open]) .utilityMenuPanel {
  display: none;
}

.chip,
.status,
.paneTitle span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 900;
  white-space: nowrap;
}

.logoutChip {
  background: var(--surface);
}

.glossaryShortcut {
  background: #e6f4f1;
  color: #115e59;
}

.statusBar {
  display: flex;
  justify-content: center;
}

.status {
  min-width: min(360px, 100%);
  background: #e6f4f1;
  color: #115e59;
}

.notice {
  padding: 12px 14px;
  border: 1px solid #f0c36d;
  border-radius: 8px;
  background: #fff8e5;
  color: var(--warn);
  font-size: 0.92rem;
  line-height: 1.45;
}

.modeTabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.modeButton {
  min-width: 0;
  min-height: 54px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--surface);
  font-size: 1rem;
}

.modeButton.active {
  border-color: var(--dark);
  background: var(--dark);
  color: #ffffff;
}

.voiceEngineTabs {
  display: block;
  padding: 8px 0 0;
}

.voiceEngineTabs summary {
  min-height: 36px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 900;
}

.engineModeList {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding-top: 8px;
}

.engineButton {
  min-height: 42px;
  border-radius: 999px;
  background: var(--soft);
  font-size: 0.92rem;
}

.engineButton.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.modePanel {
  display: none;
  min-height: 0;
  overflow: hidden;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modePanel.active {
  display: grid;
  gap: 12px;
}

#voicePanel,
#realtimePanel {
  grid-template-rows: minmax(0, 1fr) auto auto auto;
}

#dialoguePanel {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

#textPanel {
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: visible;
}

.languagePanel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px minmax(0, 1fr);
  align-items: end;
  gap: 12px;
  padding: 0;
  background: transparent;
}

.languagePanel[hidden] {
  display: none;
}

.languageGroup {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.fieldLabel {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.languageButtons {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.languageButtons button {
  min-width: 0;
  min-height: 44px;
  overflow: hidden;
  padding: 0 8px;
  border-radius: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.languageSelectButton::after {
  content: "⌄";
  margin-left: 8px;
  font-size: 0.9em;
}

.languageSheet[hidden] {
  display: none;
}

.languageSheet {
  position: fixed;
  inset: 0;
  z-index: 25;
}

.sheetBackdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  min-height: 100%;
  border: 0;
  border-radius: 0;
  background: rgba(0, 0, 0, 0.42);
}

.sheetPanel {
  position: absolute;
  left: 50%;
  bottom: 16px;
  display: grid;
  gap: 10px;
  width: min(420px, calc(100vw - 24px));
  max-height: min(70vh, 520px);
  overflow: auto;
  padding: 12px;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
}

.sheetHandle {
  justify-self: center;
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: var(--line);
}

.sheetPanel h2 {
  padding: 2px 4px 6px;
  font-size: 1.05rem;
}

.sheetOptions {
  display: grid;
  gap: 8px;
}

.sheetOptions button {
  justify-content: flex-start;
  min-height: 52px;
  padding: 0 14px;
  text-align: left;
}

.swapButton {
  align-self: end;
  min-height: 44px;
  border-color: transparent;
  background: var(--dark);
  color: transparent;
  font-size: 0;
}

.swapButton::before {
  content: "⇄";
  color: white;
  font-size: 1.25rem;
}

.hiddenSwap {
  position: absolute;
  width: 1px;
  min-height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.resultGrid,
.textTranslateGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-height: 0;
}

.textTranslateGrid {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
}

#textPanel .textInputWrap {
  min-height: 320px;
}

#textPanel textarea {
  font-size: 1.45rem;
}

#textPanel .translated {
  font-size: 1.35rem;
}

.pane,
.textInputWrap {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.paneTitle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.textInputHeader,
.paneTools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.textInputWrap {
  position: relative;
}

.paneTools {
  justify-content: flex-end;
}

.iconButton {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1;
}

.iconButton:active,
.iconButton:hover {
  background: var(--soft);
  color: var(--ink);
}

.clearInputButton {
  font-size: 1.45rem;
}

.speakResultButton {
  font-size: 1.1rem;
  background: var(--soft);
  color: var(--ink);
  border-color: var(--line);
}

.textOutput {
  width: 100%;
  min-height: 0;
  overflow: auto;
  padding: 18px;
  color: var(--ink);
  font-size: clamp(1.1rem, 1.2vw, 1.35rem);
  line-height: 1.65;
  white-space: pre-wrap;
}

.translated {
  background: #fbfcfd;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  color: var(--muted);
  font-weight: 900;
}

.toggle input {
  width: 20px;
  min-height: 20px;
  accent-color: var(--accent);
}

.voiceActions,
.realtimeActions,
.dialogueActions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px minmax(0, 1fr);
  align-items: center;
}

.textActions {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
}

.unifiedActionBar {
  display: flex;
  justify-content: center;
}

.unifiedActionBar[hidden] {
  display: none;
}

.mainActionButton {
  width: min(360px, 100%);
  min-height: 60px;
  border-radius: 999px;
  font-size: 1.05rem;
}

.mainActionButton.danger {
  border-color: var(--danger);
  background: var(--danger);
  color: #ffffff;
}

.micButton {
  min-height: 76px;
  border-radius: 999px;
  font-size: 1.08rem;
}

.secondaryActions {
  justify-content: end;
}

.secondaryActions button {
  min-width: 120px;
}

.hint {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.voiceSettings {
  color: var(--muted);
}

.voiceSettings summary {
  min-height: 34px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 900;
}

.voiceSettingGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.voiceSettingGrid label {
  display: grid;
  gap: 6px;
  min-width: 0;
  font-size: 0.82rem;
  font-weight: 900;
}

.dialogueLog {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.dialogueTurn {
  display: grid;
  gap: 6px;
  max-width: 82%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.dialogueTurn.fromTarget {
  justify-self: end;
  background: #eef6ff;
}

.dialogueMeta {
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 900;
}

.dialogueOriginal {
  color: var(--muted);
  font-size: 0.92rem;
}

.dialogueTranslation {
  font-size: 1.08rem;
  font-weight: 850;
  line-height: 1.55;
}

.glossaryPanel {
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
}

.glossaryHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.importBox {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
}

.filePicker {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 1px dashed var(--accent-2);
  border-radius: 8px;
  background: #e6f4f1;
  color: #115e59;
  cursor: pointer;
  font-weight: 900;
}

.filePicker input {
  display: none;
}

.termForm {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) 110px;
  gap: 8px;
}

.glossaryList {
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.term {
  display: grid;
  grid-template-columns: 1fr 42px;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.term + .term {
  margin-top: 8px;
}

.term strong {
  display: block;
  font-size: 0.96rem;
}

.term span {
  color: var(--muted);
  font-size: 0.84rem;
}

.term button {
  min-height: 38px;
}

.adminPanel {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.adminHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.adminGrid {
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.adminBlock {
  min-width: 0;
  min-height: 220px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.adminBlock h3 {
  margin: 0;
  font-size: 1rem;
}

.adminList {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 8px;
}

.adminItem {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.adminItem strong,
.adminItem span {
  display: block;
}

.adminItem span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.adminActions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.adminActions button,
.adminItem > button {
  min-height: 38px;
  padding: 0 10px;
  font-size: 0.82rem;
}

@media (min-width: 0px) {
  :root {
    color-scheme: dark;
    --bg: #3a3a3c;
    --surface: #141516;
    --ink: #f8fafc;
    --muted: #c7c9d1;
    --line: #2c2e33;
    --soft: #252936;
    --shadow: none;
  }

  body {
    background: var(--bg);
  }

  .appShell {
    width: 100%;
    min-height: 100dvh;
    height: auto;
    margin: 0;
    gap: 0;
    padding-bottom: calc(144px + env(safe-area-inset-bottom));
    grid-template-rows: auto auto auto auto auto;
  }

  .appHeader {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 8px;
    padding: calc(env(safe-area-inset-top) + 8px) 18px 8px;
    border: 0;
    border-radius: 0;
    background: var(--dark);
    color: #ffffff;
  }

  .favoriteButton {
    width: 38px;
    min-height: 38px;
    background: transparent;
    font-size: 1.55rem;
  }

  .brandBlock {
    text-align: center;
  }

  .eyebrow {
    color: #9ca3af;
    font-size: 0.63rem;
  }

  h1 {
    font-size: 1.35rem;
  }

  .headerTools {
    position: relative;
    display: flex;
    align-items: center;
    justify-items: end;
    gap: 6px;
  }

  .uiLangButtons {
    display: grid;
    grid-template-columns: 54px;
    gap: 5px;
  }

  .uiLangButtons:not(.expanded) button:not(.active) {
    display: none;
  }

  .uiLangButtons button.active {
    order: -1;
  }

  .chip {
    min-height: 32px;
    padding: 0 8px;
    border-color: #32343a;
    background: #202124;
    color: #ffffff;
    font-size: 0.76rem;
  }

  .utilityMenu {
    position: static;
  }

  .utilityMenuPanel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 148px;
    padding: 8px;
    border-color: #32343a;
    background: #202124;
  }

  .utilityMenuPanel .chip {
    width: 100%;
    justify-content: center;
  }

  .glossaryShortcut {
    width: 100%;
    background: #e6f4f1;
    color: #115e59;
  }

  .statusBar {
    padding: 4px 18px 8px;
    background: var(--dark);
  }

  .status {
    width: 100%;
    min-height: 34px;
    border-radius: 999px;
    background: #e6f4f1;
    color: #115e59;
    font-size: 0.92rem;
  }

  .notice {
    margin: 0;
    border-width: 0 0 1px;
    border-radius: 0;
    background: #3b2f16;
    color: #f8d98b;
  }

  .modeTabs {
    order: 5;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    padding: 8px 8px calc(env(safe-area-inset-bottom) + 8px);
    background: var(--bg);
  }

  .modeButton {
    min-height: 58px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #ffffff;
    font-size: 0.72rem;
    line-height: 1.15;
  }

  .modeButton.active {
    background: #141516;
    color: #ffffff;
  }

  .voiceEngineTabs {
    order: 0;
    padding: 0;
  }

  .voiceEngineTabs summary {
    color: #c7c9d1;
    font-size: 0.82rem;
  }

  .engineModeList {
    gap: 7px;
  }

  .engineButton {
    min-height: 40px;
    border: 0;
    background: #252936;
    color: #ffffff;
    font-size: 0.82rem;
  }

  .engineButton.active {
    background: var(--accent);
    color: #ffffff;
  }

  .modePanel {
    border: 0;
    border-radius: 0 0 34px 34px;
    background: var(--dark);
    color: #ffffff;
    padding: 14px 18px 18px;
  }

  .modePanel.active {
    min-height: 0;
  }

  #voicePanel,
  #realtimePanel {
    grid-template-rows: auto minmax(0, 1fr) auto auto auto auto;
  }

  #textPanel {
    grid-template-rows: auto auto;
    overflow: visible;
  }

  #dialoguePanel {
    grid-template-rows: auto minmax(0, 1fr) auto auto;
  }

  .languagePanel {
    order: 0;
    grid-template-columns: minmax(0, 1fr) 54px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    margin: 2px 0 8px;
  }

  .languageGroup {
    gap: 0;
  }

  .fieldLabel {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
  }

  .languageButtons {
    grid-template-columns: 1fr;
  }

  .languageButtons button {
    min-height: 64px;
    padding: 0 12px;
    border-color: transparent;
    border-radius: 8px;
    background: #111315;
    color: #ffffff;
    font-size: 1.12rem;
  }

  .languageButtons button.active {
    border-color: transparent;
    background: #111315;
  }

  .sheetPanel {
    bottom: 0;
    width: 100%;
    max-height: 72dvh;
    border-radius: 18px 18px 0 0;
    background: #202124;
    color: #ffffff;
    padding: 12px 18px calc(env(safe-area-inset-bottom) + 18px);
  }

  .sheetOptions button {
    border: 0;
    background: #141516;
    color: #ffffff;
  }

  .sheetOptions button.active {
    background: var(--accent);
  }

  .swapButton {
    min-height: 54px;
    border: 0;
    background: transparent;
  }

  .swapButton::before {
    color: #ffffff;
    font-size: 1.7rem;
  }

  .resultGrid,
  .textTranslateGrid {
    order: 1;
    grid-template-columns: 1fr;
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 0;
    min-height: 0;
    border-radius: 0;
  }

  .textTranslateGrid {
    grid-template-rows: minmax(210px, 1fr) minmax(130px, 0.62fr);
    min-height: 340px;
  }

  #textPanel .textInputWrap {
    min-height: 210px;
    padding-top: 6px;
  }

  #textPanel .textInputHeader {
    position: relative;
    width: auto;
    height: 40px;
    overflow: visible;
    display: flex;
    padding-right: 42px;
  }

  #textPanel .clearInputButton {
    position: absolute;
    top: 6px;
    right: 0;
    z-index: 2;
    background: #252936;
    color: #ffffff;
  }

  #textPanel .textInputWrap textarea {
    min-height: 170px;
    font-size: 1.35rem;
    line-height: 1.5;
  }

  #textPanel .pane {
    border-top: 1px solid #2c2e33;
  }

  #textPanel .translated {
    min-height: 96px;
    font-size: 1.25rem;
  }

  .pane,
  .textInputWrap {
    border: 0;
    border-radius: 0;
    background: var(--dark);
  }

  .pane + .pane {
    border-top: 1px solid #2c2e33;
  }

  .paneTitle {
    padding: 10px 0;
    border-bottom: 0;
  }

  .paneTitle h2 {
    font-size: 0.92rem;
    color: #c9ccd3;
  }

  .paneTitle span {
    background: #252936;
    color: #d8dee8;
  }

  .paneTools {
    gap: 8px;
  }

  .speakResultButton {
    background: #252936;
    color: #ffffff;
    border-color: #343845;
  }

  .textOutput,
  textarea {
    padding: 8px 0 18px;
    background: var(--dark);
    color: #ffffff;
    font-size: 1.35rem;
    line-height: 1.55;
  }

  textarea::placeholder {
    color: #f3f4f6;
    opacity: 0.95;
  }

  .translated {
    background: var(--dark);
  }

  .toggle {
    order: 3;
    min-height: 34px;
    color: #d1d5db;
    font-size: 0.86rem;
  }

  .voiceActions,
  .realtimeActions,
  .dialogueActions {
    order: 4;
    grid-template-columns: 1fr 116px 1fr;
    gap: 14px;
    align-items: end;
    padding-top: 8px;
  }

  .textActions {
    display: none;
  }

  #translateTextBtn,
  #speakTextBtn,
  #startBtn,
  #stopBtn,
  #startRealtimeBtn,
  #stopRealtimeBtn,
  #startDialogueBtn,
  #stopDialogueBtn {
    display: none;
  }

  .unifiedActionBar {
    order: 4;
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(74px + env(safe-area-inset-bottom));
    z-index: 21;
    padding: 8px 18px;
    background: var(--bg);
  }

  .mainActionButton {
    min-height: 58px;
    border: 0;
    background: var(--accent);
    color: #ffffff;
  }

  .actionBar button,
  .dialogueActions button {
    min-height: 54px;
    border: 0;
    border-radius: 999px;
    background: #252936;
    color: #ffffff;
  }

  .micButton {
    width: 116px;
    min-height: 116px;
    border-radius: 999px;
    background: var(--accent);
    color: #ffffff;
    font-size: 1rem;
  }

  .secondaryActions {
    display: none;
  }

  .hint {
    order: 3;
    color: #c7c9d1;
  }

  .voiceSettings {
    order: 3;
    color: #c7c9d1;
  }

  .voiceSettingGrid {
    grid-template-columns: 1fr;
    padding-top: 8px;
  }

  .voiceSettingGrid select,
  .voiceSettingGrid input {
    border-color: #32343a;
    background: #202124;
    color: #ffffff;
  }

  .dialogueLog {
    order: 2;
    border: 0;
    background: var(--dark);
    padding: 0;
  }

  .dialogueTurn {
    max-width: 100%;
    border-color: #2c2e33;
    background: #1c1d20;
  }

  .dialogueTurn.fromTarget {
    background: #1d2a3f;
  }

  .dialogueOriginal {
    color: #b8bcc7;
  }

  .glossaryPanel {
    border-radius: 0;
    background: #f8fafc;
    color: #111827;
  }

  .glossaryPanel .eyebrow,
  .glossaryPanel .hint,
  .glossaryPanel .fieldLabel {
    color: #667085;
  }

  .glossaryHeader h2 {
    font-size: 1.35rem;
    white-space: nowrap;
  }

  .glossaryHeader .status {
    min-width: 72px;
  }

  .importBox,
  .termForm {
    grid-template-columns: 1fr;
  }

  .glossaryList {
    padding-right: 0;
  }

  .adminPanel {
    border-radius: 0;
    background: #f8fafc;
    color: #111827;
  }

  .adminGrid {
    grid-template-columns: 1fr;
  }

  .adminBlock {
    min-height: 180px;
    background: #ffffff;
  }

  .adminItem {
    grid-template-columns: 1fr;
  }

  .adminActions {
    justify-content: stretch;
  }

  .adminActions button,
  .adminItem > button {
    flex: 1;
  }
}
