@import url('/liquid-glass/glass.css');

:root {
  color-scheme: light;
  --paper: #f8f9ff;
  --paper-deep: #edf1ff;
  --surface: #ffffff;
  --surface-soft: #f5f7ff;
  --forest: #142243;
  --forest-deep: #09152e;
  --sage: #5f6c86;
  --sage-light: #aab4c8;
  --line: #dbe2f3;
  --line-dark: #bdc9e2;
  --peach: #e60012;
  --peach-soft: #ffe1df;
  --mint: #dce8ff;
  --danger: #c92f3c;
  --shadow: 0 18px 55px rgba(23, 47, 102, .15);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--forest);
  background: #fff;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

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

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

body {
  min-height: 100dvh;
  overflow: hidden;
  background: var(--paper);
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
  color: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: .48;
}

a {
  color: inherit;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
svg:focus-visible {
  outline: 3px solid var(--peach);
  outline-offset: 3px;
}

.skip {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 16px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--forest);
  color: #fff;
  transform: translateY(-150%);
  transition: transform .18s ease;
}

.skip:focus {
  transform: translateY(0);
}

.topbar {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 max(28px, env(safe-area-inset-right)) 0 max(28px, env(safe-area-inset-left));
  border-bottom: 1px solid rgba(184, 199, 187, .68);
  background: rgba(244, 245, 239, .92);
}

.brand,
.app-brand,
.file-actions,
.history-tools,
.zoom-tools,
.panel-top,
.dialog-top {
  display: flex;
  align-items: center;
}

.brand {
  min-width: 0;
  gap: 11px;
  color: var(--forest);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -.25px;
  line-height: 1.05;
}

.brand-mark {
  display: grid;
  flex: 0 0 31px;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid rgba(35, 72, 59, .2);
  border-radius: 9px;
  background: var(--forest);
  color: #f7f8f2;
  font-size: 13px;
  letter-spacing: -1px;
}

.brand-sub {
  display: block;
  margin-top: 5px;
  color: var(--sage);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1.65px;
}

.app-brand {
  position: absolute;
  left: 50%;
  gap: 9px;
  transform: translateX(-50%);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.7px;
}

.map-symbol {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--line-dark);
  border-radius: 50%;
  color: var(--forest);
  font-size: 12px;
}

.edition {
  align-self: flex-start;
  margin-top: 1px;
  color: var(--peach);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 1px;
}

.quiet,
.text-button {
  min-height: 44px;
  padding: 9px 13px;
  border-radius: 8px;
  background: transparent;
  color: var(--sage);
  font-size: 12px;
}

.quiet:hover,
.text-button:hover {
  background: var(--paper-deep);
  color: var(--forest);
}

#host-app {
  min-height: calc(100dvh - 70px);
  display: flex;
  flex-direction: column;
}

.workspace-header {
  min-height: 108px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 22px max(32px, env(safe-area-inset-right)) 20px max(32px, env(safe-area-inset-left));
  background: var(--paper);
}

.map-heading {
  min-width: 0;
}

.eyebrow,
.panel-caption,
.canvas-chip {
  color: var(--sage);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.8px;
  line-height: 1.25;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 9px;
}

#map-title {
  width: min(650px, 100%);
  min-width: 0;
  display: block;
  padding: 0;
  border: 0;
  border-bottom: 1px solid transparent;
  outline: 0;
  background: transparent;
  color: var(--forest-deep);
  font-size: clamp(30px, 3.2vw, 45px);
  font-weight: 600;
  letter-spacing: -1.8px;
  line-height: 1.05;
}

#map-title:focus {
  border-color: var(--peach);
}

#save-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 8px 0 0;
  color: var(--sage);
  font-size: 10px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #73a782;
  box-shadow: 0 0 0 3px rgba(115, 167, 130, .15);
}

