:root {
  color-scheme: dark;
  --bg: #07080e;
  --shell: #0c0d15;
  --panel: #11121c;
  --panel-strong: #151622;
  --line: rgba(219, 224, 255, 0.13);
  --line-strong: rgba(133, 119, 255, 0.35);
  --text: #f3f4ff;
  --muted: #8f93aa;
  --soft: #c9ccef;
  --accent: #33ead1;
  --accent-2: #7a5cff;
  --blue: #5cc9f5;
  --danger: #ff7373;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at 22% 4%, rgba(122, 92, 255, 0.18), transparent 32%),
    linear-gradient(135deg, #17162c 0%, #07080e 42%, #061313 100%);
  color: var(--text);
  padding: 14px 22px;
}

button,
input { font: inherit; }

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(51, 234, 209, 0.24);
  outline-offset: 2px;
}

h1,
h2,
p { margin: 0; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  min-height: calc(100vh - 28px);
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  grid-template-rows: 58px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(219, 224, 255, 0.18);
  border-radius: 18px;
  background: var(--shell);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.window-bar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  min-height: 58px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #11121a, #0b0c13);
}

.traffic-lights,
.window-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.traffic-lights span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.traffic-lights span:nth-child(1) { background: #ff6464; }
.traffic-lights span:nth-child(2) { background: #ffc345; }
.traffic-lights span:nth-child(3) { background: #31d15c; }

.window-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 760;
}

.brand-orbit {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid var(--accent-2);
  border-left-color: transparent;
}

.window-actions span {
  width: 13px;
  height: 2px;
  border-radius: 8px;
  background: #858aa3;
}

.window-actions span:nth-child(2) {
  width: 12px;
  height: 12px;
  border: 1px solid #858aa3;
  background: transparent;
  border-radius: 1px;
}

.rail {
  min-width: 0;
  background: #0a0b13;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 10px;
}

.rail-links {
  display: grid;
  gap: 16px;
  width: 100%;
}

.rail-link {
  width: 64px;
  min-height: 70px;
  display: grid;
  place-items: center;
  gap: 5px;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
}

.rail-link span {
  font-size: 1.2rem;
  line-height: 1;
}

.rail-link small {
  font-size: 0.72rem;
}

.rail-link.active,
.rail-link:hover {
  color: var(--text);
  background: #181b31;
  border-color: rgba(122, 92, 255, 0.38);
}

.rail-link.active {
  box-shadow: -8px 0 0 -5px var(--accent-2), 0 14px 34px rgba(0, 0, 0, 0.25);
}

.rail-status {
  margin-top: auto;
  width: 64px;
  display: grid;
  gap: 8px;
  justify-items: center;
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
}

.rail-status span {
  display: grid;
  place-items: center;
  width: 64px;
  min-height: 64px;
  border-radius: 14px;
  border: 1px solid rgba(255, 100, 100, 0.28);
  background: rgba(255, 100, 100, 0.10);
  color: #ff7777;
  font-size: 0.78rem;
  font-weight: 800;
}

.rail-status small {
  color: var(--muted);
  font-size: 0.72rem;
}

.recall-surface {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #090a12;
}

.search-header {
  display: grid;
  grid-template-columns: minmax(320px, 550px) auto;
  justify-content: center;
  align-items: center;
  gap: 24px;
  padding: 16px 22px 18px;
  border-bottom: 1px solid var(--line);
}

.search-box {
  height: 52px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 0 12px 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(219, 224, 255, 0.18);
  background: #181923;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.search-box:focus-within {
  border-color: rgba(51, 234, 209, 0.5);
  box-shadow: 0 0 0 3px rgba(51, 234, 209, 0.1);
}

.search-box > span {
  color: var(--soft);
  font-size: 1.35rem;
}

.search-box input {
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 650;
}

.search-box input::placeholder {
  color: #d8d9e7;
  opacity: 1;
}

.search-box strong {
  border-radius: 999px;
  background: rgba(51, 234, 209, 0.12);
  color: var(--accent);
  padding: 6px 12px;
  font-size: 0.84rem;
  white-space: nowrap;
}

.search-box button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: transparent;
  color: var(--soft);
  font-weight: 900;
}

.privacy-chip {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 17px;
  border-radius: 999px;
  border: 1px solid rgba(51, 234, 209, 0.36);
  background: rgba(51, 234, 209, 0.09);
  box-shadow: 0 0 26px rgba(51, 234, 209, 0.08);
}

.privacy-chip span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.privacy-chip strong,
.privacy-chip small {
  color: var(--accent);
  font-weight: 800;
}

.privacy-chip small::before {
  content: "- ";
}

.recall-workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 354px;
  grid-template-rows: auto minmax(340px, 1fr) 140px;
}

