/* folio — Emil Kowalski skin
   A typesetter's desk, not a dashboard. Light paper. Hairline rules.
   Motion only where it explains a change. */

:root {
  --bg: #f4f3ef;
  --paper: #faf9f6;
  --ink: #161412;
  --muted: #5c574f;
  --faint: #8a8478;
  --line: rgba(22, 20, 18, 0.1);
  --line-strong: rgba(22, 20, 18, 0.18);
  --highlight: rgba(255, 255, 255, 0.55);
  --scrim: rgba(22, 20, 18, 0.28);
  --caution: #9f1239;
  --caution-bg: #fde8ec;
  --safe: #5c574f;
  --text-dim: #8a8478;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

  --dur-press: 160ms;
  --dur-tip: 125ms;
  --dur-ui: 200ms;
  --dur-sheet: 400ms;

  --r-control: 4px;
  --gutter: 23.5rem;

  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --sans: "Source Sans 3", ui-sans-serif, system-ui, sans-serif;
  --mono: "Source Code Pro", ui-monospace, "SF Mono", Menlo, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  background: var(--bg);
}

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-optical-sizing: auto;
  line-height: 1.5;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: #ddd8cc;
  color: var(--ink);
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

button,
textarea {
  font: inherit;
  color: inherit;
}

button {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

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

/* Press lives on pointer-down. Keyboard activation must not scale. */
.starter,
.filter-btn,
.btn-ctrl,
.btn-ghost,
.btn-primary,
.btn-audio,
.btn-hold,
.skin-bar a,
.history-item-del,
.drawer-head button,
.drawer-footer button {
  transition:
    transform var(--dur-press) var(--ease-out),
    background-color 150ms ease,
    color 150ms ease,
    border-color 150ms ease,
    opacity 150ms ease;
}

.starter:active,
.filter-btn:active,
.btn-ctrl:active,
.btn-ghost:active,
.btn-primary:active,
.btn-audio:active,
.btn-hold:active,
.history-item-del:active,
.drawer-head button:active,
.drawer-footer button:active {
  transform: scale(0.97);
}

.starter:focus-visible:active,
.filter-btn:focus-visible:active,
.btn-ctrl:focus-visible:active,
.btn-ghost:focus-visible:active,
.btn-primary:focus-visible:active,
.btn-audio:focus-visible:active,
.btn-hold:focus-visible:active,
.skin-bar a:focus-visible:active,
.history-item-del:focus-visible:active,
.drawer-head button:focus-visible:active,
.drawer-footer button:focus-visible:active {
  transform: none;
}

/* ── Skin gallery ── */
.skin-bar {
  position: sticky;
  top: 0;
  z-index: 80;
  display: flex;
  flex-wrap: wrap;
  gap: 0.1rem;
  align-items: center;
  padding: 0.4rem 1rem;
  font-size: 0.6875rem;
  letter-spacing: 0.02em;
  line-height: 1.3;
  background: rgba(244, 243, 239, 0.78);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--line);
}

.skin-bar a {
  color: var(--faint);
  text-decoration: none;
  padding: 0.22rem 0.42rem;
  border-radius: var(--r-control);
}

.skin-bar a[aria-current="page"] {
  color: var(--ink);
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

@media (hover: hover) and (pointer: fine) {
  .skin-bar a:hover {
    color: var(--ink);
  }
}

/* ── Desk ── */
.desk {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 2.4rem);
}

.mast {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 1.15rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.brand-mark {
  display: inline-flex;
  color: var(--ink);
  line-height: 0;
}

.wordmark {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.375rem;
  font-weight: 500;
  font-optical-sizing: auto;
  line-height: 1;
  letter-spacing: -0.035em;
}

.mast-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.45rem;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

/* ── Spread: gutter + field ── */
.spread {
  display: grid;
  grid-template-columns: minmax(18rem, var(--gutter)) minmax(0, 1fr);
  flex: 1 1 auto;
  min-height: 28rem;
  border-bottom: 1px solid var(--line);
}

.gutter {
  display: flex;
  flex-direction: column;
  padding: 1rem 1.15rem 1.1rem;
  border-right: 1px solid var(--line);
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 27px,
      rgba(22, 20, 18, 0.035) 27px,
      rgba(22, 20, 18, 0.035) 28px
    );
  background-attachment: local;
}