.file-actions {
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.file-actions button,
.zoom-tools button,
.history-tools button {
  min-width: 44px;
  min-height: 44px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
  color: var(--forest);
  font-size: 12px;
  font-weight: 650;
}

.file-actions button:hover,
.zoom-tools button:hover,
.history-tools button:hover {
  border-color: var(--line-dark);
  background: var(--surface);
}

button.primary {
  border: 1px solid var(--forest);
  background: var(--forest);
  color: #fff;
  box-shadow: 0 3px 0 rgba(24, 58, 47, .16);
}

button.primary:hover {
  background: var(--forest-deep);
}

.file-actions button.primary {
  padding-inline: 17px;
}

.workspace {
  min-height: 0;
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  overflow: hidden;
  border-top: 1px solid var(--line);
}
.workspace:has(> .detail-panel:not([hidden])) { grid-template-columns: 220px minmax(0, 1fr) 280px; }
.route-hit { cursor: copy; }
.route-hit:focus-visible { stroke: #e9a88666; outline: none; }
.route.drop-target { stroke-width: 6; filter: drop-shadow(0 0 3px rgba(230,0,18,.5)); }
button#undo-button, button#redo-button, button#zoom-in, button#zoom-out, button#fit-button, #color-picker button { min-width: 44px; min-height: 44px; }
.join-qr { display: block; width: 164px; height: 164px; margin: 8px auto 16px; image-rendering: pixelated; }
.mode-actions { display: flex; gap: 10px; justify-content: center; margin-top: 12px; }
.mode-actions button { min-height: 44px; padding: 10px 18px; border: 1px solid var(--line-dark); background: #fffefa; border-radius: 10px; }
#toast { visibility: hidden; opacity: 0; pointer-events: none; }
#toast.visible { visibility: visible; opacity: 1; }
.session-status { font-size: 12px; line-height: 1.5; }
.session-status + label { margin-top: 14px; }
.idea-card { margin: 14px 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #e6eee3; }
.idea-card p { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.5; }
.idea-card div { display: flex; gap: 4px; flex-wrap: wrap; }
.idea-card button { padding: 9px; min-height: 44px; border-radius: 8px; }
.inbox-empty { color: #536d5f; font-size: 14px; line-height: 1.6; margin: 24px 0; }
.outline-item { display: block; text-align: left; width: 100%; padding: 14px 10px; margin: 6px 0; border-radius: 8px; background: #e6eee3; overflow-wrap: anywhere; }

.tool-panel,
.detail-panel {
  min-width: 0;
  background: var(--surface-soft);
}

.tool-panel {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 0;
  flex-direction: column;
  padding: 24px 18px 18px;
  border-right: 1px solid var(--line);
}

.panel-caption {
  display: block;
}

.palette {
  display: grid;
  gap: 6px;
  margin-top: 17px;
}

.palette-item {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--forest);
  text-align: left;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.palette-item:hover,
.palette-item:focus-visible {
  border-color: var(--line);
  background: #fff;
  transform: translateX(2px);
}

.palette-item > span:last-child {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
}

.palette-item small {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: var(--sage);
  font-size: 9px;
  font-weight: 400;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shape-icon {
  flex: 0 0 34px;
  display: grid;
  width: 34px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line-dark);
  color: var(--forest);
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
}

.start-icon {
  border-radius: 50%;
  background: var(--mint);
}

.box-icon {
  border-radius: 7px;
  background: #e6eee2;
  font-size: 18px;
}

.diamond-icon {
  width: 25px;
  height: 25px;
  margin-inline: 5px 4px;
  border-radius: 4px;
  background: var(--peach-soft);
  transform: rotate(45deg);
}

.diamond-icon::first-letter {
  transform: rotate(-45deg);
}

.note-icon {
  border-radius: 5px 5px 5px 1px;
  background: #f3e7cc;
  font-size: 10px;
}

.goal-icon {
  border-radius: 999px;
  background: #d5e6df;
}

.tip {
  margin: 18px 4px 0;
  color: var(--sage);
  font-size: 10px;
  line-height: 1.65;
}

.panel-divider {
  height: 1px;
  margin: 19px 0 13px;
  background: var(--line);
}

.wide {
  width: 100%;
}

.tool-panel .wide {
  margin-top: 4px;
  text-align: left;
}

.panel-footer {
  position: relative;
  min-height: 98px;
  margin-top: auto;
  padding: 16px 5px 4px;
  color: var(--sage);
  font-size: 11px;
  line-height: 1.55;
}

.panel-footer strong {
  color: var(--forest);
  font-weight: 700;
}

.panel-footer svg {
  position: absolute;
  right: -5px;
  bottom: -4px;
  width: 115px;
  height: 58px;
  fill: none;
  stroke: var(--peach);
  stroke-linecap: round;
  stroke-width: 1.4;
  opacity: .75;
}

.canvas-shell {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
  background-color: #eef1e9;
  background-image: radial-gradient(circle, rgba(111, 129, 120, .23) 1px, transparent 1.1px);
  background-position: 12px 12px;
  background-size: 24px 24px;
}

.canvas-shell::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.42), transparent 42%, rgba(216, 230, 218, .16));
  content: "";
  pointer-events: none;
}

.canvas-top,
.canvas-bottom {
  position: absolute;
  z-index: 4;
  right: 18px;
  left: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.canvas-top {
  top: 17px;
}

.canvas-bottom {
  bottom: max(16px, env(safe-area-inset-bottom));
}

.canvas-chip,
.gesture-tip,
.zoom-tools {
  pointer-events: auto;
}

.canvas-chip {
  padding: 8px 10px;
  border: 1px solid rgba(184, 199, 187, .72);
  border-radius: 7px;
  background: rgba(255, 254, 250, .72);
}

.history-tools {
  gap: 6px;
  pointer-events: auto;
}

.history-tools button {
  min-width: 36px;
  min-height: 36px;
  padding: 5px;
  border-color: rgba(184, 199, 187, .7);
  background: rgba(255, 254, 250, .72);
  font-size: 17px;
}

#canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

#canvas:active {
  cursor: grabbing;
}

#world {
  transform-origin: 0 0;
}

#routes {
  overflow: visible;
}

.route {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .82;
  transition: stroke .16s ease, stroke-width .16s ease, opacity .16s ease;
}

.route.selected {
  stroke-width: 3;
  opacity: 1;
}

.map-node {
  cursor: grab;
  outline: none;
}

.map-node:active {
  cursor: grabbing;
}

.map-node > rect,
.map-node > path,
.map-node > polygon,
.map-node > circle,
.map-node > ellipse {
  stroke: rgba(35, 72, 59, .25);
  stroke-width: 1.5;
  transition: filter .16s ease, stroke .16s ease, stroke-width .16s ease;
}

.map-node:hover > rect,
.map-node:hover > path,
.map-node:hover > polygon,
.map-node:hover > circle,
.map-node:hover > ellipse,
.map-node.selected > rect,
.map-node.selected > path,
.map-node.selected > polygon,
.map-node.selected > circle,
.map-node.selected > ellipse,
.map-node:focus-visible > rect,
.map-node:focus-visible > path,
.map-node:focus-visible > polygon,
.map-node:focus-visible > circle,
.map-node:focus-visible > ellipse {
  filter: drop-shadow(0 5px 7px rgba(35, 72, 59, .16));
  stroke: var(--forest);
  stroke-width: 2.5;
}

.map-node.selected > rect,
.map-node.selected > path,
.map-node.selected > polygon,
.map-node.selected > circle,
.map-node.selected > ellipse {
  stroke: var(--peach);
}

.map-node text {
  fill: var(--forest);
  font-family: inherit;
  font-size: 13px;
  font-weight: 650;
  pointer-events: none;
}

.welcome {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  width: min(620px, calc(100% - 48px));
  padding: 32px 25px;
  text-align: center;
  transform: translate(-50%, -50%);
}

.welcome-flourish {
  display: grid;
  width: 31px;
  height: 31px;
  margin: 0 auto 20px;
  place-items: center;
  border: 1px solid rgba(238, 156, 124, .7);
  border-radius: 50%;
  color: var(--peach);
  font-size: 16px;
  transform: rotate(-10deg);
}

.welcome h1,
.participant-card h1 {
  margin: 0;
  color: var(--forest-deep);
  font-size: clamp(42px, 5vw, 58px);
  font-weight: 560;
  letter-spacing: -3px;
  line-height: .99;
}

.welcome > p:not(.eyebrow) {
  margin: 19px 0 24px;
  color: var(--sage);
  font-size: 13px;
  line-height: 1.7;
}

.welcome .primary {
  min-height: 46px;
  padding-inline: 20px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
}

.welcome .text-button {
  display: block;
  margin: 8px auto 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.welcome > small {
  display: block;
  margin-top: 24px;
  color: var(--sage-light);
  font-size: 10px;
}

.connect-banner {
  position: absolute;
  z-index: 6;
  top: 64px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100% - 32px);
  padding: 10px 11px 10px 16px;
  border: 1px solid rgba(35, 72, 59, .25);
  border-radius: 9px;
  background: var(--forest);
  box-shadow: 0 10px 25px rgba(35, 72, 59, .18);
  color: #fff;
  font-size: 12px;
  transform: translateX(-50%);
}

.connect-banner button {
  min-height: 30px;
  padding: 5px 9px;
  border-radius: 6px;
  background: rgba(255,255,255,.15);
  color: #fff;
  font-size: 11px;
}

.gesture-tip {
  padding: 7px 9px;
  border-radius: 6px;
  background: rgba(255, 254, 250, .62);
  color: var(--sage);
  font-size: 9px;
}

.zoom-tools {
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid rgba(184, 199, 187, .9);
  border-radius: 8px;
  background: rgba(255, 254, 250, .78);
}

.zoom-tools button {
  min-width: 33px;
  min-height: 33px;
  padding: 4px 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.zoom-tools output {
  min-width: 49px;
  color: var(--sage);
  font-size: 10px;
  text-align: center;
}

.tool-separator {
  width: 1px;
  height: 19px;
  background: var(--line);
}

.detail-panel {
  z-index: 8;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 23px 18px max(20px, env(safe-area-inset-bottom));
  border-left: 1px solid var(--line);
}

.panel-top {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 25px;
}

.panel-top .quiet {
  min-width: 36px;
  min-height: 36px;
  padding: 5px;
  font-size: 16px;
}

.detail-panel label,
.field-label {
  display: block;
  margin: 0 0 7px;
  color: var(--forest);
  font-size: 11px;
  font-weight: 700;
}

.detail-panel textarea,
.detail-panel select,
.connect-row select,
#idea-text {
  width: 100%;
  min-height: 42px;
  margin: 0 0 17px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  background: #fff;
  color: var(--forest);
  font-size: 12px;
  line-height: 1.45;
}

.detail-panel textarea,
#idea-text {
  min-height: 96px;
  resize: vertical;
}

