:root {
  color-scheme: light;
  --bg: #eef1f5;
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --line: #d9dee8;
  --line-strong: #b9c4d6;
  --text: #1e2633;
  --muted: #6d7685;
  --blue: #2563eb;
  --blue-soft: #dbeafe;
  --green: #1f9d55;
  --green-soft: #dcfce7;
  --red: #d92d20;
  --red-soft: #fee4e2;
  --shadow: 0 18px 54px rgba(30, 38, 51, .14);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
  overscroll-behavior: none;
}

body.touch-gesture-lock {
  touch-action: none;
  overscroll-behavior: none;
}

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

button,
label.primary-file {
  user-select: none;
}

[hidden] {
  display: none !important;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(420px, 1fr) 360px;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100vh;
}

.topbar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 240px minmax(280px, 1fr) minmax(620px, auto);
  grid-template-areas:
    "brand billing actions"
    "doc doc view";
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(14px);
  z-index: 5;
}

.brand {
  grid-area: brand;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 850;
  font-size: 21px;
  color: #182235;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #174ea6;
  color: #fff;
  font-size: 10px;
  letter-spacing: .04em;
}

.billing-strip {
  grid-area: billing;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  color: #485366;
  font-size: 13px;
  font-weight: 780;
  overflow: hidden;
}

.billing-strip span {
  min-width: 0;
}

.free-badge {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  color: #14713e;
  background: var(--green-soft);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.cost-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid rgba(37, 99, 235, .18);
  border-radius: 999px;
  color: #174ea6;
  background: #eef5ff;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

#token-status {
  flex: 0 0 auto;
  min-width: 52px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.billing-strip a {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.billing-strip a:hover {
  text-decoration: underline;
}

.tool-copy {
  display: grid;
  gap: 1px;
  line-height: 1.05;
  text-align: left;
}

.tool-copy small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
}

.save-button .tool-copy small {
  color: rgba(255, 255, 255, .86);
}

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

.doc-tools {
  grid-area: doc;
}

.center-tools {
  grid-area: view;
  justify-content: center;
}

.right-tools {
  grid-area: actions;
  justify-content: flex-end;
  flex-wrap: nowrap;
  align-self: stretch;
  align-content: center;
}

.tool-button,
.save-button,
.icon-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 13px;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  font-size: 14px;
  font-weight: 760;
  white-space: nowrap;
}

.tool-button:hover,
.icon-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.tool-button.active,
.segment.active {
  color: var(--blue);
  border-color: var(--blue);
  background: var(--blue-soft);
}

.tool-button:disabled,
.save-button:disabled,
.icon-button:disabled,
.danger-button:disabled {
  cursor: not-allowed;
  opacity: .48;
}

a.tool-button {
  text-decoration: none;
}

.save-button {
  border-color: transparent;
  color: #fff;
  background: var(--green);
}

.save-button:hover {
  background: #168348;
}

.danger-button {
  color: var(--red);
  border-color: #f6b9b4;
  background: #fff;
}

.danger-button:hover {
  background: var(--red-soft);
}

.primary-file {
  position: relative;
}

.primary-file input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.icon {
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  border-radius: 5px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 10px;
  font-weight: 900;
}

.save-button .icon {
  color: #14713e;
  background: #e6f8ee;
}

.icon-button {
  width: 38px;
  padding: 0;
  font-size: 18px;
}

output {
  min-width: 68px;
  text-align: center;
  color: var(--text);
  font-weight: 780;
  font-size: 14px;
}

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

.sidebar {
  min-height: 0;
  background: var(--surface);
  border-right: 1px solid var(--line);
  overflow: auto;
}

.inspector {
  border-right: 0;
  border-left: 1px solid var(--line);
}

.doc-panel,
.pages-panel,
.selected-panel {
  padding: 20px;
}

.doc-panel {
  border-bottom: 1px solid var(--line);
}

h1,
h2,
p {
  margin: 0;
}

h2 {
  margin-bottom: 12px;
  color: #2a3342;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.doc-panel strong {
  display: block;
  margin-bottom: 6px;
  overflow-wrap: anywhere;
  font-size: 16px;
}

