@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg:    #f5f5f7;
  --white: #ffffff;
  --card:  #ffffff;
  --bd:    #e5e5ea;
  --text:  #1c1c1e;
  --sub:   #6e6e73;
  --muted: #aeaeb2;
  --acc:   #e05c2a;
  --acc2:  #c0440f;
  --blue:  #3b82f6;
  --purple:#8b5cf6;
  --amber: #f59e0b;
  --green: #10b981;
  --red:   #ef4444;
  --teal:  #0ea5e9;
  --r:     14px;
  --r2:    10px;
  --r3:    8px;
  --font:  'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,.10);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); -webkit-font-smoothing: antialiased; }

/* ── SCREENS ── */
#hubRoot { min-height: 100vh; }
.hub-screen { display: none !important; }
.hub-screen.visible { display: block !important; }

/* ── PIN SCREEN ── */
#hubPin {
  min-height: 100vh;
  display: flex !important;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #f0f0f5 0%, #e8e8f0 100%);
}
#hubPin.hub-screen { display: flex !important; }
#hubPin.hub-screen:not(.visible) { display: none !important; }

.pin-card {
  background: var(--white);
  border-radius: 24px;
  padding: 40px 36px 36px;
  width: 320px;
  text-align: center;
  box-shadow: 0 8px 40px rgba(0,0,0,.12);
}
.pin-logo {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--acc), var(--acc2));
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; margin: 0 auto 16px;
  box-shadow: 0 4px 16px rgba(224,92,42,.30);
}
.pin-card h1 { font-size: 22px; font-weight: 700; margin-bottom: 4px; letter-spacing: -.4px; }
.pin-card h1 em { color: var(--acc); font-style: normal; }
.pin-sitename { font-size: 13px; color: var(--sub); margin-bottom: 28px; }

.pin-dots { display: flex; gap: 10px; justify-content: center; margin-bottom: 24px; }
.pin-dots span {
  width: 13px; height: 13px; border-radius: 50%;
  background: #e5e5ea; border: none;
  transition: all .15s;
}
.pin-dots span.filled { background: var(--acc); transform: scale(1.1); }