.gutter-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
}

.gutter-head h2,
.field-bar h2,
.reading-head h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.gutter-meta,
.meta,
#historyLinkStatus,
#safetyIndicator {
  color: var(--faint);
  font-size: 0.6875rem;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.gutter-meta {
  display: flex;
  gap: 0.55rem;
  align-items: center;
}

.safe-badge {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--safe);
}

.safety-alert {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--caution);
}

/* Safety: occasional. Scale from 0.97, never 0. Center origin — not trigger-anchored. */
.safety-banner {
  display: none;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.6rem 0.7rem;
  margin-bottom: 0.75rem;
  border: 1px solid rgba(159, 18, 57, 0.28);
  background: var(--caution-bg);
  color: #4c0519;
  font-size: 0.8125rem;
  line-height: 1.4;
  transform-origin: center;
  opacity: 1;
  transform: scale(1);
  transition:
    opacity var(--dur-ui) var(--ease-out),
    transform var(--dur-ui) var(--ease-out);
}

.safety-banner.caution {
  display: flex;
}

@starting-style {
  .safety-banner.caution {
    opacity: 0;
    transform: scale(0.97);
  }
}

/* First lines — a contents list, not chips */
.starters {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0 0 0.85rem;
}

.starter {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  width: 100%;
  padding: 0.32rem 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-family: var(--serif);
  font-size: 0.9375rem;
  letter-spacing: -0.015em;
  line-height: 1.35;
}

.starter:first-child {
  border-top: 1px solid var(--line);
}

.starter-mark {
  flex: 0 0 0.7rem;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.7rem;
}

#thoughtInput {
  display: block;
  width: 100%;
  flex: 1 1 auto;
  min-height: 10rem;
  resize: vertical;
  border: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  padding: 0.7rem 0;
  line-height: 1.55;
  caret-color: var(--ink);
}

#thoughtInput::placeholder {
  color: #a39d92;
}

#thoughtInput:focus {
  outline: none;
}

.compose-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0 0.2rem;
}

.btn-primary {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--r-control);
  padding: 0.4rem 0.8rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: wait;
  transform: none;
}

.btn-primary.is-busy [data-label] {
  filter: blur(2px);
  opacity: 0.75;
  transition: filter 200ms ease, opacity 200ms ease;
}

.btn-ghost,
.drawer-head button,
.drawer-footer .btn-ghost {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--r-control);
  padding: 0.32rem 0.58rem;
  font-size: 0.75rem;
  letter-spacing: -0.005em;
}

.hint {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
}

/* Constant motion = linear. Fast bar = perceived speed. Hidden until JS. */
.pipeline-progress {
  display: none;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.55rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.02em;
}

.pipeline-track {
  position: relative;
  flex: 0 0 3.6rem;
  height: 1px;
  overflow: hidden;
  background: #ddd8cc;
}

.pipeline-bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: 40%;
  background: var(--ink);
  transform: translateX(-120%);
  animation: pipeline-slide 700ms linear infinite;
}

@keyframes pipeline-slide {
  to {
    transform: translateX(280%);
  }
}

/* ── Field ── */
.field {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--paper);
}

.field-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--line);
}

.field-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.filter-btn,
.btn-ctrl {
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: var(--faint);
  padding: 0.2rem 0.42rem;
  font-size: 0.75rem;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

.filter-btn.active {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.btn-ctrl {
  min-width: 1.6rem;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.7rem;
}

#canvasWrapper.canvas-wrapper,
#canvasWrapper {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  min-height: 420px;
  height: auto;
  overflow: hidden;
  background: var(--paper);
}

#graphCanvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

#graphCanvas:active {
  cursor: grabbing;
}

.field-void {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  pointer-events: none;
  font-family: var(--serif);
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--faint);
  opacity: 1;
  transition: opacity var(--dur-ui) var(--ease-out);
}

.field-void.is-hidden {
  opacity: 0;
}

