:root {
  color-scheme: light;
  --app-bar-height: 52px;
  --tool-bar-height: 46px;
  --page-sidebar-width: 188px;
  --inspector-width: 232px;
  --border: #d9dde4;
  --border-strong: #c8cdd6;
  --surface: #ffffff;
  --surface-soft: #f5f6f8;
  --surface-muted: #eceff3;
  --canvas-bg: #dfe3e8;
  --text: #17191d;
  --muted: #69717e;
  --primary: #007b83;
  --primary-hover: #006970;
  --danger: #b42318;
  --shadow: 0 10px 28px rgba(18, 24, 32, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background: var(--surface-soft);
  color: var(--text);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
  letter-spacing: 0;
}

button {
  border: 0;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid #158f98;
  outline-offset: 2px;
}

svg {
  display: block;
  width: 17px;
  height: 17px;
  stroke-width: 2;
}

.app-shell {
  width: 100%;
  height: 100%;
}

.app-bar {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(116px, 1fr) minmax(180px, 480px) minmax(260px, 1fr);
  align-items: center;
  width: 100%;
  height: var(--app-bar-height);
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.97);
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 750;
}

.brand-mark {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 6px;
  background: #17191d;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.document-title {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-self: center;
  gap: 8px;
}

.document-title input {
  width: min(320px, 28vw);
  min-width: 0;
  height: 30px;
  padding: 0 8px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  text-align: center;
  text-overflow: ellipsis;
  font-size: 13px;
  font-weight: 650;
}

.document-title input:hover,
.document-title input:focus {
  border-color: var(--border);
  background: var(--surface-soft);
}

.document-state {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
}

.app-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-self: end;
  gap: 5px;
}

.icon-button,
.tool-button,
.zoom-value,
.brush-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.icon-button {
  width: 32px;
  height: 32px;
}

.icon-button:hover:not(:disabled),
.zoom-value:hover:not(:disabled),
.brush-button:hover:not(:disabled) {
  border-color: var(--border);
  background: var(--surface-soft);
}

button:disabled {
  cursor: default;
  opacity: 0.38;
}

.primary-action {
  display: inline-flex;
  height: 32px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-left: 2px;
  padding: 0 11px;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
}

.primary-action:hover:not(:disabled) {
  background: var(--primary-hover);
}

.workspace {
  display: grid;
  grid-template-columns: var(--page-sidebar-width) minmax(0, 1fr) var(--inspector-width);
  width: 100%;
  height: calc(100% - var(--app-bar-height));
}

.page-sidebar,
.inspector {
  min-height: 0;
  background: var(--surface);
}

.page-sidebar {
  overflow: hidden;
  border-right: 1px solid var(--border);
}

.inspector {
  overflow-y: auto;
  border-left: 1px solid var(--border);
}

.side-heading {
  display: flex;
  height: 42px;
  align-items: center;
  justify-content: space-between;
  padding: 0 13px;
  border-bottom: 1px solid var(--border);
  color: #4f5763;
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 800;
}

.count-badge {
  display: inline-flex;
  min-width: 20px;
  height: 19px;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  background: var(--surface-muted);
  color: #545c68;
  font-size: 10px;
}

.page-list {
  height: calc(100% - 42px);
  padding: 10px;
  overflow-y: auto;
}

