/* W-settings screens: Tự động (TuDong, TuDongSua), Cài đặt (CaiDatGChat, AdminDuyet + other tabs), Kết nối Claude (KetNoi).
   Loaded on demand by js/screens/_wset.js (ensureCss). Uses only the tokens from tokens.css, so dark mode follows. */

/* ------------------------------------------------------------------ shared bits */
.ws-stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ws-stack.sm { gap: 12px; }
.ws-sec-title { font-size: 16px; line-height: 24px; font-weight: 600; color: var(--ink); }
.ws-sec-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.ws-sec-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 16px; }
.ws-sec-head .grow { flex: 1 1 360px; min-width: 0; }
.ws-muted { color: var(--muted); }
.ws-small { font-size: 12px; }
.ws-13 { font-size: 13px; }
.ws-ink { color: var(--ink); }
.ws-b { font-weight: 600; color: var(--ink); }
.ws-mono { font-family: var(--font-mono); font-size: 12.5px; }
.ws-nowrap { white-space: nowrap; }
.ws-hr { height: 1px; background: var(--border); border: 0; margin: 0; }
.ws-tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; background: var(--sunken); color: var(--muted-2); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.ws-tag.mono { font-family: var(--font-mono); font-weight: 500; }
.ws-foot-note { display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 12px 16px; border-radius: var(--r-card); background: var(--sunken); font-size: 13px; color: var(--muted-2); }
.ws-foot-note b { color: var(--ink); font-weight: 600; }
.ws-foot-note svg { flex: 0 0 auto; margin-top: 3px; }
.ws-callout { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; border-radius: 10px; font-size: 13px; line-height: 1.5; }
.ws-callout > svg { flex: 0 0 auto; margin-top: 2px; }
.ws-callout .grow { flex: 1 1 260px; min-width: 0; }
.ws-callout.warn { background: var(--warning-soft); color: var(--warning); }
.ws-callout.honey { background: var(--honey-soft); color: var(--honey-ink); border: 1px solid var(--honey-line); }
.ws-callout.info { background: var(--info-soft); color: var(--info); }
.ws-callout.ok { background: var(--success-soft); color: var(--success); }
.ws-callout.plain { background: var(--sunken); color: var(--muted-2); }
.ws-callout .btn-link { font-size: 13px; }
.ws-inline-warn { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--warning); }
.ws-inline-warn.td-oq, .ws-inline-warn.td-oq-sum { padding: 10px 12px; border-radius: var(--r-ctl); background: var(--warning-soft); }
.td-oq ul { margin: 4px 0 0; padding-left: 18px; color: var(--ink); display: flex; flex-direction: column; gap: 2px; }
.td-oq-sum .grow { color: var(--ink); }
.ws-inline-warn svg { flex: 0 0 auto; margin-top: 3px; }

/* switch with a visible label (uses .switch from app.css) */
.ws-switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); cursor: pointer; white-space: nowrap; }
.ws-switch.disabled { cursor: not-allowed; color: var(--muted); }
.ws-switch.disabled .switch input { cursor: not-allowed; border-style: dashed; opacity: .7; }

/* status / small pills reuse .pill; destination chips */
.ws-chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.ws-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 28px; padding: 0 10px; box-sizing: border-box;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 13px; color: var(--ink); white-space: nowrap;
}
.ws-chip > svg { flex: 0 0 auto; color: var(--muted-2); }
.ws-chip .k { color: var(--muted); }
.ws-chip .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ws-chip.off { border-style: dashed; color: var(--muted); }
.ws-chip .x { flex: 0 0 22px; width: 22px; height: 22px; margin-right: -6px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: transparent; color: var(--muted-2); padding: 0; cursor: pointer; }
.ws-chip .x:hover { background: var(--hover); color: var(--ink); }
.ws-chip .ini { flex: 0 0 20px; width: 20px; height: 20px; border-radius: 50%; background: var(--honey-soft); color: var(--honey-ink); font-size: 9.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }

/* fact grid (Việc / Gửi khi / Nguồn AI / Lần tới / Lần trước) */
.ws-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 24px; }
.ws-facts .f { min-width: 0; }
.ws-facts .k { font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--muted); }
.ws-facts .v { margin-top: 2px; font-size: 14px; color: var(--ink); overflow-wrap: anywhere; }
.ws-facts .v.muted { color: var(--muted); }
.ws-facts .v .pill { white-space: normal; height: auto; min-height: 24px; padding: 3px 10px; border-radius: 10px; line-height: 1.35; max-width: 100%; justify-content: flex-start; text-align: left; }

