@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,400;14..32,500;14..32,600;14..32,700;14..32,800;14..32,900&family=JetBrains+Mono:wght@400;500;700&family=Noto+Serif+SC:wght@700;900&display=swap');

:root {
  --bg-base: #050507;
  --bg-surface: #0C0C10;
  --bg-elevated: #131318;
  --bg-hover: #1A1A22;
  --bg-active: #22222C;
  --bg-inset: #08080C;
  --text-primary: #EEEEF0;
  --text-secondary: #9898A6;
  --text-tertiary: #65657A;
  --text-muted: #44445A;
  --border-default: rgba(255,255,255,0.07);
  --border-subtle: rgba(255,255,255,0.04);
  --border-strong: rgba(255,255,255,0.12);
  --border-emphasis: rgba(255,255,255,0.18);
  --surface-glass: rgba(255,255,255,0.02);
  --surface-overlay: rgba(0,0,0,0.7);
  --brand: #10B981;
  --brand-rgb: 16,185,129;
  --brand-deep: #059669;
  --brand-subtle: rgba(16,185,129,0.06);
  --brand-muted: rgba(16,185,129,0.14);
  --brand-fg: #34D399;
  --accent: #F59E0B;
  --accent-rgb: 245,158,11;
  --accent-subtle: rgba(245,158,11,0.06);
  --accent-muted: rgba(245,158,11,0.14);
  --accent-fg: #FBBF24;
  --rose: #FB7185;
  --rose-rgb: 251,113,133;
  --cyan: #22D3EE;
  --cyan-rgb: 34,211,238;
  --nav-width: 200px;
  --content-max: 740px;
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 999px;
  --font-sans: "Inter", system-ui, -apple-system, "Noto Sans SC", sans-serif;
  --font-display: "Noto Serif SC", "Inter", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="light"] {
  --bg-base: #F8F8FA;
  --bg-surface: #FFFFFF;
  --bg-elevated: #F0F0F4;
  --bg-hover: #E4E4EA;
  --bg-active: #D8D8E0;
  --bg-inset: #ECECF0;
  --text-primary: #0C0C14;
  --text-secondary: #4A4A60;
  --text-tertiary: #6E6E82;
  --text-muted: #9E9EB0;
  --border-default: rgba(0,0,0,0.07);
  --border-subtle: rgba(0,0,0,0.04);
  --border-strong: rgba(0,0,0,0.12);
  --border-emphasis: rgba(0,0,0,0.18);
  --surface-glass: rgba(0,0,0,0.02);
  --surface-overlay: rgba(255,255,255,0.8);
  --brand: #059669;
  --brand-rgb: 5,150,105;
  --brand-deep: #047857;
  --brand-subtle: rgba(5,150,105,0.05);
  --brand-muted: rgba(5,150,105,0.10);
  --brand-fg: #047857;
  --accent: #D97706;
  --accent-rgb: 217,119,6;
  --accent-subtle: rgba(217,119,6,0.05);
  --accent-muted: rgba(217,119,6,0.10);
  --accent-fg: #B45309;
}

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

html { font-size: 14px; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 10% -10%, rgba(var(--brand-rgb),0.10) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% -5%, rgba(var(--accent-rgb),0.06) 0%, transparent 55%),
    radial-gradient(ellipse 40% 40% at 50% 100%, rgba(var(--brand-rgb),0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.015;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px;
  pointer-events: none;
  z-index: 0;
}

a { color: var(--brand-fg); text-decoration: none; transition: color 120ms; }
a:hover { color: var(--brand); }
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
img { max-width: 100%; height: auto; display: block; }

.app-shell {
  display: grid;
  grid-template-columns: var(--nav-width) minmax(0, 1fr);
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--nav-width);
  background: rgba(8,8,12,0.85);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 16px 10px 14px;
  z-index: 100;
  overflow-y: auto;
  transition: transform 0.3s var(--ease);
}

[data-theme="light"] .sidebar {
  background: rgba(255,255,255,0.82);
}

.sidebar-close {
  display: none;
  position: absolute;
  top: 10px; right: 10px;
  width: 28px; height: 28px;
  border-radius: var(--radius-xs);
  background: var(--bg-hover);
  align-items: center; justify-content: center;
  color: var(--text-tertiary);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 8px 16px;
  margin-bottom: 4px;
  text-decoration: none;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 2px;
  font-weight: 800;
  font-size: 24px;
  letter-spacing: 0.06em;
}

