/* Cloakd — component styles: settings, sidebar tabs, notes, TOTP, health,
   import, tags, attachments, cards/identities, send, share, p2p, selects.
   Extracted from index.html. */

/* ── Settings panel ── */
/* Container — wider than the old 520 cap so toggle-row description text
   no longer wraps after a couple of words on desktop. */
.settings-body { max-width: 640px; }

/* Repeated section header that used to be six inline-styled divs */
.settings-section-label {
  font-size: 11px; font-family: var(--mono);
  color: var(--muted);
  letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600;
  margin: 0 0 12px;
}

.toggle-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 24px; padding: 18px 0; border-bottom: 1px solid var(--border-soft, var(--border));
}
.toggle-row:last-of-type { border-bottom: none; }
.toggle-info { flex: 1; }
.toggle-label { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.toggle-desc { font-size: 12px; color: var(--muted); line-height: 1.55; }

.toggle { position: relative; width: 40px; height: 22px; flex-shrink: 0; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute; inset: 0; background: var(--surface2);
  border-radius: 22px; border: 1px solid var(--border);
  transition: background 0.2s, border-color 0.2s;
}
.toggle-track::after {
  content: ''; position: absolute; left: 3px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; background: var(--muted); border-radius: 50%;
  transition: left 0.2s, background 0.2s;
}
.toggle input:checked ~ .toggle-track { background: var(--accent); border-color: var(--accent); }
.toggle input:checked ~ .toggle-track::after { left: calc(100% - 17px); background: #fff; }

.pending-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px 20px; margin-bottom: 10px;
}
.pending-badge {
  font-size: 10px; min-width: 16px; height: 16px; padding: 0 5px;
  background: var(--accent); color: #fff; border-radius: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-weight: 600;
  position: absolute; top: -4px; right: -4px;
}

/* ── Sidebar tabs (icon + label stacked, dense single row) ── */
.sidebar-tabs {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  padding: 6px 6px 8px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}
.sidebar-tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 6px 2px; border: none; background: none;
  color: var(--muted); cursor: pointer;
  font-size: 9px; font-weight: 500; font-family: var(--sans);
  letter-spacing: 0.02em; line-height: 1;
  border-radius: 7px;
  transition: color 0.12s, background 0.12s;
  min-width: 0;
}
.sidebar-tab svg { width: 16px; height: 16px; flex-shrink: 0; }
.sidebar-tab span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.sidebar-tab:hover { color: var(--text); background: var(--surface2); }
.sidebar-tab.active { color: var(--accent); background: rgba(91,124,250,0.12); }
.sidebar-tab.active svg { color: var(--accent); }

.tab-breach-badge {
  position: absolute; top: 2px; right: 2px;
  background: var(--danger); color: #fff;
  font-size: 8px; font-weight: 700; padding: 1px 4px;
  border-radius: 6px; line-height: 1;
  pointer-events: none;
}
.sidebar-tab { position: relative; }

/* ── Note items ── */
.note-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px; cursor: pointer;
  transition: background 0.1s; margin-bottom: 2px; border: 1px solid transparent;
}
.note-item:hover { background: var(--surface2); }
.note-item.active { background: var(--surface2); border-color: var(--border); border-left-color: var(--accent); }
.note-icon {
  width: 28px; height: 28px; background: var(--surface2); border-radius: 6px;
  display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0;
}

/* ── TOTP display ── */
.totp-code-wrap { display: flex; align-items: center; gap: 10px; flex: 1; }
.totp-code { font-size: 20px; font-weight: 700; letter-spacing: 0.18em; color: var(--accent); font-family: var(--mono); transition: color 0.3s; }
.totp-bar-track { flex: 1; height: 3px; background: var(--border); border-radius: 2px; overflow: hidden; }
.totp-bar { height: 100%; background: var(--accent); border-radius: 2px; transition: width 1s linear, background 0.3s; }

