:root {
  --dock-pad-x: 18px;
  --dock-pad-y: 16px;
  --icon: 58px;
  --gap: 12px;
  --radius: 26px;
  --glass: rgba(255, 255, 255, 0.28);
  --glass-border: rgba(255, 255, 255, 0.58);
  --ink: rgba(20, 24, 28, 0.88);
  --muted: rgba(20, 24, 28, 0.58);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter",
    "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #87c5d8;
  color: var(--ink);
}

body {
  min-height: 100dvh;
  overflow: hidden;
}

/* First impression: only the dock until hover reveals the chrome. */
.topbar,
.hint,
.controls,
.corner-link,
.ai-chat {
  transition:
    opacity 0.95s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.95s cubic-bezier(0.22, 1, 0.36, 1);
}

body.intro-pending .topbar,
body.intro-pending .hint,
body.intro-pending .controls,
body.intro-pending .corner-link,
body.intro-pending .ai-chat {
  opacity: 0;
  pointer-events: none;
}

body.intro-pending .topbar {
  transform: translateY(-8px);
  transition-delay: 0s;
}

body.intro-pending .hint {
  transform: translateX(-50%) translateY(6px);
  transition-delay: 0.06s;
}

body.intro-pending .controls {
  transform: translateX(-50%) translateY(8px);
  transition-delay: 0.12s;
}

body.intro-pending .corner-link {
  transform: translateY(6px);
  transition-delay: 0.16s;
}

body.intro-pending .ai-chat {
  transform: translateY(6px) scale(0.96);
  transition-delay: 0.2s;
}

body.intro-revealed .topbar {
  transition-delay: 0.02s;
}

body.intro-revealed .hint {
  transition-delay: 0.1s;
}

body.intro-revealed .controls {
  transition-delay: 0.18s;
}

body.intro-revealed .corner-link {
  transition-delay: 0.24s;
}

body.intro-revealed .ai-chat {
  transition-delay: 0.3s;
}

@media (prefers-reduced-motion: reduce) {
  .topbar,
  .hint,
  .controls,
  .corner-link,
  .ai-chat {
    transition: none;
  }

  body.intro-pending .topbar,
  body.intro-pending .hint,
  body.intro-pending .controls,
  body.intro-pending .corner-link,
  body.intro-pending .ai-chat {
    opacity: 1;
    pointer-events: auto;
  }

  body.intro-pending .topbar,
  body.intro-pending .corner-link,
  body.intro-pending .ai-chat {
    transform: none;
  }

  body.intro-pending .hint,
  body.intro-pending .controls {
    transform: translateX(-50%);
  }
}

button,
input {
  font: inherit;
}

.world,
.bg,
.vignette {
  position: fixed;
  inset: 0;
}

.bg {
  background-color: #7eb8cc;
  background-position: center;
  background-size: cover;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 0.9s ease;
  animation: kenburns 42s ease-in-out infinite alternate;
}

.bg.is-active {
  opacity: 1;
}

.world,
.bg {
  pointer-events: none;
}

.vignette {
  background: radial-gradient(
    ellipse at center,
    transparent 45%,
    rgba(0, 20, 40, 0.18) 100%
  );
  pointer-events: none;
}

@keyframes kenburns {
  from {
    transform: scale(1.04);
  }
  to {
    transform: scale(1.12);
  }
}

.topbar {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 32px 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

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

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: white;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.28);
}

.brand-copy strong {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand-copy small {
  font-size: 12px;
  opacity: 0.86;
}

.quiet-link,
.corner-link {
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.quiet-link:hover,
.corner-link:hover {
  background: rgba(255, 255, 255, 0.26);
}

.corner-link {
  position: fixed;
  left: 24px;
  bottom: 22px;
  z-index: 5;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.corner-link:hover {
  background: transparent;
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.about-gate {
  position: fixed;
  inset: 0;
  z-index: 12;
  display: none;
  place-items: center;
  padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right))
    max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}

.about-gate.is-open {
  display: grid;
}

.about-gate-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  cursor: pointer;
  background:
    radial-gradient(ellipse 70% 55% at 30% 80%, rgba(120, 190, 210, 0.18), transparent 55%),
    rgba(8, 16, 24, 0.55);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}

.about-gate-panel {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  padding: 36px 32px 28px;
  border-radius: 28px;
  color: #fff;
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.22) 0%,
    rgba(255, 255, 255, 0.08) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(36px) saturate(170%);
  -webkit-backdrop-filter: blur(36px) saturate(170%);
  animation: ai-gate-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
  pointer-events: auto;
}

