/* ==========================================
   ScriptForge Pro — Design System
   SaaS Notion-style Bento Grid Aesthetic
   ========================================== */

/* --- Reset --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
button { font-family: inherit; font-size: inherit; border: none; background: none; cursor: pointer; color: inherit; }
ol, ul { list-style: none; }
a { text-decoration: none; color: inherit; }
input, textarea, select { font-family: inherit; color: inherit; }
textarea { resize: vertical; }

/* --- Custom Properties: Light Theme (Default / Normal) --- */
:root {
  --bg-primary: #FDFBF7;      /* Warm oat cheese white */
  --bg-secondary: #F5F1E9;    /* Soft wheat */
  --bg-secondary: #F2ECE2;    /* Slightly darker paper */
  --bg-tertiary: #E8DFD3;     /* Darker paper for active states */

  --text-primary: #2C2A29;    /* Soft charcoal black */
  --text-secondary: #5C5652;  /* Secondary text */
  --text-muted: #8C847A;      /* Muted text */

  --border: #D1C9C0;          /* Warm grey border */
  --border-light: #E8DFD3;    /* Light warm grey divider */

  --text-green: #059669; --text-red: #DC2626;
  --pastel-pink: #F3D3D9; --pastel-blue: #D3E0EA; --pastel-yellow: #EADCB9; --pastel-green: #D3EAD8; --pastel-purple: #E0D3EA;
  --accent: #D10A14; --accent-text: #FAF6F0;

  --font-display: "Outfit", system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif; --font-body: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif; --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  --sidebar-width: 260px; --topbar-height: 72px; --actionbar-height: 80px;
  --radius-card: 20px; --radius-btn: 12px; --radius-pill: 999px;
  --shadow-sm: 2px 2px 0 var(--border); --shadow-md: 4px 4px 0 var(--border); --shadow-lg: 6px 6px 0 var(--border);
  --border-width: 2px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1); --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-micro: 150ms; --dur-ui: 200ms; --dur-transition: 300ms; --dur-enter: 400ms;
}

/* --- Custom Properties: Dark Theme (Eye-care Dark) --- */
[data-theme="dark"] {
  --bg-primary: #1E1C1A;      /* Warm dark grey */
  --bg-secondary: #272421;    /* Slightly lighter warm dark grey */
  --bg-tertiary: #302C29;     /* Tertiary warm dark grey */

  --text-primary: #E5DEC9;    /* Warm off-white */
  --text-secondary: #AFA695;  /* Muted warm off-white */
  --text-muted: #847C6E;      /* Very muted warm off-white */

  --border: #575047;          /* Soft border */
  --border-light: #3E3831;    /* Soft divider */

  --text-green: #34D399; --text-red: #F87171;
  --pastel-pink: #582B35; --pastel-blue: #22374E; --pastel-yellow: #513F26; --pastel-green: #243E2C; --pastel-purple: #3B2A4A;
  --accent: #E62E37; --accent-text: #FFFFFF;
}

/* --- Global --- */
body { font-family: var(--font-body); font-size: 15px; font-weight: 500; line-height: 1.6; color: var(--text-primary); background-color: var(--bg-primary); transition: background-color var(--dur-transition) var(--ease-out), color var(--dur-transition) var(--ease-out); }

/* Utility Classes */
.mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.w-full { width: 100%; } .max-w-lg { max-width: 600px; margin: 0 auto; }
.text-green { color: var(--text-green); font-weight: bold; } .text-red { color: var(--text-red); font-weight: bold; }
.flex-row { display: flex; align-items: center; }

/* APP LAYOUT */
.app-layout { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
.main-body { flex: 1; display: flex; overflow: hidden; }

/* SIDEBAR (Wizard Workflow) */
.sidebar { width: var(--sidebar-width); flex-shrink: 0; background-color: var(--bg-primary); border-right: var(--border-width) solid var(--border); display: flex; flex-direction: column; z-index: 20; overflow-y: auto; }
.wizard-sidebar-header { padding: 24px 24px 16px; font-family: var(--font-display); font-size: 18px; font-weight: 700; border-bottom: 2px solid var(--border-light); }

.vertical-steps { display: flex; flex-direction: column; gap: 20px; padding: 24px; }
.v-step { display: flex; align-items: flex-start; gap: 12px; cursor: default; transition: all 0.3s var(--ease-bounce); position: relative; }
.v-step-num { font-family: var(--font-mono); font-weight: 700; font-size: 13px; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border: 2px solid var(--border); border-radius: 50%; background: var(--bg-secondary); color: var(--text-muted); z-index: 2; transition: all 0.3s var(--ease-bounce);}
.v-step.active .v-step-num { background: var(--pastel-blue); border-color: var(--accent); color: var(--text-primary); box-shadow: var(--shadow-sm); transform: scale(1.1); }
.v-step.active::before { content: ''; position: absolute; left: -24px; top: 0; bottom: 0; width: 3px; background: var(--accent); border-radius: 3px; animation: pulseRed 2s infinite; }
@keyframes pulseRed { 0% { opacity: 0.5; box-shadow: 0 0 0 rgba(209,10,20,0); } 50% { opacity: 1; box-shadow: 0 0 8px rgba(209,10,20,0.3); } 100% { opacity: 0.5; box-shadow: 0 0 0 rgba(209,10,20,0); } }
.v-step.done .v-step-num { background: var(--pastel-green); border-color: var(--border); color: var(--text-primary); }


.v-step-info { display: flex; flex-direction: column; gap: 2px; }
.v-step-title { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--text-muted); transition: all 0.3s var(--ease-bounce); }
.v-step-desc { font-size: 12px; color: var(--text-muted); opacity: 0.7; transition: all 0.3s var(--ease-bounce); }
.v-step.active .v-step-title, .v-step.done .v-step-title { color: var(--text-primary); }
.v-step.active .v-step-desc, .v-step.done .v-step-desc { color: var(--text-secondary); opacity: 1; }
.v-step.done { cursor: pointer; }
.v-step.done:hover { transform: translateX(2px); }
.v-step:not(:last-child)::after { content: ''; position: absolute; left: 13px; top: 28px; bottom: -20px; width: 2px; background: var(--border); opacity: 0.3; z-index: 1; }
.v-step.done:not(:last-child)::after { background: var(--border); opacity: 1; }

/* MAIN CONTENT */
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; background-color: var(--bg-secondary); background-image: radial-gradient(var(--border-light) 1px, transparent 1px); background-size: 20px 20px; }

