#dreamcore-editor {
  .app {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
    padding: 12px 16px calc(48px + env(safe-area-inset-bottom, 0px));
  }

  .nav-header {
    padding: 6px 4px 18px;
  }
  .nav-header .title {
    font-family: 'Shippori Mincho', "Hiragino Mincho ProN", serif;
    font-size: 36px;
    font-weight: 600;
    letter-spacing: 0.04em;
    margin: 0;
    color: var(--label);
  }
  .nav-header .tagline {
    font-size: 0.95rem;
    color: var(--label-2);
    line-height: 1.55;
    margin: 6px 0 0;
    max-width: 32em;
  }
  .nav-header .subtitle {
    display: none;
    font-size: 0.86rem;
    color: var(--label-2);
    margin: 5px 0 0;
  }

  /* ---- Account bar ---- */
  .account-bar {
    margin-top: 14px;
    display: flex;
    align-items: center;
    min-height: 36px;
  }
  .account-hint {
    font-size: 0.72rem;
    color: var(--label-2);
    line-height: 1.5;
    margin: 6px 0 0;
    max-width: 34em;
  }
  .plan-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }
  .plan-badge .avatar {
    width: 26px; height: 26px;
    border-radius: 50%;
    background: var(--fill-2);
    object-fit: cover;
  }
  .plan-pill {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--fill-2);
    color: var(--label);
    letter-spacing: 0.02em;
  }
  .plan-pill.standard { background: rgba(100,210,255,0.18); color: var(--accent-3); }
  .plan-pill.pro { background: rgba(191,90,242,0.2); color: var(--accent); }
  .text-btn {
    background: none;
    border: none;
    color: var(--accent-3);
    font-size: 0.8rem;
    font-weight: 500;
    padding: 4px 2px;
  }
  .text-btn:active { opacity: 0.6; }
  .text-btn.danger { color: var(--accent-2); }

  /* ---- Upgrade sheet (reuses the ad-sheet look) ---- */
  .upgrade-overlay {
    position: fixed; inset: 0; z-index: 50;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    display: flex; align-items: flex-end; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
  }
  .upgrade-overlay.show { opacity: 1; pointer-events: auto; }
  .upgrade-sheet {
    width: 100%; max-width: 480px;
    background: var(--group-bg);
    border-radius: 20px 20px 0 0;
    padding: 26px 22px calc(24px + env(safe-area-inset-bottom, 0px));
    text-align: center;
    transform: translateY(14px);
    transition: transform 0.2s ease;
  }
  .upgrade-overlay.show .upgrade-sheet { transform: translateY(0); }
  .plan-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 18px 0;
  }
  .plan-option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    text-align: left;
    background: var(--fill-2);
    border: none;
    border-radius: 14px;
    padding: 14px 16px;
    color: var(--label);
  }
  .plan-option strong { font-size: 0.95rem; }
  .plan-option span { font-size: 0.78rem; color: var(--label-2); }
  .plan-option:active { background: var(--fill); }

  /* ---- Ad overlay ---- */
  .ad-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }
  .ad-overlay.show { opacity: 1; pointer-events: auto; }
  .ad-sheet {
    width: 100%;
    max-width: 480px;
    background: var(--group-bg);
    border-radius: 20px 20px 0 0;
    padding: 26px 22px calc(24px + env(safe-area-inset-bottom, 0px));
    text-align: center;
    transform: translateY(14px);
    transition: transform 0.2s ease;
  }
  .ad-overlay.show .ad-sheet { transform: translateY(0); }
  .ad-tag {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--label-2);
    background: var(--fill-2);
    padding: 3px 9px;
    border-radius: 6px;
    margin-bottom: 16px;
  }
  .ad-icon {
    width: 46px; height: 46px;
    border-radius: 50%;
    background: var(--fill-2);
    color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 14px;
  }
  .ad-icon svg { width: 22px; height: 22px; }
  .ad-title { font-size: 1.05rem; font-weight: 600; margin: 0 0 6px; }
  .ad-desc { font-size: 0.85rem; color: var(--label-2); margin: 0 0 20px; line-height: 1.55; }
  .ad-progress {
    height: 4px; border-radius: 2px; background: var(--fill-2);
    overflow: hidden; margin-bottom: 10px;
  }
  .ad-progress-fill { height: 100%; width: 0%; background: var(--accent); transition: width 0.3s linear; }
  .ad-timer { font-size: 0.78rem; color: var(--label-2); margin: 0 0 18px; font-variant-numeric: tabular-nums; }
  .ad-claim-btn { width: 100%; justify-content: center; }

  /* ---- Preview card ---- */
  .preview-card {
    background: var(--group-bg);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 22px;
  }
  .stage {
    position: relative;
    min-height: 320px;
    background: #0A0A0B;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  #canvas {
    display: none;
    max-width: 100%;
    max-height: 58vh;
    width: auto;
    height: auto;
  }
  #canvas.ready { display: block; }

  .dropzone {
    width: 100%;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    color: var(--label-2);
  }
  .dropzone.drag { background: rgba(191,90,242,0.08); }
  .dropzone .icon {
    width: 46px; height: 46px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--fill-2);
    color: var(--accent);
    margin-bottom: 2px;
  }
  .dropzone .icon svg { width: 22px; height: 22px; }
  .dropzone strong { color: var(--label); font-weight: 590; font-size: 1.02rem; }
  .dropzone span.small { font-size: 0.84rem; color: var(--label-2); }
  .dropzone input[type=file] { display: none; }

  .toolbar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px;
    border-top: 0.5px solid var(--separator);
  }
  .toolbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }
  .toolbar-row .left {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .toolbar .status {
    font-size: 0.78rem;
    color: var(--label-2);
    text-align: center;
    line-height: 1.4;
    margin: 0;
  }
  .toolbar .status:empty { display: none; }

  button { font-family: inherit; cursor: pointer; color: inherit; }
  button:focus-visible, input:focus-visible, .dropzone:focus-visible {
    outline: 2px solid var(--accent-3);
    outline-offset: 2px;
  }

  .icon-btn {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--fill-2);
    border: none;
    display: flex; align-items: center; justify-content: center;
    color: var(--label);
    flex-shrink: 0;
  }
  .icon-btn svg { width: 18px; height: 18px; }
  .icon-btn:active { background: var(--fill); }
  .icon-btn:disabled { opacity: 0.35; }

  .pill-btn {
    border: none;
    background: var(--accent);
    color: #fff;
    font-size: 0.86rem;
    font-weight: 590;
    padding: 9px 18px;
    border-radius: 999px;
    flex-shrink: 0;
    display: flex; align-items: center; gap: 6px;
  }
  .pill-btn svg { width: 15px; height: 15px; }
  .pill-btn .spinner {
    display: none;
    width: 15px; height: 15px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
  }
  .pill-btn.loading #downloadIcon { display: none; }
  .pill-btn.loading .spinner { display: inline-block; }
  @keyframes spin { to { transform: rotate(360deg); } }
  .pill-btn:active { filter: brightness(0.9); }
  .pill-btn:disabled { opacity: 0.35; }

  /* ---- Groups (iOS grouped list) ---- */
  .group { margin-bottom: 22px; }
  .group-title {
    font-size: 0.8rem;
    font-weight: 590;
    color: var(--label-2);
    text-transform: uppercase;
    letter-spacing: 0.01em;
    padding: 0 16px 8px;
  }
  .footnote {
    font-size: 0.8rem;
    color: var(--label-2);
    padding: 8px 16px 0;
    line-height: 1.5;
    margin: 0;
  }

  /* ---- Filter filmstrip ---- */
  .filmstrip {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 4px 16px 6px;
    scrollbar-width: none;
  }
  .filmstrip::-webkit-scrollbar { display: none; }
  .swatch {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
    padding: 0;
  }
  .swatch .circle {
    width: 58px; height: 58px;
    border-radius: 50%;
    border: 2px solid transparent;
    padding: 2px;
  }
  .swatch .circle .fill {
    width: 100%; height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .swatch .circle .fill svg {
    width: 24px; height: 24px;
    color: rgba(255,255,255,0.92);
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.28));
  }
  .swatch.active .circle { border-color: var(--accent); }
  .swatch .label {
    font-size: 0.72rem;
    color: var(--label-2);
    max-width: 64px;
    text-align: center;
    line-height: 1.25;
  }
  .swatch.active .label { color: var(--label); font-weight: 590; }

  /* ---- Adjustment rows ---- */
  .rows {
    background: var(--group-bg);
    border-radius: 14px;
    overflow: hidden;
  }
  .row {
    padding: 11px 16px 13px;
    border-bottom: 0.5px solid var(--separator);
  }
  .row:last-child { border-bottom: none; }
  .row-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
  }
  .row-label { font-size: 0.95rem; color: var(--label); }
  .row-value {
    font-size: 0.85rem;
    color: var(--label-2);
    font-variant-numeric: tabular-nums;
  }

  input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: var(--fill-2);
    margin: 0;
  }
  input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 26px; height: 26px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.45), 0 0 0 0.5px rgba(0,0,0,0.1);
    cursor: pointer;
    margin-top: -11px;
  }
  input[type=range]::-moz-range-thumb {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: #ffffff;
    border: none;
    box-shadow: 0 1px 4px rgba(0,0,0,0.45);
    cursor: pointer;
  }
  input[type=range]::-moz-range-track {
    height: 4px;
    border-radius: 2px;
    background: var(--fill-2);
  }
  input[type=range]::-moz-range-progress {
    height: 4px;
    border-radius: 2px;
    background: var(--accent);
  }

  /* 「調整」セクションの表示/非表示はプランに応じてJSで制御します（.plan-locked） */
  #adjustmentsSection.plan-locked { display: none; }

  @media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
  }

}
