:root {
  color-scheme: dark;
  background: #141313;
  color: #e9e2da;
  font: 15px/1.5 system-ui, sans-serif;
  --panel: #1e1b19;
  --raised: #27221e;
  --border: #3c332c;
  --muted: #bcb0a3;
  --accent: #f1b873;
}
* { box-sizing: border-box; }
body { margin: 0; }
header, .inbox-header, #controls { display: flex; align-items: center; gap: .9rem; }
header {
  justify-content: space-between; padding: .9rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid var(--border); background: var(--panel);
}
a { color: var(--accent); }
.brand { color: var(--accent); text-decoration: none; font-weight: 750; font-size: 1.25rem; }
.brand span { margin-left: .65rem; color: var(--muted); font-size: .85rem; font-weight: 500; }
button, .primary {
  font: inherit; cursor: pointer; border: 1px solid var(--border); border-radius: 6px;
  background: var(--panel); color: inherit; padding: .5rem .8rem;
}
button:hover { background: var(--raised); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:disabled { opacity: .58; cursor: default; }
.primary { display: inline-block; background: var(--accent); color: #1f160c; font-weight: 700; text-decoration: none; }
main { max-width: 1400px; margin: 0 auto; padding: clamp(1rem, 3vw, 2rem); }
#workspace { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 1rem; align-items: start; }
[hidden] { display: none !important; }
aside, #conversation, #login { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 1rem; }
#login { max-width: 420px; margin: 10vh auto; padding: 2rem; }
.inbox-header { justify-content: space-between; margin-bottom: .8rem; }
h1, h2 { margin: 0; line-height: 1.3; overflow-wrap: anywhere; }
h1 { font-size: 1.25rem; }
h2 { font-size: 1.45rem; }
#login h1 { margin-bottom: 1.25rem; }
ul { margin: 0; padding: 0; list-style: none; }
#messages li + li { margin-top: .4rem; }
.message { width: 100%; text-align: start; padding: .65rem; display: grid; gap: .2rem; }
.message[aria-current="true"] { border-color: var(--accent); background: var(--raised); }
.message strong, .message span { overflow-wrap: anywhere; }
small, .muted { color: var(--muted); }
#notice { margin: .8rem 0 0; color: var(--muted); }
#notice:empty { display: none; }
#more { margin-top: .75rem; width: 100%; }
article { border-top: 1px solid var(--border); padding: .9rem 0; margin-top: .65rem; }
article p { white-space: pre-wrap; overflow-wrap: anywhere; margin: .65rem 0; }
article ul { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin-top: .6rem; }
article li { overflow-wrap: anywhere; }
form { border-top: 1px solid var(--border); padding-top: 1rem; margin-top: 1rem; }
label { display: block; font-weight: 600; }
textarea {
  width: 100%; min-height: 110px; margin: .45rem 0 .7rem; resize: vertical; padding: .65rem;
  background: #141313; color: inherit; border: 1px solid var(--border); border-radius: 6px; font: inherit;
}
@media (max-width: 680px) {
  #workspace { grid-template-columns: minmax(0, 1fr); }
  #messages { max-height: 340px; overflow: auto; }
}
