/* V35.0 AI 助手：独立样式，避免碰 1 万行的 styles.css */
.ai-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 28, 45, .32);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
  z-index: 1200;
}
.ai-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.ai-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(460px, 100vw);
  height: 100vh;
  background: var(--panel);
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 44px rgba(0, 40, 80, .18);
  transform: translateX(102%);
  transition: transform .2s ease;
  z-index: 1210;
  display: flex;
  flex-direction: column;
  color: var(--ink);
}
.ai-drawer.open { transform: translateX(0); }
.ai-drawer.ai-window {
  top: auto;
  right: 18px;
  bottom: 18px;
  width: min(420px, calc(100vw - 24px));
  height: min(640px, calc(100vh - 36px));
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0, 40, 80, .28);
  transform: translateY(110%);
  overflow: hidden;
}
.ai-drawer.ai-window.open { transform: translateY(0); }

.ai-drawer-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}
.ai-drawer-head strong { font-size: 17px; }
.ai-drawer-head .ai-head-sub {
  color: var(--muted);
  font-size: 12px;
  margin-left: auto;
  margin-right: 4px;
  white-space: nowrap;
}
.ai-icon-btn {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 8px;
  min-width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
}
.ai-icon-btn:hover { background: var(--panel-soft); }
.ai-usage-btn {
  width: auto;
  padding: 0 8px;
  font-size: 12px;
}

.ai-context-line {
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  background: var(--panel);
}

.ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg);
}
.ai-empty {
  margin: auto 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  text-align: center;
  padding: 24px 10px;
}
.ai-empty strong { color: var(--ink); display: block; margin-bottom: 6px; }

.ai-msg {
  max-width: 92%;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 15px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid var(--line);
}
.ai-msg.user {
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.ai-msg.assistant {
  align-self: flex-start;
  background: var(--panel);
  color: var(--ink);
}
.ai-msg.error {
  align-self: stretch;
  background: #fff4f2;
  border-color: #f3c6c0;
  color: var(--danger);
}
.ai-msg .ai-msg-meta {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}
.ai-msg.user .ai-msg-meta { color: rgba(255,255,255,.75); }

.ai-citations {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.ai-citation {
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--primary-dark);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  cursor: pointer;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-citation:hover { border-color: var(--primary); }

.ai-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 16px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}
.ai-suggestion {
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--ink);
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  cursor: pointer;
}
.ai-suggestion:hover { border-color: var(--primary); color: var(--primary-dark); }

.ai-form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 10px 16px 6px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}
.ai-form textarea {
  flex: 1;
  min-height: 42px;
  max-height: 120px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 10px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--panel);
}
.ai-form textarea:focus { outline: 2px solid rgba(0,94,184,.18); border-color: var(--primary); }
.ai-form button { height: 40px; }
.ai-stop-btn { display: none; }
.ai-drawer.busy .ai-stop-btn { display: inline-flex; }
.ai-drawer.busy .ai-send-btn { display: none; }

.ai-foot {
  padding: 2px 16px 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  background: var(--panel);
}

.ai-status {
  font-size: 13px;
  color: var(--muted);
  min-height: 18px;
}
.ai-status.ok { color: var(--ok); }
.ai-status.err { color: var(--danger); }

