:root {
  --bg: #F3F5F9;
  --sf: #ffffff;
  --ink: #0F2236;
  --mut: #5A6B80;
  --ln: #E1E7EF;
  --pri: #12304F;
  --onp: #ffffff;
  --hi: #2A6FDB;
  --bad: #C5352B;
  --badb: #FDECEA;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 500 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--ln);
  border-radius: 10px;
  background: var(--sf);
}
label { display: block; margin-bottom: 12px; font-size: 13px; color: var(--mut); }
label input { margin-top: 5px; }

.hidden { display: none !important; }
.sub { color: var(--mut); font-size: 13px; }
.hint { color: var(--mut); font-size: 13px; text-align: center; }
.error { color: var(--bad); background: var(--badb); border-radius: 8px; padding: 8px 10px; font-size: 14px; }

.view { min-height: 100%; display: flex; flex-direction: column; }

/* --------------------------------------------------------------- auth */
/* Cloned exactly from the Just A Way demo signup/login overlay */
.reg {
  position: fixed;
  inset: 0;
  z-index: 30;
  background:
    radial-gradient(900px 420px at 90% -10%, rgba(42, 111, 219, .5), transparent 60%),
    radial-gradient(600px 360px at -10% 100%, rgba(79, 148, 234, .2), transparent 60%),
    #0F2B48;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: auto;
}
.reg .rw { max-width: 400px; width: 100%; }
.reg .rw h1 { font-size: 30px; line-height: 1.1; font-weight: 800; letter-spacing: -.03em; }
.reg .rw p { margin: 10px 0 22px; opacity: .85; }
.reg .lgr { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 17px; letter-spacing: -.02em; margin-bottom: 28px; }
.reg .lg { display: inline-flex; width: 22px; height: 22px; border-radius: 6px; background: #fff; }
.reg label { display: block; font-weight: 700; font-size: 14px; margin: 12px 0 5px; }
.reg input {
  width: 100%;
  padding: 13px;
  border-radius: 10px;
  border: 0;
  background: rgba(255, 255, 255, .14);
  color: inherit;
}
.reg input::placeholder { color: inherit; opacity: .55; }
.reg .btn {
  width: 100%;
  margin-top: 20px;
  background: #fff;
  color: #12304F;
  padding: 14px;
  border: 2px solid #fff;
  border-radius: 10px;
  font-weight: 700;
  min-height: 48px;
}
.reg .btn.ghost { background: none; color: inherit; border: 2px solid rgba(255, 255, 255, .55); margin-top: 12px; }
.reg .lnk { display: block; margin: 16px auto 0; color: inherit; font-weight: 700; text-decoration: underline; background: none; border: 0; font-size: 15px; cursor: pointer; }
.reg .fe { display: none; background: #FDECEA; color: #C5352B; border-radius: 10px; padding: 10px 12px; margin-top: 14px; font-weight: 700; font-size: 15px; }
.reg .fe.on { display: block; }
.reg p.ag { font-size: 14px; margin: 12px 0 0; text-align: center; }
.reg .ag button { color: inherit; text-decoration: underline; font-weight: 700; padding: 0; font-size: inherit; background: none; border: 0; cursor: pointer; }
.reg .fl { display: flex; flex-wrap: wrap; gap: 4px 18px; justify-content: center; margin-top: 18px; }
.reg .fl button { color: inherit; text-decoration: underline; font-weight: 700; padding: 10px 4px; font-size: 15px; background: none; border: 0; cursor: pointer; }

/* --------------------------------------------------------------- app */
#app-view { height: 100dvh; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background: var(--pri);
  color: var(--onp);
}
.topbar .title strong { display: block; }
.topbar .sub { color: rgba(255, 255, 255, 0.7); }
.ghost { color: var(--hi); font-weight: 600; }
.topbar .ghost { color: #fff; opacity: 0.85; }

.tabs { display: flex; background: var(--sf); border-bottom: 1px solid var(--ln); }
.tab { flex: 1; padding: 12px; font-weight: 600; color: var(--mut); border-bottom: 3px solid transparent; }
.tab.on { color: var(--ink); border-bottom-color: var(--hi); }

.tab-body { flex: 1; overflow-y: auto; padding: 14px; }
.list { list-style: none; margin: 0; padding: 0; }
.conv {
  background: var(--sf);
  border: 1px solid var(--ln);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.empty { text-align: center; padding: 48px 20px; color: var(--mut); }

.card { background: var(--sf); border: 1px solid var(--ln); border-radius: 14px; padding: 18px; }
.card h2 { margin-top: 0; font-size: 18px; }
dl { margin: 0; }
dt { color: var(--mut); font-size: 13px; margin-top: 10px; }
dd { margin: 2px 0 0; }

/* ----------------------------------------------------------- conversation */
.detail { display: flex; flex-direction: column; height: 100%; }
#detail-title { margin: 10px 0; font-size: 18px; }
.msgs { list-style: none; margin: 0 0 12px; padding: 0; flex: 1; overflow-y: auto; }
.msg { margin-bottom: 10px; max-width: 82%; }
.msg p { margin: 2px 0 0; background: var(--sf); border: 1px solid var(--ln); border-radius: 12px; padding: 10px 12px; }
.msg.in { margin-right: auto; }
.msg.out { margin-left: auto; }
.msg.out p { background: var(--hi); color: #fff; border-color: var(--hi); }
.compose { display: flex; gap: 8px; }
.compose input { flex: 1; }
.compose button { width: auto; padding: 12px 18px; }
