@font-face {
  font-family: "Burbank CK";
  src: local("BurbankBigCondensed-Black"), local("Burbank Big Condensed Black");
}

@font-face {
  font-family: "Peace Sans";
  src: url("/assets/peace-sans.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Google Sans Flex";
  src: url("/assets/google-sans-flex-black.ttf") format("truetype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Google Sans Flex";
  src: url("/assets/peace-sans.otf") format("opentype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0400-052F, U+2DE0-2DFF, U+A640-A69F;
}

@font-face {
  font-family: "Fira Sans Extra Condensed Black";
  src: url("/assets/fira-sans-extra-condensed-black.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Oswald";
  src: url("/assets/oswald.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Sofia Sans Extra Condensed";
  src: url("/assets/sofiasansextracondensed.ttf") format("truetype");
  font-weight: 900;
  font-display: swap;
}

@font-face {
  font-family: "Rubik";
  src: url("/assets/rubik.ttf") format("truetype");
  font-weight: 900;
  font-display: swap;
}

@font-face {
  font-family: "Nunito";
  src: url("/assets/nunito.ttf") format("truetype");
  font-weight: 900;
  font-display: swap;
}

@font-face {
  font-family: "Overpass";
  src: url("/assets/overpass.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Itim";
  src: url("/assets/itim.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Itim";
  src: url("/assets/rubik.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0400-052F;
}

@font-face {
  font-family: "Merienda";
  src: url("/assets/merienda.ttf") format("truetype");
  font-weight: 300 900;
  font-display: swap;
}

@font-face {
  font-family: "Merienda";
  src: url("/assets/rubik.ttf") format("truetype");
  font-weight: 300 900;
  font-display: swap;
  unicode-range: U+0400-052F;
}

@font-face {
  font-family: "Lobster";
  src: url("/assets/lobster.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Cinzel";
  src: url("/assets/cinzel.ttf") format("truetype");
  font-weight: 400 900;
  font-display: swap;
}

@font-face {
  font-family: "Cinzel";
  src: url("/assets/rubik.ttf") format("truetype");
  font-weight: 400 900;
  font-display: swap;
  unicode-range: U+0400-052F;
}

@font-face {
  font-family: "Jersey 10";
  src: url("/assets/jersey10.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Jersey 10";
  src: url("/assets/rubik.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0400-052F;
}

@font-face {
  font-family: "Russo One";
  src: url("/assets/russoone.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Alfa Slab One";
  src: url("/assets/alfaslabone.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Alfa Slab One";
  src: url("/assets/rubik.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0400-052F;
}

@font-face {
  font-family: "Caveat Brush";
  src: url("/assets/caveatbrush.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Caveat Brush";
  src: url("/assets/rubik.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0400-052F;
}

:root {
  --base: #faf8f3;
  --ink: #292c26;
  --muted: #62655d;
  --line: #dddcd1;
  --accent: #83374b;
  --active: #f6eaf0;
  --danger: #923c36;
  --paper: #fffefa;
  --green: #41594c;
  --serif: "Instrument Serif",Georgia,"Times New Roman",serif;
  --sans: "DM Sans","Segoe UI",Arial,sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font: 15px/1.45 var(--sans);
  background: var(--base);
}

html.layout-scroll-locked, .layout-scroll-locked body {
  overflow: hidden;
  overscroll-behavior: none;
}

.layout-scroll-locked body {
  position: fixed;
  top: var(--layout-scroll-offset, 0px);
  width: 100%;
}

.layout-scroll-locked .preview, .layout-scroll-locked #graphic-size {
  touch-action: none;
}

h1,h2,h3,p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,input {
  font: inherit;
  color: inherit;
}

html,body,button,a {
  touch-action: manipulation;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: .48;
}

button:focus-visible,a:focus-visible,input:focus-visible,canvas:focus-visible {
  outline: 3px solid #648877;
  outline-offset: 3px;
}

svg {
  display: block;
  flex-shrink: 0;
}

button {
  background: none;
}

button,input {
  border-radius: 7px;
}

input[type=text],input[type=number],input[type=search] {
  min-width: 0;
  width: 100%;
  border: 1px solid #d3d2c7;
  background: #fffefa;
  padding: 9px 11px;
}

input::placeholder {
  color: #77796f;
}

input[type=number] {
  appearance: textfield;
  -moz-appearance: textfield;
}

input::-webkit-inner-spin-button {
  appearance: none;
}

[hidden] {
  display: none!important;
}

.top {
  border-bottom: 1px solid var(--line);
  background: #fffdf8;
}

.top-inner,main,footer {
  width: min(1216px,calc(100% - 96px));
  margin: auto;
}

.top-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 5px;
  letter-spacing: -1.25px;
  font: 600 25px/1 var(--serif);
  white-space: nowrap;
}

.brand i {
  font-weight: 400;
  color: var(--accent);
}

.brand-mark {
  display: grid;
  place-items: center;
  background: #f4e0dd;
  color: #7e3741;
  border-radius: 12px;
  width: 39px;
  height: 39px;
  margin-right: 7px;
}

.brand-mark svg {
  width: 27px;
  height: 27px;
}

nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-weight: 600;
  font-size: 14px;
}

nav>a:not(.bag) {
  position: relative;
  padding: 6px 0;
}

nav>a[aria-current=page]:not(.bag) {
  color: var(--accent);
}

nav>a[aria-current=page]:not(.bag):after {
  content: "";
  height: 2px;
  background: var(--accent);
  position: absolute;
  bottom: -3px;
  left: 0;
  right: 0;
}

.bag,.small-btn,.secondary,.text-link,.primary,.paper-label,.selected-pattern,.under,.panel-head h2,.fit-options,.section-heading,.card-content,.meta,.actions,.filter-row,.foot-brand {
  display: flex;
  align-items: center;
}

.bag {
  background: #f1eee6;
  border: 1px solid #e2dfd3;
  border-radius: 23px;
  gap: 8px;
  padding: 8px 12px;
}

.bag b {
  background: #fffdf9;
  border-radius: 20px;
  min-width: 22px;
  text-align: center;
  font-size: 12px;
  padding: 1px 5px;
}

.bag[aria-current=page] {
  border-color: #ab7b85;
}

main {
  min-height: calc(100vh - 165px);
  padding-bottom: 50px;
}

.intro {
  padding: 34px 0 25px;
}

.intro h1 {
  font: 400 clamp(40px,4.4vw,62px)/1.05 var(--serif);
  letter-spacing: -2.7px;
}

.intro h1 em {
  color: var(--accent);
  font-weight: 400;
}

.intro p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 15px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0,1.28fr) minmax(355px,1fr);
  gap: 24px;
  align-items: start;
}

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 15px;
  overflow: hidden;
}

.panel-head,.settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-head {
  padding: 14px 19px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  font: 600 15px var(--sans);
  gap: 9px;
}

.panel-head h2 svg {
  color: var(--green);
}

.tag,.paper-label {
  font-size: 12px;
  white-space: nowrap;
}

.tag {
  color: var(--green);
  background: #e9eee3;
  padding: 3px 10px;
  border-radius: 14px;
  font-weight: 600;
}

.stage {
  height: clamp(375px,36vw,450px);
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background-color: #e9eddf;
  background-image: linear-gradient(90deg,#7c967317 1px,transparent 1px),linear-gradient(#7c967317 1px,transparent 1px);
  background-size: 17px 17px;
  overflow: hidden;
}

.sheet-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 0;
}

.sheet-toolbar {
  position: absolute;
  top: 9px;
  left: 14px;
}

.layout-stage .sheet-toolbar {
  position: static;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 14px 0;
}

.sheet-layout-actions {
  display: flex;
  flex: none;
  gap: 6px;
}

.sheet-orientation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 88px;
  min-height: 44px;
  padding: 6px 10px;
  border: 1px solid #aeb9a6;
  background: #f6f8f0;
  color: var(--green);
  font-size: 13px;
  font-weight: 650;
}

.sheet-orientation:hover {
  background: #fffefa;
}

.sheet-icon-button {
  min-width: 44px;
}

#toggle-layout-guide {
  font-size: 16px;
}

#toggle-layout-scroll[aria-pressed=true] {
  background: var(--active);
  border-color: #c594a1;
  color: var(--accent);
}

#toggle-layout-guide[aria-pressed=true] {
  background: #dde8d7;
  border-color: #7d9076;
}

.sheet-label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #41594c;
  font-size: 11px;
  font-weight: 600;
}

.sheet-label svg {
  width: 14px;
  height: 14px;
}

.sheet {
  position: relative;
  display: grid;
  place-items: center;
  background: #fffefa;
  border-radius: 2px;
  box-shadow: 0 4px 14px #39493424, 0 0 0 1px #b3bca8;
}

#print-area {
  position: absolute;
  border: 1px dashed #a7b29b;
  pointer-events: none;
}

#layout-guide {
  position: absolute;
  background: #dde8d780;
  pointer-events: none;
}

#layout-guide::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: auto 0 0;
  height: 2px;
  background: repeating-linear-gradient(90deg, #567255 0 6px, #fffefa 6px 10px);
}

#layout-guide.landscape::after {
  inset: 0 auto 0 0;
  width: 2px;
  height: auto;
  background: repeating-linear-gradient(#567255 0 6px, #fffefa 6px 10px);
}

#empty-preview {
  max-width: 84%;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

#art-wrap {
  position: relative;
  background: #f8f5e9;
}

#art-wrap.circle {
  border-radius: 50%;
}

#art-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px #50674960;
  pointer-events: none;
}

