/* =========================================================================
   Trợ lý cuộc họp — hệ thống giao diện
   1. Token   2. Nền tảng   3. Thành phần   4. Màn hình   5. Responsive
   ========================================================================= */

/* ------------------------------------------------------------ 1. TOKEN -- */

/* Bảng màu: ngọc lục bảo + vàng đồng. Dải chuyển ba tông dùng cho
   tiêu đề lớn và nút chính, viền vàng mảnh dùng cho các mảng sang trọng. */

:root {
  color-scheme: light;

  --accent:        #0d7a58;
  --accent-2:      #18a37e;
  --accent-soft:   #e5f2ec;
  --accent-ink:    #0a5b42;
  --on-accent:     #ffffff;

  --gold:          #b8892f;
  --gold-2:        #e0b551;
  --gold-soft:     #f7efdc;
  --grad-lux:      linear-gradient(120deg, #0a6449 0%, #18a37e 46%, #c99a3a 100%);
  --grad-lux-soft: linear-gradient(120deg, rgba(10,100,73,0.10), rgba(24,163,126,0.08) 48%, rgba(201,154,58,0.12));

  --success:       #0f8a5f;
  --success-soft:  #e0f3ea;
  --warn:          #b57812;
  --warn-soft:     #fbf0d9;
  --danger:        #c23b34;
  --danger-soft:   #fbe9e7;

  --bg:            #f7f5ef;
  --bg-tint:       radial-gradient(1100px 500px at 10% -14%, #dff0e7 0%, rgba(223,240,231,0) 62%),
                   radial-gradient(860px 420px at 92% -8%, #f6e9cf 0%, rgba(246,233,207,0) 60%);
  --surface:       #ffffff;
  --surface-2:     #f3f1e9;
  --surface-3:     #e9e6db;
  --text:          #16211c;
  --text-2:        #364339;
  --muted:         #6a7670;
  --faint:         #9aa49d;

  --border:        rgba(22, 40, 32, 0.10);
  --border-strong: rgba(22, 40, 32, 0.20);
  --border-gold:   rgba(184, 137, 47, 0.32);
  --ring:          rgba(13, 122, 88, 0.42);

  --r-sm:  10px;
  --r-md:  14px;
  --r-lg:  18px;
  --r-xl:  24px;
  --r-pill: 999px;

  --sh-xs: 0 1px 2px rgba(20, 35, 28, 0.05);
  --sh-sm: 0 1px 2px rgba(20, 35, 28, 0.05), 0 4px 12px rgba(20, 35, 28, 0.05);
  --sh-md: 0 2px 4px rgba(20, 35, 28, 0.05), 0 12px 28px rgba(20, 35, 28, 0.09);
  --sh-lg: 0 4px 8px rgba(20, 35, 28, 0.06), 0 24px 56px rgba(20, 35, 28, 0.14);

  --gutter: 16px;
  --maxw: 1080px;
  --t-fast: 150ms;
  --t-base: 190ms;
  --t-slow: 220ms;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  /* Nội dung: bộ chữ thiết kế riêng cho dấu tiếng Việt. */
  --font: 'Be Vietnam Pro', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI',
          Roboto, 'Helvetica Neue', 'Noto Sans', Arial, sans-serif;
  /* Tiêu đề dùng chung bộ chữ với nội dung, phân biệt bằng độ đậm. */
  --font-display: var(--font);

  --sp0-b: #dff0e8; --sp0-f: #0b6449;
  --sp1-b: #f7ecd4; --sp1-f: #8a6516;
  --sp2-b: #dcecf7; --sp2-f: #14577d;
  --sp3-b: #f6e4e0; --sp3-f: #9c4436;
  --sp4-b: #e6eedb; --sp4-f: #4c6b20;
  --sp5-b: #e7e9f6; --sp5-f: #3b4a8c;
  --sp6-b: #f7e6ef; --sp6-f: #93356a;
  --sp7-b: #dff0f0; --sp7-f: #0f6a68;
}

/* Chế độ tối: theo hệ thống (khi người dùng chưa chọn) … */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --accent:        #35c396;
    --accent-2:      #62dab2;
    --accent-soft:   #10271f;
    --accent-ink:    #74e2bd;
    --on-accent:     #05211a;

    --gold:          #e2bd72;
    --gold-2:        #f0d9a4;
    --gold-soft:     #2b2416;
    --grad-lux:      linear-gradient(120deg, #17916d 0%, #35c396 48%, #e2bd72 100%);
    --grad-lux-soft: linear-gradient(120deg, rgba(53,195,150,0.14), rgba(53,195,150,0.06) 50%, rgba(226,189,114,0.14));

    --success:       #3ad79f;
    --success-soft:  #0e3128;
    --warn:          #eab24a;
    --warn-soft:     #33280f;
    --danger:        #ff7068;
    --danger-soft:   #3a1b19;

    --bg:            #090d0b;
    --bg-tint:       radial-gradient(1100px 500px at 10% -14%, #10362a 0%, rgba(16,54,42,0) 62%),
                     radial-gradient(860px 420px at 92% -8%, #33280f 0%, rgba(51,40,15,0) 60%);
    --surface:       #111713;
    --surface-2:     #18211b;
    --surface-3:     #212c25;
    --text:          #edf3ef;
    --text-2:        #c8d4cd;
    --muted:         #93a09a;
    --faint:         #6f7d77;

    --border:        rgba(255, 255, 255, 0.10);
    --border-strong: rgba(255, 255, 255, 0.22);
    --border-gold:   rgba(226, 189, 114, 0.30);
    --ring:          rgba(53, 195, 150, 0.55);

    --sh-xs: 0 1px 2px rgba(0, 0, 0, 0.5);
    --sh-sm: 0 1px 2px rgba(0, 0, 0, 0.45), 0 4px 14px rgba(0, 0, 0, 0.4);
    --sh-md: 0 2px 6px rgba(0, 0, 0, 0.5), 0 14px 32px rgba(0, 0, 0, 0.5);
    --sh-lg: 0 6px 14px rgba(0, 0, 0, 0.55), 0 28px 64px rgba(0, 0, 0, 0.6);

    --sp0-b: #13372b; --sp0-f: #6fe0b6;
    --sp1-b: #362b14; --sp1-f: #f0cd86;
    --sp2-b: #16303f; --sp2-f: #8ecbec;
    --sp3-b: #3a221d; --sp3-f: #f0a595;
    --sp4-b: #26331a; --sp4-f: #bdd98c;
    --sp5-b: #232742; --sp5-f: #a7b2ef;
    --sp6-b: #3a2133; --sp6-f: #f0a3cd;
    --sp7-b: #123434; --sp7-f: #7bd9d6;
  }
}

/* … và khi người dùng bật tối thủ công. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --accent:        #35c396;
  --accent-2:      #62dab2;
  --accent-soft:   #10271f;
  --accent-ink:    #74e2bd;
  --on-accent:     #05211a;

  --gold:          #e2bd72;
  --gold-2:        #f0d9a4;
  --gold-soft:     #2b2416;
  --grad-lux:      linear-gradient(120deg, #17916d 0%, #35c396 48%, #e2bd72 100%);
  --grad-lux-soft: linear-gradient(120deg, rgba(53,195,150,0.14), rgba(53,195,150,0.06) 50%, rgba(226,189,114,0.14));

  --success:       #3ad79f;
  --success-soft:  #0e3128;
  --warn:          #eab24a;
  --warn-soft:     #33280f;
  --danger:        #ff7068;
  --danger-soft:   #3a1b19;

  --bg:            #090d0b;
  --bg-tint:       radial-gradient(1100px 500px at 10% -14%, #10362a 0%, rgba(16,54,42,0) 62%),
                   radial-gradient(860px 420px at 92% -8%, #33280f 0%, rgba(51,40,15,0) 60%);
  --surface:       #111713;
  --surface-2:     #18211b;
  --surface-3:     #212c25;
  --text:          #edf3ef;
  --text-2:        #c8d4cd;
  --muted:         #93a09a;
  --faint:         #6f7d77;

  --border:        rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.22);
  --border-gold:   rgba(226, 189, 114, 0.30);
  --ring:          rgba(53, 195, 150, 0.55);

  --sh-xs: 0 1px 2px rgba(0, 0, 0, 0.5);
  --sh-sm: 0 1px 2px rgba(0, 0, 0, 0.45), 0 4px 14px rgba(0, 0, 0, 0.4);
  --sh-md: 0 2px 6px rgba(0, 0, 0, 0.5), 0 14px 32px rgba(0, 0, 0, 0.5);
  --sh-lg: 0 6px 14px rgba(0, 0, 0, 0.55), 0 28px 64px rgba(0, 0, 0, 0.6);

  --sp0-b: #13372b; --sp0-f: #6fe0b6;
  --sp1-b: #362b14; --sp1-f: #f0cd86;
  --sp2-b: #16303f; --sp2-f: #8ecbec;
  --sp3-b: #3a221d; --sp3-f: #f0a595;
  --sp4-b: #26331a; --sp4-f: #bdd98c;
  --sp5-b: #232742; --sp5-f: #a7b2ef;
  --sp6-b: #3a2133; --sp6-f: #f0a3cd;
  --sp7-b: #123434; --sp7-f: #7bd9d6;
}

/* ------------------------------------------------------- 2. NỀN TẢNG --- */

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

/* Thuộc tính hidden phải thắng mọi giá trị display do lớp đặt ra. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image: var(--bg-tint);
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 700; letter-spacing: -0.015em; }
h1, h2 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; }
.hero h1 { font-weight: 700; line-height: 1.16; letter-spacing: -0.03em; }
.brand > span:not(.brand-mark) { font-weight: 600; }
.brand > span:not(.brand-mark) { font-weight: 700; letter-spacing: -0.015em; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.85rem); }
h2 { font-size: clamp(1.25rem, 1.05rem + 0.9vw, 1.6rem); }
h3 { font-size: 1.0625rem; }
p  { margin: 0; }
a  { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
svg.ic { display: block; flex: none; }

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
  border-radius: 6px;
}

::selection { background: var(--accent); color: var(--on-accent); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container-narrow { max-width: 760px; }

.stack-xs > * + * { margin-top: 6px; }
.stack-sm > * + * { margin-top: 10px; }
.stack-md > * + * { margin-top: 14px; }
.stack-lg > * + * { margin-top: 22px; }
.stack-xl > * + * { margin-top: 34px; }

.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.spacer { flex: 1 1 auto; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.tiny { font-size: 0.8125rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.hide-sm { display: flex; }
@media (max-width: 880px) { .hide-sm { display: none !important; } }

/* -------------------------------------------------- 3. THÀNH PHẦN ------ */

/* Nút */
.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--text);
  --btn-bd: var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--r-pill);
  border: 1px solid var(--btn-bd);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--t-fast) var(--ease),
              box-shadow var(--t-fast) var(--ease),
              background-color var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease),
              opacity var(--t-fast) var(--ease);
  box-shadow: var(--sh-xs);
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--sh-sm); }
.btn:active { transform: translateY(0); box-shadow: var(--sh-xs); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-primary {
  --btn-bg: var(--grad-lux);
  --btn-fg: var(--on-accent);
  --btn-bd: transparent;
  box-shadow: 0 2px 6px rgba(10, 100, 73, 0.24), 0 10px 24px rgba(10, 100, 73, 0.20);
}
.btn-primary:hover { box-shadow: 0 4px 10px rgba(10, 100, 73, 0.28), 0 16px 34px rgba(10, 100, 73, 0.26); }

.btn-soft   { --btn-bg: var(--accent-soft); --btn-fg: var(--accent-ink); --btn-bd: transparent; }
.btn-ghost  { --btn-bg: transparent; --btn-fg: var(--text-2); --btn-bd: var(--border-strong); box-shadow: none; }
.btn-ghost:hover { --btn-bg: var(--surface-2); }
.btn-plain  { --btn-bg: transparent; --btn-fg: var(--muted); --btn-bd: transparent; box-shadow: none; }
.btn-plain:hover { --btn-bg: var(--surface-2); --btn-fg: var(--text); }
.btn-danger { --btn-bg: var(--danger); --btn-fg: #fff; --btn-bd: transparent; }
.btn-danger-soft { --btn-bg: var(--danger-soft); --btn-fg: var(--danger); --btn-bd: transparent; }
.btn-lg { min-height: 52px; padding: 14px 26px; font-size: 1rem; }
.btn-sm { min-height: 40px; padding: 8px 14px; font-size: 0.875rem; }
.btn-block { width: 100%; }
.btn-icon { padding: 10px; min-width: 44px; }

/* Thẻ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--sh-sm);
}
.card-flat { box-shadow: none; }
.card-pad-lg { padding: 26px; }
.card-tight { padding: 14px 16px; }

/* Thẻ hành động lớn (Ghi / Tải lên) */
.action-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  width: 100%;
  text-align: left;
  padding: 22px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--sh-sm);
  cursor: pointer;
  overflow: hidden;
  transition: transform var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease), border-color var(--t-base) var(--ease);
}
.action-card::after {
  content: '';
  position: absolute; inset: 0;
  background: var(--grad-lux-soft);
  opacity: 0;
  transition: opacity var(--t-base) var(--ease);
  pointer-events: none;
}
.action-card:hover { transform: translateY(-2px); box-shadow: var(--sh-md); border-color: var(--border-strong); }
.action-card:hover::after { opacity: 1; }
.action-card .ac-ic {
  display: grid; place-items: center;
  width: 52px; height: 52px; flex: none;
  border-radius: var(--r-md);
  background: var(--grad-lux);
  color: var(--on-accent);
  box-shadow: 0 6px 16px rgba(91, 86, 224, 0.28);
}
.action-card .ac-ic-soft { background: var(--accent-soft); color: var(--accent-ink); box-shadow: none; }
.action-card h3 { margin-bottom: 3px; }
.action-card p { color: var(--muted); font-size: 0.9375rem; }

