.font-comparison { border: 0; padding: 0; margin: 12px 0; min-width: 0; }
.font-comparison legend { font-size: 12px; margin-bottom: 6px; }
#font-alternatives { display: grid; gap: 4px; }
#font-alternatives label { display: grid; grid-template-columns: 16px minmax(0,1fr); column-gap: 8px; align-items: center; padding: 6px 0; margin: 0; cursor: pointer; }
#font-alternatives input { width: 14px; height: 14px; grid-row: span 2; }
#font-alternatives span { font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#font-alternatives small { font-size: 11px; color: #565d64; }
.font-warning { font-size: 12px; color: #8a3a12; }
.font-warning:empty { display: none; }
.detected-font[data-fidelity="original"] { color: #087452; }
.export-mode-label { display: grid; font-size: 11px; gap: 2px; min-width: 0; }
.export-mode-label select { max-width: 210px; min-width: 0; height: 34px; font-size: 12px; }
@media (max-width: 680px) { .export-mode-label { flex: 1 0 100%; } .export-mode-label select { max-width: 100%; width: 100%; } }
@font-face {
  font-family: "Lato";
  src: url("./fonts/Lato-Regular.ttf") format("truetype");
  font-weight: 400;
}

@font-face {
  font-family: "Lato";
  src: url("./fonts/Lato-Bold.ttf") format("truetype");
  font-weight: 700;
}

@font-face {
  font-family: "Montserrat";
  src: url("./fonts/Montserrat.ttf") format("truetype");
}

@font-face {
  font-family: "Merriweather";
  src: url("./fonts/Merriweather.ttf") format("truetype");
}

@font-face {
  font-family: "Noto Sans Mono";
  src: url("./fonts/NotoSansMono.ttf") format("truetype");
}

@font-face {
  font-family: "Noto Serif";
  src: url("./fonts/NotoSerif.ttf") format("truetype");
}

@font-face {
  font-family: "Playfair Display";
  src: url("./fonts/PlayfairDisplay.ttf") format("truetype");
}

@font-face {
  font-family: "Source Sans 3";
  src: url("./fonts/SourceSans3.ttf") format("truetype");
}

@font-face {
  font-family: "Source Serif 4";
  src: url("./fonts/SourceSerif4.ttf") format("truetype");
}

:root {
  font-family: "Lato", Arial, sans-serif;
  color: #17211f;
  background: #e9f2f0;
  font-synthesis: none;
  --ink: #17211f;
  --muted: #66736f;
  --line: #d6e0dd;
  --panel: #ffffff;
  --teal: #0f766e;
  --teal-dark: #0a5c57;
  --mint: #14b89a;
  --blue: #315ed8;
  --coral: #dc644f;
  --canvas: #dce7e4;
  --shadow: 0 14px 34px rgba(22, 55, 49, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  min-width: 320px;
  overflow: auto;
}

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

button,
label[for] {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
label[for]:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(49, 94, 216, 0.25);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

.editor-commandbar { display:flex; align-items:center; gap:8px; padding:6px 12px; background:#fff; border-bottom:1px solid var(--line); overflow-x:auto; }
.editor-commandbar button { display:grid; place-items:center; flex:0 0 32px; height:32px; border:0; border-radius:4px; background:#eff5f3; color:#26433c; cursor:pointer; }
.editor-commandbar button:disabled { opacity:.35; cursor:default; }
.editor-commandbar svg { width:17px; height:17px; }
.editor-commandbar output { white-space:nowrap; font-size:12px; min-width:40px; text-align:center; }
.editor-commandbar label { font-size:12px; margin-left:auto; }
.editor-commandbar select { width:125px; min-width:100px; height:32px; font-size:12px; }
.document-toolbar > div { flex-wrap:wrap; }
.editor-actions { display:grid; gap:8px; }
.export-actions .action-button:first-child { min-width:185px; }
@media(max-width:680px) { .export-actions .action-button:first-child { min-width:0; } .editor-commandbar { gap:4px; padding-inline:6px; } }

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: 72px minmax(0, calc(100dvh - 154px)) 82px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  color: #fff;
  background: linear-gradient(110deg, #0f766e 0%, #188b8e 48%, #315ed8 100%);
  box-shadow: 0 3px 14px rgba(17, 73, 69, 0.22);
  z-index: 20;
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 8px;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.14);
}

.brand h1 {
  margin: 0;
  font-size: 23px;
  line-height: 1;
  letter-spacing: 0;
}

.brand p {
  margin: 5px 0 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
}

.local-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 6px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.1);
}

.header-action {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 6px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  font-weight: 700;
}

.header-action:hover {
  background: rgba(255, 255, 255, 0.2);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #63efb4;
  box-shadow: 0 0 0 4px rgba(99, 239, 180, 0.15);
}

.workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: 224px minmax(380px, 1fr) 288px;
  gap: 1px;
  background: var(--line);
}

.tool-panel,
.inspector-panel {
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
  background: var(--panel);
}

.panel-section + .panel-section {
  padding-top: 20px;
  margin-top: 20px;
  border-top: 1px solid var(--line);
}

.panel-section h2,
.selection-empty h2,
.selection-editor h2 {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.25;
}

.action-button {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.action-button + .action-button {
  margin-top: 9px;
}

.action-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.action-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.action-button.primary {
  color: #fff;
  background: var(--teal);
}

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

.action-button.secondary {
  color: #194d49;
  border-color: #9ccbc5;
  background: #eff9f7;
}

.action-button.edit {
  color: #fff;
  background: linear-gradient(110deg, #13a889, #315ed8);
  box-shadow: 0 7px 17px rgba(35, 109, 152, 0.2);
}

.action-button.edit.active {
  color: #153a34;
  border-color: #38c99c;
  background: #9bf0d2;
}

.action-button.ghost {
  color: #34423f;
  border-color: var(--line);
  background: #fff;
}

.action-button.danger {
  color: #a33f30;
}

.action-button.compact {
  width: auto;
  min-height: 40px;
  margin: 0;
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  stroke-width: 2;
}

.helper-text,
.selection-empty p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.page-nav {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 8px;
}

.page-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 10px;
}

.mini-tool {
  min-width: 0;
  min-height: 46px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #31413e;
  background: #fff;
  cursor: pointer;
  font-size: 10px;
}

.mini-tool svg,
.tool-row svg,
.suite-tool svg {
  width: 18px;
  height: 18px;
}

.mini-tool:disabled,
.tool-row:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.danger-tool {
  color: #a33f30;
}

.quick-tools {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.quick-tools h2 {
  margin-bottom: 5px;
}

.tool-row {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #35423f;
  background: #f2f7f6;
  cursor: pointer;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
}

.tool-row:hover:not(:disabled) {
  border-color: #9ccbc5;
  color: var(--teal);
}

.page-nav span {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

.icon-button,
.toolbar-button {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
}

.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.icon-button.small {
  width: 34px;
  height: 34px;
  font-size: 22px;
}

.document-area {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--canvas);
}

.document-empty {
  width: 100%;
  height: 100%;
  min-height: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  text-align: center;
  transition: background 150ms ease;
}

.document-empty.dragging {
  background: #cceee7;
}

.document-empty h2 {
  margin: 24px 0 7px;
  font-size: 22px;
}

.document-empty p {
  margin: 0;
  color: var(--muted);
}

.empty-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

.empty-visual {
  position: relative;
  width: 130px;
  height: 142px;
}

.paper-sheet {
  position: absolute;
  width: 94px;
  height: 124px;
  border: 1px solid #b9cfca;
  border-radius: 5px;
  background: #fff;
  box-shadow: var(--shadow);
}

.paper-sheet.back {
  left: 13px;
  top: 5px;
  transform: rotate(-8deg);
  background: #c9eae3;
}

.paper-sheet.front {
  left: 27px;
  top: 11px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 30px 15px;
  transform: rotate(5deg);
}

.paper-sheet.front::before {
  content: "PDF";
  color: var(--coral);
  font-weight: 900;
}

.paper-sheet.front span {
  height: 4px;
  border-radius: 2px;
  background: #cbd8d5;
}

.document-view {
  height: 100%;
  display: grid;
  grid-template-rows: 52px 48px minmax(0, 1fr);
}

.document-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px 0 18px;
  border-bottom: 1px solid #c9d7d3;
  background: rgba(255, 255, 255, 0.9);
}

.document-toolbar > div {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.document-toolbar strong {
  max-width: 42vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.document-toolbar span {
  color: var(--muted);
  font-size: 11px;
}

.toolbar-button {
  padding: 0 12px;
  font-size: 12px;
}

.canvas-scroller {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 26px;
}

.page-stage {
  margin-inline: auto;
  position: relative;
  flex: 0 0 auto;
  width: min(100%, 980px);
  line-height: 0;
  background: #fff;
  box-shadow: 0 12px 30px rgba(24, 50, 45, 0.2);
}

#page-canvas {
  display: block;
  width: 100%;
  height: auto;
}

.text-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.text-layer.editing {
  pointer-events: auto;
}

.text-item {
  position: absolute;
  min-width: 4px;
  min-height: 6px;
  padding: 0;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 2px;
  color: transparent;
  background: transparent;
  cursor: text;
  line-height: 1;
  text-align: left;
  white-space: nowrap;
}

.text-layer.editing .text-item:hover,
.text-layer.editing .text-item:focus-visible {
  border-color: #0e9e8d;
  background: rgba(19, 168, 137, 0.14);
}

.text-item.selected {
  border: 2px solid #255dcc;
  background: rgba(49, 94, 216, 0.13);
}

.text-item.edited {
  display: flex;
  align-items: flex-start;
  overflow: visible;
  border: 0;
  color: var(--replacement-color, #111);
  background: transparent;
  font-family: var(--replacement-font, Arial);
  font-size: var(--replacement-size, 12px);
  line-height: 1.05;
  cursor: move;
  touch-action: none;
}

.text-layer.editing .text-item.edited:hover,
.text-layer.editing .text-item.edited:focus-visible,
.text-item.edited.selected {
  border: 0;
  outline: 0;
  background: transparent;
}

.resize-handle {
  position: absolute;
  right: -7px;
  bottom: -7px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #0f766e;
  box-shadow: 0 2px 7px rgba(15, 35, 31, 0.22);
  cursor: nwse-resize;
  opacity: 0;
}

.text-item.edited.selected .resize-handle,
.text-item.edited:hover .resize-handle {
  opacity: 1;
}

.loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 30px;
  color: #fff;
  text-align: center;
  background: rgba(15, 41, 37, 0.78);
  backdrop-filter: blur(4px);
}

.loading-overlay strong {
  font-size: 15px;
}

.loading-overlay span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
}

.spinner {
  width: 38px;
  height: 38px;
  border: 4px solid rgba(255, 255, 255, 0.28);
  border-top-color: #5de5bc;
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.progress-track {
  width: min(230px, 80%);
  height: 5px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.2);
}

.progress-bar {
  width: 0;
  height: 100%;
  background: #5de5bc;
  transition: width 180ms ease;
}

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

.inspector-panel {
  padding: 20px;
}

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

.selection-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  border: 1px solid #98c9c2;
  border-radius: 8px;
  color: var(--teal);
  font-family: Georgia, serif;
  font-size: 28px;
  background: #eaf8f5;
}

.inspector-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
}

.eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--teal);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.selection-editor label {
  display: block;
  margin: 15px 0 7px;
  color: #46524f;
  font-size: 12px;
  font-weight: 700;
}

