/* ============================================================
   NeoPadio Explore Demo — Styles matching real product
   ============================================================ */

:root {
  --bg: #F7F7F5;
  --card: #FFFFFF;
  --border: #EAEAE6;
  --border-md: rgba(0,0,0,.09);
  --ink: #111111;
  --ink-2: #5A5A56;
  --ink-3: #A0A09A;
  --green: #0F6E56;
  --green-lt: #EAF3EF;
  --amber: #B45309;
  --amber-lt: #FEF3E2;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'DM Sans', system-ui, sans-serif;
  --r: 14px;
  --r-sm: 9px;
  --sh: 0 2px 12px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.04);
  --sh-lg: 0 8px 32px rgba(0,0,0,.08), 0 2px 8px rgba(0,0,0,.04);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--sans);
  font-size: 14px;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
textarea { font-family: inherit; }
img { max-width: 100%; display: block; }
.hidden { display: none !important; }

/* ANIMATIONS */
@keyframes fadeUp { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
@keyframes spin { to { transform:rotate(360deg); } }
@keyframes blink { 0%,100% { opacity:.2; } 50% { opacity:1; } }
@keyframes ringExpand { 0% { transform:scale(.55); opacity:.7; } 100% { transform:scale(1.55); opacity:0; } }
@keyframes slideIn { from { transform:translateX(100%); } to { transform:translateX(0); } }
@keyframes slideInUp { from { transform:translateY(100%); } to { transform:translateY(0); } }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }

/* APP SHELL */
.app-shell { display: flex; height: 100vh; height: 100dvh; }

/* SIDEBAR */
.sidebar {
  width: 240px; flex-shrink: 0; background: #faf9f7;
  display: flex; flex-direction: column; gap: 4px; padding: 32px 24px;
}
.side-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.side-logo { height: 30px; width: auto; border-radius: 5px; }
.side-word { font-size: 22px; font-weight: 600; color: var(--ink); letter-spacing: -0.2px; }
.demo-badge {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--green); background: var(--green-lt); border: 1px solid rgba(15,110,86,.16);
  border-radius: 999px; padding: 4px 10px; margin-bottom: 20px;
}
.demo-badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--green); }
.side-cta {
  display: flex; align-items: center; gap: 10px; justify-content: center;
  background: #2b2a28; color: #fff; border-radius: 12px; padding: 12px 16px;
  font-size: 14px; font-weight: 500; letter-spacing: -.1px; margin-bottom: 24px;
  transition: opacity .15s;
}
.side-cta:hover { opacity: .85; }
.side-cta span { font-size: 18px; font-weight: 300; line-height: 1; opacity: .85; }
.side-nav-label {
  padding: 18px 14px 4px; font-size: 10.5px; color: var(--ink-3);
  letter-spacing: .09em; text-transform: uppercase;
}
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  font-size: 14px; font-weight: 500; color: #8a8680; cursor: pointer; transition: all .15s;
}
.side-link:hover { background: rgba(255,255,255,.5); }
.side-link.active {
  background: #fff; color: #2b2a28; font-weight: 700;
  box-shadow: 0 4px 20px rgba(0,0,0,0.04);
}
.side-link span { width: 18px; text-align: center; font-size: 15px; }
.side-foot {
  margin-top: auto; padding: 12px 14px 0; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
}
.side-avatar {
  width: 31px; height: 31px; border-radius: 50%; background: var(--green-lt); color: var(--green);
  display: flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 600;
}
.side-user { font-size: 13px; color: var(--ink-2); }
.side-logout {
  margin-left: auto; font-size: 12px; color: var(--ink-3); padding: 4px 8px;
  border-radius: 6px; transition: color .15s;
}
.side-logout:hover { color: var(--ink); }
.side-credit {
  padding: 10px 14px 0; font-size: 11px; color: var(--ink-3); letter-spacing: .01em;
}
.side-credit a {
  color: var(--ink-2); text-decoration: underline; text-decoration-color: rgba(0,0,0,.12);
  text-underline-offset: 2px; transition: color .15s;
}
.side-credit a:hover { color: var(--green); text-decoration-color: var(--green); }

/* MOBILE TOP BAR */
.mobile-topbar {
  display: none; align-items: center; gap: 10px; padding: 12px 16px;
  background: #faf9f7; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.topbar-brand { display: flex; align-items: center; gap: 9px; }
.topbar-brand span { font-size: 19px; font-weight: 600; color: var(--ink); }
.topbar-demo {
  font-size: 9px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--green); background: var(--green-lt); border: 1px solid rgba(15,110,86,.16);
  border-radius: 999px; padding: 3px 8px; margin-left: auto;
}
.topbar-new {
  font-size: 13px; font-weight: 500; color: #fff; background: #2b2a28;
  border-radius: 8px; padding: 7px 12px;
}

