/* ===========================
   CreatorStudio — Light Theme
   =========================== */

:root {
  --bg: #f5f7fc;
  --bg2: #ffffff;
  --bg3: #f0f3f9;
  --surface: #ffffff;
  --surface2: #eef1f8;
  --border: #dde2ef;
  --border-light: #c4cde0;
  --text: #1a2340;
  --text2: #4a5568;
  --text3: #8a97b0;
  --accent: #1e3a8a;
  --accent2: #2563eb;
  --accent-glow: rgba(37, 99, 235, 0.14);
  --accent-light: #eff6ff;
  --green: #059669;
  --green-light: #ecfdf5;
  --red: #dc2626;
  --red-light: #fef2f2;
  --yellow: #d97706;
  --yellow-light: #fffbeb;
  --font-display: 'Syne', sans-serif;
  --font-mono: 'Space Mono', monospace;
  --font-body: 'Noto Sans JP', sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 1px 6px rgba(26,35,64,0.07), 0 2px 16px rgba(26,35,64,0.04);
  --shadow-md: 0 4px 20px rgba(26,35,64,0.1);
  --shadow-lg: 0 12px 48px rgba(26,35,64,0.14);
  --transition: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ===== HEADER ===== */
.app-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  height: 72px;
  box-shadow: 0 1px 6px rgba(26,35,64,0.07);
  position: relative;
}
.app-header::after {
  content: '';
  position: absolute; bottom: -1px; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, #1e3a8a 0%, #2563eb 25%, #0d9488 50%, #ea580c 75%, #7c3aed 100%);
}
.header-inner {
  max-width: 1600px; margin: 0 auto; height: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
}
.logo { display: flex; align-items: center; height: 64px; overflow: hidden; }
.logo img { height: 180px; width: auto; object-fit: contain; display: block; }
.logo-icon, .logo-text, .logo-accent { display: none; }

.header-nav { display: flex; align-items: center; gap: 8px; }
.nav-btn {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text2); border-radius: var(--radius-sm);
  padding: 7px 14px; font-family: var(--font-body); font-size: 0.84rem;
  cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; gap: 6px; font-weight: 500;
}
.nav-btn:hover { background: var(--bg3); color: var(--text); border-color: var(--border-light); }
.nav-btn.accent { background: var(--accent2); border-color: var(--accent2); color: #fff; box-shadow: 0 2px 8px rgba(37,99,235,0.28); }
.nav-btn.accent:hover { background: var(--accent); }
.badge {
  background: var(--accent2); color: #fff;
  border-radius: 99px; padding: 1px 7px;
  font-size: 0.71rem; font-family: var(--font-mono); min-width: 20px; text-align: center;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(20,36,96,0.35); backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); width: 100%; max-width: 480px;
  box-shadow: var(--shadow-lg); animation: modalIn 0.2s ease;
}
@keyframes modalIn { from { opacity:0; transform:scale(0.96) translateY(-8px); } to { opacity:1; transform:scale(1) translateY(0); } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 16px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; color: var(--text); }
.modal-close { background:none; border:none; color:var(--text3); cursor:pointer; font-size:1rem; padding:4px 8px; border-radius:var(--radius-sm); transition:var(--transition); }
.modal-close:hover { background:var(--bg3); color:var(--text); }
.modal-body { padding: 20px 24px 24px; display: flex; flex-direction: column; gap: 14px; }
.modal-actions { display: flex; gap: 8px; }
.api-test-result { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 0.84rem; display: none; }
.api-test-result.success { background:var(--green-light); color:var(--green); border:1px solid rgba(5,150,105,0.22); display:block; }
.api-test-result.error { background:var(--red-light); color:var(--red); border:1px solid rgba(220,38,38,0.22); display:block; }

/* ===== SIDE PANELS ===== */
.side-panel {
  position: fixed; right: -380px; top:0; bottom:0; z-index:200;
  width: 360px; background: var(--surface); border-left: 1px solid var(--border);
  transition: right 0.3s cubic-bezier(0.4,0,0.2,1);
  display: flex; flex-direction: column;
  box-shadow: -8px 0 32px rgba(26,35,64,0.12);
}
.side-panel.open { right: 0; }
.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0;
  background: var(--bg3);
}
.panel-header h3 { font-family: var(--font-display); font-size: 0.94rem; font-weight: 700; color: var(--text); }
.panel-actions { display: flex; align-items: center; gap: 8px; }
.panel-close { background:none; border:none; color:var(--text3); cursor:pointer; font-size:1rem; padding:4px 8px; border-radius:var(--radius-sm); transition:var(--transition); }
.panel-close:hover { color:var(--text); background:var(--surface2); }
.panel-body { flex:1; overflow-y:auto; padding:16px; display:flex; flex-direction:column; gap:12px; }

