/* Vestyn web app — component styles built strictly on design/tokens.css */

.hd {
  font: var(--text-base);
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--bg);
  font-feature-settings: "tnum";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.hd *, .hd *::before, .hd *::after { box-sizing: border-box; }
.hd ::placeholder { color: var(--ink-faint); }

.hd-mono { font-family: var(--font-mono); }
.hd-display { font-family: var(--font-display); font-optical-sizing: auto; }

/* per-character-class password coloring */
.pc-l { color: var(--ink); }
.pc-d { color: var(--accent); }
.pc-s { color: var(--ok); }

/* ── Buttons ─────────────────────────────────────────────── */
.hd-btn {
  box-sizing: border-box;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--control-height); padding: 0 14px;
  border-radius: var(--radius-control);
  font: 500 14px/20px var(--font-ui);
  border: 1px solid transparent; cursor: pointer;
  transition: background var(--duration-state) var(--ease), border-color var(--duration-state) var(--ease), color var(--duration-state) var(--ease);
  white-space: nowrap;
}
.hd-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.hd-btn-sm { height: var(--control-height-small); padding: 0 10px; font-size: 13px; }
.hd-btn-primary { background: var(--accent); color: var(--on-accent); }
.hd-btn-primary:hover { background: var(--accent-hover); }
.hd-btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.hd-btn-secondary:hover { background: var(--surface-sunken); }
.hd-btn-ghost { background: transparent; color: var(--ink-muted); }
.hd-btn-ghost:hover { background: var(--surface-sunken); color: var(--ink); }
.hd-btn-danger { background: transparent; color: var(--danger); border-color: var(--line); }
.hd-btn-danger:hover { border-color: var(--danger); }
.hd-btn-block { width: 100%; }

.hd-iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: var(--radius-control);
  border: none; background: transparent; color: var(--ink-muted); cursor: pointer;
  transition: background var(--duration-state) var(--ease), color var(--duration-state) var(--ease);
}
.hd-iconbtn:hover { background: var(--surface-sunken); color: var(--ink); }
.hd-iconbtn:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* ── Inputs ──────────────────────────────────────────────── */
.hd-field { display: flex; flex-direction: column; gap: 6px; }
.hd-label { font: 500 12px/16px var(--font-ui); color: var(--ink-muted); letter-spacing: 0.01em; }
.hd-input {
  box-sizing: border-box;
  height: var(--control-height); width: 100%;
  padding: 0 12px;
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  font: 14px/20px var(--font-ui);
  color: var(--ink);
  transition: box-shadow var(--duration-state) var(--ease), border-color var(--duration-state) var(--ease);
}
.hd-input:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.hd-input.hd-mono { font: 14px/20px var(--font-mono); }
.hd-input-wrap { position: relative; display: flex; align-items: center; }
.hd-input-wrap .hd-input { padding-right: 64px; }
.hd-input-actions { position: absolute; right: 4px; display: flex; gap: 0; }
.hd-error { font: 13px/18px var(--font-ui); color: var(--danger); }
.hd-hint { font: 13px/18px var(--font-ui); color: var(--ink-muted); }

/* ── Strength meter ──────────────────────────────────────── */
.hd-strength { display: flex; flex-direction: column; gap: 6px; }
.hd-strength-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.hd-strength-seg { height: 4px; border-radius: 2px; background: var(--line); transition: background var(--duration-state) var(--ease); }
.hd-strength-label { font: 12px/16px var(--font-ui); color: var(--ink-muted); display: flex; align-items: center; gap: 5px; }

/* ── Tags / badges ───────────────────────────────────────── */
.hd-tag {
  display: inline-flex; align-items: center; gap: 4px;
  height: 20px; padding: 0 7px;
  border-radius: var(--radius-control);
  background: var(--surface-sunken); color: var(--ink-muted);
  font: 500 12px/16px var(--font-ui);
}
.hd-tag-ok { color: var(--ok); background: transparent; border: 1px solid var(--line); }
.hd-tag-warn { color: var(--warn); background: transparent; border: 1px solid var(--line); }

/* ── App frame ───────────────────────────────────────────── */
.hd-frame { display: grid; grid-template-columns: var(--pane-sidebar) var(--pane-list) 1fr; grid-template-rows: minmax(0, 1fr); height: 100%; background: var(--bg); }