/* MAIN CONTENT */
.main-content { flex: 1; overflow-y: auto; background: var(--bg); position: relative; }

/* HOME */
.home-wrap { max-width: 680px; margin: 0 auto; padding: 52px 32px 80px; }
.home-hero { text-align: center; margin-bottom: 44px; }
.home-title {
  font-family: var(--serif); font-style: italic; font-weight: 600;
  font-size: 58px; color: #0E5C4E; letter-spacing: -1px; line-height: 1; margin-bottom: 16px;
}
.home-tagline {
  font-family: var(--serif); font-style: italic; font-size: 29px; color: var(--ink-2);
  font-weight: 500; line-height: 1.6; letter-spacing: -0.2px; margin-bottom: 12px;
}
.home-sub {
  font-family: var(--serif); font-style: italic; font-size: 18px; color: var(--ink-2);
  font-weight: 500; letter-spacing: -0.1px;
}

/* ASK BAR */
.ask-section { margin-bottom: 40px; }
.ask-section-label {
  font-size: 10.5px; color: var(--ink-3); letter-spacing: .08em;
  text-transform: uppercase; text-align: center; margin-bottom: 10px;
}
.ask-bar-box {
  display: flex; align-items: center; gap: 12px; background: var(--card);
  border: 1px solid var(--border-md); border-radius: 16px; padding: 16px 20px;
  box-shadow: var(--sh); cursor: text; transition: border-color .25s, box-shadow .25s;
}
.ask-bar-box:focus-within { border-color: var(--green); box-shadow: var(--sh-lg); }
.ask-bar-icon { width: 13px; height: auto; border-radius: 3px; flex-shrink: 0; }
.ask-bar-input {
  flex: 1; border: none; outline: none; background: transparent;
  font-family: inherit; font-size: 15.5px; color: var(--ink);
}
.ask-bar-input::placeholder { color: var(--ink-3); }
.ask-bar-speak {
  flex-shrink: 0; font-size: 15px; padding: 6px 8px; border-radius: 9px;
  color: var(--ink-2); transition: all .15s;
}
.ask-bar-speak:hover { background: var(--bg); }
.ask-bar-speak.listening { background: #DC2626; color: #fff; border-radius: 50%; }
.ask-bar-submit {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%;
  background: var(--green); color: #fff; font-size: 16px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, transform .12s;
}
.ask-bar-submit:hover { background: #0d5e49; transform: translateY(-1px); }
.ask-chips {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  margin-top: 12px;
}
.ask-chip {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border-md);
  background: var(--card); font-size: 12.5px; color: var(--ink);
  cursor: pointer; transition: transform .12s, border-color .2s, box-shadow .2s;
}
.ask-chip:hover { transform: translateY(-1px); border-color: var(--green); box-shadow: var(--sh); }

/* QUICK ACTIONS */
.quick-actions {
  display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 40px;
}
.quick-action-label {
  font-size: 10.5px; color: var(--ink-3); letter-spacing: .08em;
  text-transform: uppercase; margin-bottom: 10px;
}
.quick-action {
  display: flex; align-items: center; gap: 9px; padding: 12px 16px;
  border-radius: 12px; border: 1px solid var(--border); background: var(--card);
  font-size: 13.5px; color: var(--ink); box-shadow: var(--sh);
  transition: transform .12s, box-shadow .12s;
}
.quick-action:hover { transform: translateY(-1px); box-shadow: var(--sh-lg); }
.quick-action span { font-size: 16px; }

/* SECTION HEADERS */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px;
}
.section-label {
  font-size: 11px; color: var(--ink-3); letter-spacing: .08em; text-transform: uppercase;
}
.section-link { font-size: 12px; color: var(--green); cursor: pointer; }

/* CARD GRID */
.card-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: 32px;
}
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r);
  padding: 18px 18px 16px; cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.card:hover { border-color: rgba(15,110,86,.28); box-shadow: var(--sh); }
.card-badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 10px; color: var(--ink-3);
  letter-spacing: .06em; text-transform: uppercase; margin-bottom: 10px;
}
.card-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.card-title { font-size: 15px; font-weight: 500; color: var(--ink); margin-bottom: 2px; letter-spacing: -.2px; }
.card-date { font-size: 11.5px; color: var(--ink-3); margin-bottom: 10px; }
.card-body { font-size: 12.5px; color: var(--ink-2); line-height: 1.6; }
.card-empty {
  grid-column: span 3; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); padding: 28px 20px; text-align: center; color: var(--ink-3); font-size: 13px;
}
.card-empty-link { color: var(--green); cursor: pointer; }