.ai-settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.ai-settings-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
}
.ai-settings-grid label.full { grid-column: 1 / -1; }
.ai-settings-grid input,
.ai-settings-grid select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 8px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--panel);
}
.ai-settings-grid .ai-check {
  flex-direction: row;
  align-items: center;
  gap: 7px;
  color: var(--ink);
}
.ai-settings-grid .ai-check input { width: auto; }
.ai-settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.ai-settings-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.ai-feedback {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px dashed var(--line);
}
.ai-feedback[hidden] { display: none; }
.ai-feedback-btn {
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--muted);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  cursor: pointer;
}
.ai-feedback-btn:hover { border-color: var(--primary); color: var(--primary-dark); }
.ai-feedback-btn.selected { border-color: var(--primary); color: var(--primary-dark); background: #e8f3ff; }
.ai-feedback-btn:disabled { cursor: default; opacity: .7; }
.ai-feedback-status { font-size: 12px; color: var(--muted); }
.ai-feedback-status.ok { color: var(--ok); }
.ai-feedback-status.err { color: var(--danger); }

.ai-usage-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}
.ai-usage-card {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 10px;
  background: var(--panel-soft);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ai-usage-card span { color: var(--muted); font-size: 11px; }
.ai-usage-card strong { font-size: 16px; color: var(--ink); }
.ai-usage-title {
  margin: 14px 0 6px;
  font-size: 13px;
  color: var(--ink);
}
.ai-usage-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.ai-usage-table th,
.ai-usage-table td {
  border-bottom: 1px solid var(--line);
  padding: 5px 6px;
  text-align: left;
  white-space: nowrap;
}
.ai-usage-table th { color: var(--muted); font-weight: 600; }
.ai-usage-errors {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.ai-draft-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border: 1px dashed var(--line);
  border-radius: 9px;
  background: var(--panel-soft);
}
.ai-draft-toolbar .muted { font-size: 12px; }
.ai-draft-box {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: var(--panel);
}
.ai-draft-box[hidden] { display: none; }
.ai-draft-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.ai-draft-head strong { font-size: 14px; }
.ai-draft-note {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.ai-draft-item {
  border-top: 1px dashed var(--line);
  padding: 8px 0;
}
.ai-draft-item-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ai-draft-item-head strong { font-size: 13px; }
.ai-draft-confidence {
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 11px;
  color: var(--muted);
  background: var(--panel-soft);
  border: 1px solid var(--line);
}
.ai-draft-confidence.high { color: var(--ok); border-color: #b9dfc8; background: #f1fbf5; }
.ai-draft-confidence.low { color: var(--warn); border-color: #ead7a8; background: #fffaf0; }
.ai-draft-values {
  margin-top: 4px;
  font-size: 14px;
  color: var(--ink);
  font-weight: 600;
}
.ai-draft-reason {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.ai-draft-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
}
.ai-draft-actions .muted { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-draft-actions button { padding: 4px 10px; font-size: 12px; }
.ai-draft-filled { border-color: var(--ok) !important; background: #f1fbf5 !important; }

/* 公开入口 AI 帮填 / 查进度：不实例化管理员抽屉，使用页面内嵌卡片 */
.public-ai-helper {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 10px;
  background: var(--panel-soft);
  margin: 8px 0 12px;
}
.public-ai-helper label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.public-ai-helper input {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--panel);
}
.public-ai-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.public-ai-actions small { color: var(--muted); font-size: 12px; }
.public-ai-result {
  margin-top: 8px;
  border-top: 1px dashed var(--line);
  padding-top: 8px;
  font-size: 13px;
  line-height: 1.6;
}
.public-ai-result .result-list { margin-top: 6px; }
.public-ai-progress .result-item { text-align: left; }

/* AI 运营分析面板：可折叠/关闭，结果保留 */
.ai-ops-panel .panel-head { flex-wrap: wrap; gap: 8px; }
.ai-ops-panel .panel-head .toolbar { flex-wrap: wrap; }
.ai-ops-period { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.ai-ops-period select { height: 30px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--ink); font: inherit; font-size: 12px; padding: 0 6px; }
.ai-ops-collapsed .panel-head { margin-bottom: 0; }
.ai-ops-closed .panel-head { margin-bottom: 0; }
.ai-ops-closed .panel-head h2 { font-size: 16px; }
.ai-ops-closed .panel-head .toolbar { margin-left: auto; }
.ai-quality { border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; margin: 8px 0; font-size: 13px; line-height: 1.6; }
.ai-quality.warn { background: #fff8e8; border-color: #e8cf95; }
.ai-quality.danger { background: #fff3f1; border-color: #e7b1a8; }
.ai-quality p { margin: 4px 0 6px; }
.ai-quality .toolbar { flex-wrap: wrap; gap: 6px; }
.ai-quality .toolbar button { font-size: 12px; }
.ai-inline-feedback { display: flex; align-items: center; gap: 8px; margin: 6px 0 2px; font-size: 12px; }
.ai-inline-feedback button { font-size: 12px; padding: 3px 8px; }
.ai-action-center { display: grid; gap: 8px; max-height: 60vh; overflow: auto; }
.ai-action-center-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-soft); flex-wrap: wrap; }
.ai-action-center-row > div:first-child { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ai-action-center-row small { color: var(--muted); font-size: 11px; margin-top: 2px; }
.ai-action-center-row .toolbar { flex-basis: 100%; margin-top: 4px; }
.ai-model-load { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ai-model-load .muted { font-size: 12px; }
.ai-brief-modal { max-height: 70vh; overflow: auto; }
.ai-brief-modal-list { display: grid; gap: 7px; margin: 10px 0; }
.ai-brief-modal-item { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-soft); padding: 8px 10px; font: inherit; color: var(--ink); cursor: pointer; }
.ai-brief-modal-item small { color: var(--muted); font-size: 12px; }
.data-quality-card { display: grid; gap: 10px; }
.quality-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.quality-metric { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-soft); text-align: left; font: inherit; color: var(--ink); cursor: pointer; }
.quality-metric strong { font-size: 20px; line-height: 1.1; }
.quality-metric span { font-size: 12px; }
.quality-metric small { color: var(--muted); font-size: 11px; }
.quality-metric.danger strong { color: #b42318; }
.quality-metric.warn strong { color: #b54708; }
.quality-fold { border-top: 1px solid var(--line); padding-top: 8px; }
.quality-fold summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.quality-trend { display: flex; align-items: flex-end; gap: 8px; height: 90px; padding: 8px 4px 0; }
.quality-trend > span { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 3px; min-width: 0; }
.quality-trend i { width: 100%; max-width: 34px; background: linear-gradient(180deg, #4d9be6, #1d6fd1); border-radius: 4px 4px 2px 2px; min-height: 6px; }
.quality-trend small { color: var(--muted); font-size: 10px; white-space: nowrap; }
@media (max-width: 720px) {
  .quality-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 公开入口聊天：右下角浮动窗口 */
.public-chat-host { position: relative; z-index: 1300; }
.public-chat-launcher {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1300;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 14px 38px rgba(0, 64, 130, .3);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.public-chat-launcher-grip { opacity: .75; font-size: 15px; line-height: 1; }
.public-chat-launcher.dragging {
  cursor: grabbing;
  opacity: .92;
  transform: scale(.98);
  transition: none;
}
.public-chat-launcher:hover { filter: brightness(1.06); }
.public-chat-window {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1300;
  box-sizing: border-box;
  width: min(380px, calc(100vw - 24px));
  max-width: 100%;
  height: min(560px, calc(100vh - 36px));
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0, 40, 80, .28);
  overflow: hidden;
}
body.public-chat-open { overflow: hidden; width: 100%; max-width: 100%; }
.public-chat-window-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}
.public-chat-window-head div { display: flex; flex-direction: column; min-width: 0; }
.public-chat-window-head strong { font-size: 15px; }
.public-chat-window-head small { color: var(--muted); font-size: 11px; margin-top: 2px; }
.public-chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 12px;
  background: var(--bg);
}
.public-chat-msg {
  max-width: 92%;
  min-width: 0;
  box-sizing: border-box;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.public-chat-msg.assistant { align-self: flex-start; background: var(--panel); border: 1px solid var(--line); }
.public-chat-msg.user { align-self: flex-end; background: #e8f1ff; border: 1px solid #b9cfe9; }
.public-chat-input-row { flex: 0 0 auto; display: flex; gap: 8px; padding: 9px 12px; border-top: 1px solid var(--line); background: var(--panel); }
.public-chat-input-row input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; font: inherit; font-size: 14px; }
.public-chat-input-row button { white-space: nowrap; }
.public-chat-image-btn { flex: 0 0 auto; padding: 0 9px; }
.public-chat-result { flex: 0 1 auto; max-height: 34%; overflow-y: auto; overflow-x: hidden; box-sizing: border-box; padding: 0 12px 8px; background: var(--panel); }
.public-chat-form-result, .public-chat-progress, .public-chat-equipment {
  border-top: 1px dashed var(--line);
  padding-top: 8px;
  font-size: 13px;
  line-height: 1.6;
  box-sizing: border-box;
  max-width: 100%;
}
.public-chat-fields { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 6px 0; }
.public-chat-progress .result-item { width: 100%; max-width: 100%; box-sizing: border-box; text-align: left; }
.public-chat-progress .result-item small { display: block; color: var(--muted); margin-top: 2px; }
.public-chat-suggestions { margin: 4px 0 8px; }

/* 图纸 AI 读图结果 */
.drawing-ai-result { margin-top: 8px; }
.drawing-ai-card {
  border: 1px dashed #b9c9e6;
  border-radius: 9px;
  background: #f7fbff;
  padding: 10px;
  font-size: 13px;
  line-height: 1.6;
}
.drawing-ai-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; margin: 6px 0; }
.drawing-ai-grid span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawing-ai-cache { min-height: 0; margin-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--muted); font-size: 12px; }
.drawing-ai-cache:empty { display: none; }
.link-btn { border: 0; background: transparent; color: var(--primary-dark); padding: 0; font: inherit; font-size: 12px; text-decoration: underline; cursor: pointer; }
.drawing-ai-window {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(560px, calc(100vw - 32px));
  max-height: 80vh;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 28px 90px rgba(0, 25, 60, .32);
  overflow: hidden;
}
.drawing-ai-window::backdrop { background: rgba(10, 28, 45, .45); }
.drawing-ai-window-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}
.drawing-ai-window-head > div { display: flex; flex-direction: column; min-width: 0; }
.drawing-ai-window-head strong { font-size: 16px; }
.drawing-ai-window-head small { color: var(--muted); font-size: 12px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawing-ai-window-body { max-height: calc(80vh - 62px); overflow: auto; padding: 12px 16px 16px; }
.drawing-ai-window .drawing-ai-card { border: 0; background: transparent; padding: 0; }
.drawing-ai-window .drawing-ai-card > .toolbar { margin-top: 10px; flex-wrap: wrap; }
.drawing-ai-raw { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 180px; overflow: auto; background: var(--panel-soft); border: 1px solid var(--line); border-radius: 6px; padding: 8px; font-size: 11px; }
.drawing-ai-loading { padding: 10px 0; }

/* AI 动作确认卡：先预览，再点确认，绝不自动执行 */
.ai-action-card {
  border: 1px solid #d9b56a;
  background: #fffdf6;
  border-radius: 10px;
  padding: 10px;
  margin: 8px 0;
  font-size: 13px;
}
.ai-action-card strong { color: #7a4b00; }
.ai-action-preview {
  margin: 6px 0;
  max-height: 180px;
  overflow: auto;
  background: #fff;
  border: 1px solid #eee3c8;
  border-radius: 6px;
  padding: 7px;
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
}
.ai-action-actions { display: flex; gap: 8px; margin-top: 8px; }
.ai-action-actions button { padding: 5px 12px; font-size: 12px; }
.ai-action-done { color: var(--ok); margin: 6px 0 0; }

.ai-route-draft {
  border: 1px dashed #b9c9e6;
  background: #f7fbff;
  border-radius: 9px;
  padding: 10px;
  margin: 10px 0;
  font-size: 13px;
  line-height: 1.6;
}
.ai-route-draft strong { color: var(--primary-dark); }
.ai-route-draft p { margin: 4px 0; }
.ai-route-draft button { margin-top: 6px; }

@media (max-width: 720px) {
  .ai-drawer { width: 100vw; }
  .ai-drawer.ai-window {
    inset: 0;
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
    border: 0;
  }
  .public-chat-window {
    inset: auto;
    left: var(--public-chat-left, 0px);
    top: var(--public-chat-top, 0px);
    right: auto;
    bottom: auto;
    width: var(--public-chat-vw, 100%);
    max-width: 100%;
    height: 100vh;
    height: var(--public-chat-vh, 100svh);
    max-height: var(--public-chat-vh, 100svh);
    border-radius: 0;
    border: 0;
    overflow: hidden;
    overscroll-behavior: contain;
  }
  .public-chat-result { max-height: 30vh; max-height: 30svh; width: 100%; box-sizing: border-box; }
  .public-chat-input-row { width: 100%; box-sizing: border-box; padding-bottom: calc(9px + env(safe-area-inset-bottom)); }
  .public-chat-input-row button { flex: 0 0 auto; }
  .public-chat-launcher { left: 12px; right: auto; bottom: calc(12px + env(safe-area-inset-bottom)); }
  .drawing-ai-window { width: calc(100vw - 16px); max-height: 90vh; }
  .ai-settings-grid { grid-template-columns: 1fr; }
  .ai-msg { max-width: 96%; }
  .ai-usage-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
