:root {
  color-scheme: dark;
  --bg: #1f1f1f;
  --window: #202020;
  --titlebar: #1b1b1b;
  --panel: #242424;
  --panel-raised: #2b2b2b;
  --border: #565656;
  --border-soft: #3d3d3d;
  --grid: #555;
  --text: #f2f2f2;
  --muted: #b9b9b9;
  --accent: #ffb000;
  --accent-hover: #ffd469;
  --selected: #3b3421;
  --hover: #303030;
  --error: #ff7b72;
  --ok: #8fd18f;
  --shadow: rgba(0, 0, 0, 0.45);
  --font-ui: "Segoe UI", Tahoma, Arial, sans-serif;
  --font-mono: "Cascadia Mono", Consolas, "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 12px/1.45 var(--font-ui);
  padding: 16px;
}

button,
input,
select {
  font: inherit;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover,
a:focus-visible {
  color: var(--accent-hover);
}

.window-shell {
  width: min(1220px, 100%);
  margin: 0 auto;
  border: 1px solid var(--border-soft);
  background: var(--window);
  box-shadow: 0 18px 40px var(--shadow);
}

.titlebar {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--titlebar);
  border-bottom: 1px solid var(--border-soft);
}

.app-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  background: transparent;
  color: #111;
  font-weight: 700;
  font-size: 11px;
}

.titlebar h1 {
  margin: 0;
  font-size: 13px;
  font-weight: 400;
}

.content {
  padding: 14px;
}

.intro {
  margin: 0 0 10px;
  color: var(--text);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(145px, auto) minmax(180px, auto) auto auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 10px;
}

.field {
  display: grid;
  gap: 3px;
}

.field span {
  color: var(--muted);
}

input,
select,
button {
  min-height: 26px;
  border: 1px solid var(--border);
  background: var(--panel-raised);
  color: var(--text);
}

input,
select {
  padding: 3px 7px;
}

button {
  min-width: 74px;
  padding: 3px 12px;
  cursor: pointer;
}

button:hover,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 0;
}

.message {
  margin-bottom: 8px;
  color: var(--muted);
}

.message.error {
  color: var(--error);
  white-space: pre-wrap;
}

.message.ok {
  color: var(--ok);
}

.table-frame {
  height: clamp(280px, 45vh, 520px);
  overflow: auto;
  border: 1px solid var(--border);
  background: #1d1d1d;
}

.table-frame:focus-visible {
  outline: 1px solid var(--accent);
}

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

th,
td {
  padding: 3px 7px;
  border-right: 1px solid var(--grid);
  border-bottom: 1px solid var(--grid);
  vertical-align: top;
  overflow: hidden;
  text-overflow: ellipsis;
}

th:last-child,
td:last-child {
  border-right: 0;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel);
  color: var(--text);
  font-weight: 400;
  text-align: left;
  cursor: pointer;
  user-select: none;
}

th::after {
  content: "";
  float: right;
  color: var(--muted);
}

th.sort-asc::after {
  content: "▲";
}

th.sort-desc::after {
  content: "▼";
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: var(--hover);
}

tbody tr.selected {
  background: var(--selected);
}

.col-source {
  width: 150px;
}

.col-plugin {
  width: 230px;
}

.col-version {
  width: 125px;
  white-space: nowrap;
  font-family: var(--font-mono);
}

.col-author {
  width: 220px;
}


.col-description {
  width: auto;
}

.details {
  margin: 14px 0 0;
  border: 1px solid var(--border);
  padding: 14px;
  min-height: 150px;
}

.details legend {
  padding: 0 6px;
}

.empty-details {
  color: var(--muted);
}

.details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 34px;
  row-gap: 8px;
}

.detail-item {
  display: grid;
  grid-template-columns: 105px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-width: 0;
}

.detail-link,
.detail-description {
  grid-column: 1 / -1;
}

.detail-label {
  color: var(--muted);
}

.detail-description p {
  min-height: 60px;
  margin: 0;
  padding: 6px;
  border: 1px solid var(--border);
  background: #1f1f1f;
  white-space: pre-wrap;
}

.statusbar {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 14px;
  border-top: 1px solid var(--border-soft);
  color: var(--muted);
}

@media (max-width: 820px) {
  body {
    padding: 0;
  }

  .window-shell {
    border-left: 0;
    border-right: 0;
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

  .details-grid {
    grid-template-columns: 1fr;
  }

  .detail-item {
    grid-template-columns: 95px minmax(0, 1fr);
  }

  .table-frame {
    height: 55vh;
  }
}


.app-icon img {
  display: block;
}
