/* ── CHAT ─────────────────────────────────────────────────────── */
#msgs {
  min-height:     180px;
  max-height:     340px;
  overflow-y:     auto;
  padding:        .875rem;
  display:        flex;
  flex-direction: column;
  gap:            10px;
  background:     var(--bg2);
  border:         1px solid var(--border);
  border-radius:  var(--radius-lg) var(--radius-lg) 0 0;
}

.msg { display: flex; gap: 8px; align-items: flex-start; }

.mav {
  width:           26px;
  height:          26px;
  border-radius:   50%;
  flex-shrink:     0;
  display:         flex;
  align-items:     center;
  justify-content: center;
  font-size:       9px;
  font-weight:     700;
}
.msg.ag .mav { background: var(--gold); color: var(--navy); }
.msg.us .mav { background: var(--info-bg); color: var(--info); }

.mbody {
  font-size:   12.5px;
  line-height: 1.65;
  padding:     7px 11px;
  border-radius: var(--radius);
  max-width:   92%;
}
.msg.ag .mbody { background: var(--bg); border: 1px solid var(--border); }
.msg.us .mbody { background: var(--info-bg); color: var(--info); margin-left: auto; }
.msg.us        { flex-direction: row-reverse; }

.mbody pre {
  font-family: var(--mono);
  font-size:   10px;
  background:  var(--bg2);
  padding:     7px;
  border-radius: 5px;
  margin-top:  6px;
  overflow-x:  auto;
  white-space: pre-wrap;
  border:      1px solid var(--border);
}

#ld   { display: none; padding: 6px .875rem; gap: 5px; align-items: center; }
#ld.v { display: flex; }

.d {
  width:         4px; height: 4px;
  border-radius: 50%;
  background:    var(--text2);
  animation:     pp 1.2s infinite;
}
.d:nth-child(2) { animation-delay: .2s; }
.d:nth-child(3) { animation-delay: .4s; }
@keyframes pp { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }

#ir {
  display:       flex;
  gap:           6px;
  padding:       7px;
  border:        1px solid var(--border);
  border-top:    none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background:    var(--bg);
}

#ui {
  flex:          1;
  border:        1px solid var(--border);
  border-radius: var(--radius);
  padding:       6px 9px;
  font-size:     12px;
  font-family:   var(--font);
  resize:        none;
  background:    var(--bg2);
  color:         var(--text);
  min-height:    34px;
  max-height:    80px;
  outline:       none;
}
#ui:focus { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-dim); }

#sb {
  background:    var(--gold);
  border:        none;
  border-radius: var(--radius);
  padding:       0 11px;
  cursor:        pointer;
  display:       flex;
  align-items:   center;
}
#sb svg { width: 14px; height: 14px; fill: var(--navy); }

.qg {
  display:               grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap:                   6px;
  margin-bottom:         .875rem;
}

.qc {
  background:    var(--bg2);
  border:        1px solid var(--border);
  border-radius: var(--radius);
  padding:       8px 10px;
  cursor:        pointer;
  text-align:    left;
  transition:    all .15s;
}
.qc:hover { background: var(--bg); border-color: var(--gold); }
.qc .ql   { font-size: 9px;  color: var(--text2); margin-bottom: 2px; }
.qc .qt   { font-size: 11px; font-weight: 500; }

/* ── DROP ZONE ────────────────────────────────────────────────── */
#dz {
  border:        2px dashed var(--border2);
  border-radius: var(--radius);
  padding:       1rem;
  text-align:    center;
  cursor:        pointer;
  transition:    all .15s;
  position:      relative;
  margin-bottom: .5rem;
}
#dz:hover, #dz.drag { border-color: var(--gold); background: var(--gold-dim); }
#dz input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
#dz p { font-size: 11px; color: var(--text2); }

/* ── SVG STUDIO ───────────────────────────────────────────────── */
#svgws { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: .5rem; }

#scb {
  background:    var(--bg2);
  border:        1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow:      hidden;
}

#stb {
  display:       flex;
  gap:           3px;
  padding:       6px;
  border-bottom: 1px solid var(--border);
  flex-wrap:     wrap;
}

.st2 {
  padding:       3px 7px;
  border-radius: 5px;
  font-size:     10px;
  border:        1px solid var(--border);
  background:    var(--bg);
  cursor:        pointer;
  color:         var(--text);
  font-family:   var(--font);
}

#sc {
  width:       100%;
  min-height:  180px;
  border:      none;
  padding:     8px;
  font-family: var(--mono);
  font-size:   10px;
  resize:      vertical;
  background:  transparent;
  color:       var(--text);
  outline:     none;
  line-height: 1.5;
}

#sp2 {
  background:     #fff;
  border:         1px solid var(--border);
  border-radius:  var(--radius-lg);
  overflow:       hidden;
  display:        flex;
  flex-direction: column;
}
#sp2 p { font-size: 9px; color: #444; padding: 4px 8px; border-bottom: 1px solid #e5e5e5; }
#sr {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  min-height: 180px;
}

