/* layout.css — login, header, input area, reconnecting */

/* Login */
#login { display: flex; align-items: center; justify-content: center; height: 100%; padding: 20px; }
.login-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-6); width: 100%; max-width: 360px; }
.login-box h1 { font-size: var(--font-3xl); margin-bottom: var(--space-1); }
.login-box p { color: var(--text-dim); font-size: var(--font-md); margin-bottom: var(--space-5); }
.login-box input { width: 100%; padding: 12px 14px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: var(--font-input); outline: none; margin-bottom: var(--space-4); }
.login-box input:focus { border-color: var(--accent); }
.login-box button { width: 100%; min-height: var(--control-lg); padding: var(--space-3); border-radius: var(--radius-md); border: none; background: var(--accent); color: var(--on-accent); font-size: var(--font-lg); font-weight: 600; cursor: pointer; }
.login-error { color: var(--error); font-size: var(--font-md); margin-top: var(--space-2); display: none; }

/* Workspace: split-view (desktop) / overlay (mobile) */
#workspace { display: none; height: 100dvh; height: -webkit-fill-available; overflow: hidden; }
#workspace.active { display: flex; }

/* Preview iframe */
.ws-preview { flex: 1; position: relative; min-width: 0; background: var(--on-accent); display: flex; flex-direction: column; }
.ws-preview iframe { flex: 1; width: 100%; border: none; display: block; transition: width 0.2s ease; }
.ws-preview.constrained { background: var(--bg); }
.ws-preview.constrained iframe { box-shadow: 0 0 0 1px var(--border); margin: 0 auto; }
.ws-preview-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,0); pointer-events: none;
  transition: background 0.3s ease;
}
.ws-preview-overlay.reloading {
  background: rgba(0,0,0,0.15); pointer-events: auto;
}

