/* ── TOKENS ───────────────────────────────────────── */
:root {
  --bg:           #0a0a0a;
  --bg-2:         #111111;
  --bg-3:         #1a1a1a;
  --surface:      #161616;
  --surface-2:    #202020;
  --border:       #2a2a2a;
  --border-2:     #333333;
  --text:         #f0f0f0;
  --text-2:       #a0a0a0;
  --text-3:       #555555;
  --accent:       #6ee7f7;
  --accent-dim:   #1a3a40;
  --danger:       #ff4d6d;
  --danger-dim:   #3a0f18;
  --bubble-bg:    #1c2a2e;
  --bubble-border:#2a4a52;
  --radius-sm:    6px;
  --radius:       12px;
  --radius-lg:    18px;
  --shadow:       0 2px 12px rgba(0,0,0,0.4);
  --nav-h:        56px;
  --font:         "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono:    "Space Mono", monospace;
}

/* ── LUCIDE ICONS ─────────────────────────────────── */
/* !important overrides the width="24" height="24" attrs Lucide injects on the SVG */
.lucide {
  width: 1em !important;
  height: 1em !important;
  display: inline-block;
  vertical-align: middle;
  stroke-width: 2;
  flex-shrink: 0;
}
.empty-icon .lucide       { width: 2rem !important; height: 2rem !important; }
.tile-status-icon .lucide  { width: 0.9em !important; height: 0.9em !important; }
.tile-location-badge .lucide { width: 0.7em !important; height: 0.7em !important; }

/* Icon + text containers — flex keeps icon and text on the same baseline cross-platform */
.feed-photo-location,
.feed-taken,
.settings-toast,
.post-details span {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
}

/* ── RESET ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { color-scheme: dark; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ── NAV ──────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(10,10,10,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.12em;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow: visible;
}

.logo-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.nav-links::-webkit-scrollbar { display: none; }

.nav-links a {
  color: var(--text-2);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }

.btn-nav {
  background: var(--accent) !important;
  color: var(--bg) !important;
  font-weight: 700 !important;
  padding: 0.4rem 0.9rem !important;
  border-radius: 20px !important;
  font-size: 0.8rem !important;
}
.btn-nav:hover { opacity: 0.9; background: var(--accent) !important; }

/* ── LAYOUT ───────────────────────────────────────── */
.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

/* ── FEED HEADER ──────────────────────────────────── */
/* Feed top row: Journal title + now-playing side by side */
.feed-top-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.feed-header {
  flex-shrink: 0;
}

.feed-header h1 {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text);
  overflow: visible;
}

.feed-subtitle {
  font-size: 0.825rem;
  color: var(--text-3);
  margin-top: 0.2rem;
}

/* ── EMPTY ────────────────────────────────────────── */
.empty {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-3);
}

.empty-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  color: var(--border-2);
}

.empty p { font-size: 0.95rem; margin-bottom: 1.25rem; }

.empty-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── TIMELINE ─────────────────────────────────────── */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── DATE DIVIDER ─────────────────────────────────── */
.date-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.75rem 0 1rem;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.date-divider::before,
.date-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.date-divider:first-child { margin-top: 0; }

/* ── FEED PHOTO ───────────────────────────────────── */
.feed-photo {
  margin-bottom: 1.25rem;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.feed-photo a {
  display: block;
  position: relative;
  overflow: hidden;
}

.feed-photo img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.feed-photo a:hover img { transform: scale(1.02); }

.feed-photo-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 55%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.feed-photo a:hover .feed-photo-overlay { opacity: 1; }

.feed-photo-caption {
  font-size: 0.9rem;
  color: #fff;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.25rem;
}

.feed-photo-location {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.75);
}

.feed-photo-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  flex-wrap: wrap;
}

.feed-time {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-3);
  font-weight: 400;
}

.feed-taken {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-3);
}

.feed-actions {
  margin-left: auto;
  display: flex;
  gap: 0.35rem;
}

/* ── FEED STATUS / BUBBLE ─────────────────────────── */
.feed-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-bottom: 0.75rem;
}

.bubble {
  background: var(--bubble-bg);
  border: 1px solid var(--bubble-border);
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-sm) var(--radius-lg);
  padding: 0.8rem 1.1rem;
  max-width: 82%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.bubble-text {
  font-size: 0.975rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.bubble-meta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
}