/* TOP BAR (Global Nav) */
.topbar { flex-shrink: 0; height: var(--topbar-height); display: flex; align-items: center; justify-content: space-between; padding: 0 32px; border-bottom: var(--border-width) solid var(--border); background-color: var(--bg-primary); z-index: 10; }
.topbar-left { display: flex; align-items: center; gap: 40px; }
.logo { display: flex; align-items: center; font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: -0.02em; cursor: pointer; user-select: none; }
.logo-icon { display: inline-block; width: 16px; height: 16px; background-color: var(--pastel-yellow); border: 2px solid var(--border); border-radius: 50%; margin-right: 12px; }
.logo-text em { font-style: normal; color: var(--bg-primary); background: var(--text-primary); padding: 2px 6px; border-radius: 6px; font-size: 14px; margin-left: 4px; }
.top-nav { display: flex; gap: 8px; align-items: center; height: 100%; }
.nav-btn { font-family: var(--font-display); font-weight: 600; padding: 8px 16px; border-radius: var(--radius-pill); color: var(--text-secondary); transition: all 0.3s var(--ease-bounce); border: 2px solid transparent; }
.nav-btn:hover { background-color: var(--bg-secondary); color: var(--text-primary); }
.nav-btn.active { background-color: var(--pastel-purple); color: var(--text-primary); border-color: var(--border); box-shadow: var(--shadow-sm); transform: translate(-1px, -1px); }
.dashboard-header-info h2 { font-family: var(--font-display); font-size: 24px; margin: 0; }
.topbar-right { display: flex; align-items: center; gap: 24px; }

/* User Profile in Topbar */
.user-profile { display: flex; align-items: center; gap: 12px; cursor: pointer; padding: 8px; border-radius: var(--radius-btn); transition: all 0.3s var(--ease-bounce); border: 2px solid transparent;}
.user-profile:hover { background: var(--bg-secondary); border-color: var(--border); transform: translate(-1px,-1px); box-shadow: var(--shadow-sm);}
.avatar { width: 40px; height: 40px; border: 2px solid var(--border); border-radius: 50%; background-color: var(--pastel-blue); display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-weight: 700; }
.user-info { display: flex; flex-direction: column; }
.user-name { font-weight: 600; font-size: 14px; }
.user-plan { font-size: 12px; color: var(--text-muted); }
.credits-display { display: flex; align-items: center; border: 2px solid var(--border); border-radius: var(--radius-pill); padding: 4px 4px 4px 16px; background: var(--bg-primary); box-shadow: var(--shadow-sm); cursor: pointer; transition: transform 0.2s; }
.credits-display:hover { transform: translate(-1px, -1px); box-shadow: var(--shadow-md); }
.credits-label { font-weight: 600; font-size: 13px; margin-right: 8px; }
.credits-val { font-family: var(--font-mono); font-weight: 700; font-size: 16px; color: var(--pastel-pink); text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000; margin-right: 12px; }
[data-theme="dark"] .credits-val { text-shadow: none; }
.unlock-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 20px; padding: 16px 20px;
  border: 2px solid var(--border); border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--pastel-yellow) 0%, var(--bg-primary) 100%);
  box-shadow: var(--shadow-sm);
}
.unlock-banner-text { display: flex; flex-direction: column; gap: 4px; }
.unlock-banner-text strong { font-size: 15px; }
.unlock-banner-text span { font-size: 13px; color: var(--text-secondary); }
@media (max-width: 640px) {
  .unlock-banner { flex-direction: column; align-items: stretch; }
}
.credits-add { background: var(--border); color: var(--bg-primary); width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; }

.theme-toggle { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border: var(--border-width) solid var(--border); border-radius: 50%; background-color: var(--bg-primary); box-shadow: var(--shadow-sm); transition: transform 0.2s; }
.theme-toggle:hover { transform: translate(-1px, -1px); box-shadow: var(--shadow-md); }
.theme-toggle svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* WORKSPACE & VIEWS */
.workspace { flex: 1; display: flex; justify-content: center; overflow-y: auto; overflow-x: hidden; padding: 40px; }
.workspace-inner { width: 100%; max-width: 1120px; }
.view-container { display: none; }
.view-container.active { display: block; animation: fadeIn var(--dur-enter) var(--ease-out); }