#art {
  width: 100%;
  height: 100%;
  display: block;
}

#art.movable {
  cursor: grab;
  touch-action: none;
}

#art.dragging {
  cursor: grabbing;
}

.ruler {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #506447;
  pointer-events: none;
}

.ruler:before {
  content: "";
  position: absolute;
}

.ruler-width {
  bottom: -18px;
  width: 100%;
  height: 7px;
  border-inline: 1px solid #798a72;
}

.ruler-width:before {
  top: 50%;
  width: 100%;
  border-top: 1px solid;
}

.ruler-height {
  top: 0;
  right: -18px;
  width: 7px;
  height: 100%;
  border-block: 1px solid #798a72;
}

.ruler-height:before {
  left: 50%;
  height: 100%;
  border-left: 1px solid;
}

.ruler span {
  background: #f4f6ec;
  border-radius: 3px;
  position: relative;
  padding: 0 4px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.ruler-height span {
  writing-mode: vertical-rl;
  padding: 4px 0;
}

#layout-layer {
  position: absolute;
}

.layout-graphic {
  position: absolute;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 0;
  touch-action: none;
  cursor: grab;
}

.layout-graphic img {
  position: absolute;
  left: 50%;
  top: 50%;
  max-width: none;
  pointer-events: none;
}

.layout-graphic[aria-pressed=true] {
  outline: 2px solid var(--accent);
}