.bubble-time {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-3);
  font-weight: 400;
}

.bubble-actions {
  display: flex;
  gap: 0.3rem;
  margin-top: 0.3rem;
  padding-right: 0.1rem;
}

/* ── ACTION BUTTONS (tiny inline) ─────────────────── */
.action-btn {
  font-family: var(--font);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.01em;
  -webkit-tap-highlight-color: transparent;
}

.action-btn:hover { background: var(--bg-3); color: var(--text); border-color: var(--text-3); opacity: 1; }

.action-btn-danger { color: var(--danger); border-color: #3a1520; }
.action-btn-danger:hover { background: var(--danger-dim); border-color: var(--danger); }

/* ── STATUS COMPOSE PAGE ──────────────────────────── */
.status-page {
  max-width: 580px;
  margin: 0 auto;
}

.status-header { margin-bottom: 1.5rem; }
.status-header h1 { font-family: var(--font-mono); font-size: 1.4rem; font-weight: 700; letter-spacing: 0.12em; overflow: visible; }
.status-subtitle { font-size: 0.825rem; color: var(--text-3); margin-top: 0.2rem; }

.status-compose {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
  transition: border-color 0.2s;
}

.status-compose:focus-within { border-color: var(--accent); }

.status-compose textarea {
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  font-size: 1rem;
  resize: none;
  min-height: 60px;
  color: var(--text);
  width: 100%;
  font-family: var(--font);
}

.status-compose textarea::placeholder { color: var(--text-3); }
.status-compose textarea:focus { outline: none; }

.status-compose-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.char-count { font-size: 0.8rem; color: var(--text-3); font-weight: 600; }

.bubbles { display: flex; flex-direction: column; gap: 0.7rem; }

.bubble-wrap { display: flex; flex-direction: column; align-items: flex-end; }

/* ── SINGLE POST ──────────────────────────────────── */
.post {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 680px;
  margin: 0 auto;
  box-shadow: var(--shadow);
}

.post-image { width: 100%; height: auto; }
.post-meta { padding: 1.1rem 1.25rem; }
.post-caption { font-size: 1rem; margin-bottom: 0.9rem; white-space: pre-wrap; line-height: 1.6; }

.post-details {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.8rem;
  color: var(--text-2);
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.9rem;
}

.post-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ── BADGE ────────────────────────────────────────── */
.badge {
  background: #2a1f00;
  color: #f0c040;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

/* ── AUTH CARD ────────────────────────────────────── */
.auth-card {
  max-width: 380px;
  margin: 3rem auto;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow);
}

.auth-card h1 { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 1.5rem; }

/* ── FORMS ────────────────────────────────────────── */
label {
  display: block;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="file"],
textarea {
  display: block;
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: var(--font);
  background: var(--bg-2);
  color: var(--text);
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s, background 0.15s;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-3);
}

input::placeholder, textarea::placeholder { color: var(--text-3); }

textarea { resize: vertical; }

/* ── BUTTONS ──────────────────────────────────────── */
button, .btn-primary, .btn-secondary, .btn-danger {
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.65rem 1.25rem;
  transition: opacity 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  letter-spacing: 0.01em;
}

button:hover, .btn-primary:hover, .btn-secondary:hover { opacity: 0.85; }
button:active { transform: scale(0.97); }

.btn-primary  { background: var(--accent); color: var(--bg); display: inline-block; }
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border-2); display: inline-block; }
.btn-danger   { background: var(--danger); color: #fff; }
.btn-link     { background: none; color: var(--text-2); padding: 0.4rem 0.5rem; font-size: 0.875rem; font-weight: 500; border: none; }
.btn-link:hover { color: var(--text); opacity: 1; }
.btn-block    { display: block; width: 100%; padding: 0.85rem; font-size: 1rem; text-align: center; }

/* ── ERROR ────────────────────────────────────────── */
.error {
  background: var(--danger-dim);
  color: var(--danger);
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.875rem;
  border: 1px solid #5a1525;
}

/* ── PAGE HEADER (archive etc) ────────────────────── */
.page-header { margin-bottom: 1.75rem; }
.page-header h1 { font-family: var(--font-mono); font-size: 1.4rem; font-weight: 700; letter-spacing: 0.12em; overflow: visible; }
.page-header .subtitle { font-size: 0.825rem; color: var(--text-3); margin-top: 0.2rem; display: block; }

/* ── UPLOAD PAGE ──────────────────────────────────── */
.upload-card {
  max-width: 520px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow);
}

