:root {
  --bg: #f5f7f8;
  --panel: #ffffff;
  --panel-soft: #f9faf7;
  --ink: #202522;
  --muted: #6b746f;
  --line: #d9dfdc;
  --line-strong: #bbc8c2;
  --teal: #ff5a33;
  --teal-dark: #d9411c;
  --coral: #e96f42;
  --sun: #f4bf45;
  --leaf: #76a96f;
  --violet: #7561d8;
  --shadow: 0 18px 50px rgba(33, 40, 36, 0.14);
  --sidebar-width: 280px;
  --inspector-width: 304px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  min-width: 1180px;
  min-height: 760px;
  height: 100vh;
  overflow: hidden;
  color: var(--ink);
  background: var(--bg);
  font-family:
    Inter, "Segoe UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  letter-spacing: 0;
}

button {
  border: 0;
  font: inherit;
  color: inherit;
  cursor: default;
}

.resizing-sidebar-panel,
.resizing-sidebar-panel * {
  cursor: row-resize !important;
  user-select: none;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(640px, 1fr) 304px;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

.sidebar,
.inspector {
  background: var(--panel);
  border-color: var(--line);
}

.sidebar {
  display: flex;
  height: 100vh;
  flex-direction: column;
  overflow: hidden;
  padding: 22px 18px;
  background: #282b35;
  border-right: 1px solid #1e2129;
}

.inspector {
  height: 100vh;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px;
  border-left: 1px solid var(--line);
}

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

.brand-logo {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: contain;
}

.brand-name {
  font-size: 17px;
  font-weight: 800;
}

.sidebar .brand-name {
  color: #fff;
}

.sidebar .brand-subtitle {
  color: #9aa2b3;
}

.brand-subtitle,
.canvas-status,
.canvas-link span,
.node-caption span,
.preview-header span,
.selected-file span {
  color: var(--muted);
  font-size: 12px;
}

.new-canvas-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--teal);
  border-radius: 8px;
  color: #fff;
  background: var(--teal);
  font-weight: 850;
}

.new-canvas-icon {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  font-size: 18px;
  line-height: 1;
}

.panel-block,
.inspector-card {
  margin-top: 20px;
}

.panel-block {
  min-height: 0;
}

.folder-panel {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
}

.canvas-panel {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  margin-top: 12px;
  min-height: 128px;
}

.sidebar-resizer {
  position: relative;
  flex: 0 0 16px;
  margin-top: 8px;
  cursor: row-resize;
  touch-action: none;
}

.sidebar-resizer::before {
  content: "";
  position: absolute;
  left: 0;
  right: 3px;
  top: 7px;
  height: 2px;
  border-radius: 999px;
  background: #4a5060;
}

.sidebar-resizer::after {
  content: "";
  position: absolute;
  left: 0;
  right: 3px;
  top: 3px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 90, 51, 0.18);
  opacity: 0;
  transition: opacity 0.16s ease;
}

.sidebar-resizer:hover::before,
.sidebar-resizer:focus-visible::before,
.sidebar.resizing-folders .sidebar-resizer::before {
  background: var(--teal);
}

.sidebar-resizer:hover::after,
.sidebar-resizer:focus-visible::after,
.sidebar.resizing-folders .sidebar-resizer::after {
  opacity: 1;
}

.section-heading {
  margin-bottom: 10px;
  color: #4f5b55;
  font-size: 12px;
  font-weight: 800;
}

.sidebar .section-heading {
  color: #9aa2b3;
}

.section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.section-heading-row .section-heading {
  margin-bottom: 0;
}

.mini-action-button {
  display: grid;
  width: 26px;
  min-width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--teal-dark);
  font-size: 17px;
  font-weight: 850;
  line-height: 1;
}

.folder-list,
.canvas-list {
  display: grid;
  gap: 8px;
}

.folder-list,
.canvas-list {
  align-content: start;
}

.folder-list,
.canvas-list,
.menu-folder-list {
  scrollbar-color: #aab7b1 transparent;
  scrollbar-width: thin;
}

.folder-list::-webkit-scrollbar,
.canvas-list::-webkit-scrollbar,
.menu-folder-list::-webkit-scrollbar {
  width: 8px;
}

.folder-list::-webkit-scrollbar-thumb,
.canvas-list::-webkit-scrollbar-thumb,
.menu-folder-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #aab7b1;
}

.folder-list {
  flex: 0 0 auto;
  grid-auto-rows: 38px;
  height: var(--folder-list-height, 240px);
  min-height: 96px;
  row-gap: 8px;
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 3px;
}

.folder-row {
  display: grid;
  grid-template-columns: 16px 22px 1fr auto;
  align-items: center;
  gap: 8px;
  height: 38px;
  min-height: 38px;
  padding: 0 9px 0 calc(9px + var(--folder-depth, 0) * 18px);
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #53615a;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
}

.sidebar .folder-row {
  color: #a6adbd;
}

.folder-toggle {
  display: grid;
  width: 16px;
  height: 24px;
  place-items: center;
  color: #8a9690;
  font-size: 13px;
  line-height: 1;
}

.folder-toggle.visible {
  color: var(--teal-dark);
}

.sidebar .folder-toggle {
  color: #7f8798;
}

.sidebar .folder-toggle.visible {
  color: #c8cfdd;
}

.folder-row.active {
  color: var(--teal-dark);
  background: #fff0eb;
  border-color: #ffd0c3;
}

.sidebar .folder-row.active {
  color: #fff;
  background: #171a22;
  border-color: #171a22;
}

.folder-row.virtual {
  background: #f7f9f8;
}

.folder-row.virtual.active {
  background: #fff0eb;
}

.sidebar .folder-row.virtual {
  background: transparent;
}

.sidebar .folder-row.virtual.active {
  background: #171a22;
}

.folder-icon {
  position: relative;
  display: block;
  width: 20px;
  height: 15px;
  border-radius: 4px;
  background: #d7b14b;
}