/* Chip & nhãn */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
}
.chip-accent { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.chip-warn   { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip-ok     { background: var(--success-soft); color: var(--success); border-color: transparent; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px;
  border-radius: var(--r-pill);
  font-size: 0.78125rem;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--text-2);
}
.badge-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.badge-ok   { background: var(--success-soft); color: var(--success); }
.badge-bad  { background: var(--danger-soft); color: var(--danger); }
.badge-wait { background: var(--surface-3); color: var(--muted); }
.badge-busy { background: var(--accent-soft); color: var(--accent-ink); }
.badge-busy .badge-dot { animation: pulse-dot 1.4s var(--ease) infinite; }
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.chip-speaker {
  display: inline-flex; align-items: center;
  padding: 2px 10px;
  border-radius: var(--r-pill);
  font-size: 0.8125rem;
  font-weight: 650;
  line-height: 1.5;
  white-space: nowrap;
  background: var(--sp0-b); color: var(--sp0-f);
}
.sp-0 { background: var(--sp0-b); color: var(--sp0-f); }
.sp-1 { background: var(--sp1-b); color: var(--sp1-f); }
.sp-2 { background: var(--sp2-b); color: var(--sp2-f); }
.sp-3 { background: var(--sp3-b); color: var(--sp3-f); }
.sp-4 { background: var(--sp4-b); color: var(--sp4-f); }
.sp-5 { background: var(--sp5-b); color: var(--sp5-f); }
.sp-6 { background: var(--sp6-b); color: var(--sp6-f); }
.sp-7 { background: var(--sp7-b); color: var(--sp7-f); }

/* Ô nhập */
.field { display: block; }
.field > .label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}
.input, .textarea, .select {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}
.textarea { min-height: 84px; resize: vertical; line-height: 1.55; }
.input-flat { background: var(--surface-2); }
.lang-field { margin-top: 16px; }
.lang-hint { display: block; margin-top: 6px; }

