/* Drabok STT — page-specific styles built on the Drabok theme tokens. */

.hidden { display: none !important; }
[hidden] { display: none !important; }
.text-destructive { color: hsl(var(--destructive)); }
.inline-form { display: inline-flex; margin: 0; }
.dd-form { margin: 0; }
.dd-form .dd-item { width: 100%; }

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: hsl(var(--background));
}
.auth-card {
  width: 100%;
  max-width: 420px;
}
.auth-brand {
  border: 1px solid hsl(var(--border));
  border-bottom: 0;
  padding: 18px;
}
.auth-card-body { border-radius: 0; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------------- Dashboard grid ---------------- */
.stt-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.85fr);
  gap: 16px;
  align-items: start;
  margin: 16px 0;
}
.stt-grid > .card { margin: 0; }

/* ---------------- Upload / recorder ---------------- */
.upload-tabs {
  display: flex;
  gap: 2px;
  padding: 4px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--muted));
  margin-bottom: 14px;
  overflow-x: auto;
}
.upload-tab {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  color: hsl(var(--muted-foreground));
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.upload-tab:hover { color: hsl(var(--foreground)); }
.upload-tab.active {
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  box-shadow: 0 1px 2px hsl(var(--foreground) / 0.06);
}
.upload-tab svg { width: 15px; height: 15px; }

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 174px;
  padding: 24px;
  border: 1.5px dashed hsl(var(--border));
  background: hsl(var(--background));
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.dropzone:hover,
.dropzone:focus-visible,
.dropzone.dragover {
  border-color: hsl(var(--primary));
  background: hsl(var(--accent));
  outline: none;
}
.dropzone b { font-size: 13.5px; }
.dropzone .muted { font-size: 12px; }
.dropzone-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 7px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
}
.dropzone-icon svg { width: 19px; height: 19px; }

.device-recorder {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--background));
}
.device-recorder .dropzone-icon { flex: 0 0 auto; margin: 0; }
.device-recorder b { font-size: 13.5px; }
.device-recorder p { margin: 4px 0 0; font-size: 12.5px; color: hsl(var(--muted-foreground)); line-height: 1.5; }

.recorder {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--background));
}
.record-btn {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  border: 1px solid hsl(var(--destructive));
  background: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.record-btn:hover { transform: scale(1.04); }
.record-btn svg { width: 24px; height: 24px; }
.record-btn.recording {
  animation: recordPulse 1.2s ease-in-out infinite;
  background: hsl(var(--card));
  color: hsl(var(--destructive));
}
@keyframes recordPulse {
  0%, 100% { box-shadow: 0 0 0 0 hsl(var(--destructive) / 0.45); }
  50% { box-shadow: 0 0 0 12px hsl(var(--destructive) / 0); }
}
.recorder-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.recorder-meta b { font-size: 13.5px; }
.recorder-meta .mono { font-size: 13px; color: hsl(var(--muted-foreground)); }
.record-preview { width: 100%; margin-top: 12px; }

.selection {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--accent));
}
.selection-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
}
.selection-icon svg { width: 17px; height: 17px; }
.selection-body { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.selection-body b {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.selection-body .muted { font-size: 11.5px; }

.upload-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.upload-actions .muted { font-size: 12px; }

.progress {
  height: 6px;
  margin-top: 12px;
  overflow: hidden;
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
}
.progress-bar {
  height: 100%;
  width: 0;
  background: hsl(var(--primary));
  transition: width 0.18s ease;
}

/* ---------------- Engine ---------------- */
.engine-list { display: flex; flex-direction: column; }
.engine-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid hsl(var(--border));
  font-size: 12.5px;
}
.engine-row:first-child { padding-top: 0; }
.engine-row:last-child { border-bottom: 0; padding-bottom: 0; }
.engine-row > span:first-child { display: inline-flex; align-items: center; gap: 7px; color: hsl(var(--muted-foreground)); }
.engine-row svg { width: 15px; height: 15px; }
.engine-row .mono {
  max-width: 62%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11.5px;
  text-align: right;
}
.model-help { margin: 10px 0 0; }
.setup-code {
  margin-top: 6px;
  padding: 6px 8px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--background));
  font-size: 11px;
  overflow-x: auto;
}
.engine-mobile {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid hsl(var(--border));
}
.engine-mobile > svg { width: 17px; height: 17px; margin-top: 2px; color: hsl(var(--muted-foreground)); }
.engine-mobile div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.engine-mobile b { font-size: 12.5px; }
.engine-mobile span {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
  font-size: 11.5px;
  overflow-wrap: anywhere;
}
.engine-mobile small { font-size: 11.5px; color: hsl(var(--muted-foreground)); }

