:root {
  color-scheme: light;
  --ink: #1e2c32;
  --muted: #586970;
  --line: #dbe3e4;
  --accent: #096650;
  --soft: #e0f0e9;
  font:
    15px/1.5 Inter,
    "Microsoft YaHei",
    system-ui,
    sans-serif;
  color: var(--ink);
  background: #f6f8f7;
}
* {
  box-sizing: border-box;
}
body,
h1,
h2,
p {
  margin: 0;
}
[hidden] {
  display: none !important;
}
button,
input,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 13px;
}
button:hover {
  background: #edf3f1;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
:focus-visible {
  outline: 3px solid #42967c;
  outline-offset: 2px;
}
.primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  font-weight: 600;
}
.primary:hover {
  background: #075341;
}
input,
textarea {
  width: 100%;
  background: white;
  border: 1px solid #bccbc7;
  border-radius: 6px;
  padding: 10px 12px;
}
label {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
}
h1 {
  font-size: 2rem;
  letter-spacing: -0.04em;
}
h2 {
  font-size: 1.16rem;
}
small,
.empty,
time {
  color: var(--muted);
}
small {
  font-size: 0.8rem;
}
.mark {
  display: inline-grid;
  place-items: center;
  background: var(--accent);
  color: white;
  width: 2rem;
  height: 2rem;
  border-radius: 7px;
  font-weight: 750;
}
#loginScreen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login {
  width: min(100%, 350px);
  display: grid;
  gap: 18px;
}
.login .mark {
  width: 44px;
  height: 44px;
}
.login h1 {
  margin-bottom: 8px;
}
.login .primary {
  margin-top: 6px;
}
.error {
  min-height: 1.5em;
  color: #a02b23;
}
#desk {
  display: grid;
  grid-template-columns: 185px minmax(230px, 320px) minmax(0, 1fr);
  height: 100dvh;
  background: white;
}
aside {
  display: flex;
  flex-direction: column;
  background: #f1f5f2;
  border-right: 1px solid var(--line);
  padding: 22px 14px;
}
aside header {
  display: flex;
  gap: 10px;
  align-items: center;
}
nav {
  display: grid;
  gap: 5px;
  margin-top: 38px;
}
nav button,
footer button,
.row {
  background: transparent;
  border: 0;
  text-align: left;
}
nav button {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
nav button[aria-current="page"],
.row[aria-current="true"] {
  color: var(--accent);
  background: var(--soft);
}
nav b {
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}
aside footer {
  margin-top: auto;
  display: grid;
  gap: 5px;
  padding: 10px;
  overflow-wrap: anywhere;
}
footer button {
  padding: 4px 0;
  color: var(--muted);
  width: fit-content;
}
#sessions,
#conversation,
#management {
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
#sessions {
  border-right: 1px solid var(--line);
}
section > header {
  min-height: 76px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.search {
  padding: 14px;
}
.search input {
  background: #f4f7f5;
  border-color: transparent;
}
#rows,
#history,
#accounts {
  overflow: auto;
}
.row {
  display: grid;
  width: 100%;
  padding: 13px 17px;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
  gap: 3px;
}
.row strong,
.row small {
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
#history {
  flex: 1;
  padding: 22px;
  background: #fafbf9;
}
.message {
  display: grid;
  justify-items: start;
  margin-bottom: 15px;
  gap: 4px;
}
.out {
  justify-items: end;
}
.bubble {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 9px 13px;
  border-radius: 8px;
  background: white;
  border: 1px solid var(--line);
  max-width: min(86%, 640px);
}
.out .bubble {
  background: var(--soft);
  border-color: transparent;
}
.bubble img,
.bubble audio {
  max-width: min(100%, 320px);
  max-height: 250px;
}
.empty {
  padding: 20px;
  text-align: center;
  font-size: 0.9rem;
}
#compose,
#claimBar {
  border-top: 1px solid var(--line);
  padding: 14px 18px;
  display: flex;
  gap: 12px;
  align-items: end;
}
textarea {
  resize: vertical;
  min-height: 50px;
  max-height: 180px;
}
#compose button {
  flex-shrink: 0;
}
#management {
  grid-column: 2/-1;
  overflow: auto;
}
.accountForm {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
  padding: 22px;
}
.accountRow {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 22px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.accountRow strong {
  min-width: 100px;
}
.accountRow small {
  margin-right: auto;
}
dialog {
  width: min(360px, 94vw);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px;
}
dialog form {
  display: grid;
  gap: 18px;
}
dialog form > div {
  display: flex;
  justify-content: end;
  gap: 8px;
}
#notice {
  position: fixed;
  right: 18px;
  bottom: 18px;
  padding: 11px 18px;
  background: #25382f;
  color: white;
  border-radius: 7px;
  max-width: min(90vw, 520px);
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
@media (max-width: 760px) {
  #desk {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 0.8fr) minmax(0, 1.3fr);
  }
  aside {
    padding: 9px 12px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    border-bottom: 1px solid var(--line);
  }
  aside header .mark {
    width: 24px;
    height: 24px;
  }
  nav {
    grid-column: 1/-1;
    grid-row: 2;
    display: flex;
    gap: 3px;
    margin: 0;
    overflow: auto;
  }
  nav button {
    gap: 4px;
    white-space: nowrap;
    padding: 5px 8px;
  }
  aside footer {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 0;
    font-size: 0.8rem;
  }
  section > header {
    min-height: 44px;
    padding: 8px 14px;
  }
  .search {
    padding: 6px 12px;
  }
  .row {
    padding: 6px 12px;
  }
  #history {
    padding: 12px;
  }
  #management {
    grid-column: 1;
    grid-row: 2/4;
  }
  #sessions {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}