.layout-graphic.outside-print {
  outline: 2px solid #a73624;
}

.layout-graphic:not([aria-pressed=true]) .ruler {
  display: none;
}

.layout-tools {
  padding: 12px 16px 16px;
}

.layout-help {
  margin-top: 6px;
  font-size: 13px;
}

.layout-help summary {
  cursor: pointer;
  padding: 12px 0;
  color: var(--accent);
  font-weight: 650;
}

.layout-help ol {
  margin: 0;
  padding-inline-start: 23px;
}

.layout-help li + li {
  margin-top: 6px;
}

.layout-toolbar, .graphic-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

#graphic-controls:not([hidden]) ~ .layout-toolbar {
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 12px;
}

.layout-toolbar button, .graphic-actions button {
  gap: 6px;
  min-height: 44px;
  font-size: 14px;
}

#add-graphic {
  border-color: #c594a1;
  background: var(--active);
  color: var(--accent);
}

#add-graphic:hover:not(:disabled), #add-graphic:active:not(:disabled) {
  background: #f0dce5;
}

.graphic-size-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.graphic-size-heading .label {
  flex-shrink: 0;
  margin: 0;
}

#graphic-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--muted);
}

#graphic-hint {
  margin-top: 0;
}

#graphic-size {
  display: block;
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 44px;
  margin: 0;
  background: transparent;
  cursor: ew-resize;
  touch-action: pan-y;
}

