/* Boardwell's shared look, used by every Power-Up (Insights in table.css, the File Viewer in
   viewer/viewer.css): colour tokens for both themes, buttons, dropdowns and icon buttons. Each page
   loads this first and adds only its own parts. */
:root {
  color-scheme: light;
  --bg: #ffffff; --fg: #172b4d; --muted: #5e6b82; --line: #dcdfe4; --panel: #f7f8f9;
  --accent: #0c66e4; --accent-fg: #ffffff; --hover: #e9f2ff; --error: #ae2e24; --code: #f1f2f4;
  --kw: #0055cc; --fn: #6e5dc6; --str: #216e4e; --num: #a54800;
  /* Chart colors: categorical slots 1-2 and the critical status color, validated per theme. */
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --critical: #d03b3b; --warn: #a54800; --ok: #216e4e; --warn-bg: #fff7d6; --warn-line: #f5cd47; --track: #f1f2f4; --tip-bg: #172b4d; --tip-fg: #ffffff;
}
/* Dark follows Trello's own theme (data-theme, set from the Power-Up context in theme.ts), and the
   OS setting until that is known. color-scheme makes native menus and scrollbars match. */
:root[data-theme="dark"] { --bg: #1d2125; --fg: #dee4ea; --muted: #9fadbc; --line: #384148; --panel: #22272b;
    --accent: #579dff; --accent-fg: #1d2125; --hover: #1c2b41; --error: #fd9891; --code: #2c333a;
    --kw: #85b8ff; --fn: #b8acf6; --str: #7ee2b8; --num: #fea362;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --critical: #e66767; --warn: #fea362; --ok: #7ee2b8; --warn-bg: #332e1b; --warn-line: #7f5f01; --track: #2c333a; --tip-bg: #dee4ea; --tip-fg: #1d2125;
    color-scheme: dark; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #1d2125; --fg: #dee4ea; --muted: #9fadbc; --line: #384148; --panel: #22272b;
    --accent: #579dff; --accent-fg: #1d2125; --hover: #1c2b41; --error: #fd9891; --code: #2c333a;
    --kw: #85b8ff; --fn: #b8acf6; --str: #7ee2b8; --num: #fea362;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --critical: #e66767; --warn: #fea362; --ok: #7ee2b8; --warn-bg: #332e1b; --warn-line: #7f5f01; --track: #2c333a; --tip-bg: #dee4ea; --tip-fg: #1d2125;
    color-scheme: dark; }
}
/* Boardwell's brand colours, the same in both themes: the icons' blue, lime, graphite and paper. */
:root { --brand: #3559e8; --brand-fg: #ffffff; --lime: #d5f52b; --graphite: #202326; --paper: #f7f7ee; }
* { box-sizing: border-box; }
body { background: var(--bg); color: var(--fg); font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
/* a.btn is a link drawn as a button (the marketing site's "Add to Trello free"). */
button, a.btn { font: inherit; color: var(--fg); background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 5px 10px; cursor: pointer; }
a.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; }
button:hover:not(:disabled), a.btn:hover { background: var(--hover); }
button:disabled { opacity: .5; cursor: default; }
button.primary, a.btn.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
button.primary:hover:not(:disabled), a.btn.primary:hover { background: var(--accent); filter: brightness(.92); }
/* On Boardwell blue (marketing hero, listing frames) the primary action is lime with graphite text. */
button.lime, a.btn.lime { background: var(--lime); color: var(--graphite); border-color: var(--lime); font-weight: 600; }
button.lime:hover:not(:disabled), a.btn.lime:hover { background: var(--lime); filter: brightness(.94); }
/* Text-like buttons ("All lists", "Edit") in the accent colour; pages size them. */
button.link { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; text-align: left; cursor: pointer; }
/* Destructive actions: a red primary button ("Delete 3 cards"), and Remove or Delete as a red text button. */
button.danger:not(.link) { background: var(--critical); border-color: var(--critical); color: #fff; }
button.danger:not(.link):hover:not(:disabled) { background: var(--critical); filter: brightness(.92); }
button.link.danger { color: var(--error); font-weight: 600; }
.muted { color: var(--muted); }
.error { color: var(--error); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }

/* ---------- dropdowns (web/src/table/select.ts) ----------
   Every select is a native <select>, so it keeps the OS menu, keyboard and screen-reader behaviour;
   only the closed control is drawn here, the same everywhere. The wrapper draws the chevron as a
   mask so it takes the text's colour in both themes. .pill rounds it among the Builder bar's chips,
   and .on marks a select that is narrowing what's shown. */
.select { position: relative; display: inline-flex; flex: none; max-width: 100%; vertical-align: middle; }
.select[hidden] { display: none; }
.select:has(> select[hidden]) { display: none; }
.select::after { content: ""; position: absolute; right: 10px; top: 50%; width: 10px; height: 10px; margin-top: -5px; pointer-events: none; background: var(--muted); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M1.5 3.5 5 7l3.5-3.5' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M1.5 3.5 5 7l3.5-3.5' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.select > select { appearance: none; -webkit-appearance: none; field-sizing: content; min-width: 0; max-width: 240px; height: 30px; padding: 0 30px 0 10px; font: inherit; font-size: 13px; font-weight: 500; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 4px; cursor: pointer; text-overflow: ellipsis; transition: background-color .12s, border-color .12s; }
.select > select:hover:not(:disabled) { background-color: var(--hover); border-color: color-mix(in srgb, var(--line) 50%, var(--muted)); }
/* Chrome counts a click on a select as keyboard focus, so the ring is a soft halo, not a heavy outline. */
.select > select:focus { outline: none; }
.select > select:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.select > select:disabled { opacity: .5; cursor: default; }
.select > select.on { color: var(--accent); background-color: var(--hover); border-color: var(--accent); font-weight: 600; }
.select > select.on:hover:not(:disabled) { border-color: var(--accent); }
.select:has(> select.on)::after { background: var(--accent); }
.select > select option { color: var(--fg); background: var(--bg); font-weight: 400; }
.select.pill > select { padding: 0 30px 0 12px; border-radius: 15px; }
.select.pill::after { right: 11px; }
/* Forced colours drop the halo, so keyboard focus gets a real outline there. */
@media (forced-colors: active) { .select > select { appearance: auto; padding-right: 6px; } .select::after { display: none; } .select > select:focus-visible { outline: 2px solid Highlight; outline-offset: 1px; } }

/* ---------- icon buttons ---------- */
.icon-btn { display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; background: none; color: var(--muted); border-radius: 4px; flex: none; }
.icon-btn[aria-pressed="true"] { background: var(--hover); color: var(--accent); }
/* A neutral hover, so the blue of the open settings never looks stuck after the gear closes them. */
.icon-btn:hover:not(:disabled) { background: var(--code); color: var(--fg); }
.icon-btn[aria-pressed="true"]:hover:not(:disabled) { background: var(--hover); color: var(--accent); }
.icon-btn:disabled svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .icon-btn:disabled svg { animation: none; opacity: .5; } }

/* ---------- shared pieces ----------
   Small controls every Power-Up's windows use (Insights first, then Share): link buttons, danger
   buttons, segmented buttons, plan tags, labelled fields, choice tiles and Trello-coloured chips. */
.seg { display: inline-flex; flex: none; }
.seg button { white-space: nowrap; }
.seg button { border-radius: 0; }
.seg button:first-child { border-radius: 4px 0 0 4px; }
.seg button:last-child { border-radius: 0 4px 4px 0; border-left: 0; }
.seg button[aria-pressed="true"] { background: var(--hover); color: var(--accent); font-weight: 600; }
.empty { color: var(--muted); margin: 8px 0; }
.plan-tag { margin-left: 6px; padding: 0 5px; border-radius: 3px; font-size: 11px; font-weight: 600; background: var(--hover); color: var(--accent); }
/* ---------- shared Insights components, used by every Power-Up ----------
   Moved from table.css (2026-11-12) so new Power-Ups reuse them rather than copying them. */

/* Tabs along a window's header (Insights · Explore, Approvals' views). Moved from table.css (2026-11-15). */
.tabs { display: flex; gap: 2px; margin-right: 8px; }
.tabs button { border: 0; background: none; padding: 5px 12px; border-radius: 4px; font-weight: 600; color: var(--muted); }
.tabs button[aria-selected="true"] { background: var(--hover); color: var(--accent); }

/* Hints and quiet meta text. */
.hint { color: var(--muted); font-size: 12px; margin: 2px 6px 6px; }

/* A "?" beside a heading that explains it on hover or focus (Fields' List total column, 2026-11-15).
   <span class="info-tip"><button aria-describedby="x">?</button><span role="tooltip" id="x">…</span></span>.
   The tip opens below and to the left, so it fits beside a right-hand column. */
.info-tip { position: relative; display: inline-flex; vertical-align: middle; margin-left: 4px; text-transform: none; letter-spacing: 0; }
.info-tip > button { display: inline-grid; place-items: center; width: 16px; height: 16px; padding: 0; border: 1px solid currentColor; border-radius: 50%; background: none; color: var(--muted); font-size: 10px; font-weight: 700; line-height: 1; cursor: help; }
.info-tip > button:hover, .info-tip > button:focus-visible { color: var(--accent); }
.info-tip > [role="tooltip"] { position: absolute; top: calc(100% + 6px); right: -8px; z-index: 10; width: max-content; max-width: 240px; padding: 6px 8px; border-radius: 4px; background: var(--tip-bg); color: var(--tip-fg); font-size: 12px; font-weight: 400; line-height: 1.4; text-align: left; white-space: normal; visibility: hidden; opacity: 0; transition: opacity .12s; }
.info-tip:hover > [role="tooltip"], .info-tip:focus-within > [role="tooltip"] { visibility: visible; opacity: 1; }

/* Empty states: an icon in a soft circle, what's missing, one line on how things get here, and
   the next step. Approvals' tabs and settings first; moved here (2026-11-15) for the Files window. */
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 28px 24px; }
.empty-state-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--hover); color: var(--accent); margin-bottom: 4px; }
.empty-state-icon svg { width: 20px; height: 20px; }
.empty-state[hidden] { display: none; }
.empty-state p { margin: 0 0 10px; max-width: 480px; text-wrap: balance; }
/* A page area that can show an empty state in place of its content: the state sits at the optical
   centre of the space left (centred, a little above the middle). Peter, 2026-11-15. */
