/* CHAOS.COLLAGE — editor UI (2026-10 productization)
   Dark neutral chrome, one acid accent used sparingly, sans-serif only.
   Content colors (cyan / magenta / orange) stay on the canvas and previews. */

:root {
  --bg: #0c0c0e;
  --panel: #121215;
  --panel-2: #17171c;
  --panel-3: #1e1e24;
  --panel-4: #26262e;
  --line: rgba(255, 255, 255, 0.07);
  --line-bright: rgba(255, 255, 255, 0.14);
  --text: #ededea;
  --muted: #a0a0a8;
  --faint: #6c6c75;
  --hot: #d7ff2f;
  --hot-soft: rgba(215, 255, 47, 0.12);
  --cyan: #20e3d1;
  --magenta: #ff4ca7;
  --orange: #ff7a18;
  --danger: #ff5f6b;
  --radius: 8px;
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --check-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='8' viewBox='0 0 10 8'%3E%3Cpath d='M1 4.2 3.8 6.8 9 1.2' fill='none' stroke='%23141410' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath d='M1 1l3 3 3-3' fill='none' stroke='%239b9ba2' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 12px;
  -webkit-font-smoothing: antialiased;
}

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

::selection {
  background: rgba(215, 255, 47, 0.25);
}

[hidden] {
  display: none !important;
}

.icon {
  width: 14px;
  height: 14px;
  flex: none;
  display: block;
}

/* thin scrollbars */
.tab-panel,
.inspector,
.flyout-body,
.home,
.projects-grid,
.font-picker-list,
.menu,
.csel-menu,
.modal-body,
.history-list {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.22);
  background-clip: padding-box;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

@keyframes cc-reveal {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

@keyframes cc-pop {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.985);
  }
}

/* ---------- buttons ---------- */

.ui-button,
.icon-button,
.mini-button,
.seed-button,
.tool-button,
.opt-button,
.opt-icon,
.chip,
.seg-btn,
.zoom-value,
.link-button,
.menu-trigger {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 150ms var(--ease), color 150ms var(--ease), border-color 150ms var(--ease), transform 150ms var(--ease), opacity 150ms var(--ease);
}

.ui-button:hover,
.icon-button:hover,
.mini-button:hover,
.seed-button:hover,
.tool-button:hover,
.opt-button:hover,
.opt-icon:hover,
.chip:hover,
.zoom-value:hover,
.menu-trigger:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.ui-button:active,
.icon-button:active,
.mini-button:active,
.tool-button:active,
.opt-button:active,
.opt-icon:active,
.chip:active {
  transform: scale(0.97);
}

button:disabled {
  opacity: 0.32;
  cursor: default;
  transform: none !important;
}

button:disabled:hover {
  background: transparent;
  color: var(--muted);
}

button:focus-visible,
input:focus-visible,
.project-card:focus-visible {
  outline: 2px solid rgba(215, 255, 47, 0.45);
  outline-offset: 1px;
}

