:root {
  font:16px/1.5 "Segoe UI","DM Sans",sans-serif;
  color:#142c35;
  background:#f8faf9;
  --ink:#142c35;
  --muted:#516871;
  --line:#d6e0de;
  --accent:#125b54;
  --dark:#102e35;
}

* {
  box-sizing:border-box;
}

body {
  margin:0;
}

button,input,textarea {
  font:inherit;
}

button {
  cursor:pointer;
  color:inherit;
}

button:disabled {
  cursor:default;
  opacity:.5;
}

button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible {
  outline:3px solid #e9914e;
  outline-offset:3px;
}

.brand {
  display:flex;
  align-items:center;
  gap:12px;
  letter-spacing:.11em;
  font-weight:800;
  font-size:1.16rem;
}

.brand i,.emblem i {
  display:block;
  width:27px;
  height:20px;
  transform:skewX(-19deg);
  background:repeating-linear-gradient(90deg,currentColor 0 5px,transparent 5px 9px);
  color:#e2a36f;
}

.shell {
  display:grid;
  grid-template-columns:16rem minmax(0,1fr);
  height:100vh;
  height:100dvh;
}

.shell aside {
  display:flex;
  flex-direction:column;
  min-height:0;
  padding:2rem 1.15rem 1.2rem;
  background:var(--dark);
  color:#edf4f2;
}

.shell aside .brand {
  margin:0 .55rem 2.8rem;
}

.new,.primary,.quiet,dialog button,.exit button {
  border:0;
  border-radius:.65rem;
  font-weight:600;
}

.new {
  background:#d9ebe4;
  color:#123d38;
  text-align:left;
  padding:.7rem 1rem;
}

.new b {
  margin-right:.45rem;
}

.new:hover {
  background:#f0f8f3;
}

.side-label,.overline,.hint {
  font-size:.82rem;
}

.side-label {
  margin:2rem .55rem .6rem;
  color:#adc2c0;
}

.shell nav {
  overflow-y:auto;
  min-height:0;
}

.shell nav button,.exit button {
  border:0;
  background:transparent;
  color:#dae6e4;
  text-align:left;
}

.shell nav button {
  width:100%;
  display:block;
  padding:.6rem .65rem;
  border-radius:.4rem;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  font-size:.94rem;
}

.shell nav button[aria-current=true] {
  background:#24454b;
  color:white;
  box-shadow:inset 3px 0 #e7a974;
}

.exit {
  margin-top:auto;
  padding-top:1rem;
}

.exit button {
  padding:.45rem .6rem;
}

.conversation {
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
  overflow:hidden;
  background:#fbfcfb;
}

.conversation header {
  border-bottom:1px solid var(--line);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
  padding:1.15rem clamp(1.2rem,4vw,4rem);
  background:white;
}

.overline,.hint,.login-card p,#empty p {
  color:var(--muted);
}

h1,h2,p {
  margin:0;
}

header h1 {
  font-size:1.35rem;
  line-height:1.2;
  margin:.2rem 0;
}

.quiet,dialog button {
  background:#edf2f0;
  padding:.52rem .9rem;
  font-size:.9rem;
}

.quiet:hover {
  background:#dfe9e5;
}

#feed {
  overflow-y:auto;
  overscroll-behavior:contain;
}

.wrap,#composer {
  width:min(100%,54rem);
  margin-inline:auto;
  padding-inline:clamp(1rem,3vw,2.4rem);
}

.wrap {
  padding-block:1.6rem;
}

#empty {
  margin:clamp(1rem,9vh,7rem) 0 2rem;
  max-width:41rem;
}

.emblem {
  display:grid;
  place-items:center;
  width:3.3rem;
  height:3.3rem;
  border:1px solid #bfd4ce;
  border-radius:1rem;
  background:#e6f0eb;
  margin-bottom:1.6rem;
}

.emblem i {
  color:var(--accent);
}

#empty h2,.login h1 {
  font-size:clamp(1.85rem,3.8vw,3rem);
  line-height:1.1;
  letter-spacing:-.045em;
  font-weight:650;
}

#empty p {
  max-width:32rem;
  margin-top:.85rem;
}

#suggestions {
  display:flex;
  gap:.55rem;
  flex-wrap:wrap;
  margin-top:1.5rem;
}

#suggestions button,.sources a {
  background:white;
  border:1px solid var(--line);
  border-radius:.5rem;
  padding:.45rem .7rem;
  font-size:.88rem;
  text-align:left;
}

#suggestions button:hover,.sources a:hover {
  border-color:var(--accent);
  background:#eff7f3;
}

