/* 拍照识题 · 启发式数学辅导 —— 共享样式 */
:root {
  --bg: #f5f7fc;
  --bg-soft: #eef2fb;
  --card: #ffffff;
  --ink: #1c2540;
  --ink-2: #3d4866;
  --muted: #7d89a3;
  --line: #e6ebf5;
  --brand: #5b6cff;
  --brand-dark: #4453e0;
  --brand-soft: #eef0ff;
  --orange: #ff9a3d;
  --orange-soft: #fff3e6;
  --green: #16b47f;
  --green-soft: #e7f8f1;
  --red: #ef6a6a;
  --shadow: 0 12px 34px rgba(30, 46, 92, .08);
  --shadow-sm: 0 4px 16px rgba(30, 46, 92, .06);
  --radius: 20px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font-family: inherit; font-size: inherit; }
button { cursor: pointer; border: none; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1100px; margin: 0 auto; padding: 12px 22px;
  display: flex; align-items: center; gap: 12px;
}
.logo {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  background: linear-gradient(135deg, var(--brand), #8b7bff);
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 6px 16px rgba(91,108,255,.3);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text b { font-size: 16px; letter-spacing: .2px; }
.brand-text span { font-size: 11px; color: var(--muted); }
.topbar-spacer { flex: 1; }
.parent-entry {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 15px; border-radius: 999px;
  background: var(--bg-soft); color: var(--ink-2);
  font-size: 13px; font-weight: 600; transition: .2s;
}
.parent-entry:hover { background: var(--brand-soft); color: var(--brand-dark); }
.chip-soft {
  padding: 5px 12px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand-dark);
  font-size: 12px; font-weight: 600;
}

/* ---------------- 布局 ---------------- */
.wrap { max-width: 1100px; margin: 0 auto; padding: 30px 22px 60px; }
.page-head { margin-bottom: 22px; }
.page-head h1 { margin: 0 0 6px; font-size: 25px; letter-spacing: -.4px; }
.page-head p { margin: 0; color: var(--muted); font-size: 14px; }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-pad { padding: 26px; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 13px;
  font-weight: 650; font-size: 14px; transition: transform .16s, box-shadow .16s, background .16s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 8px 20px rgba(91,108,255,.26); }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); box-shadow: 0 10px 24px rgba(91,108,255,.34); }