.about-gate-close {
  position: absolute;
  top: 12px;
  right: 14px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}

.about-gate-close:hover {
  color: #fff;
}

.about-gate-eyebrow {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
}

.about-gate-panel h2 {
  margin: 0;
  font-size: clamp(1.45rem, 3.4vw, 1.85rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.2;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.25);
}

.about-gate-body {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.about-gate-body p {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.82);
  max-width: 36ch;
}

.about-gate-body a {
  color: #fff;
  font-weight: 650;
  text-underline-offset: 3px;
}

.about-gate-link {
  display: inline-flex;
  margin-top: 22px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  text-underline-offset: 3px;
}

.about-gate-link:hover {
  color: #fff;
  text-decoration: underline;
}

.ai-chat {
  position: fixed;
  right: 22px;
  bottom: 20px;
  z-index: 5;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.16);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  transition:
    background 0.25s ease,
    transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.25s ease;
}

.ai-chat:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.ai-chat:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.65);
  outline-offset: 3px;
}

.ai-chat-icon {
  display: grid;
  place-items: center;
  opacity: 0.9;
}

.ai-chat-tip {
  position: absolute;
  right: calc(100% + 12px);
  bottom: 50%;
  transform: translateY(50%) translateX(6px);
  width: max-content;
  max-width: min(220px, calc(100vw - 100px));
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(18, 28, 38, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.92);
  font-size: 12px;
  line-height: 1.35;
  letter-spacing: -0.01em;
  text-align: left;
  text-shadow: none;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.45s ease,
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0.45s;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}

.ai-chat-tip::after {
  content: "";
  position: absolute;
  right: -5px;
  bottom: 50%;
  width: 8px;
  height: 8px;
  background: rgba(18, 28, 38, 0.72);
  border-right: 1px solid rgba(255, 255, 255, 0.18);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  transform: translateY(50%) rotate(45deg);
}

.ai-chat.is-tip-visible .ai-chat-tip,
.ai-chat:hover .ai-chat-tip {
  opacity: 1;
  visibility: visible;
  transform: translateY(50%) translateX(0);
}

.ai-chat.is-tip-nudge {
  animation: ai-chat-breathe 2.4s ease;
}

@keyframes ai-gate-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ai-gate {
  position: fixed;
  inset: 0;
  z-index: 12;
  display: grid;
  place-items: center;
  padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right))
    max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}

.ai-gate[hidden] {
  display: none;
}

.ai-gate-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  cursor: pointer;
  background:
    radial-gradient(ellipse 70% 55% at 70% 80%, rgba(120, 190, 210, 0.22), transparent 55%),
    rgba(8, 16, 24, 0.55);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}

.ai-gate-panel {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  padding: 36px 32px 28px;
  border-radius: 28px;
  color: #fff;
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.22) 0%,
    rgba(255, 255, 255, 0.08) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(36px) saturate(170%);
  -webkit-backdrop-filter: blur(36px) saturate(170%);
  animation: ai-gate-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.ai-gate-close {
  position: absolute;
  top: 12px;
  right: 14px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}

.ai-gate-close:hover {
  color: #fff;
}

.ai-gate-eyebrow {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
}

.ai-gate-panel h2 {
  margin: 0;
  font-size: clamp(1.45rem, 3.4vw, 1.85rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.2;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.25);
}

.ai-gate-lead {
  margin: 12px 0 0;
  font-size: 15px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.78);
  max-width: 34ch;
}

.ai-gate-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 28px;
}

.ai-gate-action {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 16px 18px;
  border-radius: 16px;
  text-decoration: none;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  transition:
    background 0.2s ease,
    transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.2s ease;
}

.ai-gate-action:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}

.ai-gate-action.is-primary {
  background: rgba(255, 255, 255, 0.88);
  color: #163041;
  border-color: rgba(255, 255, 255, 0.95);
}