.original-text {
  min-height: 46px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #53605d;
  font-size: 13px;
  line-height: 1.45;
  background: #f5f8f7;
  word-break: break-word;
}

textarea,
select {
  width: 100%;
  border: 1px solid #b9c9c5;
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
}

input[type="number"],
input[type="color"] {
  width: 100%;
  height: 42px;
  border: 1px solid #b9c9c5;
  border-radius: 6px;
  background: #fff;
}

input[type="number"] {
  padding: 0 10px;
}

.style-grid {
  display: grid;
  grid-template-columns: 1fr 86px;
  gap: 12px;
}

.format-toolbar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.format-button {
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #263835;
  background: #fff;
  cursor: pointer;
}

.format-button svg {
  width: 18px;
  height: 18px;
}

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

textarea {
  min-height: 94px;
  padding: 11px;
  resize: vertical;
  line-height: 1.45;
}

select {
  height: 42px;
  padding: 0 9px;
}

.detected-font {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.editor-actions {
  margin-top: 20px;
}

.export-bar {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 24px;
  border-top: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 -5px 18px rgba(27, 58, 52, 0.08);
  z-index: 20;
  position: sticky;
  bottom: 0;
}

.export-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.export-copy strong {
  font-size: 13px;
}

.export-copy span {
  color: var(--muted);
  font-size: 11px;
}

.export-actions {
  display: flex;
  gap: 10px;
}

.export-actions .action-button {
  width: 150px;
  margin: 0;
}

.export-pdf {
  color: #fff;
  background: linear-gradient(100deg, #13a66f, #087e83);
}

.export-txt {
  color: #244e72;
  border-color: #8fb7d5;
  background: #edf7ff;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  z-index: 50;
  max-width: min(420px, calc(100vw - 30px));
  padding: 11px 16px;
  border-radius: 6px;
  color: #fff;
  background: #173b36;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

dialog {
  color: var(--ink);
}

dialog::backdrop {
  background: rgba(9, 31, 28, 0.62);
  backdrop-filter: blur(4px);
}

.suite-dialog,
.action-dialog {
  width: min(940px, calc(100vw - 30px));
  max-height: min(820px, calc(100vh - 30px));
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 8px;
  background: #f7faf9;
  box-shadow: 0 25px 70px rgba(4, 27, 23, 0.3);
}

.action-dialog {
  width: min(520px, calc(100vw - 30px));
  background: #fff;
}

.dialog-heading {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.dialog-heading h2 {
  margin: 3px 0 5px;
  font-size: 22px;
}

.dialog-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.compact-heading {
  position: static;
}

.tool-categories {
  padding: 4px 24px 28px;
}

.tool-categories section {
  padding-top: 20px;
}

.tool-categories h3 {
  margin: 0 0 10px;
  font-size: 13px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.suite-tool {
  min-height: 116px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.suite-tool:hover {
  border-color: #72b9af;
  box-shadow: 0 8px 18px rgba(22, 75, 67, 0.1);
  transform: translateY(-2px);
}

.suite-tool svg {
  width: 24px;
  height: 24px;
  color: var(--teal);
}

.suite-tool strong {
  font-size: 13px;
}

.suite-tool span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.action-fields {
  display: grid;
  gap: 15px;
  padding: 22px 24px;
}

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

.field-group label {
  font-size: 12px;
  font-weight: 700;
}

.field-group input,
.field-group select {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #b9c9c5;
  border-radius: 6px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.range-line {
  display: grid;
  grid-template-columns: 1fr 45px;
  align-items: center;
  gap: 10px;
}

.signature-pad {
  width: 100%;
  height: 180px;
  touch-action: none;
  border: 1px dashed #7baaa3;
  border-radius: 6px;
  background: #f9fcfb;
  cursor: crosshair;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  background: #f8faf9;
}

.dialog-actions .action-button {
  width: auto;
  min-width: 120px;
  margin: 0;
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .app-shell {
    min-height: 100vh;
    min-height: 100dvh;
    grid-template-rows: 68px auto auto;
  }

  .workspace {
    grid-template-columns: 190px minmax(0, 1fr);
    grid-template-rows: minmax(620px, calc(100dvh - 150px)) auto;
  }

  .inspector-panel {
    grid-column: 1 / -1;
    min-height: 210px;
    border-top: 1px solid var(--line);
  }

  .selection-empty {
    min-height: 170px;
  }

  .selection-editor {
    max-width: 720px;
    margin: 0 auto;
  }

  .tool-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .app-header {
    padding: 0 14px;
  }

  .app-shell {
    padding-bottom: 160px;
  }

  .brand p,
  .local-badge,
  .header-action span {
    display: none;
  }

  .header-action {
    width: 42px;
    justify-content: center;
    padding: 8px;
  }

  .workspace {
    display: flex;
    flex-direction: column;
    background: #fff;
  }

  .tool-panel {
    order: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 12px;
    overflow: visible;
  }

  .panel-section {
    display: contents;
  }

  .panel-section h2,
  .helper-text,
  .page-controls,
  .quick-tools {
    display: none;
  }

  .action-button + .action-button {
    margin-top: 0;
  }

  .tool-panel .action-button {
    min-height: 46px;
  }

  .document-area {
    order: 2;
    height: auto;
    min-height: min(78dvh, 720px);
    border-top: 1px solid var(--line);
  }

  .inspector-panel {
    order: 3;
    overflow: visible;
  }

  .document-empty {
    min-height: min(78dvh, 720px);
  }

  .document-view {
    min-height: min(78dvh, 720px);
  }

  .canvas-scroller {
    min-height: 0;
    height: calc(min(78dvh, 720px) - 100px);
  }

  .empty-actions {
    flex-direction: column;
  }

  .canvas-scroller {
    padding: 14px;
  }

  .document-toolbar strong {
    max-width: 55vw;
  }

  .export-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    align-items: stretch;
    flex-direction: column;
    gap: 9px;
    padding: 11px 12px;
  }

  .export-copy {
    display: none;
  }

  .export-actions {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .export-mode-label { grid-column: 1 / -1; }

  .export-actions .action-button {
    width: 100%;
  }

  .dialog-heading,
  .tool-categories,
  .action-fields,
  .dialog-actions {
    padding-left: 16px;
    padding-right: 16px;
  }

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

  .suite-tool {
    min-height: 108px;
    padding: 12px;
  }

  .field-row {
    grid-template-columns: 1fr;
  }
}