#graphic-size::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: var(--line);
}

#graphic-size::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: var(--line);
}

#graphic-size::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  margin-top: -10px;
  border-radius: 50%;
  background: var(--accent);
}

#graphic-size::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
}

#graphic-size:disabled {
  opacity: 0.55;
  cursor: default;
}

.graphic-actions {
  margin-top: 8px;
}

.graphic-actions .secondary {
  padding-inline: 9px;
}

.graphic-dimensions .field {
  margin-top: 10px;
}

.preview-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 12px 17px;
}

.zoom-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
}

.zoom-stepper {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.zoom-stepper output {
  font-size: 13px;
  min-width: 36px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.icon-btn {
  width: 33px;
  height: 33px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
}

.preview-tools .icon-btn {
  flex: none;
  width: 44px;
  height: 44px;
  background: var(--base);
}

.preview-tools .icon-btn:active:not(:disabled) {
  background: var(--active);
}

.under {
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  padding: 10px 3px;
}

.under svg {
  width: 15px;
  height: 15px;
}

.settings {
  padding: 19px 22px 21px;
}

.settings-head h2,.section-heading h2,.summary h2,.cart-content h2,.empty h2 {
  font: 400 29px/1.15 var(--serif);
  letter-spacing: -1px;
}

.paper-label {
  color: var(--muted);
  gap: 5px;
}

.paper-label svg {
  width: 14px;
}

.source-tabs {
  display: flex;
  gap: 3px;
  padding: 4px;
  background: #efeee6;
  border-radius: 8px;
  margin: 14px 0 12px;
}

.source-tabs>* {
  flex: 1;
  border: 0;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 2px;
}

.source-tabs .selected {
  background: #fffefa;
  box-shadow: 0 1px 4px #292c2620;
  color: var(--accent);
}

.upload-zone {
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1.5px dashed #c1b8b6;
  background: #fcf8f5;
  padding: 12px;
  border-radius: 8px;
}

.upload-zone.over {
  border-color: var(--accent);
  background: #f3e4eb;
}

.upload-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: #f1e6e3;
  border-radius: 9px;
  color: var(--accent);
}

.upload-info,.selected-pattern>div {
  flex: 1;
  min-width: 0;
}

.upload-info strong,.upload-info small,.selected-pattern strong,.selected-pattern small {
  display: block;
}

.upload-info strong,.selected-pattern strong {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-info small,.selected-pattern small,.caption-note,.field-note {
  font-size: 12px;
  color: var(--muted);
}

.small-btn,.secondary {
  border: 1px solid #d5d1c8;
  background: #fffefa;
  justify-content: center;
  padding: 7px 12px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.library-back {
  display: inline-flex;
  gap: 8px;
  min-height: 40px;
  margin-bottom: 12px;
}

.small-btn:hover,.secondary:hover,.icon-btn:hover,.stepper button:hover {
  background: #f3eee6;
}

.selected-pattern {
  gap: 10px;
  border: 1px solid var(--line);
  padding: 5px 8px 5px 5px;
  border-radius: 9px;
}

.selected-pattern img {
  height: 48px;
  width: 48px;
  border-radius: 7px;
  object-fit: cover;
}

.field {
  display: block;
  margin-top: 14px;
}

.label {
  display: block;
  font-size: 13px;
  font-weight: 650;
  margin-bottom: 6px;
}

.label small {
  color: var(--muted);
  font-weight: 400;
  margin-left: 4px;
}

.shape-options,.fit-options {
  display: flex;
  gap: 6px;
}

.shape-options button,.fit-options button,.filter-row button {
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 13px;
  background: #fffefa;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.shape-options button {
  flex: 1;
}

.shape-options button[aria-pressed=true],.fit-options button[aria-pressed=true],.filter-row button[aria-pressed=true] {
  color: var(--accent);
  background: #f8edef;
  border-color: #c594a1;
  font-weight: 650;
}

.shape-options button svg {
  width: 16px;
  height: 16px;
}

.dim-row {
  display: flex;
  align-items: end;
  gap: 12px;
}

.dim-row .field {
  flex: 1;
  min-width: 0;
  max-width: 185px;
}

.field-note {
  margin-top: 6px;
}

.error.dim-error {
  margin-top: 6px;
}

.unit-field input[aria-invalid=true] {
  border-color: #bc7666;
}

.unit-field {
  position: relative;
  display: flex;
  align-items: center;
}

.unit-field>span {
  position: absolute;
  right: 12px;
  font-size: 12px;
  color: var(--muted);
}

.unit-field input {
  padding-right: 32px;
}

.caption-note {
  display: block;
  margin-top: 4px;
}

.add-row {
  display: flex;
  gap: 12px;
  align-items: end;
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 12px;
}

.stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.stepper button {
  border: 0;
  border-radius: 7px;
  width: 30px;
  height: 34px;
  display: grid;
  place-items: center;
}

.stepper button svg {
  width: 14px;
}

.stepper output {
  min-width: 24px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
}

.primary {
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 650;
  min-height: 40px;
}

.primary:hover {
  background: #713044;
}

.add-row .primary {
  flex: 1;
}

.error {
  font-size: 13px;
  background: #fcf0e9;
  color: #953722;
  border-radius: 5px;
  padding: 8px;
  margin-top: 10px;
}

.library-strip {
  margin-top: 28px;
}

.section-heading {
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 15px;
}

.text-link {
  border: 0;
  color: var(--accent);
  gap: 6px;
  font-size: 13px;
  font-weight: 650;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 16px;
}

.card {
  display: block;
  width: 100%;
  text-align: left;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  padding: 0;
}

.card:hover {
  border-color: #a86a7b;
}

.card-art {
  background-color: #efebdc;
  height: 140px;
  overflow: hidden;
}

.card-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 45%;
  transition: transform .2s;
}

.card:hover img {
  transform: scale(1.035);
}

.card-content {
  padding: 12px 15px;
  justify-content: space-between;
  gap: 7px;
}

.card-content strong {
  display: block;
  font: 400 21px var(--serif);
}

.card-content>svg {
  color: var(--accent);
}

.card-content > div {
  min-width: 0;
  overflow-wrap: anywhere;
}

.library-strip .card-art {
  height: clamp(130px, 17vw, 216px);
  background: #fff;
}

.library-examples .card-art {
  background: #fff;
}

.library-strip .card-art img,
.library-examples .card-art img {
  object-fit: contain;
  object-position: center;
}

.cards.full .card-art {
  height: clamp(170px,22vw,320px);
}

.library-search {
  max-width: 36rem;
  margin-bottom: 16px;
}

.library-search-row {
  display: flex;
  gap: 8px;
}

.library-search-row button {
  flex-shrink: 0;
}

#library-search::-webkit-search-cancel-button {
  appearance: none;
}

.library-results {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 14px;
}

.filter-row {
  gap: 8px;
  margin: 0 0 20px;
}

.filter-row button {
  border-radius: 24px;
  padding: 7px 17px;
}

.cart-layout {
  display: grid;
  grid-template-columns: minmax(0,1.6fr) minmax(270px,.8fr);
  gap: 22px;
  align-items: start;
}

.cart-content,.summary,.empty {
  padding: 22px;
}

.cart-content h2,.summary h2 {
  font-size: 25px;
  margin-bottom: 14px;
}

.twgr-preview {
  margin-top: 20px;
}

.twgr-sheet {
  margin: 16px 0;
}

.twgr-preview img,.twgr-approved {
  display: block;
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
  margin-top: 10px;
  border: 1px solid var(--line);
  background: #fff;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.thumb {
  display: grid;
  place-items: center;
  border-radius: 9px;
  width: 70px;
  height: 70px;
  background: #edf0e5;
  flex: none;
}

.thumb canvas {
  max-width: 58px;
  max-height: 58px;
}

.item-info {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.item-info strong,.item-info span,.item-info small {
  display: block;
}

.item-info span,.item-info small,.notes,.summary p,.empty p {
  font-size: 13px;
  color: var(--muted);
}

.actions {
  gap: 16px;
}

.actions .secondary {
  min-height: 44px;
  gap: 6px;
}

.actions .remove-project {
  width: 44px;
  height: 44px;
  border-color: #ead5cf;
  color: var(--danger);
}

.actions .remove-project:hover, .actions .remove-project:active {
  background: #fcf0e9;
}

.remove-project-dialog {
  width: min(420px, calc(100% - 28px));
  max-height: calc(100% - 28px);
  padding: 20px;
  color: var(--ink);
  overflow: auto;
}

.remove-project-dialog::backdrop {
  background: #292c265e;
}

.remove-project-dialog h2 {
  font-size: 21px;
}

#remove-project-summary {
  margin-top: 10px;
  overflow-wrap: anywhere;
}

#remove-project-details {
  font-size: 13px;
  color: var(--muted);
}