/* DASHBOARD & ASSETS */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.project-card { border: 2px solid var(--border); border-radius: var(--radius-card); padding: 24px; background: var(--bg-primary); box-shadow: var(--shadow-md); transition: transform 0.3s var(--ease-bounce), box-shadow 0.2s var(--ease-out); display: flex; flex-direction: column; }
.project-card:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-lg); }
/* ARCHIVED CARDS */
.project-card.archived-card { opacity: 0.65; border-color: var(--border-light); background-color: var(--bg-secondary); position: relative; overflow: hidden; pointer-events: none; }
.project-card.archived-card .project-actions { pointer-events: auto; position: relative; z-index: 2; }
.project-card.archived-card::before { content: 'ARCHIVED'; position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%) rotate(-15deg); font-family: var(--font-display); font-size: 44px; font-weight: 900; color: var(--text-muted); opacity: 0.15; pointer-events: none; z-index: 1; }
.archived-card .tag-badge { background-color: var(--bg-tertiary) !important; color: var(--text-muted) !important; border-color: transparent !important; }
.archived-card .project-badge { background-color: var(--bg-tertiary) !important; color: var(--text-muted) !important; }
.new-project-card { background: var(--bg-secondary); border-style: dashed; align-items: center; justify-content: center; text-align: center; cursor: pointer; }
.new-project-card .card-icon { font-size: 32px; color: var(--text-muted); margin-bottom: 12px; }
.card-header-flex { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px;}
.project-badge { font-size: 12px; font-family: var(--font-mono); font-weight: 700; padding: 4px 8px; border: 2px solid var(--border); border-radius: var(--radius-pill); display: inline-block; margin-bottom: 16px; align-self: flex-start; }
.file-format-badge { font-size: 11px; font-weight: bold; border: 2px solid var(--border); border-radius: 6px; padding: 2px 6px;}
.format-pdf { background: #FCA5A5; } .format-word { background: #93C5FD; }
.bg-pink { background-color: var(--pastel-pink); } .bg-blue { background-color: var(--pastel-blue); } .bg-green { background-color: var(--pastel-green); } .bg-pastel-yellow { background-color: var(--pastel-yellow); } .bg-pastel-blue { background-color: var(--pastel-blue); }
.project-title { font-family: var(--font-display); font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.project-meta { font-size: 13px; color: var(--text-muted); flex: 1; }
.project-actions { margin-top: 24px; display: flex; justify-content: space-between; }
.project-actions button { font-family: var(--font-mono); font-weight: 700; font-size: 12px; border: 2px solid var(--border); padding: 6px 12px; border-radius: var(--radius-pill); background: var(--bg-primary); box-shadow: 2px 2px 0 var(--border); }
.assets-filter { display: flex; gap: 12px; margin-bottom: 24px; }
.filter-tab { font-family: var(--font-display); font-weight: bold; padding: 8px 16px; border: 2px solid var(--border); border-radius: var(--radius-pill); background: var(--bg-primary); transition: all 0.3s var(--ease-bounce);}
.filter-tab.active { background: var(--border); color: var(--bg-primary); }

/* BENTO CARDS (GENERAL) */
.billing-bento-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 24px; }
.bento-card { border: 2px solid var(--border); border-radius: var(--radius-card); padding: 32px; background: var(--bg-primary); box-shadow: var(--shadow-md); }
.col-span-2 { grid-column: span 2; }
.bento-card h4 { font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.bento-card h2 { font-family: var(--font-display); font-size: 32px; font-weight: 700; margin: 8px 0 24px; }

/* PROGRESS BAR */
.progress-wrapper { margin-top: 16px; }
.progress-labels { display: flex; justify-content: space-between; font-size: 13px; font-family: var(--font-mono); font-weight: bold; margin-bottom: 8px;}
.progress-bar { width: 100%; height: 16px; border: 2px solid var(--border); border-radius: var(--radius-pill); background: var(--bg-primary); overflow: hidden; }
.progress-fill { height: 100%; background: var(--border); border-right: 2px solid var(--border); }

/* BENTO TABLES */
.table-responsive { overflow-x: auto; }
.bento-table { width: 100%; border-collapse: separate; border-spacing: 0; text-align: left; }
.bento-table th { font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--text-muted); padding: 12px 16px; border-bottom: 2px dashed var(--border-light); text-transform: uppercase; }
.bento-table td { padding: 16px; border-bottom: 1px solid var(--border-light); font-size: 14px; font-weight: 600;}
.bento-table tr:last-child td { border-bottom: none; }
.btn-text { font-family: var(--font-mono); font-weight: bold; text-decoration: underline; color: var(--text-secondary); }

/* FORMS & INPUTS */
.bento-form { display: flex; flex-direction: column; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group label { font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--text-secondary); }
.bento-input { width: 100%; padding: 12px 16px; font-family: var(--font-body); font-size: 15px; border: 2px solid var(--border); border-radius: var(--radius-btn); background: var(--bg-primary); outline: none; box-shadow: inset 2px 2px 0 rgba(0,0,0,0.05); transition: all 0.3s var(--ease-bounce); caret-color: var(--accent); }
.bento-input:focus { box-shadow: 0 0 8px rgba(209, 10, 20, 0.15); border-color: rgba(209, 10, 20, 0.3); }
.bento-input:disabled { background: var(--bg-tertiary); color: var(--text-muted); cursor: not-allowed; }

/* TOGGLE SWITCHES */
.toggle-group { display: flex; justify-content: space-between; align-items: center; padding: 16px; border: 2px solid var(--border-light); border-radius: var(--radius-btn); margin-bottom: 12px; }
.toggle-info h5 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.toggle-info p { font-size: 12px; color: var(--text-muted); }
.bento-toggle { position: relative; display: inline-block; width: 48px; height: 28px; }
.bento-toggle input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--bg-secondary); border: 2px solid var(--border); border-radius: 28px; transition: .4s; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: var(--border); border-radius: 50%; transition: .4s; }
input:checked + .slider { background-color: var(--pastel-green); }
input:checked + .slider:before { transform: translateX(20px); }

/* TIMELINE */
.timeline { display: flex; flex-direction: column; gap: 24px; position: relative; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 10px; bottom: 10px; width: 2px; border-left: 2px dashed var(--border); }
.timeline-item { display: flex; gap: 16px; position: relative; z-index: 1; }
.timeline-dot { width: 16px; height: 16px; border: 2px solid var(--border); border-radius: 50%; background: var(--bg-primary); flex-shrink: 0; margin-top: 4px; }
.timeline-content h5 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.timeline-content p { font-size: 14px; color: var(--text-secondary); margin-bottom: 8px; }
.timeline-date { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); font-weight: bold; background: var(--bg-secondary); padding: 2px 8px; border-radius: 6px; border: 1px solid var(--border-light);}

/* SETTINGS PROFILE */
.settings-wrapper { display: flex; justify-content: center; }
.settings-avatar-section { display: flex; align-items: center; gap: 24px; padding-bottom: 24px; border-bottom: 2px dashed var(--border-light); }

