/* Desktop editor chrome. Page/canvas styling lives in the other stylesheets. */
.app-shell { grid-template-rows: 70px 62px minmax(0, 1fr) 48px; }

.appbar.custom-titlebar {
  height: 70px;
  gap: 18px;
  padding: 0 0 0 20px;
  background: #fff;
  border-bottom: 1px solid #e4e7ef;
  color: #222b42;
}
.brand-block { min-width: 224px; gap: 12px; }
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #7158d9;
  color: #fff;
  font-size: 20px;
  box-shadow: none;
}
.brand-name { color: #202840; font-size: 14px; line-height: 1.25; font-weight: 760; }
.brand-meta { display: flex; align-items: center; gap: 6px; margin-top: 3px; color: #6d7890; font-size: 11px; }
.brand-meta-divider { color: #aeb7c7; }

.appbar-center { min-width: 0; gap: 12px; margin-left: 0; }
.appbar-command-group, .appbar-menu-group { display: flex; align-items: center; min-width: 0; }
.appbar-command-group { gap: 2px; padding-right: 12px; border-right: 1px solid #e5e8f0; }
.appbar-menu-group { gap: 3px; }
.appbar .labeled-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: auto;
  min-width: 38px;
  height: 38px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #4b5871;
  font-size: 12px;
  font-weight: 620;
  white-space: nowrap;
}
.appbar .labeled-action:hover, .appbar .top-action:hover { background: #f1effb; color: #5d47b3; }
.appbar .labeled-action:disabled { opacity: .38; cursor: default; }
.appbar .labeled-action:disabled:hover { background: transparent; color: #4b5871; }
.appbar .labeled-action.danger-hover:hover { background: #fff0f2; color: #d34659; }
.action-glyph { display: grid; place-items: center; width: 17px; height: 17px; color: inherit; font-size: 19px; line-height: 1; }
.action-glyph svg, .device-icon { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.action-label { font-size: 12px; }
.appbar .top-action {
  height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #39455e;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}
.appbar .top-action span { margin-left: 4px; color: #8792a7; }
.appbar .shortcut-action kbd { margin-left: 6px; padding: 2px 5px; border: 1px solid #e0e4ec; border-radius: 5px; color: #79859b; font: inherit; font-size: 10px; }

.appbar-actions { gap: 7px; margin-left: auto; }
.save-state { margin-right: 7px; color: #64718a; font-size: 11px; white-space: nowrap; }
.save-dot { background: #29b685; box-shadow: 0 0 0 3px #dff6ed; }
.appbar-actions .btn { min-height: 38px; padding: 0 13px; border-radius: 8px; font-size: 12px; box-shadow: none; }
.appbar-actions #saveBtn { background: transparent; border-color: transparent; color: #3d4960; }
.appbar-actions #saveBtn:hover { background: #f1f3f8; border-color: transparent; }
.appbar-actions #exportBtn { background: #fff; border-color: #dce1eb; color: #38445d; }
.appbar-actions #exportBtn:hover { background: #f7f8fc; border-color: #cbd2e1; }
.appbar-actions #previewBtn { min-width: 83px; background: #7158d9; border-color: #7158d9; color: #fff; }
.appbar-actions #previewBtn:hover { background: #6047c7; border-color: #6047c7; }

.appbar .window-controls {
  height: 36px;
  gap: 1px;
  margin: 0 9px 0 6px;
  padding: 0 0 0 9px;
  border: 0;
  border-left: 1px solid #e5e8f0;
  background: transparent;
}
.appbar .window-btn { width: 35px; height: 36px; display: grid; place-items: center; border-radius: 7px; color: #64718a; }
.appbar .window-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.appbar .window-btn:hover { background: #edf0f6; color: #2b3650; }
.appbar .window-btn.close:hover { background: #e85568; color: #fff; }
.appbar button:focus-visible, .editor-toolbar button:focus-visible, .editor-toolbar input:focus-visible { outline: 2px solid #7158d9; outline-offset: 2px; }

.editor-toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  min-width: 0;
  padding: 0 20px;
  background: #f7f8fb;
  border-bottom: 1px solid #e1e5ed;
  box-shadow: 0 3px 12px rgba(25,37,65,.05);
  color: #39455d;
}
.editor-toolbar .device-switcher { min-width: 0; flex-shrink: 0; gap: 2px; padding: 3px; border: 1px solid #e1e5ee; border-radius: 10px; background: #fff; box-shadow: 0 1px 3px rgba(24,32,56,.04); }
.editor-toolbar .device-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: #67738a; font-size: 12px; font-weight: 630; white-space: nowrap; }
.editor-toolbar .device-btn span { margin: 0; }
.editor-toolbar .device-btn:hover { background: #f3f1fb; color: #604cbb; }
.editor-toolbar .device-btn.active { background: #ebe6ff; border-color: transparent; color: #6049b9; box-shadow: none; }
.editor-toolbar .toolbar-center-info { display: flex; justify-content: center; gap: 18px; min-width: 0; color: #5b6880; }
.canvas-width-group, .canvas-options-group { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.canvas-options-group { padding-left: 18px; border-left: 1px solid #e0e4ed; }
.toolbar-group-label { color: #67738a; font-size: 11px; font-weight: 680; white-space: nowrap; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.editor-toolbar .viewport-input, .editor-toolbar .grid-size-control { height: 36px; border: 1px solid #dce1eb; border-radius: 8px; background: #fff; color: #39455d; }
.editor-toolbar .viewport-input input { width: 55px; color: #28344d; font-size: 12px; font-weight: 700; }
.editor-toolbar .canvas-height-input input { width: 62px; }
.editor-toolbar .grid-size-control { gap: 4px; padding: 0 7px; }
.editor-toolbar .grid-size-control input { width: 42px; color: #28344d; font-size: 12px; font-weight: 700; }
.editor-toolbar .viewport-input span, .editor-toolbar .grid-size-control span { color: #78849b; font-size: 11px; }
.editor-toolbar .tool-pill, .editor-toolbar .zoom-value { height: 36px; padding: 0 10px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #56627b; font-size: 12px; font-weight: 630; white-space: nowrap; }
.editor-toolbar .tool-pill:hover, .editor-toolbar .zoom-value:hover { background: #edebf7; color: #604bbb; }
.editor-toolbar .tool-pill.active { background: #ebe6ff; border-color: transparent; color: #6049b9; }
.editor-toolbar .zoom-group { gap: 2px; margin-left: 0; padding-left: 17px; border-left: 1px solid #e0e4ed; }
.editor-toolbar .zoom-group .icon-btn.small { width: 32px; height: 36px; border: 0; background: transparent; color: #59667d; }
.editor-toolbar .zoom-group .icon-btn.small:hover { background: #edebf7; color: #604bbb; }
.editor-toolbar .zoom-value { min-width: 52px; color: #34415b; font-weight: 760; }

@media (max-width: 1600px) {
  .appbar.custom-titlebar { gap: 11px; padding-left: 15px; }
  .brand-block { min-width: 197px; }
  .appbar-center { gap: 7px; }
  .appbar .labeled-action { padding: 0 6px; }
  .appbar .top-action { padding: 0 8px; }
  .editor-toolbar { gap: 12px; padding: 0 12px; }
  .editor-toolbar .toolbar-center-info { gap: 10px; }
  .canvas-options-group { padding-left: 10px; }
  .editor-toolbar .zoom-group { padding-left: 10px; }
}
@media (max-width: 1360px) {
  .action-label, .appbar .shortcut-action kbd, .appbar .save-state { display: none; }
  .appbar .labeled-action { width: 36px; min-width: 36px; padding: 0; }
  .editor-toolbar .device-btn { padding: 0 7px; }
  .editor-toolbar #fitSelectionBtn { display: none; }
  .canvas-height-label { display: none; }
}
@media (max-width: 1180px) {
  .brand-block { min-width: 177px; }
  .brand-name { font-size: 12px; }
  .appbar .shortcut-action { display: none; }
  .appbar-actions .btn { padding: 0 9px; }
  .toolbar-group-label { display: none; }
  .editor-toolbar .device-btn span { display: none; }
  .editor-toolbar .device-btn { width: 36px; }
  .editor-toolbar #actualSizeBtn { display: none; }
}
