:root {
  --green: #003f37;
  --gold: #d6c58f;
  --ink: #173a34;
  --muted: #697c76;
  --bg: #f3f5f1;
  --line: #dfe6df;
  --white: #fff;
  --radius: 18px;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
}
.brand-logo { width: 115px; height: auto; }
.pdf-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 18px; margin: 18px 0; }
.pdf-fields > div { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.pdf-fields input:not([type="checkbox"]), .pdf-fields select, .pdf-fields textarea { width: 100%; max-width: 100%; }
.pdf-fields input[type="checkbox"] { align-self: flex-start; }
.pdf-suggestion { border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin: 10px 0; overflow-wrap: anywhere; }
#pdf-input-modes > label { display: block; margin-top: 14px; }
#pdf-input-modes > textarea { display: block; width: 100%; margin: 10px 0; }
#pdf-input-modes hr { margin: 28px 0; border: 0; border-top: 1px solid var(--line); }
dialog { border: 1px solid var(--line); border-radius: 18px; padding: 26px; max-width: min(560px, calc(100vw - 32px)); color: var(--ink); }
dialog::backdrop { background: #003f3799; }
dialog h2 { white-space: pre-line; }
dialog textarea { width: 100%; margin-top: 8px; }
.package-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 0; border-bottom: 1px solid var(--line); }
.package-row > span { flex: 1; min-width: 160px; overflow-wrap: anywhere; }
#share-form, #member-form { display: grid; gap: 12px; }
#member-key { white-space: pre-wrap; overflow-wrap: anywhere; }
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  display: flex;
  min-height: 100vh;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 4px;
}
button {
  cursor: pointer;
  border: 0;
  border-radius: 9px;
  padding: 12px 17px;
  font-weight: 600;
}
button:disabled {
  cursor: wait;
  opacity: 0.55;
}
a {
  color: var(--green);
}
[hidden] {
  display: none !important;
}
.sidebar {
  width: 250px;
  background: var(--green);
  color: white;
  position: fixed;
  inset: 0 auto 0 0;
  padding: 34px 22px;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: white;
  text-decoration: none;
  font-size: 26px;
  letter-spacing: 1px;
}
.brand-mark {
  border: 1px solid var(--gold);
  border-radius: 12px;
  color: var(--gold);
  width: 47px;
  height: 47px;
  display: grid;
  place-items: center;
  font-family: Georgia, serif;
  font-size: 30px;
}
.brand small {
  display: block;
  font-size: 9px;
  letter-spacing: 3px;
  color: #c4d6ce;
  margin-top: 3px;
}
.sidebar-label {
  font-size: 10px;
  letter-spacing: 2px;
  color: #91b4a9;
  margin: 55px 12px 18px;
}
.nav {
  display: flex;
  gap: 12px;
  align-items: center;
  text-align: left;
  width: 100%;
  background: transparent;
  color: #bcd0c8;
  font-size: 18px;
  padding: 14px 12px;
  margin: 5px 0;
}
.nav span {
  font-size: 13px;
}
.nav.active {
  background: #1d584d;
  color: #f3e7c3;
}
.local-note {
  margin-top: auto;
  padding: 24px 8px 15px;
  font-size: 12px;
  color: #e0e9df;
}
.local-note small {
  display: block;
  color: #9abbaf;
  font-size: 10px;
  padding-top: 9px;
}
.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 100%;
  background: var(--gold);
  margin-right: 6px;
}
.logout {
  background: transparent;
  color: #a9c1b8;
  text-align: left;
  padding-left: 8px;
  font-size: 12px;
}
main {
  margin-left: 250px;
  width: calc(100% - 250px);
  padding: 34px 44px 20px;
  max-width: 1800px;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 16px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 700;
  color: var(--muted);
}
h1 {
  font-size: 29px;
  letter-spacing: -1px;
  font-weight: 600;
  margin: 9px 0 0;
}
h2 {
  font-size: 20px;
  letter-spacing: -0.4px;
  font-weight: 600;
  margin: 0 0 14px;
}
h3 {
  font-weight: 500;
}
p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
  margin: 9px 0 18px;
}
.header-right {
  display: flex;
  min-width: 0;
  gap: 10px;
  align-items: center;
}
select,
input,
textarea {
  border: 1px solid var(--line);
  background: white;
  border-radius: 9px;
  color: var(--ink);
  padding: 11px 12px;
  max-width: 100%;
}
select {
  max-width: 220px;
  font-size: 12px;
}
.icon-button {
  background: white;
  border: 1px solid var(--line);
  font-size: 20px;
  padding: 7px 13px;
}
.hero {
  background: var(--green);
  color: white;
  border-radius: var(--radius);
  padding: 38px 40px;
  display: flex;
  justify-content: space-between;
  overflow: hidden;
  min-height: 285px;
}
.hero .eyebrow {
  color: var(--gold);
}
.hero h2 {
  font-size: 36px;
  line-height: 1.25;
  margin: 18px 0;
  letter-spacing: -1.3px;
}
.hero p {
  color: #bcd1c7;
}
.gold {
  background: var(--gold);
  color: var(--green);
  font-size: 12px;
}
.orbit {
  height: 224px;
  width: 224px;
  align-self: center;
  border: 1px solid #5b7863;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  margin-right: 34px;
}
.orbit:after {
  content: "";
  position: absolute;
  inset: -28px;
  border: 1px solid #39604f;
  border-radius: 50%;
}
.orbit-inner {
  width: 145px;
  height: 145px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border: 1px solid var(--gold);
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 42px;
  color: var(--gold);
}
.orbit-inner span {
  font: 8px sans-serif;
  letter-spacing: 3px;
  margin-top: 10px;
}
.orb {
  height: 12px;
  width: 12px;
  background: var(--gold);
  border-radius: 50%;
  position: absolute;
}
.o1 {
  top: 0;
  left: 70px;
}
.o2 {
  right: -28px;
  top: 100px;
  width: 7px;
  height: 7px;
}
.o3 {
  bottom: 10px;
  left: 18px;
  width: 8px;
  height: 8px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 22px 0;
}
.stats article {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.stats article > span {
  font-size: 12px;
  color: var(--muted);
}
.stats strong {
  font-size: 34px;
  display: block;
  font-weight: 500;
  letter-spacing: -1px;
  margin: 12px 0 6px;
}
.stats small {
  font-size: 11px;
  color: var(--muted);
}
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  background: white;
}
.two-col {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 22px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.section-head h2 {
  margin: 0;
}
.badge {
  font-size: 10px;
  background: #e9f3ec;
  color: #256448;
  padding: 6px 9px;
  border-radius: 20px;
  white-space: nowrap;
}
.badge.neutral {
  background: #f6f2e8;
  color: #806e3b;
}
.badge.error {
  background: #fce9e5;
  color: #9c3726;
}
.model {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.model:last-child {
  border-bottom: 0;
}
.model small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 6px;
}
.steps {
  padding: 0;
  list-style: none;
  margin: 20px 0 0;
}
.steps li {
  display: flex;
  gap: 18px;
  padding: 12px 0;
}
.steps b {
  color: #9d8f5e;
  font-size: 13px;
  font-weight: 500;
}
.steps span {
  font-size: 13px;
}
.steps small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 5px;
}
.primary {
  background: var(--green);
  color: white;
}
.secondary {
  background: white;
  color: var(--green);
  border: 1px solid var(--line);
}
.login-panel {
  max-width: 780px;
  margin: 70px auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 35px;
}
label {
  display: block;
  font-size: 12px;
  margin: 0 0 8px;
}
#login-form input {
  width: 100%;
  margin-bottom: 16px;
}
.dropzone {
  border: 1px dashed #b9c8b9;
  border-radius: 12px;
  background: #fafbf8;
  padding: 25px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-bottom: 22px;
}
.dropzone label {
  width: 100%;
  font-size: 15px;
  font-weight: 500;
}
.dropzone small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
  margin-top: 8px;
}
.dropzone input {
  border: 0;
  background: none;
  padding: 0;
  flex: 1;
}
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
}
th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  font-weight: 500;
  padding: 15px 10px;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 16px 10px;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