/* WIZARD SPECIFIC (Preserved) */
.step-content { display: none; opacity: 0; }
.step-content.active { display: flex; flex-direction: column; gap: 32px; animation: fadeInUp var(--dur-enter) var(--ease-out) forwards; }
.step-header { margin-bottom: 8px; }
.step-number { font-family: var(--font-mono); font-size: 14px; font-weight: 700; color: var(--text-primary); background-color: var(--pastel-yellow); border: var(--border-width) solid var(--border); padding: 4px 12px; border-radius: var(--radius-pill); display: inline-block; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.step-title { font-family: var(--font-display); font-size: 40px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 12px; line-height: 1.1; }
.step-desc { font-size: 16px; color: var(--text-secondary); max-width: 600px; }
.curve-carousel-container { display: flex; align-items: center; gap: 16px; position: relative; margin-bottom: 8px;}
.carousel-btn { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--border); background: var(--bg-primary); font-family: var(--font-mono); font-weight: bold; font-size: 18px; box-shadow: var(--shadow-sm); flex-shrink: 0; z-index: 2; transition: all 0.3s var(--ease-bounce); display: flex; align-items: center; justify-content: center;}
.carousel-btn:hover { background: var(--bg-secondary); transform: translate(-1px, -1px); box-shadow: var(--shadow-md); }
.carousel-btn:disabled { opacity: 0.3; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.curve-carousel-viewport { flex: 1; overflow: hidden; border-radius: var(--radius-card); padding: 4px; }
.curve-grid { display: flex; transition: transform 0.5s var(--ease-out); width: 100%; gap: 20px; }
.curve-page { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; width: 100%; flex-shrink: 0; }
.curve-card { width: 100%; min-height: 380px; justify-content: flex-start; border: var(--border-width) solid var(--border); border-radius: var(--radius-card); padding: 24px; cursor: pointer; background-color: var(--bg-primary); box-shadow: var(--shadow-md); transition: transform 0.3s var(--ease-bounce), box-shadow 0.2s var(--ease-out), background-color 0.2s; display: flex; flex-direction: column; }
.curve-card:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-lg); }
.curve-card:active, .curve-card.selected { transform: translate(2px, 2px); box-shadow: var(--shadow-sm); }
.curve-card.selected { background-color: var(--card-accent, var(--pastel-blue)); }
.curve-illustration { height: 180px; margin-bottom: 32px; display: flex; align-items: center; justify-content: center; }
.curve-illustration svg { width: 100%; height: 100%; overflow: visible; }
.blob-fill { transition: fill 0.3s; }
.line-stroke { fill: none; stroke: var(--text-primary); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.curve-name { font-family: var(--font-display); font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.curve-desc { font-size: 15px; color: var(--text-secondary); }

/* Audience toggle and locking */
.audience-toggle-bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.audience-toggle { display: inline-flex; border: var(--border-width) solid var(--border); border-radius: var(--radius-pill); background-color: var(--bg-primary); padding: 4px; box-shadow: var(--shadow-sm); }
.audience-btn { padding: 10px 32px; font-family: var(--font-display); font-weight: 700; color: var(--text-secondary); border-radius: var(--radius-pill); transition: all 0.3s var(--ease-bounce); }
.audience-btn.active { background-color: var(--border); color: var(--bg-primary); }
.audience-btn:disabled { opacity: 0.35; cursor: not-allowed; text-decoration: line-through; }
.audience-btn:disabled:hover { transform: none; box-shadow: none; background-color: transparent; color: var(--text-muted); }

.audience-lock-hint { display: inline-flex; align-items: center; gap: 8px; border: 2px solid var(--border); background-color: var(--pastel-yellow); padding: 6px 12px; border-radius: var(--radius-pill); font-size: 13px; font-weight: 700; box-shadow: var(--shadow-sm); animation: fadeIn 0.3s ease-out; }
.lock-icon { font-size: 14px; }
.lock-text { color: var(--text-primary); }

/* Tag section bento optimization */
.tag-bento-container { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.tag-section-card { border: 2px solid var(--border); border-radius: var(--radius-card); padding: 24px 24px 32px 24px; background-color: var(--bg-primary); box-shadow: var(--shadow-md); display: flex; flex-direction: column; }
.tag-section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.tag-section-title { font-family: var(--font-display); font-size: 20px; font-weight: 700; margin: 0; display: flex; align-items: center; gap: 8px; }
.tag-section-title::before { content: ''; display: block; width: 12px; height: 12px; border: 2px solid var(--border); border-radius: 50%; }
.tag-section-card:nth-child(1) .tag-section-title::before { background-color: var(--pastel-blue); }
.tag-section-card:nth-child(2) .tag-section-title::before { background-color: var(--pastel-green); }

.tag-counter { font-family: var(--font-mono); font-size: 13px; font-weight: bold; color: var(--text-muted); background: var(--bg-secondary); padding: 2px 8px; border: 2px solid var(--border); border-radius: var(--radius-pill); margin-left: 6px; }

.tag-clear-btn { font-family: var(--font-display); font-size: 12px; font-weight: 700; color: var(--text-red); border: 2px solid var(--border); border-radius: var(--radius-pill); background: var(--bg-primary); padding: 4px 12px; box-shadow: 1px 1px 0 var(--border); transition: 0.1s; cursor: pointer; }
.tag-clear-btn:hover { transform: translate(-1px, -1px); box-shadow: 2px 2px 0 var(--border); }
.tag-clear-btn:active { transform: translate(1px, 1px); box-shadow: none; }

.tag-search-wrapper { display: flex; align-items: center; position: relative; margin-bottom: 16px; width: 100%; }
.tag-search-input { width: 100%; padding: 10px 16px 10px 36px; border: 2px solid var(--border); border-radius: var(--radius-btn); font-family: var(--font-body); font-size: 14px; background: var(--bg-secondary); outline: none; transition: all 0.3s var(--ease-bounce); }
.tag-search-input:focus { background: var(--bg-primary); border-color: var(--border); box-shadow: var(--shadow-sm); }
.tag-search-wrapper .search-icon { position: absolute; left: 12px; font-size: 14px; color: var(--text-muted); pointer-events: none; }

.tag-scroll-container { max-height: 250px; overflow-y: auto; padding-right: 6px; margin-top: 4px; }
/* Bento Styled Scrollbar */
.tag-scroll-container::-webkit-scrollbar { width: 8px; }
.tag-scroll-container::-webkit-scrollbar-track { background: var(--bg-secondary); border-left: 2px solid var(--border); }
.tag-scroll-container::-webkit-scrollbar-thumb { background: var(--border); border: 2px solid var(--border); border-radius: 4px; }
[data-theme="dark"] .tag-scroll-container::-webkit-scrollbar-track { border-left: 2px solid var(--border); }

.tag-group { display: flex; flex-wrap: wrap; gap: 10px; padding-bottom: 8px; }
.tag-item { font-size: 13px; font-weight: 600; padding: 6px 12px; border: 2px solid var(--border); border-radius: var(--radius-pill); background-color: var(--bg-secondary); cursor: pointer; box-shadow: 2px 2px 0 var(--border); opacity: 0; transform: translateY(8px); animation: fadeInUp 0.3s forwards; transition: background-color var(--dur-micro) var(--ease-out), transform 0.1s, box-shadow 0.1s; }
.tag-item:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--border); }
.tag-item.selected { background-color: var(--pastel-yellow); transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--border); }
.tag-item.conflict { opacity: 0.5; border-color: var(--border-light); color: var(--text-muted); background-color: transparent; box-shadow: none; }
.alert-banner { display: flex; align-items: flex-start; gap: 12px; background-color: var(--pastel-yellow); border: 2px solid var(--border); border-radius: var(--radius-btn); padding: 12px 16px; margin-bottom: 24px; box-shadow: var(--shadow-sm); animation: fadeIn 0.3s ease-out; }
.alert-icon { font-size: 18px; line-height: 1.4;}
.alert-text { font-size: 14px; font-weight: 600; color: var(--text-primary); line-height: 1.5; }
.autosave-toast { font-size: 12px; color: var(--text-muted); font-family: var(--font-mono); text-align: right; margin-top: 16px; }
.recap-bento { border: 2px solid var(--border); border-radius: var(--radius-card); padding: 24px 32px; background-color: var(--pastel-purple); box-shadow: var(--shadow-md); margin-bottom: 24px; display: flex; flex-wrap: wrap; gap: 24px; }
.recap-item { display: flex; flex-direction: column; gap: 4px; }
.recap-label { font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--text-primary); opacity: 0.6; }
.recap-value { font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.prompt-bento { border: 2px solid var(--border); border-radius: var(--radius-card); padding: 32px; background-color: var(--bg-primary); box-shadow: var(--shadow-md); }
.prompt-input { width: 100%; min-height: 160px; padding: 20px; font-size: 16px; background-color: var(--bg-secondary); border: 2px dashed var(--border-light); border-radius: var(--radius-btn); outline: none; transition: all 0.3s var(--ease-bounce); }
.prompt-input:focus { border-style: solid; border-color: var(--border); background-color: var(--bg-primary); }
.quick-inject { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 12px; }
.inject-btn { font-family: var(--font-mono); font-size: 13px; font-weight: 600; padding: 8px 16px; border: 2px solid var(--border); border-radius: var(--radius-pill); background-color: var(--bg-primary); box-shadow: 2px 2px 0 var(--border); }
.inject-btn:hover { background-color: var(--pastel-pink); }

.keyword-slots-bento { border: 2px solid var(--border); border-radius: var(--radius-card); padding: 24px 32px; background: var(--bg-primary); box-shadow: var(--shadow-md); margin-bottom: 24px; }
.keyword-slots-title { font-family: var(--font-display); font-size: 18px; font-weight: 700; margin: 0 0 8px; }
.keyword-slots-desc { font-size: 14px; color: var(--text-secondary); margin: 0 0 20px; }
.keyword-slot-field { margin-bottom: 20px; }
.keyword-slot-field:last-child { margin-bottom: 0; }
.keyword-slot-label { display: block; margin-bottom: 8px; font-family: var(--font-mono); font-weight: 700; font-size: 14px; }
.keyword-slot-label .required-mark { color: var(--accent); margin-left: 4px; }
.keyword-slot-hint { display: block; margin-top: 6px; font-size: 12px; color: var(--text-muted); }
.keyword-slot-error { margin-top: 16px; padding: 12px 16px; border: 2px solid var(--text-red); border-radius: var(--radius-btn); background: rgba(209, 10, 20, 0.08); color: var(--text-red); font-size: 13px; font-weight: 600; display: none; }
.btn-download[disabled], .btn-download.btn-download-pending { opacity: 0.55; cursor: not-allowed; }
.gen-progress-bento { border: 2px solid var(--border); border-radius: var(--radius-card); padding: 40px; background-color: var(--pastel-yellow); box-shadow: var(--shadow-md); text-align: center; }
.gen-spinner { width: 48px; height: 48px; border: 4px solid var(--border); border-top-color: transparent; border-radius: 50%; margin: 0 auto 24px; animation: spin 1s linear infinite; }
.gen-progress-text { font-family: var(--font-mono); font-size: 14px; font-weight: 600; line-height: 2; text-align: left; max-width: 400px; margin: 0 auto; background: var(--bg-primary); border: 2px solid var(--border); border-radius: var(--radius-btn); padding: 24px; box-shadow: 4px 4px 0 rgba(0,0,0,0.1); }
.gen-progress-text .line { opacity: 0; animation: fadeIn 0.2s forwards; }
.result-bento { border: 2px solid var(--border); border-radius: var(--radius-card); background-color: var(--bg-primary); box-shadow: var(--shadow-md); overflow: hidden; display: flex; flex-direction: column; }
.result-tabs { display: flex; border-bottom: 2px solid var(--border); background-color: var(--pastel-blue); }
.result-tab { flex: 1; text-align: center; font-family: var(--font-display); font-weight: 700; padding: 16px 20px; border-right: 2px solid var(--border); }
.result-tab.active { background-color: var(--bg-primary); }
.result-panel { display: none; padding: 40px; }
.result-panel.active { display: block; animation: fadeInUp 0.3s forwards; }
.result-episode { margin-bottom: 24px; padding-left: 20px; border-left: 4px solid var(--border); }
.result-episode-title { font-family: var(--font-display); font-size: 18px; font-weight: 700; margin-bottom: 8px; }

/* ACTION BAR */
.actionbar { flex-shrink: 0; height: var(--actionbar-height); display: flex; align-items: center; justify-content: space-between; border-top: var(--border-width) solid var(--border); background-color: var(--bg-primary); padding: 0 40px;}
.btn-secondary { font-family: var(--font-display); font-weight: 700; padding: 12px 24px; border: 2px solid var(--border); border-radius: var(--radius-pill); background-color: var(--bg-primary); box-shadow: var(--shadow-sm); }
.btn-secondary:hover:not(:disabled) { background-color: var(--bg-secondary); }
.btn-primary { font-family: var(--font-display); font-weight: 700; padding: 12px 32px; color: var(--accent-text); background: linear-gradient(135deg, var(--accent) 0%, #B70911 100%); border: 2px solid var(--border); border-radius: var(--radius-pill); box-shadow: 0 6px 20px rgba(209, 10, 20, 0.2); transition: all 0.3s var(--ease-bounce); }
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(209, 10, 20, 0.3); }
.btn-secondary:disabled, .btn-primary:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; background: var(--bg-tertiary); color: var(--text-muted); border-color: var(--border-light); }
.progress-dots { display: flex; gap: 12px; align-items: center; }
.dot { width: 12px; height: 12px; border: 2px solid var(--border); border-radius: 50%; }
.dot.active { background-color: var(--text-primary); transform: scale(1.3); }

/* MODALS */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.4); backdrop-filter: blur(4px); z-index: 100; display: none; opacity: 0; transition: opacity 0.3s; }
.modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -40%); width: 90%; max-width: 500px; background: var(--bg-primary); border: 2px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-lg); z-index: 101; display: none; opacity: 0; transition: opacity 0.3s, transform 0.3s; }
.modal.active { display: block; opacity: 1; transform: translate(-50%, -50%); }
.modal-overlay.active { display: block; opacity: 1; }
.modal-close { position: absolute; top: 20px; right: 20px; font-family: var(--font-mono); font-weight: bold; cursor: pointer; border: 2px solid var(--border); width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm); background: var(--bg-primary);}
.modal-close:hover { background: var(--bg-secondary); }
.modal-header { padding: 32px 32px 16px; border-bottom: 2px solid var(--border-light); text-align: center; }
.modal-header h3 { font-family: var(--font-display); font-size: 24px; margin-bottom: 8px; }
.modal-header p { color: var(--text-muted); font-size: 14px; }
.modal-body { padding: 32px; }

