@font-face {
    font-family: SolaimanLipi;
    src: url('../frontend/fonts/solaiman-lipi.woff') format('woff'),
         url('../frontend/fonts/solaiman-lipi.ttf') format('truetype');
    font-display: swap;
}

:root {
    --green: #075b45;
    --green-dark: #043f2f;
    --green-light: #eaf3ed;
    --green-subtle: #f2f7f3;
    --red: #d62635;
    --red-dark: #b01b28;
    --gold: #ccab65;
    --gold-light: #fef8eb;
    --ink: #162a23;
    --ink-light: #2d453b;
    --muted: #67786f;
    --line: #dce4dc;
    --cream: #f4f6f1;
    --white: #ffffff;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --shadow-sm: 0 2px 8px rgba(7, 91, 69, 0.06);
    --shadow-md: 0 6px 22px rgba(7, 91, 69, 0.08);
    --shadow-lg: 0 14px 40px rgba(7, 91, 69, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--cream);
    color: var(--ink);
    font-family: SolaimanLipi, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 17px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body.modal-open {
    overflow: hidden;
}

button, input, select {
    font: inherit;
}

button, a, input, select, label {
    touch-action: manipulation;
}

button, a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 3px;
}

input, select {
    min-width: 0;
}

svg {
    display: block;
}

/* Site Header */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(8px);
}

.header-inner {
    max-width: 1200px;
    margin: auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: block;
    width: 220px;
}

.brand svg {
    width: 100%;
    height: auto;
}

.home-link {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 15px;
    font-weight: 500;
    color: var(--green);
    background: var(--green-light);
    padding: 7px 15px;
    border-radius: 20px;
    transition: background 0.18s, color 0.18s;
}

.home-link:hover {
    background: var(--green);
    color: #fff;
}

/* Main Container */
main {
    max-width: 1200px;
    margin: auto;
    padding: 32px 24px 60px;
}

/* Intro Hero */
.intro {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 30px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--green);
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 10px;
    background: var(--green-light);
    padding: 4px 14px;
    border-radius: 20px;
}

.eyebrow span {
    height: 7px;
    width: 7px;
    border-radius: 50%;
    background: var(--red);
}

h1 {
    font-size: 38px;
    line-height: 1.25;
    letter-spacing: -0.5px;
    margin: 0;
    font-weight: 700;
}

h1 em {
    font-style: normal;
    color: var(--green);
}

.intro-copy {
    color: var(--muted);
    font-size: 16px;
    line-height: 1.6;
    margin: 12px 0 0;
    max-width: 620px;
}

.anniversary-note {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 12px 22px;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.anniversary-note > strong {
    font-size: 78px;
    font-weight: 700;
    line-height: 0.9;
    color: var(--red);
}

.anniversary-note b {
    display: block;
    font-size: 20px;
    color: var(--green);
}

.anniversary-note span {
    display: block;
    font-size: 15px;
    color: var(--muted);
    margin-top: 2px;
}

/* Top Template Section */
.template-section {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 22px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-sm);
}

.template-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.template-heading h2 {
    font-size: 21px;
    margin: 0;
}

.template-heading p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.selected-template-badge {
    background: var(--green-light);
    color: var(--green);
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    border: 1px solid rgba(7, 91, 69, 0.15);
}

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

.template-option {
    border: 2px solid var(--line);
    padding: 0;
    background: #fff;
    color: var(--ink);
    border-radius: 12px;
    overflow: hidden;
    text-align: left;
    transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
    position: relative;
}

.template-option:hover {
    border-color: #72a986;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.template-option.is-active,
.template-option[aria-pressed="true"] {
    border-color: var(--green);
    box-shadow: 0 0 0 2px var(--green), var(--shadow-md);
    transform: translateY(-2px);
}

.template-image {
    display: block;
    aspect-ratio: 1.25;
    overflow: hidden;
    background: #fbfbfa;
}

.template-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center bottom;
}

.template-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 8px;
    font-size: 13px;
    line-height: 1.25;
    background: #fff;
}

.template-label b {
    font-family: Arial, sans-serif;
    font-size: 12px;
    background: var(--green-light);
    color: var(--green);
    padding: 2px 6px;
    border-radius: 4px;
}

.template-check {
    display: none;
    margin-left: auto;
    color: var(--green);
    font-weight: 700;
    font-size: 14px;
}