.msg {
  margin:.5rem 0 1.5rem;
  overflow-wrap:anywhere;
}

.msg small {
  display:block;
  font-weight:650;
  color:var(--muted);
  margin-bottom:.35rem;
}

.msg p {
  white-space:pre-wrap;
}

.user {
  margin-left:auto;
  max-width:85%;
  width:fit-content;
  background:#e5efeb;
  padding:.75rem 1rem;
  border-radius:1rem 1rem .25rem 1rem;
}

.user small {
  color:#375d53;
}

.sources {
  display:flex;
  flex-wrap:wrap;
  gap:.4rem;
  margin-top:.7rem;
}

.sources a {
  color:var(--accent);
  text-decoration:underline;
  text-underline-offset:.2em;
}

.pending,.error {
  font-size:.94rem;
}

.pending {
  color:var(--muted);
}

.error {
  color:#9e3f2a;
}

#composer {
  padding-block:.7rem 1rem;
}

.input-box {
  display:flex;
  align-items:flex-end;
  gap:.7rem;
  padding:.6rem;
  border:1px solid #b9ccc6;
  border-radius:.9rem;
  background:white;
  box-shadow:0 6px 24px #19332a09;
}

.input-box:focus-within {
  border-color:var(--accent);
}

textarea {
  width:100%;
  border:0!important;
  resize:none;
  padding:.55rem .35rem;
  line-height:1.5;
  background:transparent;
  color:var(--ink);
  max-height:8.5rem;
}

textarea:focus-visible {
  outline:none;
}

.hint {
  text-align:right;
  margin-top:.45rem;
}

.primary {
  background:var(--accent)!important;
  color:white!important;
  padding:.65rem 1rem;
}

.primary:hover {
  background:#104a45!important;
}

.login {
  min-height:100vh;
  min-height:100dvh;
  display:grid;
  place-items:center;
  background:linear-gradient(125deg,#102e35,#193e40);
  padding:1rem;
}

.login-card {
  width:min(100%,26rem);
  background:#fbfcfb;
  border-radius:1.25rem;
  padding:clamp(1.5rem,5vw,2.6rem);
  box-shadow:0 20px 70px #0002;
}

.login-card .brand {
  margin-bottom:3.4rem;
}

.login-card p {
  margin:.75rem 0 1.5rem;
}

.login-card label {
  display:block;
  font-size:.9rem;
  font-weight:600;
  margin-bottom:.3rem;
}

.login-card input[type=password] {
  width:100%;
  border:1px solid #aebfb9;
  border-radius:.5rem;
  padding:.65rem;
}

.login-card .primary {
  width:100%;
  margin-top:1rem;
}

.login-card .error {
  color:#9e3f2a;
  margin:.6rem 0 0;
}

dialog {
  color:var(--ink);
  border:1px solid var(--line);
  border-radius:1rem;
  padding:1.75rem;
  max-width:calc(100% - 2rem);
}

dialog::backdrop {
  background:#0b252d70;
}

dialog form {
  display:flex;
  justify-content:flex-end;
  gap:.55rem;
  margin-top:1.5rem;
}

@media(max-width:760px) {
  .shell {
    grid-template-columns:1fr;
    grid-template-rows:auto minmax(0,1fr);
  }
  .shell aside {
    display:grid;
    grid-template-columns:auto 1fr auto;
    align-items:center;
    gap:.55rem;
    padding:.65rem .9rem;
  }
  .shell aside .brand {
    margin:0;
    font-size:.96rem;
    gap:.5rem;
  }
  .brand i {
    width:21px;
    height:16px;
  }
  .new {
    justify-self:end;
    padding:.4rem .65rem;
    font-size:.85rem;
  }
  .side-label,.hint {
    display:none;
  }
  .exit {
    margin:0;
    padding:0;
    grid-column:3;
    grid-row:1;
  }
  .exit button {
    font-size:.85rem;
  }
  .shell nav {
    grid-column:1/-1;
    display:flex;
    overflow-x:auto;
  }
  .shell nav button {
    width:auto;
    max-width:15rem;
    flex:none;
    padding:.3rem .6rem;
    font-size:.8rem;
  }
  .conversation header {
    padding:.65rem 1rem;
  }
  #empty {
    margin:1rem 0;
  }
  .emblem {
    margin-bottom:1rem;
  }
  .input-box {
    gap:.15rem;
  }
  #send {
    font-size:.9rem;
  }
  .wrap {
    padding-block:1rem;
  }
  #composer {
    padding-bottom:max(.7rem,env(safe-area-inset-bottom));
  }
}