/* ── INVENTORY BARS ───────────────────────────────────────────── */
.inv-bar-wrap { flex: 1; background: var(--bg2); border-radius: 20px; height: 5px; overflow: hidden; margin-top: 4px; }
.inv-bar { height: 5px; border-radius: 20px; background: var(--green); transition: width .3s; }
.inv-bar.low  { background: var(--amber); }
.inv-bar.crit { background: var(--danger); }

/* ── TIMER ────────────────────────────────────────────────────── */
#timer-display {
  font-size:      48px;
  font-weight:    300;
  font-family:    var(--mono);
  text-align:     center;
  letter-spacing: 3px;
  padding:        1rem 0;
  color:          var(--gold);
}

.timer-controls { display: flex; justify-content: center; gap: 8px; margin-bottom: .875rem; }

/* ── EXPORT GRID ──────────────────────────────────────────────── */
.export-grid {
  display:               grid;
  grid-template-columns: 1fr 1fr;
  gap:                   8px;
  margin-bottom:         .875rem;
}

.exp-c {
  background:    var(--bg2);
  border:        1px solid var(--border);
  border-radius: var(--radius);
  padding:       .875rem;
  box-shadow:    var(--shadow-sm);
}
.exp-t { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.exp-d { font-size: 10px; color: var(--text2); margin-bottom: 8px; line-height: 1.5; }

/* ── ATOMM LINKS ──────────────────────────────────────────────── */
.atomm-link {
  display:         flex;
  align-items:     center;
  gap:             9px;
  padding:         8px 10px;
  background:      var(--bg);
  border:          1px solid var(--border);
  border-radius:   var(--radius);
  margin-bottom:   6px;
  cursor:          pointer;
  text-decoration: none;
  color:           inherit;
  transition:      all .15s;
  box-shadow:      var(--shadow-sm);
}
.atomm-link:hover { background: var(--bg2); border-color: var(--gold); }

.al-icon {
  width:           28px; height: 28px;
  border-radius:   var(--radius);
  background:      var(--gold);
  display:         flex;
  align-items:     center;
  justify-content: center;
  flex-shrink:     0;
  color:           var(--navy);
  font-size:       14px;
}
.al-title { font-size: 12px; font-weight: 600; }
.al-sub   { font-size: 10px; color: var(--text2); }

/* ── GRANT CARDS ──────────────────────────────────────────────── */
.grant-card {
  background:    var(--bg);
  border:        1px solid var(--border);
  border-radius: var(--radius);
  padding:       10px 13px;
  margin-bottom: 8px;
  box-shadow:    var(--shadow-sm);
}

/* ── HERO BANNER ──────────────────────────────────────────────── */
.hero-banner {
  border-radius:  var(--radius-lg);
  padding:        1rem 1.25rem;
  margin-bottom:  .875rem;
  display:        flex;
  align-items:    center;
  gap:            14px;
}
.hero-banner.dark  { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%); color: #d0c8b4; }
.hero-banner.green { background: linear-gradient(135deg, #3B6D11 0%, #27500A 100%); color: #EAF3DE; }
.hero-banner .hb-icon  { font-size: 28px; }
.hero-banner .hb-title { font-size: 14px; font-weight: 700; margin-bottom: 3px; color: var(--gold); }
.hero-banner .hb-sub   { font-size: 10.5px; opacity: .85; line-height: 1.6; }

/* ── SETTINGS LOG ─────────────────────────────────────────────── */
.sle {
  background:    var(--bg);
  border:        1px solid var(--border);
  border-radius: var(--radius);
  padding:       8px 11px;
  margin-bottom: 6px;
  display:       flex;
  align-items:   flex-start;
  gap:           9px;
}

/* ── MODAL ────────────────────────────────────────────────────── */
.modal-overlay {
  display:         none;
  position:        fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background:      rgba(0,0,0,.65);
  z-index:         9999;
  align-items:     center;
  justify-content: center;
  backdrop-filter: blur(2px);
}
.modal-overlay.open { display: flex; }

.modal-box {
  background:    var(--bg);
  border-radius: var(--radius-lg);
  padding:       1.5rem;
  max-width:     460px;
  width:         90%;
  box-shadow:    0 12px 48px rgba(0,0,0,.35);
  border:        1px solid var(--border2);
}
.modal-box h2 { font-size: 15px; font-weight: 700; margin-bottom: .5rem; color: var(--gold); }
.modal-box h3 { font-size: 14px; font-weight: 700; color: var(--text); }
.modal-box p  { font-size: 11.5px; color: var(--text2); margin-bottom: 1rem; line-height: 1.65; }

/* ── ONBOARDING WIZARD ────────────────────────────────────────── */
.ob-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border); transition: background .2s;
}
.ob-dot.active { background: var(--accent); }
.ob-machine-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 8px; border-radius: 6px;
  border: 1px solid var(--border); font-size: 11px;
  cursor: pointer; user-select: none;
  transition: border-color .15s, background .15s;
}
.ob-machine-chip.selected {
  border-color: var(--accent); background: rgba(var(--accent-rgb, 37,99,235),.08);
  color: var(--accent);
}