.ai-gate-action.is-primary:hover {
  background: #fff;
  color: #0f2430;
}

.ai-gate-action-label {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.ai-gate-action-hint {
  font-size: 12px;
  opacity: 0.72;
  font-weight: 450;
}

.ai-gate-action.is-primary .ai-gate-action-hint {
  color: rgba(22, 48, 65, 0.62);
  opacity: 1;
}

@keyframes ai-chat-breathe {
  0%,
  100% {
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.16);
  }
  50% {
    box-shadow:
      0 14px 32px rgba(0, 0, 0, 0.16),
      0 0 0 6px rgba(255, 255, 255, 0.12);
  }
}

.stage {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: max-content;
}

.hint {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 16px);
  transform: translateX(-50%);
  margin: 0;
  max-width: min(36rem, calc(100vw - 32px));
  text-align: center;
  color: white;
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
  white-space: normal;
  width: max-content;
}

.hint em {
  font-style: normal;
  font-weight: 650;
}

.hint.is-alert {
  animation: hint-pulse 0.9s ease;
}

@keyframes hint-pulse {
  0%,
  100% {
    transform: translateX(-50%) scale(1);
  }
  40% {
    transform: translateX(-50%) scale(1.03);
  }
}

.controls {
  position: absolute;
  left: 50%;
  top: calc(100% + 14px);
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  margin-top: 0;
}

.glass-btn,
.dock,
.sheet-card,
.quiet-link {
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.16);
}

.glass-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: white;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.25);
  border-radius: 999px;
  padding: 9px 14px;
  cursor: pointer;
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
}

.glass-btn[aria-pressed="true"] {
  background: rgba(255, 255, 255, 0.5);
  color: #163041;
  text-shadow: none;
}

.dock-shell {
  position: relative;
  max-width: 100%;
  /* Top gutter lets icons magnify/lift without being clipped when we scroll-x. */
  padding-top: 0;
  margin-top: 0;
  overflow: visible;
}

.dock-shell.is-scrollable {
  padding-top: 52px;
  padding-bottom: 40px;
  margin-top: -52px;
  margin-bottom: -40px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
  touch-action: pan-x;
}

.dock-shell.is-scrollable::-webkit-scrollbar {
  display: none;
}

.dock-shell.is-panning {
  cursor: grabbing;
  user-select: none;
}

.dock {
  display: flex;
  align-items: center;
  gap: var(--gap);
  padding: var(--dock-pad-y) var(--dock-pad-x);
  overflow: visible;
  border-radius: 32px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.46) 0%,
    rgba(255, 255, 255, 0.18) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  box-shadow:
    0 20px 50px rgba(16, 38, 58, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 -1px 0 rgba(255, 255, 255, 0.14);
  position: relative;
  transition:
    width 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    height 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    padding 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    border-radius 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.45s ease,
    max-width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.dock.is-pyramid {
  display: block;
  width: var(--pyramid-w, 380px);
  height: var(--pyramid-h, 250px);
  padding: 22px 24px 28px;
  border-radius: 36px;
}

.dock.is-pyramid .add-btn {
  opacity: 0;
  pointer-events: none;
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.dock.is-pyramid .dock-item {
  position: absolute;
  margin: 0;
  flex: none;
}

.dock.is-pyramid .dock-item .tooltip {
  top: auto;
  bottom: calc(100% + 10px);
}

.pyramid-labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.dock.is-pyramid .pyramid-labels {
  opacity: 1;
}

.pyramid-label {
  position: absolute;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  pointer-events: auto;
  cursor: text;
  outline: none;
  border-radius: 4px;
  padding: 4px 2px;
  transition:
    color 0.25s ease,
    background-color 0.25s ease,
    box-shadow 0.25s ease,
    opacity 0.35s ease;
}

.pyramid-label:hover {
  color: rgba(255, 255, 255, 0.78);
}

.pyramid-label.is-editing {
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  caret-color: rgba(255, 255, 255, 0.85);
}

.pyramid-label.is-reverting {
  animation: label-revert 0.45s ease;
}

@keyframes label-revert {
  0% {
    opacity: 0.35;
    color: rgba(255, 255, 255, 0.35);
  }
  100% {
    opacity: 1;
    color: rgba(255, 255, 255, 0.55);
  }
}

.pyramid-slot {
  position: absolute;
  width: var(--icon);
  height: var(--icon);
  border-radius: 22.5%;
  border: 1.5px dashed rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
  pointer-events: auto;
  box-sizing: border-box;
  padding: 0;
  margin: 0;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.55);
  display: grid;
  place-items: center;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.pyramid-slot-plus {
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
  opacity: 0.55;
  transform: translateY(-1px);
  transition: opacity 0.2s ease;
}

.pyramid-slot:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.55);
  color: rgba(255, 255, 255, 0.9);
  transform: scale(1.04);
}

