:root {
  --paper: #eef7ff;
  --paper-deep: #dceeff;
  --white: #fbfdff;
  --ink: #102437;
  --muted: #648096;
  --line: #c7ddea;
  --sidebar: #183247;
  --sidebar-muted: #aec6d6;
  --coral: #ff633e;
  --blue: #4c8fe8;
  --lime: #bfeaff;
  --shadow: 0 16px 42px rgba(55, 112, 153, 0.14);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
}

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

button {
  cursor: pointer;
}

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

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 30px 20px 22px;
  color: #fff;
  background: var(--sidebar);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #fff;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--ink);
  font-size: 20px;
  font-weight: 900;
  background: var(--lime);
  border-radius: 9px;
  transform: rotate(-7deg);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 16px;
  letter-spacing: -0.03em;
}

.brand small {
  margin-top: 2px;
  color: var(--sidebar-muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.side-nav {
  display: grid;
  gap: 8px;
  margin-top: 68px;
}

.nav-item {
  display: grid;
  grid-template-columns: 25px 1fr auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 13px 12px;
  color: var(--sidebar-muted);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 7px;
}

.nav-item:hover,
.nav-item.is-active {
  color: #fff;
  background: #29475b;
}

.nav-item.is-active {
  box-shadow: inset 3px 0 0 var(--coral);
}

.nav-icon {
  color: var(--lime);
  font-size: 18px;
  line-height: 1;
}

.nav-count {
  color: #656862;
  font-size: 10px;
  letter-spacing: 0.1em;
}

.sidebar-spacer {
  flex: 1;
}

.side-note {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 4px 16px;
  border-top: 1px solid #355368;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--coral);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(255, 99, 62, 0.12);
}

.side-note strong,
.side-note small {
  display: block;
}

.side-note strong {
  font-size: 11px;
}

.side-note small {
  margin-top: 3px;
  color: var(--sidebar-muted);
  font-size: 10px;
}

.sidebar-footer {
  display: flex;
  justify-content: space-between;
  padding-top: 17px;
  color: #7893a5;
  font-size: 8px;
  letter-spacing: 0.12em;
}

.main-content {
  min-width: 0;
  padding: 0 4.6vw 54px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  border-bottom: 1px solid var(--line);
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.03em;
}

.breadcrumbs b {
  color: #b1ada5;
  font-weight: 400;
}

.breadcrumbs strong {
  color: var(--ink);
  font-weight: 700;
}

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

.icon-button,
.avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.icon-button {
  color: var(--muted);
  background: transparent;
  font-size: 16px;
}

.icon-button:hover {
  color: var(--coral);
  border-color: var(--coral);
}

.avatar {
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  background: #e8f3ff;
  border: 2px solid #b8d9f6;
}

.avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.view {
  display: none;
}

.view.is-visible {
  display: block;
}

.page-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  padding: 70px 0 57px;
}

.eyebrow,
.section-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--coral);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.eyebrow-line {
  width: 22px;
  height: 2px;
  background: var(--coral);
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 670px;
  margin: 17px 0 13px;
  font-size: clamp(38px, 5vw, 68px);
  font-weight: 800;
  letter-spacing: -0.065em;
  line-height: 0.98;
}

h1 em {
  color: var(--blue);
  font-style: normal;
}

.intro-copy {
  max-width: 485px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.intro-meta {
  display: grid;
  min-width: 132px;
  padding-bottom: 4px;
}

.meta-label,
.meta-version {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.15em;
}

.intro-meta strong {
  margin: 8px 0;
  font-size: 13px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(330px, 0.9fr) minmax(420px, 1.1fr);
  gap: clamp(24px, 4vw, 68px);
  align-items: start;
}

.control-panel,
.preview-panel {
  min-width: 0;
}

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

.section-heading h2,
.preview-header h2 {
  margin: 7px 0 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.section-heading h2 small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
}

.char-counter {
  color: var(--muted);
  font-size: 10px;
}

.prompt-wrap {
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--white);
}

.mode-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.mode-tab {
  min-height: 40px;
  padding: 8px 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
}

.mode-tab:hover,
.mode-tab.is-active {
  color: var(--ink);
}