/* Preview toolbar */
.preview-toolbar {
  display: flex; align-items: center; gap: 2px;
  padding: var(--space-1) var(--space-2); background: var(--surface);
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.preview-tab {
  width: var(--control-sm); height: var(--control-sm); border-radius: var(--radius-sm);
  border: 1px solid transparent; background: transparent;
  color: var(--text-dim); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.1s;
}
.preview-tab:hover { color: var(--text); border-color: var(--border); }
.preview-tab.active { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.preview-size {
  margin-left: auto; font-size: var(--font-xs); color: var(--text-dim);
  font-family: var(--mono);
}

/* --- Pages in the preview (js/pages.js) --- */
.pg-current {
  display: flex; align-items: center; gap: var(--space-1); max-width: 45%;
  height: var(--control-sm); padding: 0 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: transparent; color: var(--text);
  font: inherit; font-size: var(--font-md); cursor: pointer;
}
.pg-current span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-caret { color: var(--text-dim); font-size: var(--font-xs); }
.pg-spacer { flex: 1; }
.pg-act {
  height: var(--control-sm); padding: 0 10px; margin-left: var(--space-1); border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: transparent; color: var(--text-dim);
  font: inherit; font-size: var(--font-sm); cursor: pointer; white-space: nowrap;
}
.pg-act:hover { color: var(--text); }
.pg-act--pick, .pg-share-mobile { display: none; }

.pg-menu {
  display: none; position: absolute; top: 40px; left: 8px; z-index: 60;
  width: min(380px, calc(100% - 16px)); max-height: 60vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}
.pg-menu.open { display: block; }
.pg-menu__head { padding: 10px 12px 4px; font-size: var(--font-sm); color: var(--text-dim); }
.pg-row { display: flex; align-items: center; gap: 2px; padding: 0 6px; }
.pg-row.current .pg-row__name::after { content: ' ✓'; color: var(--accent); }
.pg-row__main {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start;
  padding: 8px 6px; border: none; background: transparent; color: var(--text);
  font: inherit; text-align: left; cursor: pointer; border-radius: var(--radius-sm);
}
.pg-row__main:hover { background: var(--bg); }
.pg-row__name { font-size: var(--font-base); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-row__url { font-size: var(--font-sm); color: var(--text-dim); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-icon {
  width: var(--control-md); height: var(--control-md); flex-shrink: 0; border: none; background: transparent;
  color: var(--text-dim); font-size: var(--font-xl); cursor: pointer; border-radius: var(--radius-sm);
}
.pg-icon:hover { color: var(--text); background: var(--bg); }
.pg-menu__foot { display: flex; justify-content: space-between; gap: var(--space-2); padding: 6px 12px 10px; border-top: 1px solid var(--border); margin-top: var(--space-1); }
.pg-link { border: none; background: transparent; color: var(--accent); font: inherit; font-size: var(--font-md); cursor: pointer; padding: 6px 0; }
.pg-empty { padding: var(--space-3); color: var(--text-dim); font-size: var(--font-md); }

.pg-map {
  display: none; position: fixed; inset: 0; z-index: 1100;
  background: var(--overlay); align-items: center; justify-content: center; padding: var(--space-4);
}
.pg-map.open { display: flex; }
.pg-map__panel {
  width: min(720px, 100%); max-height: 90vh; display: flex; flex-direction: column;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden;
}
.pg-map__head { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); }
.pg-map__title { flex: 1; font-size: var(--font-xl); color: var(--text); }
.pg-map__count { color: var(--text-dim); }
.pg-map__close { width: var(--control-md); height: var(--control-md); border: none; background: transparent; color: var(--text-dim); font-size: var(--font-icon); cursor: pointer; }
.pg-map__body { overflow: auto; padding: var(--space-3) var(--space-4) var(--space-4); display: flex; flex-direction: column; gap: 10px; }
.pg-map__section { margin-top: var(--space-2); font-size: var(--font-sm); color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.04em; }
.pg-map__note { margin-top: 6px; font-size: var(--font-sm); color: var(--text-dim); }
.pg-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 12px; }
.pg-card__head { display: flex; align-items: center; gap: var(--space-2); }
.pg-card__name { flex: 1; min-width: 0; font-size: var(--font-lg); color: var(--text); overflow-wrap: anywhere; }
.pg-card__badge { font-size: var(--font-xs); padding: 2px 8px; border-radius: var(--radius-full); border: 1px solid var(--border); color: var(--text-dim); white-space: nowrap; }
.pg-card__badge.on { color: var(--accent); border-color: var(--accent); }
.pg-card__url { font-size: var(--font-sm); color: var(--text-dim); margin: 2px 0 6px; overflow-wrap: anywhere; }
.pg-card__line { font-size: var(--font-md); color: var(--text-dim); line-height: 1.5; overflow-wrap: anywhere; }
.pg-card__line b { color: var(--text); font-weight: 500; }
.pg-card__warn { font-size: var(--font-md); color: var(--warning-text); line-height: 1.5; }
.pg-card__actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--space-2); }
.pg-card__actions button, .page-card__actions button {
  min-height: var(--control-md); padding: var(--space-1) 14px; border-radius: var(--radius-md); border: 1px solid var(--border);
  background: transparent; color: var(--text); font: inherit; font-size: var(--font-md); cursor: pointer;
}
.pg-card__actions button:hover, .page-card__actions button:hover { border-color: var(--accent); color: var(--accent); }

.pg-toast {
  position: fixed; left: 50%; bottom: calc(64px + var(--sab)); transform: translateX(-50%) translateY(20px);
  z-index: 1200; padding: var(--space-2) var(--space-4); border-radius: var(--radius-full);
  background: var(--text); color: var(--bg); font-size: var(--font-md);
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
}
.pg-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.pg-toast { display: flex; align-items: center; gap: var(--space-3); }
.pg-toast__undo {
  pointer-events: auto; min-height: var(--control-sm); padding: 0 var(--space-3); border: 1px solid currentColor; border-radius: var(--radius-full);
  background: transparent; color: inherit; font: inherit; font-weight: 600; cursor: pointer;
}

/* Resize handle */
.ws-resize {
  width: 4px; cursor: col-resize; background: var(--border); flex-shrink: 0;
  transition: background 0.15s; touch-action: none;
}
.ws-resize:hover, .ws-resize.active { background: var(--accent); }

/* Chat panel: floating over the site by default; data-chat-mode="pinned"
   returns it to the right-hand split column. */
