:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #1d2228;
  --muted: #66717f;
  --line: #d9dee5;
  --accent: #0f6b5f;
  --danger: #a83232;
  --warn: #8a5b00;
  --ok: #1b6b34;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.4 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: #20252b;
  color: #fff;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 18px;
  font-weight: 650;
}

h2 {
  font-size: 15px;
  font-weight: 650;
}

main {
  padding: 14px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.6fr);
  gap: 14px;
  margin-top: 14px;
}

@media (min-width: 901px) {
  .form-panel-content {
    position: sticky;
    top: 14px;
  }
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.section-heading,
.inline-actions,
.approval-controls,
.scan-controls,
.compact-form {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.section-heading {
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.suggest-limit {
  min-width: 110px;
}

.suggest-language {
  min-width: 96px;
}

form {
  display: grid;
  gap: 10px;
}

label {
  display: grid;
  gap: 4px;
  min-width: 160px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--text);
}

input,
select,
textarea,
button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  padding: 6px 8px;
  background: #fff;
  color: var(--text);
}

input[type="checkbox"] {
  width: 14px;
  height: 14px;
  min-height: 14px;
  padding: 0;
}

textarea {
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

button {
  padding: 6px 10px;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 650;
  cursor: pointer;
}

button.secondary {
  border-color: var(--line);
  background: #fff;
  color: var(--text);
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--text);
  text-decoration: none;
  font-weight: 650;
}

button.danger {
  border-color: var(--danger);
  background: #fff;
  color: var(--danger);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.suggest-dialog {
  width: min(720px, calc(100vw - 28px));
  max-height: min(760px, calc(100vh - 28px));
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
}

.suggest-dialog::backdrop {
  background: rgba(20, 25, 31, 0.35);
}

.dialog-heading,
.suggest-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dialog-heading {
  justify-content: space-between;
  margin-bottom: 8px;
}

.suggest-results {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  max-height: 520px;
  overflow: auto;
}

.suggest-group {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.suggest-group:first-child {
  border-top: 0;
  padding-top: 0;
}

.suggest-children {
  display: grid;
  gap: 6px;
  margin: 6px 0 0 26px;
}

.suggest-children[hidden] {
  display: none;
}

.suggest-row label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.suggest-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px 54px 34px;
}

.suggest-row button {
  width: 54px;
  padding-inline: 0;
}

.suggest-row .icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--text);
  text-decoration: none;
  font-weight: 650;
  width: 34px;
}

.icon-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 5px;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  padding: 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: #eef1f4;
  color: #38424d;
  font-size: 12px;
  font-weight: 700;
}

tr:last-child td {
  border-bottom: 0;
}

.muted,
.message {
  color: var(--muted);
}

.message {
  min-height: 20px;
}

.status {
  display: inline-block;
  min-width: 72px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7f8fa;
  font-size: 12px;
  text-align: center;
}

.status.ok,
.status.finished,
.status.completed {
  border-color: #bad8c2;
  color: var(--ok);
}

.status.failed,
.status.error {
  border-color: #e7b9b9;
  color: var(--danger);
}

.status.running,
.status.stopping {
  border-color: #d8c183;
  color: var(--warn);
}

.stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.row {
  display: grid;
  gap: 4px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.row:first-child {
  border-top: 0;
}

.row-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.row-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.row-actions .icon-button {
  min-height: 26px;
  padding: 4px;
  width: 28px;
}

.metrics {
  color: var(--muted);
  font-size: 12px;
}

.error {
  color: var(--danger);
}

.actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.updater-layout {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.8fr);
}

.site-block {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.plugin-list {
  display: grid;
  gap: 2px;
}

a {
  color: #0a5f9e;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .topbar,
  .toolbar,
  .approval-controls,
  .scan-controls,
  .compact-form {
    align-items: stretch;
  }

  .topbar,
  .toolbar {
    display: grid;
  }

  .nav-actions {
    justify-content: start;
  }
}