.pyramid-slot:hover:not(:disabled) .pyramid-slot-plus {
  opacity: 0.95;
}

.pyramid-slot:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.55);
  outline-offset: 3px;
}

.pyramid-slot:disabled {
  cursor: default;
  opacity: 0.45;
}

.dock.is-pyramid .dock-item .tooltip {
  display: none;
}

.dock-item,
.add-btn {
  position: relative;
  width: var(--icon);
  flex: 0 0 var(--icon);
  display: flex;
  flex-direction: column;
  align-items: center;
  user-select: none;
  -webkit-user-select: none;
}

.divider-btn {
  position: relative;
  display: grid;
  place-items: center;
  user-select: none;
  -webkit-user-select: none;
}

.dock-divider {
  width: 18px;
  flex: 0 0 18px;
}

.divider-hit {
  position: relative;
  width: 18px;
  height: var(--icon);
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: grab;
  display: grid;
  place-items: center;
  touch-action: none;
}

.divider-hit:active {
  cursor: grabbing;
}

.divider-bar {
  display: block;
  width: 2px;
  height: 42%;
  min-height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.2);
  transition:
    opacity 0.18s ease,
    background 0.18s ease;
}

.dock-divider:hover .divider-bar,
.dock-divider:focus-within .divider-bar {
  background: rgba(255, 255, 255, 0.78);
}

.dock-divider.is-dragging .divider-bar {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.dock-divider.is-remove-ready .divider-bar {
  opacity: 0.4;
}

.dock.is-pyramid .dock-divider,
.dock.is-pyramid .divider-btn {
  display: none;
}

.divider-btn {
  width: 22px;
  flex: 0 0 22px;
  height: var(--icon);
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.7);
}

.divider-btn-glyph {
  display: block;
  width: 2px;
  height: 42%;
  min-height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  transition:
    background 0.18s ease,
    opacity 0.18s ease;
}

.divider-btn:hover .divider-btn-glyph,
.divider-btn:focus-visible .divider-btn-glyph {
  background: rgba(255, 255, 255, 0.62);
}

.divider-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.divider-btn:disabled:hover .divider-btn-glyph {
  background: rgba(255, 255, 255, 0.28);
}

.dock-placeholder.is-divider-hole {
  flex: 0 0 18px;
  width: 18px;
}

.icon-hit {
  position: relative;
  width: var(--icon);
  height: var(--icon);
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  transform-origin: 50% 100%;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}

.dock-icon,
.add-glyph,
.preview-icon {
  width: var(--icon);
  height: var(--icon);
  border-radius: 22.5%;
  overflow: hidden;
  background: transparent;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
  display: grid;
  place-items: center;
  position: relative;
  transform-origin: 50% 100%;
  transition:
    transform 0.18s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.18s ease;
}

.dock-icon {
  pointer-events: none;
  padding: 0;
  box-sizing: border-box;
  border: 0;
}

.dock-icon.is-dark {
  /* No light rim — dark marks sit flush on the glass dock */
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.34);
}

.dock-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  transform: scale(var(--icon-scale, 1));
  transform-origin: center;
}

.dock-icon.letter {
  color: white;
  font-weight: 700;
  font-size: calc(var(--icon) * 0.38);
}

.hold-ring {
  position: absolute;
  inset: -5px;
  border-radius: 28%;
  pointer-events: none;
  background: conic-gradient(
    #fff var(--hold, 0%),
    rgba(255, 255, 255, 0.12) 0
  );
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  opacity: 0;
}

