:root {
  color-scheme: light;
  --paper: #f4f1ea;
  --sheet: #fffdf8;
  --ink: #10110f;
  --muted: #74746e;
  --line: #d1cabd;
  --soft: #e7e1d7;
  --radius: 7px;
  --font-display: Georgia, "Times New Roman", serif;
  --font-ui: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.masthead {
  display: grid;
  grid-template-columns: 176px minmax(220px, 460px) 1fr;
  align-items: center;
  gap: 28px;
  min-height: 72px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: inline-flex;
  gap: 4px;
  width: fit-content;
  color: inherit;
  font-size: 17px;
  text-decoration: none;
}

.wordmark span {
  font-family: var(--font-display);
}

.search-line {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  border-bottom: 1px solid var(--line);
}

.search-line span,
.eyebrow,
.view-tab,
.topic-all,
.board-meta,
.panel-heading button {
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.search-line input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.view-tabs {
  justify-self: end;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 22px;
}

.view-tab,
.topic-all,
.topic-button,
.queue-button,
.panel-heading button,
.round-control,
.pill-control,
.close-control,
.tile {
  border: 0;
  background: transparent;
  color: inherit;
}

.view-tab,
.view-tabs .collections-toggle {
  padding: 0;
}

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

.topic-strip {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 58px;
  padding: 0 28px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.topic-all {
  flex: 0 0 auto;
  padding: 0;
}

.topic-list {
  display: flex;
  gap: 16px;
}

.topic-button {
  display: inline-grid;
  grid-template-columns: 8px auto auto;
  align-items: center;
  gap: 8px;
  min-width: max-content;
  padding: 0;
  color: var(--muted);
}

.topic-button[aria-pressed="true"] {
  color: var(--ink);
}

.topic-button[aria-pressed="false"] {
  opacity: 0.36;
}

.topic-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--topic-color);
}

.topic-count {
  color: var(--muted);
  font-size: 13px;
}

.experience {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 0;
  min-height: calc(100vh - 130px);
}

.desk-panel {
  display: grid;
  align-content: start;
  gap: 30px;
  padding: 30px 26px 24px 28px;
  border-right: 1px solid var(--line);
}

.panel-block {
  display: grid;
  gap: 9px;
}

.panel-block strong {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.panel-block span {
  color: var(--muted);
  font-size: 13px;
}

.eyebrow {
  margin: 0;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-heading button {
  padding: 0;
}

.mini-list {
  display: grid;
  gap: 10px;
}

.queue-button {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--soft);
  text-align: left;
}

.queue-button strong {
  display: -webkit-box;
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.05;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.queue-button span,
.empty-state {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.board-column {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  min-width: 0;
  padding: 28px clamp(22px, 4vw, 54px) 24px;
}

.board-meta {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.tile-board {
  position: relative;
  height: clamp(560px, calc(100dvh - 252px), 720px);
  min-height: 0;
  overflow: hidden;
  perspective: 1800px;
  touch-action: pan-y;
}

.board-track {
  display: flex;
  height: 100%;
  min-height: 0;
  transition: transform 420ms cubic-bezier(0.2, 0.72, 0.1, 1);
}

.board-page {
  flex: 0 0 100%;
  display: grid;
  height: 100%;
  min-width: 0;
  min-height: 0;
  gap: 12px;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: repeat(6, minmax(86px, 1fr));
  transform-origin: left center;
}

.tile {
  position: relative;
  display: grid;
  align-content: space-between;
  min-width: 0;
  min-height: 0;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--sheet);
  box-shadow: 0 16px 36px rgba(16, 17, 15, 0.06);
  text-align: left;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.tile::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--topic-color);
  content: "";
}

.tile:hover,
.tile:focus-visible {
  border-color: color-mix(in srgb, var(--topic-color) 55%, var(--line));
  box-shadow: 0 22px 50px rgba(16, 17, 15, 0.1);
  outline: 0;
  transform: translateY(-2px);
}

.tile.hero {
  grid-column: span 6;
  grid-row: span 4;
  padding: clamp(24px, 4vw, 44px);
}

.tile.wide {
  grid-column: span 4;
  grid-row: span 2;
}

.tile.tall {
  grid-column: span 3;
  grid-row: span 3;
}

.tile.medium {
  grid-column: span 3;
  grid-row: span 2;
}

.tile.small {
  grid-column: span 3;
  grid-row: span 1;
}

.tile-kicker,
.tile-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tile-topic {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  overflow: hidden;
}

.tile-kicker > span:last-child {
  flex: 0 0 auto;
  min-width: 4ch;
  margin-right: 6px;
  text-align: right;
}

.tile-topic::before {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--topic-color);
  content: "";
}

.tile h2 {
  margin: 16px 0 10px;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.6vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 0.96;
}

.tile.hero h2 {
  max-width: 10ch;
  font-size: clamp(2.45rem, 3.8vw, 3.8rem);
  line-height: 0.9;
}

.tile.hero p {
  -webkit-line-clamp: 2;
}

.tile p {
  display: -webkit-box;
  overflow: hidden;
  margin: 10px 0 0;
  color: #30332f;
  font-size: 15px;
  line-height: 1.38;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.tile-visual {
  display: grid;
  grid-template-columns: minmax(66px, auto) minmax(90px, 1fr) 46px;
  align-items: end;
  gap: 12px;
  min-height: 54px;
  margin: 10px 0;
}

.tile-visual.prominent {
  grid-template-columns: minmax(110px, auto) minmax(180px, 1fr) 70px;
  min-height: 66px;
  margin: 14px 0 8px;
}

.visual-stat {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.visual-stat strong {
  color: var(--topic-color);
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 0.9;
}

.tile-visual:not(.prominent) .visual-stat strong {
  font-size: clamp(1.25rem, 2vw, 1.7rem);
}

.visual-stat span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 680;
  letter-spacing: 0.1em;
  line-height: 1.15;
  text-transform: uppercase;
}

.sparkline {
  width: 100%;
  min-width: 0;
  height: 54px;
  overflow: visible;
}

.tile-visual.prominent .sparkline {
  height: 60px;
}

.sparkline path {
  fill: none;
  stroke: var(--soft);
  stroke-width: 1;
}

.sparkline polyline {
  fill: none;
  stroke: var(--topic-color);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.bar-signal {
  display: flex;
  align-items: end;
  gap: 4px;
  height: 52px;
}

.tile-visual.prominent .bar-signal {
  height: 58px;
}

.bar-signal span {
  flex: 1;
  min-width: 3px;
  border-radius: 999px 999px 0 0;
  background: color-mix(in srgb, var(--topic-color) 74%, var(--sheet));
}

.tile.small p {
  display: none;
}

.tile.small h2 {
  margin-bottom: 0;
  font-size: 1.25rem;
  line-height: 1;
}

.tile-actions {
  position: absolute;
  right: 12px;
  bottom: 10px;
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity 160ms ease;
}

.tile:hover .tile-actions,
.tile:focus-within .tile-actions {
  opacity: 1;
}

.tile-action {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.9);
}

.tile-action.active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--sheet);
}

.board-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.round-control,
.pill-control,
.close-control {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.72);
}

.round-control {
  width: 40px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
}

.pill-control {
  min-width: 86px;
  padding: 0 16px;
  color: var(--muted);
  font-size: 13px;
}

.pill-control.primary,
.pill-control.active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--sheet);
}

.round-control:disabled,
.pill-control:disabled {
  cursor: default;
  opacity: 0.36;
}

.detail-dialog {
  width: min(920px, calc(100vw - 30px));
  max-height: min(820px, calc(100vh - 30px));
  padding: 0;
  border: 0;
  background: transparent;
}

.detail-dialog::backdrop {
  background: rgba(16, 17, 15, 0.48);
}

.detail-sheet {
  position: relative;
  max-height: inherit;
  padding: clamp(30px, 5vw, 62px);
  overflow: auto;
  border-radius: var(--radius);
  background: var(--sheet);
  box-shadow: 0 28px 80px rgba(16, 17, 15, 0.28);
}

.close-control {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 40px;
  padding: 0;
  font-size: 22px;
}

.detail-hero {
  display: grid;
  gap: 18px;
  max-width: 760px;
  padding-right: 44px;
}

.detail-hero h2 {
  max-width: 12ch;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, 6rem);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 0.94;
}

.detail-hero p {
  max-width: 62ch;
  margin: 0;
  color: #30332f;
  font-size: 19px;
  line-height: 1.55;
}

.detail-hero .tile-visual {
  max-width: 680px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 34px;
  margin-top: 44px;
}

