      :root {
        --accent: #1b5e3f;
        --accent-bright: #2e9e5f;
        --bg: #f5f7f5;
        --surface: #ffffff;
        --fill-soft: #f8faf8;
        --fill-chip: #f5f7f5;
        --fill-pill: #f3f5f3;
        --green-soft: #e6f4ec;
        --green-border: #c4e6d2;
        --green-rail: #d8ece0;
        --line: #e6e9e6;
        --line-soft: #eef1ee;
        --line-strong: #d6dbd7;
        --line-divider: #e1e5e1;
        --text-strong: #18211c;
        --text-body: #2a342e;
        --text-muted: #5d6862;
        --text-soft: #6b766f;
        --text-faint: #8a938d;
        --text-role: #6f9f85;
        --text-you: #4f8268;
        --text-section: #3a463f;
        --error: #c0392b;
        --error-fill: #fdeceb;
        --warn: #b9772a;
        --warn-fill: #fdf3e6;
        --neutral-fill: #f3f5f3;
      }

      * { box-sizing: border-box; }

      html, body {
        margin: 0;
        min-height: 100%;
      }

      body {
        min-height: 100vh;
        background:
          radial-gradient(circle at top left, rgba(27, 94, 63, 0.08), transparent 28%),
          linear-gradient(180deg, #f8faf8 0%, var(--bg) 100%);
        color: var(--text-strong);
        font-family: "Hanken Grotesk", system-ui, sans-serif;
        -webkit-font-smoothing: antialiased;
        font-variant-numeric: tabular-nums;
      }

      button, input, textarea, select {
        font: inherit;
      }

      button {
        cursor: pointer;
      }

      button:focus-visible,
      input:focus-visible,
      textarea:focus-visible,
      select:focus-visible {
        outline: 2px solid rgba(27, 94, 63, 0.2);
        outline-offset: 2px;
      }

      [hidden] {
        display: none !important;
      }

      .login-shell {
        min-height: 100vh;
        display: grid;
        place-items: center;
        padding: 28px;
      }

      .login-card {
        width: min(560px, 100%);
        max-width: 560px;
        background: rgba(255, 255, 255, 0.98);
        border: 1px solid rgba(230, 233, 230, 0.9);
        border-radius: 30px;
        box-shadow: 0 24px 60px rgba(20, 60, 40, 0.1);
        overflow: hidden;
      }

      .login-hero {
        padding: 46px 40px 8px;
        text-align: center;
        background: transparent;
      }

      .brand-row {
        display: block;
        margin-bottom: 22px;
      }

      .wordmark {
        display: inline-flex;
        align-items: center;
        font-size: 24px;
        font-weight: 800;
        letter-spacing: .11em;
        color: var(--accent);
      }

      .wordmark .mirror-e {
        display: inline-block;
        transform: scaleX(-1);
      }

      .login-kicker {
        display: none;
      }

      .login-title {
        margin: 0;
        font-size: 15px;
        line-height: 1.2;
        letter-spacing: -.01em;
        color: var(--text-section);
        font-weight: 600;
      }

      .login-copy {
        margin: 12px 0 0;
        color: #8a8f8b;
        font-size: 15px;
        line-height: 1.45;
      }

      .login-form {
        width: min(460px, 100%);
        margin: 0 auto;
        padding: 24px 40px 44px;
      }

      .field {
        display: grid;
        gap: 6px;
        margin-bottom: 20px;
      }

      .field label {
        font-size: 15px;
        font-weight: 700;
        color: #2b302d;
      }

      .field label .required {
        color: #db5b4c;
      }

      .field input {
        width: 100%;
        min-height: 64px;
        padding: 0 22px;
        border-radius: 20px;
        border: 1px solid #e8e0d5;
        background: #fff;
        color: var(--text-strong);
        font-size: 17px;
      }

      .field input::placeholder {
        color: #b8b8b4;
      }

      .primary-button,
      .send-button {
        border: none;
        color: #fff;
        background: var(--accent);
        transition: filter .18s ease, transform .18s ease;
      }

      .primary-button:hover,
      .send-button:hover {
        filter: brightness(.93);
      }

      .primary-button {
        width: 100%;
        min-height: 64px;
        margin-top: 4px;
        padding: 0 20px;
        border-radius: 20px;
        font-size: 18px;
        font-weight: 600;
        background: var(--accent);
        color: #ffffff;
      }

      .primary-button:disabled {
        background: #e9e2d9;
        color: rgba(255, 255, 255, 0.92);
        cursor: not-allowed;
        filter: none;
      }

      .primary-button:disabled:hover {
        filter: none;
      }

      .secondary-button {
        border: 1px solid var(--line-strong);
        background: #fff;
        color: var(--text-muted);
      }

      .login-error {
        min-height: 22px;
        margin-top: 16px;
        color: var(--error);
        font-size: 14px;
      }

      .login-help {
        margin-top: 22px;
        text-align: center;
      }

      .login-help a {
        color: #16704d;
        font-size: 16px;
        font-weight: 500;
        text-decoration: none;
      }

      .login-terms {
        margin: 26px 0 0;
        text-align: center;
        color: #b2b5b0;
        font-size: 14px;
      }

      .beta-badge {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        margin-left: 8px;
        padding: 3px 9px;
        border-radius: 999px;
        background: #e6f4ec;
        border: 1px solid var(--green-border);
        color: var(--accent);
        font-size: 11px;
        font-weight: 800;
        letter-spacing: .08em;
        text-transform: uppercase;
        vertical-align: middle;
      }

      .beta-badge::before {
        content: "✦";
        font-size: 10px;
      }

      .app-shell {
        min-height: 100vh;
      }

      .app-bar {
        position: sticky;
        top: 0;
        z-index: 40;
        height: 60px;
        display: flex;
        align-items: center;
        gap: 18px;
        padding: 0 24px;
        background: rgba(255, 255, 255, 0.96);
        border-bottom: 1px solid var(--line);
        backdrop-filter: blur(12px);
      }

      .bar-divider {
        width: 1px;
        height: 22px;
        background: var(--line);
      }

      .bar-label {
        font-size: 14px;
        font-weight: 600;
        color: var(--text-section);
      }

      .app-tabs {
        display: flex;
        align-items: center;
        gap: 4px;
      }

      .app-tab {
        padding: 6px 12px;
        border-radius: 999px;
        color: var(--text-muted);
        font-size: 14px;
        font-weight: 600;
        text-decoration: none;
      }

      .app-tab:hover {
        color: var(--text-strong);
      }

      .app-tab.active {
        border: 1px solid var(--line);
        background: white;
        color: var(--text-strong);
      }

      .group-pill {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 6px 11px;
        border-radius: 8px;
        border: 1px solid var(--green-border);
        background: var(--green-soft);
        color: var(--accent);
        font-size: 13px;
        font-weight: 600;
      }

      .group-pill::before {
        content: "";
        width: 6px;
        height: 6px;
        border-radius: 2px;
        background: var(--accent);
      }

      .group-pill .caret,
      .lang-switch {
        color: var(--text-role);
      }

      .bar-spacer {
        flex: 1;
      }

      .live-indicator {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        font-size: 12.5px;
        color: var(--text-soft);
      }

      .live-indicator::before {
        content: "";
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: var(--accent-bright);
        box-shadow: 0 0 0 3px rgba(46, 158, 95, 0.16);
      }

      .avatar {
        width: 32px;
        height: 32px;
        display: grid;
        place-items: center;
        border-radius: 999px;
        border: 1px solid var(--green-border);
        background: var(--green-soft);
        color: var(--accent);
        font-size: 12px;
        font-weight: 700;
      }

      .lang-switch {
        font-size: 12.5px;
      }

      .status-bar {
        position: sticky;
        top: 60px;
        z-index: 35;
        background: rgba(255, 255, 255, 0.97);
        border-bottom: 1px solid var(--line);
        box-shadow: 0 4px 14px -10px rgba(20, 60, 40, 0.25);
        backdrop-filter: blur(10px);
      }

      .status-inner,
      .conversation-main,
      .composer-inner {
        width: min(860px, calc(100vw - 48px));
        margin: 0 auto;
      }

      .status-inner {
        padding: 13px 0;
      }

      .status-head {
        display: flex;
        align-items: center;
        gap: 12px;
      }

      .spinner,
      .chip-spinner {
        display: inline-block;
        border-radius: 50%;
        animation: spin .7s linear infinite;
      }

      .spinner {
        width: 17px;
        height: 17px;
        border: 2px solid var(--green-border);
        border-top-color: var(--accent);
      }

      .chip-spinner {
        width: 13px;
        height: 13px;
        margin: 1px;
        border: 2px solid var(--green-border);
        border-top-color: var(--accent);
      }

      .status-action {
        font-size: 14.5px;
        font-weight: 600;
        color: var(--text-strong);
      }

      .status-timer,
      .chip-label,
      .usage-footer {
        font-family: "JetBrains Mono", monospace;
      }

      .status-timer {
        margin-left: auto;
        font-size: 12.5px;
        color: var(--text-faint);
      }

      .status-steps {
        display: flex;
        flex-wrap: wrap;
        gap: 7px;
        margin-top: 11px;
      }

      .status-chip {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 3px 9px 3px 4px;
        border-radius: 999px;
        border: 1px solid var(--line);
        background: var(--fill-chip);
        color: var(--text-muted);
        font-size: 11.5px;
      }

      .chip-check {
        width: 15px;
        height: 15px;
        display: inline-grid;
        place-items: center;
        border-radius: 50%;
        background: var(--green-soft);
        color: var(--accent);
        font-size: 9px;
        font-weight: 800;
      }

      .conversation-main {
        padding: 28px 0 140px;
      }

      .intro-card,
      .assistant-card,
      .error-card {
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: 14px;
        padding: 20px 22px;
        margin-bottom: 18px;
      }

      .role-label {
        margin-bottom: 10px;
        color: var(--text-role);
        font-size: 11px;
        font-weight: 700;
        letter-spacing: .12em;
      }

      .intro-body,
      .answer-body {
        color: var(--text-body);
        font-size: 16px;
        line-height: 1.62;
      }

      .intro-body p,
      .answer-body p {
        margin: 0 0 14px;
      }

      .intro-body p:last-child,
      .answer-body p:last-child {
        margin-bottom: 0;
      }

      .answer-body ol,
      .answer-body ul {
        margin: 0 0 14px;
        padding-left: 22px;
      }

      .answer-body li + li {
        margin-top: 10px;
      }

      .answer-body table {
        width: 100%;
        margin: 0 0 14px;
        border-collapse: collapse;
        font-size: 14px;
      }

      .answer-body th,
      .answer-body td {
        padding: 9px 12px;
        border: 1px solid var(--line);
        text-align: left;
        vertical-align: top;
        white-space: nowrap;
      }

      .answer-body td:first-child {
        white-space: normal;
      }

      .answer-body th {
        background: var(--fill-soft);
        font-weight: 600;
      }

      .answer-body code {
        padding: .12em .35em;
        border-radius: .4em;
        background: rgba(24, 33, 28, 0.06);
        font-size: .92em;
      }

      .answer-body pre {
        margin: 0 0 14px;
        padding: 14px;
        overflow-x: auto;
        border-radius: 14px;
        background: #18211c;
        color: #f7faf7;
      }

      .answer-body pre code {
        padding: 0;
        background: transparent;
        color: inherit;
      }

      .chart-wrap {
        margin: 0 0 14px;
        padding: 16px;
        background: var(--fill-soft);
        border: 1px solid var(--line);
        border-radius: 14px;
      }

      .chart-wrap canvas {
        max-height: 360px;
      }

      .starter-wrap {
        margin-top: 18px;
      }

      .starter-label {
        margin-bottom: 10px;
        font-size: 12px;
        font-weight: 600;
        color: var(--text-faint);
      }

      .stack-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
      }

      .suggestion-button,
      .follow-up-button {
        width: 100%;
        padding: 11px 14px;
        border-radius: 10px;
        border: 1px solid var(--line);
        background: var(--fill-soft);
        color: var(--text-body);
        text-align: left;
        font-size: 14.5px;
        line-height: 1.4;
      }

      .suggestion-button:hover,
      .follow-up-button:hover {
        border-color: var(--green-border);
        background: #f1f8f3;
      }

      .user-row {
        display: flex;
        justify-content: flex-end;
        margin-bottom: 18px;
      }

      .user-bubble {
        width: min(78%, 720px);
        padding: 14px 18px;
        border-radius: 14px;
        border: 1px solid var(--green-border);
        background: var(--green-soft);
      }

      .user-label {
        margin-bottom: 7px;
        color: var(--text-you);
        font-size: 11px;
        font-weight: 700;
        letter-spacing: .12em;
        text-align: right;
      }

      .user-text {
        margin: 0;
        color: #1d3328;
        font-size: 15.5px;
        line-height: 1.55;
        white-space: pre-wrap;
      }

      .user-attachment {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        margin-bottom: 8px;
        padding: 4px 10px;
        border-radius: 999px;
        border: 1px solid var(--green-border);
        background: #fff;
        color: var(--text-you);
        font-size: 12px;
      }

      .thinking-head {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 14px;
      }

      .thinking-spark {
        color: var(--accent);
        font-size: 13px;
      }

      .thinking-label {
        color: var(--text-muted);
        font-size: 12px;
        font-weight: 700;
        letter-spacing: .1em;
      }

      .thinking-dot {
        width: 5px;
        height: 5px;
        border-radius: 50%;
        background: var(--accent);
        animation: pulse 1s ease-in-out infinite;
      }

      .reasoning-rail {
        padding-left: 16px;
        border-left: 2px solid var(--green-rail);
        display: flex;
        flex-direction: column;
        gap: 14px;
      }

      .reasoning-section {
        animation: fade .35s ease both;
      }

      .reasoning-title {
        margin-bottom: 3px;
        color: var(--text-body);
        font-size: 13.5px;
        font-weight: 700;
      }

      .reasoning-text {
        margin: 0;
        color: var(--text-soft);
        font-size: 14px;
        line-height: 1.6;
      }

      .reasoning-pill {
        display: inline-flex;
        align-items: center;
        gap: 9px;
        margin-bottom: 16px;
        padding: 7px 13px;
        border-radius: 999px;
        border: 1px solid var(--line-divider);
        background: var(--fill-pill);
        color: var(--text-muted);
        font-size: 13px;
      }

      .reasoning-pill:hover {
        background: #eef1ee;
        border-color: var(--line-strong);
      }

      .pill-main {
        color: var(--text-section);
        font-weight: 600;
      }

      .pill-dot {
        color: #b8c0ba;
      }

      .pill-chevron {
        display: inline-block;
        transition: transform .2s ease;
      }

      .pill-chevron.open {
        transform: rotate(90deg);
      }

      .reasoning-panel {
        margin-bottom: 18px;
        padding: 16px 18px;
        border-radius: 12px;
        border: 1px solid var(--line-soft);
        background: var(--fill-soft);
      }

      .reasoning-panel .reasoning-title {
        color: var(--text-section);
        font-size: 13px;
      }

      .reasoning-panel .reasoning-text {
        font-size: 13.5px;
      }

      .usage-footer {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 16px;
        margin-top: 18px;
        padding-top: 15px;
        border-top: 1px solid var(--line-soft);
        color: var(--text-faint);
        font-size: 12.5px;
      }

      .usage-strong {
        color: var(--text-muted);
      }

      .usage-arrow {
        color: var(--accent);
      }

      .usage-divider {
        width: 1px;
        height: 12px;
        background: var(--line-divider);
      }

      .follow-ups {
        margin-bottom: 8px;
      }

      .follow-ups h3 {
        margin: 0 0 10px;
        color: var(--text-section);
        font-size: 13px;
        font-weight: 700;
      }

      .follow-up-button {
        padding: 12px 15px;
        background: #fff;
        color: var(--accent);
        font-weight: 500;
      }

      .error-layout {
        display: flex;
        gap: 14px;
        align-items: flex-start;
      }

      .error-icon {
        width: 38px;
        height: 38px;
        display: grid;
        place-items: center;
        border-radius: 10px;
        font-size: 18px;
        font-weight: 700;
      }

      .error-title {
        margin: 0 0 5px;
        color: var(--text-strong);
        font-size: 16px;
        font-weight: 700;
      }

      .error-copy {
        margin: 0;
        color: var(--text-soft);
        font-size: 14.5px;
        line-height: 1.58;
      }

      .error-actions {
        display: flex;
        gap: 9px;
        margin-top: 16px;
      }

      .error-actions button {
        min-height: 0;
        padding: 9px 16px;
        border-radius: 9px;
        font-size: 14px;
        font-weight: 600;
      }

      .composer-shell {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 38;
        padding: 14px 24px 16px;
        background: linear-gradient(to top, var(--bg) 72%, rgba(245, 247, 245, 0));
      }

      .composer-card {
        display: flex;
        align-items: flex-end;
        gap: 12px;
        padding: 8px 8px 8px 18px;
        border-radius: 16px;
        border: 1px solid var(--line-strong);
        background: #fff;
        box-shadow: 0 6px 20px -14px rgba(20, 60, 40, 0.3);
      }

      .composer-input {
        flex: 1;
        min-height: 52px;
        max-height: 200px;
        resize: none;
        border: none;
        background: transparent;
        color: var(--text-strong);
        font-size: 15.5px;
        line-height: 1.5;
        padding: 12px 0;
      }

      .composer-input::placeholder {
        color: #a3aca6;
      }

      .composer-input:focus {
        outline: none;
      }

      .send-button {
        height: 44px;
        padding: 0 22px;
        border-radius: 11px;
        font-size: 15px;
        font-weight: 600;
      }

      .attach-button {
        flex-shrink: 0;
        width: 36px;
        height: 36px;
        margin-bottom: 8px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 10px;
        border: 1px solid transparent;
        background: transparent;
        color: var(--text-muted);
        font-size: 16px;
        cursor: pointer;
      }

      .attach-button:hover {
        background: var(--fill-chip);
        border-color: var(--line);
      }

      .attachment-preview {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        margin: 0 0 8px 4px;
        padding: 3px 9px 3px 10px;
        border-radius: 999px;
        border: 1px solid var(--line);
        background: var(--fill-chip);
        color: var(--text-muted);
        font-size: 12.5px;
      }

      .attachment-preview-name {
        max-width: 240px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .attachment-remove {
        display: inline-grid;
        place-items: center;
        width: 16px;
        height: 16px;
        border-radius: 50%;
        border: none;
        background: var(--fill-pill);
        color: var(--text-muted);
        font-size: 9px;
        cursor: pointer;
      }

      .attachment-remove:hover {
        background: var(--error-fill);
        color: var(--error);
      }

      .composer-meta {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-top: 11px;
        min-height: 18px;
      }

      .status-text {
        color: var(--text-soft);
        font-size: 12.5px;
      }

      .saved-reports {
        margin-left: auto;
      }

      .saved-reports select {
        min-width: 210px;
        padding: 8px 12px;
        border-radius: 10px;
        border: 1px solid var(--green-border);
        background: rgba(255, 255, 255, 0.96);
        color: var(--accent);
        font-size: 13px;
        font-weight: 600;
      }

      @keyframes spin {
        to { transform: rotate(360deg); }
      }

      @keyframes pulse {
        0%, 100% { opacity: .3; }
        50% { opacity: 1; }
      }

      @keyframes fade {
        from { opacity: 0; transform: translateY(5px); }
        to { opacity: 1; transform: translateY(0); }
      }

      @media (max-width: 840px) {
        .app-bar {
          flex-wrap: wrap;
          height: auto;
          min-height: 60px;
          padding: 12px 16px;
          gap: 12px;
        }

        .status-bar {
          top: 84px;
        }

        .status-inner,
        .conversation-main,
        .composer-inner {
          width: calc(100vw - 32px);
        }

        .bar-divider,
        .lang-switch {
          display: none;
        }

        .composer-shell {
          padding-left: 16px;
          padding-right: 16px;
        }
      }

      @media (max-width: 640px) {
        .login-shell {
          padding: 12px;
        }

        .login-card {
          border-radius: 22px;
        }

        .login-hero,
        .login-form {
          padding-left: 24px;
          padding-right: 24px;
        }

        .login-hero {
          padding-top: 36px;
        }

        .brand-row {
          margin-bottom: 18px;
        }

        .login-form {
          padding-bottom: 32px;
        }

        .field label {
          font-size: 14px;
        }

        .field input {
          min-height: 58px;
          padding: 0 24px;
          border-radius: 18px;
          font-size: 16px;
        }

        .primary-button {
          min-height: 58px;
          border-radius: 18px;
          font-size: 17px;
        }

        .conversation-main {
          padding-bottom: 160px;
        }

        .user-bubble {
          width: 100%;
          max-width: 100%;
        }

        .composer-card {
          flex-direction: column;
          align-items: stretch;
          padding: 12px;
        }

        .send-button {
          width: 100%;
        }

        .composer-meta {
          flex-direction: column;
          align-items: stretch;
          gap: 10px;
        }

        .saved-reports {
          margin-left: 0;
        }

        .saved-reports select {
          width: 100%;
          min-width: 0;
        }

        .error-layout {
          flex-direction: column;
        }

        .error-actions {
          flex-wrap: wrap;
        }
      }
