/* ============================================================
   OPUS ONE — COMPONENT STYLES
   ============================================================ */

/* ---------- Typography utilities ---------- */
.t-display { font-size: var(--fs-3xl); font-weight: var(--fw-bold); letter-spacing: -0.02em; line-height: var(--lh-tight); }
.t-h1 { font-size: var(--fs-2xl); font-weight: var(--fw-bold); letter-spacing: -0.018em; line-height: var(--lh-tight); }
.t-h2 { font-size: var(--fs-xl); font-weight: var(--fw-semibold); letter-spacing: -0.014em; line-height: var(--lh-snug); }
.t-h3 { font-size: var(--fs-lg); font-weight: var(--fw-semibold); letter-spacing: -0.01em; }
.t-body { font-size: var(--fs-base); font-weight: var(--fw-regular); }
.t-sm { font-size: var(--fs-sm); }
.t-xs { font-size: var(--fs-xs); }
.t-muted { color: var(--text-muted); }
.t-faint { color: var(--text-faint); }
.t-secondary { color: var(--text-secondary); }
.t-medium { font-weight: var(--fw-medium); }
.t-semibold { font-weight: var(--fw-semibold); }
.t-mono { font-family: var(--font-mono); font-feature-settings: "tnum" 1; letter-spacing: -0.01em; }
.t-eyebrow { font-size: var(--fs-xs); font-weight: var(--fw-semibold); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.t-num { font-variant-numeric: tabular-nums; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  height: 34px; padding: 0 var(--s4);
  border-radius: var(--r-md);
  font-size: var(--fs-sm); font-weight: var(--fw-medium);
  letter-spacing: -0.006em;
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
  border: 1px solid transparent;
  user-select: none;
}
.btn:active { transform: translateY(0.5px) scale(0.992); }
.btn svg { width: 15px; height: 15px; flex: none; }
.btn-sm { height: 28px; padding: 0 var(--s3); font-size: var(--fs-xs); border-radius: var(--r-sm); }
.btn-sm svg { width: 14px; height: 14px; }
.btn-lg { height: 40px; padding: 0 var(--s5); font-size: var(--fs-base); }

.btn-primary { background: var(--accent); color: var(--text-on-accent); font-weight: var(--fw-semibold); box-shadow: var(--shadow-xs); }
.btn-primary:hover { background: var(--accent-press); }
.btn-primary:active { background: var(--accent-press); }

.btn-secondary { background: var(--bg-elevated); color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-xs); }
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--border-strong); }

.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }

.btn-danger { background: var(--c-red); color: #fff; font-weight: var(--fw-semibold); }
.btn-danger:hover { filter: brightness(0.94); }
.btn-danger-soft { background: var(--c-red-bg); color: var(--c-red-fg); }
.btn-danger-soft:hover { filter: brightness(0.97); }

.btn-icon {
  width: 34px; height: 34px; padding: 0; border-radius: var(--r-md);
  color: var(--text-muted); background: transparent;
}
.btn-icon:hover { background: var(--bg-hover); color: var(--text); }
.btn-icon.sm { width: 28px; height: 28px; border-radius: var(--r-sm); }
.btn-icon.active { background: var(--accent-soft); color: var(--text); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }

/* ---------- Pills / Badges ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 9px;
  border-radius: var(--r-full);
  font-size: var(--fs-xs); font-weight: var(--fw-medium);
  letter-spacing: -0.003em; white-space: nowrap;
  border: 1px solid transparent;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.pill-sq { border-radius: var(--r-sm); }

.pill.slate  { background: var(--c-slate-bg);  color: var(--c-slate-fg); }
.pill.blue   { background: var(--c-blue-bg);   color: var(--c-blue-fg); }
.pill.amber  { background: var(--c-amber-bg);  color: var(--c-amber-fg); }
.pill.violet { background: var(--c-violet-bg); color: var(--c-violet-fg); }
.pill.green  { background: var(--c-green-bg);  color: var(--c-green-fg); }
.pill.red    { background: var(--c-red-bg);    color: var(--c-red-fg); }
.pill.teal   { background: var(--c-teal-bg);   color: var(--c-teal-fg); }
.pill.rose   { background: var(--c-rose-bg);   color: var(--c-rose-fg); }
.pill.neutral{ background: var(--bg-sunken);   color: var(--text-secondary); border-color: var(--border); }

.pill.slate .dot  { background: var(--c-slate); }
.pill.blue .dot   { background: var(--c-blue); }
.pill.amber .dot  { background: var(--c-amber); }
.pill.violet .dot { background: var(--c-violet); }
.pill.green .dot  { background: var(--c-green); }
.pill.red .dot    { background: var(--c-red); }
.pill.teal .dot   { background: var(--c-teal); }
.pill.rose .dot   { background: var(--c-rose); }
.pill.neutral .dot{ background: var(--text-faint); }

/* outline priority pills */
.pill.outline { background: transparent; border-color: currentColor; opacity: 0.95; }

/* count bubble */
.count-bubble {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--r-full);
  background: var(--bg-active); color: var(--text-secondary);
  font-size: var(--fs-micro); font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;
}
.count-bubble.accent { background: var(--accent); color: var(--text-on-accent); }
.count-bubble.red { background: var(--c-red); color: #fff; }

/* status dot (bare) */
.sdot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.sdot.ring { box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent); }