.ws-chat { width: 420px; flex: 0 0 420px; display: flex; flex-direction: column; overflow: hidden; border-left: 1px solid var(--border); background: var(--bg); }
.ws-chat[data-chat-mode="floating"] {
  position: fixed; z-index: 150; left: 16px; top: 16px; width: 400px; height: min(680px, calc(100dvh - 32px));
  flex: none; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
}
.ws-chat #chat { width: 100%; min-width: 0; }
.ws-chat-mini, .ws-chat-resize { display: none; }
.ws-chat[data-chat-mode="floating"].is-minimized { width: 64px !important; height: 64px !important; border-radius: 50%; overflow: visible; }
.ws-chat[data-chat-mode="floating"].is-minimized #chat { display: none; }
.ws-chat[data-chat-mode="floating"].is-minimized .ws-chat-mini { display: flex; }
.ws-chat-resize[hidden] { display: none !important; }
.ws-chat-mini {
  position: absolute; inset: 0; width: 64px; height: 64px; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 50%; background: var(--accent); color: var(--on-accent);
  box-shadow: var(--shadow-lg); cursor: pointer; touch-action: manipulation;
}
.ws-chat-mini svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ws-chat-mini__dot { position: absolute; width: 11px; height: 11px; top: 1px; right: 1px; border-radius: 50%; border: 2px solid var(--bg); background: var(--success); }
.ws-chat-resize { position: absolute; z-index: 5; right: 1px; bottom: 1px; width: 24px; height: 24px; align-items: center; justify-content: center; border: 0; border-radius: 0 0 var(--radius-lg) 0; background: transparent; color: var(--text-dim); cursor: nwse-resize; touch-action: none; }
.ws-chat-resize svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.ws-chat[data-chat-mode="floating"]:not(.is-minimized) .ws-chat-resize { display: flex; }
.ws-chat[data-chat-mode="floating"] .header { cursor: default; }
.chat-drag-handle, .chat-window-control { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 32px; height: 32px; padding: 0; border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; color: var(--text-dim); cursor: pointer; touch-action: none; }
.chat-drag-handle { cursor: grab; }
.chat-drag-handle:active { cursor: grabbing; }
.chat-drag-handle svg { width: 16px; height: 16px; fill: currentColor; }
.chat-window-control svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.chat-window-control:hover, .chat-drag-handle:hover { border-color: var(--border); color: var(--text); }
.chat-window-control:focus-visible, .chat-drag-handle:focus-visible, .ws-chat-mini:focus-visible, .ws-chat-resize:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ws-chat[data-chat-mode="pinned"] .chat-drag-handle { display: none; }
.ws-chat[data-chat-mode="pinned"] .ws-chat-resize { display: none; }
.ws-chat.is-compact .chat-window-control { display: none; }
.ws-chat.is-compact .header-status { display: none !important; }
.ws-chat.is-compact .biz-btn__label { display: none; }
.ws-chat.is-compact .biz-btn { width: var(--control-md); min-width: var(--control-md); justify-content: center; padding: 0; }
.menu-item--compact { display: none; }
.ws-chat.is-compact .menu-item--compact { display: flex; }

/* Chat container */
#chat { display: flex; flex-direction: column; height: 100%; overflow: hidden; }

/* Mobile FAB */
.ws-fab {
  display: none; position: fixed; bottom: 20px; right: 20px; z-index: 1000;
  width: 56px; height: 56px; border-radius: 50%; border: none;
  background: var(--accent); color: var(--on-accent); cursor: pointer;
  box-shadow: 0 4px 20px var(--accent-glow);
  align-items: center; justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.ws-fab:active { transform: scale(0.92); }
.ws-fab svg { width: 24px; height: 24px; }
.ws-fab.has-update { animation: fabPulse 2s ease-in-out infinite; }
@keyframes fabPulse { 0%,100% { box-shadow: 0 4px 20px var(--accent-glow); } 50% { box-shadow: 0 4px 30px var(--accent-glow-strong); } }

/* Legacy mobile sheet handle — kept for the pinned mobile layout */
.ws-chat-handle { display: none; }

/* Mobile tab bar */
.ws-tabbar {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 1000; background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: var(--sab);
}
.ws-tabbar__tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 0 4px; border: none; background: none;
  color: var(--text-dim); font-size: var(--font-xs); font-family: inherit;
  cursor: pointer; position: relative;
  -webkit-tap-highlight-color: transparent;
}
.ws-tabbar__tab.active { color: var(--accent); }
.ws-tabbar__tab svg { opacity: 0.6; }
.ws-tabbar__tab.active svg { opacity: 1; stroke: var(--accent); }
.ws-tabbar__badge {
  position: absolute; top: 2px; right: calc(50% - 20px);
  color: var(--accent); font-size: var(--font-xl); line-height: 1;
}