/* CONTINUE READING BANNER */
.continue-banner {
  background: var(--green-lt); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px 18px; margin-bottom: 32px; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  transition: border-color .15s;
}
.continue-banner:hover { border-color: var(--green); }
.continue-label { font-size: 10.5px; color: var(--green); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; }
.continue-title { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.continue-cta { font-size: 13px; color: var(--green); font-weight: 500; flex-shrink: 0; }

/* MEMORIES PAGE */
.mem-shell { display: flex; height: 100%; overflow: hidden; }
.mem-list-panel {
  width: 268px; flex-shrink: 0; overflow-y: auto; padding: 14px 10px;
  border-right: 1px solid var(--border); background: var(--bg);
}
.mem-search-wrap { position: relative; margin: 4px 4px 12px; }
.mem-search-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  font-size: 14px; color: var(--ink-3);
}
.mem-search {
  width: 100%; background: var(--card); border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 8px 10px 8px 32px; font-size: 13px; color: var(--ink); outline: none;
}
.mem-group-label {
  font-size: 10px; color: var(--ink-3); letter-spacing: .08em; text-transform: uppercase;
  padding: 0 4px; margin-bottom: 7px; margin-top: 4px;
}
.mem-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r);
  padding: 13px 14px; margin-bottom: 7px; cursor: pointer; transition: border-color .15s;
}
.mem-card.active { border: 1.5px solid var(--green); }
.mem-card-title { font-size: 13.5px; font-weight: 500; color: var(--ink); margin-bottom: 5px; }
.mem-card-date { font-size: 11px; color: var(--ink-3); margin-bottom: 9px; }
.mem-card-summary { font-size: 12px; color: var(--ink-2); line-height: 1.5; }
.mem-card-tags { display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap; }
.mem-card-tag {
  font-size: 10.5px; padding: 2px 8px; border-radius: 20px;
  border: 1px solid var(--border); background: var(--bg); color: var(--ink-2);
}

/* MEMORY DETAIL PANEL */
.mem-detail { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--card); overflow: hidden; }
.mem-detail-head {
  padding: 18px 18px 0; border-bottom: 1px solid var(--border); flex-shrink: 0; padding-bottom: 14px;
}
.mem-back-btn {
  display: none; align-items: center; gap: 6px; background: transparent; color: var(--green);
  font-size: 13.5px; font-weight: 500; padding: 6px 0 12px;
}
.mem-detail-title-row { display: flex; align-items: flex-start; justify-content: space-between; }
.mem-detail-title { font-size: 16px; font-weight: 500; color: var(--ink); }
.mem-detail-menu {
  font-size: 20px; color: var(--ink-3); padding: 4px 8px; border-radius: 6px;
  transition: background .15s;
}
.mem-detail-menu:hover { background: var(--bg); }
.mem-detail-date { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.mem-tabs { display: flex; margin-top: 12px; }
.mem-tab {
  padding: 10px 14px; font-size: 12.5px; color: var(--ink-3);
  border-bottom: 2px solid transparent; font-weight: 400; transition: all .15s;
}
.mem-tab.active { color: var(--green); border-bottom-color: var(--green); font-weight: 500; }
.mem-tab-body { flex: 1; overflow-y: auto; padding: 16px 18px; }
.mem-section { margin-bottom: 18px; }
.mem-section-label {
  font-size: 10px; color: var(--ink-3); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 7px;
}
.mem-section p { font-size: 13px; color: var(--ink-2); line-height: 1.65; }
.mem-topics { display: flex; flex-wrap: wrap; gap: 6px; }
.mem-topic-pill {
  font-size: 11px; font-weight: 500; padding: 4px 12px; border-radius: 999px;
  background: var(--green-lt); color: var(--green); border: 1px solid rgba(15,110,86,.12);
}
.mem-action-item { display: flex; align-items: flex-start; gap: 9px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.mem-action-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); flex-shrink: 0; margin-top: 5px; }
.mem-action-text { font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.mem-risk-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 10px 12px; font-size: 12.5px; color: var(--ink-2); line-height: 1.55; margin-bottom: 7px;
}
.mem-audio-player { width: 100%; margin-top: 8px; border-radius: 8px; }
.mem-empty { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--ink-3); font-size: 13px; }

