html,
body {
  margin: 0;
  min-height: 100%;
}

* {
  box-sizing: border-box;
}

body {
  font-family: ui-monospace, 'SF Mono', Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
  color: #d4d4d4;
  background: #0a0a0a;
  background-image: linear-gradient(
      rgba(163, 163, 163, 0.04) 1px,
      transparent 1px
    ),
    linear-gradient(90deg, rgba(163, 163, 163, 0.04) 1px, transparent 1px);
  background-size: 24px 24px;
}

.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.shell-with-sidebar {
  flex-direction: row;
  align-items: stretch;
}

.shell-sidebar-slot {
  flex-shrink: 0;
  z-index: 2;
}

.shell-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-sidebar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 3.5rem;
  min-height: 100vh;
  padding: 0.65rem 0;
  background: transparent;
  border-right: 1px solid #262626;
  transition: width 0.28s ease;
  overflow: hidden;
}

.app-sidebar:hover {
  width: 11rem;
}

.app-sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0 0.85rem 1rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid transparent;
  white-space: nowrap;
}

.app-sidebar:hover .app-sidebar-logo {
  border-bottom-color: #262626;
}

.app-sidebar-logo-mark {
  flex-shrink: 0;
  width: 1.85rem;
  height: 1.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.app-sidebar-logo-mark svg {
  width: 100%;
  height: 100%;
  display: block;
}

.app-sidebar-logo-text {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  color: #a3a3a3;
  opacity: 0;
  transform: translateX(-6px);
  transition:
    opacity 0.22s ease 0.04s,
    transform 0.26s ease;
}

.app-sidebar:hover .app-sidebar-logo-text {
  opacity: 1;
  transform: translateX(0);
}

.app-sidebar-middle {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 0.35rem;
  padding: 0 0.5rem;
}

.app-sidebar-bottom {
  padding: 0.5rem 0.5rem 0;
  margin-top: auto;
  border-top: 1px solid transparent;
}

.app-sidebar:hover .app-sidebar-bottom {
  border-top-color: #262626;
}

.app-nav-link {
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr);
  align-items: center;
  column-gap: 0.65rem;
  padding: 0.5rem 0.55rem;
  border: 1px solid transparent;
  border-radius: 6px;
  box-sizing: border-box;
  background: transparent;
  color: #737373;
  font: inherit;
  font-weight: 400;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  line-height: 1;
  transition:
    color 0.18s ease,
    background 0.18s ease;
}

.app-nav-link:visited,
.app-nav-link:hover,
.app-nav-link:focus,
.app-nav-link:focus-visible,
.app-nav-link:active {
  text-decoration: none;
}

.app-nav-link:hover {
  color: #a3a3a3;
  background: rgba(255, 255, 255, 0.04);
}

.app-nav-link--active,
.app-nav-link--active:visited {
  color: #fafafa;
}

.app-nav-link--active:hover {
  color: #fafafa;
  background: rgba(255, 255, 255, 0.06);
}

.app-nav-link--active .app-nav-icon-wrap svg {
  color: #fafafa;
}

/* Collapsed rail: hidden labels still took layout space (opacity-only) → icons / logo clipped by overflow:hidden */
@media (prefers-reduced-motion: no-preference) {
  .app-sidebar:not(:hover) .app-sidebar-logo {
    justify-content: center;
    gap: 0;
    padding: 0 0 1rem;
  }

  .app-sidebar:not(:hover) .app-sidebar-logo-text {
    display: none;
  }

  .app-sidebar:hover .app-sidebar-logo-text {
    display: inline;
  }

  .app-sidebar:not(:hover) .app-sidebar-middle {
    align-items: center;
  }

  .app-sidebar:not(:hover) .app-sidebar-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .app-sidebar:not(:hover) .app-nav-link {
    display: flex;
    justify-content: center;
    align-items: center;
    column-gap: 0;
    width: 100%;
    max-width: 3rem;
    padding: 0.5rem;
    box-sizing: border-box;
  }

  .app-sidebar:not(:hover) .app-nav-label {
    display: none;
  }

  .app-sidebar:hover .app-nav-link {
    display: grid;
    grid-template-columns: 1.75rem minmax(0, 1fr);
    align-items: center;
    column-gap: 0.65rem;
    max-width: none;
    width: 100%;
    align-self: stretch;
    padding: 0.5rem 0.55rem;
  }

  .app-sidebar:hover .app-nav-label {
    display: inline;
  }
}

