/* Splice v0.2 — diff-mode fingerprint inspector.
 * No framework. Three views (landing, compare, share-import) share this CSS.
 */

:root {
  --bg: #0c0c0e;
  --panel: #131318;
  --panel-2: #1a1a22;
  --panel-3: #22222c;
  --border: #2a2a35;
  --border-strong: #3a3a48;
  --text: #e5e5ee;
  --text-dim: #8a8a99;
  --text-muted: #5a5a68;
  --green: #34d399;
  --red: #f87171;
  --yellow: #fcd34d;
  --orange: #fb923c;
  --accent: #a78bfa;
  --accent-soft: rgba(167, 139, 250, 0.1);
  --mono: ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
}

*  { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.55;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: 0.9em; background: var(--panel-2);
       padding: 1px 5px; border-radius: 3px; }

/* ── Header ─────────────────────────────────────────────────── */
header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1.2rem 2rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 5;
}
.brand { display: flex; align-items: baseline; gap: 0.8rem; color: inherit; }
.brand:hover { text-decoration: none; }
.brand .logo {
  font-family: var(--mono);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.brand .tagline { color: var(--text-dim); font-size: 0.95rem; }
.meta { color: var(--text-dim); font-family: var(--mono); font-size: 0.8rem; }

/* ── Buttons ────────────────────────────────────────────────── */
button {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
button:hover { background: var(--panel); border-color: var(--text-dim); }
button:active { background: var(--bg); }
button:disabled { opacity: 0.35; cursor: not-allowed; }
button.primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  font-weight: 600;
}
button.primary:hover { background: #b89cff; }
button.primary:disabled { background: var(--panel-2); color: var(--text-dim); border-color: var(--border); }

/* ── Main ───────────────────────────────────────────────────── */
main#app {
  max-width: 64rem;
  margin: 0 auto;
  padding: 2rem 2rem 5rem;
}

/* ── Hero (landing + share-import) ──────────────────────────── */
.hero, .compare-hero {
  margin-bottom: 2rem;
}
.hero h1, .compare-hero h1 {
  font-size: 1.9rem;
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem;
}
.hero-sub {
  color: var(--text-dim);
  max-width: 38rem;
  margin: 0 0 1.5rem;
}
.hero-cta {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

/* ── Profile list (landing) ─────────────────────────────────── */
.profile-list {
  margin: 2rem 0;
}
.profile-list h2 {
  font-size: 0.85rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 0.8rem;
  display: flex;
  align-items: baseline;
  gap: 1rem;
}
.profile-count {
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.profile-row {
  display: grid;
  grid-template-columns: 1.5rem 1fr auto auto auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.8rem 1.2rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 0.4rem;
}
.profile-row.flash { animation: flash 1s ease-out; }
@keyframes flash {
  0%   { background: var(--accent-soft); border-color: var(--accent); }
  100% { background: var(--panel); border-color: var(--border); }
}
.profile-row input.pick { cursor: pointer; transform: scale(1.2); accent-color: var(--accent); }
.profile-info { min-width: 0; }
.profile-name { font-weight: 600; }
.profile-meta {
  color: var(--text-dim);
  font-size: 0.8rem;
  font-family: var(--mono);
  margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.profile-action {
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
  background: transparent;
}
.profile-action.delete {
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.2rem 0.55rem;
  color: var(--text-dim);
}
.profile-action.delete:hover {
  background: rgba(248, 113, 113, 0.15);
  color: var(--red);
  border-color: var(--red);
}
.profile-action.share:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.empty {
  color: var(--text-dim);
  font-style: italic;
  background: var(--panel);
  padding: 1.5rem;
  border-radius: 6px;
  border: 1px dashed var(--border);
}

.compare-cta {
  position: sticky;
  bottom: 1rem;
  margin: 2rem 0;
  padding: 1rem 1.4rem;
  background: var(--panel-2);
  border: 1px solid var(--accent);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 4;
}
.compare-cta p { margin: 0; color: var(--text-dim); }
#pick-count { color: var(--text); font-weight: 600; font-family: var(--mono); }

.help {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
}
.help h2 {
  font-size: 0.85rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 0.8rem;
}
.help ol li { margin-bottom: 0.4rem; }
.help b { color: var(--text); }

/* ── Compare view ───────────────────────────────────────────── */
.back-link a { color: var(--text-dim); font-family: var(--mono); font-size: 0.85rem; }
.back-link { margin: 0 0 1rem; }

.compare-sides {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}
.side-card {
  padding: 1rem 1.2rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.side-card-label {
  font-family: var(--mono);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.3rem;
}
.side-card-name { font-weight: 600; font-size: 1.05rem; }
.side-card-meta { color: var(--text-dim); font-family: var(--mono); font-size: 0.78rem; margin-top: 2px; }
.side-card-ua {
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.75rem;
  margin-top: 0.5rem;
  word-break: break-all;
}

.diff-summary {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  align-items: baseline;
  padding: 0.8rem 1.2rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin: 1rem 0;
  font-family: var(--mono);
  font-size: 0.85rem;
}
.summary-stat { color: var(--text-dim); }
.summary-stat b { color: var(--text); font-size: 1.4em; }
.summary-stat.sev-high   { color: var(--red); }
.summary-stat.sev-medium { color: var(--orange); }
.summary-stat.sev-low    { color: var(--yellow); }

.diff-list { margin-top: 1.5rem; }
.diff-list-hint {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}
.q-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2em; height: 1.2em;
  border-radius: 50%;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.7em;
  line-height: 1;
}

.diff-row {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: 6px;
  margin-bottom: 0.8rem;
  padding: 1rem 1.2rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}
.diff-row.sev-high   { border-left-color: var(--red); }
.diff-row.sev-medium { border-left-color: var(--orange); }
.diff-row.sev-low    { border-left-color: var(--yellow); opacity: 0.85; }

.diff-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.75rem;
}
.diff-group {
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sev-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.sev-badge.sev-high   { background: rgba(248, 113, 113, 0.18); color: var(--red); }
.sev-badge.sev-medium { background: rgba(251, 146, 60, 0.18); color: var(--orange); }
.sev-badge.sev-low    { background: rgba(252, 211, 77, 0.14); color: var(--yellow); }

.diff-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 600;
}
.diff-label .q,
.q {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.3em; height: 1.3em;
  border-radius: 50%;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.75em;
  cursor: help;
  flex-shrink: 0;
  font-family: inherit;
  padding: 0;
}
.q:hover { color: var(--accent); border-color: var(--accent); }

.diff-values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}
.diff-side {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.6rem 0.8rem;
}
.diff-side-name {
  font-family: var(--mono);
  color: var(--text-dim);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.3rem;
}
.diff-side-value {
  font-family: var(--mono);
  font-size: 0.85rem;
  word-break: break-all;
  white-space: pre-wrap;
}

.diff-fix {
  color: var(--text-dim);
  font-size: 0.85rem;
  padding: 0.5rem 0.8rem;
  background: rgba(167, 139, 250, 0.05);
  border-radius: 4px;
}
.diff-fix b { color: var(--accent); }

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.empty-state h2 { color: var(--green); }

/* ── Tooltip ────────────────────────────────────────────────── */
.tooltip {
  position: absolute;
  z-index: 100;
  background: var(--panel-2);
  border: 1px solid var(--accent);
  color: var(--text);
  font-size: 0.85rem;
  padding: 0.8rem 1rem;
  border-radius: 6px;
  max-width: 30rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s;
}
.tooltip.show { opacity: 1; }
.tt-title {
  font-family: var(--mono);
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.tt-sev { font-size: 0.7rem; padding: 1px 5px; border-radius: 3px; }
.tt-sev.sev-high   { background: rgba(248, 113, 113, 0.2); color: var(--red); }
.tt-sev.sev-medium { background: rgba(251, 146, 60, 0.2); color: var(--orange); }
.tt-sev.sev-low    { background: rgba(252, 211, 77, 0.18); color: var(--yellow); }
.tt-why { margin-bottom: 0.5rem; }
.tt-fix { color: var(--text-dim); font-size: 0.8rem; padding-top: 0.4rem; border-top: 1px solid var(--border); }
.tt-fix b { color: var(--text); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 720px) {
  header { padding: 0.8rem 1rem; flex-direction: column; align-items: flex-start; gap: 0.3rem; }
  main#app { padding: 1.2rem 1rem 3rem; }
  .compare-sides { grid-template-columns: 1fr; }
  .diff-values { grid-template-columns: 1fr; }
  .profile-row {
    grid-template-columns: 1.5rem 1fr;
  }
  .profile-action {
    grid-column: 2;
    justify-self: start;
  }
}
