
        :root {
            --yr-dark: #0f2418;
            --yr-mint: #C5E8D1;
            --yr-mint-dark: #2D5F48;
            --yr-mint-light: #E4F2E9;
            --yr-white: #ffffff;
            --yr-gray: #5a7a68;
            --yr-light-gray: #d0ddd6;
            --yr-bg: #E4F2E9;
            --yr-gold: #2d5f48;
            --yr-serif: 'Playfair Display', Georgia, serif;
            --yr-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
        }
        * { margin: 0; padding: 0; box-sizing: border-box; }
        html, body { min-height: 0; }
        body {
            font-family: var(--yr-sans);
            background: transparent;
            color: var(--yr-dark);
            overflow-y: auto;
        }
        .container {
            display: flex; flex-direction: column;
            max-width: 700px; margin: 0 auto;
            padding: 8px 12px; gap: 6px;
        }
        .page-header { text-align: center; padding: 2px 0 2px; }
        .page-header h1 {
            font-family: var(--yr-serif); font-size: 18px; font-weight: 500;
            color: var(--yr-dark); margin-bottom: 0;
            white-space: nowrap;
        }
        .page-header h1 span.version {
            font-family: var(--yr-sans); font-size: 9px; font-weight: 400;
            color: var(--yr-gray); margin-left: 4px; display: none;
        }
        .info-toggle {
            display: inline-block; background: none; border: none; cursor: pointer;
            color: var(--yr-gold); font-size: 13px; font-weight: 500;
            font-family: var(--yr-sans); padding: 2px 0;
            text-decoration: underline; text-underline-offset: 2px;
            transition: color 0.2s;
        }
        .info-toggle:hover { color: var(--yr-dark); }
        .page-header .instructions {
            font-size: 13px; color: var(--yr-gray); line-height: 1.5;
            max-width: 560px; margin: 6px auto 0;
            overflow: hidden; transition: max-height 0.3s ease, opacity 0.2s ease;
            max-height: 0; opacity: 0;
        }
        .page-header.show-info .instructions {
            max-height: 200px; opacity: 1;
        }
        .page-header.show-info .info-toggle-text::after { content: 'Hide instructions'; }
        .page-header:not(.show-info) .info-toggle-text::after { content: 'How does this work?'; }
        .action-buttons {
            display: flex; gap: 8px; justify-content: center;
            max-width: 400px; margin: 0 auto; width: 100%;
            flex-shrink: 0;
        }
        .action-buttons .button { flex: 1; padding: 10px 14px; font-size: 14px; font-weight: 600; border-radius: 8px; }
        .sidebar { display: none; }
        .controls-panel {
            background: var(--yr-white); border-radius: 10px;
            border: 1px solid var(--yr-light-gray);
            overflow: hidden;
            box-shadow: 0 2px 12px rgba(0,0,0,0.06);
            max-width: 700px; margin: 0 auto; width: 100%;
        }
        .canvas-area { width: 100%; display: flex; justify-content: center; flex-shrink: 0; }
        #canvas-container {
            width: 100%; max-width: 700px; border-radius: 8px; overflow: hidden;
            border: 1px solid var(--yr-light-gray); background: white;
            box-shadow: 0 2px 8px rgba(0,0,0,0.06);
        }
        #canvas-container canvas { display: block; width: 100% !important; height: auto !important; }
        .loading {
            display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 12px;
            font-size: 14px; color: var(--yr-gray); padding: 60px 20px;
            font-family: var(--yr-sans);
        }
        .loading::before {
            content: ''; width: 28px; height: 28px;
            border: 3px solid var(--yr-light-gray); border-top-color: var(--yr-mint-dark);
            border-radius: 50%; animation: spin 0.8s linear infinite;
        }
        /* Tab navigation */
        .tab-bar {
            display: flex; border-bottom: 2px solid var(--yr-light-gray);
            flex-shrink: 0;
        }
        .tab-btn {
            flex: 1; padding: 14px 6px; font-size: 13px; font-weight: 500;
            font-family: var(--yr-sans);
            background: none; border: none; cursor: pointer;
            color: var(--yr-gray); transition: all 0.2s;
            border-bottom: 3px solid transparent; margin-bottom: -2px;
            text-align: center;
        }
        .tab-btn:hover { color: var(--yr-dark); background: var(--yr-mint-light); }
        .tab-btn.active {
            color: var(--yr-dark); font-weight: 600;
            border-bottom-color: var(--yr-gold);
        }
        .tab-panel { display: none; padding: 8px 14px 10px; }
        .tab-panel.active { display: block; }
        /* Controls */
        .seed-input {
            width: 100%; background: #f5f5f5; padding: 10px; border-radius: 6px;
            font-family: 'Courier New', monospace; font-size: 14px; margin-bottom: 10px;
            border: 1px solid var(--yr-light-gray); text-align: center;
        }
        .seed-input:focus { outline: none; border-color: var(--yr-gold); box-shadow: 0 0 0 2px rgba(45,95,72,0.25); background: white; }
        .seed-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
        .control-group { margin-bottom: 18px; }
        .control-group:last-child { margin-bottom: 0; }
        .control-group label { display: block; font-size: 12px; font-weight: 500; margin-bottom: 6px; color: var(--yr-dark); }
        .slider-container { display: flex; align-items: center; gap: 10px; }
        .slider-container input[type="range"] {
            flex: 1; height: 4px; background: var(--yr-light-gray);
            border-radius: 2px; outline: none; -webkit-appearance: none;
        }
        .slider-container input[type="range"]::-webkit-slider-thumb {
            -webkit-appearance: none; width: 28px; height: 28px;
            background: var(--yr-gold); border-radius: 50%; cursor: pointer;
            border: 2px solid white; box-shadow: 0 1px 4px rgba(0,0,0,0.2);
        }
        .slider-container input[type="range"]::-moz-range-thumb {
            width: 28px; height: 28px; background: var(--yr-gold);
            border-radius: 50%; border: 2px solid white; cursor: pointer;
            box-shadow: 0 1px 4px rgba(0,0,0,0.2);
        }
        .value-display { font-family: 'Courier New', monospace; font-size: 12px; color: var(--yr-gray); min-width: 50px; text-align: right; }
        .button {
            background: var(--yr-gold); color: #fff; border: none;
            padding: 10px 12px; border-radius: 8px; font-size: 13px; font-weight: 600;
            cursor: pointer; transition: all 0.2s ease; width: 100%;
            letter-spacing: 0.01em;
        }
        .button:hover { background: #2d5f48; transform: translateY(-1px); }
        .button:active { transform: translateY(0); }
        .button.secondary { background: var(--yr-dark); color: var(--yr-mint); }
        .button.secondary:hover { background: #1a3a28; }
        .button.tertiary { background: var(--yr-mint-light); color: var(--yr-dark); }
        .button.tertiary:hover { background: var(--yr-mint); }
        .button-row { display: flex; gap: 8px; }
        .button-row .button { flex: 1; }
        select.font-select {
            width: 100%; padding: 10px 12px; border-radius: 6px;
            border: 1px solid var(--yr-light-gray); background: #f5f5f5;
            font-size: 14px; font-family: var(--yr-sans); color: var(--yr-dark);
            cursor: pointer; margin-bottom: 6px;
        }
        select.font-select:focus { outline: none; border-color: var(--yr-gold); }
        .text-input-field {
            width: 100%; padding: 10px 12px; border-radius: 6px;
            border: 1px solid var(--yr-light-gray); background: #f5f5f5;
            font-size: 14px; font-family: var(--yr-sans); color: var(--yr-dark);
            margin-bottom: 6px;
        }
        .text-input-field:focus { outline: none; border-color: var(--yr-gold); }
        .scroll-hint {
            position: sticky; bottom: 12px;
            z-index: 100; pointer-events: none;
            text-align: center;
            animation: scrollBounce 2s ease-in-out infinite;
            transition: opacity 0.4s ease;
            margin-top: -48px;
        }
        .scroll-hint.hidden { opacity: 0; pointer-events: none; }
        .scroll-hint svg {
            width: 36px; height: 36px;
            filter: drop-shadow(0 2px 6px rgba(0,0,0,0.12));
        }
        @keyframes scrollBounce {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(8px); }
        }
        /* Thin scrollbar */
        html, .controls-panel { scrollbar-width: thin; scrollbar-color: var(--yr-light-gray) transparent; }
        html::-webkit-scrollbar, .controls-panel::-webkit-scrollbar { width: 6px; }
        html::-webkit-scrollbar-track, .controls-panel::-webkit-scrollbar-track { background: transparent; }
        html::-webkit-scrollbar-thumb, .controls-panel::-webkit-scrollbar-thumb { background: var(--yr-light-gray); border-radius: 3px; }
        html::-webkit-scrollbar-thumb:hover, .controls-panel::-webkit-scrollbar-thumb:hover { background: var(--yr-gray); }
        /* Save modal overlay (fallback for when share/download aren't available) */
        .save-modal-overlay {
            display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0,0,0,0.75); z-index: 9999;
            justify-content: center; align-items: center; flex-direction: column;
            padding: 20px; box-sizing: border-box;
        }
        .save-modal-overlay.active { display: flex; }
        .save-modal-box {
            background: white; border-radius: 12px; padding: 20px; max-width: 500px; width: 100%;
            text-align: center; position: relative; max-height: 90vh; overflow-y: auto;
        }
        .save-modal-box img {
            display: block;
            width: 100%;
            height: auto;
            max-width: 100%;
            max-height: 45vh;
            object-fit: contain;
            min-height: 0;
            border: 1px solid var(--yr-light-gray);
            border-radius: 6px;
            margin: 0 auto 16px;
            /* Prevent iOS callout suppression so long-press save works */
            -webkit-touch-callout: default !important;
            -webkit-user-select: auto !important;
            user-select: auto !important;
        }
        .save-modal-box .save-hint {
            font-family: var(--yr-sans); font-size: 14px; color: var(--yr-dark);
            margin-bottom: 14px; line-height: 1.5; padding-right: 36px;
        }
        .save-modal-box .save-hint strong { color: var(--yr-dark); }
        .save-modal-close {
            font-family: var(--yr-sans); font-size: 15px; font-weight: 500;
            background: var(--yr-dark); color: white; border: none; border-radius: 8px;
            padding: 10px 28px; cursor: pointer;
        }
        .save-modal-close:hover { background: #444; }
        .save-modal-x {
            position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; z-index: 1;
            border-radius: 50%; border: 2px solid var(--yr-gray); background: white;
            cursor: pointer; display: flex; align-items: center; justify-content: center;
            font-size: 18px; color: var(--yr-dark); line-height: 1; padding: 0;
            transition: background 0.15s, border-color 0.15s;
        }
        .save-modal-x:hover { background: var(--yr-light-gray); border-color: var(--yr-dark); }
        /* Save button loading & cooldown states */
        .button.saving {
            opacity: 0.6; pointer-events: none; position: relative;
        }
        .button.saving::after {
            content: ''; display: inline-block; width: 14px; height: 14px;
            border: 2px solid var(--yr-dark); border-top-color: transparent;
            border-radius: 50%; animation: spin 0.6s linear infinite;
            margin-left: 8px; vertical-align: middle;
        }
        @keyframes spin { to { transform: rotate(360deg); } }
        .button.cooldown { opacity: 0.5; pointer-events: none; }
        @media (min-width: 768px) {
            .container { padding: 24px; gap: 16px; }
            .page-header { padding: 8px 0 12px; }
            .page-header h1 { font-size: 26px; }
            .page-header h1 span.version { display: inline; }
            .page-header .instructions { font-size: 15px; max-height: 200px; opacity: 1; }
            .info-toggle { display: none; }
        }
    