.brand-logo-ai {
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-logo-orbit {
  position: relative;
  width: 16px; height: 16px;
  display: flex;
  align-items: center; justify-content: center;
}

.brand-logo-orbit-core {
  width: 6px; height: 6px;
  background: var(--brand);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(var(--brand-rgb),0.6), 0 0 4px rgba(var(--brand-rgb),0.8);
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(var(--brand-rgb),0.4), 0 0 3px rgba(var(--brand-rgb),0.6); }
  50% { box-shadow: 0 0 18px rgba(var(--brand-rgb),0.7), 0 0 6px rgba(var(--brand-rgb),0.9); }
}

.brand-logo-hot { color: var(--text-primary); }

.sidebar-divider { height: 1px; background: var(--border-subtle); margin: 4px 8px 8px; }

.side-nav { display: flex; flex-direction: column; gap: 1px; flex: 1; }

.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  font-size: 13px;
  font-weight: 500;
  transition: all 150ms var(--ease);
  text-decoration: none;
  position: relative;
}

.side-link:hover {
  color: var(--text-primary);
  background: var(--surface-glass);
}

.side-link-active {
  color: var(--brand-fg);
  background: var(--brand-subtle);
  font-weight: 600;
}

.side-link-active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 18px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, var(--brand), var(--brand-deep));
  box-shadow: 0 0 8px rgba(var(--brand-rgb),0.3);
}

.side-icon { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.6; }
.side-link-active .side-icon { opacity: 1; }
.side-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-footer {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

.theme-toggle {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.theme-seg {
  flex: 1;
  text-align: center;
  padding: 5px 0;
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 150ms;
}

.theme-seg:hover { color: var(--text-tertiary); }

.theme-seg-active {
  background: var(--bg-active);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* ===== MAIN ===== */
.app-main {
  grid-column: 2;
  padding: 24px 32px 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}

.app-mobile-bar {
  display: none;
  position: sticky;
  top: 0; z-index: 90;
  background: rgba(5,5,7,0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 14px;
  align-items: center;
  gap: 12px;
}

[data-theme="light"] .app-mobile-bar { background: rgba(248,248,250,0.88); }

.app-hamburger {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
}
.app-hamburger:hover { background: var(--bg-hover); }

.app-mobile-brand {
  font-weight: 800; font-size: 16px; letter-spacing: 0.06em;
  text-decoration: none;
}
.app-mobile-brand .brand-logo-ai { color: var(--brand-fg); -webkit-text-fill-color: var(--brand-fg); }
.app-mobile-bar-spacer { width: 36px; }

/* ===== PAGE ===== */
.page {
  width: 100%;
  max-width: var(--content-max);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ===== BENTO HERO ===== */
.bento-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 8px;
}

.bento-featured {
  grid-row: 1 / 3;
  background: linear-gradient(160deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  position: relative;
  overflow: hidden;
  transition: all 250ms var(--ease);
}

.bento-featured::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--brand), var(--brand-deep), transparent);
}

.bento-featured::after {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 160px; height: 160px;
  background: radial-gradient(circle, rgba(var(--brand-rgb),0.08), transparent 70%);
  pointer-events: none;
}

.bento-featured:hover {
  border-color: var(--border-strong);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3), 0 0 0 1px rgba(var(--brand-rgb),0.1);
  transform: translateY(-2px);
}

.bento-featured-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-fg);
  margin-bottom: 14px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--accent-subtle);
  border: 1px solid rgba(var(--accent-rgb),0.2);
}

.bento-featured-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.35;
  color: var(--text-primary);
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.bento-featured-title a { color: var(--text-primary); transition: color 120ms; }
.bento-featured-title a:hover { color: var(--brand-fg); }

