:root {
  --bg: #f1efe9;
  --panel: #faf9f5;
  --panel-2: #e7e4dc;
  --ink: #181917;
  --muted: #707169;
  --line: #d7d4ca;
  --acid: #d8f75a;
  --coral: #ff725e;
  --violet: #8267f5;
  --blue: #7fc9ff;
  --shadow: 0 24px 60px rgba(29, 27, 22, .12);
  --radius: 18px;
}

[data-theme="dark"] {
  --bg: #121310;
  --panel: #1b1c18;
  --panel-2: #24251f;
  --ink: #f0efe9;
  --muted: #aaa9a0;
  --line: #36372f;
  --shadow: 0 24px 60px rgba(0, 0, 0, .34);
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { margin: 0; min-width: 320px; }
button, input { font: inherit; }
select, textarea { font: inherit; color: inherit; }
button { color: inherit; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 228px minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 26px 18px 20px; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; background: color-mix(in srgb, var(--panel) 82%, transparent);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 28px; }
.brand-mark {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; color: #141510;
  background: var(--acid); font: 800 22px/1 ui-monospace, SFMono-Regular, Menlo, monospace; transform: rotate(-5deg);
}
.brand strong { display: block; letter-spacing: -.04em; font-size: 17px; }
.brand span { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
nav { display: grid; gap: 4px; }
.nav-item {
  width: 100%; border: 0; background: transparent; border-radius: 12px; display: grid;
  grid-template-columns: 24px 1fr auto; align-items: center; text-align: left; gap: 9px; padding: 10px 12px;
  color: var(--muted); cursor: pointer; transition: .16s ease;
}
.nav-item span { font: 600 17px/1 ui-monospace, monospace; color: inherit; }
.nav-item em { min-width: 20px; height: 20px; padding: 0 6px; display: grid; place-items: center; border-radius: 10px; background: var(--coral); color: #fff; font-size: 10px; font-style: normal; }
.nav-item:hover { background: var(--panel-2); color: var(--ink); }
.nav-item.active { background: var(--ink); color: var(--panel); }
.sidebar-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding: 12px 8px 0; }
.icon-button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: var(--panel); cursor: pointer; }
.privacy-chip { font-size: 10px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.privacy-chip i { width: 7px; height: 7px; background: #62bc65; border-radius: 50%; box-shadow: 0 0 0 3px color-mix(in srgb, #62bc65 20%, transparent); }

.workspace { min-width: 0; padding: 42px clamp(24px, 4vw, 64px) 80px; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; max-width: 1200px; margin: 0 auto; }
.eyebrow { margin: 0 0 5px; color: var(--muted); font: 600 11px/1.2 ui-monospace, SFMono-Regular, monospace; text-transform: uppercase; letter-spacing: .1em; }
h1 { margin: 0; font-size: clamp(32px, 4vw, 54px); line-height: .95; letter-spacing: -.06em; font-weight: 690; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.search-box { width: min(31vw, 330px); height: 43px; display: flex; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.search-box span { color: var(--muted); font-size: 18px; }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); }
.search-box kbd { padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: var(--bg); font-size: 10px; }
.sync-button { height: 43px; border: 0; padding: 0 16px; border-radius: 14px; background: var(--acid); color: #17180f; cursor: pointer; font-weight: 700; }
.sync-button.loading span { display: inline-block; animation: spin 1s linear infinite; }

.summary-strip { max-width: 1200px; margin: 32px auto 26px; display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.summary-item { min-width: 0; padding: 17px 20px; border-right: 1px solid var(--line); }
.summary-item:last-child { border: 0; }
.summary-item span { display: block; color: var(--muted); font-size: 11px; }
.summary-item strong { display: block; margin-top: 4px; font: 650 21px/1.1 ui-monospace, SFMono-Regular, monospace; letter-spacing: -.04em; }

.content { max-width: 1200px; margin: 0 auto; }
.feed-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.post-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform .18s ease, box-shadow .18s ease; cursor: pointer; }
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.post-card.selected { outline: 3px solid var(--acid); outline-offset: 2px; }
.media-tile { aspect-ratio: 1; background: var(--panel-2); position: relative; overflow: hidden; }
.media-tile img, .media-tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-tile::before { content: ""; position: absolute; inset: 0; background: var(--media-gradient, linear-gradient(145deg, #ffd6bd, #ef6e67 46%, #4c3c73)); }
.media-tile.has-media::before { display: none; }
.media-kind { position: absolute; top: 12px; right: 12px; z-index: 2; padding: 5px 8px; border-radius: 999px; color: #fff; background: rgba(14, 14, 12, .62); backdrop-filter: blur(8px); font: 600 9px/1 ui-monospace, monospace; text-transform: uppercase; letter-spacing: .08em; }
.select-post {
  position: absolute; z-index: 4; left: 11px; top: 11px; width: 30px; height: 30px; border: 1px solid rgba(255,255,255,.7);
  border-radius: 50%; background: rgba(20,20,18,.56); color: #fff; cursor: pointer; backdrop-filter: blur(8px);
}
.select-post.active { background: var(--acid); border-color: var(--acid); color: #17180f; }
.mini-palette { position: absolute; z-index: 3; left: 12px; bottom: 12px; display: flex; padding: 4px; border-radius: 999px; background: rgba(20,20,18,.48); backdrop-filter: blur(8px); }
.mini-palette i { width: 13px; height: 13px; margin-left: -2px; border: 1px solid rgba(255,255,255,.8); border-radius: 50%; background: var(--swatch); }
.mini-palette i:first-child { margin-left: 0; }
.post-body { padding: 14px 15px 15px; }
.post-author { display: flex; align-items: center; gap: 9px; margin-bottom: 11px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--avatar, var(--violet)); color: #fff; font-size: 10px; font-weight: 750; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.post-author strong { display: block; font-size: 12px; }
.post-author span { display: block; color: var(--muted); font-size: 10px; margin-top: 1px; }
.post-caption { min-height: 40px; margin: 0; color: color-mix(in srgb, var(--ink) 86%, var(--muted)); font-size: 12px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 13px; color: var(--muted); font-size: 11px; }
.post-meta div { display: flex; gap: 11px; }
.post-meta .saved { color: var(--ink); }
.match-reasons { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.match-reasons span { padding: 5px 7px; border-radius: 7px; background: color-mix(in srgb, var(--acid) 30%, var(--panel)); color: color-mix(in srgb, var(--ink) 85%, var(--muted)); font-size: 9px; }

.section-head { display: flex; justify-content: space-between; align-items: center; margin: 8px 0 16px; }
.section-head h2 { margin: 0; font-size: 18px; letter-spacing: -.03em; }
.section-head p { margin: 0; color: var(--muted); font-size: 11px; }
.list-panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list-row { width: 100%; border: 0; border-bottom: 1px solid var(--line); padding: 16px 18px; background: transparent; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; text-align: left; cursor: pointer; }
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--panel-2); }
.list-row h3 { margin: 0 0 4px; font-size: 13px; }
.list-row p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row time { color: var(--muted); font: 10px/1 ui-monospace, monospace; }
.score { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--acid) 35%, var(--panel)); font: 700 11px/1 ui-monospace, monospace; }

.network-grid, .insights-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.metric-card { padding: 20px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.metric-card.wide { grid-column: 1 / -1; }
.metric-card h2 { margin: 0 0 18px; font-size: 14px; }
.big-number { font: 650 clamp(42px, 6vw, 76px)/.9 ui-monospace, monospace; letter-spacing: -.08em; }
.metric-note { margin: 12px 0 0; color: var(--muted); font-size: 11px; }
.bars { display: flex; align-items: end; gap: 8px; min-height: 150px; padding-top: 10px; }
.bar { min-width: 16px; flex: 1; height: var(--h); border-radius: 6px 6px 2px 2px; background: var(--violet); position: relative; }
.bar:hover::after { content: attr(data-label); position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); background: var(--ink); color: var(--panel); padding: 5px 7px; border-radius: 6px; font-size: 9px; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 7px 10px; border-radius: 999px; background: var(--panel-2); font-size: 11px; }

.ask-hero {
  min-height: 350px; display: grid; place-items: center; align-content: center; padding: 46px 20px 36px;
  text-align: center; border: 1px solid var(--line); border-radius: 28px; overflow: hidden;
  background:
    radial-gradient(circle at 18% 20%, color-mix(in srgb, var(--acid) 30%, transparent), transparent 31%),
    radial-gradient(circle at 82% 82%, color-mix(in srgb, var(--violet) 24%, transparent), transparent 35%),
    var(--panel);
}
.ask-hero .spark { width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: 18px; border-radius: 18px; background: var(--ink); color: var(--acid); font-size: 22px; transform: rotate(-5deg); }
.ask-hero h2 { margin: 0; font-size: clamp(30px, 5vw, 58px); line-height: 1; letter-spacing: -.06em; }
.ask-hero > p { max-width: 650px; margin: 20px auto 24px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.query-examples { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.query-examples button { padding: 10px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); cursor: pointer; font-size: 11px; }
.query-examples button:hover { border-color: var(--ink); }
.query-examples span { margin-left: 6px; color: var(--muted); }

.filter-bar {
  display: grid; grid-template-columns: repeat(6, minmax(90px, 1fr)) auto auto; align-items: end; gap: 8px;
  margin: 18px 0 24px; padding: 13px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel);
}
.filter-bar label { display: grid; gap: 5px; color: var(--muted); font: 600 9px/1 ui-monospace, monospace; text-transform: uppercase; letter-spacing: .05em; }
.filter-bar input:not([type="checkbox"]), .filter-bar select {
  width: 100%; height: 34px; min-width: 0; padding: 0 8px; border: 1px solid var(--line); border-radius: 9px; outline: 0; background: var(--bg); color: var(--ink); font: 11px/1 system-ui, sans-serif; text-transform: none; letter-spacing: 0;
}
.filter-bar .check-filter { display: flex; align-items: center; gap: 5px; height: 34px; }
.small-button, .secondary-button, .text-button {
  min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); cursor: pointer; font-weight: 650; font-size: 11px;
}
.text-button { border-color: transparent; background: transparent; color: var(--muted); }
.secondary-button:hover, .small-button:hover { border-color: var(--ink); }
.search-head { align-items: flex-start; }
.interpretation { margin-top: 8px; }
.secondary-results { margin-top: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.secondary-results summary { padding: 16px 18px; cursor: pointer; font-size: 12px; font-weight: 700; }
.secondary-results .list-panel { border: 0; border-top: 1px solid var(--line); border-radius: 0; }

.bulk-toolbar {
  position: sticky; z-index: 7; top: 12px; min-height: 48px; margin: 0 0 14px; padding: 8px 10px;
  display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 90%, transparent); backdrop-filter: blur(18px); box-shadow: 0 10px 30px rgba(20,20,18,.06);
}
.bulk-toolbar:not(.active) { opacity: .72; }
.bulk-toolbar strong { min-width: 76px; font-size: 11px; }
.bulk-toolbar select { min-width: 170px; height: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); font-size: 11px; }
.bulk-toolbar button { height: 32px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); cursor: pointer; font-size: 10px; }

.library-hero {
  display: flex; align-items: end; justify-content: space-between; gap: 28px; margin-bottom: 18px; padding: 26px 28px;
  border: 1px solid var(--line); border-radius: 24px; background:
    linear-gradient(120deg, color-mix(in srgb, var(--acid) 16%, transparent), transparent 48%),
    var(--panel);
}
.library-hero h2 { max-width: 720px; margin: 0; font-size: clamp(28px, 4vw, 48px); line-height: 1; letter-spacing: -.055em; }
.library-hero > div > p:last-child { max-width: 680px; margin: 14px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.library-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.library-stats { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); overflow: hidden; }
.library-stats div { padding: 15px 18px; border-right: 1px solid var(--line); }
.library-stats button { padding: 15px 18px; border: 0; border-right: 1px solid var(--line); background: transparent; color: inherit; text-align: left; cursor: pointer; }
.library-stats button:hover { background: var(--panel-2); }
.library-stats div:last-child { border: 0; }
.library-stats strong { display: block; font: 700 22px/1 ui-monospace, monospace; }
.library-stats span { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.duplicate-groups { display: grid; gap: 34px; }
.duplicate-group { padding: 18px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); }
.collection-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 28px; }
.collection-card { padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); text-align: left; cursor: pointer; }
.collection-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.collection-cover { height: 112px; display: grid; place-items: center; background: linear-gradient(145deg, color-mix(in srgb, var(--collection) 75%, #fff), var(--collection)); overflow: hidden; }
.collection-cover img { width: 100%; height: 100%; object-fit: cover; }
.collection-cover span { font-size: 28px; color: #fff; }
.collection-card > div:last-child { display: grid; padding: 12px 13px 14px; }
.collection-card span { color: var(--muted); font: 8px/1 ui-monospace, monospace; text-transform: uppercase; letter-spacing: .08em; }
.collection-card strong { margin-top: 5px; font-size: 13px; }
.collection-card small { margin-top: 5px; color: var(--muted); font-size: 9px; }
.tag-cloud { margin-bottom: 26px; }
.tag-chip { padding: 7px 10px; border-radius: 999px; color: var(--ink); background: color-mix(in srgb, var(--tag) 45%, var(--panel)); font-size: 10px; }

.analysis-panel {
  min-height: 470px; display: grid; grid-template-columns: 150px minmax(0,1fr) 260px; align-items: center; gap: 38px;
  padding: 42px; border: 1px solid var(--line); border-radius: 28px; background:
    radial-gradient(circle at 12% 25%, color-mix(in srgb, var(--violet) 22%, transparent), transparent 31%),
    radial-gradient(circle at 82% 85%, color-mix(in srgb, var(--acid) 20%, transparent), transparent 31%),
    var(--panel);
}
.analysis-orb { width: 140px; height: 140px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 44px; background: var(--ink); color: var(--acid); transform: rotate(-5deg); box-shadow: var(--shadow); }
.analysis-orb span { font-size: 50px; }
.analysis-copy h2 { margin: 0; font-size: clamp(34px, 4.5vw, 62px); line-height: .95; letter-spacing: -.065em; }
.analysis-copy > p:not(.eyebrow) { max-width: 640px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.progress-track { height: 9px; margin-top: 24px; overflow: hidden; border-radius: 999px; background: var(--panel-2); }
.progress-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--violet), var(--acid)); transition: width .3s ease; }
.progress-meta { display: flex; justify-content: space-between; margin-top: 8px; color: var(--muted); font: 9px/1 ui-monospace, monospace; }
.analysis-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.analysis-features { display: grid; gap: 7px; padding: 15px; border: 1px solid var(--line); border-radius: 16px; background: color-mix(in srgb, var(--panel) 76%, transparent); }
.analysis-features div { display: grid; grid-template-columns: 22px 1fr; align-items: center; gap: 8px; padding: 7px; }
.analysis-features span { color: #58a75e; }
.analysis-features p { display: grid; margin: 0; color: var(--muted); font-size: 9px; }
.analysis-features strong { color: var(--ink); font-size: 11px; }
.privacy-note { display: grid; grid-template-columns: 170px 1fr; gap: 20px; margin-top: 14px; padding: 17px 20px; border: 1px solid var(--line); border-radius: 14px; }
.privacy-note strong { font-size: 11px; }
.privacy-note p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.analysis-detail { margin: 20px 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); }
.analysis-detail > strong { display: block; font-size: 13px; line-height: 1.5; }
.palette-row { display: flex; gap: 6px; margin-top: 12px; }
.palette-row i { width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 50%; background: var(--swatch); }

.boards-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.board-card { padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); text-align: left; cursor: pointer; }
.board-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.board-mini { height: 210px; display: grid; place-items: center; background: var(--board-bg); overflow: hidden; }
.board-mini img { width: 64%; height: 72%; border: 7px solid #fff; object-fit: cover; transform: rotate(-3deg); box-shadow: 0 12px 30px #0002; }
.board-mini span { font-size: 48px; color: color-mix(in srgb, var(--ink) 60%, transparent); }
.board-card > div:last-child { padding: 16px; }
.board-card strong { font-size: 15px; }
.board-card p { min-height: 30px; margin: 6px 0 12px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.board-card small { color: var(--muted); font: 9px/1 ui-monospace, monospace; }
.board-toolbar { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.board-toolbar label { margin-left: auto; display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 9px; }
.board-toolbar label input { width: 34px; height: 30px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.board-toolbar > span { color: var(--muted); font-size: 10px; }
.board-scroll { overflow: auto; padding: 14px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel-2); }
.board-canvas { position: relative; width: 1000px; height: 720px; overflow: hidden; background: var(--board-bg); box-shadow: 0 20px 60px rgba(20,20,18,.16); transform-origin: top left; }
.board-item { position: absolute; padding: 9px 9px 74px; background: #fdfcf8; color: #181917; box-shadow: 0 12px 30px rgba(20,20,18,.16); transform: rotate(var(--rotation)); cursor: grab; touch-action: none; user-select: none; }
.board-item:active { cursor: grabbing; z-index: 10; }
.board-image { width: 100%; height: 100%; overflow: hidden; background: var(--media-gradient); }
.board-image img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.board-label { position: absolute; left: 12px; right: 9px; bottom: 48px; display: flex; justify-content: space-between; align-items: center; }
.board-label strong { font-size: 10px; }
.board-label button { width: 20px; height: 20px; border: 0; border-radius: 50%; background: #ece9df; color: #555; cursor: pointer; }
.board-item textarea { position: absolute; left: 12px; right: 12px; bottom: 9px; width: calc(100% - 24px); height: 33px; padding: 5px 0; resize: none; border: 0; outline: 0; background: transparent; color: #555; font-size: 9px; line-height: 1.25; user-select: text; }
.board-empty { position: absolute; inset: 0; display: grid; place-items: center; color: color-mix(in srgb, var(--ink) 45%, transparent); font-size: 13px; }

.empty-state, .loading-state { min-height: 360px; display: grid; place-items: center; align-content: center; gap: 14px; color: var(--muted); text-align: center; }
.loader { width: 34px; height: 34px; border: 2px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

dialog { width: min(840px, calc(100vw - 32px)); max-height: calc(100vh - 36px); padding: 0; border: 1px solid var(--line); border-radius: 24px; background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(15, 15, 12, .58); backdrop-filter: blur(8px); }
.dialog-close { position: sticky; z-index: 5; top: 12px; float: right; margin: 12px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: color-mix(in srgb, var(--ink) 80%, transparent); color: var(--panel); cursor: pointer; }
.post-detail { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr); min-height: 560px; }
.post-detail .media-tile { aspect-ratio: auto; min-height: 100%; }
.post-detail-copy { padding: 28px; overflow: auto; }
.post-detail-copy h2 { margin: 18px 0 10px; font-size: 20px; }
.post-detail-copy p { font-size: 13px; line-height: 1.6; }
.comments { margin-top: 24px; border-top: 1px solid var(--line); }
.comment { padding: 13px 0; border-bottom: 1px solid var(--line); }
.comment strong { font-size: 11px; }
.comment p { margin: 4px 0 0; }

#toast { position: fixed; z-index: 20; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 10px 14px; border-radius: 12px; background: var(--ink); color: var(--panel); box-shadow: var(--shadow); font-size: 12px; transition: .2s ease; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 76px minmax(0, 1fr); }
  .sidebar { padding: 22px 10px 16px; }
  .brand { padding: 0 8px 24px; }
  .brand > div:last-child, .nav-item:not(.active) em, .nav-item { font-size: 0; }
  .nav-item { grid-template-columns: 1fr; justify-items: center; padding: 11px 8px; }
  .nav-item span { font-size: 19px; }
  .sidebar-foot { flex-direction: column; gap: 12px; }
  .privacy-chip { font-size: 0; }
  .feed-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-strip { grid-template-columns: repeat(2, 1fr); }
  .summary-item:nth-child(2) { border-right: 0; }
  .summary-item:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .filter-bar { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .collection-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .analysis-panel { grid-template-columns: 110px 1fr; padding: 28px; }
  .analysis-orb { width: 104px; height: 104px; border-radius: 32px; }
  .analysis-features { grid-column: 1 / -1; grid-template-columns: repeat(3, 1fr); }
  .boards-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 650px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 10; inset: auto 10px 10px; width: auto; height: 60px; border: 1px solid var(--line); border-radius: 18px; padding: 6px; display: block; box-shadow: var(--shadow); }
  .brand, .sidebar-foot { display: none; }
  nav { height: 100%; display: flex; justify-content: flex-start; gap: 2px; overflow-x: auto; scrollbar-width: none; }
  nav::-webkit-scrollbar { display: none; }
  .nav-item { flex: 0 0 48px; min-width: 48px; width: 48px; height: 46px; }
  .workspace { padding: 26px 15px 90px; }
  .topbar { display: block; }
  .top-actions { margin-top: 20px; }
  .search-box { flex: 1; width: auto; }
  .search-box kbd { display: none; }
  .summary-strip { margin-top: 22px; }
  .feed-grid { grid-template-columns: 1fr; }
  .network-grid, .insights-grid { grid-template-columns: 1fr; }
  .metric-card.wide { grid-column: auto; }
  .post-detail { display: block; }
  .post-detail .media-tile { aspect-ratio: 1; min-height: 0; }
  .filter-bar { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .library-hero { display: block; padding: 22px; }
  .library-actions { justify-content: flex-start; margin-top: 20px; }
  .library-stats { grid-template-columns: repeat(2, 1fr); }
  .library-stats div:nth-child(2) { border-right: 0; }
  .collection-grid, .boards-grid { grid-template-columns: 1fr; }
  .analysis-panel { display: block; padding: 22px; }
  .analysis-orb { margin-bottom: 28px; }
  .analysis-features { margin-top: 24px; grid-template-columns: repeat(2, 1fr); }
  .privacy-note { grid-template-columns: 1fr; gap: 6px; }
  .bulk-toolbar { overflow-x: auto; }
  .board-toolbar { flex-wrap: wrap; }
  .board-toolbar label { margin-left: 0; }
}
