/* Dashboard (v3.39.0). Uses the site's own colours (tf2.css variables), so dark and light both work. Everything sits inside #dash. */
#dash .dh-card { border: 1px solid var(--line2); background: var(--s1); border-radius: var(--r); padding: 16px; margin: 0 0 12px; }
#dash .dh-card h2, #dash .dh-card h3 { color: var(--t); font-size: 16px; font-weight: 600; margin: 0 0 6px; }
#dash .dh-card p { font-size: 13.5px; line-height: 1.55; color: var(--m); margin: 4px 0 0; }
#dash .dh-tabs { display: flex; gap: 8px; margin: 0 0 16px; }
#dash .dh-tab { flex: 1; height: 42px; border-radius: 999px; border: 1px solid var(--line2); background: transparent; color: var(--b); font-size: 14px; cursor: pointer; }
#dash .dh-tab[aria-selected="true"] { background: var(--s3); color: var(--t); border-color: rgb(var(--acc) / .6); }
#dash .dh-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
#dash .dh-name { display: flex; align-items: center; gap: 10px; color: var(--t); font-weight: 600; font-size: 15px; min-width: 0; }
#dash .dh-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 10px; background: var(--d); }
#dash .dh-dot.on { background: rgb(var(--ok)); box-shadow: 0 0 0 3px rgb(var(--ok) / .2); }
#dash .dh-state { font-size: 12.5px; color: var(--m); }
#dash .dh-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 12px 0 0; }
#dash .dh-facts div { background: var(--s2); border-radius: var(--rc); padding: 10px 12px; min-width: 0; }
#dash .dh-facts span { display: block; font-size: 11.5px; color: var(--d); }
#dash .dh-facts b { display: block; font-size: 14px; color: var(--t); font-weight: 500; margin-top: 2px; }
#dash .dh-btn { height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line2); background: transparent; color: var(--t); font-size: 14px; cursor: pointer; }
#dash .dh-btn.main { background: var(--btn); border-color: transparent; color: #fff; }
#dash .dh-btn.bad { border-color: rgb(var(--bad) / .6); color: rgb(var(--bad)); }
#dash .dh-btn[disabled] { opacity: .6; cursor: default; }
#dash .dh-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
#dash .dh-steps { counter-reset: s; margin: 10px 0 0; }
#dash .dh-steps li { counter-increment: s; display: flex; gap: 12px; padding: 8px 0; font-size: 14px; color: var(--b); }
#dash .dh-steps li::before { content: counter(s); width: 24px; height: 24px; min-width: 24px; border-radius: 50%; background: var(--s3); color: var(--t); font-size: 12px; display: flex; align-items: center; justify-content: center; margin-top: 1px; }
#dash code { font-family: var(--mono); background: var(--s3); color: var(--t); padding: 1px 6px; border-radius: 6px; font-size: 13px; }
#dash .dh-msg { border: 1px solid var(--line2); border-radius: var(--rc); padding: 12px 14px; font-size: 13.5px; color: var(--b); margin: 0 0 12px; }
#dash .dh-msg.err { border-color: rgb(var(--bad) / .5); }
#dash .dh-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--b); }
#dash .dh-list li:first-child { border-top: 0; }
#dash .dh-list b { color: var(--t); font-weight: 500; }
#dash .dh-small { font-size: 12.5px; color: var(--m); margin: 10px 0 0; }
#dash .dh-a { display: inline-flex; align-items: center; }

/* Phase 2 (v3.40.0): one bot, forms, number sign-in */
#dash .dh-field { margin: 12px 0 0; }
#dash .dh-field label { display: block; font-size: 12.5px; color: var(--d); margin: 0 0 6px; }
#dash .dh-field small { display: block; font-size: 12px; color: var(--m); margin-top: 6px; }
#dash .dh-input { width: 100%; box-sizing: border-box; height: 44px; border-radius: var(--rc); border: 1px solid var(--line2); background: var(--s2); color: var(--t); font-size: 15px; padding: 0 12px; font-family: inherit; }
#dash .dh-input:focus-visible { outline: 2px solid rgb(var(--acc) / .7); outline-offset: 1px; }
#dash .dh-step2 { display: none; margin-top: 12px; }
#dash .dh-step2.show { display: block; }
#dash .dh-btns.top { margin: 0 0 14px; }

