:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --border: #dde1e6;
  --text: #1f2430;
  --muted: #6b7280;
  --accent: #2f6fed;
  --accent-dark: #1f4fb0;
  --danger: #c62828;
  --danger-bg: #fdecea;
  --ok-bg: #eaf6ec;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
}

.brand-logo { height: 28px; }

nav a {
  margin-left: 18px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
}
nav a:hover { color: var(--accent); }

main {
  max-width: 820px;
  margin: 32px auto;
  padding: 0 20px 60px;
}

h1 { font-size: 1.5rem; margin-bottom: 4px; }
.subtitle { color: var(--muted); margin-top: 0; margin-bottom: 24px; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: var(--text);
  display: block;
}
.card:hover { border-color: var(--accent); }
.card h2 { font-size: 1.05rem; margin: 0 0 6px; }
.card p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.card .tag {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 100px;
  background: var(--ok-bg);
  color: #1e6b34;
}
.card .tag.destructive { background: var(--danger-bg); color: var(--danger); }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
}

label { display: block; font-weight: 600; font-size: 0.85rem; margin: 14px 0 4px; }
label:first-child { margin-top: 0; }
input[type=text], textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
}
.hint { color: var(--muted); font-size: 0.8rem; margin-top: 4px; }

.checkbox-row { display: flex; align-items: center; gap: 8px; margin: 14px 0; }
.checkbox-row input { width: auto; }
.checkbox-row label { margin: 0; font-weight: 500; }

button, .button {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: 6px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  margin-top: 16px;
}
button:hover, .button:hover { background: var(--accent-dark); }
button.danger, .button.danger { background: var(--danger); }
button.danger:hover { background: #a11f1f; }
button.secondary, .button.secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }

.error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #f3c2bd;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 18px;
  font-size: 0.9rem;
}

.warning {
  background: #fff6e5;
  color: #8a5a00;
  border: 1px solid #f2d489;
  border-radius: 8px;
  padding: 12px 14px;
  margin: 14px 0;
  font-size: 0.88rem;
}

pre.output {
  background: #16181d;
  color: #e6e6e6;
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.82rem;
  white-space: pre-wrap;
  word-break: break-word;
}

table { width: 100%; border-collapse: collapse; margin: 12px 0 20px; font-size: 0.88rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; }