/* Tooltip: 125ms, scale 0.97, origin near cursor. Never scale(0). */
.canvas-tooltip {
  display: none;
  position: absolute;
  z-index: 20;
  max-width: 17rem;
  pointer-events: none;
  padding: 0.5rem 0.6rem 0.55rem;
  background: rgba(250, 249, 246, 0.88);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  border: 1px solid var(--line-strong);
  box-shadow: 0 10px 28px rgba(22, 20, 18, 0.08);
  transform-origin: var(--transform-origin, top left);
  opacity: 1;
  transform: scale(1);
  transition:
    opacity var(--dur-tip) var(--ease-out),
    transform var(--dur-tip) var(--ease-out);
}

@starting-style {
  .canvas-tooltip {
    opacity: 0;
    transform: scale(0.97);
  }
}

#tooltipTitle {
  font-family: var(--serif);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.tooltip-mark {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  margin-right: 0.2rem;
}

#tooltipMeta {
  margin-top: 0.18rem;
  color: var(--faint);
  font-size: 0.625rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

#tooltipSnippet {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.4;
}

.graph-hud {
  position: absolute;
  left: 0.7rem;
  bottom: 0.65rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  color: var(--faint);
  font-size: 0.6875rem;
  letter-spacing: 0.02em;
}

.graph-hud span span {
  color: var(--ink);
  font-family: var(--mono);
  letter-spacing: 0;
}

/* ── Readings ── */
.readings {
  display: grid;
  grid-template-columns: 1fr;
  border-bottom: 1px solid var(--line);
}

@media (min-width: 52rem) {
  .readings {
    grid-template-columns: 1fr 1fr;
  }
}

.reading {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 0.85rem 1.1rem 0.75rem;
}

.reading + .reading {
  border-top: 1px solid var(--line);
}

@media (min-width: 52rem) {
  .reading + .reading {
    border-top: 0;
    border-left: 1px solid var(--line);
  }
}

.reading-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.reading-role {
  color: var(--faint);
  font-size: 0.6875rem;
  letter-spacing: 0.03em;
}

.card-body {
  flex: 1;
  min-height: 6.5rem;
  padding: 0.35rem 0 0.5rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

.placeholder-text {
  color: var(--faint);
  font-family: var(--serif);
  letter-spacing: -0.015em;
}

.empty-hint {
  display: block;
  margin-top: 0.4rem;
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0;
  color: #a39d92;
}

.reading-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.btn-audio {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--r-control);
  padding: 0.32rem 0.58rem;
  font-size: 0.75rem;
}

.btn-audio.loading .btn-audio-label,
.btn-audio.loading #audioBtnText {
  filter: blur(2px);
  opacity: 0.7;
  transition: filter 200ms ease, opacity 200ms ease;
}

.btn-audio.playing {
  border-color: var(--ink);
}

#audioBtnIcon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.75rem;
  height: 0.75rem;
  color: var(--muted);
}

.site-footer {
  padding: 0.85rem 1.15rem 1.4rem;
  color: var(--faint);
  font-size: 0.6875rem;
  letter-spacing: 0.02em;
}

.site-footer p {
  margin: 0;
}

/* ── File: right sheet, interruptible, % translate ── */
.history-backdrop {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--scrim);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 250ms var(--ease-out),
    visibility 250ms var(--ease-out);
}

.history-backdrop.open {
  display: block;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.history-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(24.5rem, 100%);
  height: 100%;
  z-index: 95;
  display: flex;
  flex-direction: column;
  background: rgba(250, 249, 246, 0.92);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-left: 1px solid var(--line-strong);
  box-shadow: -20px 0 40px rgba(22, 20, 18, 0.08);
  transform: translateX(100%);
  transition: transform var(--dur-sheet) var(--ease-drawer);
  will-change: transform;
}

.history-drawer.open {
  transform: translateX(0);
}

.drawer-head,
.drawer-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1rem;
}

.drawer-head {
  border-bottom: 1px solid var(--line);
}