/* page head extras */
.ws-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.ws-crumbs a { color: var(--muted); text-decoration: none; }
.ws-crumbs a:hover { color: var(--ink); text-decoration: underline; }
.ws-crumbs b { color: var(--ink); font-weight: 600; }
.ws-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }

/* ------------------------------------------------------------------ Tự động: quick plan + schedule cards */
.ws-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 16px; }
.ws-quick .lead { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.ws-quick .input { flex: 1 1 320px; min-width: 0; }

.ws-sched { padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.ws-sched.off { background: var(--surface); }
.ws-sched-top { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 16px; }
.ws-sched-top .who { flex: 1 1 320px; min-width: 0; }
.ws-sched-top h2, .ws-sched-top h3 { font-size: 17px; line-height: 1.35; font-weight: 600; color: var(--ink); }
.ws-sched-top .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 4px; font-size: 13px; color: var(--muted); }
.ws-sched-top .meta b { color: var(--ink); font-weight: 600; }
.ws-sched-top .q { margin-top: 6px; font-size: 13px; color: var(--body); }
.ws-sched-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ws-sched-acts .sep { width: 1px; height: 24px; background: var(--border); margin: 0 4px; }
.ws-dest-row { display: flex; align-items: flex-start; gap: 12px; }
.ws-dest-row > .k { flex: 0 0 auto; padding-top: 4px; font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--muted); min-width: 64px; }

/* tab body intro line */
.ws-intro { font-size: 13px; color: var(--muted); }

/* alerts table extras */
.ws-rule-name b { display: block; color: var(--ink); font-weight: 600; font-size: 14px; }
.ws-rule-name .pill { margin-top: 4px; }
.ws-today b { display: block; color: var(--ink); font-weight: 600; }
.ws-today span { display: block; font-size: 12px; color: var(--muted); }
.tbl tr.ws-sel td { background: var(--honey-soft); }
.tbl tr.ws-sel td:first-child { box-shadow: inset 3px 0 0 var(--honey); }
.ws-row-acts { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.ws-tbl-mid td { vertical-align: middle; }
.ws-tbl-mid th, .ws-tbl-mid td { padding: 10px 14px; font-size: 13.5px; }

/* Google Chat card preview */
.ws-gc { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 14px 16px; display: flex; gap: 12px; min-width: 0; }
.ws-gc .av { flex: 0 0 auto; }
.ws-gc .gc-body { flex: 1 1 auto; min-width: 0; }
.ws-gc .gc-from { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.ws-gc .gc-from b { color: var(--ink); font-weight: 600; font-size: 13px; }
.ws-gc .gc-app { padding: 0 5px; border: 1px solid var(--border); border-radius: 4px; font-size: 10.5px; color: var(--muted-2); }
.ws-gc .gc-ttl { margin-top: 6px; font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.4; }
.ws-gc .gc-sub { font-size: 12px; color: var(--muted); }
.ws-gc .gsec { margin-top: 10px; }
.ws-gc .gsec h4 { font-size: 12px; font-weight: 600; color: var(--ink); letter-spacing: .01em; }
.ws-gc .gsec p { font-size: 13px; color: var(--body); white-space: pre-line; overflow-wrap: anywhere; }
.ws-gc .gsec ul { margin: 2px 0 0; padding-left: 18px; font-size: 13px; color: var(--body); }
.ws-gc .gsec .muted { color: var(--muted); font-size: 12px; }
.ws-gc .gbtns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ws-gc .gbtn { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 6px; font-size: 12.5px; font-weight: 600; color: var(--info); background: var(--surface); }
.ws-gc-space { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--bg); border-radius: 12px 12px 0 0; }
.ws-gc-space .sq { width: 26px; height: 26px; border-radius: 7px; background: var(--info-soft); color: var(--info); font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.ws-gc-space b { display: block; font-size: 13px; color: var(--ink); }
.ws-gc-space span { font-size: 11px; color: var(--muted); }
.ws-gc-frame { border: 1px solid var(--border); border-radius: 12px; background: var(--sunken); overflow: hidden; }
.ws-gc-frame .ws-gc { border: 0; border-radius: 0; background: var(--surface); margin: 10px; border: 1px solid var(--border); border-radius: 10px; }
.ws-preview-card { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.ws-preview-card .head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }

/* running / done task cards */
.ws-group-label { font-size: 13px; font-weight: 600; color: var(--muted-2); margin: 4px 0 -4px; }
.ws-run { padding: 16px 20px; display: flex; flex-direction: column; gap: 10px; }
.ws-run-top { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 16px; }
.ws-run-top .who { flex: 1 1 360px; min-width: 0; }
.ws-run-top h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; color: var(--ink); }
.ws-run-top .meta { margin-top: 2px; font-size: 13px; color: var(--muted); }
.ws-run .res { font-size: 14px; color: var(--body); }
.ws-progress-row { display: flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 600; color: var(--ink); }
.ws-progress-row .progress { max-width: none; flex: 1 1 auto; }
.ws-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--body); }
.ws-steps li { display: flex; align-items: center; gap: 8px; }
.ws-steps li .now { color: var(--info); font-weight: 600; font-size: 12.5px; }
.ws-steps li svg { flex: 0 0 auto; }
.ws-ok-txt { display: inline-flex; align-items: center; gap: 6px; color: var(--success); font-size: 13px; font-weight: 600; }

