/* score-video's QC result - scores + a pass/reject verdict, see OUTPUT_KIND's "qc" kind */

.qc-result {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.qc-scores {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.qc-score-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
}

.qc-flags {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--risk);
}

/* generic structured-result rendering (app.js's prettyValue/patternsHtml) - a readable
   stand-in for dumping raw JSON at someone who isn't reading it as a developer would */

.kv-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kv-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
}

.kv-key {
  color: var(--ink-soft);
  flex-shrink: 0;
}

.kv-value {
  text-align: right;
}

.kv-row--stacked {
  flex-direction: column;
  align-items: flex-start;
}

.kv-row--stacked .kv-value {
  text-align: left;
  line-height: 1.5;
}

.kv-table {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  overflow-x: auto;
}

.kv-table-row {
  display: grid;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}

.kv-table-row:first-child {
  color: var(--ink-soft);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .03em;
  border-bottom-width: 2px;
}

.kv-table-row span {
  overflow-wrap: anywhere;
}

.output-json-toolbar {
  display: flex;
  justify-content: flex-end;
}

.copy-json-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
  transition: color .15s ease, border-color .15s ease;
}

.copy-json-btn svg {
  display: block;
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.copy-json-btn:hover,
.copy-json-btn--done {
  color: var(--output-accent);
  border-color: var(--output-accent);
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  max-width: 100%;
  /* pills are built for a short tag, but content ultimately comes from an LLM that doesn't
     always cooperate (see patternsHtml's own hook_type note) - wrap rather than force a
     long value into one broken horizontal strip */
  white-space: normal;
  overflow-wrap: break-word;
}

.result-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.result-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.result-card-title {
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

.result-card-title:hover {
  color: var(--accent);
}

.result-card-hook {
  margin: 0;
  font-size: 13px;
  font-style: italic;
  color: var(--ink-soft);
}

.result-card-hook-type {
  margin: 0;
  font-size: 12px;
}

.io-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* input/output are told apart by border style, not a filled color wash: solid means "this
   holds something", dashed means "empty - will populate once you run it". A filled icon
   badge stands in for the old "INPUT"/"OUTPUT" text label. */

/* input = violet ("give this"), output = rose ("get this") - two dedicated hues instead of
   a neutral wash, so each zone reads as a distinct, deliberate destination. An output with
   nothing in it yet stays neutral and dashed (nothing to show off) and only takes on its
   rose fill once a result actually lands - the color becomes the "you got something" cue. */

.io-block--input,
.io-block--output {
  position: relative;
  border-radius: 10px;
  padding: 12px 14px;
  border: 1px solid transparent;
}

/* input has no label text to anchor an icon to (unlike output's, which names the result
   kind) - a solid left rule reads as "this is the input zone" without a floating icon
   detached from anything */
.io-block--input .io-label {
  display: none;
}

.io-block--input {
  border-left: 3px solid var(--input-accent);
  padding-left: 16px;
}

.io-block--output {
  background: var(--output-tint);
  border-color: var(--output-tint-border);
}

.io-block--output:has(.io-empty),
.io-block--output:has(.output--empty) {
  background: var(--paper);
  border-color: var(--line);
  border-style: dashed;
}

.io-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.io-label-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
}

.io-label-icon svg {
  width: 9px;
  height: 9px;
}

.io-block--input .io-label { color: var(--input-accent); }
.io-block--input .io-label-icon { background: var(--input-accent); color: var(--paper-raised); }

.io-block--output .io-label { color: var(--output-accent); }
.io-block--output .io-label-icon { background: var(--output-accent); color: var(--paper-raised); }

.io-block--output:has(.io-empty) .io-label,
.io-block--output:has(.output--empty) .io-label {
  color: var(--ink-soft);
}

.io-block--output:has(.io-empty) .io-label-icon,
.io-block--output:has(.output--empty) .io-label-icon {
  background: transparent;
  color: var(--ink-soft);
  box-shadow: inset 0 0 0 1px var(--line);
}

.io-empty {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
  font-style: italic;
}

.panel-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.panel-fields-advanced {
  margin-top: 12px;
}

.panel-fields-advanced summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--ink-soft);
}

