:root {
  color-scheme: light;
  --bg: #f4f3f7;
  --bg-2: #ecebf1;
  --paper: #ffffff;
  --paper-2: #f8f7fb;
  --ink: #1a1922;
  --ink-2: #34313f;
  --ink-3: #777281;
  --ink-4: #a09ba8;
  --line: rgba(26, 25, 34, 0.08);
  --line-2: rgba(26, 25, 34, 0.16);
  --accent: #6e4f9a;
  --accent-2: #8265b3;
  --accent-soft: rgba(110, 79, 154, 0.1);
  --rose: #d291b3;
  --rose-deep: #b06998;
  --rose-soft: rgba(210, 145, 179, 0.12);
  --sage: #8a8898;
  --gold: #d4a85f;
  --danger: #9b505d;
  --success: #4f7c62;
  --serif: "Cormorant Garamond", "Noto Serif SC", "Source Han Serif SC", Georgia, "Songti SC", serif;
  --sans: Inter, "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-paper: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 8px 26px -22px rgba(26, 25, 34, 0.45);
  --topbar-height: 62px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #14131c;
  --bg-2: #1d1c27;
  --paper: #1d1c27;
  --paper-2: #25232f;
  --ink: #ece9f2;
  --ink-2: #c8c5d4;
  --ink-3: #8c889c;
  --ink-4: #656174;
  --line: rgba(236, 233, 242, 0.08);
  --line-2: rgba(236, 233, 242, 0.16);
  --accent: #a78bd0;
  --accent-2: #b9a3da;
  --accent-soft: rgba(167, 139, 208, 0.14);
  --rose: #e0a3c4;
  --rose-deep: #c87aa8;
  --rose-soft: rgba(224, 163, 196, 0.12);
  --sage: #aaa6bc;
  --gold: #d7b26e;
  --danger: #d58b96;
  --success: #82b291;
  --shadow-paper: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 14px 34px -24px rgba(0, 0, 0, 0.8);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(110, 79, 154, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(110, 79, 154, 0.012) 1px, transparent 1px);
  background-size: 36px 36px;
  font-family: var(--sans);
  font-size: 17px;
  letter-spacing: 0;
}

button,
input,
textarea,
select {
  color: inherit;
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

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

input,
textarea,
select {
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--paper);
}

input:focus,
textarea:focus,
select:focus,
button:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}

textarea {
  resize: vertical;
}

::selection {
  color: var(--paper);
  background: var(--accent);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 8px;
  background: rgba(72, 67, 83, 0.22);
  background-clip: padding-box;
}

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

.topbar {
  position: sticky;
  z-index: 80;
  top: 0;
  display: grid;
  grid-template-columns: minmax(250px, 1fr) minmax(260px, 560px) minmax(250px, 1fr);
  align-items: center;
  min-height: var(--topbar-height);
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 243, 247, 0.88);
  backdrop-filter: blur(18px);
}

[data-theme="dark"] .topbar {
  background: rgba(20, 19, 28, 0.9);
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  min-width: 0;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  background: linear-gradient(90deg, var(--ink) 50%, transparent 50%);
}

.brand-mark.large {
  width: 30px;
  height: 30px;
  margin-bottom: 18px;
}

.brand-name {
  overflow: hidden;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-count {
  padding-left: 12px;
  border-left: 1px solid var(--line-2);
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 14px;
  white-space: nowrap;
}

.global-search,
.field-search {
  display: flex;
  align-items: center;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  box-shadow: var(--shadow-paper);
}

.global-search {
  justify-self: stretch;
  height: 38px;
  padding: 0 10px;
}

.global-search input,
.field-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.global-search input {
  height: 36px;
  padding: 0 9px;
}

.global-search input:focus,
.field-search input:focus {
  box-shadow: none;
}

.search-glyph {
  color: var(--ink-3);
  font-family: var(--serif);
  font-size: 20px;
}

kbd {
  min-width: 22px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-bottom-color: var(--line-2);
  border-radius: 4px;
  color: var(--ink-4);
  background: var(--paper-2);
  font-family: var(--mono);
  font-size: 14px;
  text-align: center;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 8px;
}

.gateway-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-right: 6px;
  color: var(--ink-3);
  font-size: 15px;
}

.gateway-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 168, 95, 0.12);
}

.gateway-state.online i {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(79, 124, 98, 0.12);
}

.gateway-state.offline i {
  background: var(--danger);
}

.symbol-button,
.text-button,
.command-button,
.view-tab,
.console-tabs button,
.filter-chip,
.segmented button,
.queue-tabs button,
.network-tool,
.timeline-line,
.mini-item {
  appearance: none;
  border: 0;
  background: transparent;
}

.symbol-button {
  display: inline-grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: var(--ink-3);
  font-size: 20px;
}

.symbol-button:hover {
  color: var(--ink);
  background: var(--bg-2);
}

.symbol-button.bordered {
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--paper);
}

.symbol-button.night {
  color: #d8d2e6;
  background: rgba(255, 255, 255, 0.08);
}

.view-nav {
  position: sticky;
  z-index: 70;
  top: var(--topbar-height);
  display: flex;
  justify-content: center;
  gap: 34px;
  min-height: 43px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(16px);
}

[data-theme="dark"] .view-nav {
  background: rgba(29, 28, 39, 0.78);
}

.view-tab {
  position: relative;
  min-height: 43px;
  padding: 0 3px;
  color: var(--ink-3);
  font-size: 16px;
}

