@font-face {
  font-family: "IC Anton";
  src: url("/graphic-creator/fonts/anton.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "IC Fraunces";
  src: url("/graphic-creator/fonts/fraunces.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "IC Kaushan Script";
  src: url("/graphic-creator/fonts/kaushan-script.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
.studio-home .studio-format-grid.studio-format-grid-graphics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 760px) {
  .studio-home .studio-format-grid.studio-format-grid-graphics { grid-template-columns: 1fr; }
}
.gc-dialog {
  color: var(--ic-text, #f3f7fb);
  background: var(--ic-panel, #1b2e42);
  border: 1px solid var(--ic-line, #40546a);
  border-radius: 16px;
  padding: 0;
  width: min(1060px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.gc-dialog::backdrop { background: rgb(3 11 22 / .76); }
.gc-dialog h2, .gc-dialog h3, .gc-dialog p { margin: 0; }
.gc-dialog h2 { font-size: clamp(1.24rem, 3vw, 1.65rem); }
.gc-dialog h3 { font-size: 1.08rem; }
.gc-dialog button, .gc-dialog select, .gc-dialog input:not([type=checkbox], [type=radio], [type=range]) { min-height: 44px; }
.gc-dialog button { max-width: 100%; }
.gc-dialog button[data-close] { flex: 0 0 44px; padding: 0; font-size: 1.4rem; }
.gc-header, .gc-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 16px 24px;
  background: var(--ic-nav, #101d30);
}
.gc-header { border-bottom: 1px solid var(--ic-line, #40546a); }
.gc-header p { margin-top: .33rem; color: var(--ic-muted, #adbdcb); }
.gc-footer { border-top: 1px solid var(--ic-line, #40546a); flex-wrap: wrap; }
.gc-footer[hidden] { display: none; }
.gc-body { padding: 20px 24px; display: grid; gap: 18px; min-width: 0; }
.gc-status:not(:empty) { padding: .85rem 24px 0; overflow-wrap: anywhere; }
.gc-status.gc-error, .gc-preview-error, .gc-candidate-error { color: #ffc0b6; }
.gc-section, .gc-start, .gc-dialog fieldset { display: grid; gap: 14px; min-width: 0; }
.gc-start { padding: 24px; border: 1px solid var(--ic-line, #40546a); border-radius: 12px; background: #15263a; }
.gc-dialog fieldset {
  border: 1px solid var(--ic-line, #40546a);
  padding: 14px;
  border-radius: 9px;
  margin: 0;
}
.gc-dialog fieldset legend { font-weight: 650; padding: 0 .45rem; }
.gc-grid, .gc-purpose, .gc-template-grid, .gc-concepts, .gc-mask-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.gc-colors { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gc-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.gc-field { display: grid; gap: 6px; min-width: 0; }
.gc-field > span { font-size: .9rem; font-weight: 600; }
.gc-field:is(input,select,textarea), .gc-field :is(input,select,textarea) { min-width: 0; width: 100%; max-width: 100%; font-size: max(16px, 1rem); }
.gc-field textarea { resize: vertical; }
.gc-field input[type=color] { padding: 4px; }
.gc-check { display: flex; align-items: center; min-height: 44px; gap: .5rem; font-size: .88rem; }
.gc-check input, .gc-choice input { flex: none; accent-color: #67ddcb; }
.gc-steps ol { list-style: none; padding: 0; margin: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.gc-dialog .gc-steps li > button { display: flex; min-height: 36px; background: transparent; border: 0; align-items: center; gap: .35rem; padding: 5px 8px; color: var(--ic-muted, #adbdcb); font-size: .8rem; }
.gc-steps li[aria-current=step] { color: #effdf8; background: #254758; border-radius: 6px; }
.gc-steps li button > span:first-child { display: grid; place-items: center; flex: none; width: 22px; height: 22px; border: 1px solid currentColor; border-radius: 50%; }
.gc-choice {
  display: flex; gap: .55rem; align-items: flex-start; min-width: 0; padding: 12px;
  border: 1px solid var(--ic-line, #40546a); border-radius: 9px; cursor: pointer;
}
.gc-choice input { margin-top: 4px; }
.gc-choice:has(input:checked) { border-color: #7edecf; background: #244353; }
.gc-choice span span, .gc-projects li span, .gc-brand-assets li span { display: block; color: var(--ic-muted, #adbdcb); font-size: .85rem; margin-top: .24rem; overflow-wrap: anywhere; }
.gc-projects, .gc-brand-assets ul { list-style: none; padding: 0; margin: 10px 0 0; }
.gc-projects li, .gc-brand-assets li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--ic-line, #40546a); overflow-wrap: anywhere; }
.gc-projects li > * { min-width: 0; }
.gc-assets li .gc-field { margin-left: auto; }
.gc-note { background: #1d3d4a; padding: 12px; border-left: 3px solid #72d9c6; border-radius: 5px; }
.gc-dialog summary { padding: .5rem 0; cursor: pointer; min-height: 44px; }
.gc-template { display: grid; text-align: left; gap: 5px; padding: 10px; }
.gc-template-thumb { display: grid; align-content: center; justify-items: start; padding: 10px 16%; gap: 6px; height: 80px; background: #18374a; border-radius: 5px; }
.gc-template-thumb i { width: 42%; height: 4px; background: #e2d4b7; border-radius: 1px; }
.gc-template-thumb i:first-child { height: 8px; width: 73%; background: #77d7bf; }
.gc-template-spotlight { justify-items: center; background: #45364b; }
.gc-template-split { padding-left: 53%; background: linear-gradient(90deg,#99684d 45%,#2b3445 45%); }
.gc-editor { display: grid; grid-template-columns: minmax(0, 1.16fr) minmax(0, 1fr); align-items: start; gap: 16px; }
.gc-editor-tools, .gc-concepts article { display: grid; gap: 12px; min-width: 0; }
.gc-preview-panel { position: sticky; top: 0; min-width: 0; padding: 8px; border: 1px solid var(--ic-line, #40546a); border-radius: 9px; background: #122236; }
.gc-preview, .gc-mask-grid canvas {
  display: block; max-width: 100%; width: 100%; height: auto; object-fit: contain; margin: 0 auto;
  background: repeating-conic-gradient(#4c5764 0% 25%, #344252 0% 50%) 50% / 16px 16px;
}
.gc-preview { width: auto; max-height: 68dvh; }
.gc-concepts { grid-template-columns: repeat(auto-fit,minmax(min(100%,185px),1fr)); align-items: end; }
.gc-concepts canvas { max-height: 440px; }
.gc-concepts article h4 { margin: 0; font-size: .95rem; }
.gc-mask-grid canvas { max-height: 55dvh; width: auto; }
.gc-mask-grid h3 { margin-bottom: .4rem; }
[data-mask-source] { cursor: crosshair; touch-action: manipulation; }
.gc-preview-error:not(:empty), .gc-candidate-error:not(:empty) { padding: 8px 0; }
@media (max-width: 720px) {
  .gc-editor { grid-template-columns: minmax(0,1fr); }
  .gc-preview-panel { position: static; }
  .gc-preview { max-height: 49dvh; }
}
@media (max-width: 510px) {
  .gc-dialog { width: calc(100vw - 12px); max-width: none; max-height: calc(100dvh - 12px); }
  .gc-header, .gc-footer, .gc-body { padding: 12px; }
  .gc-footer { padding-bottom: max(12px,env(safe-area-inset-bottom)); }
  .gc-status:not(:empty) { padding: 8px 12px 0; }
  .gc-grid:not(.gc-colors), .gc-purpose { grid-template-columns: minmax(0,1fr); }
  .gc-steps ol { gap: 2px; }
  .gc-dialog .gc-steps li > button { padding: 3px 8px; min-height: 44px; }
  .gc-steps li:not([aria-current=step]) .gc-step-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .gc-step-label { max-width: 128px; }
  .gc-projects li { align-items: start; }
  .gc-assets li .gc-field { margin-left: 0; }
  .gc-footer .gc-inline { gap: 5px; }
  .gc-footer button { padding-inline: 9px; }
}

.gc-preview-stage { position: relative; width: fit-content; max-width: 100%; margin-inline: auto; }
.gc-preview-stage .gc-preview { touch-action: none; cursor: grab; }
.gc-preview-stage .gc-preview:active { cursor: grabbing; }
.gc-layer-outline { position: absolute; pointer-events: none; border: 2px solid #72e1d2; box-shadow: 0 0 0 1px #102033; }
.gc-layer-outline i { position: absolute; right: 0; bottom: 0; width: 14px; height: 14px; background: #72e1d2; border: 1px solid #102033; }

.gc-dialog .gc-steps li[aria-current=step] > button { color: inherit; }

.gc-image-counter { color: var(--ic-muted, #adbdcb); font-size: .82rem; text-align: right; }
.gc-header > .gc-inline { flex: 0 0 auto; flex-wrap: nowrap; }
.gc-header .gc-image-counter { max-width: 10em; }

.gc-brand-palette { grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); }
.gc-brand-palette input[type=color] { width: 100%; height: 44px; }

.gc-brand-drop { position: relative; display: grid; place-content: center; gap: .35rem; min-height: 148px; padding: 1rem; text-align: center; border: 2px dashed #668195; border-radius: 10px; background: #122638; cursor: pointer; }
.gc-brand-drop:hover, .gc-brand-drop.is-dragging, .gc-brand-drop:focus-within { border-color: #9de6d9; background: #204258; }
.gc-brand-drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.gc-brand-drop-icon { font-size: 2rem; line-height: 1; }
.gc-brand-drop span:not(.gc-brand-drop-icon) { color: #bdd0df; font-size: .85rem; }

.gc-brand-image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); gap: 10px; }
.gc-brand-image { display: grid; gap: 6px; max-width: 180px; }
.gc-brand-preview { display: grid; min-width: 0; aspect-ratio: 1; place-items: center; overflow: hidden; background: #0e2031; border-radius: 6px; }
.gc-brand-preview img { display: block; width: 100%; height: 100%; object-fit: contain; }
.gc-brand-preview img[hidden], .gc-brand-preview span[hidden] { display: none; }
.gc-brand-preview span { padding: .4rem; overflow-wrap: anywhere; font-size: .8rem; }
.gc-dialog button.gc-brand-image-choice { padding: 4px; min-width: 0; }
.gc-brand-image-choice:focus-visible { outline: 2px solid #9de6d9; outline-offset: 2px; }
.gc-brand-preview:has(img:not([hidden])) { background: repeating-conic-gradient(#c2c9cf 0% 25%, #e8ebee 0% 50%) 50% / 16px 16px; }

.gc-dialog fieldset.gc-brand-sections {
  gap: clamp(14px, 2vw, 24px);
  padding: 0;
  border: 0;
  background: transparent;
}
.gc-brand-sections > .gc-brand-panel {
  --gc-panel-accent: #87c8bb;
  min-width: 0;
  padding: clamp(14px, 2.2vw, 24px);
  border: 1px solid var(--ic-line, #40546a);
  border-top: 3px solid var(--gc-panel-accent);
  border-radius: 12px;
  background: #15283a;
}
.gc-brand-sections > .gc-brand-panel:nth-child(even) { background: #1b3044; }
.gc-brand-sections [data-brand-panel="pdf"],
.gc-brand-sections [data-brand-panel="fonts"] { --gc-panel-accent: #91b9df; }
.gc-brand-sections [data-brand-panel="primaryPalette"],
.gc-brand-sections [data-brand-panel="secondaryPalette"] { --gc-panel-accent: #d8b780; }
.gc-brand-sections [data-brand-panel="logos"],
.gc-brand-sections [data-brand-panel="references"] { --gc-panel-accent: #b5addc; }
.gc-brand-sections .gc-brand-panel > h3 {
  margin: 0;
  padding-bottom: .65rem;
  border-bottom: 1px solid var(--ic-line, #40546a);
}
.gc-brand-sections .gc-brand-panel > p { overflow-wrap: anywhere; }
