:root {
  font: 15px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #22312e; background: #f5f7f8; --green: #147d69; --line: #e3e9e7; --muted: #697873;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: 1px solid var(--line); background: white; color: #40564c; padding: 9px 15px; border-radius: 9px; min-height: 42px; line-height: 1.5; transition: background .15s, border-color .15s, color .15s, box-shadow .15s; }
button:hover { background: #f0f6f3; border-color: #bdd5c9; color: #126a56; }
button.primary { background: var(--green); border-color: var(--green); color: white; font-weight: 600; }
button.primary:hover { background: #106b59; border-color: #106b59; box-shadow: 0 3px 10px #147d6920; }
button.danger { color: #af413a; background: #fff6f4; border-color: #f1d4cf; }
button:disabled { opacity: .55; cursor: default; box-shadow: none; }
input, select, textarea { display: block; width: 100%; padding: 11px 13px; min-height: 46px; border: 1px solid #d5dfda; border-radius: 9px; background: white; color: #22312e; transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover, textarea:hover { border-color: #acbfb5; }
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px #147d6912; outline: none; }
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; display: inline-block; margin: 2px 0 0; accent-color: var(--green); }
textarea { resize: vertical; min-height: 120px; line-height: 1.7; }
label { display: block; font-size: 13px; font-weight: 500; color: #475c51; margin: 17px 0 7px; }
form > div:first-child > label { margin-top: 0; }
form > div:has(> input[type=checkbox]) { display: flex; align-items: flex-start; flex-direction: row-reverse; justify-content: flex-end; gap: 9px; margin-top: 18px; }
form > div:has(> input[type=checkbox]) label { margin: 0; font-weight: 400; }
a { color: var(--green); text-underline-offset: 3px; }
.policy-link { display: inline-flex; align-items: center; min-height: 42px; padding: 9px 15px; border: 1px solid var(--line); border-radius: 9px; background: white; text-decoration: none; line-height: 1.5; }
.policy-link:hover { background: #f0f6f3; border-color: #bdd5c9; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3, h4 { color: #213b30; line-height: 1.4; font-weight: 650; }
h1 { font-size: 28px; letter-spacing: -.5px; margin-bottom: 8px; }
h2 { font-size: 25px; letter-spacing: -.4px; margin-bottom: 12px; }
h3 { font-size: 16px; margin-bottom: 19px; }
h4 { font-size: 15px; }
p { margin-bottom: 12px; }
.muted, .fieldhelp { color: var(--muted); font-size: 13px; }
.error { color: #ad3d35; white-space: pre-wrap; overflow-wrap: anywhere; }
.error:empty { display: none; }
.success { color: #0c7656; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > * { min-width: 0; }
.spread { justify-content: space-between; }
.stack > * + * { margin-top: 14px; }
.card { background: white; border: 1px solid var(--line); padding: 25px 27px; border-radius: 14px; margin-bottom: 20px; min-width: 0; box-shadow: 0 3px 14px #273c3103; }
.card > form { max-width: 720px; }
.badge { font-size: 12px; padding: 5px 10px; border: 1px solid #e0ebe4; border-radius: 7px; background: #f1f7f3; color: #54806a; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 21px; font-weight: 750; letter-spacing: -.3px; color: #235e49; }
.logo::before { content: ""; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 10px; background: #147d69 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m13 3-8 11h6l-1 7 9-12h-6z'/%3E%3C/svg%3E") center/22px no-repeat; }
.auth { width: calc(100% - 48px); max-width: 1000px; margin: clamp(28px, 8vh, 84px) auto; display: grid; grid-template-columns: 1.04fr 1fr; border: 1px solid #dee8e1; border-radius: 22px; overflow: hidden; box-shadow: 0 20px 65px #233d3110; }
.brand-panel { background: radial-gradient(ellipse at 0 0, #dcefe1, transparent 75%), linear-gradient(145deg, #edf5eb, #e6f0ea); color: #456655; padding: 40px; min-height: 580px; display: flex; flex-direction: column; position: relative; isolation: isolate; }
.brand-panel::after { content: ""; position: absolute; z-index: -1; inset: 0; opacity: .24; background-image: linear-gradient(#c8dacb 1px, transparent 1px), linear-gradient(90deg, #c8dacb 1px, transparent 1px); background-size: 52px 52px; mask-image: linear-gradient(transparent, black); }
.brand-panel .logo { font-size: 19px; }
.brand-eyebrow { color: #627e6b; font-size: 12px; letter-spacing: 3px; margin: 48px 0 12px; }
.brand-panel h1 { font-size: 38px; line-height: 1.45; letter-spacing: -1.2px; white-space: pre-line; margin: 0 0 16px; color: #235440; }
.brand-description { font-size: 13px; color: #688171; margin-bottom: 24px; }
.brand-capabilities { display: grid; gap: 10px; margin-bottom: 24px; }
.brand-capability { display: flex; flex-direction: column; padding-left: 12px; border-left: 2px solid #9bbea6; gap: 2px; }
.brand-capability strong { font-size: 13px; font-weight: 600; color: #3d624b; }
.brand-capability span { font-size: 12px; color: #718477; }
.brand-company { margin: auto 0 0; padding-top: 20px; font-size: 12px; color: #73877a; }
.auth-form { background: white; padding: 44px; display: flex; flex-direction: column; justify-content: center; }
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 10px; background: #f3f6f4; margin-bottom: 28px; }
.tabs button { flex: 1; border: 0; background: transparent; color: #7a8780; font-size: 13px; min-height: 38px; padding: 8px 12px; border-radius: 7px; }
.tabs .active { background: white; color: #176a50; font-weight: 600; box-shadow: 0 2px 6px #25442d0d; }
.auth-form h2 { font-size: 27px; margin-bottom: 6px; }
.auth-intro { color: #85918a; font-size: 13px; margin-bottom: 27px; }
.auth-form form { width: 100%; }
.auth-form .form-actions { margin-top: 25px; }
.auth-form .form-actions button { width: 100%; min-height: 46px; }
.auth-form > button { align-self: center; margin: 9px 0 18px; color: #6b8274; background: transparent; border: 0; padding: 6px 14px; min-height: 36px; font-size: 12px; }
.auth-form > .row { margin: 10px 0; }
.auth-form > .row:empty { display: none; }
.auth-form > .row button { padding: 4px 8px; min-height: 30px; font-size: 12px; border: 0; background: transparent; }
.auth-form > .muted { font-size: 11px; line-height: 1.8; margin: 0; border-top: 1px solid #edf1ee; padding-top: 17px; color: #85938a; }
.auth-form > .muted + .muted { padding-top: 6px; border: 0; }
.shell { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.sidebar { background: #fcfdfc; border-right: 1px solid var(--line); padding: 25px 17px 18px; position: sticky; top: 0; height: 100vh; height: 100dvh; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 10px 18px; border-bottom: 1px solid #e8eeea; margin-bottom: 8px; }
.brand-caption { font-size: 11px; color: #8a9890; margin: 6px 0 0 44px; letter-spacing: 1px; }
.menu-toggle { display: none; }
.nav { display: flex; flex-direction: column; gap: 5px; }
.nav button { display: block; width: 100%; text-align: left; border-color: transparent; background: transparent; padding: 11px 14px; color: #63776a; font-size: 13px; }
.nav button:hover { background: #f0f5f1; color: #256b4b; }
.nav button.active { background: #e8f2eb; color: #176d4d; font-weight: 650; border-color: #dcebe0; }
.shell[data-mode=chat] .nav > button:first-child { background: white; border: 1px solid #d3e3d8; color: #176b51; font-weight: 600; margin-bottom: 12px; }
.sidebar > button { text-align: left; border-color: transparent; background: transparent; color: #7b8b81; padding: 8px 12px; font-size: 12px; min-height: 36px; }
.sidebar > button:hover { background: #f0f5f1; color: #256b4b; }
.sidebar-foot { margin-top: auto; padding: 18px 4px 0; border-top: 1px solid #e7ede9; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sidebar-foot > p { grid-column: 1/-1; color: #607469; padding: 0 6px; margin: 0 0 3px; font-size: 12px; overflow-wrap: anywhere; }
.sidebar-foot button { font-size: 12px; min-height: 37px; padding: 7px 8px; background: #f6f9f7; border-color: #e6ede8; }
.sidebar-foot .workspace-switch { grid-column: 1/-1; background: white; }
.main { padding: 35px 42px; max-width: 1480px; width: 100%; margin: 0 auto; align-self: start; min-width: 0; }
.main > .muted { margin-bottom: 28px; }
.main > div > .row:first-child { margin-bottom: 18px; }
.toolbar { margin-bottom: 22px; padding-bottom: 19px; border-bottom: 1px solid var(--line); gap: 10px; }
.toolbar h2 { margin: 0; font-size: 26px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 25px; }
.stats .card { margin: 0; padding: 23px; }
.stats h3 { color: #7c8b82; font-size: 12px; margin-bottom: 14px; font-weight: 500; }
.stats strong { font-size: 34px; line-height: 1.2; color: #234936; display: block; font-weight: 650; font-variant-numeric: tabular-nums; }
.table-wrap { overflow: auto; background: white; border: 1px solid var(--line); border-radius: 12px; scrollbar-width: thin; }
.table { border-collapse: collapse; width: 100%; font-size: 13px; }
.table th, .table td { text-align: left; padding: 16px 18px; border-bottom: 1px solid #edf1ee; vertical-align: middle; }
.table th { color: #74857b; background: #f9fbfa; font-weight: 500; white-space: nowrap; font-size: 12px; }
.table td { max-width: 380px; overflow-wrap: anywhere; min-width: 90px; color: #4f6659; }
.table td:first-child { color: #2d4c3c; min-width: 170px; }
.table td:last-child { min-width: 150px; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafcfb; }
.table .row { gap: 6px; }
.table button { padding: 6px 10px; min-height: 34px; font-size: 12px; white-space: nowrap; }
.fieldhelp { font-size: 12px; margin: 5px 0 0; color: #87958b; }
.wide { grid-column: 1/-1; }
.content { max-width: 900px; margin: auto; }
.shell[data-mode=chat] .content { min-height: calc(100dvh - 70px); display: flex; flex-direction: column; }
.bubble { padding: 23px 26px; border: 1px solid var(--line); border-radius: 14px; background: white; margin: 18px 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.85; }
.bubble.user { background: #e8f1eb; border-color: #dce9e0; margin-left: 70px; color: #335c46; }
.answer-label { font-size: 12px; color: #258361; margin-bottom: 15px; font-weight: 650; }
.bubble > button:last-child { font-size: 12px; min-height: 32px; padding: 5px 10px; color: #7b8e81; margin-top: 18px; }
.business-result { white-space: normal; background: #f3f8f5; border: 1px solid #e0eae3; padding: 17px; border-radius: 10px; margin-top: 16px; font-size: 13px; }
.business-result p { margin: 7px 0; }
.composer { position: relative; bottom: auto; background: #fff; padding: 20px; border: 1px solid #dae5de; border-radius: 15px; box-shadow: 0 6px 25px #2d4b3b08; margin-top: auto; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px; align-items: end; }
.composer > div:first-child { grid-column: 1; }
.composer > div:first-child label { margin-top: 0; font-size: 11px; color: #809185; }
.composer > div:first-child select { min-height: 38px; padding: 7px 10px; font-size: 12px; background: #fafcfa; }
.composer > p:nth-child(2) { grid-column: 1/-1; grid-row: 2; font-size: 11px; margin: 6px 0 14px; }
.composer > button[type=button] { grid-column: 2; grid-row: 1; font-size: 11px; padding: 7px 10px; min-height: 38px; }
.composer > div:has(textarea) { grid-column: 1/-1; }
.composer > div:has(textarea) label { margin-top: 0; font-size: 12px; }
.composer textarea { min-height: 100px; border: 0; padding: 5px 0; box-shadow: none; background: white; }
.composer > p[role=status] { margin: 10px 0 0; font-size: 12px; padding-right: 8px; overflow-wrap: anywhere; }
.composer > button[type=submit] { justify-self: end; min-width: 84px; margin-top: 12px; }
.conversation { width: 100%; text-align: left; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; font-size: 13px; }
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #244f3a; color: white; padding: 12px 20px; border-radius: 10px; z-index: 100; max-width: 90vw; box-shadow: 0 5px 20px #213e3322; font-size: 13px; }
dialog { border: 1px solid var(--line); border-radius: 16px; padding: 28px; width: min(700px, 94vw); max-height: 85vh; overflow: auto; color: #22312e; box-shadow: 0 25px 90px #17332524; }
dialog::backdrop { background: #233b2e66; backdrop-filter: blur(3px); }
#dialog-close { margin-top: 22px; }
pre { white-space: pre-wrap; font: inherit; overflow-wrap: anywhere; }
.loading { padding: 60px; text-align: center; color: var(--muted); }
details { margin: 15px 0; }
summary { cursor: pointer; color: var(--green); font-size: 13px; }
:focus-visible { outline: 3px solid #63aa8f; outline-offset: 3px; }
.empty { padding: 36px; text-align: center; color: #8b9a90; font-size: 13px; }
.section-note { border-left: 3px solid #a3c3ae; padding: 12px 15px; background: #f3f7f3; border-radius: 0 7px 7px 0; font-size: 13px; line-height: 1.8; margin: 17px 0; color: #697f6f; }
.form-actions { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.hidden { display: none !important; }
@media (max-width: 1100px) {
  .main { padding: 28px; }
  .brand-panel { padding: 34px; }
  .brand-panel h1 { font-size: 34px; }
  .auth-form { padding: 35px; }
  .stats { gap: 12px; }
}
@media (max-width: 900px) {
  .auth { max-width: 460px; grid-template-columns: 1fr; width: calc(100% - 40px); margin: 28px auto; border-radius: 18px; }
  .brand-panel { min-height: 0; padding: 24px 28px; }
  .brand-panel .logo { font-size: 16px; gap: 8px; }
  .brand-panel .logo::before { width: 28px; height: 28px; flex-basis: 28px; border-radius: 8px; background-size: 19px; }
  .brand-eyebrow { margin: 20px 0 6px; font-size: 10px; letter-spacing: 2px; }
  .brand-panel h1 { font-size: 27px; line-height: 1.5; letter-spacing: -.5px; margin-bottom: 8px; white-space: pre-line; }
  .brand-description { margin: 0; font-size: 11px; }
  .brand-capabilities, .brand-company { display: none; }
  .auth-form { padding: 28px; }
  .auth-form h2 { font-size: 24px; }
  .auth-intro { margin-bottom: 22px; font-size: 12px; }
  .tabs { margin-bottom: 24px; }
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .sidebar { height: auto; position: sticky; top: 0; z-index: 20; padding: 0 18px; border-right: 0; border-bottom: 1px solid var(--line); background: #fcfdfcf5; backdrop-filter: blur(12px); gap: 0; overflow: auto; max-height: 85vh; max-height: 85dvh; }
  .sidebar-head { padding: 12px 0; margin: 0; border: 0; min-height: 70px; }
  .sidebar-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
  .sidebar .logo { font-size: 19px; gap: 8px; }
  .sidebar .logo::before { width: 30px; height: 30px; flex-basis: 30px; border-radius: 8px; background-size: 20px; }
  .brand-caption { margin: 0; letter-spacing: 0; padding-left: 12px; border-left: 1px solid #dce5df; font-size: 11px; }
  .menu-toggle { display: block; min-height: 36px; font-size: 12px; padding: 7px 12px; background: white; }
  .sidebar > .nav, .sidebar > button, .sidebar > .sidebar-foot { display: none; }
  .nav-open .sidebar > .nav { display: flex; padding: 10px 0; border-top: 1px solid var(--line); max-height: 40vh; overflow: auto; }
  .nav-open .sidebar > button { display: block; margin: 3px 0; }
  .nav-open .sidebar > .sidebar-foot { display: grid; margin-top: 12px; padding: 14px 0 18px; }
  .main { padding: 27px 22px; }
  .grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .main h1 { font-size: 24px; }
  .main > .muted { margin-bottom: 22px; font-size: 12px; }
  .card { padding: 22px; }
  .shell[data-mode=chat] .content { min-height: calc(100dvh - 124px); }
  .toolbar h2 { font-size: 24px; }
  .bubble { padding: 18px; }
  .bubble.user { margin-left: 35px; }
}
@media (max-width: 480px) {
  input, select, textarea { font-size: 16px; }
  .auth { width: calc(100% - 28px); margin: 18px auto; }
  .brand-panel { padding: 22px 24px; }
  .brand-panel h1 { font-size: 25px; }
  .auth-form { padding: 25px 24px 28px; }
  .auth-form label { font-size: 12px; }
  .auth-form .form-actions { margin-top: 22px; }
  .sidebar { padding: 0 16px; }
  .sidebar-brand { gap: 10px; }
  .brand-caption { padding-left: 10px; font-size: 10px; }
  .main { padding: 23px 16px; }
  .card { padding: 20px; border-radius: 12px; }
  .stats .card { padding: 20px; }
  .stats strong { font-size: 30px; }
  .table th, .table td { padding: 13px 14px; }
  .toolbar { margin-bottom: 18px; padding-bottom: 17px; }
  .toolbar h2 { font-size: 23px; }
  .toolbar .badge { font-size: 10px; }
  .composer { padding: 16px; bottom: auto; border-radius: 12px; }
  .composer > div:first-child select { font-size: 16px; }
  .composer > button[type=button] { max-width: 70px; font-size: 10px; padding: 6px; }
  .composer > p[role=status] { font-size: 11px; }
  dialog { padding: 22px; border-radius: 13px; }
  #toast { bottom: 16px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
.field-error { margin: 7px 0 0; color: #b9362e; font-size: 13px; line-height: 1.6; }
input[aria-invalid=true], select[aria-invalid=true], textarea[aria-invalid=true] { border-color: #b9362e; }
input[readonly] { background: #f1f5f3; color: #52685e; }
.verification-row { display: grid; grid-template-columns: minmax(0, 1fr) 124px; gap: 10px; align-items: stretch; }
.verification-row input { min-width: 0; height: 48px; font-size: 16px; }
.verification-row .verification-send { height: 48px; padding: 0 12px; border-radius: 9px; border-color: #c5dfd5; background: #eaf5ef; color: #176a50; font-size: 14px; font-weight: 600; white-space: nowrap; }
.verification-row .verification-send:hover:not(:disabled) { background: #dceee4; border-color: #97c7b2; color: #10563f; }
.verification-row .verification-send:focus-visible { outline: 2px solid #147d69; outline-offset: 3px; }
.verification-row .verification-send:disabled { opacity: 1; background: #f2f5f3; border-color: #e1e8e4; color: #75847c; cursor: not-allowed; }
@media (max-width: 380px) {
  .verification-row { grid-template-columns: minmax(0, 1fr) 112px; gap: 8px; }
  .verification-row input { padding-inline: 10px; }
  .verification-row .verification-send { padding-inline: 8px; font-size: 13px; }
}