/* Sidebar */
.hd-sidebar { display: flex; flex-direction: column; padding: 16px 12px; gap: 4px; border-right: 1px solid var(--line); }
.hd-wordmark { font: 600 20px/28px var(--font-display); color: var(--ink); padding: 4px 10px 14px; letter-spacing: 0.01em; }
.hd-navsection { font: 500 12px/16px var(--font-ui); color: var(--ink-faint); padding: 14px 10px 6px; letter-spacing: 0.04em; text-transform: uppercase; }
.hd-navrow {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  height: 32px; padding: 0 10px; border-radius: var(--radius-control);
  color: var(--ink-muted); font: 14px/20px var(--font-ui);
  cursor: pointer; border: none; background: transparent; width: 100%; text-align: left;
  transition: background var(--duration-state) var(--ease), color var(--duration-state) var(--ease);
}
.hd-navrow:hover { background: var(--surface-sunken); color: var(--ink); }
.hd-navrow.active { background: var(--surface); color: var(--ink); font-weight: 500; }
.hd-navrow.active::before {
  content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 2px;
  background: var(--accent); border-radius: 1px;
}
.hd-navrow .count { margin-left: auto; font: 12px/16px var(--font-ui); color: var(--ink-faint); }
.hd-vaultdot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.hd-account {
  margin-top: auto; display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-top: 1px solid var(--line);
}
.hd-avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  background: var(--surface-sunken); color: var(--ink-muted);
  display: flex; align-items: center; justify-content: center;
  font: 500 11px/16px var(--font-ui);
}