/* Login Modal */
.login-options { display: flex; border: 2px solid var(--border); border-radius: var(--radius-pill); overflow: hidden; margin-bottom: 24px;}
.login-tab { flex: 1; padding: 12px; font-weight: bold; }
.login-tab.active { background: var(--border); color: var(--bg-primary); }
.qr-placeholder { border: 2px dashed var(--border-light); height: 160px; display: flex; align-items: center; justify-content: center; background: var(--bg-secondary); border-radius: var(--radius-card); margin-bottom: 24px; font-family: var(--font-mono); color: var(--text-muted);}
.agreement-box { margin-bottom: 24px; font-size: 13px; display: flex; align-items: center; }
.checkbox-label { display: flex; align-items: center; cursor: pointer; }
.checkbox-label input { display: none; }
.custom-checkbox { width: 18px; height: 18px; border: 2px solid var(--border); border-radius: 4px; margin-right: 8px; position: relative; }
.checkbox-label input:checked + .custom-checkbox::after { content: '✓'; position: absolute; top: -2px; left: 2px; font-weight: bold; }
.modal-btn-main { width: 100%; padding: 16px; font-size: 18px; }

/* Payment Modal */
#modalPayment { max-width: 600px; }
.plan-cards { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.plan-card { border: 2px solid var(--border); border-radius: 12px; padding: 16px; text-align: center; }
.plan-card.recommended { background: var(--pastel-yellow); transform: translateY(-8px); box-shadow: var(--shadow-md); border-width: 3px;}
.plan-card h4 { font-family: var(--font-display); font-size: 16px; margin-bottom: 8px; }
.plan-price { font-family: var(--font-mono); font-size: 20px; font-weight: bold; margin-bottom: 8px;}
.plan-price span { font-size: 12px; font-weight: normal; }
.plan-card p { font-size: 12px; color: var(--text-secondary); margin-bottom: 16px; }
.plan-btn { width: 100%; border: 2px solid var(--border); padding: 8px; border-radius: var(--radius-pill); font-weight: bold; font-size: 12px; background: var(--bg-primary); box-shadow: 2px 2px 0 var(--border);}
.plan-card.recommended .plan-btn { background: var(--accent); color: var(--accent-text); }
.pay-simulation { background: var(--bg-secondary); padding: 16px; border-radius: 12px; border: 2px dashed var(--border-light); text-align: center; }
.pay-simulation p { font-size: 13px; margin-bottom: 12px; }

/* STEP NAVIGATOR: compact for 8 steps, clickable */
.step-indicator { padding: 4px 10px; font-size: 12px; cursor: default; transition: all 0.3s var(--ease-bounce); }
.step-indicator.done { cursor: pointer; }
.step-indicator.done:hover { background-color: var(--bg-secondary); border-color: var(--border); transform: translate(-1px, -1px); box-shadow: var(--shadow-sm); }
.step-indicator.future { opacity: 0.35; cursor: not-allowed; }
.step-sep { width: 10px; }

/* EPISODE SELECTOR */
.episode-bento { border: 2px solid var(--border); border-radius: var(--radius-card); padding: 28px 32px; background: var(--bg-primary); box-shadow: var(--shadow-md); }
.episode-label { font-family: var(--font-display); font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.episode-presets { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.episode-preset { font-family: var(--font-mono); font-weight: 700; font-size: 14px; padding: 10px 20px; border: 2px solid var(--border); border-radius: var(--radius-pill); background: var(--bg-primary); box-shadow: var(--shadow-sm); transition: all 0.3s var(--ease-bounce); }
.episode-preset:hover { transform: translate(-1px, -1px); box-shadow: var(--shadow-md); }
.episode-preset.active { background: var(--accent); color: var(--accent-text); transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--border); }
.episode-preset.is-locked { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.episode-custom { display: flex; align-items: center; gap: 16px; }
.episode-custom input[type="range"] { flex: 1; height: 8px; -webkit-appearance: none; appearance: none; background: var(--bg-tertiary); border: 2px solid var(--border); border-radius: var(--radius-pill); outline: none; }
.episode-custom input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); border: 2px solid var(--border); cursor: pointer; box-shadow: var(--shadow-sm); }
.episode-custom input[type="number"] { width: 80px; padding: 8px 12px; font-family: var(--font-mono); font-weight: 700; font-size: 16px; text-align: center; border: 2px solid var(--border); border-radius: var(--radius-btn); background: var(--bg-primary); outline: none; }
.episode-custom input[type="number"]:focus { box-shadow: var(--shadow-sm); }
.episode-unit { font-family: var(--font-mono); font-weight: 700; font-size: 16px; color: var(--text-secondary); }

/* EDITABLE CONTENT AREA */
.editable-bento { border: 2px solid var(--border); border-radius: var(--radius-card); padding: 32px; background: var(--bg-primary); box-shadow: var(--shadow-md); }
.editable-content { width: 100%; padding: 20px; font-family: var(--font-body); font-size: 15px; line-height: 1.8; color: var(--text-primary); background: var(--bg-secondary); border: 2px dashed var(--border-light); border-radius: var(--radius-btn); outline: none; resize: vertical; transition: all 0.3s var(--ease-bounce); }
.editable-content:focus { border-style: solid; border-color: var(--border); background: var(--bg-primary); }
.editable-actions { margin-top: 20px; }
.regen-prompt-row { display: flex; gap: 12px; align-items: center; }
.regen-input { flex: 1; padding: 10px 16px; font-family: var(--font-body); font-size: 14px; color: var(--text-primary); border: 2px solid var(--border); border-radius: var(--radius-btn); background: var(--bg-secondary); outline: none; }
.regen-input:focus { background: var(--bg-primary); box-shadow: var(--shadow-sm); }
.btn-regen { font-family: var(--font-display); font-weight: 700; font-size: 13px; padding: 10px 20px; border: 2px solid var(--border); border-radius: var(--radius-pill); background: var(--bg-primary); box-shadow: var(--shadow-sm); white-space: nowrap; transition: all 0.3s var(--ease-bounce); }
.btn-regen:hover { background: var(--pastel-yellow); transform: translate(-1px, -1px); box-shadow: var(--shadow-md); }

/* MINI LOADING */
.gen-mini-progress { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 40px; border: 2px solid var(--border); border-radius: var(--radius-card); background: var(--bg-primary); box-shadow: var(--shadow-md); }
.gen-mini-progress::before { content: ''; width: 40px; height: 40px; border: 3px solid var(--border); border-top-color: transparent; border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 16px; }
.gen-mini-progress-text { font-family: var(--font-mono); font-size: 14px; font-weight: 600; color: var(--text-muted); }

/* JOB PROGRESS (Step6 内联 + 弹窗统一) */
.job-progress-bento {
  border: 2px solid var(--border);
  border-radius: var(--radius-card);
  padding: 28px 32px;
  background: var(--bg-primary);
  box-shadow: var(--shadow-md);
  width: 100%;
  box-sizing: border-box;
}
.job-progress-bento--modal {
  padding: 0;
  border: none;
  box-shadow: none;
  background: transparent;
  margin-top: 8px;
  text-align: left;
}
.job-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}
.job-progress-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.job-progress-count {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 5px 14px;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.job-progress-count:empty { display: none; }
.job-progress-bar {
  width: 100%;
  height: 10px;
  border: 2px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-secondary);
  overflow: hidden;
  position: relative;
  box-shadow: inset 2px 2px 0 rgba(0, 0, 0, 0.04);
}
.job-progress-bar.is-indeterminate::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(209, 10, 20, 0.12) 50%, transparent 100%);
  animation: jobProgressShimmer 1.8s ease-in-out infinite;
}
@keyframes jobProgressShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.job-progress-fill,
.script-progress-fill {
  height: 100%;
  width: 0%;
  border: none;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--accent) 0%, #e8323a 100%);
  transition: width 0.5s var(--ease-out);
  box-shadow: none;
}
.job-progress-bar.is-indeterminate .job-progress-fill,
.job-progress-bar.is-indeterminate .script-progress-fill {
  width: 0 !important;
  opacity: 0;
}
.job-progress-bar.is-batch-active::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(209, 10, 20, 0.2) 50%, transparent 100%);
  animation: jobProgressShimmer 1.4s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}