.doc-panel p,
.empty-state p,
.no-selection {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.status-list {
  display: grid;
  gap: 9px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.token-pricing-card {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(37, 99, 235, .24);
  border-radius: 8px;
  background: #f8fbff;
}

.pricing-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pricing-head h2 {
  margin: 0;
}

.pricing-head span {
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
}

.free-line {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid rgba(31, 157, 85, .26);
  border-radius: 8px;
  background: #f3fff7;
}

.free-line strong {
  color: #14713e;
  font-size: 14px;
  font-weight: 950;
}

.free-line span {
  color: #405064;
  font-size: 12px;
  line-height: 1.35;
}

.cost-table,
.modal-cost-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
}

.cost-table th,
.cost-table td,
.modal-cost-table th,
.modal-cost-table td {
  padding: 8px 9px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.cost-table tr:last-child td,
.modal-cost-table tr:last-child td {
  border-bottom: 0;
}

.cost-table th,
.modal-cost-table th {
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.cost-table td:last-child,
.modal-cost-table td:nth-child(2) {
  color: var(--blue);
  font-weight: 950;
  white-space: nowrap;
}

.token-buy-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.token-buy-row a {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 34px;
  border-radius: 7px;
  color: #fff;
  background: var(--blue);
  text-decoration: none;
  font-size: 12px;
  font-weight: 900;
}

.token-buy-row a:hover {
  background: #174ea6;
}

.status-item {
  position: relative;
  padding-left: 26px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 680;
}

.status-item:before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  width: 15px;
  height: 15px;
  border-radius: 999px;
  border: 2px solid currentColor;
}

.status-item.done {
  color: var(--green);
}

.status-item.busy {
  color: var(--blue);
}

.status-item.error {
  color: var(--red);
}

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

.panel-heading h2 {
  margin-bottom: 0;
}

#page-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.thumbs {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.thumb {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 10px;
  align-items: center;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

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

.thumb.active {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.thumb span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.thumb canvas {
  width: 84px;
  max-height: 118px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 3px 12px rgba(30, 38, 51, .12);
}

.workspace {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 36px;
  background: linear-gradient(180deg, #f4f6fa 0%, #e8edf5 100%);
}

.gomapro-demo-trigger {
  position: absolute;
  right: 24px;
  bottom: 52px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 7px 12px;
  border: 1px solid rgba(37, 99, 235, .28);
  border-radius: 8px;
  color: #174ea6;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 10px 28px rgba(30, 38, 51, .16);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
}

.gomapro-demo-trigger:hover {
  border-color: rgba(37, 99, 235, .52);
  background: #f8fbff;
}

.drop-zone {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  display: grid;
  place-items: start center;
  padding: 28px 34px;
}

.drop-zone.dragover:after {
  content: "Suelta el PDF";
  position: absolute;
  inset: 18px;
  display: grid;
  place-items: center;
  border: 2px dashed var(--blue);
  border-radius: 8px;
  color: var(--blue);
  background: rgba(219, 234, 254, .72);
  font-weight: 900;
  font-size: 24px;
  z-index: 10;
}

.empty-state {
  width: min(420px, calc(100vw - 48px));
  margin-top: 14vh;
  text-align: center;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  margin: 0 auto 18px;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--blue);
  font-weight: 950;
}

.empty-state h1 {
  margin-bottom: 10px;
  font-size: 34px;
  letter-spacing: 0;
}

.empty-costs {
  display: grid;
  gap: 8px;
  width: min(520px, 100%);
  margin: 18px auto 0;
  padding: 15px;
  border: 1px solid rgba(37, 99, 235, .24);
  border-radius: 8px;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 12px 34px rgba(30, 38, 51, .10);
  text-align: left;
}

.empty-costs strong {
  color: #14713e;
  font-size: 14px;
  font-weight: 950;
}

.empty-costs span {
  color: #405064;
  font-size: 13px;
  line-height: 1.4;
}

.empty-costs a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 36px;
  border-radius: 7px;
  color: #fff;
  background: var(--blue);
  text-decoration: none;
  font-size: 13px;
  font-weight: 900;
}

.empty-costs a:hover {
  background: #174ea6;
}

.page-stage {
  display: grid;
  justify-items: center;
  width: 100%;
}

.page-wrap {
  position: relative;
  background: #fff;
  box-shadow: var(--shadow);
  transform-origin: top center;
}

#pdf-canvas {
  display: block;
}

.text-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.text-layer.eraser-active {
  cursor: crosshair;
  touch-action: none;
  overscroll-behavior: contain;
  user-select: none;
  -webkit-user-select: none;
}

.page-stage.eraser-gesture-lock,
.page-wrap.eraser-gesture-lock {
  touch-action: none;
  overscroll-behavior: contain;
}

.text-layer.eraser-active.eraser-brush-active {
  cursor: none;
}

.text-layer.eraser-active .text-block,
.text-layer.eraser-active .stamp-block {
  pointer-events: none;
}

.erase-zone,
.erase-preview {
  position: absolute;
  z-index: 2;
  min-width: 4px;
  min-height: 4px;
  border: 1px solid rgba(37, 99, 235, .78);
  background: rgba(37, 99, 235, .10);
  pointer-events: none;
}

.erase-zone.brush {
  border-radius: 999px;
}

.erase-preview {
  border-style: dashed;
  background: rgba(31, 157, 85, .12);
}

.brush-cursor {
  position: absolute;
  z-index: 14;
  border: 2px solid rgba(37, 99, 235, .98);
  border-radius: 999px;
  background: rgba(37, 99, 235, .08);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .95),
    0 0 0 1px rgba(9, 22, 48, .28),
    0 8px 20px rgba(30, 38, 51, .16);
  pointer-events: none;
}