/* List pane */
.hd-list { display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--line); min-width: 0; min-height: 0; }
.hd-listhead { padding: 12px 12px 0; display: flex; flex-direction: column; gap: 10px; }
.hd-search { position: relative; display: flex; align-items: center; }
.hd-search .hd-input { padding-left: 34px; padding-right: 34px; }
.hd-search-icon { position: absolute; left: 10px; color: var(--ink-faint); display: flex; }
.hd-kbd {
  position: absolute; right: 8px;
  font: 11px/14px var(--font-mono); color: var(--ink-faint);
  border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px;
  background: var(--surface);
}
.hd-chips { display: flex; gap: 6px; padding-bottom: 10px; }
.hd-chip {
  height: 24px; padding: 0 10px; border-radius: 12px;
  border: 1px solid var(--line); background: transparent;
  font: 500 12px/16px var(--font-ui); color: var(--ink-muted); cursor: pointer;
  display: inline-flex; align-items: center;
  transition: background var(--duration-state) var(--ease);
}
.hd-chip:hover { background: var(--surface-sunken); }
.hd-chip.active { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.hd-rows { flex: 1; min-height: 0; overflow-y: auto; border-top: 1px solid var(--line); }
.hd-row {
  display: flex; align-items: center; gap: 12px;
  height: 56px; padding: 0 12px; width: 100%; border: none; background: transparent;
  cursor: pointer; text-align: left;
  transition: background var(--duration-state) var(--ease);
}
.hd-row:hover { background: var(--surface-sunken); }
.hd-row:hover .hd-row-quick { opacity: 1; }
.hd-row.selected { background: var(--surface-sunken); }
.hd-row-text { min-width: 0; flex: 1; }
.hd-row-name { font: 500 14px/20px var(--font-ui); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-row-sub { font: 12px/16px var(--font-mono); color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-row-quick { opacity: 0; transition: opacity var(--duration-state) var(--ease); display: flex; }
.hd-tile {
  width: 32px; height: 32px; border-radius: 8px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font: 600 13px/16px var(--font-ui);
  background: var(--surface-sunken); color: var(--ink-muted);
}
.hd-tile-icon { background: var(--surface-sunken); color: var(--ink-muted); }

/* Detail pane */
.hd-detail { background: var(--surface); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.hd-detail-head {
  display: flex; align-items: center; gap: 14px;
  padding: 20px 28px 16px; border-bottom: 1px solid var(--line);
}
.hd-detail-title { font: 500 20px/28px var(--font-ui); color: var(--ink); }
.hd-detail-body { padding: 8px 28px 20px; max-width: 640px; }
.hd-fieldrow { padding: 14px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.hd-fieldrow:last-child { border-bottom: none; }
.hd-fieldrow-line { display: flex; align-items: center; gap: 8px; min-height: 28px; }
.hd-fieldrow-value { font: 14px/20px var(--font-ui); color: var(--ink); min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd-fieldrow-value.hd-mono { font: 14px/20px var(--font-mono); letter-spacing: 0.02em; }
.hd-fieldrow-actions { display: flex; gap: 2px; }
.hd-url { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.hd-url:hover { border-bottom-color: var(--ink-muted); }
.hd-meta { font: 12px/16px var(--font-ui); color: var(--ink-faint); display: flex; gap: 16px; padding-top: 16px; }

/* TOTP */
.hd-totp { display: flex; align-items: center; gap: 14px; }
.hd-totp-code { font: 500 16px/24px var(--font-mono); letter-spacing: 0.08em; color: var(--ink); }
.hd-totp-ring { transform: rotate(-90deg); }

/* ── Auth card ───────────────────────────────────────────── */
.hd-authpage { height: 100%; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.hd-authcard {
  width: 400px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-modal);
  padding: 32px; display: flex; flex-direction: column; gap: 16px;
}
.hd-authcard .hd-wordmark { padding: 0; text-align: center; font-size: 25px; line-height: 32px; }
.hd-auth-promise { font: 13px/18px var(--font-ui); color: var(--ink-muted); text-align: center; text-wrap: pretty; }
.hd-auth-display { font: 500 20px/28px var(--font-display); color: var(--ink); text-align: center; }
.hd-warnbox {
  border: 1px solid var(--line); border-radius: var(--radius-card);
  padding: 10px 12px; font: 13px/18px var(--font-ui); color: var(--ink-muted);
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--surface-sunken);
}
.hd-warnbox svg { flex: none; margin-top: 1px; color: var(--warn); }
.hd-locktile {
  width: 44px; height: 44px; border-radius: 50%; margin: 0 auto;
  background: var(--surface-sunken); color: var(--ink-muted);
  display: flex; align-items: center; justify-content: center;
}

/* ── Toast ───────────────────────────────────────────────── */
.hd-toast {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--bg);
  font: 500 13px/18px var(--font-ui);
  padding: 8px 14px; border-radius: var(--radius-card);
  box-shadow: var(--shadow-pop);
  display: flex; align-items: center; gap: 8px;
  animation: hd-toast-in var(--duration-surface) var(--ease);
}
@keyframes hd-toast-in { from { opacity: 0; transform: translate(-50%, 4px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (prefers-reduced-motion: reduce) { .hd-toast { animation: none; } }

/* ── Modal ───────────────────────────────────────────────── */
.hd-scrim {
  position: absolute; inset: 0; z-index: 10;
  background: rgba(15, 12, 8, 0.45);
  display: flex; align-items: center; justify-content: center;
}
.hd-modal {
  width: 480px; max-height: calc(100% - 64px);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-modal); box-shadow: var(--shadow-modal);
  display: flex; flex-direction: column;
  animation: hd-modal-in var(--duration-surface) var(--ease);
}
@keyframes hd-modal-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .hd-modal { animation: none; } }
.hd-modal-confirm { width: 400px; }
.hd-modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 24px 14px; border-bottom: 1px solid var(--line); }
.hd-modal-title { font: 500 16px/24px var(--font-ui); color: var(--ink); flex: 1; }
.hd-modal-body { padding: 18px 24px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.hd-modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 24px 18px; border-top: 1px solid var(--line); }
.hd-modal-confirm .hd-modal-head { border-bottom: none; padding-bottom: 0; }
.hd-modal-confirm .hd-modal-foot { border-top: none; padding-top: 4px; }
.hd-confirm-text { font: 14px/20px var(--font-ui); color: var(--ink-muted); text-wrap: pretty; }
.hd-confirm-text strong { color: var(--ink); font-weight: 500; }

/* ── Select / textarea / small input ─────────────────────── */
.hd-select-wrap { position: relative; display: flex; align-items: center; }
.hd-select { appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer; }
.hd-select-chevron { position: absolute; right: 10px; color: var(--ink-faint); pointer-events: none; display: flex; }
.hd-textarea {
  box-sizing: border-box;
  width: 100%; min-height: 76px; resize: vertical;
  padding: 8px 12px;
  background: var(--surface-sunken); border: 1px solid var(--line);
  border-radius: var(--radius-control);
  font: 14px/20px var(--font-ui); color: var(--ink);
  transition: box-shadow var(--duration-state) var(--ease), border-color var(--duration-state) var(--ease);
}
.hd-textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.hd-input-sm { height: var(--control-height-small); font-size: 13px; }

/* ── Checkbox row ────────────────────────────────────────── */
.hd-checkrow {
  display: flex; align-items: center; gap: 10px;
  height: 28px; cursor: pointer; border: none; background: transparent;
  padding: 0; font: 14px/20px var(--font-ui); color: var(--ink); width: 100%;
  border-radius: var(--radius-control);
}
.hd-checkrow:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.hd-checkbox {
  width: 16px; height: 16px; flex: none;
  border-radius: 4px; border: 1px solid var(--line);
  background: var(--surface-sunken); color: var(--surface);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--duration-state) var(--ease), border-color var(--duration-state) var(--ease);
}
.hd-checkbox.checked { background: var(--ink); border-color: var(--ink); }
.hd-checkrow .hd-checklabel { flex: 1; text-align: left; }
.hd-checkrow .hd-checkhint { font: 13px/18px var(--font-mono); color: var(--ink-faint); }

/* ── Segmented control ───────────────────────────────────── */
.hd-seg {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px;
  padding: 2px; background: var(--surface-sunken);
  border: 1px solid var(--line); border-radius: var(--radius-control);
}
.hd-seg-btn {
  height: 26px; border: none; background: transparent; cursor: pointer;
  border-radius: 4px; font: 500 13px/18px var(--font-ui); color: var(--ink-muted);
  transition: background var(--duration-state) var(--ease), color var(--duration-state) var(--ease);
}
.hd-seg-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.hd-seg-btn.active { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }

/* ── Slider ──────────────────────────────────────────────── */
.hd-sliderrow { display: flex; align-items: center; gap: 12px; }
.hd-slider {
  -webkit-appearance: none; appearance: none; flex: 1; height: 4px; border-radius: 2px;
  background: linear-gradient(to right, var(--ink) var(--fill, 50%), var(--line) var(--fill, 50%));
  outline: none; cursor: pointer; margin: 0;
}
.hd-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 5px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-pop);
  cursor: grab;
}
.hd-slider::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 5px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-pop);
  cursor: grab;
}
.hd-slider:focus-visible { box-shadow: var(--focus-ring); }
.hd-sliderval { font: 500 13px/18px var(--font-mono); color: var(--ink); min-width: 24px; text-align: right; }

