/* TikTok Slideshow Checker UI. Built on the site's docs shell and color tokens. */

.tool-section { margin-top: 48px; }
.privacy-note { margin-bottom: 28px; color: var(--muted); max-width: 68ch; }

.tool-controls { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.mode-picker { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.mode-button, .fit-button, .mini-button {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  transition: background-color 160ms ease, color 160ms ease, transform 120ms var(--ease-out);
}
.mode-button[aria-pressed="true"], .fit-button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.mode-button:active, .fit-button:active, .mini-button:active { transform: scale(0.97); }
.check-toggle { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 700; }
.check-toggle input { width: 18px; height: 18px; accent-color: var(--red); }

.dropzone {
  display: grid;
  gap: 8px;
  padding: 28px;
  border: 2px dashed var(--muted);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease;
}
.dropzone.is-dragging { border-color: var(--red); background: #efe4d7; }
.dropzone strong { font-size: var(--step-lead); line-height: 1.1; }
.dropzone span { color: var(--muted); max-width: 58ch; }
.dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.tool-status { min-height: 1.5em; margin-top: 10px; color: var(--muted); }
.tool-status.is-error { color: var(--red); }
.deck-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 28px; }
.button.secondary { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.button.secondary:hover { background: var(--ink); color: var(--bg); }

.copy-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.field { display: grid; gap: 7px; align-content: start; }
.field span { font-weight: 800; }
.field small { color: var(--muted); font-weight: 500; }
.field input, .field textarea, .field select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--ink);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
}
.field textarea { resize: vertical; }
.field.compact { max-width: 320px; }
.field output { float: right; color: var(--muted); font-weight: 500; }
input[type="range"] { width: 100%; accent-color: var(--red); }

.deck-toolbar { display: flex; justify-content: flex-end; margin-bottom: 14px; }
.slide-deck { display: grid; gap: 16px; }
.slide-card {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) auto;
  gap: 18px;
  padding: 14px;
  border: 1px solid var(--ink);
  background: var(--ui-card);
  color: var(--ui-text);
}
.slide-card.is-dragging { opacity: 0.55; }
.slide-card.is-drop-target { outline: 3px solid var(--red); outline-offset: -3px; }
.slide-drag { width: 12px; align-self: stretch; background: var(--muted); opacity: 0.45; }
.slide-thumb { position: relative; width: 180px; aspect-ratio: 9 / 16; background: #fff; border: 1px solid var(--ui-ground); overflow: hidden; }
.slide-thumb img, .thumb-fallback { width: 100%; height: 100%; object-fit: cover; }
.thumb-fallback { display: grid; place-items: center; padding: 12px; color: var(--ui-muted); text-align: center; font-size: var(--step-small); }
.cover-badge { position: absolute; left: 8px; top: 8px; padding: 4px 8px; background: var(--red); color: #fff; font-size: 12px; font-weight: 800; text-transform: uppercase; }
.slide-meta { display: grid; gap: 6px; align-content: start; min-width: 0; font-size: var(--step-small); }
.slide-meta strong { overflow-wrap: anywhere; font-size: var(--step-body); }
.slide-meta span { color: var(--ui-muted); }
.status-chip { justify-self: start; padding: 4px 10px; border-radius: 999px; font-weight: 800; font-size: 12px; }
.status-ready { background: #dff3df; color: #174d1f; }
.status-warning { background: #fff0c2; color: #6c4b00; }
.status-blocked { background: #ffd9dc; color: #8a1019; }
.issue-list { display: grid; gap: 5px; margin-top: 6px; }
.issue-list li, .deck-issues li { padding: 7px 9px; border-left: 4px solid var(--ui-muted); background: var(--ui-ground); }
.issue-list .issue-warning, .deck-issues .issue-warning { border-left-color: var(--mustard); }
.issue-list .issue-blocked, .deck-issues .issue-blocked { border-left-color: var(--red); }
.issue-clear { color: #1f8a4c; font-weight: 700; }
.more { color: var(--ui-muted); }
.slide-actions { display: flex; flex-wrap: wrap; gap: 8px; align-content: start; justify-content: flex-end; max-width: 260px; }
.mini-button { min-height: 38px; padding: 0 10px; font-size: var(--step-small); }
.mini-button.danger { border-color: var(--red); color: var(--red); }
.mini-button:disabled { opacity: 0.35; cursor: not-allowed; }
.tool-empty { padding: 28px; background: var(--ui-ground); color: var(--ui-muted); }

.deck-issues { margin-top: 18px; }
.deck-issues ul { display: grid; gap: 8px; }
.verdict {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-top: 22px;
  padding: 22px;
  border: 2px solid var(--ink);
  background: var(--surface);
}
.verdict strong { font-size: var(--step-head); line-height: 0.95; letter-spacing: -0.03em; }
.verdict p { margin-top: 6px; color: var(--muted); max-width: 62ch; }
.verdict-ready { border-color: #1f8a4c; }
.verdict-warning { border-color: var(--mustard); }
.verdict-blocked { border-color: var(--red); }
.verdict-empty { border-color: var(--muted); }

.export-panel { margin-top: 28px; padding: 22px; border: 1px solid var(--ink); background: var(--surface); }
.export-panel h3 { font-size: var(--step-lead); }
.export-panel > p { margin: 8px 0 18px; color: var(--muted); }
.export-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.fit-picker { display: inline-flex; gap: 8px; }
.export-note { margin-top: 14px; color: var(--muted); }
.export-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

.inspect-dialog { width: min(920px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 18px; border: 1px solid var(--ink); background: var(--bg); color: var(--ink); }
.inspect-dialog::backdrop { background: rgba(42, 17, 16, 0.55); }
.inspect-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.inspect-head h3 { font-size: var(--step-lead); }
#inspectImage { width: 100%; max-height: calc(100vh - 140px); object-fit: contain; background: #fff; }

.spec-table { width: 100%; border-collapse: collapse; background: var(--ui-card); color: var(--ui-text); }
.spec-table th, .spec-table td { padding: 12px 14px; border-bottom: 1px solid var(--ui-ground); text-align: left; vertical-align: top; }
.spec-table thead th { background: var(--ink); color: var(--bg); }
.spec-table tbody th { width: 24%; font-weight: 800; }
.table-wrap { overflow-x: auto; }
.docs-body .tool-section section, .docs-body section { scroll-margin-top: 24px; }
details { padding: 16px 0; }
details + details { margin-top: 12px; background: var(--ui-ground); padding: 16px; }
summary { cursor: pointer; font-weight: 800; font-size: var(--step-body); }
details p { margin-top: 10px; color: var(--muted); }

@media (max-width: 980px) {
  .copy-grid, .export-grid { grid-template-columns: 1fr; }
  .slide-card { grid-template-columns: 140px minmax(0, 1fr); }
  .slide-actions { grid-column: 1 / -1; justify-content: flex-start; max-width: none; }
}
@media (max-width: 620px) {
  .slide-card { grid-template-columns: 1fr; }
  .slide-drag { display: none; }
  .slide-thumb { width: min(220px, 100%); }
  .slide-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .verdict { align-items: flex-start; flex-direction: column; }
  .verdict strong { font-size: clamp(2.4rem, 14vw, 4rem); }
}