/* Thông báo nổi */
.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(440px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 12px 12px 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--sh-lg);
  pointer-events: auto;
  animation: toast-in var(--t-slow) var(--ease);
}
.toast-msg { flex: 1; font-size: 0.9375rem; color: var(--text); }
.toast-ic { color: var(--muted); margin-top: 2px; }
.toast-ok    .toast-ic { color: var(--success); }
.toast-error .toast-ic { color: var(--danger); }
.toast-warn  .toast-ic { color: var(--warn); }
.toast-x {
  background: none; border: 0; cursor: pointer; color: var(--faint);
  padding: 4px; border-radius: 8px; margin-top: 1px;
}
.toast-x:hover { color: var(--text); background: var(--surface-2); }
.toast-out { animation: toast-out var(--t-base) var(--ease) forwards; }
@keyframes toast-in  { from { opacity: 0; transform: translateY(12px) scale(0.97); } }
@keyframes toast-out { to   { opacity: 0; transform: translateY(8px) scale(0.97); } }

/* Hộp thoại */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  padding: var(--gutter);
  background: rgba(14, 14, 26, 0.5);
  backdrop-filter: blur(3px);
  animation: fade-in var(--t-base) var(--ease);
}
.overlay-out { animation: fade-out var(--t-fast) var(--ease) forwards; }
@keyframes fade-in  { from { opacity: 0; } }
@keyframes fade-out { to   { opacity: 0; } }
.dialog {
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--sh-lg);
  animation: dlg-in var(--t-slow) var(--ease);
}
@keyframes dlg-in { from { opacity: 0; transform: translateY(14px) scale(0.97); } }
.dialog-title { font-size: 1.1875rem; }
.dialog-body { margin-top: 8px; color: var(--muted); }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; flex-wrap: wrap; }
.dialog-actions .btn { flex: 1 1 auto; }

/* Khối chờ */
.skel {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  border-radius: 8px;
  height: 14px;
  animation: shimmer 1.35s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.skel-card { display: flex; flex-direction: column; gap: 10px; }
.skel-line { height: 13px; }

/* Trạng thái rỗng */
.empty {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 44px 20px;
  border-radius: var(--r-lg);
  border: 1px dashed var(--border-strong);
  background: var(--surface);
}
.empty-art { margin-bottom: 16px; opacity: 0.95; }
.empty-title { font-size: 1.125rem; }
.empty-text { margin-top: 6px; color: var(--muted); max-width: 42ch; }
.empty-action { margin-top: 18px; }

/* Bảng */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); border: 1px solid var(--border); }
table.tbl { width: 100%; border-collapse: collapse; min-width: 480px; font-size: 0.9375rem; }
table.tbl th, table.tbl td { padding: 11px 14px; text-align: left; vertical-align: top; }
table.tbl thead th {
  background: var(--surface-2);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
table.tbl tbody tr + tr td { border-top: 1px solid var(--border); }

/* Thanh tiến trình */
.bar {
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  overflow: hidden;
}
.bar > i {
  display: block; height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  width: 0;
  transition: width var(--t-slow) var(--ease);
}

/* Ghi chú / hộp thông tin */
.note {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 13px 15px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.9375rem;
  color: var(--text-2);
}
.note .ic { margin-top: 2px; color: var(--muted); flex: none; }
.note-accent { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.note-accent .ic { color: var(--accent); }
.note-warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.note-warn .ic { color: var(--warn); }
.note-ok { background: var(--success-soft); border-color: transparent; color: var(--success); }
.note-ok .ic { color: var(--success); }

/* --------------------------------------------------- 4. MÀN HÌNH ------- */

/* ---- Khung chung ---- */
.app-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .app-header { background: var(--bg); }
}
.header-inner {
  display: flex; align-items: center; gap: 12px;
  min-height: 64px;
  padding-block: 10px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); font-weight: 750; letter-spacing: -0.02em;
  font-size: 1.0625rem;
  text-decoration: none;
  border-radius: 10px;
}
.brand:hover { text-decoration: none; }
.brand > span:not(.brand-mark) { white-space: nowrap; }
.brand-mark {
  display: grid; place-items: center;
  width: 34px; height: 34px; flex: none;
  border-radius: 11px;
  background: var(--grad-lux);
  color: var(--on-accent);
  box-shadow: 0 4px 12px rgba(91, 86, 224, 0.3);
}
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.avatar {
  width: 34px; height: 34px; flex: none;
  border-radius: 50%;
  background: var(--surface-3);
  object-fit: cover;
  border: 1px solid var(--border);
}
.avatar-fallback {
  display: grid; place-items: center;
  font-size: 0.875rem; font-weight: 700;
  background: var(--accent-soft); color: var(--accent-ink);
}
.user-menu { position: relative; }
.user-btn {
  display: flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 4px 10px 4px 4px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.user-btn:hover { border-color: var(--border-strong); }
.user-name { font-size: 0.9375rem; font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 232px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  box-shadow: var(--sh-lg);
  padding: 6px;
  z-index: 50;
  animation: menu-in var(--t-fast) var(--ease);
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px); } }
.menu[hidden] { display: none; }
.menu-head { padding: 10px 12px 8px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu-email { font-size: 0.8125rem; color: var(--muted); word-break: break-all; }
.menu-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; min-height: 44px;
  padding: 10px 12px;
  border: 0; border-radius: var(--r-sm);
  background: none; color: var(--text-2);
  font-size: 0.9375rem; font-weight: 550;
  cursor: pointer; text-align: left;
}
.menu-item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.menu-item .ic { color: var(--faint); }

