/* The tools page, on top of style.css: white with UVA blue (#232D4B) and UVA orange (#E57200), in light and
   dark mode alike, so it stands apart from the course sheet and meetings pages. */
:root, :root:not([data-x]) {
  color-scheme: light;
  --bg: #ffffff; --card: #ffffff; --ink: #1b2238; --muted: #555d72; --line: #dcdfe6;
  --brand: #232d4b; --brand-2: #e57200; --brand-soft: #fdf1e6; --on-brand: #ffffff;
  --orange: #e57200; --orange-ink: #b35900; --orange-soft: #fdf1e6;
  --blue: #232d4b; --blue-soft: #e9ebf1;
  --good: #1b7a43; --good-soft: #e5f4ec; --bad: #b42318; --bad-soft: #fdecea;
  --warn: #8a5a00; --warn-soft: #fff4d6; --grey: #eef0f3;
  --shadow: 0 1px 2px rgba(35,45,75,.06), 0 4px 14px rgba(35,45,75,.07);
}
body { background: #ffffff; color: var(--ink); }

/* Header: UVA blue band with an orange rule */
.top { background: #232d4b; border-bottom: 5px solid #e57200; }
.logo rect { fill: #e57200; }
.role-pill { color: #fff; }
.btn.primary { background: #232d4b; border-color: #232d4b; color: #fff; }
.btn { border-color: #232d4b; color: #232d4b; }
.btn.quiet { border-color: var(--line); color: var(--muted); }
.link { color: #232d4b; }
.tab[aria-selected=true] { color: #232d4b; border-bottom-color: #e57200; }
.tab:hover, .tab-link:hover { color: #232d4b; }
.group h2 { color: #232d4b; border-left: 4px solid #e57200; padding-left: 10px; }
.badge.write { background: var(--orange-soft); color: var(--orange-ink); }
.tool-form details summary { color: #232d4b; }
.tool-form input:focus, .tool-form textarea:focus, .tool-form select:focus, .search-row input:focus, input.plain:focus {
  outline: none; border-color: #e57200; box-shadow: 0 0 0 3px var(--orange-soft); }
.check input, .tool-form input[type=checkbox] { accent-color: #e57200; }
.toggle input:checked + span { background: #e57200; }
.chip { background: var(--blue-soft); }
.status.working::before { border-top-color: #e57200; }
.hero h1, .card h2 { color: #232d4b; }
.hero { border-top: 4px solid #e57200; }

main, footer, .top-inner { max-width: 1040px; }
.home-link { color: inherit; text-decoration: none; }
.role-pill { font-size: 12px; background: rgba(255,255,255,.2); border-radius: 999px; padding: 1px 8px; }
.role-pill:empty { display: none; }
.spacer { flex: 1 1 auto; }
.msg.warn { color: var(--warn); background: var(--warn-soft); border: 1px solid var(--warn); }
.msg.small { margin: 10px 0 0; padding: 8px 12px; font-size: 14px; }
.empty { color: var(--muted); text-align: center; padding: 30px 0; }

/* Tabs */
.tabs { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; margin: 22px 0 16px; border-bottom: 1px solid var(--line); }
.tab { background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 14px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.tab[aria-selected=true] { color: var(--brand); border-bottom-color: var(--brand); }
.tab-link { color: var(--muted); font-size: 14px; padding: 10px 8px; }

/* Tool list */
.search-row input { width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); font: inherit; }
.group h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 26px 0 10px; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.tool-card { text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 14px 16px; font: inherit; color: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 6px; transition: border-color .15s, transform .05s; }
.tool-card:hover { border-color: var(--brand-2); }
.tool-card:active { transform: translateY(1px); }
.tool-card strong { font-size: 16px; }
.tool-card span.sum { color: var(--muted); font-size: 14px; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 9px; background: var(--blue-soft); color: var(--blue); white-space: nowrap; }
.badge.write { background: var(--brand-soft); color: var(--brand); }
.badge.off { background: var(--grey); color: var(--muted); }

/* One tool */
.back { margin: 0 0 12px; }
.tool-head { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; }
.tool-form { margin-top: 10px; }
.tool-form .field { margin-top: 14px; }
.tool-form label.name { display: block; font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.tool-form code, .chip code { font-size: 12px; color: var(--muted); font-weight: 400; }
.tool-form .help { color: var(--muted); font-size: 13px; margin: 2px 0 6px; }
.tool-form input[type=text], input.plain, .tool-form textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; }
.tool-form textarea { min-height: 64px; resize: vertical; }
.tool-form .pair { display: flex; gap: 8px; }
.tool-form .file-row { display: flex; gap: 8px; align-items: center; }
.tool-form .file-row input { flex: 1 1 auto; }
.tool-form .check { margin-top: 10px; background: var(--bg); }
.tool-form details { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.tool-form details summary { cursor: pointer; font-weight: 600; color: var(--brand); }
.req { color: var(--bad); }
.run-row { margin-top: 20px; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger:disabled { opacity: .45; cursor: not-allowed; }
.btn.small { padding: 5px 10px; font-size: 14px; }
.log { max-height: 460px; overflow: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; word-break: break-word; }
.log .err { color: var(--bad); }
#output h3 { margin: 0 0 10px; }
.out-file { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.out-file .fname { flex: 1 1 240px; word-break: break-all; }
.out-file .size { color: var(--muted); font-size: 13px; }
.new-dot { display: inline-block; font-size: 11px; font-weight: 700; color: var(--good); background: var(--good-soft); border-radius: 999px; padding: 1px 7px; margin-left: 6px; }

/* Settings */
.switch-table td, .switch-table th { vertical-align: middle; }
.switch-table td.name small { display: block; color: var(--muted); }
.toggle { position: relative; display: inline-block; width: 44px; height: 24px; flex: none; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle span { position: absolute; inset: 0; background: var(--line); border-radius: 999px; cursor: pointer; transition: background .15s; }
.toggle span::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .15s; }
.toggle input:checked + span { background: var(--good); }
.toggle input:checked + span::before { transform: translateX(20px); }
.toggle input:focus-visible + span { box-shadow: 0 0 0 3px var(--brand-soft); }
.people-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 30px; }
.chip { display: inline-flex; gap: 6px; align-items: center; background: var(--blue-soft); color: var(--ink); border-radius: 999px; padding: 4px 6px 4px 12px; font-size: 14px; }
.chip button { background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 16px; line-height: 1; padding: 0 4px; }
.chips .none { color: var(--muted); font-size: 14px; }
#person-pick { flex: 1 1 220px; }
#person-id { flex: 0 1 160px; }
#person-name { flex: 1 1 160px; }
.sticky-save { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; gap: 12px; }

@media (max-width: 600px) {
  .people-grid { grid-template-columns: 1fr; }
  .tool-head { flex-direction: column; }
  .tool-form .pair { flex-direction: column; }
}

/* UVA accents on the cards (after the base card rules above) */
.tool-card { border-top: 3px solid #232d4b; }
.tool-card:hover { border-color: #e57200; border-top-color: #e57200; }

/* A tool's own page (alt-text.html): the button above the Terminal-style form */
.page-link { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 14px 0 4px; padding: 14px 16px; background: var(--orange-soft); border-radius: 12px; }
.page-link .hint { margin: 0; flex: 1 1 260px; }
