/* =========================================================================
   watch.vondl.com — only what is specific to this app. Everything generic
   (layout, panels, forms, chips, tables…) comes from the VONDL design system.
   Tokens only (var(--v-…)); classes are vw- or pk-prefixed.
   ========================================================================= */

/* ---- Watch cards (dashboard) --------------------------------------------- */
.vw-card { display: flex; flex-direction: column; height: 100%; padding: var(--v-space-4) var(--v-space-5); }
.vw-card-title { font-family: var(--v-font-heading); font-weight: 700; font-size: var(--v-text-lg); line-height: 1.25; color: var(--v-heading); }
.vw-card-title a { color: inherit; text-decoration: none; }
.vw-card-title a:hover { text-decoration: underline; }
.vw-price { font-family: var(--v-font-heading); font-size: var(--v-text-3xl); font-weight: 700; color: var(--v-heading); font-variant-numeric: tabular-nums; line-height: 1.1; }
.vw-card-foot { margin-top: auto; padding-top: var(--v-space-3); display: flex; align-items: center; gap: var(--v-space-2); font-size: var(--v-text-sm); color: var(--v-text-2); }
.vw-card-error { font-size: var(--v-text-sm); color: var(--v-crit); margin-top: var(--v-space-2); }

.vw-items { list-style: none; padding: 0; margin: var(--v-space-2) 0 0; font-size: var(--v-text-sm); }
.vw-items li { display: flex; gap: var(--v-space-2); align-items: center; padding: 5px 0; border-top: 1px dashed var(--v-border); }
.vw-items li:first-child { border-top: 0; }
.vw-items .vw-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vw-items .vw-p { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--v-heading); font-weight: 600; }

/* ---- Alerts ---------------------------------------------------------------- */
.vw-alert { padding: var(--v-space-4) var(--v-space-5); border-top: 1px solid var(--v-border); }
.vw-alert:first-child { border-top: 0; }
.vw-alert.vw-unread { box-shadow: inset 3px 0 0 var(--v-coral-400); background: var(--v-accent-tint); }

/* ---- Text diff --------------------------------------------------------------- */
.vw-del { color: var(--v-crit); text-decoration: line-through; }
.vw-ins { color: var(--v-good); font-weight: 600; }

/* ---- Account area layout ------------------------------------------------------ */
.vw-manage { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: var(--v-space-4); align-items: start; }
@media (max-width: 860px) { .vw-manage { grid-template-columns: minmax(0, 1fr); } }

/* ---- Price chart ---------------------------------------------------------------- */
.price-chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.price-chart .grid line { stroke: var(--v-grid); stroke-width: 1; }
.price-chart .axis text { fill: var(--v-text-2); font-size: 11px; font-variant-numeric: tabular-nums; font-family: var(--v-font-body); }
.price-chart .line { fill: none; stroke: var(--v-series-1); stroke-width: 2; stroke-linejoin: round; }
.price-chart .band { fill: var(--v-band); }
.price-chart .band-label { fill: var(--v-text-2); font-size: 10px; }
.price-chart .pt .hit { fill: transparent; }
.price-chart .pt .cross { stroke: var(--v-text-3); stroke-width: 1; visibility: hidden; }
.price-chart .pt .mark { fill: var(--v-series-1); stroke: var(--v-surface); stroke-width: 2; visibility: hidden; }
.price-chart .pt .tip { visibility: hidden; }
.price-chart .pt .tip rect { fill: var(--v-surface); stroke: var(--v-border-strong); }
.price-chart .pt .tip text { fill: var(--v-heading); font-size: 12px; }
.price-chart .pt .tip .sub { fill: var(--v-text-2); font-size: 11px; }
.price-chart .pt:hover .cross, .price-chart .pt:hover .mark, .price-chart .pt:hover .tip { visibility: visible; }
.price-chart .last { fill: var(--v-series-1); stroke: var(--v-surface); stroke-width: 2; }
.price-chart .last-label { fill: var(--v-heading); font-size: 12px; font-weight: 600; }