/* PAGE TITLES */
.page-wrap { max-width: 820px; margin: 0 auto; padding: 44px 32px 60px; }
.page-title {
  font-family: var(--serif); font-style: italic; font-size: 38px; color: var(--ink);
  letter-spacing: -.5px; margin-bottom: 5px;
}
.page-subtitle { font-size: 14px; color: var(--ink-3); font-weight: 300; margin-bottom: 30px; }
.upload-btn {
  padding: 10px 16px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--card); font-size: 13.5px; color: var(--ink); box-shadow: var(--sh);
  transition: border-color .15s, box-shadow .15s;
}
.upload-btn:hover { border-color: var(--green); box-shadow: var(--sh-lg); }

/* BOOK/DOCUMENT GRID */
.item-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px;
}
.item-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 16px; cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.item-card:hover { border-color: rgba(15,110,86,.28); box-shadow: var(--sh); }
.item-cover {
  width: 100%; aspect-ratio: 3/4; border-radius: 10px; display: flex;
  align-items: center; justify-content: center; margin-bottom: 14px;
}
.item-cover-letter { font-family: var(--serif); font-style: italic; font-size: 36px; }
.item-title { font-size: 14.5px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.item-meta { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; }

/* READER SHELL */
.reader-shell { display: flex; height: 100%; overflow: hidden; }
.reader-main { flex: 1; overflow-y: auto; background: #fff; }
.reader-content { max-width: 680px; margin: 0 auto; padding: 56px 32px 100px; }
.reader-back {
  display: flex; align-items: center; gap: 6px; background: none;
  color: var(--green); font-size: 12.5px; margin-bottom: 24px;
}
.reader-title {
  font-family: var(--serif); font-style: italic; font-size: 36px; line-height: 1.25;
  color: var(--ink); letter-spacing: -.5px; margin-bottom: 14px;
}
.reader-meta { font-size: 13px; color: var(--ink-3); margin-bottom: 18px; }
.reader-divider { height: 1px; background: var(--border); margin: 28px 0 32px; }
.reader-body {
  font-family: var(--serif); font-size: 18px; line-height: 1.85; color: #222;
}
.reader-body h2 { font-size: 23px; font-weight: 700; margin: 30px 0 14px; line-height: 1.3; }
.reader-body p { margin-bottom: 22px; }
.reader-body blockquote {
  margin: 0 0 22px; padding: 4px 20px; border-left: 3px solid var(--border);
  color: var(--ink-2); font-style: italic;
}
.reader-body mark { background: rgba(250,204,21,.35); border-radius: 2px; padding: 1px 2px; }
.reader-body ul { margin: 0 0 22px 20px; }
.reader-body li { margin-bottom: 6px; }
.reader-page-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border);
}
.reader-page-indicator { font-size: 12.5px; color: var(--ink-3); font-weight: 500; }
.reader-page-actions { display: flex; gap: 10px; }
.reader-page-btn {
  padding: 8px 16px; border-radius: 9px; border: 1px solid #ddd;
  background: #fff; color: #555; font-size: 13px; font-weight: 500;
  transition: border-color .15s;
}
.reader-page-btn:hover { border-color: var(--green); }
.reader-page-btn.primary { background: var(--green); color: #fff; border-color: var(--green); }
.reader-page-btn.primary:hover { background: #0d5e49; }

/* READER PANEL (right sidebar) */
.reader-panel {
  width: 340px; flex-shrink: 0; background: #fafafa; border-left: 1px solid #e5e5e5;
  display: flex; flex-direction: column; overflow: hidden;
}
.panel-tabs { display: flex; border-bottom: 1px solid #e5e5e5; flex-shrink: 0; }
.panel-tab {
  flex: 1; padding: 14px 0; border-bottom: 2px solid transparent;
  color: #888; font-weight: 500; font-size: 13px; text-align: center;
  transition: all .15s;
}
.panel-tab.active { color: #2f7d4f; border-bottom-color: #2f7d4f; font-weight: 600; }
.panel-pane { display: none; flex: 1; min-height: 0; }
.panel-pane.active { display: flex; flex-direction: column; }

/* ANALYSIS CARDS */
.analysis-scroll { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.analysis-card {
  background: #fff; border: 1px solid #ececec; border-radius: 12px; padding: 16px;
}
.analysis-label { font-size: 12px; color: #888; margin-bottom: 8px; }
.analysis-value { line-height: 1.6; font-size: 14px; color: var(--ink); }
.analysis-list { list-style: none; padding: 0; margin: 8px 0 0; }
.analysis-list li { padding: 4px 0; font-size: 14px; color: var(--ink); line-height: 1.5; }

/* CHAT */
.chat-container { display: flex; flex-direction: column; height: 100%; }
.chat-scroll {
  flex: 1; overflow-y: auto; padding: 18px 16px; display: flex;
  flex-direction: column; gap: 14px;
}
.chat-user {
  align-self: flex-end; background: #1a1a1a; color: #fff; padding: 10px 15px;
  border-radius: 16px 16px 4px 16px; font-size: 13.5px; max-width: 82%; line-height: 1.55;
  animation: fadeUp .25s ease both;
}
.chat-ai-row {
  display: flex; gap: 9px; align-items: flex-start; animation: fadeUp .3s ease both;
}
.chat-ai-avatar {
  width: 26px; height: 26px; border-radius: 50%; background: #eaf5ee;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  font-size: 13px; margin-top: 2px;
}
.chat-ai-bubble {
  background: #f5f5f3; border: 1px solid #ececec; border-radius: 4px 16px 16px 16px;
  padding: 11px 14px; font-size: 13.5px; color: #333; line-height: 1.65; max-width: 84%;
}
.chat-ai-bubble.boundary {
  background: #FFFBF0; border: 1px dashed #E0B84A; border-radius: 4px 16px 16px 16px;
  color: #6b5b2a;
}
.chat-ai-detail { margin-top: 8px; font-size: 13px; color: #444; line-height: 1.6; }
.chat-ai-highlight {
  margin-top: 8px; background: #fffbea; border-left: 3px solid #eab308;
  border-radius: 0 8px 8px 0; padding: 9px 12px; font-size: 13px; color: #4d3f14;
}
.chat-ai-hl-icon { margin-right: 4px; }
.chat-ai-sources { margin-top: 8px; border-top: 1px solid #e5e5e5; padding-top: 8px; }
.chat-ai-src-label { font-size: 11px; color: #aaa; margin-bottom: 6px; }
.chat-ai-src {
  display: flex; align-items: center; gap: 6px; padding: 4px 0;
  font-size: 11.5px; color: #2f7d4f; cursor: pointer;
}
.chat-ai-src:hover { text-decoration: underline; }
.chat-thinking { display: flex; gap: 4px; align-items: center; padding: 8px 0; }
.chat-dot {
  width: 6px; height: 6px; border-radius: 50%; background: #999;
  animation: bc-bounce 1.2s infinite ease-in-out;
}
.chat-dot:nth-child(2) { animation-delay: .15s; }
.chat-dot:nth-child(3) { animation-delay: .3s; }
@keyframes bc-bounce {
  0%,80%,100% { transform:scale(0.6); opacity:0.5; }
  40% { transform:scale(1); opacity:1; }
}
.chat-empty { text-align: center; color: #999; font-size: 13px; padding: 30px 10px; }
.chat-suggestions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }
.chat-suggestion {
  font-size: 12px; padding: 6px 12px; border-radius: 20px; border: 1px solid #e2e2e2;
  background: #fafafa; color: #555; cursor: pointer; transition: all .15s;
}
.chat-suggestion:hover { border-color: #c8c8c8; color: #333; }
.chat-input-bar { padding: 12px 14px; border-top: 1px solid #ececec; background: #fff; flex-shrink: 0; }
.chat-input-wrap {
  display: flex; align-items: flex-end; gap: 8px; background: #f5f5f3;
  border: 1.5px solid #e5e5e5; border-radius: 16px; padding: 8px 8px 8px 14px;
}
.chat-input {
  flex: 1; resize: none; border: none; outline: none; background: transparent;
  font-size: 13.5px; line-height: 1.5; max-height: 100px; padding: 4px 0;
}
.chat-send {
  width: 32px; height: 32px; border-radius: 50%; background: #e5e5e5; color: #fff;
  font-size: 13px; flex-shrink: 0; transition: background .15s;
}
.chat-send.active { background: #1a1a1a; }

/* NOTES */
.notes-scroll { flex: 1; overflow-y: auto; padding: 16px; }
.note-chapter {
  font-size: 15px; font-weight: 600; color: #1a1a1a; padding-bottom: 8px;
  border-bottom: 2px solid #1a1a1a; margin-bottom: 10px;
}
.note-label { font-size: 11.5px; color: #999; margin: 18px 0 4px; }
.note-textarea {
  width: 100%; border: 1px solid #e5e5e5; border-radius: 10px; padding: 10px 12px;
  font-size: 13.5px; line-height: 1.55; background: #fafafa; outline: none; resize: vertical;
}
.note-textarea:focus { border-color: var(--green); background: #fff; }
.note-saved { font-size: 11px; color: #aaa; text-align: right; margin-top: 3px; }
.highlight-block {
  background: #fffbea; border-left: 3px solid #eab308; border-radius: 0 8px 8px 0;
  padding: 10px 14px; font-size: 14px; line-height: 1.6; color: #3a3a2a;
  font-style: italic; margin: 12px 0;
}
.highlight-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.highlight-action {
  font-size: 12px; padding: 5px 10px; border-radius: 16px; border: 1px solid #e2e2e2;
  background: #fff; color: #444; cursor: pointer; transition: all .15s;
}
.highlight-action:hover { border-color: var(--green); color: var(--green); }

/* MODAL OVERLAY */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(10,10,10,.48); backdrop-filter: blur(14px) saturate(1.4);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn .2s ease;
}
.modal-shell {
  background: #FDFCFB; border-radius: 28px; width: 560px;
  max-width: calc(100vw - 32px); max-height: calc(100dvh - 48px); overflow-y: auto;
  box-shadow: 0 40px 100px rgba(0,0,0,.22), 0 8px 24px rgba(0,0,0,.1);
  animation: fadeUp .32s cubic-bezier(.34,1.26,.64,1) both;
}
.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; padding: 24px 24px 0;
}
.modal-title {
  font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 26px;
  color: var(--ink); letter-spacing: -.4px; line-height: 1.1; margin-bottom: 6px;
}
.modal-subtitle { font-size: 14px; color: var(--ink-3); font-weight: 300; }
.modal-close {
  width: 32px; height: 32px; border-radius: 50%; background: rgba(0,0,0,.06);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-2); font-size: 17px; flex-shrink: 0; transition: all .15s;
}
.modal-close:hover { background: rgba(0,0,0,.1); color: var(--ink); }
.modal-back {
  display: flex; align-items: center; gap: 6px; color: var(--ink-2);
  font-size: 12.5px; margin: 20px 0 16px; padding: 0;
}

/* PICKER */
.picker-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 20px 24px 24px; }
.picker-card {
  background: var(--card); border: 1.5px solid var(--border); border-radius: 18px;
  padding: 18px; cursor: pointer; display: flex; flex-direction: column;
  transition: border-color .18s, box-shadow .18s, transform .2s;
}
.picker-card:hover {
  border-color: rgba(15,110,86,.28); box-shadow: 0 8px 32px rgba(15,110,86,.1);
  transform: translateY(-3px);
}
.picker-icon { font-size: 24px; margin-bottom: 14px; line-height: 1; }
.picker-name { font-size: 16px; font-weight: 500; color: var(--ink); margin-bottom: 6px; }
.picker-desc { font-size: 12.5px; color: var(--ink-2); line-height: 1.55; margin-bottom: 12px; flex: 1; }
.picker-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 14px; }
.picker-tags span {
  font-size: 11px; padding: 3px 10px; border-radius: 20px;
  background: var(--bg); border: 1px solid var(--border); color: var(--ink-3);
}
.picker-btn {
  width: 100%; padding: 10px 16px; border-radius: 12px; color: #fff;
  font-size: 13px; font-weight: 500; transition: opacity .15s;
}
.picker-btn:hover { opacity: .85; }
.picker-btn.green { background: var(--green); }
.picker-btn.dark { background: var(--ink); }

/* CAPTURE */
.capture-textarea {
  width: 100%; min-height: 140px; border: 1px solid var(--border); border-radius: 12px;
  padding: 16px; font-size: 14px; color: var(--ink); resize: none; outline: none;
  margin: 0 24px 12px; max-width: calc(100% - 48px);
}
.capture-textarea:focus { border-color: var(--green); }
.capture-actions { display: flex; flex-wrap: wrap; gap: 12px; padding: 0 24px 24px; }
.capture-save {
  flex: 1; padding: 12px 20px; border-radius: 12px; background: var(--green);
  color: #fff; font-size: 14px; font-weight: 500; opacity: .5; transition: opacity .15s;
}
.capture-save.enabled { opacity: 1; }
.capture-save.enabled:hover { opacity: .85; }
.capture-speak {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--card); color: var(--ink-2); font-size: 14px; font-weight: 500;
  transition: all .15s;
}
.capture-speak.listening { background: #DC2626; color: #fff; border-color: #DC2626; }

/* RECORDER */
.recorder-center { display: flex; flex-direction: column; align-items: center; padding: 8px 32px 32px; }
.recorder-ring { position: relative; width: 110px; height: 110px; margin-bottom: 22px; }
.ring-pulse {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid rgba(15,110,86,.18); opacity: 0;
}
.ring-pulse.active { animation: ringExpand 2s ease-out infinite; }
.ring-pulse:nth-child(2).active { animation-delay: .55s; }
.ring-pulse:nth-child(3).active { animation-delay: 1.1s; }
.recorder-btn {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 68px; height: 68px; border-radius: 50%; background: var(--ink);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 24px rgba(0,0,0,.2); font-size: 26px; color: #fff;
  transition: background .2s;
}
.recorder-btn.recording { background: #E53E3E; }
.recorder-timer {
  font-family: var(--serif); font-style: italic; font-size: 40px;
  color: var(--ink); letter-spacing: -1px; margin-bottom: 4px;
}
.recorder-status {
  font-size: 12px; color: var(--ink-3); letter-spacing: .05em;
  text-transform: uppercase; margin-bottom: 18px;
}
.recorder-wave { display: flex; align-items: center; gap: 3px; height: 36px; margin-bottom: 22px; }
.recorder-wave-bar {
  width: 3px; border-radius: 2px; background: var(--green); opacity: .3; height: 4px;
}
.recorder-wave.active .recorder-wave-bar { opacity: .7; }
.rec-start-btn {
  display: flex; align-items: center; gap: 7px; padding: 11px 22px; border-radius: 12px;
  background: var(--green); color: #fff; font-size: 13.5px; font-weight: 500;
}
.rec-stop-btn {
  display: flex; align-items: center; gap: 7px; padding: 11px 22px; border-radius: 12px;
  background: #FEF2F2; border: 1px solid #FECACA; color: #DC2626; font-size: 13.5px; font-weight: 500;
}

/* MEETING VIEW */
.meeting-container {
  display: flex; flex-direction: column; height: 100%; min-height: 400px;
}
.meeting-screen {
  flex: 1; background: #1a1a1a; border-radius: 12px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  min-height: 260px; position: relative;
}
.meeting-screen-placeholder {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: #666; text-align: center; padding: 24px;
}
.meeting-placeholder-icon { font-size: 40px; opacity: .6; }
.meeting-placeholder-title {
  font-size: 16px; font-weight: 500; color: #888;
}
.meeting-placeholder-sub {
  font-size: 12px; color: #666; line-height: 1.5; max-width: 280px;
}
.meeting-video {
  width: 100%; height: 100%; object-fit: contain; background: #000;
}
.meeting-controls {
  padding: 16px 20px; display: flex; flex-direction: column; align-items: center; gap: 8px;
  border-top: 1px solid var(--border);
}
.meeting-timer {
  font-family: var(--serif); font-style: italic; font-size: 28px;
  color: var(--ink); letter-spacing: -0.5px;
}
.meeting-status {
  font-size: 11px; color: var(--ink-3); letter-spacing: .05em;
  text-transform: uppercase; margin-bottom: 4px;
}
.meeting-btns { display: flex; gap: 10px; }
.meeting-btn {
  display: flex; align-items: center; gap: 7px; padding: 10px 20px; border-radius: 10px;
  font-size: 13px; font-weight: 500; transition: all .15s;
}
.meeting-btn.start {
  background: var(--green); color: #fff;
}
.meeting-btn.start:hover { opacity: .88; }
.meeting-btn.stop {
  background: #FEF2F2; border: 1px solid #FECACA; color: #DC2626;
}
.meeting-btn.stop:hover { background: #FEE2E2; }
.meeting-btn-icon { font-size: 11px; }
.meeting-wave { display: flex; align-items: center; gap: 3px; height: 28px; margin-top: 4px; }
.meeting-wave .recorder-wave-bar {
  width: 3px; border-radius: 2px; background: var(--green); opacity: .3; height: 4px;
}
.meeting-wave.active .recorder-wave-bar { opacity: .7; }

/* PROCESSING */
.processing-center {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 32px; gap: 12px;
}
.processing-spinner {
  width: 44px; height: 44px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--green);
  animation: spin .8s linear infinite;
}
.processing-title { font-size: 14px; color: var(--ink-2); }
.processing-sub { font-size: 12px; color: var(--ink-3); }

/* DONE */
.done-center {
  display: flex; flex-direction: column; align-items: center; padding: 32px; text-align: center;
}
.done-check {
  width: 52px; height: 52px; border-radius: 50%; background: var(--green-lt);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: var(--green); margin-bottom: 16px;
}
.done-title { font-size: 16px; font-weight: 500; color: var(--ink); margin-bottom: 6px; }
.done-sub { font-size: 13px; color: var(--ink-3); line-height: 1.5; margin-bottom: 20px; }
.done-btn {
  display: inline-block; padding: 11px 28px; border-radius: 12px;
  background: var(--ink); color: #fff; font-size: 13.5px; font-weight: 500;
}

/* DEMO BOUNDARY MODAL */
.demo-boundary-shell { padding: 32px; text-align: center; }
.demo-boundary-icon { font-size: 40px; margin-bottom: 16px; }
.demo-boundary-title {
  font-family: var(--serif); font-style: italic; font-weight: 500;
  font-size: 24px; color: var(--ink); margin-bottom: 12px;
}
.demo-boundary-text { font-size: 14px; color: var(--ink-2); line-height: 1.6; margin-bottom: 8px; }
.demo-boundary-cta { font-size: 13px; color: var(--ink-3); margin-bottom: 24px; }
.demo-boundary-btn {
  padding: 11px 28px; border-radius: 12px; background: var(--green);
  color: #fff; font-size: 13.5px; font-weight: 500;
}

/* ASK PANEL (side slide-in) */
.ask-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.15); z-index: 150;
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.ask-overlay.open { opacity: 1; pointer-events: auto; }
.ask-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 92vw);
  background: var(--card); border-left: 1px solid var(--border);
  box-shadow: var(--sh-lg); z-index: 151; display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .3s cubic-bezier(.22,.9,.35,1);
}
.ask-panel.open { transform: translateX(0); }
.ask-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.ask-panel-title { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; }
.ask-panel-title span { font-size: 15px; }
.ask-panel-close {
  font-size: 18px; color: var(--ink-3); padding: 4px 8px; line-height: 1;
}
.ask-panel-body {
  flex: 1; overflow-y: auto; padding: 22px 20px; display: flex;
  flex-direction: column; gap: 18px;
}
.ask-panel-empty { text-align: center; color: var(--ink-3); font-size: 13px; padding: 40px 0; }
.ask-panel-foot {
  padding: 14px 16px; border-top: 1px solid var(--border); flex-shrink: 0;
}
.ask-panel-input-wrap {
  display: flex; align-items: center; gap: 8px; background: var(--bg);
  border: 1px solid var(--border-md); border-radius: 14px; padding: 9px 10px 9px 14px;
}
.ask-panel-input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 13.5px; color: var(--ink);
}
.ask-panel-input::placeholder { color: var(--ink-3); }
.ask-panel-send {
  background: var(--ink); color: #fff; border-radius: 10px; padding: 7px 14px;
  font-size: 12.5px; font-weight: 500; opacity: .5; transition: opacity .15s;
}
.ask-panel-send.active { opacity: 1; }

/* RESPONSIVE */
@media (max-width: 900px) {
  .reader-shell { flex-direction: column; }
  .reader-panel { width: 100%; height: 50%; border-left: none; border-top: 1px solid #e5e5e5; }
  .reader-main { height: 50%; }
}

@media (max-width: 760px) {
  .app-shell { flex-direction: column; }
  .sidebar { display: none; }
  .mobile-topbar { display: flex; }
  .mem-list-panel { width: 100%; }
  .mem-detail { display: none; }
  .mem-detail.mobile-show { display: flex; position: absolute; inset: 0; z-index: 10; }
  .mem-list-panel.mobile-hide { display: none; }
  .mem-back-btn { display: flex; }
  .card-grid { grid-template-columns: 1fr !important; }
  .card-empty { grid-column: span 1 !important; }
  .picker-grid { grid-template-columns: 1fr; }
  .modal-shell { border-radius: 20px; }
  .home-wrap { padding: 36px 20px 48px; }
  .home-title { font-size: 42px; }
  .home-tagline { font-size: 24px; }
  .home-sub { font-size: 16px; }
  .page-wrap { padding: 28px 20px 48px; }
  .page-title { font-size: 30px; }
  .reader-content { padding: 32px 20px 80px; }
  .reader-title { font-size: 28px; }
  .reader-body { font-size: 16px; }
  .reader-panel { height: 60%; }
  .reader-main { height: 40%; }
  .ask-panel {
    top: auto; left: 0; right: 0; width: 100%; max-width: 100vw;
    height: min(76vh, 640px); border-left: none; border-top: 1px solid var(--border);
    border-radius: 20px 20px 0 0; transform: translateY(100%);
  }
  .ask-panel.open { transform: translateY(0); }
}

@media (max-width: 480px) {
  .home-title { font-size: 36px; }
  .home-tagline { font-size: 21px; }
  .quick-actions { flex-direction: column; }
}