.empty-fill:has(> .empty-state:not([hidden])) { display: flex; flex-direction: column; }
.empty-fill > .empty-state { margin: auto; padding-bottom: 12vh; }

/* Settings screens: side menu, section heading and lede, bordered groups, badge chips. */
.settings-nav { display: flex; flex-direction: column; gap: 2px; padding: 8px; border-right: 1px solid var(--line); background: var(--panel); overflow: auto; }
.settings-nav h2 { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 12px 6px 4px; }
.settings-nav h2:first-child { margin-top: 6px; }
.settings-nav button { text-align: left; border: 0; background: none; padding: 6px 8px; border-radius: 4px; font-weight: 500; }
.settings-nav button small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-nav button small:empty { display: none; }
.settings-nav button[aria-current="true"] { background: var(--hover); color: var(--accent); font-weight: 600; }
.settings-pane { overflow: auto; min-width: 0; }
.settings-pane > [hidden] { display: none !important; }
.settings-section { padding: 20px 28px 40px; max-width: 1040px; }
/* The top of a settings page: heading, lede and who it affects; the last save's result at the right. */
.settings-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.settings-head > div { flex: 1; min-width: 0; }
.settings-head .settings-lede { margin: 0; }
.settings-scope { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.settings-scope svg, .settings-saved svg { width: 14px; height: 14px; flex: none; }
.settings-saved { flex: none; display: inline-flex; align-items: center; gap: 6px; max-width: 50%; padding-top: 4px; font-size: 12px; color: var(--muted); }
.settings-saved svg { color: var(--ok); }
/* Bordered groups side by side when there is room (Plan, Privacy). */
.settings-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; align-items: start; }
.settings-cols .badges-group { margin: 0; }
.settings-section h2 { margin: 0 0 4px; font-size: 18px; }
.settings-section h3 { margin: 24px 0 4px; font-size: 14px; }
.settings-lede { margin: 0 0 14px; color: var(--muted); font-size: 13px; max-width: 64ch; }
.settings-section > p:not(.settings-lede) { font-size: 13px; margin: 0; }
.settings-section a { color: var(--accent); }
.badges-msg { margin: 0 0 12px; padding: 8px 12px; border-radius: 6px; background: var(--hover); font-size: 13px; }
.badges-group { margin-bottom: 20px; border: 1px solid var(--line); border-radius: 8px; padding: 4px 16px 12px; }
.badges-group h3 { margin: 12px 0 4px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.badges-group > p { margin: 0 0 10px; font-size: 13px; }
.badges-group > .hint { margin: 8px 0 4px; }
.hint.flush { margin: 0; }
/* A group's heading with an action at the right ("Reset to original"), and its row of buttons. */
.group-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.group-head .link { font-size: 13px; }
.group-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 4px 0; font-size: 13px; }
.group-actions a { color: var(--accent); }
.badge-chip { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 7px; border-radius: 3px; font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--badge-gray, #dfe1e6); color: #172b4d; }
/* A badge's monochrome icon, tinted like its text as Trello tints card-front icons: set --icon to url(...). */
.badge-chip .badge-icon { width: 14px; height: 14px; flex: none; background: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.badge-blue { background: #579dff; color: #fff; } .badge-sky { background: #6cc3e0; color: #172b4d; } .badge-green { background: #4bce97; color: #172b4d; }
.badge-lime { background: #94c748; color: #172b4d; } .badge-yellow { background: #f5cd47; color: #172b4d; } .badge-orange { background: #fea362; color: #172b4d; }
.badge-red { background: #f87168; color: #172b4d; } .badge-pink { background: #e774bb; color: #172b4d; } .badge-purple { background: #9f8fef; color: #172b4d; }
.page-field { display: grid; gap: 6px; border: 0; padding: 0; margin: 0; }
.page-field[hidden] { display: none; }
.page-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.page-field input:is(:not([type]), [type="password"], [type="url"]) { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--fg); background: var(--bg); }
/* The same soft focus halo as the dropdowns. */
.page-field input:is(:not([type]), [type="password"], [type="url"]):focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.page-tpls { display: flex; flex-wrap: wrap; gap: 6px; }
.page-tpls > .page-tpl { flex: 1 1 150px; }
.page-tpl { display: grid; gap: 2px; text-align: left; padding: 8px 10px; border-radius: 6px; background: var(--bg); }
.page-tpl small { color: var(--muted); font-size: 12px; }
.page-tpl[aria-checked="true"] { border-color: var(--accent); background: var(--hover); box-shadow: 0 0 0 1px var(--accent); }
.page-radio { font-size: 13px; display: flex; gap: 6px; align-items: center; }

/* Popovers and menus (Save…, autocomplete, totals). */
/* These set their own display, which would otherwise beat the hidden attribute. */
.save-pop[hidden], #save-step[hidden], .save-menu[hidden], .save-swatches[hidden], .save-card[hidden], .save-opt[hidden] { display: none; }
.save-pop { position: fixed; z-index: 20; width: 340px; max-width: calc(100vw - 24px); padding: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgb(9 30 66 / .18), 0 0 1px rgb(9 30 66 / .3); font-size: 13px; }
.save-menu { display: grid; gap: 2px; }
.save-opt { display: grid; grid-template-columns: 24px 1fr; gap: 2px 8px; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 6px; }
.save-opt .save-ic { grid-row: span 2; text-align: center; font-size: 15px; line-height: 20px; color: var(--muted); }
.save-opt b { font-weight: 600; }
.save-opt small { color: var(--muted); font-size: 12px; }
.save-opt:disabled { opacity: .5; }
.save-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.save-head { display: flex; align-items: center; gap: 6px; margin: 0 -6px 8px; padding: 2px 8px 8px; border-bottom: 1px solid var(--line); font-weight: 600; }
.save-back { border: 0; background: none; padding: 0 6px; font-size: 16px; color: var(--muted); }
.save-body { display: grid; gap: 10px; padding: 0 6px 6px; }
.save-body > input { font: inherit; width: 100%; padding: 6px 8px; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 4px; }
.save-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.save-swatches button { width: 22px; height: 22px; padding: 1px; border-radius: 5px; border: 2px solid transparent; background: none; }
.save-swatches button > span { display: block; width: 100%; height: 100%; border-radius: 3px; }
.save-swatches .badge-gray-swatch { background: var(--badge-gray, #dfe1e6); }
.save-swatches button[aria-checked="true"] { border-color: var(--fg); }
.save-swatches button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.save-card { display: grid; gap: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.save-card .chips { display: flex; flex-wrap: wrap; gap: 4px; }
.save-body .meta { font-size: 12px; }
.save-body .meta:empty { display: none; }
.save-acts { display: flex; justify-content: flex-end; gap: 8px; }

/* The code editor box with syntax colours (SQL in Explore, formulas in Fields) and its suggestions. */
textarea { width: 100%; height: 130px; resize: vertical; font: 13px/1.5 ui-monospace, Menlo, Consolas, monospace; color: var(--fg); background: var(--code); border: 1px solid var(--line); border-radius: 4px; padding: 8px; }
.suggest { position: absolute; z-index: 5; min-width: 180px; max-width: 360px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 4px 16px rgba(9, 30, 66, .18); overflow: hidden; }
.suggest[hidden] { display: none; }
.suggest-list { list-style: none; margin: 0; padding: 4px; max-height: 220px; overflow-y: auto; }
.suggest-list li { font: 13px/1.4 ui-monospace, Menlo, Consolas, monospace; padding: 3px 8px; border-radius: 4px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest-list li:hover { background: var(--hover); }
.suggest-list li.picked { background: var(--accent); color: var(--accent-fg); }
.suggest-table { float: right; margin-left: 16px; color: var(--muted); font: 12px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.suggest-list li.picked .suggest-table { color: inherit; opacity: .8; }
.suggest-foot { font-size: 11px; color: var(--muted); padding: 4px 10px; border-top: 1px solid var(--line); background: var(--panel); }
.suggest-plain .suggest-list li { font: 13px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; padding: 4px 8px; }
.suggest-list li.suggest-none { color: var(--muted); cursor: default; background: none; }
/* Picking board members by name: chips for the people picked, then a text box with suggestions. */
.picker { display: grid; gap: 6px; min-width: 0; }
.picker-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.picker-chips[hidden] { display: none; }
.picker-chip { display: inline-flex; align-items: center; gap: 2px; height: 26px; padding: 0 2px 0 10px; font-size: 13px; background: var(--code); border: 1px solid var(--line); border-radius: 13px; max-width: 100%; }
.picker-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-chip > .icon-btn { width: 20px; height: 20px; border-radius: 10px; font-size: 11px; }
.picker-field { position: relative; max-width: 320px; }
.picker-field > .input { width: 100%; }
.picker-field > .suggest { left: 0; right: 0; top: calc(100% + 4px); max-width: none; }
.code { position: relative; }
.code textarea { position: relative; z-index: 1; display: block; background: transparent; color: transparent; caret-color: var(--fg); white-space: pre-wrap; overflow-wrap: break-word; }
.code textarea::selection { background: rgba(87, 157, 255, .35); color: transparent; }
.code-hl { position: absolute; inset: 0; margin: 0; overflow: hidden; pointer-events: none; font: 13px/1.5 ui-monospace, Menlo, Consolas, monospace; padding: 8px; border: 1px solid transparent; border-radius: 4px; background: var(--code); color: var(--fg); white-space: pre-wrap; overflow-wrap: break-word; }
.t-kw { color: var(--kw); }
.t-fn { color: var(--fn); }
.t-str { color: var(--str); }
.t-num { color: var(--num); }
.t-com { color: var(--muted); }
mark.t-err { background: transparent; color: inherit; text-decoration: underline wavy var(--error); text-decoration-skip-ink: none; text-underline-offset: 3px; }
mark.t-err.t-id, mark.t-err.t-punct, mark.t-err.t-ws { color: var(--error); }
@media (forced-colors: active) { .code textarea { color: CanvasText; } .code-hl { display: none; } }

/* ---------- text inputs ----------
   The same frame as the dropdown: 30px high, the line colour, the soft accent halo on focus. Wrap
   an input in .input-affix to show a unit before or after it ("$", "/ hour"). */
.input, .input-affix { font: inherit; font-size: 13px; height: 30px; min-width: 0; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 4px; transition: border-color .12s; }
.input { padding: 0 10px; }
.input::placeholder, .input-affix input::placeholder { color: var(--muted); }
.input:hover:not(:disabled):not(:focus), .input-affix:hover:not(:focus-within) { border-color: color-mix(in srgb, var(--line) 50%, var(--muted)); }
.input:focus, .input-affix:focus-within { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.input:disabled, .input[readonly], .input-affix:has(input:disabled) { background: var(--panel); }
/* Several lines: the same frame, growing with its text. */
textarea.input { display: block; height: auto; min-height: 30px; padding: 5px 10px; font: inherit; font-size: 13px; line-height: 1.45; resize: vertical; background: var(--bg); }
textarea.input[readonly] { resize: none; }
.input-affix { display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; }
.input-affix > span { flex: none; color: var(--muted); }
.input-affix > input { flex: 1; min-width: 0; height: 100%; padding: 0; font: inherit; color: inherit; background: none; border: 0; outline: none; }
@media (forced-colors: active) { .input:focus, .input-affix:focus-within { outline: 2px solid Highlight; } }

/* ---------- results table (Insights' results, Explore, the Archive Manager) ----------
   Moved from table.css (2026-11-13) so every Power-Up draws tables the same way. */
/* The grid sits in a card that fits its content; wide results fill the panel and scroll. No overflow:
   hidden on the table, which would break the sticky header, so the corner cells carry the radius. */
.result table.grid { border-collapse: separate; border-spacing: 0; width: max-content; margin: 12px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; }
.grid thead tr > :first-child { border-top-left-radius: 5px; }
.grid thead tr > :last-child, .grid:not(.fill.sized) thead tr > :nth-last-child(2) { border-top-right-radius: 5px; }
.grid tbody tr:last-child > :first-child { border-bottom-left-radius: 5px; }
.grid tbody tr:last-child > :last-child, .grid:not(.fill.sized) tbody tr:last-child > :nth-last-child(2) { border-bottom-right-radius: 5px; }
.grid tbody tr:last-child > * { border-bottom: 0; }
.grid th, .grid td { border-bottom: 1px solid var(--line); padding: 6px 12px; text-align: left; vertical-align: middle; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid td.wide { max-width: 420px; }
.result table.grid.fill { min-width: calc(100% - 24px); }
.result table.grid:not(.fill).sized { min-width: 0; }
.grid .filler { display: none; padding: 0; max-width: none; }
.result table.grid.fill.sized .filler { display: table-cell; }
.result table.grid.fill th.num, .result table.grid.fill td.num { width: 1%; }
.grid thead th { position: sticky; top: 0; z-index: 2; background: var(--panel); padding: 0; border-bottom: 1px solid var(--line); font-weight: 600; }
.grid thead th .sort { display: flex; align-items: center; gap: 6px; width: 100%; padding: 7px 12px; border: 0; border-radius: 0; background: transparent; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; text-align: left; }
.grid thead th.num .sort { justify-content: flex-end; }
.grid thead th .sort:hover { color: var(--fg); background: var(--hover); }
.grid thead th .col-resize { position: absolute; top: 0; right: 0; z-index: 1; width: 8px; height: 100%; cursor: col-resize; touch-action: none; }
.grid thead th .col-resize::after { content: ""; position: absolute; top: 25%; bottom: 25%; left: 3px; width: 2px; border-radius: 1px; background: transparent; }
.grid thead th:hover .col-resize::after, .grid thead th .col-resize:focus-visible::after, body.resizing .col-resize::after { background: var(--line); }
.grid thead th .col-resize:hover::after, .grid thead th .col-resize:focus-visible::after { background: var(--accent); }
body.resizing, body.resizing * { cursor: col-resize !important; user-select: none; }
.grid thead th .arrow { opacity: 0; font-size: 12px; }
.grid thead th .sort:hover .arrow, .grid thead th .sort:focus-visible .arrow, .grid thead th.sorted .arrow { opacity: 1; }
.grid thead th.sorted .sort { color: var(--accent); }
.grid tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--panel) 60%, transparent); }
.grid tbody tr:hover td, .grid tbody tr:hover th { background: var(--hover); }
.grid .rownum { position: sticky; left: 0; z-index: 1; width: 1%; min-width: 36px; padding: 6px 8px; text-align: right; color: var(--muted); font-weight: 400; font-size: 11px; font-variant-numeric: tabular-nums; background: var(--bg); border-right: 1px solid var(--line); }
.grid thead .rownum { z-index: 3; background: var(--panel); padding: 7px 8px; }
.grid td.num { text-align: right; font-variant-numeric: tabular-nums; }
.grid td.null { color: var(--muted); font-style: italic; opacity: .7; }
.grid td.date { font-variant-numeric: tabular-nums; }
.grid td.flag { text-align: center; }
.grid td.flag .yes { color: var(--accent); font-weight: 600; }
.grid td.flag .no { color: var(--muted); }
.grid .chips { display: inline-flex; gap: 4px; }
.grid .chip { display: inline-block; padding: 0 7px; border-radius: 10px; background: var(--hover); color: var(--fg); font-size: 12px; line-height: 18px; }

/* ---------- tiles, column charts and the small table (Insights, SLA) ----------
   Moved from table.css (2026-11-15) so SLAs by Boardwell draws its numbers, weekly chart and
   lists the way Insights does. A tile is a .tile inside .tiles (the File Viewer has its own .tile). */
/* Flex, not a grid: a row that wraps shares the full width, so no tile sits beside an empty slot. */
.tiles { display: flex; flex-wrap: wrap; gap: 12px; }
.tiles > .tile { flex: 1 1 140px; min-width: 0; }
.tiles > .tile { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.tile-value { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; }
.tile-label { color: var(--muted); font-size: 12px; margin-top: 2px; }
.critical-text { color: var(--critical); }
.s1 { background: var(--s1); }
.s2 { background: var(--s2); }
.critical { background: var(--critical); }
.columns-chart { display: flex; flex-direction: column; gap: 8px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.columns { display: flex; align-items: stretch; gap: 4px; height: 170px; border-bottom: 1px solid var(--line); padding-top: 18px; }
.col-slot { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; }
.col-slot:hover { background: var(--hover); border-radius: 4px 4px 0 0; }
.col-group { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.col-wrap { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; width: 100%; max-width: 24px; }
.col { width: 100%; border-radius: 4px 4px 0 0; }
.col-value { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; margin-bottom: 2px; }
.col-label { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 4px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.columns-chart { padding-bottom: 20px; }
/* The first and last dates sit inside the chart instead of centered past its edges. */
.columns-chart:not(.named) .col-slot:first-child .col-label { left: 0; transform: none; }
.columns-chart:not(.named) .col-slot:last-child:not(:first-child) .col-label { left: auto; right: 0; transform: none; }
.columns-chart.named .col-label { left: 0; right: 0; transform: none; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.mini-wrap { overflow-x: auto; }
table.mini { border-collapse: collapse; width: 100%; font-size: 13px; }
table.mini th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 4px 8px; border-bottom: 1px solid var(--line); text-transform: capitalize; }
table.mini td { padding: 5px 8px; border-bottom: 1px solid var(--line); max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.mini td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.mini th.num { text-align: right; }
table.mini a { color: var(--accent); }

/* ---------- the Explore builder's sentence chips and popovers (Insights, SLA) ----------
   Moved from table.css (2026-11-15): SLA's targets are written with the same clickable sentence. */
/* The builder: a bar of where the rows come from and which to keep; the table's headings do the rest. */
.builder-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 2px 0 10px; font-size: 13px; }
.builder-bar .builder-limit { color: var(--muted); }
.builder-word { color: var(--muted); }
.builder-chip { display: inline-flex; align-items: center; height: 30px; padding: 0 2px 0 0; background: var(--hover); border: 1px solid transparent; border-radius: 15px; }
.builder-chip.unfinished { background: var(--bg); border: 1px dashed var(--line); }
.builder-chip.counted .builder-chip-text { padding-left: 12px; }
.builder-chip-edit { height: 100%; padding: 0 4px 0 12px; border: 0; border-radius: 15px 0 0 15px; background: none; font: inherit; color: var(--fg); cursor: pointer; }
.builder-chip-edit:hover strong, .builder-chip-edit:hover { color: var(--accent); }
.builder-chip-text strong { font-weight: 600; }
.builder-join { height: 24px; padding: 0 6px; border: 0; border-radius: 4px; background: none; font: inherit; color: var(--muted); text-decoration: underline dotted; text-underline-offset: 3px; cursor: pointer; }
.builder-join:hover { color: var(--accent); }
.builder-add { height: 30px; padding: 0 12px; border: 1px dashed var(--line); border-radius: 15px; background: none; font: inherit; color: var(--accent); cursor: pointer; }
.builder-add:hover { border-color: var(--accent); }
.builder-tip { margin-left: auto; white-space: nowrap; color: var(--muted); font-size: 12px; }
.builder-x { display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); line-height: 0; cursor: pointer; }
.builder-x svg { display: block; }
.builder-x:hover { background: var(--bg); color: var(--fg); }
.builder-note { margin: 0 0 8px; color: var(--muted); font-size: 12px; }
.builder-pop { position: fixed; z-index: 30; min-width: 220px; max-width: calc(100vw - 16px); padding: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgb(9 30 66 / .18), 0 0 1px rgb(9 30 66 / .3); font-size: 13px; }
.builder-menu { display: grid; gap: 1px; }
.builder-menu-title { padding: 6px 10px 4px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.builder-item { display: block; width: 100%; padding: 7px 10px; border: 0; border-radius: 4px; background: none; font: inherit; color: var(--fg); text-align: left; cursor: pointer; }
.builder-item:hover, .builder-item:focus-visible { background: var(--hover); }
.builder-menu-sep { margin: 4px 0; border: 0; border-top: 1px solid var(--line); }
.builder-fields { display: grid; gap: 1px; max-height: 320px; overflow-y: auto; }
.builder-find { margin: 2px 4px 6px; font: inherit; height: 30px; padding: 0 8px; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 4px; }
.builder-edit { display: grid; gap: 10px; width: 300px; max-width: 100%; padding: 0 4px 4px; }
.builder-edit .builder-menu-title { padding: 6px 6px 0; }
.builder-edit-body { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
/* Text boxes beside a select match it: same height, border, corners and focus halo. */
.builder-edit input { font: inherit; font-size: 13px; height: 30px; padding: 0 8px; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 4px; }
.builder-edit input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
@media (forced-colors: active) { .builder-edit input:focus { outline: 2px solid Highlight; outline-offset: 1px; } }
.builder-edit .builder-text { width: 170px; }
.builder-edit .builder-num { width: 72px; }
.builder-value { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.builder-unit { color: var(--muted); }
.builder-edit-acts { display: flex; align-items: center; gap: 6px; }
.builder-edit .builder-date { width: 140px; }
.builder-picks { display: grid; gap: 6px; width: 100%; }
.builder-edit-body:has(.builder-picks) { flex-direction: column; align-items: flex-start; }
.builder-chip.counted .builder-chip-edit .builder-chip-text { padding-left: 0; }
.builder-pick-list { display: grid; gap: 1px; max-height: 220px; overflow-y: auto; }
.builder-pick { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 4px; cursor: pointer; }
.builder-pick:hover { background: var(--hover); }
.builder-edit .builder-pick input { height: auto; margin: 0; }
.builder-group { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 2px 2px 2px 6px; border: 1px solid var(--line); border-radius: 18px; }
.builder-paren { color: var(--muted); }
.builder-add.small { height: 26px; padding: 0 10px; }
.builder-edit-acts .spacer { flex: 1; }
.builder-bool { width: 260px; }
.builder-bool .seg { display: flex; }
.builder-bool .seg button { flex: 1; }
.builder-bool .builder-edit-acts { padding: 0 2px; }
.builder-item:has(.builder-tick) { display: flex; }
.builder-tick { margin-left: auto; padding-left: 16px; color: var(--accent); }
@media (max-width: 600px) { .builder-tip { display: none; } }

/* The Boardwell plan (Board settings › Plan in Insights, and the Plan screen every other Power-Up opens). */
.badges-group > .plan-status { font-size: 18px; font-weight: 600; margin: 4px 0 8px; }
.plan-features { margin: 4px 0 8px; padding-left: 20px; font-size: 13px; }
.plan-features li { margin: 2px 0; }
.plan-intervals { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.plan-intervals label { display: flex; align-items: baseline; gap: 6px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.plan-intervals label:has(input:checked) { border-color: var(--accent); }
.plan-intervals small { color: var(--muted); }
.plan-prices { margin-top: 16px; }
.plan-prices tr.current td { font-weight: 600; }
/* A note that needs the buyer: the trial is ending, or the workspace has outgrown its price. A
   light fill, no stripe (Peter, 2026-11-16); `.with-clock` puts the clock beside it. */
.plan-notice { padding: 10px 12px; border-radius: 6px; background: var(--hover); }
.plan-notice.with-clock { display: flex; gap: 8px; align-items: flex-start; }
.plan-notice.with-clock::before { margin-top: 3px; color: var(--accent); }
/* The clock before a trial reminder: the Plan link in its last days, and the notice in Plan. */
.with-clock::before { content: ""; flex: none; display: inline-block; width: 14px; height: 14px; background: currentColor; -webkit-mask: var(--clock) center / contain no-repeat; mask: var(--clock) center / contain no-repeat; }
:root { --clock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='6.2' fill='none' stroke='black' stroke-width='1.6'/%3E%3Cpath d='M8 4.6V8l2.3 1.5' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); }
button.link.with-clock { display: inline-flex; align-items: center; gap: 5px; }
.settings-nav button small.with-clock { color: var(--accent); font-weight: 500; }
.settings-nav button small.with-clock::before { width: 12px; height: 12px; margin-right: 4px; vertical-align: -2px; }
/* The Plan window over a Power-Up's page (web/src/plan/PlanDialog.svelte). */
.plan-dialog { position: relative; border: 1px solid var(--line); border-radius: 10px; padding: 20px 24px; width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; color: var(--fg); background: var(--bg); box-shadow: 0 12px 32px rgba(9,30,66,.3); }
.plan-dialog::backdrop { background: rgba(9,30,66,.35); }
.plan-dialog .plan-close { position: absolute; top: 12px; right: 12px; }
/* The workspace's plan at the right end of a Power-Up's heading row (web/src/plan/open.ts): a chip
   naming the plan, then one link to the Plan window (Peter, 2026-11-16, option E). The chip is
   status only; the link is what you click. In a trial's last days the chip takes the accent colour
   and the clock. Inside an h2 the h2 becomes the row; a <span> around the h2's text keeps a long
   board name to one line. */
.plan-status { flex: none; margin-left: auto; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; line-height: 1.4; white-space: nowrap; }
.plan-status[hidden] { display: none; }
.plan-status button.link { font-size: 13px; font-weight: 500; }
.plan-status button.link.quiet { color: var(--muted); }
.plan-status button.link.quiet:hover { color: var(--accent); }
.plan-chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px 0 7px; border: 1px solid var(--line); border-radius: 11px; font-size: 12px; font-weight: 500; color: var(--fg); }
.plan-chip::before { content: ""; flex: none; width: 13px; height: 13px; background: currentColor; -webkit-mask: var(--plan-icon) center / contain no-repeat; mask: var(--plan-icon) center / contain no-repeat; }
.plan-chip.plan-free { --plan-icon: var(--plan-spark); }
.plan-chip.plan-paid { --plan-icon: var(--plan-ok); }
.plan-chip.plan-ending { --plan-icon: var(--clock); border-color: transparent; background: var(--hover); color: var(--accent); }
:root { --plan-spark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 1.8l1.3 3.5 3.5 1.3-3.5 1.3L8 11.4 6.7 7.9 3.2 6.6l3.5-1.3z'/%3E%3C/svg%3E"); --plan-ok: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='8' r='6.2'/%3E%3Cpath d='M5.4 8.2l1.8 1.8 3.4-3.8'/%3E%3C/svg%3E"); }
/* Beside a heading block in a flex header (Export, Share Links, Intake Forms): level with the h2's text. */
:not(h2) > .plan-status { margin-top: 1px; }
h2:has(> .plan-status) { display: flex; align-items: center; gap: 12px; }
h2:has(> .plan-status) > span:not(.plan-status) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