.ui-button {
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  border-color: var(--line);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.ui-button.icon-only {
  width: 30px;
  padding: 0;
  border-color: transparent;
}

.ui-button.icon-only .icon {
  width: 15px;
  height: 15px;
}

.ui-button.primary {
  border-color: transparent;
  background: var(--hot);
  color: #141410;
  font-weight: 600;
}

.ui-button.primary:hover {
  background: #e2ff55;
  color: #141410;
}

.ui-button.danger {
  border-color: rgba(255, 95, 107, 0.35);
  color: var(--danger);
}

.ui-button.danger.primary,
.ui-button.danger:hover {
  background: rgba(255, 95, 107, 0.16);
  color: #ff8a93;
}

.inline-icon {
  display: inline-flex;
}

.icon-button {
  height: 24px;
  padding: 0 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.icon-button.icon-only {
  width: 24px;
  padding: 0;
  display: inline-grid;
  place-items: center;
}

.icon-button.icon-only .icon {
  width: 13px;
  height: 13px;
}

.mini-button {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 9px;
  border-color: var(--line);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.mini-button .icon {
  width: 13px;
  height: 13px;
}

.mini-button:hover {
  border-color: var(--line-bright);
}

.mini-button.wide {
  width: 100%;
}

.mini-button.ghost {
  border-color: transparent;
  color: var(--faint);
  justify-self: start;
}

.mini-button.on {
  border-color: rgba(215, 255, 47, 0.35);
  background: var(--hot-soft);
  color: var(--text);
}

.mini-button.danger {
  color: var(--danger);
  border-color: rgba(255, 95, 107, 0.22);
}

.mini-button.danger:hover {
  background: rgba(255, 95, 107, 0.09);
  border-color: rgba(255, 95, 107, 0.4);
  color: var(--danger);
}

.link-button {
  padding: 0;
  border: 0;
  color: var(--hot);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: inherit;
}

.link-button:hover {
  background: transparent;
  color: #e9ff8a;
}

.chip {
  min-height: 24px;
  padding: 0 9px;
  border-color: var(--line);
  border-radius: 999px;
  font-size: 10px;
}

.chip:hover {
  border-color: var(--line-bright);
}

/* ---------- shell ---------- */

.app-shell {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: 46px minmax(0, 1fr);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px 0 8px;
  border-bottom: 1px solid var(--line);
  background: #0e0e11;
  min-width: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 8px 0 4px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  color: var(--text);
  flex: none;
}

.brand:hover {
  background: rgba(255, 255, 255, 0.05);
}

.brand-mark {
  width: 26px;
  height: 26px;
  display: block;
  flex: none;
}

.brand-text strong {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.menubar {
  display: flex;
  align-items: center;
  gap: 1px;
}

.menu-trigger {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
  color: var(--muted);
}

.menu-trigger.open {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.doc-title {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.doc-name {
  min-width: 80px;
  max-width: 360px;
  width: 30vw;
  height: 28px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
  text-align: center;
  text-overflow: ellipsis;
  transition: border-color 150ms var(--ease), background 150ms var(--ease);
}

.doc-name:hover {
  background: rgba(255, 255, 255, 0.04);
}

.doc-name:focus {
  border-color: rgba(215, 255, 47, 0.5);
  background: rgba(255, 255, 255, 0.06);
  text-align: left;
}

.save-state {
  flex: none;
  color: var(--faint);
  font-size: 10.5px;
  white-space: nowrap;
}

.save-state[data-status="saving"],
.save-state[data-status="unsaved"] {
  color: var(--muted);
}

.save-state[data-status="saved"]::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--hot);
  vertical-align: 1px;
}

.save-state[data-status="error"] {
  color: var(--danger);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
}

.toolbar-separator {
  width: 1px;
  height: 18px;
  margin: 0 5px;
  background: var(--line);
}

/* ---------- layout ---------- */

.main-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: 48px 248px minmax(360px, 1fr) 316px;
  position: relative;
}

.panel {
  min-height: 0;
  background: var(--panel);
}

.left-panel {
  border-right: 1px solid var(--line);
  display: grid;
  grid-template-rows: 38px minmax(0, 1fr);
}

.right-panel {
  border-left: 1px solid var(--line);
  display: grid;
  grid-template-rows: 40px minmax(0, 1fr);
}

/* ---------- tool rail ---------- */

.toolrail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 0 10px;
  border-right: 1px solid var(--line);
  background: #0f0f12;
  z-index: 6;
}

.toolrail.disabled .tool-button {
  opacity: 0.35;
  pointer-events: none;
}

.tool-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
}

.tool-button .icon {
  width: 17px;
  height: 17px;
}

.tool-button.active {
  background: var(--hot-soft);
  color: var(--hot);
}

.tool-sep {
  width: 22px;
  height: 1px;
  margin: 5px 0;
  background: var(--line);
}

.tool-spacer {
  flex: 1;
}

.color-chips {
  position: relative;
  width: 34px;
  height: 40px;
}

.color-chip {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 2px solid #0f0f12;
  border-radius: 6px;
  box-shadow: 0 0 0 1px var(--line-bright);
  cursor: pointer;
  overflow: hidden;
}

.color-chip input {
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.color-chip.fg {
  left: 0;
  top: 0;
  z-index: 2;
}

.color-chip.bg {
  right: 0;
  bottom: 0;
}

.swap-colors {
  position: absolute;
  right: -2px;
  top: -4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--faint);
  font-size: 10px;
  cursor: pointer;
}

.swap-colors:hover {
  color: var(--text);
}

/* ---------- left panel ---------- */

.panel-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
}

.tab-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  transition: color 150ms var(--ease), box-shadow 150ms var(--ease);
}

.tab-button:hover {
  color: var(--muted);
}

.tab-button.active {
  color: var(--text);
  box-shadow: inset 0 -1.5px 0 rgba(237, 237, 234, 0.65);
}

.tab-panel {
  min-height: 0;
  display: none;
  overflow: auto;
}

.tab-panel.active {
  display: block;
  animation: cc-reveal 200ms var(--ease);
}

