/* history-import.css (F4 one-drop history import). Tokens only: css-hex-guard
   skips this tree and css-token-guard walks it, so every colour is a var().
   Shared by the summary card (.v2-hsc) and the bring-history drawer (.v2-hi,
   appended by the drawer task). */

.v2-hsc {
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 18px 20px;
  margin: 16px 0;
  background: var(--paper-soft);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.v2-hsc__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.v2-hsc__scope { font-size: 0.8rem; color: var(--ink-muted); }
.v2-hsc__title { margin: 0; font-size: 1.25rem; line-height: 1.25; color: var(--ink-strong); }
.v2-hsc__title--saved { font-size: 1.05rem; }
.v2-hsc__body, .v2-hsc__sub, .v2-hsc__hint, .v2-hsc__inbox { margin: 0; color: var(--ink-muted); font-size: 0.92rem; }
.v2-hsc__sub { color: var(--pace-amber); }
.v2-hsc__empty { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.v2-hsc__icon { width: 28px; height: 28px; color: var(--ink-muted); }
.v2-hsc__tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.v2-hsc__tile { padding: 10px 0; display: flex; flex-direction: column; gap: 2px; }
.v2-hsc__num { font-size: 1.4rem; font-weight: 700; color: var(--ink-strong); }
.v2-hsc__k { font-size: 0.78rem; color: var(--ink-muted); }
.v2-hsc__posting { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.v2-hsc__link { background: none; border: 0; padding: 0; color: var(--ink-strong); text-decoration: underline; cursor: pointer; font: inherit; }
.v2-hsc__actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.v2-hsc__undo { background: none; border: 0; padding: 0; color: var(--ink-muted); text-decoration: underline; cursor: pointer; font: inherit; font-size: 0.88rem; }
.v2-hsc__chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.v2-hsc__chip { border: 1px solid var(--hairline); border-radius: 999px; padding: 3px 10px; font-size: 0.8rem; color: var(--ink-strong); background: var(--paper); }
.v2-hsc__confidence { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 0.88rem; color: var(--ink-muted); }
.v2-hsc__conf-name { color: var(--ink-strong); font-weight: 600; }
@media (max-width: 767px) {
  .v2-hsc__tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* The bring-history drawer. */
.v2-hi { display: flex; flex-direction: column; gap: 16px; }
.v2-hi__sub, .v2-hi__fine, .v2-hi__nothing, .v2-hi__strip { margin: 0; color: var(--ink-muted); font-size: 0.9rem; }
.v2-hi__doors { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.v2-hi__door { border: 1px solid var(--hairline); border-radius: 12px; padding: 14px; background: var(--paper-soft); display: flex; flex-direction: column; gap: 10px; }
.v2-hi__door-title { margin: 0; font-size: 1rem; color: var(--ink-strong); }
.v2-hi__drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 12px; border: 2px dashed var(--hairline-strong); border-radius: 12px; cursor: pointer; text-align: center; color: var(--ink-muted); }
.v2-hi__drop.is-over { border-color: var(--ink-strong); background: var(--paper); }
.v2-hi__drop-icon { width: 26px; height: 26px; }
.v2-hi__formats { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.v2-hi__format { font-size: 0.8rem; border: 1px solid var(--hairline); border-radius: 999px; padding: 2px 10px; color: var(--ink); }
.v2-hi__beta { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--pace-amber); margin-left: 4px; }
.v2-hi__how summary { cursor: pointer; color: var(--ink-strong); font-size: 0.9rem; }
.v2-hi__how dl { margin: 8px 0 0; font-size: 0.85rem; }
.v2-hi__how dt { font-weight: 600; color: var(--ink-strong); margin-top: 6px; }
.v2-hi__how dd { margin: 0; color: var(--ink-muted); }
.v2-hi__addr { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.v2-hi__addr-code { font-size: 0.85rem; padding: 6px 10px; border: 1px solid var(--hairline); border-radius: 8px; background: var(--paper); word-break: break-all; }
.v2-hi__copy { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--hairline); border-radius: 8px; padding: 6px 10px; background: var(--paper); cursor: pointer; font: inherit; color: var(--ink-strong); }
.v2-hi__copy-ico { width: 16px; height: 16px; }
.v2-hi__tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.v2-hi__steps { margin: 0; padding-left: 20px; font-size: 0.88rem; color: var(--ink); display: flex; flex-direction: column; gap: 4px; }
.v2-hi__link { background: none; border: 0; padding: 0; color: var(--ink-strong); text-decoration: underline; cursor: pointer; font: inherit; }
.v2-hi__busy, .v2-hi__error { border: 1px solid var(--pace-amber); border-radius: 10px; padding: 10px 12px; color: var(--ink-strong); background: var(--paper); margin: 0; }
.v2-hi__actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.v2-hi__preview { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--hairline); padding-top: 14px; }
.v2-hi__tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.v2-hi__tile { padding: 8px 10px; display: flex; flex-direction: column; }
.v2-hi__tile b { font-size: 1.25rem; color: var(--ink-strong); }
.v2-hi__tile span { font-size: 0.75rem; color: var(--ink-muted); }
.v2-hi__rowlist summary { cursor: pointer; font-size: 0.9rem; color: var(--ink-strong); }
.v2-hi__rows { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; max-height: 320px; overflow: auto; }
.v2-hi__row { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; font-size: 0.85rem; padding: 6px 8px; border: 1px solid var(--hairline); border-radius: 8px; background: var(--paper); }
.v2-hi__row.is-dup { opacity: 0.6; }
.v2-hi__row-warn { font-size: 0.75rem; color: var(--pace-amber); }
.v2-hi__row select { font: inherit; font-size: 0.8rem; }
.v2-hi__programmes, .v2-hi__credit, .v2-hi__confidence { display: flex; flex-direction: column; gap: 8px; font-size: 0.9rem; }
.v2-hi__toggle { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--hairline); }
.v2-hi__toggle select { font: inherit; font-size: 0.85rem; }
.v2-hi__conf { display: flex; flex-direction: column; gap: 4px; padding: 8px 0; border-bottom: 1px solid var(--hairline); }
.v2-hi__conf-level { font-weight: 600; color: var(--ink-strong); }
.v2-hi__conf-level[data-level="low"] { color: var(--pace-ruby); }
.v2-hi__conf-level[data-level="medium"] { color: var(--pace-amber); }
.v2-hi__conf-level[data-level="high"] { color: var(--pace-on-track); }
.v2-hi__conf input { font: inherit; padding: 6px 8px; border: 1px solid var(--hairline); border-radius: 8px; max-width: 180px; }
.v2-hi__foot { display: flex; justify-content: flex-end; gap: 10px; }
.v2-hi__unreadable summary { cursor: pointer; font-size: 0.88rem; color: var(--ink-strong); }
.v2-hi__unreadable ol { margin: 6px 0 0; padding-left: 20px; font-size: 0.8rem; color: var(--ink-muted); max-height: 160px; overflow: auto; word-break: break-all; }
@media (max-width: 767px) {
  .v2-hi__doors { grid-template-columns: 1fr; }
  .v2-hi__door--b { order: -1; }
  .v2-hi__tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v2-hi__foot { position: sticky; bottom: 0; background: var(--paper); padding-top: 8px; }
}

.v2-hi [hidden], .v2-hi__foot[hidden] { display: none; }
.v2-hi__drop:focus-visible { outline: 2px solid var(--ink-strong); outline-offset: 3px; }
.v2-hi__row select { min-width: 0; max-width: 100%; }