/* ── Generator panel ─────────────────────────────────────── */
.hd-genpop {
  width: 360px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-modal); box-shadow: var(--shadow-pop);
  padding: 16px; display: flex; flex-direction: column; gap: 14px;
}
.hd-gen-preview {
  position: relative;
  background: var(--surface-sunken); border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 13px 44px 13px 14px; min-height: 48px;
  font: 500 15px/22px var(--font-mono); word-break: break-all;
  display: flex; align-items: center;
}
.hd-gen-re { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.hd-gen-grid { display: flex; flex-direction: column; gap: 2px; }

/* ── Detail extras ───────────────────────────────────────── */
.hd-fieldrow-value.wrap { white-space: normal; overflow: visible; text-overflow: clip; }
.hd-noteblock {
  background: var(--surface-sunken); border: 1px solid var(--line);
  border-radius: var(--radius-card); padding: 12px 14px;
  font: 13px/22px var(--font-mono); color: var(--ink);
  white-space: pre; overflow-x: auto; margin-top: 4px;
}

/* ── Editor custom field row ─────────────────────────────── */
.hd-customfield { display: grid; grid-template-columns: 140px 1fr 28px; gap: 8px; align-items: center; }
.hd-addrow { display: flex; gap: 8px; }

/* ── Settings ────────────────────────────────────────────── */
.hd-settingsframe { display: grid; grid-template-columns: var(--pane-sidebar) 220px 1fr; grid-template-rows: minmax(0, 1fr); height: 100%; background: var(--bg); }
.hd-subnav { display: flex; flex-direction: column; gap: 2px; padding: 16px 12px; background: var(--surface); border-right: 1px solid var(--line); }
.hd-subnav-title { font: 500 16px/24px var(--font-ui); color: var(--ink); padding: 2px 10px 12px; }
.hd-settings-content { overflow-y: auto; background: var(--surface); padding: 24px 32px 32px; }
.hd-settings-inner { max-width: 560px; display: flex; flex-direction: column; gap: 20px; }
.hd-settings-h1 { font: 500 20px/28px var(--font-ui); color: var(--ink); }
.hd-block { border: 1px solid var(--line); border-radius: var(--radius-card); padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.hd-block-title { font: 500 14px/20px var(--font-ui); color: var(--ink); }
.hd-block-foot { display: flex; justify-content: flex-end; gap: 8px; padding-top: 2px; }

/* ── List item rows (sessions, members, invites) ─────────── */
.hd-listitem { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.hd-listitem:last-child { border-bottom: none; padding-bottom: 2px; }
.hd-listitem:first-child { padding-top: 2px; }
.hd-listitem-text { flex: 1; min-width: 0; }
.hd-listitem-name { font: 500 14px/20px var(--font-ui); color: var(--ink); display: flex; align-items: center; gap: 8px; }
.hd-listitem-sub { font: 12px/16px var(--font-ui); color: var(--ink-faint); }

/* ── Import ──────────────────────────────────────────────── */
.hd-importcard {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line); border-radius: var(--radius-card);
  padding: 12px 14px; cursor: pointer; background: transparent; width: 100%; text-align: left;
  transition: background var(--duration-state) var(--ease), border-color var(--duration-state) var(--ease);
}
.hd-importcard:hover { background: var(--surface-sunken); }
.hd-importcard:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.hd-importcard.selected { border-color: var(--ink-muted); }
.hd-radio { width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-sunken); flex: none; display: flex; align-items: center; justify-content: center; }
.hd-importcard.selected .hd-radio { border-color: var(--ink); }
.hd-importcard.selected .hd-radio::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
.hd-dropzone {
  border: 1.5px dashed var(--line); border-radius: var(--radius-card);
  padding: 26px 20px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--ink-muted); font: 13px/18px var(--font-ui); text-align: center;
}
.hd-dropzone strong { color: var(--ink); font-weight: 500; }