.panel-heading {
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 0 12px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.panel-heading.spaced {
  margin-top: 8px;
  border-top: 1px solid var(--line);
}

.heading-actions {
  display: flex;
  gap: 2px;
}

.empty-panel {
  padding: 26px 16px;
  color: var(--faint);
  text-align: center;
}

.empty-panel.compact {
  padding: 10px 14px;
  text-align: left;
}

.empty-panel strong {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}

.empty-panel p {
  margin: 0;
  font-size: 10.5px;
  line-height: 1.6;
}

.layers-list {
  padding: 2px 6px 10px;
  min-height: calc(100% - 36px);
}

.layer-row {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 1px;
  padding: 4px 4px 4px 4px;
  border-radius: var(--radius);
  cursor: default;
  transition: background 120ms var(--ease), opacity 120ms var(--ease), box-shadow 100ms var(--ease);
}

.layer-row:hover {
  background: rgba(255, 255, 255, 0.045);
}

.layer-row.active {
  background: rgba(215, 255, 47, 0.085);
  box-shadow: inset 2px 0 0 var(--hot);
}

.layer-row.hidden-layer .layer-copy,
.layer-row.hidden-layer .layer-icon {
  opacity: 0.4;
}

.layer-row.clipped {
  padding-left: 12px;
}

.layer-row.dragging {
  opacity: 0.35;
}

.layer-row.drop-before {
  box-shadow: inset 0 2px 0 var(--hot);
}

.layer-row.drop-after {
  box-shadow: inset 0 -2px 0 var(--hot);
}

.row-toggle {
  width: 22px;
  height: 22px;
  flex: none;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
}

.row-toggle .icon {
  width: 13px;
  height: 13px;
}

.row-toggle:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.row-toggle.lock {
  opacity: 0;
}

.layer-row:hover .row-toggle.lock,
.row-toggle.lock.on {
  opacity: 1;
}

.row-toggle.lock.on {
  color: var(--muted);
}

.clip-mark {
  flex: none;
  color: var(--hot);
  opacity: 0.8;
}

.clip-mark .icon {
  width: 11px;
  height: 11px;
}

.layer-icon {
  width: 26px;
  height: 26px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--panel-3);
  color: var(--muted);
}

.layer-icon .icon {
  width: 13px;
  height: 13px;
}

.layer-row.active .layer-icon {
  color: var(--hot);
}

.layer-copy {
  flex: 1;
  min-width: 0;
}

.layer-copy strong,
.layer-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layer-copy strong {
  font-size: 11.5px;
  font-weight: 500;
}

.layer-copy small {
  margin-top: 1px;
  color: var(--faint);
  font-size: 9.5px;
}

.rename-input {
  width: 100%;
  height: 22px;
  padding: 0 6px;
  border: 1px solid rgba(215, 255, 47, 0.5);
  border-radius: 5px;
  outline: none;
  background: var(--panel-3);
  font-size: 11.5px;
}

.layer-badges {
  display: flex;
  gap: 3px;
  flex: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 16px;
  padding: 0 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.badge .icon {
  width: 10px;
  height: 10px;
}

.asset-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 0 10px 6px;
}

.asset-card {
  position: relative;
  display: block;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  cursor: pointer;
  text-align: left;
  transition: border-color 150ms var(--ease), transform 150ms var(--ease);
}

.asset-card:hover {
  border-color: var(--line-bright);
  transform: translateY(-1px);
}

.asset-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: cover;
  background: repeating-conic-gradient(#2a2a30 0 25%, #222228 0 50%) 0 0 / 12px 12px;
}

.asset-card span {
  display: block;
  padding: 4px 6px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 9.5px;
}

.asset-card em {
  display: block;
  padding: 0 6px 5px;
  color: var(--faint);
  font-size: 9px;
  font-style: normal;
}

.font-list {
  padding: 0 8px;
}

.font-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 4px 6px 8px;
  border-radius: 6px;
  font-size: 15px;
}

.font-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.font-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.local-fonts {
  display: grid;
  gap: 5px;
  padding: 10px;
}

.local-fonts small {
  color: var(--faint);
  font-size: 9.5px;
  text-align: center;
}

.history-list {
  display: grid;
  padding: 0 6px 10px;
}

.history-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 28px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  text-align: left;
}

.history-row:hover {
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
}

.history-row.current {
  background: var(--hot-soft);
  color: var(--text);
}

.history-row.future {
  opacity: 0.45;
}

.history-dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--faint);
}

.history-row.current .history-dot {
  background: var(--hot);
}

/* ---------- workspace ---------- */

.workspace {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 40px minmax(0, 1fr) 28px;
  background: #09090b;
}

.options-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 0 8px 0 12px;
  border-bottom: 1px solid var(--line);
  background: #0e0e11;
  z-index: 5;
}

.options-left {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  white-space: nowrap;
}

.options-left::-webkit-scrollbar {
  display: none;
}

.opt-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
}

.opt-title .icon {
  color: var(--hot);
}

.opt-sep {
  width: 1px;
  height: 18px;
  margin: 0 5px;
  background: var(--line);
  flex: none;
}

.opt-button {
  height: 26px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  font-size: 11px;
  flex: none;
}

.opt-button .icon {
  width: 13px;
  height: 13px;
}

.opt-button.on {
  background: var(--hot-soft);
  color: var(--text);
}

.opt-icon {
  width: 28px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  flex: none;
}