.brush-cursor::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: rgba(37, 99, 235, .95);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .95);
  transform: translate(-50%, -50%);
}

.brush-cursor.active {
  border-color: rgba(31, 157, 85, .98);
  background: rgba(31, 157, 85, .14);
}

.brush-cursor.active::after {
  background: rgba(31, 157, 85, .98);
}

.text-block {
  position: absolute;
  min-width: 10px;
  min-height: 10px;
  border: 0;
  outline: 0;
  color: #111;
  background: rgba(255, 255, 255, .02);
  line-height: 1.08;
  white-space: pre-wrap;
  overflow: hidden;
  resize: none;
  cursor: move;
  user-select: none;
  overflow-wrap: anywhere;
  touch-action: none;
}

#text-preview-canvas {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
}

.text-layer.final-preview {
  pointer-events: none;
}

.text-layer.final-preview .text-block,
.text-layer.final-preview .block-controls {
  visibility: hidden;
}

.text-layer.final-preview .stamp-block {
  border-color: transparent;
  box-shadow: none;
}

.text-block:hover,
.text-block.selected {
  outline: 1px solid var(--blue);
}

.text-appearance {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 8px 0;
  padding: 12px 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.text-appearance legend {
  padding-right: 8px;
  font-size: 13px;
  font-weight: 700;
}

.appearance-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.appearance-label output {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.final-preview-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  white-space: nowrap;
  font-size: 12px;
  cursor: pointer;
}

.final-preview-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
}

.text-block:hover {
  border-color: rgba(37, 99, 235, .72);
  background: rgba(219, 234, 254, .16);
}

.text-block.selected {
  border-style: solid;
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, .18);
  z-index: 3;
}

.text-block.editing {
  cursor: text;
  user-select: text;
  background: rgba(255, 255, 255, .22);
}

.text-block.dirty {
  background: rgba(220, 252, 231, .24);
}

.text-block.ocr {
  border-color: transparent;
}

.text-block.ocr:hover,
.text-block.ocr.selected {
  border-color: rgba(31, 157, 85, .7);
}

.stamp-block {
  position: absolute;
  z-index: 4;
  min-width: 24px;
  min-height: 16px;
  border: 1px solid transparent;
  object-fit: contain;
  transform-origin: left top;
  cursor: move;
  user-select: none;
}

.stamp-block:hover,
.stamp-block.selected {
  border-color: rgba(37, 99, 235, .78);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, .14);
}

.block-controls {
  position: absolute;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px;
  border: 1px solid rgba(37, 99, 235, .34);
  border-radius: 8px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 10px 26px rgba(30, 38, 51, .20);
  user-select: none;
  pointer-events: auto;
}

.block-control-button {
  min-width: 52px;
  height: 28px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #fff;
  background: var(--blue);
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  letter-spacing: 0;
  box-shadow: none;
}

.block-control-button.edit {
  color: var(--text);
  background: #fff;
  border-color: rgba(37, 99, 235, .32);
}

.block-control-button.move {
  cursor: move;
}

.block-control-button.rotate {
  cursor: grab;
  color: var(--text);
  background: #eef4ff;
  border-color: rgba(37, 99, 235, .36);
}

.block-control-button.rotate:active {
  cursor: grabbing;
}

.block-control-button:focus-visible {
  outline: 2px solid rgba(37, 99, 235, .55);
  outline-offset: 2px;
}

.block-angle-readout {
  min-width: 44px;
  color: #536071;
  font-size: 11px;
  font-weight: 750;
  text-align: center;
}

.progress-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 7px 14px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .84);
}

progress {
  width: 100%;
  height: 8px;
  accent-color: var(--blue);
}

#progress-label {
  min-width: 180px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-align: right;
}

.inspector-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