/* ── Health dashboard ── */
.health-score {
  display: flex; align-items: center; gap: 26px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 22px 28px; margin-bottom: 16px;
}
.health-score-ring { position: relative; width: 92px; height: 92px; flex-shrink: 0; }
.health-score-ring svg { transform: rotate(-90deg); }
.health-score-num {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.health-score-num b { font-size: 28px; font-weight: 700; font-family: var(--mono); line-height: 1; }
.health-score-num span { font-size: 8px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 3px; }
.health-score-text { flex: 1; min-width: 0; }
.health-score-grade { font-size: 18px; font-weight: 600; margin-bottom: 3px; }
.health-score-sub { font-size: 13px; color: var(--muted); line-height: 1.5; }

.health-summary {
  display: flex; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; margin-bottom: 24px;
}
.health-stat {
  flex: 1; padding: 18px 14px; text-align: center;
  border-right: 1px solid var(--border);
  cursor: pointer; transition: background 0.12s;
  position: relative;
}
.health-stat:hover { background: var(--surface2); }
.health-stat.active { background: var(--surface2); }
.health-stat.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0;
  height: 2px; background: var(--accent);
}
.health-stat:last-child { border-right: none; }
.health-stat-num { font-size: 28px; font-weight: 700; font-family: var(--mono); line-height: 1; display: block; }
.health-stat-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 5px; display: block; }

/* Health list — flex rows replacing the old table */
.health-list-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.hi-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 18px; border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.hi-row:last-child { border-bottom: none; }
.hi-row:hover { background: var(--surface2); }
.hi-info { flex: 1; min-width: 0; }
.hi-site { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hi-user { font-size: 11px; color: var(--muted); font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.hi-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.hi-tags  { display: flex; gap: 4px; }

.tag-breach { background: rgba(240,82,82,0.12); color: var(--danger); font-size: 10px; padding: 2px 7px; border-radius: 20px; font-family: var(--mono); white-space: nowrap; }
.tag-warn   { background: rgba(251,191,36,0.12); color: var(--warn);    font-size: 10px; padding: 2px 7px; border-radius: 20px; font-family: var(--mono); white-space: nowrap; }
.tag-ok     { background: rgba(52,211,153,0.12);  color: var(--success); font-size: 10px; padding: 2px 7px; border-radius: 20px; font-family: var(--mono); white-space: nowrap; }
.tag-reused { background: rgba(139,92,246,0.12); color: var(--accent2); font-size: 10px; padding: 2px 7px; border-radius: 20px; font-family: var(--mono); white-space: nowrap; }
.tag-old    { background: rgba(107,116,144,0.16); color: var(--muted);   font-size: 10px; padding: 2px 7px; border-radius: 20px; font-family: var(--mono); white-space: nowrap; }

/* ── Import preview table ── */
.import-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.import-table th { text-align: left; font-family: var(--mono); font-size: 11px; color: var(--muted); padding: 6px 10px; border-bottom: 1px solid var(--border); font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; }
.import-table td { padding: 8px 10px; border-bottom: 1px solid rgba(42,48,69,0.5); }
.import-table tr:last-child td { border-bottom: none; }
.import-table-wrap { max-height: 320px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; margin-top: 12px; }
.import-table-wrap::-webkit-scrollbar { width: 4px; }
.import-table-wrap::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.tag-new { font-size: 10px; padding: 2px 7px; border-radius: 20px; background: rgba(52,211,153,0.12); color: var(--success); font-family: var(--mono); }
.tag-dup { font-size: 10px; padding: 2px 7px; border-radius: 20px; background: rgba(107,116,144,0.12); color: var(--muted); font-family: var(--mono); }

[hidden] { display: none !important; }

/* ── Sidebar sort bar ── */
.sidebar-sort-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px 8px;
  flex-shrink: 0;
}
.sort-label {
  font-size: 10px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600;
}
.sort-select {
  flex: 1; background: var(--bg); border: 1px solid var(--border);
  color: var(--text); font-size: 11px; padding: 4px 22px 4px 8px;
  border-radius: 6px; cursor: pointer; outline: none;
  font-family: inherit;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 16 16' fill='none' stroke='%236b7490' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M4 6l4 4 4-4'/></svg>");
  background-repeat: no-repeat;
  background-position: right 6px center;
  transition: border-color 0.12s, background-color 0.12s;
}
.sort-select:hover  { border-color: var(--muted); }
.sort-select:focus  { border-color: var(--accent); }
.sort-select option { background: var(--surface); color: var(--text); }

/* ── Section headers in the sidebar list ── */
.section-header {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 8px 4px;
  font-size: 10px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.07em; font-weight: 600;
}
.section-header .section-count {
  color: var(--muted2, #4a5168);
  font-family: var(--mono); font-weight: 500;
}
.section-header:first-child { padding-top: 4px; }
.section-divider {
  height: 1px; background: var(--border-soft, var(--border));
  margin: 6px 8px;
}

/* ── Tag filter bar ── */
.tag-filter-bar {
  display: flex; gap: 6px; padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto; flex-shrink: 0;
}
.tag-filter-bar:empty { display: none; }
.tag-filter-bar::-webkit-scrollbar { height: 0; }
.tag-chip {
  font-size: 11px; padding: 3px 9px; border-radius: 20px;
  border: 1px solid var(--border); background: var(--bg);
  color: var(--muted); cursor: pointer; white-space: nowrap;
  font-family: var(--mono); transition: color 0.1s, border-color 0.1s, background 0.1s;
  flex-shrink: 0;
}
.tag-chip:hover { color: var(--text); border-color: var(--muted); }
.tag-chip.active { color: var(--accent); border-color: var(--accent); background: rgba(91,124,250,0.08); }

/* ── Site tags shown in detail header ── */
.site-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.site-tag {
  font-size: 10px; padding: 2px 8px; border-radius: 20px;
  background: rgba(91,124,250,0.1); color: var(--accent);
  border: 1px solid rgba(91,124,250,0.25); font-family: var(--mono);
}

/* ── Attachments section ── */
.attach-section {
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border);
}
.attach-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px;
}
.attach-title {
  font-size: 11px; color: var(--muted); font-family: var(--mono);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.attach-upload-btn {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  padding: 4px 10px; font-size: 11px; color: var(--muted); cursor: pointer;
  font-family: var(--sans); transition: color 0.1s, border-color 0.1s;
}
.attach-upload-btn:hover { color: var(--text); border-color: var(--accent); }
.attach-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 0; border-bottom: 1px solid rgba(42,48,69,0.4); font-size: 12px;
}
.attach-row:last-child { border-bottom: none; }
.attach-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-size { font-size: 10px; color: var(--muted); font-family: var(--mono); flex-shrink: 0; }