.detail-panel textarea:focus,
.detail-panel select:focus,
.connect-row select:focus,
#idea-text:focus {
  border-color: var(--peach);
}

.color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 2px;
}

.color-picker button,
.colour-swatch,
.color-swatch {
  width: 27px;
  height: 27px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--line-dark);
}

.color-picker button:hover,
.color-picker button[aria-pressed="true"],
.color-picker button.selected,
.colour-swatch.selected,
.color-swatch.selected {
  box-shadow: 0 0 0 2px var(--forest), 0 0 0 4px rgba(35, 72, 59, .12);
}

.connect-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 7px;
  margin-bottom: 16px;
}

.connect-row select {
  margin: 0;
}

.connect-row button {
  min-width: 44px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.route-list,
#outline-list,
#inbox-list {
  display: grid;
  gap: 7px;
  margin: 0 0 18px;
}

.route-list > *,
#outline-list > *,
#inbox-list > * {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--forest);
  font-size: 11px;
  line-height: 1.45;
}

.danger {
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid rgba(169, 79, 67, .3);
  border-radius: 8px;
  background: #fff9f7;
  color: var(--danger);
  font-size: 11px;
  font-weight: 700;
}

.danger:hover {
  border-color: var(--danger);
  background: #fff0ec;
}

.inbox-panel #session-info {
  margin: 16px 0;
  padding: 11px;
  border-radius: 8px;
  background: var(--mint);
  color: var(--forest);
  font-size: 10px;
  line-height: 1.5;
}

