/* Graphica Designer */
@font-face { font-family: 'Cormorant Garamond'; font-weight: 400; font-style: normal; font-display: swap; src: url('../fonts/cormorant-garamond-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-weight: 500; font-style: normal; font-display: swap; src: url('../fonts/cormorant-garamond-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-weight: 400; font-style: italic; font-display: swap; src: url('../fonts/cormorant-garamond-latin-400-italic.woff2') format('woff2'); }
@font-face { font-family: 'Instrument Sans'; font-weight: 400; font-display: swap; src: url('../fonts/instrument-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Instrument Sans'; font-weight: 500; font-display: swap; src: url('../fonts/instrument-sans-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Great Vibes'; font-weight: 400; font-display: swap; src: url('../fonts/great-vibes-latin-400-normal.woff2') format('woff2'); }

.gd-app, .gd-modal, .gd-toast { --gd-ink: #1E2430; --gd-muted: #4A5260; --gd-line: #E2E0DA; --gd-bg: #F6F5F2; --gd-accent: #2F4B42; --gd-blue: #2563EB; }
.gd-modal *, .gd-modal *::before, .gd-modal *::after { box-sizing: border-box; }
.gd-app {
	font-family: 'Instrument Sans', system-ui, sans-serif; color: var(--gd-ink); background: var(--gd-bg); border: 1px solid var(--gd-line); border-radius: 12px; overflow: hidden; font-size: 15px; line-height: 1.45; }
.gd-app *, .gd-app *::before, .gd-app *::after { box-sizing: border-box; }
.gd-loading-msg, .gd-error { padding: 48px; text-align: center; color: var(--gd-muted); }
.gd-error { color: #9F1239; }

/* top bar */
.gd-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 12px 16px; background: #fff; border-bottom: 1px solid var(--gd-line); position: sticky; top: 0; z-index: 5; }
.gd-bar-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.gd-bar-end { margin-left: auto; }
.gd-bar-label { font-size: 13px; color: var(--gd-muted); }
.gd-save-state { font-size: 13px; color: var(--gd-muted); min-width: 92px; text-align: right; }
.gd-seg { display: inline-flex; border: 1px solid var(--gd-line); border-radius: 8px; overflow: hidden; }
.gd-seg-btn { border: 0; background: #fff; padding: 9px 14px; font: inherit; font-size: 14px; cursor: pointer; color: var(--gd-ink); min-height: 40px; }
.gd-seg-btn + .gd-seg-btn { border-left: 1px solid var(--gd-line); }
.gd-seg-btn[aria-pressed="true"] { background: var(--gd-accent); color: #fff; }

.gd-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--gd-ink); background: #fff; color: var(--gd-ink); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; text-decoration: none; }
.gd-btn:hover { background: var(--gd-bg); }
.gd-btn:disabled { opacity: .5; cursor: not-allowed; }
.gd-btn-primary { background: var(--gd-accent); border-color: var(--gd-accent); color: #fff; }
.gd-btn-primary:hover { background: var(--gd-ink); border-color: var(--gd-ink); }
.gd-btn-ghost { border-color: var(--gd-line); }
.gd-btn-small { min-height: 36px; padding: 6px 12px; font-size: 13px; }
.gd-btn-wide { width: 100%; min-height: 48px; font-size: 16px; }
.gd-btn-danger { color: #9F1239; border-color: #F1C4CF; }
.gd-icon-btn { min-width: 36px; min-height: 36px; border: 1px solid var(--gd-line); background: #fff; border-radius: 8px; font: inherit; font-size: 15px; cursor: pointer; color: var(--gd-ink); }
.gd-icon-btn:disabled { opacity: .4; cursor: not-allowed; }
.gd-b { font-weight: 700; } .gd-i { font-style: italic; font-family: Georgia, serif; }
.gd-link { background: none; border: 0; padding: 4px; color: var(--gd-accent); text-decoration: underline; cursor: pointer; font: inherit; font-size: 13px; }
.gd-select { font: inherit; font-size: 14px; min-height: 40px; padding: 6px 10px; border: 1px solid var(--gd-line); border-radius: 8px; background: #fff; color: var(--gd-ink); }
.gd-select-small { min-height: 36px; font-size: 13px; }
.gd-banner { background: #FEF3C7; color: #78350F; padding: 12px 16px; font-size: 14px; border-bottom: 1px solid #FCD34D; }

/* layout */
.gd-body { display: flex; flex-wrap: wrap; align-items: flex-start; }
.gd-side { flex: 1 1 340px; max-width: 420px; background: #fff; border-right: 1px solid var(--gd-line); max-height: calc(100vh - 140px); overflow-y: auto; position: sticky; top: 65px; }
.gd-main { flex: 999 1 420px; min-width: 0; }
.gd-advanced .gd-side { opacity: .55; }
.gd-advanced .gd-side:hover, .gd-advanced .gd-side:focus-within { opacity: 1; }
.gd-side-head { padding: 18px 18px 6px; }
.gd-side-head h2 { margin: 0 0 4px; font-size: 18px; font-weight: 600; font-family: inherit; }
.gd-hint, .gd-help { margin: 0; font-size: 13px; color: var(--gd-muted); }
.gd-help { margin-top: 4px; }
.gd-group { border-top: 1px solid var(--gd-line); }
.gd-group summary { padding: 14px 18px; font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; min-height: 48px; align-items: center; }
.gd-group summary::after { content: '+'; color: var(--gd-muted); font-weight: 400; font-size: 18px; }
.gd-group[open] summary::after { content: '−'; }
.gd-group-body { padding: 0 18px 16px; display: grid; gap: 14px; }
.gd-field label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 5px; }
.gd-field input[type=text], .gd-field input[type=email], .gd-field textarea, .gd-modal input[type=text], .gd-modal input[type=email] { width: 100%; font: inherit; font-size: 15px; padding: 9px 11px; border: 1px solid #CFCBC2; border-radius: 8px; background: #fff; color: var(--gd-ink); min-height: 42px; }
.gd-field textarea { resize: vertical; line-height: 1.5; font-family: Georgia, 'Cormorant Garamond', serif; }
.gd-field input:focus, .gd-field textarea:focus, .gd-select:focus { outline: 2px solid var(--gd-blue); outline-offset: 1px; border-color: transparent; }
.gd-flash { animation: gd-flash 1.2s ease; border-radius: 8px; }
@keyframes gd-flash { 0% { background: #DBEAFE; } 100% { background: transparent; } }
.gd-image-row { display: flex; gap: 12px; align-items: center; }
.gd-thumb { width: 64px; height: 64px; border-radius: 8px; background: #EEE center/cover no-repeat; border: 1px solid var(--gd-line); flex: none; }
.gd-thumb-empty { background: repeating-linear-gradient(45deg, #F3F2EE, #F3F2EE 6px, #ECEAE4 6px, #ECEAE4 12px); }
.gd-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.gd-list { display: grid; gap: 8px; }
.gd-list-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 6px; align-items: center; }
.gd-list-row input { min-height: 38px !important; font-size: 14px !important; padding: 7px 9px !important; border: 1px solid #CFCBC2; border-radius: 8px; width: 100%; font: inherit; }
.gd-list-actions { display: flex; gap: 2px; }
.gd-list-actions .gd-icon-btn { min-width: 30px; min-height: 34px; font-size: 13px; }

/* tools */
.gd-tools { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--gd-line); position: sticky; top: 65px; z-index: 4; }
.gd-tool-group { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.gd-tool-group[hidden], .gd-tools[hidden] { display: none; }
.gd-tool-hint { margin: 0; font-size: 13px; color: var(--gd-muted); flex: 1 1 260px; }
.gd-size { font-size: 13px; min-width: 38px; text-align: center; }
.gd-swatches { display: flex; gap: 4px; }
.gd-swatch { width: 28px; height: 28px; border-radius: 50%; border: 1px solid #BDB8AE; cursor: pointer; padding: 0; }

/* pages */
.gd-pages { display: flex; flex-direction: column; align-items: center; gap: 28px; padding: 28px 12px 60px; }
.gd-page { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.gd-page-label { font-size: 13px; color: var(--gd-muted); }
.gd-page-paper { background: #fff; box-shadow: 0 1px 2px rgba(30,36,48,.08), 0 12px 32px rgba(30,36,48,.12); border-radius: 2px; line-height: 0; }

/* modal */
.gd-modal { border: 0; border-radius: 14px; padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); color: var(--gd-ink); font-family: 'Instrument Sans', system-ui, sans-serif; box-shadow: 0 24px 64px rgba(0,0,0,.25); }
.gd-modal-wide { width: min(880px, calc(100vw - 24px)); }
.gd-modal::backdrop { background: rgba(20, 22, 28, .55); }
.gd-modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--gd-line); }
.gd-modal-head h2 { margin: 0; font-size: 18px; font-family: inherit; }
.gd-modal-close { border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; min-width: 44px; min-height: 44px; color: var(--gd-muted); }
.gd-modal-body { padding: 18px 20px 22px; display: grid; gap: 14px; overflow: auto; }
.gd-row { display: flex; gap: 8px; align-items: center; }
.gd-row-center { justify-content: center; }
.gd-preview { display: flex; justify-content: center; background: #EDEAE4; border-radius: 10px; padding: 18px; }
.gd-preview-img { max-height: 68vh; max-width: 100%; box-shadow: 0 10px 30px rgba(0,0,0,.18); background: #fff; }
.gd-preview-cap { text-align: center; margin: 0; color: var(--gd-muted); font-size: 14px; }
.gd-issues { display: grid; gap: 6px; }
.gd-issue { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 9px 12px; border-radius: 8px; font-size: 14px; }
.gd-issue-error { background: #FEE2E2; color: #7F1D1D; }
.gd-issue-warn { background: #FEF3C7; color: #78350F; }
.gd-issue-ok { background: #DCFCE7; color: #14532D; }
.gd-order-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.gd-order-grid .gd-select { width: 100%; }
.gd-price { margin: 0; font-size: 18px; font-weight: 600; }
.gd-signoff { background: var(--gd-bg); border-radius: 10px; padding: 14px; display: grid; gap: 8px; }
.gd-check { display: flex; gap: 10px; align-items: flex-start; }
.gd-check input { width: 22px; height: 22px; margin-top: 1px; flex: none; accent-color: var(--gd-accent); }
.gd-check label { font-size: 14px; }
.gd-progress { margin: 0; font-size: 14px; color: var(--gd-muted); }

/* toast */
.gd-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: #1E2430; color: #fff; padding: 12px 18px; border-radius: 10px; font: 14px/1.4 'Instrument Sans', system-ui, sans-serif; opacity: 0; transition: all .25s ease; z-index: 100000; max-width: calc(100vw - 32px); }
.gd-toast.gd-show { opacity: 1; transform: translate(-50%, 0); }
.gd-toast-error { background: #9F1239; }
.gd-toast-warn { background: #92400E; }

@media (max-width: 860px) {
	.gd-side { max-width: none; max-height: none; position: static; border-right: 0; border-bottom: 1px solid var(--gd-line); }
	.gd-bar, .gd-tools { position: static; }
	.gd-order-grid { grid-template-columns: minmax(0, 1fr); }
}
