/* chat.css split from legacy.css on 2026-07-13T14:30:34.721Z. */

.chat-feed {
      flex: 1;
      min-height: 0;
      overflow-y: auto;
      padding: 18px 22px;
      background:
        radial-gradient(circle at 18% 0%, rgb(79 70 229 / 0.05), transparent 32%),
        radial-gradient(circle at 82% 10%, rgb(14 165 233 / 0.04), transparent 30%),
        #f8fafc;
      display: flex;
      flex-direction: column;
      gap: 14px;
    }

.msg-row {
      display: grid;
      grid-template-columns: 36px minmax(0, 1fr);
      gap: 10px;
      align-items: start;
      max-width: 94%;
    }

.msg-row.user {
      margin-left: auto;
      grid-template-columns: minmax(0, 1fr) 36px;
    }

.msg-avatar {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      display: grid;
      place-items: center;
      color: white;
      font-size: 15px;
      font-weight: 700;
      box-shadow: 0 6px 14px rgb(15 23 42 / 0.12);
      overflow: hidden;
    }

.msg-row.user .msg-avatar { grid-column: 2; grid-row: 1; background: #111827; }

.msg-meta {
      display: flex;
      align-items: center;
      gap: 6px;
      margin-bottom: 5px;
      flex-wrap: wrap;
    }

.msg-row.user .msg-meta { justify-content: flex-end; }

.msg-sender {
      font-size: 12px;
      font-weight: 600;
      line-height: 1.2;
    }

.msg-time {
      font-size: 10.5px;
      color: var(--muted-2);
    }

.msg-bubble {
      border-radius: 4px 14px 14px 14px;
      padding: 10px 13px;
      font-size: 12px;
      line-height: 1.48;
      font-weight: 400;
      color: #334155;
      max-width: 88%;
      border: 1px solid var(--line);
      box-shadow: 0 6px 16px rgb(15 23 42 / 0.04);
      position: relative;
      display: inline-block;
    }

.msg-row.user .msg-bubble {
      float: right;
      background: #111827;
      color: #fff;
      border-color: #111827;
      border-radius: 14px 4px 14px 14px;
    }

.bubble-content {
      max-height: 74px;
      overflow: hidden;
      white-space: pre-wrap;
      position: relative;
    }

.bubble-content.long::after {
      content: "";
      position: absolute;
      left: 0;
      right: 0;
      bottom: 0;
      height: 24px;
      background: linear-gradient(transparent, var(--fade-bg, #fff));
      pointer-events: none;
    }

.bubble-footer {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px 20px;
      margin-top: 8px;
      min-width: 220px;
      flex-wrap: wrap;
    }

.message-actions {
      display: inline-flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 8px 20px;
    }

.message-action-btn {
      min-height: 30px;
      padding: 6px 10px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      border: 1px solid rgb(148 163 184 / 0.24);
      background: rgb(255 255 255 / 0.7);
      box-shadow: 0 3px 8px rgb(15 23 42 / 0.04);
      transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
    }

.message-action-btn:hover {
      transform: translateY(-1px);
      border-color: rgb(100 116 139 / 0.38);
      background: #fff;
    }

.message-action-btn.rerun-inline {
      color: #1d4ed8;
      border-color: rgb(59 130 246 / 0.2);
      background: rgb(239 246 255 / 0.86);
    }

.message-action-btn.flow-inline {
      color: #0f766e;
      border-color: rgb(13 148 136 / 0.22);
      background: rgb(240 253 250 / 0.88);
    }

.clean-bullet-list {
      margin: 0;
      padding-left: 18px;
      display: grid;
      gap: 10px;
      color: #334155;
    }

.clean-bullet-list li {
      padding-left: 4px;
    }

.clean-bullet-line {
      display: inline;
      line-height: 1.7;
      font-size: 13px;
    }

.clean-bullet-line strong {
      color: #0f172a;
      font-weight: 800;
    }

.clean-bullet-extra,
.clean-bullet-fixes {
      margin-top: 6px;
      color: #475569;
      font-size: 12.5px;
      line-height: 1.6;
    }

.clean-bullet-fixes {
      display: grid;
      gap: 4px;
      padding: 8px 10px;
      border: 1px solid var(--line-soft);
      border-radius: 10px;
      background: #f8fafc;
    }

.message-action-icon {
      width: 14px;
      height: 14px;
      display: inline-grid;
      place-items: center;
      flex: 0 0 auto;
    }

.message-action-icon svg {
      width: 14px;
      height: 14px;
      fill: none;
      stroke: currentColor;
      stroke-width: 1.8;
      stroke-linecap: round;
      stroke-linejoin: round;
    }

.msg-row.user .message-action-btn {
      border-color: rgb(255 255 255 / 0.18);
      background: rgb(255 255 255 / 0.12);
    }

.bubble-footer .compact-note {
      margin-left: auto;
    }

.composer-area {
      padding: 13px 22px;
      background: #fff;
      border-top: 1px solid var(--line);
      flex-shrink: 0;
      position: relative;
    }

.mention-menu {
      position: absolute;
      left: 22px;
      bottom: 76px;
      width: min(380px, calc(100% - 44px));
      max-height: 260px;
      overflow-y: auto;
      background: #fff;
      border: 1px solid var(--line);
      border-radius: 14px;
      box-shadow: 0 18px 50px rgb(15 23 42 / 0.18);
      padding: 8px;
      display: none;
      z-index: 20;
    }

.mention-item {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 9px;
      border-radius: 10px;
      cursor: pointer;
    }

.mention-item:hover, .mention-item.active { background: #f8fafc; }

.mention-avatar {
      width: 30px;
      height: 30px;
      border-radius: 50%;
      color: white;
      display: grid;
      place-items: center;
      font-size: 11px;
      font-weight: 700;
      flex-shrink: 0;
    }

.mention-name { font-size: 12px; font-weight: 600; color: var(--heading); }

.mention-desc { font-size: 10.5px; color: var(--muted); margin-top: 2px; }

.mention-trigger-btn {
      background: transparent;
      border: 0;
      color: var(--muted);
      cursor: pointer;
      height: 32px;
      width: 30px;
      border-radius: 8px;
      font-size: 16px;
      display: grid;
      place-items: center;
    }

.mention-trigger-btn:hover { background: #eef2ff; color: var(--primary); }

.ai-doc {
      display: flex;
      flex-direction: column;
      gap: 10px;
      color: #334155;
      line-height: 1.6;
      font-size: 13px;
    }

.ai-doc-fold {
      border: 1px solid var(--line);
      border-radius: 12px;
      background: #fff;
      overflow: hidden;
      transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }

.ai-doc-fold.open {
      border-color: var(--primary);
      box-shadow: 0 4px 12px rgb(91 92 246 / 0.05);
    }

.ai-doc-fold[data-level="2"] { margin-left: 12px; }

.ai-doc-fold[data-level="3"] { margin-left: 24px; }

.ai-doc-fold.open > .fold-header .fold-arrow {
      transform: rotate(90deg);
      background: var(--primary-soft);
      color: var(--primary);
    }

.ai-doc-fold-wrapper {
      display: grid;
      grid-template-rows: 0fr;
      transition: grid-template-rows 0.22s ease;
    }

.ai-doc-fold.open > .ai-doc-fold-wrapper { grid-template-rows: 1fr; }

.ai-doc-fold-content {
      display: flex;
      flex-direction: column;
      gap: 10px;
      padding: 12px 14px;
      border-top: 1px solid var(--line-soft);
    }

.ai-doc-kv-group {
      display: flex;
      flex-direction: column;
      border: 1px solid var(--line-soft);
      border-radius: 10px;
      overflow: hidden;
      background: #fff;
    }

.ai-doc-kv {
      display: grid;
      grid-template-columns: minmax(135px, 190px) minmax(0, 1fr);
      gap: 12px;
      padding: 9px 14px;
      border-bottom: 1px solid var(--line-soft);
      background: transparent;
    }

.ai-doc-kv:last-child { border-bottom: none; }

.ai-doc-kv strong {
      color: var(--muted);
      font-weight: 600;
      font-size: 12px;
    }

.ai-doc-kv span {
      color: var(--heading);
      font-weight: 600;
      font-size: 12.5px;
      white-space: pre-wrap;
      word-break: break-word;
    }

.ai-doc-p {
      white-space: pre-wrap;
      word-break: break-word;
    }

.ai-doc-title {
      font-weight: 700;
      color: var(--heading);
      padding: 8px 10px;
      border-radius: 10px;
      background: #f8fafc;
      border-left: 3px solid var(--primary);
    }

.ai-doc-bullet, .ai-doc-number, .ai-doc-check {
      display: grid;
      grid-template-columns: 22px minmax(0, 1fr);
      gap: 8px;
      align-items: start;
      padding: 6px 8px;
    }

.ai-doc-bullet > span:first-child,
.ai-doc-check > span:first-child {
      display: none;
    }

.ai-doc-bullet,
.ai-doc-check {
      grid-template-columns: minmax(0, 1fr);
    }

.ai-doc-bullet.child,
    .ai-doc-number.child,
    .ai-doc-check.child {
      margin-left: 28px;
      padding-top: 2px;
      color: #475569;
    }

.ai-doc-bullet.child > span:first-child {
      color: var(--muted);
      font-size: 11px;
      transform: translateY(1px);
    }

.ai-doc-panel-list {
      display: grid;
      gap: 7px;
      padding: 2px 0;
    }

.ai-doc-issue {
      border: 1px solid var(--line-soft);
      border-radius: 10px;
      background: #fff;
      overflow: hidden;
    }

.ai-doc-issue-title {
      padding: 9px 12px;
      background: #f8fafc;
      color: var(--heading);
      font-weight: 700;
      border-bottom: 1px solid var(--line-soft);
    }

.ai-doc-code {
      white-space: pre-wrap;
      word-break: break-word;
      background: #0f172a;
      color: #e2e8f0;
      border-radius: 12px;
      padding: 12px;
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
      font-size: 11.5px;
      line-height: 1.55;
      overflow-x: auto;
      border: 1px solid rgb(255 255 255 / 0.06);
    }

.clean-stage-doc {
      display: grid;
      gap: 12px;
    }

.clean-fold {
      border: 1px solid var(--line);
      border-radius: 14px;
      background: #fff;
      overflow: hidden;
    }

.clean-fold summary {
        cursor: pointer;
        list-style: none;
        padding: 12px 14px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        font-weight: 800;
        color: var(--heading);
        background: #f8fafc;
        text-align: left;
      }

.clean-fold summary > span:first-child {
        flex: 1;
        text-align: left;
      }

.clean-fold summary::-webkit-details-marker { display: none; }

.clean-fold summary::before {
      content: ">";
      margin-right: 8px;
      color: #64748b;
      transition: transform 0.15s ease;
    }

.clean-fold[open] summary::before { transform: rotate(90deg); }

.clean-fold-body {
      padding: 14px 16px;
      display: grid;
      gap: 10px;
    }

.clean-fold-count {
      font-size: 11px;
      color: #475569;
      background: #e2e8f0;
      border-radius: 999px;
      padding: 2px 8px;
      white-space: nowrap;
    }

.critical-review-document {
      gap: 10px;
    }

.review-summary-line {
      padding: 10px 14px;
      border: 1px solid #fed7aa;
      border-radius: 12px;
      background: #fff7ed;
      color: #9a3412;
      font-weight: 800;
    }

.review-issue-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 7px;
      margin-bottom: 4px;
    }

.review-issue-meta span {
      display: inline-flex;
      padding: 4px 8px;
      border-radius: 999px;
      background: #f1f5f9;
      color: #475569;
      font-size: 11px;
      font-weight: 700;
    }

.review-issue-block {
      display: grid;
      grid-template-columns: minmax(110px, 150px) minmax(0, 1fr);
      gap: 12px;
      padding: 10px 0;
      border-bottom: 1px solid #e2e8f0;
    }

.review-issue-block:last-child {
      border-bottom: 0;
    }

.review-issue-label {
      color: #475569;
      font-size: 12px;
      font-weight: 800;
    }

.review-issue-text,
.review-issue-text p {
      margin: 0;
      color: #0f172a;
      line-height: 1.6;
    }

.review-empty-state {
      padding: 16px;
      border: 1px solid #bbf7d0;
      border-radius: 12px;
      background: #f0fdf4;
      color: #166534;
    }

@media (max-width: 900px) {
      .review-issue-block {
        grid-template-columns: 1fr;
        gap: 5px;
      }
    }

.clean-p {
      margin: 0;
      line-height: 1.72;
      color: #172554;
      font-size: 13px;
    }

.clean-number-list {
      margin: 0;
      padding: 0;
      list-style: none;
      display: grid;
      gap: 12px;
    }

.clean-number-list li {
      padding: 12px;
      border: 1px solid #e6edf5;
      border-radius: 12px;
      background: #fbfdff;
    }

.clean-item-main {
      display: grid;
      grid-template-columns: 34px minmax(0, 1fr);
      gap: 8px;
      align-items: start;
    }

.clean-number {
      color: #64748b;
      font-weight: 800;
    }

.clean-item-title {
      font-weight: 800;
      color: #0f172a;
      margin-bottom: 4px;
    }

.clean-item-text {
      color: #172554;
      line-height: 1.65;
    }

.clean-item-extra {
      margin-top: 6px;
      color: #334155;
      line-height: 1.6;
    }

.clean-fix-grid {
      margin-top: 10px;
      border: 1px solid #e2e8f0;
      border-radius: 12px;
      overflow: hidden;
      background: #fff;
    }

.clean-fix-row {
      display: grid;
      grid-template-columns: 180px minmax(0, 1fr);
      gap: 12px;
      padding: 10px 12px;
      border-top: 1px solid #e2e8f0;
    }

.clean-fix-row:first-child { border-top: 0; }

.clean-fix-row strong {
      color: #64748b;
      font-weight: 700;
    }

.clean-fix-row span {
      color: #0f172a;
      font-weight: 650;
      line-height: 1.55;
    }

.clean-next-stage {
      display: grid;
      grid-template-columns: 180px minmax(0, 1fr);
      gap: 12px;
      padding: 12px 14px;
      border: 1px solid #e2e8f0;
      border-radius: 14px;
      background: #fff;
    }

.clean-next-stage strong { color: #64748b; }

.clean-next-stage span {
      color: #0f172a;
      font-weight: 700;
    }

.clean-media-list {
      display: grid;
      gap: 10px;
    }

.clean-media-row {
      display: grid;
      grid-template-columns: 96px minmax(0, 1fr);
      gap: 12px;
      align-items: start;
      padding: 10px 12px;
      border: 1px solid #e6edf5;
      border-radius: 12px;
      background: #fbfdff;
    }

.clean-media-row strong { color: #0f172a; }

.clean-media-row a {
      color: #2563eb;
      word-break: break-all;
      font-weight: 700;
    }

.clean-media-row small {
      display: block;
      margin-top: 4px;
      color: #64748b;
      word-break: break-all;
      line-height: 1.5;
    }

.clean-empty {
      color: #64748b;
      font-style: italic;
    }

@media (max-width: 720px) {
      .clean-fix-row,
      .clean-next-stage,
      .clean-media-row {
        grid-template-columns: 1fr;
      }

      .clean-item-main {
        grid-template-columns: 28px minmax(0, 1fr);
      }
    }