/* ---- Element picker ---------------------------------------------------------------- */
.pk-root { position: relative; max-height: 70vh; overflow: auto; border: 1px solid var(--v-border); border-radius: var(--v-radius-md); background: var(--v-white); }
.pk-root img { display: block; width: 100%; height: auto; cursor: crosshair; user-select: none; }
.pk-hover, .pk-sel { position: absolute; pointer-events: none; display: none; border-radius: 3px; }
.pk-hover { outline: 2px solid var(--v-orange-400); background: color-mix(in srgb, var(--v-orange-400) 18%, transparent); }
.pk-sel { outline: 2px solid var(--v-coral-600); background: color-mix(in srgb, var(--v-coral-400) 20%, transparent); }
.pk-sel span { position: absolute; top: -10px; left: -10px; background: var(--v-gradient); color: var(--v-on-brand); font-size: 11px; font-weight: 700;
               border-radius: var(--v-radius-full); min-width: 18px; height: 18px; line-height: 18px; text-align: center; padding: 0 4px; }
.pk-tip { position: absolute; display: none; pointer-events: none; z-index: 5; max-width: 250px; background: var(--v-navy-900); color: var(--v-white);
          font-size: 12px; padding: 4px 8px; border-radius: var(--v-radius-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pk-n { flex: none; width: 20px; height: 20px; border-radius: var(--v-radius-full); background: var(--v-gradient); color: var(--v-on-brand); font-size: 11px; font-weight: 700; text-align: center; line-height: 20px; }
.pk-list code { font-size: 11px; }
.pk-shot { display: block; max-width: 100%; border: 1px solid var(--v-border); border-radius: var(--v-radius-sm); }

/* Identity manage pages: their scaffolded Save buttons are full width; in the side-by-side layout a normal size reads better. */
.vw-manage .btn.w-100 { width: auto; }
.vw-card-body { margin-top: var(--v-space-3); }
.pk-root:focus-visible { box-shadow: var(--v-focus); }
.vw-swatch { height: 48px; border-radius: var(--v-radius-sm); }

/* ---- Find (product lookup) ------------------------------------------------------ */
.vw-find { display: flex; gap: var(--v-space-3); align-items: flex-end; flex-wrap: wrap; }
.vw-find-box { flex: 1 1 320px; min-width: 0; }
.vw-find-box .v-input { font-size: var(--v-text-lg); padding-block: var(--v-space-3); }
.vw-find-actions { display: flex; gap: var(--v-space-2); flex-wrap: wrap; }
.vw-find-actions label.v-btn { cursor: pointer; }
.vw-find-actions label.v-btn:focus-within { box-shadow: var(--v-focus); }

.vw-product { display: flex; gap: var(--v-space-5); align-items: flex-start; }
.vw-product-img { width: 132px; height: 132px; object-fit: contain; flex: none; border-radius: var(--v-radius-md); background: var(--v-white); border: 1px solid var(--v-border); }
.vw-product-title { font-family: var(--v-font-heading); font-size: var(--v-text-xl); line-height: 1.25; margin: 0 0 var(--v-space-2); color: var(--v-heading); }
.vw-best { display: flex; align-items: baseline; gap: var(--v-space-3); flex-wrap: wrap; margin-top: var(--v-space-3); }
.vw-product-actions { margin-top: var(--v-space-4); }
@media (max-width: 560px) { .vw-product { flex-direction: column; } .vw-product-img { width: 100%; height: 180px; } }

.vw-sources { display: flex; flex-wrap: wrap; gap: var(--v-space-2); margin-bottom: var(--v-space-4); }
.vw-chip-spin { width: 10px; height: 10px; border-width: 2px; margin-right: 4px; vertical-align: -1px; }

.vw-offers { list-style: none; margin: 0; padding: 0; }
.vw-offer { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto auto; gap: var(--v-space-4); align-items: center;
            padding: var(--v-space-3) var(--v-space-5); border-top: 1px solid var(--v-border); }
.vw-offer:first-child { border-top: 0; }
.vw-offer-best { box-shadow: inset 3px 0 0 var(--v-coral-400); background: var(--v-accent-tint); }
.vw-offer-img { width: 56px; height: 56px; object-fit: contain; border-radius: var(--v-radius-sm); background: var(--v-white); border: 1px solid var(--v-border); }
.vw-offer-shop { font-weight: 700; color: var(--v-heading); display: flex; gap: var(--v-space-2); align-items: center; flex-wrap: wrap; }
.vw-offer-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vw-offer-price { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.vw-offer-price .vw-p { font-family: var(--v-font-heading); font-size: var(--v-text-lg); font-weight: 700; color: var(--v-heading); font-variant-numeric: tabular-nums; }
.vw-offer-actions { display: flex; gap: var(--v-space-2); }
@media (max-width: 720px) {
    .vw-offer { grid-template-columns: 48px minmax(0, 1fr) auto; padding: var(--v-space-3) var(--v-space-4); }
    .vw-offer-img { width: 48px; height: 48px; }
    .vw-offer-actions { grid-column: 2 / -1; }
}

.vw-recent { display: flex; gap: var(--v-space-3); align-items: center; padding: var(--v-space-3) var(--v-space-4); color: inherit; text-decoration: none; }
.vw-recent img, .vw-recent-ph { width: 48px; height: 48px; object-fit: contain; flex: none; border-radius: var(--v-radius-sm); background: var(--v-white); border: 1px solid var(--v-border); }
.vw-recent-ph { display: inline-flex; align-items: center; justify-content: center; color: var(--v-text-3); background: var(--v-surface-2); }
.vw-recent-title { display: block; font-weight: 600; color: var(--v-heading); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vw-recent .v-grow { min-width: 0; }
.vw-alts { list-style: none; margin: 0; padding: 0; }
.vw-alts li { display: flex; gap: var(--v-space-3); justify-content: space-between; padding: 4px 0; border-top: 1px dashed var(--v-border); }
.vw-alts li:first-child { border-top: 0; }

/* ---- Watch editor ---------------------------------------------------------------- */
.vw-presets { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--v-space-2); }
.vw-preset { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: var(--v-space-3) var(--v-space-4); cursor: pointer;
             border: 1px solid var(--v-border-strong); border-radius: var(--v-radius-md); background: var(--v-surface); color: var(--v-text); font: inherit; }
.vw-preset:hover { border-color: var(--v-coral-400); }
.vw-preset:focus-visible { box-shadow: var(--v-focus); outline: none; }
.vw-preset-on { border-color: var(--v-coral-600); box-shadow: inset 0 0 0 1px var(--v-coral-600); background: var(--v-accent-tint); }
.vw-preset-label { font-weight: 700; color: var(--v-heading); }
.vw-summary { margin: 0; font-size: var(--v-text-lg); color: var(--v-heading); }
.vw-dim td { opacity: .5; }
.vw-warn-text { color: var(--v-warn); font-weight: 600; }
/* The element picker needs a mouse (hover to see what you pick): hidden on phones and tablets. */
@media (hover: none) { .vw-hover-only { display: none; } }
.vw-counts { margin-bottom: var(--v-space-4); }
.vw-more { display: grid; gap: var(--v-space-2); }

/* ---- Two-factor onboarding ----------------------------------------------------------- */
.vw-onboard { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--v-space-3); margin: var(--v-space-4) 0; }
.vw-onboard-choice { display: flex; flex-direction: column; gap: var(--v-space-2); padding: var(--v-space-4); border: 1px solid var(--v-border-strong);
                     border-radius: var(--v-radius-md); color: var(--v-text); text-decoration: none; background: var(--v-surface); }
.vw-onboard-choice strong { color: var(--v-heading); }
.vw-onboard-choice .btn { align-self: flex-start; margin-top: auto; }
.vw-onboard-choice:hover { border-color: var(--v-coral-400); }
.vw-onboard-main { border-color: var(--v-coral-600); background: var(--v-accent-tint); }

/* ---- Live barcode scan (camera) ---------------------------------------------------------- */
.vw-scan { position: fixed; inset: 0; z-index: 100; background: var(--v-navy-900); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--v-space-4); }
.vw-scan video { width: 100%; max-width: 640px; max-height: 70vh; object-fit: cover; }
.vw-scan-frame { position: absolute; width: min(80vw, 420px); height: 140px; border: 3px solid var(--v-orange-400); border-radius: var(--v-radius-md); pointer-events: none; }
.vw-scan-hint { color: var(--v-white); margin: 0; }

/* ---- Find: results head, history, welcome ---------------------------------------------------- */
.vw-results-head { display: flex; align-items: center; gap: var(--v-space-3); flex-wrap: wrap; margin-bottom: var(--v-space-3); }
.vw-history { display: flex; align-items: center; gap: var(--v-space-3); flex-wrap: wrap; margin-top: var(--v-space-2); }
.vw-deal-hint { margin: var(--v-space-2) 0 0; }
.vw-welcome { margin: 0; padding-left: 1.2em; display: grid; gap: var(--v-space-2); }
.vw-bookmarklet { margin-top: var(--v-space-6); }
.vw-bookmarklet a { font-weight: 600; }
@media (hover: none) { .vw-bookmarklet { display: none; } }
