@font-face {
  font-family: 'MCCS Bodoni';
  src: url('fonts/BodoniModa.ttf') format('truetype');
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: 'MCCS Instrument';
  src: url('fonts/InstrumentSans.ttf') format('truetype');
  font-weight: 400 700;
  font-display: swap;
}

.mccs-gc {
  --gc-paper: #fffdf8;
  --gc-ink: #192c23;
  --gc-muted: #4d6254;
  --gc-line: #c8d5ca;
  --gc-selected: #e7f1e8;
  box-sizing: border-box;
  padding: clamp(14px, 3vw, 24px);
  color: var(--gc-ink);
  background: var(--gc-paper);
  border: 1px solid var(--gc-line);
  border-radius: 14px;
  font: 14px/1.45 system-ui, sans-serif;
  margin-block: 1rem;
}
.mccs-gc *, .mccs-gc *::before, .mccs-gc *::after { box-sizing: border-box; }
.mccs-gc [hidden] { display: none !important; }
.mccs-gc h2 {
  color: inherit;
  font: 500 clamp(24px, 4vw, 34px)/1.15 Georgia, serif;
  margin: 0 0 15px;
}
.mccs-gc-editor { container-type: inline-size; }
.mccs-gc-editor h2 { border-bottom: 1px solid var(--gc-line); padding-bottom: 14px; }
.mccs-gc-grid {
  display: grid;
  grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr);
  align-items: start;
  gap: clamp(14px, 3vw, 24px);
}
.mccs-gc-fields, .mccs-gc [data-gc-digital] { display: grid; gap: 12px; min-width: 0; }
.mccs-gc fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.mccs-gc legend { padding: 0; margin-bottom: 4px; font: inherit; font-weight: 600; color: inherit; }
.mccs-gc label { display: grid; gap: 4px; margin: 0; min-width: 0; font: inherit; font-weight: 600; }
.mccs-gc .mccs-gc-amounts > div > label { margin-bottom: 4px; }
.mccs-gc input:not([type=radio]), .mccs-gc select, .mccs-gc textarea {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 7px 9px;
  margin: 0;
  background: var(--gc-paper);
  color: var(--gc-ink);
  border: 1px solid var(--gc-line);
  border-radius: 6px;
  font: 400 16px/1.3 system-ui, sans-serif;
  box-shadow: none;
}
.mccs-gc textarea { resize: vertical; }
.mccs-gc select { padding-inline-end: 18px; font-size: 14px; }
.mccs-gc-options, .mccs-gc-names, .mccs-gc-amounts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.mccs-gc-amounts:has([data-gc-custom][hidden]) { grid-template-columns: 1fr; }
.mccs-gc-options label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 5px 7px;
  border: 1px solid var(--gc-line);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
}
.mccs-gc-options label:has(:checked) { background: var(--gc-selected); border-color: var(--gc-muted); }
.mccs-gc input[type=radio] { margin: 0; accent-color: var(--gc-ink); }
.mccs-gc-preview { min-width: 0; margin: 0; }
.mccs-gc-preview figcaption { margin: 0 0 6px; font-weight: 600; }
.mccs-gc-art {
  --art-paper: #fff;
  --art-ink: #17221a;
  position: relative;
  aspect-ratio: 1000 / 630;
  width: 100%;
  container-type: inline-size;
  border-radius: 10px;
  overflow: hidden;
  background: var(--art-paper);
  color: var(--art-ink);
  outline: 1px solid var(--gc-line);
}
.mccs-gc-art[data-template=green] { --art-paper: #1e3d2e; --art-ink: #fff9e9; }
.mccs-gc-art[data-template=physical] { --art-paper: #f2eee3; --art-ink: #1e3d2e; }
.mccs-gc-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.mccs-gc-mask { display: none; position: absolute; inset: 73% 8.1% 8.3% 40%; background: var(--art-paper); }
.mccs-gc-art[data-preliminary=true] .mccs-gc-mask { display: block; }
.mccs-gc-print {
  position: absolute;
  inset: 47% 8.2% 8.4% 38.5%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: max(1px, .5cqw);
  text-align: right;
  overflow-wrap: anywhere;
}
.mccs-gc-print > * { flex-shrink: 0; }
.mccs-gc-to, .mccs-gc-from { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mccs-gc-to { font: italic 500 clamp(11px, 4.65cqw, 22px)/1.04 Georgia, serif; }
.mccs-gc-value { font: 700 clamp(14px, 5.9cqw, 36px)/1 Georgia, serif; white-space: nowrap; }
.mccs-gc-note, .mccs-gc-from { font: 400 clamp(11px, 3cqw, 14px)/1.1 system-ui, sans-serif; }
.mccs-gc-note { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-style: italic; }
.mccs-gc-physical-brand {
  position: absolute;
  top: 10%;
  left: 8%;
  display: grid;
  gap: 3px;
  font: 500 11px/1.3 system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: .07em;
}
.mccs-gc-physical-brand span { font: 500 clamp(18px, 6.5cqw, 30px)/1 Georgia, serif; letter-spacing: 0; }
.mccs-gc-field-note { margin: -6px 0 0; color: #4f534b; font-size: 12px; }
.mccs-gc-art[data-template=physical] .mccs-gc-print { inset-inline-start: 8.2%; }
.mccs-gc-total {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--gc-line);
}
.mccs-gc-total strong { font-variant-numeric: tabular-nums; }
.mccs-gc.mccs-gc-balance { font-family: 'MCCS Instrument', 'Helvetica Neue', Arial, sans-serif; }
.mccs-gc.mccs-gc-balance h2 {
  font-family: 'MCCS Bodoni', Didot, Georgia, serif;
  font-variation-settings: "opsz" 16;
}
.mccs-gc-balance p { margin: 0 0 12px; }
.mccs-gc-balance form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 8px;
}
.mccs-gc-balance button {
  background: var(--gc-ink);
  color: var(--gc-paper);
  border: 0;
  border-radius: 6px;
  font: 600 14px/1.3 'MCCS Instrument', 'Helvetica Neue', Arial, sans-serif;
  padding: 10px 14px;
  min-height: 42px;
}
.mccs-gc.mccs-gc-balance input:not([type=radio]) { font-family: inherit; }
.mccs-gc-balance button:disabled { opacity: .65; }
.mccs-gc-balance .mccs-gc-result {
  margin: 12px 0 0;
  padding: 10px 12px;
  background: var(--gc-selected);
  border-radius: 6px;
}
.mccs-gc-result[data-error=true] { background: #f8ece8; color: #7c2e26; }
@container (max-width: 540px) {
  .mccs-gc-grid { grid-template-columns: minmax(0, 1fr); }
  .mccs-gc-preview { grid-row: 1; }
}
@media (max-width: 700px) {
  .mccs-gc-balance form { grid-template-columns: minmax(0, 1fr); }
}
@media (pointer: coarse) {
  .mccs-gc-options label, .mccs-gc input:not([type=radio]), .mccs-gc select, .mccs-gc-balance button { min-height: 44px; }
}
