/* Card galleries and designer: independent of the studentskylt UI. */
.cards-page { max-width: 1140px; width: calc(100% - 48px); margin: 0 auto; padding: 52px 0 80px; color: #263c4b; }
.cards-page *, .cards-page *::before, .cards-page *::after { box-sizing: border-box; }
.cards-page h1, .cards-page h2, .cards-page h3, .cards-page p { margin: 0; }
.cards-designer-heading p { color: #67747c; font-size: 15px; line-height: 1.8; }
.cards-page a:focus-visible, .cards-page textarea:focus-visible { outline: 3px solid #6da9d5; outline-offset: 4px; }

.cards-icon { flex: 0 0 auto; display: inline-block; vertical-align: middle; }
.cards-visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip-path: inset(50%); white-space: nowrap; }
.cards-designer { --card-ink: #082b4c; --card-blue: #0085ff; --card-border: #d3e0ee; max-width: 1540px; padding-top: 14px; color: var(--card-ink); }
.cards-back { display: inline-flex; align-items: center; min-height: 30px; color: #58738b; font-size: 12px; text-decoration: none; }
.cards-designer-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 12px 0 28px; }
.cards-designer-heading h1 { font: 400 clamp(28px, 3vw, 44px)/1.15 Georgia, serif; letter-spacing: -.03em; margin-bottom: 8px; }
.cards-designer-heading p { color: #4e6880; font-size: 16px; line-height: 1.5; }
.cards-header-actions { display: flex; flex-shrink: 0; gap: 14px; }
.cards-preview-button, .cards-add-text { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; border-radius: 10px; padding: 10px 18px; font: inherit; font-size: 15px; }
.cards-preview-button { border: 1px solid var(--card-border); background: #fff; color: var(--card-ink); }
.cards-add-text { border: 1px solid #075071; background: #075071; color: #fff; }
.cards-add-text:hover { background: #063c59; }
.cards-workspace { display: grid; grid-template-columns: minmax(280px, .95fr) minmax(0, 2fr); align-items: start; gap: 18px; }
.cards-controls { display: grid; gap: 16px; }
.cards-panel { padding: 22px; border: 1px solid var(--card-border); border-radius: 16px; background: linear-gradient(125deg, #fff, #f9fbfe); }
.cards-panel h2 { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; font-size: 21px; font-weight: 650; line-height: 1.3; }
.cards-panel h2 > span { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #e2f2ff; font-size: 20px; flex-shrink: 0; }
.cards-panel h2 small { margin-left: auto; color: #597089; font-size: 11px; font-weight: 400; }
.cards-designer .cards-format-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.cards-gallery-format { max-width: 540px; margin-bottom: 32px; }
.cards-gallery-format > label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 8px; }
.cards-gallery-format select, .cards-format-select { width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid #cbdbee; border-radius: 9px; background: #fff; color: #102c4b; font: inherit; font-size: 16px; }
.cards-page .cards-help { margin-top: 10px; color: #536d84; font-size: 13px; line-height: 1.5; }
.cards-style-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cards-style { min-width: 0; padding: 4px; border: 2px solid transparent; border-radius: 11px; background: transparent; color: #49647f; transition: background .15s, border-color .15s; }
.cards-style[aria-pressed="true"] { border-color: var(--card-blue); background: #e0f2ff; color: #082b4c; box-shadow: 0 0 0 3px #0085ff09; }
.cards-style:hover { background: #edf5fc; }
.cards-style svg { display: block; width: 100%; height: auto; border-radius: 7px; }
.cards-style span { display: block; margin: 8px 0 4px; font-size: 14px; }
.cards-add-text { width: 100%; min-height: 44px; margin-top: 16px; border-radius: 9px; }
.cards-preview-panel { min-width: 0; text-align: center; }
.cards-pages { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; padding: 12px 24px; border-radius: 18px; background: #f0f3f8; }
.cards-pages button { min-width: 0; padding: 8px; border: 1px solid transparent; border-radius: 11px; color: #49647f; background: transparent; }
.cards-pages button[aria-pressed="true"] { border-color: #0078d8; background: #dff1ff; box-shadow: inset 0 0 0 3px #ffffff80; color: #07466d; }
.cards-pages svg { display: block; width: 100%; max-width: 72px; height: auto; margin: 0 auto; border: 3px solid white; box-shadow: 0 2px 7px #263c4b24; }
.cards-pages span { display: block; margin-top: 8px; font-size: 13px; line-height: 1.4; }
.cards-editing-surface { padding: 14px 18px; border-radius: 18px; background: radial-gradient(ellipse at center, #e8e8e9, #f3f4f7 75%); }
.cards-text-toolbar { position: relative; z-index: 3; max-width: 760px; margin: 0 auto 16px; padding: 8px 12px 0; border: 1px solid #e3e9f1; border-radius: 14px; background: #fafcff; box-shadow: 0 4px 10px #172f4d12; text-align: left; }
.cards-text-toolbar-fields { display: flex; align-items: end; gap: 10px; }
.cards-text-toolbar label { min-width: 0; font-size: 10px; color: #5c7289; }
.cards-text-toolbar label:has([data-card-font]) { flex: 1; }
.cards-text-toolbar select, .cards-text-toolbar input[type="number"] { display: block; width: 100%; height: 38px; margin-top: 3px; padding: 6px 10px; border: 1px solid #cbdbee; border-radius: 8px; background: #fff; color: #102c4b; font: inherit; font-size: 15px; }
.cards-text-toolbar [data-card-font] option { font-size: 18px; }
/* Customizable native selects preserve keyboard and mobile picker behavior. */
@supports (appearance: base-select) {
  .cards-text-toolbar [data-card-font], .cards-text-toolbar [data-card-font]::picker(select) { appearance: base-select; }
  .cards-text-toolbar [data-card-font] { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .cards-text-toolbar [data-card-font]::picker(select) { min-width: 240px; max-height: 360px; overflow-y: auto; border: 1px solid #cbdbee; border-radius: 8px; background: #fff; box-shadow: 0 8px 24px #193c5026; }
  .cards-text-toolbar [data-card-font] option { min-height: 40px; padding: 8px 12px; line-height: 1.5; }
  .cards-text-toolbar [data-card-font] option:checked { background: #e8f3ff; }
}
.cards-text-toolbar input[type="number"] { width: 66px; }
.cards-tool-button { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 38px; padding: 6px; border: 1px solid #cbdbee; border-radius: 7px; background: #fff; color: #123d5a; font: 22px Georgia, serif; }
.cards-tool-button[aria-pressed="true"] { background: #d4edff; border-color: #9acffa; color: #00568c; }
.cards-alignment { display: flex; gap: 2px; }
.cards-alignment .cards-tool-button { border-color: transparent; background: transparent; }
.cards-alignment .cards-tool-button[aria-pressed="true"] { background: #d4edff; }
.cards-color-control { display: grid; place-items: center; width: 48px; height: 38px; border: 1px solid #cbdbee; border-radius: 8px; background: white; }
.cards-color-control input { width: 31px; height: 30px; border: 0; padding: 0; background: transparent; cursor: pointer; }
.cards-color-control input::-webkit-color-swatch-wrapper { padding: 2px; }
.cards-color-control input::-webkit-color-swatch { border: 0; border-radius: 5px; }
.cards-text-toolbar :disabled { opacity: .45; cursor: default; }
.cards-text-toolbar-actions { display: flex; justify-content: space-between; gap: 12px; }
.cards-text-toolbar-actions button { min-height: 28px; border: 0; padding: 4px 0; background: transparent; color: #58738b; font-size: 10px; }
.cards-preview-stage { position: relative; display: flex; justify-content: center; align-items: center; gap: 16px; padding: 0 0 12px; }
.cards-canvas { position: relative; width: min(100%, 430px); flex-shrink: 1; box-shadow: 0 8px 22px #1e27392b; }
.cards-canvas > svg { display: block; width: 100%; height: auto; background: white; }
.cards-preview-stage [data-card-photo-hit] { cursor: grab; touch-action: none; }
.cards-preview-stage [data-card-photo-hit]:active { cursor: grabbing; }
.cards-preview-stage [data-card-photo-hit]:focus-visible { stroke: #0085ff; stroke-width: 3; outline: none; }
.cards-preview-stage [data-card-text-hit] { cursor: move; touch-action: none; }
.cards-preview-stage [data-card-text-hit]:focus { outline: none; }
.cards-preview-stage [data-card-text] { pointer-events: none; user-select: none; }
.cards-photo-popover { position: absolute; right: 0; top: 42%; z-index: 2; width: 178px; padding: 12px; border: 1px solid #d9dee6; border-radius: 12px; background: #fffffff5; box-shadow: 0 4px 10px #172f4d1c; text-align: left; transform: translateX(4px); }
.cards-photo-popover h2 { margin-bottom: 8px; font-size: 12px; font-weight: 600; }
.cards-upload { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 6px; border: 1px solid #cbdbee; border-radius: 7px; color: #153e5e; background: #f7fbff; font-size: 13px; cursor: pointer; }
.cards-upload input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.cards-upload:focus-within { outline: 3px solid #6da9d5; outline-offset: 3px; }
.cards-photo-popover .cards-help { font-size: 10px; }
.cards-photo-adjustments { margin-top: 10px; padding-top: 10px; border-top: 1px solid #d9e2ec; }
.cards-photo-adjustments label { display: flex; justify-content: space-between; color: #4d6983; font-size: 11px; }
.cards-photo-adjustments input { width: 100%; min-height: 32px; accent-color: #0085ff; }
.cards-photo-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px; }
.cards-photo-actions button { min-height: 28px; padding: 0; border: 0; background: transparent; color: #426581; font-size: 10px; text-decoration: underline; text-underline-offset: 3px; }
.cards-inline-text { position: absolute; z-index: 4; box-sizing: border-box; min-height: 44px; margin: 0; padding: 4px; border: 2px solid #0085ff; border-radius: 3px; background: #fffffff5; color: #263c4b; resize: none; line-height: 1.35; overflow: auto; }
.cards-page .cards-format { margin-top: 4px; color: #5c7189; font-size: 11px; }
.cards-page .cards-preview-hint { font-size: 11px; }
.cards-page .cards-preview-instructions { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 12px auto 0; padding: 9px 14px; border: 1px solid #dfe6f0; border-radius: 30px; background: #ffffffbd; font-size: 11px; }
.cards-page .cards-status { margin-top: 10px; color: #326384; font-size: 12px; }
.cards-page .cards-error { margin-top: 10px; padding: 10px; border-radius: 7px; color: #9c3c35; background: #fff2ef; font-size: 13px; }
.cards-page [hidden] { display: none !important; }
.cards-preview-open, .cards-preview-open body { overflow: hidden; }
.cards-preview-dialog { width: min(96vw, 1100px); height: min(92dvh, 900px); max-width: none; max-height: none; margin: auto; padding: 16px; overflow: hidden; border: 0; border-radius: 16px; background: #eff0f2; color: #082b4c; }
.cards-preview-dialog[open] { display: grid; grid-template: "heading" auto "views" auto "warning" auto "artwork" minmax(0, 1fr) "footer" auto / minmax(0, 1fr); }
.cards-preview-dialog::backdrop { background: #082b4ca6; backdrop-filter: blur(4px); }
.cards-dialog-heading { grid-area: heading; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.cards-dialog-heading h2 { font-size: 18px; }
.cards-dialog-heading button { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid #cbdbee; border-radius: 8px; background: #fff; }
.cards-preview-view-controls { grid-area: views; margin-bottom: 12px; }
.cards-preview-views { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: #e3e6e9; }
.cards-preview-views button { flex: 1; min-width: 0; min-height: 40px; padding: 8px; border: 0; border-radius: 9px; background: transparent; color: #526477; font: inherit; font-size: 14px; }
.cards-preview-views button[aria-pressed="true"] { background: #fff; color: #082b4c; box-shadow: 0 1px 4px #082b4c14; }
.cards-preview-position { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.cards-preview-dialog .cards-overflow-warning { grid-area: warning; max-height: 15dvh; overflow-y: auto; margin: 0 0 12px; }
.cards-preview-viewport { grid-area: artwork; display: grid; place-items: center; min-width: 0; min-height: 0; container-type: size; }
.cards-preview-dialog [data-card-clean-preview] { width: min(100cqw, calc(100cqh * 600 / 846)); aspect-ratio: 600 / 846; box-shadow: 0 3px 14px #082b4c20; }
.cards-preview-dialog [data-card-clean-preview] svg { display: block; width: 100%; height: auto; }
.cards-preview-dialog .cards-booklet-spread { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: min(100cqw, calc(100cqh * 1200 / 846)); aspect-ratio: 1200 / 846; }
.cards-booklet-spread::after { position: absolute; top: 0; bottom: 0; left: 50%; width: 16px; transform: translateX(-50%); background: linear-gradient(90deg, transparent, #082b4c0a 40%, #082b4c20 50%, #ffffff40 55%, transparent); pointer-events: none; content: ""; }
.cards-preview-footer { grid-area: footer; padding-top: 14px; }
.cards-preview-dialog button { cursor: pointer; }
.cards-preview-dialog button:focus-visible { outline: 3px solid #6da9d5; outline-offset: 3px; }
@media (min-width: 1500px) { .cards-photo-popover { right: 4%; } }
@media (max-width: 1100px) { .cards-designer-header { flex-wrap: wrap; gap: 16px; } .cards-text-toolbar-fields { flex-wrap: wrap; gap: 6px; } .cards-text-toolbar label:has([data-card-font]) { min-width: 130px; } .cards-photo-popover { position: static; width: min(100%, 430px); transform: none; } .cards-preview-stage { flex-direction: column; } .cards-workspace { grid-template-columns: minmax(260px, .9fr) minmax(0, 1.4fr); } .cards-panel { padding: 16px; } .cards-pages { padding: 12px; gap: 4px; } .cards-pages span { font-size: 11px; } }
@media (max-width: 760px) { .cards-page { width: calc(100% - 28px); padding-top: 18px; } .cards-designer-heading h1 { font-size: 30px; } .cards-designer-heading p { font-size: 14px; } .cards-designer-header { margin: 10px 0 20px; } .cards-header-actions { width: 100%; gap: 8px; } .cards-header-actions button { flex: 1; padding: 9px; font-size: 13px; } .cards-workspace { display: flex; flex-direction: column; gap: 18px; } .cards-controls, .cards-preview-panel { width: 100%; } .cards-panel h2 { font-size: 19px; } .cards-style-options { gap: 14px; } .cards-style svg { max-height: 200px; } .cards-editing-surface { padding: 12px; } .cards-canvas { max-width: 360px; } .cards-text-toolbar { padding: 8px 8px 0; } .cards-text-toolbar select, .cards-text-toolbar input[type="number"] { font-size: 16px; } .cards-page .cards-preview-instructions { border-radius: 12px; text-align: left; } .cards-gallery { gap: 22px; grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .cards-gallery { grid-template-columns: 1fr; } .cards-panel { padding: 16px; } .cards-style-options { gap: 6px; } .cards-style span { font-size: 12px; } .cards-tool-button { width: 32px; flex-basis: 32px; } .cards-alignment { gap: 0; } }
@media (prefers-reduced-motion: reduce) { .cards-template svg, .cards-template-stage, .cards-style { transition: none; } }

.cards-template-description { margin-top: 14px !important; color: #67747c; font-size: 13px; line-height: 1.5; }

.cards-page .cards-overflow-warning { margin: 12px 0; padding: 10px 14px; border: 1px solid #e6b384; border-radius: 9px; background: #fff6eb; color: #854312; text-align: left; font-size: 13px; line-height: 1.5; }
.cards-preview-stage [data-card-text-hit][data-overflow="true"] { stroke: #b85121; stroke-width: 1.5; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }

.cards-canvas > svg, [data-card-clean-preview] { touch-action: pan-y pinch-zoom; }
.cards-preview-navigation { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.cards-preview-navigation button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 8px 16px; border: 1px solid #cbdbee; border-radius: 24px; background: #fff; color: #123d5a; font: inherit; font-size: 14px; }
.cards-preview-navigation button span { font-size: 26px; line-height: 1; }
.cards-preview-navigation [data-card-preview-next] { border-color: #123d5a; background: #123d5a; color: #fff; }
.cards-preview-navigation button:disabled { opacity: .35; cursor: default; }
.cards-preview-count { margin-left: 8px; color: #597089; font-size: 12px; }
.cards-preview-footer [data-card-dialog-swipe-hint] { display: none; }
@media (max-width: 760px) {
  .cards-preview-dialog { inset: 0; width: 100%; height: 100dvh; margin: 0; padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); border-radius: 0; }
  .cards-preview-views { padding: 0; background: transparent; }
  .cards-preview-views button { display: flex; align-items: center; min-height: 24px; padding: 0; border-radius: 0; font-size: 0; }
  .cards-preview-views button::before { width: 100%; height: 4px; border-radius: 2px; background: #d8dde3; content: ""; }
  .cards-preview-views button[aria-pressed="true"] { background: transparent; box-shadow: none; }
  .cards-preview-views button[aria-pressed="true"]::before { background: #0085ff; }
  .cards-preview-position { position: static; width: auto; height: auto; overflow: visible; clip-path: none; text-align: center; font-size: 14px; }
  .cards-preview-footer [data-card-dialog-swipe-hint] { display: block; margin-top: 8px; text-align: center; font-size: 12px; }
}
.cards-page .cards-swipe-hint { font-size: 11px; }

/* The selection gallery has its own layout; the card canvas and sign UI stay independent. */
.cards-gallery-page { max-width: 1160px; margin: 0 auto; padding: 56px 0 95px; color: #263c4b; }
.cards-steps { display: flex; align-items: center; justify-content: center; gap: 68px; margin: 0 0 28px; padding: 0; list-style: none; }
.cards-steps li { position: relative; display: flex; align-items: center; gap: 10px; color: #4d6781; font-size: 13px; }
.cards-steps li + li::before { position: absolute; right: calc(100% + 16px); width: 36px; height: 1px; background: #ccd9e6; content: ""; }
.cards-steps li > span { display: grid; place-items: center; width: 25px; height: 25px; border: 1px solid #ccd9e6; border-radius: 50%; background: #fff; color: #254f73; font-weight: 650; }
.cards-steps li[aria-current] { color: #102f4d; font-weight: 650; }
.cards-steps li[aria-current] > span { border-color: #254f73; background: #254f73; color: #fff; }
.cards-gallery-intro { margin: 15px 0 28px; }
.cards-gallery-intro h1 { margin-bottom: 8px; font: inherit; font-size: clamp(22px, 2.5vw, 28px); line-height: 1.3; letter-spacing: -.035em; }
.cards-gallery-intro p { color: #526c84; font-size: 14px; line-height: 1.6; }
.cards-gallery-form { display: grid; gap: 24px; }
.cards-gallery-panel { min-width: 0; }
.cards-gallery-panel h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; font-size: 18px; font-weight: 650; }
.cards-section-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #f0f3f7; }
.cards-gallery-panel fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.cards-gallery-panel legend { margin: 0 0 8px; padding: 0; font-size: 13px; font-weight: 650; }
.cards-format-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.cards-type-options, .cards-size-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cards-format-option { display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; min-height: 44px; padding: 8px 10px; border: 1px solid #cddbe9; border-radius: 9px; background: #fff; color: #143451; font: inherit; font-size: 14px; line-height: 1.4; cursor: pointer; }
.cards-format-option:hover { background: #f3f8fc; }
.cards-format-option[aria-pressed="true"] { border-color: #087fdc; background: #eff8ff; box-shadow: inset 0 0 0 1px #087fdc; }
.cards-format-option:focus-visible { outline: 3px solid #6da9d5; outline-offset: 3px; }
.cards-type-illustration { display: flex; flex: 0 0 22px; }
.cards-type-illustration .cards-icon { width: 22px; height: 22px; }
.cards-format-dimensions { color: #526c84; font-size: 12px; white-space: nowrap; }
.cards-format-fallback label { display: block; margin-bottom: 8px; font-size: 13px; }
.cards-format-fallback select { width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid #cddbe9; border-radius: 8px; background: white; color: #143451; }
.cards-gallery-ready .cards-format-fallback, .cards-gallery-page:not(.cards-gallery-ready) .cards-format-choices { display: none; }
.cards-gallery-page .cards-gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.cards-template { display: block; min-width: 0; width: 100%; color: inherit; text-decoration: none; cursor: pointer; }
.cards-template-stage { display: block; padding: 0; border: 0; border-radius: 0; background: transparent; transition: transform .2s ease-out; }
.cards-template svg { display: block; width: 100%; height: auto; }
.cards-template-paper { display: block; }
.cards-template-cover { position: relative; display: block; box-shadow: 0 6px 16px #17283d26; transition: box-shadow .2s ease-out; }
/* Both paper faces share one spine and perspective, like a slightly open card. */
.cards-gallery-page[data-card-preview-type="folded"] .cards-template-stage { position: relative; aspect-ratio: 600 / 846; perspective: 1000px; }
.cards-gallery-page[data-card-preview-type="folded"] .cards-template-stage::after { content: ""; position: absolute; left: 13%; right: 10%; bottom: 9%; height: 5%; border-radius: 50%; background: #34312b28; filter: blur(9px); transform: rotate(-3deg); pointer-events: none; }
.cards-gallery-page[data-card-preview-type="folded"] .cards-template-paper { position: absolute; top: 9%; left: 12%; width: 78%; transform-style: preserve-3d; transform: rotateX(5deg) rotateY(-10deg) rotateZ(-2deg); }
.cards-gallery-page[data-card-preview-type="folded"] .cards-template-paper::before { content: ""; position: absolute; inset: 0 0 0 1px; background: linear-gradient(90deg, #d9d5cd, #f0ede6 8%, #fffdf8 45%, #f5f2ec); border: 1px solid #dedad2; border-left: 0; transform: translateZ(-1px) rotateY(3deg); transform-origin: left center; box-shadow: 1px 1px 0 #d1ccc3, 4px 6px 12px #34312b0c; }
.cards-gallery-page[data-card-preview-type="folded"] .cards-template-cover { transform: rotateY(-22deg) translateZ(1px); transform-origin: left center; backface-visibility: hidden; box-shadow: 1px 0 0 #e8e3da, 2px 1px 0 #d5d0c7, 5px 2px 8px #34312b15; }
.cards-gallery-page[data-card-preview-type="folded"] .cards-template-cover::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, #524c431c, #ffffff12 1.5%, transparent 5%, #ffffff08 70%, #524c4308); box-shadow: inset 0 0 0 1px #524c430d; }
.cards-template:focus-visible .cards-template-stage { outline: 3px solid #6da9d5; outline-offset: 3px; }
.cards-template:hover .cards-template-cover, .cards-template:focus-visible .cards-template-cover { box-shadow: 0 12px 24px #17283d40; }
.cards-gallery-page[data-card-preview-type="folded"] .cards-template:hover .cards-template-cover, .cards-gallery-page[data-card-preview-type="folded"] .cards-template:focus-visible .cards-template-cover { box-shadow: 1px 0 0 #e8e3da, 2px 1px 0 #d5d0c7, 6px 3px 12px #34312b20; }
@media (prefers-reduced-motion: no-preference) { .cards-template:hover .cards-template-stage, .cards-template:focus-visible .cards-template-stage { transform: translateY(-4px); } }
.cards-gallery-apply { margin-top: 12px; padding: 8px 16px; border: 0; border-radius: 8px; background: #204f75; color: white; }
.cards-template-caption { display: block; margin-top: 8px; text-align: center; font-size: 13px; line-height: 1.5; }
.cards-gallery-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.cards-gallery-footer .cards-help { margin-top: 0; font-size: 12px; }
.cards-gallery-continue { display: inline-flex; align-items: center; justify-content: center; gap: 16px; min-width: 224px; min-height: 44px; padding: 10px 24px; border: 0; border-radius: 24px; background: #204f75; color: #fff; font: inherit; font-size: 14px; font-weight: 600; box-shadow: 0 2px 5px #193c5018; }
.cards-gallery-continue:hover { background: #173f60; }
@media (max-width: 980px) { .cards-gallery-page .cards-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); } .cards-format-choices { grid-template-columns: 1fr; gap: 12px; } }
@media (max-width: 760px) { .cards-gallery-page { width: calc(100% - 28px); padding: 20px 0 60px; } .cards-steps { gap: 22px; margin-bottom: 24px; } .cards-steps li { gap: 5px; font-size: 11px; } .cards-steps li + li::before { right: calc(100% + 5px); width: 12px; } .cards-steps li > span { width: 22px; height: 22px; } .cards-gallery-intro { margin: 0 0 16px; } .cards-gallery-form { gap: 20px; } .cards-gallery-panel h2 { margin-bottom: 12px; } .cards-gallery-page .cards-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; } .cards-gallery-footer { align-items: stretch; flex-direction: column; gap: 12px; } .cards-gallery-continue { width: 100%; } .cards-template-caption { font-size: 12px; } }
@media (max-width: 760px) {
  .cards-gallery-form { gap: 12px; }
  .cards-format-choices { gap: 8px; }
  .cards-format-option { height: 44px; gap: 6px; padding-block: 6px; }
  #card-format-heading .cards-section-icon { display: none; }
}
@media (max-width: 359px) { .cards-gallery-page .cards-gallery { grid-template-columns: 1fr; } .cards-format-option { gap: 6px; padding-inline: 8px; } }
@media (max-width: 420px) { .cards-gallery-page { width: calc(100% - 28px); } }
@media (prefers-reduced-motion: reduce) { .cards-template-stage { transition: none; } }

.cards-selection-summary h2 { font-size: 18px; margin-bottom: 16px; }
.cards-selection-details { display: flex; align-items: center; gap: 18px; }
.cards-selection-thumbnail { display: block; flex: 0 0 74px; width: 74px; height: auto; box-shadow: 0 3px 9px #193c5020; }
.cards-selection-details dl { min-width: 0; margin: 0; }
.cards-selection-details dt { color: #58738b; font-size: 11px; line-height: 1.4; }
.cards-selection-details dd { margin: 2px 0 10px; color: #123d5a; font-size: 13px; line-height: 1.4; }
.cards-selection-details dd:last-child { margin-bottom: 0; }
.cards-selection-details [data-card-current-title] { font-size: 16px; font-weight: 650; }

.cards-toolbar-add-text { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; gap: 6px; height: 38px; padding: 6px 10px; border: 1px solid #075071; border-radius: 8px; background: #075071; color: #fff; font: inherit; font-size: 13px; white-space: nowrap; }
.cards-toolbar-add-text:hover { background: #063c59; }
.cards-toolbar-add-text .cards-icon { width: 18px; height: 18px; }

.cards-workspace { grid-template-columns: minmax(210px, 250px) minmax(0, 1fr); }
.cards-controls { align-content: start; }
.cards-controls .cards-pages { grid-template-columns: 1fr; gap: 8px; margin: 0; padding: 12px; }
.cards-controls .cards-pages button { display: flex; align-items: center; gap: 14px; padding: 10px; text-align: left; }
.cards-controls .cards-pages svg { flex: 0 0 48px; width: 48px; margin: 0; }
.cards-controls .cards-pages span { margin: 0; font-size: 13px; }
.cards-text-toolbar-actions { flex-wrap: wrap; }
.cards-text-toolbar-actions [data-card-remove-text] { display: inline-flex; align-items: center; gap: 5px; }
.cards-text-toolbar-actions [data-card-remove-text] .cards-icon { width: 14px; height: 14px; }
@media (max-width: 760px) {
  .cards-controls .cards-pages { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 8px; }
  .cards-controls .cards-pages button { flex-direction: column; gap: 8px; padding: 6px 2px; text-align: center; }
  .cards-controls .cards-pages svg { flex: 0 0 auto; width: 100%; max-width: 48px; margin: 0 auto; }
  .cards-controls .cards-pages span { font-size: 10px; }
}

/* Card designer: large canvas with a dedicated inspector. */
.cards-designer { max-width: none; width: calc(100% - 32px); margin: 12px auto 32px; padding: 12px; border: 1px solid #e5eaf1; background: linear-gradient(125deg, #fdfdff, #f7f9fd); box-shadow: 0 3px 10px #193c5010; }
.cards-designer-header { flex-direction: column; align-items: stretch; margin: 0; padding: 6px 4px 8px; gap: 16px; }
.cards-designer-heading h1 { margin-bottom: 5px; font-size: 34px; }
.cards-selection-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; }
.cards-selection-summary p { color: #4c6580; font-size: 14px; }
.cards-selection-summary .cards-back { gap: 7px; min-height: 24px; color: #163e6c; text-decoration: underline; text-underline-offset: 3px; font-size: 13px; }
.cards-selection-summary .cards-icon { width: 16px; height: 16px; color: #1677ff; }
.cards-header-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.cards-header-actions button { min-height: 42px; padding: 9px 17px; font-size: 14px; white-space: nowrap; }
.cards-header-actions .cards-icon { width: 20px; height: 20px; }
.cards-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 400px; align-items: start; gap: 20px; }
.cards-inspector { display: grid; gap: 12px; min-width: 0; text-align: left; }
.cards-inspector-panel { padding: 18px 20px; border: 1px solid #dce5f1; border-radius: 16px; background: linear-gradient(120deg, #fff, #f9fbff); box-shadow: 0 1px 2px #193c5008; }
.cards-inspector-panel h2 { margin: 0 0 16px; font-size: 20px; font-weight: 650; line-height: 1.3; }
.cards-designer .cards-pages { width: 100%; gap: 12px; margin: 0; padding: 0; background: transparent; }
.cards-designer .cards-pages button { padding: 4px 0 0; border: 0; background: transparent; color: #102f4d; }
.cards-designer .cards-pages svg { max-width: 74px; border: 1px solid #d9dfeb; border-radius: 7px; box-shadow: 0 2px 4px #263c4b12; }
.cards-designer .cards-pages span { margin-top: 10px; padding: 4px 0; font-size: 11px; white-space: nowrap; }
.cards-designer .cards-pages button[aria-pressed="true"] { background: transparent; box-shadow: none; color: #0866ff; }
.cards-designer .cards-pages button[aria-pressed="true"] svg { outline: 2px solid #1677ff; outline-offset: 5px; }
.cards-designer .cards-pages button[aria-pressed="true"] span { background: #dcecff; border-radius: 6px; }
.cards-designer .cards-text-toolbar { width: 100%; max-width: none; margin: 0; box-shadow: 0 1px 2px #193c5008; }
.cards-designer .cards-text-toolbar-fields { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.cards-designer .cards-text-toolbar label:has([data-card-font]) { flex: 1; min-width: 100px; }
.cards-designer .cards-text-toolbar select, .cards-designer .cards-text-toolbar input[type="number"] { height: 40px; margin: 0; font-size: 14px; }
.cards-designer .cards-text-toolbar input[type="number"] { width: 70px; }
.cards-designer .cards-tool-button { width: 42px; height: 40px; flex-basis: 42px; border-radius: 8px; }
.cards-formatting-row { display: flex; align-items: center; gap: 20px; width: 100%; margin-top: 4px; }
.cards-alignment { padding: 2px; border: 1px solid #d3dfed; border-radius: 9px; background: #fff; }
.cards-designer .cards-alignment .cards-tool-button { height: 32px; }
.cards-designer .cards-color-control { width: 70px; height: 39px; }
.cards-insert-actions { display: grid; grid-template-columns: 1.15fr 1.15fr .9fr; gap: 6px; width: 100%; margin-top: 12px; }
.cards-designer .cards-insert-actions > * { display: flex; align-items: center; justify-content: center; gap: 7px; min-width: 0; min-height: 46px; margin: 0; padding: 6px; border: 1px solid #d3dfed; border-radius: 9px; background: linear-gradient(#fff, #f9fbff); box-shadow: 0 2px 4px #193c5010; color: #102f4d; font: inherit; font-size: 12px; white-space: nowrap; }
.cards-designer .cards-insert-actions .cards-icon { width: 19px; height: 19px; }
.cards-designer .cards-editing-surface { padding: 14px; border-radius: 16px; background: radial-gradient(ellipse at center, #e5e8ef, #eef1f7 75%); }
.cards-designer .cards-preview-stage { display: block; height: max(320px, calc(100dvh - 190px)); min-height: 0; padding: 0 8px 12px; overflow: auto; }
.cards-designer .cards-canvas { width: 100%; max-width: none; margin: 0 auto; border-radius: 3px; }
.cards-canvas > svg { border-radius: 3px; }
.cards-designer .cards-photo-popover { display: block; position: static; width: 100%; transform: none; text-align: left; }
.cards-designer .cards-photo-popover h2 { font-size: 20px; }
.cards-photo-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.cards-photo-thumbnail { display: grid; place-items: center; flex: 0 0 80px; width: 80px; height: 80px; border-radius: 50%; background: #edf1f6 center / cover no-repeat; }
.cards-photo-thumbnail:empty::after { content: '+'; color: #637b91; font-size: 28px; }
.cards-photo-thumbnail[data-has-photo]::after { content: none; }
.cards-designer .cards-replace-photo, .cards-crop-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 12px; border: 1px solid #d3dfed; border-radius: 9px; background: #fff; color: #102f4d; font: inherit; font-size: 12px; }
.cards-designer .cards-photo-popover .cards-help { font-size: 11px; }
.cards-canvas-footer { display: flex; align-items: center; gap: 16px; padding-top: 4px; }
.cards-view-zoom { display: inline-flex; align-items: center; flex-shrink: 0; padding: 2px; border: 1px solid #e1e7f0; border-radius: 8px; background: #fff; box-shadow: 0 2px 4px #193c501a; }
.cards-view-zoom button { min-width: 28px; min-height: 28px; padding: 2px 6px; border: 0; border-radius: 5px; background: transparent; color: #24425e; font-size: 16px; }
.cards-view-zoom button:hover { background: #edf5fc; }
.cards-view-zoom button:disabled { opacity: .35; cursor: default; }
.cards-view-zoom output { font-size: 12px; }
.cards-designer .cards-preview-instructions { flex: 1; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; font-size: 12px; }
.cards-designer .cards-preview-instructions .cards-icon { width: 18px; height: 18px; }
.cards-canvas-footer .cards-format { display: none; }
.cards-designer .cards-swipe-hint { display: none; }
@media (max-width: 1100px) {
  .cards-designer-header { flex-wrap: wrap; }
  .cards-workspace { grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; }
  .cards-inspector-panel { padding: 16px; }
}
@media (max-width: 760px) {
  .cards-designer { width: calc(100% - 20px); margin: 10px auto 28px; padding: 16px 10px; }
  .cards-designer-header { order: -2; width: 100%; margin: 0; }
  .cards-designer-heading h1 { font-size: 28px; }
  .cards-selection-summary p { font-size: 12px; }
  .cards-header-actions { flex-wrap: wrap; gap: 8px; }
  .cards-header-actions button { padding: 8px; font-size: 12px; }
  .cards-workspace { display: flex; flex-direction: column; }
  .cards-inspector { display: contents; }
  .cards-pages-panel { order: -1; width: 100%; }
  .cards-inspector-panel { width: 100%; padding: 16px 12px; }
  .cards-designer .cards-pages { gap: 4px; }
  .cards-designer .cards-pages svg { max-width: 48px; }
  .cards-designer .cards-pages span { font-size: 10px; }
  .cards-designer .cards-preview-stage { height: auto; min-height: 0; padding: 0 0 12px; }
  .cards-designer .cards-text-toolbar select, .cards-designer .cards-text-toolbar input[type="number"] { font-size: 16px; }
  .cards-designer .cards-text-toolbar-fields { gap: 6px; }
  .cards-designer .cards-tool-button { width: 36px; flex-basis: 36px; }
  .cards-canvas-footer { flex-wrap: wrap; justify-content: center; gap: 8px; }
  .cards-designer .cards-preview-instructions { flex-basis: 100%; font-size: 11px; text-align: center; }
  .cards-designer .cards-insert-actions > * { font-size: 11px; gap: 4px; }
}
.cards-crop-button:disabled { opacity: .45; cursor: default; }
.cards-cart-submit { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 48px; padding: 10px 18px; border: 0; border-radius: 24px; background: #254f73; color: #fff; font: inherit; font-weight: 600; }
.cards-cart-submit:hover { background: #1a3c59; }
.cards-cart-submit:disabled { opacity: .6; cursor: wait; }
.cards-cart-panel .cards-help { margin: 12px 0 0; text-align: center; }
.cards-cart-panel.cards-inspector-panel { padding: 14px; }
.cards-quantity { margin-bottom: 12px; }
.cards-quantity-label { display: block; margin-bottom: 8px; font-weight: 600; }
.cards-quantity-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cards-quantity-stepper { display: flex; align-items: center; width: 190px; max-width: 100%; overflow: hidden; border: 1px solid #dce1e6; border-radius: 12px; }
.cards-quantity-stepper button { flex: 0 0 44px; min-height: 44px; border: 0; background: transparent; color: #254f73; font: inherit; font-size: 20px; font-weight: 600; cursor: pointer; }
.cards-quantity-stepper button:hover:not(:disabled) { background: #edf3f8; border-color: #254f73; }
.cards-quantity-stepper button:disabled { opacity: .4; cursor: default; }
.cards-quantity-stepper button:focus-visible { outline: 2px solid #0079ac; outline-offset: -3px; }
.cards-quantity-stepper output { flex: 1; text-align: center; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cards-quantity .cards-help { margin: 0; text-align: right; white-space: nowrap; font-size: 12px; }
.cards-price-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; font-size: 14px; color: #566674; }
.cards-price-row small { display: block; margin-top: 2px; font-size: 12px; }
.cards-price-row output { color: #102c4b; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