.btn-orange { background: var(--orange); color: #fff; box-shadow: 0 8px 20px rgba(255,154,61,.3); }
.btn-orange:hover:not(:disabled) { background: #f4871f; }
.btn-ghost { background: var(--bg-soft); color: var(--ink-2); }
.btn-ghost:hover { background: #e3e9f7; }
.btn-green { background: var(--green); color: #fff; box-shadow: 0 8px 20px rgba(22,180,127,.24); }
.btn-green:hover:not(:disabled) { background: #0f9e6e; }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 10px; }
.btn-lg { padding: 15px 30px; font-size: 16px; border-radius: 15px; }

/* ---------------- 步骤条 ---------------- */
.steps { display: flex; align-items: center; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.step-item { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 600; }
.step-dot {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--bg-soft); color: var(--muted); font-size: 12px; font-weight: 700;
}
.step-item.active .step-dot { background: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(91,108,255,.3); }
.step-item.active { color: var(--brand-dark); }
.step-item.done .step-dot { background: var(--green-soft); color: var(--green); }
.step-line { width: 34px; height: 2px; background: var(--line); border-radius: 2px; }

/* ---------------- 上传区 ---------------- */
.hero {
  background: linear-gradient(135deg, #eef0ff 0%, #fff6ec 100%);
  border-radius: 26px; padding: 34px 26px 40px; text-align: center;
  border: 1px solid #e9e8fb;
}
.hero h1 { font-size: 27px; margin: 0 0 8px; letter-spacing: -.6px; }
.hero p { color: var(--ink-2); margin: 0 0 24px; font-size: 14px; }
.dropzone {
  max-width: 620px; margin: 0 auto; background: #fff;
  border: 2px dashed #c9cffc; border-radius: 22px;
  padding: 38px 24px; transition: .2s; cursor: pointer;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--brand); background: #fafaff; transform: translateY(-2px); }
.cam-icon {
  width: 66px; height: 66px; margin: 0 auto 16px; border-radius: 20px;
  background: var(--brand-soft); color: var(--brand); display: grid; place-items: center;
}
.dropzone b { display: block; font-size: 17px; margin-bottom: 5px; }
.dropzone small { color: var(--muted); display: block; margin-bottom: 20px; }
.upload-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.tips { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin-top: 24px; color: var(--muted); font-size: 12.5px; }
.tips span { display: inline-flex; align-items: center; gap: 6px; }

.feature-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 22px; }
.feature {
  background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px;
  box-shadow: var(--shadow-sm);
}
.feature .fi { font-size: 21px; }
.feature b { display: block; margin: 6px 0 2px; font-size: 14px; }
.feature span { color: var(--muted); font-size: 12.5px; line-height: 1.55; display: block; }

/* ---------------- 识别确认 ---------------- */
.confirm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.panel-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; margin-bottom: 14px; }
.panel-title .num {
  width: 22px; height: 22px; border-radius: 7px; background: var(--brand-soft); color: var(--brand-dark);
  display: grid; place-items: center; font-size: 12px;
}
.image-box {
  background: var(--bg-soft); border-radius: 14px; overflow: hidden;
  min-height: 230px; display: grid; place-items: center; border: 1px solid var(--line);
}
.image-box img { max-width: 100%; max-height: 340px; display: block; object-fit: contain; }
.field-label { display: block; font-size: 12.5px; color: var(--muted); font-weight: 600; margin-bottom: 7px; }
textarea.question-input {
  width: 100%; min-height: 150px; resize: vertical; padding: 14px 16px;
  border: 1.5px solid var(--line); border-radius: 13px; background: #fcfdff;
  color: var(--ink); line-height: 1.75; outline: none; transition: .2s;
}
textarea.question-input:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px rgba(91,108,255,.09); }
.tag-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 4px; }
.tag { padding: 5px 11px; border-radius: 8px; font-size: 12px; font-weight: 600; background: var(--orange-soft); color: #c96b12; }
.tag.blue { background: var(--brand-soft); color: var(--brand-dark); }
.tag.gray { background: var(--bg-soft); color: var(--ink-2); }
.hint-note {
  background: #fffaf2; border: 1px solid #ffe9c9; color: #9b6b24;
  border-radius: 12px; padding: 11px 14px; font-size: 12.5px; margin-top: 14px;
}
.confirm-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }

/* ---------------- 聊天区 ---------------- */
.chat-layout { display: grid; grid-template-columns: 280px 1fr; gap: 18px; align-items: start; }
.side-card { padding: 18px; position: sticky; top: 84px; }
.side-card h3 { margin: 0 0 10px; font-size: 13px; color: var(--muted); font-weight: 700; letter-spacing: .5px; }
.side-card img { width: 100%; border-radius: 11px; border: 1px solid var(--line); margin-bottom: 12px; }
.side-question {
  font-size: 13.5px; line-height: 1.7; color: var(--ink-2);
  white-space: pre-wrap; word-break: break-word;
  max-height: 190px; overflow-y: auto;
}
.progress-wrap { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.progress-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 7px; }
.progress-bar { height: 8px; border-radius: 99px; background: var(--bg-soft); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand), #8b7bff); transition: width .5s ease; }
.side-meta { margin-top: 12px; font-size: 12px; color: var(--muted); }

.chat-card { display: flex; flex-direction: column; overflow: hidden; height: min(72vh, 720px); min-height: 480px; }
.chat-head {
  padding: 14px 20px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px; background: #fff;
}
.avatar-tutor {
  width: 34px; height: 34px; border-radius: 11px; flex: none;
  background: linear-gradient(135deg, var(--orange), #ffbe6b);
  display: grid; place-items: center; font-size: 17px;
}
.chat-head b { font-size: 14px; display: block; line-height: 1.3; }
.chat-head small { color: var(--green); font-size: 11.5px; }
.chat-head .grow { flex: 1; }

.messages { flex: 1; overflow-y: auto; padding: 22px 20px; background: #fafbff; scroll-behavior: smooth; }
.msg { display: flex; gap: 10px; margin-bottom: 18px; align-items: flex-end; }
.msg.tutor { justify-content: flex-start; }
.msg.student { justify-content: flex-end; }
.msg-avatar {
  width: 30px; height: 30px; border-radius: 10px; flex: none;
  display: grid; place-items: center; font-size: 15px;
}
.msg.tutor .msg-avatar { background: var(--orange-soft); }
.msg.student .msg-avatar { background: var(--brand-soft); }
.bubble {
  max-width: min(78%, 560px); padding: 12px 16px; border-radius: 16px;
  font-size: 14.5px; line-height: 1.75; white-space: pre-wrap; word-break: break-word;
  box-shadow: var(--shadow-sm);
}
.msg.tutor .bubble { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.msg.student .bubble { background: var(--brand); color: #fff; border-bottom-right-radius: 5px; }
.bubble.typing { color: var(--muted); }
.dots { display: inline-flex; gap: 4px; align-items: center; height: 12px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); animation: bounce 1.1s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%,60%,100% { transform: translateY(0); opacity: .45 } 30% { transform: translateY(-5px); opacity: 1 } }
.ready-tip {
  margin: 0 20px 12px; padding: 10px 14px; border-radius: 11px;
  background: var(--green-soft); color: #0d8d62; font-size: 12.5px; font-weight: 600;
}
.quick-row { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 20px 0; }
.quick-chip {
  padding: 6px 12px; border-radius: 999px; background: var(--bg-soft);
  color: var(--ink-2); font-size: 12.5px; transition: .15s;
}
.quick-chip:hover { background: var(--brand-soft); color: var(--brand-dark); }
.composer { padding: 12px 20px 16px; border-top: 1px solid var(--line); background: #fff; }
.composer-inner { display: flex; gap: 10px; align-items: flex-end; }
.composer textarea {
  flex: 1; resize: none; min-height: 46px; max-height: 130px; padding: 12px 14px;
  border: 1.5px solid var(--line); border-radius: 13px; outline: none; line-height: 1.5;
  background: #fcfdff; transition: .2s;
}
.composer textarea:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px rgba(91,108,255,.09); }
.composer .btn { height: 46px; }

/* ---------------- 完成页 ---------------- */
.done-card { text-align: center; padding: 36px 28px; }
.done-icon {
  width: 76px; height: 76px; margin: 0 auto 16px; border-radius: 50%;
  background: var(--green-soft); display: grid; place-items: center; font-size: 36px;
}
.done-card h2 { margin: 0 0 6px; font-size: 23px; }
.done-card > p { color: var(--muted); margin: 0 0 24px; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 0 auto 22px; max-width: 640px; }
.stat-box { background: var(--bg-soft); border-radius: 14px; padding: 14px 8px; }
.stat-box b { display: block; font-size: 21px; color: var(--brand-dark); }
.stat-box span { font-size: 11.5px; color: var(--muted); }
.review-box {
  max-width: 640px; margin: 0 auto 26px; text-align: left;
  background: #f8faff; border: 1px solid var(--line); border-radius: 15px; padding: 18px 20px;
}
.review-box h4 { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.review-box p { margin: 0 0 10px; font-size: 14px; line-height: 1.7; }
.review-box .suggestion { color: var(--brand-dark); font-size: 13px; }

/* ---------------- 弹窗 / 提示 ---------------- */
.overlay {
  position: fixed; inset: 0; z-index: 60; background: rgba(24, 32, 58, .45);
  backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px;
}
.modal { width: min(440px, 100%); background: #fff; border-radius: 22px; padding: 26px; box-shadow: 0 24px 70px rgba(20,30,60,.28); }
.modal h3 { margin: 0 0 6px; font-size: 19px; }
.modal p { margin: 0 0 18px; color: var(--muted); font-size: 13.5px; }
.rating-options { display: grid; gap: 9px; margin-bottom: 20px; }
.rating-opt {
  display: flex; align-items: center; gap: 11px; padding: 12px 14px;
  border: 1.5px solid var(--line); border-radius: 12px; background: #fcfdff;
  text-align: left; transition: .15s; font-size: 14px; width: 100%;
}
.rating-opt:hover { border-color: var(--brand); }
.rating-opt.selected { border-color: var(--brand); background: var(--brand-soft); }
.rating-opt .emo { font-size: 19px; }
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(20px);
  background: #232c48; color: #fff; padding: 12px 20px; border-radius: 12px;
  font-size: 13.5px; z-index: 90; opacity: 0; pointer-events: none;
  transition: .25s; max-width: 86vw; box-shadow: 0 12px 30px rgba(0,0,0,.2);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: #d9534f; }

/* 加载遮罩（识题中） */
.scanning { text-align: center; padding: 30px 20px; }
.scan-anim {
  width: 74px; height: 74px; margin: 0 auto 16px; border-radius: 20px;
  background: var(--brand-soft); display: grid; place-items: center; position: relative; overflow: hidden;
}
.scan-anim::after {
  content: ''; position: absolute; left: 0; right: 0; height: 3px;
  background: var(--brand); box-shadow: 0 0 12px 3px rgba(91,108,255,.5);
  animation: scan 1.6s ease-in-out infinite;
}
@keyframes scan { 0%,100% { top: 8% } 50% { top: 88% } }
.scanning b { display: block; font-size: 16px; margin-bottom: 4px; }
.scanning span { color: var(--muted); font-size: 13px; }

/* ---------------- 家长端 ---------------- */
.parent-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: linear-gradient(120deg, #eef0ff, #f6f9ff 70%);
  border: 1px solid #e6e9fb; border-radius: 20px; padding: 22px 26px; margin-bottom: 20px;
}
.parent-hero h1 { margin: 0 0 4px; font-size: 22px; }
.parent-hero p { margin: 0; color: var(--muted); font-size: 13px; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi { padding: 18px 20px; }
.kpi .k-label { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi .k-value { font-size: 28px; font-weight: 750; letter-spacing: -.8px; margin: 6px 0 2px; }
.kpi .k-sub { font-size: 11.5px; color: var(--muted); }
.kpi .k-dot { width: 8px; height: 8px; border-radius: 50%; }
.chart-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; margin-bottom: 18px; }
.chart-card { padding: 20px; }
.chart-card h3 { margin: 0 0 3px; font-size: 15px; }
.chart-card .sub { color: var(--muted); font-size: 12px; margin: 0 0 18px; }
.bar-chart { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.bar {
  width: 100%; max-width: 26px; min-height: 3px; border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, #7e8bff, var(--brand)); transition: .3s;
}
.bar.empty { background: var(--bg-soft); }
.bar-col span { font-size: 10px; color: var(--muted); white-space: nowrap; }
.hbar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; }
.hbar-name { width: 96px; font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: none; }
.hbar-track { flex: 1; height: 9px; background: var(--bg-soft); border-radius: 99px; overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--orange), #ffbe6b); }
.hbar-num { width: 26px; text-align: right; font-size: 12px; color: var(--muted); flex: none; }
.line-chart { width: 100%; height: 150px; display: block; overflow: visible; }
.record-card { padding: 20px; }
.record-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.record-head h3 { margin: 0; font-size: 15px; }
.record-list { display: flex; flex-direction: column; }
.record-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 8px;
  border-top: 1px solid var(--line); transition: .15s; cursor: pointer; border-radius: 10px;
}
.record-item:hover { background: #f8faff; padding-left: 14px; padding-right: 14px; }
.rec-thumb {
  width: 58px; height: 48px; border-radius: 9px; flex: none; object-fit: cover;
  background: var(--bg-soft); border: 1px solid var(--line);
}
.rec-main { flex: 1; min-width: 0; }
.rec-q { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-meta { font-size: 11.5px; color: var(--muted); margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; }
.mastery-badge {
  padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; flex: none;
}
.mastery-high { background: var(--green-soft); color: #0d8d62; }
.mastery-mid { background: var(--orange-soft); color: #c47b18; }
.mastery-low { background: #ffeded; color: #cf5555; }
.empty-state { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty-state .em { font-size: 40px; display: block; margin-bottom: 10px; }
.empty-state b { display: block; color: var(--ink-2); margin-bottom: 4px; }

/* 记录详情抽屉 */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%);
  background: #fff; z-index: 70; box-shadow: -14px 0 50px rgba(20,30,60,.18);
  display: flex; flex-direction: column; animation: slideIn .25s ease;
}
@keyframes slideIn { from { transform: translateX(30px); opacity: .6 } to { transform: translateX(0); opacity: 1 } }
.drawer-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.drawer-head b { flex: 1; font-size: 16px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 22px; }
.detail-img { width: 100%; max-height: 230px; object-fit: contain; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-soft); margin-bottom: 16px; }
.detail-q { background: var(--bg-soft); border-radius: 12px; padding: 14px 16px; white-space: pre-wrap; font-size: 14px; line-height: 1.75; margin-bottom: 16px; }
.detail-section h4 { margin: 20px 0 10px; font-size: 13px; color: var(--muted); letter-spacing: .4px; }
.eval-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.eval-box { background: #f8faff; border-radius: 11px; padding: 12px; text-align: center; }
.eval-box b { display: block; font-size: 18px; color: var(--brand-dark); }
.eval-box span { font-size: 11px; color: var(--muted); }
.eval-text { font-size: 13.5px; line-height: 1.75; background: #f8faff; border-radius: 12px; padding: 14px 16px; }
.eval-text p { margin: 0 0 8px; }
.eval-text p:last-child { margin-bottom: 0; }
.detail-msg { display: flex; gap: 9px; margin-bottom: 14px; }
.detail-msg .who { width: 40px; flex: none; font-size: 11.5px; font-weight: 700; color: var(--muted); padding-top: 3px; }
.detail-msg .txt { flex: 1; background: #f8faff; border-radius: 11px; padding: 10px 13px; font-size: 13px; line-height: 1.7; white-space: pre-wrap; }
.detail-msg.student .txt { background: var(--brand-soft); }
.icon-btn {
  width: 32px; height: 32px; border-radius: 9px; background: var(--bg-soft);
  display: grid; place-items: center; font-size: 17px; color: var(--ink-2);
}
.icon-btn:hover { background: #e3e9f7; }

.pin-box { max-width: 380px; margin: 90px auto; text-align: center; padding: 34px 28px; }
.pin-box .lock { font-size: 38px; }
.pin-box h2 { margin: 10px 0 4px; font-size: 20px; }
.pin-box p { color: var(--muted); font-size: 13px; margin: 0 0 20px; }
.pin-input {
  width: 170px; text-align: center; letter-spacing: 12px; font-size: 22px; font-weight: 700;
  padding: 11px 14px 11px 26px; border: 1.5px solid var(--line); border-radius: 12px; outline: none;
}
.pin-input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(91,108,255,.09); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 900px) {
  .chat-layout { grid-template-columns: 1fr; }
  .side-card { position: static; }
  .side-card img { max-height: 150px; object-fit: contain; }
  .chart-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  .wrap { padding: 20px 14px 44px; }
  .topbar-inner { padding: 10px 14px; }
  .brand-text span { display: none; }
  .confirm-grid { grid-template-columns: 1fr; }
  .feature-row { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 24px 14px 28px; border-radius: 20px; }
  .hero h1 { font-size: 22px; }
  .card-pad { padding: 18px; }
  .chat-card { height: auto; min-height: 0; }
  .messages { height: 46vh; }
  .bubble { max-width: 86%; }
  .kpi-grid { gap: 10px; }
  .kpi { padding: 14px; }
  .kpi .k-value { font-size: 23px; }
  .hbar-name { width: 76px; }
}
