.brand-subtitle {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.header-actions,
.task-footer-actions,
.detail-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.detail-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.task-primary {
  color: #fff;
  background: var(--grad);
  box-shadow: 0 6px 16px rgba(202, 69, 255, 0.24);
}

.scope-switch {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7f6fc;
}

.scope-switch[hidden] {
  display: none;
}

.scope-switch button {
  padding: 6px 12px;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
}

.scope-switch button.active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 2px 8px rgba(63, 74, 126, 0.13);
}

.readonly-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 14px 0;
  padding: 11px 13px;
  border: 1px solid #e5ddfb;
  border-radius: 12px;
  color: #5d4788;
  background: #faf8ff;
}

.readonly-banner strong {
  display: block;
  margin-bottom: 2px;
}

.owner-chip {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  color: #5d4788;
  background: #f0ebff;
}

.task-suggestions {
  margin: 20px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfaff;
}

.suggestion-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.suggestion-header h3 {
  margin: 0;
}

.suggestion-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.suggestion-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.suggestion-count {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  border: 1px solid #e5ddfb;
  border-radius: 999px;
  color: #5d4788;
  background: #fff;
  font-size: 12px;
}

.suggestion-count strong {
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 999px;
  color: #fff;
  background: #7154a4;
  text-align: center;
}

.suggestion-count.unmapped,
.suggestion-meta .unmapped {
  color: #8a5b16;
}

.suggestion-count.unmapped strong {
  background: #a36b19;
}

.suggestion-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.suggestion-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px;
  border: 1px solid #e8e4f2;
  border-radius: 8px;
  background: #fff;
}

.suggestion-copy {
  min-width: 0;
}

.suggestion-copy h4 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
}

.suggestion-evidence {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  margin-top: 6px;
  font-size: 12px;
}

.suggestion-evidence .evidence-jump {
  padding: 2px 8px;
  border: 1px solid #d0bfff;
  border-radius: 999px;
  background: #f3f0ff;
  color: #5f3dc4;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.suggestion-evidence .evidence-jump:hover {
  background: #e5dbff;
}

.suggestion-evidence .evidence-snippet {
  color: #495057;
  font-style: italic;
}

.suggestion-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.suggestion-meta span + span::before {
  content: "Hạn: ";
  color: #786c8e;
}

.suggestion-open {
  flex: 0 0 auto;
  color: #5a3b91;
  border-color: #d8cbee;
  background: #f7f3ff;
  box-shadow: none;
}

.suggestion-open:hover {
  background: #efe7ff;
}

.suggestion-loading,
.suggestion-empty,
.suggestion-error {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.suggestion-error {
  color: #a63046;
}

.task-dialog {
  width: min(780px, calc(100vw - 28px));
  max-width: none;
  max-height: calc(100vh - 28px);
  margin: auto;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  color: var(--ink);
}

.task-dialog::backdrop {
  background: rgba(24, 16, 54, 0.48);
  backdrop-filter: blur(3px);
}

.task-card {
  display: flex;
  max-height: calc(100vh - 28px);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(229, 225, 241, 0.96);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 26px 80px rgba(27, 13, 78, 0.28);
  animation: hu-task-in 260ms cubic-bezier(0.2, 0.78, 0.28, 1) both;
}

.task-dialog.closing .task-card {
  animation: hu-task-out 200ms cubic-bezier(0.4, 0, 1, 1) both;
}

@keyframes hu-task-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes hu-task-out {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
}

.task-card-head,
.task-card-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  flex: 0 0 auto;
  background: #fff;
}

.task-card-head {
  border-bottom: 1px solid var(--line);
}

.task-card-head h2 {
  margin: 2px 0 4px;
  font-size: 18px;
}

.task-eyebrow {
  margin: 0;
  color: #9a50d5;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.task-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.icon-button {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  font-size: 22px;
  line-height: 1;
}

#task-fields {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 18px 20px;
  overflow: auto;
  border: 0;
}

#task-fields:disabled {
  opacity: 0.62;
}

.task-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px 14px;
}

.task-span-2 {
  grid-column: 1 / -1;
}

.task-field {
  min-width: 0;
}

.task-field label {
  display: block;
  margin: 0 0 6px;
  color: #453568;
  font-size: 12px;
  font-weight: 500;
}

.task-field label span {
  color: #bd3a67;
}

