/* Tool-specific styles only. Shared chrome: ../assets/css/tool-chrome.css */

/* ================= your content starts here ================== */

.vd-dock {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--paper-raised);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.vd-media { width: 100%; height: 100%; border: 0; display: block; background: #000; }
.vd-media[hidden] { display: none; }
.vd-thumb { object-fit: cover; }

.vd-empty {
  margin: 0;
  padding: 1rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink-faint);
}

.vd-preview-note {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.tool-section { margin: 0 0 1.25rem; padding: 0; border: 0; min-width: 0; background: transparent; }
.tool-section legend {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 0 0 0.6rem;
}
.tool-section[disabled] { opacity: 0.45; }

#tool-form .search-input { max-width: none; }

.vd-row { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; margin-bottom: 0.85rem; }
.vd-row .field { flex: 1 1 10rem; margin-bottom: 0; }

.vd-choice {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.92rem;
  min-height: var(--ctrl-h);
  cursor: pointer;
}

.vd-meta { margin: 0 0 0.85rem; font-size: 0.88rem; line-height: 1.45; }
.vd-meta strong { display: block; font-family: var(--font-serif); font-size: 1.05rem; }
.vd-meta span { color: var(--ink-soft); font-family: var(--font-mono); font-size: 0.78rem; }

.vd-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.85rem; align-items: center; }

.vd-btn {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  min-height: var(--ctrl-h);
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.vd-btn--primary { background: var(--ink); color: var(--paper); }
.vd-btn:hover { opacity: 0.88; }
.vd-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.vd-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.vd-btn[hidden] { display: none; }

.vd-status { margin: 0.6rem 0 0; min-height: 1.2em; font-size: 0.85rem; color: var(--ink-soft); }
.vd-status--error { color: var(--accent); }
.vd-status--server {
  margin: 0 0 1.25rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--ink);
  line-height: 1.5;
}
.vd-status--server code { font-family: var(--font-mono); font-size: 0.8rem; }

#vd-progress { width: 100%; height: 0.5rem; margin-top: 0.75rem; accent-color: var(--accent); }
#vd-progress[hidden] { display: none; }

/* ---------- Layout fixes ---------- */
/* Chrome uses margin-inline -1.5rem; the page padding drops to 1rem below 550px. */
@media (max-width: 549px) {
  .vd-layout .preview-sticky { margin-inline: -1rem; padding-inline: 1rem; }
}
/* Mobile: the preview dock sits above the form, so hide it until there is something to show. */
@media (max-width: 1023px) {
  .vd-layout:not(.vd-has-preview) .preview-sticky { display: none; }
}

/* ---------- URL field with history ---------- */
.vd-url-wrap { position: relative; }
#tool-form .vd-url-input { padding-right: calc(2 * var(--ctrl-h) + 0.6rem); }

.vd-url-btn {
  position: absolute;
  top: 50%;
  right: 0.3rem;
  transform: translateY(-50%);
  width: var(--ctrl-h);
  height: var(--ctrl-h);
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
}
.vd-paste-btn { right: calc(var(--ctrl-h) + 0.4rem); }
.vd-url-btn:hover { color: var(--ink); background: var(--accent-soft); }
.vd-url-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.vd-history-toggle svg { transition: transform 0.15s ease; }
.vd-history-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

.vd-history {
  position: absolute;
  z-index: 40;
  top: calc(100% + 0.25rem);
  left: 0;
  right: 0;
  background: var(--paper-raised);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
  overflow: hidden;
}
.vd-history[hidden] { display: none; }

.vd-history__list {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0;
  max-height: min(18rem, 50vh);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.vd-history__list:focus { outline: none; }
.vd-history__list:empty { display: none; }

.vd-history__item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  min-width: 0;
}
.vd-history__item:hover,
.vd-history__item[aria-selected="true"] { background: var(--accent-soft); }
.vd-history__item:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.vd-history__title {
  font-size: 0.88rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vd-history__url {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vd-history__empty {
  margin: 0;
  padding: 0.65rem 0.75rem;
  font-size: 0.85rem;
  color: var(--ink-faint);
}
.vd-history__empty[hidden] { display: none; }

.vd-history__clear {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 0;
  border-top: 1px solid var(--rule);
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: left;
  color: var(--ink-soft);
  cursor: pointer;
}
.vd-history__clear:hover { color: var(--accent); }
.vd-history__clear:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.vd-history__clear[hidden] { display: none; }

/* ---------- Compatibility option ---------- */
.vd-compat { margin: 0 0 0.85rem; }
.vd-compat[hidden] { display: none; }
.vd-hint { margin: 0.2rem 0 0 1.6rem; font-size: 0.8rem; line-height: 1.45; color: var(--ink-soft); }

/* ---------- Save: main button, result ---------- */
.vd-btn--main { min-width: 12rem; justify-content: center; font-variant-numeric: tabular-nums; }
.vd-btn--done,
.vd-btn--done:disabled { opacity: 1; cursor: default; background: transparent; color: var(--ink); border-color: var(--rule-strong); }
.vd-btn--busy:disabled { opacity: 1; cursor: progress; }

.vd-result { margin-top: 0.75rem; font-size: 0.85rem; }
.vd-result[hidden] { display: none; }
.vd-result__list { margin: 0 0 0.5rem; display: grid; gap: 0.2rem; }
.vd-result__list div { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 0.5rem; }
.vd-result__list dt {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  padding-top: 0.15rem;
}
.vd-result__list dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }

.vd-save-link {
  font-size: 0.82rem;
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
.vd-save-link:hover { color: var(--accent); }
.vd-save-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .vd-history-toggle svg { transition: none; }
}

/* Platform badge in the analysis summary */
.vd-badge {
  display: inline-block;
  margin: 0 0.5rem 0.2rem 0;
  padding: 0.05rem 0.55rem;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  background: var(--paper-raised);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  vertical-align: 0.1em;
}
.vd-row[hidden] { display: none; }

/* Tagline wraps on narrow screens instead of ending in an ellipsis */
@media (max-width: 640px) {
  .masthead-sub--tagline {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
}