/* history filters */
.ws-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.ws-filter { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer; }
.ws-filter .n { font-weight: 500; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.ws-filter[aria-pressed="true"] { background: var(--primary-bg); border-color: var(--primary-bg); color: var(--primary-fg); }
.ws-filter[aria-pressed="true"] .n { color: var(--primary-fg); opacity: .8; }
.ws-hist-name .k { display: block; font-size: 12px; color: var(--muted); }
.ws-hist-name b { color: var(--ink); font-weight: 600; }
.ws-res { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.ws-res .line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.ws-res .err { color: var(--danger); }
.tbl tr.ws-err-row td { background: color-mix(in srgb, var(--danger-soft) 55%, var(--surface)); }

/* ------------------------------------------------------------------ editor (TuDongSua) */
.ws-edit { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.ws-edit-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ws-edit-side { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ws-step { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.ws-step-head { display: flex; align-items: flex-start; gap: 12px; }
.ws-step-head .n { flex: 0 0 24px; width: 24px; height: 24px; border-radius: 50%; background: var(--sunken); color: var(--ink); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; margin-top: 1px; }
.ws-step-head h2 { font-size: 16px; font-weight: 600; color: var(--ink); line-height: 1.4; }
.ws-step-head p { font-size: 13px; color: var(--muted); }
.ws-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.ws-opts.three { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.ws-opt {
  position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); cursor: pointer; color: var(--body); min-width: 0;
}
.ws-opt:hover { border-color: var(--border-strong); }
.ws-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.ws-opt .mark { flex: 0 0 18px; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; border: 1.5px solid var(--switch-off); display: inline-flex; align-items: center; justify-content: center; background: var(--surface); }
.ws-opt .mark::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); opacity: 0; }
.ws-opt.box .mark { border-radius: 5px; }
.ws-opt.box .mark::after { width: 10px; height: 6px; border-radius: 0; background: none; border-left: 2px solid var(--primary-fg); border-bottom: 2px solid var(--primary-fg); transform: translateY(-1px) rotate(-45deg); }
.ws-opt.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.ws-opt.box.on { box-shadow: none; }
.ws-opt.on .mark { border-color: var(--ink); }
.ws-opt.on .mark::after { opacity: 1; }
.ws-opt.box.on .mark { background: var(--primary-bg); border-color: var(--primary-bg); }
.ws-opt:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.ws-opt.dis { cursor: not-allowed; border-style: dashed; background: var(--bg); color: var(--muted); }
.ws-opt.dis .mark { border-style: dashed; }
.ws-opt .txt { min-width: 0; flex: 1 1 auto; }
.ws-opt .t { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-weight: 600; color: var(--ink); font-size: 14px; }
.ws-opt.dis .t { color: var(--muted); }
.ws-opt .d { margin-top: 2px; font-size: 13px; color: var(--muted); }
.ws-opt .tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.ws-tpl { padding: 12px 14px; border-radius: 10px; background: var(--sunken); font-size: 13px; color: var(--body); white-space: pre-wrap; overflow-wrap: anywhere; }
.ws-tpl .ph { font-family: var(--font-mono); font-size: 12px; padding: 0 4px; border-radius: 4px; background: var(--honey-soft); color: var(--honey-ink); }
/* "Tạo lại artifact" template card (schedule editor) */
.ws-art { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border: 1px solid var(--honey-line); border-radius: 12px; background: var(--honey-soft); }
.ws-art-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.ws-art-head .ico { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 9px; background: var(--surface); color: var(--honey-ink); flex: none; }
.ws-win-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.ws-win-row .select { flex: 1 1 280px; min-width: 0; max-width: 520px; }
.ws-win-x { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.ws-art-head .grow { min-width: 0; flex: 1 1 200px; display: flex; flex-direction: column; }
.ws-art-head b { color: var(--ink); font-size: 14px; overflow-wrap: anywhere; }
.ws-art-head .grow span { font-size: 12.5px; color: var(--muted-2); }
.ws-art-steps summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink); }
.ws-art-steps ol { margin: 8px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.ws-art-steps code { font-family: var(--font-mono); font-size: 11.5px; color: var(--body); overflow-wrap: anywhere; white-space: normal; }
/* SPEC 47.1: "Dùng artifact làm mẫu" picker */
.ws-pick { display: flex; flex-direction: column; gap: 2px; max-height: min(56vh, 460px); overflow-y: auto; }
.ws-pick-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent; text-align: left; cursor: pointer; font: inherit; color: var(--body); }
.ws-pick-row:hover, .ws-pick-row:focus-visible { background: var(--honey-soft); outline: none; }
.ws-pick-row .ico { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; background: var(--surface-2, var(--surface)); color: var(--honey-ink); flex: none; }
.ws-pick-row .grow { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.ws-pick-row b { color: var(--ink); font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.ws-pick-row .help { margin: 0; font-size: 12.5px; }
.ws-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 16px; }
.ws-row-field { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 16px; }
.ws-days { display: flex; flex-wrap: wrap; gap: 6px; }
.ws-day { min-width: 44px; height: 36px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer; }
.ws-day[aria-pressed="true"] { background: var(--primary-bg); border-color: var(--primary-bg); color: var(--primary-fg); }
.ws-next { display: flex; flex-wrap: wrap; gap: 6px; }
.ws-next span { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 12.5px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.ws-next span b { color: var(--ink); font-weight: 600; }
.ws-next span:first-child { background: var(--honey-soft); border-color: var(--honey-line); color: var(--honey-ink); }
.ws-next span:first-child b { color: var(--honey-ink); }
.ws-tz { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.ws-time { width: 140px; }
.ws-subhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.ws-subhead h3 { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--ink); }
.ws-subhead h3 svg { color: var(--muted-2); }
.ws-recips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); min-height: 44px; }
.ws-pick-pop { width: 320px; max-width: calc(100vw - 24px); padding: 8px; }
.ws-pick-pop .input { margin-bottom: 6px; }
.ws-pick-list { max-height: 260px; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.ws-pick-list .menu-item small { color: var(--muted); font-size: 12px; }
.ws-check-line { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); cursor: pointer; }
.ws-check-line input { width: 18px; height: 18px; accent-color: var(--primary-bg); margin: 0; }
.ws-check-line.dis { color: var(--muted); cursor: not-allowed; }
.ws-savebar {
  position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 10px; padding: 12px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow-float);
}
.ws-savebar .msg { margin-right: auto; font-size: 13px; color: var(--muted); }
.ws-savebar .msg.dirty { color: var(--warning); font-weight: 600; }
.ws-sum { padding: 16px 18px; }
.ws-sum h2 { font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.ws-sum dl { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 6px 10px; margin: 0; font-size: 13px; }
.ws-sum dt { color: var(--muted); }
.ws-sum dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.ws-pv { padding: 0; overflow: hidden; }
.ws-pv .pv-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 14px 18px 0; }
.ws-pv .pv-head h2 { font-size: 15px; font-weight: 600; color: var(--ink); }
.ws-pv .tabs { padding: 0 10px; margin-top: 6px; }
.ws-pv .pv-body { padding: 12px; background: var(--bg); display: flex; flex-direction: column; gap: 8px; max-height: 70vh; overflow: auto; }
.ws-pv .pv-foot { padding: 10px 18px 14px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--muted); }
.ws-pv .pv-foot .st { display: flex; align-items: flex-start; gap: 8px; color: var(--ink); font-weight: 600; }
.ws-post-pv { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding: 12px 14px; }
.ws-post-pv .md { font-size: 13px; }
.ws-post-pv .md h1 { font-size: 16px; }
.ws-post-pv .md h2 { font-size: 14px; }