.theme-toggle {
  display: grid; place-items: center;
  width: 44px; height: 44px; flex: none;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: transform var(--t-base) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.theme-toggle:hover { color: var(--accent); border-color: var(--border-strong); transform: rotate(-12deg); }

main { padding-block: 26px 72px; }
.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); }
.page-head p { color: var(--muted); margin-top: 6px; }

.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px;
  color: var(--muted); font-weight: 600; font-size: 0.9375rem;
}
.back-link:hover { color: var(--text); text-decoration: none; }

/* ---- 1. Trang giới thiệu (trang bán hàng, khi chưa đăng nhập) ---- */

/* Trang này tự lo khoảng cách trên/dưới cho từng dải màu, nên bỏ phần đệm
   mặc định của <main> để các dải chạy hết chiều ngang màn hình. */
main.main-flush { padding-block: 0; }

.landing { --band-pad: clamp(52px, 6.5vw, 96px); }

/* Dải nội dung: mỗi phần của trang là một dải, xen kẽ hai nền nhẹ. */
.lx-band { position: relative; padding-block: var(--band-pad); }
.lx-band-alt { background: var(--surface-2); border-block: 1px solid var(--border); }

/* Khối mở đầu */
.lx-hero {
  padding-top: clamp(30px, 4vw, 56px);
  background-image: var(--grad-lux-soft);
}
/* Nét vàng mảnh ngăn khối mở đầu với phần dưới. */
.lx-hero::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-gold) 20%, var(--border-gold) 80%, transparent);
  pointer-events: none;
}
/* Trong dải, phần mở đầu không cần đệm và nét vàng riêng nữa. */
.lx-hero .hero { padding-block: 0; }
.lx-hero .hero::before { display: none; }

.hero { padding-block: 40px 28px; text-align: center; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--sh-xs);
  font-size: 0.8125rem; font-weight: 600; color: var(--accent-ink);
  margin-bottom: 18px;
}
.hero h1 { max-width: 18ch; margin-inline: auto; }
.hero h1 .grad {
  background: var(--grad-lux);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub {
  margin-top: 16px;
  font-size: clamp(1rem, 0.95rem + 0.35vw, 1.1875rem);
  color: var(--muted);
  max-width: 56ch; margin-inline: auto;
}
.hero-cta { margin-top: 28px; display: flex; flex-direction: column; align-items: center; gap: 12px; }

/* Tiêu đề của mỗi phần, kèm một vạch ngắn bằng dải màu thương hiệu. */
.lx-head { text-align: center; margin-bottom: clamp(26px, 3.4vw, 44px); }
.lx-head h2 {
  font-size: clamp(1.5rem, 1.18rem + 1.5vw, 2.15rem);
  letter-spacing: -0.025em;
}
.lx-head::after {
  content: '';
  display: block; width: 52px; height: 2px;
  margin: 14px auto 0;
  border-radius: 2px;
  background: var(--grad-lux);
}

/* 2. "Nghe quen không?" — những vướng mắc quen thuộc */
.pain-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}
/* Bốn mục: 2×2 ở khổ vừa, thành một hàng khi đủ rộng — không để lẻ 3 + 1. */
@media (min-width: 600px) {
  .pain-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .pain-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.pain {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 18px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--sh-xs);
}
.pain-ic {
  display: grid; place-items: center;
  width: 38px; height: 38px; flex: none;
  border-radius: 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
}
.pain p { color: var(--text-2); font-size: 0.9375rem; }

/* 3. "Cách chúng tôi giải quyết" */
.solve-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(268px, 1fr));
  gap: 18px;
}
.solve {
  position: relative;
  padding: 28px 24px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--sh-sm);
  transition: transform var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease);
}
.solve::before {
  content: '';
  position: absolute; inset: 0 0 auto 0; height: 1px;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, var(--border-gold) 18%, var(--border-gold) 82%, transparent);
  pointer-events: none;
}
.solve:hover { transform: translateY(-3px); box-shadow: var(--sh-md); }
.solve-ic {
  display: grid; place-items: center;
  width: 50px; height: 50px;
  border-radius: 15px;
  background: var(--grad-lux);
  color: var(--on-accent);
  box-shadow: var(--sh-sm);
  margin-bottom: 16px;
}
.solve h3 { font-size: 1.125rem; margin-bottom: 8px; }
.solve p { color: var(--muted); font-size: 0.9375rem; }

/* 4. "Dùng như thế nào" — ba bước đánh số */
.how-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(248px, 1fr));
  gap: 18px;
}
.how-step {
  padding: 24px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--sh-xs);
}
.how-n {
  display: grid; place-items: center;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border-gold);
  color: var(--gold);
  font-weight: 700; font-size: 1.0625rem;
  font-variant-numeric: tabular-nums;
  margin-bottom: 14px;
}
.how-step h3 { font-size: 1.0625rem; margin-bottom: 6px; }
.how-step p { color: var(--muted); font-size: 0.9375rem; }