.drawer-kicker {
  display: block;
  color: var(--faint);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.drawer-head strong {
  display: block;
  margin-top: 0.12rem;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.drawer-list {
  flex: 1;
  overflow: auto;
  overscroll-behavior: contain;
}

.history-empty {
  padding: 1.4rem 1rem;
  color: var(--faint);
  font-family: var(--serif);
  font-size: 0.9375rem;
}

.history-item {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background-color 150ms ease;
  animation: item-in 200ms var(--ease-out) both;
}

.history-item:nth-child(2) { animation-delay: 40ms; }
.history-item:nth-child(3) { animation-delay: 80ms; }
.history-item:nth-child(4) { animation-delay: 120ms; }
.history-item:nth-child(5) { animation-delay: 160ms; }
.history-item:nth-child(6) { animation-delay: 200ms; }

@keyframes item-in {
  from {
    opacity: 0;
    transform: translateX(8px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.history-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.625rem;
  letter-spacing: 0.03em;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.history-item-preview {
  margin-top: 0.3rem;
  font-family: var(--serif);
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.history-item-del {
  border: 0;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  padding: 0.1rem 0.25rem;
  font-size: 0.6875rem;
}

.drawer-footer {
  border-top: 1px solid var(--line);
}

/* Hold to empty — slow while deciding, snap on release */
.btn-hold {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(159, 18, 57, 0.28);
  background: var(--paper);
  color: var(--caution);
  border-radius: var(--r-control);
  padding: 0.32rem 0.58rem;
  font-size: 0.75rem;
}

.hold-fill {
  position: absolute;
  inset: 0;
  background: rgba(159, 18, 57, 0.12);
  clip-path: inset(0 100% 0 0);
  transition: clip-path 200ms var(--ease-out);
}

.btn-hold:active .hold-fill {
  clip-path: inset(0 0 0 0);
  transition: clip-path 2s linear;
}

.hold-label {
  position: relative;
}

@media (hover: hover) and (pointer: fine) {
  .starter:hover,
  .btn-ghost:hover,
  .btn-ctrl:hover,
  .filter-btn:hover,
  .btn-audio:hover,
  .drawer-head button:hover,
  .drawer-footer .btn-ghost:hover {
    color: var(--ink);
  }

  .btn-primary:hover {
    background: #2a2622;
  }

  .history-item:hover {
    background: rgba(22, 20, 18, 0.03);
  }

  .history-item-del:hover {
    color: var(--ink);
  }
}

@media (prefers-reduced-transparency: reduce) {
  .skin-bar,
  .canvas-tooltip,
  .history-drawer {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .skin-bar {
    background: var(--bg);
  }

  .canvas-tooltip,
  .history-drawer {
    background: var(--paper);
  }
}

@media (prefers-contrast: more) {
  :root {
    --line: rgba(22, 20, 18, 0.35);
    --line-strong: rgba(22, 20, 18, 0.55);
    --muted: #3f3b35;
    --bg: #fff;
    --paper: #fff;
  }
}

@media (prefers-reduced-motion: reduce) {
  .starter,
  .filter-btn,
  .btn-ctrl,
  .btn-ghost,
  .btn-primary,
  .btn-audio,
  .btn-hold,
  .skin-bar a,
  .history-item-del,
  .drawer-head button,
  .drawer-footer button {
    transition: background-color 150ms ease, color 150ms ease,
      border-color 150ms ease, opacity 150ms ease;
  }

  .starter:active,
  .filter-btn:active,
  .btn-ctrl:active,
  .btn-ghost:active,
  .btn-primary:active,
  .btn-audio:active,
  .btn-hold:active,
  .history-item-del:active,
  .drawer-head button:active,
  .drawer-footer button:active {
    transform: none;
    opacity: 0.82;
  }

  .safety-banner,
  .canvas-tooltip,
  .field-void {
    transition: opacity 200ms ease;
    transform: none;
  }

  @starting-style {
    .safety-banner.caution,
    .canvas-tooltip {
      opacity: 0;
      transform: none;
    }
  }

  .history-item {
    animation: item-fade 200ms ease both;
  }

  @keyframes item-fade {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  .history-backdrop {
    transition: opacity 200ms ease, visibility 200ms ease;
  }

  .history-drawer {
    transform: none !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 200ms ease, visibility 200ms ease !important;
  }

  .history-drawer.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .pipeline-bar {
    animation: none;
    transform: none;
    width: 100%;
    opacity: 0.4;
  }

  .hold-fill,
  .btn-hold:active .hold-fill {
    transition: opacity 200ms ease;
    clip-path: none;
  }
}

@media (max-width: 52rem) {
  .spread {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .gutter {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  #canvasWrapper,
  #canvasWrapper.canvas-wrapper {
    min-height: 420px;
    height: 420px;
    flex: none;
  }
}

@media (max-width: 40rem) {
  .mast {
    flex-wrap: wrap;
  }
}