/* Mobile: tab-based layout */
@media (max-width: 767px) {
  #workspace.active { flex-direction: column; }
  .ws-preview { flex: 1; }
  .ws-resize { display: none; }
  .ws-fab { display: none !important; }
  .ws-tabbar { display: flex; }
  .ws-chat[data-chat-mode="floating"] {
    position: fixed; z-index: 150; border: 1px solid var(--border); border-radius: var(--radius-lg);
    max-width: calc(100vw - 16px); max-height: calc(100dvh - 72px - var(--sab));
  }
  .ws-chat[data-chat-mode="floating"].is-minimized { display: flex !important; width: 60px !important; height: 60px !important; border-radius: 50%; }
  .ws-chat[data-chat-mode="floating"] .ws-chat-mini { width: 60px; height: 60px; }
  .ws-chat[data-chat-mode="floating"] .ws-chat-resize { width: 32px; height: 32px; }
  .ws-chat[data-chat-mode="pinned"] { width: 100%; flex: none; border: 0; display: none; position: fixed; top: 0; left: 0; right: 0; bottom: calc(44px + var(--sab)); z-index: 900; }
  .ws-chat[data-chat-mode="pinned"].open { display: flex; }
  .ws-chat[data-chat-mode="pinned"] .ws-chat-handle { display: none; }
  .ws-chat[data-chat-mode="floating"] .chat-drag-handle { width: 30px; height: 30px; }
  .ws-chat[data-chat-mode="floating"] .header-actions { gap: 0; }
  .ws-chat[data-chat-mode="floating"] .chat-window-control { width: 30px; height: 30px; }
  /* On a phone the toolbar is the page strip: which page, pick, share. */
  .preview-toolbar { display: flex; padding: var(--space-1) var(--space-2); gap: var(--space-1); }
  .preview-tab, .preview-size, .pg-act--open, .pg-share-desktop { display: none; }
  .pg-act--pick, .pg-share-mobile { display: inline; }
  .pg-act--pick { display: inline-block; }
  .pg-current { max-width: none; flex: 1; min-width: 0; height: var(--control-sm); }
  .pg-spacer { display: none; }
  .pg-act { height: var(--control-sm); margin-left: 0; font-size: var(--font-md); color: var(--text); }
  .pg-menu {
    position: fixed; top: auto; left: 0; right: 0; width: auto;
    bottom: calc(44px + var(--sab)); max-height: 70vh; z-index: 950;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
  .pg-row__main { padding: 10px 6px; }
  .pg-icon { width: var(--control-lg); height: var(--control-lg); }
  .pg-map { padding: 0; }
  .pg-map__panel { width: 100%; height: 100%; max-height: none; border-radius: 0; }
  /* Chat tab open: the preview is covered, not removed (see switchMobileTab). */
  .ws-preview--behind { visibility: hidden; }

  /* Keyboard open. .ws-chat is fixed against the layout viewport, and that
     viewport does not shrink for the on-screen keyboard — so the chip, the
     quick actions and the input all ended up underneath it. app.js measures
     the covered strip into --kb; lift the panel by exactly that much.
     The tab bar and the safe-area inset are both behind the keyboard, so
     neither should keep reserving height. */
  html.kb-open .ws-chat[data-chat-mode="pinned"] { bottom: var(--kb, 0px); }
  html.kb-open .ws-chat[data-chat-mode="floating"]:not(.is-minimized) { left: 8px !important; right: 8px !important; top: max(8px, var(--sat)) !important; bottom: var(--kb, 0px) !important; width: auto !important; height: auto !important; max-height: none; }
  html.kb-open .ws-chat[data-chat-mode="floating"] .ws-chat-resize { display: none !important; }
  html.kb-open .ws-tabbar { display: none; }
  html.kb-open .input-area { padding-bottom: var(--space-2); }
}

/* Tablet: narrower chat, bottom-sheet style */
@media (min-width: 768px) and (max-width: 1024px) {
  .ws-chat[data-chat-mode="pinned"] { width: 320px; flex-basis: 320px; display: flex !important; }
  .ws-fab { display: none !important; }
}

/* Desktop: ensure FAB hidden */
@media (min-width: 1025px) {
  .ws-fab { display: none !important; }
  .ws-chat[data-chat-mode="pinned"] { display: flex !important; }
}

/* Header */
.header {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-2); padding: 10px 12px; padding-top: calc(10px + var(--sat));
  border-bottom: 1px solid var(--border); background: var(--surface); flex-shrink: 0; z-index: 10; min-height: var(--control-lg);
}
.header-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; }
.header h1 { font-size: var(--font-xl); font-weight: 600; }
.qural-avatar { position: relative; width: 36px; height: 36px; flex-shrink: 0; }
.qural-avatar svg { width: 36px; height: 36px; }
.qural-status-dot {
  position: absolute; bottom: -1px; right: -1px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--error); border: 2px solid var(--surface); transition: background 0.3s;
}
.qural-status-dot.connected { background: var(--success); }
.qural-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.qural-activity { font-size: var(--font-sm); color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45vw; }
.qural-activity.busy { color: var(--accent); }

