:root{
  /* ============================
     NUDGE BRAND COLOR SYSTEM
     ============================ */
  --bg:#0f1115;          /* charcoal background */
  --panel:#161a22;       /* dark card */
  --panel2:#1c2230;      /* darker card */
  --line:rgba(255,255,255,.08);

  --text:rgba(229,231,235,.96);
  --muted:rgba(156,163,175,.78);

  --brand:#22c55e;       /* soft green */
  --brand2:#16a34a;      /* deeper green */

  --good:#22c55e;
  --warn:#fbbf24;
  --bad:#fb7185;

  --shadow:0 18px 60px rgba(0,0,0,.55);
  --radius:18px;
}

/* ============================
   GLOBAL
   ============================ */
*{box-sizing:border-box}
html,body{height:100%}

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  color:var(--text);
  background:
    radial-gradient(900px 500px at 20% -10%, rgba(34,197,94,.14), transparent 60%),
    radial-gradient(800px 500px at 80% 0%, rgba(22,163,74,.10), transparent 55%),
    linear-gradient(180deg, #070a0d, var(--bg));
}

a{color:inherit}
.wrap{max-width:1100px;margin:0 auto;padding:22px 16px 60px}

/* ============================
   NAVIGATION
   ============================ */
.nav{
  display:flex;align-items:center;justify-content:space-between;gap:14px;
  padding:14px 14px;
  border:1px solid var(--line);
  border-radius:16px;
  background:rgba(15,17,21,.72);
  backdrop-filter:blur(10px);
  box-shadow:0 8px 30px rgba(0,0,0,.35);
}

.brand{display:flex;align-items:center;gap:12px}

.logo{
  width:42px;height:42px;border-radius:14px;
  display:grid;place-items:center;
  background:linear-gradient(135deg,var(--brand),var(--brand2));
  color:#03120a;
  font-weight:900;
  box-shadow:0 14px 40px rgba(34,197,94,.35);
}

.navlinks{
  display:flex;gap:10px;flex-wrap:wrap;align-items:center;
}

/* ============================
   GRID & CARDS
   ============================ */
.grid{
  display:grid;
  grid-template-columns:1.35fr .95fr;
  gap:16px;
  margin-top:16px;
}
@media(max-width:920px){.grid{grid-template-columns:1fr}}

.card{
  border:1px solid var(--line);
  background:linear-gradient(180deg, rgba(22,26,34,.78), rgba(18,22,30,.78));
  border-radius:var(--radius);
  padding:18px;
  box-shadow:var(--shadow);
}

.card h2,.card h3{margin:0 0 10px}
.card h2{font-size:26px}
.card h3{font-size:16px;color:rgba(229,231,235,.90)}

.muted{color:var(--muted)}
.hr{height:1px;background:var(--line);margin:14px 0}

/* ============================
   FORM FIELDS
   ============================ */
.field{margin:10px 0}

input,textarea{
  width:100%;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(6,10,20,.55);
  color:var(--text);
  padding:12px 12px;
  outline:none;
}
textarea{min-height:120px;resize:vertical}

input:focus,textarea:focus{
  border-color:rgba(34,197,94,.55);
  box-shadow:0 0 0 4px rgba(34,197,94,.18);
}

/* ============================
   BUTTONS
   ============================ */
.btn{
  display:inline-flex;align-items:center;justify-content:center;
  padding:10px 14px;border-radius:14px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.06);
  color:var(--text);
  text-decoration:none;
  cursor:pointer;
  transition:transform .08s ease, background .15s ease, border-color .15s ease;
  user-select:none;
}

.btn:hover{
  background:rgba(255,255,255,.10);
  border-color:rgba(255,255,255,.18);
}

.btn:active{transform:translateY(1px)}

.btn.primary{
  background:linear-gradient(135deg,var(--brand),var(--brand2));
  border-color:transparent;
  color:#03120a;
  font-weight:900;
}

.btn.ghost{background:transparent}

/* ============================
   KPIs
   ============================ */
.kpis{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:10px;
}
@media(max-width:520px){.kpis{grid-template-columns:1fr}}

.kpi{
  border:1px solid rgba(255,255,255,.10);
  border-radius:16px;
  padding:12px;
  background:rgba(0,0,0,.12);
}

.kpi .num{font-size:22px;font-weight:900}
.kpi .lbl{font-size:12px;color:var(--muted);margin-top:2px}

/* ============================
   NOTICES
   ============================ */
