:root {
  --bg: #0a040c;
  --panel: rgba(14, 6, 20, 0.92);
  --text: #e8e8f0;
  --muted: rgba(232, 232, 240, 0.55);
  --led: #6badc9;
  --neg: #f9a8d4;
  --border: rgba(140, 100, 160, 0.32);
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: system-ui, -apple-system, Segoe UI, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.vq-header {
  padding: 12px 18px 8px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.vq-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.vq-app-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 22.37%;
  object-fit: cover;
}

.vq-brand h1 {
  margin: 0;
  font-size: 1.15rem;
  color: #fff;
  font-weight: bold;
}

.vq-header h1 {
  margin: 0 0 4px;
  font-size: 1.15rem;
  color: var(--led);
}

.vq-typewriter {
  margin: 8px 0 0;
  min-height: 3.6rem;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.55;
}

.vq-typewriter-label {
  color: var(--text);
  font-weight: 600;
  min-height: 1.25em;
}

.vq-typewriter-line {
  min-height: 1.55em;
  font-style: italic;
  color: var(--led);
  font-weight: 500;
}

.vq-typewriter-text {
  white-space: pre-wrap;
}

.vq-typewriter-cursor {
  display: inline-block;
  color: var(--led);
  font-weight: 400;
  animation: vq-cursor-blink 1s step-end infinite;
}

.vq-typewriter-note {
  margin: 0.2rem 0 0;
  font-size: 0.92em;
  color: var(--muted);
  font-style: italic;
}

@keyframes vq-cursor-blink {
  50% {
    opacity: 0;
  }
}

.vq-typewriter.vq-paused .vq-typewriter-cursor {
  animation: none;
  opacity: 0.35;
}

.vq-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.45;
}

.vq-hint kbd {
  display: inline-block;
  padding: 0 0.35em;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.92em;
  color: var(--led);
  background: rgba(255, 255, 255, 0.04);
}

.vq-examples {
  margin: 8px 0 0;
  padding: 0 0 0 1.1rem;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.55;
}

.vq-examples li {
  margin: 0.35rem 0;
}

.vq-examples strong {
  color: var(--text);
  font-weight: 600;
}

.vq-examples-note {
  font-size: 0.92em;
  color: var(--muted);
  font-style: italic;
}

.vq-hint-example {
  font-style: italic;
  color: var(--led);
  font-weight: 500;
}

.vq-keywords {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.45;
}

.vq-keywords strong {
  color: var(--led);
  font-weight: 600;
}

.vq-stt-panel {
  flex-shrink: 0;
  padding: 10px 18px 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 4, 12, 0.95);
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.vq-transcript-wrap {
  position: relative;
  width: min(96vw, 2160px);
  max-width: 100%;
  align-self: center;
}

.vq-edit-countdown {
  display: none;
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 3;
  width: 40px;
  height: 40px;
  pointer-events: none;
}

.vq-edit-countdown.vq-active {
  display: block;
}

.vq-countdown-svg {
  width: 40px;
  height: 40px;
  transform: rotate(-90deg);
}

.vq-countdown-track {
  fill: rgba(107, 173, 201, 0.25);
  stroke: rgba(255, 255, 255, 0.2);
  stroke-width: 2;
}

.vq-countdown-progress {
  fill: none;
  stroke: #e53935;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 94.25;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.35s linear;
}

.vq-countdown-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.vq-transcript.vq-transcript-counting {
  padding-right: 3.25rem;
}

.vq-transcript {
  width: 100%;
  min-height: 5.5rem;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 1.35rem;
  line-height: 1.35;
  resize: vertical;
}

.vq-transcript::placeholder {
  color: rgba(232, 232, 240, 0.42);
  opacity: 1;
}