.app-nav-icon-wrap {
  flex-shrink: 0;
  width: 1.75rem;
  min-width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.app-nav-icon-wrap svg {
  width: 20px;
  height: 20px;
  display: block;
  flex-shrink: 0;
}

.app-nav-label {
  font-size: 11px;
  text-transform: lowercase;
  letter-spacing: 0.06em;
  line-height: 1;
  min-width: 0;
  opacity: 0;
  transform: translateX(-8px);
  transition:
    opacity 0.2s ease,
    transform 0.24s ease;
  white-space: nowrap;
}

.app-sidebar:hover .app-nav-label {
  opacity: 1;
  transform: translateX(0);
  transition-delay: 0.05s;
}

.app-mobile-menu-header {
  display: none;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #262626;
  background: rgba(10, 10, 10, 0.92);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 200;
}

.app-mobile-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
  border: 1px solid #404040;
  border-radius: 6px;
  background: #141414;
  color: #a3a3a3;
  cursor: pointer;
  line-height: 0;
  transition:
    border-color 0.15s ease,
    color 0.15s ease,
    background 0.15s ease;
}

.app-mobile-menu-btn:hover {
  border-color: #737373;
  color: #fafafa;
}

.app-mobile-menu-title {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  color: #a3a3a3;
}

.app-mobile-menu-backdrop {
  display: none;
}

@media (max-width: 768px) {
  .app-mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .app-mobile-menu-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 298;
    border: none;
    padding: 0;
    margin: 0;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .app-mobile-menu-backdrop.app-mobile-menu-backdrop--open {
    opacity: 1;
    pointer-events: auto;
  }

  .shell-sidebar-slot {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(16rem, 88vw);
    z-index: 300;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    background: #0a0a0a;
  }

  .shell-sidebar-slot.shell-sidebar-slot--open {
    transform: translateX(0);
  }

  .shell-sidebar-slot .app-sidebar {
    width: 100% !important;
    min-height: 100%;
    border-right: none;
    transition: none;
  }

  .shell-sidebar-slot .app-sidebar:hover {
    width: 100% !important;
  }

  .shell-sidebar-slot .app-sidebar-logo {
    justify-content: flex-start;
    gap: 0.55rem;
    padding: 0 0.85rem 1rem;
    border-bottom-color: #262626;
  }

  .shell-sidebar-slot .app-sidebar-logo-text {
    display: inline !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .shell-sidebar-slot .app-sidebar-middle {
    align-items: stretch !important;
    justify-content: flex-start;
    padding-top: 0.5rem;
  }

  .shell-sidebar-slot .app-sidebar-bottom {
    align-items: stretch !important;
  }

  .shell-sidebar-slot .app-nav-link {
    display: grid !important;
    grid-template-columns: 1.75rem minmax(0, 1fr) !important;
    align-items: center !important;
    column-gap: 0.65rem !important;
    max-width: none !important;
    width: 100% !important;
    padding: 0.5rem 0.55rem !important;
    justify-content: initial !important;
  }

  .shell-sidebar-slot .app-nav-label {
    display: inline !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
  .shell-sidebar-slot,
  .app-mobile-menu-backdrop {
    transition: none !important;
  }
}

.kbd {
  display: inline-block;
  padding: 0.1em 0.45em 0.12em;
  font-size: 10px;
  font-family: inherit;
  line-height: 1.35;
  color: #d4d4d4;
  background: #1a1a1a;
  border: 1px solid #404040;
  border-radius: 3px;
  box-shadow: 0 1px 0 #0a0a0a;
  vertical-align: baseline;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
  border: 1px solid #404040;
  background: #141414;
  color: #a3a3a3;
  cursor: pointer;
  border-radius: 4px;
  transition:
    color 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease;
}

.btn-icon:hover {
  color: #e5e5e5;
  border-color: #525252;
  background: #1a1a1a;
}

.btn-icon[aria-expanded='true'] {
  color: #fafafa;
  border-color: #737373;
  background: #262626;
}

.btn-icon:disabled {
  opacity: 0.35;
  cursor: default;
}

.btn-icon-svg {
  display: block;
}

.shell-main {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr);
  gap: 0;
  align-items: stretch;
}

.shell-main-page {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 1rem 1.25rem;
  width: 100%;
}

.lexicon-panel-full {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.capture-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  /* Keep capture row readable on ultra-wide viewports; lexicon/phrase use full width */
  max-width: 72rem;
  margin: 0 auto;
  width: 100%;
}

.capture-grid {
  --capture-col-gap: 1.5rem;
  display: grid;
  /* Equal side columns so the arrow column sits on the horizontal center of the grid */
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  column-gap: var(--capture-col-gap);
  row-gap: 1rem;
  align-items: center;
  flex: 1;
  min-height: 12rem;
}

@media (max-width: 720px) {
  .capture-grid {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .capture-col-record {
    justify-content: center;
  }

  .capture-col-save {
    justify-content: center;
  }

  .capture-tag-row {
    align-items: center;
  }

  .capture-tag-label {
    justify-content: center;
  }

  .capture-col-arrow {
    order: 2;
    justify-self: center;
    width: auto;
    transform: rotate(90deg);
  }

  .capture-col-save {
    order: 3;
  }
}

.capture-col-record {
  display: flex;
  justify-content: center;
  align-items: stretch;
  min-width: 0;
}

.capture-record-block {
  width: 100%;
  max-width: 22rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
}

.capture-record-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font: inherit;
  font-size: 14px;
  padding: 0.55rem 1rem;
  border: 1px solid #404040;
  background: #141414;
  color: #d4d4d4;
  cursor: pointer;
  border-radius: 4px;
  transition:
    border-color 0.15s ease,
    color 0.15s ease,
    background 0.15s ease;
}

.capture-record-led {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #404040;
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.capture-record-btn-active .capture-record-led {
  background: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.65);
  animation: capture-rec-led-flash 0.9s ease-in-out infinite;
}

@keyframes capture-rec-led-flash {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.25;
  }
}