/* Header status */
.header-status { display: none; align-items: center; gap: 6px; font-family: var(--mono); font-size: var(--font-sm); color: var(--text-dim); margin-right: var(--space-1); }
.header-status.active { display: flex; }
.header-status span { white-space: nowrap; }
.header-status .status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex-shrink: 0; animation: statusPulse 1.5s ease-in-out infinite; }
@keyframes statusPulse { 0%,100% { opacity: 1; box-shadow: 0 0 0 0 var(--accent-glow); } 50% { opacity: 0.6; box-shadow: 0 0 0 4px rgba(16,185,129,0); } }

/* Header menu */
.header-menu { position: relative; }
.menu-btn { width: var(--control-md); height: var(--control-md); border-radius: var(--radius-md); border: 1px solid var(--border); background: transparent; color: var(--text-dim); font-size: var(--font-2xl); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.menu-btn:active { background: var(--border); }
.menu-dropdown { display: none; position: absolute; right: 0; top: 42px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); min-width: 180px; overflow: hidden; z-index: 100; box-shadow: var(--shadow-lg); }
.menu-dropdown.open { display: block; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: var(--space-3) var(--space-4); border: none; background: none; color: var(--text); font-size: var(--font-base); text-align: left; cursor: pointer; border-bottom: 1px solid var(--border); font-family: inherit; }
.menu-item:last-child { border-bottom: none; }
.menu-item:active { background: var(--border); }
.menu-item.danger { color: var(--error); }
.menu-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.6; }
.menu-overlay { display: none; position: fixed; inset: 0; z-index: 99; }
.menu-overlay.open { display: block; }

.reconnecting { padding: 6px 16px; background: var(--warning-bg); color: var(--warning-text); font-size: var(--font-md); text-align: center; display: none; flex-shrink: 0; }

/* Composer — one frame around everything that is part of the request.
   The pieces used to be four flat siblings, and the only border-top sat on
   .input-area, so the line separating panel from history ran *between* the
   selected element and the field it belongs to. */
.composer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 10;
}