.detail-section {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.detail-section h3 {
  margin: 0 0 13px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.detail-section ul {
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.detail-section li {
  color: #30332f;
  font-size: 15px;
  line-height: 1.5;
}

@media (max-width: 1100px) {
  .experience {
    grid-template-columns: 1fr;
  }

  .desk-panel {
    display: none;
  }

  .board-column {
    grid-template-rows: auto auto auto;
    padding-inline: 18px;
  }

  .tile-board {
    height: min(650px, calc(100dvh - 250px));
    min-height: 0;
  }

  .board-page {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(4, minmax(112px, 1fr));
    transform-style: preserve-3d;
  }

  .tile.hero,
  .tile.wide,
  .tile.tall,
  .tile.medium,
  .tile.small {
    grid-column: span 2;
    grid-row: span 2;
  }

  .tile.hero {
    padding: 22px;
  }

  .tile.hero .tile-kicker > span:last-child {
    display: none;
  }

  .tile.hero h2,
  .tile h2 {
    max-width: 12ch;
    font-size: clamp(1.65rem, 5vw, 3rem);
    line-height: 0.98;
  }

  .tile-visual {
    grid-template-columns: minmax(72px, auto) 1fr 48px;
  }

  .tile p {
    display: none;
  }
}

@media (max-width: 720px) {
  .masthead {
    grid-template-columns: 1fr;
    gap: 13px;
    padding: 18px;
  }

  .view-tabs {
    justify-self: start;
    gap: 20px;
  }

  .topic-strip {
    min-height: 54px;
    padding-inline: 18px;
  }

  .board-column {
    gap: 12px;
    padding: 18px;
  }

  .board-meta {
    letter-spacing: 0.06em;
  }

  .tile-board {
    height: calc(100dvh - 460px);
    min-height: 0;
  }

  .board-page {
    gap: 9px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(3, minmax(104px, 1fr));
  }

  .tile.hero,
  .tile.wide,
  .tile.tall,
  .tile.medium,
  .tile.small {
    grid-column: span 1;
    grid-row: span 1;
  }

  .tile.hero {
    grid-column: span 2;
    grid-row: span 2;
  }

  .tile {
    padding: 14px;
  }

  .tile h2,
  .tile.hero h2 {
    font-size: clamp(1.35rem, 7vw, 2.5rem);
  }

  .tile-visual {
    grid-template-columns: minmax(68px, auto) 1fr;
    min-height: 42px;
    margin: 8px 0 6px;
  }

  .tile-visual .bar-signal {
    display: none;
  }

  .tile-visual.prominent {
    grid-template-columns: minmax(84px, auto) 1fr;
    min-height: 58px;
  }

  .sparkline {
    height: 40px;
  }

  .tile-visual.prominent .sparkline {
    height: 54px;
  }

  .visual-stat strong {
    font-size: 1.55rem;
  }

  .tile:not(.hero) h2 {
    font-size: clamp(1.05rem, 5.4vw, 1.7rem);
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .tile:not(.hero) p {
    display: none;
  }

  .tile.hero p {
    display: none;
  }

  .tile:not(.hero) .tile-meta {
    display: none;
  }

  .tile.wide p {
    display: -webkit-box;
    -webkit-line-clamp: 1;
  }

  .tile.wide .tile-meta {
    display: flex;
  }

  .tile:not(.hero) .tile-visual {
    display: none;
  }

  .tile p {
    font-size: 13px;
    line-height: 1.34;
    -webkit-line-clamp: 2;
  }

  .tile-meta {
    font-size: 10px;
  }

  .tile-action {
    width: 28px;
    height: 28px;
  }

  .pill-control {
    min-width: 62px;
    padding-inline: 12px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1101px) {
  .tile:not(.hero) p {
    display: none;
  }

  .tile:not(.hero) .tile-visual {
    grid-template-columns: minmax(56px, auto) 1fr;
    min-height: 42px;
    margin: 8px 0 0;
  }

  .tile:not(.hero) .bar-signal {
    display: none;
  }

  .tile:not(.hero) .tile-meta {
    display: none;
  }

}

/* ── MODE STRIP ──────────────────────────────────────────────────────────── */

.mode-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 28px;
  background: var(--ink);
  overflow-x: auto;
}

.mode-label {
  flex-shrink: 0;
  color: rgba(255, 253, 248, 0.4);
  font-size: 11px;
  font-weight: 680;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-right: 4px;
}

.mode-tab {
  flex-shrink: 0;
  padding: 5px 14px;
  border: 1px solid rgba(255, 253, 248, 0.18);
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 253, 248, 0.48);
  font-size: 13px;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.mode-tab.active {
  border-color: var(--sheet);
  background: var(--sheet);
  color: var(--ink);
}

.mode-tab:hover:not(.active) {
  border-color: rgba(255, 253, 248, 0.42);
  color: rgba(255, 253, 248, 0.9);
}

/* ── AMBIENT MODE HIGHLIGHTS ─────────────────────────────────────────────── */

.tile.conn-source {
  border-color: var(--topic-color);
  box-shadow: 0 0 0 2px var(--topic-color), 0 16px 36px rgba(16, 17, 15, 0.12);
  transform: translateY(-2px);
  z-index: 2;
}

.tile.conn-target {
  border-color: color-mix(in srgb, var(--topic-color) 55%, var(--line));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--topic-color) 40%, transparent),
              0 8px 24px rgba(16, 17, 15, 0.08);
  transform: translateY(-1px);
  z-index: 1;
}

.tile.conn-dimmed {
  opacity: 0.22;
  transform: none;
}

.conn-hint {
  margin: 4px 0 0;
  color: var(--topic-color);
  font-size: 10px;
  font-weight: 660;
  letter-spacing: 0.07em;
  opacity: 0;
  transition: opacity 160ms ease;
}

.tile:hover .conn-hint,
.tile:focus-within .conn-hint {
  opacity: 1;
}

/* ── THREAD BADGES ───────────────────────────────────────────────────────── */

.thread-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 5px 0 2px;
  padding: 3px 8px 3px 5px;
  border: 1px solid color-mix(in srgb, var(--thread-color) 28%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--thread-color) 7%, transparent);
  color: var(--thread-color);
  font-size: 10px;
  font-weight: 660;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background 120ms ease;
}

.thread-badge.active {
  background: color-mix(in srgb, var(--thread-color) 14%, transparent);
  border-color: color-mix(in srgb, var(--thread-color) 50%, transparent);
}

.thread-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--thread-color);
  flex-shrink: 0;
}

.thread-badge-pos {
  margin-left: 2px;
  opacity: 0.6;
}

/* ── CHAIN STRIP (causal chain mode, in detail sheet) ────────────────────── */

.chain-strip {
  margin: calc(-1 * clamp(30px, 5vw, 62px));
  margin-bottom: 32px;
  padding: 20px clamp(30px, 5vw, 62px);
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--paper);
}

.chain-strip-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 680;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.chain-strip-label span {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.chain-cards {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.chain-card {
  flex: 0 0 auto;
  display: grid;
  gap: 3px;
  min-width: 154px;
  max-width: 200px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--sheet);
  text-align: left;
  cursor: pointer;
  transition: border-color 130ms ease, box-shadow 130ms ease;
}

.chain-card::before {
  content: "";
  display: block;
  height: 3px;
  border-radius: 2px;
  background: var(--topic-color);
  margin-bottom: 5px;
}

.chain-card:hover {
  border-color: var(--topic-color);
  box-shadow: 0 3px 10px rgba(16, 17, 15, 0.08);
}

.chain-card.current {
  border-color: var(--topic-color);
  background: color-mix(in srgb, var(--topic-color) 5%, var(--sheet));
}

.chain-card-topic {
  color: var(--muted);
  font-size: 10px;
  font-weight: 680;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.chain-card strong {
  display: -webkit-box;
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.15;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.chain-card span:last-child {
  color: var(--topic-color);
  font-size: 12px;
  font-weight: 680;
  letter-spacing: 0.02em;
}

.chain-arrow {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
}

/* ── RESPONSIVE: MODE STRIP ──────────────────────────────────────────────── */

@media (max-width: 720px) {
  .mode-strip {
    padding: 0 18px;
    gap: 6px;
  }

  .mode-label {
    display: none;
  }

  .mode-tab {
    padding: 4px 11px;
    font-size: 12px;
  }

}

/* ══════════════════════════════════════════════════════════════════════════
   CARD REDESIGN — overrides all previous tile visual rules
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Padding as variable so chart bleed always matches ─────────────────── */

.tile {
  --tile-pad: 16px;
  padding: var(--tile-pad);
}

.tile.hero {
  --tile-pad: clamp(20px, 3.2vw, 38px);
  padding: var(--tile-pad);
}

@media (max-width: 1100px) {
  .tile.hero { --tile-pad: 18px; }
}

@media (max-width: 720px) {
  .tile { --tile-pad: 13px; }
}

/* ── Top color strip (replaces left strip) ─────────────────────────────── */

.tile::before {
  position: absolute;
  inset: 0 0 auto 0;
  width: auto;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--topic-color);
  content: "";
}

/* ── Kicker: topic label uses topic color ──────────────────────────────── */

.tile-topic {
  color: var(--topic-color);
  font-weight: 700;
}

.tile-conf {
  color: var(--muted);
}

/* ── Area chart — bleeds edge-to-edge ──────────────────────────────────── */

.tile-chart {
  margin-inline: calc(-1 * var(--tile-pad));
  margin-top: 10px;
  height: 54px;
  overflow: hidden;
  flex-shrink: 0;
}

.tile.hero .tile-chart {
  height: 90px;
  margin-top: 12px;
}

.tile.small .tile-chart {
  height: 36px;
  margin-top: 6px;
}

.chart-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.chart-area {
  fill: var(--topic-color);
  opacity: 0.13;
}

.chart-line {
  fill: none;
  stroke: var(--topic-color);
  stroke-width: 2px;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.chart-dot {
  fill: var(--topic-color);
  filter: drop-shadow(0 0 3px var(--topic-color));
}

/* ── Stat number ───────────────────────────────────────────────────────── */

.tile-stat {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 10px;
}

.tile-stat strong {
  color: var(--topic-color);
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 1.9vw, 2rem);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1;
}

.tile-stat.prominent strong {
  font-size: clamp(1.9rem, 3vw, 3.2rem);
}

.tile-stat.neg strong {
  opacity: 0.85;
}

.tile-stat span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 680;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  flex-shrink: 0;
  line-height: 1;
}

.tile.small .tile-stat strong {
  font-size: 1.1rem;
}

/* ── Title: smaller, sans on regular tiles; small serif on hero ─────────── */

.tile h2 {
  margin: 8px 0 0;
  font-family: var(--font-ui);
  font-size: clamp(0.88rem, 1.1vw, 1.05rem);
  font-weight: 580;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--ink);
}