.vq-status {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.vq-status.vq-listening {
  color: var(--led);
}

.vq-status.vq-error {
  color: var(--neg);
}

.vq-transcript:focus {
  outline: none;
  border-color: rgba(107, 173, 201, 0.65);
  box-shadow: 0 0 0 2px rgba(107, 173, 201, 0.2);
}

.vq-transcript.vq-transcript-live {
  border-color: rgba(107, 173, 201, 0.45);
}

.vq-parse-preview {
  margin-top: 8px;
  font-size: 0.88rem;
  color: var(--led);
}

.vq-history {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  width: min(96vw, 2160px);
  max-width: 100%;
  align-self: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vq-history-label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.vq-history:empty,
.vq-history:not(:has(.vq-history-item)) {
  display: none;
}

.vq-history-item {
  margin: 0;
}

.vq-history-row {
  display: flex;
  align-items: stretch;
  gap: 4px;
}

.vq-history-btn {
  flex: 1;
  min-width: 0;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  color: rgba(232, 232, 240, 0.82);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.4;
  padding: 6px 10px;
  cursor: pointer;
  white-space: normal;
  word-break: break-word;
}

.vq-history-btn:hover,
.vq-history-btn:focus {
  border-color: rgba(107, 173, 201, 0.35);
  background: rgba(107, 173, 201, 0.1);
  color: var(--led);
  outline: none;
}

.vq-history-del {
  flex-shrink: 0;
  width: 2rem;
  border: 1px solid rgba(229, 57, 53, 0.35);
  border-radius: 6px;
  background: rgba(229, 57, 53, 0.1);
  color: #ff8a8a;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.vq-history-del:hover,
.vq-history-del:focus {
  background: rgba(229, 57, 53, 0.25);
  outline: none;
}

.vq-stt-actions {
  margin-top: 8px;
}

.vq-btn {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 0.85rem;
}

.vq-btn-primary {
  border-color: rgba(107, 173, 201, 0.55);
  background: rgba(107, 173, 201, 0.14);
  color: var(--led);
}

.vq-stt-actions {
  display: flex;
  gap: 8px;
}

.vq-grid.vq-layout-1x2 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
}

.vq-grid.vq-layout-2x2 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.vq-grid {
  flex: 1;
  display: grid;
  gap: 6px;
  padding: 6px;
  min-height: 0;
}

.vq-grid-0 {
  display: none;
}

.vq-grid-1 {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}

.vq-grid-2 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
}

.vq-grid-3 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.vq-grid-3 .vq-cell:last-child {
  grid-column: 1 / -1;
}

.vq-grid-4 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.vq-cell {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.vq-cell-num {
  position: absolute;
  top: 6px;
  left: 8px;
  z-index: 4;
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1;
  color: #e53935;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

.vq-cell-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
  padding: 4px 8px 4px 2.6rem;
  border-bottom: 1px solid var(--border);
}

.vq-cell-title {
  flex: 1;
  min-width: 0;
  padding: 2px 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--led);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vq-cell-close {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  border: 1px solid rgba(229, 57, 53, 0.45);
  border-radius: 4px;
  background: rgba(229, 57, 53, 0.12);
  color: #ff5252;
  font-size: 1.25rem;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.vq-cell-close:hover,
.vq-cell-close:focus-visible {
  background: rgba(229, 57, 53, 0.28);
  outline: none;
}

.vq-cell-body {
  flex: 1;
  min-height: 180px;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.vq-cell-under {
  flex: 1 1 auto;
  min-height: 0;
}

.vq-cell-body.vq-has-opt .vq-cell-under {
  flex: 1 1 58%;
  height: auto;
}

.vq-cell-opt {
  flex: 0 0 auto;
  min-height: 140px;
  max-height: 42%;
  border-top: 1px solid var(--border);
  overflow: auto;
}

.vq-cell-body.vq-has-opt .vq-cell-opt {
  flex: 0 0 42%;
  height: auto;
}

.vq-cell-opt[hidden] {
  display: none;
}

.vq-cell-body.vq-has-spread {
  display: flex;
  flex-direction: column;
}

.vq-cell-body.vq-has-spread .vq-cell-opt {
  flex: 0 0 46%;
  min-height: 180px;
  max-height: none;
  border-top: none;
  border-bottom: 1px solid var(--border);
  order: 1;
}

.vq-cell-body.vq-has-spread .vq-cell-under {
  flex: 1 1 54%;
  order: 2;
}

.vq-spread-wrap {
  position: relative;
  height: 100%;
  min-height: 160px;
}

.vq-spread-wrap.vq-spread-stale-wrap .vq-spread-panel {
  opacity: 0.72;
}

.vq-spread-watermark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.22);
  pointer-events: none;
  user-select: none;
}

.vq-spread-refresh {
  margin-left: auto;
  border: 1px solid rgba(107, 173, 201, 0.45);
  border-radius: 4px;
  background: rgba(107, 173, 201, 0.12);
  color: var(--led);
  font-size: 1rem;
  line-height: 1;
  padding: 2px 8px;
  cursor: pointer;
}

.vq-spread-refresh:hover,
.vq-spread-refresh:focus {
  background: rgba(107, 173, 201, 0.28);
  outline: none;
}

.vq-spread-leg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  margin-bottom: 0.35rem;
}

.vq-spread-leg-table th,
.vq-spread-leg-table td {
  padding: 3px 6px;
  text-align: right;
  border-bottom: 1px solid rgba(140, 100, 160, 0.2);
}

.vq-spread-leg-table th:first-child,
.vq-spread-leg-table td:first-child {
  text-align: left;
}

.vq-spread-leg-table th {
  color: var(--muted);
  font-weight: 600;
}

.vq-spread-panel {
  padding: 0.65rem 0.75rem;
  font-size: 0.92rem;
  line-height: 1.35;
  color: var(--text);
  background: rgba(0, 0, 0, 0.2);
  height: 100%;
  box-sizing: border-box;
}

.vq-spread-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.vq-spread-sym {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #e8e8e8;
}

.vq-spread-sym .sym-itm-first,
.vq-spread-sym .sym-itm-second {
  color: #ff6b6b;
}

.vq-spread-type {
  font-weight: 600;
  color: #f0c674;
}

.vq-spread-live {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #7dffb0;
}

.vq-spread-main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-bottom: 0.4rem;
}

.vq-spread-prem {
  font-size: 1.35rem;
  font-weight: 700;
  color: #ffb347;
}

.vq-spread-meta,
.vq-spread-muted {
  color: var(--muted, #9a8faa);
  font-size: 0.82rem;
}

.vq-spread-legs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  font-size: 0.82rem;
  margin-bottom: 0.25rem;
}

.vq-spread-exp {
  font-size: 0.78rem;
  color: var(--muted, #9a8faa);
}

.vq-spread-error {
  color: #ff8a8a;
}

body.vq-space-held .vq-status {
  color: var(--led);
}