.view-tab::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  content: "";
  background: transparent;
}

.view-tab:hover {
  color: var(--ink);
}

.view-tab.active {
  color: var(--accent);
  font-weight: 600;
}

.view-tab.active::after {
  background: var(--accent);
}

.workspace {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 34px 34px 96px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.page-heading,
.network-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  min-height: 92px;
  gap: 24px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
}

.page-heading h1,
.network-heading h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 40px;
  font-weight: 500;
  line-height: 1;
}

.page-subtitle {
  margin: 10px 0 0;
  color: var(--ink-3);
  font-family: var(--serif);
  font-size: 18px;
  font-style: italic;
}

.heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.page-counter {
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 14px;
  white-space: nowrap;
}

.command-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  gap: 7px;
  padding: 7px 13px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  background: var(--paper);
  box-shadow: var(--shadow-paper);
  font-size: 16px;
}

.command-button:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.command-button.primary {
  border-color: var(--ink);
  color: var(--paper);
  background: var(--ink);
}

.command-button.primary:hover {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}

.command-button.night {
  border-color: rgba(236, 233, 244, 0.16);
  color: #ece9f4;
  background: #232036;
}

.text-button {
  min-height: 30px;
  padding: 4px 7px;
  color: var(--ink-3);
  font-size: 15px;
}

.text-button:hover {
  color: var(--accent);
}

.danger-text {
  color: var(--danger);
}

.cells-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 160px 160px 34px;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: var(--shadow-paper);
}

.field-search {
  height: 34px;
  padding: 0 9px;
  box-shadow: none;
}

.field-search input {
  height: 32px;
  padding: 0 7px;
}

.cells-toolbar select,
.display-bar select,
.selection-bar select,
.config-section select,
.memory-form-grid input,
.memory-form-grid select,
.write-dialog input,
.write-dialog select {
  min-height: 34px;
  padding: 5px 9px;
}

.filter-rail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  gap: 18px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
}

.filter-chips {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
}

.filter-chip {
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--ink-3);
  white-space: nowrap;
  font-size: 15px;
}

.filter-chip:hover {
  color: var(--ink);
  background: var(--bg-2);
}

.filter-chip.active {
  color: var(--paper);
  background: var(--ink);
}

.filter-chip.active.pin {
  background: #4e356f;
}

.filter-chip.active.important {
  background: var(--accent);
}

.filter-chip.active.feel {
  background: var(--rose-deep);
}

.tag-filter {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  color: var(--ink-3);
  font-size: 14px;
}

.tag-filter input {
  width: 150px;
  height: 28px;
  padding: 4px 8px;
  background: transparent;
}

.display-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  gap: 16px;
}

.display-selects {
  display: flex;
  gap: 14px;
}

.display-selects label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-3);
  font-size: 14px;
}

.display-selects select {
  min-height: 29px;
  border-color: transparent;
  background: transparent;
  font-size: 15px;
}

.segmented {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
}

.segmented button {
  min-height: 27px;
  padding: 3px 10px;
  border-radius: 4px;
  color: var(--ink-3);
  font-size: 14px;
}

.segmented button.active {
  color: var(--paper);
  background: var(--ink);
}

.segmented.dark {
  border-color: rgba(236, 233, 244, 0.1);
  background: rgba(14, 13, 24, 0.7);
}

.segmented.dark button {
  color: #8f899f;
}

.segmented.dark button.active {
  color: #171421;
  background: #b9a3da;
}

.selection-bar {
  position: sticky;
  z-index: 40;
  top: calc(var(--topbar-height) + 50px);
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin: 0 0 12px;
  padding: 7px 10px 7px 14px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: 0 14px 34px -24px var(--accent);
  font-size: 15px;
}

.selection-bar[hidden] {
  display: none;
}

.selection-bar > span {
  margin-right: auto;
}

.selection-bar label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-3);
}

.selection-bar select {
  min-height: 28px;
}

.memory-collection {
  min-height: 320px;
}

.masonry-layout {
  columns: 3 280px;
  column-gap: 12px;
}

.memory-group {
  margin-bottom: 22px;
  break-inside: avoid;
}

.memory-group + .memory-group {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.masonry-layout .memory-group {
  display: contents;
}

.group-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 0 10px;
  color: var(--ink-2);
}

.masonry-layout .group-heading {
  column-span: all;
  margin-top: 16px;
}

.group-heading h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
}

.group-heading span {
  color: var(--ink-4);
  font-family: var(--mono);
  font-size: 13px;
}

.memory-card {
  position: relative;
  display: inline-block;
  width: 100%;
  margin: 0 0 12px;
  padding: 14px 15px 13px;
  overflow: hidden;
  break-inside: avoid;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--ink);
  background: var(--paper);
  box-shadow: var(--shadow-paper);
  text-align: left;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.memory-card:hover,
.memory-card.keyboard-focus {
  border-color: var(--accent);
  box-shadow: 0 16px 38px -28px var(--accent);
  transform: translateY(-1px);
}

.memory-card.selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--paper) 94%, var(--accent) 6%);
}

.memory-card.pinned::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  content: "";
  background: var(--accent);
}

.memory-card.feel {
  border-color: color-mix(in srgb, var(--rose) 46%, var(--line));
}

.memory-card-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 11px;
}

.memory-select {
  display: grid;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin-top: 2px;
  place-items: center;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  color: transparent;
  background: var(--paper-2);
}