.capture-record-btn:hover:not(:disabled) {
  border-color: #737373;
  color: #fafafa;
}

.capture-record-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.capture-record-btn-active {
  border-color: #b91c1c;
  color: #fecaca;
  background: rgba(127, 29, 29, 0.25);
}

.capture-kbd-hint {
  margin: 0;
  font-size: 11px;
  color: #737373;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.capture-record-error {
  margin: 0;
}

.capture-wave {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2px;
  height: 4.5rem;
  padding: 0.35rem 0.15rem;
  background: transparent;
}

.capture-wave-bar {
  flex: 1;
  min-width: 2px;
  max-width: 8px;
  height: 100%;
  background: #737373;
  border-radius: 1px;
  transform-origin: bottom center;
  transition: transform 0.05s linear;
}

.capture-wave-active .capture-wave-bar {
  background: #a3a3a3;
}

.capture-record-meta {
  /* Fixed slot so the record button doesn’t shift when a clip appears */
  min-height: 2.75rem;
}

.capture-record-meta-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.capture-record-meta-inner--hidden {
  visibility: hidden;
  pointer-events: none;
  user-select: none;
}

.capture-record-actions {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.capture-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #a3a3a3;
  cursor: pointer;
  line-height: 0;
  transition:
    color 0.15s ease,
    background 0.15s ease;
}

.capture-action-icon:hover:not(:disabled) {
  color: #fafafa;
  background: rgba(255, 255, 255, 0.06);
}

.capture-action-icon:disabled {
  opacity: 0.3;
  cursor: default;
}

.capture-col-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.capture-arrow {
  font-size: 2rem;
  color: #525252;
  line-height: 1;
  user-select: none;
}

.capture-col-save {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.capture-tag-row {
  width: 100%;
  max-width: 28rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
  padding-top: 1.15rem;
}

.capture-tag-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  font-size: clamp(1.35rem, 3.5vw, 2.25rem);
  line-height: 1.2;
  color: #737373;
  width: 100%;
  max-width: 100%;
}

.capture-chevron {
  flex-shrink: 0;
  font-weight: 300;
  opacity: 0.85;
  user-select: none;
}