.template-option.is-active .template-check,
.template-option[aria-pressed="true"] .template-check {
    display: block;
}

.template-status {
    font-size: 13px;
    color: var(--muted);
    margin: 12px 0 0;
}

.template-status.is-error {
    color: var(--red);
}

.btn-retry {
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--green);
    padding: 6px 14px;
    font-size: 13px;
    margin-top: 8px;
}

/* Studio Layout */
.studio {
    display: grid;
    grid-template-columns: 420px minmax(0, 1fr);
    gap: 30px;
    align-items: start;
}

/* Editor Section */
.editor {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.panel-heading {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.step-number {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--green);
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}

.editor-block {
    margin-bottom: 24px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
}

.editor-block:last-of-type {
    border-bottom: none;
    margin-bottom: 16px;
    padding-bottom: 0;
}

.block-title {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 10px;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 6px;
}

.sub-block-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    margin: 16px 0 8px;
}

.block-desc {
    font-size: 13px;
    color: var(--muted);
    margin: 0 0 10px;
}

/* Upload Zone */
.upload-zone {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 7px;
    align-items: center;
    justify-content: center;
    background: #f7faf7;
    border: 2px dashed #97b9a2;
    border-radius: 12px;
    padding: 22px 14px;
    cursor: pointer;
    text-align: center;
    transition: background 0.18s, border-color 0.18s;
}

.upload-zone:hover,
.upload-zone.is-dragging {
    background: #ebf5ec;
    border-color: var(--green);
}

.upload-zone.has-file {
    background: var(--green-subtle);
    border-style: solid;
    border-color: var(--green);
}

.upload-zone input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    left: 50%;
    top: 50%;
}

.upload-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #e2efe3;
    color: var(--green);
}

.upload-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.upload-zone strong {
    font-size: 17px;
    color: var(--green);
}

.upload-zone > span:last-child {
    font-size: 12px;
    color: #6a7c70;
}

.status {
    font-size: 13px;
    color: var(--muted);
    margin: 8px 0 14px;
    min-height: 20px;
}

.status.is-error {
    color: var(--red);
    font-weight: 600;
}

.status.is-success {
    color: var(--green);
    font-weight: 600;
}

/* Photo Controls */
.photo-controls {
    margin: 12px 0 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fafbfa;
}

.photo-controls legend {
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
    padding: 0 6px;
}

.photo-controls:disabled {
    opacity: 0.5;
    pointer-events: none;
}

.range-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: #4a5c52;
}

.range-label output {
    font-weight: 700;
    color: var(--green);
}

.zoom-slider-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0 12px;
}

.btn-nudge {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s;
}

.btn-nudge:hover {
    background: var(--green-light);
    color: var(--green);
}

input[type="range"] {
    flex: 1;
    height: 20px;
    accent-color: var(--green);
    cursor: pointer;
}

.position-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 10px;
}

.position-grid label {
    font-size: 12px;
    color: #55675c;
    display: block;
    margin-bottom: 2px;
}

.nudge-arrows {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 10px 0 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--line);
}

.nudge-label {
    font-size: 12px;
    color: var(--muted);
}

.arrow-buttons {
    display: flex;
    gap: 4px;
}

.btn-arrow {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: #fff;
    color: #44564b;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-arrow:hover {
    background: var(--green-light);
    color: var(--green);
}

.photo-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
}

.btn-action {
    border: none;
    background: transparent;
    padding: 4px 6px;
    font-size: 13px;
    color: var(--green);
    font-weight: 600;
}

.btn-action.btn-danger {
    color: var(--red);
}

/* Form Groups */
.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--ink);
}

.form-group label small {
    color: var(--muted);
    font-weight: 400;
}

.form-group input,
.form-group select {
    width: 100%;
    background: #fff;
    border: 1.5px solid #d5dfd5;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 15px;
    line-height: 1.4;
    color: var(--ink);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(7, 91, 69, 0.12);
    outline: none;
}

/* Pill Group (Name Position) */
.pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 10px;
}

.pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 13px;
    color: var(--ink);
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.pill-btn:hover {
    border-color: #8bb799;
}

.pill-btn.is-active,
.pill-btn[aria-pressed="true"] {
    background: var(--green-light);
    border-color: var(--green);
    color: var(--green);
    font-weight: 700;
}

