
      :root {
        color-scheme: light;
        --bg: #eef3f8;
        --panel: #ffffff;
        --line: #d6deea;
        --text: #183153;
        --muted: #5f718a;
        --accent: #0b6bcb;
        --accent-strong: #084d91;
        --bot: #ffffff;
        --user: #dcecff;
      }

      * {
        box-sizing: border-box;
      }

      html,
      body {
        height: 100%;
        overflow: hidden;
      }

      body {
        margin: 0;
        font-family: "Microsoft JhengHei", sans-serif;
        background: linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
        color: var(--text);
      }

      .wrap {
        width: 100%;
        height: 100vh;
        height: 100dvh;
        margin: 0;
        padding: 0;
      }

      .panel {
        height: 100%;
        background: var(--panel);
        border: 0;
        border-radius: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
      }

      .header {
        padding: 12px 22px;
        border-bottom: 1px solid var(--line);
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
      }

      .brand {
        display: flex;
        align-items: center;
        gap: 16px;
        min-width: 0;
      }

      .brand-logo {
        display: block;
        width: 282px;
        max-width: 36vw;
        height: auto;
        object-fit: contain;
        padding: 8px 10px;
        border-radius: 8px;
        background: #12243a;
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
      }

      .brand-title {
        display: grid;
        gap: 2px;
        min-width: 0;
      }

      .aimu-title-row { display: flex; align-items: center; gap: 8px; }
      .aimu-title-avatar { width: 28px; height: 28px; flex: 0 0 auto; border-radius: 50%; object-fit: cover; box-shadow: 0 2px 8px rgb(16 24 40 / 20%); }
      .page-footer {
        flex: 0 0 auto;
        padding: 5px 22px;
        border-top: 1px solid var(--line);
        background: var(--panel);
        text-align: right;
      }
      .aimu-version {
        color: var(--muted);
        font-size: 11px;
        font-weight: 600;
        letter-spacing: 0.04em;
      }

      .brand-title h1 {
        margin: 0;
        font-size: 24px;
        line-height: 1.2;
      }

      .brand-title span {
        color: var(--muted);
        font-size: 13px;
      }

      .header-actions {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 12px;
        min-width: 280px;
      }

      .agent-status {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        color: var(--muted);
        font-size: 13px;
        white-space: nowrap;
      }

      .agent-status::before {
        content: "";
        width: 8px;
        height: 8px;
        border-radius: 999px;
        background: #12b76a;
      }

      .user-pill {
        max-width: 260px;
        padding: 8px 12px;
        border: 1px solid var(--line);
        border-radius: 999px;
        background: #fbfdff;
        color: var(--text);
        font-size: 13px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .composer {
        display: grid;
        gap: 8px;
        padding: 16px 22px 18px;
        border-top: 1px solid var(--line);
        background: #ffffff;
      }

      label {
        display: grid;
        gap: 6px;
        color: var(--muted);
        font-size: 13px;
      }

      textarea,
      button {
        font: inherit;
      }

      textarea {
        width: 100%;
        min-height: 72px;
        max-height: 120px;
        padding: 11px 13px;
        border: 1px solid var(--line);
        border-radius: 10px;
        color: var(--text);
        outline: none;
        resize: none;
      }

      textarea:focus {
        border-color: var(--accent);
        box-shadow: 0 0 0 3px rgba(11, 107, 203, 0.12);
      }

      button {
        border: 0;
        border-radius: 10px;
        padding: 12px 16px;
        min-height: 44px;
        color: white;
        background: linear-gradient(135deg, var(--accent), var(--accent-strong));
        cursor: pointer;
      }

      button:disabled {
        cursor: wait;
        opacity: 0.72;
      }

      .secondary-button {
        min-width: 86px;
        background: #edf2f7;
        color: var(--text);
      }

      .help-link {
        color: var(--accent-strong);
        font-size: 13px;
        text-decoration: underline;
        text-underline-offset: 3px;
        white-space: nowrap;
      }

      .chat {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: scroll;
        overflow-x: hidden;
        scrollbar-gutter: stable;
        padding: 24px 22px;
        display: flex;
        flex-direction: column;
        gap: 16px;
        background-color: #fbfdff;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='180' viewBox='0 0 360 180'%3E%3Ctext x='180' y='90' text-anchor='middle' dominant-baseline='middle' transform='rotate(-24 180 90)' fill='%23183153' fill-opacity='.045' font-family='Arial,sans-serif' font-size='24' font-weight='600' letter-spacing='1.5'%3EAmulaire used only%3C/text%3E%3C/svg%3E");
        background-repeat: repeat;
        background-size: 360px 180px;
      }

      .chat::before {
        content: "";
        margin-top: auto;
      }

      .message-row {
        display: grid;
        gap: 6px;
        flex: 0 0 auto;
      }

      .message-row.user-row {
        justify-items: end;
      }

      .message-meta {
        color: var(--muted);
        font-size: 12px;
        padding: 0 6px;
      }

      .bubble {
        max-width: 88%;
        padding: 13px 15px;
        border-radius: 12px;
        line-height: 1.6;
        white-space: pre-wrap;
        overflow-wrap: anywhere;
      }

      .bubble img {
        display: block;
        max-width: 100%;
        height: auto;
        margin: 10px 0;
        border: 1px solid var(--line);
        border-radius: 8px;
      }

      .user {
        background: var(--user);
      }

      .bot {
        background: var(--bot);
        border: 1px solid var(--line);
      }

      .thinking .bubble {
        color: var(--muted);
        font-style: italic;
      }

      .thinking .bubble::after {
        content: "";
        display: inline-block;
        width: 1.25em;
        animation: thinking-dots 1.2s steps(4, end) infinite;
      }

      @keyframes thinking-dots {
        0% {
          content: "";
        }

        25% {
          content: ".";
        }

        50% {
          content: "..";
        }

        75%,
        100% {
          content: "...";
        }
      }

      .feedback-actions {
        display: flex;
        gap: 8px;
        margin-left: 6px;
      }

      .feedback-button {
        width: 32px;
        height: 32px;
        min-height: 32px;
        padding: 0;
        border: 1px solid var(--line);
        border-radius: 999px;
        background: #f7fafc;
        color: var(--text);
        display: inline-flex;
        align-items: center;
        justify-content: center;
      }

      .feedback-button.selected {
        border-color: var(--accent);
        background: #e8f2ff;
        color: var(--accent-strong);
      }

      .feedback-button svg {
        width: 17px;
        height: 17px;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
        fill: none;
      }

      .feedback-status {
        color: var(--muted);
        font-size: 12px;
        align-self: center;
      }

      .modal-backdrop {
        position: fixed;
        inset: 0;
        z-index: 20;
        display: none;
        align-items: center;
        justify-content: center;
        padding: 20px;
        background: rgba(15, 23, 42, 0.34);
      }

      .modal-backdrop.open {
        display: flex;
      }

      .feedback-modal {
        width: min(560px, 100%);
        padding: 22px;
        border-radius: 14px;
        background: #ffffff;
        box-shadow: 0 24px 70px rgba(24, 49, 83, 0.22);
      }

      .feedback-modal h2 {
        margin: 0 0 8px;
        font-size: 20px;
      }

      .feedback-modal p {
        margin: 0 0 16px;
        color: var(--muted);
      }

      .usage-section + .usage-section {
        margin-top: 18px;
      }

      .usage-section h3 {
        margin: 0 0 6px;
        font-size: 15px;
      }

      .usage-section p {
        margin: 0;
        color: var(--text);
        line-height: 1.65;
      }

      .usage-list {
        margin: 0 0 16px;
        padding-left: 20px;
        color: var(--text);
        line-height: 1.65;
      }

      .usage-list li + li {
        margin-top: 6px;
      }

      .feedback-options {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 14px;
      }

      .feedback-option {
        min-height: 34px;
        padding: 7px 12px;
        border: 1px solid var(--line);
        border-radius: 999px;
        background: #f8fafc;
        color: var(--text);
      }

      .feedback-option.selected {
        border-color: var(--accent);
        background: #e8f2ff;
      }

      .feedback-modal textarea {
        min-height: 86px;
        margin-bottom: 16px;
      }

      .modal-actions {
        display: flex;
        justify-content: flex-end;
        gap: 10px;
      }

      .feedback-modal-status {
        min-height: 18px;
        margin-bottom: 10px;
        color: #b42318;
        font-size: 12px;
      }

      .composer-row {
        display: grid;
        grid-template-columns: 1fr 132px;
        gap: 12px;
        align-items: stretch;
      }

      .hint {
        color: var(--muted);
        font-size: 12px;
      }

      @media (max-width: 1040px) {
        .header {
          align-items: flex-start;
          flex-direction: column;
        }

        .header-actions {
          width: 100%;
          min-width: 0;
        }
      }

      @media (max-width: 900px) {
        .brand-logo {
          width: 200px;
          max-width: 48vw;
        }

        .brand-title h1 {
          font-size: 21px;
        }
      }

      @media (max-width: 760px) {
        .wrap {
          width: 100vw;
          padding: 0;
        }

        .panel {
          border-radius: 0;
          border-left: 0;
          border-right: 0;
        }

        .header {
          padding: 10px 14px;
          gap: 10px;
        }
        .brand {
          flex-direction: row;
          align-items: center;
          gap: 10px;
        }
        .header-actions {
          align-items: center;
          justify-content: flex-start;
          flex-direction: row;
          flex-wrap: wrap;
          gap: 8px;
        }

        .brand-logo {
          width: 120px;
          max-width: 32vw;
        }

        .user-pill {
          max-width: 100%;
        }

        .composer-row {
          grid-template-columns: 1fr 80px;
        }
        .composer { padding: 10px 14px; }
        .composer textarea { min-height: 60px; }
        .page-footer { padding: 5px 14px; }

        .bubble {
          max-width: 100%;
        }
      }
    
[hidden]{display:none!important}#status{margin-left:12px}.bot{white-space:normal}.bot p{margin:0 0 10px}.bot p:last-child{margin-bottom:0}.bot table{display:block;overflow:auto;border-collapse:collapse;max-width:100%;font-size:14px}.bot td,.bot th{padding:8px 10px;border:1px solid var(--line);min-width:100px}.bot th{background:#edf4fb}.bot pre{overflow:auto}.bot h1,.bot h2,.bot h3{font-size:18px}.feedback-modal{max-height:90vh;overflow:auto}.feedback-button[aria-pressed="true"]{border-color:var(--accent);background:#e8f2ff;color:var(--accent-strong)}

.turn-diagnostics{margin:6px 0 0 6px;color:var(--muted);font-size:12px;line-height:1.5;font-variant-numeric:tabular-nums}

.answer-sources{margin-top:18px;padding-top:12px;border-top:1px solid #dce5e1;font-size:14px}.answer-sources>span{font-weight:600;color:#536c60}.answer-sources ul{margin:6px 0 0;padding-left:20px}.answer-sources li{overflow-wrap:anywhere;margin:4px 0}.answer-sources a{color:#25664b;text-decoration:underline;text-underline-offset:3px}