/* 5. Bảng giá */
.plan-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  padding-top: 14px;          /* chừa chỗ cho huy hiệu của thẻ nổi bật */
}
@media (min-width: 600px) {
  .plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .plan-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.plan {
  position: relative;
  display: flex; flex-direction: column;
  padding: 24px 20px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--sh-sm);
}
.plan.is-featured {
  border-color: var(--border-gold);
  box-shadow: var(--sh-md);
}
.plan.is-featured::before {
  content: '';
  position: absolute; inset: 0 0 auto 0; height: 1px;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, var(--border-gold) 18%, var(--border-gold) 82%, transparent);
  pointer-events: none;
}
.plan-badge {
  position: absolute; top: -12px; left: 50%;
  transform: translateX(-50%);
  padding: 4px 13px;
  border-radius: var(--r-pill);
  background: var(--grad-lux);
  color: var(--on-accent);
  font-size: 0.75rem; font-weight: 700; white-space: nowrap;
  box-shadow: var(--sh-sm);
}
.plan-name { font-size: 1.125rem; }
.plan-tagline {
  margin-top: 4px;
  color: var(--muted); font-size: 0.875rem;
  min-height: 3.9em;          /* chừa đủ ba dòng để giá các thẻ thẳng hàng */
}
.plan-price { margin-top: 14px; display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; }
.plan-price strong {
  font-size: clamp(1.5rem, 1.3rem + 0.7vw, 1.875rem);
  letter-spacing: -0.03em;
}
.plan-price span { color: var(--muted); font-size: 0.875rem; }
.plan-note {
  margin-top: 4px;
  color: var(--gold); font-size: 0.8125rem;
  min-height: 2.7em;          /* chừa hai dòng để danh sách tính năng thẳng hàng */
}
.plan-features {
  list-style: none; margin: 18px 0 0; padding: 0;
  display: flex; flex-direction: column; gap: 9px;
  flex: 1 1 auto;
}
.plan-features li {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 0.875rem; color: var(--text-2);
}
.plan-features .ic { color: var(--accent); margin-top: 3px; }
.plan-cta { margin-top: 20px; }
.lx-fineprint {
  margin-top: 22px; text-align: center;
  color: var(--muted); font-size: 0.8125rem;
}

/* Khi các gói xếp thành một cột thì không cần chừa chỗ để thẳng hàng nữa. */
@media (max-width: 599px) {
  .plan-tagline, .plan-note { min-height: 0; }
}

/* Chỉ nhấc thẻ nổi bật lên khi cả bốn gói nằm trên cùng một hàng. */
@media (min-width: 1024px) {
  .plan.is-featured { transform: translateY(-10px); }
}

/* 6. Cam kết */
.pledge-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}
/* Bốn mục nên xếp 2×2 cho cân, không để lẻ một mục ở hàng dưới. */
@media (min-width: 720px) {
  .pledge-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.pledge {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 20px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--sh-xs);
}
.pledge-ic {
  display: grid; place-items: center;
  width: 40px; height: 40px; flex: none;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.pledge h3 { font-size: 1rem; margin-bottom: 5px; }
.pledge p { color: var(--muted); font-size: 0.9375rem; }

/* 7. Chân trang */
.lx-footer {
  position: relative;
  padding-block: 34px calc(44px + env(safe-area-inset-bottom, 0px));
  background: var(--surface-2);
  border-top: 1px solid var(--border);
}
.lx-footer::before {
  content: '';
  position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-gold) 20%, var(--border-gold) 80%, transparent);
  pointer-events: none;
}
.lx-footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; flex-wrap: wrap;
}
.lx-footer-brand { display: flex; align-items: center; gap: 12px; }
.lx-footer-brand strong { font-weight: 700; letter-spacing: -0.015em; }
.lx-footer-brand p { margin-top: 2px; }
.lx-footer-links { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.lx-footer-links a {
  display: inline-flex; align-items: center;
  min-height: 44px;
  color: var(--muted); font-size: 0.9375rem; font-weight: 600;
}
.lx-footer-links a:hover { color: var(--accent); }

/* Ô biểu tượng vuông dùng lại ở trang biên bản (mục "Công việc cần làm"). */
.feature-ic {
  display: grid; place-items: center;
  width: 46px; height: 46px;
  border-radius: 14px;
  background: var(--accent-soft); color: var(--accent-ink);
  margin-bottom: 14px;
}

/* ---- 2. Trang chủ ---- */
.quota-row { display: flex; gap: 8px; flex-wrap: wrap; }
.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.meeting-list { display: flex; flex-direction: column; gap: 12px; }
.meeting-card {
  display: block;
  width: 100%; text-align: left;
  padding: 18px 20px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--sh-xs);
  cursor: pointer;
  transition: transform var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease), border-color var(--t-base) var(--ease);
}
.meeting-card:hover { transform: translateY(-2px); box-shadow: var(--sh-md); border-color: var(--border-strong); text-decoration: none; }
.meeting-card h3 {
  font-size: 1.0625rem; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-clamp: 2;
}
.meeting-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
  margin-top: 10px;
  font-size: 0.875rem; color: var(--muted);
}
.meeting-meta .mi { display: inline-flex; align-items: center; gap: 5px; }
.meeting-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }

/* ---- 3. Ghi âm ---- */
.rec-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 18px;
  align-items: start;
}
.rec-stage {
  display: flex; flex-direction: column; align-items: center;
  padding: 30px 20px 26px;
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--sh-sm);
}

.rec-btn {
  position: relative;
  width: 132px; height: 132px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  display: grid; place-items: center;
  background: var(--grad-lux);
  color: var(--on-accent);
  box-shadow: 0 10px 30px rgba(91, 86, 224, 0.35);
  transition: transform var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease);
}
.rec-btn:hover { transform: scale(1.03); }
.rec-btn:active { transform: scale(0.98); }
.rec-btn[disabled] { opacity: 0.6; cursor: wait; }
.rec-btn .rec-btn-label { position: absolute; bottom: 26px; font-size: 0.8125rem; font-weight: 700; }
.rec-btn .ic { margin-bottom: 12px; }