.bento-featured-summary {
  font-size: 13px;
  line-height: 1.75;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bento-stat {
  background: linear-gradient(160deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  transition: all 200ms;
}
.bento-stat:hover { border-color: var(--border-strong); }

.bento-stat-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.bento-stat-value {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.bento-stat-value.brand {
  background: linear-gradient(135deg, var(--brand-fg), var(--brand));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== TOOLBAR ===== */
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.segmented {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  overflow-x: auto;
}

.seg-item {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  transition: all 150ms;
  cursor: pointer;
  text-decoration: none;
}

.seg-item:hover { color: var(--text-secondary); }

.seg-item-active {
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(var(--brand-rgb),0.3);
}

.search-box {
  flex: 1;
  min-width: 160px;
  position: relative;
}

.search-box .search-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  min-height: 34px;
  padding: 0 60px 0 34px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: all 150ms;
}

.search-input:focus {
  border-color: rgba(var(--brand-rgb),0.4);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb),0.08);
}
.search-input::placeholder { color: var(--text-muted); }

.search-kbd {
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  font-family: var(--font-mono);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background: var(--bg-hover);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  pointer-events: none;
}

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

.timeline-day { display: flex; flex-direction: column; }

.timeline-day-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 16px 0 8px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.timeline-day-head::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--bg-base);
  z-index: -1;
}

.timeline-date {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
}

.timeline-day-toggle {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  transition: all 150ms;
}
.timeline-day-toggle:hover { background: var(--bg-hover); }
.timeline-day-toggle.collapsed { transform: rotate(-90deg); }

.timeline-day-items { display: flex; flex-direction: column; gap: 6px; }

/* ===== FEED ITEM ===== */
.feed-item {
  background: linear-gradient(160deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: all 250ms var(--ease);
  position: relative;
  animation: fadeIn 0.4s var(--ease) both;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.feed-item:hover {
  border-color: var(--border-strong);
  background: linear-gradient(160deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.feed-item.featured {
  border-left: 3px solid transparent;
  border-image: linear-gradient(180deg, var(--accent), rgba(var(--accent-rgb),0.3)) 1;
  background: linear-gradient(90deg, var(--accent-subtle), linear-gradient(160deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01)));
  background: linear-gradient(90deg, var(--accent-subtle), rgba(255,255,255,0.04));
}

.feed-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.feed-item-source { display: flex; align-items: center; gap: 6px; min-width: 0; }

.feed-item-avatar {
  width: 18px; height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--bg-active);
  border: 1px solid var(--border-subtle);
}

.feed-item-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feed-item-handle { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }

.feed-item-meta { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }

.feed-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.feed-badge-featured {
  color: var(--accent-fg);
  background: var(--accent-subtle);
  border: 1px solid rgba(var(--accent-rgb),0.2);
}

.feed-badge-score {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-muted);
  background: var(--surface-glass);
  border: 1px solid var(--border-subtle);
}

.feed-badge-score.high {
  color: var(--brand-fg);
  background: var(--brand-subtle);
  border-color: var(--brand-muted);
  box-shadow: 0 0 6px rgba(var(--brand-rgb),0.15);
}
.feed-badge-score.mid {
  color: var(--accent-fg);
  background: var(--accent-subtle);
  border-color: var(--accent-muted);
}

.feed-item-time {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

/* ===== ITEM CONTENT ===== */
.feed-title {
  display: block;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text-primary);
  margin-bottom: 4px;
  transition: color 120ms;
}
.feed-title:hover { color: var(--brand-fg); }

.feed-summary {
  font-size: 13px;
  line-height: 1.75;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.feed-body { display: block; transition: opacity 120ms; }
.feed-body:hover { opacity: 0.82; }

.feed-body-text {
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== MEDIA ===== */
.feed-media {
  display: flex;
  gap: 4px;
  margin-top: 10px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.feed-media-cell {
  display: block;
  width: 100%;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  padding: 0;
  transition: border-color 150ms;
}
.feed-media-cell:hover { border-color: var(--border-strong); }

.feed-media-cell img {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  display: block;
}

.feed-media-cell-video { position: relative; }

.feed-media-play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 40px; height: 40px;
  background: rgba(0,0,0,0.5);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  pointer-events: none;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.15);
}

/* ===== TAGS ===== */
.feed-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }

.feed-tag {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  background: var(--surface-glass);
  color: var(--text-tertiary);
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
  cursor: pointer;
  transition: all 150ms;
  text-decoration: none;
}

.feed-tag:hover {
  color: var(--brand-fg);
  background: var(--brand-subtle);
  border-color: var(--brand-muted);
}

/* ===== REASON ===== */
.feed-reason-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--brand-fg);
  opacity: 0.6;
  cursor: pointer;
  transition: opacity 150ms;
  padding: 0;
}
.feed-reason-toggle:hover { opacity: 1; }
.feed-reason-toggle svg { transition: transform 150ms; }
.feed-reason-toggle.open svg { transform: rotate(90deg); }

