/* Color tokens mirror the app's default "Mint" theme (AppIconOption.mint in
   SettingsView.swift): near-black canvas, translucent white overlays for
   cards/borders, mint accent. */
:root {
  --bg: #0f0f17;
  --card: rgba(255, 255, 255, 0.06);
  --card-hover: rgba(255, 255, 255, 0.10);
  --border: rgba(255, 255, 255, 0.10);
  --text: rgba(255, 255, 255, 0.92);
  --text-secondary: rgba(255, 255, 255, 0.5);
  --text-tertiary: rgba(255, 255, 255, 0.3);
  --accent: #40e0bf;
  --accent-ink: #06251f;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ─────────────────────────────────────────────────────────── */

.sidebar {
  width: 340px;
  min-width: 260px;
  max-width: 40vw;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.sidebar-header {
  padding: 22px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.wordmark-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(64, 224, 191, 0.7);
  flex-shrink: 0;
}

.subtitle {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-tertiary);
  padding-left: 17px;
}

.list {
  list-style: none;
  margin: 0;
  padding: 8px;
  overflow-y: auto;
  flex: 1;
}

.list-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 12px;
  border-radius: 12px;
  cursor: pointer;
  margin-bottom: 2px;
  transition: background 0.12s ease;
}

.list-item:hover { background: var(--card); }

.list-item.selected {
  background: var(--card-hover);
  box-shadow: inset 0 0 0 1px rgba(64, 224, 191, 0.35);
}

.list-item-body { min-width: 0; flex: 1; }

.list-item-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item-meta {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.list-item-copy {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.12s ease, background 0.12s ease, color 0.12s ease;
}

.list-item:hover .list-item-copy,
.list-item:focus-within .list-item-copy { opacity: 1; }

.list-item-copy:hover {
  background: rgba(64, 224, 191, 0.15);
  color: var(--accent);
}

.sidebar-footer {
  padding: 12px 20px;
  font-size: 11px;
  color: var(--text-tertiary);
  border-top: 1px solid var(--border);
}

/* ── Detail pane ─────────────────────────────────────────────────────── */

.detail {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.detail-empty {
  margin: auto;
  color: var(--text-tertiary);
  font-size: 14px;
}

.detail-header {
  padding: 24px 32px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.detail-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.2px;
  margin: 0 0 6px;
}

.detail-meta {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  gap: 10px;
  align-items: center;
}

.detail-meta .dot::before { content: "·"; margin-right: 10px; color: var(--text-tertiary); }

.copy-button {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.12s ease;
}

.copy-button:hover { filter: brightness(1.08); }
.copy-button:active { transform: scale(0.97); }

/* ── Unlock overlay (sync token entry) ──────────────────────────────────── */

.unlock-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 12, 0.88);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.unlock-overlay[hidden] { display: none; }

.unlock-card {
  width: 320px;
  max-width: calc(100vw - 40px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
}

.unlock-card .wordmark { justify-content: center; }

.unlock-copy {
  margin: 14px 0 16px;
  font-size: 13px;
  color: var(--text-secondary);
}

.unlock-input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 14px;
  margin-bottom: 12px;
}

.unlock-input:focus {
  outline: none;
  border-color: rgba(64, 224, 191, 0.5);
}

.unlock-submit { width: 100%; justify-content: center; }

.unlock-error {
  margin: 12px 0 0;
  font-size: 12px;
  color: #ff8a8a;
}

.detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px 60px;
}

.detail-text {
  max-width: 760px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
  user-select: text;
}

/* ── Toast ───────────────────────────────────────────────────────────── */

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Responsive: narrow window (e.g. half-screen on Windows) ───────────── */

@media (max-width: 720px) {
  .app { flex-direction: column; }
  .sidebar {
    width: 100%;
    max-width: none;
    height: 40%;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .detail { height: 60%; }
}