.dock-item.is-holding .hold-ring {
  opacity: 1;
}

.dock-item.is-anchored .dock-icon {
  box-shadow:
    0 0 0 2px #ffd166,
    0 8px 18px rgba(0, 0, 0, 0.22);
}

.dock-item.is-anchored .dock-icon.is-dark {
  box-shadow:
    0 0 0 2px #ffd166,
    0 10px 22px rgba(0, 0, 0, 0.34);
}

.dock-item:hover,
.dock-item:focus-within {
  z-index: 20;
}

.tooltip {
  position: absolute;
  top: calc(100% + 8px);
  bottom: auto;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: rgba(40, 40, 40, 0.88);
  color: white;
  font-size: 12px;
  padding: 5px 8px;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
  z-index: 5;
}

.dock-item:hover .tooltip,
.add-btn:hover .tooltip,
.divider-btn:hover .tooltip {
  opacity: 1;
}

.add-btn {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.add-glyph {
  background: rgba(255, 255, 255, 0.22);
  color: white;
  font-size: 32px;
  font-weight: 300;
  border: 1.5px dashed rgba(255, 255, 255, 0.7);
  box-shadow: none;
  transform-origin: 50% 100%;
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
  display: grid;
  place-items: center;
  line-height: 1;
}

.dock-item.is-dragging {
  cursor: grabbing;
  z-index: 30;
  transition: none !important;
}

.dock-placeholder {
  flex: 0 0 var(--icon);
  width: var(--icon);
  height: var(--icon);
  border-radius: 22.5%;
  border: 0;
  background: transparent;
  pointer-events: none;
  transition: margin 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.dock-placeholder.is-pyramid-hole {
  border: 1.5px dashed rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.06);
  box-sizing: border-box;
}

.dock-item.is-dragging .dock-icon {
  transform: scale(1.08) !important;
  box-shadow:
    0 18px 36px rgba(0, 0, 0, 0.28),
    0 2px 6px rgba(0, 0, 0, 0.18);
  transition:
    transform 0.18s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.18s ease,
    opacity 0.18s ease,
    filter 0.18s ease;
}

.dock-item.is-remove-ready .dock-icon {
  opacity: 0.42;
  transform: scale(0.78) !important;
  filter: grayscale(0.2) brightness(1.08);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
}

.dock-item.is-disappearing {
  pointer-events: none;
}

.dock-item.is-disappearing .dock-icon {
  transition: none !important;
}

.dock-item.is-dragging .tooltip {
  opacity: 0;
}

.dock-item.is-drifting .dock-icon {
  animation: drift 1.6s ease-in-out infinite;
}

@keyframes drift {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(255, 255, 255, 0.14), transparent 55%),
    rgba(10, 22, 32, 0.42);
  backdrop-filter: blur(12px) saturate(130%);
  -webkit-backdrop-filter: blur(12px) saturate(130%);
  animation: sheet-backdrop-in 0.35s ease both;
}

.sheet[hidden] {
  display: none;
}

@keyframes sheet-backdrop-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes sheet-card-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.sheet-card {
  --sheet-ink: #15232f;
  --sheet-muted: rgba(21, 35, 47, 0.58);
  --sheet-line: rgba(21, 35, 47, 0.1);
  --sheet-focus: #2a7a8c;
  width: min(440px, calc(100vw - 32px));
  max-height: min(90dvh, 920px);
  overflow: auto;
  overscroll-behavior: contain;
  font-family: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--sheet-ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(246, 249, 251, 0.88) 100%);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 28px;
  padding: 28px 26px 22px;
  position: relative;
  backdrop-filter: blur(40px) saturate(160%);
  -webkit-backdrop-filter: blur(40px) saturate(160%);
  box-shadow:
    0 28px 64px rgba(8, 24, 36, 0.28),
    0 2px 0 rgba(255, 255, 255, 0.7) inset,
    0 -1px 0 rgba(21, 35, 47, 0.04) inset;
  animation: sheet-card-in 0.48s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.sheet-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(21, 35, 47, 0.06);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--sheet-muted);
  display: grid;
  place-items: center;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

.sheet-close:hover {
  background: rgba(21, 35, 47, 0.1);
  color: var(--sheet-ink);
}