.tile.hero h2 {
  max-width: none;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 1.8vw, 1.8rem);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.12;
}

.tile.small h2 {
  font-size: 0.82rem;
  line-height: 1.25;
  margin-bottom: 0;
  -webkit-line-clamp: 2;
}

@media (max-width: 1100px) {
  .tile.hero h2,
  .tile h2 {
    max-width: none;
    font-size: clamp(0.9rem, 3.8vw, 1.35rem);
    font-family: var(--font-ui);
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.25;
  }

  .tile.hero h2 {
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 4.5vw, 1.8rem);
  }
}

@media (max-width: 720px) {
  .tile h2 {
    font-size: clamp(0.82rem, 3.6vw, 1.05rem);
  }

  .tile.hero h2 {
    font-size: clamp(1rem, 5vw, 1.55rem);
  }

  .tile-chart { height: 44px; }
  .tile.hero .tile-chart { height: 68px; }
  .tile.small .tile-chart { height: 30px; }

  .tile-stat strong { font-size: 1.15rem; }
  .tile.hero .tile-stat strong { font-size: clamp(1.5rem, 6vw, 2.2rem); }
}

/* ── Detail sheet: updated sparkline (spark-* classes) ─────────────────── */

.spark-area {
  fill: var(--topic-color);
  opacity: 0.12;
}

.spark-line {
  fill: none;
  stroke: var(--topic-color);
  stroke-width: 3px;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.spark-dot {
  fill: var(--topic-color);
  filter: drop-shadow(0 0 4px var(--topic-color));
}

/* detail visual-stat neg treatment */
.visual-stat.neg strong {
  opacity: 0.85;
}

/* Hide old sparkline baseline rule — replaced by area fill */
.sparkline path { display: none; }
.sparkline polyline {
  stroke-width: 3px;
}

/* ── Tile meta: single line, tighter ───────────────────────────────────── */

.tile-meta {
  font-size: 10px;
  letter-spacing: 0.04em;
}

/* ── Connection hint: sits just above meta ─────────────────────────────── */

.conn-hint {
  margin-top: 6px;
}

/* ══════════════════════════════════════════════════════════════════════════
   CONTENT-HEIGHT LAYOUT — overrides every fixed-height grid constraint.
   Tiles size to their content; nothing is clipped.
   The horizontal flip animation is unaffected.
   ══════════════════════════════════════════════════════════════════════════ */

/* Board: no fixed height, flip clips only horizontally */
.tile-board {
  height: auto;
  min-height: 180px;
}

/* Track: let each page have its own height */
.board-track {
  height: auto;
  align-items: flex-start;
  transition: transform 300ms cubic-bezier(0.22, 0.72, 0.1, 1);
}

/* Board-column: stop forcing the board row to fill the viewport */
.board-column {
  grid-template-rows: auto auto auto;
}

/* Page: rows auto-size to the tallest tile in each row */
.board-page {
  height: auto;
  min-height: 0;
  grid-template-rows: none;
  grid-auto-rows: auto;
  align-items: start;
}

/* Remove every row span — tiles expand to content height */
.tile.hero,
.tile.wide,
.tile.tall,
.tile.medium,
.tile.small {
  grid-row: auto;
}

/* ── Desktop: 3-col grid — hero 2/3, others 1/3, bottom tile full-width ── */

@media (min-width: 1101px) {
  .board-page {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: auto;
    align-items: start;
  }

  /* Clear any named-area assignments */
  .board-page .tile { grid-area: auto; grid-column: span 1; }

  /* Hero spans 2 of 3 columns */
  .board-page .tile:nth-child(1) { grid-column: span 2; }

  /* 6th tile is a full-width featured strip */
  .board-page .tile:nth-child(6) { grid-column: span 3; }

  /* Show meta on all desktop tiles */
  .tile:not(.hero) .tile-meta { display: flex; }
}

/* ── Tablet: 2-col, hero spans both columns ────────────────────────────── */

@media (max-width: 1100px) {
  .tile-board { height: auto; min-height: 160px; }

  .board-page {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: none;
    grid-auto-rows: auto;
    align-items: start;
  }

  .tile.hero,
  .tile.wide,
  .tile.tall,
  .tile.medium,
  .tile.small { grid-column: span 1; grid-row: auto; }

  .tile.hero { grid-column: span 2; }

  /* Show description on hero at tablet */
  .tile.hero p {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* Show meta on all tiles */
  .tile .tile-meta { display: flex; }
}

/* ── Mobile: 2-col, hero full width ────────────────────────────────────── */

@media (max-width: 720px) {
  .tile-board { height: auto; min-height: 120px; }

  .board-page {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: auto;
    align-items: start;
    gap: 9px;
  }

  .tile.hero,
  .tile.wide,
  .tile.tall,
  .tile.medium,
  .tile.small { grid-column: span 1; grid-row: auto; }

  .tile.hero { grid-column: span 2; }

  /* Remove line-clamp from h2 — titles show fully */
  .tile:not(.hero) h2 {
    display: block;
    overflow: visible;
    -webkit-line-clamp: none;
    -webkit-box-orient: horizontal;
  }

  /* Meta on all tiles */
  .tile .tile-meta { display: flex; }
  .tile:not(.hero) .tile-meta { display: flex; }
}

/* ── Wide tile: horizontal banner layout on desktop ─────────────────────── */

@media (min-width: 1101px) {
  .tile.wide {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
    align-items: center;
    column-gap: 0;
  }

  /* Left column: kicker + stat + title + meta */
  .tile.wide .tile-kicker,
  .tile.wide .tile-stat,
  .tile.wide h2,
  .tile.wide p,
  .tile.wide .tile-meta {
    grid-column: 1;
  }

  /* Right column: chart bleeds into right half */
  .tile.wide .tile-chart {
    grid-column: 2;
    grid-row: 1 / 5;
    height: 100%;
    min-height: 90px;
    margin: 0;
    margin-inline: 0;
    align-self: stretch;
  }

  .tile.wide h2 {
    font-family: var(--font-display);
    font-size: clamp(1rem, 1.4vw, 1.45rem);
    font-weight: 650;
  }

  .tile.wide p {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   EXECUTIVE READY LAYER
   restrained briefing chrome, priority signals, memo detail view
   ══════════════════════════════════════════════════════════════════════════ */

:root {
  --paper: #f2efe7;
  --sheet: #fffefa;
  --ink: #141411;
  --muted: #706f68;
  --line: #cbc3b6;
  --soft: #e5ded2;
  --coal: #181915;
  --success: #1a6b3c;
  --caution: #a36418;
  --alert: #9d2f24;
}

body {
  background:
    linear-gradient(180deg, rgba(24, 25, 21, 0.035), transparent 210px),
    var(--paper);
}

.mode-strip {
  min-height: 42px;
  border-bottom: 1px solid rgba(255, 253, 248, 0.12);
  background: var(--coal);
}

.masthead {
  grid-template-columns: 190px minmax(260px, 520px) 1fr;
  min-height: 76px;
  background: rgba(255, 253, 248, 0.58);
  backdrop-filter: blur(18px);
}

.wordmark {
  align-items: baseline;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.wordmark::before {
  width: 10px;
  height: 10px;
  margin-right: 7px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ink) 0 48%, transparent 49%);
  content: "";
}

.search-line {
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.7);
}

.view-tabs {
  gap: 8px;
}

.view-tab,
.view-tabs .collections-toggle {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 680;
  letter-spacing: 0.1em;
}

.view-tab.active,
.view-tabs .collections-toggle.active {
  border-color: var(--line);
  background: var(--sheet);
  box-shadow: 0 1px 3px rgba(16, 17, 15, 0.06);
}

.topic-strip {
  min-height: 52px;
  background: rgba(242, 239, 231, 0.88);
}

.topic-button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 999px;
}

.topic-button[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--topic-color) 28%, var(--line));
  background: color-mix(in srgb, var(--topic-color) 5%, var(--sheet));
}

.experience {
  grid-template-columns: 284px minmax(0, 1fr);
}

.desk-panel {
  gap: 26px;
  background: rgba(255, 253, 248, 0.42);
}

.panel-pulse {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.72);
}

.pulse-meter {
  position: relative;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--success), var(--caution), var(--alert));
}

.pulse-meter span {
  display: block;
  height: 100%;
  border-right: 3px solid var(--ink);
}