.opt-icon.on {
  background: var(--hot-soft);
  color: var(--hot);
}

.opt-shapes {
  display: flex;
  gap: 1px;
}

.opt-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}

.opt-field input[type="range"] {
  width: 90px;
}

.opt-field em {
  min-width: 24px;
  color: var(--text);
  font-style: normal;
  font-variant-numeric: tabular-nums;
}

.opt-hint {
  margin-left: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--faint);
  font-size: 10.5px;
}

.opt-swatch {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  box-shadow: 0 0 0 1px var(--line-bright);
}

.font-trigger span {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
}

.zoom-controls {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: none;
}

.zoom-value {
  min-width: 52px;
  height: 24px;
  padding: 0 6px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.viewport {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  outline: none;
  background-color: #0b0b0e;
  background-image: radial-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 18px 18px;
  touch-action: none;
}

.art-canvas,
.overlay-canvas {
  position: absolute;
  inset: 0;
  display: block;
}

.overlay-canvas {
  pointer-events: none;
}

.inline-text-editor {
  position: absolute;
  z-index: 4;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px dashed rgba(215, 255, 47, 0.8);
  outline: none;
  background: rgba(255, 255, 255, 0.04);
  resize: none;
  white-space: pre;
  transform-origin: 50% 50%;
  caret-color: var(--hot);
}

.drop-overlay {
  position: absolute;
  inset: 14px;
  z-index: 10;
  display: none;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 1.5px dashed rgba(215, 255, 47, 0.55);
  border-radius: 12px;
  background: rgba(9, 9, 11, 0.82);
  backdrop-filter: blur(6px);
  pointer-events: none;
  text-align: center;
}

.drop-overlay.visible {
  display: grid;
}

.drop-overlay strong {
  font-size: clamp(22px, 4vw, 38px);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.drop-overlay span {
  color: var(--hot);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.statusbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 0 12px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.status-left {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-pos {
  min-width: 110px;
  text-align: right;
}

.status-right {
  display: flex;
  gap: 14px;
  white-space: nowrap;
}

.status-dot {
  width: 6px;
  height: 6px;
  display: inline-block;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--hot);
}

.seed-button {
  min-height: 18px;
  padding: 0 5px;
  color: var(--hot);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.seed-button:hover {
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- flyout ---------- */

.flyout {
  position: absolute;
  left: 0;
  top: 40px;
  bottom: 28px;
  z-index: 8;
  width: 318px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  border-right: 1px solid var(--line-bright);
  background: rgba(18, 18, 21, 0.97);
  backdrop-filter: blur(14px);
  box-shadow: 18px 0 40px rgba(0, 0, 0, 0.45);
  animation: cc-pop 200ms var(--ease);
}

.flyout-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 8px;
  padding: 12px 10px 8px 14px;
}

.flyout-head strong {
  font-size: 13px;
  font-weight: 600;
}

.flyout-sub {
  grid-column: 1;
  color: var(--faint);
  font-size: 10px;
}

.flyout-head .icon-button {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: start;
}

.flyout-search {
  margin: 0 10px 6px;
}

.flyout-body {
  min-height: 0;
  overflow: auto;
  padding: 0 10px 16px;
}

.fly-cat {
  margin: 12px 4px 7px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.fly-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.fly-item {
  display: grid;
  gap: 5px;
  padding: 6px 4px 6px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-2);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 150ms var(--ease), background 150ms var(--ease), transform 150ms var(--ease);
}

.fly-item:hover {
  border-color: rgba(215, 255, 47, 0.4);
  background: var(--panel-3);
  color: var(--text);
  transform: translateY(-1px);
}

.fly-thumb {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
  background-color: #e9e6dc;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.fly-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  text-align: center;
}

.fly-note {
  margin: 14px 4px 0;
  color: var(--faint);
  font-size: 10px;
  line-height: 1.6;
}

/* ---------- search field ---------- */

.search-field {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--faint);
}

.search-field:focus-within {
  border-color: rgba(215, 255, 47, 0.45);
}

.search-field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 11.5px;
}

/* ---------- inspector ---------- */

.inspector-title {
  border-bottom: 1px solid var(--line);
}

.type-badge {
  max-width: 160px;
  padding: 2px 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inspector {
  min-height: 0;
  overflow: auto;
  padding-bottom: 24px;
}

.insp-section {
  border-bottom: 1px solid var(--line);
}

.insp-section summary {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  user-select: none;
}

.insp-section summary::-webkit-details-marker {
  display: none;
}

.insp-section summary::after {
  content: "";
  width: 9px;
  height: 9px;
  flex: none;
  background: var(--chevron) no-repeat center / contain;
  opacity: 0.55;
  transform: rotate(-90deg);
  transition: transform 200ms var(--ease), opacity 150ms var(--ease);
}

.insp-section[open] summary::after {
  transform: rotate(0deg);
  opacity: 0.85;
}

.insp-section summary:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.025);
}

.summary-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.summary-badge {
  padding: 0 6px;
  border-radius: 999px;
  background: var(--hot-soft);
  color: var(--hot);
  font-size: 9px;
  font-style: normal;
  letter-spacing: 0;
}

.control-group {
  display: grid;
  gap: 8px;
  padding: 2px 12px 14px;
}

.control-group-tight {
  display: grid;
  gap: 5px;
}

.sub-head {
  margin-top: 6px;
  color: var(--faint);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.sub-controls {
  display: grid;
  gap: 7px;
  margin: -2px 0 4px;
  padding: 8px 0 8px 10px;
  border-left: 1px solid var(--line-bright);
}

.muted-note {
  margin: 0;
  color: var(--faint);
  font-size: 10px;
  line-height: 1.55;
}

.control-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 50px;
  align-items: center;
  gap: 8px;
}

.control-row.compact {
  grid-template-columns: 72px minmax(0, 1fr);
}

.control-row label,
.control-label {
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 18px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  --pct: 0%;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 2px;
  border-radius: 1px;
  background: linear-gradient(90deg, rgba(237, 237, 234, 0.9) 0 var(--pct), rgba(255, 255, 255, 0.13) var(--pct) 100%);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -5px;
  border: 0;
  border-radius: 50%;
  background: #ededea;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  transition: transform 150ms var(--ease);
}

input[type="range"]:hover::-webkit-slider-thumb {
  transform: scale(1.25);
}

input[type="range"]:focus-visible {
  outline: none;
}

input[type="range"]:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px rgba(215, 255, 47, 0.35), 0 1px 4px rgba(0, 0, 0, 0.5);
}

