:root {
  --mint-950: #003f27;
  --mint-900: #00663f;
  --mint-800: #00875b;
  --mint-700: #00a873;
  --mint-600: #00c989;
  --mint-500: #00dd95;
  --mint-400: #29eca8;
  --mint-300: #71f5c7;
  --mint-200: #b7ffe2;
  --mint-100: #e9fff6;
  --ink: #13221d;
  --muted: #66756f;
  --line: #d8eee5;
  --surface: #ffffff;
  --surface-soft: #f6fffb;
  --danger: #cb3c66;
  --warning: #b47b00;
  --blue: #67dfff;
  --pink: #ffc0d5;
  --yellow: #ffe86b;
  --purple: #d9c9ff;
  --shadow-sm: 0 2px 10px rgba(0, 83, 51, .09);
  --shadow-md: 0 12px 35px rgba(0, 76, 47, .16);
  --radius-card: 16px;
  --radius-pill: 999px;
  --footer-height: 132px;
  --header-height: 116px;
  --content-max: 1120px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--mint-200);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { background: linear-gradient(145deg, #b9ffe2, #eafff7 48%, #b5f8df); overflow: hidden; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid rgba(0, 111, 75, .35);
  outline-offset: 2px;
}
a { color: var(--mint-800); }
[hidden] { display: none !important; }

.app-root { height: 100dvh; min-height: 100vh; }
.app-shell {
  width: min(100%, var(--content-max));
  height: 100%;
  margin: 0 auto;
  background: var(--mint-500);
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  box-shadow: 0 0 0 1px rgba(0, 95, 57, .06), 0 0 50px rgba(0, 95, 57, .16);
  overflow: hidden;
}

.app-header {
  background: #ffffff;
  padding: max(10px, env(safe-area-inset-top)) 14px 8px;
  position: relative;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 14px rgba(0, 84, 51, .06);
}
.header-row { display: flex; gap: 10px; align-items: center; }
.search-shell {
  flex: 1;
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  min-height: 44px;
  padding: 0 12px 0 16px;
  box-shadow: 0 2px 8px rgba(0, 83, 51, .05);
}
.search-shell input { border: 0; outline: 0; min-width: 0; flex: 1; background: transparent; }
.search-shell .icon { width: 20px; height: 20px; color: var(--mint-500); }
.logo-button { border: 0; background: #ffffff; padding: 0; cursor: pointer; height: 46px; min-width: 105px; border-radius: 12px; }
.logo-button img { height: 44px; width: 115px; object-fit: contain; }
.semantic-row, .view-switcher, .chip-row { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; padding-top: 8px; }
.semantic-row::-webkit-scrollbar, .view-switcher::-webkit-scrollbar, .chip-row::-webkit-scrollbar, .rail::-webkit-scrollbar { display: none; }
.semantic-chip, .view-chip, .filter-chip {
  border: 0;
  background: var(--mint-100);
  border-radius: var(--radius-pill);
  padding: 7px 14px;
  min-width: max-content;
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 1px 5px rgba(0, 70, 43, .08);
}
.semantic-chip.active, .view-chip.active, .filter-chip.active { background: var(--mint-900); color: white; }
.primary-view-switcher { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 6px 10px; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); overflow: visible; }
.primary-view-switcher .view-chip { width: 100%; min-width: 0; text-align: center; font-weight: 750; }

.app-main {
  min-height: 0;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(222, 255, 244, .85), rgba(0, 221, 149, .96) 24%, var(--mint-500));
  position: relative;
}
.scroll-view { height: 100%; overflow-y: auto; overscroll-behavior-y: contain; scroll-behavior: smooth; padding: 10px max(10px, calc((100% - 760px) / 2)) 40px; }
.scroll-view.wide { padding-left: 10px; padding-right: 10px; }
.content-column { width: min(100%, 760px); margin: 0 auto; }

.offline-banner {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  background: #fff5c7; color: #684600; padding: 6px 10px; font-size: 12px;
}
.offline-banner .icon { width: 16px; height: 16px; }

