/* Neura. Sistemi Umani tokens (src/app/globals.css); light only, like the app. */
:root {
  --wall: #eef0eb;
  --surface: #ffffff;
  --ink: #1c2420;
  --muted: #62695f;
  --faint: #8a938d;
  --primary: #1f5142;
  --deep: #14352b;
  --tint: #e6eee9;
  --danger: #b3261e;
  --on-dark: #ffffff;
  --on-dark-soft: rgba(255, 255, 255, .74);
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Gelasio", Georgia, "Times New Roman", serif;
  --display: "Cinzel", "Trajan Pro", Georgia, serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; background: var(--deep); color: var(--ink); }
body { font-family: var(--sans); font-size: 15px; line-height: 1.45; -webkit-text-size-adjust: 100%; }
button { font: inherit; color: inherit; }
button:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
#app { height: 100%; }

/* ---------- sign in ---------- */
.gate { position: relative; min-height: 100%; overflow: hidden; display: flex; align-items: flex-end; background: var(--deep); color: var(--on-dark); }
.nodes { position: absolute; inset: 0; width: 100%; height: 100%; }
.gate-inner { position: relative; width: 100%; max-width: 440px; margin-inline: auto; display: flex; flex-direction: column; gap: 44px;
  padding: calc(32px + env(safe-area-inset-top, 0px)) 24px calc(44px + env(safe-area-inset-bottom, 0px)); }
.brand { display: flex; flex-direction: column; gap: 8px; }
.mark { font-family: var(--display); font-weight: 600; letter-spacing: .14em; font-size: 26px; }
.tag { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--on-dark-soft); }
.gate-card { display: flex; flex-direction: column; gap: 14px; }
.gate-card h1 { font-family: var(--serif); font-weight: 600; font-size: 32px; line-height: 1.1; margin: 0; }
.gate-card p { margin: 0; color: var(--on-dark-soft); }
.btn-light { height: 50px; border: 0; border-radius: 999px; background: var(--on-dark); color: var(--deep); font-weight: 600; font-size: 16px; cursor: pointer; }
.btn-light:disabled { opacity: .6; }
.btn-light:focus-visible { outline-color: var(--on-dark); }

/* ---------- chat ---------- */
.chat { height: 100%; display: flex; flex-direction: column; background: var(--wall); }
.bar { position: relative; display: flex; align-items: center; gap: 12px; background: var(--deep); color: var(--on-dark);
  padding: calc(10px + env(safe-area-inset-top, 0px)) 8px 10px 14px; }
.disc { width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--primary); color: var(--on-dark); font-weight: 600; }
.who { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.who strong { font-size: 16px; font-weight: 600; }
.who span { font-size: 12.5px; color: var(--on-dark-soft); }
.icon-btn { width: 42px; height: 42px; border: 0; border-radius: 50%; background: transparent; color: var(--on-dark); display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: rgba(255, 255, 255, .1); }
.menu { position: absolute; right: 10px; top: calc(100% - 6px); z-index: 5; min-width: 180px; padding: 6px; border-radius: 12px; background: var(--surface); color: var(--ink); box-shadow: 0 10px 30px rgba(0, 0, 0, .2); }
.menu button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 10px 12px; border-radius: 8px; cursor: pointer; }
.menu button:hover { background: var(--wall); }

.notice { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; background: var(--tint); color: var(--primary); font-size: 14px; font-weight: 500; }
.notice button { flex: none; border: 0; border-radius: 999px; background: var(--primary); color: var(--on-dark); font-weight: 600; padding: 8px 14px; cursor: pointer; }

.log { flex: 1; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 6px; padding: 14px 10px 10px; }
.intro { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--muted); text-align: center; }
.intro .disc { width: 64px; height: 64px; font-size: 24px; }
.intro strong { color: var(--ink); font-size: 17px; }
.day { align-self: center; margin: 10px 0 4px; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .75); color: var(--muted); font-size: 12px; font-weight: 500; }
.msg { display: flex; }
.msg.me { justify-content: flex-end; }
.bubble { max-width: min(84%, 560px); padding: 8px 12px 6px; border-radius: 18px; font-size: 15px; line-height: 1.42; overflow-wrap: anywhere; box-shadow: 0 1px 1px rgba(28, 36, 32, .06); }
.me .bubble { background: var(--primary); color: var(--on-dark); border-bottom-right-radius: 6px; }
.them .bubble { background: var(--surface); border-bottom-left-radius: 6px; }
.bubble p { margin: 0 0 6px; }
.bubble p:last-of-type { margin-bottom: 0; }
.bubble ul { margin: 2px 0 6px; padding-left: 20px; }
.bubble code { font-size: 13px; padding: 1px 4px; border-radius: 4px; background: rgba(28, 36, 32, .07); }
.me .bubble a { color: var(--on-dark); }
.them .bubble a { color: var(--primary); }
.time { display: block; text-align: right; margin-top: 2px; font-size: 11px; opacity: .66; font-variant-numeric: tabular-nums; }
.system { align-self: center; max-width: 92%; padding: 6px 12px; border-radius: 12px; background: var(--surface); color: var(--muted); font-size: 13px; text-align: center; }
.pending .bubble { opacity: .7; }
.failed .bubble { background: var(--danger); }
.typing .bubble { display: flex; gap: 5px; padding: 13px 14px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
@media (prefers-reduced-motion: no-preference) {
  .typing i { animation: blink 1.2s infinite ease-in-out; }
  .typing i:nth-child(2) { animation-delay: .2s; }
  .typing i:nth-child(3) { animation-delay: .4s; }
  @keyframes blink { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
}

.composer { display: flex; align-items: flex-end; gap: 8px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)); background: var(--wall); }
.composer textarea { flex: 1; resize: none; border: 0; border-radius: 22px; padding: 11px 16px; max-height: 140px; background: var(--surface); color: var(--ink);
  font: inherit; font-size: 16px; line-height: 1.35; box-shadow: 0 1px 1px rgba(28, 36, 32, .06); }
.composer textarea:focus-visible { outline: 2px solid var(--primary); outline-offset: 0; }
.send { width: 46px; height: 46px; flex: none; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: var(--on-dark); cursor: pointer; }
.send:disabled { opacity: .45; cursor: default; }