.panel-pulse strong {
  font-family: var(--font-ui);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.board-column {
  gap: 16px;
  padding-top: 24px;
}

.board-meta {
  align-items: center;
  min-height: 34px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}

.tile {
  border-color: rgba(20, 20, 17, 0.11);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), transparent 34%),
    var(--sheet);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 10px 24px rgba(16, 17, 15, 0.055);
}

.tile:hover,
.tile:focus-visible {
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.74) inset, 0 16px 34px rgba(16, 17, 15, 0.105);
}

.tile[data-tone="watch"]::after,
.tile[data-tone="upside"]::after {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  content: "";
}

.tile[data-tone="watch"]::after {
  background: var(--alert);
  box-shadow: 0 0 0 4px rgba(157, 47, 36, 0.1);
}

.tile[data-tone="upside"]::after {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(26, 107, 60, 0.1);
}

.tile-exec-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.3;
  text-transform: uppercase;
}

.priority-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--sheet);
  color: var(--muted);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.priority-chip.watch {
  border-color: rgba(157, 47, 36, 0.28);
  background: rgba(157, 47, 36, 0.075);
  color: var(--alert);
}

.priority-chip.upside {
  border-color: rgba(26, 107, 60, 0.28);
  background: rgba(26, 107, 60, 0.075);
  color: var(--success);
}

.priority-chip.monitor {
  border-color: rgba(112, 111, 104, 0.24);
  background: rgba(112, 111, 104, 0.06);
}

.tile h2 {
  margin-top: 10px;
  font-size: clamp(0.96rem, 1.08vw, 1.08rem);
  font-weight: 650;
  line-height: 1.26;
}

.tile.hero h2 {
  font-size: clamp(1.45rem, 2.25vw, 2.35rem);
  line-height: 1.05;
}

.tile.hero p {
  display: -webkit-box;
  margin-top: 12px;
  color: #333630;
  font-size: 16px;
  line-height: 1.52;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.tile-stat {
  align-items: end;
}

.tile-stat strong {
  font-family: var(--font-ui);
  font-weight: 780;
  letter-spacing: -0.045em;
}

.tile-stat.prominent strong {
  font-size: clamp(2.2rem, 4vw, 4.2rem);
}

.tile-chart {
  border-bottom: 1px solid rgba(20, 20, 17, 0.04);
}

.tile-actions {
  opacity: 1;
}

.tile-action {
  border-color: rgba(20, 20, 17, 0.12);
  color: var(--muted);
  font-size: 13px;
}

.board-controls {
  position: static;
  z-index: 4;
  width: fit-content;
  margin: 0 auto;
  padding: 7px;
  border: 1px solid rgba(20, 20, 17, 0.1);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.78);
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 32px rgba(16, 17, 15, 0.12);
}

.detail-dialog {
  width: min(1040px, calc(100vw - 30px));
}

.detail-sheet {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), transparent 180px),
    var(--sheet);
}

.decision-band {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 2px;
}

.decision-band > span:not(.priority-chip) {
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 720;
  letter-spacing: 0.08em;
  line-height: 20px;
  text-transform: uppercase;
}

.detail-hero h2 {
  max-width: 14ch;
  font-size: clamp(2.35rem, 5.8vw, 5.2rem);
}

.detail-hero .tile-visual {
  max-width: none;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.7);
}

.sparkline .spark-area {
  display: block;
}

.memo-strip {
  display: grid;
  grid-template-columns: 1fr 1fr 1.25fr;
  gap: 1px;
  overflow: hidden;
  max-width: 820px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.memo-strip div {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 14px 16px;
  background: rgba(255, 253, 248, 0.9);
}

.memo-strip span,
.metric-card span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 720;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.memo-strip strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  font-weight: 720;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-cards {
  display: grid;
  gap: 8px;
}

.metric-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: baseline;
  padding: 11px 0;
  border-bottom: 1px solid var(--soft);
}

.metric-card strong {
  color: var(--ink);
  font-size: 17px;
  font-weight: 760;
  letter-spacing: -0.02em;
}

.detail-section li {
  position: relative;
  padding-left: 16px;
}

.detail-section li::before {
  position: absolute;
  top: 0.68em;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--topic-color);
  content: "";
}

@media (max-width: 1100px) {
  .masthead {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 18px;
  }

  .view-tabs {
    justify-self: start;
  }

  .experience {
    grid-template-columns: 1fr;
  }

  .tile.hero p {
    font-size: 14px;
    -webkit-line-clamp: 2;
  }
}