.memory-card.selected .memory-select {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}

.memory-card-title {
  min-width: 0;
  flex: 1;
  margin: 0;
  overflow-wrap: anywhere;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
}

.importance-dots {
  display: flex;
  flex: 0 0 auto;
  gap: 2px;
  padding-top: 4px;
}

.importance-dots i {
  width: 3px;
  height: 10px;
  border-radius: 2px;
  background: var(--bg-2);
}

.importance-dots i.on {
  background: var(--accent);
}

.memory-card-copy {
  display: -webkit-box;
  margin: 0 0 13px;
  overflow: hidden;
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.65;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
}

.memory-card-summary {
  margin: -4px 0 12px;
  padding: 8px 10px;
  border-left: 2px solid var(--rose);
  color: var(--ink-3);
  background: var(--paper-2);
  font-family: var(--serif);
  font-size: 16px;
  font-style: italic;
  line-height: 1.5;
}

.memory-card-meta,
.memory-card-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.memory-card-meta {
  margin-top: 10px;
  color: var(--ink-4);
  font-family: var(--mono);
  font-size: 12px;
}

.memory-tag,
.memory-badge {
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--ink-3);
  background: var(--paper-2);
  font-size: 13px;
  line-height: 1;
}

.memory-badge.pin {
  color: #4e356f;
  background: rgba(110, 79, 154, 0.12);
}

.memory-badge.feel {
  color: var(--rose-deep);
  background: var(--rose-soft);
}

.list-layout {
  border-top: 1px solid var(--line);
}

.list-layout .memory-group {
  margin: 0;
}

.list-layout .group-heading {
  padding: 16px 4px 8px;
}

.list-layout .memory-card {
  display: grid;
  grid-template-columns: 28px minmax(180px, 0.75fr) minmax(260px, 1.5fr) minmax(160px, 0.7fr);
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 9px 7px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.list-layout .memory-card:hover {
  background: var(--paper);
  box-shadow: none;
  transform: none;
}

.list-layout .memory-card::before,
.list-layout .memory-card-summary,
.list-layout .importance-dots {
  display: none;
}

.list-layout .memory-card-header {
  display: contents;
}

.list-layout .memory-select {
  grid-column: 1;
}

.list-layout .memory-card-title {
  grid-column: 2;
  font-size: 17px;
}

.list-layout .memory-card-copy {
  grid-column: 3;
  margin: 0;
  -webkit-line-clamp: 2;
}

.list-layout .memory-card-tags,
.list-layout .memory-card-meta {
  grid-column: 4;
  margin: 0;
}

.list-layout .memory-card-meta {
  display: none;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  border-top: 1px solid var(--line);
  color: var(--ink-4);
  font-family: var(--mono);
  font-size: 13px;
}

.loading-state,
.empty-state,
.error-state {
  width: 100%;
  padding: 44px 18px;
  color: var(--ink-4);
  font-family: var(--serif);
  font-size: 18px;
  font-style: italic;
  text-align: center;
}

.error-state {
  color: var(--danger);
}

body.density-compact .memory-card {
  margin-bottom: 8px;
  padding: 10px 11px;
}

body.density-compact .memory-card-copy {
  margin-bottom: 8px;
  -webkit-line-clamp: 4;
}

body.density-comfortable .memory-card {
  margin-bottom: 16px;
  padding: 18px;
}

.timeline-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: var(--shadow-paper);
}

.timeline-toolbar .field-search {
  width: min(430px, 48%);
}

.today-strip {
  display: grid;
  grid-template-columns: 150px 1fr auto;
  align-items: center;
  min-height: 48px;
  gap: 18px;
  margin: 12px 0 18px;
  padding: 0 16px;
  border-left: 3px solid var(--accent);
  background: var(--paper);
  box-shadow: var(--shadow-paper);
}

.today-strip[hidden] {
  display: none;
}

.today-date {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
}

.today-summary {
  color: var(--ink-3);
  font-size: 15px;
}

.timeline-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 30px;
}

.timeline {
  position: relative;
  min-width: 0;
}

.timeline::before {
  position: absolute;
  top: 3px;
  bottom: 22px;
  left: 92px;
  width: 1px;
  content: "";
  background: linear-gradient(to bottom, var(--accent), var(--line-2) 35%, var(--line));
}

.month-divider,
.timeline-day,
.timeline-gap,
.timeline-end {
  position: relative;
  display: grid;
  grid-template-columns: 70px 44px minmax(0, 1fr);
}

.month-divider {
  align-items: baseline;
  min-height: 72px;
  padding-top: 24px;
}

.month-divider .month-name {
  grid-column: 1;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 20px;
  text-align: right;
}

.month-divider .month-line {
  grid-column: 2 / 4;
  align-self: center;
  height: 1px;
  margin-left: 22px;
  background: var(--line);
}

.month-divider .month-stats {
  grid-column: 3;
  justify-self: end;
  margin-top: -25px;
  color: var(--ink-4);
  font-family: var(--mono);
  font-size: 12px;
}

.timeline-day {
  margin-bottom: 22px;
}

.day-axis-label {
  grid-column: 1;
  padding-top: 10px;
  text-align: right;
}

.day-axis-label b {
  display: block;
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 500;
  line-height: 0.9;
}

.day-axis-label span {
  color: var(--ink-4);
  font-family: var(--mono);
  font-size: 12px;
}