/* ------------------------------------------------------------------ Cài đặt */
.ws-tbl-card { border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); overflow: hidden; }
.ws-tbl-card .tbl-wrap { border: 0; border-radius: 0; }
.ws-tbl-card .foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.ws-space-name { display: flex; align-items: center; gap: 10px; }
.ws-space-name .ico { flex: 0 0 28px; width: 28px; height: 28px; border-radius: 8px; background: var(--sunken); color: var(--muted-2); display: inline-flex; align-items: center; justify-content: center; }
.ws-space-name b { color: var(--ink); font-weight: 600; }
.ws-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.ws-group { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.ws-group .gh { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.ws-group .gh b { display: block; font-size: 15px; color: var(--ink); font-weight: 600; }
.ws-group .gh span { font-size: 12px; color: var(--muted); }
.ws-group ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--ink); }
.ws-group li { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ws-group li span.e { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-group .gf { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); display: flex; align-items: flex-start; gap: 6px; font-size: 12px; color: var(--muted); }
.ws-av { flex: 0 0 24px; width: 24px; height: 24px; border-radius: 50%; background: var(--honey-soft); color: var(--honey-ink); font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.ws-av.lg { flex-basis: 32px; width: 32px; height: 32px; font-size: 12px; }
.ws-av.plain { background: var(--sunken); color: var(--muted-2); }
.ws-add-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 180px; padding: 16px; border: 1.5px dashed var(--border-strong); border-radius: var(--r-card); background: transparent; color: var(--ink); cursor: pointer; text-align: center; }
.ws-add-tile:hover { background: var(--surface); }
.ws-add-tile .plus { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border-strong); display: inline-flex; align-items: center; justify-content: center; background: var(--surface); }
.ws-add-tile b { font-size: 14px; }
.ws-add-tile span { font-size: 12px; color: var(--muted); }
.ws-dashed { padding: 18px 20px; border: 1.5px dashed var(--border-strong); border-radius: var(--r-card); display: flex; gap: 14px; }
.ws-dashed .ico { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 10px; background: var(--sunken); color: var(--muted-2); display: inline-flex; align-items: center; justify-content: center; }
.ws-dashed h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: var(--ink); }
.ws-dashed p { margin-top: 4px; font-size: 13.5px; color: var(--body); max-width: 760px; }
.ws-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px 18px; }
.ws-form-grid .full { grid-column: 1 / -1; }
.ws-topic-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.ws-topic { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 500; cursor: pointer; }
.ws-topic[aria-pressed="true"] { background: var(--primary-bg); border-color: var(--primary-bg); color: var(--primary-fg); }
.ws-req { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; padding: 14px 20px; border-top: 1px solid var(--border); }
.ws-req .who { display: flex; gap: 12px; flex: 1 1 320px; min-width: 0; }
.ws-req .who b { color: var(--ink); font-weight: 600; }
.ws-req .who .e { color: var(--muted); font-size: 13px; }
.ws-req .who p { font-size: 13px; color: var(--body); }
.ws-req .who small { display: block; font-size: 12px; color: var(--muted); }
.ws-req .ctl { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.ws-req .ctl .field label { font-size: 12px; }
.ws-req .ctl .input, .ws-req .ctl .select { height: 36px; min-height: 36px; }
.ws-req-head { display: flex; align-items: flex-start; gap: 12px; padding: 14px 20px; background: var(--honey-soft); }
.ws-req-head .ico { flex: 0 0 32px; width: 32px; height: 32px; border-radius: 9px; background: var(--surface); color: var(--honey-ink); display: inline-flex; align-items: center; justify-content: center; }
.ws-req-head h2 { font-size: 15px; font-weight: 600; color: var(--ink); }
.ws-req-head p { font-size: 13px; color: var(--body); }
.ws-perms { display: flex; flex-direction: column; gap: 6px; }
.ws-perms .ws-switch { font-size: 12.5px; white-space: normal; }
.ws-src-pills { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.ws-user-cell { display: flex; gap: 10px; min-width: 0; }
.ws-user-cell b { color: var(--ink); font-weight: 600; }
.ws-user-cell .e { display: block; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.ws-users td { vertical-align: top; }
.ws-kv { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 8px 14px; margin: 0; font-size: 13.5px; }
.ws-kv dt { color: var(--muted); }
.ws-kv dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.ws-chk-row { display: flex; flex-wrap: wrap; gap: 6px; }
.ws-chk-pill { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); font-size: 13px; color: var(--ink); cursor: pointer; }
.ws-chk-pill input { margin: 0; accent-color: var(--primary-bg); }
.ws-chk-pill:has(input:checked) { border-color: var(--ink); }
.ws-chk-pill:has(input:disabled) { cursor: not-allowed; color: var(--muted); }
.ws-logbox { margin: 0; max-height: 260px; overflow: auto; padding: 10px 12px; border-radius: 8px; background: var(--sunken); font-family: var(--font-mono); font-size: 12px; line-height: 1.55; color: var(--body); white-space: pre-wrap; }
.ws-jobs { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.ws-job { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.ws-job b { font-size: 15px; color: var(--ink); }
.ws-job p { font-size: 13px; color: var(--muted); }
.ws-job .row { margin-top: auto; justify-content: space-between; }
.ws-search { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); flex: 1 1 260px; max-width: 420px; }
.ws-search input { flex: 1 1 auto; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 14px; color: var(--ink); outline: none; }
.ws-search:focus-within { outline: 2px solid var(--focus); border-color: transparent; }
.ws-detail { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted-2); max-width: 520px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-cr { padding: 14px 18px; display: flex; flex-direction: column; gap: 8px; }
.ws-cr + .ws-cr { border-top: 1px solid var(--border); }
.ws-cr .h { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.ws-cr .h b { color: var(--ink); }
.ws-cr .md { font-size: 13px; padding: 8px 12px; border-radius: 8px; background: var(--bg); }

/* ------------------------------------------------------------------ Kết nối */
.ws-src-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ws-src { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 16px 18px 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); min-width: 0; }
.ws-src.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.ws-src.dis { background: var(--bg); }
.ws-src-head { display: flex; align-items: center; gap: 10px; }
.ws-src-head label { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; color: var(--ink); font-size: 15px; cursor: pointer; min-width: 0; }
.ws-src-head input[type="radio"] { width: 18px; height: 18px; margin: 0; accent-color: var(--primary-bg); flex: 0 0 auto; }
.ws-src-head input[type="radio"]:disabled + span { color: var(--muted); }
.ws-src-head .using { margin-left: auto; }
.ws-src-body { padding-left: 28px; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; color: var(--body); }
.ws-src-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; font-size: 12.5px; color: var(--muted); }
.ws-key-row { display: flex; gap: 8px; }
.ws-key-row .input { flex: 1 1 auto; min-width: 0; font-family: var(--font-mono); font-size: 13px; }
.ws-bridge-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ws-bstep { position: relative; display: flex; gap: 14px; padding-bottom: 18px; }
.ws-bstep:last-child { padding-bottom: 0; }
.ws-bstep::before { content: ""; position: absolute; left: 13px; top: 30px; bottom: 2px; width: 2px; background: var(--border); }
.ws-bstep:last-child::before { display: none; }
.ws-bstep .num { flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--ink); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; position: relative; z-index: 1; }
.ws-bstep.done .num { border-color: var(--success); color: var(--success); background: var(--success-soft); }
.ws-bstep.cur .num { border-color: var(--honey); background: var(--honey-soft); color: var(--honey-ink); }
/* a step after the current one: still readable ahead of time, but nothing in it looks like the next thing to click */
.ws-bstep.locked .num { border-style: dashed; background: var(--sunken); color: var(--muted-2); }
.ws-bstep.locked .bh h3, .ws-bstep.locked .bh h3 small { color: var(--muted); }
.ws-bstep.locked .bd > :not(.bh):not(.kn-outdated) { opacity: .6; }
.ws-bstep.flash .num { animation: ws-bstep-flash 1.3s ease-out; }
@keyframes ws-bstep-flash { 0%, 45% { box-shadow: 0 0 0 6px var(--honey-soft); } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .ws-bstep.flash .num { animation: none; box-shadow: 0 0 0 4px var(--honey-soft); } }
.ws-bstep .bd { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.ws-bstep .bh { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.ws-bstep .bh h3 { font-size: 15px; font-weight: 600; color: var(--ink); }
.ws-bstep .bh h3 small { font-size: 12px; font-weight: 600; color: var(--honey-ink); margin-right: 6px; }
.ws-bstep p { font-size: 13.5px; color: var(--body); }
.ws-cmd { display: flex; align-items: flex-start; gap: 8px; padding: 10px 10px 10px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--sunken); }
.ws-cmd code, .ws-cmd pre { flex: 1 1 auto; min-width: 0; margin: 0; padding: 0; background: none; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.6; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.ws-cmd .btn { flex: 0 0 auto; }
.ws-live { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 14px; border-radius: 10px; font-size: 13px; }
.ws-live.on { background: var(--success-soft); color: var(--success); }
.ws-live.off { background: var(--sunken); color: var(--muted-2); }
.ws-live b { font-weight: 600; }
.ws-live .r { margin-left: auto; font-size: 12.5px; }
.ws-facts-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.ws-facts-list li { display: flex; align-items: flex-start; gap: 8px; }
.ws-facts-list svg { flex: 0 0 auto; margin-top: 3px; }
.ws-cols2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 20px; align-items: start; }
.ws-token-box { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border: 1px solid var(--honey-line); border-radius: 12px; background: var(--honey-soft); }
.ws-token-box .tk { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); }
.ws-token-box .tk code { flex: 1 1 auto; min-width: 0; font-family: var(--font-mono); font-size: 13px; color: var(--ink); overflow-wrap: anywhere; background: none; padding: 0; }
.ws-token-box p { font-size: 13px; color: var(--honey-ink); }
.ws-req-list { display: flex; flex-wrap: wrap; gap: 6px; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1180px) {
  .ws-edit { grid-template-columns: minmax(0, 1fr); }
  .ws-edit-side { position: static; }
}
@media (max-width: 760px) {
  .ws-sched, .ws-run, .ws-step, .ws-preview-card { padding: 14px 14px; }
  .ws-sched-acts { width: 100%; }
  .ws-sched-acts .sep { display: none; }
  .ws-dest-row { flex-direction: column; gap: 6px; }
  .ws-quick .lead { white-space: normal; }
  .ws-quick .btn { width: 100%; }
  .ws-kv { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .ws-kv dd { margin-bottom: 8px; }
  .ws-src-grid, .ws-cols2 { grid-template-columns: minmax(0, 1fr); }
  .ws-src-body { padding-left: 0; }
  .ws-req .ctl { width: 100%; }
  .ws-req .ctl .field { flex: 1 1 120px; min-width: 0; }
  .ws-req .ctl .field .input, .ws-req .ctl .field .select { width: 100% !important; }
  .ws-req .ctl .btn { flex: 1 1 auto; }
  .tbl.ws-tbl-mid { min-width: 820px; }
  .tbl.ws-users { min-width: 940px; }
  .ws-savebar { padding: 10px 12px; }
  .ws-savebar .msg { flex: 1 1 100%; }
  .ws-savebar .btn { flex: 1 1 auto; }
  .ws-opts, .ws-opts.three { grid-template-columns: minmax(0, 1fr); }
  .ws-time { width: 100%; }
  .ws-dashed { flex-direction: column; }
  .ws-gc { padding: 12px; }
  .ws-key-row { flex-wrap: wrap; }
  .ws-key-row .btn { flex: 1 1 auto; }
}
.ws-stack .field > .seg, .ws-step .field > .seg { align-self: flex-start; }
.ws-step .ws-stack > .seg { align-self: flex-start; }
.ws-users td:first-child { min-width: 230px; }
.ws-users td:nth-child(2) { min-width: 130px; }
.ws-users td:nth-child(3) { min-width: 190px; }
.ws-users td:nth-child(4) { min-width: 180px; }
.ws-src-pills .pill { white-space: normal; height: auto; min-height: 22px; padding-top: 2px; padding-bottom: 2px; line-height: 1.4; }
.ws-users td:first-child .e { overflow-wrap: normal; word-break: break-all; }
.ws-tbl-mid td:first-child { min-width: 150px; }
/* v1.5.1 Google Chat card preview: KPI tiles, links, primary button, data refresh destinations (tokens only) */
.ws-gc .gcols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 16px; margin-top: 8px; }
.ws-gc .gcol { min-width: 0; }
.ws-gc .gtile { display: flex; flex-direction: column; min-width: 0; margin-top: 4px; }
.ws-gc .gtile .tl { font-size: 11.5px; color: var(--muted); }
.ws-gc .gtile .tv { font-size: 15px; color: var(--ink); line-height: 1.35; overflow-wrap: anywhere; }
.ws-gc .gtile .tb { font-size: 11.5px; color: var(--muted); overflow-wrap: anywhere; }
.ws-gc .gsec p + p { margin-top: 4px; }
.ws-gc .gsec a { color: var(--info); text-decoration: underline; text-underline-offset: 2px; }
.ws-gc .gsec .gfoot { font-size: 12px; color: var(--muted); }
.ws-gc .gbtn.pri { background: var(--info); border-color: var(--info); color: var(--surface); }
.ws-gc .gdiv { border: 0; border-top: 1px solid var(--border); margin: 8px 0; }
.td-sys-dest { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.td-sys-dest b { color: var(--body); font-weight: 600; }
.td-dd-grid { display: flex; flex-direction: column; gap: 16px; }
.td-dd-sec h3 { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.td-dd-list { display: flex; flex-direction: column; gap: 6px; }
.td-dd-check { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--body); }
.td-dd-check input { margin-top: 3px; }
.td-dd-check small { display: block; color: var(--muted); font-size: 12px; }
.td-dd-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.td-dd-pick { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.td-dd-pick .menu-item { justify-content: flex-start; }
.td-dd-prev { display: flex; flex-direction: column; gap: 8px; }
.td-dd-verdict { font-size: 12.5px; color: var(--body); display: flex; align-items: flex-start; gap: 6px; }
.td-dd-verdict.no { color: var(--muted); }
@media (max-width: 760px) {
  .ws-gc .gcols { grid-template-columns: minmax(0, 1fr); }
}

/* ------------------------------------------------------------------ Bộ nhớ của AI (#/bo-nho) */
.mem-prefs { display: flex; flex-direction: column; gap: 14px; }
.mem-prefs .ws-switch { white-space: normal; align-items: flex-start; }
.mem-prefs .ws-switch .switch { margin-top: 2px; flex: 0 0 auto; }
.mem-note { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding-top: 12px; border-top: 1px solid var(--border); }
.mem-note > svg { flex: 0 0 auto; margin-top: 2px; }
.mem-add { display: flex; flex-wrap: wrap; gap: 8px; }
.mem-add .input { flex: 1 1 320px; min-width: 0; }
.mem-kind { flex: 0 0 auto; width: auto; min-width: 140px; }
.mem-tools { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.mem-search { position: relative; flex: 1 1 260px; min-width: 0; display: flex; align-items: center; }
.mem-search > svg { position: absolute; left: 10px; color: var(--muted); pointer-events: none; }
.mem-search .input { padding-left: 34px; width: 100%; }
.mem-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.mem-fchip { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--body); font: inherit; font-size: 13px; cursor: pointer; }
.mem-fchip .n { color: var(--muted); font-variant-numeric: tabular-nums; }
.mem-fchip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.mem-fchip[aria-pressed="true"] .n { color: inherit; opacity: .75; }
.mem-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); overflow: hidden; }
.mem-list .empty { border: 0; }
.mem-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-top: 1px solid var(--border); }
.mem-row:first-child { border-top: 0; }
.mem-row.off .mem-text { color: var(--muted); }
.mem-row.editing { background: var(--honey-soft); }
.mem-main { flex: 1 1 auto; min-width: 0; }
.mem-top { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.mem-unused { font-size: 12px; color: var(--muted); }
.mem-text { margin: 6px 0 4px; font-size: 14px; line-height: 1.5; color: var(--ink); overflow-wrap: anywhere; }
.mem-meta { font-size: 12px; color: var(--muted); }
.mem-acts { display: flex; gap: 2px; flex: 0 0 auto; opacity: .55; transition: opacity .12s; }
.mem-row:hover .mem-acts, .mem-row:focus-within .mem-acts { opacity: 1; }
@media (hover: none) { .mem-acts { opacity: 1; } }
.mem-delall { color: var(--danger); }

/* Google Chat space: "Ai được gửi" (post_access all / admins / some people & groups) */
.ws-access-btn { display: inline-flex; align-items: center; gap: 6px; max-width: 220px; height: 30px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--r-ctl); background: var(--surface); color: var(--body); font-size: 13px; cursor: pointer; }
.ws-access-btn:hover { border-color: var(--border-strong); }
.ws-access-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ws-access-btn span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-access-btn svg { flex: 0 0 auto; color: var(--muted); }
.ws-poster-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; align-items: center; }
.ws-tag.ws-chip-x { height: 26px; gap: 5px; padding: 0 4px 0 8px; font-size: 12.5px; font-weight: 500; color: var(--body); }
.ws-chip-x button { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); cursor: pointer; }
.ws-chip-x button:hover { background: var(--hover); color: var(--ink); }
.ws-chip-x button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
@media (max-width: 640px) { .ws-access-btn { max-width: 100%; height: 40px; } .ws-chip-x button { width: 28px; height: 28px; } }

.ws-tbl-mid .ws-space-name { min-width: 168px; }
.ws-tbl-mid .ws-space-name b { line-height: 1.3; }
.ws-topic-cell { flex-wrap: nowrap; }