.feed-reason {
  display: none;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-tertiary);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--brand-subtle), rgba(var(--brand-rgb),0.02));
  border: 1px solid rgba(var(--brand-rgb),0.1);
}

.feed-reason.open { display: block; animation: fadeIn 0.2s var(--ease); }
.feed-reason-label { color: var(--brand-fg); font-weight: 600; }

/* ===== LOAD MORE ===== */
.load-more-wrap { display: flex; justify-content: center; padding: 16px 0; }

.load-more-btn {
  padding: 9px 32px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-default);
  background: linear-gradient(160deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: all 200ms var(--ease);
}

.load-more-btn:hover {
  border-color: rgba(var(--brand-rgb),0.35);
  color: var(--brand-fg);
  background: var(--brand-subtle);
  box-shadow: 0 0 16px rgba(var(--brand-rgb),0.1);
}

/* ===== LOADING ===== */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  color: var(--text-muted);
  font-size: 13px;
  gap: 10px;
}

.spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--border-default);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.5s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); font-size: 13px; }

/* ===== CMD+K ===== */
.cmd-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  z-index: 200;
  align-items: flex-start;
  justify-content: center;
  padding-top: 16vh;
}
.cmd-modal-overlay.open { display: flex; }

.cmd-modal {
  width: 560px;
  max-width: calc(100vw - 32px);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
  overflow: hidden;
}

.cmd-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
}
.cmd-input-wrap svg { color: var(--text-muted); flex-shrink: 0; }

.cmd-input {
  flex: 1;
  border: none;
  background: none;
  color: var(--text-primary);
  font-size: 15px;
  outline: none;
}
.cmd-input::placeholder { color: var(--text-muted); }

.cmd-kbd {
  font-size: 10px;
  font-family: var(--font-mono);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background: var(--bg-hover);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.cmd-results { max-height: 320px; overflow-y: auto; }

.cmd-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 100ms;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 13px;
}
.cmd-result-item:hover { background: var(--bg-hover); }

.cmd-result-tag {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  background: var(--brand-subtle);
  color: var(--brand-fg);
  font-weight: 600;
  font-family: var(--font-mono);
}

/* ===== OVERLAY ===== */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 99;
}
.sidebar-overlay.active { display: block; }

/* ===== CONTENT CARD ===== */
.content-card {
  background: linear-gradient(160deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 24px;
}

[data-theme="light"] .content-card { background: var(--bg-surface); }

.content-card h2 {
  font-family: var(--font-display);
  font-size: 16px;
  margin: 20px 0 8px;
  color: var(--text-primary);
}

.content-card p {
  color: var(--text-secondary);
  margin-bottom: 10px;
  line-height: 1.75;
  font-size: 13px;
}

.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 12px; font-weight: 500; margin-bottom: 5px; color: var(--text-tertiary); }

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-inset);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  outline: none;
  transition: all 150ms;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: rgba(var(--brand-rgb),0.4);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb),0.08);
}

.form-textarea { min-height: 100px; resize: vertical; }
.form-select { min-height: auto; }

.btn { padding: 8px 16px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; transition: all 150ms; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { box-shadow: 0 0 16px rgba(var(--brand-rgb),0.25); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { transform: translateX(-100%); width: 260px; box-shadow: 8px 0 32px rgba(0,0,0,0.3); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: flex; }
  .app-mobile-bar { display: flex; }
  .app-main { grid-column: 1; padding: 14px 14px 60px; }
  .bento-hero { grid-template-columns: 1fr; }
  .bento-featured { grid-row: auto; }
  .toolbar { flex-direction: column; }
  .search-kbd { display: none; }
  .feed-item-time { display: none; }
  .feed-media-cell img { max-height: 200px; }
  .cmd-modal { width: calc(100vw - 16px); }
}

@media (max-width: 480px) {
  .bento-hero { display: none; }
  .segmented { flex-wrap: nowrap; }
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
::selection { background: rgba(var(--brand-rgb), 0.25); }