.upload-card h1 { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 1.5rem; }

/* ── MOBILE ───────────────────────────────────────── */
@media (max-width: 600px) {
  :root { --nav-h: 50px; }

  body { font-size: 15px; }

  .container { padding: 1.25rem 1rem 3rem; }

  .nav { padding: 0 1rem; }

  .nav-links a { font-size: 0.82rem; padding: 0.35rem 0.5rem; }

  .btn-nav { padding: 0.35rem 0.75rem !important; font-size: 0.78rem !important; }

  .feed-header h1 { font-size: 1.35rem; }

  .bubble { max-width: 92%; }

  input[type="text"], input[type="password"], input[type="date"],
  input[type="file"], textarea { font-size: 16px; }

  .post-meta { padding: 0.85rem 1rem; }

  .auth-card, .upload-card { padding: 1.5rem 1.25rem; margin: 1.5rem auto; }
}

@media (max-width: 380px) {
  .nav-links a { font-size: 0.78rem; padding: 0.3rem 0.4rem; }
  .bubble { max-width: 96%; }
}

/* ── SETTINGS PAGE ────────────────────────────────── */
.settings-page {
  max-width: 560px;
  margin: 0 auto;
}

.settings-header { margin-bottom: 1.75rem; }
.settings-header h1 { font-family: var(--font-mono); font-size: 1.4rem; font-weight: 700; letter-spacing: 0.12em; overflow: visible; }
.settings-subtitle { font-size: 0.825rem; color: var(--text-3); margin-top: 0.2rem; }

.settings-toast {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.settings-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.settings-group-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 0.7rem 1.1rem 0.4rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--border);
  min-height: 56px;
}

.settings-row:last-child { border-bottom: none; }

.settings-row-col {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
}

.settings-row-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
}

.settings-row-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

.settings-row-desc {
  font-size: 0.78rem;
  color: var(--text-3);
}

.settings-row-label-inline {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  flex: 1;
  margin: 0;
  text-transform: none;
  letter-spacing: 0;
}

.settings-input {
  background: var(--bg-2);
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  font-family: var(--font);
  padding: 0.5rem 0.75rem;
  text-align: right;
  width: 200px;
  margin: 0;
  margin-top: 0;
}

.settings-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-3);
}

.settings-input-sm { width: 80px; }

/* Toggle switch */
.toggle { position: relative; display: inline-block; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }

.toggle-track {
  display: block;
  width: 44px;
  height: 26px;
  background: var(--border-2);
  border-radius: 13px;
  cursor: pointer;
  transition: background 0.2s;
  position: relative;
}

.toggle input:checked + .toggle-track { background: var(--accent); }

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.toggle input:checked + .toggle-track .toggle-thumb { transform: translateX(18px); }

/* Theme picker */
.theme-picker {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.theme-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

.theme-swatch {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid transparent;
  transition: border-color 0.15s, transform 0.15s;
}

.theme-option.selected .theme-swatch,
.theme-option:hover .theme-swatch { transform: scale(1.08); }

.theme-dot { width: 10px; height: 10px; border-radius: 50%; }

.theme-label { font-size: 0.7rem; color: var(--text-3); font-weight: 500; }

/* Segment control */
.segment-control {
  display: flex;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.segment {
  flex: 1;
  text-align: center;
  padding: 0.45rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s;
  border-right: 1px solid var(--border-2);
}

.segment:last-child { border-right: none; }
.segment.active { background: var(--surface-2); color: var(--text); }
.segment:hover:not(.active) { color: var(--text); }

/* Color picker */
.color-control { display: flex; align-items: center; gap: 0.6rem; }

.color-picker {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  padding: 2px;
  background: none;
  margin: 0;
}

.color-value {
  font-size: 0.78rem;
  color: var(--text-3);
  font-family: monospace;
  font-weight: 600;
}

/* Avatar controls */
.settings-avatar-control {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.avatar-preview {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-2);
}

.avatar-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 2px solid var(--border-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
}

.avatar-upload-btn {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--accent);
  border-radius: 20px;
  transition: all 0.15s;
  text-transform: none;
  letter-spacing: 0;
  margin: 0;
}

.avatar-upload-btn:hover { background: var(--accent-dim); }

.avatar-remove-btn {
  font-size: 0.78rem;
  font-weight: 600;
  background: none;
  border: 1px solid var(--border-2);
  color: var(--text-3);
  padding: 0.3rem 0.6rem;
  border-radius: 20px;
  cursor: pointer;
}

.avatar-remove-btn:hover { color: var(--danger); border-color: var(--danger); opacity: 1; }

/* Nav avatar */
.nav-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--border-2);
}