input[type="range"]::-moz-range-track {
  height: 2px;
  background: rgba(255, 255, 255, 0.13);
}

input[type="range"]::-moz-range-progress {
  height: 2px;
  background: rgba(237, 237, 234, 0.9);
}

input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: #ededea;
}

.value-input,
.text-input,
.textarea-input {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 6px;
  outline: none;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  transition: border-color 150ms var(--ease), background 150ms var(--ease);
}

.value-input:hover,
.text-input:hover,
.textarea-input:hover {
  background: rgba(255, 255, 255, 0.07);
}

.value-input:focus,
.text-input:focus,
.textarea-input:focus {
  border-color: rgba(215, 255, 47, 0.5);
  background: rgba(255, 255, 255, 0.07);
}

.value-input {
  height: 24px;
  padding: 0 5px;
  text-align: right;
}

.value-input::-webkit-inner-spin-button,
.value-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.value-input[type="number"] {
  -moz-appearance: textfield;
}

.text-input {
  height: 28px;
  padding: 0 8px;
}

.text-input.wide {
  width: 100%;
}

.textarea-input {
  min-height: 62px;
  padding: 7px 8px;
  resize: vertical;
  line-height: 1.45;
}

.color-pair {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 6px;
}

.color-pair input[type="color"] {
  width: 30px;
  height: 28px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

.checkbox-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 24px;
  color: var(--muted);
  font-size: 10.5px;
  cursor: pointer;
}

.checkbox-row.inline {
  justify-content: flex-start;
  align-self: end;
  min-height: 30px;
}

.toggle-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.checkbox-row input[type="checkbox"],
.fx-toggle {
  appearance: none;
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  flex: none;
  margin: 0;
  border: 1px solid var(--line-bright);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: background 150ms var(--ease), border-color 150ms var(--ease);
}

.checkbox-row input[type="checkbox"]:checked,
.fx-toggle:checked {
  background: var(--hot) var(--check-mark) no-repeat center;
  background-size: 9px 7px;
  border-color: var(--hot);
}

.num-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
}

.num-field {
  display: grid;
  grid-template-columns: 14px 1fr;
  align-items: center;
  gap: 6px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 600;
}

.num-field .value-input {
  height: 26px;
  text-align: left;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.button-row.icons .mini-button {
  flex: 1;
  min-width: 0;
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.size-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--text);
  font-size: 11px;
}

.font-trigger-field {
  width: 100%;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  text-align: left;
}

.font-trigger-field:hover {
  background: rgba(255, 255, 255, 0.08);
}

.font-trigger-field span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.font-trigger-field .icon {
  width: 10px;
  height: 10px;
  color: var(--faint);
}

.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.seg-btn {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 9px;
  border-radius: 6px;
  font-size: 10.5px;
}

.seg-btn:hover {
  color: var(--text);
}

.seg-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.icon-seg .seg-btn {
  width: 32px;
  padding: 0;
}

.inspector-actions {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding: 12px;
}

.icon-action {
  min-height: 30px;
  padding: 0;
}

