* {
    box-sizing: border-box;
}

.greeting-cards-public-page a:not(.gc-btn):not(.gc-tab-pill),
.gc-page-shell a:not(.gc-btn):not(.gc-tab-pill) {
    color: inherit;
}

.gc-page-shell {
    color: #1f2937;
}

.gc-page-shell .gc-hero {
    margin-bottom: 22px;
    border: 1px solid rgba(99, 102, 241, 0.16);
    background: radial-gradient(circle at top right, rgba(129, 140, 248, 0.22), transparent 30%),
        linear-gradient(135deg, #4f46e5 0%, #7c3aed 52%, #0ea5e9 100%);
    color: #fff;
    border-radius: 28px;
    padding: 34px;
    box-shadow: 0 22px 48px rgba(79, 70, 229, 0.16);
}

.gc-page-shell .gc-hero.gc-hero-compact {
    padding: 24px 28px;
    border-radius: 24px;
    box-shadow: 0 16px 34px rgba(79, 70, 229, 0.12);
}

.gc-section-title-row,
.gc-template-footer,
.gc-actions-row,
.gc-actions-stack,
.gc-share-grid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.gc-hero {
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(12px);
}

.gc-hero h1 {
    font-size: clamp(32px, 4vw, 52px);
    margin: 10px 0 10px;
}

.gc-hero p {
    margin: 0;
    max-width: 720px;
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.9;
}

.gc-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    font-size: 14px;
}

.gc-panel,
.gc-template-card,
.gc-empty-state {
    background: #fff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    border-radius: 24px;
}

.gc-panel {
    padding: 22px;
    margin-bottom: 22px;
}

.gc-inline-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.gc-inline-stat {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 8px 14px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #dbe2f0;
    color: #334155;
}

.gc-inline-stat-label {
    font-size: 13px;
    color: #64748b;
}

.gc-inline-stat-value {
    font-size: 15px;
    color: #111827;
}

.gc-tabs-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.gc-filter-tabs-wrap {
    display: flex;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.gc-filter-tabs-wrap .gc-tabs-row {
    margin-inline-start: auto;
}

.gc-tab-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid #dbe2f0;
    background: #fff;
    color: #334155;
    text-decoration: none;
    font-weight: 700;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.gc-tab-pill.is-active,
.gc-tab-pill:hover {
    transform: translateY(-1px);
    border-color: #818cf8;
    box-shadow: 0 10px 24px rgba(79, 70, 229, 0.12);
    color: #4338ca;
}

.gc-filters-grid,
.gc-form-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 14px;
}

.gc-field {
    grid-column: span 3;
}

.gc-field.gc-checkbox-field {
    display: flex;
    align-items: end;
}

.gc-field label {
    display: block;
    margin-bottom: 8px;
    color: #374151;
    font-size: 14px;
    font-weight: 600;
}

.gc-field input,
.gc-field select,
.gc-field textarea {
    width: 100%;
    border-radius: 16px;
    border: 1px solid #dbe2f0;
    background: #fff;
    padding: 14px 16px;
    font: inherit;
}

.gc-field textarea {
    resize: vertical;
}

.gc-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.gc-actions-row {
    grid-column: 1 / -1;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.gc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    border: 1px solid transparent;
    border-radius: 16px;
    padding: 0 18px;
    text-decoration: none;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.gc-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.gc-btn.is-copied {
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    color: #fff;
    border-color: rgba(22, 163, 74, 0.34);
    box-shadow: 0 14px 28px rgba(34, 197, 94, 0.24);
    animation: gc-copy-success-pulse .55s ease;
}

@keyframes gc-copy-success-pulse {
    0% {
        transform: scale(1);
    }
    45% {
        transform: scale(1.04);
    }
    100% {
        transform: scale(1);
    }
}

.gc-btn-sm {
    min-height: 40px;
    padding: 0 14px;
}

.gc-btn-primary,
.greeting-cards-public-page a.gc-btn-primary,
.gc-page-shell a.gc-btn-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: #fff;
}

.gc-btn-light,
.greeting-cards-public-page a.gc-btn-light,
.gc-page-shell a.gc-btn-light {
    background: #fff;
    color: #1f2937;
    border-color: #dbe2f0;
}

.gc-btn-success,
.greeting-cards-public-page a.gc-btn-success,
.gc-page-shell a.gc-btn-success {
    background: #16a34a;
    color: #fff;
}

.gc-btn-info,
.greeting-cards-public-page a.gc-btn-info,
.gc-page-shell a.gc-btn-info {
    background: #0ea5e9;
    color: #fff;
}

.gc-btn-instagram,
.greeting-cards-public-page a.gc-btn-instagram,
.gc-page-shell a.gc-btn-instagram {
    background: linear-gradient(135deg, #f58529 0%, #dd2a7b 52%, #8134af 100%);
    color: #fff;
    border-color: rgba(129, 52, 175, 0.34);
}

.gc-templates-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.gc-template-card {
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
}

.gc-template-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 46px rgba(15, 23, 42, 0.14);
}

.gc-template-thumb,
.gc-template-thumb img,
.gc-result-preview img {
    display: block;
    width: 100%;
}

.gc-template-thumb {
    aspect-ratio: 4 / 5;
    background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
    min-height: 0;
    overflow: hidden;
}

.gc-template-thumb img,
.gc-result-preview img {
    height: 100%;
    object-fit: cover;
}

.gc-template-thumb .gc-thumb-placeholder {
    min-height: 100%;
    height: 100%;
}

.gc-template-body {
    padding: 18px;
}

.gc-template-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 10px;
}

.gc-template-body h5,
.gc-section-title-row h4 {
    margin: 0;
}