.job-progress-bar.is-batch-active .job-progress-fill,
.job-progress-bar.is-batch-active .script-progress-fill {
  animation: jobProgressBatchPulse 2s ease-in-out infinite;
  position: relative;
  z-index: 0;
}
@keyframes jobProgressBatchPulse {
  0%, 100% { opacity: 1; filter: brightness(1); }
  50% { opacity: 0.88; filter: brightness(1.06); }
}
.job-progress-batch-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
}
.job-progress-batch-hint::before {
  content: '';
  width: 7px;
  height: 7px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  animation: jobBatchDotPulse 1.2s ease-in-out infinite;
}
@keyframes jobBatchDotPulse {
  0%, 100% { opacity: 0.35; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1); }
}
.job-progress-batch-hint .batch-hint-ellipsis {
  display: inline-block;
  min-width: 1.2em;
  animation: batchHintEllipsis 1.5s steps(4, end) infinite;
}
@keyframes batchHintEllipsis {
  0% { opacity: 0.3; }
  50% { opacity: 1; }
  100% { opacity: 0.3; }
}
.job-progress-meta,
.script-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-top: 14px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.5;
}
.job-progress-detail { flex: 1; min-width: 0; }
.job-progress-percent,
.script-progress-percent {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
  min-width: 2.5em;
  text-align: right;
}
.job-progress-percent.is-active,
.script-progress-percent.is-active { color: var(--accent); }
.job-progress-percent:empty { display: none; }
.job-progress-lock-hint {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}
.job-progress-actions {
  margin-top: 18px;
  display: flex;
  justify-content: center;
}
.job-progress-actions .btn-secondary {
  min-width: 140px;
}
.modal-overlay.job-progress-locked { cursor: default; }

