/* Canvas Studio: native, quiet chrome. Canvas geometry belongs to the existing engine. */
:root {
  --bg: #f6f7f8;
  --panel: rgba(255, 255, 255, 0.95);
  --panel-strong: #fff;
  --border: #e3e6e9;
  --text: #30363d;
  --muted: #717b86;
  --accent: #414b56;
  --accent-soft: #edf0f3;
  --shadow: 0 8px 30px #2733420b, 0 1px 4px #27334205;
  --radius: 14px;
  --canvas-grid: #c6cbd250;
  font-family:
    -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
  font-size: 14px;
}
:root[data-appearance="paper"] {
  --bg: #f8f5ef;
  --accent: #9a6543;
  --accent-soft: #f2e8de;
  --canvas-grid: #b8aa9638;
}
:root[data-appearance="sage"] {
  --bg: #f2f5f1;
  --accent: #527264;
  --accent-soft: #e8eee8;
  --canvas-grid: #a8b6a535;
}
body {
  background: var(--bg);
  font-weight: 400;
}
button {
  transition:
    background 0.15s,
    box-shadow 0.15s;
}
button:focus-visible,
input:focus-visible {
  outline: 2px solid #8196b5;
  outline-offset: 3px;
}
button img {
  pointer-events: none;
}
.ui-icon {
  width: 20px;
  height: 20px;
  flex: none;
  vertical-align: middle;
}
.studio-header {
  height: 64px;
  position: fixed;
  inset: 0 0 auto;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 26px;
  background: #fffffff5;
  border-bottom: 1px solid var(--border);
}
.studio-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  white-space: nowrap;
}
.studio-brand strong {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.4px;
}
.studio-brand img {
  border-radius: 9px;
}
.studio-header-divider {
  height: 26px;
  width: 1px;
  background: var(--border);
}
.studio-header > .workspace-control {
  width: auto;
  min-width: 170px;
  max-width: 360px;
  padding: 4px 32px 4px 0;
  gap: 2px;
  background: url("/icons/caret.svg") right 7px center/14px no-repeat;
  border: 0;
  box-shadow: none;
  border-radius: 7px;
}
.workspace-control-label {
  font-size: 10px;
  font-weight: 400;
  color: var(--muted);
}
.workspace-control-current {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
}
.studio-icon-button {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
}
.studio-icon-button:hover {
  background: var(--accent-soft);
}
.studio-icon-button img {
  width: 20px;
  height: 20px;
}
#header-settings-button {
  margin-left: auto;
}
.canvas-viewport {
  top: 64px;
  height: calc(100vh - 64px);
  background:
    radial-gradient(circle, var(--canvas-grid) 0.8px, transparent 0.8px)
      center/22px 22px,
    var(--bg);
}
:root[data-canvas-dots="false"] .canvas-viewport {
  background: var(--bg);
}
.menu-toggle {
  top: 84px;
  left: 26px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 2px 5px #202b3a04;
}
.sidebar {
  inset: 136px auto 105px 26px;
  width: 304px;
  padding: 15px;
  background: #fffffff5;
  border: 1px solid var(--border);
  border-radius: 15px;
  box-shadow: 0 18px 55px #27323f17;
  backdrop-filter: blur(24px);
}
.sidebar-inner {
  gap: 18px;
}
.sidebar-section {
  border-color: var(--border);
}
.sidebar h2 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text);
}
.project-row {
  border: 0;
  background: none;
  padding: 0;
}
.project-item {
  border: 0;
  background: none;
  border-radius: 9px;
  padding: 12px 10px;
  box-shadow: none;
}
.project-name {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}
.project-item.active {
  background: var(--accent-soft);
  box-shadow: none;
  color: var(--text);
}
.project-row-controls {
  gap: 2px;
}
.project-menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  list-style: none;
}
.project-menu-toggle::-webkit-details-marker {
  display: none;
}
.project-menu-panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.sidebar-header-actions .ghost-button,
.sidebar-header-actions .pill-button {
  height: 32px;
  width: 32px;
  padding: 6px;
  border-radius: 8px;
  background: transparent;
  border: 0;
}
.sidebar-header-actions .pill-button:hover {
  background: var(--accent-soft);
}
.search-row {
  gap: 7px;
}
#search-input {
  font-size: 12px;
  padding: 10px 11px;
  border-radius: 8px;
}
#search-button {
  font-size: 11px;
  padding: 8px 11px;
  border-radius: 8px;
}
.sidebar-settings-button {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  padding: 15px 8px 0;
  color: var(--muted);
}
.pill-button {
  background: var(--accent);
  border: 1px solid transparent;
  color: #fff;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 500;
  box-shadow: none;
}
.ghost-button {
  border-color: var(--border);
  background: transparent;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 400;
  box-shadow: none;
  color: var(--text);
}
.ghost-button:hover {
  background: var(--accent-soft);
}
input,
textarea,
select {
  border-color: var(--border);
  background: #fff;
  border-radius: 9px;
  color: var(--text);
}
.project-action-bar {
  bottom: auto;
  left: auto;
  top: 84px;
  right: 26px;
  padding: 5px 7px;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: #ffffffeb;
  box-shadow: var(--shadow);
  gap: 3px;
}
.project-tool-button {
  height: 35px;
  width: 36px;
  border: 0;
  background: transparent;
  border-radius: 7px;
  padding: 7px;
}
.project-tool-button:hover {
  background: var(--accent-soft);
}
.project-tool-button .ui-icon {
  width: 21px;
  height: 21px;
}
.bottom-dock {
  bottom: 24px;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 15px;
  box-shadow: var(--shadow);
  background: #ffffffed;
  gap: 4px;
}
.dock-group {
  gap: 4px;
}
.bottom-dock .dock-icon-button {
  height: 36px;
  width: 36px;
  min-width: 36px;
  padding: 8px;
  border: 0;
  background: transparent;
  border-radius: 9px;
}
.bottom-dock .dock-icon-button[aria-pressed="true"] {
  background: var(--accent);
}
.bottom-dock .dock-icon-button[aria-pressed="true"] img {
  filter: brightness(0) invert(1);
}
.dock-mode-icon,
.dock-mode-icon img {
  width: 20px;
  height: 20px;
}
.dock-view-switch {
  gap: 3px;
  padding: 0 7px;
  background: none;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-radius: 0;
  margin: 0 3px;
}
.dock-view-switch button {
  height: 36px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 11px;
}
.dock-view-switch .ui-icon {
  width: 16px;
  height: 16px;
}
.dock-view-switch button[aria-pressed="true"] {
  background: var(--accent-soft);
  box-shadow: none;
  color: var(--text);
  font-weight: 500;
}
.studio-zoom {
  position: fixed;
  right: 26px;
  bottom: 29px;
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fffffff0;
  z-index: 24;
  padding: 3px;
}
.studio-zoom button {
  height: 28px;
  min-width: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: none;
  border-radius: 6px;
  cursor: pointer;
  color: var(--muted);
  font-size: 10px;
}
.studio-zoom button:hover {
  background: var(--accent-soft);
}
.studio-zoom button img {
  width: 14px;
  height: 14px;
}
#zoom-reset-button {
  width: 40px;
}
.project-region {
  border-radius: 20px;
  background: transparent !important;
  border: 1px solid #cbd2da;
  box-shadow: none;
  padding: 20px;
}
.project-region.selected {
  outline: 1px solid #7e8d9b;
  box-shadow: none;
}
.project-region-title h3 {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.4px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.project-region-title .ui-icon {
  width: 22px;
  height: 22px;
}
.region-description-toggle {
  font-size: 11px;
  padding: 5px 8px;
  border: 0;
  color: var(--muted);
}
.project-region-summary {
  background: #ffffffba;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.asset-card {
  background: #fff;
  border: 1px solid #e0e4e8;
  box-shadow: 0 3px 9px #28344206;
  border-radius: 14px;
  padding: 16px;
  gap: 9px;
}
.asset-card.selected {
  outline: 2px solid #8093a8;
}
.asset-card strong {
  font-weight: 550;
}
.asset-card .muted {
  color: #697581;
  line-height: 1.65;
}
.asset-card.note {
  background: #fffbe0;
  border-color: #eee8c9;
}
.asset-card.note .muted {
  color: #776f55;
}
.asset-card.text {
  background: transparent;
  border: 0;
  box-shadow: none;
}
.asset-card.text .text-asset-content {
  font-weight: 500;
  line-height: 1.4;
}
.asset-card.image {
  background: #f0efeb;
  border-radius: 14px;
  box-shadow: none;
  border: 0;
}
.asset-card.image img {
  object-fit: contain;
}
.asset-card.image .image-title-overlay span {
  border-radius: 5px;
  background: #fffffff0;
  color: #626b75;
  font-size: 11px;
  font-weight: 500;
  box-shadow: 0 1px 3px #0001;
}
.asset-card.table {
  border-radius: 12px;
  padding: 16px;
}
.asset-card.table th {
  background: #f4f6f8;
  color: #747e89;
  font-weight: 500;
}
.asset-card.table td,
.asset-card.table th {
  border-color: #e7ebee;
}
.badge {
  background: #f1f3f5;
  border: 0;
  color: #79828d;
  font-size: 10px;
  font-weight: 400;
}
.asset-card.note .badge {
  background: #f5efca;
  color: #8c825b;
}
.asset-card.link {
  background: #fff;
  border-radius: 12px;
}
.link-preview-title {
  font-weight: 550;
}
.link-preview-domain {
  color: var(--muted);
}
.link-preview-media {
  background: #f4f4f2;
}
.modal-panel,
.hosted-connect-panel {
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 25px 80px #26334626;
}
.modal-backdrop,
.hosted-connect-backdrop {
  background: #29344330;
  backdrop-filter: blur(5px);
}
.modal-header h2 {
  font-size: 25px;
  letter-spacing: -0.5px;
  font-weight: 500;
}
.modal-form label,
.field-label {
  font-weight: 500;
}
.settings-dialog {
  width: min(794px, calc(100vw - 32px));
  padding: 0;
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: 0 30px 100px #1a263833;
  background: #fff;
  max-height: calc(100vh - 64px);
  overflow: auto;
}
.settings-dialog[open] {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  min-height: 540px;
}
.settings-dialog::backdrop,
.workspace-picker::backdrop {
  background: #29344330;
  backdrop-filter: blur(6px);
}
.settings-navigation {
  padding: 28px 15px 25px;
  background: #f6f7f8;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.settings-header {
  justify-content: flex-start;
  gap: 10px;
  margin: 0 8px 28px;
}
.settings-header img {
  width: 31px;
  height: 31px;
}
.settings-header h2 {
  font-size: 14px;
  font-weight: 600;
}
.settings-tabs {
  flex-direction: column;
  margin: 0;
  padding: 0;
  border: 0;
  gap: 6px;
}
.settings-tabs button {
  display: flex;
  gap: 10px;
  align-items: center;
  text-align: left;
  font-size: 12px;
  font-weight: 400;
  padding: 12px;
  border-radius: 8px;
  color: #69737e;
}
.settings-tabs button img {
  width: 19px;
  height: 19px;
}
.settings-tabs button[aria-selected="true"] {
  background: #e6e9ed;
  color: #303842;
  font-weight: 500;
}
.studio-build-label {
  margin-top: auto;
  padding: 30px 12px 0;
  color: #717b86;
  font-size: 10px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.settings-body {
  padding: 43px 38px 35px;
  min-width: 0;
}
.settings-panel {
  min-height: 0;
}
.settings-panel h3,
.settings-panel .section-head h3 {
  font-size: 25px;
  font-weight: 500;
  letter-spacing: -0.6px;
}
.settings-description {
  color: #767e87;
  font-size: 12px;
  line-height: 1.7;
  margin: 10px 0 32px;
}
.settings-panel .section-head {
  align-items: flex-start;
}
.settings-panel .small,
.settings-panel .muted {
  font-size: 12px;
  line-height: 1.8;
}
.settings-panel .button-row {
  margin-top: 24px;
  gap: 10px;
}
.settings-panel .button-row button {
  font-size: 11px;
  padding: 11px 16px;
}
#settings-close-button {
  position: absolute;
  right: 14px;
  top: 14px;
}
#settings-close-button img {
  width: 18px;
  height: 18px;
}
.appearance-fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}
.appearance-fieldset legend {
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 14px;
}
.appearance-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.appearance-option {
  position: relative;
  border: 1px solid #e7e9eb;
  border-radius: 10px;
  padding: 4px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 10px;
  font-weight: 400;
}
.appearance-option > input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.appearance-option:has(input:checked) {
  border-color: #606c79;
  box-shadow: 0 0 0 1px #606c79;
}
.appearance-option:has(input:focus-visible) {
  outline: 2px solid #8196b5;
  outline-offset: 3px;
}
.appearance-option > span:last-child {
  padding: 0 5px 6px;
}
.appearance-swatch {
  height: 75px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f2f3f5;
}
.appearance-swatch img {
  width: 25px;
  height: 25px;
  opacity: 0.55;
}
.paper .appearance-swatch {
  background: #f6eee2;
}
.sage .appearance-swatch {
  background: #eaf0e7;
}
.appearance-dots {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 25px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.appearance-dots small {
  display: block;
  font-size: 11px;
  color: #767e87;
  margin-top: 6px;
}
.appearance-dots input {
  accent-color: var(--accent);
  width: 32px;
  height: 20px;
  cursor: pointer;
}
.settings-shortcuts {
  padding-top: 24px;
  font-size: 11px;
  color: var(--muted);
}
.settings-shortcuts h4 {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  margin: 0 0 13px;
}
.settings-shortcuts p {
  display: flex;
  justify-content: space-between;
  margin: 10px 0;
}
.settings-shortcuts kbd {
  font: inherit;
  font-size: 10px;
  border: 1px solid var(--border);
  padding: 2px 5px;
  border-radius: 4px;
}
.update-app-icon {
  text-align: center;
  margin: 0 0 24px;
}
.update-app-icon img {
  width: 65px;
  height: 65px;
}
#settings-updates-panel .section-head {
  display: block;
}
#app-current-version {
  display: block;
  margin-top: 8px;
}
#app-update-status {
  margin-top: 18px;
}
#desktop-update-badge {
  position: static;
  display: flex;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  background: none;
  padding: 0;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
}
#desktop-update-badge[hidden] {
  display: none;
}
#desktop-update-badge span {
  font-size: 11px;
  font-weight: 500;
}
#desktop-update-button {
  display: none;
}
#activity-list {
  margin-top: 24px;
  max-height: 330px;
}
#activity-list .activity-item {
  box-shadow: none;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 12px 0;
}
.workspace-picker {
  width: min(560px, calc(100vw - 32px));
  padding: 34px;
  border-radius: 20px;
  background: white;
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: 0 30px 100px #1a263833;
}
.workspace-picker h2 {
  font-size: 25px;
  font-weight: 500;
  letter-spacing: -0.6px;
}
.workspace-picker [data-picker-close] {
  border: 0;
  padding: 5px;
}
.workspace-picker-description,
.workspace-picker .small {
  font-size: 12px;
}
.workspace-row {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  margin-bottom: 8px;
}
.workspace-row.current-workspace {
  background: #f4f6f8;
  padding: 12px;
}
.workspace-open-button {
  font-size: 13px;
  font-weight: 500;
  border: 0;
  padding: 8px 3px;
}
.workspace-current {
  font-size: 10px;
  color: #708377;
}
.workspace-picker h3 {
  font-weight: 500;
  font-size: 12px;
}
.workspace-create-section {
  border-color: var(--border);
  margin-top: 28px;
  padding-top: 24px;
}
.workspace-create button {
  align-self: flex-end;
}
.workspace-create input {
  font-size: 13px;
  padding: 12px;
}
.workspace-picker-status:empty {
  display: none;
}
.workspace-picker > p {
  color: var(--muted);
  margin-top: 10px;
}
.workspace-picker form {
  gap: 16px;
}
.settings-panel[hidden],
.settings-tabs button[hidden] {
  display: none !important;
}
@media (max-width: 760px) {
  .studio-header {
    padding: 0 16px;
    gap: 12px;
  }
  .studio-brand strong {
    display: none;
  }
  .studio-header-divider {
    display: none;
  }
  .studio-header > .workspace-control {
    min-width: 140px;
  }
  .menu-toggle {
    left: 14px;
  }
  .project-action-bar {
    right: 14px;
  }
  .sidebar {
    left: 14px;
  }
  .bottom-dock {
    padding: 5px;
    bottom: 16px;
  }
  .dock-view-switch button {
    font-size: 10px;
    padding: 0 7px;
  }
  .dock-view-switch button img {
    display: none;
  }
  .bottom-dock .dock-icon-button {
    width: 30px;
    height: 32px;
    min-width: 30px;
  }
  .studio-zoom {
    right: 14px;
    bottom: 80px;
  }
  .settings-dialog[open] {
    grid-template-columns: 1fr;
  }
  .settings-navigation {
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .settings-header,
  .studio-build-label {
    display: none;
  }
  .settings-tabs {
    flex-direction: row;
    justify-content: space-between;
    gap: 2px;
  }
  .settings-tabs button {
    font-size: 10px;
    gap: 5px;
    padding: 9px 7px;
  }
  .settings-tabs button img {
    width: 15px;
    height: 15px;
  }
  .settings-body {
    padding: 40px 24px 28px;
  }
  #settings-close-button {
    top: 65px;
    right: 10px;
    width: 26px;
    height: 26px;
  }
  .workspace-picker {
    padding: 26px;
  }
  .appearance-options {
    gap: 8px;
  }
  .appearance-option {
    font-size: 9px;
  }
  .studio-zoom button {
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
/* Float the app chrome over the existing canvas rather than changing its camera viewport. */
.canvas-viewport {
  top: 0;
  height: 100vh;
}
/* Explicit height avoids WebKit stretching a grid dialog to its max-height. */
.settings-dialog[open] {
  height: 560px;
  min-height: 0;
}
.settings-body {
  overflow-y: auto;
}
.appearance-dots {
  flex-direction: row;
  text-align: left;
}
.appearance-dots input {
  appearance: none;
  -webkit-appearance: none;
  width: 36px;
  height: 21px;
  padding: 3px;
  border: 0;
  border-radius: 20px;
  background: #d8dde3;
  flex: none;
}
.appearance-dots input::before {
  content: "";
  display: block;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px #0002;
}
.appearance-dots input:checked {
  background: var(--accent);
}
.appearance-dots input:checked::before {
  transform: translateX(15px);
}
@media (max-width: 760px) {
  .settings-dialog[open] {
    height: 610px;
  }
}

/* One compact workspace bar, shared with native macOS window controls. */
.studio-header { height: 44px; gap: 12px; padding: 0 20px; }
.desktop-mac .studio-header { padding-left: 96px; }
.studio-header > .workspace-control { display:flex; flex-direction:row; align-items:center; gap:9px; min-width:0; max-width:min(440px, calc(100vw - 170px)); padding:6px 27px 6px 0; }
.workspace-control-label { font-size:11px; }
.workspace-control-current { font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#header-settings-button { width:30px; height:30px; }
.menu-toggle { top:60px; }
.project-action-bar { top:60px; }
.sidebar { top:60px; max-height:calc(100vh - 144px); }
.modal-header { align-items:flex-start; gap:24px; }
.modal-header h2 { margin:0; line-height:1.25; }
#modal-context:empty { display:none; }
#modal-close-button { flex:none; width:30px; height:30px; padding:6px; }
.modal-display { border:0; padding:0; background:none; }
.project-description { margin:0; white-space:pre-wrap; line-height:1.65; overflow-wrap:anywhere; }
#modal-root[data-kind="project-details"] .modal-panel { width:min(560px, calc(100vw - 32px)); }
#modal-root[data-kind="project-details"] .modal-grid:empty { display:none; }
@media(max-width:760px) {
  .studio-header { padding-right:12px; padding-left:16px; }
  .project-action-bar { top:60px; }
}
.modal-root:not([hidden]), .hosted-connect-root:not([hidden]) { display:flex; align-items:center; justify-content:center; }
.modal-panel, .hosted-connect-panel { margin:24px 0; }
.public-demo .studio-header { display: none !important; }
.public-demo .public-demo-banner { z-index: 31; }
