:root {
  color-scheme: dark;
  --topbar-sticky-offset: 88px;
  --bg: #0b0d12;
  --panel: rgba(255, 255, 255, 0.06);
  --panel-strong: rgba(255, 255, 255, 0.09);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.64);
  --subtle: rgba(255, 255, 255, 0.42);
  --border: rgba(255, 255, 255, 0.14);
  --accent: #fe9042;
  --accent-strong: #ffad72;
  --danger: #ff6b5f;
  --ok: #74d99f;
  --warn: #ffc46b;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(180deg, rgba(254, 144, 66, 0.08), transparent 42%);
  background-size: 48px 48px, 48px 48px, 100% 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 16px 32px;
  background: rgba(11, 13, 18, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

body.builder-active .topbar {
  position: static;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 20px;
  font-weight: 800;
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 9px;
}

.brand-dot {
  content: "";
  width: 9px;
  height: 9px;
  background: var(--accent);
  display: inline-block;
  flex: 0 0 auto;
}

h2 {
  font-size: 18px;
  font-weight: 800;
}

p {
  color: var(--muted);
  margin-top: 3px;
}

.app-version {
  color: var(--subtle);
  font-size: 12px;
  white-space: nowrap;
}

.view {
  padding: 24px;
}

.hidden {
  display: none !important;
}

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

.panel,
.capacity-hero,
.builder-shell {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 0;
  box-shadow: var(--shadow);
  padding: 18px;
  min-width: 0;
  backdrop-filter: blur(12px);
}

.panel + .panel,
.capacity-hero + .panel {
  margin-top: 16px;
}

.login-card {
  width: min(460px, 100%);
  margin: 8vh auto 0;
  display: grid;
  gap: 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 22px;
  box-shadow: var(--shadow);
}

.login-card h2 {
  font-size: 28px;
}

.login-form {
  display: grid;
  gap: 12px;
}

.panel-header,
.builder-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.capacity-hero {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(420px, 1.2fr);
  gap: 22px;
  align-items: center;
  min-height: 220px;
  position: relative;
  overflow: hidden;
}

.capacity-hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent 68%);
}

.capacity-hero h2 {
  font-size: 42px;
  letter-spacing: 0;
}

.upgrade-signal {
  display: grid;
  gap: 4px;
  max-width: 560px;
  margin-top: 18px;
  padding: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.upgrade-signal strong {
  font-size: 14px;
}

.upgrade-signal span {
  color: var(--muted);
  font-size: 13px;
}

.upgrade-signal.signal-ok {
  border-color: rgba(116, 217, 159, 0.36);
  background: rgba(116, 217, 159, 0.08);
}

.upgrade-signal.signal-warn {
  border-color: rgba(255, 196, 107, 0.46);
  background: rgba(255, 196, 107, 0.09);
}

.upgrade-signal.signal-danger {
  border-color: rgba(255, 107, 95, 0.52);
  background: rgba(255, 107, 95, 0.1);
}

.eyebrow {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.capacity-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.database-capacity-grid {
  margin-top: 10px;
}

.metrics-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
}

.metrics-toolbar > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.metrics-toolbar > span::before {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--ok);
  display: inline-block;
}

.range-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
}

.range-toggle button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 6px 9px;
  font-size: 12px;
}

.range-toggle button.active {
  background: var(--accent);
  color: #140b05;
}

.metric {
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 14px;
  min-height: 162px;
  background: rgba(255, 255, 255, 0.04);
}

.metric-button {
  display: block;
  width: 100%;
  color: var(--text);
  text-align: left;
  font-weight: inherit;
}

.metric-button:hover,
.metric-button:focus-visible {
  border-color: var(--accent);
  background: rgba(254, 144, 66, 0.08);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  font-size: 26px;
  letter-spacing: 0;
}

.metric-detail {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 12px;
  min-height: 48px;
}

.sparkline {
  display: flex;
  align-items: center;
  height: 48px;
  margin-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 8px;
}

.sparkline svg {
  width: 100%;
  height: 42px;
}

.sparkline polygon {
  fill: rgba(254, 144, 66, 0.12);
}

.sparkline polyline {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.4;
  vector-effect: non-scaling-stroke;
}