.remove-project-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.remove-project-actions button {
  min-height: 44px;
}

.remove-project-actions .primary {
  border-color: var(--danger);
  background: var(--danger);
}

.remove-project-actions .primary:hover {
  background: #7a2f2a;
}

.summary .primary,.summary .secondary,.empty .primary {
  margin-top: 16px;
}

.summary .primary {
  width: 100%;
}

.meta {
  justify-content: space-between;
  padding: 13px 0;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.meta strong {
  font-size: 20px;
}

.empty {
  text-align: center;
  padding: 40px;
}

.empty .primary {
  display: inline-flex;
}

.empty svg {
  margin: auto auto 12px;
  color: var(--accent);
}

.continue {
  display: inline-flex;
  margin-top: 14px;
}

.summary code {
  display: block;
  font-weight: 650;
  letter-spacing: 1px;
  color: var(--accent);
  font-size: clamp(16px,2vw,24px);
  overflow-wrap: anywhere;
}

.summary ol {
  padding-left: 21px;
  font-size: 14px;
}

.summary li {
  margin: 6px 0;
}

.summary .notes {
  margin-top: 12px;
}

footer {
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  font-size: 12px;
  color: var(--muted);
}

footer>div {
  display: flex;
  gap: 7px;
  align-items: center;
}

.foot-brand {
  color: var(--accent);
}

#toast {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  border-radius: 9px;
  background: #35493e;
  color: #fff;
  padding: 10px 18px;
  max-width: calc(100% - 24px);
  text-align: center;
  font-size: 14px;
}