.page-item {
  display: grid;
  width: 100%;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: start;
  gap: 5px;
  margin: 0 0 9px;
  padding: 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.page-item:hover {
  background: var(--surface-soft);
}

.page-item.is-active {
  border-color: #58aeb4;
  background: #eef9fa;
}

.page-number {
  padding-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.page-thumb {
  display: block;
  width: 100%;
  min-height: 80px;
  border: 1px solid var(--border);
  background: #fff;
  object-fit: contain;
  box-shadow: 0 2px 7px rgba(24, 31, 40, 0.08);
}

.page-thumb-placeholder {
  display: grid;
  width: 100%;
  min-height: 96px;
  place-items: center;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  font-size: 11px;
}

.editor-column {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: var(--tool-bar-height) minmax(0, 1fr);
}

.tool-bar {
  position: relative;
  z-index: 8;
  display: flex;
  min-width: 0;
  height: var(--tool-bar-height);
  align-items: center;
  gap: 3px;
  padding: 0 9px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
  scrollbar-width: none;
}

.tool-bar::-webkit-scrollbar {
  display: none;
}

.tool-button {
  min-width: 56px;
  height: 34px;
  gap: 6px;
  padding: 0 8px;
  color: #4f5763;
  font-size: 11px;
  font-weight: 700;
}

.tool-button:hover:not(:disabled) {
  border-color: var(--border);
  background: var(--surface-soft);
}

.tool-button.is-active {
  border-color: #91c7cb;
  background: #eaf7f8;
  color: #006b72;
}

.tool-divider {
  width: 1px;
  height: 22px;
  margin: 0 4px;
  background: var(--border);
}

.tool-spacer {
  flex: 1 1 auto;
  min-width: 6px;
}

.zoom-value {
  min-width: 36px;
  height: 30px;
  padding: 0 6px;
  color: #4f5763;
  font-size: 10px;
  font-weight: 750;
}

.stage-viewport {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--canvas-bg);
}

.mobile-page-nav {
  display: none;
}

.empty-state {
  display: flex;
  min-height: 100%;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 28px;
  text-align: center;
}

.empty-icon {
  display: grid;
  width: 52px;
  height: 52px;
  margin-bottom: 14px;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  color: #59616c;
}

.empty-icon svg {
  width: 23px;
  height: 23px;
}

.empty-state h1 {
  margin: 0 0 15px;
  font-size: 22px;
  line-height: 1.2;
}

.empty-open,
.primary-button,
.secondary-button,
.wide-button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
}

.empty-open,
.primary-button {
  padding: 0 14px;
  background: var(--primary);
  color: #fff;
}

.empty-open:hover,
.primary-button:hover {
  background: var(--primary-hover);
}

.empty-state p {
  max-width: 380px;
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.canvas-stage {
  display: flex;
  width: max-content;
  min-width: 100%;
  min-height: 100%;
  align-items: flex-start;
  justify-content: center;
  padding: 28px 36px 52px;
  transform-origin: top center;
}

.canvas-stage .canvas-container {
  flex: 0 0 auto;
  background: #fff;
  box-shadow: 0 5px 22px rgba(20, 27, 36, 0.18);
}

.canvas-stage canvas {
  touch-action: none;
}

.inspector-empty {
  display: flex;
  min-height: 150px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  color: #858c96;
  font-size: 11px;
}

.inspector-controls {
  padding: 14px;
}

.control-group {
  margin-bottom: 18px;
}

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

.control-row label,
.control-label {
  color: #4f5763;
  font-size: 11px;
  font-weight: 700;
}

.control-row output {
  color: var(--muted);
  font-size: 10px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}

.text-editor-input {
  display: block;
  width: 100%;
  min-height: 58px;
  margin-top: 8px;
  padding: 8px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  font-size: 12px;
  line-height: 1.35;
}

.text-font-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  align-items: start;
  gap: 7px;
  margin: 10px 0 7px;
}

.font-picker-button,
.text-number-input {
  min-width: 0;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  font-size: 11px;
}

.font-picker-button {
  display: grid;
  width: 100%;
  grid-template-columns: 27px minmax(0, 1fr) 14px;
  align-items: center;
  gap: 4px;
  padding: 0 7px 0 4px;
  cursor: pointer;
  text-align: left;
}

.font-picker-button:hover {
  background: var(--surface-soft);
}

.font-picker-button[aria-expanded="true"] {
  border-color: #7cb7bb;
}

