.youtube-info-tool {
  color-scheme: light dark;
  --bg: var(--tt-bg, #f4f7f7);
  --surface: var(--tt-surface, #fbfdfc);
  --ink: var(--tt-ink, #172122);
  --muted: var(--tt-muted, #627072);
  --line: var(--tt-line, #d6dfe0);
  --line-soft: color-mix(in srgb, var(--line) 55%, transparent);
  --accent: var(--tt-accent, #126b68);
  --accent-ink: #f6fffe;
  --warn: #b42318;
  --panel: color-mix(in srgb, var(--surface) 86%, var(--bg));
  --control: var(--surface);
  font-family:
    "Pretendard Variable",
    Pretendard,
    "Apple SD Gothic Neo",
    "Noto Sans KR",
    sans-serif;
  container-type: inline-size;
}

.youtube-info-tool,
.youtube-info-tool * {
  box-sizing: border-box;
}

.youtube-info-tool {
  margin: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
}

.youtube-info-tool button,
.youtube-info-tool input,
.youtube-info-tool select {
  font: inherit;
}

.youtube-info-tool a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.youtube-info-tool .shell {
  width: 100%;
  margin: 0;
  padding: 0 0 32px;
}

.youtube-info-tool h2,
.youtube-info-tool h3,
.youtube-info-tool p {
  margin-top: 0;
}

.youtube-info-tool h2 {
  margin-bottom: 12px;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
}

.youtube-info-tool h3 {
  margin: 20px 0 8px;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
}

.youtube-info-tool .inspect-form,
.youtube-info-tool .panel {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.youtube-info-tool .inspect-form {
  padding: 16px;
}

.youtube-info-tool .inspect-form label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.youtube-info-tool .input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.youtube-info-tool input,
.youtube-info-tool select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--control);
  color: var(--ink);
  padding: 0 12px;
}

.youtube-info-tool select {
  padding-right: 36px;
}

.youtube-info-tool input:focus,
.youtube-info-tool select:focus,
.youtube-info-tool button:focus-visible,
.youtube-info-tool a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent);
  outline-offset: 2px;
}

.youtube-info-tool button,
.youtube-info-tool .button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0 12px;
  font-size: 0.925rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.youtube-info-tool button.secondary,
.youtube-info-tool .button.secondary {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
  font-weight: 500;
}

.youtube-info-tool button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.youtube-info-tool .status {
  min-height: 24px;
  margin: 10px 0;
  color: var(--muted);
  font-size: 0.925rem;
}

.youtube-info-tool .status.error {
  color: var(--warn);
}

.youtube-info-tool .result {
  display: grid;
  gap: 12px;
}

.youtube-info-tool .panel {
  padding: 16px;
}

.youtube-info-tool .description {
  max-width: 74ch;
  color: var(--muted);
  line-height: 1.6;
}

.youtube-info-tool .action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.youtube-info-tool .action-row.compact {
  margin-top: 0;
}

.youtube-info-tool .meta-grid {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  border-top: 1px solid var(--line-soft);
}

.youtube-info-tool .meta-grid dt,
.youtube-info-tool .meta-grid dd {
  margin: 0;
  border-bottom: 1px solid var(--line-soft);
  padding: 8px 0;
}

.youtube-info-tool .meta-grid dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.youtube-info-tool .meta-grid dd {
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.youtube-info-tool .thumb-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.youtube-info-tool .thumb-item {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  padding: 10px;
}

.youtube-info-tool .thumb-item img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 4px;
  background: var(--panel);
  object-fit: contain;
}

.youtube-info-tool .small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.youtube-info-tool .caption-controls {
  display: grid;
  grid-template-columns: minmax(120px, 0.35fr) minmax(180px, 1fr) minmax(90px, 0.25fr) minmax(180px, 1fr);
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  padding: 10px;
}

.youtube-info-tool .caption-controls label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.youtube-info-tool .transcript-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
}

.youtube-info-tool .transcript-head h3 {
  margin: 0;
}

.youtube-info-tool .transcript {
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--control);
  padding: 12px;
  font-family:
    ui-monospace,
    SFMono-Regular,
    Consolas,
    "Liberation Mono",
    monospace;
  font-size: 0.9rem;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  white-space: pre-wrap;
}

.youtube-info-tool .empty {
  border: 1px dashed var(--line);
  border-radius: 6px;
  color: var(--muted);
  padding: 14px;
}

@container (max-width: 720px) {
  .youtube-info-tool .shell {
    width: 100%;
    padding-bottom: 20px;
  }

  .youtube-info-tool .input-row,
.youtube-info-tool .meta-grid,
.youtube-info-tool .caption-controls {
    grid-template-columns: 1fr;
  }

  .youtube-info-tool .meta-grid dt {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .youtube-info-tool .meta-grid dd {
    padding-top: 4px;
  }
}
