/* ═══ THE CONTENT FORGE — Molten design language ═══ */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg:        #121013;   /* coal: near-black with a warm cast */
  --bg-2:      #171316;
  --stone:     #1a1618;
  --stone-2:   #241d1c;
  --amber:     #ff5c1f;   /* molten orange (kept the old var names so every view restyles) */
  --amber-lite:#ff8a4d;
  --bronze:    #e8b14a;   /* gold, premium accents */
  --parch:     #f4ede4;   /* warm off-white */
  --parch-dim: #a3968c;
  --green:     #4A7C59;
  --red:       #a5301f;
  --line:      #332a26;
  --heat:      linear-gradient(100deg, #ffb25c 0%, #ff5c1f 45%, #e23b22 100%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: radial-gradient(1100px 560px at 82% -12%, rgba(255,92,31,.07) 0%, var(--bg) 62%) fixed, var(--bg);
  color: var(--parch);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px; line-height: 1.5;
}
h1, h2, h3, .cinzel { font-family: 'Syne', system-ui, sans-serif; font-weight: 800; letter-spacing: -.01em; }
a { color: var(--amber-lite); text-decoration: none; }
::selection { background: var(--amber); color: #000; }

/* ─── Layout ─── */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; flex-shrink: 0; background: linear-gradient(180deg, #121110, #0b0a09);
  border-right: 1px solid var(--line); padding: 22px 14px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; }
.brand .anvil { font-size: 26px; filter: drop-shadow(0 0 6px var(--amber)); }
.brand .name { font-family: 'Cinzel', serif; font-weight: 800; font-size: 16px; line-height: 1.05;
  background: var(--heat); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 8px;
  color: var(--parch-dim); font-weight: 500; font-size: 14px; border: 1px solid transparent;
}
.nav a .i { font-size: 17px; width: 20px; text-align: center; }
.nav a:hover { background: var(--stone); color: var(--parch); }
.nav a.active {
  background: linear-gradient(180deg, #2a1c0c, #1a1207); color: var(--amber-lite);
  border-color: #5a3a12; box-shadow: inset 0 0 14px rgba(212,112,10,.15);
}
.sidebar .spacer { flex: 1; }
.logout-btn { color: var(--parch-dim); font-size: 13px; padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--stone); cursor: pointer; text-align: left; width: 100%; }
.logout-btn:hover { color: var(--red); border-color: var(--red); }

.main { flex: 1; padding: 34px 40px 90px; max-width: 1180px; }
.page-head { margin-bottom: 26px; }
.page-head h1 { font-size: 30px; font-weight: 800; }
.page-head p { color: var(--parch-dim); margin-top: 4px; }

/* ─── Cards / panels ─── */
.card {
  background: linear-gradient(180deg, var(--stone-2), var(--stone));
  border: 1px solid var(--line); border-radius: 12px; padding: 20px;
  box-shadow: 0 6px 20px rgba(0,0,0,.35);
}
.card h2, .card h3 { font-size: 17px; margin-bottom: 12px; color: var(--parch); }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 900px){ .grid.cols-3,.grid.cols-4{grid-template-columns:repeat(2,1fr);} .grid.cols-5{grid-template-columns:repeat(2,1fr);} .sidebar{width:64px;} .brand .name,.nav a span.lbl{display:none;} }