/* Input area */
.input-area {
  display: flex; gap: 6px; padding: var(--space-2) var(--space-3);
  padding-bottom: calc(8px + var(--sab));
  align-items: flex-end;
  flex-shrink: 0; z-index: 10;
}
.input-area textarea {
  flex: 1; padding: 10px 12px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--bg);
  color: var(--text); font-size: var(--font-xl); outline: none; resize: none; min-height: var(--control-lg); max-height: 120px;
  font-family: inherit; line-height: 1.4; touch-action: manipulation;
  -webkit-user-select: text; user-select: text;
}
.input-area textarea:focus { border-color: var(--accent); }
.input-btn {
  width: var(--control-lg); height: var(--control-lg); border-radius: 50%; border: none; color: var(--on-accent); font-size: var(--font-2xl);
  cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  touch-action: manipulation;
}
.input-btn:disabled { opacity: 0.5; }
.btn-send { background: var(--accent); }
.btn-send:active { background: var(--accent-hover); }
.btn-send.cancel { background: var(--error); }
.btn-attach { background: transparent; border: 1px solid var(--border); color: var(--text-dim); font-size: var(--font-3xl); }
.btn-attach:active { background: var(--border); color: var(--text); }

/* Pending files */
/* 12px gutter, matching .input-area — attachments used to start 4px off the
   rail from the chip below them and the text beside them. */
.pending-files { display: none; padding: var(--space-2) var(--space-3) 0; flex-shrink: 0; flex-wrap: wrap; gap: 6px; }
/* Cards in the strip and in bubbles: css/files.css */

/* Send wrap / model */
.send-wrap { position: relative; }

.msg-tag { display: inline-block; font-size: var(--font-xs); color: var(--accent); border: 1px solid var(--accent); border-radius: var(--radius-full); padding: 1px 8px; margin-bottom: 6px; opacity: 0.85; }

/* Classes that replaced inline styles in index.html (STYLEGUIDE.md) */
.login-powered { color: var(--text-dim); font-size: var(--font-sm); margin-top: var(--space-4); text-align: center; }
.header-actions { display: flex; align-items: center; gap: var(--space-1); flex: 0 0 auto; }

/* Login screen without a token field: a pulse while the proof is checked, then the way to kexit.kz (js/auth.js showLogin) */
.login-loading { display: flex; align-items: center; gap: var(--space-2); color: var(--text-dim); font-size: var(--font-md); min-height: var(--control-lg); }
.login-loading[hidden], .login-nosession[hidden] { display: none; }
.login-spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--accent); animation: loginSpin 0.8s linear infinite; flex: none; }
@keyframes loginSpin { to { transform: rotate(360deg); } }
.login-nosession__text { color: var(--text-dim); font-size: var(--font-md); line-height: 1.5; margin-bottom: var(--space-4); }
.login-go { display: flex; align-items: center; justify-content: center; width: 100%; min-height: var(--control-lg); padding: var(--space-3); border-radius: var(--radius-md); background: var(--accent); color: var(--on-accent); font-size: var(--font-lg); font-weight: 600; text-decoration: none; }
.login-nosession .login-error { margin: 0 0 var(--space-3); }

/* «Школьный» (js/school.js): no Бизнес panel, no Pro, no business-site hints */
html[data-mode="school"] #businessBtn,
html[data-mode="school"] #menuBusiness,
html[data-mode="school"] #menuHints,
html[data-mode="school"] #proHeaderBtn,
html[data-mode="school"] #menuProGit,
html[data-mode="school"] #quralProBadge,
html[data-mode="school"] .hints-more,
html[data-mode="school"] #menuSiteMap,
html[data-mode="school"] #pgCurrent { display: none !important; }

/* A student's project bar over the chat (js/school.js) */
.school-bar { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border); background: var(--surface); font-size: var(--font-md); }
.school-bar__label { color: var(--text-dim); font-weight: 600; }
.school-bar__select, .school-bar__input { flex: 1; min-width: 0; height: var(--control-md); }
.school-bar__none { flex: 1; color: var(--text-dim); }
.school-bar__all { color: var(--accent); text-decoration: none; white-space: nowrap; }
.school-bar__err { flex-basis: 100%; color: var(--error-text); }
.school-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.school-chip { cursor: pointer; }
.school-chip input { position: absolute; opacity: 0; pointer-events: none; }
.school-chip span { display: inline-block; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); color: var(--text); font-size: var(--font-md); }
.school-chip input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.school-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