.nav-icon-btn {
  font-size: 1rem;
  color: var(--text-3) !important;
  padding: 0.35rem 0.5rem !important;
}
.nav-icon-btn:hover { color: var(--text) !important; }

/* Save button */
.btn-save {
  width: 100%;
  padding: 0.85rem;
  font-size: 1rem;
  border-radius: var(--radius);
  margin-top: 0.5rem;
}

@media (max-width: 600px) {
  .settings-input { width: 140px; }
  .settings-input-sm { width: 70px; }
  .theme-swatch { width: 36px; height: 36px; }
}

/* Font picker */
.font-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  width: 100%;
}

.font-option {
  cursor: pointer;
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.7rem;
  background: var(--bg-2);
  transition: border-color 0.15s, background 0.15s;
}

.font-option.selected {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.font-option:hover:not(.selected) {
  border-color: var(--text-3);
  background: var(--bg-3);
}

.font-preview {
  font-size: 0.82rem;
  color: var(--text);
  white-space: nowrap;
  display: block;
}

/* ── ARCHIVE GRID PAGE ────────────────────────────── */
.archive-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.archive-header h1 {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  overflow: visible;
}

.archive-subtitle {
  font-size: 0.825rem;
  color: var(--text-3);
  margin-top: 0.2rem;
}

.archive-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
}

.grid-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  display: block;
  background: var(--surface);
  border-radius: 0;
}

/* ── PHOTO TILE ───────────────────────────────────── */
.grid-tile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.grid-tile-photo:hover img { transform: scale(1.04); }

.tile-location-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  font-size: 0.65rem;
  line-height: 1;
  background: rgba(0,0,0,0.55);
  border-radius: 4px;
  padding: 2px 4px;
}

/* ── STATUS TILE ──────────────────────────────────── */
.grid-tile-status {
  background: var(--bubble-bg);
  border: none;
  padding: 0.7rem 0.65rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  height: 100%;
  cursor: pointer;
  font-family: var(--font);
  color: var(--text);
  text-align: left;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.grid-tile-status:hover { background: var(--surface-2); opacity: 1; }

.tile-status-icon {
  font-size: 0.75rem;
  color: var(--accent);
  line-height: 1;
}

.tile-status-excerpt {
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--text);
  flex: 1;
  margin: 0.3rem 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

.tile-status-time {
  display: block;
  font-size: 0.6rem;
  color: var(--text-3);
  font-weight: 500;
}

/* ── STATUS MODAL ─────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  max-width: 420px;
  width: 100%;
  position: relative;
  box-shadow: 0 8px 40px rgba(0,0,0,0.55);
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  line-height: 1;
  transition: color 0.15s;
}

.modal-close:hover { color: var(--text); opacity: 1; }

.modal-bubble {
  background: var(--bubble-bg);
  border: 1px solid var(--bubble-border);
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) var(--radius-sm);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}

.modal-text {
  font-size: 0.975rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.modal-time {
  display: block;
  font-size: 0.72rem;
  color: var(--text-3);
  text-align: right;
}

.modal-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

/* ── ARCHIVE MOBILE ───────────────────────────────── */
@media (max-width: 600px) {
  .archive-grid {
    gap: 2px;
    /* Break out of container padding so grid fills edge-to-edge */
    margin-left: -1rem;
    margin-right: -1rem;
  }

  .grid-tile-status {
    padding: 0.5rem;
  }

  .tile-status-icon { font-size: 0.65rem; }

  .tile-status-excerpt {
    font-size: 0.65rem;
    -webkit-line-clamp: 3;
    margin: 0.2rem 0;
  }

  .tile-status-time { font-size: 0.55rem; }

  .modal-card { padding: 1.25rem 1rem; }
}

/* ── NOW PLAYING WIDGET (feed) ────────────────────── */
.now-playing {
  flex: 1;
  min-width: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-2);
  background: var(--surface);
  box-shadow: var(--shadow);
  /* Force GPU layer so overflow:hidden clips child iframes at border-radius in Safari */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.now-playing-bar {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 0;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
  outline: none;
  overflow: hidden;
}

.now-playing-bar:hover { background: var(--surface-2); }

.now-playing-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.now-playing-cover-btn {
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
  width: 76px;
  align-self: stretch;
  overflow: hidden;
  z-index: 2;
}

.now-playing-info-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  padding: 0.8rem 1rem 0.8rem 0.85rem;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.now-playing-cover-btn .cover-play-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  transition: opacity 0.15s;
}