/* ── Sidebar tabs — 4 tabs fit at 11px ── */
.sidebar-tab { font-size: 11px; }

/* ── Password history ── */
.history-section { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.history-toggle { font-size: 11px; color: var(--muted); font-family: var(--mono); cursor: pointer; background: none; border: none; padding: 0; display: flex; align-items: center; gap: 5px; letter-spacing: 0.04em; text-transform: uppercase; }
.history-toggle:hover { color: var(--text); }
.history-list { margin-top: 10px; display: none; }
.history-list.open { display: block; }
.history-entry { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid rgba(42,48,69,0.4); font-size: 12px; }
.history-entry:last-child { border-bottom: none; }
.history-pw { font-family: var(--mono); color: var(--muted); letter-spacing: 0.04em; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-date { font-size: 10px; color: var(--border); font-family: var(--mono); flex-shrink: 0; }

/* ── Cards & Identities ── */
.card-item, .identity-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px; cursor: pointer;
  transition: background 0.1s; margin-bottom: 2px; border: 1px solid transparent;
}
.card-item:hover, .identity-item:hover { background: var(--surface2); }
.card-item.active, .identity-item.active { background: var(--surface2); border-color: var(--border); border-left-color: var(--accent); }

.card-chip-icon {
  width: 28px; height: 28px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 6px; display: flex; align-items: center; justify-content: center;
}
.identity-chip-icon {
  width: 28px; height: 28px; flex-shrink: 0;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: var(--accent);
}

/* ── Card visual ── */
.card-visual {
  background: linear-gradient(135deg, #1e2330 0%, #2a3045 100%);
  border: 1px solid var(--border); border-radius: 14px;
  padding: 22px 24px 18px; margin-bottom: 20px; position: relative; overflow: hidden;
}
.card-visual::after {
  content: ''; position: absolute; top: -40px; right: -40px;
  width: 160px; height: 160px; border-radius: 50%;
  background: rgba(91,124,250,0.07); pointer-events: none;
}
.card-num { font-family: var(--mono); font-size: 19px; letter-spacing: 0.22em; margin: 14px 0 10px; }
.card-meta { display: flex; gap: 28px; }
.card-meta-group { display: flex; flex-direction: column; gap: 2px; }
.card-meta-label { font-size: 9px; color: var(--muted); font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.07em; }
.card-meta-val { font-family: var(--mono); font-size: 13px; }

/* ── Share link box ── */
.share-link-box {
  background: var(--bg); border: 1px solid rgba(91,124,250,0.4);
  border-radius: 8px; padding: 12px 14px; font-family: var(--mono);
  font-size: 11px; color: var(--muted); word-break: break-all; line-height: 1.7;
  margin: 14px 0;
}

/* ── Cloakd Send ── */
.send-wrap { max-width: 560px; margin: 0 auto; }
.send-section { margin-bottom: 22px; }
.send-section-label {
  font-size: 10px; font-family: var(--mono); color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px;
}
.send-section-label svg { opacity: 0.7; }

/* Segmented control (Text / File toggle) */
.send-seg {
  display: flex; background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 4px; gap: 4px;
}
.send-seg-btn {
  flex: 1; display: flex; align-items: center; justify-content: center;
  gap: 8px; padding: 9px 14px; border-radius: 7px; border: none;
  background: transparent; color: var(--muted); cursor: pointer;
  font-size: 13px; font-weight: 500; transition: all 0.15s;
}
.send-seg-btn:hover { color: var(--text); }
.send-seg-btn.active {
  background: var(--surface2); color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.send-seg-btn svg { width: 14px; height: 14px; }

/* Big textarea */
.send-textarea {
  width: 100%; min-height: 140px; padding: 14px 16px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); font-family: var(--mono); font-size: 13px;
  line-height: 1.55; resize: vertical; outline: none; box-sizing: border-box;
  transition: border-color 0.15s;
}
.send-textarea:focus { border-color: var(--accent); }
.send-textarea::placeholder { color: var(--muted); }
.send-char-count {
  text-align: right; font-size: 10px; font-family: var(--mono);
  color: var(--muted); margin-top: 6px;
}

/* File drop zone */
.send-drop {
  position: relative; border: 1.5px dashed var(--border); border-radius: 12px;
  padding: 28px 20px; text-align: center; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: rgba(91,124,250,0.02);
}
.send-drop:hover, .send-drop.drag-over {
  border-color: var(--accent); background: rgba(91,124,250,0.06);
}
.send-drop input[type="file"] { display: none; }
.send-drop-icon {
  width: 38px; height: 38px; margin: 0 auto 10px;
  color: var(--accent); opacity: 0.7;
}
.send-drop-text { font-size: 13px; color: var(--text); margin-bottom: 4px; }
.send-drop-sub  { font-size: 11px; color: var(--muted); }
.send-file-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px;
}
.send-file-icon {
  width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0;
  background: rgba(91,124,250,0.12); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.send-file-meta { flex: 1; min-width: 0; }
.send-file-name {
  font-size: 13px; font-weight: 500; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.send-file-size { font-size: 11px; color: var(--muted); margin-top: 2px; }
.send-file-clear {
  background: none; border: none; color: var(--muted); cursor: pointer;
  padding: 4px; border-radius: 4px; transition: color 0.15s, background 0.15s;
}
.send-file-clear:hover { color: var(--danger); background: rgba(240,82,82,0.08); }

/* Settings grid (expiry / views / password) */
.send-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.send-field {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px;
}
.send-field-label {
  font-size: 10px; font-family: var(--mono); color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px;
  display: flex; align-items: center; gap: 6px;
}
.send-select, .send-pw-input {
  width: 100%; background: transparent; border: none;
  color: var(--text); font-size: 14px; font-weight: 500; outline: none;
  padding: 2px 0; box-sizing: border-box;
  font-family: var(--sans);
}
.send-select {
  cursor: pointer;
  /* Kill the OS chevron and supply our own so the closed control
     reads as themed even on platforms with white dropdown buttons. */
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 16 16' fill='none' stroke='%236b7490' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M4 6l4 4 4-4'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0 center;
  padding-right: 16px;
}
/* The open dropdown popup itself is OS-rendered, but Chromium honours
   background/color on the individual option elements. */
.send-select option {
  background: var(--surface);
  color: var(--text);
  padding: 8px;
}
/* The send-sep-select reuses these styles since it has the same class
   pattern — make sure it picks up the chevron too. */
.gen-sep-select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 16 16' fill='none' stroke='%236b7490' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M4 6l4 4 4-4'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 24px !important;
}
.gen-sep-select option {
  background: var(--surface);
  color: var(--text);
}
.send-pw-input { font-family: var(--mono); font-size: 13px; }
.send-pw-input::placeholder { color: var(--muted); font-weight: 400; }

/* Result success card */
.send-result-card {
  background: linear-gradient(135deg, rgba(52,211,153,0.04), rgba(91,124,250,0.04));
  border: 1px solid rgba(52,211,153,0.3); border-radius: 12px; padding: 18px;
}
.send-result-head {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
  font-weight: 600; color: var(--success); margin-bottom: 6px;
}
.send-result-sub { font-size: 11px; color: var(--muted); margin-bottom: 14px; }
.send-link-row {
  display: flex; align-items: stretch;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden;
}
.send-link-input {
  flex: 1; background: transparent; border: none; outline: none;
  padding: 11px 14px; color: var(--text); font-family: var(--mono);
  font-size: 11px; min-width: 0;
}
.send-link-copy {
  background: var(--accent); color: #fff; border: none; padding: 0 16px;
  cursor: pointer; font-size: 12px; font-weight: 600; min-width: 78px;
  transition: background 0.15s;
}
.send-link-copy:hover { background: #4a6bf0; }
.send-link-copy.copied { background: var(--success); }
.send-pw-hint {
  display: flex; align-items: flex-start; gap: 8px; margin-top: 12px;
  padding: 10px 12px; background: rgba(91,124,250,0.06);
  border: 1px solid rgba(91,124,250,0.2); border-radius: 8px;
  font-size: 11px; color: var(--muted); line-height: 1.5;
}
.send-pw-hint svg { flex-shrink: 0; margin-top: 1px; color: var(--accent); }

/* "My sends" list — reuses .note-item but with badges */
.send-list-item .vault-item-count {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.send-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px; border-radius: 10px;
  font-size: 10px; font-weight: 500; font-family: var(--mono);
  background: var(--surface2); color: var(--muted);
}
.send-badge.locked { background: rgba(91,124,250,0.15); color: var(--accent); }
.send-badge.urgent { background: rgba(240,82,82,0.15); color: var(--danger); }

/* ── Share modal tabs ── */
.share-tabs {
  display: flex; border-bottom: 1px solid var(--border);
  margin: -4px -4px 16px; padding: 0 4px;
}
.share-tab {
  background: none; border: none; border-bottom: 2px solid transparent;
  margin-bottom: -1px; padding: 8px 14px 10px;
  font-size: 13px; color: var(--muted); cursor: pointer; transition: color 0.1s;
}
.share-tab:hover { color: var(--text); }
.share-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── P2P share UI ── */
.p2p-room-code {
  font-size: 34px; font-family: var(--mono); font-weight: 700;
  letter-spacing: 0.22em; color: var(--text); text-align: center;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 20px; margin: 10px 0;
  transition: opacity 0.3s;
}
.p2p-status {
  font-size: 12px; color: var(--muted); display: flex;
  align-items: center; justify-content: center; gap: 6px; margin-top: 8px;
}
.p2p-mode-toggle {
  display: flex; background: var(--bg); border-radius: 8px;
  padding: 3px; margin-bottom: 14px; border: 1px solid var(--border);
}
.p2p-mode-btn {
  flex: 1; padding: 6px; border: none; border-radius: 6px;
  cursor: pointer; font-size: 12px; font-weight: 500;
  transition: background 0.15s, color 0.15s;
  background: none; color: var(--muted);
}
.p2p-mode-btn.active { background: var(--surface2); color: var(--text); }

/* ── Select inputs in settings ── */
.setting-select {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 7px; color: var(--text); font-family: var(--sans);
  font-size: 12px; padding: 7px 10px; cursor: pointer; outline: none;
  flex-shrink: 0;
}
.setting-select:focus { border-color: var(--accent); }
