/* My view (views.js): the Style button and toolkit in every page's top-right corner, each person's look for a widget,
   and the Widgets page. Every look is one of these classes or a checked theme; nothing a person types becomes CSS. */

/* ---- widgets ----------------------------------------------------------------------------------------------------- */
.vw { position: relative; }
.vw-notitle .vw-title { display: none; }
.vw-fine { margin: 0; padding: 0 4px; font-size: 11.5px; color: var(--muted); }
/* while the Style toolkit is open, widgets can be clicked to style just that one */
.vw-picking [data-vw] { cursor: pointer; }
.vw-picking [data-vw]:hover { outline: 2px dashed color-mix(in srgb, var(--text) 30%, transparent); outline-offset: 3px; }
.vw-picking [data-vw].vw-picked, [data-vw].vw-picked { outline: 2px solid #2563EB; outline-offset: 3px; }

/* ---- a widget's look ------------------------------------------------------------------------------------------- */
/* color: a clear tint, an edge in the color and a bar of it along the top, so a change is easy to see (Landon, 2026-11-23:
   "If I change a color of something, make it more noticeable"); navy and dark turn the whole card dark */
.vw-c-slate  { --vw-bg: #E6EAF0; --vw-edge: #AEB8C6; --vw-head: #1D2939; --vw-ink: #475467; }
.vw-c-blue   { --vw-bg: #DCEAFE; --vw-edge: #8FB6FA; --vw-head: #1E40AF; --vw-ink: #2563EB; }
.vw-c-green  { --vw-bg: #D3F3E1; --vw-edge: #7AD3A2; --vw-head: #05603A; --vw-ink: #079455; }
.vw-c-teal   { --vw-bg: #D0F3EC; --vw-edge: #6CD3C1; --vw-head: #0B5E55; --vw-ink: #0E9384; }
.vw-c-purple { --vw-bg: #E6E1FF; --vw-edge: #B1A3FA; --vw-head: #4A1FB8; --vw-ink: #6938EF; }
.vw-c-amber  { --vw-bg: #FEEBC0; --vw-edge: #F6BE55; --vw-head: #93370D; --vw-ink: #DC6803; }
.vw-c-red    { --vw-bg: #FEDCD8; --vw-edge: #F39C93; --vw-head: #912018; --vw-ink: #D92D20; }
.vw-c-pink   { --vw-bg: #FBDDEC; --vw-edge: #EE9EC6; --vw-head: #851440; --vw-ink: #DB2777; }
.vw-c-orange { --vw-bg: #FFE2CF; --vw-edge: #F6A877; --vw-head: #97300F; --vw-ink: #E8590C; }
.vw-c-yellow { --vw-bg: #FBF0BE; --vw-edge: #E3C24A; --vw-head: #713B12; --vw-ink: #CA8A04; }
.vw-c-brown  { --vw-bg: #EEE0D1; --vw-edge: #C8A684; --vw-head: #5A3A1E; --vw-ink: #8B5E34; }
.vw-c-navy   { --vw-bg: #0B1B3D; --vw-edge: #1E3A8A; --vw-head: #BFDBFE; --vw-ink: #93C5FD;
  --surface: #102552; --subtle: #15306A; --line: #1E3A8A; --line-strong: #2C4A9A; --text: #F8FAFF; --text-2: #DBE6FF; --muted: #A9BCE6; --faint: #7E93C2;
  color-scheme: dark; }
.vw-c-dark   { --vw-bg: #111214; --vw-edge: #2E2E2E; --vw-head: #F5F5F5; --vw-ink: #E5E5E5;
  --surface: #1A1A1A; --subtle: #232323; --line: #2E2E2E; --line-strong: #3D3D3D; --text: #F5F5F5; --text-2: #D4D4D4; --muted: #A3A3A3; --faint: #737373;
  color-scheme: dark; }
.vw[class*="vw-c-"] { background-color: var(--vw-bg); border-color: var(--vw-edge); color: var(--text);
  background-image: linear-gradient(var(--vw-ink), var(--vw-ink)); background-size: 100% 4px; background-repeat: no-repeat; background-position: top; }
.vw[class*="vw-c-"] .vw-title { color: var(--vw-head); }
/* the plain black progress bars take the widget's color; red (late) and the andon colors keep their meaning */
.vw[class*="vw-c-"] .ap-bar:not(.risk):not(.done) span, .vw[class*="vw-c-"] .bt-pct-bar > span, .vw[class*="vw-c-"] .bt-bd-bar > span { background: var(--vw-ink); }
.vw.vw-c-navy .ap-table tr.click:hover, .vw.vw-c-dark .ap-table tr.click:hover { background: var(--subtle); }
/* in Acter's dark mode the light tints turn into deep ones */
[data-theme="dark"] .vw-c-slate  { --vw-bg: #262C36; --vw-edge: #4E596B; --vw-head: #E4E7EC; --vw-ink: #98A2B3; }
[data-theme="dark"] .vw-c-blue   { --vw-bg: #13294F; --vw-edge: #3462C2; --vw-head: #C4DAFF; --vw-ink: #60A5FA; }
[data-theme="dark"] .vw-c-green  { --vw-bg: #0E3523; --vw-edge: #22804F; --vw-head: #A6F0C6; --vw-ink: #47CD89; }
[data-theme="dark"] .vw-c-teal   { --vw-bg: #0C352F; --vw-edge: #1A7F71; --vw-head: #99F6E0; --vw-ink: #2ED3B7; }
[data-theme="dark"] .vw-c-purple { --vw-bg: #261C52; --vw-edge: #5F43CC; --vw-head: #DAD4FF; --vw-ink: #9B8AFB; }
[data-theme="dark"] .vw-c-amber  { --vw-bg: #3B240A; --vw-edge: #A8601A; --vw-head: #FEDF89; --vw-ink: #FDB022; }
[data-theme="dark"] .vw-c-red    { --vw-bg: #3F1613; --vw-edge: #AA372C; --vw-head: #FECDCA; --vw-ink: #F97066; }
[data-theme="dark"] .vw-c-pink   { --vw-bg: #3F152B; --vw-edge: #A92B63; --vw-head: #FBCFE8; --vw-ink: #F472B6; }
[data-theme="dark"] .vw-c-orange { --vw-bg: #3F1E0B; --vw-edge: #B44E19; --vw-head: #FDCBA8; --vw-ink: #FB923C; }
[data-theme="dark"] .vw-c-yellow { --vw-bg: #3A310A; --vw-edge: #957312; --vw-head: #FDEB9C; --vw-ink: #FACC15; }
[data-theme="dark"] .vw-c-brown  { --vw-bg: #34251A; --vw-edge: #7F5A36; --vw-head: #EDD9C3; --vw-ink: #C8A27C; }
[data-theme="dark"] .vw-c-dark   { --vw-bg: #000000; --surface: #121212; --subtle: #1B1B1B; }

/* text size: everything inside grows or shrinks together (numbers, bars, tables) */
.vw.vw-t-sm > :not(.vw-motif) { zoom: .9; }
.vw.vw-t-lg > :not(.vw-motif) { zoom: 1.15; }
.vw.vw-t-xl > :not(.vw-motif) { zoom: 1.35; }

/* spacing */
.vw.vw-d-compact { padding: 10px 12px; gap: 6px; }
.vw.vw-d-compact.kp-card { padding: 10px 12px 8px; }
.vw-d-compact .ap-table th, .vw-d-compact .ap-table td { padding-top: 4px; padding-bottom: 4px; }
.vw-d-compact .bt-t th, .vw-d-compact .bt-t td { padding-top: 3px; padding-bottom: 3px; }
.vw-d-compact .ap-queues { gap: 6px; }
.vw-d-compact .ap-q { padding: 6px 10px; min-width: 104px; }
.vw-d-compact .bt-q { gap: 8px; }
.vw-d-compact .bt-w-h { margin-bottom: 6px; }
.vw.vw-d-roomy { padding: 22px 26px; gap: 14px; }
.vw.vw-d-roomy.kp-card { padding: 20px 22px 16px; }
.vw-d-roomy .ap-table th, .vw-d-roomy .ap-table td { padding-top: 12px; padding-bottom: 12px; }
.vw-d-roomy .ap-queues { gap: 14px; }

/* width. Production: a two-column grid, each widget full width unless made half. KPIs: small / double / full. */
.vw-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.vw-grid > * { grid-column: 1 / -1; min-width: 0; }
.vw-grid > .vw-s-half { grid-column: auto; }
@media (max-width: 900px) { .vw-grid > .vw-s-half { grid-column: 1 / -1; } }
.vw-more { margin: 0; }
.kp-grid > .vw-s-small { grid-column: auto; }
@media (min-width: 700px) { .kp-grid > .vw-s-wide { grid-column: span 2; } }
.kp-grid > .vw-s-full { grid-column: 1 / -1; }


/* ---- the Widgets button and page ------------------------------------------------------------------------------- */
.vw-widgets-btn svg { flex: none; }
.vw-page { max-width: 1100px; }
.vw-note { margin: 0; color: var(--text-2); }
.vw-on h2, .vw-add h2 { font-size: 15px; }
.vw-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.vw-row { display: flex; align-items: center; gap: 12px; padding: 9px 4px; border-top: 1px solid var(--line); }
.vw-row:first-child { border-top: 0; }
.vw-n { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--subtle); border: 1px solid var(--line-strong);
  font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; color: var(--text-2);
  font-variant-numeric: tabular-nums; }
.vw-row-t { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.vw-row-t strong { font-size: 14px; }
.vw-row-t .meta { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vw-now { flex: none; font-size: 12px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.vw-row-acts { flex: none; display: flex; align-items: center; gap: 2px; }
.vw-row-acts .icon-btn[disabled] { opacity: .3; cursor: default; background: transparent; }
.vw-row-acts .btn { margin-left: 6px; }
.vw-add { display: flex; flex-direction: column; gap: 14px; }
.vw-group h3 { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.vw-tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.vw-tile { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.vw-tile.made { border-style: dashed; border-color: var(--line-strong); }
.vw-badge { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.vw-tile strong { font-size: 13.5px; }
.vw-tile-about { font-size: 12px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vw-tile-now { font-size: 12px; font-weight: 600; color: var(--text); margin-top: 2px; }
.vw-tile-now.wait { color: var(--muted); font-weight: 500; }
.vw-tile-acts { display: flex; gap: 6px; margin-top: 8px; }
@media (max-width: 640px) {
  .vw-row { flex-wrap: wrap; }
  .vw-row-acts { width: 100%; justify-content: flex-end; }
}

/* ---- a theme (views-theme.js): the page's or a widget's own colours, type and shapes ------------------------- */
/* Its colours arrive as the app's own variables (--surface, --text …), so every card, table and button inside
   follows. Status colours (--red, and the andon greens and ambers) are never set by a theme. */
.vw-th { color: var(--text); font-family: var(--vw-font, inherit); }
.content.vw-th, .shell.vw-th { background-color: var(--bg); isolation: isolate; min-height: 100vh; }
.shell.vw-th .side { background: var(--surface); border-color: var(--line); }
.vw-th h1, .vw-th h2, .vw-th h3, .vw-th .vw-title, .vw-th .bt-w-h, .vw-th .kp-name {
  color: var(--vw-title, var(--text)); font-family: var(--vw-title-font, var(--vw-font, inherit)); }
.vw-th .meta, .vw-th .kp-sub { color: var(--muted); }
.vw-th .card, .vw-th .bt-w, .vw-th .ap-empty, .vw-th .vw-tile { border-radius: var(--radius); }
.vw-th.vw.card, .vw-th.vw.bt-w { border-radius: var(--radius); }
.vw-th .ap-bar:not(.risk):not(.done) span, .vw-th .bt-pct-bar > span, .vw-th .bt-bd-bar > span, .vw-th.vw .ap-bar:not(.risk):not(.done) span { background: var(--vw-accent); }
/* Plain links take the theme accent; links drawn as buttons (btn, ak-btn, cr-btn, hq-btn...) keep their own colours
   (2026-11-23: Ask's black "Open in CRM" button turned its text the accent colour and became unreadable). */
.vw-th a:not(.btn):not(.nav-item):not(.brand):not([class*="btn"]) { color: var(--vw-accent); }
.vw-th .btn { border-color: var(--text); background: var(--surface); color: var(--text); }
.vw-th .btn.quiet { border-color: var(--line-strong); }
.vw-th .ap-table th { color: var(--muted); border-color: var(--line-strong); }
.vw-th .ap-table td { border-color: var(--line); }
.vw-th-upper h1, .vw-th-upper h2, .vw-th-upper .vw-title, .vw-th-upper .bt-w-h, .vw-th-upper .kp-name { text-transform: uppercase; letter-spacing: .06em; }
/* no shadow or glow behind words, ever (Landon, 2026-11-22): a theme's "glow" draws nothing on text */
.vw-th-sh-soft .card, .vw-th-sh-soft .bt-w, .vw-th-sh-soft.vw { box-shadow: 0 8px 22px -12px rgba(0,0,0,.28); }
.vw-th-sh-lifted .card, .vw-th-sh-lifted .bt-w, .vw-th-sh-lifted.vw { box-shadow: 0 2px 0 var(--line-strong), 0 14px 28px -14px rgba(0,0,0,.4); }
.vw-th-sh-glow .card, .vw-th-sh-glow .bt-w, .vw-th-sh-glow.vw {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--vw-accent) 35%, transparent), 0 0 26px -6px color-mix(in srgb, var(--vw-accent) 55%, transparent); }
.vw-th-bd-none .card, .vw-th-bd-none .bt-w, .vw-th-bd-none.vw { border-color: transparent; }
.vw-th-bd-thick .card, .vw-th-bd-thick .bt-w, .vw-th-bd-thick.vw { border-width: 2px; border-color: var(--line-strong); }
/* the corner motif: big, faint, behind the content, never in the way of a click */
.vw-th.vw { isolation: isolate; }
.vw-motif { position: absolute; pointer-events: none; z-index: -1; opacity: var(--vw-motif-op, .13); }
.vw-motif-page { top: 28px; right: 36px; width: min(300px, 36vw); height: auto; }
.vw-motif-widget { right: 8px; bottom: 6px; width: 96px; height: 96px; }
.vw-th-dark .vw-motif { opacity: calc(var(--vw-motif-op, .13) + .07); }
.vw-th-page > .vw-motif-page { stroke: var(--vw-on-bg-title); }
/* the page's own header and title sit on the page background, not on a card: they take the on-bg colours */
.vw-th-page :is(h1, .ap-head, .detail-head, .work-head, .ap-ph, .kp-top, .ak-top, .au-top, .bt-head, .cr-page-h, .cr-top, .cu-top,
  .dq-top, .doc-head, .hq-top):not(:is(.card, .bt-w, .vw, .ap-empty, .vw-tile, .side, .vw-tk, dialog) *) { color: var(--vw-on-bg); }
.vw-th-page :is(.ap-head, .detail-head, .work-head, .ap-ph, .kp-top, .ak-top, .au-top, .bt-head, .cr-page-h, .cr-top, .cu-top, .dq-top,
  .doc-head, .hq-top):not(:is(.card, .bt-w, .vw, .ap-empty, .vw-tile, .side, .vw-tk, dialog) *) :is(h1, h2, h3) { color: var(--vw-on-bg-title); }
.vw-th-page h1:not(:is(.card, .bt-w, .vw, .ap-empty, .vw-tile, .side, .vw-tk, dialog) *) { color: var(--vw-on-bg-title); }
.vw-th-page :is(.ap-head, .detail-head, .work-head, .ap-ph, .kp-top, .ak-top, .au-top, .bt-head, .cr-page-h, .cr-top, .cu-top, .dq-top,
  .doc-head, .hq-top):not(:is(.card, .bt-w, .vw, .ap-empty, .vw-tile, .side, .vw-tk, dialog) *) :is(.meta, p, a:not(.btn)) { color: var(--vw-on-bg-muted); }
.vw-th-page > .vw-tk-btn { color: var(--vw-on-bg-muted); }
/* a scene behind the page: cards let a little of it through (the header reads on the sky: its colours are checked against it) */
.vw-th-scene :is(.card, .bt-w, .ap-empty, .vw-tile):not(:is(.card, .bt-w) *) {
  background-color: color-mix(in srgb, var(--surface) 90%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
/* a coloured widget keeps its own tint over the picture */
.vw-th-scene .vw[class*="vw-c-"]:not(:is(.card, .bt-w) *) { background-color: color-mix(in srgb, var(--vw-bg) 94%, transparent); }
/* big numbers in the theme's figure font */
.vw-th :is(.kp-value, .bt-kpi-v, .bt-q-n, .ap-table td.num) { font-family: var(--vw-figure-font, inherit); font-variant-numeric: tabular-nums; }
.vw-th :is(.kp-value, .bt-kpi-v, .bt-q-n) { letter-spacing: .01em; }
/* the title style carries the theme into every widget */
.vw-th-ts-underline :is(.vw-title, .bt-w-h) { display: block; width: fit-content; max-width: 100%; padding-bottom: 5px; border-bottom: 3px solid var(--vw-accent); }
.vw-th-ts-bar :is(.vw-title, .bt-w-h) { padding-left: 10px; border-left: 4px solid var(--vw-accent); border-radius: 0; }
/* a theme on a widget: its card takes the theme's own surface */
.vw-th.vw { background-color: var(--surface); border-color: var(--line); }

/* ---- the Style button: top-right corner of every page ------------------------------------------------------------ */
.content { position: relative; }
.vw-tk-btn { position: absolute; top: 12px; right: 14px; z-index: 50; height: 30px; padding: 0 10px 0 8px; display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); font: 500 13px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  cursor: pointer; transition: color .12s, background .12s, border-color .12s; }
.vw-tk-btn:hover { color: var(--text); background: var(--subtle); border-color: var(--line); }
.vw-tk-btn[aria-expanded="true"] { color: var(--text); background: var(--subtle); border-color: var(--line-strong); }
.vw-tk-btn:focus-visible { outline: 2px solid #2563EB; outline-offset: 2px; }
.vw-tk-btn svg { flex: none; }
@media (max-width: 640px) { .vw-tk-btn span { display: none; } .vw-tk-btn { padding: 0 7px; } }

/* ---- the Style toolkit: drops down under the button (fixed, outside the page, so no card clips it). It always keeps
   Acter's own look and colours, whatever theme the page wears, so it reads the same everywhere. ------------------ */
.vw-tk { --tk-bg: #FFFFFF; --tk-sub: #F6F7F9; --tk-line: #E6E8EC; --tk-line2: #D0D5DD; --tk-text: #101828; --tk-muted: #667085; --tk-on: #2563EB;
  position: fixed; z-index: 95; box-sizing: border-box; display: flex; flex-direction: column; background: var(--tk-bg); color: var(--tk-text);
  border: 1px solid var(--tk-line); border-radius: 12px; box-shadow: 0 16px 40px -12px rgba(16,24,40,.28), 0 2px 6px rgba(16,24,40,.06);
  font: 13px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; letter-spacing: normal; text-transform: none; overflow: hidden; }
[data-theme="dark"] .vw-tk { --tk-bg: #252525; --tk-sub: #2E2E2E; --tk-line: #363636; --tk-line2: #444444; --tk-text: #F2F4F7; --tk-muted: #A1A1AA; --tk-on: #60A5FA; }
.vw-tk-new { animation: tk-in .14s ease-out; }
.vw-tk.vw-tk-sheet { bottom: 8px; border-radius: 14px; }
@keyframes tk-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .vw-tk-new { animation: none; } }
.vw-tk button, .vw-tk select, .vw-tk input { font: inherit; color: inherit; }
.tk-head { display: flex; align-items: center; gap: 4px; padding: 10px 10px 6px 14px; }
.tk-head strong { font-size: 14px; font-weight: 600; }
.tk-grow { flex: 1 1 auto; }
.tk-icon { width: 28px; height: 28px; border: 0; border-radius: 6px; background: transparent; color: var(--tk-muted); display: inline-flex; align-items: center;
  justify-content: center; cursor: pointer; }
.tk-icon:hover:not([disabled]) { background: var(--tk-sub); color: var(--tk-text); }
.tk-icon[disabled] { opacity: .35; cursor: default; }
.tk-applies { display: flex; align-items: center; gap: 10px; padding: 2px 14px 8px; }
.tk-applies .tk-dd-btn { flex: 1 1 auto; min-width: 0; }
/* dropdown (views.js dropdown()) */
.tk-dd-btn { display: flex; align-items: center; gap: 6px; width: 100%; height: 30px; box-sizing: border-box; padding: 0 8px 0 10px; border: 1px solid var(--tk-line2);
  border-radius: 7px; background: var(--tk-bg); color: var(--tk-text); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.tk-dd-btn:hover { background: var(--tk-sub); }
.tk-dd-btn.open { border-color: var(--tk-on); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tk-on) 22%, transparent); }
.tk-dd-v { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-dd-btn svg { flex: none; color: var(--tk-muted); transition: transform .15s; }
.tk-dd-btn.open svg { transform: rotate(180deg); }
.tk-dd-panel { position: fixed; z-index: 96; box-sizing: border-box; min-width: 180px; overflow-y: auto; overscroll-behavior: contain; padding: 4px;
  background: var(--tk-bg); color: var(--tk-text); border: 1px solid var(--tk-line2); border-radius: 9px; outline: none;
  box-shadow: 0 12px 28px -8px rgba(16,24,40,.28), 0 2px 6px rgba(16,24,40,.08); animation: tk-dd-in .1s ease-out; }
[data-theme="dark"] .tk-dd-panel { box-shadow: 0 12px 28px -8px rgba(0,0,0,.6), 0 2px 6px rgba(0,0,0,.35); }
.tk-dd-grp + .tk-dd-grp { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--tk-line); }
.tk-dd-gl { padding: 6px 8px 4px; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--tk-muted); }
.tk-dd-opt { display: grid; grid-template-columns: 16px 1fr; align-items: center; gap: 8px; min-height: 30px; padding: 0 8px; border-radius: 6px; font-size: 13px; cursor: pointer; }
.tk-dd-opt.hi { background: var(--tk-sub); }
.tk-dd-opt.sel .tk-dd-t { font-weight: 600; }
.tk-dd-tick { display: flex; color: var(--tk-on); }
.tk-dd-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes tk-dd-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .tk-dd-panel { animation: none; } }
.tk-hint { margin: 0; padding: 0 14px 8px; font-size: 12px; color: var(--tk-muted); }
.tk-err { margin: 0 14px 8px; padding: 6px 8px; border-radius: 6px; background: #FEF3F2; color: #B42318; font-size: 12px; font-weight: 600; }
.tk-body { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; border-top: 1px solid var(--tk-line); }
.tk-sec { padding: 12px 14px; border-bottom: 1px solid var(--tk-line); display: flex; flex-direction: column; gap: 8px; }
.tk-sec:last-child { border-bottom: 0; }
.tk-label { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--tk-muted); font-family: inherit; }
.tk-sub { margin: 2px 0 -2px; font-size: 12px; color: var(--tk-muted); }
.tk-row { display: flex; align-items: center; gap: 10px; min-height: 30px; }
.tk-row-l { flex: none; width: 80px; font-size: 12.5px; color: var(--tk-text); }
.tk-applies .tk-row-l { width: auto; color: var(--tk-muted); }
.tk-row-c { flex: 1 1 auto; min-width: 0; display: flex; justify-content: flex-end; }
.tk-select, .tk-text { height: 30px; box-sizing: border-box; border: 1px solid var(--tk-line2); border-radius: 7px; background: var(--tk-bg); padding: 0 8px; width: 100%;
  max-width: 100%; cursor: pointer; }
.tk-text { cursor: text; }
.tk-select:focus-visible, .tk-dd-btn:focus-visible, .tk-text:focus-visible, .vw-tk button:focus-visible, .tk-sw-any:focus-within { outline: 2px solid var(--tk-on); outline-offset: 1px; }
/* segmented control */
.tk-seg { display: inline-flex; padding: 2px; gap: 2px; background: var(--tk-sub); border: 1px solid var(--tk-line); border-radius: 8px; max-width: 100%; }
.tk-seg-b { flex: 1 1 auto; height: 24px; padding: 0 7px; border: 0; border-radius: 6px; background: transparent; color: var(--tk-muted); font-size: 12px; cursor: pointer; white-space: nowrap; }
.tk-seg-b:hover { color: var(--tk-text); }
.tk-seg-b.on { background: var(--tk-bg); color: var(--tk-text); font-weight: 600; box-shadow: 0 1px 2px rgba(16,24,40,.12); }
/* switch */
.tk-switch { width: 34px; height: 20px; padding: 2px; border: 0; border-radius: 999px; background: var(--tk-line2); cursor: pointer; display: inline-flex; transition: background .12s; }
.tk-knob { width: 16px; height: 16px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .12s; }
.tk-switch.on { background: var(--tk-on); }
.tk-switch.on .tk-knob { transform: translateX(14px); }
/* colour swatches */
.tk-sws { display: flex; flex-wrap: wrap; gap: 5px; }
.tk-sw { position: relative; width: 22px; height: 22px; padding: 0; border-radius: 50%; border: 1px solid rgba(16,24,40,.16); background: var(--sw, #FFFFFF); cursor: pointer; }
.tk-sw:hover { transform: scale(1.08); }
[data-theme="dark"] .tk-sw { border-color: rgba(255,255,255,.22); }
[data-theme="dark"] .tk-bgt-pv { box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
.tk-sw.on { box-shadow: 0 0 0 2px var(--tk-bg), 0 0 0 4px var(--tk-on); }
.tk-sw-none { background: linear-gradient(135deg, var(--tk-bg) 45%, #D92D20 45%, #D92D20 55%, var(--tk-bg) 55%); }
.tk-sw-any { display: inline-block; overflow: hidden; background: conic-gradient(#EF4444, #F59E0B, #22C55E, #06B6D4, #3B82F6, #A855F7, #EF4444); }
.tk-sw-any.on { background: var(--sw); }
.tk-sw-in { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
/* Background tiles: the real picture in small, its name under it */
.tk-bgts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 8px; }
.tk-bgt { display: flex; flex-direction: column; gap: 5px; padding: 0; border: 0; background: none; cursor: pointer; min-width: 0; text-align: center; color: inherit; font: inherit; }
.tk-bgt-pv { display: block; aspect-ratio: 16 / 10; border-radius: 8px; background-size: cover; background-position: center bottom; background-repeat: no-repeat;
  box-shadow: inset 0 0 0 1px rgba(16,24,40,.12); transition: transform .12s ease-out, box-shadow .12s; }
.tk-bgt-pv.plain { box-shadow: inset 0 0 0 1px var(--tk-line2); }
.tk-bgt:hover .tk-bgt-pv { transform: translateY(-1px); box-shadow: inset 0 0 0 1px rgba(16,24,40,.12), 0 4px 10px -4px rgba(16,24,40,.3); }
.tk-bgt.on .tk-bgt-pv { box-shadow: 0 0 0 2px var(--tk-bg), 0 0 0 4px var(--tk-on); }
.tk-bgt-n { font-size: 11px; color: var(--tk-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-bgt.on .tk-bgt-n { color: var(--tk-text); font-weight: 600; }
.tk-bgt:focus-visible { outline: none; }
.tk-bgt:focus-visible .tk-bgt-pv { box-shadow: 0 0 0 2px var(--tk-bg), 0 0 0 4px var(--tk-on); }
@media (prefers-reduced-motion: reduce) { .tk-bgt-pv { transition: none; } .tk-bgt:hover .tk-bgt-pv { transform: none; } }
/* fonts: big "Ag" tiles, like Notion's style picker */
.tk-fonts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.tk-font { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 6px; border: 1px solid var(--tk-line); border-radius: 8px; background: var(--tk-bg); cursor: pointer; min-width: 0; }
.tk-font:hover { background: var(--tk-sub); }
.tk-font.on { border-color: var(--tk-on); box-shadow: inset 0 0 0 1px var(--tk-on); }
.tk-font-ag { font-size: 22px; line-height: 1.1; }
.tk-font.on .tk-font-ag { color: var(--tk-on); }
.tk-font-n { font-size: 11px; color: var(--tk-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.tk-more, .tk-link { align-self: flex-start; border: 0; background: none; padding: 2px 0; color: var(--tk-muted); font-size: 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; text-decoration: none; }
.tk-more:hover, .tk-link:hover:not([disabled]) { color: var(--tk-text); }
.tk-link[disabled] { opacity: .4; cursor: default; }
/* corners slider */
.tk-range-w { display: flex; align-items: center; gap: 8px; width: 100%; }
.tk-range { flex: 1 1 auto; accent-color: var(--tk-on); min-width: 0; }
.tk-val { flex: none; width: 34px; text-align: right; font-size: 12px; color: var(--tk-muted); font-variant-numeric: tabular-nums; }
.tk-foot { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-top: 1px solid var(--tk-line); }
.tk-fine { margin: 0; padding: 0 14px 10px; font-size: 11.5px; color: var(--tk-muted); }

/* ---- drag a widget anywhere (views.js › sortable, 2026-11-23): it stays where it's let go ---- */
.vw-sort { position: relative; }
.vw-sort > [data-vw] { cursor: grab; -webkit-touch-callout: none; }
.vw-sort > [data-vw] :is(button, a, input, textarea, select, summary) { cursor: pointer; }
.vw-sort > [data-vw] :is(input, textarea) { cursor: text; }
/* laid out by hand: each widget at its own place (left, top and width set by the page from the saved layout) */
.vw-free { position: relative; display: block !important; }
.vw-free > [data-vw] { position: absolute; margin: 0 !important; box-sizing: border-box; grid-column: auto; }
.vw-sorting > [data-vw]:not(.vw-dragging) { pointer-events: none; transition: top 160ms ease; }
.vw-dragging { z-index: 30; cursor: grabbing; will-change: transform; transition: none !important;
  box-shadow: 0 18px 44px rgba(15, 23, 42, .24), 0 0 0 2px #2E90FA; }
.vw-dropping { z-index: 30; }
.vw-ghost { position: absolute; z-index: 1; box-sizing: border-box; border: 2px dashed #2E90FA; border-radius: 8px;
  background: rgba(46, 144, 250, .07); pointer-events: none; }
body.vw-drag-on, body.vw-drag-on * { cursor: grabbing !important; -webkit-user-select: none; user-select: none; }
.vw-undo-bar { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 12px;
  padding: 10px 12px 10px 16px; border-radius: 10px; background: #0f172a; color: #f8fafc; font-size: 14px; box-shadow: 0 10px 30px rgba(15, 23, 42, .3); }
.vw-undo-bar .vw-undo { margin: 0; border: 0; border-radius: 7px; padding: 6px 12px; background: #334155; color: #f8fafc; font: inherit; font-weight: 600; cursor: pointer; }
.vw-undo-bar .vw-undo:hover, .vw-undo-bar .vw-undo:focus-visible { background: #475569; outline: 2px solid #93c5fd; outline-offset: 1px; }
@media (prefers-reduced-motion: reduce) { .vw-sorting > [data-vw], .vw-dropping { transition: none !important; } }
