    :root {
      --bg: #f7f7f8;
      --panel: #ffffff;
      --panel-2: #f3f4f6;
      --ink: #1f2328;
      --muted: #667085;
      --line: #e5e7eb;
      --accent: #1f7a5a;
      --accent-strong: #166046;
      --shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
    }
    * { box-sizing: border-box; }
    body {
      margin: 0;
      font-family: "IBM Plex Sans", "Noto Sans SC", "PingFang SC", sans-serif;
      color: var(--ink);
      background: var(--bg);
      min-height: 100vh;
    }
    .app {
      min-height: 100vh;
      display: grid;
      grid-template-rows: auto 1fr auto;
    }
    .topbar {
      position: sticky;
      top: 0;
      z-index: 20;
      background: rgba(247, 247, 248, 0.92);
      backdrop-filter: blur(10px);
      border-bottom: 1px solid var(--line);
    }
    .topbar-inner {
      max-width: 920px;
      margin: 0 auto;
      padding: 14px 18px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
    }
    .topbar-actions {
      display: flex;
      align-items: center;
      gap: 12px;
    }
    .brand {
      display: flex;
      align-items: center;
      gap: 12px;
      min-width: 0;
    }
    .brand-mark {
      width: 36px;
      height: 36px;
      border-radius: 12px;
      display: grid;
      place-items: center;
      background: linear-gradient(135deg, var(--accent), var(--accent-strong));
      color: white;
      font-weight: 700;
      box-shadow: var(--shadow);
    }
    .brand-text {
      min-width: 0;
    }
    .brand-title {
      font-size: 15px;
      font-weight: 700;
    }
    .brand-subtitle {
      font-size: 12px;
      color: var(--muted);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .ghost-btn, .send-btn {
      border: 0;
      border-radius: 14px;
      padding: 10px 14px;
      font: inherit;
      font-weight: 600;
      cursor: pointer;
    }
    .ghost-btn {
      color: var(--ink);
      background: white;
      border: 1px solid var(--line);
    }
    .send-btn {
      color: white;
      background: linear-gradient(135deg, var(--accent), var(--accent-strong));
      box-shadow: 0 10px 24px rgba(31, 122, 90, 0.18);
    }
    .account-summary {
      display: grid;
      gap: 2px;
      min-width: 0;
      text-align: right;
      padding: 8px 12px;
      border: 1px solid var(--line);
      border-radius: 14px;
      background: rgba(255, 255, 255, 0.88);
    }
    .account-plan {
      font-size: 12px;
      font-weight: 700;
      color: var(--accent-strong);
      letter-spacing: 0.03em;
      text-transform: uppercase;
    }
    .account-usage {
      font-size: 11px;
      color: var(--muted);
      white-space: nowrap;
    }
    .ghost-btn:disabled, .send-btn:disabled {
      cursor: wait;
      opacity: 0.68;
    }
    .thread-shell {
      width: 100%;
    }
    .thread {
      max-width: 920px;
      margin: 0 auto;
      padding: 18px 18px 160px;
      display: grid;
      gap: 18px;
    }
    .welcome {
      min-height: calc(100vh - 240px);
      display: grid;
      gap: 20px;
      align-content: start;
      padding: 28px 0 10px;
    }
    .welcome-hero {
      position: relative;
      overflow: hidden;
      border: 1px solid rgba(31, 122, 90, 0.16);
      border-radius: 28px;
      background:
        radial-gradient(circle at top left, rgba(31, 122, 90, 0.18), transparent 32%),
        radial-gradient(circle at bottom right, rgba(22, 96, 70, 0.14), transparent 28%),
        linear-gradient(135deg, #ffffff, #f7fbf9 58%, #f0f6f3);
      box-shadow: 0 20px 48px rgba(15, 23, 42, 0.08);
      padding: 26px 24px 22px;
      text-align: left;
    }
    .welcome-kicker {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 6px 10px;
      border-radius: 999px;
      background: rgba(15, 23, 42, 0.04);
      color: var(--accent-strong);
      font-size: 12px;
      font-weight: 700;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      margin-bottom: 16px;
    }
    .welcome-card {
      max-width: 700px;
    }
    .welcome-title {
      margin: 0 0 12px;
      font-size: clamp(30px, 4.4vw, 48px);
      line-height: 1.02;
      font-weight: 780;
      letter-spacing: -0.04em;
      text-wrap: balance;
    }
    .welcome-subtitle {
      margin: 0;
      color: var(--muted);
      line-height: 1.82;
      font-size: 15px;
      max-width: 62ch;
    }
    .welcome-badges {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      margin-top: 18px;
    }
    .welcome-badge {
      display: inline-flex;
      align-items: center;
      border-radius: 999px;
      padding: 7px 11px;
      background: rgba(255, 255, 255, 0.86);
      border: 1px solid rgba(31, 122, 90, 0.12);
      color: #183a2f;
      font-size: 12px;
      font-weight: 700;
      box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
    }
    .welcome-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 14px;
    }
    .feature-card {
      text-align: left;
      width: 100%;
      border: 1px solid var(--line);
      border-radius: 22px;
      padding: 18px 18px 16px;
      background: linear-gradient(180deg, #ffffff, #fafbfb);
      cursor: pointer;
      box-shadow: var(--shadow);
      transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
    }
    .feature-card:hover {
      transform: translateY(-2px);
      border-color: rgba(31, 122, 90, 0.26);
      box-shadow: 0 18px 32px rgba(15, 23, 42, 0.08);
    }
    .feature-card-accent {
      background: linear-gradient(180deg, #f8fcfa, #eef7f2);
      border-color: rgba(31, 122, 90, 0.22);
    }
    .feature-title {
      font-size: 15px;
      font-weight: 780;
      color: #102018;
      margin-bottom: 8px;
    }
    .feature-body {
      color: var(--muted);
      font-size: 13px;
      line-height: 1.72;
    }
    .welcome-suggestions {
      border: 1px solid var(--line);
      border-radius: 22px;
      background: rgba(255, 255, 255, 0.8);
      padding: 16px 16px 14px;
    }
    .welcome-section-title {
      font-size: 13px;
      font-weight: 780;
      color: #123b2d;
      margin-bottom: 12px;
      letter-spacing: 0.02em;
    }
    .prompt-chip-row {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
    }
    .prompt-chip {
      border: 1px solid rgba(31, 122, 90, 0.14);
      background: #ffffff;
      color: #1f2328;
      border-radius: 16px;
      padding: 10px 12px;
      font: inherit;
      font-size: 13px;
      line-height: 1.45;
      cursor: pointer;
      text-align: left;
      box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
      transition: border-color 140ms ease, transform 140ms ease;
    }
    .prompt-chip:hover {
      transform: translateY(-1px);
      border-color: rgba(31, 122, 90, 0.26);
    }
    .welcome-footnote {
      padding: 0 4px;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.75;
    }
    .case-divider {
      display: flex;
      align-items: center;
      gap: 12px;
      color: var(--muted);
      font-size: 12px;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      margin: 6px 0 2px;
    }
    .case-divider::before,
    .case-divider::after {
      content: "";
      height: 1px;
      flex: 1;
      background: var(--line);
    }
    .message-row {
      display: flex;
      gap: 14px;
      align-items: flex-start;
    }
    .message-row.user {
      justify-content: flex-end;
    }
    .avatar {
      flex: 0 0 34px;
      width: 34px;
      height: 34px;
      border-radius: 10px;
      display: grid;
      place-items: center;
      font-size: 13px;
      font-weight: 700;
      color: white;
      background: linear-gradient(135deg, var(--accent), var(--accent-strong));
      box-shadow: var(--shadow);
    }
    .user .avatar {
      background: linear-gradient(135deg, #0f172a, #334155);
      order: 2;
    }
    .bubble {
      max-width: min(760px, calc(100vw - 96px));
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 20px;
      padding: 16px 18px;
      line-height: 1.8;
      white-space: pre-wrap;
      box-shadow: var(--shadow);
    }
    .user .bubble {
      background: #ffffff;
      border-bottom-right-radius: 8px;
    }
    .assistant .bubble {
      border-bottom-left-radius: 8px;
      background: #fcfcfd;
    }
    .bubble-rich {
      display: grid;
      gap: 8px;
    }
    .answer-line {
      white-space: pre-wrap;
      word-break: break-word;
    }
    .answer-line-core {
      font-size: 16px;
      line-height: 1.95;
    }
    .answer-line-main-formula {
      display: grid;
      gap: 6px;
      padding: 10px 12px;
      border-radius: 14px;
      background: linear-gradient(180deg, rgba(31, 122, 90, 0.12), rgba(31, 122, 90, 0.04));
      border: 1px solid rgba(31, 122, 90, 0.16);
    }
    .answer-formula-label {
      display: inline-block;
      color: #475467;
      font-weight: 700;
      letter-spacing: 0.02em;
    }
    .answer-formula-label-main {
      color: var(--accent-strong);
      font-size: 13px;
    }
    .answer-formula-name {
      display: inline-block;
      padding: 2px 10px;
      border-radius: 999px;
      background: rgba(31, 122, 90, 0.14);
      color: #0f5137;
      font-weight: 850;
      font-size: 16px;
      letter-spacing: 0.01em;
    }
    .answer-formula-name-main {
      display: block;
      width: fit-content;
      max-width: 100%;
      padding: 6px 14px;
      font-size: 20px;
      line-height: 1.5;
      border-radius: 14px;
      background: rgba(31, 122, 90, 0.18);
      box-shadow: inset 0 0 0 1px rgba(31, 122, 90, 0.12);
    }
    .answer-herb-dose {
      color: #0f5137;
      font-weight: 800;
    }
    .answer-section-label {
      display: inline-block;
      padding: 1px 7px;
      margin: 0 2px;
      border-radius: 8px;
      background: rgba(15, 23, 42, 0.08);
      color: #0f172a;
      font-weight: 800;
    }
    .answer-line-subitem {
      color: #1f2937;
      padding-left: 4px;
      line-height: 1.85;
    }
    .answer-subitem-number {
      color: #667085;
      font-weight: 600;
    }
    .answer-line-heading {
      display: flex;
      align-items: baseline;
      gap: 6px;
      padding: 6px 10px;
      border-left: 4px solid rgba(31, 122, 90, 0.9);
      border-radius: 10px;
      background: linear-gradient(90deg, rgba(31, 122, 90, 0.1), rgba(31, 122, 90, 0.02));
      color: #123b2d;
    }
    .answer-heading-number {
      font-weight: 800;
      color: var(--accent-strong);
      letter-spacing: 0.02em;
      flex: 0 0 auto;
    }
    .answer-heading-text {
      font-weight: 800;
      color: #0f172a;
    }
    .answer-spacer {
      height: 8px;
    }
    @media (max-width: 640px) {
      .bubble {
        max-width: calc(100vw - 44px);
        padding: 14px 14px;
      }
      .answer-line-main-formula {
        padding: 9px 10px;
      }
      .answer-formula-name-main {
        font-size: 18px;
      }
    }
    .message-stack {
      display: grid;
      gap: 10px;
      max-width: min(760px, calc(100vw - 96px));
    }
    .report-card {
      border: 1px solid var(--line);
      border-radius: 18px;
      background: linear-gradient(180deg, #ffffff 0%, #f8fbfa 100%);
      padding: 14px 16px;
      box-shadow: var(--shadow);
    }
    .report-card-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 10px;
    }
    .report-card-title {
      font-size: 14px;
      font-weight: 700;
    }
    .report-chip {
      display: inline-flex;
      align-items: center;
      border-radius: 999px;
      padding: 4px 9px;
      font-size: 12px;
      font-weight: 700;
      background: rgba(31, 122, 90, 0.12);
      color: var(--accent-strong);
    }
    .report-sections {
      display: grid;
      gap: 10px;
    }
    .report-section {
      border-top: 1px solid var(--line);
      padding-top: 10px;
    }
    .report-section:first-child {
      border-top: 0;
      padding-top: 0;
    }
    .report-section-title {
      font-size: 12px;
      font-weight: 700;
      letter-spacing: 0.04em;
      color: var(--muted);
      text-transform: uppercase;
      margin-bottom: 6px;
    }
    .report-list {
      margin: 0;
      padding-left: 18px;
      display: grid;
      gap: 4px;
      line-height: 1.65;
      font-size: 14px;
    }
    .report-empty {
      font-size: 14px;
      color: var(--muted);
      line-height: 1.6;
    }
    .lab-item-name {
      font-weight: 700;
    }
    .lab-flag-high {
      color: #b42318;
      font-weight: 700;
    }
    .lab-flag-low {
      color: #175cd3;
      font-weight: 700;
    }
    .lab-flag-positive {
      color: #b42318;
      font-weight: 700;
    }
    .status-line {
      max-width: 920px;
      margin: 0 auto;
      padding: 0 18px 10px;
      color: var(--muted);
      font-size: 13px;
    }
    .modal-shell[hidden] {
      display: none;
    }
    .modal-shell {
      position: fixed;
      inset: 0;
      z-index: 50;
      display: grid;
      place-items: center;
      padding: 18px;
    }
    .modal-backdrop {
      position: absolute;
      inset: 0;
      background: rgba(15, 23, 42, 0.45);
      backdrop-filter: blur(8px);
    }
    .modal-card {
      position: relative;
      width: min(920px, calc(100vw - 24px));
      max-height: min(82vh, 920px);
      overflow: auto;
      background: linear-gradient(180deg, #ffffff 0%, #f8fbfa 100%);
      border: 1px solid rgba(255, 255, 255, 0.58);
      border-radius: 28px;
      box-shadow: 0 30px 80px rgba(15, 23, 42, 0.22);
      padding: 22px;
    }
    .modal-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 16px;
      margin-bottom: 14px;
    }
    .modal-kicker {
      font-size: 11px;
      color: var(--accent-strong);
      letter-spacing: 0.16em;
      text-transform: uppercase;
      font-weight: 700;
      margin-bottom: 6px;
    }
    .modal-title {
      margin: 0;
      font-size: clamp(24px, 3vw, 32px);
      line-height: 1.1;
    }
    .modal-meta {
      color: var(--muted);
      font-size: 14px;
      line-height: 1.7;
      margin-bottom: 16px;
    }
    .membership-toolbar {
      display: flex;
      justify-content: flex-end;
      margin-bottom: 16px;
    }
    .auth-panel {
      border: 1px solid var(--line);
      border-radius: 22px;
      padding: 16px;
      background: rgba(255, 255, 255, 0.88);
      box-shadow: var(--shadow);
      margin-bottom: 16px;
      display: grid;
      gap: 12px;
    }
    .auth-head {
      display: grid;
      gap: 4px;
    }
    .auth-title {
      font-size: 15px;
      font-weight: 700;
    }
    .auth-subtitle {
      color: var(--muted);
      font-size: 13px;
      line-height: 1.6;
    }
    .auth-form {
      display: grid;
      grid-template-columns: minmax(0, 1.4fr) auto minmax(0, 1fr) auto;
      gap: 10px;
      align-items: center;
    }
    .auth-input {
      width: 100%;
      border: 1px solid var(--line);
      border-radius: 14px;
      padding: 11px 12px;
      font: inherit;
      color: var(--ink);
      background: white;
      outline: none;
    }
    .auth-input:focus {
      border-color: rgba(31, 122, 90, 0.35);
      box-shadow: 0 0 0 3px rgba(31, 122, 90, 0.12);
    }
    .auth-actions {
      display: flex;
      align-items: center;
    }
    .auth-dev-code {
      border-radius: 14px;
      padding: 10px 12px;
      background: rgba(31, 122, 90, 0.08);
      color: var(--accent-strong);
      font-size: 13px;
      line-height: 1.6;
    }
    .plan-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 14px;
    }
    .plan-card {
      border: 1px solid var(--line);
      border-radius: 22px;
      padding: 18px;
      background: rgba(255, 255, 255, 0.92);
      box-shadow: var(--shadow);
      display: grid;
      gap: 14px;
      align-content: start;
    }
    .plan-card.active {
      border-color: rgba(31, 122, 90, 0.32);
      box-shadow: 0 18px 42px rgba(31, 122, 90, 0.14);
      background: linear-gradient(180deg, #ffffff 0%, #eef8f4 100%);
    }
    .plan-card-header {
      display: grid;
      gap: 6px;
    }
    .plan-badge {
      display: inline-flex;
      width: fit-content;
      border-radius: 999px;
      padding: 5px 9px;
      font-size: 11px;
      font-weight: 700;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      background: rgba(31, 122, 90, 0.12);
      color: var(--accent-strong);
    }
    .plan-name {
      font-size: 20px;
      font-weight: 700;
    }
    .plan-note {
      color: var(--muted);
      font-size: 13px;
      line-height: 1.6;
    }
    .plan-feature-list {
      margin: 0;
      padding-left: 18px;
      display: grid;
      gap: 6px;
      line-height: 1.6;
      font-size: 14px;
    }
    .plan-product-list {
      display: grid;
      gap: 8px;
      border-top: 1px solid var(--line);
      padding-top: 12px;
    }
    .plan-product-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 10px 12px;
      border-radius: 16px;
      background: rgba(247, 247, 248, 0.9);
      border: 1px solid rgba(15, 23, 42, 0.05);
    }
    .plan-product-copy {
      display: grid;
      gap: 2px;
    }
    .plan-product-actions {
      display: flex;
      flex-wrap: wrap;
      justify-content: flex-end;
      gap: 8px;
    }
    .plan-product-name {
      font-size: 13px;
      font-weight: 700;
    }
    .plan-product-note {
      font-size: 12px;
      color: var(--muted);
    }
    .plan-product-btn {
      border: 1px solid rgba(31, 122, 90, 0.18);
      border-radius: 12px;
      padding: 8px 12px;
      font: inherit;
      font-size: 12px;
      font-weight: 700;
      color: var(--accent-strong);
      background: rgba(31, 122, 90, 0.08);
      cursor: pointer;
      white-space: nowrap;
    }
    .plan-product-btn:disabled {
      opacity: 0.62;
      cursor: default;
    }
    .plan-actions {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      margin-top: auto;
    }
    .plan-status {
      font-size: 12px;
      color: var(--muted);
    }
    .plan-select-btn {
      border: 0;
      border-radius: 14px;
      padding: 10px 14px;
      font: inherit;
      font-size: 13px;
      font-weight: 700;
      color: white;
      background: linear-gradient(135deg, var(--accent), var(--accent-strong));
      cursor: pointer;
    }
    .plan-select-btn[disabled] {
      opacity: 0.62;
      cursor: default;
    }
    .composer-wrap {
      position: sticky;
      bottom: 0;
      z-index: 20;
      background: linear-gradient(180deg, rgba(247,247,248,0) 0%, rgba(247,247,248,0.94) 22%, rgba(247,247,248,1) 100%);
      padding: 0 12px 18px;
    }
    .composer {
      max-width: 920px;
      margin: 0 auto;
      background: white;
      border: 1px solid var(--line);
      border-radius: 24px;
      box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
      padding: 12px;
    }
    .composer-textarea {
      width: 100%;
      border: 0;
      resize: none;
      min-height: 56px;
      max-height: 220px;
      padding: 10px 12px 8px;
      font: inherit;
      color: var(--ink);
      background: transparent;
      outline: none;
      line-height: 1.7;
    }
    .composer-actions {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 6px 6px 2px;
    }
    .composer-right {
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .upload-btn {
      border: 1px solid var(--line);
      background: white;
      color: var(--ink);
      border-radius: 14px;
      padding: 10px 12px;
      font: inherit;
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
    }
    .upload-btn[hidden] {
      display: none;
    }
    .composer-tip {
      color: var(--muted);
      font-size: 12px;
    }
    @media (max-width: 880px) {
      .topbar-inner, .thread, .status-line {
        padding-left: 12px;
        padding-right: 12px;
      }
      .welcome-grid {
        grid-template-columns: 1fr;
      }
      .composer-wrap {
        padding: 0 8px 12px;
      }
      .bubble {
        max-width: calc(100vw - 74px);
      }
      .brand-subtitle, .composer-tip {
        display: none;
      }
      .account-summary {
        display: none;
      }
      .welcome-hero {
        padding: 20px 18px 18px;
        border-radius: 24px;
      }
      .welcome-title {
        font-size: 30px;
      }
      .welcome-badges,
      .prompt-chip-row {
        gap: 8px;
      }
      .prompt-chip {
        width: 100%;
      }
      .plan-grid {
        grid-template-columns: 1fr;
      }
      .modal-card {
        padding: 18px;
      }
      .auth-form {
        grid-template-columns: 1fr;
      }
    }
  