.task-field input,
.task-field textarea,
.task-field select,
.select-button {
  width: 100%;
  margin: 0;
  padding: 9px 11px;
  border: 1px solid #e5e1ef;
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

.task-field textarea {
  min-height: 104px;
  line-height: 1.5;
}

.task-field select {
  min-height: 44px;
  appearance: none;
  padding-right: 42px;
}

.task-field input:focus,
.task-field textarea:focus,
.task-field select:focus,
.select-button:focus-visible {
  outline: none;
  border-color: #bd57e9;
  box-shadow: 0 0 0 3px rgba(189, 87, 233, 0.13);
}

.field-hint,
.field-error {
  display: block;
  min-height: 15px;
  margin-top: 4px;
  font-size: 11px;
}

.field-hint {
  color: var(--muted);
}

.field-error {
  color: #b32652;
}

.task-field.has-error input,
.task-field.has-error textarea,
.task-field.has-error select,
.task-field.has-error .select-button {
  border-color: #d9597d;
}

.assignee-field {
  position: relative;
}

.assignee-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.assignee-selected:empty {
  display: none;
}

.assignee-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px 3px 4px;
  border: 1px solid #e3dcf5;
  border-radius: 999px;
  color: #4f3c78;
  background: #faf8ff;
  font-size: 11px;
}

.assignee-pill button {
  padding: 0 2px;
  color: #7b6c9c;
  background: transparent;
  box-shadow: none;
}

.avatar-initials {
  display: inline-grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #5eb6ff, #bd57e9);
  font-size: 9px;
  font-weight: 600;
}

.select-button {
  position: relative;
  text-align: left;
  box-shadow: none;
}

.select-button::after {
  content: "⌄";
  position: absolute;
  right: 11px;
  color: var(--muted);
}

.assignee-menu {
  position: absolute;
  z-index: 4;
  top: calc(100% - 13px);
  right: 0;
  left: 0;
  padding: 8px;
  border: 1px solid #e5e1ef;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 16px 38px rgba(35, 18, 91, 0.18);
}

.assignee-menu[hidden] {
  display: none;
}

.assignee-menu input {
  margin-bottom: 7px;
}

.assignee-options {
  max-height: 190px;
  overflow: auto;
}

.assignee-option {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border-radius: 7px;
  text-align: left;
  background: transparent;
  box-shadow: none;
}

.assignee-option:hover,
.assignee-option[aria-selected="true"] {
  transform: none;
  background: #f7f3ff;
  box-shadow: none;
}

.assignee-option-copy {
  min-width: 0;
}

.assignee-option-copy strong,
.assignee-option-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assignee-option-copy small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
}

.task-context-state,
.task-general-error {
  margin: 0 20px;
  font-size: 12px;
}

.task-context-state:not(:empty),
.task-general-error:not([hidden]) {
  margin-top: 12px;
  padding: 9px 11px;
  border-radius: 8px;
}

.task-context-state:not(:empty) {
  color: #5d4788;
  background: #faf8ff;
}

.task-general-error:not([hidden]) {
  color: #93264a;
  background: #fff1f5;
}

.task-card-footer {
  align-items: center;
  border-top: 1px solid var(--line);
}

.task-default-note {
  color: var(--muted);
  font-size: 11px;
}

.task-toast {
  position: fixed;
  z-index: 20;
  right: 22px;
  bottom: 22px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 12px;
  color: #fff;
  background: #26164c;
  box-shadow: 0 16px 38px rgba(28, 15, 67, 0.28);
}

.task-toast[hidden] {
  display: none;
}

@media (max-width: 760px) {
  .header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .pill-badge {
    display: none;
  }

  .task-grid {
    grid-template-columns: 1fr;
  }

  .task-span-2 {
    grid-column: auto;
  }

  .task-card-head,
  .task-card-footer,
  #task-fields {
    padding-right: 14px;
    padding-left: 14px;
  }

  .task-card-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .task-footer-actions {
    justify-content: flex-end;
  }

  .suggestion-card {
    align-items: stretch;
    flex-direction: column;
  }

  .suggestion-open {
    width: 100%;
  }

  #detail > .row {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .detail-actions {
    width: 100%;
  }

  .detail-actions .task-primary {
    flex: 1 1 auto;
    white-space: nowrap;
  }
}

@media (max-width: 430px) {
  header {
    align-items: flex-start;
  }

  .brand-subtitle {
    display: none;
  }

  .task-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }

  .task-card {
    max-height: calc(100vh - 16px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .task-card,
  .task-dialog.closing .task-card {
    animation: none;
  }
}
.policy-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 10px 0;
  color: var(--ink);
}