/* Phase 3 (v3.41.0): groups */
#dash .dh-gitem { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; box-sizing: border-box; min-height: 48px; padding: 10px 12px; margin-top: 8px; border: 1px solid var(--line2); border-radius: var(--rc); background: var(--s2); color: var(--t); font-size: 14.5px; cursor: pointer; text-align: left; font-family: inherit; }
#dash .dh-gitem:hover, #dash .dh-gitem:focus-visible { border-color: rgb(var(--acc) / .6); outline: none; }
#dash .dh-gname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#dash .dh-gsize { font-size: 12.5px; color: var(--m); flex: 0 0 auto; }
#dash .dh-groupwrap { display: grid; grid-template-columns: 1fr; gap: 12px; align-items: start; }
#dash .dh-side { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
#dash .dh-sidebtn { flex: 0 0 auto; height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line2); background: transparent; color: var(--b); font-size: 14px; cursor: pointer; font-family: inherit; }
#dash .dh-sidebtn[aria-selected="true"] { background: var(--s3); color: var(--t); border-color: rgb(var(--acc) / .6); }
#dash .dh-main { margin: 0; }
#dash .dh-h3 { color: var(--t); font-size: 14px; font-weight: 600; margin: 16px 0 4px; }
#dash .dh-frow.tog { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#dash .dh-frow.tog label { margin: 0; color: var(--t); font-size: 14px; }
#dash .dh-switch { width: 46px; height: 26px; min-width: 46px; border-radius: 999px; border: 1px solid var(--line2); background: var(--s3); position: relative; cursor: pointer; padding: 0; }
#dash .dh-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--d); transition: transform .15s; }
#dash .dh-switch.on { background: var(--btn); border-color: transparent; }
#dash .dh-switch.on::after { transform: translateX(20px); background: #fff; }
#dash .dh-switch[disabled] { opacity: .6; cursor: default; }
#dash .dh-area { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
#dash .dh-pv { margin-top: 10px; border-left: 3px solid rgb(var(--acc) / .6); background: var(--s2); border-radius: var(--rc); padding: 8px 12px; }
#dash .dh-pv span { font-size: 11.5px; color: var(--d); }
#dash .dh-pv p { white-space: pre-wrap; color: var(--t); margin: 2px 0 0; overflow-wrap: anywhere; }
#dash .dh-bar { position: sticky; bottom: 12px; display: none; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; border: 1px solid rgb(var(--acc) / .6); background: var(--s1); border-radius: var(--r); padding: 10px 14px; margin-top: 12px; box-shadow: 0 6px 24px rgb(0 0 0 / .25); }
#dash .dh-bar.show { display: flex; }
#dash .dh-bar span { font-size: 13.5px; color: var(--t); }
#dash .dh-bar .dh-btns { margin: 0; }
@media (min-width: 720px) {
  #dash .dh-groupwrap { grid-template-columns: 200px 1fr; }
  #dash .dh-side { flex-direction: column; overflow: visible; }
  #dash .dh-sidebtn { text-align: left; border-radius: var(--rc); }
}

/* Phase 4c (v3.45.0): owner tools */
#dash .dh-keyrow { border-top: 1px solid var(--line2); padding: 12px 0; display: flex; flex-direction: column; gap: 8px; }
#dash .dh-keyrow b { display: block; color: var(--t); font-size: 14px; }
#dash .dh-keyrow small { display: block; color: var(--m); font-size: 12.5px; overflow-wrap: anywhere; }
#dash .dh-code { display: block; padding: 8px 10px; border-radius: var(--rc); background: var(--s2); color: var(--t); font-size: 13px; overflow-wrap: anywhere; user-select: all; }
/* plugins page (v3.47.0): the risk of a permission is shown in words and by a coloured edge */
#dash .dh-list li.dh-risk-low, #dash .dh-list li.dh-risk-medium, #dash .dh-list li.dh-risk-high { justify-content: flex-start; border-left: 3px solid rgb(var(--ok)); padding-left: 10px; }
#dash .dh-list li.dh-risk-medium { border-left-color: #d9a400; }
#dash .dh-list li.dh-risk-high { border-left-color: rgb(var(--bad)); }
/* group admins (v3.48.0) */
#dash h2.dh-sec { margin: 22px 0 6px; font-size: 1rem; }