.sidebar .folder-icon {
  background: #5f6678;
}

.sidebar .folder-icon::before {
  background: #7a8294;
}

.sidebar .folder-row.active .folder-icon {
  background: var(--teal);
}

.sidebar .folder-row.active .folder-icon::before {
  background: #ff8a6b;
}

.folder-icon::before {
  position: absolute;
  left: 2px;
  top: -4px;
  width: 9px;
  height: 5px;
  border-radius: 4px 4px 0 0;
  background: #e7c66c;
  content: "";
}

.recent-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--teal);
}

.recent-icon::before {
  position: absolute;
  left: 8px;
  top: 3px;
  width: 2px;
  height: 6px;
  border-radius: 999px;
  background: #fff;
  content: "";
}

.recent-icon::after {
  position: absolute;
  left: 8px;
  top: 8px;
  width: 5px;
  height: 2px;
  border-radius: 999px;
  background: #fff;
  content: "";
}

.sidebar .recent-icon {
  background: var(--teal);
}

.sidebar .recent-icon::before,
.sidebar .recent-icon::after {
  background: #fff;
}

.folder-count {
  display: grid;
  min-width: 24px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: #eef1ef;
  color: #67736e;
  font-size: 12px;
}

.sidebar .folder-count {
  color: #c0c7d5;
  background: #3a3f4d;
}

.folder-row.active .folder-count {
  color: var(--teal-dark);
  background: #ffe1d8;
}

.sidebar .folder-row.active .folder-count {
  color: #fff;
  background: var(--teal);
}

.folder-edit-input {
  min-width: 0;
  width: 100%;
  height: 26px;
  padding: 0 7px;
  border: 1px solid var(--teal);
  border-radius: 7px;
  outline: none;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.canvas-list {
  flex: 1 1 auto;
  grid-auto-rows: 64px;
  gap: 7px;
  row-gap: 7px;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 3px;
}

.canvas-link {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 64px;
  min-height: 64px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbf9;
  text-align: left;
}

.sidebar .canvas-link {
  background: #303440;
  border-color: #3a3f4d;
}

.canvas-link.active {
  border-color: var(--teal);
  background: #fff0eb;
  box-shadow: inset 3px 0 0 var(--teal);
}

.sidebar .canvas-link.active {
  background: #171a22;
  border-color: var(--teal);
}

.canvas-link.active strong {
  color: var(--teal-dark);
}

.sidebar .canvas-link strong {
  color: #edf1f7;
}

.sidebar .canvas-link span {
  color: #9aa2b3;
}

.sidebar .canvas-link.active strong {
  color: #fff;
}

.canvas-link.active .canvas-cover {
  box-shadow:
    inset 0 0 0 2px rgba(255, 90, 51, 0.26),
    0 0 0 3px rgba(255, 90, 51, 0.12);
}

.canvas-cover {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(32, 37, 34, 0.16);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
}

.canvas-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.canvas-link strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-edit-input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--teal);
  outline: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.empty-state {
  padding: 16px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: #fafbf9;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.sidebar .empty-state {
  border-color: #454b59;
  background: #303440;
  color: #9aa2b3;
}

