/* Werkbank — ui: components */
[hidden] { display: none !important; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: none;
  border-radius: 999px;
  padding: 12px 20px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.55s var(--ease);
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--amber-hot), var(--amber-deep));
  color: #1A1206;
  padding-right: 8px;
  box-shadow: 0 8px 28px rgba(232, 155, 75, 0.22);
}
.btn-primary .btn-orb {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(10, 8, 4, 0.22);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.55s var(--ease);
}
.btn-primary:hover .btn-orb { transform: translateX(3px) scale(1.06); }
.btn-orb svg { width: 15px; height: 15px; color: #FFF3E2; }
.btn-ghost {
  background: var(--glass);
  border: 1px solid var(--line);
  color: var(--ink-dim);
}
.btn-ghost:hover { color: var(--ink); border-color: rgba(255, 255, 255, 0.16); }
.btn.sm { padding: 9px 16px; font-size: 12.5px; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.link-btn {
  background: none; border: none;
  color: var(--ink-faint);
  font-family: inherit; font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.row-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.row-actions.center { justify-content: center; }

/* ---- Inputs ---- */
.field-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-dim);
  margin: 14px 0 8px;
}
.field-label:first-child { margin-top: 0; }
.field-label em { font-style: normal; text-transform: none; letter-spacing: 0; color: var(--ink-faint); font-weight: 400; }
.input, .area, .search {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  padding: 13px 15px;
  outline: none;
  transition: border-color 0.4s var(--ease);
}
.input:focus, .area:focus, .search:focus { border-color: rgba(232, 155, 75, 0.45); }
.area { resize: vertical; line-height: 1.55; min-height: 90px; }
.area.mono { font-family: "SF Mono", ui-monospace, Menlo, monospace; font-size: 13px; }
select.input { appearance: none; -webkit-appearance: none; }
.note { font-size: 12.5px; line-height: 1.6; color: var(--ink-faint); margin-top: 14px; }

/* ---- Voice ---- */
.rec-core { text-align: center; }
.rec-stage { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 8px 0 18px; }
.rec-btn {
  position: relative;
  width: 92px; height: 92px;
  border-radius: 50%;
  border: 1px solid rgba(232, 155, 75, 0.35);
  background: radial-gradient(circle at 32% 28%, rgba(232, 155, 75, 0.28), rgba(232, 155, 75, 0.08) 65%);
  color: var(--amber-hot);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.55s var(--ease);
  box-shadow: 0 10px 40px rgba(232, 155, 75, 0.15), inset 0 1px 1px rgba(255, 255, 255, 0.15);
}
.rec-btn:active { transform: scale(0.94); }
.rec-icon { width: 34px; height: 34px; }
.rec-ring {
  position: absolute; inset: -8px;
  border-radius: 50%;
  border: 1px solid rgba(232, 155, 75, 0.25);
  opacity: 0;
}
.rec-btn.live { background: radial-gradient(circle at 32% 28%, rgba(232, 106, 92, 0.4), rgba(232, 106, 92, 0.12) 65%); border-color: rgba(232, 106, 92, 0.5); color: #FFB4A8; }
.rec-btn.live .rec-ring { animation: pulse 1.6s var(--ease) infinite; border-color: rgba(232, 106, 92, 0.5); }
@keyframes pulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.45); opacity: 0; }
}
.rec-meta { display: flex; gap: 12px; align-items: baseline; }
.rec-state { font-size: 12px; text-transform: uppercase; letter-spacing: 0.18em; color: var(--ink-dim); }
.rec-timer { font-size: 13px; font-weight: 700; color: var(--amber); font-variant-numeric: tabular-nums; }

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  padding: 6px;
}
.mode-opt {
  display: flex; flex-direction: column; gap: 2px;
  border: none; border-radius: 13px;
  background: transparent;
  color: var(--ink-faint);
  font-family: inherit; font-size: 13px; font-weight: 600;
  padding: 10px 8px;
  cursor: pointer;
  transition: all 0.5s var(--ease);
}
.mode-opt small { font-size: 10px; font-weight: 400; }
.mode-opt.active { background: rgba(232, 155, 75, 0.12); color: var(--amber-hot); }