.panel-fields-advanced[open] summary {
  margin-bottom: 10px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft);
}

.field input,
.field textarea,
.field select,
select,
input[type="text"],
input[type="number"],
.custom-select-trigger {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--input-tint);
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  box-shadow: inset 0 1px 2px var(--input-inset-shadow);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--ink-soft);
  opacity: .75;
}

.field input:hover,
.field textarea:hover,
.field select:hover,
.custom-select-trigger:hover {
  border-color: var(--input-accent);
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.custom-select-trigger[aria-expanded="true"] {
  outline: none;
  border-color: var(--input-accent);
  box-shadow: inset 0 1px 2px var(--input-inset-shadow), 0 0 0 3px var(--input-accent-soft);
}

.field textarea {
  min-height: 70px;
  resize: vertical;
}

.custom-select {
  position: relative;
}

.custom-select-trigger {
  position: relative;
  padding-right: 30px;
  cursor: pointer;
}

.custom-select-trigger::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 7px;
  height: 7px;
  border: solid var(--input-accent);
  border-width: 0 1.5px 1.5px 0;
  transform: translateY(-70%) rotate(45deg);
}

.custom-select-list {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 4px;
  list-style: none;
  max-height: 240px;
  overflow-y: auto;
  border-radius: 9px;
  background: var(--paper-raised);
  box-shadow: var(--shadow);
}

.custom-select-option {
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}

.custom-select-option:hover {
  background: var(--input-tint);
}

.custom-select-option--active {
  background: var(--input-accent-soft);
  color: var(--input-accent);
}

.custom-select-option--disabled {
  color: var(--ink-soft);
  cursor: not-allowed;
}

.custom-select-option--disabled:hover {
  background: none;
}

.voice-picker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 6px 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}

.voice-picker-row:hover {
  background: var(--input-tint);
}

.voice-picker-row.custom-select-option--active {
  background: var(--input-accent-soft);
  color: var(--input-accent);
}

.checklist-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-raised);
}

/* checkbox fields - the generic .field input rule above styles inputs as full-width text
   boxes, which turns a checkbox into a big empty block instead of a small inline toggle */
.field--checkbox label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

/* Custom-drawn checkbox/radio - the native control (even with accent-color) reads as a tiny,
   flat, "free" browser default next to this app's own buttons/fields. Same box for both,
   just square vs round and check vs dot, so a mixed form doesn't look like two components. */
.field--checkbox input[type="checkbox"],
.checkbox-label input[type="checkbox"],
.voice-option input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  aspect-ratio: 1 / 1;
  flex: none;
  margin: 0;
  padding: 0;
  border: 1.5px solid var(--line);
  border-radius: 4px;
  background: var(--paper-raised);
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}

.voice-option input[type="radio"] {
  border-radius: 50%;
}

.field--checkbox input[type="checkbox"]:hover,
.checkbox-label input[type="checkbox"]:hover,
.voice-option input[type="radio"]:hover {
  border-color: var(--accent);
}

.field--checkbox input[type="checkbox"]:checked,
.checkbox-label input[type="checkbox"]:checked,
.voice-option input[type="radio"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.field--checkbox input[type="checkbox"]:checked::after,
.checkbox-label input[type="checkbox"]:checked::after {
  content: "";
  width: 5px;
  height: 9px;
  border: solid var(--paper-raised);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}

.voice-option input[type="radio"]:checked::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--paper-raised);
}

.voice-picker {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.voice-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  background: var(--input-tint);
}

.voice-option:hover {
  background: var(--input-accent-soft);
}

.voice-option-name {
  flex: 1;
}

.voice-preview-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--input-tint);
  color: var(--ink-soft);
}

.voice-preview-btn:hover,
.voice-preview-btn--playing {
  background: var(--accent);
  color: var(--paper-raised);
}

.voice-preview-btn svg {
  width: 12px;
  height: 12px;
}