.icon-action .icon {
  width: 14px;
  height: 14px;
}

/* effect stack */

.fx-stack {
  display: grid;
  gap: 6px;
}

.fx-card {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 150ms var(--ease);
}

.fx-card.expanded {
  border-color: var(--line-bright);
}

.fx-card.off .fx-title span {
  color: var(--faint);
  text-decoration: line-through;
}

.fx-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 4px 5px 8px;
}

.fx-title {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 2px;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--text);
  font-size: 11px;
  font-weight: 500;
  text-align: left;
}

.fx-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fx-title .icon {
  width: 10px;
  height: 10px;
  color: var(--faint);
}

.fx-actions {
  display: flex;
  opacity: 0.55;
  transition: opacity 150ms var(--ease);
}

.fx-card:hover .fx-actions {
  opacity: 1;
}

.fx-actions .icon-button.icon-only {
  width: 20px;
  height: 20px;
}

.fx-actions .icon {
  width: 11px !important;
  height: 11px !important;
}

.fx-body {
  display: grid;
  gap: 8px;
  padding: 2px 10px 10px;
  animation: cc-reveal 180ms var(--ease);
}

.fx-desc {
  margin: 0;
  color: var(--faint);
  font-size: 10px;
  line-height: 1.5;
}

.fx-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.add-fx {
  width: 100%;
  border-style: dashed;
}

/* ---------- styled select ---------- */

.csel {
  position: relative;
  min-width: 0;
}

.csel select.select-input {
  display: none;
}

.csel-btn {
  width: 100%;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 6px 0 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  outline: none;
  background: rgba(255, 255, 255, 0.05);
  font-size: 11px;
  cursor: pointer;
  text-align: left;
  transition: background 150ms var(--ease), border-color 150ms var(--ease);
}

.csel-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.csel-btn.open {
  border-color: rgba(215, 255, 47, 0.5);
}

.csel-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.csel-btn .icon {
  width: 10px;
  height: 10px;
  color: var(--faint);
  transition: transform 200ms var(--ease);
}

.csel-btn.open .icon {
  transform: rotate(180deg);
}

.csel-menu {
  position: fixed;
  z-index: 400;
  padding: 3px;
  overflow: auto;
  border: 1px solid var(--line-bright);
  border-radius: 8px;
  background: rgba(27, 27, 33, 0.98);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  animation: cc-reveal 140ms var(--ease);
}

