.note-input-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.note-input-toolbar button { min-height: 44px; max-width: 100%; touch-action: manipulation; }
.note-input-toolbar [hidden] { display: none !important; }
.voice-input-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.voice-input-button svg { width: 19px; height: 19px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.voice-input-button.is-listening { color: #1766ce; border-color: #1766ce; background: #edf4ff; }
.note-input-toolbar :is(button, select):focus-visible { outline: 3px solid #5a9ef4; outline-offset: 3px; }
.voice-unsupported { flex-basis: 100%; overflow-wrap: anywhere; }
.voice-note-status { flex-basis: 100%; overflow-wrap: anywhere; }
.voice-note-status:empty { display: none; }
.voice-note-status[data-active="true"] { font-weight: 700; color: #b32640; }
.voice-input-button.is-listening { animation: engrnote-voice-pulse 1.5s ease-in-out infinite; }
body.dark .voice-input-button.is-listening { color: #c5daff; border-color: #87b9ff; background: #243450; }
body.dark .voice-note-status[data-active="true"] { color: #ffadbd; }
@media (prefers-reduced-motion: reduce) { .voice-input-button.is-listening { animation: none; } }
.voice-panel {
  --voice-navy: #0b2451;
  --voice-blue: #1766ce;
  --voice-wash: #edf4ff;
  --voice-danger: #b32640;
  position: fixed;
  inset: auto 24px calc(24px + var(--voice-keyboard-offset, 0px)) auto;
  z-index: 40;
  width: min(430px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  max-height: calc(var(--voice-viewport-height, 100dvh) - 48px);
  margin: 0;
  padding: 0;
  border: 1px solid var(--line, #dce4ef);
  border-radius: 20px;
  background: var(--panel, #fff);
  color: inherit;
  box-shadow: 0 16px 60px #07143f26, 0 2px 12px #07143f0d;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}
.voice-panel:not([open]) { display: none; }
.voice-panel * { box-sizing: border-box; }
.voice-panel [hidden] { display: none !important; }
.voice-panel button,
.voice-panel select {
  min-height: 44px;
  min-width: 44px;
  font: inherit;
  touch-action: manipulation;
}
.voice-panel button {
  border: 1px solid var(--line, #dce4ef);
  border-radius: 11px;
  background: var(--panel, #fff);
  color: inherit;
  cursor: pointer;
  line-height: 1.5;
}
.voice-panel button:hover { border-color: var(--voice-blue); background: var(--voice-wash); }
.voice-panel button:disabled { cursor: default; opacity: .55; }
.voice-panel button:disabled:hover { border-color: var(--line, #dce4ef); background: var(--panel, #fff); }
.voice-panel :is(button, input, select):focus-visible {
  outline: 3px solid #5a9ef4;
  outline-offset: 3px;
}
.voice-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--line, #dce4ef);
  background: linear-gradient(120deg, var(--voice-wash), var(--panel, #fff));
}
.voice-panel__heading { min-width: 0; }
.voice-panel .voice-panel__title {
  margin: 0;
  color: var(--voice-navy);
  font-size: 21px;
  line-height:1.5;
  letter-spacing:normal;
}
.voice-panel .voice-panel__description {
  margin: 5px 0 0;
  color: var(--muted, #687086);
  font-size: 12px;
  line-height: 1.6;
}
.voice-panel__header-actions { display: flex; flex-shrink: 0; gap: 3px; }
.voice-panel .voice-panel__icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 9px;
  border-color: transparent;
  background: transparent;
}
.voice-panel svg {
  display: block;
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.voice-panel__settings { padding: 18px 20px 0; }
.voice-panel .voice-panel__label {
  display: block;
  margin: 0 0 9px;
  color: var(--voice-navy);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
  letter-spacing:normal;
}
.voice-panel__languages { display: flex; gap: 7px; }
.voice-panel .voice-panel__language { flex: 1; padding: 9px 8px; font-size: 14px; }
.voice-panel .voice-panel__language[aria-pressed="true"] {
  border-color: var(--voice-blue);
  color: var(--voice-blue);
  background: var(--voice-wash);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px var(--voice-blue);
}
.voice-panel .voice-panel__hint {
  margin: 8px 0 0;
  color: var(--muted, #687086);
  font-size: 12px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.voice-panel__capture { padding: 14px 20px 18px; }
.voice-panel .voice-panel__status {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 23px;
  margin: 0 0 12px;
  color: var(--voice-navy);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
}
.voice-panel__status-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8190a5;
}
.voice-panel[data-status="listening"] .voice-panel__status-dot,
.voice-panel[data-status="starting"] .voice-panel__status-dot,
.voice-panel[data-active="true"] .voice-panel__status-dot {
  background: var(--voice-blue);
  animation: engrnote-voice-pulse 1.5s ease-in-out infinite;
}
.voice-panel[data-status="inserted"] .voice-panel__status-dot { background: #12836f; }
.voice-panel[data-status="error"] .voice-panel__status-dot { background: var(--voice-danger); }
.voice-panel[data-active="true"] .voice-panel__status-dot { background: var(--voice-blue); }
.voice-panel .voice-panel__microphone {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  border-color: var(--voice-navy);
  background: var(--voice-navy);
  color: #fff;
  font-weight: 700;
}
.voice-panel .voice-panel__microphone:hover { border-color: var(--voice-blue); background: var(--voice-blue); }
.voice-panel .voice-panel__microphone[aria-pressed="true"] { border-color: var(--voice-blue); background: var(--voice-blue); }
.voice-panel .voice-panel__microphone:disabled:hover { border-color: var(--voice-navy); background: var(--voice-navy); }
.voice-panel__microphone[aria-pressed="true"] .voice-panel__mic-icon svg { fill: currentColor; stroke-width: 1; }
.voice-panel .voice-panel__notice,
.voice-panel .voice-panel__error {
  margin: 12px 0 0;
  padding: 11px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.voice-panel .voice-panel__notice { background: var(--voice-wash); color: var(--voice-navy); }
.voice-panel .voice-panel__error { border: 1px solid #edbdc6; background: #fff0f3; color: var(--voice-danger); }
.voice-panel__details { padding: 0 20px 20px; }
.voice-panel__preview {
  margin: 0 0 18px;
  padding: 15px;
  border: 1px solid var(--line, #dce4ef);
  border-radius: 13px;
  background: var(--panel, #fff);
  background: color-mix(in srgb, var(--voice-wash) 35%, var(--panel, #fff));
}
.voice-panel .voice-panel__transcript,
.voice-panel .voice-panel__translation,
.voice-panel .voice-panel__interim {
  margin: 0;
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: normal;
}
.voice-panel .voice-panel__placeholder { color: var(--muted, #687086); font-size: 13px; }
.voice-panel .voice-panel__interim { margin-top: 7px; color: var(--muted, #687086); font-style: italic; }
.voice-panel__translation-settings { margin-bottom: 17px; }
.voice-panel__toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-bottom: 11px;
  font-size: 13px;
  line-height: 1.6;
  cursor: pointer;
}
.voice-panel .voice-panel__toggle input {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin: 0;
  padding: 0;
  accent-color: var(--voice-blue);
  cursor: pointer;
}
.voice-panel__mode {
  display: block;
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--line, #dce4ef);
  border-radius: 10px;
  padding: 11px;
  background: var(--panel, #fff);
  color: inherit;
  font-size: 14px;
}
.voice-panel .voice-panel__translate { width: 100%; border-color: var(--voice-blue); color: var(--voice-blue); font-weight: 700; }
.voice-panel__translation-preview { margin: 15px 0 12px; }
.voice-panel__apply { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.voice-panel .voice-panel__apply-button { padding: 10px 8px; font-size: 13px; }
.voice-panel .voice-panel__privacy {
  margin: 20px 0 0;
  padding-top: 15px;
  border-top: 1px solid var(--line, #dce4ef);
  color: var(--muted, #687086);
  font-size: 12px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.voice-panel .voice-panel__service-hint { margin-top: 5px; font-size: 11px; }
body.dark .voice-panel {
  --voice-navy: #c5daff;
  --voice-blue: #87b9ff;
  --voice-wash: #243450;
  --voice-danger: #ffadbd;
  box-shadow: 0 16px 60px #0006;
}
body.dark .voice-panel .voice-panel__microphone { background: #234e91; border-color: #4778bf; color: #fff; }
body.dark .voice-panel .voice-panel__microphone:hover,
body.dark .voice-panel .voice-panel__microphone[aria-pressed="true"] { background: #2b64bb; border-color: #87b9ff; }
body.dark .voice-panel .voice-panel__error { border-color: #714150; background: #402836; }
@keyframes engrnote-voice-pulse {
  0%, 100% { box-shadow: 0 0 0 0 #1766ce33; }
  50% { box-shadow: 0 0 0 5px #1766ce00; }
}
@media (max-width: 760px) {
  .voice-panel {
    inset: auto 0 var(--voice-keyboard-offset, 0px) 0;
    width: 100%;
    max-height: 78vh;
    max-height: 78dvh;
    max-height: min(78dvh, calc(var(--voice-viewport-height, 100dvh) - 12px));
    border-radius: 20px 20px 0 0;
    border-bottom: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -8px 45px #07143f26;
    scrollbar-gutter: auto;
  }
  .voice-panel__header { padding: 16px 16px 12px; }
  .voice-panel__settings { padding: 15px 16px 0; }
  .voice-panel__capture { padding: 12px 16px 16px; }
  .voice-panel__details { padding: 0 16px 18px; }
  .voice-panel .voice-panel__title { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .voice-panel *, .voice-panel *::before, .voice-panel *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
.voice-note-language{width:auto;min-width:88px;max-width:120px;min-height:44px;padding:8px 12px;border:1px solid var(--line);border-radius:10px;background:var(--panel);color:inherit;font:inherit;flex:0 0 auto}.voice-note-language:disabled{opacity:.7;cursor:default}
.voice-note-history{display:inline-flex;align-items:center;flex:0 0 auto;flex-wrap:nowrap;gap:3px;white-space:nowrap}.voice-note-history[hidden]{display:none!important}.voice-note-history>button{flex:0 0 auto}#voice-system-input{font-size:13px}
