/* ==========================================================================
   Blu-shop.cz – Produktový AI Asistent (Karel: b-s-k / Jan: b-s-j)
   Design System matching blu-shop.cz (#0b689a, #73ba2c, #ffbb00, #27263f)
   ========================================================================== */

:root {
  color-scheme: light dark;
  accent-color: #0b689a;

  /* Blu-shop.cz Core Brand Tokens */
  --bs-blue: #0b689a;
  --bs-blue-bright: #1689c7;
  --bs-blue-deep: #07476b;
  --bs-blue-glow: rgba(11, 104, 154, 0.28);
  --bs-green: #73ba2c;
  --bs-green-bright: #84d136;
  --bs-green-soft: rgba(115, 186, 44, 0.16);
  --bs-amber: #ffbb00;
  --bs-amber-soft: rgba(255, 187, 0, 0.16);
  --bs-danger: #ef4444;

  /* Dark Home-Cinema Theme (Default) */
  --bg-app: #0b1017;
  --bg-surface: #111924;
  --bg-elevated: #172231;
  --bg-card: #1a2738;
  --bg-input: #0e1620;
  --bg-user-msg: linear-gradient(135deg, #0b689a 0%, #084c73 100%);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.22);

  --font-sans: "Inter", "Roboto", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

html[data-theme="light"] {
  --bg-app: #f3f7fa;
  --bg-surface: #ffffff;
  --bg-elevated: #f8fafc;
  --bg-card: #f1f5f9;
  --bg-input: #ffffff;
  --bg-user-msg: linear-gradient(135deg, #0b689a 0%, #09537b 100%);
  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --shadow-lg: 0 18px 40px rgba(11, 104, 154, 0.12);
  --shadow-sm: 0 2px 10px rgba(15, 23, 42, 0.06);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

::selection {
  background-color: var(--bs-blue);
  color: #ffffff;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* Native Scrollbar Theming (modern-web-guidance compliant) */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}

/* ==========================================================================
   AUTH VIEW (Login Screen)
   ========================================================================== */

.auth-view {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 20%, rgba(11, 104, 154, 0.22), transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(115, 186, 44, 0.12), transparent 45%),
    var(--bg-app);
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 36px 32px 28px;
  box-shadow: var(--shadow-lg);
}

.auth-header {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  padding: 10px 20px;
  border-radius: 12px;
  margin-bottom: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.auth-logo {
  height: 36px;
  width: auto;
  display: block;
}

.auth-badges {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.fmt-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.fmt-pill img {
  height: 14px;
  width: auto;
}

.auth-header h1 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-field input {
  width: 100%;
  padding: 12px 14px;
  font-size: 14.5px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-field input:focus {
  outline: none;
  border-color: var(--bs-blue-bright);
  box-shadow: 0 0 0 3px var(--bs-blue-glow);
}

/* Modern validity states (:user-invalid / :user-valid) */
input:not(input[type="range"]):user-invalid {
  border-color: var(--bs-danger);
}

.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrap input {
  padding-right: 42px;
}

.icon-btn-inline {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: inline-flex;
}

.icon-btn-inline:hover {
  color: var(--text-primary);
}

.auth-error {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  font-size: 13px;
  line-height: 1.4;
}

html[data-theme="light"] .auth-error {
  color: #b91c1c;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  font-size: 14.5px;
  font-weight: 600;
  font-family: inherit;
  color: #ffffff;
  background: linear-gradient(135deg, var(--bs-blue) 0%, var(--bs-blue-bright) 100%);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.12s, filter 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 14px rgba(11, 104, 154, 0.35);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-full {
  width: 100%;
}

.auth-footer {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

.security-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ==========================================================================
   APP WORKSPACE LAYOUT (3 Columns)
   ========================================================================== */

.app-layout {
  display: grid;
  grid-template-columns: 280px 1fr 310px;
  height: 100dvh;
  width: 100vw;
  overflow: hidden;
}

.app-layout.files-panel-closed {
  grid-template-columns: 280px 1fr 0px;
}

.app-layout.files-panel-closed .sidebar-right {
  display: none;
}

/* Left Sidebar */
.sidebar-left {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  height: 100dvh;
  overflow: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-logo-link {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  padding: 5px 10px;
  border-radius: 8px;
}

.brand-logo-img {
  height: 22px;
  width: auto;
  display: block;
}

.brand-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.brand-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

.workspace-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 99px;
  background: rgba(11, 104, 154, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

html[data-theme="light"] .workspace-badge {
  color: var(--bs-blue);
}

.sidebar-actions {
  padding: 14px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-new-thread {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  color: #ffffff;
  background: linear-gradient(135deg, var(--bs-blue) 0%, #0e7bb5 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
}

.btn-new-thread:hover {
  filter: brightness(1.1);
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box svg {
  position: absolute;
  left: 10px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 8px 10px 8px 32px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
}

.search-box input:focus {
  outline: none;
  border-color: var(--bs-blue-bright);
}

.sidebar-section-label {
  padding: 6px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.thread-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.thread-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.12s, border-color 0.12s;
  color: var(--text-secondary);
}

.thread-item:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.thread-item.active {
  background: rgba(11, 104, 154, 0.18);
  border-color: rgba(22, 137, 199, 0.4);
  color: var(--text-primary);
}

.thread-item-main {
  min-width: 0;
  flex: 1;
}

.thread-item-title {
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thread-item-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

.thread-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bs-green);
}

.thread-status-dot.processing {
  background: var(--bs-amber);
  animation: pulseDot 1.2s infinite ease-in-out;
}

.thread-delete-btn {
  opacity: 0;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
}

.thread-item:hover .thread-delete-btn {
  opacity: 1;
}

.thread-delete-btn:hover {
  color: var(--bs-danger);
  background: rgba(239, 68, 68, 0.12);
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
}

.colleague-card {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--bs-blue) 0%, var(--bs-green) 100%);
  color: #ffffff;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-info {
  min-width: 0;
  flex: 1;
}

.user-name {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-controls {
  display: flex;
  gap: 4px;
}

.icon-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.icon-btn:hover {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

/* ==========================================================================
   CENTER CHAT AREA
   ========================================================================== */

.chat-main {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  background: var(--bg-app);
  min-width: 0;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 22px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.thread-title-group {
  min-width: 0;
}

.active-thread-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.active-thread-meta {
  font-size: 11.5px;
  color: var(--text-muted);
}

.chat-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Admin Switcher for Štěpán */
.admin-switcher {
  display: inline-flex;
  background: var(--bg-elevated);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

.admin-switch-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.admin-switch-btn.active {
  background: var(--bs-blue);
  color: #ffffff;
}

/* Bridge Status Pill */
.bridge-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bs-green-soft);
  color: var(--bs-green-bright);
  border: 1px solid rgba(115, 186, 44, 0.35);
}

html[data-theme="light"] .bridge-status-pill.online {
  color: #3f6d13;
}

.bridge-status-pill.busy {
  background: var(--bs-amber-soft);
  color: var(--bs-amber);
  border-color: rgba(255, 187, 0, 0.4);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.88); }
}

.btn-secondary-sm {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s, border-color 0.12s;
}

.btn-secondary-sm:hover {
  background: var(--bg-card);
  border-color: var(--bs-blue-bright);
}

.count-badge {
  background: var(--bs-blue);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
}

/* Messages Stream */
.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.messages-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 920px;
  width: 100%;
  margin: 0 auto;
}

.msg-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.msg-row.user {
  flex-direction: row-reverse;
}

.msg-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 700;
  flex-shrink: 0;
}

.msg-row.assistant .msg-avatar {
  background: #ffffff;
  border: 1px solid var(--border-strong);
  padding: 4px;
}

.msg-row.assistant .msg-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.msg-row.user .msg-avatar {
  background: var(--bs-blue);
  color: #ffffff;
}

.msg-bubble {
  max-width: min(82%, 780px);
  border-radius: 16px;
  padding: 14px 18px;
  line-height: 1.6;
  font-size: 14.5px;
  box-shadow: var(--shadow-sm);
  overflow-wrap: break-word;
}

.msg-row.assistant .msg-bubble {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-top-left-radius: 4px;
}

.msg-row.user .msg-bubble {
  background: var(--bg-user-msg);
  color: #ffffff;
  border-top-right-radius: 4px;
}

.msg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  font-size: 11.5px;
  opacity: 0.78;
}

.msg-sender-name {
  font-weight: 700;
}

/* Markdown Styling inside Bubbles */
.msg-content > *:first-child { margin-top: 0; }
.msg-content > *:last-child { margin-bottom: 0; }

.msg-content h1,
.msg-content h2,
.msg-content h3 {
  margin: 14px 0 8px;
  line-height: 1.3;
}

.msg-content h3 {
  font-size: 15.5px;
  color: #38bdf8;
}

html[data-theme="light"] .msg-row.assistant .msg-content h3 {
  color: var(--bs-blue);
}

.msg-content p {
  margin: 8px 0;
}

.msg-content ul,
.msg-content ol {
  margin: 8px 0;
  padding-left: 22px;
}

.msg-content li {
  margin: 4px 0;
}

.msg-content code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(15, 23, 42, 0.45);
}

html[data-theme="light"] .msg-row.assistant .msg-content code {
  background: #e2e8f0;
  color: #0f172a;
}

.msg-content pre {
  background: #090d14;
  color: #e2e8f0;
  padding: 12px 14px;
  border-radius: 10px;
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
}

.msg-content pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

/* Blu-shop Product Tables in Chat */
.msg-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 13px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
}

.msg-content th,
.msg-content td {
  padding: 8px 11px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.msg-content th {
  background: rgba(11, 104, 154, 0.22);
  font-weight: 700;
}

.msg-content a {
  color: #38bdf8;
  text-decoration: underline;
  text-underline-offset: 2px;
}

html[data-theme="light"] .msg-row.assistant .msg-content a {
  color: var(--bs-blue);
}

.msg-row.user .msg-content a {
  color: #ffffff;
}

/* Message Attachment Cards (CSV / HTML / Images) */
.msg-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.att-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 600;
  transition: transform 0.1s, border-color 0.15s;
}

.att-card:hover {
  border-color: var(--bs-green);
  transform: translateY(-1px);
}

.att-card.att-csv {
  background: rgba(115, 186, 44, 0.14);
  border-color: rgba(115, 186, 44, 0.45);
}

.att-thumb {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  object-fit: cover;
  background: #000;
  cursor: zoom-in;
}

.att-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.att-name {
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.att-sub {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Live Progress Card (Replaces Chain of Thought) */
.live-progress-card {
  max-width: 920px;
  width: 100%;
  margin: 4px auto 0;
  padding: 14px 18px;
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(11, 104, 154, 0.18) 0%, rgba(115, 186, 44, 0.1) 100%);
  border: 1px solid rgba(22, 137, 199, 0.45);
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}

.progress-spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid rgba(56, 189, 248, 0.25);
  border-top-color: #38bdf8;
  animation: spin 0.85s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.progress-body {
  flex: 1;
  min-width: 0;
}

.progress-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 700;
  color: #38bdf8;
  margin-bottom: 3px;
}

html[data-theme="light"] .progress-title-row {
  color: var(--bs-blue);
}

.progress-elapsed {
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.progress-detail {
  font-size: 13.5px;
  color: var(--text-primary);
}

/* ==========================================================================
   COMPOSER & STAGED FILES
   ========================================================================== */

.composer-area {
  padding: 12px 24px 16px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
}

.staged-files-bar {
  max-width: 920px;
  margin: 0 auto 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.staged-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  font-size: 12px;
}

.staged-chip button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  font-size: 13px;
}

.staged-chip button:hover {
  color: var(--bs-danger);
}

.composer-box {
  max-width: 920px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-input);
  border: 1.5px solid var(--border-strong);
  border-radius: 14px;
  padding: 8px 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.composer-box:focus-within {
  border-color: var(--bs-blue-bright);
  box-shadow: 0 0 0 3px var(--bs-blue-glow);
}

.composer-icon-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.12s, border-color 0.12s;
}

.composer-icon-btn:hover {
  color: var(--text-primary);
  border-color: var(--bs-blue-bright);
}

#messageInput {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14.5px;
  line-height: 1.5;
  padding: 8px 6px;
  min-height: 76px;
  max-height: 240px;
  overflow-y: auto;
  resize: none;
  field-sizing: content;
}

#messageInput:focus {
  outline: none;
}

.btn-send {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  height: 38px;
  font-size: 13.5px;
  font-weight: 700;
  font-family: inherit;
  color: #ffffff;
  background: linear-gradient(135deg, var(--bs-green) 0%, #5da11c 100%);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  flex-shrink: 0;
  transition: filter 0.15s, transform 0.1s;
}

.btn-send:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.composer-hint {
  max-width: 920px;
  margin: 7px auto 0;
  font-size: 11.5px;
  color: var(--text-muted);
  text-align: center;
}

/* ==========================================================================
   RIGHT PANEL: FILES & SHOPTET EXPORTS
   ========================================================================== */

.sidebar-right {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
  height: 100dvh;
  overflow: hidden;
}

.right-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.right-panel-header h2 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
}

.right-panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.files-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.dot-green,
.dot-blue {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-green { background: var(--bs-green); }
.dot-blue { background: var(--bs-blue-bright); }

.files-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.files-empty {
  margin: 0;
  padding: 14px;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px dashed var(--border-strong);
  font-size: 12.5px;
  color: var(--text-muted);
  text-align: center;
}

.file-drawer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  text-decoration: none;
  color: var(--text-primary);
  transition: border-color 0.12s;
}

.file-drawer-item:hover {
  border-color: var(--bs-blue-bright);
}

.file-drawer-info {
  min-width: 0;
  flex: 1;
}

.file-drawer-name {
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-drawer-type {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.file-drawer-dl {
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 9px;
  border-radius: 6px;
  background: var(--bs-blue);
  color: #ffffff;
  flex-shrink: 0;
}

/* ==========================================================================
   DRAG & DROP OVERLAY & DIALOG MODAL
   ========================================================================== */

.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(11, 16, 23, 0.82);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.drop-overlay[hidden] {
  display: none !important;
}

.drop-overlay-card {
  border: 2px dashed var(--bs-green);
  background: var(--bg-surface);
  padding: 42px 54px;
  border-radius: 24px;
  text-align: center;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
}

.drop-overlay-icon {
  color: var(--bs-green);
  margin-bottom: 12px;
}

.drop-overlay-card h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.drop-overlay-card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
}

/* Modal Dialog (light-dismiss-a-dialog pattern) */
.preview-dialog {
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: var(--bg-surface);
  color: var(--text-primary);
  padding: 0;
  max-width: min(90vw, 860px);
  max-height: 90dvh;
  box-shadow: var(--shadow-lg);
}

.preview-dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

.preview-dialog-inner {
  display: flex;
  flex-direction: column;
  max-height: 90dvh;
}

.preview-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.preview-dialog-header h3 {
  margin: 0;
  font-size: 15px;
}

.preview-dialog-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-dialog-body {
  padding: 18px;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #05080c;
}

.preview-dialog-body img {
  max-width: 100%;
  max-height: 74dvh;
  object-fit: contain;
  border-radius: 8px;
}

.mobile-only {
  display: none;
}

@media (max-width: 1024px) {
  .app-layout {
    grid-template-columns: 250px 1fr;
  }
  .sidebar-right {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 310px;
    z-index: 60;
    box-shadow: var(--shadow-lg);
  }
}

@media (max-width: 768px) {
  .app-layout {
    grid-template-columns: 1fr;
  }
  .sidebar-left {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 280px;
    z-index: 70;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  .sidebar-left.open {
    transform: translateX(0);
  }
  .mobile-only {
    display: inline-flex;
  }
}