.sheet-close:active {
  transform: scale(0.96);
}

.sheet-header {
  padding-right: 36px;
  margin-bottom: 18px;
}

.sheet-eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sheet-muted);
}

.sheet-card h2 {
  margin: 0;
  font-size: clamp(1.45rem, 3.5vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.15;
  color: var(--sheet-ink);
}

.sheet-lead {
  margin: 8px 0 0;
  color: var(--sheet-muted);
  font-size: 15px;
  line-height: 1.45;
  max-width: 34ch;
}

.sheet-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.preview {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 22px;
  padding: 14px 16px;
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(232, 242, 246, 0.65));
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    0 10px 24px rgba(21, 35, 47, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.preview-icon {
  width: 64px;
  height: 64px;
  font-size: 26px;
  color: #7a8794;
  background: rgba(255, 255, 255, 0.85);
  flex: none;
  cursor: default;
  border-radius: 18px;
  transform-origin: center;
  box-shadow:
    0 12px 22px rgba(21, 35, 47, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.65);
}

.preview-icon.is-pickable {
  cursor: crosshair;
  box-shadow:
    0 12px 22px rgba(21, 35, 47, 0.14),
    0 0 0 3px rgba(42, 122, 140, 0.28);
}

.preview-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(var(--icon-scale, 1));
  transform-origin: center;
  pointer-events: none;
}

.preview-meta {
  min-width: 0;
}

.preview-meta strong,
.preview-meta small {
  display: block;
}

.preview-meta strong {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--sheet-ink);
}

.preview-meta small {
  color: var(--sheet-muted);
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 14px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--sheet-muted);
}