/* ── AI RESULT ────────────────────────────────────────────────── */
.ai-result { font-size: 12px; line-height: 1.75; white-space: pre-wrap; }

/* ── AI STRUCTURED RESULTS (Etsy listing / Social captions / Ideas) ── */
.ai-listing { display: grid; gap: 12px; }
.ai-listing-field label {
  display: block; font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--text2); margin-bottom: 4px;
}
.ai-listing-count { font-weight: 400; text-transform: none; letter-spacing: 0; }
.ai-listing-title {
  font-size: 13px; font-weight: 600; line-height: 1.5;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px 10px;
}
.ai-listing-desc {
  font-size: 12px; line-height: 1.7;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px 10px;
}
.ai-listing-bullets { margin: 0; padding-left: 18px; font-size: 12px; line-height: 1.7; }
.ai-listing-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-tag-chip {
  display: inline-block; font-size: 10.5px; font-weight: 600;
  background: rgba(var(--accent-rgb, 37,99,235),.08); color: var(--accent);
  border: 1px solid rgba(var(--accent-rgb, 37,99,235),.2);
  border-radius: 999px; padding: 3px 10px;
}
.ai-tag-chip-alt {
  background: var(--bg2); color: var(--text2);
  border-color: var(--border);
}

.ai-caption-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 12px; margin-bottom: 10px;
}
.ai-caption-num { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); margin-bottom: 4px; }
.ai-caption-hook { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.ai-caption-body { font-size: 12px; line-height: 1.7; margin-bottom: 6px; }
.ai-caption-cta { font-size: 12px; font-weight: 600; color: var(--text2); margin-bottom: 6px; }

.ai-idea-card {
  display: flex; gap: 10px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 12px; margin-bottom: 8px;
}
.ai-idea-num {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(var(--accent-rgb, 37,99,235),.12); color: var(--accent);
  font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.ai-idea-body { flex: 1; min-width: 0; }
.ai-idea-name { font-size: 12.5px; font-weight: 700; margin-bottom: 3px; }
.ai-idea-price { font-weight: 500; color: var(--text2); }
.ai-idea-desc { font-size: 12px; line-height: 1.6; margin-bottom: 4px; }
.ai-idea-meta { display: flex; gap: 14px; font-size: 11px; color: var(--text2); margin-bottom: 4px; flex-wrap: wrap; }
.ai-idea-why, .ai-idea-diff { font-size: 11.5px; line-height: 1.6; color: var(--text2); }

/* ── INVOICE LINE ─────────────────────────────────────────────── */
.inv-line {
  display:               grid;
  grid-template-columns: 1fr 55px 80px auto;
  gap:                   6px;
  margin-bottom:         6px;
  align-items:           center;
}
.inv-line input {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 4px 7px; font-size: 12px; font-family: var(--font);
  background: var(--bg2); color: var(--text); outline: none; width: 100%;
}

/* ── GRANT INNER NAV ──────────────────────────────────────────── */
.gtab-nav {
  display:        flex;
  gap:            2px;
  background:     var(--bg2);
  border-radius:  var(--radius);
  padding:        3px;
  margin-bottom:  .875rem;
}

/* ── LOG ITEM ─────────────────────────────────────────────────── */
.log-item {
  background:    var(--bg);
  border:        1px solid var(--border);
  border-radius: var(--radius);
  padding:       9px 11px;
  margin-bottom: 6px;
  display:       flex;
  align-items:   flex-start;
  gap:           10px;
  box-shadow:    var(--shadow-sm);
}
.log-item-info { flex: 1; }
.log-item-name { font-size: 12px; font-weight: 600; margin-bottom: 2px; }
.log-item-sub  { font-size: 10.5px; color: var(--text2); line-height: 1.5; }

/* ── CANDIDATE CARDS ──────────────────────────────────────────── */
.candidate-box { margin-top: 8px; display: grid; gap: 6px; }
.candidate-card {
  background:    var(--bg);
  border:        1px solid var(--border);
  border-radius: var(--radius);
  padding:       9px 11px;
  box-shadow:    var(--shadow-sm);
}

/* ── UTILITY ──────────────────────────────────────────────────── */
.text-muted   { color: var(--text2); }
.text-small   { font-size: 10px; }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warn    { color: var(--warn); }
.text-info    { color: var(--info); }
.fw-500       { font-weight: 500; }
.fw-600       { font-weight: 600; }
.mt-half      { margin-top: .5rem; }
.mt-1         { margin-top: 1rem; }
.mb-half      { margin-bottom: .5rem; }
.gap-sm       { gap: 5px; }

/* ── MOBILE MENU BUTTON (hidden on desktop) ──────────────────── */
#mob-menu-btn {
  display:      none;
  background:   none;
  border:       none;
  color:        var(--text);
  font-size:    20px;
  cursor:       pointer;
  padding:      0 6px;
  line-height:  1;
  flex-shrink:  0;
}

/* ── MOBILE BACKDROP ─────────────────────────────────────────── */
#mob-backdrop {
  display:    none;
  position:   fixed;
  inset:      0;
  z-index:    90;
  background: rgba(0,0,0,.55);
}
#mob-backdrop.open { display: block; }