.mode-tab.is-active {
  border-bottom-color: var(--coral);
}

.edit-upload {
  display: flex;
  min-height: 118px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  text-align: center;
  background: var(--paper-deep);
  border: 1px dashed #a9c9dd;
  cursor: pointer;
}

.edit-upload:hover,
.edit-upload.is-dragging {
  background: #e1f4ff;
  border-color: var(--blue);
}

.edit-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.editor-shell {
  margin-top: 12px;
  border: 1px solid var(--line);
  background: var(--white);
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 8px;
  border-bottom: 1px solid var(--line);
}

.tool-group,
.zoom-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tool-button,
.tool-icon {
  display: inline-grid;
  min-width: 32px;
  height: 30px;
  place-items: center;
  padding: 0 8px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
  background: transparent;
  border: 1px solid transparent;
}

.tool-button:hover,
.tool-icon:hover,
.tool-button.is-active {
  color: var(--ink);
  background: var(--paper-deep);
  border-color: var(--line);
}

.tool-icon:disabled {
  cursor: default;
  opacity: 0.42;
}

.tool-range {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 9px;
}

.tool-range input {
  width: 74px;
  accent-color: var(--coral);
}

.tool-range output {
  min-width: 28px;
  color: var(--ink);
  text-align: right;
}

.tool-actions {
  margin-left: auto;
}

.editor-viewport {
  position: relative;
  display: grid;
  min-height: 280px;
  max-height: 560px;
  overflow: hidden;
  place-items: center;
  background-color: #dce6ed;
  background-image: linear-gradient(45deg, #fff9 25%, transparent 25%), linear-gradient(-45deg, #fff9 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #fff9 75%), linear-gradient(-45deg, transparent 75%, #fff9 75%);
  background-size: 18px 18px;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
  touch-action: none;
  user-select: none;
}

.editor-stage {
  position: relative;
  flex: none;
  transform-origin: center;
  touch-action: none;
}

.editor-stage canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

#editImageCanvas {
  position: relative;
}

#editMaskCanvas {
  pointer-events: none;
}

.brush-cursor {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  width: var(--brush-diameter, 24px);
  height: var(--brush-diameter, 24px);
  border: 1px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(16, 36, 55, 0.85);
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.editor-empty {
  position: absolute;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 9px;
  color: var(--muted);
  font-size: 9px;
}

.editor-footer strong {
  min-width: 34px;
  color: var(--ink);
  font-size: 9px;
  text-align: center;
}

.edit-options {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: end;
  gap: 12px;
  margin-top: 14px;
}

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

.edit-options output {
  float: right;
  color: var(--ink);
}

.check-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  color: var(--ink);
  font-size: 10px;
}

.check-field input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--coral);
}

.edit-fallback {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  padding: 10px;
  color: #7b3525;
  font-size: 10px;
  background: #fff0e9;
  border-left: 3px solid var(--coral);
}

.edit-note {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

#prompt {
  display: block;
  width: 100%;
  min-height: 150px;
  padding: 17px 18px 12px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.7;
  resize: vertical;
  background: transparent;
  border: 0;
  outline: 0;
}

#prompt::placeholder {
  color: #a9a59d;
}

.prompt-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 15px 12px 18px;
  color: var(--muted);
  font-size: 10px;
  border-top: 1px solid #d9eaf5;
}

.mini-action,
.text-button {
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  background: transparent;
  border: 0;
}

.mini-action:hover,
.text-button:hover {
  color: var(--coral);
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 13px 0 31px;
}

.preset-chip {
  padding: 7px 10px;
  color: var(--muted);
  font-size: 10px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.preset-chip:hover {
  color: var(--ink);
  background: var(--lime);
  border-color: var(--lime);
}

.compact-heading {
  margin-bottom: 14px;
}

.dropzone {
  position: relative;
  display: flex;
  min-height: 118px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--muted);
  text-align: center;
  background: var(--paper-deep);
  border: 1px dashed #a9c9dd;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.dropzone:hover,
.dropzone.is-dragging {
  background: #e1f4ff;
  border-color: var(--blue);
}

.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.upload-icon {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 18px;
  background: var(--lime);
  border-radius: 50%;
}

.dropzone-title {
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.dropzone-hint {
  margin-top: 4px;
  font-size: 10px;
}

.dropzone.has-image .upload-icon {
  display: none;
}

.reference-previews {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  width: calc(100% - 24px);
  margin: 10px 12px;
}

.reference-thumb {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--white);
  border: 1px solid #a9c9dd;
}

.reference-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reference-thumb > span {
  position: absolute;
  right: 4px;
  bottom: 4px;
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  background: rgba(16, 36, 55, 0.78);
  border-radius: 50%;
}

.reference-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  padding: 0;
  color: #fff;
  font-size: 15px;
  line-height: 1;
  background: rgba(16, 36, 55, 0.82);
  border: 0;
  border-radius: 50%;
}

.reference-remove:hover {
  background: var(--coral);
}

.options-heading {
  margin-top: 30px;
}

.options-heading .text-button span {
  display: inline-block;
  margin-left: 3px;
  transition: transform 160ms ease;
}

.options-heading .text-button.is-open span {
  transform: rotate(180deg);
}

.options-grid,
.advanced-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.advanced-options {
  margin-top: 11px;
}

.field {
  display: grid;
  gap: 7px;
}

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

.field select {
  width: 100%;
  padding: 10px 28px 10px 11px;
  color: var(--ink);
  font-size: 11px;
  background-color: var(--white);
  border: 1px solid var(--line);
  border-radius: 0;
  outline: 0;
}

.field select:focus {
  border-color: var(--blue);
}

.generate-button {
  display: grid;
  grid-template-columns: 25px 1fr 25px;
  align-items: center;
  width: 100%;
  min-height: 51px;
  margin-top: 28px;
  padding: 0 14px;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.01em;
  background: var(--ink);
  border: 0;
  transition: background 160ms ease, transform 160ms ease;
}

.generate-button:hover {
  background: var(--blue);
  transform: translateY(-2px);
}

.generate-button:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}

.button-spark {
  color: var(--lime);
  font-size: 18px;
  text-align: left;
}

.button-arrow {
  font-size: 18px;
  text-align: right;
}

.form-footnote {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
  text-align: center;
}

.preview-panel {
  padding-top: 1px;
}

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

.preview-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.preview-status i {
  display: block;
  width: 6px;
  height: 6px;
  background: var(--lime);
  border-radius: 50%;
}

.preview-status.is-working i {
  background: var(--coral);
  animation: pulse 1s ease infinite;
}

.canvas-wrap {
  position: relative;
  display: grid;
  min-height: 500px;
  overflow: hidden;
  place-items: center;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.42) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.42) 75%),
    linear-gradient(45deg, rgba(255, 255, 255, 0.42) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.42) 75%),
    #d9e8f2;
  background-position: 0 0, 12px 12px;
  background-size: 24px 24px;
  box-shadow: var(--shadow);
}

.empty-canvas,
.loading-canvas,
.error-canvas {
  display: grid;
  place-items: center;
  text-align: center;
}

.empty-canvas strong,
.loading-canvas strong,
.error-canvas strong {
  margin-top: 18px;
  font-size: 14px;
}

.empty-canvas > span,
.loading-canvas > span,
.error-canvas > span {
  max-width: min(80%, 420px);
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.orbit-mark {
  position: relative;
  display: grid;
  width: 73px;
  height: 73px;
  place-items: center;
  color: var(--ink);
  background: var(--lime);
  border-radius: 50%;
}

.orbit-mark::before,
.orbit-mark::after {
  position: absolute;
  content: "";
  border: 1px solid var(--ink);
  border-radius: 50%;
}

.orbit-mark::before {
  width: 95px;
  height: 33px;
  transform: rotate(30deg);
}

.orbit-mark::after {
  width: 33px;
  height: 95px;
  transform: rotate(30deg);
}

.orbit-mark span {
  font-size: 24px;
}

.loading-canvas {
  color: var(--ink);
}

.error-canvas {
  color: var(--ink);
}

.error-mark {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  color: var(--white);
  font-size: 28px;
  font-weight: 800;
  background: var(--coral);
  border-radius: 50%;
}

.loader-ring {
  width: 66px;
  height: 66px;
  border: 3px solid #b9d3e4;
  border-top-color: var(--coral);
  border-right-color: var(--blue);
  border-radius: 50%;
  animation: spin 1.1s linear infinite;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: stretch;
  width: 100%;
  height: 100%;
  gap: 8px;
  padding: 8px;
}

.image-grid.single-image {
  grid-template-columns: minmax(0, 1fr);
}

.image-card {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #d7e8f3;
}

.image-card img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.image-card .image-actions {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: flex;
  gap: 5px;
  opacity: 0;
  transition: opacity 160ms ease;
}

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

.image-action {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  color: var(--ink);
  background: rgba(251, 253, 255, 0.94);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.14);
}

.image-action:hover {
  color: #fff;
  background: var(--blue);
}

.preview-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 15px;
}

.canvas-spec {
  display: grid;
  gap: 4px;
}

.canvas-spec span {
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.15em;
}

.canvas-spec strong {
  font-size: 11px;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 7px;
}

.outline-button {
  padding: 9px 11px;
  color: var(--ink);
  font-size: 10px;
  font-weight: 700;
  background: transparent;
  border: 1px solid var(--line);
}

.outline-button:hover {
  color: var(--blue);
  border-color: var(--blue);
}

.hidden {
  display: none !important;
}

.history-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 70px 0 44px;
}

.history-heading h1 {
  margin-bottom: 14px;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.history-card {
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--line);
}

.history-card-image {
  aspect-ratio: 1;
  background: var(--paper-deep);
}

.history-card-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.history-card-body {
  padding: 13px;
}

.history-card-prompt {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.history-card-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  color: var(--muted);
  font-size: 9px;
}

.history-empty {
  grid-column: 1 / -1;
  padding: 90px 20px;
  color: var(--muted);
  text-align: center;
  background: var(--paper-deep);
  border: 1px dashed #a9c9dd;
}

.toast {
  position: fixed;
  right: 25px;
  bottom: 25px;
  z-index: 5;
  max-width: min(380px, calc(100vw - 40px));
  padding: 12px 15px;
  color: #fff;
  font-size: 11px;
  line-height: 1.5;
  background: var(--ink);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

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

@keyframes pulse {
  50% { opacity: 0.35; }
}

@media (max-width: 1050px) {
  .app-shell {
    grid-template-columns: 206px minmax(0, 1fr);
  }

  .main-content {
    padding-right: 28px;
    padding-left: 28px;
  }

  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .control-panel {
    max-width: 700px;
  }

  .canvas-wrap {
    min-height: 580px;
  }
}

@media (max-width: 680px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    min-height: auto;
    padding: 17px 18px 13px;
  }

  .side-nav {
    display: flex;
    gap: 6px;
    margin-top: 18px;
  }

  .nav-item {
    grid-template-columns: 20px 1fr auto;
    padding: 9px 8px;
    font-size: 11px;
  }

  .sidebar-spacer,
  .side-note,
  .sidebar-footer {
    display: none;
  }

  .main-content {
    padding: 0 18px 35px;
  }

  .topbar {
    min-height: 58px;
  }

  .page-intro,
  .history-heading {
    display: block;
    padding: 45px 0 36px;
  }

  .intro-meta {
    margin-top: 22px;
  }

  h1 {
    font-size: 45px;
  }

  .workspace-grid {
    gap: 40px;
  }

  .mode-tab {
    font-size: 10px;
  }

  .editor-toolbar {
    gap: 6px;
  }

  .tool-actions {
    margin-left: 0;
  }

  .editor-viewport {
    min-height: 240px;
    max-height: 430px;
  }

  .edit-options {
    grid-template-columns: 1fr 1fr;
  }

  .check-field {
    grid-column: 1 / -1;
  }

  .canvas-wrap {
    min-height: min(90vw, 450px);
  }

  .preview-header {
    align-items: start;
  }

  .preview-header h2 {
    font-size: 16px;
  }

  .preview-footer {
    align-items: start;
    flex-direction: column;
  }

  .result-actions {
    justify-content: start;
  }

  .history-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .history-card-body {
    padding: 10px;
  }
}