.sparkline-empty {
  color: var(--subtle);
  font-size: 12px;
}

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

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 10px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(254, 144, 66, 0.72);
  box-shadow: 0 0 0 3px rgba(254, 144, 66, 0.12);
}

textarea {
  min-height: 520px;
  resize: vertical;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  line-height: 1.5;
  tab-size: 4;
}

button {
  border: 1px solid var(--accent);
  border-radius: 0;
  padding: 10px 14px;
  color: #140b05;
  background: var(--accent);
  cursor: pointer;
  white-space: nowrap;
  font-weight: 800;
}

button:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

button.secondary,
.link-button {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

button.secondary:hover,
.link-button:hover,
button.active-nav {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.24);
}

.link-button {
  margin-bottom: 24px;
}

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

.inline-stack {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.inline input,
fieldset input {
  width: auto;
}

.spec-form {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(260px, 1fr) minmax(120px, 0.35fr) minmax(260px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.database-tier-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) minmax(140px, 0.6fr) repeat(3, minmax(110px, 0.45fr));
  gap: 10px;
  align-items: end;
}

.database-tier-form .info-box {
  grid-column: 1 / -2;
  min-height: 42px;
}

.admin-settings-form {
  grid-template-columns: minmax(280px, 1fr) minmax(260px, 0.8fr) auto;
  align-items: end;
}

.gmail-settings-form {
  grid-template-columns: repeat(2, minmax(220px, 1fr)) minmax(220px, 1fr);
  align-items: end;
}

.gmail-settings-form .info-box {
  min-height: 42px;
}

.user-invite-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1fr) minmax(130px, 0.5fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

.permission-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.035);
}

.compact-textarea {
  min-height: 116px;
  font-family: inherit;
}

.spec-summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  padding: 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-size: 13px;
}

.table-search {
  max-width: 320px;
}

.job-board-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.folder-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.folder-form input {
  width: 180px;
}

.folder-form button {
  white-space: nowrap;
}

.history-filters {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.history-filters select {
  min-width: 220px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 0;
  background: rgba(0, 0, 0, 0.12);
}

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

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
}

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

tbody tr {
  transition: background 0.16s ease, color 0.16s ease;
}

tbody tr:hover {
  background: rgba(254, 144, 66, 0.055);
}

.folder-row td {
  padding: 0;
  background: rgba(254, 144, 66, 0.08);
  border-top: 1px solid rgba(254, 144, 66, 0.42);
  border-bottom: 1px solid rgba(254, 144, 66, 0.22);
}

tbody tr.folder-row:hover {
  background: rgba(254, 144, 66, 0.08);
}

.folder-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 54px;
  padding: 10px 12px;
  color: var(--text);
  font-weight: 800;
}

.folder-toggle {
  display: inline-flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.folder-icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 22px;
  color: var(--accent-strong);
  border: 1px solid rgba(254, 144, 66, 0.45);
  background: rgba(254, 144, 66, 0.12);
  font-size: 13px;
}

.folder-caret {
  color: var(--accent-strong);
  font-size: 14px;
}

.folder-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.folder-title span {
  overflow-wrap: anywhere;
}

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

.folder-heading small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.icon-button:hover {
  color: var(--accent-strong);
  border-color: rgba(254, 144, 66, 0.58);
}

.table-sub,
.meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.row-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.row-actions button {
  padding: 7px 9px;
  font-size: 12px;
}

.row-actions button.secondary {
  color: var(--muted);
}

.empty-state {
  color: var(--muted);
  text-align: center;
  padding: 28px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 0;
  padding: 4px 8px;
  border: 1px solid rgba(254, 144, 66, 0.42);
  background: rgba(254, 144, 66, 0.1);
  color: var(--accent);
  font-size: 12px;
  white-space: nowrap;
}

.status-success {
  color: var(--ok);
}

.status-failed {
  color: var(--danger);
}

.status-warn {
  color: var(--warn);
}

.meter {
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 0;
  overflow: hidden;
  margin-top: 12px;
}

.meter span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
}

.metric.loading strong,
.metric.loading .metric-detail {
  color: var(--muted);
}

.metric-spinner {
  display: inline-block;
  width: 26px;
  height: 26px;
  border: 3px solid rgba(255, 255, 255, 0.16);
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
}