@media (max-width: 720px) {
  .search-line {
    grid-template-columns: 1fr;
    gap: 2px;
    min-height: 54px;
    padding-block: 7px;
    border-radius: var(--radius);
  }

  .tile-exec-line {
    display: none;
  }

  .board-controls {
    width: 100%;
    justify-content: space-between;
  }

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

  .detail-hero h2 {
    max-width: none;
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   DESKTOP PROMOTED MOSAIC
   Stable, intentional boardroom layout: click to promote, click hero to read.
   ══════════════════════════════════════════════════════════════════════════ */

.tile {
  cursor: pointer;
}

.tile.is-active {
  border-color: color-mix(in srgb, var(--topic-color) 58%, var(--line));
}

.tile.is-active::before {
  height: 4px;
}

.tile-action {
  pointer-events: auto;
}

@media (min-width: 1101px) {
  .tile-board {
    height: clamp(760px, calc(100dvh - 220px), 900px);
    min-height: 760px;
    overflow: hidden;
  }

  .board-track {
    height: 100%;
    align-items: stretch;
  }

  .board-page {
    height: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows:
      minmax(170px, 1.08fr)
      minmax(170px, 1.08fr)
      minmax(130px, 0.78fr)
      minmax(135px, 0.82fr);
    gap: 14px;
    align-items: stretch;
  }

  .board-page .tile {
    grid-area: auto;
    grid-column: auto;
    grid-row: auto;
    min-height: 0;
  }

  .board-page .tile:nth-child(1) {
    grid-column: 1 / 3;
    grid-row: 1 / 3;
  }

  .board-page .tile:nth-child(2) {
    grid-column: 3;
    grid-row: 1;
  }

  .board-page .tile:nth-child(3) {
    grid-column: 3;
    grid-row: 2;
  }

  .board-page .tile:nth-child(4) {
    grid-column: 1;
    grid-row: 3;
  }

  .board-page .tile:nth-child(5) {
    grid-column: 2;
    grid-row: 3;
  }

  .board-page .tile:nth-child(6) {
    grid-column: 1 / 4;
    grid-row: 4;
  }

  .tile:not(.hero) h2 {
    display: -webkit-box;
    overflow: hidden;
    margin-top: 6px;
    font-size: clamp(0.86rem, 0.98vw, 0.98rem);
    line-height: 1.18;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .tile:not(.hero) .tile-chart {
    height: 34px;
  }

  .tile.hero {
    --tile-pad: clamp(20px, 2.4vw, 30px);
  }

  .tile.hero .tile-chart {
    height: 72px;
  }

  .tile.hero h2 {
    font-size: clamp(1.35rem, 2vw, 2.1rem);
  }

  .tile.hero p {
    -webkit-line-clamp: 2;
  }

  .tile:not(.hero) .tile-stat {
    margin-top: 6px;
  }

  .tile:not(.hero) .tile-stat strong {
    font-size: clamp(1.25rem, 1.65vw, 1.72rem);
  }

  .tile:not(.hero) .tile-exec-line {
    gap: 4px;
    margin-top: 5px;
    font-size: 9px;
    letter-spacing: 0.06em;
  }

  .tile:not(.hero) .priority-chip {
    min-height: 18px;
    padding-inline: 6px;
    font-size: 9px;
  }

  .tile:not(.hero) .tile-meta {
    font-size: 9px;
  }

  .tile.wide {
    grid-template-columns: minmax(0, 0.9fr) minmax(260px, 1.1fr);
    min-height: 0;
  }

  .tile.wide .tile-chart {
    min-height: 110px;
  }

  .tile.wide h2 {
    -webkit-line-clamp: 2;
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   GRAPH VARIETY — donut, bar, gauge, step charts
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Donut ─────────────────────────────────────────────────────────────── */

.tile-chart--donut {
  margin-inline: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.chart-donut-svg {
  width: auto;
  height: 100%;
  aspect-ratio: 1;
  overflow: visible;
  flex-shrink: 0;
}

.donut-track {
  fill: none;
  stroke: var(--soft);
  stroke-width: 4.5;
}

.donut-fill {
  fill: none;
  stroke: var(--topic-color);
  stroke-width: 4.5;
  stroke-linecap: round;
}

.donut-fill.neg {
  stroke: var(--alert);
}

/* ── Bar ───────────────────────────────────────────────────────────────── */

.chart-bar {
  fill: color-mix(in srgb, var(--topic-color) 38%, var(--soft));
}

.chart-bar.last {
  fill: var(--topic-color);
  filter: drop-shadow(0 0 2px var(--topic-color));
}

/* ── Gauge ─────────────────────────────────────────────────────────────── */

.tile-chart--gauge {
  margin-inline: 0;
  padding-inline: 8px;
}

.gauge-track {
  fill: var(--soft);
}

.gauge-fill {
  fill: var(--topic-color);
}

.gauge-fill.neg {
  fill: var(--alert);
}

.gauge-pip {
  fill: var(--sheet);
  stroke: var(--topic-color);
  stroke-width: 2.5;
  filter: drop-shadow(0 1px 3px rgba(16, 17, 15, 0.16));
}

/* ── Step (staircase sparkline) ───────────────────────────────────────── */

.step-line {
  fill: none;
  stroke: var(--topic-color);
  stroke-width: 2px;
  stroke-linecap: square;
  stroke-linejoin: miter;
  vector-effect: non-scaling-stroke;
}

/* ══════════════════════════════════════════════════════════════════════════
   DRAMATIC FLIPBOARD ANIMATION — true 90-degree page flip
   ══════════════════════════════════════════════════════════════════════════ */

@keyframes tileFlipIn {
  0% {
    opacity: 0;
    transform: perspective(360px) rotateX(90deg);
  }
  65% {
    opacity: 1;
    transform: perspective(360px) rotateX(-8deg);
  }
  100% {
    opacity: 1;
    transform: perspective(360px) rotateX(0deg);
  }
}

@keyframes tileFlipOut {
  0% {
    opacity: 1;
    transform: perspective(360px) rotateX(0deg);
  }
  100% {
    opacity: 0;
    transform: perspective(360px) rotateX(-90deg);
  }
}

.board-page.page-in .tile {
  animation: tileFlipIn 520ms cubic-bezier(0.14, 0.72, 0.28, 1) both;
}

.board-page.page-out .tile {
  animation: tileFlipOut 200ms ease-in both;
}

.board-page.page-in .tile:nth-child(1) { animation-delay: 0ms; }
.board-page.page-in .tile:nth-child(2) { animation-delay: 60ms; }
.board-page.page-in .tile:nth-child(3) { animation-delay: 120ms; }
.board-page.page-in .tile:nth-child(4) { animation-delay: 180ms; }
.board-page.page-in .tile:nth-child(5) { animation-delay: 240ms; }
.board-page.page-in .tile:nth-child(6) { animation-delay: 300ms; }

/* On mobile/tablet, disable the track's horizontal slide — tile flip is the transition */
@media (max-width: 1100px) {
  .board-track {
    transition: none;
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   STORIES SECTION — persistent thread browser in topic strip
   ══════════════════════════════════════════════════════════════════════════ */

.stories-toggle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  margin-left: auto;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.stories-toggle.active {
  border-color: var(--coal);
  background: var(--coal);
  color: rgba(255, 253, 248, 0.92);
}

.stories-toggle::after {
  content: "›";
  display: inline-block;
  transform: rotate(90deg);
  font-size: 14px;
  line-height: 1;
  transition: transform 200ms ease;
}

.stories-toggle.active::after {
  transform: rotate(270deg);
}

.stories-section {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 28px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--coal) 4%, var(--paper));
  scrollbar-width: none;
}

.stories-section::-webkit-scrollbar { display: none; }

.thread-story-button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.thread-story-button[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--thread-color) 36%, var(--line));
  background: color-mix(in srgb, var(--thread-color) 8%, var(--sheet));
  color: var(--ink);
}

.thread-story-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--thread-color, var(--muted));
}

@media (max-width: 720px) {
  .stories-section {
    padding-inline: 18px;
    gap: 8px;
  }

  .stories-toggle {
    font-size: 10px;
    padding: 0 10px;
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   INLINE CHAIN — connection context strip below topic bar
   ══════════════════════════════════════════════════════════════════════════ */

.inline-chain-container {
  padding: 14px 28px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--coal) 3%, var(--paper));
}

.inline-chain-container .chain-strip-label {
  margin-bottom: 10px;
}

.inline-chain-container .chain-cards {
  gap: 6px;
}

.inline-chain-container .chain-card {
  min-width: 140px;
  padding: 9px 11px;
}

@media (max-width: 720px) {
  .inline-chain-container {
    padding-inline: 18px;
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   ICON CONTROL — compact save/pin buttons in board bar
   ══════════════════════════════════════════════════════════════════════════ */

.icon-control {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.icon-control:hover {
  border-color: var(--line);
  color: var(--ink);
}

.icon-control.active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--sheet);
}

.icon-control:disabled {
  opacity: 0.3;
  cursor: default;
}

/* ── Tile actions always visible on touch devices ─────────────────────── */

@media (hover: none) {
  .tile-actions {
    opacity: 1;
  }
}

/* ── Weave mode uses arrows to move the focused signal ────────────────── */

[data-mode="weave"] .board-controls .round-control {
  opacity: 0.65;
}

/* ── Mobile board controls: full-width with even spacing ──────────────── */

@media (max-width: 720px) {
  .board-controls {
    width: 100%;
    justify-content: space-between;
    gap: 4px;
  }

  .pill-control {
    flex: 1;
    max-width: 140px;
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   SIGNAL WEAVE VIEW
   ══════════════════════════════════════════════════════════════════════════ */

.signal-weave-view {
  width: 100%;
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.92);
  padding: 16px;
}

[data-mode="weave"] .board-column {
  grid-template-rows: auto auto auto;
}

[data-mode="weave"] .tile-board {
  height: auto;
  min-height: 0;
  overflow: visible;
  perspective: none;
  touch-action: auto;
}

.weave-focus {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(260px, 1.2fr) minmax(0, 0.9fr);
  gap: 12px;
  align-items: stretch;
}

.weave-column,
.weave-parallel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.weave-column-label {
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.weave-current {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 260px;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--topic-color) 34%, var(--line));
  border-top: 4px solid var(--topic-color);
  border-radius: var(--radius);
  background: var(--sheet);
  box-shadow: 0 12px 32px rgba(16, 17, 15, 0.1);
}

.weave-current strong {
  color: var(--topic-color);
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 4.4rem);
  line-height: 0.95;
}

.weave-current h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3vw, 2.35rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.weave-current p {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
}

.weave-current .pill-control {
  align-self: flex-start;
  margin-top: auto;
}

.weave-relation-card,
.weave-step {
  appearance: none;
  min-width: 0;
  border: 1px solid var(--line);
  border-left: 4px solid var(--topic-color);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.78);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: opacity 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.weave-relation-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 9px;
  min-height: 76px;
  padding: 10px;
}

.weave-relation-card span,
.weave-step-topic {
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 10px;
  font-style: normal;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.weave-relation-card strong,
.weave-step strong {
  color: var(--topic-color);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1;
}

.weave-relation-card em,
.weave-step em {
  grid-column: 1 / -1;
  display: -webkit-box;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-style: normal;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.weave-empty {
  min-height: 76px;
  margin: 0;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.weave-parallel {
  padding-top: 2px;
}

.weave-parallel-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.weave-stories {
  display: grid;
  gap: 10px;
}

.weave-story {
  display: grid;
  grid-template-columns: minmax(170px, 0.34fr) minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(244, 241, 234, 0.58);
}

.weave-story.current {
  border-color: color-mix(in srgb, var(--thread-color) 44%, var(--line));
  background: rgba(255, 253, 248, 0.82);
}

.weave-story-heading {
  display: flex;
  gap: 10px;
  min-width: 0;
}

.weave-story-heading > span {
  width: 4px;
  min-height: 100%;
  border-radius: 999px;
  background: var(--thread-color);
}

.weave-story-heading h3 {
  margin: 0 0 4px;
  font-size: 14px;
  line-height: 1.2;
}

.weave-story-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.weave-step-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
}

.weave-step {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 4px 7px;
  min-height: 92px;
  padding: 9px;
}

.weave-step.active {
  border-color: var(--topic-color);
  box-shadow: inset 0 0 0 1px var(--topic-color), 0 8px 20px rgba(16, 17, 15, 0.08);
}

.weave-step-index {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--topic-color);
  color: var(--sheet);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 800;
}

.signal-weave-view.is-hovering .hover-dimmed {
  opacity: 0.28;
}

.weave-signal.hover-focus,
.weave-signal.hover-connected,
.weave-signal.hover-thread {
  border-color: var(--topic-color);
}

.weave-signal.hover-focus {
  transform: translateY(-2px);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--topic-color) 40%, transparent),
              0 12px 28px rgba(16, 17, 15, 0.12);
}

.weave-signal.hover-connected {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--topic-color) 28%, transparent);
}

@media (max-width: 1100px) {
  .weave-focus {
    grid-template-columns: 1fr;
  }

  .weave-current {
    min-height: 0;
  }

  .weave-parallel-list,
  .weave-story {
    grid-template-columns: 1fr;
  }

  .weave-step-row {
    display: flex;
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }

  .weave-step {
    flex: 0 0 210px;
  }
}

