/* Веб-кабинет истории проверок ДЗ (Этап 3) — светлый, без эмодзи в UI */
:root {
  --hw-bg: #f5f6f8;
  --hw-panel: #ffffff;
  --hw-line: #e4e7ec;
  --hw-text: #1d2433;
  --hw-muted: #6b7280;
  --hw-accent: #2f6fed;
  --hw-accent-soft: #e8effd;
  --hw-ok: #16803c;
  --hw-warn: #b45309;
  --hw-err: #b42318;
  --hw-radius: 14px;
}
.hw-body { margin: 0; background: var(--hw-bg); color: var(--hw-text);
  font-family: "Inter", "Segoe UI", system-ui, sans-serif; height: 100vh; overflow: hidden; }
.hw-app { display: grid; grid-template-columns: 320px 1fr; height: 100vh; }

/* --- сайдбар --- */
.hw-sidebar { background: var(--hw-panel); border-right: 1px solid var(--hw-line);
  display: flex; flex-direction: column; min-width: 0; }
.hw-side-head { padding: 14px 16px; border-bottom: 1px solid var(--hw-line);
  display: flex; flex-direction: column; gap: 8px; }
.hw-side-head .brand { text-decoration: none; color: var(--hw-text); font-weight: 600; }
.hw-usage { align-self: flex-start; font-size: 13px; font-weight: 600;
  background: var(--hw-accent-soft); color: var(--hw-accent);
  padding: 3px 10px; border-radius: 999px; }
.hw-filters { display: flex; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--hw-line); }
.hw-select { flex: 1; min-width: 0; border: 1px solid var(--hw-line); border-radius: 10px;
  padding: 7px 10px; font-size: 13px; background: var(--hw-bg); color: var(--hw-text); }
.hw-btn-ghost { border: none; background: none; color: var(--hw-muted); font-size: 13px; cursor: pointer; }
.hw-btn-ghost:hover { color: var(--hw-accent); }
.hw-list { overflow-y: auto; flex: 1; padding: 8px; }
.hw-item { display: block; width: 100%; text-align: left; border: none; background: none;
  cursor: pointer; padding: 10px 12px; border-radius: 10px; }
.hw-item:hover { background: var(--hw-bg); }
.hw-item.active { background: var(--hw-accent-soft); }
.hw-item-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
.hw-item-meta { display: flex; gap: 8px; align-items: center; margin-top: 3px;
  font-size: 12px; color: var(--hw-muted); }
.hw-badge { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.hw-badge.done { background: #e7f6ec; color: var(--hw-ok); }
.hw-badge.pending { background: #fdf3e2; color: var(--hw-warn); }
.hw-badge.cancelled { background: #fdeceb; color: var(--hw-err); }
.hw-list-empty { color: var(--hw-muted); font-size: 13px; text-align: center; padding: 24px 12px; }

/* --- чат --- */
.hw-chat { display: flex; flex-direction: column; min-width: 0; }
.hw-chat-head { display: flex; gap: 12px; align-items: center; background: var(--hw-panel);
  border-bottom: 1px solid var(--hw-line); padding: 12px 24px; }
.hw-chat-title { font-weight: 600; }
.hw-chat-sub { font-size: 12px; color: var(--hw-muted); }
.hw-messages { flex: 1; overflow-y: auto; padding: 24px; display: flex;
  flex-direction: column; gap: 14px; max-width: 860px; width: 100%; margin: 0 auto; }
.hw-empty { margin: auto; text-align: center; color: var(--hw-muted); font-size: 14px; }
.hw-empty .hw-icon { display: inline-block; margin-bottom: 8px; }

.bubble { max-width: 78%; padding: 12px 16px; border-radius: var(--hw-radius);
  font-size: 14px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.bubble.child { align-self: flex-start; background: var(--hw-panel);
  border: 1px solid var(--hw-line); border-bottom-left-radius: 4px; }
.bubble.ai { align-self: flex-end; background: var(--hw-accent-soft);
  color: var(--hw-text); border-bottom-right-radius: 4px; }
.bubble .b-label { display: block; font-size: 11px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--hw-muted); margin-bottom: 6px; }
.bubble img { max-width: 100%; border-radius: 10px; margin-top: 8px; display: block; }
.bubble .b-photo-ph { margin-top: 8px; padding: 14px; border: 1px dashed var(--hw-line);
  border-radius: 10px; color: var(--hw-muted); font-size: 13px; text-align: center; }
.bubble.photo-only { padding: 8px; }

.hw-statusbar { align-self: center; font-size: 12px; color: var(--hw-muted);
  background: var(--hw-panel); border: 1px solid var(--hw-line);
  padding: 4px 14px; border-radius: 999px; }
.hw-statusbar.bad { color: var(--hw-err); border-color: #f4d3d0; background: #fdf3f2; }

/* --- иконки (lucide) --- */
.hw-icon { width: 20px; height: 20px; }
.hw-icon.lg { width: 40px; height: 40px; }
.hw-icon svg { width: 100%; height: 100%; stroke: currentColor; }

/* --- вход --- */
.hw-login { position: fixed; inset: 0; background: rgba(29,36,51,.45);
  display: flex; align-items: center; justify-content: center; }
.hw-login[hidden] { display: none; }
.hw-login-card { background: var(--hw-panel); border-radius: 16px; padding: 24px;
  width: 320px; display: flex; flex-direction: column; gap: 10px; }
.hw-login-card h3 { margin: 0; }
.hw-muted { color: var(--hw-muted); font-size: 13px; margin: 0; }
.hw-btn { background: var(--hw-accent); color: #fff; border: none; border-radius: 10px;
  padding: 10px 14px; font-size: 14px; font-weight: 600; cursor: pointer; }
.hw-btn:hover { filter: brightness(1.05); }
.hw-err { color: var(--hw-err); font-size: 13px; min-height: 16px; }

@media (max-width: 760px) {
  .hw-app { grid-template-columns: 1fr; grid-template-rows: 38vh 1fr; }
  .hw-messages { padding: 14px; }
}
