:root {
  --bg: #f6f7f3;
  --paper: #fff;
  --ink: #243c35;
  --muted: #78827b;
  --line: #e4e8e1;
  --green: #244b40;
  --soft: #eaf0e9;
  --gold: #af7b37;
  --red: #a64c43;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    15px/1.65 "Segoe UI",
    "Microsoft YaHei",
    sans-serif;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}
button,
.button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 9px;
  padding: 9px 15px;
  transition: background 0.15s;
}
button:hover,
.button:hover {
  background: var(--soft);
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #83a598;
  outline-offset: 3px;
}
a {
  color: var(--green);
  text-decoration: none;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 32px;
  line-height: 1.4;
  letter-spacing: -0.7px;
  margin-bottom: 10px;
  font-weight: 650;
}
h2 {
  font-size: 19px;
  margin-bottom: 16px;
}
h3 {
  font-size: 18px;
  margin: 0 0 8px;
}
small {
  font-size: 12px;
  color: var(--muted);
}
.muted {
  color: var(--muted);
  font-size: 14px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2.4px;
  color: var(--muted);
  margin-bottom: 14px;
}
.primary {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.primary:hover {
  background: #356553;
}
.button {
  display: inline-block;
}
.icon {
  border: none;
  background: transparent;
  font-size: 24px;
  padding: 0 8px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border-radius: 12px;
  background: var(--green);
  color: #fff;
  font-family: serif;
  font-size: 25px;
}
.sidebar {
  width: 244px;
  height: 100dvh;
  position: fixed;
  left: 0;
  top: 0;
  padding: 35px 22px 20px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  background: #f0f3ed;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 0 8px 45px;
  font-size: 24px;
  font-weight: 600;
}
.brand small,
.account small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 1px;
}
.sidebar nav {
  display: grid;
  gap: 8px;
}
.nav {
  display: flex;
  gap: 12px;
  align-items: center;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 12px 15px;
  color: #68756d;
}
.nav.active {
  background: #dfe8dd;
  color: var(--green);
  font-weight: 600;
}
.nav b {
  margin-left: auto;
  font-size: 11px;
  background: #fff;
  border-radius: 5px;
  padding: 0 6px;
}
.sidebar-note {
  margin: auto 15px 35px;
  font-size: 13px;
  line-height: 2;
  color: #829083;
  border-left: 2px solid #ccd8c9;
  padding-left: 15px;
}
.account {
  border-top: 1px solid #dce3d8;
  padding-top: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
}
.account .icon {
  margin-left: auto;
}
.avatar {
  width: 31px;
  height: 31px;
  background: #e0e7dc;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.account small {
  font-size: 10px;
}
main {
  margin-left: 244px;
  padding: 0 48px 60px;
  max-width: 1580px;
}
.topbar {
  height: 79px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 38px;
}
.private-label {
  font-size: 11px;
  letter-spacing: 1px;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 26px;
}
.page-heading p:last-child {
  margin-bottom: 0;
}
.quick-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 25px;
  margin-bottom: 27px;
  box-shadow: 0 3px 8px #243c3503;
}
.quick-card label {
  font-size: 14px;
  font-weight: 600;
}
.quick-card textarea {
  border: 0;
  padding: 10px 0;
  box-shadow: none;
  background: transparent;
  resize: vertical;
  min-height: 90px;
}
.quick-card > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 30px;
}
.stat {
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f9faf7;
}
.stat span {
  font-size: 13px;
  color: var(--muted);
}
.stat strong {
  font-size: 28px;
  font-weight: 500;
}
.stat:first-child {
  background: #edf2e9;
}
.list-toolbar {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  justify-content: space-between;
  margin-bottom: 18px;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}