.photo-media {
  background:
    radial-gradient(circle at 72% 24%, #ffd36a 0 10%, transparent 11%),
    linear-gradient(135deg, #81c7b8 0 35%, #d8eee6 36% 52%, #f79b77 53% 100%);
}

.photo-media.transparent-bg {
  background:
    linear-gradient(45deg, #d8dfdc 25%, transparent 25% 75%, #d8dfdc 75%),
    linear-gradient(45deg, #d8dfdc 25%, #fff 25% 75%, #d8dfdc 75%);
  background-position: 0 0, 10px 10px;
  background-size: 20px 20px;
}

.photo-media.transparent-bg img {
  object-fit: contain;
}

.psd-media {
  display: grid;
  place-items: center;
  background:
    linear-gradient(45deg, rgba(255, 90, 51, 0.12) 25%, transparent 25% 50%, rgba(255, 90, 51, 0.12) 50% 75%, transparent 75%),
    linear-gradient(135deg, #202020, #555 52%, #ff5a33);
  background-size: 18px 18px, cover;
}

.psd-media.has-cover {
  background: #fff;
}

.psd-cover-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.psd-placeholder {
  display: grid;
  width: 78px;
  height: 78px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  color: #fff;
  font-size: 22px;
  font-weight: 950;
}

.video-media {
  background:
    linear-gradient(45deg, rgba(0, 0, 0, 0.16) 25%, transparent 25% 50%, rgba(0, 0, 0, 0.16) 50% 75%, transparent 75%),
    linear-gradient(135deg, #2f6f8f, #73b1a4 55%, #f0c767);
  background-size: 18px 18px, cover;
}

.video-media.is-playing .play-circle {
  opacity: 0;
}

.selected-icon {
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--coral);
  font-weight: 900;
}

.workspace {
  position: relative;
  display: grid;
  grid-template-rows: 74px 1fr;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  --canvas-control-bottom: 24px;
  --canvas-control-side: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 22px;
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid var(--line);
}

.canvas-title {
  margin-bottom: 4px;
  font-size: 18px;
  font-weight: 850;
}

.canvas-title-input {
  width: min(420px, 46vw);
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid var(--teal);
  border-radius: 7px;
  outline: none;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 18px;
  font-weight: 850;
}

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

.divider {
  width: 1px;
  height: 24px;
  background: var(--line);
}

.icon-button,
.tool-button,
.share-button,
.close-button,
.preview-controls button,
.wide-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-weight: 750;
}

.icon-button {
  width: 36px;
  padding: 0;
  color: #53615a;
  font-size: 20px;
}

.tool-button {
  padding: 0 13px;
  color: #53615a;
  font-size: 13px;
}

.tool-button.active {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.share-button,
.wide-button {
  padding: 0 15px;
  color: #fff;
  background: var(--teal);
  border-color: var(--teal);
}

.canvas-stage {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  min-height: 686px;
  background:
    linear-gradient(rgba(108, 122, 114, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(108, 122, 114, 0.08) 1px, transparent 1px),
    radial-gradient(circle at 28% 26%, rgba(244, 191, 69, 0.16), transparent 28%),
    radial-gradient(circle at 80% 72%, rgba(255, 90, 51, 0.12), transparent 30%),
    #f6f8f7;
  background-size: 32px 32px, 32px 32px, auto, auto, auto;
}

.zoom-control {
  position: fixed;
  left: calc(var(--sidebar-width) + var(--canvas-control-side));
  bottom: var(--canvas-control-bottom);
  z-index: 120;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.zoom-pill,
.fullscreen-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: #53615a;
  box-shadow: 0 10px 24px rgba(32, 37, 34, 0.1);
}

.zoom-pill {
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 800;
}

.fullscreen-button {
  display: grid;
  width: 36px;
  padding: 0;
  place-items: center;
}

.fullscreen-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fullscreen-button.active {
  border-color: var(--coral);
  color: #fff;
  background: var(--coral);
}

.workspace:fullscreen {
  grid-template-rows: 1fr;
  background: var(--bg);
}

.workspace:fullscreen .topbar {
  display: none;
}

.workspace:fullscreen .canvas-stage {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
}

.workspace:fullscreen .zoom-control {
  left: var(--canvas-control-side);
}

.workspace:fullscreen .canvas-action-bar {
  left: 50%;
}

.workspace:fullscreen .mini-navigator {
  right: var(--canvas-control-side);
}

.zoom-menu {
  position: absolute;
  left: 0;
  bottom: 44px;
  display: grid;
  width: 136px;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.zoom-option {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fafbf9;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-align: left;
}

.zoom-option.active,
.zoom-option:hover {
  border-color: var(--teal);
  color: var(--teal-dark);
  background: #fff0eb;
}

.fit-option {
  color: #fff;
  background: #15171c;
  border-color: #15171c;
}

.fit-option:hover {
  color: #fff;
  background: #050505;
  border-color: #050505;
}

.stage-content {
  position: absolute;
  inset: 0;
  z-index: 1;
  --stage-zoom: 0.74;
  --stage-pan-x: 0px;
  --stage-pan-y: 0px;
}

.canvas-world {
  position: absolute;
  inset: 0;
  transform: translate(var(--stage-pan-x), var(--stage-pan-y)) scale(var(--stage-zoom));
  transform-origin: 0 0;
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
}

.canvas-stage.panning {
  cursor: grabbing;
}

.canvas-stage.file-drag-over {
  box-shadow: inset 0 0 0 2px rgba(255, 90, 51, 0.72);
}

.canvas-stage.panning .canvas-world {
  transition: none;
}

.canvas-node {
  --item-ui-scale: 1;
  --item-caption-gap: 4px;
  --item-caption-pad-bottom: 12px;
  --item-caption-pad-top: 10px;
  --item-caption-pad-x: 12px;
  --item-title-font: 14px;
  --item-meta-font: 12px;
  --comment-badge-border: 2px;
  --comment-badge-font: 11px;
  --comment-badge-offset: -10px;
  --comment-badge-size: 26px;
  --comment-popover-gap: 8px;
  --comment-popover-offset: 8px;
  --comment-popover-padding: 10px;
  --comment-popover-width: 236px;
  --comment-preview-font: 12px;
  --comment-preview-gap: 4px;
  --comment-preview-padding: 8px;
  --comment-preview-time-font: 11px;
  --comment-actions-gap: 6px;
  --comment-button-font: 12px;
  --comment-button-height: 24px;
  --comment-button-padding: 8px;
  --ppt-control-button: 30px;
  --ppt-control-button-height: 28px;
  --ppt-control-font: 20px;
  --ppt-control-gap: 6px;
  --ppt-control-margin: 4px;
  --ppt-control-padding: 5px;
  --ppt-page-font: 12px;
  --video-progress-height: 8px;
  --video-progress-margin: 5px;
  --video-progress-thumb: 14px;
  --video-progress-thumb-border: 2px;
  --note-handle-height: 30px;
  --note-handle-pad-x: 12px;
  --note-title-font: 12px;
  --note-title-height: 22px;
  --note-title-padding-x: 6px;
  --note-text-font: 15px;
  --note-text-padding: 16px;
  --resize-handle-border: 2px;
  --resize-handle-mark-border: 1px;
  --resize-handle-mark-offset: 3px;
  --resize-handle-mark-size: 5px;
  --resize-handle-offset: -7px;
  --resize-handle-radius: 5px;
  --resize-handle-size: 15px;
  position: absolute;
  overflow: visible;
  border: 1px solid rgba(108, 122, 114, 0.22);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(32, 37, 34, 0.13);
}

.photo-node {
  left: 86px;
  top: 76px;
  width: 286px;
}

.video-node {
  left: 254px;
  top: 380px;
  width: 318px;
  transform: rotate(-2deg);
}

.deck-node {
  left: 536px;
  top: 142px;
  width: 356px;
}

.small-node {
  left: 770px;
  top: 465px;
  width: 220px;
}

.uploaded-node {
  cursor: grab;
  min-width: 120px;
}

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

.canvas-node.item-selected {
  border: 2px solid var(--teal);
  box-shadow:
    0 0 0 4px rgba(255, 90, 51, 0.13),
    0 16px 38px rgba(32, 37, 34, 0.16);
}

.canvas-comment-badge {
  position: absolute;
  top: var(--comment-badge-offset);
  right: var(--comment-badge-offset);
  z-index: 9;
  display: grid;
  width: var(--comment-badge-size);
  min-height: var(--comment-badge-size);
  padding: 0;
  place-items: center;
  border: var(--comment-badge-border) solid #fff;
  border-radius: 50%;
  background: var(--coral);
  color: #fff;
  cursor: pointer;
  font-size: var(--comment-badge-font);
  font-weight: 950;
  box-shadow: 0 8px 18px rgba(32, 37, 34, 0.22);
}

.canvas-comment-popover {
  position: absolute;
  right: 0;
  bottom: calc(100% + var(--comment-popover-offset));
  display: none;
  width: var(--comment-popover-width);
  gap: var(--comment-popover-gap);
  padding: var(--comment-popover-padding);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.canvas-comment-badge:hover .canvas-comment-popover,
.canvas-comment-badge:focus-visible .canvas-comment-popover,
.canvas-comment-badge:focus-within .canvas-comment-popover {
  display: grid;
}

.canvas-comment-preview {
  display: grid;
  gap: var(--comment-preview-gap);
  padding-bottom: var(--comment-preview-padding);
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.canvas-comment-preview:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.canvas-comment-preview p {
  margin: 0;
  color: #2f3733;
  font-size: var(--comment-preview-font);
  font-weight: 750;
  line-height: 1.45;
}

.canvas-comment-preview time,
.canvas-comment-more {
  color: var(--muted);
  font-size: var(--comment-preview-time-font);
  font-weight: 800;
  text-align: left;
}

.comment-actions {
  display: flex;
  gap: var(--comment-actions-gap, 6px);
  align-items: center;
  justify-content: flex-end;
}

.comment-action-button {
  min-height: var(--comment-button-height, 24px);
  padding: 0 var(--comment-button-padding, 8px);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: #53615a;
  font-size: var(--comment-button-font, 12px);
  font-weight: 850;
}

.comment-action-button.danger {
  color: var(--coral);
}

.item-resize-handle {
  position: absolute;
  right: var(--resize-handle-offset);
  bottom: var(--resize-handle-offset);
  z-index: 3;
  width: var(--resize-handle-size);
  height: var(--resize-handle-size);
  border: var(--resize-handle-border) solid #fff;
  border-radius: var(--resize-handle-radius);
  background: var(--teal);
  box-shadow: 0 3px 10px rgba(32, 37, 34, 0.18);
  cursor: nwse-resize;
}

.item-resize-handle::after {
  position: absolute;
  right: var(--resize-handle-mark-offset);
  bottom: var(--resize-handle-mark-offset);
  width: var(--resize-handle-mark-size);
  height: var(--resize-handle-mark-size);
  border-bottom: var(--resize-handle-mark-border) solid rgba(255, 255, 255, 0.86);
  border-right: var(--resize-handle-mark-border) solid rgba(255, 255, 255, 0.86);
  content: "";
}

.selected {
  border: 2px solid var(--teal);
  box-shadow:
    0 0 0 4px rgba(255, 90, 51, 0.13),
    0 16px 38px rgba(32, 37, 34, 0.16);
}

.resize-dot {
  position: absolute;
  z-index: 2;
  width: 10px;
  height: 10px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--teal);
}

.top-left {
  left: -6px;
  top: -6px;
}

.top-right {
  right: -6px;
  top: -6px;
}

.bottom-left {
  left: -6px;
  bottom: -6px;
}

.bottom-right {
  right: -6px;
  bottom: -6px;
}

.node-media {
  position: relative;
  overflow: hidden;
  height: 178px;
  border-radius: 7px 7px 0 0;
}

.node-media img,
.node-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.deck-node .node-media {
  height: 208px;
}

.small-node .node-media {
  height: auto;
  min-height: 96px;
  border-radius: 7px;
}

.play-circle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 58px;
  height: 58px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  transition: opacity 120ms ease;
}

.play-circle::after {
  position: absolute;
  left: 24px;
  top: 18px;
  width: 0;
  height: 0;
  content: "";
  border-bottom: 11px solid transparent;
  border-left: 16px solid var(--teal-dark);
  border-top: 11px solid transparent;
}

.deck-media {
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(233, 111, 66, 0.12), transparent 55%),
    #fff7f1;
}

.deck-media.has-cover {
  padding: 0;
  background: #050505;
}

.ppt-cover-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ppt-inline-controls {
  display: grid;
  grid-template-columns: var(--ppt-control-button) 1fr var(--ppt-control-button);
  align-items: center;
  gap: var(--ppt-control-gap);
  margin-top: var(--ppt-control-margin);
  padding: var(--ppt-control-padding);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f8f6;
  color: #53615a;
}

.ppt-inline-button {
  display: grid;
  width: var(--ppt-control-button);
  min-height: var(--ppt-control-button-height);
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: #53615a;
  font-size: var(--ppt-control-font);
  font-weight: 900;
  line-height: 1;
}

.ppt-inline-button:disabled {
  opacity: 0.38;
}

.ppt-inline-page {
  overflow: hidden;
  font-size: var(--ppt-page-font);
  font-weight: 900;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-progress-control {
  display: grid;
  margin-top: var(--video-progress-margin);
}

.video-progress-range {
  width: 100%;
  height: var(--video-progress-height);
  margin: 0;
  appearance: none;
  border-radius: 999px;
  background:
    linear-gradient(90deg, var(--coral) var(--video-progress, 0%), #dfe5e1 var(--video-progress, 0%));
  cursor: pointer;
}

.video-progress-range::-webkit-slider-thumb {
  width: var(--video-progress-thumb);
  height: var(--video-progress-thumb);
  appearance: none;
  border: var(--video-progress-thumb-border) solid #fff;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 2px 8px rgba(32, 37, 34, 0.2);
}

.video-progress-range::-moz-range-thumb {
  width: var(--video-progress-thumb);
  height: var(--video-progress-thumb);
  border: var(--video-progress-thumb-border) solid #fff;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 2px 8px rgba(32, 37, 34, 0.2);
}

.deck-lines {
  display: grid;
  gap: 11px;
  width: 64%;
}

.deck-lines span {
  display: block;
  height: 13px;
  border-radius: 999px;
  background: #d95531;
}

.deck-lines span:nth-child(2) {
  width: 74%;
  background: #f0a04d;
}

.deck-lines span:nth-child(3) {
  width: 52%;
  background: #8dbd78;
}

.deck-chart {
  position: absolute;
  right: 28px;
  bottom: 24px;
  display: flex;
  align-items: end;
  gap: 8px;
  height: 92px;
}

.deck-chart i {
  display: block;
  width: 26px;
  border-radius: 7px 7px 0 0;
  background: var(--coral);
}

.deck-chart i:nth-child(1) {
  height: 46px;
}

.deck-chart i:nth-child(2) {
  height: 76px;
  background: var(--teal);
}

.deck-chart i:nth-child(3) {
  height: 58px;
  background: var(--sun);
}

.note-media {
  display: flex;
  align-items: center;
  padding: 18px;
  color: #675118;
  background: #fff4c2;
  font-size: 15px;
  line-height: 1.55;
}

.note-canvas-node .node-media {
  height: 150px;
  border-radius: 7px;
}

.note-write-media {
  display: grid;
  grid-template-rows: var(--note-handle-height) 1fr;
  background: #fff4c2;
}

.note-drag-handle {
  display: flex;
  align-items: center;
  padding: 0 var(--note-handle-pad-x);
  border-bottom: 1px solid rgba(103, 81, 24, 0.18);
  color: rgba(103, 81, 24, 0.72);
  cursor: grab;
  font-size: var(--note-title-font);
  font-weight: 850;
}

.note-title-input {
  width: 100%;
  min-width: 0;
  height: var(--note-title-height);
  padding: 0 var(--note-title-padding-x);
  border: 1px solid rgba(103, 81, 24, 0.28);
  border-radius: 6px;
  outline: none;
  background: rgba(255, 255, 255, 0.78);
  color: #675118;
  font: inherit;
  font-size: var(--note-title-font);
  font-weight: 850;
}

.note-textarea {
  width: 100%;
  height: 100%;
  padding: var(--note-text-padding);
  border: 0;
  outline: none;
  resize: none;
  background: transparent;
  color: #675118;
  font: inherit;
  font-size: var(--note-text-font);
  line-height: 1.5;
}

.note-textarea::placeholder {
  color: rgba(103, 81, 24, 0.62);
}

.node-caption {
  display: grid;
  gap: var(--item-caption-gap);
  padding: var(--item-caption-pad-top) var(--item-caption-pad-x) var(--item-caption-pad-bottom);
}

.node-caption strong {
  overflow: hidden;
  font-size: var(--item-title-font);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-caption span {
  font-size: var(--item-meta-font);
}

.preview-modal {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(560px, 58vw);
  overflow: hidden;
  transform: translate(-32%, -45%);
  border: 1px solid rgba(108, 122, 114, 0.28);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.media-preview-backdrop {
  position: fixed;
  inset: 0;
  z-index: 240;
  background: rgba(5, 6, 6, 0.74);
  backdrop-filter: blur(4px);
}

.media-preview-dialog {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  color: #fff;
  background: #050505;
}

.media-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 68px;
  padding: 14px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 10, 10, 0.94);
}

.media-preview-title {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.media-preview-title strong {
  overflow: hidden;
  font-size: 16px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-preview-title span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  font-weight: 750;
}

.media-preview-actions {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 10px;
}

.media-preview-zoom-indicator {
  min-width: 48px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 900;
  text-align: right;
}

.media-preview-download,
.media-preview-reset {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.media-preview-download:disabled,
.media-preview-reset:disabled {
  opacity: 0.48;
}

.media-preview-download:hover:not(:disabled),
.media-preview-reset:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.16);
}

.media-preview-close {
  display: grid;
  width: 40px;
  min-height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 24px;
  line-height: 1;
}

.media-preview-close:hover {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.16);
}

.media-preview-body {
  min-height: 0;
  padding: 24px;
  background: #050505;
}

.media-preview-stage {
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  place-items: center;
}

.media-preview-stage.is-pan-enabled {
  cursor: grab;
  touch-action: none;
}

.media-preview-dialog.is-panning .media-preview-stage.is-pan-enabled {
  cursor: grabbing;
}

.media-preview-image,
.media-preview-video {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: center center;
  transition: transform 120ms ease;
  user-select: none;
  will-change: transform;
}

.media-preview-dialog.is-panning .media-preview-image,
.media-preview-dialog.is-panning .media-preview-video {
  transition: none;
}

.media-preview-image {
  border-radius: 6px;
}

.media-preview-video {
  width: 100%;
  height: 100%;
  background: #000;
}

.media-preview-empty {
  display: grid;
  min-width: min(360px, 80vw);
  min-height: 120px;
  place-items: center;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  font-weight: 800;
}

.media-ppt-viewer {
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
}

.media-ppt-slide {
  width: min(1120px, 100%);
  aspect-ratio: 16 / 9;
  max-height: calc(100vh - 176px);
  margin: 0 auto;
  padding: clamp(28px, 5vw, 58px);
  overflow: hidden;
  border: 1px solid rgba(255, 90, 51, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 90, 51, 0.14), transparent 44%),
    linear-gradient(158deg, #fff 0 62%, #f2f4f1 63% 100%);
  color: var(--ink);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.34);
}

.media-ppt-kicker {
  color: var(--coral);
  font-size: 13px;
  font-weight: 950;
  text-transform: uppercase;
}

.media-ppt-slide h2 {
  max-width: 740px;
  margin: 18px 0 10px;
  overflow: hidden;
  font-size: clamp(28px, 5vw, 54px);
  line-height: 1.08;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-ppt-slide p {
  margin: 0;
  color: #58645f;
  font-size: 16px;
  font-weight: 800;
}

.media-ppt-slide.static-slide {
  position: relative;
  display: block;
  padding: 0;
  background: #fff;
}

.media-ppt-slide.rendered-slide {
  position: relative;
  display: block;
  padding: 0;
  background: #050505;
}

.media-ppt-rendered-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #050505;
}

.media-ppt-static-images {
  position: absolute;
  inset: 0;
  display: grid;
  overflow: hidden;
  grid-auto-rows: 1fr;
  background: #fff;
}

.media-ppt-static-images.image-count-1 {
  grid-template-columns: 1fr;
}

.media-ppt-static-images.image-count-2 {
  grid-template-columns: repeat(2, 1fr);
}

.media-ppt-static-images.image-count-3,
.media-ppt-static-images.image-count-4 {
  grid-template-columns: repeat(2, 1fr);
}

.media-ppt-static-images img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  background: #fff;
}

.media-ppt-visual {
  display: flex;
  align-items: end;
  gap: 16px;
  height: min(30vh, 190px);
  margin-top: clamp(34px, 7vw, 86px);
}

.media-ppt-visual span {
  display: block;
  width: min(118px, 18%);
  border-radius: 8px 8px 0 0;
  background: var(--coral);
}

.media-ppt-visual span:nth-child(2) {
  background: var(--teal);
}

.media-ppt-visual span:nth-child(3) {
  background: var(--sun);
}

.media-ppt-visual span:nth-child(4) {
  background: var(--leaf);
}

.media-preview-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.media-preview-page-button {
  min-width: 88px;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: #fff;
  color: #151716;
  font-size: 13px;
  font-weight: 900;
}

.media-preview-page-button:disabled {
  opacity: 0.46;
}

.media-preview-counter {
  min-width: 64px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.canvas-action-bar {
  position: fixed;
  left: calc(var(--sidebar-width) + (100vw - var(--sidebar-width) - var(--inspector-width)) / 2);
  bottom: var(--canvas-control-bottom);
  z-index: 120;
  display: flex;
  gap: 8px;
  padding: 6px;
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 28px rgba(32, 37, 34, 0.12);
}

.canvas-action-button {
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #53615a;
  font-size: 13px;
  font-weight: 850;
}

.canvas-action-button.active {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.upload-action-button,
.upload-action-button.active {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: #fff;
  background: #050505;
  border-color: #050505;
}

.upload-button-icon {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
}

.upload-button-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.upload-action-wrap {
  position: relative;
}

.upload-type-menu {
  position: absolute;
  left: 50%;
  bottom: 50px;
  display: grid;
  width: 112px;
  gap: 6px;
  padding: 8px;
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.upload-type-button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fafbf9;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.upload-type-button:hover {
  border-color: var(--teal);
  color: var(--teal-dark);
}

.mini-navigator {
  position: fixed;
  right: calc(var(--inspector-width) + var(--canvas-control-side));
  bottom: var(--canvas-control-bottom);
  z-index: 120;
  width: 146px;
  height: 98px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 28px rgba(32, 37, 34, 0.12);
}

.mini-map {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 6px;
  background:
    linear-gradient(rgba(108, 122, 114, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(108, 122, 114, 0.1) 1px, transparent 1px),
    #f6f8f7;
  background-size: 12px 12px;
}

.mini-map-dot {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  transform: translate(-50%, -50%);
  transition:
    width 140ms ease,
    height 140ms ease,
    background 140ms ease,
    box-shadow 140ms ease;
}

.mini-map-dot.active {
  width: 10px;
  height: 10px;
  background: var(--coral);
  box-shadow: 0 0 0 3px rgba(233, 111, 66, 0.18);
}

.mini-map-viewport {
  position: absolute;
  left: 34%;
  top: 28%;
  width: 38%;
  height: 34%;
  border: 2px solid var(--coral);
  border-radius: 5px;
  background: rgba(233, 111, 66, 0.08);
  transition:
    left 180ms ease,
    top 180ms ease;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.preview-header div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.close-button {
  width: 34px;
  min-height: 34px;
  padding: 0;
  color: var(--muted);
  font-size: 24px;
}

.preview-body {
  padding: 18px;
  background: #f6f7f5;
}

.slide-preview {
  min-height: 292px;
  padding: 34px;
  border: 1px solid #ead8ca;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(233, 111, 66, 0.12), transparent 45%),
    linear-gradient(160deg, #fffaf5 0 62%, #d8eee6 63% 100%);
}

.slide-kicker {
  color: var(--coral);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.slide-preview h1 {
  max-width: 360px;
  margin: 14px 0 10px;
  font-size: 30px;
  line-height: 1.18;
}

.slide-preview p {
  max-width: 360px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.slide-visual {
  display: flex;
  gap: 10px;
  align-items: end;
  height: 78px;
  margin-top: 34px;
}

.slide-visual span {
  display: block;
  width: 88px;
  border-radius: 8px;
  background: var(--teal);
}

.slide-visual span:nth-child(1) {
  height: 42px;
  background: var(--sun);
}

.slide-visual span:nth-child(2) {
  height: 68px;
  background: var(--coral);
}

.slide-visual span:nth-child(3) {
  height: 54px;
  background: var(--leaf);
}

.preview-controls {
  display: grid;
  grid-template-columns: 86px 1fr 86px;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.preview-controls button {
  min-height: 34px;
  color: #53615a;
  font-size: 13px;
}

.page-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce3df;
}

.page-track span {
  display: block;
  width: 28%;
  height: 100%;
  background: var(--teal);
}

.inspector-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.inspector-card:first-child {
  margin-top: 0;
}

.selected-file {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 10px;
  align-items: center;
}

.inspector-empty {
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: #fafbf9;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.inspector-selection .wide-button {
  width: 100%;
  margin-top: 16px;
}

.comments-panel {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.comments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.comments-header strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.comments-header span {
  display: grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 90, 51, 0.12);
  color: var(--coral);
  font-size: 12px;
  font-weight: 900;
}

.comments-list {
  display: grid;
  max-height: 172px;
  gap: 8px;
  overflow: auto;
}

.comment-row {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbf9;
}

.comment-row p {
  margin: 0;
  color: #2f3733;
  font-size: 13px;
  line-height: 1.45;
}

.comment-row time,
.comment-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.comment-row .comment-actions {
  justify-content: flex-start;
  gap: 7px;
  padding-top: 2px;
}

.comment-row .comment-action-button {
  min-height: 28px;
  padding: 0 12px;
  border-color: rgba(83, 97, 90, 0.18);
  border-radius: 999px;
  background: #fff;
  color: #4c5a53;
  box-shadow: 0 4px 12px rgba(32, 37, 34, 0.06);
  font-size: 12px;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    color 140ms ease,
    transform 140ms ease;
}

.comment-row .comment-action-button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 90, 51, 0.36);
  background: #fff7f4;
  color: var(--coral);
  box-shadow: 0 8px 18px rgba(32, 37, 34, 0.09);
}

.comment-row .comment-action-button.danger {
  border-color: rgba(255, 90, 51, 0.22);
  background: rgba(255, 90, 51, 0.08);
  color: var(--coral);
}

.comment-row .comment-action-button.danger:hover {
  border-color: var(--coral);
  background: var(--coral);
  color: #fff;
}

.comment-input {
  width: 100%;
  min-height: 82px;
  padding: 10px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  line-height: 1.45;
}

.comment-input:focus {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(255, 90, 51, 0.12);
}

.inspector-selection .comment-submit {
  margin-top: 0;
}

.image-ai-panel {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.ai-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ai-panel-title {
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.ai-settings-button {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: #53615a;
  font-size: 12px;
  font-weight: 850;
}

.ai-settings-button.active {
  color: #fff;
  background: #050505;
  border-color: #050505;
}

.ai-settings-panel {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9f8;
}

.ai-field-stack {
  display: grid;
  gap: 8px;
}

.ai-field-stack input,
.ai-field-stack select,
.ai-field-stack textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: #fafbf9;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
}

.ai-field-stack input {
  min-height: 34px;
  padding: 0 10px;
}

.ai-field-stack select {
  min-height: 34px;
  padding: 0 9px;
}

.ai-field-stack textarea {
  min-height: 76px;
  resize: vertical;
  padding: 9px 10px;
  line-height: 1.5;
}

.ai-field-stack input:focus,
.ai-field-stack select:focus,
.ai-field-stack textarea:focus {
  border-color: var(--teal);
  background: #fff;
}

.ai-verify-status {
  min-height: 30px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.ai-verify-status.success {
  color: #16733a;
  border-color: #9bd9b0;
  background: #ebf8ef;
}

.ai-verify-status.error {
  color: #b42318;
  border-color: #f3aaa4;
  background: #fff0ef;
}

.ai-action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ai-settings-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.ai-action-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #53615a;
  font-size: 12px;
  font-weight: 850;
}

.ai-action-button.primary {
  color: #fff;
  background: #050505;
  border-color: #050505;
}

.ai-action-button:disabled {
  opacity: 0.62;
}

.ai-result-box {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff8f5;
  color: #3d4540;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.ai-generated-preview {
  display: block;
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f8f7;
}

.selected-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
}

.selected-file div:last-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.selected-file strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.property-list {
  display: grid;
  gap: 12px;
  margin: 16px 0 0;
}

.property-list div,
.permission-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.property-list dt,
.permission-row span {
  color: var(--muted);
  font-size: 12px;
}

.property-list dd {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
}

.ready {
  color: var(--teal-dark);
}

.share-preview {
  overflow: hidden;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9f8;
  color: #53615a;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wide-button {
  width: 100%;
  margin-top: 12px;
}

.canvas-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.canvas-menu {
  position: fixed;
  z-index: 50;
  display: grid;
  gap: 6px;
  width: 252px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
}

.menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  overflow: hidden;
  padding: 4px 4px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.menu-close-button {
  display: grid;
  width: 26px;
  min-width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  font-size: 19px;
  font-weight: 850;
  line-height: 1;
}

.menu-close-button:hover {
  border-color: var(--teal);
  color: var(--teal-dark);
}

.menu-button,
.menu-folder-item {
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
  text-align: left;
}

.menu-button:hover,
.menu-folder-item:hover,
.cover-swatch:hover {
  border-color: var(--teal);
}

.menu-button.return-button {
  color: var(--teal-dark);
  background: #fff0eb;
  border-color: #ffb59f;
  font-weight: 850;
  text-align: center;
}

.menu-button.return-button:hover {
  background: #ffe3da;
  border-color: var(--teal);
}

.menu-form {
  display: grid;
  gap: 10px;
}

.menu-action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.menu-font-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.menu-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.menu-field input[type="color"] {
  width: 100%;
  height: 38px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.menu-field input[type="text"] {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 750;
}

.menu-field input[type="text"]:focus {
  border-color: var(--teal);
}

.menu-hint {
  padding: 0 4px 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.menu-palette {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 4px 0 2px;
}

.cover-swatch {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.menu-folder-list {
  display: grid;
  gap: 6px;
  max-height: min(300px, calc(100vh - 220px));
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 3px;
}

.copy-toast {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 110;
  min-width: 156px;
  padding: 12px 18px;
  transform: translate(-50%, -50%);
  border-radius: 8px;
  background: rgba(32, 37, 34, 0.92);
  color: #fff;
  font-size: 14px;
  font-weight: 850;
  text-align: center;
  box-shadow: var(--shadow);
}

.share-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(32, 37, 34, 0.22);
}

.share-dialog {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 90;
  width: min(420px, calc(100vw - 32px));
  overflow: hidden;
  transform: translate(-50%, -50%);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.share-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.share-dialog-header div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.share-dialog-header strong {
  font-size: 16px;
}

.share-dialog-header span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-dialog-close {
  display: grid;
  width: 34px;
  min-width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 24px;
  font-weight: 850;
  line-height: 1;
}

.share-dialog-body {
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: 20px;
}

.qr-code {
  display: block;
  width: 184px;
  height: 184px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
}

.share-link-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9f8;
}

.share-link-box span {
  overflow: hidden;
  align-self: center;
  color: #53615a;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-link-copy {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--teal);
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  font-size: 13px;
  font-weight: 850;
}

.ai-settings-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(32, 37, 34, 0.22);
}

.ai-settings-dialog {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 90;
  width: min(420px, calc(100vw - 32px));
  overflow: hidden;
  transform: translate(-50%, -50%);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.ai-settings-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.ai-settings-dialog-header div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.ai-settings-dialog-header strong {
  font-size: 16px;
}

.ai-settings-dialog-header span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-settings-dialog-close {
  display: grid;
  width: 34px;
  min-width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 24px;
  font-weight: 850;
  line-height: 1;
}

.ai-settings-dialog-body {
  padding: 16px;
}

.ai-model-picker {
  display: grid;
  gap: 12px;
}

.ai-model-category {
  display: grid;
  gap: 8px;
}

.ai-model-category-title {
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.ai-model-list {
  display: grid;
  max-height: 156px;
  overflow: auto;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9f8;
  scrollbar-color: #aab7b1 transparent;
  scrollbar-width: thin;
}

.ai-model-list::-webkit-scrollbar {
  width: 8px;
}

.ai-model-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #aab7b1;
}

.ai-model-option {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: #fff;
  color: #3d4540;
  font-size: 12px;
  font-weight: 800;
}

.ai-model-option input {
  width: 14px;
  height: 14px;
  accent-color: var(--teal);
}

.ai-model-option span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-model-empty {
  padding: 8px;
  color: var(--muted);
  font-size: 12px;
}

.ai-model-picker-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-top: 2px;
}

.confirm-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(32, 37, 34, 0.22);
}

.confirm-dialog {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 90;
  width: min(360px, calc(100vw - 32px));
  overflow: hidden;
  transform: translate(-50%, -50%);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.confirm-dialog-header {
  padding: 16px 16px 10px;
}

.confirm-dialog-header strong {
  font-size: 16px;
}

.confirm-dialog-body {
  padding: 0 16px 14px;
}

.confirm-dialog-body p {
  margin: 0;
  color: #4f5b55;
  font-size: 14px;
  line-height: 1.6;
}

.confirm-dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--line);
}

.confirm-cancel-button,
.confirm-delete-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  font-weight: 850;
}

.confirm-delete-button {
  color: #fff;
  background: #c94b35;
  border-color: #c94b35;
}

.folder-overview {
  position: absolute;
  inset: 42px 48px 42px 48px;
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.folder-overview-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.folder-overview-header h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.folder-overview-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.folder-canvas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(226px, 1fr));
  gap: 14px;
}

.folder-canvas-card {
  display: grid;
  grid-template-columns: 60px 1fr;
  align-items: center;
  gap: 12px;
  min-height: 96px;
  padding: 14px;
  border: 1px solid rgba(108, 122, 114, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 24px rgba(32, 37, 34, 0.1);
  text-align: left;
}

.folder-canvas-card.active {
  border-color: var(--teal);
  box-shadow:
    inset 3px 0 0 var(--teal),
    0 10px 24px rgba(32, 37, 34, 0.1);
}

.folder-card-cover {
  display: grid;
  width: 60px;
  height: 60px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(32, 37, 34, 0.16);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
}

.folder-card-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.folder-card-copy strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-card-copy span {
  color: var(--muted);
  font-size: 12px;
}

.stage-empty {
  display: grid;
  gap: 12px;
  min-height: 180px;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.stage-new-canvas-button {
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--teal);
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  font-size: 13px;
  font-weight: 850;
}

.selection-box {
  position: absolute;
  z-index: 9;
  border: 1px solid var(--teal);
  border-radius: 4px;
  background: rgba(255, 90, 51, 0.12);
  pointer-events: none;
}

@media (max-width: 900px) {
  body {
    min-width: 0;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar,
  .inspector {
    display: none;
  }

  .workspace {
    min-height: 100vh;
  }

  .zoom-control {
    left: var(--canvas-control-side);
  }

  .canvas-action-bar {
    left: 50%;
  }

  .mini-navigator {
    right: var(--canvas-control-side);
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    height: auto;
    padding: 14px;
  }

  .toolbar {
    flex-wrap: wrap;
  }

  .canvas-stage {
    min-height: calc(100vh - 136px);
  }

  .photo-node {
    left: 32px;
    top: 44px;
  }

  .video-node {
    left: 56px;
    top: 324px;
  }

  .deck-node {
    left: 170px;
    top: 148px;
  }

  .small-node {
    left: 392px;
    top: 430px;
  }

  .preview-modal {
    left: 50%;
    top: 54%;
    width: min(520px, calc(100vw - 28px));
    transform: translate(-50%, -50%);
  }

  .media-preview-header {
    gap: 10px;
    min-height: 58px;
    padding: 10px 12px;
  }

  .media-preview-actions {
    gap: 6px;
  }

  .media-preview-zoom-indicator {
    min-width: 42px;
  }

  .media-preview-download,
  .media-preview-reset {
    min-height: 36px;
    padding: 0 10px;
  }

  .media-preview-body {
    padding: 12px;
  }

  .media-ppt-slide {
    max-height: calc(100vh - 150px);
    padding: 22px;
  }

  .media-ppt-slide h2 {
    font-size: 26px;
  }

  .media-ppt-slide.static-slide {
    padding: 0;
  }

  .media-ppt-visual {
    gap: 10px;
    margin-top: 28px;
  }
}