.now-playing-cover-btn:hover .cover-play-icon,
.now-playing-cover-btn.playing .cover-play-icon { opacity: 1; }

.now-playing-cover-ph {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  flex-shrink: 0;
}

.now-playing-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.now-playing-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-family: var(--font-mono);
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
}

@keyframes np-scroll {
  0%        { transform: translateX(0); }
  10%       { transform: translateX(0); }
  90%       { transform: translateX(var(--np-scroll-dist)); }
  100%      { transform: translateX(var(--np-scroll-dist)); }
}

.now-playing-track,
.now-playing-artist {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.now-playing-track {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.now-playing-artist {
  font-size: 0.78rem;
  color: var(--text-2);
}

.now-playing-track.scrolling,
.now-playing-artist.scrolling {
  overflow: visible;
  text-overflow: clip;
  animation: np-scroll 6s ease-in-out infinite alternate;
}

.now-playing-chevron {
  color: var(--text-3);
  flex-shrink: 0;
  transition: transform 0.25s;
}

.now-playing-chevron.open { transform: rotate(180deg); }

.now-playing-embed {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
  background: var(--surface);
}

.now-playing-embed.open { max-height: 90px; }

.now-playing-embed iframe {
  display: block;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

/* ── NOW PLAYING MANAGEMENT PAGE ─────────────────── */
.music-page {
  max-width: 560px;
  margin: 0 auto;
}

.music-current {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.music-current-inner {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1rem 0.75rem;
}

.music-current-cover {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.music-current-cover-ph {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  flex-shrink: 0;
}

.music-current-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.music-current-track  { font-size: 0.92rem; font-weight: 600; color: var(--text); }
.music-current-artist { font-size: 0.8rem;  color: var(--text-2); }
.music-current-album  { font-size: 0.72rem; color: var(--text-3); }

.music-current-actions {
  display: flex;
  gap: 0.5rem;
  padding: 0 1rem 0.85rem;
}

.music-paste-wrap { margin-bottom: 1.25rem; }

.music-paste-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font-size: 0.78rem;
  color: var(--text-2);
  margin-bottom: 0.4rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
}

.music-paste-hint {
  font-size: 0.72rem;
  color: var(--text-3);
  margin-top: 0.4rem;
}

.music-search-input {
  width: 100%;
  margin-top: 0;
}

.music-preview-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}

.music-preview-cover {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.music-preview-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.music-preview-track  { font-size: 1rem;   font-weight: 600; color: var(--text); }
.music-preview-artist { font-size: 0.85rem; color: var(--text-2); }
.music-preview-album  { font-size: 0.75rem; color: var(--text-3); }

.music-result-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.music-result {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  transition: border-color 0.15s;
}

.music-result:hover { border-color: var(--border-2); }

.music-result-cover {
  width: 44px;
  height: 44px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}

.music-result-cover-ph {
  width: 44px;
  height: 44px;
  border-radius: 4px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  flex-shrink: 0;
}

.music-result-info {
  flex: 1;
  min-width: 0;
}

.music-result-track  { font-size: 0.88rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music-result-artist { font-size: 0.78rem; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music-result-album  { font-size: 0.7rem;  color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.music-empty { font-size: 0.875rem; color: var(--text-3); padding: 0.5rem 0; }

/* ── Passkey UI ────────────────────────────────────────────────── */
.btn-passkey {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* auth-divider between passkey and password login */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--text-3);
  font-size: 0.8rem;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
