:root {
  --verde: #008c45;
  --rosso: #cd212a;
  --ink: #1d2330;
  --muted: #6b7280;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --bubble-amma: #eef2f7;
  --bubble-user: #008c45;
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.app {
  max-width: 760px;
  min-height: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  box-shadow: 0 0 40px rgba(0, 0, 0, .06);
}

/* ---- topbar / branding sovranista ---- */
.topbar {
  padding: 16px 20px 14px;
  border-bottom: 1px solid #e7eaef;
  position: sticky;
  top: 0;
  background: var(--panel);
  z-index: 5;
}
.brand { display: flex; align-items: center; gap: 12px; }
.flag {
  width: 30px; height: 30px; border-radius: 8px; flex: 0 0 auto;
  background: linear-gradient(90deg, var(--verde) 0 33.33%, #fff 33.33% 66.66%, var(--rosso) 66.66% 100%);
  border: 1px solid #e3e6ea;
}
.titles h1 {
  margin: 0; font-size: 20px; letter-spacing: .5px; font-weight: 800;
}
.titles .ver { font-size: 12px; color: var(--muted); font-weight: 700; vertical-align: super; }
.claim { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.beta {
  margin: 10px 0 0; font-size: 11px; color: var(--verde);
  text-transform: uppercase; letter-spacing: .6px; font-weight: 700;
}

/* ---- chat ---- */
.chat {
  flex: 1 1 auto;
  padding: 18px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.row { display: flex; }
.row.utente { justify-content: flex-end; }
.row.amma { justify-content: flex-start; }

.bubble {
  max-width: 78%;
  padding: 11px 14px;
  border-radius: var(--radius);
  line-height: 1.45;
  font-size: 15px;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.row.amma .bubble {
  background: var(--bubble-amma);
  border-bottom-left-radius: 5px;
}
.row.utente .bubble {
  background: var(--bubble-user);
  color: #fff;
  border-bottom-right-radius: 5px;
}
.row.amma.sospesa .bubble {
  background: #fff4f4;
  border: 1px dashed var(--rosso);
  color: #7a1118;
  font-style: italic;
}

/* ---- typing indicator ---- */
.typing {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 22px 10px; color: var(--muted); font-size: 13px;
}
.typing.hidden { display: none; }
.dots { display: inline-flex; gap: 4px; }
.dots i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--muted);
  display: inline-block; animation: blink 1.2s infinite both;
}
.dots i:nth-child(2) { animation-delay: .2s; }
.dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* ---- composer ---- */
.composer {
  display: flex; gap: 8px; padding: 12px 16px;
  border-top: 1px solid #e7eaef; background: var(--panel);
}
.input {
  flex: 1 1 auto; padding: 12px 14px; font-size: 15px;
  border: 1px solid #d7dce3; border-radius: 999px; outline: none;
}
.input:focus { border-color: var(--verde); box-shadow: 0 0 0 3px rgba(0, 140, 69, .12); }
.input:disabled { background: #f3f5f7; }
.send {
  flex: 0 0 auto; width: 46px; border: 0; border-radius: 50%;
  background: var(--verde); color: #fff; font-size: 16px; cursor: pointer;
}
.send:hover { filter: brightness(1.05); }
.send:disabled { opacity: .5; cursor: default; }

/* ---- disclaimer ---- */
.disclaimer {
  padding: 10px 16px 16px; font-size: 11px; color: var(--muted);
  text-align: center; border-top: 1px solid #f0f2f5; line-height: 1.5;
}
.disclaimer strong { color: var(--rosso); }
.disclaimer .priv { display: block; margin-top: 4px; opacity: .8; }

/* ---- banner parodia (disclaimer chiaro) ---- */
.warnbar {
  background: var(--rosso); color: #fff;
  padding: 9px 16px; font-size: 12.5px; line-height: 1.4; text-align: center;
}
.warnbar strong { color: #fff; }