.policy-check input {
  width: auto;
  margin: 2px 0 0;
}

#capture-policy-card select {
  width: 100%;
  margin: 6px 0 10px;
}
.meeting-search {
  margin: 18px 0 8px;
}

.meeting-search label {
  display: block;
  margin: 0 0 6px 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.meeting-search select {
  width: 100%;
}

select {
  width: 100%;
  min-height: 44px;
  appearance: none;
  border: 1px solid #e5e7eb;
  border-radius: 11px;
  padding: 10px 42px 10px 13px;
  color: var(--ink);
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 18px;
  font: inherit;
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

select:hover {
  border-color: #d1d5db;
  background-color: #fafbfc;
}

select:focus {
  outline: none;
  border-color: #d9ab00;
  box-shadow: 0 0 0 3px rgba(255, 201, 10, 0.2);
}

.search-snippet {
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.stale-warning {
  padding: 9px 12px;
  border-left: 3px solid #c77800;
  background: #fff8e7;
  color: #755000;
}

/* Lỗi tạm khi làm mới chi tiết (Kolia chập chờn, mất mạng): biên bản đang xem
   giữ nguyên, chỉ thêm dòng này ở đầu khung. */
.detail-loi-tam {
  margin: 0 0 12px;
}

/* Toàn văn sửa được: đọc là chính, ô nhập chỉ hiện ở đoạn đang sửa. */
/* Đoạn gốc của một việc: tô sáng vài giây khi bấm từ thẻ việc / link #block= */
.utt.utt-hit {
  background: #fff3bf;
  outline: 2px solid #f59f00;
  outline-offset: 2px;
  border-radius: 6px;
  transition: background 0.6s ease, outline-color 0.6s ease;
}

.transcript-blocks .utt {
  position: relative;
  margin: 0 0 4px;
  padding: 3px 9px;
  border-radius: 9px;
}

/* Chừa chỗ cho nút Sửa, chỉ khi thật sự có nút. */
.transcript-editable .utt {
  padding-right: 58px;
}

/* Nhãn người nói đứng riêng một dòng. Các đoạn sau trong cùng một lượt không
   có nhãn — để nhãn nằm cùng dòng thì mỗi dòng lại thụt vào một kiểu khác nhau. */
.transcript-blocks .who {
  display: block;
  width: fit-content;
  margin: 0 0 3px;
}

/* Người nói đổi lượt thì tách ra cho dễ nhìn. */
.transcript-blocks .utt-turn {
  margin-top: 12px;
}

.transcript-blocks .utt:first-child {
  margin-top: 0;
}

.transcript-editable .utt:hover {
  background: #f4f3fb;
}

.utt-blank {
  color: var(--muted);
  font-style: italic;
}

/* Nút sửa: luôn có mặt (điện thoại không có hover) nhưng mờ, chỉ rõ lên khi
   trỏ vào hoặc focus bàn phím. */
.utt-edit {
  position: absolute;
  top: 3px;
  right: 5px;
  padding: 2px 11px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  opacity: 0.4;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.utt:hover .utt-edit,
.utt-edit:focus-visible {
  opacity: 1;
  background: var(--chip);
  color: var(--ink);
}

.utt-edit:hover {
  transform: none;
  box-shadow: none;
}

/* Đoạn đang sửa — thay đúng chỗ đoạn văn vừa đứng. */
.utt-editor {
  margin: 12px 0;
  padding: 12px 13px;
  border: 1px solid var(--gold-dark);
  border-radius: 13px;
  background: #fffdf4;
  box-shadow: 0 0 0 3px rgba(255, 201, 10, 0.15);
}

.utt-editor-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.utt-editor-head input {
  max-width: 260px;
  margin-bottom: 9px;
}

.utt-editor textarea {
  margin-bottom: 9px;
}

/* Đang ghi: ô nội dung chỉ đọc (chỉ đổi được tên người nói) — trông khác ô sửa
   được để không ai gõ vào rồi mới thấy không ăn. */
.utt-editor textarea[readonly] {
  background: var(--chip);
  color: var(--muted);
}

.utt-editor-note {
  margin: -3px 0 9px;
  font-size: 12px;
  color: #755000;
}

.utt-editor-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.utt-save {
  background: var(--grad);
  box-shadow: 0 5px 14px rgba(217, 171, 0, 0.2);
}

.utt-cancel,
.utt-rename {
  padding: 7px 14px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}

.utt-cancel:hover,
.utt-rename:hover {
  background: var(--chip);
  color: var(--ink);
}

.audit-history {
  margin-top: 14px;
  color: var(--muted);
}

.audit-history p {
  margin: 6px 0;
  font-size: 12px;
}

.ai-chat-panel {
  margin: 22px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fdfcff;
}

.ai-chat-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ai-chat-heading h3,
.ai-chat-heading p {
  margin-top: 0;
}

.ai-thread-create,
.ai-chat-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.ai-meeting-picker {
  display: grid;
  gap: 7px;
  max-height: 210px;
  overflow: auto;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.ai-meeting-picker label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.ai-meeting-picker input {
  width: auto;
  margin: 2px 0 0;
}

.ai-messages {
  display: grid;
  gap: 10px;
  max-height: 520px;
  overflow: auto;
  margin: 12px 0;
}

.ai-message {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f0ecfb;
}

.ai-message.user {
  justify-self: end;
  background: #e9f3ff;
}

.ai-message .md p:last-child {
  margin-bottom: 0;
}

.ai-messages {
  /* Cột `auto` giãn theo max-content: một dòng mã dài trong câu trả lời kéo
     cả cột rộng ra ngoài màn hình, `max-width: 88%` tính theo cột đó nên
     không cứu được. minmax(0, 1fr) khoá cột lại đúng bề ngang khung. */
  grid-template-columns: minmax(0, 1fr);
  scroll-behavior: smooth;
}

.ai-message {
  position: relative;
  min-width: 0;
}

.ai-message .md,
.ai-message .ai-plain {
  min-width: 0;
}

/* Chữ dài không có khoảng trắng (URL, mã lỗi) phải xuống dòng chứ không đẩy
   bong bóng ra ngoài. */
.ai-plain,
.ai-message .md p,
.ai-message .md li {
  overflow-wrap: anywhere;
}

.ai-message.assistant {
  padding-right: 56px;
}

.ai-role {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* Câu người dùng gõ là chữ thô — giữ đúng chỗ họ xuống dòng. */
.ai-plain {
  line-height: 1.55;
  white-space: pre-wrap;
}

/* Trong bong bóng chat thì Markdown không cần khung riêng nữa. */
.ai-message .md {
  padding: 0;
  border: 0;
  background: transparent;
}

.ai-message .md h4:first-child,
.ai-message .md p:first-child {
  margin-top: 0;
}

.ai-copy {
  position: absolute;
  top: 7px;
  right: 8px;
  padding: 2px 10px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  opacity: 0.4;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.ai-message:hover .ai-copy,
.ai-copy:focus-visible {
  opacity: 1;
  background: #fff;
  color: var(--ink);
}

.ai-copy:hover {
  transform: none;
  box-shadow: none;
}

.ai-typing-dots {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.ai-typing-dots::after {
  content: "";
  animation: ai-cham 1.2s steps(4, end) infinite;
}

@keyframes ai-cham {
  0% {
    content: "";
  }
  25% {
    content: ".";
  }
  50% {
    content: "..";
  }
  75% {
    content: "...";
  }
}

/* Ô nhập câu hỏi: một dòng lúc trống, nút Gửi nằm ngay cạnh. */
.ai-chat-form {
  gap: 6px;
}

.ai-chat-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.ai-chat-row textarea {
  flex: 1;
  min-height: 44px;
  max-height: 190px;
  margin-bottom: 0;
  overflow-y: auto;
  /* Đã tự cao theo nội dung; kéo tay chỉ làm lệch với nút Gửi. */
  resize: none;
}

.ai-send {
  flex: none;
  background: var(--grad);
  box-shadow: 0 5px 14px rgba(217, 171, 0, 0.2);
}

.ai-send:disabled {
  box-shadow: none;
  opacity: 0.55;
  cursor: default;
}

.ai-send:disabled:hover {
  transform: none;
}

.ai-chat-hint {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
}

.ai-suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ai-suggest .empty {
  flex: 0 0 100%;
  margin: 0 0 2px;
}

.ai-suggest-chip {
  padding: 6px 13px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 13px;
}

.ai-suggest-chip:hover {
  border-color: var(--gold-dark);
  background: var(--gold-soft);
}

/* Markdown đầy đủ — dùng chung cho biên bản và câu trả lời AI. */
.md ol {
  margin: 4px 0;
  padding-left: 22px;
}

.md ol li {
  margin-bottom: 3px;
}

.md code {
  padding: 1px 5px;
  border-radius: 6px;
  background: #efeaf9;
  color: #5b3fa0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

.md pre {
  margin: 8px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f6f6fa;
  /* Dòng mã dài phải cuộn TRONG khối, không được đẩy ngang cả trang. */
  overflow-x: auto;
}

.md pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.md blockquote {
  margin: 8px 0;
  padding: 2px 0 2px 12px;
  border-left: 3px solid var(--gold);
  color: var(--muted);
}

.md hr {
  margin: 12px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.md a {
  color: #6b4fae;
}

#admin-settings {
  margin-top: 18px;
}

#admin-settings .card {
  margin-bottom: 10px;
}

.meeting-organization {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.meeting-organization > h3 {
  margin-bottom: 0;
}

.organization-box {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #faf9fe;
}

.label-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.label-choices label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.label-choices input {
  width: auto;
  margin: 0;
}

.label-swatch {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.organization-actions,
.workflow-suggestion {
  display: flex;
  align-items: center;
  gap: 8px;
}

.organization-actions input,
.workflow-suggestion span {
  flex: 1 1 auto;
}

.workflow-result {
  display: grid;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.meeting-share-panel {
  display: grid;
  gap: 10px;
  margin: 4px 0 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbff;
}

.meeting-share-panel[hidden] {
  display: none;
}

.share-create,
.share-output,
.share-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.share-create input {
  max-width: 120px;
}

.share-output input,
.share-row span {
  flex: 1 1 auto;
}

.share-row {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

#retention-policy-card input {
  margin: 5px 0 10px;
}

/* Kolia workspace navigation */
[hidden] {
  display: none !important;
}

.app-navigation {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  gap: 5px;
  width: min(1224px, calc(100% - 56px));
  margin: 14px auto 0;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 28px rgba(24, 24, 27, 0.05);
  backdrop-filter: blur(12px);
}

.app-navigation button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
  font-weight: 700;
}

.app-navigation button:hover {
  color: var(--ink);
  background: var(--chip);
  box-shadow: none;
  transform: none;
}

.app-navigation button.active {
  color: var(--ink);
  background: var(--gold);
  box-shadow: 0 5px 14px rgba(217, 171, 0, 0.15);
}

.nav-icon {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  font-size: 15px;
}

body[data-app-view="planned"] main,
body[data-app-view="admin"] main {
  display: block;
}

body[data-app-view="planned"] #left,
body[data-app-view="admin"] #left {
  width: min(960px, 100%);
  margin: 0 auto;
}

.workspace-page {
  width: 100%;
}

.page-heading {
  margin: 2px 2px 20px;
}

.page-heading h2,
.page-heading p {
  margin: 0;
}

.page-heading h2 {
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -0.025em;
}

.page-heading > p:last-child {
  margin-top: 5px;
  color: var(--muted);
}

.page-eyebrow {
  margin-bottom: 5px !important;
  color: #8a6800;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.admin-grid .card {
  margin: 0;
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(24, 24, 27, 0.045);
}

#capture-policy-card {
  grid-column: 1 / -1;
}

.meeting-library .meeting-search {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  box-shadow: var(--shadow);
}

.meeting-library .meeting-search input,
.meeting-library .meeting-search select {
  margin: 0;
}

.detail-nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  margin: 20px -26px 0;
  padding: 0 26px;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}

.detail-nav::-webkit-scrollbar {
  display: none;
}

.detail-nav button {
  position: relative;
  flex: 0 0 auto;
  min-height: 44px;
  border-radius: 9px 9px 0 0;
  padding: 10px 14px 11px;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
  font-weight: 700;
}

.detail-nav button:hover {
  color: var(--ink);
  background: #fafbfc;
  box-shadow: none;
  transform: none;
}

.detail-nav button.active {
  color: var(--ink);
  background: var(--gold-soft);
}

.detail-nav button.active::after {
  position: absolute;
  right: 12px;
  bottom: -1px;
  left: 12px;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: var(--gold-dark);
  content: "";
}

.detail-tab-panel {
  min-height: 250px;
  padding-top: 18px;
}

.detail-tab-panel > h3:first-child,
.meeting-organization > h3:first-child,
.ai-chat-panel > h3:first-child {
  margin-top: 0;
}

.detail-empty {
  display: grid;
  min-height: 220px;
  margin: 0;
  place-items: center;
  text-align: center;
}

.task-primary {
  color: var(--ink);
  background: var(--gold);
  box-shadow: 0 6px 16px rgba(217, 171, 0, 0.16);
}

.scope-switch {
  background: #f4f6f9;
}

.readonly-banner,
.task-suggestions,
.organization-box {
  border-color: var(--line);
  color: var(--ink);
  background: #fafbfc;
}

.owner-chip,
.suggestion-count {
  border-color: rgba(217, 171, 0, 0.22);
  color: #805f00;
  background: var(--gold-soft);
}

.task-field label {
  color: var(--ink);
}

.task-field input:focus,
.task-field textarea:focus,
.task-field select:focus,
.select-button:focus-visible {
  border-color: var(--gold-dark);
  box-shadow: 0 0 0 3px rgba(255, 201, 10, 0.18);
}

@media (max-width: 860px) {
  .app-navigation {
    width: calc(100% - 32px);
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  #capture-policy-card {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  body > header {
    flex-wrap: wrap;
  }

  .header-actions {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  #detail > .row {
    align-items: flex-start;
    flex-direction: column;
  }

  /* Bấm một biên bản là cuộn tới khung chi tiết (B36): chừa chỗ cho thanh
     Biên bản / Lịch họp dính ở đầu trang, không thì nó che mất tiêu đề. */
  #detail {
    scroll-margin-top: 72px;
  }

  #detail .detail-actions {
    justify-content: flex-start;
  }

  .app-navigation {
    top: 0;
    width: calc(100% - 24px);
    margin-top: 10px;
    overflow-x: auto;
  }

  .app-navigation button {
    flex: 1 0 auto;
    justify-content: center;
    padding-inline: 12px;
  }

  .detail-nav {
    margin-inline: -16px;
    padding-inline: 16px;
  }
}

/* Ai có mặt trong cuộc họp — bóc từ bản gỡ băng (transcript.js/nguoiThamDu).
   Công ty dùng một link Meet cố định nên mã phòng lặp lại ở mọi dòng; tên do
   AI đặt cộng với danh sách người là hai thứ giúp nhận ra cuộc nào là cuộc
   nào. */
.nguoi-tham-du {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.nguoi-tham-du span {
  font-size: 12px;
  padding: 1px 8px;
  border-radius: 999px;
  color: var(--muted, #5f6368);
  background: rgba(0, 0, 0, 0.05);
  white-space: nowrap;
}

/* Đang ghi bằng extension — chỉ hiện cho biết, không chặn gì. */
.dang-ghi-chip {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  color: #8a2b2b;
  background: #fdecec;
}

/* Bản của cuộc mình ĐÃ DỰ mà người khác ghi (một cuộc họp một người ghi) —
   chỉ đọc. Tách màu với chip chủ bản ghi của quản trị viên để nhìn danh sách
   là biết bản nào của mình, bản nào đọc nhờ. */
.owner-chip.du-hop-chip {
  color: #1d5a8c;
  background: #e8f1fb;
}

/* Các bản ghi khác của cùng buổi họp: người ghi đầu rời, người sau ghi tiếp;
   hoặc OWNER ghi song song. */
.cung-buoi {
  margin: 14px 0;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafbfc;
}

.cung-buoi h3 {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--muted);
}

.cung-buoi ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cung-buoi li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
}

.cung-buoi-mo {
  padding: 0;
  border: 0;
  background: none;
  color: #1d5a8c;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.cung-buoi-mo:hover,
.cung-buoi-mo:focus-visible {
  text-decoration: underline;
}

/* Chủ bản ghi biết ai đọc được bản của mình. */
.nguoi-du-hop {
  margin: 10px 0;
  font-size: 13px;
  color: var(--muted);
}

/* Khung chia sẻ ngay dưới hàng nút: tiêu đề + nút đóng cùng một hàng. */
.share-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.share-head h3 {
  margin: 0;
}

.share-close {
  min-width: 32px;
  padding: 2px 8px;
  font-size: 18px;
  line-height: 1;
}

.share-days-label {
  color: var(--muted, #5f6368);
}

@media (max-width: 720px) {
  .share-output {
    flex-wrap: wrap;
  }
  .share-output input {
    flex-basis: 100%;
  }
}
