:root {
  color-scheme: light;
  --ink: #27262a;
  --muted: #69656a;
  --line: #e2ded8;
  --bg: #f8f7f4;
  --paper: #fffefa;
  --nav: #28233a;
  --plum: #524065;
  --plum-dark: #3d2e4d;
  --tint: #eee9f2;
  --green: #286348;
  --amber: #866026;
  --radius: 15px;
  --shadow: 0 5px 20px #30283909;
  font:
    15px/1.55 'Inter',
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
button:disabled,
input:disabled,
textarea:disabled {
  cursor: default;
  opacity: 0.6;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid #9270b0;
  outline-offset: 3px;
}
button {
  border: 0;
  background: none;
}
a {
  color: var(--plum);
}
h1,
h2,
h3,
p,
dl,
dd {
  margin: 0;
}
h1,
.serif,
.wordmark {
  font-family: 'Iowan Old Style', 'Baskerville', 'Georgia', serif;
  font-weight: 500;
}
h1 {
  font-size: clamp(38px, 4vw, 62px);
  line-height: 1.02;
  letter-spacing: -0.055em;
}
h2 {
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.3;
}
h3 {
  font-size: 1rem;
  line-height: 1.35;
  letter-spacing: -0.02em;
}
small,
.muted,
.hint {
  color: var(--muted);
}
.hint {
  font-size: 0.87rem;
}
svg {
  display: inline-block;
  vertical-align: middle;
  flex: none;
}
.loading,
.auth {
  min-height: 100vh;
  display: grid;
  place-content: center;
  padding: 24px;
}
.auth {
  background:
    radial-gradient(ellipse at 50% 0, #eee6ef, transparent 67%), var(--bg);
}
.auth-card {
  width: min(420px, calc(100vw - 40px));
  padding: 34px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.auth-card .brand {
  margin-bottom: 32px;
  color: var(--plum-dark);
}
.auth-card h1 {
  font-size: 38px;
  margin: 0 0 12px;
}
.auth-card .hint {
  margin-bottom: 22px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
}
.wordmark {
  font-size: 31px;
  line-height: 1;
  letter-spacing: -1.6px;
}
.mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: #d8c8de;
  color: #382d45;
}
.shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
}
.sidebar {
  background: var(--nav);
  color: #e7e4ea;
  padding: 32px 15px 19px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100dvh;
  z-index: 1;
}
.sidebar .brand {
  padding: 0 12px;
}
.nav {
  display: grid;
  gap: 5px;
  margin-top: 46px;
}
.nav button,
.sidebar-foot button {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #cfccd5;
  padding: 12px 14px;
  border-radius: 9px;
  text-align: left;
  font-weight: 550;
  width: 100%;
  font-size: 0.94rem;
}
.nav button:hover,
.sidebar-foot button:hover {
  background: #ffffff0c;
  color: white;
}
.nav button[aria-current='page'] {
  background: #443b53;
  color: #fff;
}
.sidebar-foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid #ffffff23;
  display: flex;
  align-items: center;
  gap: 6px;
}
.avatar {
  background: #e5ddc9;
  color: #50432e;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  flex: none;
  font-size: 0.75rem;
  font-weight: 700;
}
.sidebar-foot strong {
  font-size: 0.85rem;
  line-height: 1.2;
}
.sidebar-foot small {
  display: block;
  color: #c2b9ce;
  font-size: 0.73rem;
}
.sidebar-foot button {
  width: auto;
  margin-left: auto;
  padding: 10px;
}
.primary-area {
  min-width: 0;
}
.topbar {
  height: 74px;
  border-bottom: 1px solid var(--line);
  padding: 0 clamp(20px, 4vw, 72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--muted);
}
.crumb {
  display: flex;
  align-items: center;
  gap: 10px;
}
.crumb b {
  color: var(--ink);
  font-weight: 600;
}
.content {
  max-width: 1570px;
  margin: 0 auto;
  padding: clamp(28px, 4vw, 64px) clamp(20px, 4vw, 72px) 50px;
}
.page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 30px;
}
.page-head p {
  margin-top: 13px;
  color: var(--muted);
  max-width: 56ch;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 14px;
  color: var(--ink);
  background: var(--paper);
  font-weight: 580;
  font-size: 0.9rem;
  line-height: 1.45;
}
.btn:hover {
  border-color: #bab0bd;
}
.btn.primary {
  background: var(--plum);
  border-color: var(--plum);
  color: #fff;
}
.btn.primary:hover {
  background: var(--plum-dark);
}
.btn.quiet {
  background: transparent;
  border-color: transparent;
  color: var(--plum);
  padding: 7px 0;
}
.btn.icon {
  padding: 8px;
}
.chat-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(210px, 0.82fr);
  gap: 19px;
  align-items: start;
}
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
  min-width: 0;
}
.card-head {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.chat-panel {
  display: flex;
  flex-direction: column;
  height: clamp(470px, calc(100dvh - 283px), 720px);
  min-width: 0;
}
.chat-log {
  flex: 1;
  overflow: auto;
  min-height: 0;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 17px;
  scrollbar-width: thin;
}
.chat-empty {
  margin: auto;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 18px;
}
.chat-empty h2 {
  font-family: Georgia, serif;
  font-size: clamp(22px, 2vw, 31px);
  font-weight: 400;
  letter-spacing: -0.04em;
}
.chat-empty p {
  max-width: 32ch;
  font-size: 0.9rem;
  color: var(--muted);
}
.emblem {
  width: 57px;
  height: 57px;
  border-radius: 18px;
  background: var(--tint);
  color: var(--plum);
  display: grid;
  place-items: center;
}
.msg {
  max-width: 92%;
  align-self: flex-start;
  min-width: 0;
}
.msg.user {
  align-self: flex-end;
}
.msg-label {
  font-size: 0.71rem;
  font-weight: 650;
  color: var(--muted);
  margin: 0 3px 4px;
}
.msg.user .msg-label {
  text-align: right;
}
.bubble {
  background: #f2efea;
  border-radius: 3px 13px 13px;
  padding: 11px 14px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  line-height: 1.55;
  font-size: 0.94rem;
}
.user .bubble {
  background: var(--tint);
  border-radius: 13px 3px 13px 13px;
}
.compose {
  border: 1px solid #d7d1d7;
  border-radius: 12px;
  margin: 0 16px 16px;
  padding: 9px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: white;
}
.compose textarea {
  flex: 1;
  width: 100%;
  background: transparent;
  padding: 5px 7px;
  border: 0;
  resize: vertical;
  max-height: 150px;
  min-height: 42px;
  line-height: 1.45;
}
.compose .btn {
  width: 40px;
  height: 40px;
  flex: none;
}
.rail {
  display: grid;
  gap: 16px;
}
.stats-card,
.rail-card {
  padding: 20px;
}
.statline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 13px;
  border-top: 1px solid var(--line);
  padding-top: 11px;
}
.statline span {
  font-size: 0.86rem;
  color: var(--muted);
}
.statline strong {
  font-family: Georgia, serif;
  font-size: 27px;
  font-weight: 400;
  line-height: 1;
}
.rail-card .hint {
  margin: 9px 0 3px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.74rem;
  font-weight: 600;
  background: #efede9;
  color: #555157;
  white-space: normal;
}
.badge.good {
  background: #e5efe7;
  color: var(--green);
}
.badge.attention {
  background: #f5eddc;
  color: var(--amber);
}
.badge.purple {
  background: var(--tint);
  color: var(--plum);
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.empty {
  padding: 44px 22px;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 9px;
}
.empty .emblem {
  width: 45px;
  height: 45px;
  border-radius: 14px;
}
.empty p {
  max-width: 46ch;
  color: var(--muted);
  font-size: 0.9rem;
}
.empty .btn {
  margin-top: 7px;
}
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.91rem;
}
th {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 13px 18px;
  border-bottom: 1px solid #eae7e1;
}
tr:last-child td {
  border-bottom: 0;
}
td small {
  display: block;
}
.row-name {
  font-weight: 600;
}
.row-actions {
  text-align: right;
}
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.search {
  max-width: 320px;
  width: 100%;
}
input,
select,
textarea {
  width: 100%;
  background: white;
  border: 1px solid #cec8ca;
  border-radius: 8px;
  padding: 9px 11px;
}
input[type='checkbox'] {
  width: 16px;
  height: 16px;
  accent-color: var(--plum);
  margin: 0;
}
.tasklist {
  display: grid;
  gap: 12px;
}
.taskitem {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 18px 20px;
  align-items: center;
}
.taskitem h2,
.taskitem p {
  overflow-wrap: anywhere;
}
.task-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.82rem;
}
.channel-card {
  max-width: 720px;
}
.channel-card dl {
  padding: 6px 20px;
}
dl > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
dl > div:last-child {
  border: 0;
}
dt {
  color: var(--muted);
  font-size: 0.9rem;
}
dd {
  font-weight: 550;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 16px;
  width: min(520px, calc(100% - 28px));
  max-height: 88dvh;
  overflow-y: auto;
  padding: 0;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 22px 90px #201b2e30;
}
dialog::backdrop {
  background: #25203067;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.form-fields {
  padding: 19px 21px;
  display: grid;
  gap: 13px;
}
.auth-card .form-fields {
  padding: 0;
}
label {
  display: grid;
  gap: 5px;
  font-size: 0.85rem;
  font-weight: 600;
}
label small,
.form-fields p {
  font-weight: 400;
}
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.checklist {
  display: grid;
  gap: 7px;
  max-height: 160px;
  overflow: auto;
  border: 1px solid var(--line);
  padding: 10px;
  border-radius: 8px;
  background: white;
}
.checklist label {
  display: flex;
  align-items: center;
  gap: 9px;
}
.actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}
.form-error {
  color: #a13232;
  font-size: 0.85rem;
  white-space: pre-line;
}
.form-error:empty {
  display: none;
}
.task-detail {
  display: grid;
  gap: 12px;
  padding: 18px 20px;
}
.task-detail > p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.person-progress {
  border-top: 1px solid var(--line);
  padding: 13px 0;
  display: grid;
  gap: 8px;
}
.person-progress:last-child {
  padding-bottom: 0;
}
.participants-title {
  margin-top: 12px;
}
#notice {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(510px, 95vw);
  z-index: 10;
  background: #292532;
  color: white;
  padding: 10px 15px;
  border-radius: 9px;
  box-shadow: var(--shadow);
  font-size: 0.9rem;
}
#notice:empty {
  display: none;
}
@media (max-width: 930px) {
  .shell {
    grid-template-columns: 175px minmax(0, 1fr);
  }
  .sidebar {
    padding-inline: 10px;
  }
  .content {
    padding-inline: 23px;
  }
  .topbar {
    padding-inline: 23px;
  }
  .chat-grid {
    grid-template-columns: minmax(0, 1.5fr) minmax(185px, 0.8fr);
  }
  .stats-card,
  .rail-card {
    padding: 15px;
  }
}
@media (max-width: 740px) {
  .shell {
    display: block;
  }
  .sidebar {
    position: static;
    height: auto;
    padding: 13px 17px 7px;
    border-radius: 0;
  }
  .sidebar .brand {
    padding: 0;
  }
  .wordmark {
    font-size: 27px;
  }
  .brand .mark {
    width: 30px;
    height: 30px;
  }
  .nav {
    display: flex;
    gap: 2px;
    margin-top: 14px;
    overflow: auto;
  }
  .nav button {
    justify-content: center;
    gap: 5px;
    font-size: 0.78rem;
    padding: 8px;
    flex: 1;
  }
  .nav button svg {
    width: 15px;
    height: 15px;
  }
  .sidebar-foot {
    position: absolute;
    right: 15px;
    top: 15px;
    margin: 0;
    border: 0;
    padding: 0;
  }
  .sidebar-foot .avatar,
  .sidebar-foot > div {
    display: none;
  }
  .sidebar-foot button {
    padding: 5px;
  }
  .topbar {
    height: 46px;
    padding-inline: 18px;
  }
  .topbar time {
    font-size: 0.72rem;
  }
  .content {
    padding: 24px 15px 32px;
  }
  .page-head {
    margin-bottom: 18px;
    align-items: center;
  }
  .page-head p {
    font-size: 0.91rem;
    margin-top: 9px;
  }
  .page-head .btn {
    padding: 8px 10px;
  }
  .chat-grid {
    display: flex;
    flex-direction: column;
  }
  .chat-panel {
    width: 100%;
    height: clamp(395px, 61dvh, 690px);
  }
  .rail {
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }
  .card-head {
    padding: 14px 16px;
  }
  .chat-log {
    padding: 14px;
  }
  .taskitem {
    padding: 14px;
  }
  .grid2 {
    grid-template-columns: 1fr;
  }
  .toolbar {
    padding: 12px;
  }
  .task-detail,
  .form-fields {
    padding: 15px;
  }
  .table-wrap th,
  .table-wrap td {
    padding: 10px 12px;
  }
}
@media (max-width: 420px) {
  .nav button {
    padding-inline: 5px;
  }
  .rail {
    grid-template-columns: 1fr;
  }
  .page-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .topbar time {
    display: none;
  }
  .taskitem {
    grid-template-columns: 1fr;
  }
  .taskitem > .btn {
    justify-self: start;
  }
}