label {
  display: block;
  margin-bottom: 6px;
  color: #485366;
  font-size: 12px;
  font-weight: 800;
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  color: var(--text);
  background: #fff;
  outline: 0;
  font-size: 14px;
}

textarea {
  min-height: 90px;
  resize: vertical;
  line-height: 1.35;
}

input[type="color"] {
  min-height: 40px;
  padding: 4px;
}

.style-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.style-toggle,
.fit-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  min-height: 36px;
  padding: 0 10px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.style-toggle {
  width: 38px;
  padding: 0;
  font-size: 15px;
  font-weight: 800;
}

.style-toggle.italic span {
  font-style: italic;
}

.fit-toggle {
  font-size: 12px;
  font-weight: 800;
  color: #485366;
}

.style-toggle input,
.fit-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.style-toggle:has(input:checked),
.fit-toggle:has(input:checked) {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
}

.style-toggle:has(input:focus-visible),
.fit-toggle:has(input:focus-visible) {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

textarea:focus,
input:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
}

.field-grid {
  display: grid;
  gap: 10px;
}

.field-grid.two {
  grid-template-columns: 1fr 110px;
}

.field-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ocr-readout {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  padding: 12px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
}

.ocr-readout strong {
  color: var(--text);
}

.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.no-selection {
  margin-top: 18px;
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--surface-soft);
}

.eraser-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.segment {
  height: 34px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
}

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

.sample-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.sample-status.ready {
  color: var(--green);
}

.sample-status.armed {
  color: var(--blue);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(24, 34, 53, .48);
  z-index: 20;
}

.demo-backdrop {
  z-index: 30;
}