.notice{
  border:1px solid rgba(255,255,255,.10);
  background:rgba(0,0,0,.18);
  border-radius:16px;
  padding:12px;
}
.notice.locked{
  border-color:rgba(251,113,133,.35);
  background:rgba(251,113,133,.10);
}

/* ============================
   LISTS & ROW ITEMS
   ============================ */
.list{display:flex;flex-direction:column;gap:10px}

.rowitem{
  display:flex;align-items:center;justify-content:space-between;gap:14px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(0,0,0,.16);
  border-radius:16px;
  padding:12px;
  text-decoration:none;
  transition:.2s;
}
.rowitem:hover{
  border-color:rgba(34,197,94,.35);
  background:rgba(34,197,94,.10);
}

.rowitem .title{font-weight:900}
.rowitem .sub{font-size:12px;color:var(--muted);margin-top:4px}

.badges{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}

.badge{
  font-size:12px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.05);
}
.badge.good{
  border-color:rgba(34,197,94,.35);
  background:rgba(34,197,94,.12);
}
.badge.warn{
  border-color:rgba(251,191,36,.35);
  background:rgba(251,191,36,.12);
}

/* Error shake + red flash */
.input-error{
  border-color: rgba(251,113,133,.95) !important;
  box-shadow: 0 0 0 4px rgba(251,113,133,.18) !important;
  animation: nudgeShake .28s ease-in-out;
}

@keyframes nudgeShake{
  0%{transform:translateX(0)}
  25%{transform:translateX(-6px)}
  50%{transform:translateX(6px)}
  75%{transform:translateX(-4px)}
  100%{transform:translateX(0)}
}

/* Button spinner */
.btn.primary{position:relative}
.btnSpin{
  display:none;
  width:14px;height:14px;
  border-radius:999px;
  border:2px solid rgba(3,18,10,.35);
  border-top-color: rgba(3,18,10,.95);
  margin-left:10px;
  animation: spin .8s linear infinite;
}

@keyframes spin{
  from{transform:rotate(0deg)}
  to{transform:rotate(360deg)}
}

.btn.is-loading{
  opacity:.9;
  cursor:not-allowed;
}
.btn.is-loading .btnSpin{display:inline-block}

/* ============================
   CHAT POLISH (screenshot-friendly)
   Paste at bottom of app.css
   ============================ */

/* Chat container */
.chat{
  display:flex;
  flex-direction:column;
  gap:14px;                 /* more spacing between messages */
  padding:2px 0;
}

/* Bubble base */
.bubble{
  max-width: 78%;
  padding:14px 14px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.18);
  box-shadow: 0 10px 28px rgba(0,0,0,.22);
  line-height:1.55;

  /* ✅ Make message text bolder and clearer */
  font-size:16px;
  font-weight:800;
  letter-spacing:.1px;

  /* ✅ Space inside bubble for screenshot clarity */
  word-wrap:break-word;
  overflow-wrap:anywhere;
}

/* Smaller meta under each message */
.bubble .meta{
  margin-top:8px;
  font-size:11px;
  font-weight:700;
  opacity:.78;
  color: var(--muted);
}

/* Creator bubble (right) */
.bubble.creator{
  align-self:flex-end;
  border-color: rgba(34,197,94,.30);
  background: linear-gradient(
    180deg,
    rgba(34,197,94,.12),
    rgba(0,0,0,.14)
  );
  position:relative;
}

/* Anonymous bubble (left) */
.bubble.anon{
  align-self:flex-start;
  border-color: rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  position:relative;
}

/* ✅ Add more separation between sides (helps screenshot ID) */
.bubble.creator{ margin-left:auto; }
.bubble.anon{ margin-right:auto; }

/* Optional: subtle tail dots to visually separate roles */
.bubble.creator::after,
.bubble.anon::after{
  content:"";
  position:absolute;
  bottom:10px;
  width:6px;height:6px;
  border-radius:99px;
  opacity:.55;
}

.bubble.creator::after{
  right:-10px;
  background: rgba(34,197,94,.75);
  box-shadow: 0 0 0 6px rgba(34,197,94,.10);
}

.bubble.anon::after{
  left:-10px;
  background: rgba(255,255,255,.55);
  box-shadow: 0 0 0 6px rgba(255,255,255,.08);
}

/* Mobile: bubbles take more width */
@media(max-width:520px){
  .bubble{ max-width: 92%; font-size:16px; }
  .chat{ gap:16px; }
}