.badge-rec {
    background: var(--green);
    color: #fff;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 10px;
}

.drag-hint-text {
    font-size: 12px;
    color: #496956;
    background: #eff7f2;
    padding: 7px 10px;
    border-radius: 7px;
    margin: 8px 0 14px;
    line-height: 1.4;
}

/* Style Group (Nameplate Style) */
.style-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.style-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    color: var(--ink);
    text-align: left;
    transition: border-color 0.15s, background 0.15s;
}

.style-btn:hover {
    border-color: #8bb799;
}

.style-btn.is-active,
.style-btn[aria-pressed="true"] {
    border-color: var(--green);
    background: var(--green-light);
    font-weight: 700;
}

.style-preview {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.15);
}

.style-preview-glass {
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.style-preview-emerald {
    background: #075b45;
}

.style-preview-ruby {
    background: #d62635;
}

.style-preview-minimal {
    background: linear-gradient(135deg, #eee 0%, #aaa 100%);
}

/* Download Section */
.download-section {
    margin-top: 18px;
}

.download-button {
    width: 100%;
    background: var(--green);
    color: #fff;
    border: 0;
    border-radius: 10px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 700;
    font-size: 18px;
    box-shadow: 0 4px 14px rgba(7, 91, 69, 0.25);
    transition: background 0.18s, transform 0.15s, box-shadow 0.18s;
}

.download-button:hover:not(:disabled) {
    background: var(--green-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(7, 91, 69, 0.3);
}

.download-button svg {
    width: 22px;
    height: 22px;
    stroke-width: 2;
}

.download-hint {
    font-size: 13px;
    color: var(--muted);
    text-align: center;
    margin: 8px 0 0;
}

/* Preview Panel */
.preview-panel {
    min-width: 0;
    position: sticky;
    top: 75px;
}

.preview-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 12px;
    padding: 0 2px;
}

.preview-heading > div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-heading h2 {
    font-size: 18px;
    margin: 0;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: #28a745;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.2);
}

.res-badge {
    font-size: 12px;
    color: var(--muted);
    background: #eef3ed;
    padding: 3px 8px;
    border-radius: 6px;
    font-family: Arial, sans-serif;
}

.canvas-stage {
    padding: 14px;
    background: #e4ebe2;
    border: 1px solid #d6ded4;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}

#greetingCanvas {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(7, 91, 69, 0.12);
    cursor: default;
    touch-action: pan-y;
}

#greetingCanvas.has-photo {
    touch-action: none;
    cursor: grab;
}

#greetingCanvas.is-dragging {
    cursor: grabbing;
}

.preview-help {
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    margin: 10px 0 0;
}

.preview-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 20px auto 0;
    color: var(--muted);
}

.preview-note > span {
    font-size: 28px;
    color: #bfa47e;
}

.preview-note p {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
}

.preview-note strong {
    color: var(--ink);
}

/* Mobile Quick Template Carousel */
.mobile-template-carousel-wrap {
    margin-top: 14px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
    box-shadow: var(--shadow-sm);
}

.carousel-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
}

.carousel-hint {
    font-size: 11px;
    color: var(--muted);
    font-weight: 400;
}

.template-carousel {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
}

.template-carousel::-webkit-scrollbar {
    height: 4px;
}

.template-carousel::-webkit-scrollbar-thumb {
    background: #c7d8cb;
    border-radius: 4px;
}

.template-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px 6px 6px;
    background: #f7faf7;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    flex-shrink: 0;
    scroll-snap-align: start;
    text-align: left;
    transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.template-chip:hover {
    border-color: #8bb799;
}

.template-chip.is-active,
.template-chip[aria-pressed="true"] {
    background: var(--green-light);
    border-color: var(--green);
    box-shadow: 0 0 0 1px var(--green);
}

.chip-thumb {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    flex-shrink: 0;
    border: 1px solid var(--line);
}

.chip-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center bottom;
}

.chip-info b {
    display: block;
    font-size: 12px;
    color: var(--green);
}

.chip-info span {
    display: block;
    font-size: 13px;
    color: var(--ink);
    white-space: nowrap;
}

/* Sticky Mobile Action Bar */
.mobile-action-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    padding: 10px 16px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.08);
    z-index: 100;
    gap: 10px;
}