.field input {
  border: 1px solid var(--sheet-line);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 14px;
  padding: 13px 14px;
  font-size: 16px;
  font-family: inherit;
  color: var(--sheet-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.field input::placeholder {
  color: rgba(21, 35, 47, 0.34);
}

.field input:hover {
  border-color: rgba(21, 35, 47, 0.18);
}

.field input:focus {
  outline: none;
  border-color: rgba(42, 122, 140, 0.55);
  background: #fff;
  box-shadow:
    0 0 0 4px rgba(42, 122, 140, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.icon-tools {
  margin: 2px 0 16px;
  padding: 14px 14px 12px;
  border-radius: 18px;
  background: rgba(21, 35, 47, 0.035);
  border: 1px dashed rgba(21, 35, 47, 0.12);
}

.icon-tools[hidden] {
  display: none;
}

.icon-tools-title {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--sheet-ink);
}

.icon-tools-title span {
  font-weight: 500;
  color: var(--sheet-muted);
}

.icon-tools-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
}

.icon-tools-row + .icon-tools-row {
  margin-top: 10px;
}

.icon-tools-caption {
  width: 32px;
  flex: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--sheet-muted);
}

.icon-fill-controls {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}

.icon-swatches {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.icon-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(21, 35, 47, 0.14);
  padding: 0;
  cursor: pointer;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.icon-swatch:hover {
  transform: scale(1.08);
}

.icon-swatch.is-active {
  box-shadow:
    0 0 0 2px #fff,
    0 0 0 3.5px rgba(42, 122, 140, 0.75);
}

.icon-swatch.is-none {
  background:
    linear-gradient(45deg, #d0d5db 25%, transparent 25%),
    linear-gradient(-45deg, #d0d5db 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #d0d5db 75%),
    linear-gradient(-45deg, transparent 75%, #d0d5db 75%);
  background-size: 8px 8px;
  background-position: 0 0, 0 4px, 4px -4px, -4px 0;
  background-color: #f4f6f8;
}

.icon-color-wrap {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(21, 35, 47, 0.14);
  flex: none;
  cursor: pointer;
}

.icon-color-wrap input {
  width: 38px;
  height: 38px;
  border: 0;
  padding: 0;
  transform: translate(-6px, -6px);
  cursor: pointer;
  background: transparent;
}

.icon-tool-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(21, 35, 47, 0.1);
  background: rgba(255, 255, 255, 0.9);
  color: var(--sheet-ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}

.icon-tool-btn:hover,
.icon-tool-btn.is-active {
  background: #fff;
  border-color: rgba(42, 122, 140, 0.45);
}

.icon-tools-row input[type="range"] {
  flex: 1;
  min-width: 0;
  accent-color: var(--sheet-focus);
}

.icon-scale-value {
  width: 42px;
  flex: none;
  text-align: right;
  font-size: 12px;
  font-weight: 600;
  color: var(--sheet-muted);
  font-variant-numeric: tabular-nums;
}

.icon-tools-hint {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--sheet-muted);
}

.icon-tools-hint[hidden] {
  display: none;
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 18px;
}

.chip {
  border: 1px solid rgba(21, 35, 47, 0.08);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  color: var(--sheet-ink);
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease;
}

.chip:hover {
  background: #fff;
  border-color: rgba(42, 122, 140, 0.35);
  transform: translateY(-1px);
}

.primary-btn {
  width: 100%;
  border: 0;
  border-radius: 16px;
  padding: 15px 16px;
  background: linear-gradient(180deg, #243846 0%, #15232f 100%);
  color: white;
  font-family: inherit;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.02em;
  cursor: pointer;
  box-shadow:
    0 14px 28px rgba(21, 35, 47, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transition:
    transform 0.18s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.18s ease,
    filter 0.18s ease;
}

.primary-btn:hover {
  filter: brightness(1.06);
  box-shadow:
    0 16px 32px rgba(21, 35, 47, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.primary-btn:active {
  transform: translateY(1px) scale(0.99);
}

@media (prefers-reduced-motion: reduce) {
  .sheet,
  .sheet-card {
    animation: none;
  }
}

.primary-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 720px) {
  .controls {
    flex-wrap: wrap;
    justify-content: center;
    max-width: calc(100vw - 24px);
    top: calc(100% + 10px);
    gap: 8px;
  }

  .topbar {
    padding: max(14px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
      0 max(16px, env(safe-area-inset-left));
  }

  .corner-link {
    left: max(14px, env(safe-area-inset-left));
    bottom: max(14px, env(safe-area-inset-bottom));
    font-size: 12px;
    padding: 0;
  }

  .ai-chat {
    right: max(14px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    width: 44px;
    height: 44px;
  }

  .ai-chat-tip {
    max-width: min(180px, calc(100vw - 90px));
    font-size: 11px;
  }

  .ai-gate-panel,
  .about-gate-panel {
    padding: 32px 22px 24px;
    border-radius: 24px;
  }

  .topbar-actions .glass-btn {
    font-size: 12px;
    padding: 8px 12px;
    min-height: 40px;
  }

  :root {
    --icon: 48px;
    --gap: 8px;
    --dock-pad-x: 10px;
    --dock-pad-y: 12px;
  }

  .stage {
    left: 50%;
    top: 46%;
    transform: translate(-50%, -50%);
    width: min(100vw - 16px, max-content);
  }

  .hint {
    font-size: 13px;
    max-width: min(36rem, calc(100vw - 28px));
    bottom: calc(100% + 12px);
  }

  .sheet {
    place-items: end center;
    padding: 0;
    background:
      linear-gradient(180deg, rgba(10, 22, 32, 0.2), rgba(10, 22, 32, 0.5)),
      rgba(10, 22, 32, 0.35);
  }

  .sheet-card {
    width: 100%;
    max-width: none;
    border-radius: 28px 28px 0 0;
    padding: 26px 20px calc(20px + env(safe-area-inset-bottom));
    max-height: min(92dvh, 100%);
    overflow: auto;
    animation-name: sheet-card-in-mobile;
  }

  @keyframes sheet-card-in-mobile {
    from {
      opacity: 0;
      transform: translateY(28px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .preview {
    padding: 12px 14px;
  }

  .preview-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
  }

  .glass-btn {
    min-height: 40px;
  }
}

/* Touch / stylus: names on press (no real hover). */
@media (hover: none) {
  .dock-item:active .tooltip,
  .dock-item:focus-within .tooltip,
  .add-btn:active .tooltip,
  .divider-btn:active .tooltip {
    opacity: 1;
  }

  .dock-shell.is-scrollable {
    padding-top: 24px;
    padding-bottom: 36px;
    margin-top: -24px;
    margin-bottom: -36px;
  }
}