.capture-tag-input {
  flex: 0 0 auto;
  box-sizing: content-box;
  min-width: 11ch;
  max-width: 100%;
  border: none;
  background: transparent;
  color: #fafafa;
  font: inherit;
  font-size: inherit;
  line-height: inherit;
  padding: 0.15rem 0.5rem;
  outline: none;
}

.capture-tag-input::placeholder {
  color: #525252;
}

.capture-tag-input:disabled {
  opacity: 0.4;
}

.capture-save-hint {
  margin: 0;
  font-size: 11px;
  color: #737373;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.capture-dup {
  margin-top: 1rem;
}

@media (max-width: 800px) {
  .shell-main {
    grid-template-columns: 1fr;
  }
}

.col-left,
.col-right {
  padding: 1rem;
  border-right: 1px solid #262626;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  animation: col-fade-in 0.45s ease-out;
}

@keyframes col-fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.col-right {
  border-right: none;
}

.shell-footer {
  border-top: 1px solid #262626;
  background: rgba(10, 10, 10, 0.85);
}

.shell-footer-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem 0.85rem;
  padding: 0.45rem 1rem 0.5rem;
  font-size: 11px;
}

.shell-footer-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  justify-self: start;
  min-width: 0;
}

.shell-footer-entries {
  color: #737373;
  flex-shrink: 0;
  text-transform: lowercase;
}

.shell-footer-shortcuts {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  color: #737373;
  text-transform: lowercase;
}

.shell-footer-shortcut {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.shell-footer-dot {
  color: #525252;
  user-select: none;
}

.shell-footer-center {
  justify-self: center;
  text-align: center;
}

.shell-footer-right {
  justify-self: end;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem 0.75rem;
  text-align: right;
}

.shell-footer-status-msg {
  font-size: 11px;
  color: #a3a3a3;
  text-transform: lowercase;
}

@media (max-width: 640px) {
  .shell-footer-row {
    grid-template-columns: 1fr;
    row-gap: 0.65rem;
  }

  .shell-footer-left {
    justify-self: start;
  }

  .shell-footer-center {
    justify-self: center;
  }

  .shell-footer-right {
    justify-self: end;
  }
}

.footer-link {
  color: #737373;
  text-decoration: none;
  text-transform: lowercase;
  transition: color 0.15s ease;
}

.footer-link:hover {
  color: #d4d4d4;
}

.settings-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.6rem 1rem;
  background: rgba(23, 23, 23, 0.95);
}

.settings-page-panel .settings-bar {
  padding: 0;
  background: transparent;
}

.settings-field {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 11px;
  color: #a3a3a3;
  text-transform: lowercase;
}

.settings-field.checkbox {
  gap: 0.4rem;
}

.panel {
  border: 1px solid #262626;
  background: rgba(20, 20, 20, 0.55);
  padding: 0.75rem;
  animation: panel-in 0.4s ease-out;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel-label {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #737373;
  margin-bottom: 0.65rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}

.field-label {
  font-size: 11px;
  color: #737373;
  text-transform: lowercase;
}

.input {
  width: 100%;
  padding: 0.45rem 0.5rem;
  border: 1px solid #404040;
  background: #0f0f0f;
  color: #e5e5e5;
  font: inherit;
}

.input:focus {
  outline: 1px solid #737373;
  outline-offset: 0;
}

.input-inline {
  width: auto;
  min-width: 8rem;
}

.input-narrow {
  width: 4.5rem;
}

.textarea {
  min-height: 5rem;
  resize: vertical;
}

.btn {
  font: inherit;
  padding: 0.35rem 0.65rem;
  border: 1px solid #404040;
  background: #141414;
  color: #d4d4d4;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    color 0.15s ease,
    background 0.15s ease;
}

.btn:hover:not(:disabled) {
  border-color: #737373;
  color: #fafafa;
}

.btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.btn-accent {
  border-color: #525252;
  color: #e5e5e5;
}

.btn-sm {
  padding: 0.2rem 0.45rem;
  font-size: 11px;
}

.btn.danger:hover:not(:disabled) {
  border-color: #f87171;
  color: #fca5a5;
}

.quick-add-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.meta {
  font-size: 11px;
  color: #737373;
}

.meta.empty-hint {
  margin: 0.5rem 0;
}

.dim {
  opacity: 0.75;
}

.field-error {
  color: #f87171;
  font-size: 11px;
  margin: 0 0 0.5rem;
}

.dup-banner {
  margin-top: 0.5rem;
  padding: 0.5rem;
  border: 1px solid #854d0e;
  background: rgba(120, 53, 15, 0.2);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 12px;
}

.lex-toolbar {
  margin-bottom: 0.5rem;
}

.table-wrap {
  overflow-x: auto;
  max-height: min(50vh, 28rem);
  overflow-y: auto;
}

.lex-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 12px;
}

