:root {
  --bg: #f5f6f8; --surface: #fff; --surface-2: #f8f9fb; --fg: #1d2129; --muted: #6b7280; --faint: #9aa1ad;
  --line: #e5e7eb; --line-strong: #d1d5db; --hover: #f2f4f7; --sel: #eef3ff;
  --accent: #3370ff; --accent-hover: #2860e6; --accent-soft: #e8efff; --accent-fg: #fff;
  --ok: #16a34a; --ok-soft: #e7f6ec; --warn: #b45309; --warn-soft: #fdf3e2; --err: #dc2626; --err-soft: #fdecec;
  --radius: 12px; --shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
  --shadow-lg: 0 10px 30px rgba(16,24,40,.12);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317; --surface: #1a1d23; --surface-2: #16181d; --fg: #e6e8eb; --muted: #9aa1ad; --faint: #6b7280;
    --line: #2a2e36; --line-strong: #3a3f49; --hover: #22262d; --sel: #1d2840;
    --accent: #5b8cff; --accent-hover: #74a0ff; --accent-soft: #1d2840;
    --ok: #4ade80; --ok-soft: #13291c; --warn: #fbbf24; --warn-soft: #2d2410; --err: #f87171; --err-soft: #2f1717;
    --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-lg: 0 10px 30px rgba(0,0,0,.5);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); min-height: 100vh;
  font: 14.5px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }
a { color: var(--accent); }
button { font: inherit; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 24px; background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand b { display: block; font-size: 16px; letter-spacing: -.01em; }
.brand small { display: block; font-size: 12px; color: var(--muted); margin-top: -2px; }
.logo svg { width: 30px; height: 30px; display: block; }
.logo rect { fill: var(--accent); }
.logo path { stroke: #fff; stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.account { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.ws { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--surface); max-width: 260px; }
.ws-ico { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; background: var(--surface-2);
  overflow: hidden; flex: none; font-size: 14px; }
.ws-ico img { width: 100%; height: 100%; object-fit: cover; }
.ws-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: none; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 14px;
  border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--fg);
  cursor: pointer; text-decoration: none; font-weight: 500; transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); box-shadow: 0 1px 2px rgba(51,112,255,.3); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--hover); color: var(--fg); }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 7px; }