/* App alert / confirm dialog */
.app-dialog-modal { max-width: 440px; }
.app-dialog-content { padding: 32px 28px 28px; text-align: center; }
.app-dialog-title { font-family: var(--font-display); font-size: 22px; margin: 0 0 12px; color: var(--text-primary); }
.app-dialog-body { color: var(--text-secondary); font-size: 15px; line-height: 1.65; white-space: pre-wrap; margin: 0 0 28px; }
.app-dialog-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.app-dialog-actions .btn-primary,
.app-dialog-actions .btn-secondary { min-width: 120px; margin: 0; }
.app-dialog-modal.app-dialog--danger .app-dialog-title { color: var(--text-red, #d10a14); }

/* CHARACTER CARDS */
.character-cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.character-card { border: 2px solid var(--border); border-radius: var(--radius-card); padding: 24px; background: var(--bg-primary); box-shadow: var(--shadow-md); transition: transform 0.3s var(--ease-bounce), box-shadow 0.2s var(--ease-out); }
.character-card:hover { transform: translate(-1px, -1px); box-shadow: var(--shadow-lg); }
.char-card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.char-avatar { width: 44px; height: 44px; border: 2px solid var(--border); border-radius: 50%; background: var(--pastel-blue); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; font-size: 18px; flex-shrink: 0; }
.char-meta { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.char-name-input { font-family: var(--font-display); font-size: 16px; font-weight: 700; border: none; border-bottom: 2px solid var(--border-light); background: transparent; outline: none; padding: 2px 0; width: 100%; }
.char-name-input:focus { border-bottom-color: var(--border); }
.char-role-select { font-family: var(--font-mono); font-size: 12px; font-weight: 700; border: 2px solid var(--border); border-radius: var(--radius-pill); padding: 2px 8px; background: var(--pastel-yellow); outline: none; cursor: pointer; width: fit-content; }
.char-delete-btn { width: 28px; height: 28px; border: 2px solid var(--border); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; background: var(--bg-primary); box-shadow: 1px 1px 0 var(--border); transition: all 0.3s var(--ease-bounce); flex-shrink: 0; }
.char-delete-btn:hover { background: var(--pastel-pink); transform: translate(-1px, -1px); box-shadow: 2px 2px 0 var(--border); }
.char-desc-input { width: 100%; padding: 12px; font-family: var(--font-body); font-size: 14px; line-height: 1.6; color: var(--text-primary); border: 2px dashed var(--border-light); border-radius: var(--radius-btn); background: var(--bg-secondary); outline: none; resize: vertical; }
.char-desc-input:focus { border-style: solid; border-color: var(--border); background: var(--bg-primary); }
.character-actions-bar { display: flex; align-items: center; gap: 16px; margin-top: 24px; flex-wrap: wrap; }
.btn-add-char { font-family: var(--font-display); font-weight: 700; font-size: 14px; padding: 10px 20px; border: 2px dashed var(--border); border-radius: var(--radius-pill); background: var(--bg-secondary); box-shadow: var(--shadow-sm); transition: all 0.3s var(--ease-bounce); }
.btn-add-char:hover { background: var(--pastel-green); border-style: solid; transform: translate(-1px, -1px); box-shadow: var(--shadow-md); }

/* OUTLINE TABS */
.outline-bento { border: 2px solid var(--border); border-radius: var(--radius-card); background: var(--bg-primary); box-shadow: var(--shadow-md); overflow: hidden; }
.outline-tabs { display: flex; border-bottom: 2px solid var(--border); background: var(--pastel-purple); }
.outline-tab { flex: 1; text-align: center; font-family: var(--font-display); font-weight: 700; padding: 14px 20px; transition: all 0.3s var(--ease-bounce); cursor: pointer; }
.outline-tab.active { background: var(--bg-primary); border-bottom: 2px solid var(--accent); color: var(--accent); }
.outline-tab:hover:not(.active) { background: var(--bg-secondary); }
.outline-panel { display: none; padding: 24px; }
.outline-panel.active { display: block; animation: fadeInUp 0.3s forwards; }

/* SCRIPT GENERATION PROGRESS */
.script-gen-bento { border: 2px solid var(--border); border-radius: var(--radius-card); padding: 40px; background: var(--bg-primary); box-shadow: var(--shadow-md); }
.script-progress-wrapper { margin-bottom: 32px; }
.script-progress-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.script-progress-label { font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.script-progress-bar { width: 100%; height: 10px; border: 2px solid var(--border); border-radius: var(--radius-pill); background: var(--bg-secondary); overflow: hidden; position: relative; box-shadow: inset 2px 2px 0 rgba(0, 0, 0, 0.04); }
.script-results-bento { border: 2px solid var(--border); border-radius: var(--radius-card); background: var(--bg-primary); box-shadow: var(--shadow-md); overflow: hidden; }
.script-result-actions { display: flex; justify-content: flex-end; gap: 12px; padding: 20px 32px; border-top: 2px solid var(--border-light); }

/* SCRIPT SEGMENT CARDS */
.script-segments-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.script-segment-card { border: 2px solid var(--border); border-radius: var(--radius-card); padding: 24px; background: var(--bg-primary); box-shadow: var(--shadow-md); transition: transform 0.3s var(--ease-bounce), box-shadow 0.2s var(--ease-out); cursor: pointer; display: flex; flex-direction: column; }
.script-segment-card:hover { transform: translate(-2px, -2px); box-shadow: 0 10px 30px rgba(209, 10, 20, 0.05); border-color: rgba(209, 10, 20, 0.2); }
.segment-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.segment-badge { font-family: var(--font-mono); font-weight: 700; font-size: 13px; padding: 4px 10px; border: 2px solid var(--border); border-radius: var(--radius-pill); background: var(--pastel-blue); }
.segment-status { font-size: 13px; font-weight: 600; color: var(--text-green); }
.segment-preview-text { font-size: 14px; color: var(--text-secondary); line-height: 1.6; flex: 1; margin-bottom: 16px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.segment-card-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 12px; border-top: 2px dashed var(--border-light); }
.segment-meta { font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--text-muted); }
.segment-expand-btn { font-family: var(--font-display); font-weight: 700; font-size: 13px; padding: 6px 14px; border: 2px solid var(--border); border-radius: var(--radius-pill); background: var(--bg-primary); box-shadow: 2px 2px 0 var(--border); transition: all 0.3s var(--ease-bounce); }
.segment-expand-btn:hover { background: var(--pastel-yellow); transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--border); }

/* SEGMENT DETAIL PANEL */
.segment-detail-panel { border: 2px solid var(--border); border-radius: var(--radius-card); background: var(--bg-primary); box-shadow: var(--shadow-lg); padding: 32px; margin-top: 24px; animation: fadeInUp 0.3s forwards; }
.segment-detail-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.segment-detail-title { font-family: var(--font-display); font-size: 24px; font-weight: 700; }
.segment-close-btn { font-family: var(--font-display); font-weight: 700; font-size: 13px; padding: 8px 16px; border: 2px solid var(--border); border-radius: var(--radius-pill); background: var(--bg-primary); box-shadow: var(--shadow-sm); transition: all 0.3s var(--ease-bounce); }
.segment-close-btn:hover { background: var(--bg-secondary); transform: translate(-1px, -1px); box-shadow: var(--shadow-md); }
.segment-detail-meta { display: flex; gap: 24px; margin-bottom: 20px; font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--text-muted); }
.segment-detail-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 20px; }
.editor-textarea { width: 100%; min-height: 400px; padding: 24px; font-family: var(--font-body); font-size: 15px; line-height: 2; color: var(--text-primary); border: 2px solid var(--border); border-radius: var(--radius-btn); background: var(--bg-secondary); outline: none; resize: vertical; }
.editor-textarea:focus { background: var(--bg-primary); box-shadow: inset 0 0 0 1px var(--border); }
.editor-action-bar { display: flex; justify-content: space-between; margin-top: 24px; }

