/* ---- Task detail ---- */
.task-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }
@media (max-width: 900px) { .task-grid { grid-template-columns: 1fr; } }
.section-label {
  font-size: 12px; font-weight: 600; color: var(--slate-500);
  text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 6px;
}
.editable {
  background: white; border: 1px solid var(--slate-200); border-radius: 6px;
  padding: 12px 16px; min-height: 60px; cursor: text;
}
.editable:hover { border-color: var(--slate-300); }
.editable.empty { color: var(--slate-400); font-size: 14px; }

.field-row { margin-bottom: 12px; }
.field-row .label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em;
  font-weight: 600; color: var(--slate-500); margin-bottom: 4px;
}

/* Activity */
.activity-line {
  font-size: 12px; color: var(--slate-500); padding: 4px 0;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.activity-line .who { color: var(--modena); font-weight: 500; }

/* File list */
.file-list { list-style: none; padding: 0; margin: 0; }
.file-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; font-size: 13px;
}
.file-list li + li { border-top: 1px solid var(--slate-100); }
.file-list a { flex: 1; color: var(--modena); text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
.file-list a:hover { text-decoration: underline; }

/* Comments */
.comment {
  background: white; border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 14px 16px;
}
.comment + .comment { margin-top: 10px; }
.comment-internal {
  background: var(--warning-dim) !important;
  border-color: rgba(251,191,36,0.32) !important;
}
.comment .meta {
  display: flex; align-items: center; gap: 8px; font-size: 12px;
  color: var(--text-tertiary); margin-bottom: 8px;
}
.comment .meta .who { color: var(--modena); font-weight: 500; }
.comment .meta .actions { margin-left: auto; display: flex; gap: 8px; }
.comment .meta .actions button { background: none; border: none; color: inherit; font-size: 12px; cursor: pointer; }
.comment .meta .actions button.danger { color: #B91C1C; }
.comment .meta .actions button:hover { text-decoration: underline; }

/* Rich content */
.prose-modena h1 { font-size: 1.5rem; font-weight: 700; margin: 0.5rem 0; }
.prose-modena h2 { font-size: 1.25rem; font-weight: 700; margin: 0.5rem 0; }
.prose-modena h3 { font-size: 1.1rem; font-weight: 600; margin: 0.5rem 0; }
.prose-modena p  { margin: 0.5rem 0; line-height: 1.6; }
.prose-modena ul, .prose-modena ol { margin: 0.5rem 0; padding-left: 1.5rem; }
.prose-modena li { margin: 0.25rem 0; }
.prose-modena code {
  background: var(--slate-100); padding: 1px 4px; border-radius: 3px; font-size: 13px;
}
.prose-modena pre {
  background: var(--modena); color: var(--modena-mint);
  padding: 8px 12px; border-radius: 6px; overflow-x: auto;
}
.prose-modena pre code { background: none; color: inherit; padding: 0; }
.prose-modena a { color: var(--modena); text-decoration: underline; }
.prose-modena blockquote {
  border-left: 3px solid var(--modena-mint); padding-left: 12px;
  color: var(--slate-600); margin: 8px 0;
}
.prose-modena img { max-width: 100%; border-radius: 6px; margin: 8px 0; display: block; }

/* Quill overrides for Modena */
.ql-editor { font-family: inherit; min-height: 120px; }
.ql-toolbar.ql-snow {
  border-color: var(--border); border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: var(--surface);
  display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
}
.ql-container.ql-snow {
  border-color: var(--border); border-radius: 0 0 var(--radius-md) var(--radius-md);
}
/* Reset our global select width inside Quill toolbar so pickers stay inline */
.ql-toolbar.ql-snow select,
.ql-toolbar.ql-snow .ql-picker {
  width: auto; padding: 0; border: none; background: transparent; box-shadow: none;
}
.ql-toolbar.ql-snow button { padding: 0; }

/* Tables / lists */
.list { background: white; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.list-row + .list-row { border-top: 1px solid var(--border-soft); }
.list-row .name { font-weight: 500; color: var(--text-primary); }
.list-row .email { color: var(--text-tertiary); font-size: 12px; }

/* Stats */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.stat {
  background: white; border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px;
}
.stat .label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-tertiary); font-weight: 600; }
.stat .value { font-size: 26px; font-weight: 700; color: var(--text-primary); margin-top: 6px; letter-spacing: -0.01em; }
.stat .hint { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; }

/* Star rating */
/* Admin landing cards */
.admin-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.admin-card {
  display: block; text-decoration: none; color: inherit;
  background: white; border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 22px;
  transition: box-shadow var(--dur-moderate) var(--spring-moderate),
              border-color var(--dur-moderate) var(--spring-moderate),
              transform var(--dur-moderate) var(--spring-moderate);
}
.admin-card:hover {
  border-color: var(--text-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.admin-card-icon { font-size: 28px; line-height: 1; margin-bottom: 10px; opacity: 0.92; }
.admin-card h2 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.admin-card p { margin: 0; color: var(--text-tertiary); font-size: 13px; line-height: 1.5; }

/* Login: SSO button */
.login-sso-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0 16px; color: var(--slate-400); font-size: 12px;
}
.login-sso-divider::before, .login-sso-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--slate-200);
}
.login-sso-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 11px 0;
  border: 1px solid var(--slate-300); border-radius: 999px;
  background: white; color: var(--modena);
  font-weight: 500; font-size: 14px; text-decoration: none;
}
.login-sso-btn:hover { border-color: var(--modena); background: var(--slate-50); }

