:root {
  color-scheme: light;
  --ink: #16201f;
  --ink-soft: #33413f;
  --paper: #fffef9;
  --canvas: #e9ebe7;
  --panel: #f5f4ee;
  --line: #ced3cd;
  --line-strong: #98a39f;
  --teal: #087f78;
  --teal-dark: #075e5a;
  --teal-wash: #d9efeb;
  --gold: #d8a327;
  --gold-wash: #fff1bd;
  --danger: #b63e39;
  --shadow: 0 20px 58px rgba(27, 37, 35, 0.14);
  --header-height: 72px;
  --footer-height: 30px;
}

* {
  box-sizing: border-box;
}

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

body,
button,
input,
select,
textarea {
  font-family: "Trebuchet MS", "Avenir Next", sans-serif;
  letter-spacing: 0;
}

body {
  background: var(--canvas);
  color: var(--ink);
}

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

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(8, 127, 120, 0.2);
  outline-offset: 2px;
}

svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

.hidden {
  display: none !important;
}

.print-portal { display: none; }

.app-shell {
  height: 100%;
  display: grid;
  grid-template-rows: var(--header-height) minmax(0, 1fr) var(--footer-height);
}

.skip-links {
  position: fixed;
  z-index: 200;
  top: 8px;
  left: 8px;
  display: flex;
  gap: 5px;
  transform: translateY(-150%);
}

.skip-links:focus-within { transform: translateY(0); }
.skip-links a { padding: 9px 12px; border-radius: 4px; color: white; background: var(--teal-dark); font-size: 12px; font-weight: 800; }

.app-header {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(230px, 1fr) minmax(260px, 420px) minmax(300px, 1fr);
  align-items: center;
  gap: 24px;
  padding: 10px 18px;
  background: var(--ink);
  color: var(--paper);
  border-bottom: 3px solid var(--gold);
}

.brand {
  width: max-content;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}

.brand img {
  flex: 0 0 auto;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.22));
}

.brand span {
  display: grid;
  min-width: 0;
}

.brand strong {
  font-family: Georgia, serif;
  font-size: 25px;
  line-height: 1;
  font-weight: 700;
}

.brand small {
  margin-top: 4px;
  color: #aebbb8;
  font-size: 11px;
}

.project-control {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
}

.project-name-field {
  position: relative;
  min-width: 0;
  display: block;
}

.project-name-field > span,
.project-control .save-state {
  color: #aebbb8;
  font-size: 10px;
  text-transform: uppercase;
}

.project-name-field > span {
  position: absolute;
  z-index: 1;
  top: 5px;
  left: 12px;
  color: #82918d;
  font-size: 8px;
  pointer-events: none;
}

.project-control input {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 13px 12px 2px;
  border: 1px solid #4f5d5a;
  border-radius: 5px;
  background: #222e2c;
  color: var(--paper);
}

.project-control .save-state {
  width: 80px;
  color: #89c9bd;
}

.project-control .save-state.saving {
  color: var(--gold-wash);
}

.header-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.button,
.icon-button,
.mini-icon,
.paste-action,
.label-list-main,
.sheet-label,
.segmented-control button,
.import-tabs button {
  border: 0;
}

.button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 700;
}

.button--quiet {
  background: #2a3735;
  color: #eaf0ed;
  border: 1px solid #4a5956;
}

.button--quiet:hover {
  background: #364642;
}

.button--primary {
  background: var(--teal);
  color: white;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.2);
}

.button--primary:hover {
  background: #09958b;
}