.filters button {
  font-size: 12px;
  border: 0;
  padding: 7px 10px;
  background: transparent;
  color: var(--muted);
}
.filters .selected {
  background: #e1e9dc;
  color: var(--green);
  font-weight: 600;
}
#search {
  max-width: 240px;
  font-size: 12px;
  padding: 8px 12px;
}
.item-list {
  display: grid;
  gap: 12px;
}
.item-card {
  background: var(--paper);
  padding: 23px 25px;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
}
.item-card:hover {
  border-color: #abbfab;
}
.card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}
.card-description {
  font-size: 13px;
  color: #758176;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin-bottom: 14px;
}
.tags {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.tag {
  font-size: 11px;
  padding: 2px 8px;
  background: #f0f3ee;
  color: #74816f;
  border-radius: 5px;
}
.tag.warn {
  background: #fbf2e5;
  color: #a17b40;
}
.tag.danger {
  background: #f9ece8;
  color: var(--red);
}
.tag.green {
  background: #e7f0e8;
  color: #4b7654;
}
.next-action {
  font-size: 12px;
  margin-top: 15px;
  border-top: 1px solid #f0f1ee;
  padding-top: 12px;
  color: #566c5c;
  white-space: pre-wrap;
}
.empty {
  padding: 55px 20px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed #dbe3d7;
  border-radius: 12px;
  font-size: 14px;
}
.empty strong {
  display: block;
  font-size: 18px;
  color: var(--ink);
  margin-bottom: 9px;
}
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-top: 28px;
}
.panel {
  padding: 25px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 13px;
}
.wide {
  grid-column: 1/-1;
}
label {
  display: block;
  font-size: 13px;
  margin-bottom: 15px;
}
input,
textarea,
select {
  display: block;
  width: 100%;
  border: 1px solid #dfe5dc;
  border-radius: 7px;
  background: #fcfdfa;
  padding: 10px 12px;
  color: var(--ink);
  outline: none;
  margin-top: 6px;
}
input:focus,
textarea:focus,
select:focus {
  border-color: #92ae95;
  box-shadow: 0 0 0 3px #91aa9617;
}
textarea {
  resize: vertical;
}
input[type="checkbox"] {
  width: auto;
  display: inline-block;
  margin: 0 6px 0 0;
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 27px 0;
}
.token-form {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  align-items: center;
}
.token-form input {
  flex: 1;
  margin: 0;
}
.token-form select {
  width: auto;
  margin: 0;
}
.token-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 0;
  border-top: 1px solid var(--line);
  align-items: center;
  font-size: 13px;
}
#new-token {
  background: #edf4e8;
  border-radius: 10px;
  padding: 16px;
  margin: 15px 0;
}
code {
  overflow-wrap: anywhere;
  display: block;
  font-size: 13px;
  margin-bottom: 12px;
}
.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 25px 0;
}
.suggestions button {
  font-size: 13px;
}
.conversation {
  display: grid;
  gap: 16px;
  margin-bottom: 22px;
}
.message {
  padding: 22px;
  border-radius: 12px;
  background: white;
  border: 1px solid var(--line);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.message.user {
  background: #e9efe5;
  margin-left: 35px;
}
.message .refs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.message .refs button {
  font-size: 12px;
}
.draft-card {
  cursor: default;
}
.draft-card pre {
  white-space: pre-wrap;
  font: inherit;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.draft-diff {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin: 18px 0;
}
.draft-diff > div {
  background: #f6f8f3;
  padding: 15px;
  border-radius: 8px;
}
.draft-diff h4 {
  font-size: 12px;
  margin: 0 0 12px;
  color: var(--muted);
}
dialog {
  width: min(660px, calc(100% - 24px));
  max-height: 90dvh;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 28px;
  color: var(--ink);
}
dialog::backdrop {
  background: #18362a66;
  backdrop-filter: blur(3px);
}
dialog header {
  display: flex;
  justify-content: space-between;
  align-items: start;
}
dialog header .eyebrow {
  font-size: 9px;
  margin-bottom: 8px;
}
dialog footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 25px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.check-label {
  display: flex;
  align-items: center;
}
details {
  font-size: 13px;
  border-top: 1px solid var(--line);
  padding-top: 15px;
}
summary {
  cursor: pointer;
}
.history-entry {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.history-entry pre {
  font: inherit;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: #244b40;
  color: #fff;
  padding: 13px 22px;
  border-radius: 10px;
  box-shadow: 0 4px 20px #0002;
  z-index: 20;
  max-width: 90%;
  font-size: 13px;
}
.login-wrap {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 20% 20%, #dfe9d8, transparent 65%), #f6f7f3;
  padding: 30px;
}
.login-card {
  width: 390px;
  max-width: 100%;
}
.login-card .brand-mark {
  margin-bottom: 35px;
}
.login-card h1 {
  font-size: 40px;
}
.login-card form {
  margin: 28px 0;
}
.login-card button {
  width: 100%;
  margin-top: 8px;
}
.login-card small {
  display: block;
  text-align: center;
}
.login-card input {
  background: #ffffffa8;
}
.login-card .eyebrow {
  font-size: 9px;
}
#login-error {
  color: var(--red);
  font-size: 13px;
  margin: 10px 0 0;
}
[hidden] {
  display: none !important;
}
@media (min-width: 1500px) {
  main {
    padding-left: 70px;
    padding-right: 70px;
  }
}
@media (max-width: 1050px) {
  .sidebar {
    width: 205px;
    padding: 30px 15px;
  }
  main {
    margin-left: 205px;
    padding: 0 27px 45px;
  }
  .brand {
    margin-left: 0;
  }
  .page-heading h1 {
    font-size: 27px;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .wide {
    grid-column: auto;
  }
  .token-form {
    flex-wrap: wrap;
  }
  .account {
    gap: 5px;
  }
  .stat {
    padding: 15px;
  }
}
@media (max-width: 700px) {
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    padding: 16px 18px 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand {
    margin: 0 0 17px;
    font-size: 21px;
    gap: 10px;
  }
  .brand-mark {
    height: 36px;
    width: 36px;
    font-size: 21px;
  }
  .brand small {
    font-size: 9px;
  }
  .sidebar nav {
    display: flex;
    gap: 3px;
    justify-content: space-between;
  }
  .nav {
    font-size: 12px;
    padding: 8px 9px;
    gap: 5px;
  }
  .nav b {
    padding: 0 4px;
    font-size: 10px;
  }
  .sidebar-note,
  .account {
    display: none;
  }
  main {
    margin: 0;
    padding: 0 18px 35px;
  }
  .topbar {
    height: 50px;
    margin-bottom: 25px;
    font-size: 11px;
  }
  .page-heading {
    display: block;
    margin-bottom: 22px;
  }
  .page-heading h1,
  h1 {
    font-size: 25px;
  }
  .page-heading > button {
    margin-top: 17px;
  }
  .eyebrow {
    font-size: 9px;
  }
  .quick-card {
    padding: 17px;
  }
  .quick-card small {
    font-size: 10px;
  }
  .quick-card .primary {
    font-size: 12px;
    padding: 8px 12px;
  }
  .stats {
    gap: 8px;
    margin-bottom: 20px;
  }
  .stat {
    display: block;
    padding: 13px;
  }
  .stat span {
    font-size: 11px;
  }
  .stat strong {
    display: block;
    font-size: 25px;
  }
  .list-toolbar {
    gap: 10px;
  }
  #search {
    max-width: none;
  }
  .filters button {
    font-size: 11px;
    padding: 6px 8px;
  }
  .item-card {
    padding: 18px;
  }
  h3 {
    font-size: 16px;
  }
  .card-description {
    font-size: 12px;
  }
  .settings-grid {
    gap: 16px;
  }
  .panel {
    padding: 19px;
  }
  .token-form input {
    min-width: 100%;
  }
  .token-form select {
    flex: 1;
  }
  .draft-diff {
    grid-template-columns: 1fr;
  }
  .form-grid {
    gap: 10px;
  }
  dialog {
    padding: 20px;
  }
  .message.user {
    margin-left: 15px;
  }
  .suggestions button {
    font-size: 12px;
  }
}

#mobile-logout {
  margin-top: 24px;
}