/* ---------- Avatars ---------- */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  font-size: var(--fs-xs); font-weight: var(--fw-semibold);
  color: #fff; flex: none; letter-spacing: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
  user-select: none;
}
.avatar.xs { width: 20px; height: 20px; font-size: 9px; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.avatar.lg { width: 36px; height: 36px; font-size: var(--fs-sm); }
.avatar.xl { width: 48px; height: 48px; font-size: var(--fs-lg); }
.avatar.role-admin { background: #161616; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18); }
.avatar.role-pm { background: var(--role-pm); }
.avatar.role-consultant { background: var(--role-consultant); }
.avatar.role-sales { background: var(--role-sales); }
.avatar.role-client { background: var(--role-client); }
.avatar.role-observer { background: var(--role-observer); }

.avatar-stack { display: inline-flex; align-items: center; }
.avatar-stack > * { margin-left: -7px; box-shadow: 0 0 0 2px var(--bg-elevated), inset 0 0 0 1px rgba(255,255,255,0.12); }
.avatar-stack > *:first-child { margin-left: 0; }
.avatar-stack .more {
  background: var(--bg-sunken); color: var(--text-muted);
  box-shadow: 0 0 0 2px var(--bg-elevated);
}

/* ---------- Inputs ---------- */
.field-label { display: block; font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--text-secondary); margin-bottom: 6px; }
.input, .select, .textarea {
  width: 100%; height: 34px; padding: 0 var(--s3);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  color: var(--text); font-size: var(--fs-sm);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.textarea { height: auto; min-height: 76px; padding: var(--s2) var(--s3); resize: vertical; line-height: var(--lh-normal); }
.input-group { position: relative; display: flex; align-items: center; }
.input-group .lead-icon { position: absolute; left: 10px; width: 15px; height: 15px; color: var(--text-faint); pointer-events: none; }
.input-group .input { padding-left: 32px; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236B6B72' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  padding-right: 30px;
}

/* search field (topbar) */
.searchbar {
  display: flex; align-items: center; gap: var(--s2);
  height: 34px; padding: 0 10px; min-width: 240px;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-muted); font-size: var(--fs-sm);
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.searchbar:hover { border-color: var(--border-strong); }
.searchbar svg { width: 15px; height: 15px; flex: none; }
.searchbar .kbd { margin-left: auto; }
.kbd {
  display: inline-flex; align-items: center; gap: 1px;
  padding: 1px 5px; height: 18px;
  border-radius: var(--r-xs);
  background: var(--bg-elevated); border: 1px solid var(--border);
  font-family: var(--font-sans); font-size: var(--fs-micro); font-weight: var(--fw-medium);
  color: var(--text-muted);
}

/* checkbox */
.check {
  appearance: none; width: 16px; height: 16px; flex: none;
  border: 1.5px solid var(--border-strong); border-radius: var(--r-xs);
  background: var(--bg-elevated); position: relative; cursor: pointer;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.check:checked { background: var(--accent); border-color: var(--accent); }
.check:checked::after {
  content: ""; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23161616' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 12px no-repeat;
}

/* toggle switch */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; vertical-align: middle; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch .track {
  position: absolute; inset: 0; border-radius: 999px;
  background: var(--bg-active);
  box-shadow: inset 0 0 0 1.5px var(--border-strong);
  transition: background var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.switch .thumb {
  position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(20,20,22,0.28), 0 0 0 0.5px rgba(20,20,22,0.10);
  transition: transform var(--dur) var(--ease);
}
.switch input:checked + .track { background: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent-press); }
.switch input:checked ~ .thumb { transform: translateX(18px); }
.switch input:focus-visible + .track { box-shadow: inset 0 0 0 1.5px var(--border-strong), 0 0 0 3px var(--focus-ring); }
.switch input:checked:focus-visible + .track { box-shadow: inset 0 0 0 1.5px var(--accent-press), 0 0 0 3px var(--accent-ring); }
[data-theme="dark"] .switch .thumb { background: #F4F4F3; box-shadow: 0 1px 3px rgba(0,0,0,0.6); }
[data-theme="dark"] .switch input:checked ~ .thumb { background: #fff; }

/* segmented control */
.segmented {
  display: inline-flex; padding: 2px; gap: 2px;
  background: var(--bg-sunken); border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.segmented button {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 10px; border-radius: var(--r-sm);
  font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--text-muted);
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.segmented button svg { width: 14px; height: 14px; }
.segmented button:hover { color: var(--text); }
.segmented button.active { background: var(--bg-elevated); color: var(--text); box-shadow: var(--shadow-xs); }

/* filter chip */
.chip {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  height: 30px; padding: 0 10px; border-radius: var(--r-md);
  background: var(--bg-elevated); border: 1px solid var(--border-strong);
  font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--text-secondary);
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.chip svg { width: 14px; height: 14px; color: var(--text-muted); }
.chip:hover { background: var(--bg-hover); border-color: var(--border-strong); color: var(--text); }
.chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.chip.active svg { color: var(--text); }
.chip .chip-x { margin-left: 2px; opacity: 0.6; }
.chip .chip-x:hover { opacity: 1; }
.chip.dashed { border-style: dashed; background: transparent; }

/* ---------- Cards ---------- */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xs);
}
.card-pad { padding: var(--s5); }
.card-hover { transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease); }
.card-hover:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }

/* KPI card */
.kpi { display: flex; flex-direction: column; gap: var(--s3); padding: var(--s5); }
.kpi-head { display: flex; align-items: center; justify-content: space-between; }
.kpi-icon {
  width: 32px; height: 32px; border-radius: var(--r-md);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-sunken); color: var(--text-muted);
}
.kpi-icon svg { width: 17px; height: 17px; }
.kpi-value { font-size: var(--fs-3xl); font-weight: var(--fw-bold); letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi-label { font-size: var(--fs-sm); color: var(--text-muted); }
.kpi-delta { display: inline-flex; align-items: center; gap: 3px; font-size: var(--fs-xs); font-weight: var(--fw-medium); }
.kpi-delta.up { color: var(--c-green-fg); }
.kpi-delta.down { color: var(--c-red-fg); }
.kpi-delta svg { width: 13px; height: 13px; }

/* ---------- Tables ---------- */
.table-wrap { width: 100%; overflow: auto; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-sm); }
.tbl thead th {
  position: sticky; top: 0; z-index: 1;
  text-align: left; padding: 9px var(--s3);
  font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--text-muted);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  white-space: nowrap; user-select: none;
}
.tbl thead th.sortable { cursor: pointer; }
.tbl thead th.sortable:hover { color: var(--text); }
.tbl thead th .th-in { display: inline-flex; align-items: center; gap: 4px; }
.tbl thead th .sort-ic { width: 13px; height: 13px; opacity: 0; transition: opacity var(--dur-fast); }
.tbl thead th.sorted .sort-ic, .tbl thead th.sortable:hover .sort-ic { opacity: 0.7; }
.tbl tbody td { padding: 0 var(--s3); height: 44px; border-bottom: 1px solid var(--border-subtle); vertical-align: middle; color: var(--text-secondary); }
.tbl tbody tr { transition: background var(--dur-fast) var(--ease); }
.tbl tbody tr:hover { background: var(--bg-hover); }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl .cell-strong { color: var(--text); font-weight: var(--fw-medium); }
.tbl .row-actions { display: flex; align-items: center; gap: 2px; opacity: 0; transition: opacity var(--dur-fast); }
.tbl tbody tr:hover .row-actions { opacity: 1; }
.tbl.dense tbody td { height: 36px; }