/* ── Banner (trashed item) ───────────────────────────────── */
.hd-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; margin: 16px 0 4px;
  border: 1px solid var(--line); border-radius: var(--radius-card);
  background: var(--surface-sunken);
  font: 13px/18px var(--font-ui); color: var(--ink-muted);
}
.hd-banner svg { color: var(--warn); flex: none; }
.hd-banner-actions { margin-left: auto; display: flex; gap: 8px; }

/* ── Empty states ────────────────────────────────────────── */
.hd-empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 32px; text-align: center;
}
.hd-empty-icon {
  width: 44px; height: 44px; border-radius: 50%; margin-bottom: 6px;
  background: var(--surface-sunken); color: var(--ink-faint);
  display: flex; align-items: center; justify-content: center;
}
.hd-empty-title { font: 500 15px/22px var(--font-ui); color: var(--ink); }
.hd-empty-sub { font: 13px/18px var(--font-ui); color: var(--ink-muted); max-width: 280px; text-wrap: pretty; }
.hd-empty .hd-btn { margin-top: 10px; }

/* ── Type picker / chooser rows ──────────────────────────── */
.hd-chooserow {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line); border-radius: var(--radius-card);
  padding: 12px 14px; cursor: pointer; background: transparent; width: 100%; text-align: left;
  transition: background var(--duration-state) var(--ease);
}
.hd-chooserow:hover { background: var(--surface-sunken); }
.hd-chooserow:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.hd-chooserow .chev { margin-left: auto; color: var(--ink-faint); display: flex; }