/* ===== MAIN LAYOUT ===== */
.app-main {
  display: grid; grid-template-columns: 320px 1fr;
  min-height: calc(100vh - 62px);
  max-width: 1600px; margin: 0 auto;
}

/* ===== INPUT PANEL ===== */
.input-panel {
  background: var(--surface); border-right: 1px solid var(--border);
  overflow-y: auto; position: sticky; top: 62px; height: calc(100vh - 62px);
}
.input-panel-inner { padding: 20px; display:flex; flex-direction:column; gap:4px; }
.panel-title {
  display:flex; align-items:center; gap:8px;
  margin-bottom:16px; padding-bottom:14px; border-bottom:1px solid var(--border);
}
.panel-icon { color:var(--accent2); font-size:1rem; }
.panel-title h2 { font-family:var(--font-display); font-size:0.94rem; font-weight:700; color:var(--text); }

/* ===== FORM ===== */
.form-section { margin-bottom: 14px; }
.form-label {
  display:block; font-size:0.73rem; font-weight:600; color:var(--text2);
  margin-bottom:6px; text-transform:uppercase; letter-spacing:0.6px;
}
.required { color:var(--accent2); }
.form-input {
  width:100%; background:var(--bg3); border:1px solid var(--border); border-radius:var(--radius-sm);
  color:var(--text); padding:8px 12px; font-family:var(--font-body); font-size:0.88rem;
  transition:var(--transition); outline:none;
}
.form-input:focus { border-color:var(--accent2); box-shadow:0 0 0 3px var(--accent-glow); background:#fff; }
.form-input::placeholder { color:var(--text3); }
.form-input.small { width:calc(100% - 54px); }
.form-input.tiny { width:64px; text-align:center; }
.form-select {
  width:100%; background:var(--bg3); border:1px solid var(--border); border-radius:var(--radius-sm);
  color:var(--text); padding:8px 12px; font-family:var(--font-body); font-size:0.88rem;
  cursor:pointer; outline:none; appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%234a5568' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 12px center; transition:var(--transition);
}
.form-select:focus { border-color:var(--accent2); box-shadow:0 0 0 3px var(--accent-glow); background-color:#fff; }
.form-textarea {
  width:100%; background:var(--bg3); border:1px solid var(--border); border-radius:var(--radius-sm);
  color:var(--text); padding:8px 12px; font-family:var(--font-body); font-size:0.88rem;
  resize:vertical; outline:none; transition:var(--transition);
}
.form-textarea:focus { border-color:var(--accent2); box-shadow:0 0 0 3px var(--accent-glow); background:#fff; }

.preset-chips, .suggestion-chips { display:flex; flex-wrap:wrap; gap:6px; margin-top:6px; }
.chip {
  background:var(--surface); border:1.5px solid var(--border); color:var(--text2);
  border-radius:99px; padding:5px 14px; font-size:0.81rem; cursor:pointer;
  transition:var(--transition); font-family:var(--font-body); font-weight:500;
}
.chip:hover { border-color:var(--accent2); color:var(--accent2); background:var(--accent-light); }
.chip.active { background:var(--accent2); border-color:var(--accent2); color:#fff; box-shadow:0 2px 8px rgba(37,99,235,0.28); }
.chip-small {
  background:transparent; border:1px solid var(--border); color:var(--text3);
  border-radius:99px; padding:3px 10px; font-size:0.76rem; cursor:pointer;
  transition:var(--transition); font-family:var(--font-body);
}
.chip-small:hover { border-color:var(--accent2); color:var(--accent2); background:var(--accent-light); }

.radio-group { display:grid; grid-template-columns:1fr 1fr; gap:5px; }
.radio-option {
  display:flex; align-items:center; gap:7px; background:var(--bg3);
  border:1.5px solid var(--border); border-radius:var(--radius-sm); padding:7px 10px;
  cursor:pointer; font-size:0.83rem; transition:var(--transition);
}
.radio-option:hover { background:#fff; border-color:var(--border-light); }
.radio-option input[type="radio"] { accent-color:var(--accent2); }
.radio-option:has(input:checked) { border-color:var(--accent2); background:var(--accent-light); color:var(--accent2); font-weight:600; }

.mood-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:5px; }
.mood-btn {
  background:var(--bg3); border:1.5px solid var(--border); color:var(--text2);
  border-radius:var(--radius-sm); padding:7px 4px; font-size:0.77rem; cursor:pointer;
  transition:var(--transition); text-align:center; font-family:var(--font-body); font-weight:500;
}
.mood-btn:hover { background:#fff; border-color:var(--border-light); color:var(--text); }
.mood-btn.active { background:var(--accent-light); border-color:var(--accent2); color:var(--accent2); font-weight:700; }

.color-input-row { display:flex; gap:8px; align-items:center; }
.color-picker { width:42px; height:36px; padding:3px; border-radius:var(--radius-sm); border:1.5px solid var(--border); background:var(--bg3); cursor:pointer; }

.number-input-row { display:flex; gap:8px; align-items:center; }
.num-btn {
  width:34px; height:34px; background:var(--bg3); border:1.5px solid var(--border);
  color:var(--text2); border-radius:var(--radius-sm); cursor:pointer; font-size:1.1rem;
  display:flex; align-items:center; justify-content:center; transition:var(--transition); font-weight:700;
}
.num-btn:hover { background:#fff; color:var(--accent2); border-color:var(--accent2); }

.function-checks { display:grid; grid-template-columns:1fr 1fr; gap:5px; }
.check-option {
  display:flex; align-items:center; gap:7px; background:var(--bg3);
  border:1.5px solid var(--border); border-radius:var(--radius-sm); padding:7px 10px;
  cursor:pointer; font-size:0.81rem; transition:var(--transition);
}
.check-option:hover { background:#fff; border-color:var(--border-light); }
.check-option input[type="checkbox"] { accent-color:var(--accent2); }
.check-option:has(input:checked) { border-color:rgba(37,99,235,0.4); background:var(--accent-light); color:var(--accent); font-weight:600; }

.input-group { display:flex; gap:8px; }
.hint { font-size:0.76rem; color:var(--text3); }

/* ===== BUTTONS ===== */
.btn-primary {
  background:var(--accent2); border:none; color:#fff;
  border-radius:var(--radius-sm); padding:9px 18px;
  font-family:var(--font-body); font-size:0.9rem; font-weight:600;
  cursor:pointer; transition:var(--transition); box-shadow:0 2px 8px rgba(37,99,235,0.25);
}
.btn-primary:hover { background:var(--accent); transform:translateY(-1px); }
.btn-secondary {
  background:var(--surface); border:1.5px solid var(--border); color:var(--text2);
  border-radius:var(--radius-sm); padding:9px 18px;
  font-family:var(--font-body); font-size:0.9rem; font-weight:500; cursor:pointer; transition:var(--transition);
}
.btn-secondary:hover { background:var(--bg3); color:var(--text); }
.btn-ghost {
  background:none; border:1.5px solid var(--border); color:var(--text2);
  border-radius:var(--radius-sm); padding:9px 18px;
  font-family:var(--font-body); font-size:0.9rem; cursor:pointer; transition:var(--transition);
}
.btn-ghost:hover { background:var(--bg3); color:var(--text); }
.btn-small {
  background:var(--bg3); border:1px solid var(--border); color:var(--text2);
  border-radius:var(--radius-sm); padding:5px 10px;
  font-family:var(--font-body); font-size:0.79rem; cursor:pointer; transition:var(--transition); white-space:nowrap; font-weight:500;
}
.btn-small:hover { background:#fff; color:var(--accent2); border-color:var(--accent2); }
.btn-small.danger { color:var(--red); border-color:rgba(220,38,38,0.22); }
.btn-small.danger:hover { background:var(--red-light); }
.full-width { width:100%; }

.btn-generate {
  width:100%; padding:14px;
  background: linear-gradient(135deg, #1e3a8a, #2563eb 60%, #3b82f6);
  border:none; border-radius:var(--radius);
  color:#fff; font-family:var(--font-display); font-size:0.95rem; font-weight:700;
  cursor:pointer; transition:var(--transition);
  display:flex; align-items:center; justify-content:center; gap:10px;
  margin-top:8px; letter-spacing:0.3px;
  box-shadow:0 4px 18px rgba(37,99,235,0.38);
}
.btn-generate:hover { transform:translateY(-2px); box-shadow:0 8px 28px rgba(37,99,235,0.46); }
.btn-generate:active { transform:translateY(0); }
.btn-generate.loading { opacity:0.72; cursor:not-allowed; }
.generate-icon { font-size:1rem; animation:spin 4s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
.btn-generate.loading .generate-icon { animation:pulse 1s ease-in-out infinite; }
@keyframes pulse { 0%,100%{ opacity:1; } 50%{ opacity:0.4; } }

.export-row { display:flex; gap:6px; margin-top:8px; }
.btn-export {
  flex:1; background:var(--bg3); border:1px solid var(--border); color:var(--text3);
  border-radius:var(--radius-sm); padding:7px; font-family:var(--font-body); font-size:0.8rem;
  cursor:pointer; transition:var(--transition); font-weight:500;
}
.btn-export:hover:not(:disabled) { background:#fff; color:var(--accent2); border-color:var(--accent2); }
.btn-export:disabled { opacity:0.4; cursor:not-allowed; }

/* ===== RESULT PANEL ===== */
.result-panel { display:flex; flex-direction:column; overflow:hidden; background:var(--bg); }

.empty-result {
  flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center;
  padding:60px 40px; text-align:center; gap:16px;
}
.empty-icon {
  width:64px; height:64px;
  background:linear-gradient(135deg, #dbeafe, #e0e7ff);
  border-radius:50%; display:flex; align-items:center; justify-content:center;
  font-size:1.8rem; color:var(--accent2); margin:0 auto;
}
.empty-result h3 { font-family:var(--font-display); font-size:1.15rem; color:var(--text); font-weight:700; }
.empty-result p { color:var(--text2); font-size:0.9rem; }
.feature-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-top:10px; width:100%; max-width:500px; }
.feature-item {
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-sm);
  padding:10px 12px; font-size:0.82rem; color:var(--text2); display:flex; gap:6px; align-items:center; box-shadow:var(--shadow);
}

.loading-state {
  flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center;
  padding:60px; gap:20px; background:var(--bg);
}
.loading-orb {
  width:68px; height:68px; border-radius:50%;
  border:3px solid var(--border);
  border-top-color:var(--accent2); border-right-color:#93c5fd;
  animation:orbSpin 0.9s linear infinite;
}
@keyframes orbSpin { to { transform:rotate(360deg); } }
.loading-state h3 { font-family:var(--font-display); color:var(--text2); font-size:0.95rem; }
.loading-steps { display:flex; flex-direction:column; gap:6px; align-items:center; }
.loading-step { font-size:0.82rem; color:var(--text3); display:flex; align-items:center; gap:8px; animation:stepFadeIn 0.4s ease; }
.loading-step.done { color:var(--green); }
.loading-step::before { content:'○'; font-size:0.7rem; }
.loading-step.done::before { content:'●'; }
@keyframes stepFadeIn { from { opacity:0; transform:translateX(-10px); } to { opacity:1; } }

/* ===== TABS ===== */
.tab-nav {
  display:flex; overflow-x:auto; gap:0; padding:0 16px;
  border-bottom:1px solid var(--border); background:var(--surface); flex-shrink:0;
  scrollbar-width:none; box-shadow:0 2px 6px rgba(26,35,64,0.05);
}
.tab-nav::-webkit-scrollbar { display:none; }
.tab-btn {
  background:none; border:none; color:var(--text3);
  padding:14px 14px 13px; font-family:var(--font-body); font-size:0.82rem;
  cursor:pointer; transition:var(--transition); white-space:nowrap; font-weight:500;
  border-bottom:2px solid transparent; margin-bottom:-1px;
}
.tab-btn:hover { color:var(--text2); background:var(--bg3); }
.tab-btn.active { color:var(--accent2); border-bottom-color:var(--accent2); font-weight:700; }
.tab-btn.has-content::after { content:' ●'; color:var(--green); font-size:0.55rem; }

.tab-content { display:none; flex:1; overflow-y:auto; }
.tab-content.active { display:block; }
.result-inner { padding:20px; display:flex; flex-direction:column; gap:16px; }

/* ===== CARDS ===== */
.result-card {
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius);
  overflow:hidden; transition:var(--transition); animation:cardIn 0.28s ease; box-shadow:var(--shadow);
}
@keyframes cardIn { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }
.result-card:hover { border-color:var(--border-light); box-shadow:var(--shadow-md); }

.card-header {
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 16px; border-bottom:1px solid var(--border); background:var(--bg3);
}
.card-title { font-family:var(--font-display); font-size:0.87rem; font-weight:700; display:flex; align-items:center; gap:8px; color:var(--text); }
.card-badge { background:var(--accent2); color:#fff; border-radius:99px; padding:2px 8px; font-size:0.69rem; font-family:var(--font-mono); font-weight:700; }
.card-actions { display:flex; gap:6px; }
.card-body { padding:16px; }

.copy-item {
  background:var(--bg3); border:1.5px solid var(--border); border-radius:var(--radius-sm);
  padding:12px 14px; margin-bottom:8px; cursor:pointer; transition:var(--transition);
  display:flex; align-items:flex-start; justify-content:space-between; gap:10px;
}
.copy-item:hover { border-color:var(--accent2); background:var(--accent-light); box-shadow:0 2px 8px rgba(37,99,235,0.1); }
.copy-item:last-child { margin-bottom:0; }
.copy-text { font-size:0.97rem; font-weight:600; flex:1; line-height:1.4; color:var(--text); }
.copy-meta { font-size:0.73rem; color:var(--text3); margin-top:4px; }
.copy-action { color:var(--text3); font-size:0.73rem; white-space:nowrap; padding-top:2px; }

.color-palette { display:flex; gap:10px; flex-wrap:wrap; }
.color-swatch { display:flex; flex-direction:column; align-items:center; gap:6px; cursor:pointer; }
.swatch-block { width:60px; height:60px; border-radius:var(--radius-sm); border:1px solid rgba(0,0,0,0.08); transition:var(--transition); box-shadow:0 2px 8px rgba(0,0,0,0.09); }
.swatch-block:hover { transform:scale(1.07); box-shadow:0 6px 18px rgba(0,0,0,0.14); }
.swatch-label { font-size:0.7rem; color:var(--text3); font-weight:500; }
.swatch-hex { font-family:var(--font-mono); font-size:0.7rem; color:var(--text2); }

.spec-table { width:100%; border-collapse:collapse; }
.spec-table th, .spec-table td { padding:9px 12px; text-align:left; font-size:0.84rem; border-bottom:1px solid var(--border); }
.spec-table th { color:var(--text3); font-weight:600; width:35%; background:var(--bg3); }
.spec-table td { color:var(--text); font-size:0.83rem; }
.spec-table tr:last-child th, .spec-table tr:last-child td { border-bottom:none; }

.size-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:10px; }
.size-card { background:var(--bg3); border:1.5px solid var(--border); border-radius:var(--radius-sm); padding:13px 14px; transition:var(--transition); }
.size-card:hover { border-color:var(--accent2); background:var(--accent-light); }
.size-name { font-weight:700; font-size:0.84rem; margin-bottom:4px; color:var(--text); }
.size-dims { font-family:var(--font-mono); color:var(--accent2); font-size:0.82rem; font-weight:700; }
.size-desc { color:var(--text3); font-size:0.73rem; margin-top:4px; }

.slide-grid { display:flex; flex-direction:column; gap:8px; padding:4px; }
.slide-item {
  background:var(--bg3); border:1px solid var(--border); border-radius:var(--radius-sm);
  padding:13px; display:grid; grid-template-columns:40px 1fr; gap:12px; align-items:start; transition:var(--transition);
}
.slide-item:hover { background:#fff; border-color:var(--border-light); }
.slide-num {
  width:36px; height:36px; border-radius:var(--radius-sm);
  background:linear-gradient(135deg, var(--accent), var(--accent2));
  color:#fff; display:flex; align-items:center; justify-content:center;
  font-family:var(--font-mono); font-size:0.88rem; font-weight:700; flex-shrink:0;
}
.slide-content h4 { font-weight:700; font-size:0.9rem; margin-bottom:4px; color:var(--text); }
.slide-content p { color:var(--text2); font-size:0.83rem; line-height:1.5; }
.slide-content .slide-tags { display:flex; gap:5px; flex-wrap:wrap; margin-top:6px; }
.slide-tag { background:var(--surface2); border:1px solid var(--border); border-radius:99px; padding:2px 8px; font-size:0.71rem; color:var(--text3); }

.prompt-block {
  background:#f0f6ff; border:1px solid #c7dff9; border-radius:var(--radius-sm);
  padding:12px 14px; font-family:var(--font-mono); font-size:0.77rem;
  color:var(--accent); line-height:1.7; white-space:pre-wrap; word-break:break-all; position:relative;
}
.prompt-copy-btn {
  position:absolute; top:8px; right:8px; background:#fff; border:1px solid var(--border);
  color:var(--text2); border-radius:var(--radius-sm); padding:4px 8px;
  font-size:0.72rem; cursor:pointer; transition:var(--transition);
}
.prompt-copy-btn:hover { background:var(--accent2); color:#fff; border-color:var(--accent2); }

.section-divider {
  display:flex; align-items:center; gap:10px;
  color:var(--text3); font-size:0.72rem; font-weight:600; text-transform:uppercase; letter-spacing:0.8px; margin:4px 0;
}
.section-divider::before, .section-divider::after { content:''; flex:1; height:1px; background:var(--border); }

.tag {
  display:inline-block; background:var(--surface2); border:1px solid var(--border);
  border-radius:99px; padding:2px 8px; font-size:0.73rem; color:var(--text2); font-weight:500;
}
.tag.green { background:var(--green-light); color:var(--green); border-color:rgba(5,150,105,0.2); }
.tag.purple { background:var(--accent-light); color:var(--accent2); border-color:rgba(37,99,235,0.2); }
.tag.yellow { background:var(--yellow-light); color:var(--yellow); border-color:rgba(217,119,6,0.2); }

.history-item { background:var(--bg3); border:1px solid var(--border); border-radius:var(--radius-sm); padding:12px; cursor:pointer; transition:var(--transition); }
.history-item:hover { background:#fff; border-color:var(--border-light); box-shadow:var(--shadow); }
.history-theme { font-weight:600; font-size:0.87rem; margin-bottom:4px; color:var(--text); }
.history-meta { color:var(--text3); font-size:0.73rem; display:flex; gap:8px; }
.history-time { font-family:var(--font-mono); }

.preset-list { display:flex; flex-direction:column; gap:8px; }
.preset-item { background:var(--bg3); border:1px solid var(--border); border-radius:var(--radius-sm); padding:10px 12px; cursor:pointer; transition:var(--transition); display:flex; align-items:center; justify-content:space-between; }
.preset-item:hover { background:#fff; border-color:var(--border-light); }
.preset-name { font-size:0.87rem; font-weight:600; color:var(--text); }
.preset-delete { color:var(--text3); font-size:0.77rem; cursor:pointer; padding:2px 6px; border-radius:4px; }
.preset-delete:hover { color:var(--red); background:var(--red-light); }

.toast {
  position:fixed; bottom:24px; right:24px; z-index:9999;
  background:var(--text); border:none; color:#fff; border-radius:var(--radius);
  padding:12px 18px; font-size:0.87rem; box-shadow:var(--shadow-lg);
  transform:translateY(20px); opacity:0;
  transition:all 0.3s cubic-bezier(0.4,0,0.2,1);
  pointer-events:none; max-width:320px; font-weight:500;
}
.toast.show { transform:translateY(0); opacity:1; }
.toast.success { background:var(--green); }
.toast.error { background:var(--red); }

.empty-state { color:var(--text3); font-size:0.83rem; text-align:center; padding:20px; }

::-webkit-scrollbar { width:5px; height:5px; }
::-webkit-scrollbar-track { background:var(--bg3); }
::-webkit-scrollbar-thumb { background:var(--border-light); border-radius:99px; }
::-webkit-scrollbar-thumb:hover { background:var(--accent2); }

@media (max-width:900px) {
  .app-main { grid-template-columns:1fr; }
  .input-panel { position:static; height:auto; border-right:none; border-bottom:1px solid var(--border); }
  .feature-grid { grid-template-columns:repeat(2,1fr); }
  .mood-grid { grid-template-columns:repeat(4,1fr); }
}
@media (max-width:600px) {
  .header-inner { padding:0 12px; }
  .input-panel-inner { padding:14px; }
  .result-inner { padding:14px; }
  .radio-group, .function-checks { grid-template-columns:1fr; }
  .size-grid { grid-template-columns:1fr 1fr; }
  .tab-btn { padding:12px 10px; font-size:0.78rem; }
}

.fade-in { animation:fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
.highlight { color:var(--accent2); font-weight:600; }
.text-green { color:var(--green); }
.text-yellow { color:var(--yellow); }

.prose { font-size:0.87rem; color:var(--text2); line-height:1.7; }
.prose h4 { font-family:var(--font-display); font-size:0.9rem; color:var(--text); margin-bottom:6px; margin-top:12px; font-weight:700; }
.prose h4:first-child { margin-top:0; }
.prose p { margin-bottom:8px; }
.prose ul { padding-left:16px; margin-bottom:8px; }
.prose li { margin-bottom:4px; }
.prose strong { color:var(--text); font-weight:600; }

.grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
@media (max-width:700px) { .grid-2 { grid-template-columns:1fr; } }

/* ===========================
   HELP MODAL STYLES
   =========================== */

.help-modal {
  max-width: 780px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.help-modal-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

/* Help Tab Nav */
.help-tab-nav {
  display: flex;
  overflow-x: auto;
  gap: 2px;
  padding: 12px 16px 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg3);
  flex-shrink: 0;
  scrollbar-width: none;
}
.help-tab-nav::-webkit-scrollbar { display: none; }
.help-tab-btn {
  background: none; border: none; color: var(--text3);
  padding: 8px 14px; font-family: var(--font-body); font-size: 0.82rem;
  cursor: pointer; white-space: nowrap; font-weight: 500;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: var(--transition); border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.help-tab-btn:hover { color: var(--text2); background: var(--surface2); }
.help-tab-btn.active { color: var(--accent2); border-bottom-color: var(--accent2); font-weight: 700; }

.help-tab-content { display: none; flex: 1; overflow-y: auto; }
.help-tab-content.active { display: block; }

.help-section { padding: 24px; display: flex; flex-direction: column; gap: 20px; }

/* Hero */
.help-hero {
  background: linear-gradient(135deg, #eff6ff, #f0fdf4);
  border: 1px solid #dbeafe;
  border-radius: var(--radius);
  padding: 24px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.help-hero-icon { font-size: 2.4rem; }
.help-hero h2 { font-family: var(--font-display); font-size: 1.2rem; font-weight: 800; color: var(--text); }
.help-hero p { color: var(--text2); font-size: 0.9rem; max-width: 500px; line-height: 1.7; }

/* Headings */
.help-heading {
  font-family: var(--font-display); font-size: 0.95rem; font-weight: 700;
  color: var(--text); padding-bottom: 8px;
  border-bottom: 2px solid var(--accent-light);
  display: flex; align-items: center; gap: 8px;
}
.help-note { font-size: 0.87rem; color: var(--text2); line-height: 1.7; }

/* Steps */
.help-steps { display: flex; flex-direction: column; gap: 12px; }
.help-step {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow);
}
.help-step-num {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; font-family: var(--font-mono); font-size: 0.9rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.help-step-body h4 { font-weight: 700; font-size: 0.9rem; margin-bottom: 5px; color: var(--text); }
.help-step-body p { font-size: 0.85rem; color: var(--text2); line-height: 1.7; }

/* Preset Grid */
.help-preset-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; }
@media (max-width: 600px) { .help-preset-grid { grid-template-columns: repeat(2,1fr); } }
.help-preset-card {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 14px 12px; text-align: center;
  box-shadow: var(--shadow); transition: var(--transition);
}
.help-preset-card:hover { border-color: var(--accent2); background: var(--accent-light); }
.help-preset-icon { font-size: 1.6rem; margin-bottom: 6px; }
.help-preset-card h4 { font-weight: 700; font-size: 0.88rem; margin-bottom: 5px; color: var(--text); }
.help-preset-card p { font-size: 0.78rem; color: var(--text2); line-height: 1.5; }

/* Alerts */
.help-alert {
  border-radius: var(--radius-sm); padding: 12px 16px;
  font-size: 0.86rem; line-height: 1.6;
}
.help-alert.info { background: var(--accent-light); border: 1px solid #bfdbfe; color: var(--accent); }
.help-alert.success { background: var(--green-light); border: 1px solid #a7f3d0; color: var(--green); }

/* Input Items */
.help-item-list { display: flex; flex-direction: column; gap: 12px; }
.help-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden;
  box-shadow: var(--shadow);
}
.help-item-label {
  background: var(--bg3); padding: 9px 14px;
  font-size: 0.82rem; font-weight: 700; color: var(--text);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.required-badge {
  background: #fef2f2; color: #dc2626;
  border: 1px solid #fca5a5; border-radius: 99px;
  padding: 1px 7px; font-size: 0.7rem;
}
.help-item-body { padding: 12px 14px; }
.help-item-body p { font-size: 0.84rem; color: var(--text2); margin-bottom: 8px; line-height: 1.6; }
.help-examples { display: flex; flex-wrap: wrap; gap: 6px; }
.help-eg {
  background: var(--accent-light); border: 1px solid #bfdbfe;
  color: var(--accent2); border-radius: 99px;
  padding: 3px 10px; font-size: 0.78rem; font-weight: 500;
}

/* Function List */
.help-func-list { display: flex; flex-direction: column; gap: 14px; }
.help-func {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow); transition: var(--transition);
}
.help-func:hover { border-color: var(--border-light); }
.help-func-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.help-func-icon { font-size: 1.3rem; }
.help-func-header h4 { font-family: var(--font-display); font-size: 0.92rem; font-weight: 700; color: var(--text); }
.help-func p { font-size: 0.85rem; color: var(--text2); line-height: 1.7; }
.help-output-box {
  margin-top: 10px; background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px;
  font-size: 0.82rem; color: var(--text2); line-height: 1.6;
}
.help-output-box strong { color: var(--text); }

/* Tips */
.help-tip-list { display: flex; flex-direction: column; gap: 12px; }
.help-tip {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px;
}
.help-tip-num {
  display: inline-block; background: var(--accent2); color: #fff;
  border-radius: 99px; padding: 2px 10px; font-size: 0.75rem; font-weight: 700;
  font-family: var(--font-mono); width: fit-content;
}
.help-tip h4 { font-weight: 700; font-size: 0.9rem; color: var(--text); }
.help-tip p { font-size: 0.85rem; color: var(--text2); line-height: 1.7; }
.help-combo-table-label { font-size: 0.82rem; color: var(--text3); margin-bottom: 6px; }

/* Tables */
.help-table-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.help-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.help-table.compact { font-size: 0.81rem; }
.help-table thead tr { background: var(--bg3); }
.help-table th { padding: 9px 12px; text-align: left; font-weight: 700; color: var(--text); border-bottom: 1px solid var(--border); }
.help-table td { padding: 9px 12px; color: var(--text2); border-bottom: 1px solid var(--border); }
.help-table tr:last-child td { border-bottom: none; }
.help-table tr:hover td { background: var(--bg3); }

/* FAQ */
.help-faq-list { display: flex; flex-direction: column; gap: 10px; }
.help-faq {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden;
  box-shadow: var(--shadow);
}
.help-faq-q {
  padding: 12px 16px; background: var(--bg3);
  font-weight: 700; font-size: 0.88rem; color: var(--text);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; gap: 8px;
}
.help-faq-q::before { content: 'Q'; color: var(--accent2); font-family: var(--font-mono); font-size: 0.88rem; flex-shrink: 0; }
.help-faq-a {
  padding: 12px 16px; font-size: 0.85rem; color: var(--text2); line-height: 1.7;
  padding-left: calc(16px + 1rem);
}

/* Link */
.help-link { color: var(--accent2); text-decoration: underline; text-decoration-color: transparent; transition: var(--transition); }
.help-link:hover { text-decoration-color: var(--accent2); }

/* Code */
.help-code {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 6px;
  font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent2);
}