/* ---- Structured result ---- */
.res-group { margin-bottom: 22px; }
.res-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.18em;
  color: var(--amber);
  margin: 4px 4px 10px;
}
.res-card {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  margin-bottom: 8px;
  display: flex; gap: 12px; align-items: flex-start;
  animation: panelIn 0.6s var(--ease) both;
}
.res-card p { flex: 1; font-size: 14px; line-height: 1.5; }
.res-card .res-sub { font-size: 12px; color: var(--ink-faint); margin-top: 3px; }
.res-card .prio { display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--amber); margin-right: 6px; }
.icon-btn {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--ink-dim);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.4s var(--ease);
}
.icon-btn svg { width: 14px; height: 14px; }
.icon-btn:active { transform: scale(0.9); }
.spinner {
  width: 22px; height: 22px;
  border: 2px solid var(--line);
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.busy-note { text-align: center; color: var(--ink-dim); font-size: 13px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }

/* ---- History ---- */
.hist-head { display: flex; justify-content: space-between; align-items: baseline; margin: 26px 4px 10px; }
.hist-list .res-card { cursor: pointer; }
.hist-empty { color: var(--ink-faint); font-size: 13px; padding: 8px 4px; }

/* ---- OCR ---- */
.drop-zone {
  border: 1.5px dashed rgba(232, 155, 75, 0.3);
  border-radius: 18px;
  padding: 30px 16px;
  text-align: center;
  color: var(--ink-dim);
  font-size: 14px;
}
.drop-zone.hover { border-color: var(--amber); background: rgba(232, 155, 75, 0.05); }
.drop-icon { width: 34px; height: 34px; color: var(--amber); margin-bottom: 10px; }
.drop-hint { font-size: 12px; color: var(--ink-faint); margin-top: 4px; }
.ocr-progress { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.ocr-bar { flex: 1; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.ocr-bar span { display: block; height: 100%; width: 0%; border-radius: 999px; background: linear-gradient(90deg, var(--amber-deep), var(--amber-hot)); transition: width 0.3s var(--ease); }
.ocr-pct { font-size: 12px; font-weight: 700; color: var(--amber); min-width: 42px; text-align: right; font-variant-numeric: tabular-nums; }
.ocr-img { width: 100%; border-radius: 14px; display: block; }

/* ---- Snippets ---- */
.snip-tools { margin-bottom: 18px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 2px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--ink-dim);
  border-radius: 999px;
  padding: 7px 15px;
  font-family: inherit; font-size: 12px; font-weight: 600;
  cursor: pointer;
  transition: all 0.45s var(--ease);
}
.chip.active { background: rgba(232, 155, 75, 0.13); border-color: rgba(232, 155, 75, 0.4); color: var(--amber-hot); }
.snip-card {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 10px;
  animation: panelIn 0.55s var(--ease) both;
}
.snip-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.snip-title { flex: 1; font-size: 14.5px; font-weight: 700; }
.snip-cat { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; color: var(--amber); border: 1px solid rgba(232, 155, 75, 0.3); border-radius: 999px; padding: 3px 9px; }
.snip-body {
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-dim);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 96px;
  overflow: hidden;
  mask-image: linear-gradient(180deg, #000 60%, transparent);
  -webkit-mask-image: linear-gradient(180deg, #000 60%, transparent);
}
.snip-acts { display: flex; gap: 8px; margin-top: 10px; }
.snip-empty { text-align: center; color: var(--ink-faint); font-size: 13.5px; padding: 40px 20px; line-height: 1.7; }

/* ---- FAB ---- */
.fab {
  position: fixed;
  right: 20px;
  bottom: calc(var(--sab) + 96px);
  z-index: 45;
  width: 56px; height: 56px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--amber-hot), var(--amber-deep));
  color: #1A1206;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 34px rgba(232, 155, 75, 0.35);
  transition: transform 0.5s var(--ease);
}
.fab svg { width: 22px; height: 22px; }
.fab:active { transform: scale(0.9); }

/* ---- Bottom sheet ---- */
.sheet-wrap { position: fixed; inset: 0; z-index: 60; }
.sheet-bg {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.5s var(--ease);
}
.sheet {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: #12100D;
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 28px 28px 0 0;
  padding: 14px 20px calc(var(--sab) + 24px);
  transform: translateY(100%);
  transition: transform 0.6s var(--ease);
  max-height: 86dvh;
  overflow-y: auto;
}
.sheet-wrap.open .sheet-bg { opacity: 1; }
.sheet-wrap.open .sheet { transform: translateY(0); }
.sheet-grip { width: 40px; height: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.15); margin: 0 auto 16px; }
.sheet-title { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 16px; }
.sheet .input, .sheet .area { margin-bottom: 10px; }

/* ---- Toast ---- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--sab) + 100px);
  transform: translate(-50%, 20px);
  z-index: 70;
  background: rgba(20, 18, 14, 0.92);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(232, 155, 75, 0.3);
  border-radius: 999px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  padding: 11px 20px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.5s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
