:root {
  --bg: #f5f6f5;
  --ink: #1d2f2b;
  --muted: #65746f;
  --line: #dce4df;
  --accent: #17674d;
  --soft: #e8f1ec;
  --white: #fff;
  --warn: #8a5b16;
  --bad: #9d3434;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    15px/1.5 system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
header {
  height: 72px;
  padding: 0 5%;
  display: flex;
  align-items: center;
  gap: 18px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.brand {
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
}
.mark {
  display: grid;
  place-items: center;
  background: var(--accent);
  color: white;
  width: 34px;
  height: 34px;
  border-radius: 8px;
}
.header-note {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
}
main {
  max-width: 1280px;
  margin: auto;
  padding: 40px 28px 90px;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 24px;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 8px;
}
h1 {
  font-size: 36px;
  line-height: 1.15;
  margin: 0 0 10px;
}
h2 {
  font-size: 21px;
  margin: 0 0 18px;
}
.muted {
  color: var(--muted);
}
button,
.button {
  border: 1px solid transparent;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 650;
  padding: 10px 16px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button:hover,
.button:hover {
  filter: brightness(0.95);
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
.secondary {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}
.ghost,
.text-button {
  background: none;
  color: var(--accent);
  border: 0;
  padding: 4px 0;
}
.danger {
  color: var(--bad);
}
.actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  margin-bottom: 18px;
}
.org-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}
.org-head label {
  flex: 1;
}
.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 650;
  padding: 4px 10px;
  background: var(--soft);
  border-radius: 999px;
  color: var(--accent);
  white-space: nowrap;
}
.cabinet {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 18px;
  margin: 12px 0;
}
.cabinet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
}
.cabinet-head strong {
  font-size: 16px;
  overflow-wrap: anywhere;
}
.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 14px;
}
label {
  display: block;
  font-size: 13px;
  font-weight: 650;
  color: var(--ink);
}
input {
  display: block;
  width: 100%;
  margin-top: 6px;
  border: 1px solid #cdd9d2;
  border-radius: 7px;
  padding: 9px 11px;
  background: white;
  color: var(--ink);
  font: 14px/1.4 inherit;
}
input:focus {
  outline: 2px solid #68a88c;
  outline-offset: 1px;
}
.login {
  max-width: 520px;
  margin: 8vh auto;
}
.login h1 {
  font-size: 46px;
}
.login form {
  max-width: 380px;
  margin-top: 28px;
}
.login button {
  width: 100%;
  margin-top: 10px;
}
#login-error {
  color: var(--bad);
  white-space: pre-wrap;
}
#notice {
  position: fixed;
  right: 22px;
  top: 84px;
  z-index: 4;
  max-width: 560px;
  background: #1c302b;
  color: #fff;
  padding: 14px 18px;
  border-radius: 8px;
  box-shadow: 0 8px 20px #0002;
  white-space: pre-wrap;
}
.table-wrap {
  overflow: auto;
  max-height: 420px;
  margin-top: 12px;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}
td,
th {
  padding: 9px 11px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  max-width: 420px;
  overflow-wrap: anywhere;
}
th {
  background: #edf2ee;
  position: sticky;
  top: 0;
}
.ok td:first-child {
  color: var(--accent);
  font-weight: 700;
}
.warning td:first-child {
  color: var(--warn);
  font-weight: 700;
}
.error td:first-child {
  color: var(--bad);
  font-weight: 700;
}
.empty td:first-child {
  color: var(--muted);
}
ul {
  margin: 0 0 16px;
  padding-left: 20px;
}
footer {
  border-top: 1px solid var(--line);
  padding: 20px 5%;
  color: var(--muted);
  font-size: 12px;
}
[hidden] {
  display: none !important;
}
@media (max-width: 980px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .page-head {
    flex-direction: column;
  }
  .actions {
    justify-content: flex-start;
  }
}
@media (max-width: 640px) {
  main {
    padding: 28px 14px 80px;
  }
  header {
    padding: 0 14px;
  }
  .header-note {
    display: none;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .org-head {
    display: block;
  }
  h1 {
    font-size: 30px;
  }
  .login h1 {
    font-size: 36px;
  }
  .panel {
    padding: 18px;
  }
}

textarea,
select {
  display: block;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font: inherit;
  margin: 6px 0 14px;
}
textarea {
  min-height: 90px;
}
input[type="checkbox"] {
  display: inline-block;
  width: auto;
  margin-right: 8px;
}
summary {
  cursor: pointer;
  font-weight: 650;
  padding: 8px 0;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  max-width: 600px;
  width: 90%;
  padding: 24px;
}
dialog::backdrop {
  background: #0006;
}
small {
  display: block;
  color: var(--muted);
  overflow-wrap: anywhere;
}
input[readonly],
textarea:disabled {
  background: #eef1ef;
}
#org-list {
  margin-top: 20px;
}
.panel > .grid,
#cities .grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
textarea[data-setting="description_prefix"],
textarea[data-setting="description_suffix"],
textarea[data-ai="system_prompt"],
textarea[data-ai="user_prompt_template"] {
  min-height: 170px;
}
@media (max-width: 640px) {
  .panel > .grid,
  #cities .grid {
    grid-template-columns: 1fr;
  }
}
