:root {
  color-scheme: light;
  font-family: "Avenir Next", "Segoe UI", system-ui, sans-serif;
  background: #f1f5f0;
  color: #172b25;
  --ink: #172b25;
  --muted: #51645b;
  --line: #d7e2d9;
  --panel: #fff;
  --primary: #215945;
  --primary-hover: #173e30;
  --soft: #eaf5ec;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body, h1, h2, p, dl, dd { margin: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #759f3c; outline-offset: 3px; }
a { color: inherit; text-decoration: none; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 244px minmax(0, 1fr); }
.sidebar {
  display: flex; flex-direction: column; gap: 25px; padding: 27px 18px;
  background: #172b25; color: #f6f9f4;
}
.brand { display: flex; align-items: center; gap: 10px; margin-left: 4px; white-space: nowrap; font-weight: 600; }
.brand strong { color: #d2f38f; }
.brand-mark {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  background: #d2f38f; color: #172b25; font: italic bold 28px Georgia, serif;
}
.company { display: flex; align-items: center; gap: 11px; padding: 12px; border: 1px solid #426056; border-radius: 14px; }
.company small { display: block; color: #c2d3c9; font-size: .8rem; margin-top: 2px; }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; background: #38564b; border-radius: 10px; font-weight: 700; font-size: .85rem; }
nav { display: grid; gap: 6px; }
nav button, .restart { min-height: 44px; background: transparent; border: 1px solid transparent; border-radius: 10px; text-align: left; color: inherit; padding: 8px 11px; font-weight: 600; }
nav button { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
nav button span { padding: 1px 7px; background: #d2f38f; color: #172b25; border-radius: 16px; font-size: .85rem; }
nav button:hover, nav button[aria-current="page"] { background: #304a3e; border-color: #496255; }
.restart { margin-top: auto; border-color: #426056; }
.restart:hover { background: #304a3e; }
.main { min-width: 0; width: min(100%, 1370px); padding: clamp(19px, 4.2vw, 60px); }
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 9px 16px; padding-bottom: 22px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.demo, .status { display: inline-block; border-radius: 999px; padding: 5px 10px; font-size: .875rem; font-weight: 700; }
.demo { background: #dce9dd; color: #204538; }
.status { background: #f7eccc; color: #623f0f; white-space: nowrap; }
.status.good { background: #e4f2df; color: #265137; }
.section-heading { margin: 29px 0 25px; }
h1 { font-size: clamp(2.1rem, 5.4vw, 3.45rem); line-height: 1.03; letter-spacing: -.055em; font-weight: 730; }
h2 { font-size: clamp(1.18rem, 2vw, 1.48rem); line-height: 1.2; letter-spacing: -.024em; }
.section-heading p, .action-card p, .empty p { margin-top: 9px; color: var(--muted); line-height: 1.55; }
.work-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(245px, 1fr); gap: 16px; align-items: start; }
.card {
  min-width: 0; padding: clamp(16px, 2.5vw, 27px); border: 1px solid var(--line); border-radius: 17px;
  background: var(--panel); box-shadow: 0 8px 30px #254a3310;
}
.card-heading { display: flex; flex-wrap: wrap; align-items: start; justify-content: space-between; gap: 10px; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.label, .sender { display: block; color: var(--muted); font-size: .875rem; font-weight: 650; margin-bottom: 5px; }
.thread { display: flex; flex-direction: column; gap: 12px; margin-top: 17px; }
.message { align-self: flex-start; max-width: 93%; padding: 11px 14px; background: #f1f4f1; border-radius: 3px 12px 12px; }
.message.accent { align-self: flex-end; background: var(--soft); border-radius: 12px 3px 12px 12px; }
.message p { line-height: 1.5; }
.action-card form { display: grid; gap: 13px; margin-top: 17px; }
label { display: grid; gap: 5px; font-size: .9rem; font-weight: 650; }
input, select { color: var(--ink); background: #fff; border: 1px solid #bacbbf; border-radius: 9px; padding: 9px 10px; width: 100%; min-height: 44px; }
select { appearance: none; padding-right: 32px; background: conic-gradient(from 45deg at 50% 20%, transparent 0deg 90deg, #365247 90deg 180deg, transparent 180deg) right 13px center / 11px 10px no-repeat white; }
.primary, .secondary { min-height: 44px; display: inline-block; border: 1px solid transparent; border-radius: 10px; font-weight: 690; padding: 9px 14px; }
.primary { background: var(--primary); color: white; }
.primary:hover { background: var(--primary-hover); }
.secondary { background: #fff; border-color: #bacbbf; color: var(--ink); }
.secondary:hover { background: var(--soft); }
.action-card > button, .empty > button { margin-top: 17px; }
.details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 10px; margin: 19px 0; }
.details dt, .total span, .document-note { color: var(--muted); font-size: .875rem; }
.details dd { font-weight: 680; margin-top: 2px; }
.details dd small { display: block; color: var(--muted); font-size: .82rem; font-weight: 500; }
.quantity { display: flex; flex-wrap: wrap; gap: 13px; justify-content: space-between; align-items: end; padding: 13px; border-radius: 10px; background: var(--soft); }
.quantity label { width: 108px; }
.total { display: grid; text-align: right; }
.total strong { font-size: clamp(1.4rem, 4vw, 2rem); letter-spacing: -.045em; }
.document-note { margin-top: 13px; line-height: 1.45; }
.access-steps { padding-left: 22px; line-height: 1.55; margin: 13px 0 0; }
.access-steps li + li { margin-top: 9px; }
.access-details { grid-template-columns: minmax(0, 1fr); }
.sr-only { position: absolute; overflow: hidden; clip-path: inset(50%); width: 1px; height: 1px; }
@media (max-width: 940px) { .work-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 680px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { gap: 12px; padding: 13px 16px; }
  .company { display: none; }
  nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  nav button { padding-inline: 7px; justify-content: center; font-size: .88rem; }
  .restart { align-self: start; min-height: 40px; padding-block: 6px; font-size: .88rem; }
  .top { padding-bottom: 13px; }
  .section-heading { margin: 19px 0 16px; }
}
@media print {
  body { background: #fff; }
  .sidebar, .top, .section-heading, .action-card { display: none !important; }
  .shell, .main, .work-grid { display: block; padding: 0; }
  .document { box-shadow: none; }
}

.chat-card { display: grid; gap: 14px; }
.chat-log { margin-top: 0; max-height: min(46vh, 460px); min-height: 105px; overflow-y: auto; }
.chat-log .message { white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-log .message.visitor { align-self: flex-end; background: #e5eee8; border-radius: 12px 3px 12px 12px; }
.chat-log .message.assistant { align-self: flex-start; background: var(--soft); border-radius: 3px 12px 12px; }
.compose { display: grid; gap: 6px; padding-top: 14px; border-top: 1px solid var(--line); }
textarea { width: 100%; resize: vertical; padding: 10px; border: 1px solid #bacbbf; border-radius: 10px; background: white; color: var(--ink); font: inherit; }
textarea:focus-visible { outline: 3px solid #759f3c; outline-offset: 2px; }
.compose-actions, .document-actions, .examples { display: flex; flex-wrap: wrap; gap: 7px 10px; align-items: center; }
.compose-actions { justify-content: space-between; }
.compose-actions span, .muted { color: var(--muted); font-size: .875rem; }
.examples button { padding-inline: 10px; font-size: .88rem; }
.document-actions { margin-top: 12px; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.error { background: #fff0e8; color: #7c331f; border-radius: 8px; padding: 9px 11px; }
#doc-customer, #doc-item { overflow-wrap: anywhere; }
@media (min-width: 941px) {
  .work-grid { grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); }
}
@media print {
  .chat-card, .document-actions, #document-feedback { display: none !important; }
  #financial { display: block; }
}