.button--danger { color: white; background: var(--danger); }
.button--danger:hover { background: #95332f; }

.account-dialog { width: min(520px, calc(100vw - 28px)); padding: 0; border: 0; border-radius: 7px; color: var(--ink); background: var(--paper); box-shadow: var(--shadow); }
.account-dialog::backdrop { background: rgba(12, 19, 18, .62); backdrop-filter: blur(4px); }
.account-shell { display: grid; gap: 0; }
.account-dialog .dialog-shell { min-height: 0; grid-template-rows: auto auto auto; }
.account-shell > header { min-height: 74px; padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.account-shell h2 { margin: 3px 0 0; font-family: Georgia, serif; font-size: 23px; }
.account-content { padding: 20px; display: grid; gap: 14px; }
.account-content > p { margin: 0 0 2px; color: #5e6b68; font-size: 13px; line-height: 1.55; }
.account-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); }
.account-tabs button { min-height: 35px; border: 0; border-radius: 3px; background: transparent; color: #68736f; font-weight: 700; }
.account-tabs button.selected { background: var(--paper); color: var(--teal-dark); box-shadow: 0 1px 5px rgba(0,0,0,.09); }
.sync-service { color: #68736f; font-size: 11px; }
.sync-service select { width: 100%; height: 36px; margin-top: 8px; border: 1px solid var(--line); border-radius: 4px; background: white; }
.account-identity { display: flex; align-items: center; gap: 12px; }
.account-avatar { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--teal); }
.account-identity div { display: grid; gap: 3px; }
.account-identity small { color: #68736f; }
.sync-status { padding: 13px; display: flex; justify-content: space-between; gap: 12px; border: 1px solid var(--line); background: var(--panel); font-size: 12px; }
.sync-status span { color: #68736f; }
.conflict-actions { padding: 14px; display: flex; flex-wrap: wrap; gap: 8px; border: 1px solid #d8a327; background: var(--gold-wash); }
.conflict-actions p { width: 100%; margin: 0 0 3px; font-size: 12px; }
.account-actions { display: flex; gap: 9px; }
.account-shell > .dialog-message { min-height: 20px; margin: 0; padding: 0 20px 18px; color: var(--teal-dark); font-size: 12px; }
.account-shell > .dialog-message.error { color: var(--danger); }

@media print {
  @page { size: letter; margin: 0; }
  html, body { width: auto; height: auto; overflow: visible; background: white; }
  .app-shell, dialog, .toast { display: none !important; }
  .print-portal { display: block !important; }
  .print-sheet { position: relative; width: 8.5in; height: 11in; overflow: hidden; break-after: page; }
  .print-sheet:last-child { break-after: auto; }
  .print-label { position: absolute; overflow: hidden; color: #000; }
  .print-label .sheet-label-content { width: 100%; height: 100%; font-family: "Trebuchet MS", "Avenir Next", sans-serif; }
}

.icon-button {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 5px;
  background: transparent;
  color: inherit;
}

.header-actions .icon-button {
  color: #cbd5d2;
}

.icon-button:hover {
  background: rgba(8, 127, 120, 0.11);
  color: var(--teal);
}

.header-actions .icon-button:hover {
  background: #2f3d3a;
  color: white;
}

.icon-button--accent {
  background: var(--teal);
  color: white;
}

.icon-button--accent:hover {
  background: var(--teal-dark);
  color: white;
}

.icon-button--danger:hover {
  background: rgba(182, 62, 57, 0.11);
  color: var(--danger);
}

.icon-button:disabled,
.mini-icon:disabled {
  cursor: default;
  opacity: 0.3;
}

.workspace {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(250px, 286px) minmax(620px, 1fr) minmax(290px, 330px);
}

.label-library,
.inspector,
.sheet-workbench {
  min-width: 0;
  min-height: 0;
}

.label-library,
.inspector {
  background: var(--panel);
}

.label-library {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  border-right: 1px solid var(--line);
}

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

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 16px 14px;
}

.panel-heading h1,
.panel-heading h2,
.import-dialog h2 {
  margin: 3px 0 0;
  font-family: Georgia, serif;
  font-weight: 700;
}

.panel-heading h1 {
  font-size: 27px;
}

.panel-heading h2,
.import-dialog h2 {
  font-size: 23px;
}

.eyebrow {
  display: block;
  color: var(--teal-dark);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.search-box {
  height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 14px 10px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper);
  color: var(--line-strong);
}

.search-box input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.library-meta {
  display: flex;
  justify-content: space-between;
  padding: 0 16px 9px;
  color: #68736f;
  font-size: 11px;
}

.label-list {
  min-height: 0;
  overflow: auto;
  border-top: 1px solid var(--line);
  scrollbar-width: thin;
}

.label-list-item {
  position: relative;
  min-height: 66px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  overflow: hidden;
  border-bottom: 1px solid #d9ddd7;
  background: transparent;
}

.label-list-item::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: transparent;
}

.label-list-item:hover {
  background: #eeefe9;
}

.label-list-item.selected {
  background: var(--teal-wash);
}

.label-list-item.selected::before {
  background: var(--teal);
}

.label-list-main {
  min-width: 0;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 9px 5px 9px 13px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.label-index {
  width: 28px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid #bfc6c0;
  border-radius: 3px;
  background: var(--paper);
  color: #68736f;
  font-family: ui-monospace, monospace;
  font-size: 10px;
}

.label-list-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.label-list-copy strong,
.label-list-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.label-list-copy small {
  color: #68736f;
  font-size: 11px;
}

.label-movement {
  width: 112px;
  flex: 0 0 112px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  padding-right: 8px;
  opacity: 0;
}

.label-list-item:hover .label-movement,
.label-list-item.selected .label-movement,
.label-list-item:focus-within .label-movement {
  opacity: 1;
}

.mini-icon {
  width: 30px;
  flex: 0 0 30px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: transparent;
  color: #68736f;
}

.mini-icon svg {
  width: 17px;
  height: 17px;
}

.mini-icon:hover {
  background: rgba(8, 127, 120, 0.1);
  color: var(--teal);
}

.mini-icon--danger:hover {
  color: var(--danger);
}

.empty-list {
  margin: 0;
  padding: 30px 20px;
  color: #68736f;
  font-size: 12px;
  line-height: 1.55;
  text-align: center;
}

.paste-action {
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px;
  padding: 9px 12px;
  border: 1px dashed #9baaa5;
  border-radius: 5px;
  background: transparent;
  color: var(--ink-soft);
  text-align: left;
}

.paste-action:hover {
  border-color: var(--teal);
  background: var(--teal-wash);
}

.paste-action span {
  display: grid;
  gap: 2px;
}

.paste-action strong {
  font-size: 12px;
}

.paste-action small {
  color: #68736f;
  font-size: 10px;
}

.sheet-workbench {
  min-width: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--canvas);
}

.sheet-toolbar {
  position: relative;
  z-index: 4;
  min-height: 52px;
  display: grid;
  grid-template-columns: minmax(180px, 260px) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 244, 238, 0.94);
}

.sheet-set-control { min-width: 0; display: flex; align-items: flex-end; gap: 4px; }
.sheet-set-control label { min-width: 0; flex: 1; display: grid; gap: 4px; }
.sheet-set-control label > span { color: #68736f; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.sheet-set-control select { width: 100%; height: 30px; padding: 0 7px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); color: var(--ink); font-size: 11px; }
.sheet-set-control .icon-button { width: 30px; height: 30px; }

.page-stepper {
  display: flex;
  align-items: center;
  gap: 2px;
}

.page-stepper .icon-button {
  width: 30px;
  height: 30px;
}

.page-stepper span {
  min-width: 76px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.toolbar-fields {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  justify-self: end;
  gap: 8px;
}

.toolbar-fields label {
  display: grid;
  gap: 4px;
}

.toolbar-fields label > span {
  color: #68736f;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.toolbar-fields .zoom-field > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.toolbar-fields .zoom-field output {
  color: var(--teal);
  font-variant-numeric: tabular-nums;
}

.toolbar-fields select,
.toolbar-fields input[type="number"] {
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  font-size: 11px;
}

.toolbar-fields select {
  width: 190px;
  padding: 0 8px;
}

.toolbar-fields .start-field input {
  width: 58px;
  padding: 0 7px;
}

.toolbar-fields input[type="range"] {
  width: 105px;
  accent-color: var(--teal);
}

.sheet-stage {
  --sheet-scale: 0.86;
  min-height: 0;
  overflow: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 28px 26px 60px;
  scrollbar-width: thin;
  overscroll-behavior: contain;
}

.sheet-canvas {
  position: relative;
  flex: 0 0 auto;
  transform-origin: top center;
  margin-right: calc(4.25in * (var(--sheet-scale) - 1));
  margin-bottom: calc(11in * (var(--sheet-scale) - 1));
  margin-left: calc(4.25in * (var(--sheet-scale) - 1));
  background: var(--paper);
  box-shadow: var(--shadow), 0 0 0 1px rgba(45, 58, 55, 0.08);
}

.sheet-canvas::before,
.sheet-canvas::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: var(--teal);
  pointer-events: none;
}

.sheet-canvas::before {
  top: 0.18in;
  left: 0.06in;
  border-top: 1px solid;
  border-left: 1px solid;
}

.sheet-canvas::after {
  right: 0.06in;
  bottom: 0.18in;
  border-right: 1px solid;
  border-bottom: 1px solid;
}

.sheet-label {
  position: absolute;
  overflow: hidden;
  display: grid;
  place-items: stretch;
  padding: 0;
  border: 1px dashed #ccd1cc;
  border-radius: 0.08in;
  background: transparent;
  color: #111;
  font-family: Arial, sans-serif;
  text-align: left;
}

.sheet-label:hover {
  border-color: var(--teal);
  background: rgba(8, 127, 120, 0.035);
}

.sheet-label.selected {
  border: 2px solid var(--teal);
  box-shadow: 0 0 0 2px rgba(8, 127, 120, 0.12);
}

.sheet-label.empty {
  cursor: text;
  opacity: 0.55;
}

.sheet-label.empty:disabled {
  cursor: default;
  opacity: 0.3;
}

.sheet-label.drag-source { opacity: 0.38; }
.sheet-label.drag-target {
  border-color: var(--teal);
  border-style: solid;
  background: rgba(8, 127, 120, 0.12);
  box-shadow: inset 0 0 0 2px rgba(8, 127, 120, 0.24);
}
.sheet-label.drag-target--replace {
  border-color: var(--gold);
  background: rgba(195, 139, 42, 0.13);
  box-shadow: inset 0 0 0 2px rgba(195, 139, 42, 0.24);
}

.slot-number {
  position: absolute;
  top: 0.04in;
  right: 0.06in;
  color: #b4bbb7;
  font-family: ui-monospace, monospace;
  font-size: 6pt;
}

.sheet-label-content {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: 0.09in 0.13in;
}

.sheet-label-content span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-label-content.align-center {
  align-items: center;
  text-align: center;
}

.sheet-note {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 0;
  padding: 7px 14px;
  border-top: 1px solid var(--line);
  background: #dde1dc;
  color: #5f6c68;
  font-size: 10px;
}

.sheet-note svg {
  width: 14px;
  height: 14px;
}

.empty-inspector {
  min-height: 100%;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 9px;
  padding: 32px;
  color: #6a7571;
  text-align: center;
}

.empty-inspector .empty-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 50%;
  color: var(--teal);
}

.empty-inspector h2 {
  margin: 5px 0 0;
  font-family: Georgia, serif;
  color: var(--ink);
  font-size: 22px;
}

.empty-inspector p {
  max-width: 225px;
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
}

.inspector-heading {
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 244, 238, 0.96);
}

.inline-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.label-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 78px 96px;
  gap: 14px 10px;
  padding: 18px 16px 32px;
}

.field {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
}

.field select { height: 36px; padding: 0 9px; }
.field textarea { min-height: 112px; padding: 9px; resize: vertical; line-height: 1.45; }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: rgba(182, 62, 57, .68); }
.field-error { min-height: 0; color: var(--danger); font-size: 9px; line-height: 1.35; }
.field-error:empty { display: none; }
.validation-summary { padding: 9px 10px; border: 1px solid var(--line); border-left-width: 3px; background: var(--paper); color: #66716e; font-size: 10px; line-height: 1.4; }
.validation-summary.valid { border-left-color: var(--teal); color: var(--teal-dark); }
.validation-summary.needs-attention { border-left-color: var(--gold); color: #745518; }

.sync-benefit { padding: 11px; display: flex; gap: 9px; border: 1px solid var(--line); background: var(--panel); color: #5e6b68; font-size: 11px; line-height: 1.45; }
.sync-benefit svg { flex: 0 0 auto; color: var(--teal); }

.sheet-dialog { width: min(470px, calc(100vw - 28px)); padding: 0; border: 0; border-radius: 7px; color: var(--ink); background: var(--paper); box-shadow: var(--shadow); }
.sheet-dialog::backdrop { background: rgba(12, 19, 18, .62); backdrop-filter: blur(4px); }
.compact-dialog { padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.compact-dialog > header, .compact-dialog > footer { grid-column: 1 / -1; }
.compact-dialog > header { padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.compact-dialog > header h2 { margin: 3px 0 0; font-family: Georgia, serif; font-size: 23px; }
.compact-dialog > label { padding-inline: 18px; }
.compact-dialog > footer { padding: 14px 18px; display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px; border-top: 1px solid var(--line); }
.sheet-dialog > .compact-dialog { min-height: 0; grid-template-rows: auto auto auto; }
.sheet-typography {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.1fr .8fr .8fr;
  gap: 12px;
  margin: 0 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
}
.sheet-typography legend {
  padding: 0 6px;
  color: #697470;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}
.sheet-format-field {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 6px;
}
.sheet-format-field > span {
  color: #697470;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}
.sheet-format-field input {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
}
.number-stepper {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(44px, 1fr) 34px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
}
.number-stepper input,
.field .number-stepper input,
.sheet-format-field .number-stepper input {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 4px;
  border: 0;
  border-inline: 1px solid var(--line);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  text-align: center;
}
.number-stepper button {
  width: 34px;
  min-width: 0;
  height: 36px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 0;
  background: #eef0eb;
  color: #53615d;
}
.number-stepper button:hover {
  background: var(--teal-wash);
  color: var(--teal-dark);
}
.number-stepper button:disabled {
  cursor: default;
  background: #f3f3ef;
  color: #a7afac;
}
.number-stepper button svg {
  display: block;
  width: 17px;
  height: 17px;
  max-width: 100%;
  max-height: 100%;
  pointer-events: none;
}
.number-stepper input::-webkit-inner-spin-button,
.number-stepper input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}
.sheet-reset-button {
  grid-column: 1 / -1;
  min-height: 32px;
  justify-self: end;
  padding-inline: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  color: #53615d;
  font-size: 10px;
  font-weight: 800;
}
.sheet-reset-button:hover {
  border-color: #aebbb7;
  background: var(--teal-wash);
  color: var(--teal-dark);
}
.sheet-reset-button svg {
  width: 14px;
  height: 14px;
}
.replace-label-dialog { width: min(420px, calc(100vw - 28px)); }
.replace-label-shell { display: grid; }
.replace-label-shell > header { padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); }
.replace-label-shell > header h2 { margin: 3px 0 0; font-family: Georgia, serif; font-size: 22px; }
.replace-label-shell > p { margin: 0; padding: 20px 18px; color: #5f6b67; font-size: 12px; line-height: 1.55; }
.replace-label-shell > footer { padding: 14px 18px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); }

.brand-footer { min-width: 0; padding: 0 18px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; color: #7e8a86; border-top: 1px solid #3d4a47; background: var(--ink); font-size: 9px; }
.brand-footer span:nth-child(2) { text-align: center; }
.brand-footer > a { justify-self: end; }
.brand-footer a { color: #b8c5c1; text-decoration: none; }
.brand-footer a:hover { color: white; }

.field > span,
.form-divider span {
  color: #697470;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
}

.field input,
.field select {
  height: 38px;
  padding: 0 10px;
}

.field textarea {
  resize: vertical;
  padding: 11px;
  line-height: 1.45;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--teal);
  outline: 3px solid rgba(8, 127, 120, 0.11);
}

.field--wide,
.field--city,
.form-divider {
  grid-column: 1 / -1;
}

.field--state {
  grid-column: 1 / 2;
}

.field--postal {
  grid-column: 2 / -1;
}

.form-divider {
  position: relative;
  height: 21px;
  display: flex;
  align-items: center;
}

.form-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  margin-left: 9px;
  background: var(--line);
}

.segmented-control {
  width: max-content;
  display: grid;
  grid-template-columns: repeat(2, 38px);
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
}

.segmented-control button {
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--paper);
  color: #63706c;
}

.segmented-control button + button {
  border-left: 1px solid var(--line);
}

.segmented-control button.selected {
  background: var(--teal);
  color: white;
}

.field--font {
  min-width: 0;
}

.typography-fields {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.import-dialog {
  width: min(620px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  padding: 0;
  border: 1px solid #68736f;
  border-radius: 7px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 30px 90px rgba(11, 19, 18, 0.38);
}

.import-dialog::backdrop {
  background: rgba(17, 27, 25, 0.62);
  backdrop-filter: blur(3px);
}

.dialog-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  min-height: min(580px, calc(100vh - 36px));
}

.dialog-shell > header,
.dialog-shell > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
}

.dialog-shell > header {
  border-bottom: 1px solid var(--line);
}

.dialog-shell > footer {
  border-top: 1px solid var(--line);
}

.dialog-shell > footer > div {
  display: flex;
  gap: 8px;
}

.dialog-shell > footer .button--quiet {
  border-color: var(--line);
  background: var(--paper);
  color: var(--ink);
}

.import-tabs {
  display: flex;
  gap: 20px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
}

.import-tabs button {
  position: relative;
  height: 46px;
  padding: 0;
  background: transparent;
  color: #67736f;
  font-size: 12px;
  font-weight: 700;
}

.import-tabs button.selected {
  color: var(--ink);
}

.import-tabs button.selected::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  background: var(--teal);
}

.import-panel {
  min-height: 0;
  overflow: auto;
  padding: 20px;
}

.import-panel textarea {
  min-height: 300px;
  font-family: ui-monospace, monospace;
  font-size: 12px;
}

.file-drop {
  min-height: 280px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  padding: 30px;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  background: var(--paper);
  text-align: center;
  cursor: pointer;
}

.file-drop:hover {
  border-color: var(--teal);
  background: var(--teal-wash);
}

.file-drop svg {
  width: 34px;
  height: 34px;
  color: var(--teal);
}

.file-drop strong {
  font-family: Georgia, serif;
  font-size: 20px;
}

.file-drop span {
  max-width: 360px;
  color: #68736f;
  font-size: 11px;
  line-height: 1.5;
}

.file-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.file-name,
.dialog-message {
  color: var(--teal-dark);
  font-size: 11px;
}

.file-name {
  text-align: center;
}

.dialog-message {
  max-width: 270px;
  color: var(--danger);
}

.toast {
  position: fixed;
  z-index: 100;
  top: 84px;
  left: 50%;
  max-width: min(380px, calc(100vw - 30px));
  padding: 10px 14px;
  border: 1px solid #55615e;
  border-radius: 5px;
  background: var(--ink);
  color: white;
  box-shadow: 0 12px 32px rgba(15, 24, 22, 0.25);
  font-size: 12px;
  opacity: 0;
  transform: translate(-50%, -12px);
  transition: opacity 150ms ease, transform 150ms ease;
  pointer-events: none;
}

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

@media (max-width: 1380px) {
  .app-header {
    grid-template-columns: auto minmax(220px, 1fr) auto;
    gap: 12px;
  }

  .brand small,
  .project-control .save-state,
  .button--quiet span {
    display: none;
  }

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

  .workspace {
    grid-template-columns: 230px minmax(0, 1fr) 270px;
  }

  .toolbar-fields label:first-child {
    display: none;
  }
}

@media (max-width: 900px) {
  html,
  body {
    overflow: auto;
  }

  .app-shell {
    min-height: 100%;
    height: auto;
    grid-template-rows: auto auto;
  }

  .app-header {
    min-height: var(--header-height);
    grid-template-columns: 1fr auto;
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
  }

  .header-actions {
    grid-column: 2;
    grid-row: 1;
  }

  .project-control {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .workspace {
    display: flex;
    flex-direction: column;
  }

  .label-library,
  .inspector {
    border: 0;
  }

  .label-library {
    min-height: 390px;
    max-height: 52vh;
    border-bottom: 1px solid var(--line);
  }

  .sheet-workbench {
    min-height: 720px;
  }

  .sheet-toolbar {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
  }

  .sheet-set-control,
  .page-stepper {
    width: 100%;
  }

  .page-stepper { justify-content: space-between; }

  .toolbar-fields {
    width: 100%;
    justify-content: space-between;
  }

  .sheet-stage {
    justify-content: flex-start;
  }

  .inspector {
    min-height: 520px;
  }

  .brand-footer { min-height: 58px; padding-block: 10px; grid-template-columns: 1fr auto; }
  .brand-footer span:nth-child(2) { display: none; }
}

@media (max-width: 520px) {
  .app-header {
    padding: 10px 12px;
  }

  .brand strong {
    font-size: 21px;
  }

  .header-actions .button span,
  .header-actions .button--quiet {
    display: none;
  }

  .header-actions .button {
    width: 40px;
    padding: 0;
  }

  .sheet-toolbar {
    padding: 10px 12px;
  }

  .toolbar-fields input[type="range"] {
    width: 86px;
  }

  .toolbar-fields label:last-child {
    display: none;
  }

  .sheet-stage {
    padding: 18px 14px 44px;
  }

  .dialog-shell > footer {
    align-items: stretch;
    flex-direction: column;
  }

  .dialog-shell > footer > div {
    justify-content: flex-end;
  }

  .compact-dialog { grid-template-columns: 1fr; }
  .compact-dialog > header,
  .compact-dialog > footer { grid-column: 1; }
  .compact-dialog > footer { grid-template-columns: 1fr 1fr; }
  .compact-dialog > footer span { display: none; }
  .sheet-typography { grid-template-columns: 1fr 1fr; }
  .sheet-typography .sheet-format-field:first-of-type { grid-column: 1 / -1; }
  .sheet-reset-button { justify-self: start; }
  .typography-fields { grid-template-columns: 1fr; }
}

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