/* ---------- Progress ---------- */
.progress { width: 100%; height: 6px; border-radius: 999px; background: var(--bg-active); overflow: hidden; }
.progress .bar { height: 100%; border-radius: 999px; background: var(--text); transition: width var(--dur-slow) var(--ease); }
.progress .bar.green { background: var(--c-green); }
.progress .bar.blue { background: var(--c-blue); }
.progress .bar.amber { background: var(--c-amber); }
.progress .bar.accent { background: var(--accent); }
.progress.thin { height: 4px; }

.progress-inline { display: flex; align-items: center; gap: var(--s2); }
.progress-inline .progress { flex: 1; }
.progress-inline .pct { font-size: var(--fs-xs); color: var(--text-muted); font-variant-numeric: tabular-nums; min-width: 30px; text-align: right; }

/* ---------- Tabs ---------- */
.tabs { display: flex; align-items: center; gap: 2px; border-bottom: 1px solid var(--border); }
.tabs.no-border { border-bottom: none; }
.tab {
  position: relative; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  height: 38px; padding: 0 12px; margin-bottom: -1px;
  font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: color var(--dur-fast) var(--ease);
}
.tab svg { width: 15px; height: 15px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); font-weight: var(--fw-semibold); }
.tab .count-bubble { height: 16px; min-width: 16px; }