/* ── Color swatches (vault editor) ────────────────────────── */
.hd-swatches { display: flex; gap: 10px; }
.hd-swatch {
  width: 24px; height: 24px; border-radius: 50%; border: none; cursor: pointer; padding: 0;
  transition: box-shadow var(--duration-state) var(--ease);
}
.hd-swatch.selected { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--ink); }
.hd-swatch:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* ── Progress (import) ───────────────────────────────────── */
.hd-progress { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.hd-progress-fill { display: block; height: 100%; border-radius: 2px; background: var(--accent); transition: width var(--duration-state) var(--ease); }
.hd-statline { display: flex; align-items: center; justify-content: space-between; gap: 12px; font: 13px/18px var(--font-ui); color: var(--ink-muted); }
.hd-statline .hd-mono { color: var(--ink); }

/* ── Mobile (≤760 stacked) ────────────────────────────────── */
.hd-mobile { display: flex; flex-direction: column; height: 100%; background: var(--surface); position: relative; }
.hd-topbar {
  display: flex; align-items: center; gap: 4px;
  height: 56px; padding: 0 8px; flex: none;
  border-bottom: 1px solid var(--line); background: var(--surface);
}
.hd-topbar-title { font: 500 16px/24px var(--font-ui); color: var(--ink); padding: 0 6px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-topbar .hd-iconbtn { width: 44px; height: 44px; }
.hd-mobile .hd-rows { border-top: none; }
.hd-mobile .hd-row { height: 60px; padding: 0 16px; }
.hd-mobile .hd-detail-body { padding: 4px 16px 20px; }
.hd-fab {
  position: absolute; right: 16px; bottom: 16px;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--accent); color: var(--on-accent);
  border: none; cursor: pointer; box-shadow: var(--shadow-pop);
  display: flex; align-items: center; justify-content: center;
}
.hd-fab:hover { background: var(--accent-hover); }
.hd-fab:focus-visible { outline: none; box-shadow: var(--focus-ring), var(--shadow-pop); }

/* ── Skeletons (static — no shimmer loops) ──────────────────── */
.hd-skel { background: var(--surface-sunken); border-radius: 4px; display: block; }
.hd-skel-tile { width: 32px; height: 32px; border-radius: 8px; flex: none; }

/* ── Spinner (transient loading only) ───────────────────────── */
@keyframes hd-spin { to { transform: rotate(360deg); } }
.hd-spin { animation: hd-spin 0.9s linear infinite; }
@media (prefers-reduced-motion: reduce) { .hd-spin { animation: none; } }

/* ── Offline banner ─────────────────────────────────────── */
.hd-offline {
  display: flex; align-items: center; gap: 10px; flex: none;
  padding: 8px 16px; background: var(--surface-sunken);
  border-bottom: 1px solid var(--line);
  font: 13px/18px var(--font-ui); color: var(--ink-muted);
}
.hd-offline svg { color: var(--warn); flex: none; }
.hd-offline .spacer { flex: 1; }

/* ── Context menu ───────────────────────────────────────── */
.hd-menu {
  min-width: 180px; padding: 4px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-card); box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column;
}
.hd-menuitem {
  display: flex; align-items: center; gap: 10px;
  height: 32px; padding: 0 10px; border-radius: 6px;
  border: none; background: transparent; cursor: pointer; text-align: left; width: 100%;
  font: 14px/20px var(--font-ui); color: var(--ink);
  transition: background var(--duration-state) var(--ease);
}
.hd-menuitem:hover { background: var(--surface-sunken); }
.hd-menuitem.danger { color: var(--danger); }
.hd-menusep { height: 1px; background: var(--line); margin: 4px 6px; }

/* ── Search match highlight ───────────────────────────────── */
.hd-mark {
  background: color-mix(in oklab, var(--accent) 18%, transparent);
  color: inherit; border-radius: 3px; padding: 0 1px;
}

/* ── Error toast variant ─────────────────────────────────── */
.hd-toast.error { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.hd-toast.error svg { color: var(--danger); }

/* ── Mobile drawer ──────────────────────────────────────── */
.hd-drawer-scrim { position: absolute; inset: 0; background: rgba(15, 12, 8, 0.45); z-index: 30; }
.hd-drawer {
  position: absolute; top: 0; bottom: 0; left: 0; width: 300px; z-index: 31;
  background: var(--bg); box-shadow: var(--shadow-modal);
  display: flex; flex-direction: column;
}
.hd-drawer .hd-sidebar { flex: 1; border-right: none; }