.participant {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  overflow: auto;
  background: radial-gradient(circle at 50% 8%, #fffefa 0%, var(--paper) 65%);
}

.participant-card {
  width: min(540px, 100%);
  padding: clamp(28px, 6vw, 56px) clamp(22px, 7vw, 58px);
  border: 1px solid #fff;
  border-radius: 18px;
  background: rgba(255, 254, 250, .88);
  box-shadow: var(--shadow);
}

.participant-card h1 {
  font-size: clamp(38px, 8vw, 56px);
  letter-spacing: -2.7px;
}

.participant-card > p:not(.eyebrow):not(.privacy-note) {
  margin: 19px 0 25px;
  color: var(--sage);
  font-size: 13px;
  line-height: 1.65;
}

.participant-card form label {
  display: block;
  margin: 0 0 8px;
  color: var(--forest);
  font-size: 11px;
  font-weight: 700;
}

.participant-card .primary {
  min-height: 46px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}

.privacy-note {
  color: var(--sage) !important;
  font-size: 10px !important;
  line-height: 1.55 !important;
}

.participant-card > a {
  display: inline-block;
  margin-top: 18px;
  color: var(--forest);
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

dialog {
  width: min(520px, 92vw);
  max-height: min(680px, calc(100dvh - 32px));
  overflow: auto;
  padding: 27px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(24, 58, 47, .2);
  color: var(--forest);
}

dialog::backdrop {
  background: rgba(24, 58, 47, .28);
  backdrop-filter: blur(3px);
}

.dialog-top {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

dialog h2 {
  margin: 0;
  color: var(--forest-deep);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -1px;
  line-height: 1.05;
}

dialog p,
dialog dd,
dialog li {
  color: var(--sage);
  font-size: 12px;
  line-height: 1.65;
}

dialog ul {
  margin: 18px 0;
  padding-left: 18px;
}

dialog dl {
  margin: 20px 0 0;
}

dialog dt {
  margin-top: 14px;
  color: var(--forest);
  font-size: 11px;
  font-weight: 750;
}

dialog dd {
  margin: 4px 0 0;
}

.export-option {
  width: 100%;
  display: grid;
  gap: 4px;
  margin-top: 9px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
  text-align: left;
}

.export-option:hover {
  border-color: var(--peach);
  background: #fffaf7;
}

.export-option strong {
  color: var(--forest);
  font-size: 12px;
}

.export-option span {
  color: var(--sage);
  font-size: 10px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

.dialog-actions button {
  min-height: 44px;
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
}

.dialog-actions button:not(.primary) {
  background: var(--surface-soft);
  color: var(--forest);
}


#toast {
  position: fixed;
  z-index: 30;
  right: max(20px, env(safe-area-inset-right));
    bottom: max(84px, env(safe-area-inset-bottom));
  max-width: min(360px, calc(100vw - 40px));
  padding: 11px 15px;
  border: 1px solid rgba(35, 72, 59, .18);
  border-radius: 9px;
  background: var(--forest);
  box-shadow: 0 10px 25px rgba(35, 72, 59, .18);
  color: #fff;
  font-size: 11px;
  line-height: 1.4;
}

@media (max-width: 980px) {
  .workspace {
    grid-template-columns: 190px minmax(0, 1fr);
  }
  .workspace:has(> .detail-panel:not([hidden])) { grid-template-columns: 190px minmax(0, 1fr) 250px; }

  .tool-panel,
  .detail-panel {
    padding-inline: 14px;
  }

  .workspace-header {
    padding-inline: 24px;
  }
}

@media (max-width: 760px) {
  body {
    min-width: 0;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .topbar {
    height: 62px;
    padding-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right));
  }

  .brand {
    font-size: 12px;
  }

  .brand-sub {
    font-size: 7px;
    letter-spacing: 1.2px;
  }

  .brand-mark {
    flex-basis: 28px;
    width: 28px;
    height: 28px;
  }

  .app-brand {
    position: static;
    margin-left: auto;
    transform: none;
  }

  .topbar > .quiet {
    padding-inline: 8px;
    font-size: 10px;
  }

  #host-app {
    min-height: calc(100dvh - 62px);
  }

  .workspace-header {
    min-height: 0;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
    padding: 21px max(17px, env(safe-area-inset-right)) 17px max(17px, env(safe-area-inset-left));
  }

  .map-heading {
    flex: 1 1 230px;
  }

  #map-title {
    font-size: 30px;
  }

  .file-actions {
    flex: 1 1 100%;
    justify-content: flex-start;
  }

  .file-actions button {
    flex: 1 1 auto;
  }

  .workspace {
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  .tool-panel {
    flex: 0 0 auto;
    display: block;
    overflow: hidden;
    padding: 13px max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .tool-panel .panel-caption {
    margin-bottom: 8px;
  }

  .palette {
    display: flex;
    gap: 7px;
    max-width: 100%;
    margin: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding-bottom: 3px;
    scrollbar-width: thin;
  }

  .palette-item {
    flex: 0 0 auto;
    width: auto;
    min-height: 44px;
    padding: 7px 9px;
    border-color: var(--line);
    background: rgba(255,255,255,.52);
  }

  .palette-item > span:last-child {
    font-size: 10px;
  }

  .palette-item small,
  .tool-panel .tip,
  .panel-footer {
    display: none;
  }

  .shape-icon {
    flex-basis: 26px;
    width: 26px;
    height: 23px;
  }

  .diamond-icon {
    width: 21px;
    height: 21px;
    margin-inline: 3px;
  }

  .tool-panel .panel-divider {
    display: none;
  }
  .tool-panel .wide { display: inline-flex; width: auto; min-height: 44px; padding: 8px; font-size: 11px; }

  .canvas-shell {
    flex: 1 1 auto;
    min-height: 52vh;
    height: max(52vh, 430px);
  }

  .canvas-top,
  .canvas-bottom {
    right: 11px;
    left: 11px;
  }

  .canvas-top {
    top: 11px;
  }

  .canvas-bottom {
    bottom: max(11px, env(safe-area-inset-bottom));
  }

  .gesture-tip {
    max-width: 52%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .welcome {
    width: min(600px, calc(100% - 26px));
    padding: 24px 8px;
  }

  .welcome h1 {
    font-size: clamp(38px, 11vw, 52px);
    letter-spacing: -2.4px;
  }

  .welcome > p:not(.eyebrow) {
    font-size: 12px;
  }

  .detail-panel {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    max-height: 55vh;
    padding: 17px max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
    border: 1px solid var(--line);
    border-bottom: 0;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -14px 45px rgba(35, 72, 59, .14);
  }

  .panel-top {
    position: sticky;
    top: -17px;
    z-index: 1;
    margin: -17px -1px 20px;
    padding: 17px 1px 11px;
    background: linear-gradient(var(--surface-soft) 78%, transparent);
  }

  #toast {
    right: max(14px, env(safe-area-inset-right));
      bottom: max(84px, env(safe-area-inset-bottom));
    left: max(14px, env(safe-area-inset-left));
    max-width: none;
  }
}

@media (max-width: 420px) {
  .brand > span:last-child {
    display: none;
  }

  .app-brand {
    margin-left: auto;
    font-size: 15px;
  }

  .topbar > .quiet {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .file-actions button {
    padding-inline: 9px;
    font-size: 10px;
  }

  .canvas-chip {
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .history-tools button {
    min-width: 33px;
    min-height: 33px;
  }

  .welcome h1 {
    font-size: 38px;
  }

  .welcome > p:not(.eyebrow) br {
    display: none;
  }

  .gesture-tip {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
    animation-iteration-count: 1 !important;
  }
}

/* Canvas-first Map interface. Floating panels occupy the edges, leaving the
   planning surface visible at ordinary laptop sizes. */
.topbar { height: 58px; padding-inline: max(20px, env(safe-area-inset-left)) max(20px, env(safe-area-inset-right)); border-color: var(--line); background: rgba(255,255,255,.92); backdrop-filter: blur(16px); }
.topbar { border-bottom: 0; }
.brand { gap: 8px; }
.brand-mark { display: block; flex: 0 0 30px; width: 30px; height: 30px; border: 0; border-radius: 9px; }
.brand-copy { display: grid; color: #121923; font-family: Arial, sans-serif; font-size: 14px; font-weight: 900; letter-spacing: -.083em; line-height: .84; }
.brand-copy > span { display: block; }
.app-brand { font-size: 16px; }
.map-symbol { overflow: hidden; border: 0; background: transparent; }
.map-symbol img { display: block; width: 100%; height: 100%; }
button.primary { border-color: var(--peach); background: var(--peach); box-shadow: 0 5px 14px rgba(230,0,18,.2); }
button.primary:hover { background: #bd0010; }

#host-app { min-height: calc(100dvh - 58px); background: #fff; }
.workspace-header { min-height: 62px; padding: 8px max(20px, env(safe-area-inset-left)); gap: 16px; border-bottom: 1px solid #edf0f7; background: rgba(255,255,255,.92); }
.workspace-header .eyebrow { display: none; }
.eyebrow, .panel-caption, .canvas-chip { color: #52617d; }
.eyebrow { margin-bottom: 4px; }
#map-title { width: min(470px, 100%); color: var(--forest-deep); font-size: clamp(21px,2vw,25px); font-weight: 720; letter-spacing: -1px; }
#save-note { margin-top: 4px; font-size: 10px; }
.status-dot { background: #2e65ee; box-shadow: 0 0 0 3px rgba(46,101,238,.12); }
.file-actions { gap: 6px; }
.file-actions button, .zoom-tools button, .history-tools button { min-height: 36px; border-color: #dfe6f5; border-radius: 10px; background: #fff; color: var(--forest); font-size: 11px; }
.file-actions button.primary { padding-inline: 14px; border-color: var(--peach); background: var(--peach); color: #fff; }
.file-actions button.primary:hover { background: #bd0010; }

.workspace { position: relative; display: block; min-height: 0; overflow: hidden; border-top: 0; }
.workspace:has(> .detail-panel:not([hidden])) { grid-template-columns: none; }
.canvas-shell { height: 100%; min-height: 0; background-color: #fff; background-image: radial-gradient(circle, rgba(69,107,195,.13) 1px, transparent 1.1px); background-size: 26px 26px; }
.canvas-shell::after { background: linear-gradient(130deg, rgba(235,242,255,.45), transparent 38%, rgba(255,244,203,.17)); }
.canvas-top, .canvas-bottom { right: 18px; left: 18px; }
.workspace:has(#inbox-panel:not([hidden])) .canvas-top, .workspace:has(#inbox-panel:not([hidden])) .canvas-bottom { right: 336px; }
.canvas-shell:has(.welcome:not([hidden])) .canvas-bottom, .canvas-shell:has(.welcome:not([hidden])) .canvas-top:not(:has(.history-tools button:not(:disabled))) { display: none; }
.canvas-chip, .gesture-tip, .zoom-tools, .history-tools button { border-color: rgba(190,204,233,.78); background: rgba(236,241,238,.35); box-shadow: 0 10px 28px rgba(20,34,67,.12), inset 0 1px rgba(255,255,255,.78); backdrop-filter: blur(16px) saturate(125%); }
.zoom-tools { border-radius: 18px; overflow: visible; }
.zoom-tools button { border-radius: 12px; }
.history-tools button { color: #2e65ee; }
.route.selected, .route.drop-target { opacity: 1; }
.map-node { cursor: move; }
#canvas { cursor: default; }
#canvas.connecting { cursor: crosshair; }
.route-hit { cursor: pointer; }
.map-node > g > g > :is(rect, path, polygon, circle, ellipse) { stroke: rgba(20,34,67,.28); transition: filter .16s ease, stroke .16s ease, stroke-width .16s ease; }
.map-node:hover > g > g > :is(rect, path, polygon, circle, ellipse), .map-node:focus-visible > g > g > :is(rect, path, polygon, circle, ellipse) { stroke: #2e65ee; filter: drop-shadow(0 8px 13px rgba(46,101,238,.2)); }
.map-node.selected > g > g > :is(rect, path, polygon, circle, ellipse) { stroke: var(--peach); stroke-width: 3px; filter: drop-shadow(0 0 0 3px rgba(230,0,18,.18)) drop-shadow(0 10px 16px rgba(230,0,18,.18)); }
#canvas.connecting .map-node.selected > g > g > :is(rect, path, polygon, circle, ellipse) { stroke: #e60012; stroke-width: 4px; filter: drop-shadow(0 0 0 5px rgba(230,0,18,.22)) drop-shadow(0 10px 18px rgba(230,0,18,.2)); }
#canvas.connecting .map-node:not(.selected):hover > g > g > :is(rect, path, polygon, circle, ellipse), #canvas.connecting .map-node.connect-candidate > g > g > :is(rect, path, polygon, circle, ellipse) { stroke: #2e65ee; stroke-width: 3px; filter: drop-shadow(0 0 0 4px rgba(46,101,238,.2)); }

.tool-panel, .detail-panel { position: absolute; z-index: 8; border: 0; border-radius: var(--lg-radius); background: transparent; box-shadow: 0 8px 24px rgb(24 32 44 / .12), 0 1px 3px rgb(24 32 44 / .1); backdrop-filter: none; }
.tool-panel { top: 18px; left: 18px; width: 240px; max-height: calc(100% - 36px); padding: 0; border-right: 1px solid rgba(202,214,239,.85); }
.tool-panel > .lg__content { padding: 17px 14px 13px; }
.tool-panel .panel-caption { color: #2e65ee; }
.palette { gap: 4px; margin-top: 11px; }
.palette-item { padding: 8px 7px; border-radius: 10px; color: var(--forest); }
.palette-item:hover, .palette-item:focus-visible { border-color: #c7d7ff; background: rgba(235,242,255,.86); transform: translateX(2px); }
.palette-item > span:last-child { font-size: 12px; }
.palette-item small { color: var(--sage); font-size: 9px; }
.tool-panel .route-palette { display: grid; grid-template-columns: repeat(4, 44px); align-items: center; gap: 7px; margin: 12px 0 3px; padding-top: 11px; border-top: 1px solid #e3e9f5; }
.route-palette > span { grid-column: 1 / -1; color: var(--sage); font-size: 9px; font-weight: 750; text-transform: uppercase; letter-spacing: .7px; }
.route-palette button { width: 24px; height: 24px; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px #c5d1e8; }
.tool-panel .route-palette button { width: 44px; height: 44px; }
.route-palette button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--forest), 0 0 0 4px rgba(46,101,238,.16); }
.shape-icon { border-color: transparent; color: var(--forest); }
.start-icon, .goal-icon { background: #dce8ff; }
.box-icon { background: #fff0c9; }
.diamond-icon { background: #ffe1df; }
.note-icon { background: #f5efff; }
.tip, #save-note { font-size: 10px; }
.tool-panel .wide { min-height: 34px; margin-top: 2px; padding: 7px 8px; border-radius: 8px; }
.panel-divider { margin: 12px 0 8px; }
.panel-footer { display: none; }
.workspace:has(#detail-panel:not([hidden])) .tool-panel { opacity: 0; pointer-events: none; }
.workspace:has(#inline-editor:not([hidden])) .tool-panel, .workspace:has(#inline-editor:not([hidden])) #inbox-panel { opacity: 0; pointer-events: none; }

.detail-panel { top: 18px; bottom: 18px; left: 18px; width: 260px; padding: 17px 14px; border-left: 1px solid rgba(202,214,239,.85); }
.detail-panel > .lg__content { min-height: 100%; padding: 17px 14px; }
.detail-panel.inbox-panel { right: 18px; left: auto; width: min(300px, calc(100% - 36px)); display: flex; flex-direction: column; }
.detail-panel.inbox-panel > .lg__content { display: flex; flex: 1 1 auto; flex-direction: column; }
.detail-panel .wide { min-height: 40px; margin-top: 7px; padding: 9px 11px; border: 1px solid #d7e0f2; border-radius: 10px; background: rgba(255,255,255,.9); color: var(--forest); font-size: 12px; font-weight: 650; }
.detail-panel .wide.primary { border-color: var(--peach); background: var(--peach); color: #fff; }
.detail-panel .wide.primary:hover { background: #bd0010; }
.branch-symbol { width: 30px; height: 30px; margin-right: 6px; overflow: visible; stroke: #2e65ee; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.75; fill: none; vertical-align: middle; }
.panel-top { margin-bottom: 15px; }
.detail-panel textarea, .detail-panel select, .connect-row select, #idea-text { border-color: #d7e0f2; border-radius: 11px; background: rgba(255,255,255,.84); }
.detail-panel textarea:focus, .detail-panel select:focus, .connect-row select:focus, #idea-text:focus { border-color: #2e65ee; box-shadow: 0 0 0 3px rgba(46,101,238,.12); }
.idea-card { margin: 0; padding: 13px; border-color: #dfe6f5; border-radius: 13px; background: rgba(255,255,255,.92); box-shadow: 0 7px 18px rgba(30,53,105,.07); }
#inbox-list { display: flex; flex: 1 1 auto; flex-direction: column; justify-content: flex-start; gap: 8px; min-height: 0; overflow-y: auto; }
#inbox-list > :first-child { margin-top: auto; }
.inbox-empty { color: var(--sage); }
.inbox-panel #session-info { background: #eef4ff; color: #294c9a; }
.inbox-panel #session-info .join-qr { width: 164px; height: 164px; margin: 10px auto 16px; }
.inbox-panel #session-info input { width: 100%; min-height: 40px; margin: 8px 0 0; padding: 9px; border: 1px solid #cbd9f4; border-radius: 10px; background: #fff; color: var(--forest); font-size: 10px; }
.inbox-panel #session-info button { width: 100%; min-height: 40px; margin-top: 7px; padding: 9px 11px; border: 1px solid #cbd9f4; border-radius: 10px; background: rgba(255,255,255,.9); color: #294c9a; font-size: 11px; font-weight: 700; }
.inbox-panel #session-info button:hover { border-color: #9eb7ed; background: #fff; }

.connect-banner { border-color: rgba(255,255,255,.52); border-radius: 18px; background: rgba(20,34,67,.88); box-shadow: 0 18px 42px rgba(20,34,67,.28); backdrop-filter: blur(16px); }
.connect-banner > span { display: grid; gap: 2px; }
.connect-banner small { color: rgba(255,255,255,.75); font-size: 10px; }
.connect-banner button { border: 1px solid rgba(255,255,255,.28); border-radius: 999px; }

#team-dialog { border: 1px solid #d8dfe9; border-radius: 28px; background: #fffefa; box-shadow: 0 24px 70px rgba(20,34,67,.24), 0 3px 10px rgba(20,34,67,.1); backdrop-filter: none; }
#team-dialog p, #team-dialog li { font-size: 16px; }
#team-dialog .privacy-note { font-size: 14px !important; }
#team-dialog #create-session { width: 100%; min-height: 56px; margin-top: 10px; border: 1px solid #e60012; border-radius: 999px; background: #e60012; color: #fff; font-size: 18px; font-weight: 800; box-shadow: inset 0 1px rgba(255,255,255,.28), 0 7px 20px rgba(20,34,67,.16); }
#team-dialog #create-session:hover { border-color: #bd0010; background: #bd0010; color: #fff; }
#team-dialog .opaque-close { border: 1px solid #d8dfe9 !important; background: #fff !important; box-shadow: 0 3px 9px rgba(20,34,67,.12) !important; }
#team-dialog .glass-close > svg { width: 24px; height: 24px; overflow: visible; fill: none; stroke: #e60012; stroke-linecap: round; stroke-width: 3; filter: drop-shadow(0 1px rgba(255,255,255,.9)); }
.zoom-tools > .lg__content { display: flex; align-items: center; padding: 0; }
.glass-close { display: grid; width: 48px; height: 48px; min-width: 48px !important; min-height: 48px !important; place-items: center; overflow: hidden; border: 0 !important; border-radius: 50% !important; background: transparent !important; color: #e60012 !important; font-size: 0 !important; box-shadow: none !important; }
.glass-close > .lg__content { display: grid; width: 100%; height: 100%; padding: 0; place-items: center; }
.glass-close > .lg__content svg { width: 24px; height: 24px; overflow: visible; fill: none; stroke: #e60012; stroke-linecap: round; stroke-width: 3; filter: drop-shadow(0 1px rgba(255,255,255,.9)); }
.shape-picker, .route-style-picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin: 2px 0 14px; }
.route-style-picker { grid-template-columns: repeat(3, 1fr); }
.shape-picker button, .route-style-picker button { min-height: 40px; border: 1px solid #d7e0f2; border-radius: 11px; background: rgba(255,255,255,.72); color: #294c9a; font-size: 20px; }
.shape-picker svg, .route-style-picker svg { width: 28px; height: 28px; overflow: visible; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; vertical-align: middle; }
.shape-picker button[aria-pressed='true'], .route-style-picker button[aria-pressed='true'] { border-color: #2e65ee; box-shadow: 0 0 0 3px rgba(46,101,238,.14); }
.detail-route-palette { flex-wrap: wrap; margin-top: 0; padding-top: 0; border-top: 0; }
.detail-route-palette button { width: 24px; height: 24px; }
.block-menu { position: absolute; z-index: 12; border-radius: 18px; background: rgba(255,255,255,.94); box-shadow: 0 18px 45px rgba(20,34,67,.2); backdrop-filter: blur(14px); }
.block-menu { display: grid; min-width: 180px; padding: 8px; gap: 3px; }
.block-menu button { min-height: 40px; padding: 8px 10px; border-radius: 10px; background: transparent; color: var(--forest); text-align: left; }
.block-menu button:hover, .block-menu button:focus-visible { background: #edf3ff; }
#inline-editor { position: absolute; z-index: 12; pointer-events: none; }
#inline-text { position: absolute; top: 28px; right: 14px; bottom: 12px; left: 14px; overflow: auto; padding: 0 3px; border: 0; border-radius: 8px; background: transparent; color: var(--forest); line-height: 1.45; outline: 0; text-align: center; white-space: pre-wrap; pointer-events: auto; }
#inline-text:focus { box-shadow: 0 0 0 2px rgba(46,101,238,.45); }
#text-format-toolbar { position: absolute; top: calc(100% + 8px); left: 0; display: flex; flex-wrap: wrap; gap: 5px; width: max-content; max-width: min(360px, calc(100vw - 24px)); padding: 8px; border: 1px solid rgba(191,205,233,.9); border-radius: 13px; background: rgba(255,255,255,.88); box-shadow: 0 10px 28px rgba(20,34,67,.16); backdrop-filter: blur(12px); pointer-events: auto; }
#text-format-toolbar button { min-height: 32px; padding: 5px 8px; border: 1px solid #d7e0f2; border-radius: 8px; background: #fff; color: var(--forest); font-size: 12px; }
.inline-actions { position: absolute; top: calc(100% + 8px); left: 0; display: flex; gap: 5px; pointer-events: auto; }
.inline-actions button { min-height: 34px; padding: 5px 10px; border: 1px solid #d7e0f2; border-radius: 9px; background: rgba(255,255,255,.93); color: var(--forest); font-size: 12px; }
#inline-done { border-color: #e60012 !important; background: #e60012 !important; color: #fff !important; }
.map-node.editing > g > g[clip-path] { visibility: hidden; }

.welcome { width: min(560px, calc(100% - 48px)); padding: 30px 25px; }
.welcome-flourish { border-color: #ffc3bd; color: var(--peach); }
.welcome h1 { font-size: clamp(38px,4.5vw,55px); color: var(--forest-deep); }
.welcome > p:not(.eyebrow) { color: var(--sage); }
.mode-actions button { border-color: #d6e1f9; background: rgba(255,255,255,.85); }

.participant { align-items: start; padding-top: clamp(54px,12vh,140px); background: radial-gradient(circle at 74% 12%, #fff3c7 0, transparent 17%), radial-gradient(circle at 16% 18%, #e5edff 0, transparent 23%), #fff; }
.participant-card { width: min(620px,100%); padding: clamp(26px,5vw,48px) 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.participant-card h1 { font-size: clamp(31px,4vw,42px); line-height: 1.02; }
.participant-card #idea-form { max-width: 540px; padding: 0; border: 0; border-radius: var(--lg-radius); background: transparent; box-shadow: none; backdrop-filter: none; }
.participant-card #idea-form > .lg__content { padding: 14px; }
.participant-card #idea-text { min-height: 128px; margin-bottom: 10px; background: rgba(255,255,255,.92); }
.participant-card .primary { min-height: 50px; border-radius: 12px; background: var(--peach); font-size: 14px; }
.participant-card #idea-feedback { min-height: 1.5em; color: #294c9a; font-weight: 650; }

@media (max-width: 760px) {
  .topbar { height: 54px; padding-inline: 14px; }
  #host-app { min-height: calc(100dvh - 54px); }
  .workspace-header { min-height: 58px; padding: 7px 14px; gap: 8px; }
  #map-title { font-size: 22px; }
  .file-actions { flex: 0 0 auto; }
  .file-actions button { min-width: 36px; min-height: 34px; padding: 7px 9px; }
  .workspace { height: calc(100dvh - 112px); min-height: 430px; overflow: hidden; }
  .tool-panel { top: 10px; left: 10px; width: calc(100% - 20px); max-height: none; height: auto; display: block; overflow: hidden; padding: 0; }
  .tool-panel > .lg__content { padding: 10px; }
  .tool-panel .panel-caption, .tool-panel .tip, .tool-panel .panel-divider { display: none; }
  .tool-panel .route-palette { display: grid; grid-template-columns: repeat(4, 32px); width: auto; gap: 4px; margin: 7px 0 0; padding: 0; border: 0; }
  .route-palette > span { display: none; }
  .tool-panel .route-palette button { width: 32px; height: 32px; margin: 0; }
  .tool-panel .wide { display: inline-flex; width: auto; min-height: 30px; margin: 5px 2px 0 0; padding: 5px 7px; border: 1px solid #dbe4f5; border-radius: 8px; background: rgba(255,255,255,.78); font-size: 10px; }
  .workspace:has(.welcome:not([hidden])) .tool-panel { display: none; }
  .palette { display: flex; margin: 0; overflow-x: auto; }
  .palette-item { flex: 0 0 auto; width: 42px; min-height: 42px; padding: 6px; border-color: #dbe4f5; background: rgba(255,255,255,.7); }
  .palette-item > span:last-child { display: none; }
  .shape-icon { flex-basis: 30px; width: 30px; height: 27px; }
  .detail-panel, .detail-panel.inbox-panel { top: auto; right: 10px; bottom: 10px; left: 10px; width: auto; max-height: min(54vh,430px); padding: 0; border-radius: var(--lg-radius); }
  .detail-panel > .lg__content { padding: 15px 14px; }
  .workspace:has(#detail-panel:not([hidden])) .tool-panel { opacity: 1; pointer-events: auto; }
  .workspace:has(#detail-panel:not([hidden])) .inbox-panel { display: none; }
  .canvas-top { top: auto; right: 10px; bottom: 10px; left: auto; }
  .canvas-bottom { right: 108px; left: 10px; bottom: 10px; }
  .canvas-chip { display: none; }
  .gesture-tip { max-width: 56%; }
  .welcome { top: 54%; width: min(500px,calc(100% - 34px)); padding: 20px 8px; }
  .welcome h1 { font-size: clamp(34px,10vw,47px); }
  .participant { padding: 54px 20px 28px; }
  .participant-card { padding-top: 14px; }
  .participant-card h1 { font-size: clamp(31px,9vw,36px); }
  .participant-card #idea-text { min-height: 220px; }
}

@media (max-width: 360px) {
  .brand > span:last-child, .app-brand .edition { display: none; }
  .app-brand { font-size: 14px; }
  .topbar > .quiet { min-height: 36px; padding-inline: 7px; font-size: 10px; }
  .file-actions #export-button span, .file-actions #team-button span { display: none; }
  .workspace { min-height: 400px; }
}

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

@media (min-width: 761px) {
  #host-app { height: calc(100dvh - 58px); }
  .workspace-header { flex-shrink: 0; }
  .tool-panel { overflow-y: auto; }
}

/* Connector controls use compact line glyphs, while their buttons remain touch-sized. */
.route-palette button,
.route-stroke-picker button {
  display: grid;
  min-width: 36px;
  min-height: 36px;
  padding: 4px;
  place-items: center;
  border: 1px solid rgba(144, 161, 193, .58);
  border-radius: 10px;
  background: rgb(255 255 255 / .38);
  box-shadow: inset 0 1px rgb(255 255 255 / .68);
}
.route-palette button svg,
.route-stroke-picker button svg {
  width: 25px;
  height: 25px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.route-palette button svg path { stroke-width: 2.25; }
.route-stroke-picker {
  display: grid;
  grid-template-columns: repeat(4, minmax(36px, 1fr));
  gap: 6px;
  margin: 12px 0 3px;
  padding-top: 11px;
  border-top: 1px solid rgb(206 217 239 / .72);
}
.route-stroke-picker > span {
  grid-column: 1 / -1;
  color: var(--sage);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .7px;
  text-transform: uppercase;
}
.route-stroke-picker button svg path { stroke-width: 2; }
[data-route-stroke='thick'] svg path,
[data-detail-route-stroke='thick'] svg path { stroke-width: 4; }
[data-route-stroke='thin-dash'] svg path,
[data-detail-route-stroke='thin-dash'] svg path { stroke-width: 2; stroke-dasharray: 7 6; }
[data-route-stroke='thick-dash'] svg path,
[data-detail-route-stroke='thick-dash'] svg path { stroke-width: 4; stroke-dasharray: 7 6; }
.route-palette button[aria-pressed='true'],
.route-stroke-picker button[aria-pressed='true'] {
  border-color: #2e65ee;
  box-shadow: 0 0 0 3px rgb(46 101 238 / .16), inset 0 1px rgb(255 255 255 / .9);
}
.route-palette button[aria-pressed='mixed'],
.route-stroke-picker button[aria-pressed='mixed'] { border-style: dashed; }
.tool-panel .route-palette,
.tool-panel .route-stroke-picker { grid-template-columns: repeat(4, 44px); }
.tool-panel .route-palette button,
.tool-panel .route-stroke-picker button { width: 44px; height: 44px; }
.detail-route-palette,
.detail-route-stroke-picker { margin: 2px 0 12px; padding-top: 0; border-top: 0; }
.detail-route-palette button,
.detail-route-stroke-picker button { width: 100%; height: 38px; }

/* The optical surface is stationary. Only panel content scrolls. */
.tool-panel,
.detail-panel { overflow: hidden; }
.tool-panel > .lg__content,
.detail-panel > .lg__content {
  height: 100%;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.tool-panel > .lg__content::-webkit-scrollbar,
.detail-panel > .lg__content::-webkit-scrollbar { width: 0; height: 0; }
.detail-panel > .lg__content { padding: 17px 14px max(20px, env(safe-area-inset-bottom)); }
.detail-panel.inbox-panel > .lg__content { display: flex; flex-direction: column; }
.tool-panel > .lg__content { padding: 17px 14px 13px; }

/* Smoke preset is mounted by app.mjs; layout belongs to its foreground wrapper. */
.connect-banner { background: transparent; box-shadow: none; backdrop-filter: none; }
.connect-banner > .lg__content {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 11px 10px 16px;
}
.connect-banner > .lg__content > span { display: grid; gap: 2px; }
.connect-banner > .lg__content button { border: 1px solid rgb(255 255 255 / .28); border-radius: 999px; }

/* The format toolbar is a Clear glass surface; its controls stay crisp. */
#text-format-toolbar { background: transparent; backdrop-filter: none; box-shadow: none; }
#text-format-toolbar > .lg__content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  padding: 8px;
}
#text-format-toolbar button {
  min-width: 32px;
  min-height: 32px;
  padding: 5px 8px;
  border: 1px solid #d7e0f2;
  border-radius: 8px;
  background: rgb(255 255 255 / .64);
  color: var(--forest);
  font-size: 13px;
}
#text-format-toolbar button[data-format='bold'] { font-weight: 800; }
#text-format-toolbar button[data-format='italic'] { font-style: italic; }
#text-format-toolbar button[data-format='underline'] { text-decoration: underline; }
.text-size-control { display: flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 4px; color: var(--forest); font-size: 11px; font-weight: 700; white-space: nowrap; }
#text-size-slider { width: 104px; accent-color: #2e65ee; }
#text-size-output { min-width: 48px; color: #294c9a; font-size: 11px; text-align: right; }
#text-format-toolbar button[aria-pressed='mixed'] { border-style: dashed; }
#text-format-toolbar button:disabled,
#text-size-slider:disabled { opacity: .52; cursor: not-allowed; }

@media (max-width: 760px) {
  .tool-panel > .lg__content { padding: 10px; }
  .tool-panel .route-palette,
  .tool-panel .route-stroke-picker { grid-template-columns: repeat(4, 32px); gap: 4px; margin: 7px 0 0; padding: 0; border: 0; }
  .tool-panel .route-palette button,
  .tool-panel .route-stroke-picker button { width: 32px; height: 32px; min-width: 32px; min-height: 32px; }
  .tool-panel .route-stroke-picker > span { display: none; }
  .detail-panel > .lg__content { padding: 15px 14px; }
  #text-format-toolbar > .lg__content { max-width: min(340px, calc(100vw - 24px)); }
  .text-size-control { width: 100%; justify-content: space-between; }
  #text-size-slider { flex: 1 1 auto; min-width: 84px; }
}

/* Mounted containers own only the optical shell; foreground content owns spacing. */
.tool-panel,
.detail-panel { padding: 0; }
.tool-panel { height: calc(100% - 36px); }
.detail-panel > .lg__content { box-sizing: border-box; }
.connect-banner {
  padding: 0;
  border: 0;
  border-radius: var(--lg-radius);
}
#text-format-toolbar {
  padding: 0;
  border: 0;
  border-radius: var(--lg-radius);
}
#text-format-toolbar button {
  min-width: 44px;
  min-height: 44px;
  background: transparent;
}
.detail-route-palette button,
.detail-route-stroke-picker button { min-height: 44px; }
@media (max-width: 760px) {
  .tool-panel { height: auto; }
}

.detail-route-palette,
.detail-route-stroke-picker {
  display: grid;
  grid-template-columns: repeat(4, minmax(44px, 1fr));
}
.detail-route-palette button,
.detail-route-stroke-picker button { width: auto; height: 44px; }
.shape-picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin: 2px 0 14px; }
.shape-picker button { min-height: 40px; border: 1px solid #d7e0f2; border-radius: 11px; background: rgb(255 255 255 / .72); color: #294c9a; font-size: 20px; }
.shape-picker svg { width: 28px; height: 28px; overflow: visible; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; vertical-align: middle; }
.shape-picker button[aria-pressed='true'] { border-color: #2e65ee; box-shadow: 0 0 0 3px rgb(46 101 238 / .14); }

.canvas-bottom { justify-content: flex-end; }

/* Stroke glyphs mirror the fixed two- and four-pixel route weights. */
.route-stroke-picker button[data-route-stroke='thick'] svg path,
.route-stroke-picker button[data-detail-route-stroke='thick'] svg path { stroke-width: 4; }
.route-stroke-picker button[data-route-stroke='thin-dash'] svg path,
.route-stroke-picker button[data-detail-route-stroke='thin-dash'] svg path { stroke-width: 2; stroke-dasharray: 7 6; }
.route-stroke-picker button[data-route-stroke='thick-dash'] svg path,
.route-stroke-picker button[data-detail-route-stroke='thick-dash'] svg path { stroke-width: 4; stroke-dasharray: 7 6; }

/* Keep the Clear format controls compact, with one deliberate row per task. */
#text-format-toolbar {
  width: min(288px, calc(100vw - 32px));
  box-sizing: border-box;
}
#text-format-toolbar > .lg__content {
  display: grid;
  grid-template-columns: repeat(3, minmax(44px, 1fr));
  gap: 8px;
  padding: 14px 18px;
}
.text-size-control {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  width: 100%;
  gap: 8px;
  padding: 0;
}
#text-size-slider { width: 100%; min-width: 0; }

.canvas-top { justify-content: flex-end; }

@media (max-width: 760px) {
  #text-format-toolbar { width: min(288px, calc(100vw - 24px)); }
  #text-format-toolbar > .lg__content { padding: 12px 16px; }
  .text-size-control { justify-content: normal; }
}
/* Header controls share one compact host row; participant Help remains available. */
body {
  height: 100dvh;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: auto;
  min-height: 72px;
  flex: 0 0 auto;
  justify-content: flex-start;
  gap: 14px;
  padding: 10px max(20px, env(safe-area-inset-right)) 10px max(20px, env(safe-area-inset-left));
}
.brand-cluster,
.topbar-actions {
  display: flex;
  align-items: center;
}
.brand-cluster {
  flex: 0 0 auto;
  gap: 10px;
}
.app-brand {
  position: static;
  transform: none;
  flex: 0 0 auto;
  font-size: 16px;
}
.map-heading {
  display: grid;
  flex: 1 1 260px;
  min-width: 150px;
  gap: 2px;
}
#map-title {
  width: 100%;
  font-size: clamp(19px, 2vw, 23px);
  line-height: 1.08;
}
#save-note {
  margin: 0;
  font-size: 10px;
}
.topbar-actions {
  flex: 0 0 auto;
  gap: 6px;
  margin-left: auto;
}
.topbar-actions > .quiet {
  min-height: 44px;
  padding-inline: 10px;
  white-space: nowrap;
}
.file-actions {
  flex-wrap: nowrap;
  gap: 5px;
}
.file-actions button {
  min-width: 44px;
  min-height: 44px;
  padding: 7px 10px;
  white-space: nowrap;
}
#host-app {
  height: auto;
  min-height: 0;
  flex: 1 1 auto;
}
body:has(#host-app[hidden]) [data-host-header] {
  display: none;
}

@media (min-width: 761px) {
  .topbar { height: 72px; }
  #host-app { height: calc(100dvh - 72px); }
  .workspace,
  .canvas-shell { height: 100%; }
}

@media (max-width: 760px) {
  .topbar {
    min-height: 0;
    flex-wrap: wrap;
    gap: 6px 10px;
    padding: 8px 12px;
  }
  .brand-cluster { order: 1; }
  .map-heading {
    order: 2;
    flex-basis: 100%;
  }
  .topbar-actions { order: 3; margin-left: auto; }
  .workspace {
    height: auto;
    min-height: 400px;
    flex: 1 1 auto;
  }
}

@media (max-width: 360px) {
  .brand > span:last-child { display: grid; }
  .topbar-actions > .quiet { min-height: 44px; padding-inline: 7px; font-size: 10px; }
  .file-actions #import-button span,
  .file-actions #export-button span,
  .file-actions #team-button span { display: none; }
}