.rail-title {
  display: flex;
  align-items: center;
  gap: 9px;
}

.usage-period {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .65rem;
  margin: -10px 0 20px;
  color: var(--muted);
}
.usage-period select { width: auto; max-width: 100%; }
.usage-model { padding: 20px 22px; }
.usage-model h2, .usage-metrics h2 { font-size: .86rem; color: var(--muted); }
.usage-model-name { font-size: 1.5rem; font-weight: 650; overflow-wrap: anywhere; color: var(--plum-dark); }
.usage-coverage { margin: 12px 0 22px; color: var(--muted); font-size: .85rem; }
.usage-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr));
  gap: 12px;
}
.usage-metrics .card { padding: 17px 19px; }
.usage-metrics strong { display: block; font-size: clamp(1.15rem, 2.15vw, 1.85rem); overflow-wrap: anywhere; }
.usage-metrics small { display: block; color: var(--muted); }
.usage-metrics strong, .usage-table td, .usage-rates dd { font-variant-numeric: tabular-nums; }
.usage-table, .usage-method { margin-top: 18px; }
.usage-table { overflow: hidden; }
.usage-table th, .usage-table td { white-space: nowrap; }
.usage-table tbody th { font-size: .9rem; text-align: left; color: var(--ink); }
.usage-table tbody tr:last-child th { border: 0; }
.usage-note, .usage-method p { font-size: .88rem; color: var(--muted); }
.usage-note { padding: 13px 20px; }
.coverage-partial { margin-top: 10px; border-left: 3px solid var(--amber); }
.usage-method { padding: 16px 20px; }
.usage-method summary { cursor: pointer; font-weight: 600; }
.usage-method h3, .usage-method p { margin-top: 14px; }
.usage-rates { max-width: 36rem; }
@media (max-width: 740px) {
  .usage-period { margin-top: 0; justify-content: flex-start; }
  .nav button { flex-shrink: 0; white-space: nowrap; }
}
.usage-shortcut { padding: 0; border-radius: 999px; }
.usage-shortcut:hover .badge { text-decoration: underline; }