@media(min-width:1450px) {
  .intro {
    padding-top: 45px;
    padding-bottom: 31px;
  }
}

@media(max-width:950px) {
  .top-inner,main,footer {
    width: calc(100% - 44px);
  }
  .workspace {
    grid-template-columns: minmax(0,1.05fr) minmax(320px,1fr);
    gap: 16px;
  }
  .settings {
    padding: 16px;
  }
  .preview-tools {
    gap: 7px;
  }
  .shape-options button {
    font-size: 12px;
    padding: 7px 4px;
  }
  nav {
    gap: 18px;
  }
  .upload-zone {
    gap: 7px;
    padding: 8px;
  }
  .upload-icon {
    display: none;
  }
}

@media (max-width: 720px), (max-width: 1100px) and (max-height: 550px) and (orientation: landscape) {
  .top-inner,main,footer {
    width: calc(100% - 28px);
  }
  .top-inner {
    min-height: 62px;
    gap: 10px;
  }
  .brand {
    font-size: 21px;
    letter-spacing: -1px;
  }
  .brand-mark {
    width: 30px;
    height: 32px;
    margin-right: 2px;
  }
  .brand-mark svg {
    width: 24px;
  }
  nav {
    gap: 8px;
  }
  nav>a:not(.bag) {
    display: none;
  }
  .bag {
    padding: 6px 9px;
    gap: 5px;
    font-size: 12px;
  }
  .intro {
    padding: 24px 0 17px;
  }
  .intro h1 {
    font-size: 43px;
    letter-spacing: -2px;
  }
  .intro p {
    font-size: 14px;
  }
  .workspace,.cart-layout {
    grid-template-columns: minmax(0,1fr);
    gap: 9px;
  }
  .stage {
    height: clamp(310px, 92vw, 385px);
  }
  .panel-head {
    padding: 10px 14px;
  }
  .preview-tools {
    padding: 8px 12px;
  }
  .settings {
    padding: 16px;
  }
  .upload-icon {
    display: grid;
  }
  .under {
    font-size: 11px;
    padding: 7px 2px;
  }
  .library-strip {
    margin-top: 23px;
  }
  .cards {
    gap: 10px;
  }
  .card-art {
    height: 95px;
  }
  .card-content {
    padding: 9px;
  }
  .card-content strong {
    font-size: 17px;
  }
  .card-content>svg {
    display: none;
  }
  .section-heading h2 {
    font-size: 24px;
  }
  .cards.full {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
  .cards.full .card-art {
    height: 145px;
  }
  .cart-content,.summary {
    padding: 16px;
  }
  .cart-item {
    gap: 9px;
    flex-wrap: wrap;
  }
  .item-info {
    min-width: 110px;
  }
  .actions {
    margin-left: auto;
  }
  .shape-options button {
    font-size: 13px;
  }
  .section-heading .text-link {
    font-size: 12px;
  }
}

@media(max-width:420px) {
  .zoom-label > span {
    display: none;
  }
  .top-inner,main,footer {
    width: calc(100% - 20px);
  }
  .brand {
    font-size: 20px;
  }
  .bag span:nth-child(2) {
    font-size: 11px;
  }
  .cards:not(.full) {
    grid-template-columns: 1fr;
  }
  .cards:not(.full) .card {
    display: flex;
    align-items: stretch;
  }
  .cards:not(.full) .card-art {
    width: 104px;
    height: 86px;
    flex-shrink: 0;
  }
  .cards:not(.full) .card-content {
    flex: 1;
  }
  .shape-options button {
    gap: 4px;
    font-size: 12px;
  }
  .cart-item .actions {
    width: 100%;
    justify-content: space-between;
  }
  footer {
    gap: 10px;
  }
  .upload-info small {
    font-size: 10px;
  }
}

@media(max-width:360px) {
  .top-inner {
    gap: 6px;
  }
  .bag span:nth-child(2) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .graphic-actions .secondary {
    gap: 4px;
    padding-inline: 6px;
    font-size: 13px;
  }
}

@media(max-width:380px) {
  .layout-stage #sheet-dimensions {
    display: none;
  }
}

.lookup {
  margin-top: 22px;
  max-width: 460px;
}

.lookup summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
}

.lookup form {
  margin-top: 12px;
}

.lookup label {
  display: block;
  font-size: 13px;
  margin-bottom: 5px;
}

.lookup form > div {
  display: flex;
  gap: 6px;
}

#see-preview {
  display: none;
}

@media (max-width: 720px), (max-width: 1100px) and (max-height: 550px) and (orientation: landscape) {
  #see-preview {
    display: flex;
    padding: 6px 0 0;
  }
}

@media (max-width: 1100px) and (max-height: 550px) and (orientation: landscape) {
  .stage {
    height: clamp(260px, 72svh, 340px);
  }
  .layout-scroll-locked .layout-stage {
    max-height: max(160px, calc(100dvh - 158px));
  }
}

@media (max-width: 720px), (pointer: coarse) {
  input[type=text],input[type=number],input[type=search] {
    font-size: 16px;
  }
}

.rotation-test {
  position: fixed;
  bottom: 8px;
  right: 8px;
  z-index: 20;
  max-width: calc(100% - 16px);
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font-size: 12px;
  white-space: pre-line;
  pointer-events: none;
}