.result-strip {
  grid-column: 1 / -1;
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 40px 0 24px;
  border-bottom: 1px solid var(--line);
}

.current-memory-title,
.pane-head,
.controls-head,
.exclude-row,
.control-actions,
.timeline-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.current-memory-title strong {
  font-size: 1.04rem;
}

.current-memory-title > span:not(.app-badge) {
  color: var(--muted);
}

.app-badge {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  color: #071313;
  background: var(--accent);
  font-weight: 900;
}

.source-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.filter-pill,
.secondary-action,
.carousel-btn {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--soft);
  padding: 8px 12px;
  font-weight: 750;
}

.filter-pill.active {
  color: #071313;
  background: var(--accent);
  border-color: transparent;
}

.memory-browser {
  min-width: 0;
  padding: 24px;
  overflow: hidden;
  display: grid;
}

.large-preview {
  min-height: 0;
  display: grid;
  align-items: start;
}

.preview-window {
  border-radius: 8px;
  border: 1px solid rgba(219, 224, 255, 0.12);
  overflow: hidden;
  position: relative;
  background: #f6f5fb;
  color: #080b24;
}

.large-preview .preview-window {
  height: min(62vh, 620px);
  min-height: 420px;
}

.browser-bar {
  height: 60px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  background: #e8e6f0;
  border-bottom: 1px solid #d4d1df;
}

.browser-bar i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #c4c0d2;
}

.browser-bar span {
  margin-left: 10px;
  width: min(400px, 55%);
  padding: 9px 18px;
  border-radius: 999px;
  background: #ffffff;
  color: #53618f;
}

.sofa-page {
  min-height: calc(100% - 60px);
  display: grid;
  grid-template-columns: 1.18fr 1fr;
  gap: 28px;
  padding: 30px 34px;
  background: #f7f6fb;
}

