      :root {
        --bg: #f7f7f8;
        --panel: #ffffff;
        --line: #ececf0;
        --line-2: #e4e1e8;
        --text: #1d1d22;
        --muted: #757884;
        --soft: #a5a8b2;
        --purple: #7664f6;
        --purple-2: #f2f0ff;
        --shadow: 0 18px 48px rgba(22, 24, 33, 0.08);
      }

      * {
        box-sizing: border-box;
      }

      [hidden] {
        display: none !important;
      }

      html,
      body {
        margin: 0;
        height: 100%;
        background: var(--bg);
        color: var(--text);
        font-family: Inter, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
      }

      button,
      textarea {
        font: inherit;
      }

      input {
        font: inherit;
      }

      button {
        cursor: pointer;
      }

      .app {
        height: 100vh;
        display: grid;
        grid-template-columns: 76px 1fr;
        background: var(--bg);
      }

      .rail {
        border-right: 1px solid var(--line);
        background: #fff;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 14px;
        padding: 15px 0 12px;
      }

      .logo {
        width: 28px;
        height: 28px;
        border-radius: 50%;
        background: #17171c;
        color: #fff;
        display: grid;
        place-items: center;
        font-size: 0.7rem;
        font-weight: 800;
      }

      .nav-icon {
        width: 36px;
        height: 36px;
        border: 0;
        background: transparent;
        color: #4b4d57;
        border-radius: 12px;
        display: grid;
        place-items: center;
        font-size: 1rem;
      }

      .nav-icon.active {
        color: #111116;
        background: #f4f4f6;
      }

      .help {
        margin-top: auto;
      }

      .rail-account {
        width: 62px;
        min-height: 58px;
        border: 0;
        border-radius: 16px;
        background: transparent;
        color: #17171c;
        display: grid;
        place-items: center;
        gap: 3px;
        padding: 7px 4px;
      }

      .rail-account:hover {
        background: #f4f4f6;
      }

      .rail-avatar {
        width: 30px;
        height: 30px;
        border-radius: 50%;
        background: #17171c;
        color: #fff;
        display: grid;
        place-items: center;
        font-size: 0.75rem;
        font-weight: 900;
      }

      .rail-account-meta {
        max-width: 58px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        color: var(--muted);
        font-size: 0.66rem;
        line-height: 1.1;
      }

      .page {
        min-width: 0;
        min-height: 0;
        display: grid;
        grid-template-rows: 48px 1fr;
        overflow: hidden;
      }

      .top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 14px;
        border-bottom: 1px solid var(--line);
        background: #fff;
      }

      .project-title {
        display: flex;
        align-items: center;
        gap: 10px;
      }

      .project-title h1 {
        margin: 0;
        font-size: 0.92rem;
        font-weight: 700;
      }

      .top-meta {
        color: var(--muted);
        font-size: 0.8rem;
        display: inline-flex;
        align-items: center;
        gap: 10px;
      }

      .support-chip {
        display: inline-flex;
        align-items: center;
        min-height: 26px;
        padding: 0 10px;
        border: 1px solid #e4e0ff;
        border-radius: 999px;
        background: #f7f5ff;
        color: #5a4bcf;
        font-size: 0.74rem;
        font-weight: 680;
        white-space: nowrap;
      }

      .user-chip {
        border: 1px solid var(--line);
        background: #fff;
        border-radius: 999px;
        height: 28px;
        padding: 0 10px;
        color: #4e515b;
        font-size: 0.75rem;
      }

      .credit-chip {
        border: 1px solid var(--line);
        background: #f7f7f8;
        border-radius: 999px;
        height: 28px;
        padding: 0 10px;
        color: #17171c;
        font-size: 0.75rem;
        display: inline-grid;
        place-items: center;
      }

      .hidden-chip {
        display: none !important;
      }

      .auth-modal {
        position: fixed;
        left: 14px;
        bottom: 84px;
        z-index: 40;
        display: none;
        width: 260px;
      }

      .auth-modal.active {
        display: block;
      }

      .production-reference-modal {
        position: fixed;
        inset: 0;
        z-index: 80;
        display: grid;
        place-items: center;
        padding: 24px;
        background: rgba(17, 17, 24, 0.28);
        backdrop-filter: blur(6px);
        overflow: auto;
      }

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

      .production-reference-card {
        width: min(560px, 100%);
        max-height: min(720px, calc(100dvh - 32px));
        overflow: auto;
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.98);
        border: 1px solid var(--line);
        box-shadow: 0 24px 80px rgba(18, 18, 24, 0.2);
        padding: 18px;
        display: grid;
        gap: 12px;
      }

      .production-reference-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
      }

      .production-reference-head h3 {
        margin: 0;
        font-size: 1rem;
      }

      .production-reference-close {
        border: 1px solid var(--line);
        background: #fff;
        color: var(--text);
        border-radius: 999px;
        padding: 6px 12px;
        font: inherit;
        cursor: pointer;
      }

      .production-reference-note {
        color: var(--muted);
        font-size: 0.84rem;
        line-height: 1.6;
      }

      .production-reference-version {
        color: #4b4d57;
        font-size: 0.78rem;
      }

      .production-reference-textarea {
        width: 100%;
        min-height: 132px;
        border-radius: 14px;
        border: 1px solid var(--line);
        background: #fff;
        padding: 14px 15px;
        font: inherit;
        color: var(--text);
        resize: vertical;
        line-height: 1.7;
      }

      .production-reference-textarea:focus {
        outline: none;
        border-color: rgba(104, 77, 255, 0.45);
        box-shadow: 0 0 0 3px rgba(104, 77, 255, 0.12);
      }

      .production-reference-actions {
        position: sticky;
        bottom: -18px;
        z-index: 2;
        display: flex;
        justify-content: flex-end;
        gap: 10px;
        flex-wrap: wrap;
        margin: 0 -18px -18px;
        padding: 12px 18px 18px;
        border-top: 1px solid rgba(225, 225, 232, 0.9);
        background: rgba(255, 255, 255, 0.96);
        box-shadow: 0 -10px 22px rgba(18, 18, 24, 0.06);
      }

      .production-reference-actions .composer-pill {
        min-height: 38px;
      }

      .auth-card {
        width: 100%;
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.96);
        border: 1px solid var(--line);
        padding: 14px;
        box-shadow: 0 18px 54px rgba(20, 20, 24, 0.16);
        backdrop-filter: blur(14px);
        animation: accountMenuIn 0.16s ease-out;
      }

      .auth-card h3 {
        margin: 0 0 10px;
        font-size: 0.9rem;
      }

      .auth-actions {
        margin-top: 8px;
        display: grid;
        gap: 7px;
      }

      .auth-actions .composer-pill {
        width: 100%;
        justify-content: flex-start;
      }

      .auth-note {
        min-height: 18px;
        margin-top: 12px;
        color: var(--muted);
        font-size: 0.76rem;
        line-height: 1.5;
      }

      .support-note {
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid #ececf2;
        color: #5a4bcf;
        font-weight: 680;
      }

      @keyframes accountMenuIn {
        from {
          opacity: 0;
          transform: translateY(8px) scale(0.98);
        }
        to {
          opacity: 1;
          transform: translateY(0) scale(1);
        }
      }

      .screen {
        min-height: 0;
        position: relative;
        overflow: hidden;
      }

      .projects {
        height: 100%;
        overflow: auto;
        padding: 64px 56px 48px;
      }

      .projects-shell {
        width: min(100%, 1580px);
      }

      .projects-hero {
        margin-bottom: 48px;
      }

      .hero-panel {
        max-width: 620px;
      }

      .hero-panel.demo {
        padding: 18px 20px;
        border-radius: 18px;
        border: 1px solid #ececf0;
        background:
          linear-gradient(135deg, rgba(118, 100, 246, 0.06), rgba(23, 23, 28, 0.02)),
          #fff;
      }

      .hero-title {
        margin: 0 0 12px;
        font-size: 2.2rem;
        line-height: 1.08;
        font-weight: 760;
      }

      .hero-subtitle {
        margin: 0;
        color: var(--muted);
        font-size: 0.96rem;
        line-height: 1.55;
      }

      .hero-actions {
        margin-top: 24px;
        display: flex;
        align-items: center;
        gap: 10px;
      }

      .hero-button {
        height: 40px;
        border-radius: 12px;
        padding: 0 15px;
        border: 1px solid #eceaf0;
        background: #fff;
        color: #23242b;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        font-size: 0.82rem;
        font-weight: 620;
      }

      .hero-button.primary {
        background: #18181d;
        color: #fff;
        border-color: #18181d;
      }

      .project-section-head {
        display: flex;
        align-items: end;
        justify-content: space-between;
        gap: 16px;
        margin-bottom: 14px;
      }

      .project-section-head h2 {
        margin: 0;
        font-size: 1.08rem;
        font-weight: 720;
      }

      .section-note {
        color: var(--muted);
        font-size: 0.8rem;
        display: none;
      }

      .demo-note {
        color: var(--muted);
        font-size: 0.84rem;
      }

      .project-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 14px;
      }

      .project-card {
        min-width: 0;
        padding: 10px;
        border-radius: 12px;
        background: #fff;
        border: 1px solid #eeeeef;
        box-shadow: none;
        cursor: pointer;
        position: relative;
      }

      .project-card.demo-card {
        cursor: default;
      }

      .project-card.featured {
        grid-column: span 2;
      }

      .project-delete {
        position: absolute;
        top: 16px;
        right: 16px;
        z-index: 8;
        height: 32px;
        padding: 0 12px;
        border: 1px solid rgba(185, 28, 28, 0.14);
        border-radius: 999px;
        background: #dc2626;
        color: #fff;
        font-size: 0.78rem;
        font-weight: 720;
        line-height: 1;
        display: inline-flex;
        align-items: center;
        gap: 4px;
        cursor: pointer;
        opacity: 0.96;
        box-shadow: 0 8px 22px rgba(220, 38, 38, 0.18);
        transition: background 140ms ease, color 140ms ease, opacity 140ms ease, transform 140ms ease, box-shadow 140ms ease;
      }

      .project-lock {
        position: absolute;
        top: 12px;
        right: 12px;
        z-index: 9;
        height: 28px;
        padding: 0 10px;
        border-radius: 999px;
        border: 1px solid rgba(23, 23, 28, 0.08);
        background: rgba(255, 255, 255, 0.92);
        color: #4d5058;
        font-size: 0.74rem;
        display: inline-flex;
        align-items: center;
      }

      .project-delete:hover {
        opacity: 1;
        background: #b91c1c;
        border-color: rgba(185, 28, 28, 0.3);
        color: #fff;
        transform: translateY(-1px);
        box-shadow: 0 10px 26px rgba(185, 28, 28, 0.24);
      }

      .project-confirm {
        position: absolute;
        inset: 10px;
        z-index: 12;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.94);
        border: 1px solid #eee9ef;
        backdrop-filter: blur(12px);
        display: grid;
        place-items: center;
        padding: 18px;
        box-shadow: 0 18px 42px rgba(24, 24, 29, 0.12);
      }

      .project-confirm-box {
        width: min(100%, 260px);
        display: grid;
        gap: 12px;
        text-align: center;
      }

      .project-confirm-title {
        font-size: 0.92rem;
        font-weight: 720;
      }

      .project-confirm-note {
        color: var(--muted);
        font-size: 0.76rem;
        line-height: 1.5;
      }

      .project-confirm-actions {
        display: flex;
        justify-content: center;
        gap: 8px;
      }

      .project-confirm-actions button {
        height: 32px;
        padding: 0 13px;
        border-radius: 999px;
        border: 1px solid #ececf0;
        background: #fff;
        color: #3f414b;
        font-size: 0.76rem;
      }

      .project-confirm-actions .danger {
        background: #18181d;
        border-color: #18181d;
        color: #fff;
      }

      .thumb {
        height: 186px;
        border-radius: 10px;
        border: 1px solid #eeeeef;
        background: #f7f7f8;
        overflow: hidden;
        position: relative;
      }

      .project-card.featured .thumb {
        height: 186px;
      }

      .new-thumb {
        display: grid;
        place-items: center;
        color: #6e7280;
        font-size: 1.7rem;
        background:
          radial-gradient(circle at top left, rgba(255, 255, 255, 0.95), transparent 48%),
          linear-gradient(180deg, #f8f6f9 0%, #f1edf3 100%);
      }

      .thumb.cover-thumb {
        background-size: cover;
        background-position: center;
      }

      .empty-projects {
        padding: 26px;
        border: 1px dashed #e3dfe7;
        border-radius: 22px;
        color: var(--muted);
        background: rgba(255, 255, 255, 0.62);
        font-size: 0.86rem;
      }

      .thumb-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        height: 100%;
      }

      .food-img {
        background-size: cover;
        background-position: center;
      }

      .project-meta {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-top: 12px;
      }

      .title-row {
        margin-top: 4px;
        font-weight: 650;
        font-size: 0.98rem;
      }

      .date-row {
        margin-top: 6px;
        color: var(--muted);
        font-size: 0.78rem;
      }

      .workspace {
        height: 100%;
        min-height: 0;
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(480px, 540px);
        overflow: hidden;
      }

      .canvas {
        position: relative;
        background: var(--bg);
        overflow-x: auto;
        overflow-y: hidden;
        display: grid;
        grid-template-rows: 56px minmax(0, 1fr) 96px;
        min-height: 0;
        isolation: isolate;
      }

      .canvas-topbar {
        padding: 14px 22px 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
      }

      .mode-tabs {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 4px;
        border: 1px solid transparent;
        border-radius: 999px;
        background: transparent;
      }

      .canvas-mode-tabs {
        visibility: hidden;
      }

      .mode-tab {
        height: 34px;
        padding: 0 14px;
        border: 0;
        border-radius: 999px;
        background: transparent;
        color: #7a7d88;
        font-size: 0.8rem;
        font-weight: 560;
      }

      .mode-tab.active {
        background: #f3f2f7;
        color: #17171c;
      }

      .status-badge {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        color: var(--muted);
        font-size: 0.77rem;
        display: none;
      }

      .status-dot {
        width: 8px;
        height: 8px;
        border-radius: 999px;
        background: #c9cad1;
      }

      .status-dot.generating {
        background: var(--purple);
      }

      .status-dot.error {
        background: #d94668;
      }

      .canvas-stage {
        padding: 14px 22px 18px;
        position: relative;
        z-index: 1;
        min-height: 0;
      }

      .canvas-frame {
        height: 100%;
        border: 0;
        border-radius: 12px;
        background: #f2f2f3;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        overflow: auto;
        overscroll-behavior: contain;
      }

      .canvas-wrapper {
        min-width: 100%;
        min-height: 100%;
        padding: 34px;
        display: grid;
        place-items: center;
      }

      .canvas-paper {
        width: min(100%, 760px);
        aspect-ratio: var(--paper-ratio, 4 / 5);
        background: transparent;
        border-radius: 0;
        box-shadow: none;
        border: 0;
        padding: 0;
        position: relative;
        overflow: visible;
        transform: scale(var(--canvas-zoom, 1));
        transform-origin: center center;
        transition: transform 120ms ease;
      }

      .zoom-controls {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 4px;
        border-radius: 999px;
        background: #fff;
        border: 1px solid #ececf0;
      }

      .zoom-button {
        min-width: 30px;
        height: 28px;
        border: 0;
        border-radius: 999px;
        background: transparent;
        color: #4e515b;
        font-size: 0.75rem;
        cursor: pointer;
        white-space: nowrap;
      }

      .zoom-button:hover {
        background: #f4f4f6;
      }

      .zoom-value {
        min-width: 44px;
        text-align: center;
        color: #6b6e79;
        font-size: 0.74rem;
        font-variant-numeric: tabular-nums;
      }

      .canvas-paper::before {
        display: none;
      }

      .safe-area {
        display: none;
      }

      .paper-meta {
        display: none;
      }

      .paper-meta strong {
        color: #24252d;
        font-weight: 680;
      }

      .empty-state {
        text-align: center;
        position: absolute;
        inset: 32px;
        display: grid;
        place-items: center;
        z-index: 2;
      }

      .empty-title {
        font-size: 1.02rem;
        font-weight: 620;
      }

      .empty-note {
        display: none;
      }

      .result-view {
        width: 100%;
        height: 100%;
        display: block;
        position: relative;
      }

      .result-art {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        border: 0;
        box-shadow: none;
      }

      .text-layer {
        position: absolute;
        inset: 0;
        z-index: 2;
      }

      .photo-layer {
        position: absolute;
        inset: 0;
        z-index: 3;
        pointer-events: none;
      }

      .photo-overlay {
        position: absolute;
        border: 2px solid rgba(118, 100, 246, 0.86);
        border-radius: 12px;
        background-size: cover;
        background-position: center;
        box-shadow: 0 10px 26px rgba(24, 24, 29, 0.16);
        cursor: move;
        pointer-events: auto;
        transform: translate(-50%, -50%);
      }

      .photo-overlay::after {
        display: none;
      }

      .photo-resize-handle {
        position: absolute;
        width: 14px;
        height: 14px;
        border-radius: 999px;
        background: #7664f6;
        border: 2px solid #fff;
        box-shadow: 0 4px 10px rgba(24, 24, 29, 0.18);
        display: none;
      }

      .photo-overlay.selected .photo-resize-handle {
        display: block;
      }

      .photo-resize-handle[data-resize-handle="n"] {
        top: -8px;
        left: calc(50% - 7px);
        cursor: ns-resize;
      }

      .photo-resize-handle[data-resize-handle="s"] {
        bottom: -8px;
        left: calc(50% - 7px);
        cursor: ns-resize;
      }

      .photo-resize-handle[data-resize-handle="e"] {
        right: -8px;
        top: calc(50% - 7px);
        cursor: ew-resize;
      }

      .photo-resize-handle[data-resize-handle="w"] {
        left: -8px;
        top: calc(50% - 7px);
        cursor: ew-resize;
      }

      .photo-resize-handle[data-resize-handle="ne"],
      .photo-resize-handle[data-resize-handle="nw"],
      .photo-resize-handle[data-resize-handle="se"],
      .photo-resize-handle[data-resize-handle="sw"] {
        cursor: nwse-resize;
      }

      .photo-resize-handle[data-resize-handle="ne"] {
        top: -8px;
        right: -8px;
      }

      .photo-resize-handle[data-resize-handle="nw"] {
        top: -8px;
        left: -8px;
      }

      .photo-resize-handle[data-resize-handle="se"] {
        right: -8px;
        bottom: -8px;
      }

      .photo-resize-handle[data-resize-handle="sw"] {
        left: -8px;
        bottom: -8px;
      }

      .photo-remove-button {
        position: absolute;
        top: -12px;
        right: -12px;
        width: 24px;
        height: 24px;
        border: 2px solid #fff;
        border-radius: 999px;
        background: #ef4444;
        color: #fff;
        font-size: 15px;
        font-weight: 800;
        line-height: 18px;
        display: grid;
        place-items: center;
        cursor: pointer;
        box-shadow: 0 6px 14px rgba(127, 29, 29, 0.22);
        display: none;
      }

      .photo-overlay.selected .photo-remove-button {
        display: grid;
      }

      .photo-tools {
        display: none;
        margin-top: 10px;
        padding: 12px;
        border: 1px solid #ececf0;
        border-radius: 16px;
        background: #f8f8fb;
        gap: 10px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: center;
      }

      .photo-tools.active {
        display: grid;
      }

      .photo-tools label {
        display: grid;
        gap: 4px;
        color: #6b6e79;
        font-size: 0.68rem;
        font-weight: 650;
      }

      .photo-tools label.wide {
        grid-column: 1 / -1;
      }

      .photo-tools input,
      .photo-tools select {
        min-width: 0;
        height: 30px;
        border: 1px solid #dedee7;
        border-radius: 10px;
        padding: 0 8px;
        background: #fff;
        color: #25262d;
        font: inherit;
      }

      .photo-tool-actions {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
      }

      .photo-tool-actions .composer-pill {
        width: 100%;
        justify-content: center;
        white-space: nowrap;
      }

      .reference-tools {
        display: none;
        margin-top: 10px;
        padding: 12px;
        border: 1px solid #ececf0;
        border-radius: 16px;
        background: #f8f8fb;
        gap: 10px;
        max-height: 220px;
        overflow: auto;
        overscroll-behavior: contain;
      }

      .reference-tools.active {
        display: grid;
      }

      .document-tools {
        display: none;
        margin-top: 10px;
        padding: 12px;
        border: 1px solid #ececf0;
        border-radius: 16px;
        background: #f8f8fb;
        gap: 8px;
      }

      .document-tools.active {
        display: grid;
      }

      .document-toolbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
        gap: 8px;
      }

      .document-clear-button {
        width: auto;
        min-height: 28px;
        padding: 0 10px;
        background: #fff;
      }

      .document-preview {
        max-height: 132px;
        overflow: auto;
        padding: 10px;
        border: 1px solid #e2e2ea;
        border-radius: 12px;
        background: #fff;
        color: #4b4d57;
        font-size: 0.72rem;
        line-height: 1.55;
        white-space: pre-wrap;
      }

      .document-structure {
        display: grid;
        gap: 8px;
      }

      .document-structure[hidden] {
        display: none !important;
      }

      .document-structure-head {
        display: flex;
        justify-content: space-between;
        gap: 10px;
        align-items: center;
        color: #6f7280;
        font-size: 0.72rem;
      }

      .document-structure-meta {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 8px 12px;
        align-items: center;
      }

      .document-structure-switcher {
        display: inline-flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-end;
        gap: 8px;
      }

      .document-structure-switcher[hidden] {
        display: none !important;
      }

      .document-structure-switcher .composer-pill {
        min-height: 28px;
        padding: 0 10px;
        background: #fff;
      }

      .document-structure-switcher .composer-pill:disabled {
        opacity: 0.45;
        cursor: default;
      }

      #documentTableSelect {
        min-width: 132px;
        min-height: 30px;
        padding: 0 10px;
        border: 1px solid #dedee8;
        border-radius: 999px;
        background: #fff;
        color: #4b4d57;
        font-size: 0.72rem;
      }

      #documentTableSummary {
        color: #7a7d8a;
        white-space: nowrap;
      }

      #documentTableSummary[hidden] {
        display: none !important;
      }

      #documentActiveTableLabel {
        min-width: 82px;
        text-align: center;
        color: #4b4d57;
      }

      @media (max-width: 720px) {
        .document-structure-head {
          align-items: start;
          flex-direction: column;
        }

        .document-structure-meta {
          width: 100%;
          justify-content: space-between;
        }
      }

      .document-table-preview {
        overflow: auto;
        border: 1px solid #e2e2ea;
        border-radius: 12px;
        background: #fff;
      }

      .document-table-preview table {
        width: 100%;
        border-collapse: collapse;
      }

      .document-table-preview td {
        min-width: 88px;
        padding: 7px 8px;
        border: 1px solid #ececf3;
        color: #3e414a;
        font-size: 0.72rem;
        line-height: 1.4;
        vertical-align: middle;
        background: #fff;
      }

      .document-table-preview td.merged-cell {
        background: #f7f6ff;
        color: #6b5bd2;
        font-weight: 600;
      }

      .document-table-preview td.merge-source-cell {
        background: #fff3df;
        color: #9a5a12;
        font-weight: 600;
      }

      .document-table-preview td.span-cell {
        background: #fffaf0;
      }

      .reference-upload-row {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
        gap: 8px;
      }

      .reference-guide {
        display: grid;
        gap: 5px;
        color: #6f7280;
        font-size: 0.74rem;
        line-height: 1.38;
      }

      .reference-guide strong {
        color: #30323b;
      }

      .reference-preview {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        max-height: 72px;
        overflow: auto;
        padding-right: 2px;
      }

      .reference-chip {
        width: 52px;
        height: 52px;
        border: 1px solid #dedee7;
        border-radius: 12px;
        background: #f2f2f5 center / cover no-repeat;
        position: relative;
        overflow: hidden;
      }

      .reference-chip::after {
        content: attr(data-role-label);
        position: absolute;
        left: 4px;
        bottom: 4px;
        max-width: calc(100% - 8px);
        padding: 1px 5px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.92);
        color: #272932;
        font-size: 0.62rem;
        font-weight: 720;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }

      .reference-chip button {
        position: absolute;
        top: 3px;
        right: 3px;
        width: 18px;
        height: 18px;
        border: 0;
        border-radius: 999px;
        padding: 0;
        background: rgba(23, 23, 28, 0.82);
        color: #fff;
        font-size: 0.7rem;
        line-height: 18px;
      }

      .canvas-photo-button {
        position: absolute;
        top: 14px;
        right: 14px;
        z-index: 7;
        height: 34px;
        padding: 0 14px;
        border: 1px solid rgba(255, 255, 255, 0.86);
        border-radius: 999px;
        background: linear-gradient(135deg, #7664f6, #a78bfa);
        color: #fff;
        font-weight: 760;
        font-size: 0.78rem;
        box-shadow: 0 12px 26px rgba(73, 59, 194, 0.24);
        cursor: pointer;
      }

      .canvas-photo-button:hover {
        transform: translateY(-1px);
        box-shadow: 0 16px 32px rgba(73, 59, 194, 0.28);
      }

      .mask-canvas {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        z-index: 5;
        cursor: crosshair;
        display: none;
        touch-action: none;
        outline: none;
        border: 0;
        box-shadow: none;
      }

      .editing-mask .mask-canvas {
        display: block;
      }

      .editing-mask .photo-layer {
        display: none;
      }

      .editing-mask .result-art {
        filter: saturate(0.92);
      }

      .mask-hint {
        position: absolute;
        left: 16px;
        bottom: 16px;
        z-index: 6;
        padding: 8px 10px;
        border-radius: 12px;
        background: rgba(24, 24, 29, 0.76);
        color: #fff;
        font-size: 0.72rem;
        backdrop-filter: blur(10px);
        display: none;
      }

      .editing-mask .mask-hint {
        display: block;
      }

      .loading-shell {
        position: absolute;
        inset: 32px;
        width: min(76%, 460px);
        display: grid;
        gap: 16px;
        align-content: center;
        justify-self: center;
        align-self: center;
        z-index: 2;
      }

      .loading-title {
        text-align: center;
        font-size: 0.92rem;
        font-weight: 700;
      }

      .progress-track {
        height: 10px;
        border-radius: 999px;
        background: #ece9f2;
        overflow: hidden;
      }

      .progress-bar {
        height: 100%;
        width: 0%;
        border-radius: inherit;
        background: linear-gradient(90deg, #7664f6 0%, #8b7df7 100%);
        transition: width 220ms linear;
      }

      .loading-note {
        text-align: center;
        color: var(--muted);
        font-size: 0.78rem;
      }

      .generation-leave-note {
        margin-top: 2px;
        padding: 9px 10px;
        border-radius: 12px;
        border: 1px solid #ddd8ff;
        background: #f5f2ff;
        color: #5547b8;
        font-size: 0.75rem;
        line-height: 1.45;
        text-align: center;
      }

      .generation-leave-note[hidden] {
        display: none;
      }

      .error-state {
        position: absolute;
        inset: 32px;
        z-index: 2;
        display: grid;
        place-items: center;
        text-align: center;
      }

      .error-card {
        width: min(78%, 380px);
        padding: 24px;
        border-radius: 24px;
        background: rgba(255, 255, 255, 0.92);
        border: 1px solid #f0d7df;
        box-shadow: 0 20px 44px rgba(122, 46, 72, 0.08);
      }

      .error-title {
        font-weight: 720;
        color: #9d294c;
      }

      .error-note {
        margin-top: 8px;
        color: #7b6570;
        font-size: 0.78rem;
        line-height: 1.55;
      }

      .retry-button {
        margin-top: 16px;
        height: 34px;
        padding: 0 14px;
        border-radius: 999px;
        border: 0;
        background: #18181d;
        color: #fff;
        font-weight: 680;
        font-size: 0.78rem;
      }

      .version-bar {
        min-height: 0;
        padding: 12px 22px 16px;
        display: flex;
        align-items: flex-end;
        scrollbar-width: thin;
        scrollbar-color: #d8d2ff transparent;
        gap: 10px;
        overflow: hidden;
        position: relative;
        z-index: 300;
      }

      .version-track {
        min-width: 0;
        flex: 1 1 auto;
        display: flex;
        gap: 10px;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 18px 10px 12px;
        scroll-padding: 18px 10px;
        align-items: flex-end;
        cursor: grab;
        scrollbar-width: thin;
        scrollbar-color: #d8d2ff transparent;
      }

      .version-track.dragging {
        cursor: grabbing;
        user-select: none;
        scroll-behavior: auto;
      }

      .version-track::-webkit-scrollbar {
        height: 8px;
      }

      .version-track::-webkit-scrollbar-track {
        background: transparent;
      }

      .version-track::-webkit-scrollbar-thumb {
        background: #d8d2ff;
        border-radius: 999px;
      }

      .version-pill {
        width: 92px;
        height: 68px;
        padding: 5px;
        border-radius: 16px;
        border: 1px solid #ececf0;
        background: rgba(255, 255, 255, 0.92);
        color: #585b68;
        display: grid;
        grid-template-columns: 46px minmax(0, 1fr);
        grid-template-rows: 1fr;
        gap: 6px;
        flex: 0 0 auto;
        font-size: 0.73rem;
        min-width: 92px;
        cursor: pointer;
        position: relative;
        overflow: visible;
        transform-origin: center bottom;
        transition: transform 190ms cubic-bezier(.2,.8,.2,1), box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
      }

      .version-pill:hover {
        z-index: 500;
        transform: translateY(-4px);
        background: #fff;
        border-color: #d8d2ff;
        box-shadow: 0 8px 18px rgba(24, 24, 29, 0.12);
      }

      .version-pill.active {
        background: #f7f5ff;
        border-color: #cfc7ff;
        color: #17171c;
        box-shadow: 0 8px 18px rgba(118, 100, 246, 0.16);
      }

      .version-thumb {
        display: block;
        width: 46px;
        height: 56px;
        border-radius: 12px;
        background-color: #f2f3f7;
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        border: 1px solid #f0eef5;
        overflow: hidden;
        position: relative;
        z-index: 1;
      }

      .version-copy {
        min-width: 0;
        align-self: center;
        position: relative;
        z-index: 2;
        transform-origin: left center;
        transition: none;
      }

      .version-label {
        font-weight: 600;
        line-height: 1.1;
      }

      .version-meta {
        display: block;
        margin-top: 2px;
        color: var(--muted);
        font-size: 0.63rem;
        line-height: 1.05;
      }

      .version-current {
        display: none;
      }

      .version-actions {
        display: none;
        align-items: center;
        gap: 3px;
        position: absolute;
        left: 50%;
        bottom: -13px;
        transform: translateX(-50%) scale(0.72);
        padding: 2px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.96);
        box-shadow: 0 10px 20px rgba(24, 24, 29, 0.14);
        white-space: nowrap;
        z-index: 30;
      }

      .version-pill:hover .version-actions,
      .version-pill.confirming-delete .version-actions {
        display: flex;
      }

      .version-edit {
        border: 1px solid #ddd6ff;
        background: #f6f4ff;
        color: #5748bf;
        font-size: 0.58rem;
        height: 15px;
        min-width: 22px;
        padding: 0 3px;
        border-radius: 999px;
        font-weight: 700;
      }

      .version-delete {
        border: 1px solid transparent;
        background: transparent;
        color: #8a8d97;
        font-size: 0.58rem;
        height: 15px;
        min-width: 22px;
        padding: 0 3px;
        border-radius: 999px;
        opacity: 1;
        transition: opacity 120ms ease, background 120ms ease, border-color 120ms ease, color 120ms ease;
      }

      .version-delete.confirm {
        min-width: 70px;
        background: #fff1f2;
        border-color: #fecdd3;
        color: #be123c;
        font-weight: 700;
      }

      .version-empty {
        color: var(--soft);
        font-size: 0.77rem;
        display: inline-flex;
        align-items: center;
      }

      .version-status {
        height: 34px;
        padding: 0 10px;
        border-radius: 12px;
        border: 1px solid #ececf0;
        background: #fff;
        color: #6b6e79;
        display: inline-flex;
        align-items: center;
        font-size: 0.75rem;
        white-space: nowrap;
      }

      #versionStatus {
        display: none;
      }

      #addTitleButton,
      .text-layer {
        display: none;
      }

      .title-block {
        position: absolute;
        min-width: 120px;
        max-width: 72%;
        padding: 10px 14px;
        border-radius: 12px;
        border: 1px solid transparent;
        color: #17171c;
        font-size: 2rem;
        font-weight: 760;
        line-height: 1.1;
        text-align: center;
        letter-spacing: 0;
        cursor: move;
        user-select: none;
        z-index: 4;
        outline: none;
        transform: translate(-50%, -50%);
        transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
      }

      .title-block:hover,
      .title-block.editing {
        border-color: #d9d2ff;
        background: rgba(255, 255, 255, 0.76);
        box-shadow: 0 8px 22px rgba(118, 100, 246, 0.08);
      }

      .title-block[contenteditable="true"] {
        cursor: text;
        user-select: text;
      }

      .title-block.core-values-title {
        min-width: min(54%, 620px);
        padding: 8px 16px;
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.86);
        font-size: clamp(0.95rem, 2.35vw, 1.8rem);
        color: #b91c1c;
        letter-spacing: 0.06em;
      }

      .title-block.core-values-line {
        min-width: min(58%, 660px);
        padding: 5px 12px;
        border-radius: 14px;
        font-size: clamp(0.74rem, 1.72vw, 1.22rem);
        color: #7f1d1d;
        line-height: 1.35;
        letter-spacing: 0.08em;
        background: rgba(255, 255, 255, 0.82);
      }

      .chat {
        border-left: 1px solid var(--line);
        background: #fff;
        display: grid;
        grid-template-rows: minmax(190px, 1fr) minmax(0, auto);
        min-height: 0;
        min-width: 480px;
        overflow: hidden;
      }

      .skill-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        position: relative;
        z-index: 2;
      }

      .skill {
        min-height: 36px;
        padding: 0 11px;
        border: 1px solid #f1eff3;
        border-radius: 999px;
        background: #fff;
        color: #31333b;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 0.74rem;
        white-space: nowrap;
        min-width: 0;
      }

      .skill.active {
        background: var(--purple-2);
        border-color: #ddd6ff;
        color: #22232b;
      }

      .skill.hidden-skill {
        display: none;
      }

      .panel-scroll {
        min-height: 0;
        overflow: auto;
        padding: 24px 28px 20px;
        scroll-padding-bottom: 84px;
      }

      .panel-group {
        margin-top: 16px;
      }

      .panel-group:first-child {
        margin-top: 0;
      }

      .panel-group h4 {
        margin: 0 0 10px;
        font-size: 0.75rem;
        font-weight: 600;
        color: var(--muted);
      }

      .step-badge {
        width: 22px;
        height: 22px;
        margin-right: 8px;
        border-radius: 999px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: #17171c;
        color: #fff;
        font-size: 0.72rem;
        font-weight: 780;
        line-height: 1;
        vertical-align: middle;
      }

      .prompt-card,
      .style-card,
      .ratio-card {
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
      }

      .prompt-card {
        padding: 0;
      }

      .safety-consent {
        margin-top: 10px;
        padding: 12px 13px;
        border: 1px solid #d9d5ff;
        border-radius: 12px;
        background: #f8f6ff;
        color: #424653;
        font-size: 0.78rem;
        line-height: 1.55;
      }

      .safety-consent label {
        display: grid;
        grid-template-columns: 22px 1fr;
        gap: 10px;
        align-items: start;
      }

      .safety-consent input {
        appearance: none;
        -webkit-appearance: none;
        width: 22px;
        height: 22px;
        margin: 1px 0 0;
        border: 2px solid #77718f;
        border-radius: 6px;
        background: #fff;
        display: grid;
        place-items: center;
        flex: 0 0 22px;
      }

      .safety-consent input::after {
        content: "";
        width: 9px;
        height: 5px;
        border-left: 2px solid #fff;
        border-bottom: 2px solid #fff;
        transform: rotate(-45deg) translate(1px, -1px);
        opacity: 0;
      }

      .safety-consent input:checked {
        border-color: #17171c;
        background: #17171c;
      }

      .safety-consent input:checked::after {
        opacity: 1;
      }

      .safety-consent input:focus-visible {
        outline: 3px solid rgba(118,100,246,.22);
        outline-offset: 2px;
      }

      .safety-warning {
        display: none;
        margin-top: 8px;
        color: #b42318;
        font-weight: 700;
      }

      .safety-warning.active {
        display: block;
      }

      .safety-consent a {
        color: #5f52d9;
        font-weight: 800;
        text-decoration: none;
      }

      textarea {
        width: 100%;
        min-height: 220px;
        border: 1px solid var(--line);
        outline: 0;
        resize: none;
        padding: 16px 18px;
        border-radius: 14px;
        color: #30323b;
        line-height: 1.7;
        font-size: 0.92rem;
        background: #fff;
      }

      #batchPromptBox,
      #editPromptBox,
      #productionReferencePromptBox {
        min-height: 132px;
        font-size: 0.84rem;
      }

      .batch-card {
        display: none;
        margin-top: 12px;
      }

      .prompt-suggestions {
        display: grid;
        gap: 8px;
        margin-top: 10px;
      }

      .prompt-suggestions[hidden] {
        display: none;
      }

      .suggestion-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
      }

      .suggestion-title {
        color: var(--muted);
        font-size: 0.74rem;
      }

      .suggestion-tags {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
      }

      .suggestion-tag {
        min-height: 30px;
        padding: 0 12px;
        border-radius: 999px;
        border: 1px dashed #ddd6ff;
        background: #f8f6ff;
        color: #5a50ba;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 0.74rem;
        font-weight: 560;
        transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, border-color 140ms ease;
      }

      .suggestion-tag:hover {
        transform: translateY(-1px);
        background: #f1edff;
        border-color: #cfc5ff;
        box-shadow: 0 8px 18px rgba(118, 100, 246, 0.12);
      }

      .suggestion-tag.active {
        border-style: solid;
        border-color: #7664f6;
        background: #ede9ff;
        color: #4737b7;
        box-shadow: 0 8px 18px rgba(118, 100, 246, 0.14);
      }

      .batch-card.active {
        display: block;
      }

      .batch-card textarea {
        min-height: 128px;
      }

      .batch-actions {
        display: flex;
        justify-content: flex-start;
        gap: 8px;
        align-items: center;
        flex-wrap: wrap;
        margin-top: 10px;
      }

      .batch-controls {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
      }

      .batch-count {
        width: 84px;
        height: 32px;
        border: 1px solid var(--line);
        border-radius: 10px;
        padding: 0 10px;
        background: #fff;
        color: #30323b;
      }

      .wall-production-preview {
        margin-top: 10px;
        border: 1px solid #e5e5eb;
        border-radius: 14px;
        background: #fff;
        overflow: hidden;
        display: none;
      }

      .wall-production-preview.active {
        display: block;
      }

      .wall-production-preview img {
        display: block;
        width: 100%;
        max-height: 260px;
        object-fit: contain;
        background: #fafafa;
      }

      .wall-production-preview-note {
        padding: 8px 10px;
        border-top: 1px solid #ececf0;
        color: #686b75;
        font-size: 0.72rem;
        line-height: 1.5;
      }

      .inline-count {
        width: 72px;
        height: 30px;
        border-radius: 999px;
        font-size: 0.75rem;
        text-align: center;
      }

      .batch-status {
        color: var(--muted);
        font-size: 0.74rem;
        line-height: 1.45;
        white-space: pre-wrap;
      }

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

      .field {
        display: grid;
        gap: 6px;
      }

      .field label {
        color: var(--muted);
        font-size: 0.72rem;
      }

      .field input {
        width: 100%;
        height: 36px;
        border: 1px solid var(--line);
        border-radius: 12px;
        padding: 0 11px;
        background: #fff;
        color: #30323b;
        outline: 0;
      }

      .style-card,
      .ratio-card {
        padding: 0;
      }

      .inline-filter {
        margin-bottom: 8px;
      }

      .inline-filter input {
        width: 100%;
        height: 34px;
        border: 1px solid #ececf0;
        border-radius: 999px;
        background: #fff;
        padding: 0 14px;
        color: #30323b;
        font-size: 0.76rem;
      }

      .size-priority-note {
        margin-top: 8px;
        color: var(--muted);
        font-size: 0.72rem;
        line-height: 1.45;
      }

      .ratio-card.disabled-by-size {
        opacity: 0.52;
      }

      .ratio-card.disabled-by-size .tag-button {
        pointer-events: none;
      }

      .group-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
      }

      .group-pill {
        height: 24px;
        padding: 0 10px;
        border-radius: 999px;
        background: #f3f2f7;
        color: #5f6270;
        font-size: 0.72rem;
        display: inline-flex;
        align-items: center;
      }

      .core-shell {
        display: grid;
        gap: 16px;
      }

      .subtle-label {
        color: var(--muted);
        font-size: 0.72rem;
        font-weight: 520;
      }

      .advanced-shell {
        margin-top: 16px;
        display: grid;
        gap: 18px;
      }

      .advanced-header {
        display: grid;
        gap: 4px;
      }

      .advanced-title {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
      }

      .advanced-title strong {
        font-size: 0.82rem;
        color: #30323b;
      }

      .advanced-meta {
        color: var(--muted);
        font-size: 0.74rem;
      }

      .advanced-body {
        display: grid;
        gap: 16px;
      }

      .advanced-toggle-row {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 10px;
        flex-wrap: wrap;
      }

      .advanced-toggle-button {
        min-height: 34px;
        border: 1px solid #e9e6f2;
        border-radius: 12px;
        background: #fff;
        color: #4d4f5a;
        padding: 0 14px;
        font-size: 0.76rem;
        font-weight: 650;
        box-shadow: 0 2px 6px rgba(20, 20, 24, 0.04);
      }

      .advanced-toggle-button:hover {
        border-color: #d8d0ff;
        color: #4a3fb5;
        box-shadow: 0 8px 18px rgba(20, 20, 24, 0.08);
      }

      .advanced-toggle-button.active {
        background: #f3efff;
        border-color: #d8d0ff;
        color: #4a3fb5;
      }

      .advanced-toggle-note {
        color: var(--muted);
        font-size: 0.72rem;
        line-height: 1.45;
      }

      .panel-group.condensed {
        margin: 0;
      }

      .style-tags,
      .ratio-tags {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        position: relative;
        z-index: 2;
      }

      .tag-button {
        min-height: 34px;
        padding: 0 14px;
        border-radius: 12px;
        border: 1px solid #e9e6f2;
        background: #fff;
        color: #4d4f5a;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 0.76rem;
        font-weight: 560;
        box-shadow: 0 2px 6px rgba(20, 20, 24, 0.04);
        transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, background 140ms ease, color 140ms ease;
      }

      .tag-button:hover {
        transform: translateY(-1px);
        box-shadow: 0 8px 18px rgba(20, 20, 24, 0.08);
      }

      .tag-button.active {
        background: linear-gradient(135deg, #f3efff 0%, #ece8ff 100%);
        border-color: #d8d0ff;
        color: #4a3fb5;
        box-shadow: 0 10px 22px rgba(118, 100, 246, 0.12);
      }

      .composer-wrap {
        padding: 10px 14px 12px;
        background: #fff;
        border-top: 1px solid var(--line);
        min-height: 0;
        max-height: min(68vh, calc(100vh - 160px));
        overflow: auto;
        overscroll-behavior: contain;
      }

      .composer {
        border: 1px solid #ececf2;
        border-radius: 14px;
        background: #fff;
        box-shadow: 0 10px 28px rgba(24, 24, 32, 0.055);
        padding: 10px;
        min-height: 0;
      }

      .composer-summary {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(88px, auto);
        align-items: center;
        gap: 8px;
        margin-bottom: 10px;
        padding: 10px 10px;
        border-radius: 12px;
        background: #fafaff;
        border: 1px solid #ececf4;
      }

      .summary-main {
        min-width: 0;
        display: grid;
        gap: 5px;
      }

      .summary-title {
        color: #1f2230;
        font-size: 0.9rem;
        line-height: 1.2;
        font-weight: 680;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: flex;
        align-items: center;
        gap: 0;
      }

      .summary-details {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 2px 7px;
        color: #626775;
        font-size: 0.73rem;
        line-height: 1.28;
      }

      .summary-details span {
        display: inline-flex;
        align-items: center;
        min-width: 0;
      }

      .summary-details span + span::before {
        content: "";
        width: 3px;
        height: 3px;
        margin-right: 7px;
        border-radius: 999px;
        background: #c8cad5;
      }

      .summary-cost {
        flex: 0 0 auto;
        min-width: 88px;
        padding: 6px 7px;
        border-radius: 11px;
        border: 1px solid #d8d0ff;
        background: #f4f0ff;
        color: #5c4fcb;
        display: grid;
        justify-items: end;
        gap: 0;
        font-size: 0.66rem;
        line-height: 1.16;
        text-align: right;
        white-space: nowrap;
        box-shadow: 0 8px 18px rgba(99, 102, 241, 0.09);
      }

      .summary-cost .credit-label {
        color: #7469cf;
        font-weight: 650;
      }

      .summary-cost strong {
        color: #493bc2;
        font-size: 0.88rem;
        font-weight: 760;
      }

      .summary-cost .credit-balance {
        color: #7469cf;
        font-weight: 620;
      }

      .summary-cost.low {
        background: #fff1f2;
        border-color: #fecdd3;
        color: #be123c;
        box-shadow: 0 10px 24px rgba(225, 29, 72, 0.1);
      }

      .summary-cost.low .credit-label,
      .summary-cost.low .credit-balance,
      .summary-cost.low strong {
        color: #be123c;
      }

      .local-storage-note {
        margin: -2px 0 10px;
        padding: 7px 9px;
        border: 1px solid #e5e7ee;
        border-radius: 11px;
        background: #fbfbfd;
        color: #646976;
        font-size: 0.68rem;
        line-height: 1.45;
      }

      .local-storage-note strong {
        color: #4f46c8;
        font-weight: 760;
      }

      .composer-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
      }

      .composer-meta {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        color: var(--muted);
        font-size: 0.74rem;
        min-width: 0;
        width: 100%;
      }

      .composer-meta #copyVersionButton {
        order: 9;
      }

      .composer-pill {
        width: 100%;
        min-height: 30px;
        padding: 0 11px;
        border-radius: 10px;
        border: 1px solid #e5e7ee;
        background: #f7f8fb;
        color: #414553;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 0.72rem;
        font-weight: 600;
        white-space: nowrap;
        box-shadow: 0 2px 6px rgba(20, 20, 24, 0.04);
        transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease;
      }

      .composer-pill:hover {
        transform: translateY(-1px);
        background: #eef0f6;
        box-shadow: 0 10px 22px rgba(20, 20, 24, 0.08);
      }

      .composer-pill.active {
        background: linear-gradient(135deg, #6b5cf6 0%, #a78bfa 100%);
        border-color: transparent;
        color: #fff;
        box-shadow: 0 12px 26px rgba(107, 92, 246, 0.22);
      }

      .edit-tools {
        display: none;
        gap: 8px;
        align-items: center;
        margin-top: 12px;
      }

      .edit-tools.active {
        display: grid;
        grid-template-columns: 1fr;
      }

      .edit-tools textarea {
        min-height: 76px;
      }

      .edit-actions {
        display: flex;
        gap: 8px;
        justify-content: flex-end;
      }

      #copyVersionButton {
        display: none;
      }

      .generate-button {
        width: 100%;
        min-width: 0;
        height: 40px;
        border: 0;
        border-radius: 12px;
        background: linear-gradient(135deg, #6366f1 0%, #a78bfa 100%);
        color: #fff;
        font-size: 0.92rem;
        font-weight: 700;
        white-space: nowrap;
        box-shadow: 0 14px 28px rgba(99, 102, 241, 0.24);
        transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
        display: inline-flex;
        align-items: center;
        justify-content: center;
      }

      .generate-button .step-badge {
        background: rgba(255, 255, 255, 0.94);
        color: #4f46e5;
      }

      .generate-button:hover {
        transform: translateY(-1px) scale(1.01);
        box-shadow: 0 18px 34px rgba(99, 102, 241, 0.28);
        filter: saturate(1.04);
      }

      .generate-button:active,
      .composer-pill:active,
      .tag-button:active {
        transform: scale(0.98);
      }

      .generate-button:disabled {
        opacity: 0.72;
      }

      .generate-button.generating {
        background: #6153cf;
      }

      .generate-button.error {
        background: #9d294c;
      }

      @media (max-width: 390px) {
        .safety-consent {
          padding: 10px;
          font-size: 0.72rem;
        }

        .safety-consent label {
          grid-template-columns: 24px 1fr;
          gap: 8px;
        }

        .safety-consent input {
          width: 22px;
          height: 22px;
          border-radius: 7px;
          flex-basis: 22px;
        }

        .composer-summary {
          grid-template-columns: minmax(0, 1fr) 82px;
          gap: 6px;
        }

        .summary-cost {
          min-width: 82px;
          padding-inline: 6px;
        }

        .composer-pill {
          padding: 0 9px;
          font-size: 0.7rem;
        }

        .generate-button {
          min-width: 88px;
        }
      }

      .projects-mode .workspace {
        display: none;
      }

      .workspace-mode .projects {
        display: none;
      }

      @media (max-width: 1100px) {
        .projects-hero {
          grid-template-columns: 1fr;
        }

        .workspace {
          grid-template-columns: 1fr;
        }

        .chat {
          position: absolute;
          right: 0;
          top: 0;
          bottom: 0;
          width: min(540px, 94vw);
          min-width: 0;
        }

        .composer-wrap {
          max-height: min(58vh, calc(100vh - 190px));
        }

        .project-grid {
          grid-template-columns: 1fr 1fr;
        }
      }

      @media (max-width: 720px) {
        .projects {
          padding: 24px 18px 28px;
        }

        .hero-title {
          font-size: 2rem;
        }

        .project-grid {
          grid-template-columns: 1fr;
        }

        .project-card.featured {
          grid-column: span 1;
        }

        .canvas {
          grid-template-rows: auto 1fr auto;
        }

        .canvas-topbar,
        .canvas-stage,
        .version-bar {
          padding-left: 16px;
          padding-right: 16px;
        }
      }
