:root {
  color-scheme: light;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: #f5f7fa;
  color: #17202a;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #ffffff 0, #f5f7fa 420px);
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
[hidden] {
  display: none !important;
}
.shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 72px;
}
.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.eyebrow {
  margin: 0 0 8px;
  color: #16856f;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.22em;
}
h1 {
  margin: 0;
  color: #111820;
  font-size: clamp(30px, 5vw, 46px);
  letter-spacing: -0.04em;
}
h2 {
  margin: 6px 0 0;
  color: #17202a;
  font-size: 19px;
}
.subtitle,
.card p {
  color: #687483;
}
.subtitle {
  margin: 8px 0 0;
}
.card {
  border: 1px solid #e1e6eb;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 14px 42px rgba(29, 43, 58, 0.08);
  padding: 24px;
}
.login-card {
  display: grid;
  grid-template-columns: 1fr minmax(300px, 420px);
  gap: 42px;
  align-items: center;
  max-width: 900px;
  margin: 80px auto 0;
}
.badge,
.chip,
.mini-chip {
  display: inline-flex;
  border-radius: 999px;
  background: #eaf8f4;
  color: #137862;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
}
.summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}
.summary div {
  display: grid;
  gap: 6px;
}
.summary span,
.result-head {
  color: #788493;
  font-size: 12px;
}
.summary strong {
  color: #17202a;
  font-size: 18px;
}
.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.72fr);
  gap: 18px;
  align-items: start;
}
.side-stack {
  display: grid;
  gap: 18px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 24px;
}
.section-head > div {
  display: flex;
  align-items: center;
  gap: 12px;
}
.step {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: #edf7f4;
  color: #17846e;
  font-size: 12px;
  font-weight: 800;
}
.stack {
  display: grid;
  gap: 16px;
}
.fields {
  display: grid;
  gap: 14px;
}
.fields.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
label {
  display: grid;
  gap: 8px;
  color: #4d5967;
  font-size: 13px;
  font-weight: 650;
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid #ccd4dc;
  border-radius: 11px;
  background: #ffffff;
  color: #17202a;
  padding: 12px 13px;
  outline: none;
  transition:
    border 0.2s,
    box-shadow 0.2s,
    background 0.2s;
}
input::placeholder,
textarea::placeholder {
  color: #9ba5b0;
}
input:focus,
select:focus,
textarea:focus {
  border-color: #15977c;
  box-shadow: 0 0 0 3px rgba(21, 151, 124, 0.12);
}
textarea:disabled {
  cursor: not-allowed;
  background: #f3f5f7;
  color: #89939f;
}
input.invalid {
  border-color: #cf3f55;
  background: #fff8f9;
  box-shadow: 0 0 0 3px rgba(207, 63, 85, 0.09);
}
textarea {
  resize: vertical;
  line-height: 1.55;
}
button {
  border: 0;
  border-radius: 11px;
  padding: 11px 15px;
  font-weight: 750;
}
.primary {
  background: #17202a;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(23, 32, 42, 0.14);
}
.primary:hover {
  background: #263442;
}
.secondary {
  background: #eaf3f1;
  color: #146b5a;
}
.ghost {
  border: 1px solid #ccd4dc;
  background: #ffffff;
  color: #43505e;
}
.text-button,
.danger-text {
  padding: 0;
  background: transparent;
  color: #147a65;
}
.danger-text {
  color: #b23a4c;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}
.form-note {
  margin: -4px 0 0;
  font-size: 12px;
  line-height: 1.6;
}
.picker {
  margin-top: 24px;
  border-top: 1px solid #e1e6eb;
  padding-top: 22px;
}
.picker-head,
.publish-bar,
.result-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}
.picker-head > div {
  display: grid;
  gap: 4px;
}
.picker-head span {
  color: #788493;
  font-size: 12px;
}
.search {
  width: min(250px, 45%);
}
.search input {
  padding: 9px 11px;
}
.relay-draft {
  display: grid;
  gap: 14px;
  margin: 18px 0;
}
.relay-card {
  overflow: hidden;
  border: 1px solid #dce2e8;
  border-radius: 16px;
  background: #fafbfc;
}
.relay-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid #e3e8ed;
  background: #ffffff;
  padding: 15px 16px;
}
.relay-heading > div {
  display: grid;
  gap: 4px;
}
.relay-heading span {
  color: #7a8694;
  font-size: 12px;
}
.model-list {
  display: grid;
  gap: 10px;
  max-height: 660px;
  overflow: auto;
  padding: 14px;
}
.model-row {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(180px, 0.7fr);
  gap: 12px;
  border: 1px solid #e0e5ea;
  border-radius: 13px;
  padding: 14px;
  background: #ffffff;
}
.model-select {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.model-select input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  accent-color: #17846e;
}
.model-select code {
  min-width: 0;
}
.model-row label:last-child {
  grid-column: 1 / -1;
}
.prompt-toggle {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 9px;
}
.prompt-toggle input {
  width: 18px;
  height: 18px;
  accent-color: #17846e;
}
.prompt-field {
  grid-column: 1 / -1;
}
code {
  color: #34414f;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.publish-bar {
  border-top: 1px solid #e1e6eb;
  padding-top: 16px;
}
.publish-bar > span {
  color: #697583;
  font-size: 13px;
}
.published {
  display: grid;
  gap: 12px;
}
.published-group {
  overflow: hidden;
  border: 1px solid #e0e5ea;
  border-radius: 13px;
  background: #fafbfc;
}
.published-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #e4e8ed;
  background: #ffffff;
  padding: 11px 12px;
}
.mini-chip {
  padding: 4px 8px;
}
.published-model {
  display: grid;
  gap: 5px;
  padding: 11px 12px;
  border-bottom: 1px solid #e8ecf0;
}
.published-model-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.revoke-button {
  flex: 0 0 auto;
  border: 1px solid #e5b8bf;
  background: #fff7f8;
  color: #a63143;
  padding: 6px 9px;
  font-size: 12px;
}
.published-model:last-child {
  border-bottom: 0;
}
.published-model details {
  color: #62707e;
  font-size: 12px;
}
.published-model summary {
  cursor: pointer;
  color: #147a65;
}
.published-model pre {
  max-height: 180px;
  overflow: auto;
  margin: 8px 0 0;
  white-space: pre-wrap;
  color: #4d5967;
  font: inherit;
  line-height: 1.55;
}
.published.empty {
  color: #7e8998;
  font-size: 13px;
}
.compact input {
  padding: 10px;
}
#invite-result {
  margin-top: 18px;
}
#invite-codes {
  margin-top: 10px;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 12px;
}
.notice {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10;
  max-width: min(460px, calc(100% - 48px));
  border: 1px solid #d7dee5;
  border-radius: 13px;
  background: #ffffff;
  color: #25313d;
  padding: 14px 16px;
  box-shadow: 0 18px 55px rgba(29, 43, 58, 0.18);
}
.notice[data-tone="success"] {
  border-color: #61b49f;
  background: #f5fffb;
}
.notice[data-tone="error"] {
  border-color: #d7808d;
  background: #fff8f9;
}
.notice[data-tone="progress"] {
  border-color: #79a9c5;
  background: #f7fbff;
}
@media (max-width: 930px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .summary {
    grid-template-columns: repeat(2, 1fr);
  }
  .summary button {
    grid-column: 1 / -1;
  }
  .login-card {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 620px) {
  .shell {
    width: min(100% - 20px, 1280px);
    padding-top: 22px;
  }
  .card {
    padding: 18px;
    border-radius: 18px;
  }
  .fields.two,
  .summary,
  .model-row {
    grid-template-columns: 1fr;
  }
  .model-select,
  .model-row label:last-child {
    grid-column: 1;
  }
  .picker-head {
    align-items: stretch;
    flex-direction: column;
  }
  .search {
    width: 100%;
  }
  .topbar {
    align-items: start;
  }
}