.numpad { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-bottom: 14px; }
.np-btn {
  background: var(--bg); border: 1px solid var(--bd);
  border-radius: 12px; color: var(--text);
  font-family: var(--font); font-size: 20px; font-weight: 600;
  padding: 14px; cursor: pointer; transition: all .12s;
}
.np-btn:hover { background: #eaeaef; border-color: #ccc; }
.np-btn:active { transform: scale(.93); background: #ddd; }
.np-back { font-size: 15px; color: var(--sub); }
.np-enter { background: var(--acc); color: #fff; border-color: var(--acc); font-size: 14px; font-weight: 700; }
.np-enter:hover { background: var(--acc2); border-color: var(--acc2); }
.pin-msg { font-size: 13px; min-height: 20px; margin-top: 4px; color: var(--sub); }
.pin-msg.err { color: var(--red); font-weight: 500; }
.pin-msg.lk  { color: var(--amber); }

/* ── APP LAYOUT ── */
#hubApp {
  display: grid;
  grid-template-columns: 230px 1fr;
  min-height: 100vh;
}
#hubApp.hub-screen:not(.visible) { display: none !important; }

/* ── SIDEBAR ── */
.hub-nav {
  background: var(--white);
  border-right: 1px solid var(--bd);
  padding: 20px 0;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.nav-brand {
  display: flex; align-items: center; gap: 11px;
  padding: 0 18px 18px; border-bottom: 1px solid var(--bd); margin-bottom: 10px;
}
.nav-logo {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--acc), var(--acc2));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.nav-title { font-size: 14px; font-weight: 700; letter-spacing: -.3px; }
.nav-sub   { font-size: 11px; color: var(--sub); margin-top: 1px; }

.nav-sep-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .9px; color: var(--muted);
  padding: 12px 18px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 18px; font-size: 13px; font-weight: 500;
  color: var(--sub); background: none; border: none;
  cursor: pointer; transition: all .12s;
  width: 100%; text-align: left; border-radius: 0;
  font-family: var(--font); min-height: 44px;
  box-sizing: border-box; line-height: 1.4;
}
.nav-item:hover { background: #f5f5f7; color: var(--text); }
.nav-item.active {
  background: rgba(224,92,42,.08);
  color: var(--acc); font-weight: 600;
}
.nav-item i { font-size: 16px; width: 18px; flex-shrink: 0; }
.nav-pill {
  background: var(--acc); color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 1px 7px; border-radius: 99px; margin-left: auto;
}
.nav-footer {
  margin-top: auto; padding: 14px 18px 0;
  border-top: 1px solid var(--bd);
}
.nav-logout-btn {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 9px 0;
  font-size: 13px; color: var(--sub);
  background: none; border: none; cursor: pointer;
  font-family: var(--font); transition: color .12s;
}
.nav-logout-btn:hover { color: var(--red); }

/* ── MAIN CONTENT ── */
.hub-main { padding: 32px 36px; background: var(--bg); min-height: 100vh; }
.tab-pane  { display: none !important; }
.tab-pane.active { display: block !important; }

.pane-hd {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.pane-hd h2 { font-size: 24px; font-weight: 700; letter-spacing: -.5px; }
.icon-btn {
  background: var(--white); border: 1px solid var(--bd);
  border-radius: var(--r2); color: var(--sub);
  font-family: var(--font); font-size: 12px;
  padding: 8px 14px; cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  transition: all .12s; box-shadow: var(--shadow);
}
.icon-btn:hover { border-color: #bbb; color: var(--text); }
.btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--acc); color: #fff;
  border: none; border-radius: var(--r2);
  font-family: var(--font); font-size: 13px; font-weight: 600;
  padding: 10px 18px; cursor: pointer; transition: background .12s;
  box-shadow: 0 2px 8px rgba(224,92,42,.3);
}
.btn-primary:hover { background: var(--acc2); }

/* ── STATS ROW ── */
.stats-row {
  display: grid; grid-template-columns: repeat(4,1fr);
  gap: 14px; margin-bottom: 28px;
}
.stat-card {
  background: var(--white); border: 1px solid var(--bd);
  border-radius: var(--r); padding: 20px;
  box-shadow: var(--shadow);
}
.stat-lbl {
  font-size: 12px; font-weight: 500; color: var(--sub);
  margin-bottom: 10px; display: flex; align-items: center; gap: 6px;
}
.stat-lbl i { font-size: 14px; }
.stat-val { font-size: 30px; font-weight: 700; letter-spacing: -1px; line-height: 1; }
.stat-note { font-size: 11px; color: var(--muted); margin-top: 6px; }
.stat-note.g { color: var(--green); }
.stat-note.w { color: var(--amber); }
.c-bar { height: 3px; background: #f0f0f5; border-radius: 99px; overflow: hidden; margin-top: 10px; }
.c-bar-fill { height: 100%; background: linear-gradient(90deg, var(--acc), var(--amber)); border-radius: 99px; transition: width .4s; }

/* ── CREDITS CHART ── */
.credits-chart-box {
  background: var(--white); border: 1px solid var(--bd);
  border-radius: var(--r); padding: 20px 24px;
  margin-bottom: 28px; box-shadow: var(--shadow);
}
.credits-chart-box h3 { font-size: 14px; font-weight: 600; margin-bottom: 18px; color: var(--sub); }
.chart-bars { display: flex; align-items: flex-end; gap: 8px; height: 80px; }
.chart-bar-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; }
.chart-bar {
  width: 100%; background: rgba(224,92,42,.15);
  border-radius: 4px 4px 0 0; transition: height .4s;
  min-height: 4px;
}
.chart-bar.this-month { background: var(--acc); }
.chart-bar-lbl { font-size: 10px; color: var(--muted); }
.chart-bar-val { font-size: 10px; font-weight: 600; color: var(--sub); }

/* ── QUICK ACTIONS ── */
.sect-title { font-size: 13px; font-weight: 600; color: var(--sub); margin-bottom: 14px; text-transform: uppercase; letter-spacing: .5px; }
.tools-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 28px; }
.tool-card {
  background: var(--white); border: 1px solid var(--bd);
  border-radius: var(--r); padding: 18px;
  cursor: pointer; transition: all .15s;
  box-shadow: var(--shadow);
}
.tool-card:hover { border-color: #bbb; box-shadow: var(--shadow-md); transform: translateY(-1px); }
.tool-ico {
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px; font-size: 20px;
}
.tool-name  { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.tool-desc  { font-size: 12px; color: var(--sub); line-height: 1.4; }
.tool-cred  {
  font-size: 11px; color: var(--muted); margin-top: 10px;
  padding-top: 10px; border-top: 1px solid var(--bd);
  display: flex; align-items: center; gap: 4px;
}

/* ── ACTIVITY ── */
.act-list { display: flex; flex-direction: column; gap: 6px; }
.act-row {
  background: var(--white); border: 1px solid var(--bd);
  border-radius: var(--r2); padding: 12px 16px;
  display: flex; align-items: center; gap: 12px;
  font-size: 13px; box-shadow: var(--shadow);
}
.act-ico {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.act-text { flex: 1; font-size: 13px; }
.act-time { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* ── CHAT ── */
.chat-area { display: flex; flex-direction: column; height: calc(100vh - 140px); }
.chat-msgs { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding-bottom: 16px; }
.cmsg { display: flex; max-width: 78%; }
.cmsg.bot  { align-self: flex-start; }
.cmsg.user { align-self: flex-end; }
.cbubble { padding: 12px 16px; border-radius: 16px; font-size: 14px; line-height: 1.6; }
.cmsg.bot  .cbubble { background: var(--white); border: 1px solid var(--bd); border-bottom-left-radius: 4px; box-shadow: var(--shadow); }
.cmsg.user .cbubble { background: var(--acc); color: #fff; border-bottom-right-radius: 4px; }
.cdot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: dp 1.2s ease infinite; display: inline-block; }
.cdot:nth-child(2) { animation-delay: .2s; }
.cdot:nth-child(3) { animation-delay: .4s; }
@keyframes dp { 0%,80%,100% { transform: scale(.5); opacity: .3; } 40% { transform: scale(1); opacity: 1; } }
.chat-suggs { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.chat-sugg {
  background: var(--white); border: 1px solid var(--bd);
  border-radius: 99px; color: var(--sub);
  font-family: var(--font); font-size: 12px;
  padding: 7px 14px; cursor: pointer; transition: all .12s;
  box-shadow: var(--shadow);
}
.chat-sugg:hover { border-color: var(--acc); color: var(--acc); }
.chat-bottom { display: flex; gap: 8px; padding-top: 12px; border-top: 1px solid var(--bd); }
.chat-bottom input {
  flex: 1; background: var(--white); border: 1px solid var(--bd);
  border-radius: var(--r2); color: var(--text);
  font-family: var(--font); font-size: 14px;
  padding: 12px 16px; outline: none; transition: border-color .15s;
  box-shadow: var(--shadow);
}
.chat-bottom input:focus { border-color: var(--acc); }
.chat-bottom input::placeholder { color: var(--muted); }
#chatSendBtn {
  background: var(--acc); border: none; border-radius: var(--r2);
  color: #fff; padding: 12px 16px; cursor: pointer; font-size: 18px;
  box-shadow: 0 2px 8px rgba(224,92,42,.3); transition: background .12s;
}
#chatSendBtn:hover { background: var(--acc2); }

/* ── NOTIFICATIONS ── */
.notif-item {
  background: var(--white); border: 1px solid var(--bd);
  border-radius: var(--r); padding: 14px 16px;
  display: flex; gap: 12px; margin-bottom: 8px;
  box-shadow: var(--shadow);
}
.notif-item.unread { border-left: 3px solid var(--acc); }
.notif-ico { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.notif-body { flex: 1; }
.notif-msg  { font-size: 13px; line-height: 1.5; }
.notif-time { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ── HISTORY ── */
.hist-row {
  background: var(--white); border: 1px solid var(--bd);
  border-radius: var(--r2); padding: 12px 16px;
  display: flex; align-items: center; gap: 12px;
  font-size: 13px; margin-bottom: 6px; box-shadow: var(--shadow);
}
.hist-ico { width: 30px; height: 30px; border-radius: 50%; background: #f5f5f7; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.hist-text { flex: 1; }
.hist-meta { font-size: 11px; color: var(--muted); }

/* ── QUEUE ── */
.queue-item {
  background: var(--white); border: 1px solid var(--bd);
  border-radius: var(--r); padding: 18px;
  margin-bottom: 10px; display: flex;
  justify-content: space-between; align-items: flex-start;
  gap: 16px; box-shadow: var(--shadow);
}
.queue-info strong { font-size: 14px; display: block; margin-bottom: 4px; }
.queue-info p { font-size: 12px; color: var(--sub); }
.queue-acts { display: flex; gap: 8px; flex-shrink: 0; }
.btn-approve {
  background: var(--green); color: #fff; border: none;
  border-radius: var(--r2); font-family: var(--font);
  font-size: 12px; font-weight: 600; padding: 8px 16px; cursor: pointer;
}
.btn-reject {
  background: rgba(239,68,68,.08); color: var(--red);
  border: 1px solid rgba(239,68,68,.2); border-radius: var(--r2);
  font-family: var(--font); font-size: 12px; padding: 8px 14px; cursor: pointer;
}

/* ── DNA ── */
.dna-badge {
  font-size: 13px; font-weight: 500; padding: 5px 14px;
  border-radius: 99px; background: rgba(224,92,42,.08);
  color: var(--acc); border: 1px solid rgba(224,92,42,.2);
}
.dna-q {
  background: var(--white); border: 1px solid var(--bd);
  border-radius: var(--r); padding: 20px;
  margin-bottom: 12px; box-shadow: var(--shadow);
}
.dna-q-text  { font-size: 13px; color: var(--sub); margin-bottom: 10px; line-height: 1.5; }
.dna-q-ans   { font-size: 14px; line-height: 1.6; margin-bottom: 12px; }
.dna-q-ans.empty { color: var(--muted); font-style: italic; }
.dna-textarea {
  width: 100%; background: #f9f9fb; border: 1px solid var(--bd);
  border-radius: var(--r2); color: var(--text);
  font-family: var(--font); font-size: 14px;
  padding: 12px; resize: vertical; min-height: 80px;
  transition: border-color .15s; display: none;
}
.dna-textarea:focus { outline: none; border-color: var(--acc); }
.dna-edit-btn {
  background: transparent; border: 1px solid var(--bd);
  border-radius: var(--r2); color: var(--sub);
  font-family: var(--font); font-size: 12px;
  padding: 6px 12px; cursor: pointer; transition: all .12s; margin-right: 6px;
}
.dna-edit-btn:hover { border-color: #bbb; color: var(--text); }
.dna-save-btn {
  background: var(--acc); border: none; border-radius: var(--r2);
  color: #fff; font-family: var(--font); font-size: 12px;
  font-weight: 600; padding: 6px 14px; cursor: pointer; display: none;
}

/* ── CREDITS PAGE ── */
.credits-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-bottom: 24px; }
.credit-big {
  background: var(--white); border: 1px solid var(--bd);
  border-radius: var(--r); padding: 22px; text-align: center;
  box-shadow: var(--shadow);
}
.credit-big-lbl { font-size: 12px; color: var(--sub); margin-bottom: 8px; font-weight: 500; }
.credit-big-val { font-size: 38px; font-weight: 700; letter-spacing: -1.5px; }
.credit-use-row {
  background: var(--white); border: 1px solid var(--bd);
  border-radius: var(--r2); padding: 12px 16px;
  display: flex; align-items: center; gap: 12px;
  font-size: 13px; margin-bottom: 6px; box-shadow: var(--shadow);
}

/* ── MISC ── */
.sect-hd { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin-bottom: 12px; }
.empty-state { text-align: center; padding: 60px 24px; color: var(--muted); }
.empty-state i { font-size: 40px; display: block; margin-bottom: 12px; opacity: .3; }
.sk, .sk-row { background: #ebebef; border-radius: var(--r); animation: sk 1.2s ease infinite alternate; }
.sk { height: 90px; }
.sk-row { height: 50px; margin-bottom: 8px; border-radius: var(--r2); }
@keyframes sk { from { opacity: .5; } to { opacity: 1; } }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  #hubApp { grid-template-columns: 1fr; }
  .hub-nav { height: auto; position: relative; flex-direction: row; flex-wrap: wrap; padding: 12px; gap: 2px; }
  .nav-brand { padding-bottom: 0; border-bottom: none; margin-bottom: 8px; width: 100%; }
  .nav-sep-label { display: none; }
  .nav-item { padding: 8px 10px; border-radius: var(--r2); width: auto; flex-shrink: 0; }
  .nav-item.active { background: rgba(224,92,42,.1); color: var(--acc); }
  .nav-footer { margin-top: 0; padding: 0; border-top: none; }
  .hub-main { padding: 20px 16px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .tools-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 500px) {
  .pin-card { width: 290px; padding: 32px 22px; }
  .tools-grid { grid-template-columns: 1fr 1fr; }
  .stats-row { grid-template-columns: 1fr 1fr; }
}

/* ── EMBED BOX ── */
.embed-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 48px 32px;
  text-align: center;
  color: var(--muted);
}
.embed-box i { font-size: 48px; display: block; margin-bottom: 14px; opacity: .3; }
.embed-box p { font-size: 14px; line-height: 1.6; margin-bottom: 0; }

/* ── TOOL CARD improvements ── */
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
  cursor: pointer;
  transition: all .18s;
}
.tool-card:hover { border-color: var(--acc); box-shadow: 0 4px 14px rgba(224,92,42,.1); transform: translateY(-1px); }
.tool-ico {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
  font-size: 18px;
}
.tool-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; color: var(--text); }
.tool-desc { font-size: 12px; color: var(--muted); line-height: 1.4; margin-bottom: 8px; }
.tool-cred { font-size: 11px; color: var(--muted); padding-top: 8px; border-top: 1px solid var(--border); }

/* ── NAV improvements — highlight active better ── */
.nav-item.active {
  background: rgba(224,92,42,.08);
  color: var(--acc);
  border-left-color: var(--acc);
  font-weight: 600;
}

/* ── OVERVIEW two-col ── */
.overview-grid { display: grid; grid-template-columns: 1fr 320px; gap: 24px; }
@media (max-width: 900px) { .overview-grid { grid-template-columns: 1fr; } }
.sect-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.act-list { display: flex; flex-direction: column; gap: 6px; }
.act-row { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r2); padding: 11px 14px; display: flex; align-items: center; gap: 10px; font-size: 13px; }
.act-ico { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 12px; background: #f5f5f7; }
.act-text { flex: 1; color: var(--text); }
.act-time { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* ── CREDIT bar ── */
.c-bar { height: 4px; background: var(--border); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.c-bar-fill { height: 100%; background: linear-gradient(90deg, var(--acc), #f59e0b); border-radius: 99px; transition: width .4s; }

/* ══════════════════════════════════════════════════════
   DNA EXPERIENCE
══════════════════════════════════════════════════════ */

/* DNA Header */
.dna-header { margin-bottom: 20px; }
.dna-logo-wrap { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.dna-logo { width: 48px; height: 48px; background: linear-gradient(135deg, #7c3aed, #a855f7); border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 22px; box-shadow: 0 4px 16px rgba(124,58,237,.3); }
.dna-brand { font-size: 22px; font-weight: 700; letter-spacing: -.4px; color: var(--text); }
.dna-tagline { font-size: 13px; color: var(--muted); margin-top: 2px; }
.dna-progress-bar-wrap { background: var(--surface); border-radius: var(--r); padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid var(--border); }
.dna-prog-track { flex: 1; height: 6px; background: rgba(255,255,255,.08); border-radius: 99px; overflow: hidden; }
.dna-prog-fill { height: 100%; background: linear-gradient(90deg, #7c3aed, #a855f7); border-radius: 99px; transition: width .5s ease; }
.dna-prog-label { font-size: 13px; color: var(--muted); white-space: nowrap; flex-shrink: 0; }

/* DNA Tabs */
.dna-tabs { display: flex; gap: 4px; background: rgba(255,255,255,.04); border-radius: var(--r); padding: 5px; margin-bottom: 20px; }
.dna-tab { flex: 1; padding: 10px 8px; border: none; background: none; color: var(--muted); font-family: var(--font); font-size: 13px; font-weight: 500; cursor: pointer; border-radius: var(--r2); transition: all .18s; text-align: center; }
.dna-tab:hover { color: var(--text); background: rgba(255,255,255,.06); }
.dna-tab.active { background: #312b5a; color: #a78bfa; font-weight: 600; }

/* DNA Tab Panes */
.dna-tabpane { display: none; }
.dna-tabpane.active { display: block; }

/* Info box */
.dna-info-box { background: rgba(34,197,94,.08); border: 1px solid rgba(34,197,94,.2); border-radius: var(--r); padding: 16px; display: flex; gap: 12px; margin-bottom: 20px; font-size: 13px; line-height: 1.6; color: var(--text); }
.dna-info-box span { font-size: 18px; flex-shrink: 0; }
.dna-info-box strong { display: block; margin-bottom: 4px; color: #4ade80; }
.dna-warn-box { background: rgba(251,191,36,.08); border: 1px solid rgba(251,191,36,.2); border-radius: var(--r); padding: 14px; display: flex; gap: 12px; margin-bottom: 20px; font-size: 13px; line-height: 1.6; color: var(--text); }
.dna-warn-box strong { display: block; margin-bottom: 3px; color: #fbbf24; }

/* Themes grid */
.dna-themes-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: 20px; }
@media (max-width: 700px) { .dna-themes-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .dna-themes-grid { grid-template-columns: 1fr; } }

.dna-theme-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 20px; cursor: pointer; transition: all .18s; position: relative; }
.dna-theme-card:hover { border-color: rgba(167,139,250,.4); background: rgba(124,58,237,.06); transform: translateY(-1px); }
.dna-theme-card.done { border-color: rgba(74,222,128,.3); background: rgba(34,197,94,.05); }
.dna-theme-icon { font-size: 28px; margin-bottom: 10px; display: block; }
.dna-theme-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.dna-theme-sub { font-size: 12px; color: var(--muted); line-height: 1.5; margin-bottom: 12px; }
.dna-theme-status { }
.dna-badge-pending { background: rgba(255,255,255,.06); color: var(--muted); border: 1px solid var(--border); border-radius: 99px; font-size: 11px; padding: 3px 10px; font-weight: 500; }
.dna-badge-done { background: rgba(74,222,128,.12); color: #4ade80; border: 1px solid rgba(74,222,128,.25); border-radius: 99px; font-size: 11px; padding: 3px 10px; font-weight: 700; }

/* Theme conversation */
.dna-conv-wrap { display: none !important; }
.dna-conv-wrap.visible { display: block !important; }
.dna-back-btn { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r2); color: var(--muted); font-family: var(--font); font-size: 13px; padding: 8px 14px; cursor: pointer; margin-bottom: 16px; transition: all .15s; }
.dna-back-btn:hover { color: var(--text); border-color: var(--muted); }
.dna-conv-header { background: rgba(34,197,94,.08); border: 1px solid rgba(34,197,94,.15); border-radius: var(--r); padding: 14px 18px; margin-bottom: 12px; font-size: 14px; color: var(--text); line-height: 1.5; }
.dna-conv-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; margin-bottom: 12px; }
.dna-conv-title-bar { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; color: var(--muted); }
.dna-conv-title-bar strong { font-weight: 700; }
.dna-conv-msgs { padding: 16px; min-height: 220px; max-height: 340px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.dna-msg { display: flex; gap: 10px; align-items: flex-start; }
.dna-msg.user { flex-direction: row-reverse; }
.dna-msg-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg,#7c3aed,#a855f7); display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.dna-msg.user .dna-msg-avatar { background: linear-gradient(135deg,#3b82f6,#60a5fa); }
.dna-msg-bubble { background: rgba(255,255,255,.05); border: 1px solid var(--border); border-radius: 14px; border-top-left-radius: 4px; padding: 11px 14px; font-size: 14px; line-height: 1.55; color: var(--text); max-width: 85%; }
.dna-msg.user .dna-msg-bubble { background: #2d2060; border-color: rgba(167,139,250,.3); border-radius: 14px; border-top-right-radius: 4px; }
.dna-conv-input-wrap { display: flex; gap: 10px; align-items: flex-end; margin-bottom: 8px; }
.dna-conv-input { flex: 1; background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--r); color: var(--text); font-family: var(--font); font-size: 14px; padding: 12px 16px; resize: none; outline: none; transition: border-color .15s; line-height: 1.5; }
.dna-conv-input:focus { border-color: #7c3aed; }
.dna-conv-input::placeholder { color: var(--muted); }
.dna-conv-send { background: #4f46e5; color: #fff; border: none; border-radius: var(--r); font-family: var(--font); font-size: 14px; font-weight: 600; padding: 12px 22px; cursor: pointer; transition: all .15s; white-space: nowrap; }
.dna-conv-send:hover { background: #6366f1; }
.dna-conv-hint { font-size: 12px; color: var(--muted); text-align: center; }

/* Hub Chat tab */
.dna-chat-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.dna-chat-title { padding: 14px 18px; border-bottom: 1px solid var(--border); font-size: 14px; font-weight: 600; color: #a78bfa; }
.dna-chat-msgs { padding: 16px; min-height: 280px; max-height: 400px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.dna-chat-input-row { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--border); }
.dna-chat-input-row input { flex: 1; background: var(--bg); border: 1.5px solid var(--border); border-radius: var(--r2); color: var(--text); font-family: var(--font); font-size: 14px; padding: 11px 16px; outline: none; transition: border-color .15s; }
.dna-chat-input-row input:focus { border-color: #7c3aed; }
.dna-chat-input-row input::placeholder { color: var(--muted); }
.dna-chat-input-row button { background: #4f46e5; color: #fff; border: none; border-radius: var(--r2); font-family: var(--font); font-size: 14px; font-weight: 600; padding: 11px 22px; cursor: pointer; }

/* Memory tab */
.dna-mem-add { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 18px; margin-bottom: 16px; }
.dna-mem-add-title { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 12px; }
.dna-mem-type { width: 100%; background: var(--bg); border: 1.5px solid var(--border); border-radius: var(--r2); color: var(--text); font-family: var(--font); font-size: 14px; padding: 10px 12px; outline: none; margin-bottom: 10px; cursor: pointer; }
.dna-mem-textarea { width: 100%; background: var(--bg); border: 1.5px solid var(--border); border-radius: var(--r2); color: var(--text); font-family: var(--font); font-size: 14px; padding: 12px; resize: vertical; min-height: 90px; outline: none; line-height: 1.5; margin-bottom: 12px; transition: border-color .15s; }
.dna-mem-textarea:focus { border-color: #7c3aed; }
.dna-mem-textarea::placeholder { color: var(--muted); }
.dna-mem-save-btn { width: 100%; background: #22c55e; color: #0a1a0a; border: none; border-radius: var(--r2); font-family: var(--font); font-size: 14px; font-weight: 700; padding: 14px; cursor: pointer; transition: all .15s; }
.dna-mem-save-btn:hover { background: #16a34a; }
.dna-mem-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 14px 16px; margin-bottom: 8px; position: relative; }
.dna-mem-item-type { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: rgba(124,58,237,.12); color: #a78bfa; margin-bottom: 8px; }
.dna-mem-item-text { font-size: 14px; color: var(--text); line-height: 1.5; }
.dna-mem-item-date { font-size: 11px; color: var(--muted); margin-top: 6px; }
.dna-mem-del { position: absolute; top: 12px; right: 12px; background: none; border: none; color: var(--muted); cursor: pointer; font-size: 14px; padding: 4px; border-radius: 4px; }
.dna-mem-del:hover { color: #f87171; }

/* Insights tab */
.dna-insights-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; font-size: 13px; color: var(--muted); }
.dna-insight-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; margin-bottom: 10px; }
.dna-insight-type { font-size: 11px; font-weight: 700; color: #fbbf24; text-transform: uppercase; letter-spacing: .6px; margin-bottom: 6px; }
.dna-insight-text { font-size: 14px; color: var(--text); line-height: 1.6; }
.dna-insight-action { display: inline-block; margin-top: 10px; font-size: 12px; color: #a78bfa; cursor: pointer; }
.dna-insight-action:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════════════
   ARTICLES MODULE — embedded inside Hub Control
   ═══════════════════════════════════════════════════════ */
#articles-module-root { width:100%; }
.am-wrap { width:100%; }
.am-topbar { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:18px; border-bottom:1px solid var(--border); padding-bottom:14px; }
.am-tb-btn { background:transparent; border:1px solid var(--border); color:var(--sub); padding:6px 14px; border-radius:var(--r2); font-size:13px; cursor:pointer; transition:.15s; white-space:nowrap; }
.am-tb-btn:hover { background:var(--bg2); color:var(--text); }
.am-tb-btn.am-active { background:var(--acc); border-color:var(--acc); color:#fff; }

.am-content { min-height:300px; }
.am-loading { display:flex; align-items:center; gap:10px; padding:40px 0; justify-content:center; color:var(--sub); font-size:14px; }
.am-empty { text-align:center; padding:40px 20px; color:var(--sub); font-size:14px; }
.am-alert { padding:12px 16px; border-radius:var(--r2); font-size:13px; margin-bottom:12px; }
.am-alert-err { background:rgba(239,68,68,.12); color:#ef4444; border:1px solid rgba(239,68,68,.2); }

.am-card { background:var(--bg2); border:1px solid var(--border); border-radius:var(--r3,12px); padding:18px; margin-bottom:14px; }
.am-sect-title { font-size:13px; font-weight:600; color:var(--sub); text-transform:uppercase; letter-spacing:.6px; margin-bottom:14px; }
.am-field { margin-bottom:12px; }
.am-label { display:block; font-size:12px; font-weight:600; color:var(--sub); margin-bottom:5px; letter-spacing:.3px; }
.am-input { width:100%; background:var(--bg); border:1px solid var(--border); border-radius:var(--r2); color:var(--text); font-size:13px; padding:9px 12px; outline:none; transition:.15s; box-sizing:border-box; height:40px; line-height:1.4; vertical-align:middle; }
.am-input:focus { border-color:var(--acc); }
.am-textarea { width:100%; background:var(--bg); border:1px solid var(--border); border-radius:var(--r2); color:var(--text); font-size:13px; padding:9px 12px; outline:none; resize:vertical; transition:.15s; box-sizing:border-box; font-family:var(--font); }
.am-textarea:focus { border-color:var(--acc); }
.am-textarea-code { font-family:monospace; font-size:12px; line-height:1.6; }
.am-select { width:100%; background:var(--bg); border:1px solid var(--border); border-radius:var(--r2); color:var(--text); font-size:13px; padding:9px 12px; outline:none; cursor:pointer; height:40px; line-height:1.4; box-sizing:border-box; vertical-align:middle; }

/* Buttons */
.am-btn { display:inline-flex; align-items:center; gap:6px; padding:7px 14px; border-radius:var(--r2); font-size:13px; font-weight:500; cursor:pointer; border:none; transition:.15s; white-space:nowrap; }
.am-btn:disabled { opacity:.5; cursor:not-allowed; }
.am-btn-primary { background:var(--acc); color:#fff; }
.am-btn-primary:hover:not(:disabled) { opacity:.85; }
.am-btn-secondary { background:var(--bg2); border:1px solid var(--border); color:var(--text); }
.am-btn-secondary:hover:not(:disabled) { background:var(--bg); }
.am-btn-success { background:#10b981; color:#fff; }
.am-btn-success:hover:not(:disabled) { opacity:.85; }
.am-btn-danger { background:#ef4444; color:#fff; }
.am-btn-danger:hover:not(:disabled) { opacity:.85; }
.am-btn-ghost { background:transparent; color:var(--sub); border:1px solid transparent; }
.am-btn-ghost:hover:not(:disabled) { color:var(--text); border-color:var(--border); }
.am-btn-full { width:100%; justify-content:center; padding:11px; }

/* Stats */
.am-stats-row { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin-bottom:14px; }
.am-stat { background:var(--bg2); border:1px solid var(--border); border-radius:var(--r3,12px); padding:14px; text-align:center; }
.am-stat-val { font-size:26px; font-weight:700; color:var(--text); line-height:1; }
.am-stat-lbl { font-size:11px; color:var(--sub); margin-top:4px; }
@media(max-width:600px){ .am-stats-row { grid-template-columns:repeat(2,1fr); } }

/* Recent rows */
.am-recent-row { display:flex; justify-content:space-between; align-items:center; padding:10px 0; border-bottom:1px solid var(--border); gap:10px; flex-wrap:wrap; }
.am-recent-row:last-child { border-bottom:none; }
.am-recent-title { font-size:13px; font-weight:500; color:var(--text); }
.am-recent-meta { font-size:11px; color:var(--sub); margin-top:2px; }

/* Tabs */
.am-tabs { display:flex; gap:4px; flex-wrap:wrap; }
.am-tab { background:transparent; border:1px solid var(--border); color:var(--sub); padding:5px 12px; border-radius:20px; font-size:12px; cursor:pointer; transition:.15s; }
.am-tab.am-active, .am-tab:hover { background:var(--acc); border-color:var(--acc); color:#fff; }

/* Article cards */
.am-art-card { background:var(--bg2); border:1px solid var(--border); border-radius:var(--r2); padding:14px; margin-bottom:10px; transition:.15s; }
.am-art-card:hover { border-color:var(--acc); }
.am-art-title { font-size:14px; font-weight:600; color:var(--text); }
.am-art-meta { font-size:11px; color:var(--sub); margin-top:3px; }
.am-art-acts { display:flex; gap:6px; flex-wrap:wrap; margin-top:10px; }

/* Article body preview */
.am-article-body { background:var(--bg); border:1px solid var(--border); border-radius:var(--r2); padding:14px; font-size:13px; line-height:1.7; color:var(--text); max-height:300px; overflow-y:auto; }
.am-article-body h2,.am-article-body h3 { color:var(--text); margin:12px 0 6px; }
.am-article-body p { margin:6px 0; }
.am-article-body ul { padding-left:18px; }

/* Spinner */
.am-spin { display:inline-block; width:14px; height:14px; border:2px solid rgba(255,255,255,.3); border-top-color:currentColor; border-radius:50%; animation:am-spin-anim .6s linear infinite; vertical-align:middle; }
@keyframes am-spin-anim { to { transform:rotate(360deg); } }

/* Toast (if not already defined) */
#wpai-toasts { position:fixed; bottom:24px; right:24px; z-index:99999; display:flex; flex-direction:column; gap:8px; }
.wpai-toast { background:#1e2030; border:1px solid var(--border,#2a2d3e); color:var(--text,#e2e8f0); padding:11px 18px; border-radius:10px; font-size:13px; box-shadow:0 4px 20px rgba(0,0,0,.3); animation:am-slide-in .2s ease; }
.wpai-toast-error { border-color:#ef4444; color:#ef4444; }
.wpai-toast-info { color:var(--sub,#888); }
@keyframes am-slide-in { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }
