/* The demo panel (demo tool only). It floats bottom LEFT: a small "Demo" pill 16px right of the Connect sidebar (or 16px
 * from the window edge on the referred company's page, --dk-left from dock.js), and a panel that opens upwards from it,
 * layered over the page. It never takes page space, so the page measures the same with the panel open or closed. */
.dk { position: fixed; z-index: 120; left: var(--dk-left, 1rem); bottom: 3.75rem; width: 22.5rem; max-width: calc(100vw - var(--dk-left, 1rem) - 1rem); max-height: calc(100vh - 2rem - 2.75rem); display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 24px 48px -12px rgba(0, 6, 37, 0.22), 0 2px 6px rgba(0, 6, 37, 0.06); font-size: var(--text-sm); transform-origin: bottom left; animation: dkIn 220ms var(--ease) both; }
.dk[hidden] { display: none; }
@keyframes dkIn { from { opacity: 0; transform: translateY(6px) scale(0.985); } }

/* the screen switcher: six screens, a line icon each, the current one in Connect blue */
.dk-scr { flex: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; margin: 0.5rem 0.5rem 0; padding: 2px; border-radius: 9px; background: var(--subtle); border: 1px solid var(--line); }
.dk-scr button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.25rem; min-height: 3.25rem; padding: 0.375rem 0.25rem; border-radius: 7px; border: 1px solid transparent; font-size: 0.75rem; line-height: 1.2; font-weight: 500; color: var(--muted-fg); text-align: center; transition: color 140ms var(--ease), background-color 140ms var(--ease); }
.dk-scr button .ic { color: currentColor; opacity: 0.85; }
.dk-scr button:hover { color: var(--fg); background: rgba(255, 255, 255, 0.6); }
.dk-scr button[aria-current='page'] { background: #fff; border-color: var(--primary-line); color: var(--primary); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05); }
.dk-scr button[aria-current='page'] .ic { opacity: 1; }

.dk-h { flex: none; display: flex; align-items: flex-start; gap: 0.5rem; padding: 0.75rem 0.625rem 0.75rem 1.125rem; border-bottom: 1px solid var(--line); }
.dk-h > div { flex: 1; display: flex; flex-direction: column; gap: 0.125rem; }
.dk-h b { font-family: var(--font-display); font-size: 1.0667rem; font-weight: 600; letter-spacing: -0.01em; color: var(--ats-title); }
.dk-h small { font-size: var(--text-xs); color: var(--muted-fg); }
.dk-h .btn-icon:hover { color: var(--fg); background: var(--subtle); }
.dk-b { flex: 1; min-height: 0; overflow-y: auto; padding: 0 1.125rem; overscroll-behavior: contain; }
.dk-g { padding: 0.875rem 0 1rem; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 0.625rem; }
.dk-g h4 { font-family: var(--font-sans); font-size: var(--text-xs); font-weight: 600; letter-spacing: 0; color: var(--fg); }
.dk-f { display: flex; flex-direction: column; gap: 0.3125rem; }
.dk-f.sub { padding-left: 2.5rem; margin-top: -0.25rem; }
.dk-l { font-size: var(--text-xs); color: var(--muted-fg); }
.dk .sel.sm { height: 2.125rem; font-size: var(--text-sm); }
.dk-note { font-size: var(--text-xs); line-height: 1.45; color: var(--muted-fg); }
.dk-none { padding: 1rem 0; font-size: var(--text-xs); color: var(--muted-fg); }

/* programme rules: a heading, the presets row, then the rule groups */
.dk-rules { display: flex; flex-direction: column; }
.dk-rh { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; padding-top: 1rem; }
.dk-rh h3 { font-family: var(--font-display); font-size: 0.9333rem; font-weight: 600; color: var(--ats-title); }
.dk-rh span { font-size: var(--text-xs); color: var(--muted-fg); }
.dk-rules .dk-pre { padding: 0.625rem 0 0.875rem; border-bottom: 1px solid var(--line); }
.dk-rules .dk-g h4 { color: var(--fg-2); }

/* "Show all settings": a quiet text toggle, then the rest under a muted heading */
.dk-all { padding: 0.75rem 0 0.875rem; }
.dk-allb { display: inline-flex; align-items: center; gap: 0.375rem; font-size: var(--text-xs); font-weight: 500; color: var(--muted-fg); border-radius: 4px; }
.dk-allb:hover { color: var(--fg); }
.dk-rest { padding-bottom: 0.5rem; border-top: 1px dashed var(--line-2); }
.dk-resth { padding-top: 0.875rem; font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-fg); }
.dk-rest .dk-g { opacity: 0.85; }
.dk-rest .dk-g:last-child { border-bottom: 0; }