.day-axis-node {
  position: relative;
  z-index: 2;
  grid-column: 2;
  width: 11px;
  height: 11px;
  align-self: start;
  justify-self: center;
  margin-top: 14px;
  border: 2px solid var(--bg);
  border-radius: 50%;
  background: var(--ink-4);
  box-shadow: 0 0 0 1px var(--line-2);
}

.day-axis-node.heat-2 {
  width: 14px;
  height: 14px;
  margin-top: 12px;
  background: var(--accent-2);
}

.day-axis-node.heat-3 {
  width: 17px;
  height: 17px;
  margin-top: 11px;
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft);
}

.day-axis-node.feel {
  background: var(--rose-deep);
  box-shadow: 0 0 0 5px var(--rose-soft);
}

.day-card {
  grid-column: 3;
  min-width: 0;
  padding: 14px 17px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: var(--shadow-paper);
}

.day-card:hover {
  border-color: var(--accent);
  box-shadow: 0 16px 38px -30px var(--accent);
}

.day-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  color: var(--ink-3);
  font-size: 13px;
}

.day-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.timeline-line {
  display: grid;
  grid-template-columns: 54px 10px minmax(120px, 0.65fr) minmax(160px, 1fr);
  align-items: baseline;
  gap: 7px;
  min-height: 31px;
  padding: 5px 0;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  text-align: left;
}

.timeline-line:first-child {
  border-top: 0;
}

.timeline-line:hover {
  color: var(--accent);
}

.timeline-line time {
  color: var(--ink-4);
  font-family: var(--mono);
  font-size: 12px;
}

.timeline-line .line-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-4);
}

.timeline-line.important .line-dot {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.timeline-line.feel .line-dot {
  background: var(--rose-deep);
}

.timeline-line strong {
  overflow: hidden;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-line span:last-child {
  overflow: hidden;
  color: var(--ink-3);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-gap {
  min-height: 36px;
  align-items: center;
}

.timeline-gap span {
  grid-column: 3;
  color: var(--ink-4);
  font-family: var(--serif);
  font-size: 16px;
  font-style: italic;
}

.timeline-end {
  min-height: 52px;
  align-items: center;
}

.timeline-end i {
  z-index: 2;
  grid-column: 2;
  width: 7px;
  height: 7px;
  justify-self: center;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: var(--bg);
}

.timeline-end span {
  grid-column: 3;
  color: var(--ink-4);
  font-family: var(--serif);
  font-size: 15px;
  font-style: italic;
}

.mini-timeline {
  position: sticky;
  top: 132px;
  display: flex;
  height: calc(100vh - 170px);
  min-height: 360px;
  max-height: 650px;
  flex-direction: column;
  align-self: start;
  padding: 11px 8px;
  border-left: 1px solid var(--line);
}

.mini-year {
  margin-bottom: 8px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 12px;
}

.mini-items {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  justify-content: space-between;
  gap: 2px;
}

.mini-item {
  display: flex;
  min-height: 8px;
  flex: 1;
  align-items: center;
  gap: 6px;
  color: var(--ink-4);
  font-family: var(--mono);
  font-size: 11px;
}

.mini-item::before {
  width: 16px;
  height: 2px;
  flex: 0 0 auto;
  content: "";
  background: var(--line-2);
}

.mini-item.has-memory::before {
  height: 3px;
  background: var(--accent-2);
}

.mini-item.feel::before {
  background: var(--rose);
}

.mini-item:hover {
  color: var(--accent);
}

.timeline.focus-today .timeline-day:not(.is-today),
.timeline.focus-today .month-divider,
.timeline.focus-today .timeline-gap {
  opacity: 0.18;
}

.network-view {
  width: calc(100vw - 28px);
  margin-left: calc((100% - 100vw) / 2 + 14px);
}

.network-heading {
  width: min(1400px, calc(100vw - 56px));
  min-height: 78px;
  margin: 0 auto 16px;
}

.network-search {
  display: flex;
  gap: 8px;
}

.network-search input {
  width: min(360px, 40vw);
  min-height: 36px;
  padding: 7px 10px;
}

.network-stage {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 260px;
  min-height: 660px;
  overflow: hidden;
  border: 1px solid rgba(236, 233, 244, 0.08);
  border-radius: var(--radius-md);
  color: #ece9f4;
  background: #0e0d18;
}

.network-filters,
.network-detail {
  min-width: 0;
  background: #14131f;
}

.network-filters {
  border-right: 1px solid rgba(236, 233, 244, 0.08);
}

.network-filters section {
  padding: 16px 15px;
  border-bottom: 1px solid rgba(236, 233, 244, 0.08);
}

.panel-heading,
.column-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 13px;
  text-transform: uppercase;
}

.network-stage .panel-heading {
  color: #8f899f;
}

.panel-heading b,
.column-heading b {
  color: var(--accent);
  font-weight: 600;
}

.network-filter-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.network-filter {
  display: flex;
  min-height: 30px;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 4px;
  color: #8f899f;
  background: transparent;
  text-align: left;
  font-size: 14px;
}

.network-filter i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a78bd0;
}

.network-filter b {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
}

.network-filter.active,
.network-filter:hover {
  color: #ece9f4;
  background: rgba(167, 139, 208, 0.12);
}

.range-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--ink-3);
  font-size: 14px;
}

.network-stage .range-label {
  color: #8f899f;
}

input[type="range"] {
  width: 100%;
  height: 4px;
  border: 0;
  border-radius: 2px;
  accent-color: var(--accent);
}