.media-group { position: relative; }
.media-card {
  background: white;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border: 1px solid rgba(0, 88, 53, .1);
  margin-bottom: 5px;
}
.media-card.sticky { position: sticky; top: 0; z-index: 12; }
.media-preview { aspect-ratio: 16 / 7; width: 100%; object-fit: cover; display: block; background: #0b2b22; }
.media-card.compact { display: grid; grid-template-columns: 112px 1fr; align-items: center; padding: 8px; }
.media-card.compact .media-preview { aspect-ratio: 4 / 3; border-radius: 11px; height: 75px; }
.media-copy { padding: 10px 12px; min-width: 0; }
.media-card.compact .media-copy { padding: 4px 10px; }
.media-title { font-size: 14px; line-height: 1.25; font-weight: 750; margin: 0; }
.media-meta { color: var(--mint-700); font-size: 11px; margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px 8px; }
.evidence-badge { display: inline-flex; align-items: center; gap: 4px; border-radius: var(--radius-pill); padding: 3px 8px; background: var(--mint-100); color: var(--mint-900); font-size: 10px; font-weight: 700; }
.evidence-badge.unavailable { background: #fff4d6; color: #7c5200; }

.said-card, .paragraph-card {
  background: white;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0, 93, 56, .1);
  margin: 5px 0;
  overflow: hidden;
  transition: box-shadow .18s ease, transform .18s ease;
}
.said-card.playing, .paragraph-card.playing { box-shadow: 0 0 0 3px rgba(0, 221, 149, .55), var(--shadow-md); }
.said-card-header { padding: 9px 11px 3px; display: flex; align-items: center; gap: 7px; min-width: 0; }
.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; background: var(--mint-100); }
.avatar.tiny { width: 21px; height: 21px; }
.avatar.small { width: 40px; height: 40px; }
.avatar.large { width: 76px; height: 76px; }
.identity { min-width: 0; flex: 1; }
.identity-line { display: flex; align-items: center; gap: 3px; font-size: 11px; color: var(--mint-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.identity-line .icon { width: 13px; height: 13px; color: var(--mint-500); flex: 0 0 auto; }
.attribution { font-size: 11px; color: var(--mint-700); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.said-meta { font-size: 10px; color: var(--muted); }
.expand-button { border: 0; background: transparent; padding: 6px; border-radius: 10px; cursor: pointer; }
.expand-button .icon { width: 18px; height: 18px; }

.said-body { padding: 3px 11px 8px; }
.playable-row { display: grid; grid-template-columns: 29px minmax(0, 1fr) auto; gap: 7px; align-items: start; padding: 5px 0; }
.playable-row.text-aligned { column-gap: 7px; row-gap: 2px; }
.playable-row.with-meta {
  grid-template-areas:
    ". meta extra"
    "button text extra";
}
.playable-row.with-meta .segment-meta-row {
  grid-area: meta;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 0;
}
.playable-row.with-meta .play-button {
  grid-area: button;
  align-self: start;
  margin-top: 1px;
}
.playable-row.with-meta .playable-content {
  grid-area: text;
}
.playable-row.comment-playable-row {
  grid-template-areas: "button text extra";
}
.playable-row.comment-playable-row .play-button {
  grid-area: button;
  align-self: start;
  margin-top: 1px;
}
.playable-row.comment-playable-row .playable-content {
  grid-area: text;
}
.play-button {
  width: 26px; height: 26px; border-radius: 8px; border: 1px solid rgba(0, 196, 128, .22);
  background: rgba(226, 255, 244, .72); color: var(--mint-700); display: inline-grid; place-items: center;
  cursor: pointer; box-shadow: none; flex: 0 0 auto; transition: transform .16s ease, background-color .16s ease, color .16s ease;
}
.play-button:hover { transform: scale(1.05); background: var(--mint-100); color: var(--mint-900); }
.play-button:active { transform: scale(.96); }
.play-button.small { width: 24px; height: 24px; border-radius: 7px; }
.play-button .icon { width: 13px; height: 13px; }
.playable-content { min-width: 0; }
.segment-meta { font-size: 10px; color: var(--muted); margin-bottom: 2px; }
.said-text { font-family: Georgia, "Times New Roman", serif; font-size: 16px; line-height: 1.34; margin: 0; overflow-wrap: anywhere; }
.playback-line { height: 2px; background: var(--mint-500); margin-top: 5px; width: 100%; transform-origin: left; }
.resaid-button { border: 0; background: transparent; color: var(--ink); font-size: 11px; padding: 7px 2px; cursor: pointer; display: flex; align-items: center; gap: 3px; }
.resaid-button .icon { width: 13px; height: 13px; color: var(--mint-400); }
.resaid-number { font-weight: 850; }
.resaid-label { font-size: 8px; color: var(--muted); }

.tags { display: flex; flex-wrap: wrap; gap: 5px; padding-top: 7px; }
.tag { color: var(--mint-700); background: var(--mint-100); border-radius: var(--radius-pill); padding: 3px 8px; font-size: 10px; }
.interaction-row { border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.interaction-button { border: 0; border-right: 1px solid var(--line); background: white; min-height: 34px; padding: 5px 3px; font-size: 10px; display: flex; align-items: center; justify-content: center; gap: 4px; cursor: pointer; }
.interaction-button:last-child { border-right: 0; }
.interaction-button.active { background: var(--mint-100); color: var(--mint-900); }
.interaction-button .icon { width: 15px; height: 15px; }
.stat-strip { display: flex; gap: 10px; align-items: center; color: #73847d; font-size: 10px; padding: 5px 11px; border-top: 1px solid var(--line); }
.stat { display: inline-flex; align-items: center; gap: 3px; }
.stat .icon { width: 13px; height: 13px; }

.comment-thread { border-top: 1px solid var(--mint-300); background: linear-gradient(180deg, #fbfffd, #f0fff8); padding: 8px 10px 10px 34px; }
.comment-card { border-left: 2px solid var(--mint-400); padding: 7px 0 7px 9px; margin-left: calc(var(--comment-depth, 0) * 10px); }
.comment-head { display: flex; align-items: center; gap: 6px; font-size: 10px; }
.comment-text { font-size: 12px; line-height: 1.35; margin: 4px 0; }
.comment-actions { display: flex; gap: 9px; align-items: center; font-size: 10px; color: var(--muted); }
.comment-actions button { border: 0; background: transparent; color: var(--mint-800); font-weight: 750; padding: 2px 0; cursor: pointer; }
.comment-children { margin-top: 4px; }
.comment-target-preview { margin: 0 10px 10px; padding: 9px 11px; background: #f2fff8; border-left: 3px solid var(--mint-500); border-radius: 8px; }
.comment-target-preview p { margin: 4px 0 0; font-family: Georgia, serif; }
.field-hint { font-size: 11px; color: var(--muted); margin: 8px 0 0; }
.add-comment-button { width: 100%; border: 0; border-radius: 0 0 13px 13px; background: var(--mint-300); padding: 9px; font-weight: 750; cursor: pointer; }

/* Paragraph refinement baseline: one card per recorded conversation/time group. */
.paragraph-scroll-view { padding-top: 8px; }
.paragraph-content-column { width: min(100%, 900px); }
.paragraph-filter-panel {
  background: rgba(255,255,255,.96);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  padding: 10px 12px;
  margin-bottom: 9px;
}
.paragraph-filter-panel > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.paragraph-filter-panel strong { font-size: 12px; }
.paragraph-filter-panel > div:first-child span { font-size: 10px; color: var(--muted); }
.paragraph-person-rail { display: flex; gap: 6px; overflow-x: auto; padding-top: 8px; scrollbar-width: none; }
.paragraph-person-rail::-webkit-scrollbar { display: none; }
.paragraph-person-chip {
  border: 1px solid var(--line);
  background: white;
  border-radius: var(--radius-pill);
  min-width: max-content;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px 4px 5px;
  cursor: pointer;
  font-size: 10px;
  color: var(--mint-800);
}
.paragraph-person-chip.active { background: var(--mint-900); color: white; border-color: var(--mint-900); }
.paragraph-person-chip .avatar { width: 22px; height: 22px; }
.paragraph-conversation-card {
  background: white;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0, 93, 56, .1);
  margin: 7px 0 12px;
  overflow: hidden;
}
.paragraph-conversation-card.playing { box-shadow: 0 0 0 3px rgba(0, 221, 149, .5), var(--shadow-md); }
.paragraph-conversation-head {
  display: grid;
  grid-template-columns: 78px minmax(0,1fr);
  gap: 10px;
  align-items: center;
  padding: 9px 11px;
  background: linear-gradient(180deg, #ffffff, #f8fffc);
}
.paragraph-source-preview { width: 78px; height: 54px; object-fit: cover; border-radius: 10px; background: var(--mint-100); }
.paragraph-conversation-copy { min-width: 0; }
.paragraph-conversation-copy h2 { margin: 0; font-size: 13px; line-height: 1.25; }
.paragraph-conversation-meta { display: flex; flex-wrap: wrap; gap: 3px 8px; color: var(--muted); font-size: 9px; margin-top: 4px; }
.paragraph-conversation-body { padding: 9px 13px 4px; }
.paragraph-speaker-block { margin: 0 0 12px; }
.paragraph-speaker-block:last-child { margin-bottom: 5px; }
.paragraph-speaker-head { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.paragraph-speaker-head > div { display: flex; align-items: center; gap: 4px; min-width: 0; font-size: 10px; color: var(--mint-800); }
.paragraph-speaker-head .icon { width: 12px; height: 12px; color: var(--mint-500); }
.paragraph-prose {
  margin: 0;
  padding-left: 28px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  line-height: 1.62;
  color: var(--ink);
}
.paragraph-said-unit { display: inline; position: relative; }
.paragraph-said-unit.playing { background: linear-gradient(transparent 62%, rgba(0,221,149,.24) 62%); }
.paragraph-inline-play {
  border: 1px solid rgba(0, 196, 128, .22);
  background: rgba(226, 255, 244, .72);
  color: var(--mint-700);
  width: 20px;
  height: 20px;
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  margin: 0 4px 0 1px;
  vertical-align: -3px;
  cursor: pointer;
  transition: transform .16s ease, background-color .16s ease;
}
.paragraph-inline-play:hover { transform: scale(1.05); background: var(--mint-100); }
.paragraph-inline-play .icon { width: 10px; height: 10px; }
.paragraph-inline-meta { font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: 9px; color: var(--muted); white-space: nowrap; margin-right: 3px; }
.paragraph-inline-text { text-decoration-line: underline; text-decoration-color: var(--mint-500); text-decoration-thickness: 1px; text-underline-offset: 4px; }
.paragraph-resaid-count {
  border: 0;
  background: var(--mint-100);
  color: var(--mint-900);
  border-radius: var(--radius-pill);
  min-width: 21px;
  height: 20px;
  padding: 0 6px;
  margin: 0 2px 0 4px;
  font: 800 9px/20px Inter, ui-sans-serif, system-ui, sans-serif;
  vertical-align: 1px;
  cursor: pointer;
}
.paragraph-inline-actions { display: inline-flex; align-items: center; gap: 1px; margin: 0 5px 0 2px; vertical-align: -3px; }
.paragraph-inline-actions button { border: 0; background: transparent; color: var(--muted); padding: 2px; cursor: pointer; font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: 8px; display: inline-flex; align-items: center; gap: 1px; }
.paragraph-inline-actions button.active { color: var(--mint-800); background: var(--mint-100); border-radius: 6px; }
.paragraph-inline-actions .icon { width: 11px; height: 11px; }
.paragraph-comments-panel { border-top: 1px solid var(--line); background: #fbfffd; padding: 8px 12px; }
.paragraph-comments-panel summary { cursor: pointer; font-size: 10px; font-weight: 800; color: var(--mint-800); }
.paragraph-comment-context { margin: 8px 0 0 28px; font-size: 9px; color: var(--muted); }
.paragraph-conversation-actions { border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 10px; }
.paragraph-conversation-actions .secondary-button { min-height: 32px; padding: 5px 10px; font-size: 9px; }
.paragraph-conversation-actions .icon { width: 13px; height: 13px; }

.end-message { text-align: center; background: rgba(255,255,255,.9); border: 1px solid rgba(0,177,112,.12); border-radius: var(--radius-pill); padding: 11px 20px; margin: 18px auto 22px; width: max-content; max-width: 90%; font-family: Georgia, "Times New Roman", serif; font-size: 13px; font-style: italic; color: var(--mint-900); box-shadow: 0 6px 18px rgba(0,90,55,.06); }
.end-message::before, .end-message::after { content: "•"; color: var(--mint-400); padding: 0 7px; font-style: normal; }
.empty-state { background: white; border-radius: var(--radius-card); padding: 28px 18px; text-align: center; box-shadow: var(--shadow-sm); margin: 12px auto; }
.empty-state .icon { width: 36px; height: 36px; color: var(--mint-500); }

.app-footer {
  background: rgba(255,255,255,.96);
  border-top: 1px solid rgba(0, 79, 48, .12);
  position: relative;
  z-index: 60;
  padding-bottom: max(7px, env(safe-area-inset-bottom));
  box-shadow: 0 -8px 25px rgba(0, 84, 51, .09);
}
.player-shell { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 7px 10px 4px; }
.now-playing { min-width: 0; }
.now-title { font-size: 11px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now-subtitle { font-size: 9px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-controls { display: flex; align-items: center; justify-content: center; gap: 2px; }
.player-button { border: 0; background: transparent; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.player-button.primary { background: var(--mint-500); color: white; width: 42px; height: 42px; }
.player-button .icon { width: 17px; height: 17px; }
.progress-row { grid-column: 1 / -1; display: grid; grid-template-columns: 34px 1fr 34px; align-items: center; gap: 7px; font-size: 9px; color: var(--muted); }
.progress-row input { accent-color: var(--mint-500); width: 100%; }
.bottom-nav { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; padding: 3px 8px 0; }
.nav-button { border: 0; border-radius: 10px; background: #eef7f3; min-height: 38px; padding: 4px 2px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; cursor: pointer; font-size: 8px; }
.nav-button.active { background: var(--mint-300); color: var(--mint-950); }
.nav-button.compose { background: var(--mint-500); color: white; }
.nav-button.topic-nav { grid-column: 4; background: #ffffff; box-shadow: inset 0 0 0 1px var(--mint-300); }
.nav-button.topic-nav.active { background: var(--mint-900); color: white; box-shadow: none; }
.nav-button .icon { width: 17px; height: 17px; }

/* Timeline */
.timeline-page { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: #effaf5; }
.timeline-toolbar { background: white; padding: 8px 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.timeline-toolbar label { font-size: 11px; display: flex; align-items: center; gap: 7px; }
.timeline-toolbar input[type="range"] { accent-color: var(--mint-500); }
.timeline-viewport { min-height: 0; overflow: auto; position: relative; overscroll-behavior: contain; background: linear-gradient(180deg, #f2fff9, #e2f5ec); }
.timeline-canvas { min-width: 1600px; position: relative; padding-bottom: 12px; }
.timeline-track { display: grid; grid-template-columns: 86px 1fr; min-height: 84px; border-bottom: 1px solid rgba(0, 91, 55, .12); }
.timeline-track.expanded { min-height: 150px; }
.track-person { position: sticky; left: 0; z-index: 8; background: rgba(239, 250, 245, .97); display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 8px 4px; border-right: 1px solid var(--line); }
.track-person button { border: 0; background: transparent; cursor: pointer; }
.track-person .avatar { width: 42px; height: 42px; }
.track-handle { font-size: 9px; color: var(--mint-800); max-width: 78px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-lane { position: relative; min-height: inherit; background-image: linear-gradient(90deg, rgba(0, 117, 72, .08) 1px, transparent 1px); background-size: 80px 100%; }
.timeline-card { position: absolute; top: 12px; background: white; border: 1px solid rgba(0, 116, 70, .14); box-shadow: var(--shadow-sm); border-radius: 12px; padding: 7px 9px; height: 58px; overflow: hidden; cursor: pointer; white-space: nowrap; z-index: 3; }
.timeline-card.playing { box-shadow: 0 0 0 3px var(--mint-400), var(--shadow-md); z-index: 5; }
.timeline-card .timeline-text { font-family: Georgia, serif; font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.timeline-card .timeline-meta { color: var(--muted); font-size: 9px; display: flex; align-items: center; gap: 4px; }
.timeline-card.expanded { height: 125px; white-space: normal; overflow: visible; z-index: 20; }
.timeline-card.expanded .timeline-text { white-space: normal; max-height: 48px; overflow: auto; }
.timeline-card-actions { display: flex; gap: 4px; margin-top: 6px; }
.timeline-card-actions button { border: 0; background: var(--mint-100); border-radius: 8px; font-size: 9px; padding: 4px 7px; cursor: pointer; }
.comment-lane { position: absolute; top: 78px; left: 0; right: 0; height: 55px; border-top: 1px dashed var(--mint-400); }
.comment-marker { position: absolute; top: 8px; background: #fff5fa; border: 1px solid #f1bfd2; border-radius: 10px; padding: 5px 8px; font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.time-ruler { height: 34px; background: white; border-top: 1px solid var(--line); margin-left: 86px; min-width: 1514px; position: relative; }
.time-tick { position: absolute; top: 0; height: 100%; border-left: 1px solid #9dcbb8; padding: 3px 0 0 4px; font-size: 9px; color: var(--muted); }
.playhead { position: absolute; top: 0; bottom: 0; width: 2px; background: #ff466e; z-index: 30; pointer-events: none; }
.playhead::before { content: ''; position: absolute; top: -1px; left: -4px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 8px solid #ff466e; }

/* Discovery */
.discovery-view { height: 100%; overflow-y: auto; background: #f8fffc; }
.discovery-layer { padding: 10px 8px 13px; }
.discovery-layer:nth-child(6n+1) { background: #bbf6e7; }
.discovery-layer:nth-child(6n+2) { background: #e0d2f5; }
.discovery-layer:nth-child(6n+3) { background: #f5d3df; }
.discovery-layer:nth-child(6n+4) { background: #e4e4e4; }
.discovery-layer:nth-child(6n+5) { background: #b8eee2; }
.discovery-layer:nth-child(6n) { background: #e7d7f5; }
.layer-label { font-size: 11px; font-weight: 800; margin-bottom: 5px; }
.rail { display: flex; overflow-x: auto; gap: 7px; scrollbar-width: none; padding: 2px 1px 5px; }
.person-pill { border: 0; background: white; border-radius: var(--radius-pill); height: 56px; min-width: 150px; max-width: 190px; display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: center; padding: 5px 10px 5px 5px; box-shadow: var(--shadow-sm); cursor: pointer; text-align: left; }
.person-pill .avatar { width: 40px; height: 40px; }
.person-pill-name { font-size: 12px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 2px; }
.person-pill-name .icon { width: 12px; height: 12px; color: var(--mint-500); }
.person-pill-handle { font-size: 10px; color: var(--mint-700); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Compose */
.compose-view, .settings-view, .share-view, .profile-view, .search-view, .lab-view { height: 100%; overflow-y: auto; padding: 10px max(10px, calc((100% - 720px) / 2)) 40px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: white; padding: 4px 4px 9px; }
.page-heading h1 { font-size: 17px; margin: 0; }
.panel { background: white; border-radius: var(--radius-card); box-shadow: var(--shadow-sm); padding: 13px; margin-bottom: 10px; }
.panel h2 { font-size: 14px; margin: 0 0 8px; }
.panel h3 { font-size: 12px; margin: 10px 0 6px; }
.field { display: grid; gap: 5px; margin: 9px 0; }
.field label { font-size: 11px; font-weight: 700; }
.field small { color: var(--muted); font-size: 10px; }
.field input, .field textarea, .field select { width: 100%; border: 1px solid #cfe7dc; border-radius: 11px; padding: 10px; background: #fbfffd; }
.field textarea { min-height: 94px; resize: vertical; }
.evidence-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.evidence-option { border: 1px solid var(--mint-300); background: var(--mint-100); border-radius: 12px; min-height: 72px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; font-size: 10px; }
.evidence-option.active { background: var(--mint-500); color: white; }
.evidence-option .icon { width: 24px; height: 24px; }
.recorder { background: #f1fff9; border-radius: 12px; padding: 10px; text-align: center; }
.record-dot { width: 12px; height: 12px; border-radius: 50%; background: #ef3d62; display: inline-block; margin-right: 5px; }
.segment-editor { border: 1px solid var(--line); border-radius: 12px; padding: 8px; margin: 7px 0; }
.segment-editor-grid { display: grid; grid-template-columns: 1fr 86px 86px; gap: 6px; }
.primary-button, .secondary-button, .danger-button { border: 0; border-radius: var(--radius-pill); min-height: 42px; padding: 9px 18px; font-weight: 750; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.primary-button { background: var(--mint-500); color: white; }
.secondary-button { background: var(--mint-100); color: var(--mint-900); border: 1px solid var(--mint-300); }
.danger-button { background: #ffe8ef; color: var(--danger); }
.button-row { display: flex; flex-wrap: wrap; gap: 7px; }
.button-row.sticky { position: sticky; bottom: 0; background: rgba(0,221,149,.95); padding: 8px; margin: 0 -10px -40px; z-index: 10; }
.validation-list { margin: 0; padding-left: 18px; font-size: 11px; }
.validation-list li.ok { color: var(--mint-800); }
.validation-list li.fail { color: var(--danger); }

/* Search/profile/share */
.search-results { display: grid; gap: 8px; }
.result-section h2 { font-size: 12px; color: white; margin: 12px 2px 6px; }
.profile-hero { background: white; border-radius: var(--radius-card); padding: 16px; display: grid; grid-template-columns: 84px 1fr; gap: 13px; box-shadow: var(--shadow-sm); }
.profile-name { display: flex; align-items: center; gap: 4px; font-size: 20px; font-weight: 850; }
.profile-name .icon { width: 17px; height: 17px; color: var(--mint-500); }
.profile-handle { color: var(--mint-700); }
.profile-stats { display: flex; gap: 12px; margin-top: 8px; font-size: 11px; }
.qr-stage { display: grid; place-items: center; background: white; border-radius: 14px; padding: 12px; min-height: 300px; overflow: auto; }
.qr-stage svg { max-width: 100%; height: auto; image-rendering: pixelated; }
.frame-status { font-size: 11px; color: var(--muted); text-align: center; margin: 8px 0; }
.code-output { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; overflow-wrap: anywhere; background: #f1f6f3; border-radius: 10px; padding: 9px; max-height: 150px; overflow: auto; }
.scanner-video { width: 100%; border-radius: 12px; background: #111; min-height: 230px; }
.diagnostic-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 8px; }
.diagnostic { background: #f2fff9; border-radius: 11px; padding: 10px; }
.diagnostic strong { display: block; font-size: 18px; color: var(--mint-900); }

/* Modal/toasts */
#modal-root { position: fixed; inset: 0; z-index: 1000; }
.modal-backdrop { position: absolute; inset: 0; background: linear-gradient(145deg, rgba(0,63,31,.92), rgba(0,221,149,.88)); display: grid; place-items: center; padding: 14px; }
.modal-backdrop.tag-gradient { background: linear-gradient(145deg, rgba(82,75,0,.93), rgba(255,230,0,.84)); }
.modal-card { width: min(100%, 600px); max-height: min(90dvh, 760px); overflow: auto; background: white; border-radius: 22px; box-shadow: 0 30px 80px rgba(0, 36, 22, .3); padding: 18px; position: relative; }
.modal-close { position: sticky; top: 0; float: right; z-index: 3; }
.icon-button { border: 0; background: rgba(255,255,255,.85); width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.icon-button .icon { width: 18px; height: 18px; }
.toast-root { position: fixed; z-index: 2000; top: max(14px, env(safe-area-inset-top)); right: 14px; display: grid; gap: 7px; pointer-events: none; }
.toast { background: #17362c; color: white; border-radius: 12px; padding: 10px 14px; box-shadow: var(--shadow-md); transform: translateY(-12px); opacity: 0; transition: .2s ease; max-width: min(360px, calc(100vw - 28px)); font-size: 12px; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { background: #006e47; }
.toast.error { background: #9e2648; }

.icon { display: inline-block; width: 1em; height: 1em; vertical-align: middle; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

@media (max-width: 640px) {
  :root { --footer-height: 139px; }
  body { background: var(--mint-200); }
  .app-shell { width: 100%; box-shadow: none; }
  .logo-button { min-width: 93px; }
  .logo-button img { width: 98px; }
  .scroll-view { padding: 6px 8px 24px; }
  .media-card.compact { grid-template-columns: 88px 1fr; }
  .media-card.compact .media-preview { height: 62px; }
  .said-text { font-size: 15px; }
  .nav-button { font-size: 7px; padding-left: 1px; padding-right: 1px; }
  .nav-button .icon { width: 16px; height: 16px; }
  .paragraph-conversation-head { grid-template-columns: 66px minmax(0,1fr); }
  .paragraph-source-preview { width: 66px; height: 48px; }
  .paragraph-prose { padding-left: 0; font-size: 14px; line-height: 1.58; }
  .player-shell { grid-template-columns: minmax(0, 1fr) auto; }
  .player-button { width: 30px; height: 30px; }
  .player-button.primary { width: 38px; height: 38px; }
  .evidence-options { grid-template-columns: 1fr; }
  .segment-editor-grid { grid-template-columns: 1fr 70px 70px; }
}

@media (min-width: 900px) {
  .app-shell { border-radius: 20px; height: calc(100dvh - 20px); margin-top: 10px; }
  .bottom-nav { max-width: 640px; margin: 0 auto; }
  .player-shell { max-width: 900px; margin: 0 auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media (forced-colors: active) {
  .play-button, .player-button.primary, .nav-button.compose { border: 2px solid ButtonText; }
}

/* --------------------------------------------------------------------------
   v1.3 profile, search, footer, minimal-attribute, and timeline refinement
   -------------------------------------------------------------------------- */
:root {
  --footer-height: 184px;
  --header-height: 118px;
}
body {
  background: linear-gradient(180deg, #ffffff 0%, #fbfffd 38%, #effcf6 72%, #def7eb 100%);
}
.app-shell {
  background: #ffffff;
}
.app-main {
  background: linear-gradient(180deg, #ffffff 0%, #fbfffd 34%, #f1fcf6 67%, #e4f7ed 100%);
}
.app-header {
  background: #ffffff;
}
.search-shell,
.logo-button {
  background: #ffffff;
}
.semantic-row {
  scroll-snap-type: x proximity;
}
.semantic-chip {
  scroll-snap-align: center;
  transition: transform .18s ease, background-color .18s ease, color .18s ease, box-shadow .18s ease;
}
.semantic-chip:hover { transform: translateY(-1px); }
.semantic-chip.active { box-shadow: 0 4px 12px rgba(0,102,63,.18); }
.semantic-transition {
  animation: semantic-panel-forward .28s cubic-bezier(.2,.75,.3,1) both;
}
.semantic-transition.direction-backward {
  animation-name: semantic-panel-backward;
}
@keyframes semantic-panel-forward {
  from { opacity: .2; transform: translateX(18px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes semantic-panel-backward {
  from { opacity: .2; transform: translateX(-18px); }
  to { opacity: 1; transform: translateX(0); }
}
.search-fallback-note {
  background: linear-gradient(90deg, #ffffff, #effff7);
  border: 1px solid var(--mint-200);
  border-radius: 12px;
  padding: 9px 11px;
  margin: 4px 0 10px;
  color: var(--mint-900);
  font-size: 11px;
}
.result-section h2,
.page-heading {
  color: var(--ink);
}
.discovery-intro {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  padding: 12px 12px 8px;
  background: linear-gradient(180deg,#fff,#f6fff9);
  border-bottom: 1px solid var(--line);
}
.discovery-intro span { color: var(--muted); font-size: 10px; }
.discovery-topic-card {
  min-width: 150px;
  min-height: 56px;
  border: 0;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  cursor: pointer;
}
.discovery-topic-card strong { color: var(--mint-800); font-size: 12px; }
.discovery-topic-card span { color: var(--muted); font-size: 9px; }

/* Footer: player, content-view strip, then primary destination strip. */
.app-footer {
  background: linear-gradient(180deg, #ffffff 0%, #fcfefd 58%, #f6faf8 100%);
  border-top-color: #dce9e3;
}
.footer-view-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 5px;
  padding: 4px 10px 5px;
  background: linear-gradient(180deg, #ffffff, #fbfdfc);
  border-top: 1px solid #edf3f0;
  border-bottom: 1px solid #e4ece8;
}
.footer-view-button {
  min-height: 31px;
  border: 0;
  border-radius: 999px;
  background: #f6faf8;
  color: #7a8781;
  cursor: pointer;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: background .18s ease, transform .18s ease, color .18s ease;
}
.footer-view-button:hover { transform: translateY(-1px); }
.footer-view-button.active {
  background: linear-gradient(180deg, #eafff5, #dff8ec);
  color: var(--mint-800);
  box-shadow: inset 0 0 0 1px var(--mint-200);
}
.bottom-nav {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  padding: 4px 8px 0;
  background: linear-gradient(180deg, #fbfdfc 0%, #f4f8f6 100%);
}
.nav-button {
  background: linear-gradient(180deg, #ffffff, #f3f7f5);
  box-shadow: inset 0 0 0 1px rgba(0,70,43,.05);
}
.nav-button.active { background: linear-gradient(180deg, #e9fff5, #cdf3e1); }
.nav-button.compose { background: linear-gradient(180deg, var(--mint-400), var(--mint-600)); }

/* Minimal versus expanded Said attributes. */
.said-card {
  position: relative;
  border-radius: 10px;
  overflow: visible;
}
.said-card.attributes-minimal { overflow: hidden; }
.attribute-toggle {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 6;
  width: 25px;
  height: 22px;
  border: 0;
  border-radius: 9px 0 9px 0;
  background: linear-gradient(135deg, #9beab9, #69cf86);
  color: white;
  display: grid;
  place-items: center;
  cursor: pointer;
  transform-origin: 50% 50%;
  transition: transform .2s ease, border-radius .2s ease;
}
.attribute-toggle .icon { width: 13px; height: 13px; transition: transform .2s ease; }
.attribute-toggle.expanded .icon { transform: rotate(180deg); }
.said-card-header { padding-left: 30px; }
.inline-profile-link,
.attribute-grid button {
  border: 0;
  background: transparent;
  color: var(--mint-800);
  padding: 0;
  cursor: pointer;
  font-size: inherit;
}
.resaid-reference {
  vertical-align: super;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: 800 10px/1 Inter,ui-sans-serif,system-ui,sans-serif;
  padding: 0 2px;
  cursor: pointer;
}
.said-attribute-panel {
  margin: 8px -2px 0;
  padding: 8px 9px;
  border-radius: 11px;
  background: linear-gradient(180deg,#fbfffd,#f2fff8);
  border: 1px solid var(--line);
}
.attribute-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 7px 12px;
  margin: 0;
}
.attribute-grid div { min-width: 0; }
.attribute-grid dt { font-size: 8px; font-weight: 850; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.attribute-grid dd { margin: 1px 0 0; font-size: 10px; overflow-wrap: anywhere; }
.mood-tag { background: #fff7d9; color: #8a6500; }
.interaction-row.minimal .interaction-button { min-height: 30px; }
.interaction-row.minimal .interaction-count { font-size: 8px; }
.interaction-row.expanded .interaction-button { min-height: 36px; }
.reaction-eye,.reaction-eye .icon { color: #ffbddd; }
.reaction-share,.reaction-share .icon { color: #74ddf6; }
.reaction-comment,.reaction-comment .icon { color: #93e7b2; }
.reaction-dislike,.reaction-dislike .icon { color: #efadc2; }
.reaction-like,.reaction-like .icon { color: #82dca1; }
.reaction-tag,.reaction-tag .icon { color: #e8c769; }
.interaction-button.active { color: var(--mint-900); }
.playback-line {
  transition: transform 180ms linear;
  will-change: transform;
  transform-origin: left center;
}

/* Paragraph mode remains one conversation/time card without Said card dividers. */
.paragraph-conversation-card {
  border-radius: 12px;
}
.paragraph-speaker-block {
  border: 0;
}
.paragraph-said-unit {
  border: 0;
}
.paragraph-inline-text { text-decoration-thickness: 1.5px; }
.paragraph-resaid-count {
  vertical-align: super;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 850;
  padding: 0 2px;
}

/* A profile is a high-level viewing context, not a separate dead-end page. */
.profile-context-card {
  position: relative;
  margin: 8px max(8px, calc((100% - 760px)/2));
  background: linear-gradient(180deg,#ffffff,#f7fffb);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  padding: 12px 50px 12px 12px;
  display: grid;
  grid-template-columns: 72px minmax(0,1fr);
  gap: 12px;
  max-height: 150px;
  overflow: auto;
}
.profile-context-card .avatar.large { width: 68px; height: 68px; }
.profile-context-copy p { margin: 5px 0; font-size: 10px; color: var(--muted); }
.persona-status {
  display: inline-block;
  margin-top: 2px;
  color: var(--mint-800);
  background: var(--mint-100);
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 8px;
  font-weight: 800;
}
.profile-context-close,
.profile-send-button {
  position: absolute;
  border: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.profile-context-close {
  top: 7px;
  left: 7px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow-sm);
}
.profile-send-button {
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  color: var(--mint-800);
  background: linear-gradient(180deg,#effff7,#dcf8eb);
}
.profile-composite-view,
.profile-content-mode { height: 100%; min-height: 0; }
.profile-composite-view { display: flex; flex-direction: column; }
.profile-composite-view > .profile-context-card { flex: 0 0 auto; }
.profile-content-mode { flex: 1; overflow: hidden; }

/* Share opens with the camera before the generator. */
.receive-first-card { border: 2px solid var(--mint-200); }
.camera-ready-stage {
  min-height: 190px;
  border-radius: 18px;
  margin: 8px 0 12px;
  background: linear-gradient(145deg,#edfdf6,#dff7eb);
  color: var(--mint-800);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 7px;
  position: relative;
  overflow: hidden;
}
.camera-ready-stage > .icon { width: 42px; height: 42px; }
.camera-ready-stage span { max-width: 300px; text-align: center; font-size: 10px; color: var(--muted); }
.camera-corners::before,
.camera-corners::after,
.camera-ready-stage::before,
.camera-ready-stage::after {
  content: '';
  position: absolute;
  width: 34px;
  height: 34px;
  border-color: var(--mint-500);
}
.camera-ready-stage::before { top: 18px; left: 18px; border-top: 3px solid; border-left: 3px solid; }
.camera-ready-stage::after { top: 18px; right: 18px; border-top: 3px solid; border-right: 3px solid; }
.camera-corners::before { bottom: 18px; left: 18px; border-bottom: 3px solid; border-left: 3px solid; }
.camera-corners::after { bottom: 18px; right: 18px; border-bottom: 3px solid; border-right: 3px solid; }

/* Timeline: scrollable media/metadata panel, draggable divider, and readable time cards. */
.timeline-page {
  grid-template-rows: auto var(--timeline-media-height,228px) 9px minmax(0,1fr) auto;
  background: linear-gradient(180deg,#ffffff,#effaf5);
}
.timeline-context-panel {
  min-height: 120px;
  max-height: 520px;
  overflow: hidden;
  background: #ffffff;
}
.timeline-context-scroll {
  height: 100%;
  overflow-y: auto;
  padding: 8px max(8px,calc((100% - 760px)/2));
}
.timeline-context-scroll .media-card { margin: 0 auto 8px; max-width: 760px; }
.timeline-context-scroll .profile-context-card { margin: 0 auto 8px; max-width: 760px; }
.timeline-context-scroll .said-card { max-width: 760px; margin-left: auto; margin-right: auto; }
.timeline-context-meta {
  max-width: 760px;
  margin: 0 auto 8px;
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 6px;
}
.timeline-context-meta span {
  background: #f6fffa;
  border-radius: 10px;
  padding: 7px 9px;
  font-size: 9px;
  overflow-wrap: anywhere;
}
.timeline-context-meta strong { display: block; font-size: 8px; color: var(--muted); text-transform: uppercase; }
.timeline-selected-heading {
  max-width: 760px;
  margin: 7px auto 3px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 10px;
}
.timeline-selected-heading span { color: var(--muted); }
.timeline-divider {
  cursor: row-resize;
  background: linear-gradient(180deg,#f8fffb,#dff7eb);
  border-top: 1px solid var(--mint-200);
  border-bottom: 1px solid var(--mint-200);
  display: grid;
  place-items: center;
  touch-action: none;
}
.timeline-divider span {
  width: 54px;
  height: 3px;
  border-radius: 999px;
  background: var(--mint-400);
}
.resizing-timeline { cursor: row-resize !important; user-select: none; }
.timeline-viewport { background: linear-gradient(90deg,#e8f6ef,#f2ffe9 55%,#e5f5ee); }
.timeline-canvas { min-width: 1600px; }
.timeline-track { grid-template-columns: 104px 1fr; min-height: 96px; }
.timeline-track.expanded { min-height: 176px; }
.track-person {
  background: rgba(255,255,255,.98);
  border-right: 4px solid #d8e852;
  padding: 7px 4px;
}
.track-person .avatar { width: 46px; height: 46px; border: 2px solid var(--mint-400); }
.track-profile-button { padding: 0; }
.track-name { font-size: 9px; text-align: center; line-height: 1.1; margin-top: 2px; }
.track-handle { font-size: 8px; }
.track-stats { font-size: 7px; color: var(--muted); text-align: center; }
.track-expand-button { margin-top: 2px; color: var(--mint-700); }
.track-lane { background-size: 96px 100%; }
.timeline-card {
  top: 9px;
  height: 76px;
  border-radius: 0;
  padding: 8px 10px 6px 27px;
  overflow: visible;
  white-space: nowrap;
}
.timeline-card.minimal { overflow: visible; }
.timeline-card.expanded { height: 154px; white-space: nowrap; }
.timeline-card .timeline-text {
  font-size: 14px;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.3;
  border-bottom: 2px solid var(--mint-400);
  width: max-content;
  max-width: calc(100% - 8px);
}
.timeline-card.expanded .timeline-text {
  white-space: nowrap;
  max-height: none;
  overflow: visible;
}
.timeline-attribute-toggle {
  position: absolute;
  left: 0;
  top: 0;
  width: 23px;
  height: 22px;
  border: 0;
  border-radius: 0 0 8px 0;
  background: linear-gradient(135deg,#9beab9,#67cc83);
  color: white;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.timeline-attribute-toggle .icon { width: 12px; height: 12px; transition: transform .2s ease; }
.timeline-attribute-toggle.expanded .icon { transform: rotate(180deg); }
.timeline-meta { min-height: 25px; }
.timeline-mini-reactions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
}
.timeline-mini-reactions .icon { width: 14px; height: 14px; }
.timeline-expanded-attributes {
  display: flex;
  gap: 6px 12px;
  flex-wrap: wrap;
  margin-top: 6px;
  font-size: 8px;
  color: var(--muted);
}
.timeline-card-actions { margin-top: 5px; }
.comment-lane { top: 102px; height: 67px; }
.time-ruler { margin-left: 104px; }
.timeline-help {
  min-height: 26px;
  padding: 5px 10px;
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: center;
  font-size: 9px;
  color: var(--muted);
  background: #ffffff;
  border-top: 1px solid var(--line);
}
.timeline-help .icon { width: 14px; height: 14px; color: var(--mint-700); }

@media (max-width: 640px) {
  :root { --footer-height: 186px; }
  .header-row { gap: 6px; }
  .semantic-chip { padding: 6px 12px; }
  .footer-view-strip { padding-left: 7px; padding-right: 7px; }
  .footer-view-button { font-size: 8px; }
  .profile-context-card { margin: 6px; grid-template-columns: 58px minmax(0,1fr); max-height: 138px; padding-right: 44px; }
  .profile-context-card .avatar.large { width: 56px; height: 56px; }
  .profile-stats { gap: 6px; flex-wrap: wrap; }
  .attribute-grid { grid-template-columns: 1fr; }
  .timeline-toolbar { max-height: 72px; overflow-y: auto; }
  .timeline-context-meta { grid-template-columns: 1fr; }
  .timeline-track { grid-template-columns: 88px 1fr; }
  .track-person { width: 88px; }
  .time-ruler { margin-left: 88px; }
  .timeline-card { padding-left: 25px; }
}

/* v1.3.1 paragraph conversation disclosure and synchronized playback polish */
.paragraph-conversation-card {
  position: relative;
  overflow: visible;
  background: #ffffff;
}
.paragraph-conversation-card.attributes-minimal {
  overflow: hidden;
}
.paragraph-attribute-toggle {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 7;
  width: 25px;
  height: 22px;
  border: 0;
  border-radius: 9px 0 9px 0;
  background: linear-gradient(135deg,#9beab9,#69cf86);
  color: #ffffff;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.paragraph-attribute-toggle .icon {
  width: 13px;
  height: 13px;
  transition: transform .2s ease;
}
.paragraph-attribute-toggle.expanded .icon { transform: rotate(180deg); }
.paragraph-conversation-head { padding-left: 31px; }
.paragraph-conversation-card.attributes-minimal .paragraph-conversation-meta span:not(:first-child),
.paragraph-conversation-card.attributes-minimal .paragraph-source-preview {
  opacity: .7;
}
.paragraph-conversation-card.attributes-minimal .paragraph-inline-actions,
.paragraph-conversation-card.attributes-minimal .paragraph-comments-panel,
.paragraph-conversation-card.attributes-minimal .paragraph-conversation-actions {
  display: none;
}
.paragraph-conversation-card.attributes-expanded {
  box-shadow: 0 8px 28px rgba(0,88,53,.11);
}
.paragraph-conversation-card.attributes-expanded .paragraph-conversation-head {
  background: linear-gradient(180deg,#ffffff,#f7fffb);
}
.paragraph-inline-text,
.timeline-text,
.said-text {
  text-decoration-skip-ink: auto;
}
.playback-line {
  transition: transform 120ms linear;
  backface-visibility: hidden;
}

/* Preserve enough contrast between the two footer strips while keeping both white. */
.footer-view-strip {
  background: linear-gradient(180deg,#ffffff 0%,#fcfefd 54%,#f8fbf9 100%);
}
.bottom-nav {
  background: linear-gradient(180deg,#f7faf8 0%,#f2f6f4 100%);
}


/* --------------------------------------------------------------------------
   v1.5 narrow-window resilience and horizontal semantic navigation
   -------------------------------------------------------------------------- */
.app-header,
.header-row,
.search-shell,
.semantic-row,
.player-shell,
.player-controls,
.progress-row,
.footer-view-strip,
.bottom-nav {
  min-width: 0;
  max-width: 100%;
}
.app-header { overflow: hidden; }
.header-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}
.search-shell {
  width: 100%;
  overflow: hidden;
}
.search-shell input {
  width: 100%;
  min-width: 0;
}
.logo-button {
  display: grid;
  place-items: center;
  width: clamp(76px, 20vw, 105px);
  min-width: 0;
  max-width: 105px;
  flex: 0 0 auto;
  overflow: hidden;
}
.logo-button img {
  display: block;
  width: 100%;
  max-width: 105px;
  height: auto;
  max-height: 42px;
}
.semantic-row {
  width: 100%;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  scroll-padding-inline: 10px;
  padding-bottom: 4px;
}
.semantic-chip {
  flex: 0 0 auto;
  user-select: none;
}
.player-controls {
  flex-wrap: nowrap;
  white-space: nowrap;
}

@media (max-width: 560px) {
  .app-header { padding-left: 8px; padding-right: 8px; }
  .header-row { gap: 5px; }
  .search-shell {
    min-height: 40px;
    padding-left: 12px;
    padding-right: 8px;
  }
  .search-shell input { font-size: clamp(12px, 4vw, 15px); }
  .logo-button {
    width: clamp(72px, 23vw, 88px);
    height: 40px;
  }
  .logo-button img {
    width: clamp(70px, 22vw, 86px);
    max-height: 36px;
  }
  .semantic-row {
    margin-left: -2px;
    margin-right: -2px;
    width: calc(100% + 4px);
    padding-left: 2px;
    padding-right: 2px;
  }
  .player-shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
    padding: 6px 8px 4px;
  }
  .now-playing {
    grid-column: 1;
    min-width: 0;
  }
  .player-controls {
    grid-column: 1;
    width: 100%;
    justify-content: space-evenly;
    gap: 4px;
    padding: 0 6px;
  }
  .player-button {
    width: 31px;
    height: 31px;
    flex: 0 0 auto;
  }
  .player-button.primary {
    width: 40px;
    height: 40px;
  }
  .progress-row {
    grid-column: 1;
    grid-template-columns: 30px minmax(0, 1fr) 30px;
    gap: 5px;
  }
  .footer-view-strip,
  .bottom-nav {
    width: 100%;
    overflow: hidden;
  }
}

@media (max-width: 360px) {
  .app-header { padding-left: 6px; padding-right: 6px; }
  .header-row { gap: 4px; }
  .search-shell { min-height: 38px; padding-left: 10px; padding-right: 6px; }
  .logo-button { width: 70px; height: 38px; }
  .logo-button img { width: 68px; max-height: 34px; }
  .semantic-chip { padding: 6px 11px; }
  .player-controls { padding-left: 2px; padding-right: 2px; gap: 2px; }
  .player-button { width: 29px; height: 29px; }
  .player-button.primary { width: 38px; height: 38px; }
  .footer-view-button { font-size: 7px; gap: 3px; }
  .nav-button { font-size: 6.5px; }
}

/* --------------------------------------------------------------------------
   v1.6 swipe rails, bounded pills, and true split-pane timeline refinement
   -------------------------------------------------------------------------- */
.semantic-row {
  position: relative;
  background: linear-gradient(180deg, #ffffff 0%, #f9fffc 52%, #effbf5 100%);
  border-top: 1px solid rgba(0, 177, 112, .07);
  border-bottom: 1px solid rgba(0, 177, 112, .12);
  margin: 7px -14px -8px;
  padding: 8px 14px 9px;
  cursor: grab;
  scroll-snap-type: x proximity;
}
.semantic-row.is-dragging,
.rail.is-dragging,
.chip-row.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.semantic-chip {
  scroll-snap-align: start;
  background: linear-gradient(180deg, #ffffff 0%, #f2fff8 100%);
  color: var(--ink);
  border: 1px solid rgba(0, 177, 112, .08);
}
.semantic-chip.active {
  color: var(--mint-900);
  background: linear-gradient(180deg, #f8fffb 0%, #dff8ec 100%);
  box-shadow: inset 0 0 0 1px var(--mint-300), 0 3px 10px rgba(0,102,63,.10);
}
.rail,
.chip-row {
  cursor: grab;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-inline: contain;
  touch-action: pan-x;
}

.person-pill {
  box-sizing: border-box;
  flex: 0 0 min(230px, 78vw);
  width: min(230px, 78vw);
  min-width: min(230px, 78vw);
  max-width: min(230px, 78vw);
  overflow: hidden;
  contain: layout paint;
}
.person-pill > span {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.person-pill-name,
.person-pill-handle {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.person-pill-name { display: flex; }
.person-pill-name .icon { flex: 0 0 auto; }

.timeline-page {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  grid-template-rows: auto minmax(120px, var(--timeline-media-height, 228px)) 11px minmax(120px, 1fr) auto;
}
.timeline-context-panel {
  height: 100%;
  min-height: 0;
  max-height: none;
  overflow: hidden;
}
.timeline-context-scroll {
  height: 100%;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
.timeline-divider {
  position: relative;
  z-index: 40;
  min-height: 11px;
  background: linear-gradient(180deg, #ffffff 0%, #e6f8ef 50%, #ffffff 100%);
  box-shadow: 0 -1px 0 rgba(0,177,112,.13), 0 1px 0 rgba(0,177,112,.16);
}
.timeline-divider::before {
  content: 'media / timeline';
  position: absolute;
  left: 12px;
  color: #709086;
  font-size: 7px;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .75;
}
.timeline-divider span { width: 62px; height: 4px; }
.timeline-viewport {
  min-height: 0;
  min-width: 0;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-x pan-y;
  scrollbar-gutter: stable both-edges;
}
.timeline-canvas { min-height: max-content; }
.timeline-track { width: max-content; min-width: 100%; }
.track-lane { position: relative; min-width: 0; }
.timeline-card {
  box-sizing: border-box;
  max-width: 760px;
  padding-right: 12px;
  contain: layout paint style;
}
.timeline-card.minimal { overflow: hidden; }
.timeline-card.expanded {
  height: auto;
  min-height: 170px;
  overflow: visible;
}
.timeline-card .timeline-text {
  box-sizing: border-box;
  width: fit-content;
  max-width: 100%;
  padding-right: 4px;
}
.timeline-mini-reactions {
  width: 100%;
  min-width: 0;
  gap: 10px;
  overflow: hidden;
  padding: 4px 2px 2px 0;
}
.timeline-mini-reactions > span {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  flex: 0 1 auto;
}
.timeline-mini-reactions small {
  font-size: 7px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 52px;
}
.timeline-card-comments {
  display: grid;
  gap: 4px;
  margin-top: 6px;
  max-height: 56px;
  overflow-y: auto;
}
.timeline-card-comments button {
  border: 0;
  border-left: 2px solid var(--mint-300);
  background: linear-gradient(90deg, #ffffff, #f6fffa);
  color: var(--ink);
  padding: 4px 6px;
  text-align: left;
  font-size: 8px;
  line-height: 1.25;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.timeline-card-comments strong { color: var(--mint-800); }

@media (max-width: 640px) {
  .semantic-row {
    margin-left: -8px;
    margin-right: -8px;
    padding-left: 8px;
    padding-right: 8px;
  }
  .timeline-page {
    grid-template-rows: auto minmax(120px, var(--timeline-media-height, 190px)) 11px minmax(110px, 1fr) auto;
  }
  .timeline-divider::before { display: none; }
}
.timeline-card { contain: layout style; }
.timeline-track.expanded { min-height: 246px; }
.comment-lane { top: 184px; height: 54px; }


/* v1.6.2 play-button polish and minimal timeline cards */
.playable-row.with-meta .play-button {
  margin-top: -1px;
}
.timeline-card {
  margin-bottom: 10px;
}
.timeline-card.minimal {
  height: auto;
  min-height: 74px;
  padding-bottom: 10px;
}
.timeline-card.expanded {
  white-space: normal;
  min-height: 162px;
  padding-bottom: 10px;
}
.timeline-meta {
  min-height: 18px;
  margin-bottom: 3px;
  padding-left: 0;
}
.timeline-content-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  margin-bottom: 4px;
}
.timeline-play-button {
  align-self: start;
  margin-top: 1px;
}
.timeline-card .timeline-text {
  width: auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.timeline-card.expanded .timeline-text {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  width: 100%;
  max-width: 100%;
}
.timeline-card.minimal .timeline-mini-reactions,
.timeline-card.minimal .timeline-expanded-attributes,
.timeline-card.minimal .timeline-card-comments,
.timeline-card.minimal .timeline-card-actions {
  display: none;
}
.timeline-card.expanded .timeline-mini-reactions {
  margin-top: 6px;
  margin-bottom: 4px;
}
.timeline-card.expanded .timeline-card-comments {
  margin-bottom: 6px;
}
.timeline-card.expanded .timeline-card-actions {
  margin-top: 6px;
}


/* v1.6.3 interaction, discovery, TTS, and paragraph refinements */
.discovery-layer .filter-chip.active,
.paragraph-filter-panel .filter-chip.active,
.paragraph-person-chip.active {
  color: var(--mint-900);
  background: linear-gradient(180deg, #ffffff 0%, #e7f9f0 100%);
  border-color: rgba(0, 177, 112, .22);
  box-shadow: inset 0 0 0 1px rgba(0, 221, 149, .22), 0 3px 10px rgba(0,102,63,.08);
}
.paragraph-inline-meta { margin-right: 4px; }
.paragraph-inline-play {
  margin-left: 1px;
  margin-right: 4px;
  vertical-align: -3px;
}
.settings-view select,
.settings-view input[type="range"] { width: 100%; }
.settings-view select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  padding: 8px 10px;
  color: var(--ink);
}


/* Unified card disclosure controls */
.attribute-toggle,
.paragraph-attribute-toggle,
.timeline-attribute-toggle {
  background: linear-gradient(135deg, #ffffff 0%, #f8fffb 48%, #e6faef 100%);
  color: #00d995;
  border: 1px solid rgba(0, 217, 149, .22);
  box-shadow: 0 2px 8px rgba(0, 122, 76, .08), inset 0 0 0 1px rgba(255,255,255,.7);
}
.attribute-toggle:hover,
.paragraph-attribute-toggle:hover,
.timeline-attribute-toggle:hover {
  background: linear-gradient(135deg, #ffffff 0%, #f1fff8 48%, #d8f7e8 100%);
  color: #00c98a;
}
.attribute-toggle:focus-visible,
.paragraph-attribute-toggle:focus-visible,
.timeline-attribute-toggle:focus-visible {
  outline: 2px solid rgba(0, 221, 149, .55);
  outline-offset: 2px;
}
.attribute-toggle .icon,
.paragraph-attribute-toggle .icon,
.timeline-attribute-toggle .icon {
  color: currentColor;
  stroke-width: 2.4;
}

/* --------------------------------------------------------------------------
   v1.6.5 playback scope, monotonic focus lines, silver progress, and comments
   -------------------------------------------------------------------------- */
.playback-line {
  position: relative;
  overflow: hidden;
  height: 3px;
  transform: none !important;
  background: linear-gradient(90deg, #dff8eb 0%, #bfeecf 100%);
  border-radius: 999px;
  transition: background-color 160ms ease, box-shadow 160ms ease;
}
.playback-line::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #30ed9d 0%, #00ff9c 100%);
  transform: scaleX(var(--line-progress, 0));
  transform-origin: left center;
  transition: transform 70ms linear;
  will-change: transform;
}
.playback-line.is-focused {
  background: linear-gradient(90deg, #b8f8d4 0%, #8cefb9 100%);
  box-shadow: 0 0 0 1px rgba(0, 221, 149, .12);
}
.playback-line.is-playing::after {
  background: linear-gradient(90deg, #2affaa 0%, #00f58f 100%);
  box-shadow: 0 0 8px rgba(0, 245, 143, .42);
}
.timeline-card .timeline-text {
  border-bottom-color: #b9ebce;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.timeline-card.playing .timeline-text {
  border-bottom-color: #00f58f;
  box-shadow: 0 2px 0 rgba(0, 245, 143, .12);
}

.global-progress {
  --player-progress: 0%;
  appearance: none;
  -webkit-appearance: none;
  height: 8px;
  border-radius: 999px;
  outline: none;
  background: linear-gradient(90deg,
    var(--mint-500) 0%,
    var(--mint-500) var(--player-progress),
    #fbfcfc var(--player-progress),
    #d9dede 100%);
  box-shadow: inset 0 0 0 1px rgba(84, 101, 95, .16);
}
.global-progress::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: transparent;
}
.global-progress::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fbfcfc 0%, #d9dede 100%);
}
.global-progress::-moz-range-progress {
  height: 8px;
  border-radius: 999px;
  background: var(--mint-500);
}
.global-progress::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -4px;
  border: 0;
  border-radius: 50%;
  background: var(--mint-500);
  box-shadow: 0 2px 7px rgba(0, 90, 55, .22);
}
.global-progress::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 50%;
  background: var(--mint-500);
  box-shadow: 0 2px 7px rgba(0, 90, 55, .22);
}

.timeline-card-comments.preview-comments {
  max-height: 56px;
  overflow: hidden;
}
.timeline-card-comments.all-comments {
  max-height: 132px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.timeline-card-comments.all-comments button {
  white-space: normal;
  text-overflow: clip;
}
.timeline-comments-toggle {
  width: 100%;
  border: 1px solid rgba(0, 177, 112, .15);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #effbf5 100%);
  color: var(--mint-800);
  font-size: 8px;
  font-weight: 800;
  padding: 5px 7px;
  margin-top: 4px;
  cursor: pointer;
}
.timeline-card.expanded:has(.timeline-card-comments.all-comments) {
  min-height: 250px;
}

.discovery-value-rail {
  transition: opacity 150ms ease, transform 150ms ease;
}
.discovery-topic-card {
  min-width: min(280px, 82vw);
}

/* --------------------------------------------------------------------------
   v1.6.6 semantic search, simplified playback, replies, and paragraph spans
   -------------------------------------------------------------------------- */
.semantic-explanation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin: 10px auto 8px;
  width: min(100%, 920px);
  padding: 13px 15px;
  border: 1px solid rgba(0, 177, 112, .13);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f5fff9 100%);
  box-shadow: 0 5px 18px rgba(0, 85, 52, .06);
}
.semantic-explanation h1 {
  margin: 3px 0 0;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 650;
  color: var(--ink);
}
.semantic-kicker {
  color: var(--mint-800);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.semantic-example-row {
  display: flex;
  gap: 5px;
  max-width: 360px;
  overflow-x: auto;
  scrollbar-width: none;
}
.semantic-example-row::-webkit-scrollbar { display: none; }
.semantic-example-row button,
.prediction-chip {
  flex: 0 0 auto;
  border: 1px solid rgba(0, 177, 112, .12);
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff 0%, #edfbf4 100%);
  color: var(--mint-900);
  padding: 6px 10px;
  cursor: pointer;
  font-size: 10px;
}
.search-predictive-panel {
  width: min(100%, 920px);
  margin: 0 auto 9px;
  padding: 10px 12px;
  border: 1px solid rgba(0, 177, 112, .1);
  border-radius: 14px;
  background: rgba(255,255,255,.97);
  box-shadow: 0 6px 18px rgba(0, 70, 43, .05);
}
.search-predictive-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 6px;
}
.search-predictive-head strong { font-size: 11px; }
.search-predictive-head span { color: var(--muted); font-size: 8px; }
.prediction-chip { display: inline-flex; align-items: center; gap: 5px; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prediction-chip small { color: var(--muted); text-transform: uppercase; font-size: 7px; letter-spacing: .05em; }

.player-controls.simplified { gap: 12px; }
.player-controls.simplified .player-button { width: 38px; height: 38px; }
.player-controls.simplified .player-button.primary { width: 46px; height: 46px; }

/* The progress indicator is display-only until seeking can be truthful for all sources. */
.global-progress {
  position: relative;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background:
    linear-gradient(90deg,
      var(--mint-500) 0%,
      var(--mint-500) var(--player-progress),
      transparent var(--player-progress),
      transparent 100%),
    linear-gradient(180deg, #ffffff 0%, #f8f9f9 45%, #d7dcda 100%);
  box-shadow: inset 0 0 0 1px rgba(84, 101, 95, .16), inset 0 -2px 3px rgba(65, 80, 74, .08);
}
.global-progress span { display: none; }

.paragraph-block-summary {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 550;
  line-height: 1.25;
}
.paragraph-speaker-block .paragraph-prose { margin-top: 5px; }

.timeline-comment-preview {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 6px;
  border-left: 2px solid var(--mint-300);
  background: linear-gradient(90deg, #ffffff, #f6fffa);
  padding: 5px 7px;
  text-align: left;
  font-size: 8px;
  line-height: 1.25;
}
.timeline-comment-preview.nested-reply { margin-left: 14px; border-left-color: var(--mint-500); }
.timeline-comment-preview p { margin: 2px 0; white-space: normal; }
.timeline-comment-play {
  width: 20px;
  height: 20px;
  border: 1px solid rgba(0, 177, 112, .16);
  border-radius: 6px;
  background: #f0fff8;
  color: var(--mint-700);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.timeline-comment-play .icon { width: 10px; height: 10px; }
.timeline-inline-reply-link {
  border: 0;
  background: transparent;
  color: var(--mint-800);
  font-size: 8px;
  font-weight: 800;
  padding: 1px 0;
  cursor: pointer;
}
.timeline-inline-reply-box {
  margin-top: 6px;
  padding: 7px;
  border: 1px solid var(--mint-300);
  border-radius: 9px;
  background: linear-gradient(180deg, #ffffff, #f1fff8);
}
.timeline-inline-reply-box label { display: grid; gap: 4px; font-size: 8px; font-weight: 800; color: var(--mint-900); }
.timeline-inline-reply-box textarea {
  width: 100%;
  resize: vertical;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px;
  font: 10px/1.35 Inter, system-ui, sans-serif;
}
.timeline-inline-reply-box > div { display: flex; justify-content: flex-end; gap: 5px; margin-top: 5px; }
.timeline-inline-reply-box > div > button:not(.primary-button) { border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.timeline-no-comments { color: var(--muted); font-size: 8px; padding: 5px 0; }
.timeline-card.expanded:has(.timeline-inline-reply-box) { min-height: 245px; }

@media (max-width: 640px) {
  .semantic-explanation { grid-template-columns: 1fr; gap: 8px; }
  .semantic-example-row { max-width: 100%; }
  .search-predictive-head { align-items: flex-start; flex-direction: column; gap: 2px; }
}

/* --------------------------------------------------------------------------
   v1.6.7 interaction feedback, swipe recovery, and Timeline polish
   -------------------------------------------------------------------------- */
/* Keep the semantic modes as one native, inertial horizontal strip. */
.semantic-row {
  display: flex !important;
  flex-wrap: nowrap !important;
  width: calc(100% + 28px);
  max-width: none !important;
  box-sizing: border-box;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  touch-action: pan-x !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
}
.semantic-row > .semantic-chip {
  flex: 0 0 auto !important;
  min-width: max-content;
}

/* Interacted controls remain white; the icon itself becomes vivid and solid. */
.interaction-button.active,
.timeline-reaction-button.active {
  background: #ffffff !important;
  color: var(--mint-600);
  box-shadow: none !important;
}
.interaction-button.active .icon,
.timeline-reaction-button.active .icon {
  color: var(--mint-500);
  filter: drop-shadow(0 0 2px rgba(0, 221, 149, .18));
}
.reaction-like.active .icon path,
.reaction-dislike.active .icon path,
.reaction-comment.active .icon path,
.reaction-tag.active .icon path {
  fill: currentColor;
  stroke: currentColor;
}
.reaction-share.active .icon circle {
  fill: currentColor;
  stroke: currentColor;
}
.reaction-share.active .icon path,
.reaction-eye.active .icon path,
.reaction-eye.active .icon circle {
  stroke: currentColor;
  stroke-width: 2.6;
}
.timeline-mini-reactions {
  display: flex;
  align-items: center;
}
.timeline-reaction-button,
.timeline-reaction-static {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 2px 3px;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font: inherit;
}
.timeline-reaction-button { cursor: pointer; border-radius: 6px; }
.timeline-reaction-button:hover { background: rgba(226, 255, 244, .65); }
.timeline-reaction-button .icon,
.timeline-reaction-static .icon { width: 14px; height: 14px; }

/* Reply composer belongs inside a compact Timeline card, not a modal-sized CTA. */
.timeline-inline-reply-box {
  padding: 7px 8px;
}
.timeline-inline-reply-box > div {
  align-items: center;
  gap: 7px;
}
.timeline-inline-reply-box > div > button,
.timeline-inline-reply-box > div > .primary-button {
  width: auto;
  min-width: 0;
  min-height: 27px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 9px;
  line-height: 1.1;
  font-weight: 750;
}
.timeline-inline-reply-box > div > .primary-button {
  background: var(--mint-500);
  color: white;
}

/* The media-panel comment action is a quiet utility button. */
.timeline-context-panel .add-comment-button {
  width: auto;
  min-height: 30px;
  margin: 8px 10px 10px auto;
  padding: 6px 11px;
  border: 1px solid rgba(0, 177, 112, .16);
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff 0%, #edfbf4 100%);
  color: var(--mint-800);
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
  font-weight: 750;
}
.timeline-context-panel .add-comment-button .icon { width: 13px; height: 13px; }

/* The playhead moves underneath the sticky speaker rail and disappears behind it. */
.playhead { z-index: 2; }
.track-person {
  z-index: 20;
  background: linear-gradient(180deg, #ffffff 0%, #f7fffb 100%);
}
.timeline-card { z-index: 4; }
.timeline-card.expanded { z-index: 12; }

/* Timeline speech is always one horizontal line. Cards grow until that line ends. */
.timeline-card,
.timeline-card.expanded {
  max-width: none !important;
  white-space: nowrap !important;
}
.timeline-content-row {
  grid-template-columns: 24px max-content;
  width: max-content;
  max-width: none;
}
.timeline-card .timeline-text,
.timeline-card.expanded .timeline-text {
  display: block;
  width: max-content !important;
  max-width: none !important;
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
  max-height: none !important;
}
.timeline-card.expanded .timeline-card-comments,
.timeline-card.expanded .timeline-expanded-attributes,
.timeline-card.expanded .timeline-inline-reply-box {
  white-space: normal;
}

@media (max-width: 640px) {
  .semantic-row {
    width: calc(100% + 16px);
  }
}
.paragraph-inline-actions button.active {
  background: transparent !important;
  box-shadow: none !important;
}


/* v1.6.8 immediate playback-state acknowledgement */
.player-button.primary {
  position: relative;
  transform: translateZ(0);
  -webkit-tap-highlight-color: transparent;
}
.player-button.primary.is-starting::after {
  content: '';
  position: absolute;
  inset: -3px;
  border: 2px solid rgba(0, 221, 149, .32);
  border-radius: inherit;
  animation: player-starting-ring .75s ease-out infinite;
  pointer-events: none;
}
@keyframes player-starting-ring {
  from { transform: scale(.92); opacity: .75; }
  to { transform: scale(1.14); opacity: 0; }
}

/* --------------------------------------------------------------------------
   v1.6.9 embedded evidence, unified disclosure edge, touch swipe, and
   persistent timeline scrollbar
   -------------------------------------------------------------------------- */
.attribute-toggle,
.paragraph-attribute-toggle,
.timeline-attribute-toggle {
  top: -1px;
  left: -1px;
  border: 0;
  box-shadow: none;
  background: linear-gradient(135deg, #ffffff 0%, #f8fffb 48%, #e6faef 100%);
}
.attribute-toggle:hover,
.paragraph-attribute-toggle:hover,
.timeline-attribute-toggle:hover {
  box-shadow: none;
}
.attribute-toggle:focus-visible,
.paragraph-attribute-toggle:focus-visible,
.timeline-attribute-toggle:focus-visible {
  outline-offset: -2px;
}

.semantic-row,
.rail,
.chip-row {
  touch-action: pan-y;
}
.semantic-row.is-dragging,
.rail.is-dragging,
.chip-row.is-dragging {
  user-select: none;
  -webkit-user-select: none;
}

.media-embed-frame,
.media-preview-shell,
.media-audio-shell {
  position: relative;
  width: 100%;
  background: #061d18;
  overflow: hidden;
}
.media-embed-frame {
  aspect-ratio: 16 / 9;
}
.media-embed {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #061d18;
}
.media-native-player {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  object-fit: contain;
  background: #061d18;
}
.media-audio-shell {
  min-height: 190px;
  display: grid;
  align-items: end;
}
.media-audio-art {
  grid-area: 1 / 1;
  min-height: 190px;
}
.media-native-audio {
  grid-area: 1 / 1;
  z-index: 2;
  width: calc(100% - 24px);
  margin: 0 12px 12px;
}
.media-open-source {
  position: absolute;
  right: 12px;
  bottom: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  color: var(--mint-900);
  padding: 7px 11px;
  font-size: 10px;
  font-weight: 750;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}
.media-card.compact .media-embed-frame,
.media-card.compact .media-audio-shell,
.media-card.compact .media-native-player {
  display: none;
}

.timeline-page {
  grid-template-rows: auto minmax(120px, var(--timeline-media-height, 228px)) 11px minmax(120px, 1fr) 20px auto;
}
.timeline-scrollbar-shell {
  position: relative;
  z-index: 45;
  display: flex;
  align-items: center;
  min-height: 20px;
  padding: 4px 9px;
  background: linear-gradient(180deg, #ffffff 0%, #f7faf8 58%, #edf2ef 100%);
  border-top: 1px solid rgba(0, 116, 70, .12);
  border-bottom: 1px solid rgba(0, 116, 70, .12);
}
.timeline-scrollbar-track {
  position: relative;
  width: 100%;
  height: 10px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #fdfefe 0%, #e5eae7 100%);
  box-shadow: inset 0 1px 2px rgba(15, 52, 39, .14);
  cursor: pointer;
  overflow: hidden;
}
.timeline-scrollbar-track:focus-visible {
  outline: 2px solid rgba(0, 221, 149, .55);
  outline-offset: 2px;
}
.timeline-scrollbar-track.is-disabled {
  opacity: .58;
  cursor: default;
}
.timeline-scrollbar-thumb {
  position: absolute;
  left: 0;
  top: 1px;
  height: 8px;
  min-width: 52px;
  border-radius: 999px;
  background: linear-gradient(180deg, #32edb0 0%, #00ca88 100%);
  box-shadow: 0 1px 3px rgba(0, 109, 69, .22);
  will-change: transform, width;
  cursor: grab;
}
.timeline-scrollbar-thumb:active { cursor: grabbing; }
.timeline-viewport {
  background-color: #ffffff;
}
.timeline-viewport::-webkit-scrollbar:horizontal { height: 0; }
.timeline-viewport::-webkit-scrollbar:vertical { width: 10px; }
.timeline-viewport::-webkit-scrollbar-track:vertical { background: #f4f8f6; }
.timeline-viewport::-webkit-scrollbar-thumb:vertical {
  background: #b9e8d2;
  border-radius: 999px;
  border: 2px solid #f4f8f6;
}

@media (max-width: 640px) {
  .timeline-page {
    grid-template-rows: auto minmax(120px, var(--timeline-media-height, 190px)) 11px minmax(110px, 1fr) 20px auto;
  }
  .timeline-scrollbar-shell { padding-left: 6px; padding-right: 6px; }
}

.media-card { position: relative; }
.media-expand-toggle {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(0, 196, 128, .2);
  border-radius: 999px;
  background: rgba(255, 255, 255, .95);
  color: var(--mint-800);
  padding: 6px 9px;
  font-size: 9px;
  font-weight: 750;
  box-shadow: 0 3px 12px rgba(0, 92, 57, .12);
  cursor: pointer;
}
.media-expand-toggle .icon { width: 13px; height: 13px; }
.media-expand-toggle.expanded {
  left: auto;
  right: 12px;
  top: 12px;
  bottom: auto;
}
.media-card.compact .media-expand-toggle {
  left: 15px;
  bottom: 13px;
  padding: 4px 7px;
}
.media-card.compact .media-expand-toggle span { display: none; }
.media-card.media-expanded {
  display: block;
  padding: 0;
}
.media-card.media-expanded .media-copy { padding-right: 112px; }

/* --------------------------------------------------------------------------
   v1.7.0 profile relationship history and playback-policy controls
   -------------------------------------------------------------------------- */
.content-column > .profile-context-card,
.content-column > .profile-activity-panel {
  width: min(100%, 760px);
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}
.profile-context-card {
  overflow: visible;
  max-height: none;
}
.profile-activity-panel {
  margin-top: 8px;
  margin-bottom: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fffb 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.profile-activity-toggle {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border: 0;
  background: linear-gradient(180deg, #ffffff, #effcf6);
  color: var(--mint-900);
  font-weight: 800;
  cursor: pointer;
}
.profile-activity-toggle .icon {
  width: 16px;
  height: 16px;
  color: var(--mint-500);
  transition: transform .2s ease;
}
.profile-activity-panel.open .profile-activity-toggle .icon { transform: rotate(180deg); }
.profile-activity-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
  border-top: 1px solid var(--line);
}
.profile-activity-grid section {
  min-width: 0;
  padding: 8px;
  border-radius: 12px;
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(0,177,112,.09);
}
.profile-activity-grid h3 {
  margin: 0 0 7px;
  font-size: 11px;
  color: var(--mint-900);
}
.profile-activity-row {
  width: 100%;
  display: grid;
  gap: 2px;
  text-align: left;
  padding: 7px 5px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.profile-activity-row:last-child { border-bottom: 0; }
.profile-activity-row strong { color: var(--mint-800); font-size: 9px; }
.profile-activity-row span {
  font-size: 9px;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.profile-empty-note { margin: 4px 0; font-size: 9px; color: var(--muted); }
.profile-tag-list { display: flex; flex-wrap: wrap; gap: 5px; }
.profile-general-tag {
  padding: 4px 7px;
  border-radius: 999px;
  color: var(--mint-800);
  background: linear-gradient(180deg,#ffffff,#e8faf1);
  border: 1px solid rgba(0,177,112,.13);
  font-size: 8px;
}
.profile-tag-entry {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 6px;
  margin-top: 8px;
}
.profile-tag-entry input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px 8px;
  font: inherit;
  font-size: 9px;
}
.profile-tag-entry button {
  border: 0;
  border-radius: 9px;
  padding: 7px 9px;
  background: var(--mint-500);
  color: white;
  font-weight: 800;
  cursor: pointer;
}
.person-pill.tagged {
  box-shadow: inset 0 0 0 2px var(--mint-400);
}
.playback-preferences-panel .check-row { margin: 8px 0 10px; }
.player-mode-toggle {
  min-width: 34px;
  height: 30px;
  border: 1px solid rgba(0,177,112,.18);
  border-radius: 999px;
  background: linear-gradient(180deg,#ffffff,#eaf9f2);
  color: var(--mint-800);
  font-size: 8px;
  font-weight: 900;
  cursor: pointer;
}
.player-mode-toggle:hover,
.player-mode-toggle:focus-visible {
  box-shadow: 0 0 0 2px rgba(0,221,149,.18);
}
.profile-flow-scroll {
  height: 100%;
  overflow-y: auto;
  padding: 8px;
}

@media (max-width: 760px) {
  .profile-activity-grid { grid-template-columns: 1fr; }
  .player-mode-toggle { min-width: 30px; height: 28px; }
}


/* v1.7.1 stable main playback hit target */
.player-button.primary {
  position: relative;
  overflow: visible;
}
.player-button.primary .player-state-icon {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  transition: opacity 90ms linear, transform 90ms linear;
}
.player-button.primary .player-icon-play { opacity: 1; transform: scale(1); }
.player-button.primary .player-icon-stop { opacity: 0; transform: scale(.84); }
.player-button.primary.is-active .player-icon-play { opacity: 0; transform: scale(.84); }
.player-button.primary.is-active .player-icon-stop { opacity: 1; transform: scale(1); }
.player-button.primary .player-state-icon .icon { pointer-events: none; }

/* --------------------------------------------------------------------------
   v1.7.2 isolated semantic rails and contained search results
   -------------------------------------------------------------------------- */
html,
body,
.app-root,
.app-shell,
.app-main,
.scroll-view,
.search-view,
.search-results,
.result-section {
  min-width: 0;
  max-width: 100%;
}
html,
body,
.app-root,
.app-shell,
.app-main {
  overflow-x: hidden;
}
.scroll-view {
  overflow-x: hidden !important;
}
.app-header {
  overflow: hidden;
}
.semantic-row {
  width: 100% !important;
  max-width: 100% !important;
  margin: 7px 0 -8px !important;
  padding: 8px 0 9px !important;
  contain: inline-size layout paint;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  touch-action: pan-x !important;
  overscroll-behavior-inline: contain;
}
.semantic-row > .semantic-chip {
  flex: 0 0 auto !important;
}
.search-results,
.result-section {
  width: 100%;
  overflow: hidden;
}
.result-section > .rail,
.result-section > .chip-row,
.search-predictive-panel .chip-row,
.semantic-example-row {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap;
  touch-action: pan-x;
  overscroll-behavior-inline: contain;
}
.result-section > .rail > *,
.result-section > .chip-row > *,
.search-predictive-panel .chip-row > *,
.semantic-example-row > * {
  flex: 0 0 auto;
}
.search-mode-dashboard {
  display: grid;
  gap: 10px;
  width: 100%;
  min-width: 0;
  margin-bottom: 12px;
}
.search-mode-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}
.search-mode-summary-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f3fff9 100%);
  padding: 10px 12px;
  box-shadow: var(--shadow-sm);
}
.search-mode-summary-card strong,
.search-mode-summary-card span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-mode-summary-card strong { color: var(--mint-900); font-size: 12px; }
.search-mode-summary-card span { color: var(--muted); font-size: 10px; margin-top: 2px; }
.search-demo-label {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  border-radius: 999px;
  background: linear-gradient(180deg, #fffdf4, #fff4c9);
  color: #785300;
  padding: 3px 7px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
}