/* ---------- Tooltip ---------- */
.tip { position: relative; display: inline-flex; }
.tip-bubble {
  position: absolute; bottom: calc(100% + 7px); left: 50%; transform: translateX(-50%) translateY(2px);
  background: var(--brand-charcoal); color: #F4F4F3;
  padding: 5px 8px; border-radius: var(--r-sm);
  font-size: var(--fs-xs); font-weight: var(--fw-medium); white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity var(--dur-fast), transform var(--dur-fast);
  z-index: 60; box-shadow: var(--shadow-md);
}
[data-theme="dark"] .tip-bubble { background: #2A2A2D; border: 1px solid var(--border-strong); }
.tip:hover .tip-bubble { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Toasts ---------- */
.toast-stack { position: fixed; bottom: var(--s5); right: var(--s5); z-index: 200; display: flex; flex-direction: column; gap: var(--s2); width: 340px; }
.toast {
  display: flex; align-items: flex-start; gap: var(--s3);
  padding: 12px 14px; border-radius: var(--r-lg);
  background: var(--bg-elevated); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  animation: toastIn var(--dur-slow) var(--ease-out);
}
.toast.out { animation: toastOut var(--dur) var(--ease) forwards; }
.toast .t-ic { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.toast.success .t-ic { color: var(--c-green); }
.toast.error .t-ic { color: var(--c-red); }
.toast.info .t-ic { color: var(--c-blue); }
.toast.warning .t-ic { color: var(--c-amber); }
.toast .t-body { flex: 1; min-width: 0; }
.toast .t-title { font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.toast .t-msg { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 1px; }
.toast .t-close { color: var(--text-faint); width: 22px; height: 22px; border-radius: var(--r-sm); display: inline-flex; align-items: center; justify-content: center; }
.toast .t-close:hover { background: var(--bg-hover); color: var(--text); }
@keyframes toastIn { from { opacity: 0; transform: translateX(16px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(16px) scale(0.98); } }

/* ---------- Skeleton ---------- */
.sk { background: linear-gradient(90deg, var(--bg-sunken) 25%, var(--bg-hover) 37%, var(--bg-sunken) 63%); background-size: 400% 100%; animation: skshimmer 1.4s ease infinite; border-radius: var(--r-sm); }
@keyframes skshimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.sk-line { height: 10px; }
.sk-circle { border-radius: 50%; }

/* ---------- Empty state ---------- */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: var(--s12) var(--s6); gap: var(--s3); }
.empty .e-ic { width: 44px; height: 44px; border-radius: var(--r-xl); display: inline-flex; align-items: center; justify-content: center; background: var(--bg-sunken); color: var(--text-faint); }
.empty .e-ic svg { width: 22px; height: 22px; }
.empty .e-title { font-size: var(--fs-base); font-weight: var(--fw-semibold); }
.empty .e-msg { font-size: var(--fs-sm); color: var(--text-muted); max-width: 320px; }

/* ---------- Drawer ---------- */
.scrim { position: fixed; inset: 0; background: rgba(10,10,12,0.32); z-index: 150; opacity: 0; transition: opacity var(--dur) var(--ease); backdrop-filter: blur(1.5px); }
.scrim.show { opacity: 1; }
[data-theme="dark"] .scrim { background: rgba(0,0,0,0.55); }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 160;
  width: 560px; max-width: 94vw;
  background: var(--bg-elevated);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-drawer);
  transform: translateX(100%); transition: transform var(--dur-slow) var(--ease);
  display: flex; flex-direction: column;
}
.drawer.show { transform: none; }
.drawer.wide { width: 640px; }

/* ---------- Modal ---------- */
.modal-scrim { position: fixed; inset: 0; z-index: 170; display: flex; align-items: center; justify-content: center; padding: var(--s6);
  background: rgba(10,10,12,0.38); opacity: 0; transition: opacity var(--dur) var(--ease); backdrop-filter: blur(2px); }
.modal-scrim.show { opacity: 1; }
[data-theme="dark"] .modal-scrim { background: rgba(0,0,0,0.6); }
.modal {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--r-2xl); box-shadow: var(--shadow-xl);
  width: 100%; display: flex; flex-direction: column; max-height: 88vh;
  transform: translateY(8px) scale(0.985); opacity: 0; transition: transform var(--dur-slow) var(--ease-out), opacity var(--dur) var(--ease);
}
.modal-scrim.show .modal { transform: none; opacity: 1; }
.modal.sm { max-width: 440px; }
.modal.lg { max-width: 680px; }
.modal.xl { max-width: 920px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s4); padding: var(--s5) var(--s6); border-bottom: 1px solid var(--border); }
.modal-body { padding: var(--s6); overflow: auto; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: var(--s2); padding: var(--s4) var(--s6); border-top: 1px solid var(--border); }

