:root {
      --bg: #eef2ec;
      --panel: #ffffff;
      --ink: #12221b;
      --muted: #5f6f66;
      --accent: #0f6f5a;
      --accent-strong: #0b5b48;
      --accent-soft: #e7f6f0;
      --assistant: #f7f6f2;
      --user: #e6f6ef;
      --border: #e2e6df;
      --shadow: 0 24px 60px rgba(11, 36, 25, 0.12);
      --glow: 0 12px 30px rgba(15, 111, 90, 0.12);
      --message-rail-width: 920px;
    }
    * { box-sizing: border-box; }
    [hidden] { display: none !important; }
    html { height: 100%; }
    body {
      margin: 0;
      min-height: 100vh;
      font-family: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
      color: var(--ink);
      background: var(--bg);
      padding: 16px;
      position: relative;
    }
    body::before {
      content: "";
      position: fixed;
      inset: -20% -10% auto -10%;
      height: 70%;
      background: radial-gradient(60% 60% at 20% 10%, rgba(15, 111, 90, 0.16), transparent 60%),
                  radial-gradient(55% 55% at 80% 0%, rgba(218, 184, 120, 0.2), transparent 60%),
                  radial-gradient(60% 60% at 50% 60%, rgba(35, 101, 86, 0.12), transparent 70%);
      pointer-events: none;
      z-index: 0;
    }
    body::after {
      content: "";
      position: fixed;
      inset: 0;
      background-image: linear-gradient(90deg, rgba(255, 255, 255, 0.4) 0, rgba(255, 255, 255, 0.4) 1px, transparent 1px, transparent 24px),
                        linear-gradient(180deg, rgba(255, 255, 255, 0.4) 0, rgba(255, 255, 255, 0.4) 1px, transparent 1px, transparent 24px);
      opacity: 0.18;
      pointer-events: none;
      z-index: 0;
    }
    .frame {
      width: 100%;
      height: calc(100vh - 32px);
      background: rgba(255, 255, 255, 0.92);
      border-radius: 18px;
      box-shadow: var(--shadow);
      overflow: hidden;
      border: 1px solid #e6ece5;
      display: flex;
      flex-direction: column;
      position: relative;
      z-index: 1;
      backdrop-filter: blur(6px);
    }
    header {
      padding: 18px 26px;
      border-bottom: 1px solid #e6ece5;
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 12px;
      background: linear-gradient(120deg, #ffffff 0%, #f5faf7 100%);
      position: relative;
      z-index: 50;
    }
    .header-right {
      display: flex;
      align-items: center;
      gap: 12px;
      flex-wrap: wrap;
      justify-content: flex-end;
    }
    .verify-banner {
      margin: 12px 14px 0;
      padding: 10px 16px;
      border-radius: 16px;
      border: 1px solid rgba(218, 184, 120, 0.38);
      background: rgba(218, 184, 120, 0.16);
      color: #6a4b10;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      box-shadow: 0 10px 22px rgba(13, 33, 24, 0.06);
    }
    .frontend-update-banner {
      margin: 12px 14px 0;
      padding: 10px 16px;
      border-radius: 16px;
      border: 1px solid rgba(15, 111, 90, 0.22);
      background: linear-gradient(120deg, rgba(231, 246, 240, 0.95), rgba(255, 255, 255, 0.96));
      color: var(--accent-strong);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      box-shadow: 0 10px 22px rgba(13, 33, 24, 0.06);
    }
    .verify-banner-text {
      font-size: 13px;
      line-height: 1.4;
      font-weight: 600;
      letter-spacing: 0.2px;
    }
    .frontend-update-banner-text {
      font-size: 13px;
      line-height: 1.4;
      font-weight: 600;
      letter-spacing: 0.2px;
    }
    .verify-banner-btn {
      border: 1px solid rgba(106, 75, 16, 0.32);
      background: #ffffff;
      color: #6a4b10;
      padding: 6px 12px;
      border-radius: 999px;
      font-size: 12px;
      cursor: pointer;
      font-weight: 700;
      font-family: inherit;
      transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
      white-space: nowrap;
    }
    .verify-banner-btn:hover {
      border-color: rgba(106, 75, 16, 0.6);
      box-shadow: 0 6px 14px rgba(106, 75, 16, 0.12);
    }
    .verify-banner-btn:active {
      transform: translateY(1px);
    }
    .frontend-update-banner-actions {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }
    .frontend-update-btn {
      border: 1px solid rgba(15, 111, 90, 0.32);
      background: #ffffff;
      color: var(--accent-strong);
      padding: 6px 12px;
      border-radius: 999px;
      font-size: 12px;
      cursor: pointer;
      font-weight: 700;
      font-family: inherit;
      transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
      white-space: nowrap;
    }
    .frontend-update-btn.secondary {
      font-weight: 600;
      color: var(--muted);
      border-color: rgba(15, 111, 90, 0.18);
      background: rgba(255, 255, 255, 0.82);
    }
    .frontend-update-btn:hover {
      border-color: rgba(15, 111, 90, 0.58);
      box-shadow: 0 6px 14px rgba(15, 111, 90, 0.12);
    }
    .frontend-update-btn:active {
      transform: translateY(1px);
    }
    .header-actions {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }
    .header-btn {
      border: 1px solid rgba(15, 111, 90, 0.25);
      background: #ffffff;
      color: var(--accent-strong);
      padding: 6px 12px;
      border-radius: 999px;
      font-size: 12px;
      cursor: pointer;
      font-weight: 600;
      font-family: inherit;
      transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
      white-space: nowrap;
    }
    .header-btn:hover {
      border-color: rgba(15, 111, 90, 0.6);
      box-shadow: 0 6px 14px rgba(15, 111, 90, 0.12);
    }
    .header-btn:active {
      transform: translateY(1px);
    }
    .header-btn-personal {
      background: linear-gradient(135deg, rgba(15, 111, 90, 0.12), rgba(255, 255, 255, 0.96));
      border-color: rgba(15, 111, 90, 0.35);
      font-weight: 700;
    }
    .header-btn-personal:hover {
      border-color: rgba(15, 111, 90, 0.72);
      box-shadow: 0 8px 18px rgba(15, 111, 90, 0.16);
    }
    header h1 {
      margin: 0;
      font-size: 22px;
      letter-spacing: 0.6px;
      font-family: "ZCOOL XiaoWei", "Noto Serif SC", "Source Han Serif SC", "Songti SC", serif;
    }
    header div .meta {
      font-size: 13px;
      color: var(--muted);
      margin-top: 4px;
    }
    header > .meta {
      font-size: 12px;
      color: var(--accent-strong);
      background: var(--accent-soft);
      border: 1px solid rgba(15, 111, 90, 0.2);
      padding: 6px 12px;
      border-radius: 999px;
      font-weight: 600;
    }
    .auth-panel {
      position: relative;
      display: flex;
      align-items: center;
      padding: 4px 8px;
      border-radius: 999px;
      background: #f7faf8;
      border: 1px solid #dbe6de;
      box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
    }
    .auth-menu-trigger {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      border: none;
      background: transparent;
      cursor: pointer;
      font-family: inherit;
      padding: 4px 6px;
      border-radius: 999px;
      color: var(--ink);
    }
    .auth-menu-trigger:hover {
      background: rgba(15, 111, 90, 0.08);
    }
    .auth-status {
      font-size: 12px;
      color: var(--muted);
      max-width: 220px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .auth-caret {
      font-size: 10px;
      color: var(--accent-strong);
    }
    .auth-menu {
      position: absolute;
      top: calc(100% + 8px);
      right: 0;
      min-width: 200px;
      background: #ffffff;
      border: 1px solid #e6ece5;
      border-radius: 12px;
      padding: 8px;
      box-shadow: 0 18px 36px rgba(13, 33, 24, 0.16);
      display: flex;
      flex-direction: column;
      gap: 6px;
      z-index: 200;
    }
    .auth-menu-email {
      font-size: 12px;
      color: var(--ink);
      font-weight: 600;
      padding: 4px 6px 0;
      max-width: 220px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .auth-menu-note {
      font-size: 11px;
      color: var(--muted);
      padding: 0 6px 4px;
      line-height: 1.4;
    }
    .auth-menu-item {
      border: none;
      background: transparent;
      text-align: left;
      padding: 8px 10px;
      border-radius: 8px;
      font-size: 12px;
      color: var(--ink);
      cursor: pointer;
      font-family: inherit;
      transition: background 0.2s ease;
    }
    .auth-menu-item:hover {
      background: #f2f6f3;
    }
    .auth-btn {
      border: 1px solid rgba(15, 111, 90, 0.35);
      background: #ffffff;
      color: #0f7760;
      padding: 6px 12px;
      border-radius: 999px;
      font-size: 12px;
      cursor: pointer;
      font-weight: 600;
      font-family: inherit;
      transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
      white-space: nowrap;
    }
    .auth-btn.secondary {
      border-color: rgba(15, 111, 90, 0.2);
      color: var(--accent-strong);
      background: #f7faf8;
    }
    .auth-btn:hover {
      border-color: rgba(15, 111, 90, 0.7);
      box-shadow: 0 6px 12px rgba(15, 111, 90, 0.12);
    }
    .auth-btn:active {
      transform: translateY(1px);
    }
    .content {
      display: grid;
      grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
      grid-template-areas: "tasks chat";
      gap: 12px;
      padding: 14px;
      flex: 1;
      min-height: 0;
      position: relative;
      background: linear-gradient(180deg, rgba(255, 255, 255, 0.6) 0%, rgba(247, 249, 246, 0.9) 100%);
    }
    @media (max-width: 960px) {
      .verify-banner,
      .frontend-update-banner {
        flex-direction: column;
        align-items: flex-start;
      }
    }
    .sidebar {
      position: absolute;
      top: 14px;
      right: 14px;
      bottom: 14px;
      width: min(320px, calc(100% - 28px));
      background: linear-gradient(180deg, rgba(249, 250, 249, 0.94), rgba(255, 255, 255, 0.98));
      padding: 16px;
      display: flex;
      flex-direction: column;
      gap: 12px;
      min-height: 0;
      overflow: hidden;
      border-radius: 16px;
      border: 1px solid #e7ebe7;
      box-shadow: 0 20px 44px rgba(17, 24, 39, 0.14);
      z-index: 20;
      transform: translateX(calc(100% + 20px));
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
      transition: transform 0.22s ease, opacity 0.18s ease, visibility 0.18s ease;
    }
    .sidebar.is-open {
      transform: translateX(0);
      opacity: 1;
      visibility: visible;
      pointer-events: auto;
    }
    .sidebar-drawer-backdrop {
      position: absolute;
      inset: 14px;
      background: rgba(15, 23, 42, 0.18);
      border-radius: 16px;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.18s ease;
      z-index: 15;
    }
    .sidebar-drawer-backdrop.is-open {
      opacity: 1;
      pointer-events: auto;
    }
    .sidebar-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }
    .sidebar-close {
      width: 34px;
      height: 34px;
      border: 1px solid #dde4df;
      border-radius: 999px;
      background: #ffffff;
      color: #6a7872;
      font: inherit;
      font-size: 18px;
      line-height: 1;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      transition: border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
    }
    .sidebar-close:hover {
      color: var(--ink);
      border-color: #cbd8d1;
      box-shadow: 0 6px 14px rgba(17, 24, 39, 0.08);
    }
    .tasks-panel {
      grid-area: tasks;
      border-left: none;
      background: linear-gradient(180deg, rgba(243, 249, 245, 0.96), rgba(255, 255, 255, 0.98));
      padding: 16px;
      display: flex;
      flex-direction: column;
      gap: 12px;
      min-height: 0;
      overflow: hidden;
      border-radius: 16px;
      border: 1px solid rgba(15, 111, 90, 0.14);
      box-shadow: 0 18px 34px rgba(15, 111, 90, 0.09);
    }
    .tasks-panel .title {
      font-size: 12px;
      color: #0b5b48;
      text-transform: uppercase;
      letter-spacing: 1.6px;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .sidebar .title {
      font-size: 12px;
      color: #6a7872;
      text-transform: uppercase;
      letter-spacing: 1.6px;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .tasks-panel .title::before {
      content: "";
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: var(--accent);
      box-shadow: 0 0 0 4px rgba(15, 111, 90, 0.2);
    }
    .sidebar .title::before {
      content: "";
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: #7f9d92;
      box-shadow: 0 0 0 4px rgba(127, 157, 146, 0.12);
    }
    .sidebar .controls {
      display: flex;
      gap: 10px;
    }
    .sidebar button {
      flex: 1;
      border: 1px solid #dde4df;
      padding: 10px 12px;
      border-radius: 12px;
      cursor: pointer;
      font-family: inherit;
      font-weight: 600;
      font-size: 13px;
      transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
    }
    .sidebar button:active {
      transform: translateY(1px);
    }
    .btn-new {
      background: linear-gradient(180deg, #f5f8f6, #edf2ef);
      color: #48645a;
      box-shadow: 0 4px 10px rgba(17, 24, 39, 0.04);
    }
    .btn-new:hover {
      border-color: #cbd8d1;
      background: #f1f6f3;
      color: #314a42;
    }
    .btn-clear {
      background: #fbfcfb;
      color: #77827d;
      border: 1px solid #e6eae7;
    }
    .history {
      overflow-y: scroll;
      display: flex;
      flex-direction: column;
      gap: 10px;
      flex: 1;
      min-height: 0;
    }
    .history-item {
      border: 1px solid #e7ebe8;
      background: #fcfcfb;
      border-radius: 12px;
      padding: 10px 12px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      position: relative;
      transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    }
    .history-item::before {
      content: "";
      position: absolute;
      left: 0;
      top: 8px;
      bottom: 8px;
      width: 3px;
      border-radius: 999px;
      background: transparent;
    }
    .history-item.active {
      border-color: #d7dfda;
      background: #f3f6f4;
    }
    .history-item.active::before {
      background: #86a196;
    }
    .history-item:hover {
      transform: translateY(-1px);
      box-shadow: 0 8px 16px rgba(17, 24, 39, 0.05);
      border-color: #dde4df;
    }
    .history-item .label {
      font-size: 14px;
      line-height: 1.3;
      flex: 1;
    }
    .history-item .time {
      font-size: 11px;
      color: var(--muted);
      white-space: nowrap;
    }
    .history-item .del {
      border: none;
      background: transparent;
      color: #bf7676;
      cursor: pointer;
      font-size: 12px;
    }
    .tasks {
      display: grid;
      grid-template-rows: auto auto auto minmax(0, 1fr);
      gap: 8px;
      flex: 1;
      min-height: 0;
      height: 100%;
    }
    .task-section {
      display: grid;
      grid-template-rows: auto minmax(0, 1fr);
      min-height: 0;
      border: 1px solid rgba(15, 111, 90, 0.12);
      border-radius: 14px;
      background: linear-gradient(180deg, rgba(248, 252, 249, 0.96), rgba(255, 255, 255, 0.98));
      padding: 8px 10px;
      overflow: hidden;
      height: 100%;
      box-shadow: 0 10px 22px rgba(15, 111, 90, 0.05);
    }
    .task-section-body {
      min-height: 0;
      overflow: hidden;
      height: 100%;
      display: flex;
      flex-direction: column;
    }
    .task-section.plan-section { min-height: 0; }
    .task-section summary {
      cursor: pointer;
      font-weight: 600;
      list-style: none;
      padding: 8px 12px;
      background: linear-gradient(135deg, #f2faf6, #eaf5ef);
      border-radius: 10px;
      border: 1px solid #d2e4da;
      color: #154b3d;
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .task-section summary::-webkit-details-marker {
      display: none;
    }
    .task-section summary::before {
      content: ">";
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 22px;
      height: 22px;
      border-radius: 8px;
      border: 1px solid #c1d9cc;
      background: #edf8f2;
      color: #145341;
      font-weight: 700;
      font-size: 13px;
      transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    }
    .task-section[open] summary::before {
      transform: rotate(90deg);
      background: #e4f4ec;
      border-color: #b6d7c8;
      box-shadow: 0 4px 10px rgba(15, 111, 90, 0.18);
    }
    .task-section summary:hover {
      background: #e7f6ef;
      border-color: #b7d8ca;
    }
    .task-section summary:hover::before {
      border-color: #b7d5c7;
      box-shadow: 0 4px 10px rgba(15, 111, 90, 0.12);
    }
    .task-row {
      display: flex;
      gap: 8px;
      align-items: center;
    }
    .task-row input[type="text"] {
      flex: 1;
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 8px 10px;
      font-size: 12px;
      font-family: inherit;
      background: #ffffff;
    }
    .goal-row {
      display: flex;
      gap: 8px;
      margin-bottom: 6px;
      align-items: center;
    }
    .goal-row input[type="text"] {
      flex: 1;
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 8px 10px;
      font-size: 12px;
      font-family: inherit;
      background: #ffffff;
    }
    .goal-row #goalDiscoveryOpen {
      background: linear-gradient(135deg, #eff8f3 0%, #f7fbf9 100%);
      color: var(--accent-strong);
      border-color: rgba(15, 111, 90, 0.24);
    }
    .goal-row #goalDiscoveryOpen:hover {
      border-color: rgba(15, 111, 90, 0.48);
      background: #f2fbf6;
    }
    .inspiration-hub {
      display: flex;
      flex-direction: column;
      gap: 6px;
      padding: 8px 10px;
      border: 1px solid rgba(15, 111, 90, 0.12);
      border-radius: 14px;
      background: linear-gradient(180deg, rgba(247, 251, 249, 0.96), rgba(255, 255, 255, 0.98));
    }
    .inspiration-chip-row {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      align-items: flex-start;
    }
    .hot-topic-pill {
      width: auto;
      max-width: 100%;
      flex: 0 0 auto;
      border: 1px solid rgba(15, 111, 90, 0.16);
      background: #ffffff;
      color: var(--ink);
      border-radius: 10px;
      padding: 8px 10px;
      display: inline-flex;
      flex-direction: row;
      align-items: center;
      gap: 8px;
      text-align: left;
      box-shadow: 0 4px 12px rgba(17, 24, 39, 0.03);
    }
    .hot-topic-pill:hover {
      border-color: rgba(15, 111, 90, 0.34);
      background: #f8fcfa;
      box-shadow: 0 8px 16px rgba(15, 111, 90, 0.06);
    }
    .hot-topic-pill:disabled,
    .hot-topic-pill.loading {
      opacity: 0.7;
      cursor: progress;
      pointer-events: none;
      box-shadow: none;
    }
    .hot-topic-pill-meta {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: nowrap;
    }
    .hot-topic-badge {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 20px;
      padding: 0 8px;
      border-radius: 999px;
      background: rgba(15, 111, 90, 0.1);
      color: var(--accent-strong);
      font-size: 10px;
      font-weight: 800;
      letter-spacing: 0.4px;
      text-transform: uppercase;
    }
    .hot-topic-name {
      font-size: 13px;
      font-weight: 700;
      color: #183d33;
      white-space: nowrap;
    }
    input[type="text"]:focus,
    textarea:focus,
    .task-title-input:focus,
    .step-goal-input:focus {
      outline: none;
      border-color: rgba(15, 111, 90, 0.6);
      box-shadow: 0 0 0 3px rgba(15, 111, 90, 0.12);
    }
    select:focus-visible {
      outline: none;
      box-shadow: 0 0 0 3px rgba(15, 111, 90, 0.12);
      border-color: rgba(15, 111, 90, 0.6);
    }
    .goal-list {
      display: flex;
      flex-direction: column;
      gap: 10px;
      overflow-y: auto;
      min-height: 0;
      flex: 1;
      scrollbar-gutter: stable;
    }
    .goal-card {
      border: 1px solid rgba(15, 111, 90, 0.12);
      border-radius: 12px;
      padding: 8px 10px;
      background: linear-gradient(180deg, #fbfefd, #ffffff);
      box-shadow: 0 8px 18px rgba(15, 111, 90, 0.05);
      transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    }
    .goal-card:hover {
      transform: translateY(-1px);
      border-color: rgba(15, 111, 90, 0.24);
      box-shadow: 0 12px 24px rgba(15, 111, 90, 0.08);
    }
    .goal-card-header {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 6px;
      font-weight: 600;
      flex-wrap: wrap;
    }
    .goal-card-actions {
      display: flex;
      gap: 6px;
      align-items: center;
      flex-wrap: wrap;
      justify-content: flex-end;
      max-width: 100%;
    }
    .goal-card-actions button {
      border: 1px solid var(--border);
      background: #ffffff;
      color: var(--muted);
      border-radius: 8px;
      padding: 4px 6px;
      font-size: 11px;
      cursor: pointer;
      font-family: inherit;
      transition: border-color 0.2s ease, color 0.2s ease, transform 0.15s ease, background 0.2s ease;
      white-space: nowrap;
    }
    .goal-card-actions button:hover {
      color: var(--ink);
      border-color: #cad7ce;
      background: #f6faf8;
    }
    .goal-card-actions button:active {
      transform: translateY(1px);
    }
    .tasks button {
      flex: 0;
      border: 1px solid var(--border);
      background: #ffffff;
      color: var(--muted);
      border-radius: 8px;
      padding: 6px 10px;
      font-size: 12px;
      cursor: pointer;
      font-family: inherit;
      font-weight: 600;
      transition: border-color 0.2s ease, color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    }
    .tasks button:hover {
      color: var(--ink);
      border-color: #cad7ce;
      box-shadow: 0 4px 10px rgba(17, 24, 39, 0.06);
    }
    .tasks button:active {
      transform: translateY(1px);
    }
    .tasks button.loading,
    .plan-modal-btn.loading,
    .goal-card-actions button.loading,
    .task-group-actions button.loading {
      opacity: 0.6;
      cursor: progress;
      pointer-events: none;
    }
    .task-clear {
      border: 1px solid #b24747;
      color: #b24747;
      background: #fff5f5;
    }
    .task-clear:hover {
      color: #8f3333;
      border-color: #8f3333;
    }
    .task-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
      flex: 1;
      min-height: 0;
      overflow-y: scroll;
      padding-right: 12px;
      scrollbar-gutter: stable;
    }
    .goal-list,
    .task-list,
    .history,
    .chat {
      scrollbar-width: thin;
      scrollbar-color: rgba(140, 140, 140, 0.6) transparent;
    }
    .goal-list::-webkit-scrollbar,
    .task-list::-webkit-scrollbar,
    .history::-webkit-scrollbar,
    .chat::-webkit-scrollbar {
      width: 10px;
    }
    .goal-list::-webkit-scrollbar-thumb,
    .task-list::-webkit-scrollbar-thumb,
    .history::-webkit-scrollbar-thumb,
    .chat::-webkit-scrollbar-thumb {
      background: rgba(140, 140, 140, 0.5);
      border-radius: 8px;
    }
    .task-group {
      border: 1px solid rgba(15, 111, 90, 0.12);
      border-radius: 12px;
      padding: 12px 14px;
      background: linear-gradient(180deg, #f9fcfa, #ffffff);
      box-shadow: 0 8px 18px rgba(15, 111, 90, 0.05);
      transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
      cursor: pointer;
      position: relative;
      overflow: visible;
    }
    .task-group:hover {
      transform: translateY(-1px);
      border-color: rgba(15, 111, 90, 0.22);
      box-shadow: 0 12px 22px rgba(15, 111, 90, 0.08);
    }
    .task-group:focus-visible {
      outline: 2px solid rgba(15, 111, 90, 0.28);
      outline-offset: 2px;
      border-color: rgba(15, 111, 90, 0.24);
      box-shadow: 0 12px 22px rgba(15, 111, 90, 0.08), 0 0 0 4px rgba(15, 111, 90, 0.08);
    }
    .task-group.task-group-menu-open {
      z-index: 12;
    }
    .task-group.task-group-compact {
      padding: 10px 14px;
    }
    .task-group-title {
      display: flex;
      align-items: flex-start;
      justify-content: flex-start;
      gap: 10px;
      padding: 0;
      width: 100%;
      min-width: 0;
    }
    .tasks .task-group-goal-link {
      color: var(--ink);
      padding: 0;
      margin: 0;
      flex: 1 1 auto;
      width: 100%;
      align-self: stretch;
      font: inherit;
      font-size: 20px;
      font-weight: 700;
      line-height: 1.2;
      text-align: left;
      cursor: pointer;
      transition: color 0.2s ease, transform 0.15s ease;
      display: block;
      min-width: 0;
      max-width: 100%;
      white-space: normal;
      word-break: keep-all;
      overflow-wrap: break-word;
    }
    .task-group:hover .task-group-goal-link,
    .task-group:focus-visible .task-group-goal-link {
      color: var(--accent-strong);
    }
    .task-group-header {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 14px;
      flex-direction: column;
      align-items: flex-start;
      width: 100%;
    }
    .task-group.task-group-compact .task-group-header {
      flex-direction: row;
      align-items: center;
      gap: 12px;
    }
    .task-group.task-group-compact .task-group-title {
      flex: 1 1 auto;
      min-width: 0;
      align-items: center;
    }
    .task-group-badge {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 20px;
      padding: 0 8px;
      border-radius: 999px;
      font-size: 10px;
      font-weight: 800;
      letter-spacing: 0.35px;
      text-transform: uppercase;
      flex: 0 0 auto;
    }
    .task-group-badge-hot {
      background: rgba(15, 111, 90, 0.1);
      color: var(--accent-strong);
      border: 1px solid rgba(15, 111, 90, 0.12);
    }
    .task-group.task-group-compact .task-group-goal-link {
      font-size: 18px;
      line-height: 1.3;
      display: block;
      flex: 1 1 auto;
      min-width: 0;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .task-group-actions {
      display: flex;
      gap: 8px;
      align-items: center;
      margin-left: 0;
      flex-wrap: wrap;
      justify-content: flex-start;
      max-width: 100%;
    }
    .task-group.task-group-compact .task-group-actions {
      margin-left: auto;
      width: auto;
      flex: 0 0 auto;
      align-self: center;
      justify-content: flex-end;
      max-width: none;
      flex-wrap: nowrap;
    }
    .task-group.task-group-compact.task-group-hot-topic .task-group-title {
      gap: 8px;
      align-items: center;
    }
    .task-group-actions button {
      border: 1px solid var(--border);
      background: #ffffff;
      color: var(--muted);
      border-radius: 8px;
      padding: 6px 10px;
      font-size: 12px;
      cursor: pointer;
      font-family: inherit;
      transition: border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
      white-space: nowrap;
    }
    .task-group-actions button:hover {
      color: var(--ink);
      border-color: #cad7ce;
    }
    .task-group-menu {
      position: relative;
      display: flex;
      align-items: center;
      margin-left: auto;
      z-index: 2;
    }
    .task-group.task-group-compact .task-group-menu {
      margin-left: auto;
      flex: 0 0 auto;
    }
    .task-group-menu.is-open {
      z-index: 14;
    }
    .task-group-menu-trigger {
      min-width: 34px;
      padding: 6px 8px !important;
      border-radius: 999px !important;
      font-size: 18px !important;
      line-height: 1 !important;
      color: var(--muted) !important;
      background: rgba(255, 255, 255, 0.92) !important;
      border-color: rgba(15, 111, 90, 0.14) !important;
      opacity: 0;
      visibility: hidden;
      transform: translateY(-2px);
      transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease, border-color 0.2s ease, color 0.2s ease;
    }
    .task-group:hover .task-group-menu-trigger,
    .task-group:focus-within .task-group-menu-trigger,
    .task-group-menu.is-open .task-group-menu-trigger {
      opacity: 1;
      visibility: visible;
      transform: translateY(0);
    }
    .task-group-menu-trigger:hover {
      color: var(--ink) !important;
      border-color: rgba(15, 111, 90, 0.28) !important;
      box-shadow: 0 6px 14px rgba(15, 111, 90, 0.08);
    }
    .task-group-menu-panel {
      position: absolute;
      top: calc(100% + 8px);
      right: 0;
      min-width: 108px;
      padding: 6px;
      border-radius: 12px;
      border: 1px solid rgba(15, 111, 90, 0.12);
      background: rgba(255, 255, 255, 0.98);
      box-shadow: 0 14px 28px rgba(17, 24, 39, 0.12);
      z-index: 20;
    }
    .task-group-menu-item {
      width: 100%;
      justify-content: flex-start;
      text-align: left;
      border-radius: 10px !important;
      padding: 8px 10px !important;
      font-size: 12px !important;
      white-space: nowrap;
    }
    .task-group-menu-item-danger {
      color: #8b5f5f !important;
      border-color: rgba(180, 116, 116, 0.18) !important;
      background: rgba(255, 255, 255, 0.98) !important;
    }
    .task-group-menu-item-danger:hover {
      color: #7a4343 !important;
      border-color: rgba(180, 116, 116, 0.34) !important;
    }
    .task-group-discuss-btn {
      color: var(--accent-strong);
      border-color: rgba(15, 111, 90, 0.22);
      background: rgba(255, 255, 255, 0.96);
      font-weight: 600;
    }
    .task-group-discuss-btn:hover {
      border-color: rgba(15, 111, 90, 0.42);
      color: var(--accent-strong);
    }
    @media (hover: none), (pointer: coarse) {
      .task-group-menu-trigger {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
      }
    }
    .task-item {
      border: 1px solid var(--border);
      background: #ffffff;
      border-radius: 12px;
      padding: 10px 12px;
      display: flex;
      flex-direction: column;
      gap: 6px;
      transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }
    .task-item:hover {
      border-color: #d1ded5;
      box-shadow: 0 8px 16px rgba(17, 24, 39, 0.06);
    }
    .task-item input[type="checkbox"] {
      margin: 0;
    }
    .task-main {
      display: flex;
      align-items: flex-start;
      gap: 8px;
    }
    .task-action-row {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 6px;
      padding-left: 0;
      min-width: 0;
    }
    .task-plan-discussion {
      display: flex;
      flex-direction: column;
      gap: 6px;
      padding: 8px 6px 4px 12px;
      border-left: 2px solid #e3ece6;
      margin: 6px 0 4px 6px;
      background: #f7fbf8;
      border-radius: 10px;
    }
    .task-plan-discussion-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-size: 11px;
      color: var(--muted);
    }
    .task-plan-discussion-actions button {
      border: 1px solid #d2ddd6;
      background: #ffffff;
      color: var(--muted);
      border-radius: 999px;
      padding: 2px 10px;
      font-size: 11px;
      cursor: pointer;
      font-family: inherit;
    }
    .task-plan-discussion-actions button:hover {
      color: var(--ink);
      border-color: #cad7ce;
    }
    .task-plan-discussion-list {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }
    .plan-discussion-item {
      border: 1px solid #d2ddd6;
      background: #ffffff;
      color: #44524b;
      border-radius: 999px;
      padding: 2px 10px;
      font-size: 11px;
      cursor: pointer;
      font-family: inherit;
    }
    .plan-discussion-item.active {
      border-color: #6ab39f;
      color: #0f7760;
      background: #e8f5f1;
      font-weight: 600;
    }
    .plan-discussion-empty {
      font-size: 11px;
      color: var(--muted);
    }
    .task-action-main {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      align-items: start;
      gap: 6px;
      width: 100%;
      min-width: 0;
    }
    .task-title {
      flex: 1;
      font-size: 13px;
      line-height: 1.5;
    }
    .task-title-text {
      cursor: text;
    }
    .task-title-text:hover {
      background: #f6f7fb;
    }
    .task-title-input {
      width: 100%;
      border: 1px solid var(--border);
      border-radius: 6px;
      padding: 4px 6px;
      font-size: 12px;
      font-family: inherit;
      background: #ffffff;
    }
    .task-title.editing .task-title-text {
      display: none;
    }
    .task-meta {
      font-size: 11px;
      color: #7a8a82;
      margin-top: 2px;
    }
    .task-stage-summary {
      font-size: 11px;
      color: #64726b;
      margin-top: 4px;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }
    .task-actions {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
      width: 100%;
      justify-content: flex-start;
    }
    .task-actions button {
      border: 1px solid var(--border);
      background: #ffffff;
      color: var(--muted);
      border-radius: 999px;
      padding: 5px 10px;
      font-size: 11px;
      cursor: pointer;
      font-family: inherit;
      font-weight: 600;
      transition: border-color 0.2s ease, color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
      white-space: nowrap;
    }
    .task-actions button:hover {
      color: var(--ink);
      border-color: #cad7ce;
      box-shadow: 0 6px 14px rgba(17, 24, 39, 0.08);
    }
    .task-actions button:active {
      transform: translateY(1px);
    }
    .task-stage-select {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 11px;
      color: var(--muted);
      background: #eef6f2;
      border: 1px solid #d6e4dd;
      border-radius: 999px;
      padding: 2px 8px 2px 10px;
      white-space: nowrap;
      max-width: 100%;
    }
    .task-stage-select select {
      border: none;
      background: transparent;
      color: var(--ink);
      font-size: 11px;
      font-family: inherit;
      cursor: pointer;
      padding: 0;
      font-weight: 600;
      min-width: 0;
    }
    .task-stage-select select:focus {
      outline: none;
    }
    .task-stage-hint {
      font-size: 11px;
      color: var(--muted);
      border: 1px dashed #d6e4dd;
      background: #f5f7f6;
      border-radius: 8px;
      padding: 4px 8px;
      max-width: 100%;
    }
    .task-item.done .task-title {
      color: var(--muted);
      text-decoration: line-through;
    }
    .task-delete {
      border: 1px solid #e6b3b3;
      background: #fff7f7;
      color: #b24747;
      cursor: pointer;
      font-size: 11px;
      flex-shrink: 0;
      white-space: nowrap;
      border-radius: 999px;
      padding: 4px 10px;
      margin-left: 0;
      transition: border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    }
    .task-delete:hover {
      color: #8f3333;
      border-color: #d39a9a;
      box-shadow: 0 6px 14px rgba(178, 71, 71, 0.12);
    }
    .task-aux {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 8px;
      min-width: 0;
      width: 100%;
      justify-content: flex-start;
    }

    .task-btn-primary {
      background: linear-gradient(135deg, #e8f7f1, #dff2e9);
      border-color: #bcdccf;
      color: #0f6f5a;
    }
    .task-btn-primary:hover {
      border-color: #a7cfc0;
      color: #0a5b49;
    }
    .task-btn-secondary {
      background: #ffffff;
      border-color: #d6e4dd;
      color: #2c4f45;
    }
    .task-btn-secondary:hover {
      border-color: #c5d7ce;
      color: #1f3c33;
    }
    .task-btn-danger {
      border-color: #e6b3b3;
      background: #fff7f7;
      color: #b24747;
    }
    .task-btn-danger:hover {
      border-color: #d39a9a;
      color: #8f3333;
    }
    .task-empty {
      font-size: 12px;
      color: var(--muted);
      padding: 4px;
    }
    @media (max-width: 520px) {
      .task-actions {
        justify-content: flex-start;
      }
      .task-aux {
        justify-content: flex-start;
      }
      .task-action-row {
        gap: 8px;
      }
    }
    .history-empty {
      font-size: 12px;
      color: var(--muted);
      padding: 6px 4px;
    }
    .task-status {
      font-size: 12px;
      min-height: 16px;
      color: var(--muted);
      margin: -2px 0 6px;
    }
    .task-status.error { color: #b24747; }
    .task-status.success { color: #0f7760; }

    .panel-modal {
      position: fixed;
      inset: 0;
      display: flex;
      align-items: flex-start;
      justify-content: center;
      padding: 90px 16px 24px;
      z-index: 1000;
    }
    .panel-modal[hidden] {
      display: none;
    }
    .panel-modal-backdrop {
      position: absolute;
      inset: 0;
      background: rgba(15, 23, 42, 0.35);
    }
    .panel-modal-card {
      position: relative;
      z-index: 1;
      width: min(760px, 92vw);
      max-height: 78vh;
      background: #ffffff;
      border-radius: 16px;
      border: 1px solid #e6ece5;
      box-shadow: var(--shadow);
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }
    .panel-modal-title {
      font-weight: 700;
      font-size: 16px;
      padding: 16px 18px;
      border-bottom: 1px solid var(--border);
      background: linear-gradient(120deg, #ffffff 0%, #f5faf7 100%);
    }
    .panel-modal-body {
      padding: 16px 18px;
      overflow: auto;
      font-size: 14px;
      color: var(--ink);
    }
    .goal-discovery-panel {
      display: flex;
      align-items: center;
      gap: 12px;
      margin: 0 0 12px;
      padding: 10px 14px;
      border-radius: 14px;
      border: 1px solid rgba(15, 111, 90, 0.14);
      background:
        radial-gradient(circle at top right, rgba(169, 221, 194, 0.14), transparent 36%),
        linear-gradient(135deg, rgba(247, 251, 248, 0.98), rgba(242, 248, 244, 0.98));
      box-shadow: 0 8px 18px rgba(13, 33, 24, 0.04);
    }
    .goal-discovery-panel-title {
      flex: 0 0 auto;
      font-size: 13px;
      font-weight: 700;
      color: var(--accent-strong);
    }
    .goal-discovery-panel-summary {
      min-width: 0;
      font-size: 13px;
      line-height: 1.5;
      color: var(--muted);
      white-space: pre-wrap;
    }
    .panel-divider {
      height: 1px;
      margin: 16px 0;
      background: linear-gradient(90deg, rgba(15, 111, 90, 0.15), rgba(218, 184, 120, 0.25), rgba(15, 111, 90, 0.1));
    }
    .panel-subtitle {
      font-size: 13px;
      font-weight: 700;
      color: var(--accent-strong);
      margin-bottom: 8px;
    }
    .panel-modal-actions {
      display: flex;
      justify-content: flex-end;
      gap: 10px;
      padding: 12px 18px 16px;
      border-top: 1px solid var(--border);
    }
    .panel-modal-btn {
      border: 1px solid #d2ddd6;
      background: #ffffff;
      color: var(--ink);
      border-radius: 999px;
      padding: 6px 16px;
      font-size: 12px;
      cursor: pointer;
      font-family: inherit;
      font-weight: 600;
    }
    .panel-modal-btn.primary {
      background: #0f7760;
      color: #ffffff;
      border-color: #0f7760;
    }
    .panel-label {
      font-size: 12px;
      color: #44524b;
      margin-top: 6px;
      display: block;
    }
    .panel-input,
    .panel-textarea {
      width: 100%;
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 8px 10px;
      font-size: 13px;
      font-family: inherit;
      margin: 6px 0 10px;
      background: #ffffff;
    }
    .panel-textarea {
      min-height: 120px;
      resize: vertical;
    }
    .panel-tip {
      min-height: 14px;
      font-size: 12px;
      color: #0f7760;
      margin-top: 4px;
    }
    .panel-tip.error { color: #b24747; }
    .panel-hint {
      font-size: 12px;
      color: var(--muted);
      margin-bottom: 8px;
    }
    .panel-hint.warning {
      color: #8a6a2b;
    }
    .reference-links-card {
      width: min(680px, 92vw);
    }
    .reference-links-mode {
      margin-bottom: 12px;
      padding: 9px 12px;
      border-radius: 10px;
      border: 1px solid rgba(15, 111, 90, 0.14);
      background: linear-gradient(135deg, rgba(247, 251, 249, 0.96), rgba(255, 255, 255, 0.98));
      font-size: 12px;
      color: #31584b;
      font-weight: 600;
    }
    .reference-links-add {
      display: flex;
      gap: 10px;
      align-items: center;
      margin-bottom: 10px;
    }
    .reference-links-add .panel-input {
      flex: 1;
      min-width: 0;
      margin-bottom: 0;
    }
    .reference-links-input-hint {
      margin-top: -2px;
      margin-bottom: 10px;
      padding: 8px 10px;
      border-radius: 10px;
      border: 1px solid rgba(15, 111, 90, 0.14);
      background: linear-gradient(135deg, rgba(243, 250, 247, 0.96), rgba(255, 255, 255, 0.98));
      color: rgba(15, 91, 72, 0.92);
    }
    .reference-links-recommended {
      display: flex;
      flex-direction: column;
      gap: 8px;
      margin: 12px 0 14px;
      padding: 12px;
      border: 1px solid rgba(15, 111, 90, 0.12);
      border-radius: 12px;
      background: linear-gradient(180deg, rgba(248, 252, 249, 0.96), rgba(255, 255, 255, 0.98));
    }
    .reference-links-recommended-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }
    .reference-links-recommended-title {
      font-size: 12px;
      font-weight: 700;
      color: #2c5c4d;
    }
    .reference-links-recommended-item,
    .reference-links-item {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 10px;
      align-items: center;
      padding: 10px 12px;
      border-radius: 12px;
      border: 1px solid rgba(15, 111, 90, 0.12);
      background: #ffffff;
    }
    .reference-links-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .reference-links-list-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-top: 2px;
    }
    .reference-links-header-actions {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
      justify-content: flex-end;
    }
    .reference-links-list-title {
      font-size: 12px;
      font-weight: 700;
      color: #2c5c4d;
    }
    .reference-links-empty {
      padding: 14px 12px;
      border-radius: 12px;
      border: 1px dashed rgba(15, 111, 90, 0.18);
      background: #fbfefd;
      font-size: 12px;
      color: #587066;
    }
    .reference-links-item-main {
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 4px;
    }
    .reference-links-item-title {
      font-size: 13px;
      font-weight: 700;
      color: #183d33;
      word-break: break-word;
    }
    .reference-links-item-url {
      font-size: 12px;
      color: #5e756a;
      word-break: break-all;
    }
    .reference-links-item-actions {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
      justify-content: flex-end;
    }
    .reference-links-item-buttons {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
      justify-content: flex-end;
    }
    .reference-links-status {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 24px;
      padding: 0 10px;
      border-radius: 999px;
      border: 1px solid rgba(15, 111, 90, 0.14);
      background: rgba(15, 111, 90, 0.06);
      color: #2c5c4d;
      font-size: 11px;
      font-weight: 700;
      white-space: nowrap;
    }
    .reference-links-status.processing {
      background: rgba(24, 116, 160, 0.08);
      border-color: rgba(24, 116, 160, 0.16);
      color: #186987;
    }
    .reference-links-status.failed {
      background: rgba(191, 118, 118, 0.08);
      border-color: rgba(191, 118, 118, 0.18);
      color: #a34d4d;
    }
    .reference-links-ghost-btn {
      border: 1px solid rgba(15, 111, 90, 0.16);
      background: #ffffff;
      color: #2b5245;
      border-radius: 999px;
      padding: 6px 12px;
      font-size: 12px;
      font-weight: 600;
      cursor: pointer;
      font-family: inherit;
    }
    .reference-links-ghost-btn:hover {
      border-color: rgba(15, 111, 90, 0.32);
      background: #f7fbf9;
    }
    .ui-tooltip {
      position: fixed;
      z-index: 1100;
      max-width: 280px;
      padding: 8px 10px;
      border-radius: 10px;
      border: 1px solid rgba(15, 111, 90, 0.16);
      background: rgba(255, 255, 255, 0.98);
      box-shadow: 0 12px 28px rgba(15, 111, 90, 0.14);
      color: #22483c;
      font-size: 12px;
      line-height: 1.45;
      pointer-events: none;
      opacity: 0;
      transform: translateY(2px);
      transition: opacity 0.14s ease, transform 0.14s ease;
    }
    .ui-tooltip.is-visible {
      opacity: 1;
      transform: translateY(0);
    }
    @media (max-width: 720px) {
      .reference-links-add {
        flex-direction: column;
        align-items: stretch;
      }
      .reference-links-add .panel-modal-btn {
        width: 100%;
      }
      .reference-links-recommended-item,
      .reference-links-item {
        grid-template-columns: 1fr;
      }
      .reference-links-recommended-header {
        align-items: stretch;
        flex-direction: column;
      }
      .reference-links-list-header {
        align-items: stretch;
        flex-direction: column;
      }
      .reference-links-header-actions {
        justify-content: flex-start;
      }
      .reference-links-item-actions {
        justify-content: flex-start;
      }
      .reference-links-item-buttons {
        justify-content: flex-start;
      }
    }
    .key-status {
      font-size: 12px;
      color: var(--muted);
      margin-top: 6px;
    }
    .key-status.error {
      color: #b24747;
    }
    .panel-loading {
      font-size: 12px;
      color: var(--muted);
    }
    .announcement-body > :first-child {
      margin-top: 0;
    }
    .support-note {
      font-size: 14px;
      color: var(--muted);
      margin-bottom: 14px;
    }
    .support-link {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 10px 16px;
      border-radius: 999px;
      border: 1px solid rgba(15, 111, 90, 0.35);
      background: #ffffff;
      color: #0f7760;
      font-weight: 700;
      text-decoration: none;
      box-shadow: 0 8px 18px rgba(15, 111, 90, 0.18);
      transition: transform 0.15s ease, box-shadow 0.2s ease;
    }
    .support-link:hover {
      transform: translateY(-1px);
      box-shadow: 0 12px 22px rgba(15, 111, 90, 0.24);
    }
    .plan-modal {
      position: fixed;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 1000;
    }
    .plan-modal[hidden] {
      display: none;
    }
    .plan-modal-backdrop {
      position: absolute;
      inset: 0;
      background: rgba(15, 23, 42, 0.45);
    }
    .plan-modal-card {
      position: relative;
      z-index: 1;
      background: #ffffff;
      border-radius: 16px;
      border: 1px solid #e6ece5;
      width: min(760px, 92vw);
      max-height: 82vh;
      box-shadow: var(--shadow);
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }
    .plan-modal-title {
      font-size: 16px;
      font-weight: 700;
      color: var(--ink);
      padding: 16px 20px;
      border-bottom: 1px solid var(--border);
      background: linear-gradient(120deg, #ffffff 0%, #f5faf7 100%);
    }
    .plan-modal-body {
      padding: 16px 20px;
      font-size: 14px;
      line-height: 1.65;
      color: #43514a;
      overflow: auto;
      flex: 1;
      min-height: 0;
    }
    .plan-modal-body ul {
      padding-left: 20px;
      margin: 8px 0 0;
    }
    .plan-modal-body li + li {
      margin-top: 6px;
    }
    .plan-modal-subtitle {
      font-size: 13px;
      font-weight: 700;
      margin-bottom: 8px;
      color: var(--accent-strong);
    }
    .plan-modal-goal {
      font-size: 14px;
      color: #2c3a34;
      font-weight: 600;
      line-height: 1.5;
    }
    .plan-modal-list {
      padding-top: 4px;
    }
    .plan-modal-actions {
      display: flex;
      justify-content: flex-end;
      gap: 8px;
      padding: 12px 20px 18px;
      border-top: 1px solid var(--border);
      flex-wrap: wrap;
    }
    .plan-modal-btn {
      border: 1px solid #d2ddd6;
      background: #ffffff;
      color: var(--ink);
      border-radius: 999px;
      padding: 6px 14px;
      font-size: 12px;
      cursor: pointer;
      font-family: inherit;
    }
    .plan-modal-btn.primary {
      background: #0f7760;
      color: #ffffff;
      border-color: #0f7760;
    }
    @media (max-width: 640px) {
      .plan-modal-card {
        width: 94vw;
        max-height: 88vh;
      }
      .plan-modal-title,
      .plan-modal-body,
      .plan-modal-actions {
        padding-left: 16px;
        padding-right: 16px;
      }
      .plan-modal-actions {
        justify-content: stretch;
      }
      .plan-modal-btn {
        flex: 1 1 160px;
        min-height: 40px;
      }
    }


    .auth-modal {
      position: fixed;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 1100;
    }
    .auth-modal[hidden] {
      display: none;
    }
    .auth-modal-backdrop {
      position: absolute;
      inset: 0;
      background: rgba(15, 23, 42, 0.45);
    }
    .auth-modal-card {
      position: relative;
      z-index: 1;
      background: #ffffff;
      border-radius: 16px;
      padding: 18px 20px;
      width: min(420px, 92vw);
      box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
      display: flex;
      flex-direction: column;
      gap: 12px;
    }
    .auth-modal-title {
      font-size: 16px;
      font-weight: 600;
    }
    .auth-modal-tabs {
      display: flex;
      gap: 8px;
    }
    .auth-tab {
      border: 1px solid #d2ddd6;
      background: #ffffff;
      color: var(--muted);
      border-radius: 999px;
      padding: 6px 14px;
      font-size: 12px;
      cursor: pointer;
      font-family: inherit;
    }
    .auth-tab.active {
      background: #0f7760;
      color: #ffffff;
      border-color: #0f7760;
    }
    .auth-modal-body {
      display: grid;
      gap: 8px;
    }
    .auth-label {
      font-size: 12px;
      color: #44524b;
    }
    .auth-input {
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 8px 10px;
      font-size: 13px;
      font-family: inherit;
      background: #ffffff;
    }
    .auth-tip {
      min-height: 14px;
      font-size: 12px;
      color: #b24747;
    }
    .auth-note {
      font-size: 12px;
      color: #8a6a2b;
    }
    .auth-turnstile {
      min-height: 65px;
    }
    .auth-modal-actions {
      display: flex;
      justify-content: flex-end;
      gap: 8px;
    }
    .auth-modal-btn {
      border: 1px solid #d2ddd6;
      background: #ffffff;
      color: var(--ink);
      border-radius: 999px;
      padding: 6px 14px;
      font-size: 12px;
      cursor: pointer;
      font-family: inherit;
    }
    .auth-modal-btn.primary {
      background: #0f7760;
      color: #ffffff;
      border-color: #0f7760;
    }

    .chat-area {
      grid-area: chat;
      display: flex;
      flex-direction: column;
      min-width: 0;
      flex: 1;
      min-height: 0;
      background: rgba(255, 255, 255, 0.92);
      border: 1px solid #e6ece5;
      border-radius: 16px;
      box-shadow: var(--glow);
      overflow: hidden;
    }
    .chat-status {
      font-size: 12px;
      color: var(--muted);
      min-height: 16px;
      width: min(980px, calc(100% - 36px));
      align-self: center;
      padding: 10px 0 0;
    }
    .chat-status.error { color: #b24747; }
    .step-goal-panel {
      margin: 12px 18px 0;
      padding: 12px 14px;
      border: 1px solid #cfe0d6;
      background: linear-gradient(135deg, #f4fbf8, #eef7f2);
      border-radius: 14px;
      box-shadow: 0 10px 22px rgba(15, 111, 90, 0.12);
      position: relative;
      overflow: hidden;
      max-height: 72px;
      transition: max-height 0.2s ease, box-shadow 0.2s ease;
    }
    .step-goal-panel:not(.empty) {
      cursor: default;
    }
    .step-goal-panel::after {
      content: "";
      position: absolute;
      inset: 0;
      border-top: 3px solid rgba(15, 111, 90, 0.4);
      border-radius: 14px;
      pointer-events: none;
    }
    .step-goal-panel.empty {
      background: #f7f7f8;
      border-color: #e5e5e5;
      box-shadow: none;
    }
    .step-goal-panel.hover-expanded,
    .step-goal-panel.expanded {
      max-height: 60vh;
      overflow: auto;
    }
    .step-goal-header {
      min-width: 0;
      display: flex;
      align-items: center;
      justify-content: flex-start;
      gap: 12px;
      flex-wrap: nowrap;
    }
    .step-goal-title {
      flex: 0 0 auto;
      font-weight: 700;
      font-size: 14px;
    }
    .step-goal-summary {
      flex: 1 1 auto;
      min-width: 0;
      margin-top: 0;
      font-size: 13px;
      color: #1f2d2a;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .step-goal-summary-main {
      color: inherit;
    }
    .step-goal-summary-hint {
      font-size: 12px;
      color: #66766f;
    }
    .step-goal-actions {
      margin-left: auto;
      flex: 0 0 auto;
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: nowrap;
    }
    .step-goal-input {
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 6px 8px;
      font-size: 12px;
      min-width: 180px;
    }
    .step-goal-btn {
      border: 1px solid rgba(15, 119, 96, 0.35);
      background: #ffffff;
      color: #0f7760;
      padding: 6px 10px;
      border-radius: 10px;
      font-size: 12px;
      cursor: pointer;
      font-weight: 600;
      transition: border-color 0.2s ease, color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    }
    .step-goal-btn:hover {
      border-color: rgba(15, 111, 90, 0.6);
      box-shadow: 0 6px 12px rgba(15, 111, 90, 0.12);
    }
    .step-goal-btn:active {
      transform: translateY(1px);
    }
    .step-goal-btn:disabled {
      opacity: 0.6;
      cursor: not-allowed;
    }
    .step-goal-btn.secondary {
      color: #325a4f;
      border-color: rgba(50, 90, 79, 0.2);
      background: rgba(255, 255, 255, 0.86);
    }
    .step-goal-full {
      margin-top: 8px;
      padding-top: 8px;
      border-top: 1px solid rgba(29, 36, 31, 0.08);
      font-size: 13px;
      color: #344;
      line-height: 1.6;
      display: none;
    }
    .step-goal-full > :first-child {
      margin-top: 0;
    }
    .step-goal-full > :last-child {
      margin-bottom: 0;
    }
    .step-goal-panel.hover-expanded .step-goal-full,
    .step-goal-panel.expanded .step-goal-full {
      display: block;
    }
    .question-suggestion-list {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
    }
    .question-suggestion-chip {
      width: 100%;
      display: flex;
      align-items: flex-start;
      gap: 8px;
      text-align: left;
      padding: 10px 12px;
      border-radius: 12px;
      border: 1px solid #d7e7dd;
      background: #fff;
      color: #17362b;
      cursor: pointer;
      transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
    }
    .question-suggestion-chip:hover {
      border-color: rgba(15, 111, 90, 0.4);
      box-shadow: 0 8px 16px rgba(15, 111, 90, 0.08);
    }
    .question-suggestion-chip:active {
      transform: translateY(1px);
    }
    .question-suggestion-index {
      flex: 0 0 auto;
      font-size: 12px;
      font-weight: 700;
      color: #0f7760;
      line-height: 1.5;
    }
    .question-suggestion-text {
      min-width: 0;
      font-size: 13px;
      line-height: 1.55;
    }
    .agent-status-panel {
      margin: 10px 0 10px;
      padding: 12px 14px;
      border-radius: 14px;
      border: 1px solid #d7e7dd;
      background:
        radial-gradient(circle at top right, rgba(169, 221, 194, 0.28), transparent 42%),
        linear-gradient(180deg, #f7fbf8 0%, #f1f7f4 100%);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
    }
    .agent-status-panel.complete {
      border-color: #c9dfd1;
      background:
        radial-gradient(circle at top right, rgba(169, 221, 194, 0.18), transparent 40%),
        linear-gradient(180deg, #f9fcfa 0%, #f4faf6 100%);
    }
    .agent-status-head {
      display: flex;
      align-items: center;
      gap: 10px;
      min-width: 0;
    }
    .agent-status-dot {
      width: 11px;
      height: 11px;
      border-radius: 50%;
      background: linear-gradient(135deg, #0f766e, #1f8f61);
      box-shadow: 0 0 0 4px rgba(31, 143, 97, 0.12);
      flex: 0 0 auto;
      animation: agentPulse 1.6s ease-in-out infinite;
    }
    .agent-status-panel.complete .agent-status-dot {
      animation: none;
      box-shadow: 0 0 0 4px rgba(31, 143, 97, 0.08);
    }
    .agent-status-label {
      font-size: 13px;
      font-weight: 600;
      color: #143126;
      line-height: 1.5;
      letter-spacing: 0.1px;
    }
    .agent-status-flow {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 10px;
    }
    .agent-status-chip {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      border-radius: 999px;
      padding: 5px 10px;
      font-size: 12px;
      line-height: 1.2;
      border: 1px solid transparent;
      white-space: nowrap;
    }
    .agent-status-chip.done {
      background: rgba(31, 143, 97, 0.1);
      color: #166244;
      border-color: rgba(31, 143, 97, 0.16);
    }
    .agent-status-chip.pending {
      background: rgba(148, 163, 184, 0.12);
      color: #506072;
      border-color: rgba(148, 163, 184, 0.2);
    }
    .activity-status-panel {
      margin: 10px 0 10px;
      padding: 10px 12px;
      border-radius: 14px;
      border: 1px solid #dde7ef;
      background:
        radial-gradient(circle at top right, rgba(188, 220, 236, 0.2), transparent 44%),
        linear-gradient(180deg, #fbfcfd 0%, #f6f8fb 100%);
    }
    .activity-status-head {
      display: flex;
      align-items: center;
      gap: 10px;
      min-width: 0;
    }
    .activity-status-dot {
      width: 10px;
      height: 10px;
      border-radius: 50%;
      background: linear-gradient(135deg, #0f766e, #1d4ed8);
      box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.08);
      flex: 0 0 auto;
      animation: agentPulse 1.6s ease-in-out infinite;
    }
    .activity-status-label {
      font-size: 13px;
      font-weight: 600;
      color: #243648;
      line-height: 1.45;
      letter-spacing: 0.08px;
    }
    .activity-status-done {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 8px;
    }
    .activity-status-chip {
      display: inline-flex;
      align-items: center;
      border-radius: 999px;
      padding: 4px 9px;
      font-size: 12px;
      line-height: 1.2;
      color: #496273;
      background: rgba(148, 163, 184, 0.12);
      border: 1px solid rgba(148, 163, 184, 0.18);
      white-space: nowrap;
    }
    .message-citation {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 2.4em;
      margin-left: 0.34em;
      padding: 0.08em 0.5em;
      border-radius: 999px;
      border: 1px solid rgba(15, 111, 90, 0.2);
      background: rgba(15, 111, 90, 0.1);
      color: #0f6f5a;
      font-size: 0.84em;
      font-weight: 700;
      line-height: 1.35;
      vertical-align: baseline;
      white-space: nowrap;
      cursor: pointer;
      transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
    }
    .message-citation + .message-citation {
      margin-left: 0.18em;
    }
    .message-citation:hover {
      border-color: rgba(15, 111, 90, 0.32);
      background: rgba(15, 111, 90, 0.14);
      box-shadow: 0 6px 14px rgba(15, 111, 90, 0.12);
      transform: translateY(-1px);
    }
    .message-citation.is-previewing {
      border-color: rgba(15, 111, 90, 0.34);
      background: rgba(15, 111, 90, 0.16);
      box-shadow: 0 8px 18px rgba(15, 111, 90, 0.16);
      transform: translateY(-1px);
    }
    .message-citation:focus-visible {
      outline: none;
      border-color: rgba(15, 111, 90, 0.5);
      box-shadow: 0 0 0 3px rgba(15, 111, 90, 0.16);
    }
    .citation-preview {
      position: fixed;
      z-index: 80;
      width: min(380px, calc(100vw - 32px));
      padding: 14px 16px;
      border-radius: 16px;
      border: 1px solid rgba(15, 111, 90, 0.18);
      background: rgba(252, 255, 253, 0.98);
      box-shadow: 0 16px 36px rgba(23, 52, 43, 0.16);
      backdrop-filter: blur(10px);
    }
    .citation-preview[hidden] {
      display: none;
    }
    .citation-preview-content {
      max-height: 300px;
      overflow-y: auto;
      color: #26453d;
      font-size: 13px;
      line-height: 1.65;
      white-space: pre-wrap;
      overflow-wrap: anywhere;
      padding-right: 2px;
    }
    .message-sources {
      margin-top: 12px;
      padding-top: 12px;
      border-top: 1px solid rgba(148, 163, 184, 0.2);
    }
    .message-sources-toggle {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 0;
      border: none;
      background: transparent;
      color: var(--ink);
      font: inherit;
      cursor: pointer;
    }
    .message-sources-toggle:hover .message-sources-label,
    .message-sources-toggle:hover .message-sources-count {
      color: var(--accent-strong);
    }
    .message-sources-toggle:focus-visible {
      outline: none;
      border-radius: 10px;
      box-shadow: 0 0 0 3px rgba(15, 118, 96, 0.14);
    }
    .message-sources-label {
      font-size: 12px;
      font-weight: 700;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      color: var(--muted);
    }
    .message-sources-count {
      font-size: 12px;
      font-weight: 600;
      color: var(--muted);
    }
    .message-sources-chevron {
      width: 8px;
      height: 8px;
      border-right: 1.5px solid currentColor;
      border-bottom: 1.5px solid currentColor;
      transform: rotate(45deg) translateY(-1px);
      color: var(--muted);
      transition: transform 0.2s ease, color 0.2s ease;
    }
    .message-sources.is-expanded .message-sources-chevron {
      transform: rotate(225deg) translateY(-1px);
      color: var(--accent-strong);
    }
    .message-sources-list {
      gap: 8px;
      margin-top: 8px;
    }
    .message-sources-list[hidden] {
      display: none;
    }
    .message-sources:not(.is-expanded) .message-sources-list {
      display: none;
    }
    .message-sources.is-expanded .message-sources-list {
      display: grid;
    }
    .learning-defaults-probe {
      margin-top: 12px;
      padding: 12px;
      border-radius: 14px;
      border: 1px solid rgba(15, 111, 90, 0.16);
      background: rgba(255, 255, 255, 0.82);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
    }
    .learning-defaults-probe-question {
      font-size: 13px;
      line-height: 1.5;
      color: var(--ink);
      font-weight: 600;
      margin-bottom: 10px;
    }
    .learning-defaults-probe-options {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }
    .learning-defaults-probe-option {
      border: 1px solid rgba(15, 111, 90, 0.18);
      background: #ffffff;
      color: var(--accent-strong);
      border-radius: 999px;
      padding: 7px 12px;
      font-size: 12px;
      line-height: 1.2;
      font-weight: 600;
      font-family: inherit;
      cursor: pointer;
      transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, transform 0.15s ease;
    }
    .learning-defaults-probe-option:hover {
      border-color: rgba(15, 111, 90, 0.42);
      box-shadow: 0 8px 16px rgba(15, 111, 90, 0.08);
    }
    .learning-defaults-probe-option:disabled {
      cursor: wait;
      opacity: 0.72;
      box-shadow: none;
      transform: none;
    }
    .learning-defaults-probe-option:active {
      transform: translateY(1px);
    }
    .learning-defaults-probe-option.selected {
      background: rgba(15, 111, 90, 0.12);
      border-color: rgba(15, 111, 90, 0.55);
      box-shadow: 0 8px 16px rgba(15, 111, 90, 0.08);
    }
    .learning-defaults-probe.is-error {
      border-color: rgba(178, 71, 71, 0.28);
    }
    .learning-defaults-probe.is-error .learning-defaults-probe-hint {
      color: #b24747;
    }
    .learning-defaults-probe-hint {
      margin-top: 10px;
      font-size: 12px;
      line-height: 1.45;
      color: var(--muted);
    }
    .message-source-link {
      display: flex;
      flex-direction: column;
      gap: 3px;
      padding: 10px 12px;
      border-radius: 12px;
      text-decoration: none;
      background: rgba(255, 255, 255, 0.7);
      border: 1px solid rgba(148, 163, 184, 0.22);
      transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    }
    .message-source-link:hover {
      transform: translateY(-1px);
      border-color: rgba(15, 118, 96, 0.28);
      box-shadow: 0 10px 18px rgba(15, 23, 42, 0.06);
    }
    .message-source-link:focus-visible {
      outline: none;
      border-color: rgba(15, 118, 96, 0.42);
      box-shadow: 0 0 0 3px rgba(15, 118, 96, 0.14);
    }
    .message-source-link.is-linked {
      border-color: rgba(15, 118, 96, 0.42);
      background: rgba(15, 118, 96, 0.08);
      box-shadow: 0 0 0 3px rgba(15, 118, 96, 0.12), 0 12px 24px rgba(15, 23, 42, 0.08);
    }
    .message-source-id {
      align-self: flex-start;
      display: inline-flex;
      align-items: center;
      padding: 2px 7px;
      border-radius: 999px;
      font-size: 11px;
      font-weight: 700;
      letter-spacing: 0.04em;
      color: #0f766e;
      background: rgba(15, 118, 96, 0.1);
      border: 1px solid rgba(15, 118, 96, 0.16);
    }
    .message-source-title {
      font-size: 14px;
      font-weight: 600;
      color: var(--ink);
      word-break: break-word;
    }
    .message-source-host {
      font-size: 12px;
      color: var(--muted);
      word-break: break-word;
    }
    .reasoning-panel {
      margin: 10px 0 8px;
      border: none;
      background: transparent;
      padding: 0;
    }
    .reasoning-panel summary {
      cursor: pointer;
      list-style: none;
      font-weight: 600;
      color: #0f172a;
      display: inline-flex;
      align-items: center;
      gap: 10px;
      padding: 8px 14px;
      border-radius: 12px;
      background: #f1f5f9;
      border: 1px solid #e2e8f0;
      box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
    }
    .reasoning-panel summary::-webkit-details-marker {
      display: none;
    }
    .reasoning-icon {
      width: 18px;
      height: 18px;
      border-radius: 50%;
      border: 2px solid #0f172a;
      display: inline-block;
      position: relative;
    }
    .reasoning-icon::after {
      content: "";
      position: absolute;
      width: 4px;
      height: 4px;
      border-radius: 50%;
      background: #0f172a;
      top: 5px;
      left: 5px;
    }
    .reasoning-label {
      font-size: 13px;
      letter-spacing: 0.2px;
    }
    .reasoning-caret {
      width: 8px;
      height: 8px;
      border-right: 2px solid #64748b;
      border-bottom: 2px solid #64748b;
      transform: rotate(45deg);
      margin-left: 4px;
      transition: transform 0.2s ease;
    }
    .reasoning-panel[open] .reasoning-caret {
      transform: rotate(225deg);
    }
    .reasoning-content {
      font-size: 14px;
      color: #5f6b7a;
      line-height: 1.85;
      white-space: pre-wrap;
      margin-top: 10px;
      padding: 6px 0 6px 16px;
      border-left: 2px solid #dbe3ef;
      font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", serif;
      letter-spacing: 0.2px;
      scrollbar-width: thin;
      scrollbar-color: rgba(140, 140, 140, 0.6) transparent;
    }
    .reasoning-content::-webkit-scrollbar {
      width: 8px;
    }
    .reasoning-content::-webkit-scrollbar-thumb {
      background: rgba(140, 140, 140, 0.5);
      border-radius: 8px;
    }
    @keyframes agentPulse {
      0%, 100% { transform: scale(1); opacity: 1; }
      50% { transform: scale(0.88); opacity: 0.78; }
    }
    .chat {
      padding: 14px 14px 8px;
      flex: 1;
      min-height: 0;
      overflow-y: auto;
      background: transparent;
      display: flex;
      flex-direction: column;
      align-items: stretch;
      gap: 6px;
    }
    .msg {
      width: min(var(--message-rail-width), 100%);
      align-self: center;
      display: flex;
      gap: 12px;
      margin: 12px 0 18px;
      animation: fadeUp 0.28s ease both;
    }
    .msg.user { justify-content: flex-end; }
    .msg.assistant { justify-content: center; }
    .bubble {
      max-width: 78%;
      padding: 14px 16px;
      border-radius: 16px;
      border: 1px solid var(--border);
      line-height: 1.7;
      font-size: 15px;
      background: #fff;
    }
    .bubble.assistant {
      width: min(920px, 100%);
      max-width: 100%;
      background: transparent;
      border: none;
      padding: 0 4px;
      min-width: 0;
    }
    .bubble.user {
      background: linear-gradient(135deg, #e7f7f0, #dff2ea);
      border-color: rgba(15, 111, 90, 0.25);
      box-shadow: 0 10px 18px rgba(15, 111, 90, 0.15);
    }
    .bubble.assistant {
      background: var(--assistant);
      border: 1px solid #e6e6e6;
      box-shadow: 0 10px 20px rgba(17, 24, 39, 0.08);
    }
    .bubble-toolbar {
      display: flex;
      justify-content: flex-end;
      gap: 8px;
      margin: 0 0 6px;
    }
    .copy-btn {
      border: 1px solid var(--border);
      background: #ffffff;
      color: var(--muted);
      border-radius: 10px;
      padding: 5px 10px;
      font-size: 12px;
      cursor: pointer;
      transition: border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
    }
    .copy-btn:hover {
      color: var(--ink);
      border-color: #cad7ce;
      box-shadow: 0 6px 12px rgba(17, 24, 39, 0.08);
    }
    .copy-btn:active {
      transform: translateY(1px);
    }
    .edit-btn {
      border: 1px solid var(--border);
      background: #ffffff;
      color: var(--muted);
      border-radius: 10px;
      padding: 5px 10px;
      font-size: 12px;
      cursor: pointer;
      transition: border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
    }
    .edit-btn:hover {
      color: var(--ink);
      border-color: #cad7ce;
      box-shadow: 0 6px 12px rgba(17, 24, 39, 0.08);
    }
    .edit-btn:active {
      transform: translateY(1px);
    }
    .edit-input {
      width: 100%;
      min-height: 88px;
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 10px 12px;
      font-size: 14px;
      line-height: 1.6;
      font-family: inherit;
      resize: vertical;
      background: #ffffff;
    }
    .keyword-tag {
      display: inline-flex;
      align-items: center;
      padding: 2px 8px;
      border-radius: 999px;
      font-size: 12px;
      font-weight: 700;
      letter-spacing: 0.3px;
      border: 1px solid transparent;
      margin-right: 4px;
      vertical-align: middle;
    }
    .keyword-done {
      color: #0f5f4a;
      background: rgba(22, 163, 74, 0.12);
      border-color: rgba(22, 163, 74, 0.25);
    }
    .keyword-next {
      color: #92400e;
      background: rgba(245, 158, 11, 0.15);
      border-color: rgba(245, 158, 11, 0.35);
    }
    .keyword-key {
      color: #1e3a8a;
      background: rgba(59, 130, 246, 0.14);
      border-color: rgba(59, 130, 246, 0.3);
    }
    .edit-actions {
      display: flex;
      justify-content: flex-end;
      gap: 8px;
      margin-top: 8px;
    }
    .edit-action {
      border: 1px solid var(--border);
      background: #ffffff;
      color: var(--muted);
      border-radius: 8px;
      padding: 6px 10px;
      font-size: 12px;
      cursor: pointer;
      transition: border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
    }
    .edit-action:hover {
      color: var(--ink);
      border-color: #cad7ce;
      box-shadow: 0 6px 12px rgba(17, 24, 39, 0.08);
    }
    .edit-action:active {
      transform: translateY(1px);
    }
    .edit-action.primary {
      background: linear-gradient(135deg, var(--accent), var(--accent-strong));
      color: #ffffff;
      border-color: var(--accent);
    }
    .edit-action.primary:hover {
      filter: brightness(0.95);
    }
    .bubble p { margin: 8px 0; }
    .bubble h1, .bubble h2, .bubble h3 { margin: 12px 0 6px; font-weight: 700; }
    .bubble ul, .bubble ol { margin: 8px 0 8px 18px; }
    .bubble a {
      color: #0f7760;
      text-decoration: underline;
      word-break: break-word;
    }
    .bubble code {
      background: rgba(0,0,0,0.06);
      padding: 2px 6px;
      border-radius: 6px;
      font-family: "JetBrains Mono", "Cascadia Code", monospace;
    }
    .bubble pre {
      background: #1f1f1f;
      color: #f6f3ec;
      padding: 12px;
      border-radius: 12px;
      overflow-x: auto;
      font-size: 13px;
      width: 100%;
      box-sizing: border-box;
      margin: 8px 0;
      max-width: 100%;
      white-space: pre;
      scrollbar-width: none;
    }
    .bubble pre::-webkit-scrollbar {
      height: 0;
      width: 0;
    }
    .code-module {
      margin: 10px 0 14px;
      border: 1px solid var(--border);
      border-radius: 12px;
      background: #ffffff;
      overflow: hidden;
    }
    .code-header {
      display: flex;
      align-items: center;
      justify-content: flex-start;
      padding: 8px 12px;
      font-size: 12px;
      color: var(--muted);
      border-bottom: 1px solid var(--border);
      background: #f9f9f9;
    }
    .code-module pre {
      margin: 0;
      border-radius: 0 0 12px 12px;
    }
    .code-module pre code {
      padding: 0;
      background: transparent;
      border-radius: 0;
    }
    .input {
      padding: 16px 18px 20px;
      border-top: 1px solid #e6ece5;
      background: linear-gradient(180deg, #ffffff 0%, #f7faf8 100%);
      position: relative;
    }
    .input-shell {
      width: min(100%, 980px);
      margin: 0 auto;
      position: relative;
      border-radius: 18px;
      border: 1px solid rgba(29, 36, 31, 0.1);
      background: rgba(250, 252, 248, 0.98);
      transition: border-color 0.18s ease, box-shadow 0.18s ease;
    }
    .input-shell:focus-within {
      border-color: rgba(26, 127, 99, 0.24);
      box-shadow: 0 0 0 4px rgba(26, 127, 99, 0.08);
    }
    textarea {
      width: 100%;
      resize: none;
      height: 92px;
      padding: 12px 124px 14px 14px;
      border-radius: 18px;
      border: none;
      font-family: inherit;
      font-size: 15px;
      background: transparent;
    }
    .slash-menu {
      position: absolute;
      left: 0;
      top: -8px;
      max-width: 100%;
      background: #ffffff;
      border: 1px solid #e1e7df;
      border-radius: 14px;
      box-shadow: 0 16px 40px rgba(41, 66, 57, 0.12);
      padding: 6px;
      z-index: 25;
      display: flex;
      flex-direction: column;
      gap: 4px;
    }
    .slash-menu[hidden] {
      display: none;
    }
    .slash-item {
      display: flex;
      flex-direction: column;
      gap: 4px;
      border: none;
      background: transparent;
      padding: 8px 10px;
      border-radius: 10px;
      text-align: left;
      cursor: pointer;
      transition: background 0.15s ease, transform 0.15s ease;
    }
    .slash-item:hover {
      background: #f1f6f2;
    }
    .slash-item.active {
      background: #e7f2ea;
      transform: translateY(-1px);
    }
    .slash-command {
      font-weight: 700;
      color: #23433b;
      font-size: 13px;
    }
    .slash-desc {
      color: #4f6a60;
      font-size: 12px;
    }
    button.send {
      border: 1px solid transparent;
      padding: 10px 16px;
      border-radius: 14px;
      cursor: pointer;
      font-family: inherit;
      font-weight: 600;
      background: linear-gradient(135deg, var(--accent), var(--accent-strong));
      color: white;
      box-shadow: 0 12px 20px rgba(15, 111, 90, 0.24);
      transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
    }
    button.send:hover {
      filter: brightness(1.05);
      box-shadow: 0 14px 26px rgba(15, 111, 90, 0.28);
    }
    button.send:active {
      transform: translateY(1px);
    }
    button.send:disabled {
      opacity: 0.55;
      cursor: not-allowed;
    }
    button.send.stop {
      background: #ffffff;
      color: var(--accent);
      border-color: var(--accent);
    }
    .input-shell .send {
      position: absolute;
      right: 12px;
      bottom: 12px;
      min-width: 88px;
    }
    header,
    .sidebar,
    .chat-area,
    .tasks-panel {
      animation: softRise 0.38s ease both;
    }
    .tasks-panel { animation-delay: 0.04s; }
    .chat-area { animation-delay: 0.08s; }
    .sidebar { animation-delay: 0.12s; }
    @keyframes softRise {
      from { opacity: 0; transform: translateY(10px); }
      to { opacity: 1; transform: translateY(0); }
    }
    @keyframes fadeUp {
      from { opacity: 0; transform: translateY(6px); }
      to { opacity: 1; transform: translateY(0); }
    }
    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after {
        animation: none !important;
        transition: none !important;
      }
    }
    @media (max-width: 1100px) {
      body { padding: 0; }
      .frame { height: 100vh; border-radius: 0; }
      .content {
        grid-template-columns: 1fr;
        grid-template-areas: "tasks" "chat";
        height: auto;
        padding: 10px;
      }
      .tasks-panel { border-bottom: 1px solid var(--border); }
      .sidebar {
        top: 10px;
        right: 10px;
        bottom: 10px;
        width: min(360px, calc(100% - 20px));
      }
      .sidebar-drawer-backdrop {
        inset: 10px;
      }
      .chat { height: 60vh; }
      .goal-discovery-panel {
        align-items: flex-start;
        flex-direction: column;
      }
    }
    .katex {
      font-size: 1.02em;
    }
    .katex-display {
      margin: 0.6em 0;
      padding: 0.35rem 0.5rem;
      background: #ffffff;
      border: 1px solid #e2e6df;
      border-radius: 10px;
      overflow-x: auto;
      overflow-y: hidden;
    }
    .katex-display > .katex {
      display: inline-block;
      white-space: nowrap;
    }
    .math-block {
      margin: 0.6em 0;
    }
    .math-block .katex-display {
      margin: 0;
    }