/* Equal column widths (5 × 20%) */
.lex-table col {
  width: 20%;
}

.lex-table th {
  text-align: left;
  font-weight: normal;
  color: #737373;
  text-transform: lowercase;
  font-size: 10px;
  padding: 0.35rem 0.3rem;
  border-bottom: 1px solid #262626;
}

.lex-table td {
  padding: 0.4rem 0.3rem;
  border-bottom: 1px solid #1f1f1f;
  vertical-align: middle;
}

.lex-table td:first-child {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.lex-table th:nth-child(2) {
  padding: 0.35rem 1.25rem;
}

.lex-table td.lex-wave-cell {
  padding: 0.4rem 1.25rem;
  vertical-align: middle;
  overflow: hidden;
  box-sizing: border-box;
}

.lex-wave-mini {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 2px;
  height: 22px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.lex-wave-mini-bar {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  border-radius: 1px;
  background: #525252;
  transform-origin: center bottom;
  transition:
    transform 0.12s ease,
    background-color 0.06s ease;
}

.lex-wave-mini-bar--played {
  background: #fafafa;
}

.lex-wave-mini-placeholder {
  font-size: 11px;
  color: #525252;
  line-height: 22px;
}

.lex-row {
  animation: lex-row-in 0.38s ease-out;
}

@keyframes lex-row-in {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.lex-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  justify-content: flex-end;
}

.linkish {
  background: none;
  border: none;
  color: #e5e5e5;
  font: inherit;
  cursor: pointer;
  text-align: left;
  padding: 0;
  transition: color 0.15s ease;
}

.linkish:hover {
  color: #fafafa;
}

.mono {
  font-family: inherit;
}

.lexicon-panel {
  flex: 1;
  min-height: 0;
}

.composer-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.unknown-banner {
  margin: 0.5rem 0;
  padding: 0.45rem 0.5rem;
  border: 1px solid #7c2d12;
  background: rgba(124, 45, 18, 0.15);
  font-size: 11px;
}

.token-unknown {
  display: inline-block;
  margin-right: 0.35rem;
  padding: 0.1rem 0.25rem;
  background: rgba(127, 29, 29, 0.35);
  color: #fca5a5;
}

.token-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.65rem 0;
  min-height: 1.5rem;
  align-items: center;
}

.token-chip {
  padding: 0.15rem 0.4rem;
  border: 1px solid #404040;
  font-size: 11px;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.token-known {
  border-color: #525252;
  color: #d4d4d4;
}

.token-miss {
  border-color: #7f1d1d;
  color: #fca5a5;
}

.token-active {
  box-shadow: 0 0 0 1px #a3a3a3;
  background: rgba(163, 163, 163, 0.1);
}

.composer-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.5rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

select.input {
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .col-left,
  .col-right,
  .panel,
  .lex-row,
  .app-sidebar,
  .app-sidebar-logo-text,
  .app-nav-label,
  .capture-wave-bar,
  .capture-record-btn-active .capture-record-led {
    animation: none !important;
    transition: none !important;
  }

  .app-sidebar {
    width: 11rem;
  }

  .app-sidebar-logo {
    justify-content: flex-start;
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .app-sidebar-logo-text,
  .app-nav-label {
    opacity: 1;
    transform: none;
  }

  /* Keep grid + visible labels; do not use collapsed flex rules above */
  .app-nav-link {
    display: grid;
    grid-template-columns: 1.75rem minmax(0, 1fr);
    align-items: center;
    column-gap: 0.65rem;
  }

  .app-nav-label {
    display: inline;
  }
}