/* ANIMATIONS */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* RESPONSIVE */
@media (max-width: 1024px) {
  .curve-carousel-viewport { overflow-x: auto; scrollbar-width: none; }
  .curve-carousel-viewport::-webkit-scrollbar { display: none; }
  .curve-grid { transform: none !important; width: max-content; gap: 20px; }
  .curve-page { display: flex; gap: 20px; width: auto; flex-shrink: 0; }
  .curve-card { width: 260px; flex-shrink: 0; }
  .carousel-btn { display: none; }
  .tag-bento-container { grid-template-columns: 1fr; }
  .billing-bento-grid { grid-template-columns: 1fr; }
  .col-span-2 { grid-column: span 1; }
  .character-cards-grid { grid-template-columns: 1fr 1fr; }
  .script-segments-container { grid-template-columns: 1fr 1fr; }
}


/* COLLAPSIBLE SIDEBAR */
.sidebar { transition: width 0.3s var(--ease-bounce); overflow: hidden; }
.sidebar.collapsed { width: 80px; }
.sidebar.collapsed .v-step-info { display: none; }
.sidebar.collapsed .sidebar-title { display: none; }
.sidebar.collapsed #toggleSidebarBtn svg { transform: rotate(180deg); }
.wizard-sidebar-header { white-space: nowrap; overflow: hidden; }


/* CLICKABLE STEP INDICATORS */
.v-step.done { cursor: pointer; }
.v-step.done:hover .v-step-num { background: var(--pastel-yellow); border-color: var(--border); box-shadow: var(--shadow-sm); transform: scale(1.1); }

/* Global mode / locale chips */
.workspace-mode-switch .mode-chip,
.locale-switch .locale-chip {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  padding: 6px 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-primary);
  cursor: pointer;
  color: var(--text-secondary);
}
.workspace-mode-switch .mode-chip.active,
.locale-switch .locale-chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--border);
}
body.workspace-global .script-segment-card,
body.workspace-global #segmentEditorTextarea,
body.workspace-global #scriptStudioEditor {
  font-family: 'Courier New', Courier, monospace;
}