/* ---------- Activity timeline ---------- */
.timeline { display: flex; flex-direction: column; }
.tl-item { display: grid; grid-template-columns: 28px 1fr; gap: var(--s3); padding-bottom: var(--s4); position: relative; }
.tl-item:not(:last-child)::before { content: ""; position: absolute; left: 13px; top: 26px; bottom: -2px; width: 1.5px; background: var(--border); }
.tl-dot { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--bg-sunken); border: 1px solid var(--border); z-index: 1; }
.tl-dot svg { width: 14px; height: 14px; color: var(--text-muted); }
.tl-body { padding-top: 4px; }
.tl-text { font-size: var(--fs-sm); color: var(--text-secondary); }
.tl-text strong { color: var(--text); font-weight: var(--fw-semibold); }
.tl-time { font-size: var(--fs-xs); color: var(--text-faint); margin-top: 2px; }

/* ---------- Dropdown / menu ---------- */
.menu {
  min-width: 200px; padding: var(--s1);
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  animation: menuIn var(--dur-fast) var(--ease-out);
}
@keyframes menuIn { from { opacity: 0; transform: translateY(-4px) scale(0.98); } to { opacity: 1; transform: none; } }
.menu-item {
  display: flex; align-items: center; gap: var(--s3); width: 100%;
  padding: 7px 9px; border-radius: var(--r-sm);
  font-size: var(--fs-sm); color: var(--text-secondary); text-align: left;
}
.menu-item svg { width: 15px; height: 15px; color: var(--text-muted); flex: none; }
.menu-item:hover { background: var(--bg-hover); color: var(--text); }
.menu-item:hover svg { color: var(--text); }
.menu-item.danger { color: var(--c-red-fg); }
.menu-item.danger svg { color: var(--c-red-fg); }
.menu-item.danger:hover { background: var(--c-red-bg); }
.menu-sep { height: 1px; background: var(--border); margin: var(--s1) 0; }
.menu-label { padding: 6px 9px 4px; font-size: var(--fs-micro); font-weight: var(--fw-semibold); text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); }

/* ---------- Misc ---------- */
.divider { height: 1px; background: var(--border); }
.divider-v { width: 1px; align-self: stretch; background: var(--border); }
.hairline-top { border-top: 1px solid var(--border); }
.section-label { font-size: var(--fs-xs); font-weight: var(--fw-semibold); text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); }
.surface-sunken { background: var(--bg-sunken); }

.banner-maint {
  display: flex; align-items: center; gap: var(--s2); justify-content: center;
  height: 32px; font-size: var(--fs-xs); font-weight: var(--fw-medium);
  background: var(--accent-soft); color: var(--text);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
}
.banner-maint svg { width: 14px; height: 14px; }

/* file upload zone */
.upload-zone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s2);
  padding: var(--s8) var(--s6); text-align: center;
  border: 1.5px dashed var(--border-strong); border-radius: var(--r-xl);
  background: var(--bg-sunken); color: var(--text-muted);
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.upload-zone:hover { border-color: var(--accent); background: var(--accent-soft); }
.upload-zone .u-ic { width: 38px; height: 38px; border-radius: var(--r-lg); display: flex; align-items: center; justify-content: center; background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-muted); }

/* mention chip */
.mention { display: inline-flex; align-items: center; padding: 1px 6px; border-radius: var(--r-sm); background: var(--accent-soft); color: var(--text); font-weight: var(--fw-medium); }
[data-theme="dark"] .mention { background: var(--accent-soft); color: var(--accent); }

/* view-only badge */
.viewonly { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: var(--r-full); background: var(--bg-sunken); border: 1px solid var(--border); color: var(--text-muted); font-size: var(--fs-xs); font-weight: var(--fw-medium); }
.viewonly svg { width: 12px; height: 12px; }
