:root {
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: #1b2e25;
  background: #f6f7f2;
  font-size: 16px;
  --ink: #192b22;
  --muted: #53665b;
  --line: #dbe0d6;
  --lime: #c4f56c;
  --card: #fff;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.55;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #528d29;
  outline-offset: 3px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  letter-spacing: -0.045em;
}
h1 {
  font-size: clamp(2.1rem, 4vw, 3.35rem);
  line-height: 1.05;
}
h2 {
  font-size: 1.45rem;
}
h3 {
  font-size: 1.05rem;
}
p {
  line-height: 1.55;
}
.muted,
small {
  color: var(--muted);
}
small {
  font-size: 0.82rem;
}
.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.07em;
}
.brand img {
  width: 37px;
}
.ic {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
  flex-shrink: 0;
}
.btn,
.flat,
.quick,
.nav,
.rowlink {
  border: 0;
  background: none;
  color: inherit;
}
.btn,
.flat,
.quick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 8px;
  font-weight: 600;
  min-height: 42px;
  padding: 9px 15px;
  font-size: 0.92rem;
}
.btn {
  background: var(--ink);
  color: white;
}
.btn:hover {
  background: #304a3b;
}
.flat,
.quick {
  background: white;
  border: 1px solid var(--line);
}
.flat:hover,
.quick:hover {
  background: #f0f4e9;
}
.flat.icononly {
  padding: 8px;
  min-height: 36px;
}
.btn .ic,
.flat .ic,
.quick .ic {
  width: 17px;
  height: 17px;
}
.eyebrow {
  font: 600 0.78rem var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--muted);
}
.auth {
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1.06fr 1fr;
  padding: 16px;
  gap: 16px;
  background: #f9faf6;
}
.auth-art {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #162a20;
  color: #f4f8ec;
  padding: clamp(2rem, 4vw, 4.5rem);
  border-radius: 20px;
  min-height: 620px;
}
.auth-art canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}
.art-title {
  font-size: clamp(2.4rem, 4.8vw, 5rem);
  font-weight: 550;
  line-height: 1.01;
  letter-spacing: -0.065em;
  max-width: 17ch;
  text-wrap: balance;
}
.auth-art .eyebrow {
  color: #c4f56c;
  margin-bottom: 16px;
}
.auth-form {
  align-self: center;
  justify-self: center;
  width: min(82%, 385px);
  padding: 50px 0;
}
.auth-form .brand {
  display: none;
}
.auth-form h1 {
  font-size: 2.6rem;
  margin: 16px 0 10px;
}
.auth-form form {
  margin-top: 35px;
  display: grid;
  gap: 20px;
}
label {
  display: grid;
  gap: 8px;
  color: #34483b;
  font-size: 0.91rem;
  font-weight: 600;
}
input,
textarea,
select {
  width: 100%;
  border: 1px solid #c6cec3;
  border-radius: 7px;
  background: white;
  color: var(--ink);
  padding: 11px 12px;
  font-weight: 400;
  font-size: 1rem;
}
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #87b959;
  outline-offset: 1px;
}
textarea {
  resize: vertical;
  min-height: 85px;
}
.auth-form .btn {
  margin-top: 6px;
}
.error {
  color: #9f302d;
  font-size: 0.9rem;
}
.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
}
aside {
  background: #172920;
  color: #e9efe7;
  padding: 30px 18px;
  display: flex;
  flex-direction: column;
  gap: 46px;
  position: sticky;
  top: 0;
  height: 100vh;
}
aside .brand {
  margin-left: 12px;
}
nav {
  display: grid;
  gap: 6px;
}
.nav {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 13px;
  color: #c4cec5;
  padding: 13px 14px;
  border-radius: 8px;
  font-size: 0.95rem;
}
.nav.active {
  background: #34483a;
  color: #d6ff9a;
}
.nav:hover {
  background: #2c4033;
}
.aside-foot {
  margin-top: auto;
  border-top: 1px solid #394a3f;
  padding-top: 16px;
}
.aside-foot small {
  color: #cfdbd1;
  display: block;
  overflow-wrap: anywhere;
  margin: 6px 12px 12px;
}
.workspace {
  min-width: 0;
}
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
  padding: 0 clamp(20px, 4vw, 66px);
  border-bottom: 1px solid var(--line);
  background: #fbfcf8;
  font-size: 0.9rem;
  color: var(--muted);
}
.inline,
.actions,
.section-head,
.page-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-head,
.page-head {
  justify-content: space-between;
}
.page-head {
  align-items: flex-end;
  margin: 0 0 32px;
}
.page-head .eyebrow {
  margin-bottom: 12px;
}
.section-head {
  margin-bottom: 18px;
}
.section-head h2 {
  margin: 0;
}
.pill,
.state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  padding: 5px 9px;
  background: #e8eedf;
  color: #3e5535;
  border-radius: 6px;
}
.pill .ic {
  width: 14px;
  height: 14px;
}
main {
  max-width: 1450px;
  margin: auto;
  padding: clamp(25px, 4vw, 60px);
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 26px;
}
.stat,
.card,
.item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 13px;
}
.stat {
  padding: 20px 22px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.stat strong {
  font-size: 2.5rem;
  font-weight: 550;
  display: block;
  letter-spacing: -0.07em;
  margin-top: 10px;
}
.stat .ic {
  color: #58734f;
}
.card {
  padding: 24px;
  margin: 0 0 22px;
}
.empty {
  text-align: center;
  padding: 32px 10px;
}
.empty .ic {
  width: 31px;
  height: 31px;
  color: #5c7755;
  margin-bottom: 10px;
}
.empty p {
  color: var(--muted);
  margin: 6px 0 15px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(235px, 100%), 1fr));
  gap: 14px;
}
.item {
  padding: 19px;
  text-align: left;
  color: inherit;
}
.item:hover {
  border-color: #96ad84;
}
.item .ic {
  color: #547048;
  margin-bottom: 15px;
}
.item strong {
  display: block;
  font-size: 1.15rem;
  margin-bottom: 6px;
}
.item small {
  display: block;
  overflow-wrap: anywhere;
}
.item .state {
  margin-top: 16px;
}
.state.failed,
.state.alta {
  background: #f8e5df;
  color: #923e26;
}
.state.running,
.state.queued,
.state.média {
  background: #fcf0d7;
  color: #805817;
}
.rows {
  display: grid;
}
.rowlink,
.auditrow {
  width: 100%;
  padding: 15px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  text-align: left;
  border-top: 1px solid var(--line);
}
.rowlink:hover {
  background: #f6f8f1;
}
.rowlink small,
.auditrow small {
  display: block;
  margin-top: 4px;
}
.listfooter {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 18px;
}
.details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.details p,
.wrap {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.details small {
  display: block;
  margin-bottom: 4px;
}
.actions {
  flex-wrap: wrap;
}
.chatbox {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.chatbox input {
  min-width: 0;
}
dialog {
  width: min(620px, calc(100% - 24px));
  max-height: 88svh;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px;
  color: var(--ink);
  box-shadow: 0 18px 90px #10281930;
}
dialog::backdrop {
  background: #13261cc0;
}
dialog header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}
fieldset {
  border: 0;
  border-top: 1px solid var(--line);
  padding: 18px 0;
  margin: 0;
}
legend {
  padding-right: 12px;
  font-weight: 650;
}
.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.full {
  grid-column: 1/-1;
}
.foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}
.mono {
  font-family: var(--mono);
  font-size: 0.88rem;
}
.gap {
  margin: 12px 0;
}
.report-section {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-top: 18px;
}
.report-section h3 {
  margin: 0 0 10px;
}
.report-section p {
  white-space: pre-wrap;
}
.evidence {
  padding: 12px 0;
}
.evidence small {
  display: block;
  margin-top: 4px;
}
progress {
  width: 100%;
  accent-color: #547c35;
}
#notice {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 8px;
  background: #192b22;
  color: #fff;
  max-width: 92%;
  z-index: 6;
}
#notice:not(:empty) {
  padding: 12px 20px;
}
.back {
  margin-bottom: 20px;
}
.hidden {
  display: none;
}
.org {
  overflow-wrap: anywhere;
}
@media (max-width: 800px) {
  .shell {
    display: block;
  }
  aside {
    position: relative;
    height: auto;
    padding: 12px 18px;
    gap: 12px;
  }
  aside .brand {
    margin: 0;
    font-size: 1.5rem;
  }
  aside .brand img {
    width: 29px;
  }
  nav {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
  }
  .nav {
    width: auto;
    padding: 8px;
    font-size: 0.86rem;
    gap: 6px;
  }
  .nav .ic {
    width: 16px;
  }
  .aside-foot {
    position: absolute;
    top: 10px;
    right: 12px;
    border: 0;
    padding: 0;
  }
  .aside-foot small {
    display: none;
  }
  .bar {
    height: 48px;
  }
  .auth {
    grid-template-columns: 0.85fr 1fr;
  }
  .auth-art {
    padding: 25px;
  }
  .stats {
    gap: 8px;
  }
  .stat {
    padding: 15px;
  }
  .stat .ic {
    display: none;
  }
}
@media (max-width: 600px) {
  .auth {
    display: block;
    padding: 0;
  }
  .auth-art {
    height: 210px;
    min-height: 0;
    border-radius: 0 0 20px 20px;
  }
  .art-title {
    font-size: 2rem;
  }
  .auth-art .eyebrow {
    display: none;
  }
  .auth-form {
    width: auto;
    margin: 0 26px;
    padding: 35px 0;
  }
  .auth-form h1 {
    font-size: 2.2rem;
  }
  .bar .pill {
    font-size: 0.72rem;
  }
  main {
    padding: 24px 16px;
  }
  .page-head {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
  }
  .card {
    padding: 17px;
  }
  .fields,
  .details {
    grid-template-columns: 1fr;
  }
  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .stat {
    padding: 12px;
  }
  .stat small {
    font-size: 0.78rem;
  }
  .stat strong {
    font-size: 1.9rem;
  }
  .chatbox {
    flex-direction: column;
  }
  .section-head {
    flex-wrap: wrap;
  }
  .actions .quick {
    font-size: 0.84rem;
  }
  .rowlink {
    align-items: flex-start;
  }
  .inline {
    gap: 7px;
  }
}
.exchange {
  background: #f5f8f0;
  border-radius: 8px;
  padding: 14px;
  margin: 14px 0 6px;
}
.exchange p {
  margin: 8px 0;
  white-space: pre-wrap;
}
.exchange .flat {
  margin-top: 5px;
}

.ai-config {
  max-width: 760px;
}
.ai-config form,
.ai-credentials {
  display: grid;
  gap: 18px;
}
.ai-config form {
  margin-top: 24px;
}
.ai-config label small {
  font-weight: 400;
}

.turns { max-height: 55vh; overflow-y: auto; padding: .5rem 0; }
.turn { display: grid; gap: .65rem; margin-bottom: 1.25rem; }
.turn p { white-space: pre-wrap; overflow-wrap: anywhere; margin: .35rem 0; }
.user-bubble, .assistant-bubble { padding: .8rem 1rem; border-radius: 8px; max-width: 90%; }
.user-bubble { justify-self: end; background: #e9efdf; color: #243027; }
.assistant-bubble { justify-self: start; border: 1px solid #bec8ba; }
.compose-actions { display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
.change-receipt { border-left: 3px solid #839861; padding: .55rem .8rem; }
.change-receipt small { display: block; }