.gomapro-dialog {
  width: min(700px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.gomapro-demo-stage {
  padding: 22px;
  background: linear-gradient(180deg, #f8fafc 0%, #eef3f9 100%);
}

.demo-paper {
  position: relative;
  min-height: 286px;
  padding: 30px;
  border: 1px solid #d6dce6;
  border-radius: 4px;
  background:
    linear-gradient(90deg, rgba(36, 42, 51, .045) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(180deg, #f1f2f3 0%, #e9ebee 100%);
  box-shadow: 0 18px 38px rgba(30, 38, 51, .14);
  transform: rotate(-.35deg);
}

.demo-heading {
  width: 54%;
  height: 18px;
  margin: 0 auto 24px;
  border-radius: 3px;
  background: #252a32;
  opacity: .78;
}

.demo-field {
  position: relative;
  min-height: 74px;
  margin-top: 12px;
  border: 2px solid rgba(24, 34, 53, .72);
  background: rgba(244, 245, 246, .82);
  overflow: hidden;
}

.demo-field.wide {
  width: 100%;
}

.demo-field.small {
  width: 48%;
  float: left;
}

.demo-field.medium {
  width: 48%;
  float: right;
}

.demo-label {
  position: absolute;
  left: 13px;
  top: 8px;
  color: #4b5563;
  font-size: 14px;
  font-weight: 750;
}

.demo-field > span:not(.demo-label, .demo-clean-fill, .demo-brush, .demo-new-text, .demo-old-text) {
  position: absolute;
  left: 13px;
  top: 34px;
  color: #323944;
  font-size: 22px;
  font-weight: 650;
}

.demo-old-text,
.demo-new-text {
  position: absolute;
  left: 13px;
  top: 35px;
  z-index: 1;
  color: #4a5360;
  font-size: 22px;
  font-weight: 760;
  letter-spacing: 0;
  line-height: 1.05;
}

.demo-clean-fill {
  position: absolute;
  left: 8px;
  top: 28px;
  z-index: 2;
  width: 0;
  height: 32px;
  border-radius: 3px;
  background:
    linear-gradient(90deg, rgba(236, 238, 241, .98), rgba(226, 229, 233, .96)),
    #eceef1;
  box-shadow: 0 0 0 1px rgba(230, 232, 236, .72);
}

.demo-brush {
  position: absolute;
  left: 8px;
  top: 21px;
  z-index: 5;
  width: 46px;
  height: 46px;
  border: 2px solid rgba(37, 99, 235, .72);
  border-radius: 999px;
  background: rgba(37, 99, 235, .14);
  opacity: 0;
}

.demo-new-text {
  z-index: 4;
  color: #323944;
  opacity: 0;
  transform: translateY(1px) rotate(-.15deg);
}

.gomapro-demo-stage.playing .demo-old-text {
  animation: demoOldText 3s ease-in-out both;
}

.gomapro-demo-stage.playing .demo-clean-fill {
  animation: demoCleanFill 3s ease-in-out both;
}

.gomapro-demo-stage.playing .demo-brush {
  animation: demoBrush 3s ease-in-out both;
}

.gomapro-demo-stage.playing .demo-new-text {
  animation: demoNewText 3s ease-in-out both;
}

.demo-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.demo-footer span {
  min-width: 0;
}

@keyframes demoOldText {
  0%, 52% { opacity: 1; }
  62%, 100% { opacity: 0; }
}

@keyframes demoCleanFill {
  0%, 18% { width: 0; }
  55%, 100% { width: calc(100% - 16px); }
}

@keyframes demoBrush {
  0%, 14% {
    opacity: 0;
    transform: translateX(0);
  }
  20%, 58% {
    opacity: 1;
  }
  62%, 100% {
    opacity: 0;
    transform: translateX(520px);
  }
}

@keyframes demoNewText {
  0%, 62% {
    opacity: 0;
    filter: blur(1px);
  }
  72%, 100% {
    opacity: 1;
    filter: blur(0);
  }
}

.pro-dialog {
  width: min(1120px, calc(100vw - 44px));
  max-height: calc(100vh - 44px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.pro-header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
  z-index: 2;
}

.pro-header h2 {
  margin-bottom: 4px;
}

.pro-header strong {
  font-size: 18px;
}

.pro-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
}

.pro-section {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.pro-section.wide {
  grid-column: 1 / -1;
}

.pro-section h3 {
  margin: 0;
  color: #2a3342;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.section-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.pro-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.pro-actions.single {
  grid-template-columns: 1fr;
}

.signature-pad {
  width: 100%;
  height: 150px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  cursor: crosshair;
  touch-action: none;
  overscroll-behavior: contain;
  user-select: none;
  -webkit-user-select: none;
}

.company-logo-preview {
  max-width: 148px;
  max-height: 72px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px;
  background: #fff;
  object-fit: contain;
}

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

.account-panel {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.account-panel.attention {
  border-color: rgba(37, 99, 235, .7);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
}

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

.billing-card {
  display: grid;
  gap: 6px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.billing-card.free {
  border-color: rgba(31, 157, 85, .28);
  background: #f3fff7;
}

.billing-card.paid {
  border-color: rgba(37, 99, 235, .24);
  background: #f5f9ff;
}

.billing-card strong {
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
}

.billing-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.modal-cost-table {
  font-size: 13px;
}

.account-panel strong,
.account-panel span {
  display: block;
}

.account-panel strong {
  color: var(--text);
  font-size: 15px;
}

.account-panel span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.server-documents {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}

.server-document {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.server-document strong,
.server-document span {
  display: block;
}

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

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

.history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.history-item strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.history-item span {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1500px) {
  .topbar {
    grid-template-columns: minmax(480px, 1fr) minmax(500px, 1fr);
    grid-template-areas:
      "brand billing"
      "actions actions"
      "doc view";
  }

  .right-tools {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .billing-strip {
    flex-wrap: wrap;
  }
}

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

  .app-shell {
    grid-template-columns: 220px minmax(360px, 1fr);
    grid-template-rows: auto minmax(620px, 1fr) auto;
    min-height: 100vh;
    height: auto;
  }

  .topbar {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "billing"
      "doc"
      "view"
      "actions";
  }

  .center-tools,
  .right-tools {
    justify-content: flex-start;
  }

  .right-tools {
    flex-wrap: wrap;
  }

  .inspector {
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

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

  .billing-strip {
    flex-wrap: wrap;
  }
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto minmax(480px, 65vh) auto;
  }

  .left-panel {
    max-height: 300px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .toolbar {
    flex-wrap: wrap;
  }

  .billing-cards {
    grid-template-columns: 1fr;
  }

  .field-grid.two,
  .field-grid.four {
    grid-template-columns: 1fr 1fr;
  }

  .drop-zone {
    padding: 16px;
  }

  .gomapro-demo-trigger {
    right: 14px;
    bottom: 48px;
    max-width: calc(100vw - 28px);
  }

  .gomapro-dialog {
    width: calc(100vw - 24px);
  }

  .gomapro-demo-stage {
    padding: 14px;
  }

  .demo-paper {
    min-height: 340px;
    padding: 18px;
  }

  .demo-field.small,
  .demo-field.medium {
    width: 100%;
    float: none;
  }

  .demo-old-text,
  .demo-new-text,
  .demo-field > span:not(.demo-label, .demo-clean-fill, .demo-brush, .demo-new-text, .demo-old-text) {
    font-size: 17px;
  }

  .demo-footer {
    align-items: stretch;
    flex-direction: column;
  }
}