td button {
  padding: 6px 9px;
  font-size: 11px;
  background: #f3f5f1;
  margin: 2px;
}
.chat-layout {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 22px;
}
.chat-panel {
  min-height: 570px;
  display: flex;
  flex-direction: column;
}
#messages {
  flex: 1;
  max-height: 520px;
  min-height: 300px;
  overflow: auto;
  padding: 10px 0 20px;
}
.chat-welcome {
  text-align: center;
  padding: 50px 15px;
}
.chat-welcome > span {
  font-size: 42px;
  color: #ac9b63;
}
.message {
  padding: 15px 18px;
  border-radius: 13px;
  background: #f2f5ef;
  margin: 12px 0;
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.7;
}
.message.user {
  background: var(--green);
  color: white;
  margin-left: 35px;
}
.message small {
  display: block;
  opacity: 0.7;
  font-size: 10px;
  margin-top: 10px;
}
#chat-form {
  display: flex;
  align-items: stretch;
  gap: 10px;
  padding: 12px 0;
}
textarea {
  resize: vertical;
  flex: 1;
  min-width: 0;
}
.muted {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
}
.source {
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
}
.source summary {
  cursor: pointer;
  line-height: 1.5;
  font-size: 13px;
}
.source p {
  white-space: pre-wrap;
  font-size: 12px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 17px;
}
.form-grid input {
  width: 100%;
}
.segmented {
  display: flex;
  gap: 5px;
  margin: 20px 0;
  flex-wrap: wrap;
}
.segmented button {
  background: #f0f3ee;
  font-size: 11px;
  flex: 1;
}
.check {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 18px 0;
}
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #f4f6f1;
  border-radius: 10px;
  padding: 18px;
  font-size: 11px;
  line-height: 1.8;
  max-height: 400px;
  overflow: auto;
}
code {
  background: #f2f4ee;
  padding: 12px;
  display: block;
  border-radius: 8px;
}
#notice {
  padding: 14px 18px;
  background: #f6eccf;
  border: 1px solid #d7c58f;
  border-radius: 10px;
  margin-bottom: 22px;
  font-size: 13px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
