.app {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
}

body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.toolbar {
  position: absolute;
  z-index: 20;
  top: 14px;
  left: 14px;
  right: 14px;
  pointer-events: none;
}

.toolbar-glass {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 52px;
  padding: 6px 8px 6px 14px;
  border-radius: var(--r-pill);
  background: var(--glass);
  border: 1px solid var(--glass-stroke);
  box-shadow: var(--shadow-1), inset 0 0.5px 0 rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(22px) saturate(1.4);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
}

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

.brand-mark {
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  position: relative;
  background: radial-gradient(circle at 34% 30%, #f4fffc, #8ed4ca 46%, #1c645e 100%);
  box-shadow: 0 6px 14px rgba(12, 80, 74, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 1px;
}

.brand-mark::before {
  left: 50%;
  top: 6px;
  width: 1.5px;
  height: 16px;
  transform: translateX(-50%);
}

.brand-mark::after {
  left: 6px;
  top: 50%;
  width: 16px;
  height: 1.5px;
  transform: translateY(-50%);
}

.brand-copy { min-width: 0; }

.brand-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-headline);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.brand-sub {
  margin: 0;
  color: var(--label-secondary);
  font-size: var(--text-caption);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 42vw;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.save-pill {
  font-size: var(--text-caption);
  color: var(--accent-bright);
  padding: 0 8px;
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}

.save-pill.is-on { opacity: 1; }

.btn {
  border: 0;
  background: var(--fill);
  color: var(--label);
  border-radius: var(--r-pill);
  min-height: 36px;
  padding: 0 14px;
  font-size: var(--text-subhead);
  font-weight: 560;
  letter-spacing: -0.012em;
  line-height: 1.2;
}

.btn:hover { background: rgba(120, 120, 128, 0.24); }

.btn-plain {
  background: transparent;
  color: var(--accent);
}

.btn-plain:hover { background: rgba(12, 110, 102, 0.08); }

.btn-tinted {
  background: var(--accent-deep);
  color: var(--accent);
}

.btn-tinted:hover { background: #d7efe9; }

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 650;
}

.btn-primary:hover { filter: brightness(1.06); }

.btn-danger {
  background: transparent;
  color: var(--destructive);
}

.btn-danger:hover { background: rgba(196, 30, 22, 0.08); }

.btn-block { width: 100%; }

.btn.is-on {
  background: var(--accent);
  color: var(--accent-ink);
}

.icon-btn, .text-btn {
  border: 0;
  background: transparent;
  color: var(--label-secondary);
  border-radius: var(--r-sm);
}

.icon-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  position: relative;
  flex: none;
}

.icon-btn::before {
  content: "";
  position: absolute;
  inset: -6px;
}

.icon-btn:hover, .text-btn:hover {
  color: var(--label);
  background: var(--hover);
}

.text-btn {
  padding: 4px 8px;
  min-height: 32px;
  font-size: var(--text-footnote);
  color: var(--accent);
}

.mini-icon { width: 15px; height: 15px; display: block; }

.plane {
  flex: 1;
  min-height: 0;
}

.plane-scroll {
  height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.22) transparent;
}

.noscript {
  margin: 24px;
  padding: 16px 18px;
  background: var(--glass-thick);
  border-radius: var(--r-lg);
}

.caption {
  margin: 0;
  color: var(--label-tertiary);
  font-size: var(--text-caption);
  font-weight: 560;
  letter-spacing: -0.006em;
}

.fine {
  margin: 0;
  color: var(--label-secondary);
  font-size: var(--text-footnote);
  line-height: 1.4;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .toolbar-glass,
  .wizard-card,
  .drawer-panel,
  .modal,
  .popover,
  .map-sheet,
  .stage-head,
  .corner,
  .persona-cell,
  .y-add,
  .segment-label {
    background: #ffffff;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .toolbar-glass,
  .wizard-card,
  .drawer-panel,
  .modal,
  .popover,
  .map-sheet,
  .scrim,
  .overlay,
  .channel-map {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .toolbar-glass,
  .wizard-card,
  .drawer-panel,
  .modal,
  .popover,
  .map-sheet,
  .stage-head,
  .corner,
  .persona-cell {
    background: #ffffff;
  }
}

@media (max-width: 800px) {
  .toolbar {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    margin: 10px 10px 0;
  }

  .toolbar-glass {
    border-radius: 22px;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .save-pill { transition: none; }
}