/* Vòng nhịp khi đang ghi */
.rec-btn.is-rec { background: linear-gradient(135deg, #b8322f, #d98a2b); box-shadow: 0 10px 30px rgba(184, 50, 47, 0.38); }
.rec-btn.is-rec::before,
.rec-btn.is-rec::after {
  content: ''; position: absolute; inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(224, 69, 79, 0.55);
  animation: rec-ring 2s var(--ease) infinite;
  pointer-events: none;
}
.rec-btn.is-rec::after { animation-delay: 1s; }
@keyframes rec-ring {
  0%   { transform: scale(1);    opacity: 0.8; }
  100% { transform: scale(1.42); opacity: 0; }
}

.rec-timer {
  margin-top: 22px;
  font-size: clamp(2rem, 1.5rem + 2.2vw, 2.75rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.rec-remain { margin-top: 2px; font-size: 0.9375rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.rec-remain.is-warn { color: var(--warn); font-weight: 650; }

/* Cột mức âm thanh */
.meter {
  display: flex; align-items: flex-end; justify-content: center;
  gap: 4px; height: 44px; margin-top: 20px; width: min(280px, 100%);
}
.meter i {
  display: block; flex: 1 1 0; max-width: 8px;
  height: 6px; min-height: 6px;
  border-radius: var(--r-pill);
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  opacity: 0.35;
  transform-origin: bottom;
  transition: height 90ms linear, opacity 90ms linear;
}
.meter.is-live i { opacity: 1; }

.source-picker { display: grid; gap: 10px; margin-top: 22px; width: 100%; }
.source-opt {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.source-opt:hover { background: var(--surface-2); }
.source-opt input { margin: 3px 0 0; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.source-opt strong { display: block; font-size: 0.9375rem; }
.source-opt span { display: block; font-size: 0.8125rem; color: var(--muted); margin-top: 2px; }
.source-opt.is-on { border-color: var(--accent); background: var(--accent-soft); }
.source-opt.is-on span { color: var(--accent-ink); opacity: 0.85; }

.live-panel {
  display: flex; flex-direction: column;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--sh-sm);
  overflow: hidden;
}
.live-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.live-head h3 { font-size: 0.9375rem; }
.live-body { padding: 16px 18px; overflow-y: auto; max-height: 340px; scroll-behavior: smooth; }
.live-body.is-short { max-height: 260px; }

.tline { padding: 8px 0; border-bottom: 1px dashed var(--border); }
.tline:last-child { border-bottom: 0; }
.tline p { margin-top: 4px; color: var(--text-2); }
.tline-partial { color: var(--muted); font-style: italic; }
.tline-partial::after {
  content: ''; display: inline-block;
  width: 7px; height: 1.05em; margin-left: 3px;
  background: var(--accent); border-radius: 2px;
  vertical-align: text-bottom;
  animation: caret 1s steps(2) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

.autoscroll {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 36px; padding: 4px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 0.8125rem; font-weight: 600; color: var(--muted);
  cursor: pointer;
}
.autoscroll input { width: 16px; height: 16px; accent-color: var(--accent); }
.autoscroll.is-on { color: var(--accent-ink); background: var(--accent-soft); border-color: transparent; }

.draft-sec { padding: 10px 0; }
.draft-sec + .draft-sec { border-top: 1px solid var(--border); }
.draft-sec h4 { font-size: 0.9375rem; margin-bottom: 6px; }
.draft-sec ul { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 0.9375rem; }
.draft-sec li { margin-bottom: 4px; }
.draft-new { animation: slide-up var(--t-slow) var(--ease); }
@keyframes slide-up { from { opacity: 0; transform: translateY(8px); } }

/* Các bước xử lý */
.steps { display: flex; flex-direction: column; gap: 2px; }
.step {
  display: flex; align-items: flex-start; gap: 13px;
  padding: 12px 0;
  position: relative;
}
.step + .step::before {
  content: ''; position: absolute;
  left: 15px; top: -14px; height: 14px; width: 2px;
  background: var(--border-strong);
}
.step-dot {
  display: grid; place-items: center;
  width: 32px; height: 32px; flex: none;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: var(--surface);
  color: var(--faint);
  font-size: 0.8125rem; font-weight: 700;
}
.step-txt strong { display: block; font-size: 0.9375rem; }
.step-txt span { font-size: 0.8125rem; color: var(--muted); }
.step.is-done .step-dot { border-color: var(--success); background: var(--success); color: #fff; }
.step.is-done .step-txt strong { color: var(--text); }
.step.is-active .step-dot { border-color: var(--accent); color: var(--accent); }
.step.is-active .step-txt strong { color: var(--accent-ink); }
.step.is-fail .step-dot { border-color: var(--danger); color: var(--danger); }
.spin { animation: spin 1.1s linear infinite; transform-origin: 50% 50%; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- 4. Tải file lên ---- */
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 46px 22px;
  border-radius: var(--r-xl);
  border: 2px dashed var(--border-strong);
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--t-base) var(--ease), background var(--t-base) var(--ease), transform var(--t-base) var(--ease);
}
.dropzone:hover { border-color: var(--accent); background: var(--surface-2); }
.dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); transform: scale(1.01); }
.dropzone h3 { margin-top: 14px; }
.dropzone p { margin-top: 6px; color: var(--muted); font-size: 0.9375rem; }
.dropzone .btn { margin-top: 18px; }

.file-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.file-row .f-ic { color: var(--accent); flex: none; }
.file-row .f-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .f-sub { font-size: 0.8125rem; color: var(--muted); }

/* ---- 5. Biên bản chi tiết ---- */
.detail-title-row { display: flex; align-items: flex-start; gap: 10px; }
.title-input {
  flex: 1 1 auto;
  font-size: clamp(1.375rem, 1.15rem + 1vw, 1.875rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  border: 1px solid transparent;
  background: transparent;
  border-radius: var(--r-sm);
  padding: 4px 8px;
  margin-left: -8px;
  width: 100%;
  min-height: 44px;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.title-input:hover { background: var(--surface-2); }
.title-input:focus { outline: none; background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }

.detail-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  margin-top: 8px;
  font-size: 0.9375rem; color: var(--muted);
}
.detail-meta .mi { display: inline-flex; align-items: center; gap: 6px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.dropdown { position: relative; }

.tabs {
  display: flex; gap: 4px;
  padding: 4px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
  margin: 22px 0 18px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 1 1 auto;
  min-height: 42px;
  padding: 8px 18px;
  border: 0; border-radius: var(--r-pill);
  background: none; color: var(--muted);
  font-weight: 650; font-size: 0.9375rem;
  cursor: pointer; white-space: nowrap;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { background: var(--surface); color: var(--accent-ink); box-shadow: var(--sh-xs); }

/* Nội dung biên bản */
.minutes-overview {
  padding: 18px 20px;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--accent-soft), transparent 70%);
  border: 1px solid var(--border);
}
.minutes-overview h3 { font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent-ink); margin-bottom: 8px; }
.minutes-overview p { color: var(--text-2); }

.msec { padding: 20px 0; }
.msec + .msec { border-top: 1px solid var(--border); }
.msec > h3 {
  font-size: 1.0625rem;
  display: flex; align-items: center; gap: 9px;
  margin-bottom: 12px;
}
.msec > h3 .msec-n {
  display: grid; place-items: center;
  width: 25px; height: 25px; flex: none;
  border-radius: 8px;
  background: var(--accent-soft); color: var(--accent-ink);
  font-size: 0.8125rem; font-weight: 700;
}
.mitems { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.mitem { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.mitem > p { flex: 1 1 220px; color: var(--text-2); }
.mdetails { list-style: none; margin: 7px 0 0; padding: 0 0 0 4px; flex-basis: 100%; }
.mdetails li {
  position: relative;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.9375rem;
  margin-top: 4px;
}
.mdetails li::before {
  content: ''; position: absolute; left: 4px; top: 0.66em;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--border-strong);
}

.actions-title { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
td.td-owner { font-weight: 600; white-space: nowrap; }
td.td-due { white-space: nowrap; color: var(--muted); }

/* Chế độ sửa */
.edit-sec { padding: 16px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border); }
.edit-sec + .edit-sec { margin-top: 12px; }
.edit-item { padding: 12px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--border); }
.edit-item + .edit-item { margin-top: 10px; }
.edit-grid { display: grid; grid-template-columns: minmax(120px, 0.6fr) minmax(0, 2fr); gap: 10px; }
.edit-actions-grid { display: grid; grid-template-columns: 1fr 1.6fr 0.8fr auto; gap: 8px; align-items: start; }
.row-x {
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--danger); cursor: pointer;
}
.row-x:hover { background: var(--danger-soft); }
.edit-bar {
  position: sticky; bottom: 0; z-index: 20;
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin-top: 18px; padding: 12px 16px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--sh-lg);
}

/* Lời thoại */
.seg-list { display: flex; flex-direction: column; gap: 2px; }
.seg {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: none;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.seg:hover { background: var(--surface-2); border-color: var(--border); }
.seg.is-playing { background: var(--accent-soft); border-color: transparent; }
.seg-time {
  font-variant-numeric: tabular-nums;
  font-size: 0.8125rem; color: var(--faint);
  padding-top: 3px;
}
.seg.is-playing .seg-time { color: var(--accent-ink); }
.seg-text { color: var(--text-2); margin-top: 4px; }

/* Trình phát */
.player { padding: 20px; }
.player-main { display: flex; align-items: center; gap: 16px; }
.play-btn {
  display: grid; place-items: center;
  width: 60px; height: 60px; flex: none;
  border-radius: 50%; border: 0;
  background: var(--grad-lux);
  color: var(--on-accent);
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(91, 86, 224, 0.3);
  transition: transform var(--t-fast) var(--ease);
}
.play-btn:hover { transform: scale(1.05); }
.player-body { flex: 1 1 auto; min-width: 0; }
.seek {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 22px; background: transparent; cursor: pointer; margin: 0;
}
.seek::-webkit-slider-runnable-track { height: 7px; border-radius: 99px; background: var(--surface-3); }
.seek::-moz-range-track { height: 7px; border-radius: 99px; background: var(--surface-3); }
.seek::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 17px; height: 17px; margin-top: -5px;
  border-radius: 50%; background: var(--accent);
  border: 2px solid var(--surface); box-shadow: var(--sh-sm);
}
.seek::-moz-range-thumb {
  width: 17px; height: 17px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--surface);
}
.player-times {
  display: flex; justify-content: space-between;
  font-size: 0.8125rem; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.mini-player {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  width: min(560px, calc(100vw - 32px));
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--sh-lg);
  animation: toast-in var(--t-slow) var(--ease);
}
.mini-player[hidden] { display: none; }
.mini-play {
  display: grid; place-items: center;
  width: 40px; height: 40px; flex: none;
  border-radius: 50%; border: 0;
  background: var(--accent); color: var(--on-accent); cursor: pointer;
}
.mini-player .seek { flex: 1 1 auto; }
.mini-time { font-size: 0.8125rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---- 6. Xem chia sẻ ---- */
.shared-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 18px;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--accent-soft), transparent 75%);
  border: 1px solid var(--border);
  margin-bottom: 20px;
}
.shared-cta {
  margin-top: 34px; padding: 26px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: center;
  box-shadow: var(--sh-sm);
}