.font-picker-preview {
  display: grid;
  width: 27px;
  height: 25px;
  place-items: center;
  color: #202329;
  font-size: 16px;
  line-height: 1;
}

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

.font-picker-button svg {
  width: 13px;
  height: 13px;
  color: #69717e;
  transition: transform 140ms ease;
}

.font-picker-button[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.font-picker-menu {
  display: grid;
  grid-column: 1 / -1;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

.font-option {
  display: grid;
  width: 100%;
  height: 38px;
  grid-template-columns: 38px minmax(0, 1fr) 16px;
  align-items: center;
  padding: 0 8px 0 4px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
}

.font-option:last-child {
  border-bottom: 0;
}

.font-option:hover,
.font-option.is-active {
  background: #eef7f7;
}

.font-option-preview {
  color: #202329;
  text-align: center;
  font-size: 19px;
  line-height: 1;
}

.font-option-name {
  overflow: hidden;
  text-overflow: ellipsis;
  color: #444b55;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    sans-serif;
  font-size: 11px;
  white-space: nowrap;
}

.font-option-check {
  width: 14px;
  height: 14px;
  color: var(--primary);
  opacity: 0;
}

.font-option.is-active .font-option-check {
  opacity: 1;
}

.text-number-input {
  width: 58px;
  padding: 0 4px 0 7px;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  width: 100%;
  margin-top: 11px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.segment-button {
  display: grid;
  min-width: 0;
  height: 30px;
  place-items: center;
  border-right: 1px solid var(--border);
  background: var(--surface);
  color: #515966;
  cursor: pointer;
}

.segment-button:last-child {
  border-right: 0;
}

.segment-button:hover {
  background: var(--surface-soft);
}

.segment-button.is-active,
.segment-button[aria-pressed="true"] {
  background: #e6f3f3;
  color: #006970;
}

.segment-button.segment-separator {
  border-left: 2px solid var(--border-strong);
}

.segment-button svg {
  width: 15px;
  height: 15px;
}

.text-line-control {
  margin: 12px 0;
}

.swatches {
  display: grid;
  grid-template-columns: repeat(4, 28px);
  gap: 7px;
  margin-top: 9px;
}

.swatch {
  width: 28px;
  height: 28px;
  border: 1px solid #c8cdd4;
  border-radius: 6px;
  background: var(--swatch);
  cursor: pointer;
}

.swatch.is-active {
  border-color: #24272c;
  box-shadow: inset 0 0 0 2px #fff, 0 0 0 1px #24272c;
}

.text-background-label {
  display: block;
  margin-top: 13px;
}

.transparent-swatch {
  display: grid;
  place-items: center;
  background: #fff;
  color: #a33a32;
}

.transparent-swatch svg {
  width: 16px;
  height: 16px;
}

.wide-button {
  width: 100%;
  margin-bottom: 8px;
  padding: 0 10px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.wide-button:hover {
  background: var(--surface-soft);
}

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

.library-drawer {
  position: fixed;
  z-index: 80;
  top: 0;
  right: 0;
  display: grid;
  width: min(360px, 92vw);
  height: 100%;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  border-left: 1px solid var(--border);
  background: var(--surface);
  box-shadow: -14px 0 34px rgba(20, 27, 36, 0.17);
}

.drawer-head {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px 8px 16px;
  border-bottom: 1px solid var(--border);
}

.drawer-head > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.drawer-head strong {
  font-size: 15px;
}

.drawer-head span {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
}

.library-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  margin: 10px 12px 4px;
  padding: 3px;
  border-radius: 7px;
  background: var(--surface-muted);
}

.library-tab {
  height: 31px;
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
  color: #5d6571;
  font-size: 11px;
  font-weight: 750;
}

.library-tab.is-active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 4px rgba(20, 27, 36, 0.1);
}

.library-account {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 8px 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
}

.library-account a {
  color: #006f77;
  font-weight: 750;
}

.library-list {
  min-height: 0;
  padding: 8px 12px 24px;
  overflow-y: auto;
}

.resource-empty {
  display: grid;
  min-height: 160px;
  place-items: center;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
}

.resource-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 56px;
  padding: 7px 4px;
  border-bottom: 1px solid #eceef2;
}

.resource-preview {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-soft);
  color: #606874;
}