.network-tag-search {
  display: block;
  color: #8f899f;
  font-size: 13px;
}

.network-tag-search input {
  width: 100%;
  min-height: 30px;
  margin-top: 7px;
  padding: 5px 7px;
  border-color: rgba(236, 233, 244, 0.12);
  color: #ece9f4;
  background: #0e0d18;
}

.network-tag-list {
  display: flex;
  max-height: 220px;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 10px;
  overflow: auto;
}

.network-tag-list button {
  min-height: 21px;
  padding: 2px 6px;
  border: 1px solid rgba(236, 233, 244, 0.08);
  border-radius: 999px;
  color: #8f899f;
  background: transparent;
  font-size: 12px;
}

.network-tag-list button.active {
  border-color: #a78bd0;
  color: #ece9f4;
  background: rgba(167, 139, 208, 0.14);
}

.network-canvas-wrap {
  position: relative;
  min-width: 0;
  min-height: 660px;
  overflow: hidden;
  background-color: #0e0d18;
  background-image:
    linear-gradient(rgba(236, 233, 244, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(236, 233, 244, 0.018) 1px, transparent 1px);
  background-size: 48px 48px;
}

.network-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 660px;
  cursor: grab;
}

.network-canvas-wrap canvas.dragging {
  cursor: grabbing;
}

.network-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #5f596e;
  font-family: var(--serif);
  font-size: 18px;
  font-style: italic;
  pointer-events: none;
}

.network-empty[hidden] {
  display: none;
}

.network-tooltip {
  position: absolute;
  z-index: 8;
  width: min(260px, calc(100% - 24px));
  padding: 10px 11px;
  border: 1px solid rgba(236, 233, 244, 0.16);
  border-radius: var(--radius-sm);
  color: #ece9f4;
  background: rgba(20, 19, 31, 0.94);
  box-shadow: 0 16px 36px -20px #000;
  pointer-events: none;
}

.network-tooltip b {
  display: block;
  margin-bottom: 5px;
  font-family: var(--serif);
  font-size: 17px;
}