/* ---- 7. Hết lượt dùng thử ---- */
.upsell {
  text-align: center;
  padding: 34px 24px;
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  background: linear-gradient(160deg, var(--warn-soft), var(--surface) 62%);
  box-shadow: var(--sh-sm);
}
.upsell h2 { margin-top: 14px; }
.upsell p { margin-top: 10px; color: var(--muted); max-width: 46ch; margin-inline: auto; }
.upsell .btn { margin-top: 22px; }

/* Hộp chia sẻ liên kết */
.share-box { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.share-box .input { flex: 1 1 220px; min-width: 0; font-size: 0.875rem; }

/* ------------------------------------------------- 5. RESPONSIVE ------- */

@media (max-width: 900px) {
  .rec-layout { grid-template-columns: minmax(0, 1fr); }
  .live-body { max-height: 300px; }
}

@media (max-width: 640px) {
  main { padding-block: 20px 84px; }
  .card { padding: 17px; }
  .card-pad-lg { padding: 20px; }
  .hero { padding-block: 28px 20px; }
  .lx-head { margin-bottom: 24px; }
  .pain { padding: 15px; }
  .solve { padding: 22px 19px; }
  .how-step { padding: 20px; }
  .plan { padding: 22px 18px; }
  .lx-footer-inner { flex-direction: column; align-items: flex-start; gap: 10px; }
  .user-name { display: none; }
  .user-btn { padding: 4px; }
  .toolbar .btn { flex: 1 1 auto; }
  .edit-grid { grid-template-columns: minmax(0, 1fr); }
  .edit-actions-grid { grid-template-columns: minmax(0, 1fr); }
  .row-x { width: 100%; }
  .seg { grid-template-columns: 52px minmax(0, 1fr); gap: 9px; padding: 10px 8px; }
  .dialog-actions { flex-direction: column-reverse; }
  .dialog-actions .btn { width: 100%; }
  .rec-btn { width: 118px; height: 118px; }
  .user-menu .menu { position: fixed; left: var(--gutter); right: var(--gutter); top: 70px; min-width: 0; }
  .dropdown .menu { left: 0; right: auto; min-width: 210px; }
}

@media (max-width: 380px) {
  /* Chỉ ẩn chữ, vẫn giữ lại biểu tượng thương hiệu */
  .brand > span:not(.brand-mark) { display: none; }
  .tab { padding: 8px 12px; font-size: 0.875rem; }
}

/* ---------------------------------------------- Hạn chế chuyển động --- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .action-card:hover, .solve:hover, .meeting-card:hover,
  .btn:hover, .play-btn:hover, .rec-btn:hover, .theme-toggle:hover { transform: none; }
}

/* In ấn: chỉ giữ phần nội dung biên bản */
@media print {
  .app-header, .toolbar, .tabs, .toasts, .mini-player, .edit-bar, .back-link { display: none !important; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; border-color: #ddd; }
}


/* --------------------------------------------------- Nét vàng cao cấp --- */

.card, .panel, .hero {
  position: relative;
}
.card::before, .hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-gold) 18%, var(--border-gold) 82%, transparent);
  border-radius: inherit;
  pointer-events: none;
}
.hero h1 .grad {
  background: var(--grad-lux);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@media print {
  .card::before, .hero::before { display: none; }
}


/* Tên cuộc họp là ô nhập chỉnh sửa tại chỗ, nên phải gọi chữ tiêu đề riêng. */
.title-input,
.detail-title {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0;
}




/* --------------------------------------------------- Nút hỗ trợ nổi ---- */

.support-fab {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 52px;
  padding: 0 18px 0 15px;
  border-radius: var(--r-pill);
  background: var(--grad-lux);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(10, 100, 73, 0.28), 0 18px 40px rgba(10, 100, 73, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: transform var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease);
}
.support-fab:hover {
  text-decoration: none;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(10, 100, 73, 0.32), 0 24px 52px rgba(10, 100, 73, 0.26);
}
.support-fab:active { transform: translateY(0); }
.support-fab:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring), var(--sh-md); }
.support-fab-ic { flex: none; }