.resource-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.resource-main {
  min-width: 0;
  text-align: left;
}

.resource-name {
  display: block;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 700;
}

.resource-meta {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

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

.resource-actions .icon-button {
  width: 28px;
  height: 28px;
}

.drawer-scrim {
  position: fixed;
  z-index: 70;
  inset: 0;
  background: rgba(18, 24, 32, 0.34);
}

.modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(18, 24, 32, 0.55);
}

.modal-panel {
  width: min(680px, 100%);
  max-height: min(760px, 92vh);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.modal-head {
  display: flex;
  height: 50px;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 0 16px;
  border-bottom: 1px solid var(--border);
}

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

.account-gate-panel {
  width: min(410px, 100%);
}

.account-gate-body {
  display: flex;
  align-items: center;
  flex-direction: column;
  padding: 24px;
  text-align: center;
}

.account-gate-icon {
  display: grid;
  width: 42px;
  height: 42px;
  margin-bottom: 13px;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--primary);
}

.account-gate-icon svg {
  width: 20px;
  height: 20px;
}

.account-gate-body p {
  max-width: 330px;
  margin: 0;
  color: #4f5763;
  font-size: 12px;
  line-height: 1.55;
}

.account-gate-actions {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 8px;
  margin-top: 20px;
}

.account-gate-actions .primary-button,
.account-gate-actions .secondary-button {
  width: 100%;
  margin: 0;
}

.account-gate-actions .primary-button {
  text-decoration: none;
}

.account-gate-body small {
  margin-top: 12px;
  color: #7a828d;
  font-size: 10px;
}

.image-editor-stage {
  display: grid;
  min-height: 260px;
  max-height: 58vh;
  place-items: center;
  padding: 14px;
  overflow: auto;
  background-color: #f5f5f5;
  background-image:
    linear-gradient(45deg, #d9d9d9 25%, transparent 25%),
    linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #d9d9d9 75%),
    linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);
  background-position:
    0 0,
    0 8px,
    8px -8px,
    -8px 0;
  background-size: 16px 16px;
}

#image-editor-canvas {
  display: block;
  max-width: 100%;
  height: auto;
  background: transparent;
  box-shadow: 0 2px 12px rgba(20, 27, 36, 0.12);
  touch-action: none;
}

.image-editor-controls {
  display: flex;
  min-height: 68px;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
}

.image-editor-controls .control-group {
  margin: 0;
}

.grow-control {
  flex: 1 1 170px;
}

.brush-modes {
  display: flex;
  gap: 3px;
}

.brush-button {
  width: 34px;
  height: 34px;
}

.brush-button.is-active {
  border-color: #91c7cb;
  background: #eaf7f8;
  color: #006b72;
}

.brush-size-control {
  width: 90px;
}

.secondary-button {
  padding: 0 12px;
  border: 1px solid var(--border);
  background: #fff;
}

.secondary-button:hover {
  background: var(--surface-soft);
}

.busy-overlay {
  position: fixed;
  z-index: 140;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 11px;
  background: rgba(245, 246, 248, 0.82);
  backdrop-filter: blur(3px);
}

.busy-overlay span {
  font-size: 12px;
  font-weight: 700;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #b9c2cc;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.toast {
  position: fixed;
  z-index: 160;
  right: 16px;
  bottom: 16px;
  max-width: min(340px, calc(100vw - 32px));
  padding: 10px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: #fff;
  box-shadow: var(--shadow);
  font-size: 11px;
  font-weight: 650;
}