@media (max-width: 720px) {
  .signal-weave-view {
    padding: 10px;
  }

  .weave-current {
    padding: 14px;
  }

  .weave-current h2 {
    font-size: 1.45rem;
  }

  .weave-parallel-list {
    grid-template-columns: 1fr;
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   COLLECTIONS PANEL + TOGGLE
   ══════════════════════════════════════════════════════════════════════════ */

.collections-toggle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.collections-toggle:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.collections-toggle.active {
  border-color: var(--coal);
  background: var(--coal);
  color: rgba(255, 253, 248, 0.92);
}

.collections-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 180;
  width: min(380px, 90vw);
  display: flex;
  flex-direction: column;
  background: var(--sheet);
  border-left: 1px solid var(--line);
  box-shadow: -12px 0 48px rgba(16, 17, 15, 0.14);
  transform: translateX(100%);
  transition: transform 300ms cubic-bezier(0.22, 0.72, 0.1, 1);
}

.collections-panel.open {
  transform: translateX(0);
}

.collections-backdrop {
  position: fixed;
  inset: 0;
  z-index: 170;
  background: rgba(16, 17, 15, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}

.collections-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

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

.collections-header strong {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.collections-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease;
}

.collections-close:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.collections-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.collection-item {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.collection-item:hover {
  border-color: color-mix(in srgb, var(--ink) 22%, var(--line));
  box-shadow: 0 4px 14px rgba(16,17,15,0.07);
}

.collection-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.collection-item-header strong {
  font-size: 14px;
  font-weight: 660;
  letter-spacing: -0.01em;
}

.collection-item-count {
  color: var(--muted);
  font-size: 11px;
  font-weight: 680;
  letter-spacing: 0.07em;
  flex-shrink: 0;
}

.collection-item-previews {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.collection-preview-chip {
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 640;
  white-space: nowrap;
}

.collection-item-actions {
  display: flex;
  gap: 7px;
  margin-top: 2px;
}

.collection-action-btn {
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 640;
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease;
}

.collection-action-btn:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.collection-action-btn.danger:hover {
  border-color: var(--alert);
  color: var(--alert);
}

.collections-new-btn {
  margin: 0 22px 22px;
  min-height: 42px;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}

.collections-new-btn:hover {
  border-color: var(--ink);
  background: rgba(20, 20, 17, 0.03);
  color: var(--ink);
}

.empty-collections {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  padding: 32px 0;
  line-height: 1.6;
}

/* ══════════════════════════════════════════════════════════════════════════
   ASK INTUNE.AI — floating orb + side panel / bottom sheet
   ══════════════════════════════════════════════════════════════════════════ */

.ask-orb {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 200;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, #32364a 0%, #0f1117 100%);
  color: rgba(255, 253, 248, 0.92);
  font-size: 19px;
  cursor: pointer;
  box-shadow:
    0 0 0 1px rgba(255,253,248,0.07) inset,
    0 8px 28px rgba(15, 17, 23, 0.45),
    0 2px 8px rgba(15, 17, 23, 0.3);
  transition: transform 220ms ease, box-shadow 220ms ease, background 220ms ease;
  animation: orbIdlePulse 4s ease-in-out infinite;
}

@keyframes orbIdlePulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(255,253,248,0.07) inset, 0 8px 28px rgba(15,17,23,0.45), 0 0 0 0 rgba(109,138,245,0); }
  50%       { box-shadow: 0 0 0 1px rgba(255,253,248,0.07) inset, 0 8px 28px rgba(15,17,23,0.45), 0 0 0 9px rgba(109,138,245,0); }
}

.ask-orb:hover {
  transform: scale(1.1);
  background: radial-gradient(circle at 36% 30%, #4a4f68 0%, #1a1d2e 100%);
  animation: none;
}

.ask-orb.active {
  transform: scale(0.93);
  animation: none;
}

.ask-orb-glyph {
  display: inline-block;
  animation: glyphSpin 10s linear infinite;
}

@keyframes glyphSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Panel */
.ask-panel {
  position: fixed;
  z-index: 190;
  background: #0f1117;
  color: rgba(255, 253, 248, 0.92);
}

/* Desktop: right side panel */
@media (min-width: 721px) {
  .ask-panel {
    top: 0;
    right: 0;
    bottom: 0;
    width: min(420px, 88vw);
    border-left: 1px solid rgba(255, 253, 248, 0.08);
    transform: translateX(100%);
    transition: transform 320ms cubic-bezier(0.22, 0.72, 0.1, 1);
  }
  .ask-panel.open {
    transform: translateX(0);
  }
}

/* Mobile: bottom sheet */
@media (max-width: 720px) {
  .ask-panel {
    left: 0;
    right: 0;
    bottom: 0;
    height: 72dvh;
    border-radius: 16px 16px 0 0;
    border-top: 1px solid rgba(255, 253, 248, 0.08);
    transform: translateY(100%);
    transition: transform 320ms cubic-bezier(0.22, 0.72, 0.1, 1);
  }
  .ask-panel.open {
    transform: translateY(0);
  }
}

.ask-panel-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.ask-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 253, 248, 0.07);
  flex-shrink: 0;
}

.ask-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ask-brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #8fa8ff, #4d6ef5);
  box-shadow: 0 0 8px rgba(109,138,245,0.6);
  animation: brandDotPulse 2.4s ease-in-out infinite;
}

@keyframes brandDotPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(0.82); opacity: 0.7; }
}

.ask-brand strong {
  color: rgba(255, 253, 248, 0.92);
  font-size: 14px;
  font-weight: 660;
  letter-spacing: -0.01em;
}

.ask-close {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 253, 248, 0.14);
  border-radius: 50%;
  background: transparent;
  color: rgba(255, 253, 248, 0.44);
  font-size: 17px;
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease;
}

.ask-close:hover {
  border-color: rgba(255, 253, 248, 0.3);
  color: rgba(255, 253, 248, 0.88);
}

.ask-context {
  padding: 11px 20px;
  border-bottom: 1px solid rgba(255, 253, 248, 0.05);
  color: rgba(255, 253, 248, 0.52);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.5;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ask-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,253,248,0.08) transparent;
}

.ask-msg {
  display: grid;
  gap: 5px;
  max-width: 90%;
}

.ask-msg.user { align-self: flex-end; }
.ask-msg.ai   { align-self: flex-start; }

.ask-msg-label {
  font-size: 10px;
  font-weight: 680;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.36;
  padding: 0 4px;
}

.ask-msg.user .ask-msg-label { text-align: right; }

.ask-msg-bubble {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.54;
  white-space: pre-line;
}

.ask-msg.user .ask-msg-bubble {
  background: rgba(255, 253, 248, 0.1);
  color: rgba(255, 253, 248, 0.84);
  border-radius: 12px 2px 12px 12px;
}

.ask-msg.ai .ask-msg-bubble {
  background: rgba(109, 138, 245, 0.1);
  border: 1px solid rgba(109, 138, 245, 0.18);
  color: rgba(255, 253, 248, 0.88);
  border-radius: 2px 12px 12px 12px;
}

.ask-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 10px 20px 12px;
  flex-shrink: 0;
}

.ask-chip {
  padding: 5px 12px;
  border: 1px solid rgba(255, 253, 248, 0.13);
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 253, 248, 0.58);
  font-size: 12px;
  font-weight: 540;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 130ms ease, background 130ms ease, color 130ms ease;
}

.ask-chip:hover {
  border-color: rgba(255, 253, 248, 0.28);
  background: rgba(255, 253, 248, 0.05);
  color: rgba(255, 253, 248, 0.88);
}

.ask-input-row {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 12px 20px 18px;
  border-top: 1px solid rgba(255, 253, 248, 0.07);
  flex-shrink: 0;
}

#askInput {
  flex: 1;
  min-width: 0;
  padding: 9px 14px;
  border: 1px solid rgba(255, 253, 248, 0.13);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.05);
  color: rgba(255, 253, 248, 0.88);
  font-size: 14px;
  outline: none;
  transition: border-color 140ms ease, background 140ms ease;
}

#askInput::placeholder {
  color: rgba(255, 253, 248, 0.26);
}

#askInput:focus {
  border-color: rgba(109, 138, 245, 0.38);
  background: rgba(255, 253, 248, 0.07);
}

.ask-send {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border: 0;
  border-radius: 50%;
  background: #4d6ef5;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  transition: background 130ms ease, transform 120ms ease;
}

.ask-send:hover {
  background: #6382f7;
  transform: scale(1.06);
}

.ask-send:disabled {
  opacity: 0.36;
  cursor: default;
  transform: none;
}

/* ── Wordmark .AI emphasis ──────────────────────────────────────────────── */

.wordmark strong {
  font-style: italic;
  letter-spacing: -0.02em;
  color: var(--ink);
}

/* ── Tile action: add to collection ───────────────────────────────────── */

.tile-action[data-collect] {
  font-size: 14px;
  font-weight: 300;
}

/* ── Detail sheet: actions row ────────────────────────────────────────── */

.detail-actions-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.detail-actions-row .pill-control {
  font-size: 13px;
  color: var(--muted);
  border-color: var(--line);
  background: var(--paper);
  min-height: 36px;
}

.detail-actions-row .pill-control:hover {
  border-color: var(--ink);
  color: var(--ink);
}

/* ── Collections panel: mobile adjustments ─────────────────────────────── */

@media (max-width: 720px) {
  .collections-panel {
    width: 100%;
    top: auto;
    right: 0;
    left: 0;
    bottom: 0;
    height: 80dvh;
    border-radius: 16px 16px 0 0;
    border-left: 0;
    border-top: 1px solid var(--line);
    transform: translateY(100%);
  }

  .collections-panel.open {
    transform: translateY(0);
  }

  .ask-orb {
    right: 16px;
    bottom: 16px;
  }
}

/* Content refresh guardrails: newer insight titles are longer than the
   original oncology-launch placeholders, so phone pages use a single-column
   tile stack and aggressive wrapping to avoid right-edge clipping. */