.confirm-word { font-family: monospace; background: #f0f1f3; padding: 2px 6px; border-radius: 4px; }

/* ---- V2: Launch from Form ---- */
.panel h2 { font-size: 1.05rem; margin: 0 0 10px; }
.muted-inline { color: var(--muted); font-weight: 400; font-size: 0.85rem; }
.segmented { display: flex; flex-wrap: wrap; gap: 8px; }
.segmented label {
  margin: 0; font-weight: 500; font-size: 0.9rem;
  border: 1px solid var(--border); border-radius: 6px; padding: 6px 12px; cursor: pointer;
}
.segmented label:has(input:checked) { border-color: var(--accent); background: #eef3fe; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; }
.pick-col h3 { font-size: 0.85rem; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.pick { font-weight: 400; font-size: 0.9rem; margin: 4px 0; display: flex; align-items: center; gap: 6px; }
.type-tag { font-size: 0.7rem; color: var(--muted); background: #f0f1f3; border-radius: 100px; padding: 0 6px; }
.count { color: var(--accent); }
.inline-row { display: flex; gap: 8px; align-items: stretch; }
.inline-row button { margin-top: 0; white-space: nowrap; }
.dropdown { margin-top: 10px; }
.dropdown-toggle {
  margin-top: 0; width: 100%; text-align: left; background: var(--panel); color: var(--text);
  border: 1px solid var(--border); font-weight: 500;
}
.dropdown-toggle:hover { background: #f8f9fb; }
.dropdown-panel { border: 1px solid var(--border); border-top: none; border-radius: 0 0 6px 6px; padding: 8px; }
#folder-list { max-height: 320px; overflow-y: auto; margin-top: 8px; }
.tree-row { font-weight: 400; font-size: 0.9rem; margin: 0; padding: 4px 8px; display: flex; align-items: center; gap: 6px; border-radius: 4px; cursor: pointer; }
.tree-row:hover { background: #f5f6f8; }
.tree-row.covered { color: var(--muted); }

[hidden] { display: none !important; }

/* ---- V2: Settings ---- */
.ok { background: var(--ok-bg); color: #1e6b34; border: 1px solid #b9e0c2; border-radius: 8px; padding: 12px 14px; margin-bottom: 18px; font-size: 0.9rem; }
.warn-panel { border-color: #f2d489; background: #fffaf0; }
.pill { font-size: 0.7rem; background: var(--ok-bg); color: #1e6b34; border-radius: 100px; padding: 1px 8px; }
button.small { padding: 4px 10px; font-size: 0.8rem; margin-top: 0; }
.inline-form { margin: 0; }
.good { color: #1e6b34; }
.bad { color: var(--danger); }
.token-status { font-size: 0.88rem; margin: 2px 0 8px; }
code.key { font-weight: 400; font-size: 0.72rem; color: var(--muted); background: #f0f1f3; padding: 1px 5px; border-radius: 4px; margin-left: 6px; }
.test-result { font-size: 0.82rem; margin: 4px 0 0; }
input[type=password] { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 0.95rem; font-family: inherit; }
button.small { white-space: nowrap; }

/* ---- V2: API key profiles ---- */
.keybar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 7px 24px; font-size: 0.85rem; color: var(--text); text-decoration: none;
  background: color-mix(in srgb, var(--key-colour) 9%, white);
  border-bottom: 2px solid var(--key-colour);
}
.keybar:hover .keybar-switch { text-decoration: underline; }
.keybar-switch { margin-left: auto; color: var(--accent); font-size: 0.8rem; }
.keybar-bad { background: var(--danger-bg); border-bottom-color: var(--danger); }
.key-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--key-colour); display: inline-block; flex: none; }
.muted { color: var(--muted); }
.key-card { border: 1px solid var(--border); border-left: 4px solid var(--key-colour); border-radius: 8px; padding: 14px 16px; margin: 12px 0; }
.key-card.is-active { background: color-mix(in srgb, var(--key-colour) 5%, white); }
.key-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.key-label { font-size: 1rem; }
.pill-bad { background: var(--danger-bg); color: var(--danger); }
.pill-warn { background: #fff6e5; color: #8a5a00; }
.key-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 6px 18px; margin: 10px 0 4px; font-size: 0.86rem; }
.key-grid .k { display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); }
.key-notes { font-size: 0.85rem; color: var(--muted); margin: 6px 0 0; font-style: italic; }
.key-actions { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.switch-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
label.tiny { font-size: 0.75rem; font-weight: 400; margin: 0; color: var(--muted); display: flex; gap: 4px; align-items: center; }
details.key-edit[open] { flex-basis: 100%; }
details.key-edit[open] { border-top: 1px dashed var(--border); padding-top: 8px; }
details > summary { list-style: none; display: inline-block; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
details.key-edit summary.button { margin-top: 0; }
details.add-key { margin-top: 14px; }
details.add-key[open] > summary { margin-bottom: 6px; }
.delete-form { margin-top: 14px; border-top: 1px dashed var(--border); padding-top: 8px; }
.swatches { display: flex; gap: 8px; }
.swatch { width: 22px; height: 22px; border-radius: 50%; background: var(--c); margin: 0; cursor: pointer; display: grid; place-items: center; }
.swatch input { appearance: none; margin: 0; width: 100%; height: 100%; border-radius: 50%; cursor: pointer; }
.swatch input:checked { outline: 2px solid var(--text); outline-offset: 2px; }
input[type=date] { padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px; font-family: inherit; }
.button.small { padding: 4px 10px; font-size: 0.8rem; margin-top: 0; white-space: nowrap; }

/* ---- V2: Formula Audit ---- */
select { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 0.95rem; font-family: inherit; background: #fff; }
.warn-text { color: #8a5a00; }
button:disabled { opacity: 0.6; cursor: not-allowed; }
.panel details > summary.button { margin-top: 6px; }
.panel details[open] > summary.button { margin-bottom: 4px; }

/* ---- V3: background runs + Force Stop ---- */
.job-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.job-head h1 { margin-bottom: 4px; }
.job-status { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; padding: 2px 10px; border-radius: 100px; background: #eef3fe; color: var(--accent-dark); }
.status-running { background: #eef3fe; color: var(--accent-dark); }
.status-stopping { background: #fff6e5; color: #8a5a00; }
.status-done { background: var(--ok-bg); color: #1e6b34; }
.status-stopped { background: #fff6e5; color: #8a5a00; }
.status-error { background: var(--danger-bg); color: var(--danger); }
.job-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.job-actions button, .job-actions .button { margin-top: 0; }
.job-actions .follow { margin-left: auto; }
pre.job-log { max-height: 60vh; overflow-y: auto; margin-bottom: 0; }
.runbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 7px 24px; font-size: 0.85rem; background: #fff6e5; border-bottom: 1px solid #f2d489; }
.runbar a { color: var(--accent); margin-left: auto; }
.run-dot { width: 9px; height: 9px; border-radius: 50%; background: #e09b00; display: inline-block; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }


/* =====================================================================
   V4.1
   ===================================================================== */

/* ---- hamburger menu (top right) ---- */
.topbar { position: sticky; top: 0; z-index: 20; }
.menu-wrap { position: relative; }
.menu-btn {
  margin: 0; display: inline-flex; align-items: center; gap: 8px;
  background: var(--panel); color: var(--text); border: 1px solid var(--border);
  padding: 7px 12px; border-radius: 8px; font-weight: 600;
}
.menu-btn:hover, .menu-btn.open { background: #eef3fe; border-color: var(--accent); color: var(--accent-dark); }
.menu-icon { display: inline-grid; gap: 3px; width: 16px; }
.menu-icon span { display: block; height: 2px; border-radius: 2px; background: currentColor; transition: transform .15s, opacity .15s; }
.menu-btn.open .menu-icon span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.menu-btn.open .menu-icon span:nth-child(2) { opacity: 0; }
.menu-btn.open .menu-icon span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px); width: 270px; max-height: calc(100vh - 90px); overflow-y: auto;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(20, 30, 50, .14); padding: 8px; z-index: 30;
}
.menu-group { padding: 4px 0; }
.menu-group + .menu-group { border-top: 1px solid var(--border); }
.menu-group-title { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 6px 10px 2px; }
.menu-panel a { display: block; margin: 0; padding: 7px 10px; border-radius: 6px; color: var(--text); text-decoration: none; font-size: .92rem; }
.menu-panel a:hover { background: #f1f4fa; color: var(--accent-dark); }
.menu-panel a.current { background: #eef3fe; color: var(--accent-dark); font-weight: 600; }

main.wide { max-width: 1180px; }

/* ---- page head with an add button ---- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.add-btn { margin-top: 6px; white-space: nowrap; }
.section-title { font-size: 1.05rem; margin: 30px 0 0; color: var(--muted); font-weight: 600; }

/* ---- home metrics ---- */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.metric {
  display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--text);
  background: var(--panel); border: 1px solid var(--border); border-top: 3px solid var(--accent);
  border-radius: var(--radius); padding: 14px 16px;
}
.metric:hover { border-color: var(--accent); }
.metric-bad { border-top-color: var(--danger); }
.metric-warn { border-top-color: #e09b00; }
.metric-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.metric-value { font-size: 2rem; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.metric-bad .metric-value { color: var(--danger); }
.metric-warn .metric-value { color: #8a5a00; }
.metric-sub { font-size: .76rem; color: var(--muted); }
.metrics-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.metrics-foot button { margin-top: 0; }
.breakdown { font-size: .82rem; margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bd-item { background: var(--panel); border: 1px solid var(--border); border-radius: 100px; padding: 1px 10px; }

/* ---- forms ---- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; }
.form-grid label { margin-top: 12px; }
.tick-row { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 14px 0 4px; }
.tick-row label { margin: 0; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.tick-row .tag { font-size: .7rem; padding: 1px 7px; border-radius: 100px; }
.tag.destructive { background: var(--danger-bg); color: var(--danger); }
.lookup { font-size: .8rem; margin: 4px 0 0; min-height: 1em; }
.lookup strong { font-weight: 600; }
.open-link { font-size: .82rem; margin-left: 6px; color: var(--accent); }
.small-text { font-size: .8rem; }
.reg-summary { background: #f6f8fc; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: .86rem; margin-bottom: 6px; }
.client-picks { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; max-height: 260px; overflow-y: auto; }
details.extras { margin-top: 14px; }
details.extras[open] > summary { margin-bottom: 4px; }
details.help { margin: 8px 0; font-size: .85rem; }
details.help > summary { color: var(--accent); cursor: pointer; }
details.help ul { margin: 6px 0; padding-left: 20px; color: var(--muted); }

/* ---- Client Registry table ---- */
.table-scroll { overflow-x: auto; }
.clients-table td.c, .clients-table th.c { text-align: center; }
.clients-table tr.inactive-row td { color: var(--muted); }
.clients-table tr.edit-row > td { background: #f8f9fb; }
.clients-table .ws-open { font-size: .8rem; }

/* ---- Settings: collapsed API keys ---- */
details.key-card > summary.key-head { cursor: pointer; list-style: none; }
details.key-card > summary.key-head::-webkit-details-marker { display: none; }
.key-chevron { color: var(--muted); font-size: .8rem; width: 10px; transition: transform .15s; display: inline-block; }
details.key-card[open] > summary .key-chevron { transform: rotate(90deg); }
.key-email { font-size: .85rem; }
.key-more { margin-left: auto; font-size: .78rem; }
details.key-card[open] > summary .key-more { visibility: hidden; }
details.key-card { padding: 10px 16px; }
details.key-card[open] { padding-bottom: 14px; }
.pill-night { background: #ede9fe; color: #5b21b6; }
.nightly-form select { max-width: 460px; }
.nightly-form button { margin-top: 0; }

/* ---- Automation Audit: where saved ---- */
.saved-where td:first-child { width: 36%; }

/* ---- Smartsheet Dashboards ---- */
.dash-tabs { display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 0; }
.dash-tab {
  margin: 0; background: transparent; color: var(--muted); border: 1px solid transparent; border-bottom: none;
  border-radius: 8px 8px 0 0; padding: 8px 14px; font-weight: 600;
}
.dash-tab:hover { background: #eef1f6; color: var(--text); }
.dash-tab.on { background: var(--panel); color: var(--accent-dark); border-color: var(--border); margin-bottom: -1px; }
.dash-pane { background: var(--panel); border: 1px solid var(--border); border-top: none; border-radius: 0 0 var(--radius) var(--radius); padding: 10px; }
.dash-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.dash-bar button, .dash-bar .button { margin-top: 0; }
.dash-bar .open-link { margin-left: 0; margin-right: auto; }
details.dash-edit[open] { flex-basis: 100%; border-top: 1px dashed var(--border); padding-top: 8px; }
.dash-frame { width: 100%; border: 0; border-radius: 6px; background: #f8f9fb; display: block; }

@media (max-width: 640px) {
  .topbar { padding: 10px 16px; }
  main { padding: 0 16px 48px; margin-top: 20px; }
  .menu-label { display: none; }
  .page-head { flex-direction: column; }
  .keybar, .runbar { padding-left: 16px; padding-right: 16px; }
}

/* ---- Phase 1: sign-in, account and user management ---- */
input[type=email], input[type=password], select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
}
.auth-main { max-width: 440px; }
.auth-panel h1 { margin-top: 0; }
.auth-panel ol { padding-left: 20px; }
.qr { margin: 12px 0; }
.qr img { display: block; background: #fff; padding: 8px; border: 1px solid var(--border); border-radius: 8px; }
code.secret { display: inline-block; margin-top: 6px; word-break: break-all; font-size: .9rem; }
pre.codes { font-size: 1.05rem; letter-spacing: .04em; }
.row-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row-form input, .row-form select { width: auto; flex: 1 1 160px; }
.row-form button { margin-top: 0; }
td.actions { display: flex; flex-wrap: wrap; gap: 6px; }
td.actions button { margin-top: 0; }
.link-button {
  display: block; width: 100%; text-align: left; margin: 0; padding: 7px 10px; border-radius: 6px;
  background: transparent; color: var(--text); font-weight: 400; font-size: .92rem;
}
.link-button:hover { background: #f1f4fa; color: var(--accent-dark); }
@media (max-width: 600px) { .row-form input, .row-form select { flex-basis: 100%; } }

/* Deletion Control */
.dc-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.dc-actions .inline-form button { margin-top: 0; }
label.inline { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; margin: 8px 12px 8px 0; }
label.inline input { width: auto; margin: 0; }

/* Deletion Control: monitored sheets grouped per client (13/11/2026) */
details.dc-group { border: 1px solid var(--border, #e2e5ea); border-radius: 8px; margin: 0 0 8px; background: #fff; }
details.dc-group > summary { cursor: pointer; padding: 10px 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; list-style: none; }
details.dc-group > summary::-webkit-details-marker { display: none; }
details.dc-group > summary::before { content: "▸"; color: #888; display: inline-block; width: 1em; text-align: center; transition: transform .15s; }
details.dc-group[open] > summary::before { transform: rotate(90deg); }
details.dc-group > summary:hover { background: #f7f8fa; border-radius: 8px; }
details.dc-group .table-scroll { padding: 0 12px 8px; }

/* ======================================================================
   Home page (13/11/2026): grouped by risk -- Check / Maintain / Build /
   Clean up -- with tinted icons and badges, "things need you" and Recent runs.
   ====================================================================== */
main.home { max-width: 1000px; }
.home-title { font-size: 1.75rem; letter-spacing: -.01em; margin: 0 0 2px; }

/* things need you */
.attention { background: #fffbeb; border: 1px solid #f3d27a; border-radius: var(--radius); margin: 0 0 26px; overflow: hidden; }
.attention-head { display: flex; align-items: center; gap: 8px; padding: 10px 16px; font-weight: 600; font-size: .9rem; color: #7a4d00; border-bottom: 1px solid #f6e2a8; }
.attention-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 16px; font-size: .88rem; color: #5c4300; }
.attention-row + .attention-row { border-top: 1px solid #f6e2a8; }
.attention-row .button { margin-top: 0; background: #fff; color: var(--text); border-color: #d9c48a; white-space: nowrap; }
.attention-row .button:hover { background: #fff8e1; }

/* groups */
.tool-group { margin-bottom: 26px; }
.group-title { font-size: 1rem; margin: 0 0 10px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.group-title span { font-size: .78rem; font-weight: 400; color: var(--muted); }
.tool-grid { display: grid; gap: 12px; }
.tool-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tool-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tool-grid.narrow { max-width: 640px; }
.two-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }

/* tool cards */
.tool {
  display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 14px 12px; color: var(--text); text-decoration: none;
  transition: border-color .12s, box-shadow .12s;
}
a.tool:hover { border-color: #b9c6f5; box-shadow: 0 4px 14px rgba(47, 76, 180, .08); }
.tool-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.tool h3 { font-size: .92rem; margin: 0 0 4px; }
.tool p { font-size: .8rem; color: var(--muted); margin: 0 0 12px; line-height: 1.45; flex: 1; }
.tool-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .76rem; }
.tool-meta { color: var(--muted); }
.tool-go { color: var(--accent); font-weight: 600; white-space: nowrap; }
.tool.danger .tool-go { color: var(--danger); }
.tool-foot.chips { justify-content: flex-start; gap: 6px; }
.chip { font-size: .74rem; padding: 2px 9px; border: 1px solid #c9d4f5; border-radius: 6px; color: var(--accent-dark); text-decoration: none; background: #f6f8ff; }
.chip:hover { background: #eaf0ff; border-color: var(--accent); }

.tool-icon { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; background: #eef2ff; color: #4f46e5; flex: none; }
.tool-icon.danger { background: var(--danger-bg); color: var(--danger); }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .68rem; font-weight: 600; padding: 2px 8px; border-radius: 100px; white-space: nowrap; }
.badge svg { width: 11px; height: 11px; }
.badge-indigo { background: #eef2ff; color: #4338ca; }
.badge-violet { background: #f3e8ff; color: #6b21a8; }
.badge-green { background: #e8f7ee; color: #1e6b34; }
.badge-amber { background: #fff4e0; color: #9a5b00; }
.badge-grey { background: #eef0f3; color: #4b5563; }
.badge-red { background: var(--danger-bg); color: var(--danger); }

/* clean up */
.danger-zone { background: #fff7f7; border: 1px solid #f3c7c7; border-radius: var(--radius); padding: 16px; margin-bottom: 26px; }
.danger-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.danger-head h2 { font-size: 1rem; margin: 2px 0 2px; color: #8f1d1d; }
.danger-head p { margin: 0; font-size: .8rem; color: #8a4b4b; }
.danger-zone .tool { border-color: #f1d3d3; }
.danger-zone a.tool:hover { border-color: #e9a3a3; box-shadow: 0 4px 14px rgba(198, 40, 40, .08); }

/* recent runs */
.recent { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px 6px; }
.recent-head { display: flex; align-items: center; justify-content: space-between; }
.recent-head h2 { font-size: .95rem; margin: 0; }
.recent-head a { font-size: .8rem; color: var(--accent); }
.recent-table { margin: 8px 0 8px; font-size: .82rem; }
.recent-table th { font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; text-align: left; }
.recent-table td.strong { font-weight: 600; }
.recent-table td.result-bad { color: var(--danger); }

@media (max-width: 900px) {
  .tool-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-groups { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .tool-grid.four, .tool-grid.two { grid-template-columns: 1fr; }
  .attention-row { flex-direction: column; align-items: flex-start; }
}

/* Settings: name and branding */
.branding-form { display: grid; grid-template-columns: 1fr 2fr auto; gap: 0 12px; align-items: end; }
.branding-form button { margin-top: 0; }
@media (max-width: 700px) { .branding-form { grid-template-columns: 1fr; } }