.btn.lg { padding: 11px 20px; font-size: 15px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.spin { display: inline-block; flex: none; }
.btn .spin { width: 15px; height: 15px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.n-mark { width: 22px; height: 22px; border-radius: 5px; background: #fff; color: #000; font: 700 14px/22px Georgia, serif; text-align: center; }

/* ---------- landing ---------- */
.landing { max-width: 960px; margin: 0 auto; padding: 56px 20px 64px; }
.hero { text-align: center; max-width: 640px; margin: 0 auto 44px; }
.hero h1 { font-size: clamp(28px, 5vw, 40px); line-height: 1.2; letter-spacing: -.02em; margin: 0 0 14px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.lead { font-size: 16.5px; color: var(--muted); margin: 0 0 28px; }
.hint { margin-top: 16px; font-size: 13px; color: var(--warn); background: var(--warn-soft); display: inline-block; padding: 6px 12px; border-radius: 8px; }
.steps { list-style: none; padding: 0; margin: 0 0 40px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; counter-reset: s; }
.steps li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px;
  display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); position: relative; }
.steps li::after { counter-increment: s; content: counter(s); position: absolute; top: 14px; right: 16px; color: var(--faint); font-weight: 600; font-size: 13px; }
.steps b { font-size: 14.5px; }
.steps span:last-child { color: var(--muted); font-size: 13px; }
.step-ico { font-size: 22px; margin-bottom: 6px; }
.mapping { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
.mapping h2 { font-size: 15px; margin: 0 0 14px; }
.map-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 28px; }
.map-grid div { display: grid; grid-template-columns: 24px 1fr 18px 1fr; align-items: center; gap: 6px; font-size: 13.5px; }
.map-grid i { color: var(--faint); font-style: normal; }
.map-grid div span:last-child { font-weight: 500; }

/* ---------- workspace ---------- */
.workspace { max-width: 1240px; margin: 0 auto; padding: 24px; display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.panel h2 { font-size: 15.5px; margin: 0; display: flex; align-items: center; gap: 10px; }
.panel > h2 { margin-bottom: 14px; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.sub { margin: 4px 0 0 34px; color: var(--muted); font-size: 13px; }
.num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: var(--accent-soft);
  color: var(--accent); font-size: 12.5px; font-weight: 700; flex: none; }
.side { display: grid; gap: 16px; position: sticky; top: 76px; }
.picker { display: flex; flex-direction: column; min-height: calc(100vh - 120px); }

.toolbar { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.search { flex: 1 1 220px; position: relative; }
.search svg { position: absolute; left: 10px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%);
  stroke: var(--faint); fill: none; stroke-width: 2; stroke-linecap: round; }
.search input[type=search] { padding-left: 34px; }
.seg { display: flex; gap: 2px; }
input[type=search], input:not([type]), input[type=password] {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--surface); color: var(--fg); font: inherit; transition: border-color .15s, box-shadow .15s; }
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- tree ---------- */
.tree { flex: 1; min-height: 280px; max-height: calc(100vh - 290px); overflow: auto; border: 1px solid var(--line);
  border-radius: 10px; padding: 6px; background: var(--surface-2); }
.tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul ul { padding-left: 22px; position: relative; }
.tree ul ul::before { content: ""; position: absolute; left: 13px; top: 0; bottom: 6px; border-left: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 4px; height: 34px; padding: 0 8px 0 2px; border-radius: 7px; cursor: pointer; user-select: none; }
.row:hover { background: var(--hover); }
.row.on { background: var(--sel); }
.caret { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 5px; color: var(--faint); flex: none; border: 0; background: none; padding: 0; cursor: pointer; }
.caret:hover { background: var(--line); color: var(--fg); }
.caret svg { width: 12px; height: 12px; transition: transform .15s; stroke: currentColor; stroke-width: 2.4; fill: none; }
li:not(.collapsed) > .row .caret svg { transform: rotate(90deg); }
.caret.leaf { visibility: hidden; }
li.collapsed > ul { display: none; }
.row input[type=checkbox] { width: 16px; height: 16px; margin: 0 6px 0 2px; accent-color: var(--accent); flex: none; cursor: pointer; }
.row .ico { width: 20px; text-align: center; flex: none; }
.row .title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .title mark { background: #ffe58f; color: inherit; border-radius: 2px; padding: 0 1px; }
@media (prefers-color-scheme: dark) { .row .title mark { background: #6b5200; } }
.row .tag { font-size: 11px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 0 6px; line-height: 18px; flex: none; }
.row .cnt { font-size: 11.5px; color: var(--faint); flex: none; }
.row .open { opacity: 0; color: var(--faint); flex: none; padding: 2px 4px; border-radius: 4px; text-decoration: none; font-size: 12px; }
.row:hover .open { opacity: 1; }
.row .open:hover { background: var(--line); color: var(--fg); }
.row.inherited { color: var(--muted); }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty .big { font-size: 34px; display: block; margin-bottom: 8px; }
.skeleton { height: 30px; margin: 4px 6px; border-radius: 6px;
  background: linear-gradient(90deg, var(--hover) 25%, var(--line) 37%, var(--hover) 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.foot { margin: 10px 2px 0; font-size: 12.5px; color: var(--muted); }

/* ---------- fields ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-weight: 500; font-size: 13.5px; margin-bottom: 6px; }
.field-msg { display: block; margin-top: 6px; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.field-msg.ok { color: var(--ok); } .field-msg.err { color: var(--err); }
.input-wrap { position: relative; }
.input-wrap input { padding-right: 36px; }
.input-state { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 15px; display: grid; place-items: center; }
.input-state .spin { width: 15px; height: 15px; border: 2px solid var(--faint); border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.input-wrap.valid input { border-color: var(--ok); }
.input-wrap.invalid input { border-color: var(--err); }
.adv { border-top: 1px dashed var(--line); padding-top: 12px; }
.adv summary { cursor: pointer; font-size: 13px; color: var(--muted); list-style: none; display: flex; align-items: center; gap: 6px; user-select: none; }
.adv summary::before { content: "›"; display: inline-block; transition: transform .15s; font-size: 16px; line-height: 1; }
.adv[open] summary::before { transform: rotate(90deg); }
.adv summary::-webkit-details-marker { display: none; }
.adv[open] summary { margin-bottom: 12px; }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 34px; height: 20px; border-radius: 999px; background: var(--line-strong); position: relative; flex: none; transition: background .15s; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(14px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- selection summary ---------- */
.sel-summary { margin-bottom: 14px; }
.sel-empty { color: var(--muted); font-size: 13px; padding: 14px; border: 1px dashed var(--line-strong); border-radius: 10px; text-align: center; }
.sel-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.sel-head b { color: var(--fg); }
.link-btn { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0; font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 132px; overflow: auto; }
.chip { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 3px 4px 3px 9px; border-radius: 999px;
  background: var(--accent-soft); color: var(--fg); font-size: 12.5px; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 210px; }
.chip button { border: 0; background: none; color: var(--muted); cursor: pointer; width: 18px; height: 18px; border-radius: 50%; padding: 0; line-height: 18px; }
.chip button:hover { background: var(--line-strong); color: var(--fg); }

/* ---------- progress ---------- */
.progress { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.prog-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.badge-status { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; padding: 3px 10px; border-radius: 999px; }
.badge-status.running { background: var(--accent-soft); color: var(--accent); }
.badge-status.done { background: var(--ok-soft); color: var(--ok); }
.badge-status.warn { background: var(--warn-soft); color: var(--warn); }
.badge-status.error { background: var(--err-soft); color: var(--err); }
.badge-status .spin { width: 11px; height: 11px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.stats { font-size: 12.5px; color: var(--muted); }
.bar { height: 4px; background: var(--hover); border-radius: 4px; overflow: hidden; margin-bottom: 12px; }
.bar span { display: block; height: 100%; width: 30%; background: var(--accent); border-radius: 4px; }
.bar.indeterminate span { animation: slide 1.2s ease-in-out infinite; }
.bar.full span { width: 100%; }
.bar.full.error span { background: var(--err); }
.bar.full.warn span { background: var(--warn); }
.bar.full.done span { background: var(--ok); }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(340%); } }
.created { list-style: none; margin: 0 0 10px; padding: 0; max-height: 260px; overflow: auto; display: grid; gap: 2px; }
.created li a, .created li span.na { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; color: var(--fg); text-decoration: none; font-size: 13.5px; }
.created li a:hover { background: var(--hover); }
.created li a .t, .created li .na .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.created li a .ext { color: var(--faint); font-size: 12px; }
.created li.new { animation: pop .35s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }
.log-wrap summary { cursor: pointer; font-size: 12.5px; color: var(--muted); user-select: none; }
.log { font: 12px/1.65 ui-monospace, SFMono-Regular, Menlo, monospace; max-height: 220px; overflow: auto; margin: 8px 0 0;
  padding: 8px 10px; list-style: none; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; }
.log li { white-space: pre-wrap; word-break: break-word; }
.log .t { color: var(--faint); margin-right: 6px; }
.log .success { color: var(--ok); } .log .warn { color: var(--warn); } .log .error { color: var(--err); }

/* ---------- toasts ---------- */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 100; width: min(92vw, 420px); }
.toast { background: var(--fg); color: var(--bg); padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow-lg);
  font-size: 13.5px; animation: toast-in .2s ease-out; display: flex; gap: 8px; align-items: flex-start; }
.toast.err { background: var(--err); color: #fff; }
.toast.ok { background: var(--ok); color: #fff; }
.toast.out { opacity: 0; transform: translateY(6px); transition: .2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .workspace { grid-template-columns: 1fr; padding: 16px; }
  .side { position: static; }
  .picker { min-height: 0; }
  .tree { max-height: 60vh; }
  .steps { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .topbar { padding: 10px 16px; }
  .brand small { display: none; }
  .ws { max-width: 150px; }
  .landing { padding-top: 36px; }
  .steps, .map-grid { grid-template-columns: 1fr; }
  .account .btn.sm span { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.btn.disabled { opacity: .45; pointer-events: none; }

/* ---------- Feishu account ---------- */
.lark-account { margin-bottom: 16px; }
.lark-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.lark-card .av { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; overflow: hidden; flex: none; }
.lark-card .av img { width: 100%; height: 100%; object-fit: cover; }
.lark-card .who { flex: 1; min-width: 0; }
.lark-card .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.lark-card .who small { color: var(--muted); font-size: 12px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lark-card .who small .dot { display: inline-block; margin-right: 5px; vertical-align: 1px; }
.lark-connect { display: grid; gap: 8px; }
.lark-connect .alt { display: flex; justify-content: center; gap: 4px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.btn.lark { background: #fff; border-color: var(--line-strong); }
@media (prefers-color-scheme: dark) { .btn.lark { background: var(--surface); } }
.lark-logo { width: 18px; height: 18px; flex: none; }
.or { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 12px; margin: 14px 0 12px; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

/* ---------- wizard ---------- */
.wizard { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--line);
  border-radius: 16px; background: var(--surface); color: var(--fg); box-shadow: var(--shadow-lg); overflow: auto; }
.wizard::backdrop { background: rgba(15, 18, 25, .45); backdrop-filter: blur(2px); }
.wiz-head { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  padding: 18px 22px 14px; background: var(--surface); border-bottom: 1px solid var(--line); margin: 0; }
.wiz-head h3 { margin: 0; font-size: 17px; }
.wiz-head .sub { margin: 4px 0 0; }
.wiz-steps { list-style: none; margin: 0; padding: 8px 22px 22px; counter-reset: w; }
.wiz-steps > li { position: relative; padding: 14px 0 14px 40px; border-bottom: 1px dashed var(--line); }
.wiz-steps > li:last-child { border-bottom: 0; }
.wiz-steps > li::before { counter-increment: w; content: counter(w); position: absolute; left: 0; top: 13px; width: 26px; height: 26px;
  border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 13px; display: grid; place-items: center; }
.wiz-steps b { font-size: 14.5px; }
.wiz-steps p { margin: 4px 0 10px; color: var(--muted); font-size: 13px; }
.wiz-steps p b { color: var(--fg); font-size: inherit; }
.copybox { display: flex; gap: 8px; align-items: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 8px 8px 12px; }
.copybox pre, .copybox code { flex: 1; min-width: 0; margin: 0; font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; word-break: break-all; padding-top: 3px; }
.cred-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cred-grid .field { margin-bottom: 8px; }
@media (max-width: 560px) { .cred-grid { grid-template-columns: 1fr; } }

/* ---------- login ---------- */
.login-view { min-height: calc(100vh - 60px); display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: min(380px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 30px 28px 26px; box-shadow: var(--shadow-lg); }
.login-card h1 { font-size: 21px; margin: 14px 0 4px; }
.login-card .sub { margin: 0 0 22px; }
.logo.big svg { width: 44px; height: 44px; }

/* ---------- user menu ---------- */
.user-menu { position: relative; }
.user-menu summary { list-style: none; cursor: pointer; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu .menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 180px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 20; display: grid; }
.user-menu .menu button { text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 6px; color: var(--fg); cursor: pointer; font-size: 13.5px; }
.user-menu .menu button:hover { background: var(--hover); }
.user-menu .menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.user-menu .menu .danger { color: var(--err); }
.role-tag { font-size: 11px; padding: 0 6px; border-radius: 5px; background: var(--accent-soft); color: var(--accent); line-height: 18px; }

/* ---------- banners / head ---------- */
.pw-banner { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); font-size: 13.5px; }
.head-actions { display: flex; gap: 6px; align-items: center; flex: none; }
.n-mark.sm { width: 18px; height: 18px; font-size: 12px; line-height: 18px; border: 1px solid var(--line-strong); border-radius: 4px; }

/* ---------- workspace rows ---------- */
.row.ws-row { font-weight: 600; height: 38px; }
.row.ws-row.broken { cursor: default; }
.row.ws-row.broken:hover { background: none; }
.row.ws-row .ico img { width: 18px; height: 18px; border-radius: 4px; vertical-align: -3px; }
.row .by { font-size: 11.5px; color: var(--faint); font-weight: 400; flex: none; }
.row .rm { opacity: 0; border: 0; background: none; color: var(--faint); cursor: pointer; padding: 2px 6px; border-radius: 4px; font-size: 12px; flex: none; }
.row:hover .rm { opacity: 1; }
.row .rm:hover { background: var(--err-soft); color: var(--err); }
.row .ws-err { font-size: 12px; color: var(--err); font-weight: 400; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree > ul > li { margin-bottom: 4px; }
.tree > ul > li > ul::before { display: none; }
.tree > ul > li > ul { padding-left: 8px; }

/* ---------- dialogs ---------- */
.wizard.small { width: min(400px, calc(100vw - 32px)); }
.dlg-body { padding: 16px 22px 22px; }
.users-table { width: 100%; border-collapse: collapse; margin-bottom: 18px; font-size: 13.5px; }
.users-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); }
.users-table td:last-child { text-align: right; white-space: nowrap; }
.users-table .me { color: var(--faint); font-size: 12px; }
.user-form h4 { margin: 0 0 10px; font-size: 14px; }
.user-form-grid { display: grid; grid-template-columns: 1fr 1fr 100px auto; gap: 8px; }
select { padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--fg); font: inherit; }
@media (max-width: 560px) { .user-form-grid { grid-template-columns: 1fr 1fr; } .head-actions [data-i18n="addWorkspace"] { display: none; } }
.wrap-name { margin: 10px 0 4px 44px; }
#adv { margin-top: 14px; }

/* image icons (e.g. workspace avatars) and overflow guards */
.chip-ico { display: inline-grid; place-items: center; width: 16px; height: 16px; flex: none; overflow: hidden; }
.chip-ico img, .row .ico img { width: 16px; height: 16px; border-radius: 4px; object-fit: cover; display: block; }
.row .ico { display: inline-grid; place-items: center; }
.side, .picker, .chips, .chip { min-width: 0; }
.panel { overflow-wrap: anywhere; }