@media (max-width: 720px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .flip-app,
  .masthead,
  .topic-strip,
  .stories-section,
  .inline-chain-container,
  .experience,
  .board-column,
  .tile-board,
  .board-track,
  .board-page,
  .tile {
    max-width: 100%;
    min-width: 0;
  }

  .flip-app,
  .experience,
  .board-column {
    width: 100%;
  }

  .board-column {
    padding-inline: 18px;
  }

  .tile-board,
  .board-track,
  .board-page {
    width: calc(100vw - 36px) !important;
  }

  .tile-board,
  .board-track,
  .board-page {
    overflow-x: hidden;
  }

  .board-track,
  .board-page {
    width: 100%;
  }

  .board-page {
    flex: 0 0 calc(100vw - 36px);
    grid-template-columns: minmax(0, 1fr);
  }

  .tile.hero,
  .tile.wide,
  .tile.tall,
  .tile.medium,
  .tile.small {
    grid-column: 1 / -1;
  }

  .tile h2,
  .tile.hero h2,
  .tile p {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .tile h2,
  .tile.hero h2 {
    display: block;
    overflow: visible;
    max-width: 14ch !important;
    white-space: normal;
    word-break: break-word;
    line-break: anywhere;
  }
}

/* Decision intelligence refresh */
:root {
  --paper: #f7f5ef;
  --sheet: #fffefa;
  --ink: #11120f;
  --muted: #6f7069;
  --line: #d8d1c4;
  --soft: #ebe6dc;
  --accent: #d76a1f;
}

.masthead,
.topic-strip {
  background: rgba(247, 245, 239, 0.92);
  backdrop-filter: blur(14px);
}

.desk-panel {
  background: color-mix(in srgb, var(--paper) 82%, #ffffff);
}

.panel-block {
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(17, 18, 15, 0.08);
}

.panel-block:last-child {
  border-bottom: 0;
}

.panel-heading span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tile {
  border-color: rgba(17, 18, 15, 0.12);
  border-radius: 8px;
  background: var(--sheet);
  box-shadow: 0 1px 2px rgba(16, 17, 15, 0.04);
}

.tile:hover,
.tile:focus-visible {
  box-shadow: 0 2px 8px rgba(16, 17, 15, 0.1);
}

.tile.is-active {
  border-color: color-mix(in srgb, var(--topic-color) 50%, var(--ink));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--topic-color) 45%, transparent);
}

.tile::before {
  width: 4px;
}

.tile h2 {
  font-family: var(--font-ui);
  font-size: clamp(1.25rem, 2vw, 2rem);
  font-weight: 760;
  letter-spacing: -0.035em;
  line-height: 1.06;
}

.tile.hero h2 {
  max-width: 18ch;
  font-size: clamp(2rem, 3.3vw, 3.15rem);
  line-height: 0.98;
}

.tile p {
  color: #333630;
  line-height: 1.5;
}

.tile-kicker,
.tile-meta,
.tile-exec-line {
  letter-spacing: 0.08em;
}

.tile-actions {
  opacity: 1;
  right: 10px;
  bottom: 10px;
}

.tile-action,
.icon-control,
.round-control,
.pill-control {
  border-color: rgba(17, 18, 15, 0.16);
  background: rgba(255, 254, 250, 0.88);
}

.tile-action:hover,
.icon-control:hover,
.round-control:hover,
.pill-control:hover {
  border-color: var(--ink);
}

.tile-action.active,
.icon-control.active,
.pill-control.active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--sheet);
}

.decision-capsule {
  display: grid;
  gap: 7px;
  margin-top: 14px;
  padding: 11px 12px;
  border: 1px solid rgba(17, 18, 15, 0.1);
  border-radius: 7px;
  background: #fffaf2;
}

.decision-capsule[data-posture="upside"] {
  background: #f4fbf5;
}

.decision-capsule[data-posture="monitor"] {
  background: #faf9f5;
}

.decision-capsule-head,
.decision-capsule-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.decision-capsule-head span {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 760;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.decision-capsule-head strong {
  color: var(--accent);
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 820;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.decision-capsule[data-posture="upside"] .decision-capsule-head strong {
  color: #1a6b3c;
}

.decision-capsule p {
  display: block;
  margin: 0;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 720;
  line-height: 1.35;
  -webkit-line-clamp: unset;
}

.decision-capsule-meta {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.decision-capsule-meta span {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.2;
}

.decision-capsule-meta span + span::before {
  margin-right: 8px;
  color: rgba(17, 18, 15, 0.26);
  content: "/";
}

.tile:not(.hero) .decision-capsule {
  padding: 9px 10px;
}

.tile:not(.hero) .decision-capsule p {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.tile.small .decision-capsule,
.tile.small .tile-exec-line {
  display: none;
}

.detail-sheet {
  border: 1px solid rgba(255, 253, 248, 0.38);
  border-radius: 10px;
}

.detail-hero h2 {
  font-family: var(--font-ui);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.detail-capsule {
  margin-top: 22px;
  max-width: 760px;
}

.detail-actions-row {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin: 28px -8px -8px;
  padding: 14px 8px 8px;
  background: linear-gradient(180deg, rgba(255, 254, 250, 0), var(--sheet) 28%);
}

.package-panel > strong {
  font-family: var(--font-ui);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.package-queue-button {
  position: relative;
  padding-left: 34px;
}

.package-queue-button em {
  position: absolute;
  top: 2px;
  left: 0;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--sheet);
  font-size: 11px;
  font-style: normal;
  font-weight: 820;
}

.agent-work-panel {
  gap: 12px;
}

.agent-work-list {
  display: grid;
  gap: 10px;
}

.agent-work-item {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px 0 0;
  border-top: 1px solid rgba(17, 18, 15, 0.07);
}

.agent-work-dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--muted);
}

.agent-work-item.done .agent-work-dot {
  background: #1a6b3c;
}

.agent-work-item.review .agent-work-dot {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(215, 106, 31, 0.13);
}

.agent-work-item strong {
  display: block;
  margin-bottom: 2px;
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.agent-work-item span {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.42;
}

.agent-work-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.agent-work-actions button {
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid rgba(17, 18, 15, 0.14);
  border-radius: 999px;
  background: var(--sheet);
  color: var(--ink);
  font-size: 10.5px;
  font-weight: 760;
}

.agent-work-actions button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

@media (max-width: 1100px) {
  .agent-work-panel,
  .package-panel {
    display: none;
  }
}

@media (max-width: 720px) {
  .decision-capsule {
    margin-top: 10px;
  }

  .board-controls {
    flex-wrap: wrap;
  }
}

/* Ask Intune color alignment: warm signal-room palette, no blue layer */
.ask-orb {
  background: radial-gradient(circle at 34% 30%, #f6a968 0%, var(--accent) 52%, #9f4616 100%);
  color: var(--sheet);
  box-shadow:
    0 0 0 1px rgba(255,254,250,0.44) inset,
    0 8px 24px rgba(17, 18, 15, 0.22),
    0 0 0 0 rgba(215, 106, 31, 0);
}

@keyframes orbIdlePulse {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(255,254,250,0.44) inset,
      0 8px 24px rgba(17, 18, 15, 0.22),
      0 0 0 0 rgba(215, 106, 31, 0);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(255,254,250,0.44) inset,
      0 8px 24px rgba(17, 18, 15, 0.22),
      0 0 0 9px rgba(215, 106, 31, 0.08);
  }
}

.ask-orb:hover {
  background: radial-gradient(circle at 34% 30%, #ffc08a 0%, #e7792b 52%, var(--accent) 100%);
}

.ask-panel {
  background: var(--sheet);
  color: var(--ink);
  box-shadow: -22px 0 70px rgba(17, 18, 15, 0.18);
}

@media (min-width: 721px) {
  .ask-panel {
    border-left: 1px solid rgba(17, 18, 15, 0.14);
  }
}

@media (max-width: 720px) {
  .ask-panel {
    border-top: 1px solid rgba(17, 18, 15, 0.14);
  }
}

.ask-header,
.ask-context,
.ask-input-row {
  border-color: rgba(17, 18, 15, 0.09);
}

.ask-header {
  background: color-mix(in srgb, var(--paper) 72%, #ffffff);
}

.ask-brand-dot {
  background: radial-gradient(circle at 35% 28%, #f6a968, var(--accent));
  box-shadow: 0 0 0 4px rgba(215, 106, 31, 0.12);
}

.ask-brand strong {
  color: var(--ink);
}

.ask-close {
  border-color: rgba(17, 18, 15, 0.14);
  color: var(--muted);
  background: rgba(255, 254, 250, 0.72);
}

.ask-close:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.ask-context {
  background: #fbf8f0;
  color: var(--muted);
}

.ask-messages {
  background:
    linear-gradient(180deg, rgba(247,245,239,0.66), rgba(255,254,250,0.92));
  scrollbar-color: rgba(17,18,15,0.18) transparent;
}

.ask-msg-label {
  color: var(--muted);
  opacity: 1;
}

.ask-msg-bubble {
  border: 1px solid rgba(17, 18, 15, 0.1);
}

.ask-msg.user .ask-msg-bubble {
  background: var(--ink);
  color: var(--sheet);
}

.ask-msg.ai .ask-msg-bubble {
  background: #fff8ee;
  border-color: rgba(215, 106, 31, 0.2);
  color: var(--ink);
}

.ask-chips {
  background: var(--sheet);
  border-top: 1px solid rgba(17, 18, 15, 0.07);
}

.ask-chip {
  border-color: rgba(17, 18, 15, 0.14);
  background: #fbf8f0;
  color: var(--muted);
}

.ask-chip:hover {
  border-color: var(--accent);
  background: #fff2e5;
  color: #9f4616;
}

#askInput {
  border-color: rgba(17, 18, 15, 0.14);
  background: #fffefa;
  color: var(--ink);
}

#askInput::placeholder {
  color: color-mix(in srgb, var(--muted) 58%, transparent);
}

#askInput:focus {
  border-color: var(--accent);
  background: #fffaf2;
}

.ask-send {
  background: var(--accent);
  color: var(--sheet);
}

.ask-send:hover {
  background: #b85319;
}

/* Full modern polish pass */
:root {
  --font-display: var(--font-ui);
}

.wordmark span {
  font-family: Georgia, "Times New Roman", serif;
}

.edition-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 28px;
  border-bottom: 1px solid rgba(17, 18, 15, 0.09);
  background: #fffaf2;
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}

.edition-bar span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.edition-bar span + span::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(17, 18, 15, 0.28);
}

.edition-bar span:first-child {
  color: var(--ink);
  font-weight: 820;
}

.edition-command {
  margin-left: auto;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid rgba(17, 18, 15, 0.14);
  border-radius: 999px;
  background: var(--sheet);
  color: var(--ink);
  font-size: 11px;
  font-weight: 760;
}

.experience {
  min-height: calc(100vh - 168px);
}

.desk-panel {
  gap: 20px;
  padding-top: 24px;
}

.panel-block {
  position: relative;
}

.panel-block > .eyebrow,
.panel-heading .eyebrow {
  color: #4f514b;
}

.panel-pulse::after,
.package-panel::after {
  content: "";
  display: block;
  height: 4px;
  margin-top: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), rgba(215, 106, 31, 0.2));
}