/* ---------------- Transcript table ---------------- */
.table-card-head {
  flex-wrap: wrap;
  gap: 12px;
}
.table-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-wrap: nowrap;
}
.searchbox.table-search { display: block; width: 290px; flex: 0 0 290px; max-width: 100%; }
.table-tools select { width: 170px; flex: 0 0 170px; }
.stt-table td { vertical-align: top; }
.audio-cell { display: flex; gap: 10px; align-items: flex-start; }
.play-btn {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
}
.play-btn:hover { background: hsl(var(--accent)); }
.play-btn svg { width: 15px; height: 15px; }
.audio-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.file-name {
  display: block;
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
}
.audio-meta .muted { font-size: 11.5px; }
.transcript-preview {
  font-size: 12.5px;
  line-height: 1.55;
  color: hsl(var(--foreground));
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.link-btn {
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: hsl(var(--muted-foreground));
  font: inherit;
  font-size: 11.5px;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.link-btn:hover { color: hsl(var(--foreground)); }
.status-detail { font-size: 11px; margin-top: 3px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 2px; }
.row-actions .btn { padding-left: 7px; padding-right: 7px; }
.row-actions form { margin: 0; }
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 38px 16px;
  text-align: center;
  color: hsl(var(--muted-foreground));
}
.empty-state svg { width: 28px; height: 28px; margin-bottom: 4px; }
.empty-state b { color: hsl(var(--foreground)); font-size: 13.5px; }
.empty-state span { font-size: 12.5px; }

/* ---------------- Transcript modal ---------------- */
.modal-audio { width: 100%; margin-bottom: 14px; }
.meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--border));
  margin-bottom: 14px;
}
.meta-grid > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 10px;
  background: hsl(var(--card));
  min-width: 0;
}
.meta-grid span { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; color: hsl(var(--muted-foreground)); }
.meta-grid b { font-size: 12.5px; overflow-wrap: anywhere; }
.transcript-full {
  max-height: 42vh;
  overflow: auto;
  padding: 14px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--background));
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.transcript-full:empty { display: none; }
#transcriptPlaceholder { font-size: 13px; }
.modal-spacer { flex: 1 1 auto; }

/* ---------------- Small screens ---------------- */
@media (max-width: 1100px) {
  .stt-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .page-head { flex-direction: column; align-items: flex-start; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1 1 auto; justify-content: center; }
  .grid.grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card.stat { padding: 14px; }
  .card.stat b { font-size: 25px; }
  .table-tools { width: 100%; margin-left: 0; flex-wrap: wrap; }
  .searchbox.table-search { width: 100%; flex: 1 1 100%; }
  .table-tools select { max-width: none !important; width: 100%; flex: 1 1 100%; }
  .meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .upload-tab { font-size: 11.5px; padding: 8px 6px; }
  .upload-tab svg { display: none; }
  .recorder { flex-wrap: wrap; }
  .recorder .btn { margin-left: 72px; }
  .file-name { max-width: 150px; }
  .modal-f { flex-wrap: wrap; }
  .modal-f .btn { flex: 1 1 auto; justify-content: center; }
}

.toast-region {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 10px 12px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  box-shadow: 0 8px 24px hsl(var(--foreground) / 0.12);
  font-size: 12.5px;
  pointer-events: auto;
}