.mobile-btn {
    border: none;
    border-radius: 10px;
    padding: 12px 16px;
    font-weight: 700;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.mobile-btn-primary {
    flex: 1;
    background: var(--green);
    color: #fff;
}

.mobile-btn-primary:active {
    background: var(--green-dark);
}

.mobile-btn-secondary {
    background: var(--green-light);
    color: var(--green);
    padding: 12px 14px;
}

/* Download Modal */
.download-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.download-modal[hidden] {
    display: none !important;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(14, 30, 22, 0.65);
    backdrop-filter: blur(6px);
}

.modal-card {
    position: relative;
    z-index: 1;
    background: #fff;
    width: 100%;
    max-width: 460px;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-lg);
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
    animation: modalPop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    border: none;
    background: #f0f4f1;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--muted);
    font-size: 14px;
    display: grid;
    place-items: center;
}

.modal-header .success-icon {
    display: inline-grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--green-light);
    color: var(--green);
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.modal-header h3 {
    margin: 0;
    font-size: 22px;
    color: var(--ink);
}

.modal-header p {
    margin: 4px 0 14px;
    font-size: 13px;
    color: var(--muted);
}

.modal-image-wrap {
    background: #f4f6f3;
    border-radius: 12px;
    padding: 8px;
    margin-bottom: 14px;
    border: 1px solid var(--line);
}

.modal-image-wrap img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.modal-mobile-guide {
    background: #fff9e6;
    border: 1px solid #fae19c;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 16px;
    text-align: left;
    font-size: 13px;
    line-height: 1.45;
    color: #634f19;
}

.modal-mobile-guide strong {
    display: block;
    color: #8c5d00;
    margin-bottom: 3px;
}

.modal-mobile-guide p {
    margin: 0;
}

.modal-actions {
    display: flex;
    gap: 10px;
}

.btn-modal-action {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 15px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-modal-primary {
    background: var(--green);
    color: #fff;
}

.btn-modal-share {
    background: var(--green-light);
    color: var(--green);
}

/* Page Footer */
.page-footer {
    max-width: 1140px;
    margin: 0 auto;
    padding: 24px 0;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    gap: 16px;
    color: var(--muted);
    font-size: 13px;
}

.noscript {
    padding: 18px;
    background: #fff1de;
    color: #884610;
    border-radius: 8px;
    text-align: center;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .studio {
        grid-template-columns: 360px minmax(0, 1fr);
        gap: 20px;
    }
    .template-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    h1 {
        font-size: 32px;
    }
    .anniversary-note > strong {
        font-size: 64px;
    }
    .anniversary-note b {
        font-size: 18px;
    }
}

/* Mobile Screens (<768px) */
@media (max-width: 768px) {
    main {
        padding: 16px 14px 90px; /* Space for sticky bar */
    }

    .site-header {
        position: static;
    }

    .header-inner {
        padding: 10px 14px;
    }

    .brand {
        width: 170px;
    }

    .home-link {
        font-size: 13px;
        padding: 5px 12px;
    }

    .intro {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 18px;
    }

    .anniversary-note {
        display: none;
    }

    h1 {
        font-size: 26px;
        line-height: 1.3;
    }

    .intro-copy {
        font-size: 14px;
        margin-top: 6px;
    }

    /* Template section at top: compact on mobile */
    .template-section {
        display: none; /* Hide huge top section on mobile; using quick carousel by preview */
    }

    /* Studio: preview goes first on mobile! */
    .studio {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .preview-panel {
        order: -1;
        position: static;
        width: 100%;
    }

    .canvas-stage {
        padding: 10px;
    }

    .preview-heading h2 {
        font-size: 16px;
    }

    .editor {
        padding: 18px 14px;
    }

    .editor-block {
        margin-bottom: 20px;
        padding-bottom: 18px;
    }

    .block-title {
        font-size: 16px;
    }

    .position-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .style-group {
        grid-template-columns: 1fr;
    }

    .download-button {
        font-size: 17px;
        padding: 14px;
    }

    /* Show sticky bottom bar on mobile */
    .mobile-action-bar {
        display: flex;
    }

    .page-footer {
        flex-direction: column;
        text-align: center;
        gap: 8px;
        padding: 16px 0;
        margin-bottom: 50px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 23px;
    }

    .pill-group {
        gap: 5px;
    }

    .pill-btn {
        padding: 5px 10px;
        font-size: 12px;
    }
}