/* Trên màn hình hẹp chỉ còn hình tròn để không che nội dung. */
@media (max-width: 560px) {
  .support-fab { width: 52px; padding: 0; justify-content: center; }
  .support-fab-label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .support-fab { transition: none; }
  .support-fab:hover { transform: none; }
}

@media print { .support-fab { display: none; } }


/* ------------------------------------------------------------ GÓP Ý ---- */

/* Nút "Góp ý" trên thanh đầu trang. Cố ý để nhạt: nó không được tranh chỗ
   với nút "Đăng nhập", và cũng không liên quan tới nút hỗ trợ Messenger
   (#support-fab) đang nổi ở góc dưới bên phải. */
.fb-btn {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 44px;
  padding: 0 15px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.9375rem; font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease),
              background-color var(--t-fast) var(--ease);
}
.fb-btn:hover { color: var(--accent-ink); border-color: var(--border-strong); background: var(--surface-2); }

/* Màn hình hẹp: chỉ còn biểu tượng, chữ đã có trong aria-label. */
@media (max-width: 560px) {
  .fb-btn { width: 44px; padding: 0; justify-content: center; }
  .fb-btn-label { display: none; }
}

/* Thẻ mời góp ý ở cuối trang biên bản. Giữ thật nhạt — đây là lời mời,
   không phải quảng cáo: không màu nổi, chỉ có nét vàng mảnh sẵn của .card. */
.fb-card {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; flex-wrap: wrap;
  margin-top: 28px;
  padding: 26px 28px;
  box-shadow: var(--sh-xs);
}
.fb-card h3 { font-size: 1.0625rem; }
.fb-card .fb-card-text p { margin-top: 5px; }
.fb-card .btn { flex: none; }

@media (max-width: 560px) {
  .fb-card { padding: 20px; gap: 14px; }
  .fb-card .btn { width: 100%; }
}

/* Hộp thoại góp ý: rộng hơn hộp xác nhận một chút cho vừa ô nhập. */
.dialog-feedback { width: min(540px, 100%); }
.fb-text {
  width: 100%;
  margin-top: 14px;
  min-height: 132px;
  line-height: 1.55;
}
.fb-hint {
  margin-top: 9px;
  color: var(--warn);
  font-size: 0.875rem;
  font-weight: 600;
}
.fb-count {
  margin-top: 8px;
  text-align: right;
  color: var(--muted);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}


/* ------------------------------------------------------ Trang pháp lý ---- */

.legal { padding-block: clamp(32px, 5vw, 64px) 72px; color: var(--text-2); line-height: 1.75; }
.legal h1 { color: var(--text); font-size: clamp(1.9rem, 1.4rem + 2vw, 2.6rem); margin: 4px 0 6px; }
.legal h2 { color: var(--text); font-size: 1.3rem; margin: 44px 0 12px; padding-top: 20px;
            border-top: 1px solid var(--border); scroll-margin-top: 90px; }
.legal h3 { color: var(--text); font-size: 1.02rem; margin: 22px 0 6px; }
.legal p, .legal li { font-size: 1rem; }
.legal ul, .legal ol { padding-left: 1.25em; }
.legal li + li { margin-top: 6px; }
.legal a { color: var(--accent-ink); text-underline-offset: 3px; }
.legal code { font-size: .88em; padding: 1px 6px; border-radius: 6px; background: var(--surface-2); }
.legal-kicker { margin: 0; font-size: .8rem; font-weight: 700; letter-spacing: .08em;
                text-transform: uppercase; color: var(--gold); }
.legal-meta { margin: 0 0 26px; color: var(--muted); font-size: .92rem; }
.legal-summary { position: relative; padding: 20px 22px; border-radius: var(--r-lg);
                 background: var(--grad-lux-soft); border: 1px solid var(--border-gold); }
.legal-summary p { margin: 0 0 8px; color: var(--text); }
.legal-summary ul { margin: 0; }
.legal-toc { margin: 26px 0 0; padding: 16px 22px; border-radius: var(--r-md);
             background: var(--surface); border: 1px solid var(--border); }
.legal-toc ol { margin: 0; columns: 2; column-gap: 28px; }
.legal-toc li { font-size: .95rem; break-inside: avoid; }
.legal-toc a { text-decoration: none; }
.legal-toc a:hover { text-decoration: underline; }
.legal-table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: .95rem; }
.legal-table th, .legal-table td { text-align: left; vertical-align: top; padding: 10px 12px;
                                    border-bottom: 1px solid var(--border); }
.legal-table th { color: var(--text); font-weight: 700; background: var(--surface-2); }
.legal-foot { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--border);
              color: var(--muted); font-size: .95rem; }
@media (max-width: 560px) {
  .legal-toc ol { columns: 1; }
  .legal-table { font-size: .88rem; }
  .legal-table th, .legal-table td { padding: 8px; }
}
@media print {
  .app-header, .legal-toc { display: none; }
  .legal { padding: 0; color: #000; }
}
