/* OKU · right-center voice dock · isolated additive UI.
   Sized against the provided Voice-01/Voice-02 desktop references.
   No existing page, reader, search, or theme selector is changed. */
#oku-side-voice,
#oku-side-voice * { box-sizing: border-box; }
#oku-side-voice {
  --osv-bg: #1d1d1c;
  --osv-gold: #dfb151;
  --osv-paper: #f3e5c8;
  position: fixed;
  top: 50%;
  right: 0;
  width: 49px;
  height: 230px;
  transform: translateY(-50%);
  z-index: 9998;
  color: var(--osv-paper);
  font-family: "JetBrains Mono Local", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.4;
  isolation: isolate;
  transition: width .27s cubic-bezier(.2,.75,.2,1);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}
#oku-side-voice.is-open { width: 280px; }
#oku-side-voice .osv-shell {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--osv-bg);
  border-radius: 28px 0 0 28px;
  box-shadow: -6px 12px 26px rgba(0,0,0,.055);
}
#oku-side-voice.is-open .osv-shell { border-radius: 28px; }
#oku-side-voice button,
#oku-side-voice input {
  all: unset;
  box-sizing: border-box;
  color: inherit;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}
#oku-side-voice button { cursor: pointer; }
#oku-side-voice button:focus-visible,
#oku-side-voice input:focus-visible {
  outline: 2px solid var(--osv-gold);
  outline-offset: 3px;
}
/* Fixed left-hand rail: identical on both states. */
#oku-side-voice .osv-rail {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 49px;
  z-index: 2;
  display: block;
  border-radius: 28px 0 0 28px;
  text-align: center;
}
#oku-side-voice .osv-mic {
  position: absolute;
  top: 20px;
  left: 14px;
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: var(--osv-paper);
  color: #20201f;
}
#oku-side-voice .osv-mic svg { display: block; width: 15px; height: 15px; }
#oku-side-voice .osv-rail-label {
  position: absolute;
  top: 59px;
  left: 13px;
  width: 21px;
  height: 123px;
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
  color: var(--osv-paper);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.6px;
  line-height: 1;
}
#oku-side-voice .osv-rail-wave {
  position: absolute;
  left: 18px;
  bottom: 18px;
  height: 24px;
  width: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}
#oku-side-voice .osv-rail-wave i {
  display: block;
  width: 2px;
  height: var(--bar-height,8px);
  flex: 0 0 2px;
  background: var(--osv-paper);
  border-radius: 2px;
}
#oku-side-voice .osv-rail-wave i:nth-child(1) { --bar-height: 4px; }
#oku-side-voice .osv-rail-wave i:nth-child(2) { --bar-height: 18px; }
#oku-side-voice .osv-rail-wave i:nth-child(3) { --bar-height: 7px; }
/* Expanded panel. Hidden descendants are not focusable while collapsed. */
#oku-side-voice .osv-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 53px;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}
#oku-side-voice.is-open .osv-panel {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition-delay: .13s;
}
#oku-side-voice .osv-wave {
  position: absolute;
  left: 0;
  right: 27px;
  top: 11px;
  height: 46px;
  display: flex;
  gap: 5px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
#oku-side-voice .osv-wave i {
  width: 2px;
  height: var(--wave-height, 12px);
  flex: 0 0 2px;
  display: block;
  border-radius: 1px;
  background: var(--osv-paper);
  transform-origin: center;
}
#oku-side-voice.is-listening .osv-wave i {
  animation: osv-wave-pulse .65s ease-in-out var(--wave-delay,0ms) infinite alternate;
}
@keyframes osv-wave-pulse {
  to { transform: scaleY(.42); opacity: .78; }
}
#oku-side-voice .osv-close {
  position: absolute;
  top: -3px;
  right: 3px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border: 1px solid var(--osv-gold);
  border-radius: 50%;
  background: #292826;
  color: var(--osv-paper);
  font-size: 19px;
  font-weight: 700;
  line-height: 1;
}
#oku-side-voice .osv-close:hover { background: #3c3528; }
#oku-side-voice .osv-body {
  position: absolute;
  top: 74px;
  left: 0;
  right: 14px;
  min-width: 0;
}
#oku-side-voice .osv-kicker {
  color: var(--osv-gold);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.15px;
}
#oku-side-voice .osv-status {
  display: block;
  max-width: 208px;
  margin-top: 1px;
  color: var(--osv-paper);
  font-size: 15px;
  line-height: 1.35;
  font-weight: 750;
  overflow-wrap: anywhere;
}
#oku-side-voice .osv-form {
  position: absolute;
  left: 0;
  right: 12px;
  bottom: 19px;
  height: 47px;
  margin: 0;
  padding: 0;
}
#oku-side-voice .osv-input {
  position: absolute;
  left: 0;
  bottom: 25px;
  width: calc(100% - 55px);
  height: 26px;
  padding: 0 0 2px 0;
  border-bottom: 1px solid rgba(220,181,99,.39);
  border-radius: 0;
  background: transparent;
  color: var(--osv-paper);
  font-size: 11px;
  font-weight: 500;
  caret-color: var(--osv-gold);
}
#oku-side-voice .osv-input::placeholder { color: transparent; }
#oku-side-voice .osv-send {
  position: absolute;
  right: 0;
  top: 0;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: var(--osv-gold);
  color: #242321;
  display: grid;
  place-items: center;
  transition: background .15s ease, transform .15s ease;
}
#oku-side-voice .osv-send:hover { background: #edc36c; transform: translateX(1px); }
#oku-side-voice .osv-send svg { display: block; width: 35px; height: 35px; }
#oku-side-voice .osv-hint {
  position: absolute;
  left: 0;
  bottom: 6px;
  width: calc(100% - 55px);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--osv-paper);
  font-size: 8px;
  line-height: 1.25;
  opacity: .9;
}
#oku-side-voice .osv-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
@media (max-width: 480px) {
  #oku-side-voice { width: 45px; }
  #oku-side-voice.is-open { width: min(280px, calc(100vw - 8px)); }
  #oku-side-voice .osv-rail { width: 45px; }
  #oku-side-voice .osv-mic { left: 11px; }
  #oku-side-voice .osv-rail-label { left: 11px; }
  #oku-side-voice .osv-rail-wave { left: 15px; }
  #oku-side-voice .osv-panel { left: 50px; }
}
@media (max-height: 400px) {
  #oku-side-voice { height: min(230px, calc(100dvh - 16px)); }
}
@media (prefers-reduced-motion: reduce) {
  #oku-side-voice,
  #oku-side-voice .osv-panel,
  #oku-side-voice .osv-send { transition: none !important; }
  #oku-side-voice .osv-wave i { animation: none !important; }
}