.network-tooltip span {
  display: -webkit-box;
  overflow: hidden;
  color: #9892a8;
  font-size: 13px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.network-tools {
  position: absolute;
  right: 14px;
  bottom: 15px;
  left: 14px;
  display: flex;
  align-items: center;
  gap: 7px;
  pointer-events: none;
}

.network-tools > * {
  pointer-events: auto;
}

.network-tool {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border: 1px solid rgba(236, 233, 244, 0.1);
  border-radius: var(--radius-sm);
  color: #8f899f;
  background: rgba(14, 13, 24, 0.82);
  font-size: 13px;
}

.network-tool:hover {
  color: #ece9f4;
}

.network-replay {
  position: absolute;
  right: 14px;
  top: 14px;
  display: grid;
  grid-template-columns: 32px 150px 74px;
  align-items: center;
  gap: 7px;
  padding: 4px;
  border: 1px solid rgba(236, 233, 244, 0.08);
  border-radius: var(--radius-sm);
  color: #8f899f;
  background: rgba(14, 13, 24, 0.78);
  font-family: var(--mono);
  font-size: 12px;
}

.network-detail {
  padding: 18px 16px;
  overflow: auto;
  border-left: 1px solid rgba(236, 233, 244, 0.08);
}

.network-detail-empty {
  display: grid;
  min-height: 420px;
  place-items: center;
  color: #5f596e;
  font-family: var(--serif);
  font-style: italic;
}

.network-detail .detail-type {
  color: #a78bd0;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
}

.network-detail h2 {
  margin: 8px 0 12px;
  overflow-wrap: anywhere;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
}

.network-detail .detail-copy {
  color: #b9b4cc;
  font-size: 14px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.network-detail dl {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 7px;
  margin: 20px 0;
  padding: 13px 0;
  border-top: 1px solid rgba(236, 233, 244, 0.08);
  border-bottom: 1px solid rgba(236, 233, 244, 0.08);
  font-size: 13px;
}

.network-detail dt {
  color: #706a80;
}

.network-detail dd {
  margin: 0;
  color: #b9b4cc;
}

.network-detail .detail-actions {
  display: flex;
  gap: 7px;
}

.console-heading {
  align-items: flex-end;
  border-bottom: 1px solid var(--line);
}

.console-tabs {
  display: flex;
  min-width: 0;
  gap: 18px;
  overflow-x: auto;
}

.console-tabs button {
  position: relative;
  min-height: 44px;
  padding: 0 2px;
  color: var(--ink-3);
  white-space: nowrap;
  font-size: 15px;
}

.console-tabs button.active {
  color: var(--accent);
  font-weight: 600;
}

.console-tabs button.active::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  content: "";
  background: var(--accent);
}

.console-panel {
  display: none;
}

.console-panel.active {
  display: block;
}

.import-source {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  align-items: stretch;
  min-height: 140px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.import-source header {
  padding: 14px 18px 14px 0;
  border-right: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 15px;
}

.import-source header b {
  display: block;
  margin-top: 8px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 13px;
}

.import-source textarea {
  min-height: 140px;
  padding: 14px 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
  line-height: 1.7;
}

.source-actions {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  padding: 12px 0 12px 12px;
}

.import-workbench {
  display: grid;
  grid-template-columns: 250px minmax(360px, 1fr) 290px;
  min-height: 560px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.import-queue-column,
.import-editor-column,
.import-related-column {
  min-width: 0;
  padding: 15px;
}

.import-queue-column,
.import-editor-column {
  border-right: 1px solid var(--line);
}

.queue-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 10px;
}

.queue-tabs button {
  min-height: 30px;
  padding: 5px 7px;
  border-radius: 4px;
  color: var(--ink-3);
  background: var(--paper-2);
  font-size: 13px;
}

.queue-tabs button b {
  margin-left: 3px;
  color: var(--ink-4);
  font-family: var(--mono);
  font-weight: 400;
}

.queue-tabs button.active {
  color: var(--paper);
  background: var(--ink);
}

.import-queue,
.import-duplicates {
  display: flex;
  max-height: 490px;
  flex-direction: column;
  gap: 5px;
  overflow: auto;
}

.queue-item,
.duplicate-item {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  background: var(--paper);
  text-align: left;
}

.queue-item.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.queue-item b,
.duplicate-item b {
  display: block;
  margin-bottom: 5px;
  overflow: hidden;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-item span,
.duplicate-item span {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink-3);
  font-size: 13px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.empty-editor {
  display: grid;
  min-height: 460px;
  place-items: center;
  color: var(--ink-4);
  font-family: var(--serif);
  font-style: italic;
}

.import-editor form {
  display: grid;
  gap: 10px;
}

.import-editor label,
.config-section label,
.memory-form-grid label,
.write-dialog label {
  display: grid;
  gap: 5px;
  color: var(--ink-3);
  font-size: 13px;
}

.import-editor input,
.import-editor textarea,
.import-editor select,
.config-section input,
.config-section select,
.memory-form-grid input,
.memory-form-grid textarea,
.write-dialog input,
.write-dialog textarea,
.write-dialog select {
  width: 100%;
  padding: 8px 9px;
  color: var(--ink);
  font-size: 15px;
}

.import-editor textarea {
  min-height: 230px;
  line-height: 1.65;
}

.import-editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.import-editor-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  padding-top: 5px;
  border-top: 1px solid var(--line);
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.config-section {
  min-height: 390px;
  padding: 20px;
  border-right: 1px solid var(--line);
}

.config-section:last-child {
  border-right: 0;
}

.config-section > label {
  margin-bottom: 20px;
}

.theme-swatches {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
}

.theme-swatches button {
  display: flex;
  min-height: 54px;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink-3);
  background: var(--paper);
  font-size: 14px;
}

.theme-swatches button.active {
  border-color: var(--accent);
  color: var(--accent);
}

.theme-swatches i {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line-2);
  border-radius: 50%;
}

.swatch-light {
  background: #f4f3f7;
}

.swatch-dark {
  background: #14131c;
}

.connection-stats {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin: 0 0 18px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.connection-stats dt {
  color: var(--ink-3);
}

.connection-stats dd {
  margin: 0;
  color: var(--ink);
  font-family: var(--mono);
}

.connection-result {
  min-height: 22px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 13px;
}

.breath-input-band {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  align-items: stretch;
  min-height: 130px;
  border-bottom: 1px solid var(--line);
}

.breath-input-band label {
  padding: 18px 18px 0 0;
  border-right: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 15px;
}

.breath-input-band textarea {
  min-height: 130px;
  padding: 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
  line-height: 1.7;
}

.breath-input-band button {
  align-self: end;
  margin: 0 0 14px 14px;
}

.breath-pipeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  margin: 22px 0;
  border: 1px solid var(--line);
  background: var(--line);
}

.pipeline-stage {
  min-height: 118px;
  padding: 14px;
  background: var(--paper);
}

.pipeline-stage .stage-index {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
}

.pipeline-stage h3 {
  margin: 10px 0 6px;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
}

.pipeline-stage p {
  margin: 0;
  color: var(--ink-3);
  font-size: 13px;
  line-height: 1.55;
}

.breath-output {
  padding-top: 8px;
}

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

.breath-result {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  text-align: left;
}

.breath-result header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.breath-result h3 {
  margin: 0;
  overflow: hidden;
  font-family: var(--serif);
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breath-result header b {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 13px;
}

.breath-result p {
  display: -webkit-box;
  margin: 8px 0;
  overflow: hidden;
  color: var(--ink-3);
  font-size: 14px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.score-track {
  height: 4px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--bg-2);
}

.score-track i {
  display: block;
  height: 100%;
  background: var(--accent);
}

.explanation-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.explanation-list span {
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--rose-deep);
  background: var(--rose-soft);
  font-size: 12px;
}

.trash-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 460px) 1fr 34px;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.trash-toolbar .page-counter {
  justify-self: end;
}

.trash-list {
  border-top: 1px solid var(--line);
}

.trash-item {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) 150px auto;
  align-items: center;
  gap: 14px;
  min-height: 74px;
  padding: 10px 7px;
  border-bottom: 1px solid var(--line);
}

.trash-item .trash-id {
  color: var(--ink-4);
  font-family: var(--mono);
  font-size: 13px;
}

.trash-item h3 {
  margin: 0 0 4px;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
}

.trash-item p {
  margin: 0;
  overflow: hidden;
  color: var(--ink-3);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trash-item time {
  color: var(--ink-4);
  font-family: var(--mono);
  font-size: 12px;
}

.mobile-nav {
  display: none;
}

.unlock-overlay {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--bg);
}

.unlock-overlay[hidden] {
  display: none;
}

