:root {
  --bg: #eef3ef;
  --surface: #fbfcfb;
  --panel: #ffffff;
  --ink: #14231e;
  --muted: #5e6d66;
  --line: #d7e0db;
  --accent: #1d6f53;
  --accent-strong: #12503c;
  --danger: #9e2f35;
  --warn: #9a641f;
  --shadow: 0 12px 32px rgb(14 35 26 / 12%);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

button,
input,
select {
  font: inherit;
}

.topbar {
  min-height: 64px;
  display: grid;
  grid-template-columns: minmax(190px, 250px) 1fr minmax(260px, 430px);
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

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

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #10231d;
  color: white;
  font-weight: 800;
  letter-spacing: 0;
}

.brand strong,
.brand small {
  display: block;
  white-space: nowrap;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

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

.tool-button,
.icon-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 7px;
  min-height: 36px;
  padding: 0 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease;
}

.icon-button {
  width: 36px;
  padding: 0;
  font-size: 1.1rem;
}

.tool-button:hover:not(:disabled),
.icon-button:hover:not(:disabled) {
  border-color: #9ab1a7;
  background: #f4f8f6;
}

.tool-button.primary,
.tool-button.strong {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.tool-button.strong {
  background: #10231d;
  border-color: #10231d;
}

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

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

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

.zoom-output {
  min-width: 54px;
  text-align: center;
  color: var(--muted);
}

.privacy-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 12px;
  background: #e8f4ee;
  color: #174534;
  border: 1px solid #b8d9c9;
  border-radius: 999px;
  font-size: 0.86rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #168850;
  flex: 0 0 auto;
}

.app-shell {
  height: calc(100vh - 65px);
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 320px;
  overflow: hidden;
}

.sidebar,
.properties {
  background: var(--panel);
  border-right: 1px solid var(--line);
  overflow: auto;
}

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

.workspace {
  min-width: 0;
  min-height: 0;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgb(16 35 29 / 4%) 1px, transparent 1px),
    linear-gradient(rgb(16 35 29 / 4%) 1px, transparent 1px);
  background-size: 28px 28px;
}

.drop-zone {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  outline: none;
}

.drop-zone.drag-over {
  background: rgb(29 111 83 / 12%);
}

.drop-copy {
  width: min(740px, 100%);
}

.eyebrow {
  text-transform: uppercase;
  color: var(--accent-strong);
  font-weight: 800;
  font-size: 0.78rem;
  margin: 0 0 10px;
}

h1 {
  font-size: clamp(2rem, 4vw, 4.8rem);
  line-height: 0.98;
  margin: 0 0 18px;
  letter-spacing: 0;
  max-width: 900px;
}

.drop-copy > p:not(.eyebrow) {
  max-width: 650px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.5;
}

.trust-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 22px;
  padding: 0;
  margin: 24px 0 0;
  list-style: none;
}

.trust-list li {
  padding-left: 22px;
  position: relative;
  color: #31453d;
}

.trust-list li::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  position: absolute;
  left: 4px;
  top: 0.55em;
}

.editor-stage {
  height: 100%;
  overflow: hidden;
}

.canvas-viewport {
  height: 100%;
  overflow: auto;
  padding: 32px;
}

.canvas-wrap {
  position: relative;
  width: fit-content;
  height: fit-content;
  margin: 0 auto;
  box-shadow: var(--shadow);
  background: white;
  transform-origin: top left;
}

#pageCanvas,
#overlayCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

#overlayCanvas {
  position: absolute;
  inset: 0;
  cursor: crosshair;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.properties .panel-heading {
  padding: 0 0 12px;
  border-bottom: 0;
}

.panel-heading h2 {
  margin: 0;
  font-size: 0.95rem;
}

.panel-heading span {
  color: var(--muted);
  font-size: 0.84rem;
}

.thumb-list {
  padding: 12px;
  display: grid;
  gap: 12px;
}

.thumb {
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: #f8faf9;
  padding: 8px;
  display: grid;
  gap: 6px;
  cursor: pointer;
  text-align: left;
}

.thumb[aria-current="page"] {
  border-color: var(--accent);
  background: #eff8f4;
}

.thumb canvas {
  width: 100%;
  background: white;
  border: 1px solid var(--line);
}

.thumb span {
  color: var(--muted);
  font-size: 0.82rem;
}

.tool-panel {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.field {
  display: grid;
  gap: 7px;
  margin: 12px 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.field input,
.field select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 9px;
  background: white;
  color: var(--ink);
}

.button-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.button-grid .tool-button:nth-child(3),
.button-grid .tool-button:nth-child(4) {
  grid-column: span 2;
}

.fine-print {
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.86rem;
}

.verify-report,
.safety-summary {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8faf9;
  padding: 12px;
  color: #344941;
  line-height: 1.45;
}

.verify-report ul,
.limit-list {
  padding-left: 18px;
}

.modal {
  width: min(720px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--ink);
}

.modal::backdrop {
  background: rgb(10 20 16 / 55%);
}

.modal h2 {
  margin-top: 0;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.4;
  margin: 16px 0;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.settings-grid,
.plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.plans article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: #fbfcfb;
}

progress {
  width: 100%;
  height: 12px;
}

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

@media (max-width: 1020px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .privacy-pill {
    border-radius: 7px;
  }

  .app-shell {
    grid-template-columns: 150px minmax(0, 1fr);
  }

  .properties {
    display: none;
  }
}

@media (max-width: 720px) {
  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: calc(100vh - 64px);
  }

  .sidebar {
    display: none;
  }

  .workspace {
    min-height: calc(100vh - 64px);
  }

  .trust-list,
  .settings-grid,
  .plans {
    grid-template-columns: 1fr;
  }

  .canvas-viewport {
    padding: 14px;
  }
}