.toast.is-error {
  border-color: #efb2ad;
  color: var(--danger);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  border: 0 !important;
  white-space: nowrap !important;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 980px) {
  :root {
    --page-sidebar-width: 150px;
    --inspector-width: 204px;
  }

  .tool-button span {
    display: none;
  }

  .tool-button {
    min-width: 34px;
    width: 34px;
    padding: 0;
  }
}

@media (max-width: 760px) {
  :root {
    --app-bar-height: 48px;
    --tool-bar-height: 44px;
  }

  .app-bar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 0 7px;
  }

  .brand {
    gap: 0;
  }

  .brand-name,
  .document-state,
  .compact-only {
    display: none;
  }

  .brand-mark {
    width: 26px;
    height: 26px;
  }

  .document-title {
    width: 100%;
    padding: 0 5px;
  }

  .document-title input {
    width: 100%;
    max-width: none;
    font-size: 12px;
  }

  .primary-action {
    width: 34px;
    padding: 0;
  }

  .primary-action span {
    display: none;
  }

  .workspace {
    display: block;
    height: calc(100% - var(--app-bar-height));
  }

  .page-sidebar,
  .inspector {
    display: none;
  }

  .inspector.has-selection {
    position: fixed;
    z-index: 34;
    right: 8px;
    bottom: calc(64px + env(safe-area-inset-bottom));
    display: block;
    width: min(224px, calc(100vw - 16px));
    max-height: 238px;
    overflow-y: auto;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 8px 24px rgba(20, 27, 36, 0.18);
  }

  .inspector.has-selection .side-heading,
  .inspector.has-selection .inspector-empty {
    display: none;
  }

  .inspector.has-selection .inspector-controls {
    padding: 10px;
  }

  .inspector.has-selection .control-group {
    margin-bottom: 10px;
  }

  .inspector.has-selection .wide-button {
    min-height: 32px;
    margin-bottom: 5px;
  }

  .editor-column {
    height: 100%;
    grid-template-rows: minmax(0, 1fr);
  }

  .tool-bar {
    position: absolute;
    z-index: 35;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 8px;
    height: 48px;
    justify-content: space-between;
    gap: 2px;
    padding: 5px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(20, 27, 36, 0.18);
  }

  .tool-button {
    width: 38px;
    min-width: 38px;
    height: 36px;
  }

  .tool-divider,
  .tool-spacer,
  #delete-button,
  #zoom-out-button,
  #zoom-in-button,
  #fit-button {
    display: none;
  }

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

  .mobile-page-nav:not([hidden]) {
    position: absolute;
    z-index: 30;
    top: calc(var(--app-bar-height) + 8px);
    left: 50%;
    display: flex;
    height: 32px;
    align-items: center;
    gap: 2px;
    padding: 2px;
    border: 1px solid var(--border-strong);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 3px 10px rgba(20, 27, 36, 0.12);
    transform: translateX(-50%);
  }

  .mobile-page-nav .icon-button {
    width: 27px;
    height: 27px;
  }

  .mobile-page-nav span {
    min-width: 48px;
    color: #4f5763;
    text-align: center;
    font-size: 10px;
    font-weight: 750;
  }

  .stage-viewport {
    grid-row: 1;
    height: auto;
    padding-bottom: 62px;
  }

  .canvas-stage {
    padding: 14px 12px 80px;
  }

  .empty-state {
    padding-bottom: 92px;
  }

  .image-editor-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
  }

  .grow-control {
    grid-column: 1 / -1;
  }

  .brush-size-control {
    display: none;
  }

  .secondary-button,
  .primary-button {
    min-width: 68px;
  }

  .toast {
    bottom: calc(72px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 380px) {
  .tool-bar {
    right: 5px;
    left: 5px;
  }

  .tool-button,
  .tool-bar .icon-button {
    width: 34px;
    min-width: 34px;
  }

  .app-actions {
    gap: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
