/* Processing Contribution Manager - web version. Flat, no gradients. */

:root {
  --bg: #ffffff;
  --fg: #111111;
  --dim: #6b6b6b;
  --line: #d4d4d4;
  --panel: #f4f4f4;
  --sel: #e8e8e8;
  --link: #0b57c2;
  --accent: #111111;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161616;
    --fg: #e9e9e9;
    --dim: #9a9a9a;
    --line: #333333;
    --panel: #1e1e1e;
    --sel: #262626;
    --link: #79aaff;
    --accent: #e9e9e9;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 0 16px 48px;
  background: var(--bg);
  color: var(--fg);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--link); }
a:hover { text-decoration: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* Header */

.titlebar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 8px;
  row-gap: 12px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 0 12px;
}

.titlebar h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.install-note {
  flex: 0 0 100%;
  margin: -10px 0 0;
  color: var(--dim);
  font-size: 12px;
}

.info-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: 0;
  padding: 0;
  background: none;
  color: var(--dim);
  cursor: pointer;
}

.info-button svg { display: block; fill: currentColor; }
.info-button:hover { color: var(--fg); }
.info-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.text-link {
  appearance: none;
  border: 0;
  padding: 0;
  background: none;
  color: var(--link);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}

.text-link:hover { text-decoration: none; }
.text-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.github-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-left: auto;
  color: var(--dim);
}

.github-link img { width: 18px; height: 18px; }
.github-link:hover { opacity: 0.72; }
.github-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (prefers-color-scheme: dark) {
  .github-link img { filter: invert(1); }
}

/* Tabs */

.tabs {
  display: flex;
  gap: 0;
  max-width: 1100px;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
}

.tabs button {
  appearance: none;
  border: 1px solid transparent;
  border-bottom: none;
  background: none;
  color: var(--dim);
  font: inherit;
  padding: 7px 14px;
  margin-bottom: -1px;
  cursor: pointer;
}

.tabs button:hover { color: var(--fg); }

.tabs button[aria-selected="true"] {
  color: var(--fg);
  background: var(--bg);
  border-color: var(--line);
  border-bottom: 1px solid var(--bg);
  font-weight: 600;
}

.tabs .count { color: var(--dim); font-weight: 400; font-size: 12px; }

/* Toolbar */

.toolbar {
  display: flex;
  gap: 8px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 0;
}

#filter, #category {
  appearance: none;
  font: inherit;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 5px 8px;
}

#filter { flex: 1 1 auto; min-width: 0; }
#category { flex: 0 0 200px; }
#filter:focus, #category:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

/* Table */

main { max-width: 1100px; margin: 0 auto; }

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

thead th {
  text-align: left;
  font-weight: 400;
  color: var(--dim);
  border-bottom: 1px solid var(--line);
  padding: 0;
}

thead th button {
  appearance: none;
  background: none;
  border: 0;
  font: inherit;
  color: inherit;
  padding: 6px 8px;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

thead th button:hover { color: var(--fg); }
thead th.sorted button { color: var(--fg); }
thead th.sorted button::after { content: " \2193"; }
thead th.sorted.desc button::after { content: " \2191"; }

.c-name { width: auto; }
.c-author { width: 22%; }
.c-version { width: 90px; }
.c-dl { width: 126px; padding: 6px 8px; }

tbody tr { border-bottom: 1px solid var(--line); }
tbody tr.open { background: var(--sel); }

tbody td { padding: 7px 8px; vertical-align: top; }

td.name { cursor: pointer; }
td.name .n { font-weight: 600; }
td.name .s { color: var(--dim); }
td.name .s::before { content: " \2014 "; }

td.author, td.version { color: var(--dim); }
td.version { font-family: var(--mono); font-size: 12px; }

.dl {
  display: block;
  border: 1px solid var(--line);
  padding: 2px 8px;
  color: var(--link);
  text-decoration: none;
  font-size: 12px;
  text-align: center;
}
.dl:hover { border-color: var(--link); }

.download-actions { display: flex; flex-direction: column; gap: 4px; }

.copy-link {
  appearance: none;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 2px 5px;
  background: var(--bg);
  color: var(--dim);
  font: 12px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  cursor: pointer;
}

.copy-link:hover { color: var(--fg); border-color: var(--dim); }
.copy-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Expanded detail */

tr.detail > td {
  padding: 0 8px 12px;
  color: var(--dim);
  background: var(--sel);
}

tr.detail p { margin: 0 0 8px; max-width: 78ch; }
tr.detail .kv { font-size: 12px; }
tr.detail .kv span { margin-right: 14px; }

.status { color: var(--dim); padding: 24px 0; }
.err { color: #c0392b; }

footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  max-width: 1100px;
  margin: 24px auto 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 12px;
}

.footer-info p {
  max-width: 82ch;
  margin: 6px 0 0;
}

footer button {
  appearance: none;
  border: 0;
  padding: 0;
  background: none;
  color: var(--link);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}

footer button:hover { text-decoration: none; }

dialog {
  width: min(440px, calc(100% - 32px));
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--bg);
  color: var(--fg);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
}

dialog::backdrop { background: rgba(0, 0, 0, 0.35); }

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.modal-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}

.modal-content { margin-top: 16px; }
.modal-content p { margin: 0 0 12px; }
.modal-content p:last-child { margin-bottom: 0; }
.modal-content .src { color: var(--dim); font-size: 12px; }

.modal-close {
  appearance: none;
  border: 0;
  padding: 0 2px;
  background: none;
  color: var(--dim);
  font: 24px/1 system-ui, sans-serif;
  cursor: pointer;
}

.modal-close:hover { color: var(--fg); }

dialog ol {
  margin: 16px 0 0;
  padding-left: 22px;
}

dialog li { padding: 3px 0; }
dialog code { font-family: var(--mono); font-size: 12px; }
.modal-note { margin: 16px 0 0; font-size: 12px; }

@media (max-width: 720px) {
  .c-author, .c-version, td.author, td.version { display: none; }
  .c-dl { width: 126px; }
  .toolbar { flex-wrap: wrap; }
  #category { flex: 1 1 100%; }
}