.csel-group {
  padding: 7px 8px 3px;
  color: var(--faint);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.csel-option {
  display: block;
  width: 100%;
  padding: 6px 8px;
  overflow: hidden;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.csel-option:hover,
.csel-option:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.csel-option.selected {
  background: var(--hot-soft);
  color: var(--text);
}

/* ---------- menus ---------- */

.menu {
  position: fixed;
  z-index: 500;
  min-width: 200px;
  max-height: calc(100vh - 16px);
  padding: 4px;
  overflow: auto;
  border: 1px solid var(--line-bright);
  border-radius: 9px;
  background: rgba(24, 24, 29, 0.98);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  animation: cc-reveal 120ms var(--ease);
}

.menu-item {
  width: 100%;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 0 8px 0 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 11.5px;
  text-align: left;
}

.menu-item:hover,
.menu-item:focus-visible,
.menu-item.open {
  outline: none;
  background: rgba(255, 255, 255, 0.08);
}

.menu-item.disabled {
  opacity: 0.35;
}

.menu-item.danger {
  color: #ff8a93;
}

.menu-check {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.menu-item.checked .menu-check {
  color: var(--hot);
}

.menu-check .icon {
  width: 13px;
  height: 13px;
}

.menu-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-shortcut {
  display: flex;
  align-items: center;
  padding-left: 14px;
  color: var(--faint);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

.menu-shortcut .icon {
  width: 11px;
  height: 11px;
}

.menu-sep {
  height: 1px;
  margin: 4px 6px;
  background: var(--line);
}

.menu-heading {
  padding: 7px 8px 3px 32px;
  color: var(--faint);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

/* ---------- font picker ---------- */

.font-picker {
  position: fixed;
  z-index: 450;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--line-bright);
  border-radius: 10px;
  background: rgba(22, 22, 27, 0.99);
  box-shadow: var(--shadow);
  animation: cc-reveal 140ms var(--ease);
}

.font-picker-head {
  padding: 8px;
  border-bottom: 1px solid var(--line);
}

.font-picker-list {
  min-height: 0;
  overflow: auto;
  padding: 4px;
}

.font-group {
  position: sticky;
  top: -4px;
  z-index: 1;
  padding: 8px 8px 4px;
  background: rgba(22, 22, 27, 0.99);
  color: var(--faint);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.font-option {
  width: 100%;
  display: grid;
  gap: 1px;
  padding: 6px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.font-option:hover {
  background: rgba(255, 255, 255, 0.07);
}

.font-option.selected {
  background: var(--hot-soft);
}

.font-name {
  color: var(--faint);
  font-size: 10px;
}

.font-sample {
  overflow: hidden;
  color: var(--text);
  font-size: 18px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.font-empty {
  padding: 20px;
  color: var(--faint);
  text-align: center;
}

.font-picker-foot {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 8px;
  border-top: 1px solid var(--line);
}

/* ---------- dialogs ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(5, 5, 7, 0.62);
  backdrop-filter: blur(4px);
  animation: cc-reveal 160ms var(--ease);
}

.modal {
  max-height: calc(100vh - 32px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--line-bright);
  border-radius: 14px;
  background: #16161b;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
  animation: cc-pop 220ms var(--ease);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 10px 18px;
}

.modal-head strong {
  font-size: 14px;
  font-weight: 600;
}

.modal-body {
  min-height: 0;
  overflow: auto;
  padding: 4px 18px 16px;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--line);
}

.modal-text {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.field > span,
.field-label {
  color: var(--muted);
  font-size: 10.5px;
}

.field.small {
  width: 104px;
  flex: none;
}

.field-row {
  display: flex;
  align-items: end;
  gap: 8px;
}

.field-row .field {
  flex: 1;
}

.swap-dims,
.link-dims {
  margin-bottom: 3px;
}

.link-dims.on {
  color: var(--hot);
}

.newproj-dialog .modal-body {
  padding: 0;
}

.newproj {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  min-height: 430px;
}

.newproj-cats {
  display: grid;
  align-content: start;
  gap: 2px;
  padding: 8px;
  border-right: 1px solid var(--line);
}

.cat-button {
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11.5px;
  text-align: left;
}

.cat-button:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.cat-button.active {
  background: var(--hot-soft);
  color: var(--text);
}

.newproj-main {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
  min-width: 0;
  padding: 12px 16px 14px;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  align-content: start;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}

.preset-card,
.quick-card {
  display: grid;
  justify-items: start;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color 150ms var(--ease), background 150ms var(--ease), transform 150ms var(--ease);
}

.preset-card:hover,
.quick-card:hover {
  border-color: var(--line-bright);
  background: var(--panel-3);
  transform: translateY(-1px);
}

.preset-card.active {
  border-color: rgba(215, 255, 47, 0.6);
  background: rgba(215, 255, 47, 0.06);
}

.preset-card strong,
.quick-card strong {
  font-size: 11.5px;
  font-weight: 600;
}

.preset-card small,
.quick-card small {
  color: var(--faint);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.quick-preview {
  width: 100%;
  height: 52px;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
}

.ratio-box {
  display: block;
  border: 1.5px solid rgba(237, 237, 234, 0.5);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.05);
}

.quick-card:hover .ratio-box,
.preset-card.active .ratio-box {
  border-color: var(--hot);
}

.newproj-form {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.newproj-summary {
  margin: 0;
  color: var(--hot);
  font-size: 11px;
}

.newproj-summary.invalid {
  color: var(--danger);
}

.canvas-size,
.export-form {
  display: grid;
  gap: 12px;
}

.radio-list {
  display: grid;
  gap: 6px;
}

.radio-list label {
  display: flex;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.radio-list label:has(input:checked) {
  border-color: rgba(215, 255, 47, 0.5);
  background: rgba(215, 255, 47, 0.05);
}

.radio-list input {
  accent-color: var(--hot);
}

.radio-list strong {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
}

.radio-list small {
  color: var(--faint);
  font-size: 10px;
}

.anchor-grid {
  display: grid;
  grid-template-columns: repeat(3, 24px);
  gap: 4px;
}

.anchor-cell {
  width: 24px;
  height: 24px;
  border: 1px solid var(--line-bright);
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
}

.anchor-cell.active {
  border-color: var(--hot);
  background: var(--hot);
}

.shortcut-table {
  display: grid;
  gap: 2px;
}

.shortcut-row {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
  line-height: 1.6;
}

.shortcut-row strong {
  color: var(--hot);
  font-weight: 600;
}

.shortcut-row span {
  color: var(--muted);
}

.about-text p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.about-text strong {
  color: var(--text);
}

/* ---------- home ---------- */

.home {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow: auto;
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(215, 255, 47, 0.06), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(32, 227, 209, 0.05), transparent 60%),
    #0b0b0d;
}

.home-inner {
  max-width: 1180px;
  min-height: 100%;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 26px;
  margin: 0 auto;
  padding: 26px 32px 18px;
  animation: cc-pop 260ms var(--ease);
}

.home-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.home-brand .brand-mark {
  width: 36px;
  height: 36px;
}

.home-brand strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.home-brand small {
  display: block;
  margin-top: 2px;
  color: var(--faint);
  font-size: 11px;
}

.home-actions {
  display: flex;
  gap: 8px;
}

.home-actions .ui-button {
  height: 34px;
  padding: 0 14px;
}

.home-section h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.home-section h3 em {
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 10px;
  font-style: normal;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 10px;
}

.quick-card.more .quick-preview {
  color: var(--faint);
}

.quick-card.more .icon {
  width: 22px;
  height: 22px;
}

.projects-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.projects-head h3 {
  margin: 0;
}

.projects-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.projects-tools .search-field {
  width: 240px;
}

.projects-tools .csel {
  width: 120px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  align-content: start;
  gap: 14px;
}

.project-card {
  position: relative;
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
  cursor: pointer;
  outline: none;
  transition: border-color 160ms var(--ease), transform 160ms var(--ease), box-shadow 160ms var(--ease);
}

.project-card:hover {
  border-color: var(--line-bright);
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.35);
}

.project-card.current {
  border-color: rgba(215, 255, 47, 0.45);
}

.project-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    repeating-conic-gradient(#1f1f25 0 25%, #1a1a20 0 50%) 0 0 / 14px 14px;
}

.project-thumb img {
  max-width: 88%;
  max-height: 88%;
  display: block;
  object-fit: contain;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.current-badge {
  position: absolute;
  left: 8px;
  top: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--hot);
  color: #141410;
  font-size: 9.5px;
  font-weight: 600;
}

.project-meta {
  display: grid;
  gap: 2px;
  padding: 10px 34px 11px 12px;
}

.project-meta strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-meta small {
  color: var(--faint);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.project-more {
  position: absolute;
  right: 6px;
  bottom: 10px;
}

.projects-empty {
  grid-column: 1 / -1;
  padding: 50px 20px;
  border: 1px dashed var(--line-bright);
  border-radius: 14px;
  color: var(--faint);
  text-align: center;
}

.projects-empty strong {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.projects-empty p {
  max-width: 420px;
  margin: 0 auto;
  font-size: 11.5px;
  line-height: 1.7;
}

.home-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 10.5px;
}

body.home-open .app-shell {
  visibility: hidden;
}

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  z-index: 600;
  max-width: min(520px, calc(100vw - 30px));
  padding: 10px 14px;
  border: 1px solid var(--line-bright);
  border-radius: 10px;
  background: rgba(30, 30, 36, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translate(-50%, 10px);
  pointer-events: none;
  transition: opacity 220ms var(--ease), transform 220ms var(--ease);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.5;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.error {
  border-color: rgba(255, 95, 107, 0.45);
  color: #ffb3b9;
}

/* ---------- empty doc ---------- */

body.no-doc .options-left,
body.no-doc .zoom-controls,
body.no-doc .top-actions #exportButton {
  opacity: 0.35;
  pointer-events: none;
}

/* ---------- responsive ---------- */

@media (max-width: 1280px) {
  .main-grid {
    grid-template-columns: 48px 220px minmax(320px, 1fr) 296px;
  }

  .opt-hint {
    display: none;
  }
}

@media (max-width: 1080px) {
  .main-grid {
    grid-template-columns: 48px 196px minmax(300px, 1fr) 268px;
  }

  .status-pos,
  .save-state {
    display: none;
  }

  .doc-title {
    justify-content: flex-start;
  }
}

@media (max-width: 880px) {
  .main-grid {
    grid-template-columns: 48px minmax(300px, 1fr) 268px;
  }

  .left-panel {
    display: none;
  }
}

@media (max-width: 680px) {
  .main-grid {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .right-panel,
  .menubar {
    display: none;
  }
}

/* ---------------- cloud sign-in ---------------- */

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  overflow: auto;
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(215, 255, 47, 0.08), transparent 70%),
    var(--bg);
}

.auth-card {
  width: min(360px, 100%);
  display: grid;
  gap: 12px;
  padding: 28px 26px 22px;
  border: 1px solid var(--line-bright);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.auth-logo {
  justify-self: center;
  width: 56px;
  height: 56px;
}

.auth-card h1 {
  margin: 0;
  text-align: center;
  font-size: 17px;
  letter-spacing: 0.08em;
}

.auth-sub {
  margin: -4px 0 4px;
  text-align: center;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border-radius: 9px;
  background: var(--panel-3);
}

.auth-tabs button {
  height: 28px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.auth-tabs button.active {
  background: var(--panel-4);
  color: var(--text);
}

.auth-hint {
  margin: 0;
  color: var(--faint);
  font-size: 10.5px;
  line-height: 1.6;
}

.auth-error {
  min-height: 1em;
  margin: 0;
  color: #ff8a93;
  font-size: 11.5px;
}

.auth-error:empty {
  display: none;
}

.auth-submit {
  justify-content: center;
  height: 34px;
}

.auth-local {
  justify-self: center;
  font-size: 11px;
}