.gc-template-body p,
.gc-muted {
    color: #6b7280;
    line-height: 1.9;
}

.gc-templates-panel .gc-section-title-row {
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.gc-section-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #dbe2f0;
    color: #475569;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.gc-detail-layout,
.gc-result-layout {
    display: grid;
    grid-template-columns: minmax(340px, 1fr) minmax(360px, 1fr);
    gap: 22px;
    margin-bottom: 22px;
    align-items: start;
}

.gc-detail-sidebar {
    display: grid;
    gap: 22px;
    align-self: start;
}

.gc-result-sidebar {
    display: grid;
    gap: 22px;
    align-self: start;
}

.gc-detail-preview,
.gc-result-preview {
    overflow: hidden;
    border-radius: 24px;
    background: #fff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.gc-live-preview {
    position: relative;
    background: #fff;
}

.gc-live-preview-source {
    display: none !important;
}

.gc-live-preview-canvas {
    display: block;
    width: 100%;
    height: auto;
    background: linear-gradient(135deg, #eef2ff 0%, #e0f2fe 100%);
}

.gc-detail-panel,
.gc-detail-preview {
    align-self: start;
}

.gc-detail-panel .gc-form-grid {
    gap: 16px;
}

.gc-detail-panel .gc-field {
    grid-column: 1 / -1;
}

.gc-detail-panel .gc-actions-row {
    margin-top: 4px;
}

.gc-live-preview-note {
    padding: 14px 18px;
    font-size: 13px;
    color: #6b7280;
    border-top: 1px solid #e5e7eb;
    background: rgba(248, 250, 252, 0.9);
}

.gc-preview-list {
    display: grid;
    gap: 12px;
}

.gc-preview-list .gc-empty-state {
    padding: 18px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px dashed #dbe2f0;
    text-align: center;
}

.gc-preview-item {
    padding: 14px 16px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.gc-preview-item strong {
    display: block;
    margin-bottom: 6px;
}

.gc-actions-stack,
.gc-share-grid {
    flex-direction: column;
    align-items: stretch;
    margin-top: 16px;
}

.gc-result-secondary-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed #dbe2f0;
}

.gc-result-secondary-actions .gc-btn {
    width: 100%;
}

.gc-feedback-panel {
    background: linear-gradient(135deg, #eef6ff 0%, #ffffff 100%);
}

.gc-empty-state,
.gc-error-box {
    padding: 28px;
    text-align: center;
    color: #6b7280;
}

.gc-error-box {
    background: #fff1f2;
    border: 1px solid #fecdd3;
    border-radius: 18px;
    color: #b91c1c;
    margin-bottom: 18px;
}

.gc-thumb-placeholder,
.gc-thumb-placeholder-large {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 220px;
    padding: 30px;
    color: #4338ca;
    background: linear-gradient(135deg, #eef2ff 0%, #e0f2fe 100%);
    font-weight: 700;
}

.gc-thumb-placeholder-large {
    min-height: 100%;
}

@media (prefers-color-scheme: dark) {
    .gc-page-shell {
        color: #e5eefc;
    }

    .gc-page-shell .gc-hero {
        background: radial-gradient(circle at top right, rgba(14, 165, 233, 0.24), transparent 28%),
            linear-gradient(135deg, #1d4ed8 0%, #312e81 52%, #0f766e 100%);
    }

    .gc-panel,
    .gc-template-card,
    .gc-empty-state,
    .gc-detail-preview,
    .gc-result-preview {
        background: rgba(15, 23, 42, 0.92);
        border-color: rgba(148, 163, 184, 0.18);
        box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
    }

    .gc-template-body h5,
    .gc-section-title-row h4,
    .gc-field label,
    .gc-tab-pill {
        color: #f8fafc;
    }

    .gc-template-meta,
    .gc-template-body p,
    .gc-muted,
    .gc-live-preview-note {
        color: #94a3b8;
    }

    .gc-inline-stat {
        background: rgba(15, 23, 42, 0.72);
        border-color: rgba(148, 163, 184, 0.2);
        color: #e5eefc;
    }

    .gc-inline-stat-label {
        color: #94a3b8;
    }

    .gc-inline-stat-value {
        color: #f8fafc;
    }

    .gc-filter-tabs-wrap {
        border-top-color: rgba(148, 163, 184, 0.18);
    }

    .gc-templates-panel .gc-section-title-row {
        border-bottom-color: rgba(148, 163, 184, 0.18);
    }

    .gc-section-count {
        background: rgba(15, 23, 42, 0.72);
        border-color: rgba(148, 163, 184, 0.2);
        color: #e5eefc;
    }

    .gc-field input,
    .gc-field select,
    .gc-field textarea,
    .gc-tab-pill,
    .gc-btn-light,
    .gc-preview-item {
        background: #0f172a;
        border-color: rgba(148, 163, 184, 0.2);
        color: #e5eefc;
    }

    .gc-feedback-panel {
        background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.92));
    }

    .gc-thumb-placeholder,
    .gc-thumb-placeholder-large,
    .gc-template-thumb {
        background: linear-gradient(135deg, #172554 0%, #1e293b 100%);
        color: #c7d2fe;
    }
}

@media (max-width: 1024px) {
    .gc-templates-grid,
    .gc-detail-layout,
    .gc-result-layout {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .gc-field {
        grid-column: span 6;
    }
}

@media (max-width: 720px) {
    .gc-templates-grid,
    .gc-detail-layout,
    .gc-result-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .gc-field,
    .gc-field.gc-checkbox-field {
        grid-column: 1 / -1;
    }

    .gc-section-title-row,
    .gc-template-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .gc-hero,
    .gc-panel {
        padding: 18px;
    }
}