.sofa-art {
  min-height: 320px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(140deg, #e9e6f5, #f7f6fb);
  position: relative;
}

.sofa-art em {
  position: absolute;
  left: 26px;
  top: 48px;
  z-index: 2;
  padding: 8px 13px;
  border-radius: 999px;
  background: var(--accent);
  color: #061414;
  font-style: normal;
  font-weight: 900;
  font-size: 0.86rem;
}

.sofa-art::after {
  content: "";
  position: absolute;
  inset: 58px 16px;
  border-radius: 17px;
  border: 3px solid var(--accent);
  box-shadow: 0 0 28px rgba(51, 234, 209, 0.52);
}

.sofa-shape {
  width: min(460px, 82%);
  height: 170px;
  position: relative;
  transform: translateY(-12%);
}

.sofa-shape b {
  position: absolute;
  display: block;
  background: #3f5591;
  border: 3px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 16px 24px rgba(255, 255, 255, 0.08);
}

.sofa-shape b:nth-child(1) {
  left: 15%;
  right: 15%;
  top: 18px;
  height: 92px;
  border-radius: 18px 18px 0 0;
}

.sofa-shape b:nth-child(2) {
  left: 8%;
  right: 8%;
  bottom: 20px;
  height: 62px;
  border-radius: 16px;
}

.sofa-shape b:nth-child(3),
.sofa-shape b:nth-child(4) {
  bottom: 18px;
  width: 58px;
  height: 88px;
  border-radius: 10px;
}

.sofa-shape b:nth-child(3) { left: 0; }
.sofa-shape b:nth-child(4) { right: 0; }

.sofa-copy {
  align-self: center;
  display: grid;
  gap: 16px;
  align-content: center;
}

.sofa-copy small {
  color: #8081a4;
  font-weight: 900;
  letter-spacing: 0.22em;
}

.sofa-copy strong {
  font-size: clamp(1.35rem, 2.4vw, 2.2rem);
  line-height: 1.08;
}

.sofa-copy span {
  color: #30477d;
  font-size: 1.8rem;
  font-weight: 900;
}

.sofa-copy i {
  height: 12px;
  border-radius: 999px;
  background: #dedbed;
}

.sofa-copy i:nth-of-type(2) {
  width: 62%;
}

.sofa-copy button {
  justify-self: start;
  border-radius: 10px;
  padding: 14px 24px;
  background: #2f4379;
  color: #fff;
  font-weight: 900;
}

.browser-preview {
  background: linear-gradient(#f9fafc 0 28px, #e5e7f2 28px 29px, transparent 29px),
    linear-gradient(135deg, #ecf5ff, #9bdcd1 48%, #516aa9);
}

.browser-preview span {
  position: absolute;
  top: 9px;
  left: 12px;
  width: 120px;
  height: 9px;
  border-radius: 999px;
  background: #d4d7e7;
}

.browser-preview strong {
  position: absolute;
  left: 18px;
  bottom: 34px;
  max-width: 210px;
  font-size: 0.95rem;
}

.browser-preview i {
  position: absolute;
  right: 18px;
  width: 74px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
}

.browser-preview i:first-of-type { bottom: 48px; }
.browser-preview i:last-of-type { bottom: 30px; }

.terminal-preview {
  background: #0f172a;
  color: #b8f4de;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 18px;
}

.terminal-preview code {
  color: #e2e8f0;
  white-space: normal;
}

.document-preview,
.message-preview {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 18px;
}

.document-preview b,
.message-preview b {
  font-size: 0.96rem;
}

.document-preview span,
.document-preview i,
.message-preview span,
.message-preview i {
  min-height: 10px;
  border-radius: 999px;
  background: #d8dbea;
}

.document-preview i:nth-of-type(1),
.message-preview i:nth-of-type(1) { width: 92%; }
.document-preview i:nth-of-type(2),
.message-preview i:nth-of-type(2) { width: 76%; }
.document-preview i:nth-of-type(3) { width: 58%; }

.message-preview {
  background: linear-gradient(135deg, #fff7ec, #eef4ff);
}

.design-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 10px;
  padding: 18px;
  background: linear-gradient(135deg, #f2edff, #ebfbff);
}

.design-preview span {
  border-radius: 8px;
  background: rgba(73, 90, 174, 0.2);
}

.design-preview span:nth-child(1) { height: 72px; }
.design-preview span:nth-child(2) { height: 98px; }
.design-preview span:nth-child(3) { height: 54px; }

.design-preview strong {
  position: absolute;
  left: 18px;
  top: 18px;
}

.privacy-preview {
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  background: #eafff9;
  color: #087060;
}

.image-preview {
  background: #0f172a;
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.memory-pane {
  grid-column: 2;
  grid-row: 2;
  border-left: 1px solid var(--line);
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 24px 24px 0;
  overflow: auto;
}

.selected-moment,
.local-controls,
.empty-state {
  background: rgba(18, 19, 31, 0.88);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 17px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.18);
}

.pane-head {
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
  margin-bottom: 16px;
}

.pane-head h2,
.controls-head h2 {
  font-size: 1rem;
}

.meta-line,
.detail-text,
.source-status,
.exclusion-list,
.timeline-scrubber {
  color: var(--muted);
  font-size: 0.9rem;
}

.eyebrow {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 760;
  margin: 0 0 12px;
}

.detail-text {
  color: #d8dcff;
  line-height: 1.45;
  padding: 14px 15px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #12131d;
}

.recognition-label {
  margin-top: 18px;
}

.recognition-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.recognition-chips span {
  border-radius: 999px;
  border: 1px solid var(--line);
  color: #dce1ff;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.025);
}

.time-bubble {
  min-width: 58px;
  display: inline-block;
  border-radius: 999px;
  color: #aeb7ff;
  font-size: 0.85rem;
  text-align: right;
  white-space: nowrap;
}

.primary-action {
  width: 100%;
  margin-top: 18px;
  border-radius: 9px;
  padding: 13px 16px;
  color: #070914;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  font-weight: 900;
}

.source-open-action:disabled {
  color: var(--muted);
  background: #181923;
  border: 1px solid var(--line);
}

.status-toast {
  position: fixed;
  right: 28px;
  bottom: 28px;
  max-width: min(360px, calc(100vw - 40px));
  padding: 12px 15px;
  border-radius: 12px;
  border: 1px solid rgba(51, 234, 209, 0.32);
  background: rgba(13, 17, 28, 0.94);
  color: var(--soft);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 20;
}

.status-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.local-controls {
  background: rgba(18, 19, 31, 0.58);
  box-shadow: none;
}

.controls-head {
  align-items: flex-start;
  justify-content: space-between;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.status-grid div,
.source-status div {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.025);
}

.status-grid span,
.source-status span,
.exclusions label {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  margin-bottom: 4px;
}

.source-toggle-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.source-toggle-list label {
  display: flex;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px;
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.88rem;
}

.source-status {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.exclusions {
  display: grid;
  gap: 8px;
}

.exclude-row input {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 11px;
  background: #0d0e16;
  color: var(--text);
}

.exclusion-list {
  min-height: 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.exclusion-pill {
  border-radius: 999px;
  padding: 6px 9px;
  background: rgba(51, 234, 209, 0.12);
  color: var(--accent);
}

.control-actions {
  margin-top: 14px;
  flex-wrap: wrap;
}

.danger-action {
  border-radius: 999px;
  background: rgba(255, 115, 115, 0.08);
  color: var(--danger);
  border: 1px solid rgba(255, 115, 115, 0.22);
  padding: 9px 13px;
  font-weight: 800;
}

.timeline-dock {
  grid-column: 1 / -1;
  grid-row: 3;
  border-top: 1px solid var(--line);
  padding: 14px 22px 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: 18px minmax(0, 1fr);
  gap: 11px 14px;
}

.timeline-scrubber {
  grid-column: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  font-weight: 650;
}

.scrubber-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(219, 224, 255, 0.16);
  position: relative;
}

.scrubber-track b {
  display: none;
}

.scrubber-thumb {
  position: absolute;
  z-index: 2;
  left: var(--progress, 0%);
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 0 0 5px rgba(51, 234, 209, 0.28);
  transform: translate(-50%, -50%);
  transition: left 180ms ease;
}

.timeline-actions {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
}

.timeline-cards {
  grid-column: 1 / -1;
  --card-width: clamp(132px, 10.7vw, 178px);
  --step: calc(var(--card-width) + 12px);
  --center: calc(50% - (var(--card-width) / 2));
  min-height: 76px;
  position: relative;
  overflow: hidden;
  overscroll-behavior-x: contain;
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 96%, transparent);
}

.timeline-cards .result-card {
  position: absolute;
  top: 0;
  left: var(--center);
  width: var(--card-width);
  height: 54px;
  min-height: 54px;
  padding: 0;
  display: grid;
  grid-template-rows: 1fr auto;
  transform: translateX(calc(var(--stack-offset) * var(--step))) translateY(0) scale(1);
  opacity: var(--opacity);
  transition: transform 190ms ease, opacity 190ms ease, box-shadow 160ms ease, border-color 160ms ease;
  z-index: var(--z);
}

.timeline-cards .result-card:hover,
.timeline-cards .result-card:focus-visible,
.timeline-cards .result-card.active {
  transform: translateX(calc(var(--stack-offset) * var(--step))) translateY(0) scale(1);
}

.result-card {
  background: linear-gradient(90deg, rgba(122, 92, 255, 0.8), rgba(20, 23, 39, 0.85));
  border: 1px solid rgba(219, 224, 255, 0.14);
  border-radius: 8px;
  color: var(--text);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.result-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(51, 234, 209, 0.18), 0 18px 38px rgba(0, 0, 0, 0.28);
}

.card-top {
  display: none;
}

.timeline-cards .preview-window {
  display: none;
}

.card-bottom {
  min-height: 54px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: end;
  gap: 7px;
  padding: 10px;
}

.card-bottom .app-badge {
  width: 7px;
  height: 7px;
  flex-basis: 7px;
  border-radius: 50%;
  font-size: 0;
  box-shadow: 0 0 10px currentColor;
}

.card-bottom strong {
  display: block;
  font-size: 0.75rem;
}

.card-bottom p {
  display: none;
}

.timeline-cards .result-card::after {
  content: attr(aria-label);
  position: absolute;
  left: 50%;
  bottom: -22px;
  width: 100%;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

.empty-state {
  grid-column: 1 / -1;
  margin: 18px;
  display: grid;
  gap: 5px;
}

.empty-state[hidden],
.results-overview {
  display: none;
}

body.search-mode .app-shell {
  grid-template-columns: minmax(0, 1fr);
}

body.search-mode .rail {
  display: none;
}

body.search-mode .recall-surface {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

@media (max-width: 1180px) {
  body {
    padding: 0;
  }

  .app-shell {
    min-height: 100vh;
    border-radius: 0;
    border: 0;
  }

  .recall-workspace {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(360px, auto) auto 140px;
  }

  .memory-pane {
    grid-column: 1;
    grid-row: 3;
    border-left: 0;
    border-top: 1px solid var(--line);
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr);
    padding-bottom: 20px;
  }

  .timeline-dock {
    grid-row: 4;
  }
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .window-bar {
    grid-row: 1;
  }

  .rail {
    grid-row: 2;
    min-height: auto;
    padding: 8px 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .rail-links {
    display: flex;
    gap: 8px;
    overflow-x: auto;
  }

  .rail-link {
    width: 70px;
    min-height: 48px;
  }

  .rail-status {
    margin-top: 0;
  }

  .rail-status span {
    width: auto;
    min-height: 40px;
    padding: 0 12px;
  }

  .rail-status small {
    display: none;
  }

  .recall-surface {
    grid-row: 3;
  }

  .search-header {
    grid-template-columns: 1fr;
    justify-content: stretch;
    padding: 14px;
  }

  .privacy-chip {
    justify-self: start;
  }

  .result-strip {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px;
  }

  .memory-browser {
    padding: 14px;
  }

  .large-preview .preview-window {
    height: auto;
    min-height: 340px;
  }

  .sofa-page {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .sofa-art {
    min-height: 210px;
  }

  .memory-pane {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .source-toggle-list,
  .status-grid {
    grid-template-columns: 1fr;
  }

  .timeline-dock {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 90px;
  }

  .timeline-actions {
    grid-column: 1;
    grid-row: 2;
  }

  .timeline-cards {
    grid-row: 3;
    --card-width: min(48vw, 190px);
    --step: calc(var(--card-width) + 10px);
    --center: 0px;
    overflow-x: auto;
    mask-image: none;
    scroll-snap-type: x mandatory;
  }

  .timeline-cards .result-card,
  .timeline-cards .result-card.active {
    transform: translateX(calc(var(--offset) * var(--step))) translateY(0) scale(1);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scrubber-thumb,
  .timeline-cards .result-card {
    transition: none;
  }
}