/* segmented control: a bordered strip, the chosen part white with a border (as the app's SegmentedTabs) */
.dk-seg { display: flex; flex-wrap: wrap; gap: 2px; padding: 2px; border-radius: 8px; background: var(--subtle); border: 1px solid var(--line); }
.dk-seg button { flex: 1 1 auto; min-height: 1.875rem; padding: 0 0.5rem; border-radius: 6px; border: 1px solid transparent; font-size: var(--text-xs); font-weight: 500; color: var(--muted-fg); white-space: nowrap; text-align: center; transition: color 140ms var(--ease); }
.dk-seg button:hover { color: var(--fg); }
.dk-seg button[aria-checked='true'] { background: #fff; border-color: var(--line-2); color: var(--fg); box-shadow: 0 1px 1px rgba(15, 23, 42, 0.04); }

/* switch */
.dk-sw { display: flex; align-items: center; gap: 0.625rem; min-height: 1.875rem; font-size: var(--text-sm); color: var(--fg); text-align: left; }
.dk-sw-t { flex: none; position: relative; width: 1.875rem; height: 1.125rem; border-radius: 999px; background: #d5d6de; transition: background-color 160ms var(--ease); }
.dk-sw-t i { position: absolute; top: 2px; left: 2px; width: calc(1.125rem - 4px); height: calc(1.125rem - 4px); border-radius: 999px; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18); transition: transform 200ms var(--ease); }
.dk-sw[aria-checked='true'] .dk-sw-t { background: var(--primary); }
.dk-sw[aria-checked='true'] .dk-sw-t i { transform: translateX(0.75rem); }

/* presets */
.dk-pre { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.dk-pre button { height: 1.75rem; padding: 0 0.625rem; border-radius: 6px; border: 1px solid var(--line-2); background: #fff; font-size: var(--text-xs); font-weight: 500; color: var(--fg-2); transition: border-color 140ms var(--ease), color 140ms var(--ease); }
.dk-pre button:hover { border-color: color-mix(in oklab, var(--fg) 28%, var(--line-2)); color: var(--fg); }
.dk-pre button[aria-pressed='true'] { border-color: var(--primary); color: var(--primary); }

.dk-ft { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.75rem 1.125rem; border-top: 1px solid var(--line); }

/* the pill, bottom left of the content area (dashed, as the Demo pill in the branding demo) */
.dk-pill { position: fixed; z-index: 121; left: var(--dk-left, 1rem); bottom: 1rem; display: inline-flex; align-items: center; gap: 6px; height: 2.125rem; padding: 0 0.875rem; border-radius: 999px; border: 1px dashed var(--line-2); background: #fff; color: var(--fg-2); font-size: var(--text-xs); font-weight: 500; box-shadow: 0 4px 14px -6px rgba(15, 23, 42, 0.25); transition: color 140ms var(--ease), border-color 140ms var(--ease); }
.dk-pill:hover, .dk-pill.on { color: var(--fg); border-color: var(--fg-2); }
.dk-pill.on { border-style: solid; }
.dk-scr button:focus-visible, .dk-allb:focus-visible, .dk-pill:focus-visible, .dk-seg button:focus-visible, .dk-pre button:focus-visible, .dk-sw:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* the change highlight: a soft Connect-blue outline and tint that fades over 600ms */
.dk-flash { animation: dkFlash 600ms ease-out; }
@keyframes dkFlash {
	0% { box-shadow: 0 0 0 3px rgba(48, 78, 255, 0.38), inset 0 0 0 999px rgba(48, 78, 255, 0.07); }
	100% { box-shadow: 0 0 0 3px rgba(48, 78, 255, 0), inset 0 0 0 999px rgba(48, 78, 255, 0); }
}
@media (prefers-reduced-motion: reduce) { .dk { animation: none; } .dk-flash { animation: none; } }