.job-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-content: center;
  gap: 14px;
  background: rgba(10, 12, 14, 0.86);
  backdrop-filter: blur(2px);
  color: var(--text);
  text-align: center;
}

.job-loading-overlay .metric-spinner {
  justify-self: center;
}

.job-loading-overlay strong {
  font-size: 14px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.builder-shell {
  max-width: 1440px;
  margin: 0 auto;
}

.choice-header {
  margin-bottom: 18px;
}

.choice-header h2 {
  font-size: 30px;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.choice-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  min-height: 220px;
  padding: 20px;
  text-align: left;
  align-content: start;
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.choice-card:hover {
  border-color: var(--accent);
  background: rgba(254, 144, 66, 0.08);
}

.choice-card span {
  color: var(--accent-strong);
  font-weight: 800;
  min-width: 0;
  overflow-wrap: anywhere;
}

.choice-card strong {
  font-size: 24px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.choice-card small {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: break-word;
}

.builder-toolbar {
  margin-bottom: 16px;
}

.builder-shell > .builder-toolbar {
  position: sticky;
  top: var(--topbar-sticky-offset);
  z-index: 10;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 12px;
}

body.builder-active .builder-shell > .builder-toolbar {
  top: 0;
}

.builder-toolbar > div {
  flex: 1;
}

.builder-toolbar > .builder-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
}

.setup-toggle-button {
  min-width: auto;
  width: auto;
  height: auto;
  display: inline-grid;
  place-items: center;
  line-height: 1;
}

.builder-grid {
  --job-panel-height: min(72vh, 760px);
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.builder-left {
  grid-column: 1;
  display: grid;
  gap: 16px;
  min-height: 0;
}

.setup-panel {
  height: var(--job-panel-height);
  max-height: var(--job-panel-height);
  min-height: 0;
  overflow-y: auto;
  position: sticky;
  top: 18px;
}

.setup-panel > label,
.setup-panel > fieldset,
.setup-panel > section {
  transition: opacity 0.12s ease;
}

.panel-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ide-panel {
  display: flex;
  flex-direction: column;
  grid-column: 2;
  height: var(--job-panel-height);
  max-height: var(--job-panel-height);
  min-width: 0;
  overflow: hidden;
  position: relative;
}

.builder-shell.setup-collapsed .builder-grid {
  grid-template-columns: minmax(0, 1fr);
}

.builder-shell.setup-collapsed .builder-left {
  display: none;
}

.builder-shell.setup-collapsed .ide-panel {
  grid-column: 1;
}

.code-editor-label {
  display: flex;
  flex: 1;
  min-height: 0;
}

.run-log-panel {
  margin-top: 18px;
}

.code-editor-shell {
  display: grid;
  grid-template-columns: minmax(44px, auto) minmax(0, 1fr);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  flex: 1;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.code-editor-shell:focus-within {
  border-color: rgba(254, 144, 66, 0.72);
  box-shadow: 0 0 0 3px rgba(254, 144, 66, 0.12);
}

.code-line-numbers {
  height: 100%;
  min-height: 0;
  padding: 10px 8px;
  border-right: 1px solid var(--border);
  color: var(--subtle);
  background: rgba(0, 0, 0, 0.16);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.5;
  overflow: hidden;
  text-align: right;
  user-select: none;
  white-space: pre;
}

.code-editor-main {
  position: relative;
  background: rgba(255, 255, 255, 0.06);
  height: 100%;
  min-width: 0;
  overflow: hidden;
}

.code-editor-loader {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
}

.code-highlight,
.code-editor-shell textarea {
  border: 0;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 10px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.5;
  tab-size: 4;
  white-space: pre;
}

.code-highlight {
  position: absolute;
  inset: 0;
  background: transparent;
  color: var(--text);
  display: block;
  overflow: visible;
  pointer-events: none;
}

.code-editor-shell textarea {
  position: relative;
  background: transparent;
  box-shadow: none;
  caret-color: var(--accent-strong);
  color: transparent;
  overflow: auto;
  resize: none;
}

.code-editor-shell.highlight-loading .code-editor-loader {
  display: flex;
}

.code-editor-shell.highlight-loading .code-highlight,
.code-editor-shell.highlight-loading textarea {
  visibility: hidden;
}

.code-editor-shell.highlight-ready .code-editor-loader {
  display: none;
}

.code-editor-shell textarea:focus {
  border-color: transparent;
  box-shadow: none;
}

.code-editor-shell textarea::selection {
  background: rgba(254, 144, 66, 0.28);
  color: transparent;
}

.py-comment {
  color: #7f8c8d;
}

.py-keyword {
  color: #ffb86c;
  font-weight: 700;
}

.py-string {
  color: #8fd694;
}

.py-number {
  color: #80bfff;
}

.py-builtin {
  color: #c792ea;
}

.py-decorator {
  color: #f78c6c;
}

.queue-list {
  display: grid;
  gap: 10px;
}

.queue-list p {
  font-size: 13px;
}

.queue-item {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.queue-item strong {
  font-size: 13px;
}

.queue-log-item {
  border-color: rgba(254, 144, 66, 0.38);
  background: rgba(254, 144, 66, 0.07);
}

.schedule-box,
.info-box,
.folder-variables-box {
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.folder-variables-box {
  display: grid;
  gap: 10px;
}

#builderFolderVariables .variable-row {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

#builderFolderVariables .variable-row input[data-variable-name] {
  grid-column: 1;
}

#builderFolderVariables .variable-row input[data-variable-value] {
  grid-column: 1 / -1;
}

#builderFolderVariables .variable-row button {
  grid-column: 2;
  grid-row: 1;
}

#saveBuilderFolderVariablesBtn {
  width: 100%;
}

.info-box {
  color: var(--muted);
  font-size: 13px;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
  word-break: break-word;
}

.mini-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.variable-list {
  display: grid;
  gap: 8px;
}

.variable-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.6fr) minmax(150px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.variable-row input {
  min-width: 0;
}

.hint {
  margin-top: 10px;
  font-size: 12px;
}

.hint code,
.info-box code {
  color: var(--accent-strong);
}

.modal-dialog {
  width: min(680px, calc(100vw - 28px));
  border: 1px solid var(--border);
  padding: 0;
  background: transparent;
  color: var(--text);
}

.modal-dialog::backdrop {
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(3px);
}

.modal-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  background: rgba(20, 22, 28, 0.98);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.test-input-fields {
  display: grid;
  gap: 12px;
}

.test-input-fields label {
  gap: 6px;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

fieldset {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 0;
  border: 0;
  padding: 0;
}

legend {
  width: 100%;
  color: var(--muted);
  font-size: 13px;
}

fieldset label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.logs {
  display: grid;
  gap: 10px;
}

.item {
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
}

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

.item-title {
  font-weight: 700;
}

pre {
  margin: 10px 0 0;
  padding: 10px;
  max-height: 240px;
  overflow: auto;
  border-radius: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.34);
  color: rgba(255, 255, 255, 0.84);
  font-size: 12px;
  white-space: pre-wrap;
}

@media (max-width: 980px) {
  :root {
    --topbar-sticky-offset: 146px;
  }

  .topbar,
  .panel-header,
  .builder-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
  }

  .topbar-actions button,
  .builder-toolbar button {
    width: 100%;
  }

  .builder-toolbar > .builder-actions {
    align-items: flex-start;
    width: 100%;
  }

  .builder-toolbar .setup-toggle-button {
    min-width: auto;
    width: auto;
  }

  .job-board-actions,
  .folder-form {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .folder-form input,
  .folder-form button,
  .table-search {
    max-width: none;
    width: 100%;
  }

  .capacity-hero,
  .choice-grid,
  .builder-grid,
  .spec-form,
  .database-tier-form,
  .admin-settings-form,
  .gmail-settings-form,
  .user-invite-form,
  .permission-grid {
    grid-template-columns: 1fr;
  }

  .builder-grid {
    --job-panel-height: min(64vh, 520px);
  }

  .database-tier-form .info-box {
    grid-column: auto;
  }

  .capacity-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  textarea {
    min-height: 380px;
  }

  .compact-textarea {
    min-height: 140px;
  }
}

@media (max-width: 560px) {
  .view,
  .topbar {
    padding: 14px;
  }

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