/* tools/shared/tool.css — the three standalone tools share one look. SHELL TOKENS ONLY (no hard-coded colours), so the
   fleet header's light/dark switch (documentElement[data-theme]) drives everything, tables included. */
.wrap.tool { max-width: 100%; margin: 0 auto; padding: 12px 18px 70px; box-sizing: border-box; overflow-x: hidden; }
.thead { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 8px 0 14px; }
.thead h1 { font-size: 22px; margin: 0 0 4px; color: var(--fg); }
.thead .sub { color: var(--muted); font-size: 12.5px; max-width: 860px; }
.spendbox { font-size: 12px; text-align: right; min-width: 220px; line-height: 1.5; }
.spendbox b { color: var(--fg); }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius, 10px); padding: 12px 14px; margin: 0 0 14px; min-width: 0; }
.cardhead { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.cardhead b { font-size: 14px; color: var(--fg); }
.cardhead .muted { font-size: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; position: relative; }
.row input, .row select { background: var(--bg); color: var(--fg); border: 1px solid var(--border); border-radius: 7px; padding: 7px 9px; font-size: 12.5px; min-width: 220px; }
.wrap.tool button { background: var(--muted-bg); color: var(--fg); border: 1px solid var(--border); border-radius: 7px; padding: 6px 11px; font-size: 12.5px; cursor: pointer; }
.wrap.tool button:hover { border-color: var(--accent); }
.wrap.tool button.primary { background: var(--accent); color: #fff; border-color: transparent; font-weight: 700; }
.wrap.tool button:disabled { opacity: .45; cursor: not-allowed; }
.small { font-size: 11.5px; } .muted { color: var(--muted); }
.hits { position: absolute; top: 40px; left: 232px; z-index: 20; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; min-width: 320px; max-height: 260px; overflow: auto; box-shadow: var(--shadow-lg); }
.hits div { padding: 6px 10px; cursor: pointer; font-size: 12.5px; } .hits div:hover { background: var(--row-hover); }
/* queue */
.queue { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px; }
.qgroup { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; background: var(--row-alt); min-width: 0; }
.qgroup h3 { margin: 0 0 6px; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; }
.qgroup.running h3 { color: var(--info); } .qgroup.needs_you h3 { color: var(--warn); } .qgroup.blocked h3 { color: var(--danger); } .qgroup.ready h3 { color: var(--ok); } .qgroup.evidence_only h3, .qgroup.done h3 { color: var(--muted); }
.qitem { padding: 6px 0; border-top: 1px dashed var(--border); font-size: 12.5px; }
.qitem:first-of-type { border-top: 0; }
.qitem a { color: var(--fg); font-weight: 700; text-decoration: none; } .qitem a:hover { color: var(--accent); }
.qitem .why { color: var(--muted); font-size: 11.5px; }
.qitem .since { color: var(--muted); font-size: 11px; float: right; }
/* product workspace */
.phead { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 6px 0 2px; }
.phead h1 { font-size: 21px; margin: 0; color: var(--fg); }
.phead .score { font-size: 30px; font-weight: 800; line-height: 1; color: var(--fg); }
.kv { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin: 4px 0 10px; }
.kv b { color: var(--fg); }
.kv .tg { cursor: pointer; border-bottom: 1px dotted var(--muted); }
.kv .tg:hover { color: var(--accent); }
.now { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.now .state, .state { font-size: 11px; font-weight: 800; letter-spacing: .05em; padding: 4px 10px; border-radius: 14px; }
.state.running { background: var(--info-bg); color: var(--info); } .state.needs_you { background: var(--warn-bg); color: var(--warn); }
.state.blocked { background: var(--danger-bg, var(--warn-bg)); color: var(--danger); } .state.ready { background: var(--ok-bg); color: var(--ok); } .state.evidence_only, .state.done { background: var(--muted-bg); color: var(--muted); }
.actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.tabs { display: flex; gap: 4px; margin: 12px 0 8px; flex-wrap: wrap; }
.tabs button { border-radius: 8px 8px 0 0; }
.tabs button.on { background: var(--accent); color: #fff; border-color: transparent; font-weight: 700; }
.pane { display: none; min-width: 0; } .pane.on { display: block; }
.runlog { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; background: var(--bg); color: var(--fg); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; max-height: 220px; overflow: auto; white-space: pre-wrap; }
.drawer { position: fixed; top: 0; right: 0; width: min(560px, 96vw); height: 100vh; background: var(--panel); color: var(--fg); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); z-index: 1000; padding: 14px 16px; overflow: auto; }
.drawer h2 { margin: 0 0 6px; font-size: 16px; } .drawer .close { float: right; }
.drawer table { width: 100%; border-collapse: collapse; font-size: 12px; } .drawer td, .drawer th { padding: 4px 6px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.drawer .caveat { color: var(--warn); font-size: 12px; }
.need { border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px; margin: 6px 0; background: var(--row-alt); }
.need b { color: var(--fg); } .need .m { color: var(--muted); font-size: 12px; }
.need .bar { height: 5px; background: var(--muted-bg); border-radius: 3px; margin-top: 5px; } .need .bar i { display: block; height: 5px; background: var(--accent); border-radius: 3px; }
/* grids: the table scrolls inside its own box (both axes); the page never scrolls sideways */
.gridwrap, #grid, #offersGrid, #reviewsGrid, #marketsGrid, #variantsGrid { max-width: 100%; min-width: 0; overflow: auto; }

/* native form controls (select option lists, date pickers, scrollbars) follow the theme — without this Chrome paints
   the dropdown LIST white on a dark page */
:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }
.wrap.tool select, .wrap.tool input, .wrap.tool textarea, .tabulator .tabulator-header-filter select, .tabulator .tabulator-header-filter input { color-scheme: inherit; }
.wrap.tool select option { background: var(--bg); color: var(--fg); }