/* Primary (only) login: Microsoft button, more prominent */
.login-sso-btn-primary {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; padding: 14px 0;
  background: var(--modena); color: var(--modena-accent);
  border: 1px solid var(--modena); border-radius: 999px;
  font-weight: 600; font-size: 15px; text-decoration: none;
}
.login-sso-btn-primary:hover { background: var(--modena); filter: brightness(0.92); }
.login-sso-btn svg, .login-sso-btn-primary svg { flex: none; display: block; }

/* Tabbar (HTML/Preview switcher in notification editor etc.) */
.tabbar {
  display: inline-flex; border: 1px solid var(--slate-300); border-radius: 6px; overflow: hidden;
  font-size: 12px;
}
.tabbar-btn {
  background: white; border: 0; padding: 4px 12px;
  color: var(--slate-500); cursor: pointer;
}
.tabbar-btn:hover { background: var(--slate-50); }
.tabbar-btn.active { background: var(--modena); color: var(--modena-accent); }

/* Notifications: audience grouping (admin notifications page) */
.notif-group { margin-bottom: 22px; }
.notif-group-head {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 8px; padding: 0 4px;
}
.notif-group-head h3 {
  margin: 0; font-size: 13px; font-weight: 600;
  color: var(--modena); letter-spacing: 0.02em;
}
.notif-group-head .hint {
  font-size: 12px; color: var(--slate-500); font-weight: 400;
}
.notif-aud-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; white-space: nowrap;
}
.notif-aud-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  vertical-align: middle; margin-right: 2px;
}
.notif-aud-client { background: #DBEAFE; color: #1E40AF; }
.notif-aud-client.notif-aud-dot { background: #2563EB; }
.notif-aud-agent  { background: #DCFCE7; color: #14532D; }
.notif-aud-agent.notif-aud-dot  { background: #16A34A; }
.notif-aud-both   { background: #FEF3C7; color: #78350F; }
.notif-aud-both.notif-aud-dot   { background: #D97706; }

/* User row badges + delete */
.user-badge {
  display: inline-block; padding: 1px 7px; border-radius: 999px;
  background: #00A4EF22; color: #00558E;
  font-size: 10px; font-weight: 600; letter-spacing: 0.04em;
  margin-left: 4px;
}
.btn-user-delete {
  background: white; color: #B91C1C; border: 1px solid var(--slate-200);
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
  font-size: 18px; line-height: 1; display: inline-flex; align-items: center; justify-content: center;
}
.btn-user-delete:hover { background: #FEF2F2; border-color: #FECACA; }

/* Audit log */
.audit-action {
  display: inline-block; padding: 1px 8px; border-radius: 4px;
  background: var(--modena-mint); color: var(--modena);
  font-size: 12px; font-weight: 500; margin: 0 4px;
}

/* Role checkboxes (chip-style multi-select) */
.role-checkboxes {
  display: inline-flex; flex-wrap: wrap; gap: 6px;
}
.role-chk {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--slate-300); background: white;
  font-size: 12px; font-weight: 500; color: var(--slate-600);
  cursor: pointer; user-select: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.role-chk input { display: none; }
.role-chk:hover { border-color: var(--modena); }
.role-chk.on {
  background: var(--modena); color: var(--modena-accent); border-color: var(--modena);
}
.role-chk.disabled {
  opacity: 0.5; cursor: not-allowed;
}
.role-chk.disabled:hover { border-color: var(--slate-300); }

/* Time-log quick buttons */
.time-quick { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.time-quick-btn {
  padding: 4px 10px !important; font-size: 12px !important; border-radius: 999px !important;
  background: var(--slate-100); border: 1px solid var(--slate-200);
  color: var(--modena);
}
.time-quick-btn:hover { background: var(--modena); color: var(--modena-accent); border-color: var(--modena); }

.stars { display: inline-flex; gap: 2px; }
.stars button { background: none; border: none; font-size: 24px; color: var(--slate-300); cursor: pointer; padding: 0; line-height: 1; }
.stars button.on { color: var(--modena-accent); filter: drop-shadow(0 1px 0 var(--modena)); }

/* Feedback callout */
.feedback {
  background: rgba(223,250,242,0.4); border: 1px solid var(--modena-mint);
  border-radius: 8px; padding: 16px;
}

/* Modal */
.modal-bg {
  position: fixed; inset: 0; background: rgba(6,36,41,0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 32px 16px; overflow-y: auto; z-index: 50;
}
.modal {
  background: white; border-radius: var(--radius-xl); max-width: 640px; width: 100%;
  box-shadow: var(--shadow-lg); margin: 16px auto;
  border: 1px solid var(--border-soft);
}
.modal-lg {
  max-width: 960px;
}
.modal .head { padding: 20px 24px; border-bottom: 1px solid var(--border-soft); display: flex; justify-content: space-between; align-items: center; }
.modal .body { padding: 22px 24px; }
.modal .actions { padding: 16px 24px; border-top: 1px solid var(--border-soft); display: flex; justify-content: flex-end; gap: 8px; }
.modal-lg .head { padding: 22px 28px; }
.modal-lg .body { padding: 26px 28px; }
.modal-lg .actions { padding: 18px 28px; }
.modal h2 { font-size: 18px; font-weight: 600; }
.modal-lg h2 { font-size: 20px; font-weight: 600; }
.field-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.row { display: flex; gap: 12px; }
.row > * { flex: 1; }
@media (max-width: 600px) { .row { flex-direction: column; } }

/* Toast */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 100;
  background: var(--text-primary); color: var(--modena-accent);
  padding: 12px 18px; border-radius: var(--radius-pill); box-shadow: var(--shadow-lg);
  font-size: 13px; font-weight: 500;
}
.toast.error { background: #DC2626; color: white; }

/* Dashboard layout — 2 columns on desktop, 1 on mobile */
.dash-row {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 16px; margin-top: 24px;
}
@media (max-width: 720px) {
  .dash-row { grid-template-columns: 1fr !important; gap: 12px; }
}

/* PWA: bottom nav (mobile only) */
.bottom-nav { display: none; }
@media (max-width: 720px) {
  .bottom-nav {
    display: flex; align-items: stretch;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: white; border-top: 1px solid var(--slate-200);
    padding: 4px 0 max(4px, env(safe-area-inset-bottom));
    box-shadow: 0 -2px 12px rgba(1,43,50,0.06);
  }
  .bottom-nav a, .bottom-nav button {
    flex: 1; background: none; border: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; padding: 6px 0;
    font-size: 11px; color: var(--slate-500); text-decoration: none;
    cursor: pointer;
  }
  .bottom-nav a.active { color: var(--modena); font-weight: 600; }
  .bottom-nav .icon { font-size: 20px; line-height: 1; }
  .bottom-nav .new-btn .icon {
    background: var(--modena); color: var(--modena-accent); width: 36px; height: 36px;
    border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 22px; line-height: 1; margin-bottom: -4px;
  }
  body { padding-bottom: 70px; }
  .app-header .nav { display: none; }
  .app-header .btn-new { display: none; }
  .search-wrap { min-width: 0; }
  .modal-bg { padding: 0; }
  .modal { border-radius: 0; max-width: 100%; min-height: 100vh; margin: 0; }
  .modal .head, .modal .body, .modal .actions { padding-left: 16px; padding-right: 16px; }
  .btn, .btn-toggle, .role-chk { min-height: 36px; }
  .container { padding: 16px 12px; }
  .board { gap: 8px; }
  .column { min-width: 240px; }
  .task-grid { grid-template-columns: 1fr !important; }
  .filter-panel { grid-template-columns: 1fr 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}

/* PWA: install banner + offline indicator */
.install-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 200;
  max-width: 520px; margin: 0 auto;
  background: white; border: 1px solid var(--slate-200); border-radius: 12px;
  box-shadow: 0 8px 24px rgba(1,43,50,0.18);
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  font-size: 13px;
}
.install-icon { font-size: 22px; }
.install-text { flex: 1; color: var(--modena); line-height: 1.4; }
.install-close {
  background: none; border: 0; color: var(--slate-500); font-size: 20px;
  cursor: pointer; padding: 0; width: 24px; height: 24px;
}
.install-close:hover { color: var(--modena); }

.offline-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 250;
  background: #B91C1C; color: white;
  padding: 8px 16px; text-align: center;
  font-size: 13px; font-weight: 500;
}
.offline-bar + .app-header { top: 36px !important; }

/* Language switcher (used in header dropdown + login page) */
.lang-switch {
  display: inline-flex; align-items: center; gap: 0;
  border: 1px solid var(--slate-200); border-radius: 8px; overflow: hidden;
  background: #fff;
}
.lang-switch a {
  padding: 5px 10px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  color: var(--slate-500); text-decoration: none; line-height: 1;
  transition: background 0.12s, color 0.12s;
}
.lang-switch a:hover { background: var(--slate-100); color: var(--modena); }
.lang-switch a.active { background: var(--modena); color: #fff; }
.lang-switch-mini a { padding: 3px 8px; font-size: 11px; }

/* Dropdown row that pairs the "Language" label with the ET/EN toggle */
.dropdown-lang {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 6px 12px;
}
.dropdown-lang-label {
  font-size: 13px; color: var(--text-primary);
}

/* Utility */
.hidden { display: none !important; }
.text-right { text-align: right; }
.gap-8 { gap: 8px; }

/* ===== Task detail v2: email-style conversation + sticky reply dock ===== */
.conversation { display: flex; flex-direction: column; gap: 12px; }

/* Outbound agent reply rendered as a sent email */
.email-msg {
  background: linear-gradient(180deg, #F0FDF4 0%, #FFFFFF 36px);
  border: 1px solid #BBF7D0;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(1,43,50,0.04);
}
.email-msg-head {
  display: flex; gap: 12px; padding: 12px 14px 10px;
  border-bottom: 1px solid rgba(16,185,129,0.18);
}
.email-msg-icon { font-size: 20px; line-height: 1; padding-top: 2px; }
.email-msg-meta { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.email-msg-line {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 12px; color: var(--slate-700);
}
.email-msg-line .email-label {
  color: var(--slate-500); min-width: 52px;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600;
}
.email-msg-line strong { color: var(--modena); font-weight: 600; }
.email-msg-head .actions { margin-left: auto; display: flex; gap: 8px; align-self: flex-start; }
.email-msg-head .actions button {
  background: none; border: none; color: var(--slate-500);
  font-size: 12px; cursor: pointer; padding: 2px 4px;
}
.email-msg-head .actions button:hover { text-decoration: underline; color: var(--modena); }
.email-msg-head .actions button.danger { color: #B91C1C; }
.email-msg-body { padding: 14px 16px 16px; background: #fff; }

/* Sticky reply dock — pinned to viewport bottom, height user-resizable via top handle */
:root { --reply-dock-h: 440px; }
/* Global `html, body { height: 100% }` would prevent body padding from creating scroll
   space, so we use a real spacer div before the fixed dock — it sits in normal flow and
   reserves matching height in the document, so all sidebar content stays scrollable. */
.reply-dock-spacer {
  height: calc(var(--reply-dock-h) + 24px);
  width: 100%;
  flex: 0 0 auto;
  pointer-events: none;
}
.reply-dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  height: var(--reply-dock-h);
  background: rgba(255,255,255,0.98);
  border-top: 2px solid var(--modena-mint);
  box-shadow: 0 -10px 30px rgba(1,43,50,0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex; flex-direction: column;
}
.reply-dock.collapsed { height: auto !important; }

/* Drag handle that sits flush with the top edge */
.reply-dock-resize {
  position: absolute; left: 0; right: 0; top: -6px;
  height: 12px; cursor: ns-resize;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
  touch-action: none; user-select: none;
}
.reply-dock-resize-grip {
  width: 56px; height: 4px; border-radius: 999px;
  background: var(--modena-mint);
  opacity: 0.7;
  transition: opacity 0.15s, transform 0.15s, background 0.15s;
}
.reply-dock-resize:hover .reply-dock-resize-grip,
.reply-dock-resize:focus-visible .reply-dock-resize-grip {
  opacity: 1; transform: scaleX(1.25); background: var(--modena);
}
.reply-dock-resize:focus-visible { outline: none; }
.reply-dock-resize.dragging .reply-dock-resize-grip {
  opacity: 1; background: var(--modena); transform: scaleX(1.4);
}
body.reply-dock-resizing { cursor: ns-resize !important; user-select: none; }
body.reply-dock-resizing * { pointer-events: none; }
body.reply-dock-resizing .reply-dock-resize { pointer-events: auto; }
.reply-dock.collapsed .reply-dock-resize { display: none; }

.reply-dock-inner {
  max-width: 1400px; margin: 0 auto; width: 100%;
  padding: 12px 22px 16px;
  display: flex; flex-direction: column;
  flex: 1 1 0; min-height: 0;
  box-sizing: border-box;
}
.reply-dock-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding-bottom: 10px;
}
.reply-dock-title {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 700; color: var(--modena);
  letter-spacing: 0.01em;
}
.reply-dock-target {
  display: inline-flex; align-items: center; gap: 8px; flex: 1;
  font-size: 12px; flex-wrap: wrap; min-width: 0;
}
.reply-dock-mode {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.reply-dock-mode-email { background: #DBEAFE; color: #1E40AF; }
.reply-dock-mode-internal { background: #F1F5F9; color: var(--slate-700); }

.reply-dock-collapse {
  background: white; border: 1px solid var(--slate-200); border-radius: 8px;
  width: 32px; height: 32px; cursor: pointer; color: var(--slate-500);
  font-size: 14px; line-height: 1;
}
.reply-dock-collapse:hover { background: var(--slate-50); color: var(--modena); border-color: var(--modena); }

.reply-dock.collapsed .reply-dock-body { display: none; }
.reply-dock.collapsed .reply-dock-inner { padding-bottom: 12px; }

/* Dock body is a 2-col grid: AI assistant left, reply form right; fills remaining dock height */
.reply-dock-body {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 16px;
  align-items: stretch;
  flex: 1 1 0; min-height: 0;
}

/* ----- AI panel (left side of dock) ----- */
.reply-dock-ai {
  display: flex; flex-direction: column; gap: 8px;
  background: linear-gradient(180deg, #F8FAFC 0%, #FFFFFF 100%);
  border: 1px solid var(--slate-200); border-radius: var(--radius-md);
  padding: 10px 12px;
  min-height: 0; min-width: 0;
  height: 100%; box-sizing: border-box;
}
.reply-dock-ai-head {
  display: flex; align-items: flex-start; gap: 8px;
  padding-bottom: 8px; border-bottom: 1px solid var(--slate-100);
}
.reply-dock-ai-title {
  flex: 1; min-width: 0;
  font-size: 13px; font-weight: 600; color: var(--modena);
  line-height: 1.3;
}
.reply-dock-ai-sub {
  font-size: 11px; font-weight: 400; color: var(--slate-500);
  margin-top: 1px;
}
.reply-dock-ai-clear {
  background: var(--slate-50); border: 1px solid var(--slate-200);
  color: var(--slate-600); font-size: 11px; padding: 3px 9px;
  border-radius: 6px; cursor: pointer; white-space: nowrap;
}
.reply-dock-ai-clear:hover { background: var(--slate-100); color: var(--modena); }

.reply-dock-ai-quick { display: flex; gap: 6px; flex-wrap: wrap; }
.reply-dock-ai-quick .ai-quick { font-size: 12px; padding: 5px 10px; font-weight: 500; }

.reply-dock-ai-msgs {
  flex: 1 1 0; min-height: 100px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px;
  padding: 8px; background: #FAFAFA; border-radius: 8px;
  border: 1px solid var(--slate-100);
}

.reply-dock-ai-form { display: flex; gap: 6px; }
.reply-dock-ai-form textarea {
  flex: 1; padding: 7px 10px; border: 1px solid var(--slate-200);
  border-radius: 8px; resize: vertical; font: inherit;
  font-size: 12px; min-height: 36px; max-height: 120px;
}
.reply-dock-ai-form button { padding: 0 14px; font-size: 13px; }

/* ----- Reply form (right side of dock) ----- */
.reply-dock-reply {
  display: flex; flex-direction: column; gap: 10px;
  min-height: 0; min-width: 0;
  height: 100%; box-sizing: border-box;
}
.reply-dock-reply #new-comment-editor {
  flex: 1 1 0; min-height: 0;
  display: flex; flex-direction: column;
}
.reply-dock-reply .ql-toolbar.ql-snow {
  background: var(--surface); border-radius: var(--radius-md) var(--radius-md) 0 0;
  flex: 0 0 auto;
}
.reply-dock-reply .ql-container.ql-snow {
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  flex: 1 1 0; min-height: 70px; overflow-y: auto;
}
.reply-dock-reply .ql-editor { min-height: 70px; }

.reply-dock-actions {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap;
}
.reply-internal-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--slate-600); cursor: pointer;
  padding: 6px 12px; border-radius: 999px;
  background: var(--slate-50); border: 1px solid var(--slate-200);
  user-select: none;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.reply-internal-toggle input { margin: 0; }
.reply-internal-toggle:hover { background: var(--slate-100); }
.reply-internal-toggle:has(input:checked) {
  background: #FEF3C7; border-color: #FCD34D; color: #92400E; font-weight: 600;
}

.reply-dock-actions-right {
  margin-left: auto; display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap;
}

/* Split-button: main action + chevron with status dropdown */
.split-btn { position: relative; display: inline-flex; }
.split-btn .btn { font-weight: 600; }
.split-btn-main {
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
  padding-left: 20px !important; padding-right: 20px !important;
}
.split-btn-chevron {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
  border-left: 1px solid rgba(255,255,255,0.28) !important;
  padding: 0 14px !important;
  font-size: 13px;
}
.split-btn-chevron[aria-expanded="true"] { filter: brightness(0.92); }

.split-btn-menu {
  position: absolute; right: 0; bottom: calc(100% + 8px);
  min-width: 260px;
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(1,43,50,0.18);
  padding: 6px;
  z-index: 30;
}
.status-menu-header {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--slate-500); padding: 6px 10px 8px; font-weight: 600;
  border-bottom: 1px solid var(--slate-100); margin-bottom: 4px;
}
.split-btn-menu button {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: none; border: 0; padding: 9px 10px;
  border-radius: 6px; font-size: 13px; cursor: pointer;
  text-align: left; color: var(--slate-700);
}
.split-btn-menu button:hover { background: var(--slate-100); color: var(--modena); }
.split-btn-menu button.active { background: var(--modena-mint); color: var(--modena); font-weight: 600; }

/* Tablet/narrow desktop: stack the two columns; rows share dock height */
@media (max-width: 980px) {
  .reply-dock-body { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; gap: 12px; }
}

/* Mobile: lift dock above bottom-nav */
@media (max-width: 720px) {
  .reply-dock-spacer { height: calc(var(--reply-dock-h) + 88px); }
  .reply-dock { bottom: 64px; } /* sit above the bottom-nav */
  .reply-dock-inner { padding: 10px 14px 12px; }
  .reply-dock-actions { gap: 8px; }
  .reply-dock-actions-right { margin-left: 0; width: 100%; justify-content: flex-end; }
  .split-btn-menu { right: 0; left: auto; min-width: 220px; max-width: calc(100vw - 28px); }
}