/* ─── Buttons — forged metal ─── */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  font-family: 'Inter', sans-serif; font-weight: 600; font-size: 14px; cursor: pointer;
  padding: 11px 18px; border-radius: 9px; color: var(--parch);
  background: linear-gradient(180deg, #2b2620, #1a1712);
  border: 1px solid #4a3d28; box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
  transition: .15s;
}
.btn:hover { border-color: var(--bronze); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary {
  background: linear-gradient(180deg, var(--amber-lite), var(--amber));
  border-color: #b85e08; color: #1a0e02; text-shadow: 0 1px 0 rgba(255,255,255,.25);
  box-shadow: 0 0 16px rgba(212,112,10,.35), inset 0 1px 0 rgba(255,255,255,.35);
}
.btn.primary:hover { filter: brightness(1.08); color: #000; }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 7px; }
.btn.danger:hover { border-color: var(--red); color: #ff6b6b; }

/* ─── Forms ─── */
label.fld { display: block; font-size: 13px; color: var(--parch-dim); margin-bottom: 6px; font-weight: 500; }
input[type=text], input[type=password], input[type=date], textarea, select {
  width: 100%; background: #0e0d0b; border: 1px solid var(--line); color: var(--parch);
  border-radius: 8px; padding: 11px 13px; font-family: inherit; font-size: 14px; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(212,112,10,.15); }
textarea { resize: vertical; min-height: 90px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 140px; }

/* ─── Chips / tag selectors ─── */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 14px; border-radius: 20px; border: 1px solid var(--line); background: var(--stone);
  color: var(--parch-dim); cursor: pointer; font-size: 13px; font-weight: 500; user-select: none;
}
.chip:hover { color: var(--parch); border-color: var(--bronze); }
.chip.active { background: linear-gradient(180deg, #2a1c0c, #1a1207); color: var(--amber-lite);
  border-color: var(--amber); box-shadow: 0 0 12px rgba(212,112,10,.3); }

/* ─── Badges ─── */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600; border: 1px solid var(--line); }
.badge.ok { color: #8fd6a5; border-color: #2f5a3c; background: rgba(74,124,89,.12); }
.badge.off { color: #d59090; border-color: #5a2f2f; background: rgba(139,26,26,.12); }
.badge.type { color: var(--amber-lite); border-color: #5a3a12; background: rgba(212,112,10,.1); }

/* ─── Stat tiles ─── */
.stat { text-align: center; padding: 18px; }
.stat .n { font-family: 'Cinzel', serif; font-size: 34px; font-weight: 800; color: var(--amber-lite); }
.stat .l { color: var(--parch-dim); font-size: 13px; margin-top: 2px; }

/* ─── Selectable media cards (avatars/voices) ─── */
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.pick {
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; cursor: pointer; background: var(--stone);
  transition: .15s; position: relative;
}
.pick:hover { border-color: var(--bronze); }
.pick.sel { border-color: var(--amber); box-shadow: 0 0 0 2px var(--amber), 0 0 18px rgba(212,112,10,.4); }
.pick img { width: 100%; height: 120px; object-fit: cover; display: block; background: #000; }
.pick .cap { padding: 8px 10px; font-size: 13px; color: var(--parch); display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.pick .play { border: 1px solid var(--line); background: var(--stone-2); color: var(--amber-lite);
  border-radius: 6px; padding: 3px 8px; font-size: 12px; cursor: pointer; }

/* ─── Steps ─── */
.step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.step-head .num { width: 28px; height: 28px; border-radius: 50%; background: var(--amber);
  color: #000; font-weight: 800; display: grid; place-items: center; font-size: 14px; flex-shrink: 0; }
.step-head h2 { margin: 0; }

/* ─── Forge fire loader ─── */
.forge-loader { display: inline-flex; gap: 5px; align-items: flex-end; height: 26px; }
.forge-loader span { width: 6px; background: linear-gradient(180deg, #ffd27a, var(--amber), var(--red));
  border-radius: 3px; animation: flare .9s ease-in-out infinite; }
.forge-loader span:nth-child(1){animation-delay:0s;height:14px}
.forge-loader span:nth-child(2){animation-delay:.15s;height:22px}
.forge-loader span:nth-child(3){animation-delay:.3s;height:16px}
.forge-loader span:nth-child(4){animation-delay:.45s;height:24px}
.forge-loader span:nth-child(5){animation-delay:.6s;height:12px}
@keyframes flare { 0%,100%{transform:scaleY(.6);opacity:.7} 50%{transform:scaleY(1.15);opacity:1} }
.progress-list { list-style: none; }
.progress-list li { padding: 8px 0; color: var(--parch-dim); display: flex; align-items: center; gap: 10px; }
.progress-list li.done { color: #8fd6a5; }
.progress-list li.active { color: var(--amber-lite); }

/* ─── Toast ─── */
#toasts { position: fixed; top: 18px; right: 18px; display: flex; flex-direction: column; gap: 10px; z-index: 9999; }
.toast { padding: 12px 16px; border-radius: 9px; border: 1px solid var(--line); background: var(--stone-2);
  color: var(--parch); font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.5); max-width: 340px; }
.toast.ok { border-color: #2f5a3c; } .toast.err { border-color: var(--red); }

/* ─── Login ─── */
.login-wrap { min-height: 100vh; display: grid; place-items: center; }
.login-card { width: 360px; text-align: center; }
.login-card .anvil { font-size: 46px; filter: drop-shadow(0 0 12px var(--amber)); }
.login-card h1 { font-size: 24px; margin: 10px 0 2px; }
.login-card p { color: var(--parch-dim); margin-bottom: 20px; font-size: 13px; }
.login-card .fields { text-align: left; display: flex; flex-direction: column; gap: 12px; }

/* ─── Chat widget ─── */
#chat-fab { position: fixed; right: 22px; bottom: 22px; width: 58px; height: 58px; border-radius: 50%;
  background: linear-gradient(180deg, var(--amber-lite), var(--amber)); border: 1px solid #b85e08;
  color: #1a0e02; font-size: 26px; cursor: pointer; z-index: 9998; box-shadow: 0 0 22px rgba(212,112,10,.5);
  display: grid; place-items: center; }
#chat-fab:hover { filter: brightness(1.08); }
#chat-panel { position: fixed; right: 22px; bottom: 92px; width: 380px; max-width: calc(100vw - 44px);
  height: 540px; max-height: calc(100vh - 130px); background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 14px; z-index: 9998; display: none; flex-direction: column; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.6); }
#chat-panel.open { display: flex; }
.chat-head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px;
  background: linear-gradient(180deg, #221a10, #14100b); }
.chat-head .t { font-family: 'Cinzel', serif; font-weight: 700; font-size: 15px; color: var(--amber-lite); }
.chat-head .x { margin-left: auto; cursor: pointer; color: var(--parch-dim); background: none; border: none; font-size: 18px; }
.chat-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.msg { padding: 10px 13px; border-radius: 10px; font-size: 14px; max-width: 85%; white-space: pre-wrap; word-wrap: break-word; }
.msg.user { align-self: flex-end; background: linear-gradient(180deg,#2a1c0c,#1a1207); border: 1px solid #5a3a12; color: var(--parch); }
.msg.bot { align-self: flex-start; background: var(--stone); border: 1px solid var(--line); }
.msg.sys { align-self: center; color: var(--parch-dim); font-size: 12px; }
.chat-input { padding: 12px; border-top: 1px solid var(--line); display: flex; gap: 8px; }
.chat-input textarea { min-height: 42px; max-height: 120px; }

.muted { color: var(--parch-dim); }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; }
.hidden { display: none !important; }
.output-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px,1fr)); gap: 14px; }
.output-grid .cell { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--stone); }
.output-grid .cell img { width: 100%; display: block; cursor: zoom-in; }
.output-grid .cell .bar { padding: 8px; display: flex; gap: 6px; }
.script-box { white-space: pre-wrap; background: #0e0d0b; border: 1px solid var(--line); border-radius: 10px;
  padding: 16px; min-height: 120px; line-height: 1.6; }
table.hist { width: 100%; border-collapse: collapse; }
table.hist th, table.hist td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
table.hist th { color: var(--parch-dim); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
table.hist tbody tr:hover { background: rgba(212,112,10,.05); }
.thumb { width: 54px; height: 54px; border-radius: 8px; object-fit: cover; background: #000; border: 1px solid var(--line); }

/* ─── Tabs ─── */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.tab { padding: 9px 16px; border-radius: 8px 8px 0 0; border: 1px solid transparent; border-bottom: none;
  background: transparent; color: var(--parch-dim); cursor: pointer; font-weight: 600; font-size: 14px; font-family: inherit; }
.tab:hover { color: var(--parch); }
.tab.active { background: linear-gradient(180deg, #2a1c0c, #171008); color: var(--amber-lite); border-color: var(--line); }
.tab-panel.hidden { display: none; }

/* ─── Dropzone ─── */
.dropzone { border: 2px dashed #4a3d28; border-radius: 12px; padding: 26px; text-align: center; cursor: pointer;
  color: var(--parch-dim); background: #0e0d0b; transition: .15s; }
.dropzone:hover { border-color: var(--bronze); color: var(--parch); }
.dropzone.drag { border-color: var(--amber); background: rgba(212,112,10,.08); color: var(--amber-lite); }
.dropzone .big { font-size: 30px; }

/* ─── Burger (mobile) ─── */
.burger { display: none; position: fixed; top: 12px; left: 12px; z-index: 9997; width: 42px; height: 42px;
  border-radius: 9px; border: 1px solid var(--line); background: var(--stone-2); color: var(--amber-lite); font-size: 20px; cursor: pointer; }

/* ─── Hashtag categories ─── */
.tag-cat { margin-bottom: 14px; }
.tag-cat h4 { font-size: 13px; color: var(--amber-lite); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .5px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { background: var(--stone); border: 1px solid var(--line); border-radius: 16px; padding: 4px 11px; font-size: 13px; color: var(--parch); cursor: pointer; }
.tag:hover { border-color: var(--amber); color: var(--amber-lite); }

/* ─── Favorite star ─── */
.star { cursor: pointer; font-size: 18px; color: #4a4335; background: none; border: none; line-height: 1; }
.star.on { color: #f2c14e; text-shadow: 0 0 8px rgba(242,193,78,.5); }

/* ─── Calendar ─── */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.cal-day { border: 1px solid var(--line); border-radius: 10px; background: var(--stone); min-height: 150px; padding: 8px; display: flex; flex-direction: column; }
.cal-day.today { border-color: var(--amber); box-shadow: inset 0 0 12px rgba(212,112,10,.15); }
.cal-day .dh { font-size: 12px; color: var(--parch-dim); display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.cal-day .dh .add { cursor: pointer; color: var(--amber-lite); border: 1px solid var(--line); border-radius: 6px; width: 20px; height: 20px; display: grid; place-items: center; font-size: 13px; }
.cal-item { border-radius: 7px; padding: 6px 8px; font-size: 12px; margin-bottom: 6px; cursor: grab; border-left: 3px solid var(--amber); background: var(--stone-2); }
.cal-item.tiktok { border-left-color: #D4700A; } .cal-item.instagram { border-left-color: #b45cff; } .cal-item.facebook { border-left-color: #4a72d6; }
.cal-item.twitter { border-left-color: #45b3e0; } .cal-item.youtube { border-left-color: #e0454f; }
.cal-item .st { display: inline-block; font-size: 10px; padding: 1px 6px; border-radius: 10px; background: rgba(255,255,255,.06); color: var(--parch-dim); margin-top: 3px; }
.cal-item.drop-target { outline: 2px dashed var(--amber); }

/* ─── Asset grid ─── */
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); gap: 14px; }
.asset { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--stone); }
.asset .img { height: 130px; background: #000 center/contain no-repeat; display: block; }
.asset .meta { padding: 8px 10px; }
.asset .meta .nm { font-size: 12px; color: var(--parch); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset .meta .cat { font-size: 11px; color: var(--amber-lite); }
.asset .acts { display: flex; gap: 4px; padding: 0 8px 8px; flex-wrap: wrap; }

/* ─── Reorder list (combine) ─── */
.reorder .ri { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--stone); margin-bottom: 8px; cursor: grab; }
.reorder .ri.dragging { opacity: .5; }
.reorder .ri .h { color: var(--parch-dim); }

/* ─── Usage bars ─── */
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.bar-row .lbl { width: 130px; font-size: 13px; color: var(--parch-dim); }
.bar-track { flex: 1; height: 14px; background: #0e0d0b; border-radius: 7px; overflow: hidden; border: 1px solid var(--line); }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--bronze), var(--amber-lite)); }
.chart { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding-top: 10px; }
.chart .col { flex: 1; background: linear-gradient(180deg, var(--amber-lite), var(--amber)); border-radius: 3px 3px 0 0; min-height: 2px; }

/* ─── Mobile ─── */
@media (max-width: 820px){
  .burger { display: grid; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 9996; transform: translateX(-110%); transition: transform .2s; width: 220px; }
  .sidebar.open { transform: translateX(0); }
  .sidebar .brand .name, .nav a span.lbl { display: inline; }
  .main { padding: 64px 16px 90px; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4, .grid.cols-5 { grid-template-columns: 1fr; }
  .cal-grid { grid-template-columns: repeat(2, 1fr); }
  .page-head h1 { font-size: 24px; }
  .row > * { min-width: 100%; }
}
@media (max-width: 480px){ .cal-grid { grid-template-columns: 1fr; } }

/* ══════════ REVAMP v3 — polish, animations, mobile ══════════ */

/* Smoother global transitions + font smoothing */
*{ -webkit-font-smoothing: antialiased; }
.card, .btn, .chip, .tab, .pick, .nav a, .stat, .asset { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease, color .18s ease; }

/* Page entrance */
.main { animation: fadeUp .35s ease both; }
@keyframes fadeUp { from{ opacity:0; transform: translateY(8px);} to{ opacity:1; transform:none;} }

/* Cards — subtle depth + hover lift */
.card { position: relative; }
.card:hover { border-color:#4a3d28; box-shadow: 0 10px 30px rgba(0,0,0,.45); }
a.card:hover, .quick-card:hover { transform: translateY(-3px); border-color: var(--amber); box-shadow: 0 12px 34px rgba(0,0,0,.5), 0 0 22px rgba(212,112,10,.18); }

/* Buttons — forged press + amber shine sweep */
.btn { position: relative; overflow: hidden; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn.primary::after{ content:''; position:absolute; top:0; left:-120%; width:60%; height:100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent); transform: skewX(-20deg); }
.btn.primary:hover::after{ animation: shine .7s ease; }
@keyframes shine { to{ left:130%; } }

/* Glowing stat numbers + count-up feel */
.stat .n { text-shadow: 0 0 18px rgba(242,147,58,.45); animation: glowPulse 3.5s ease-in-out infinite; }
@keyframes glowPulse { 0%,100%{ text-shadow:0 0 14px rgba(242,147,58,.3);} 50%{ text-shadow:0 0 26px rgba(242,147,58,.6);} }

/* Forge-fire animated dashboard header */
.forge-hero { position: relative; display:flex; align-items:center; gap:18px; padding:26px; border-radius:16px;
  background: radial-gradient(600px 200px at 12% -30%, #2a1a0e 0%, transparent 70%), linear-gradient(180deg,#161310,#0d0b09);
  border:1px solid var(--line); overflow:hidden; }
.forge-hero .ember { position:absolute; bottom:-10px; width:8px; height:8px; border-radius:50%;
  background: radial-gradient(circle,#ffd27a,#D4700A 60%,transparent 70%); opacity:0; animation: ember 3.2s linear infinite; }
@keyframes ember { 0%{ transform: translateY(0) scale(1); opacity:0; } 10%{opacity:.9;} 100%{ transform: translateY(-160px) translateX(20px) scale(.3); opacity:0; } }
.forge-hero .anvil-big { font-size:52px; filter: drop-shadow(0 0 16px var(--amber)); animation: hammer 2.4s ease-in-out infinite; }
@keyframes hammer { 0%,88%,100%{ transform: rotate(0);} 92%{ transform: rotate(-12deg);} 96%{ transform: rotate(4deg);} }

/* Tabs — animated active underline + panel fade */
.tab { position: relative; }
.tab.active::after{ content:''; position:absolute; left:12px; right:12px; bottom:-3px; height:2px; background: var(--amber); box-shadow:0 0 8px var(--amber); border-radius:2px; animation: growLine .25s ease; }
@keyframes growLine { from{ transform: scaleX(.2); opacity:0;} to{ transform:none; opacity:1;} }
.tab-panel:not(.hidden){ animation: fadeUp .28s ease both; }

/* Nav active glow */
.nav a.active { position: relative; }
.nav a.active::before{ content:''; position:absolute; left:0; top:8px; bottom:8px; width:3px; border-radius:3px; background: var(--amber); box-shadow:0 0 10px var(--amber); }
.nav a:active{ transform: scale(.98); }
.collapse-btn{ margin-left:auto; background:none; border:1px solid var(--line); color:var(--parch-dim); width:24px; height:24px; border-radius:6px; cursor:pointer; }
.collapse-btn:hover{ color:var(--amber-lite); border-color:var(--bronze); }

/* Collapsed sidebar (desktop) */
body.collapsed .sidebar{ width:66px; }
body.collapsed .sidebar .brand .name, body.collapsed .nav a .lbl, body.collapsed .logout-btn .lbl{ display:none; }
body.collapsed .nav a{ justify-content:center; }
body.collapsed .collapse-btn{ transform: rotate(180deg); }
/* Tooltips when collapsed */
body.collapsed .nav a{ position:relative; }
body.collapsed .nav a::after{ content: attr(data-tip); position:absolute; left:64px; top:50%; transform: translateY(-50%);
  background:#000; color:var(--parch); border:1px solid var(--line); padding:5px 9px; border-radius:7px; font-size:12px;
  white-space:nowrap; opacity:0; pointer-events:none; transition:.15s; z-index:50; }
body.collapsed .nav a:hover::after{ opacity:1; left:60px; }

/* Empty states */
.empty { text-align:center; padding:44px 20px; color:var(--parch-dim); }
.empty .ico{ font-size:44px; opacity:.6; filter: drop-shadow(0 0 10px rgba(212,112,10,.3)); }
.empty h3{ margin:10px 0 4px; color:var(--parch); }

/* Shimmer skeleton loading */
.skeleton{ background: linear-gradient(90deg, #17140f 25%, #221d15 50%, #17140f 75%); background-size:200% 100%; animation: shimmer 1.3s infinite; border-radius:8px; }
@keyframes shimmer { to{ background-position:-200% 0; } }

/* Idea cards */
.idea { border:1px solid var(--line); border-left:3px solid var(--amber); border-radius:10px; padding:13px 15px; background: var(--stone); }
.idea:hover{ border-color: var(--bronze); border-left-color: var(--amber-lite); transform: translateX(2px); }
.idea .h{ font-weight:600; margin-bottom:4px; }
.idea .hook{ color: var(--parch-dim); font-size:13px; font-style:italic; }
.idea .meta{ margin-top:7px; display:flex; gap:6px; flex-wrap:wrap; }

/* Prediction meter */
.meter{ height:10px; border-radius:6px; background:#0e0d0b; border:1px solid var(--line); overflow:hidden; }
.meter > i{ display:block; height:100%; background: linear-gradient(90deg,#8B1A1A,#D4700A,#4A7C59); }
.score-badge{ font-family:'Cinzel',serif; font-size:26px; font-weight:800; color: var(--amber-lite); }

/* Mobile bottom nav */
.bottom-nav{ display:none; }
@media (max-width: 820px){
  .bottom-nav{ display:flex; position:fixed; left:0; right:0; bottom:0; z-index:9995;
    background: rgba(13,11,9,.96); backdrop-filter: blur(8px); border-top:1px solid var(--line); padding:6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .bottom-nav a{ flex:1; display:flex; flex-direction:column; align-items:center; gap:2px; padding:7px 2px; min-height:52px; justify-content:center;
    color: var(--parch-dim); font-size:10px; border-radius:10px; }
  .bottom-nav a .i{ font-size:20px; }
  .bottom-nav a.active{ color: var(--amber-lite); background: rgba(212,112,10,.12); }
  .main{ padding-bottom: 84px; }
  #chat-fab{ bottom: 78px; }
  /* Larger tap targets */
  .btn{ min-height:44px; } .btn.sm{ min-height:38px; }
  .tab{ min-height:44px; } input, select, textarea{ min-height:44px; font-size:16px; }
  .nav a{ min-height:46px; }
}

/* ══════════ UX REVAMP — grouped nav, topbar, chaining, modal ══════════ */

/* Grouped sidebar */
.brand a { color: inherit; }
.nav-home { display:flex; align-items:center; gap:11px; padding:10px 12px; border-radius:8px;
  color:var(--parch-dim); font-weight:500; font-size:14px; border:1px solid transparent; margin-bottom:2px; }
.nav-home:hover { background:var(--stone); color:var(--parch); }
.nav-home.active { background:linear-gradient(180deg,#2a1c0c,#1a1207); color:var(--amber-lite); border-color:#5a3a12; }
.nav-home .i { font-size:17px; width:20px; text-align:center; }
.nav { overflow-y:auto; scrollbar-width:thin; }
.nav-group { margin-top:8px; }
.nav-group-h { display:flex; align-items:center; width:100%; background:none; border:none; cursor:pointer;
  color:var(--bronze); font-size:10.5px; font-weight:700; letter-spacing:1.6px; padding:6px 12px 4px;
  font-family:'Cinzel', serif; }
.nav-group-h:hover { color:var(--amber-lite); }
.nav-group-h .chev { margin-left:auto; font-size:10px; }
.nav-group-items { display:none; flex-direction:column; gap:2px; }
.nav-group.open .nav-group-items { display:flex; }
body.collapsed .nav-group-h .lbl { display:none; }
body.collapsed .nav-group-h { justify-content:center; padding:6px 0 2px; }
body.collapsed .nav-group-items { display:flex; } /* collapsed rail always shows icons */
body.collapsed .nav-home { justify-content:center; }
body.collapsed .nav-home .lbl { display:none; }

/* Global client selector topbar */
.topbar { display:flex; align-items:center; gap:10px; padding:10px 14px; margin:-10px 0 18px;
  border:1px solid var(--line); border-radius:10px; background:linear-gradient(180deg,#171310,#100d0a); flex-wrap:wrap; }
.topbar .gcs-tag { font-size:12px; color:var(--parch-dim); letter-spacing:.4px; }
.topbar select { width:auto; min-width:170px; padding:7px 10px; font-size:13px; }
.topbar .gcs-name { font-family:'Cinzel',serif; font-weight:700; font-size:13px; color:var(--amber-lite);
  padding:3px 10px; border:1px solid #5a3a12; border-radius:16px; background:rgba(212,112,10,.08); }

/* Workflow chaining action bar */
.chain-bar { display:flex; flex-wrap:wrap; gap:6px; margin-top:10px; padding-top:10px; border-top:1px dashed var(--line); }
.chain-bar .btn { font-size:12.5px; }

/* Shared modal */
#forge-modal { position:fixed; inset:0; background:rgba(0,0,0,.75); z-index:9998; display:grid; place-items:center; padding:18px; }
#forge-modal .fm-card { width:640px; max-width:96vw; max-height:88vh; overflow:auto; background:var(--bg-2);
  border:1px solid var(--line); border-radius:14px; box-shadow:0 24px 70px rgba(0,0,0,.65); }
#forge-modal .fm-head { display:flex; align-items:center; gap:10px; padding:14px 18px; border-bottom:1px solid var(--line);
  background:linear-gradient(180deg,#221a10,#14100b); position:sticky; top:0; }
#forge-modal .fm-head h3 { margin:0; font-size:16px; color:var(--amber-lite); flex:1; }
#forge-modal .fm-x { background:none; border:none; color:var(--parch-dim); font-size:17px; cursor:pointer; }
#forge-modal .fm-x:hover { color:var(--red); }
#forge-modal .fm-body { padding:18px; }

/* Library page grid */
.lib-toolbar { display:flex; gap:10px; flex-wrap:wrap; align-items:center; margin-bottom:16px; }
.lib-toolbar input[type=text] { flex:2; min-width:200px; }
.lib-toolbar select { flex:1; min-width:140px; width:auto; }
.lib-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:14px; }
.lib-item { border:1px solid var(--line); border-radius:10px; overflow:hidden; background:var(--stone); display:flex; flex-direction:column; }
.lib-item .th { height:140px; background:#000; display:grid; place-items:center; font-size:34px; cursor:zoom-in; position:relative; }
.lib-item .th img, .lib-item .th video { width:100%; height:100%; object-fit:cover; display:block; }
.lib-item .meta { padding:8px 10px 4px; }
.lib-item .meta .nm { font-size:12.5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.lib-item .meta .sub { font-size:11px; color:var(--parch-dim); display:flex; gap:6px; flex-wrap:wrap; margin-top:3px; }
.lib-item .acts { display:flex; gap:4px; padding:6px 8px 8px; flex-wrap:wrap; }
.lib-badge { font-size:10px; padding:1px 7px; border-radius:10px; border:1px solid var(--line); color:var(--amber-lite); }

@media (max-width:820px){
  .topbar { margin-top:44px; }
  #forge-modal .fm-card { width:100%; }
}