footer {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  letter-spacing: 1.5px;
  color: #8a998e;
  margin-top: 35px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
@media (min-width: 1600px) {
  main {
    padding: 45px 65px;
  }
}
@media (max-width: 1100px) {
  .sidebar {
    width: 205px;
    padding: 28px 15px;
  }
  main {
    margin-left: 205px;
    width: calc(100% - 205px);
    padding: 25px;
  }
  .hero {
    padding: 28px;
  }
  .orbit {
    transform: scale(0.75);
    margin-right: -15px;
    width: 190px;
    flex-shrink: 0;
  }
  .two-col,
  .chat-layout {
    grid-template-columns: 1fr;
  }
  .stats strong {
    font-size: 27px;
  }
  .hero h2 {
    font-size: 30px;
  }
}
@media (max-width: 650px) {
  body {
    display: block;
  }
  .sidebar {
    position: relative;
    width: 100%;
    padding: 18px 20px;
  }
  .brand {
    font-size: 22px;
  }
  .brand-mark {
    width: 36px;
    height: 36px;
    font-size: 24px;
  }
  .sidebar-label,
  .local-note {
    display: none;
  }
  nav {
    display: flex;
    margin-top: 16px;
    overflow: auto;
    gap: 4px;
  }
  .nav {
    width: auto;
    padding: 9px;
    font-size: 16px;
    white-space: nowrap;
  }
  .nav span {
    font-size: 10px;
  }
  main {
    margin: 0;
    width: 100%;
    padding: 22px 16px;
  }
  header {
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 22px;
  }
  h1 {
    font-size: 26px;
  }
  .header-right {
    width: 100%;
  }
  .header-right select {
    flex: 1;
    min-width: 0;
    max-width: none;
  }
  .hero {
    padding: 27px 24px;
  }
  .hero h2 {
    font-size: 30px;
  }
  .orbit {
    display: none;
  }
  .stats {
    gap: 8px;
  }
  .stats article {
    padding: 14px 10px;
    border-radius: 12px;
  }
  .stats article > span {
    font-size: 10px;
  }
  .stats small {
    font-size: 9px;
  }
  .stats strong {
    font-size: 24px;
  }
  .panel {
    padding: 20px;
  }
  .section-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .login-panel {
    grid-template-columns: 1fr;
    margin: 25px auto;
  }
  .dropzone {
    padding: 18px;
  }
  .dropzone button {
    width: 100%;
  }
  footer span {
    letter-spacing: 0;
  }
  .chat-panel {
    min-height: 500px;
  }
  .form-grid {
    gap: 12px;
  }
}

[data-page="cluster"] textarea { width:100%; min-height:80px; }
[data-page="cluster"] label { display:block; margin-top:12px; }
.cluster-days { display:flex; flex-wrap:wrap; gap:14px; }
[data-page="cluster"] small { overflow-wrap:anywhere; }
.batch-scroll { max-height: 360px; overflow: auto; margin-bottom: 24px; }
.batch-scroll td { overflow-wrap: anywhere; }
#batch-progress { width: 100%; accent-color: var(--green); }
#upload-form input[type=file] { max-width: 100%; }
.upload-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; width: 100%; }
.upload-choice { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.upload-choice label { display: block; font-weight: 600; }
.upload-choice p { font-size: 13px; margin: 8px 0 16px; }
.upload-choice input[type=file] { width: 100%; font-size: 13px; }
.upload-choice input::file-selector-button { padding: 10px 14px; margin-right: 8px; border: 1px solid var(--green); border-radius: 8px; background: var(--green); color: white; cursor: pointer; }
#upload-unavailable { padding: 18px; border-left: 3px solid var(--gold); background: #fafbf8; }
@media (max-width: 700px) { .upload-choices { grid-template-columns: 1fr; } }

#login > details, #login > p, #email-verification { grid-column: 1 / -1; }
#registration-form { display: grid; gap: 10px; max-width: 560px; margin-top: 20px; }