.package-panel::after {
  background: linear-gradient(90deg, var(--ink), rgba(17, 18, 15, 0.12));
}

.package-preview-button {
  min-height: 30px;
  border: 1px solid rgba(17, 18, 15, 0.15);
  border-radius: 999px;
  background: var(--ink);
  color: var(--sheet);
  font-size: 11px;
  font-weight: 760;
}

.tile {
  align-content: start;
  gap: 12px;
}

.tile.is-active {
  transform: translateY(-3px) scale(1.012);
  z-index: 4;
  background: #fffdfa;
}

.tile.conn-source {
  box-shadow: 0 0 0 1px var(--topic-color), 0 4px 18px rgba(16, 17, 15, 0.12);
  transform: translateY(-3px) scale(1.012);
}

.tile.conn-target {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--topic-color) 32%, transparent),
              0 3px 14px rgba(16, 17, 15, 0.08);
}

.tile.conn-dimmed {
  opacity: 0.58;
  filter: saturate(0.82);
}

.tile h2,
.tile.hero h2 {
  max-width: none;
}

.tile p {
  -webkit-line-clamp: 2;
}

.tile.hero p {
  max-width: 58ch;
  -webkit-line-clamp: 2;
}

.decision-capsule {
  min-height: 116px;
}

.tile:not(.hero) .decision-capsule {
  min-height: 106px;
}

.agent-stamp,
.decision-callout {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  gap: 6px;
  min-height: 23px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 780;
  letter-spacing: 0.06em;
  line-height: 21px;
  text-transform: uppercase;
}

.agent-stamp {
  border: 1px solid rgba(17, 18, 15, 0.1);
  background: #faf7ef;
  color: var(--muted);
}

.agent-stamp::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1a6b3c;
}

.decision-callout {
  margin-top: 7px;
  background: #fff0e3;
  color: #9f4616;
}

.decision-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 3px;
}

.decision-reactions button,
.suggested-next-card button,
.preview-slide button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.decision-reactions button {
  min-height: 25px;
  padding: 4px 8px;
  border: 1px solid rgba(17, 18, 15, 0.12);
  border-radius: 999px;
  background: var(--sheet);
  color: var(--ink);
  font-size: 10.5px;
  font-weight: 760;
}

.decision-reactions button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.tile-action svg,
.icon-control svg,
.round-control svg,
.ask-send svg,
.close-control svg,
.ask-close svg,
.collections-close svg,
.package-preview-close svg {
  width: 16px;
  height: 16px;
}

.round-control,
.icon-control {
  display: inline-grid;
  place-items: center;
}

.round-control svg {
  width: 22px;
  height: 22px;
}

.detail-actions-row .pill-control {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.suggested-next-card {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(17, 18, 15, 0.12);
  border-left: 4px solid var(--topic-color);
  border-radius: 8px;
  background: #fffaf2;
}

.suggested-next-card span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 780;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.suggested-next-card strong {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.25;
}

.suggested-next-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.suggested-next-card button {
  width: fit-content;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(17, 18, 15, 0.14);
  border-radius: 999px;
  background: var(--sheet);
  color: var(--ink);
  font-size: 12px;
  font-weight: 760;
}

.detail-dialog.from-tile .detail-sheet {
  transform-origin: var(--origin-x, 50vw) var(--origin-y, 50vh);
  animation: detailFromTile 220ms ease-out;
}

@keyframes detailFromTile {
  from {
    opacity: 0;
    transform: scale(0.965) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.activity-timeline {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(17, 18, 15, 0.08);
}

.activity-timeline div {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.activity-timeline time {
  color: var(--ink);
  font-weight: 780;
}

.package-preview-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 230;
  width: min(420px, 92vw);
  border-left: 1px solid rgba(17, 18, 15, 0.14);
  background: var(--sheet);
  box-shadow: -24px 0 80px rgba(17, 18, 15, 0.2);
  transform: translateX(100%);
  transition: transform 260ms ease;
}

.package-preview-panel.open {
  transform: translateX(0);
}

.package-preview-backdrop {
  position: fixed;
  inset: 0;
  z-index: 220;
  background: rgba(17, 18, 15, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.package-preview-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

.package-preview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 20px;
  border-bottom: 1px solid rgba(17, 18, 15, 0.09);
  background: #fffaf2;
}

.package-preview-header span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 780;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.package-preview-header strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.2;
}

.package-preview-close {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(17, 18, 15, 0.14);
  border-radius: 50%;
  background: var(--sheet);
  color: var(--ink);
}

.package-preview-body {
  display: grid;
  gap: 12px;
  padding: 16px;
  overflow-y: auto;
  max-height: calc(100dvh - 82px);
}

.preview-slide,
.package-preview-empty {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(17, 18, 15, 0.1);
  border-left: 4px solid var(--topic-color, var(--accent));
  border-radius: 8px;
  background: #fffefa;
}

.preview-slide span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 780;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.preview-slide strong,
.package-preview-empty strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.3;
}

.preview-slide p,
.package-preview-empty span {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.command-palette {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: grid;
  place-items: start center;
  padding-top: 12vh;
  background: rgba(17, 18, 15, 0.34);
}

.command-palette[hidden] {
  display: none;
}

.command-shell {
  width: min(620px, calc(100vw - 32px));
  overflow: hidden;
  border: 1px solid rgba(17, 18, 15, 0.14);
  border-radius: 10px;
  background: var(--sheet);
  box-shadow: 0 30px 90px rgba(17, 18, 15, 0.24);
}

.command-input-wrap {
  display: grid;
  grid-template-columns: 92px 1fr;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(17, 18, 15, 0.08);
}

.command-input-wrap span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 780;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

#commandInput {
  min-height: 34px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
}

.command-results {
  display: grid;
  max-height: 340px;
  overflow-y: auto;
  padding: 8px;
}

.command-results button {
  display: grid;
  gap: 3px;
  padding: 11px 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  text-align: left;
}

.command-results button:hover,
.command-results button[aria-selected="true"] {
  background: #fff2e5;
}

.command-results strong {
  color: var(--ink);
  font-size: 13px;
}

.command-results span {
  color: var(--muted);
  font-size: 12px;
}

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 88px;
  z-index: 270;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast {
  max-width: 320px;
  padding: 10px 13px;
  border: 1px solid rgba(255, 254, 250, 0.12);
  border-radius: 999px;
  background: var(--ink);
  color: var(--sheet);
  font-size: 12.5px;
  font-weight: 720;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
  box-shadow: 0 12px 34px rgba(17, 18, 15, 0.22);
}

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

.link-preview {
  position: fixed;
  z-index: 240;
  display: grid;
  gap: 5px;
  width: 260px;
  padding: 11px 12px;
  border: 1px solid rgba(17, 18, 15, 0.14);
  border-radius: 8px;
  background: var(--sheet);
  box-shadow: 0 14px 40px rgba(17, 18, 15, 0.18);
  pointer-events: none;
}

.link-preview strong {
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.3;
}

.link-preview span {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.35;
}

@media (max-width: 900px) {
  .edition-bar {
    overflow-x: auto;
  }
}

@media (max-width: 720px) {
  .edition-bar {
    padding-inline: 18px;
  }

  .package-preview-panel {
    top: auto;
    left: 0;
    width: 100%;
    height: 82dvh;
    border-left: 0;
    border-top: 1px solid rgba(17, 18, 15, 0.14);
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
  }

  .package-preview-panel.open {
    transform: translateY(0);
  }

  .toast-stack {
    right: 12px;
    left: 12px;
    bottom: 78px;
  }
}