.unlock-sheet {
  width: min(420px, 100%);
  padding: 38px 36px 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: 0 30px 80px -42px rgba(26, 25, 34, 0.5);
}

.unlock-sheet h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 500;
}

.unlock-sheet > p:not(.eyebrow):not(.form-error) {
  margin: 10px 0 24px;
  color: var(--ink-3);
  font-family: var(--serif);
  font-style: italic;
}

.unlock-sheet label {
  display: grid;
  gap: 6px;
  color: var(--ink-3);
  font-size: 13px;
}

.unlock-sheet input {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
}

.unlock-sheet .command-button {
  width: 100%;
  margin-top: 12px;
}

.form-error {
  min-height: 18px;
  margin: 8px 0 0;
  color: var(--danger);
  font-size: 14px;
}

dialog {
  width: min(760px, calc(100vw - 28px));
  max-height: calc(100vh - 34px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-md);
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 34px 90px -36px rgba(26, 25, 34, 0.55);
}

dialog::backdrop {
  background: rgba(26, 25, 34, 0.5);
  backdrop-filter: blur(4px);
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
}

.dialog-header h2 {
  margin: 0;
  overflow-wrap: anywhere;
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 500;
}

.importance-meter {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 2px;
  padding: 12px 22px 0;
}

.importance-meter i {
  height: 3px;
  border-radius: 2px;
  background: var(--bg-2);
}

.importance-meter i.on {
  background: var(--accent);
}

.memory-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 18px 22px;
}

.memory-form-grid .wide,
.write-grid .wide {
  grid-column: 1 / -1;
}

.memory-form-grid textarea,
.write-dialog textarea {
  min-height: 190px;
  line-height: 1.7;
}

.memory-form-grid .short-textarea,
.write-dialog .short-textarea {
  min-height: 75px;
}

.check-field {
  display: flex !important;
  align-items: center;
  align-self: end;
  gap: 8px !important;
  min-height: 34px;
}

.check-field input {
  width: 15px;
  min-height: 15px;
  accent-color: var(--accent);
}

.dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  gap: 16px;
  padding: 10px 22px;
  border-top: 1px solid var(--line);
  background: var(--paper-2);
}

.dialog-footer > div {
  display: flex;
  gap: 8px;
}

.dialog-meta {
  color: var(--ink-4);
  font-family: var(--mono);
  font-size: 12px;
}

.day-dialog {
  width: min(860px, calc(100vw - 28px));
}

.day-dialog-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--line);
}

.day-dialog-stats div {
  padding: 13px 18px;
  border-right: 1px solid var(--line);
}

.day-dialog-stats div:last-child {
  border-right: 0;
}

.day-dialog-stats b {
  display: block;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 500;
}

.day-dialog-stats span {
  color: var(--ink-4);
  font-size: 12px;
}

.day-dialog-body {
  padding: 18px 22px 28px;
}

.day-dialog-memory {
  display: grid;
  grid-template-columns: 70px 12px minmax(0, 1fr);
  gap: 8px;
  min-height: 66px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.day-dialog-memory time {
  color: var(--ink-4);
  font-family: var(--mono);
  font-size: 12px;
}

.day-dialog-memory i {
  width: 7px;
  height: 7px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--accent);
}

.day-dialog-memory h3 {
  margin: 0 0 4px;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
}

.day-dialog-memory p {
  margin: 0;
  color: var(--ink-3);
  font-size: 13px;
  line-height: 1.5;
}

.write-dialog form {
  padding-bottom: 0;
}

.write-dialog form > label {
  margin: 14px 22px 0;
}

.write-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 22px 18px;
}

.toast {
  position: fixed;
  z-index: 300;
  right: 20px;
  bottom: 20px;
  max-width: min(360px, calc(100vw - 40px));
  padding: 10px 13px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  color: var(--paper);
  background: var(--ink);
  box-shadow: 0 20px 44px -28px rgba(26, 25, 34, 0.8);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 160ms ease, transform 160ms ease;
  font-size: 15px;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1120px) {
  .topbar {
    grid-template-columns: minmax(210px, 0.7fr) minmax(240px, 1fr) auto;
    padding: 0 18px;
  }

  .brand-count,
  .gateway-state span {
    display: none;
  }

  .workspace {
    padding-right: 24px;
    padding-left: 24px;
  }

  .masonry-layout {
    columns: 2 270px;
  }

  .network-stage {
    grid-template-columns: 190px minmax(0, 1fr);
  }

  .network-detail {
    position: absolute;
    z-index: 12;
    right: 0;
    width: 280px;
    height: 100%;
    transform: translateX(100%);
    transition: transform 180ms ease;
  }

  .network-detail.open {
    transform: translateX(0);
  }

  .network-stage {
    position: relative;
  }

  .import-workbench {
    grid-template-columns: 220px minmax(330px, 1fr);
  }

  .import-related-column {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
  }

  .import-duplicates {
    display: grid;
    max-height: none;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  :root {
    --topbar-height: 56px;
  }

  body {
    font-size: 17px;
  }

  .topbar {
    grid-template-columns: minmax(150px, 1fr) auto;
    min-height: var(--topbar-height);
    padding: 0 12px;
  }

  .brand-name {
    font-size: 19px;
  }

  .global-search {
    display: none;
  }

  .view-nav {
    display: none;
  }

  .workspace {
    width: 100%;
    padding: 18px 12px 86px;
  }

  .page-heading,
  .network-heading {
    min-height: 80px;
    align-items: flex-start;
    margin-bottom: 16px;
  }

  .page-heading h1,
  .network-heading h1 {
    font-size: 34px;
  }

  .page-subtitle {
    font-size: 17px;
  }

  .cells-toolbar {
    grid-template-columns: minmax(0, 1fr) 34px;
  }

  .cells-toolbar select {
    display: none;
  }

  .filter-rail {
    display: block;
    padding-right: 0;
    padding-left: 0;
  }

  .tag-filter {
    margin-top: 8px;
  }

  .tag-filter input {
    width: 100%;
  }

  .display-bar {
    align-items: flex-start;
  }

  .display-selects {
    gap: 3px;
  }

  .display-selects label {
    display: grid;
    gap: 2px;
  }

  .masonry-layout {
    columns: 1;
  }

  .list-layout .memory-card {
    grid-template-columns: 26px minmax(0, 1fr);
  }

  .list-layout .memory-card-copy {
    grid-column: 2;
  }

  .list-layout .memory-card-tags {
    display: none;
  }

  .selection-bar {
    top: 64px;
    flex-wrap: wrap;
  }

  .timeline-toolbar {
    display: block;
  }

  .timeline-toolbar .field-search {
    width: 100%;
    margin-bottom: 7px;
  }

  .today-strip {
    grid-template-columns: 1fr auto;
  }

  .today-summary {
    display: none;
  }

  .timeline-layout {
    display: block;
  }

  .mini-timeline {
    display: none;
  }

  .timeline::before {
    left: 58px;
  }

  .month-divider,
  .timeline-day,
  .timeline-gap,
  .timeline-end {
    grid-template-columns: 42px 32px minmax(0, 1fr);
  }

  .day-axis-label b {
    font-size: 23px;
  }

  .timeline-line {
    grid-template-columns: 45px 8px minmax(100px, 1fr);
  }

  .timeline-line span:last-child {
    display: none;
  }

  .network-view {
    width: calc(100vw - 24px);
    margin-left: 0;
  }

  .network-heading {
    width: 100%;
  }

  .network-search {
    display: none;
  }

  .network-stage {
    display: block;
    min-height: 580px;
  }

  .network-filters {
    display: none;
  }

  .network-canvas-wrap {
    min-height: 580px;
  }

  .network-canvas-wrap canvas {
    height: 580px;
  }

  .network-replay {
    grid-template-columns: 32px 100px;
  }

  .network-replay span {
    display: none;
  }

  .network-tools {
    align-items: flex-end;
    flex-wrap: wrap;
  }

  .console-heading {
    display: block;
  }

  .console-tabs {
    margin-top: 17px;
  }

  .import-source,
  .breath-input-band {
    grid-template-columns: 1fr;
  }

  .import-source header,
  .breath-input-band label {
    min-height: 42px;
    padding: 10px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .source-actions,
  .breath-input-band button {
    margin: 0;
    padding: 10px 0;
  }

  .import-workbench {
    display: block;
  }

  .import-queue-column,
  .import-editor-column {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .import-queue {
    max-height: 260px;
  }

  .import-duplicates {
    display: flex;
  }

  .config-grid {
    display: block;
  }

  .config-section {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .breath-pipeline {
    grid-template-columns: 1fr;
  }

  .pipeline-stage {
    min-height: 78px;
  }

  .breath-results {
    grid-template-columns: 1fr;
  }

  .trash-item {
    grid-template-columns: 65px minmax(0, 1fr) auto;
  }

  .trash-item time {
    display: none;
  }

  .mobile-nav {
    position: fixed;
    z-index: 90;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    min-height: 66px;
    padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid var(--line);
    background: rgba(244, 243, 247, 0.94);
    backdrop-filter: blur(18px);
  }

  [data-theme="dark"] .mobile-nav {
    background: rgba(20, 19, 28, 0.96);
  }

  .mobile-nav button {
    display: grid;
    min-width: 0;
    place-items: center;
    align-content: center;
    gap: 2px;
    border: 0;
    color: var(--ink-3);
    background: transparent;
    font-size: 13px;
  }

  .mobile-nav button span {
    font-family: var(--serif);
    font-size: 18px;
    line-height: 1;
  }

  .mobile-nav button.active {
    color: var(--accent);
  }

  .memory-form-grid,
  .write-grid {
    grid-template-columns: 1fr;
  }

  .memory-form-grid .wide,
  .write-grid .wide {
    grid-column: auto;
  }

  .dialog-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .dialog-footer > div,
  .dialog-footer .command-button {
    width: 100%;
  }

  .day-dialog-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .heading-actions .page-counter {
    display: none;
  }

  .page-heading {
    gap: 10px;
  }

  .page-heading h1,
  .network-heading h1 {
    font-size: 30px;
  }

  .command-button {
    padding-right: 10px;
    padding-left: 10px;
  }

  .display-selects label:first-child {
    display: none;
  }

  .today-strip {
    padding: 0 10px;
  }

  .day-card {
    padding: 11px;
  }

  .timeline-line {
    grid-template-columns: 38px 7px minmax(80px, 1fr);
  }

  .timeline-line time {
    font-size: 11px;
  }

  .network-tools .network-tool span {
    display: none;
  }

  .trash-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .trash-toolbar .page-counter {
    display: none;
  }

  .unlock-sheet {
    padding: 30px 24px;
  }
}

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