:root {
  color-scheme: light;
  --bg: #f9fafb;
  --panel: #fff;
  --line: #dfe4ec;
  --line-strong: #c8d0dc;
  --text: #202123;
  --muted: #6d7686;
  --blue: #1654d1;
  --blue-dark: #0d2447;
  --blue-soft: #eef5ff;
  --green: #047857;
  --green-soft: #e8f7f1;
  --red: #c62828;
  --red-soft: #fdeeee;
  --warning-soft: #fff6e8;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(20, 35, 60, .06);
  --topbar: 58px;
  --icon-rail: 68px;
  --sidebar: 248px;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a, button, [tabindex], summary { outline: 0; }
a:focus, button:focus, [tabindex]:focus, summary:focus { outline: 0; }
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible,
summary:focus-visible {
  outline: 2px solid rgba(22, 84, 209, .45);
  outline-offset: 2px;
  border-radius: 5px;
}

a { color: var(--blue); text-decoration: none; font-weight: 500; }
a:hover { text-decoration: underline; }

.ui-icon {
  width: 24px;
  height: 24px;
  display: block;
  flex: 0 0 auto;
  vertical-align: middle;
  stroke-width: 1.75;
}

.skip-link {
  position: absolute;
  left: -1000px;
  top: -1000px;
}
.skip-link:focus {
  left: 10px;
  top: 10px;
  background: var(--blue-dark);
  color: #fff;
  padding: 8px 12px;
  border-radius: var(--radius);
  z-index: 20;
}

.app-topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--topbar);
  background: var(--blue-dark);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  z-index: 10;
}
.cloud-mark {
  width: 58px;
  height: 42px;
  border-radius: 0;
  background: transparent;
  color: #fff;
  display: grid;
  place-items: center;
}
.cloud-mark .ui-icon { width: 58px; height: 42px; }
.mobile-menu {
  display: none;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: #fff;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.mobile-menu .ui-icon {
  width: 24px;
  height: 24px;
}
.top-diamond {
  color: #8090a8;
  display: grid;
  place-items: center;
  margin: 0 6px 0 2px;
}
.top-diamond .ui-icon { width: 16px; height: 16px; }
.space-switcher,
.top-icon,
.avatar {
  border: 0;
  background: rgba(255,255,255,.06);
  color: #fff;
  border-radius: 999px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  font: inherit;
  font-weight: 500;
}
.space-switcher {
  min-width: 148px;
  height: 34px;
  gap: 8px;
  color: #eef5ff;
  white-space: nowrap;
  font-weight: 500;
}
.space-switcher .ui-icon {
  width: 16px;
  height: 16px;
  color: #93a4bd;
}
.quick-search {
  width: min(220px, 28vw);
  height: 34px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #b8c7de;
  background: rgba(255,255,255,.06);
  border-radius: 999px;
  padding: 0 12px;
  margin-left: 8px;
  border: 0;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}
.quick-search .ui-icon { width: 16px; height: 16px; }
.quick-search:focus {
  outline: 0;
}
.quick-search-text {
  color: #b8c7de;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.shortcut {
  color: #d1d9e7;
  font-weight: 500;
  white-space: nowrap;
  margin-left: auto;
  font-size: 12px;
}
.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.top-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  position: relative;
  text-decoration: none;
  color: #edf4ff;
}
.top-icon .ui-icon { width: 18px; height: 18px; }
.top-icon .unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff3131;
  position: absolute;
  top: 4px;
  right: 4px;
}
.avatar {
  width: 34px;
  height: 34px;
  padding: 0;
  background: #fff;
  color: var(--blue-dark);
  font-weight: 600;
  font-size: 12px;
}

.global-icon-rail {
  position: fixed;
  top: var(--topbar);
  bottom: 0;
  left: 0;
  width: var(--icon-rail);
  background: #fff;
  border-right: 1px solid var(--line);
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 22px 12px;
  z-index: 6;
}
.global-icon-rail a {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #5f6c7d;
}
.global-icon-rail .ui-icon { width: 20px; height: 20px; }
.global-icon-rail a.active,
.global-icon-rail a:hover {
  color: var(--blue);
  background: var(--blue-soft);
  text-decoration: none;
}
.global-separator {
  height: 1px;
  background: var(--line);
  display: block;
  margin: 10px -12px;
}

.rail {
  position: fixed;
  top: var(--topbar);
  bottom: 0;
  left: 0;
  width: var(--sidebar);
  background: transparent;
  border-right: 1px solid var(--line);
  padding: 14px 0 22px;
  overflow-y: auto;
}
.rail nav {
  display: grid;
  gap: 2px;
}
.rail a {
  color: #202123;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 18px 6px 22px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
  border-left: 3px solid transparent;
  min-height: 34px;
  white-space: nowrap;
}
.rail a .ui-icon {
  display: block;
  width: 18px;
  height: 18px;
  color: #687386;
  flex: 0 0 18px;
}
.rail a.active,
.rail a:hover {
  color: var(--blue);
  text-decoration: none;
}
.rail a.active {
  border-left-color: var(--blue);
  background: #f2f7ff;
}
.rail a.active .ui-icon,
.rail a:hover .ui-icon {
  color: var(--blue);
}
.rail-separator {
  height: 1px;
  background: var(--line);
  margin: 14px 12px;
  display: block;
}
.pill {
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  border-radius: 999px;
  padding: 2px 8px;
}

.shell {
  margin-left: var(--sidebar);
  padding: 76px 22px 48px;
  min-height: 100vh;
}
body.project-context .shell {
  margin-left: var(--icon-rail);
  padding-left: 22px;
}
.page-heading,
.topline,
.project-hero,
.toolbar,
.phase-heading,
.project-title-row,
.button-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.topline {
  margin-bottom: 16px;
}
h1 {
  margin: 0 0 8px;
  font-size: 22px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: 0;
}
h3 { margin: 0 0 10px; font-size: 14px; font-weight: 700 !important; }
p { line-height: 1.5; }
.crumb, .muted { color: var(--muted); margin: 0 0 8px; font-weight: 400; }
.small { font-size: 13px; }
.breadcrumb {
  color: #596374;
  font-size: 13px;
  margin-bottom: 18px;
  font-weight: 500;
}
.breadcrumb span,
.meta-dot {
  color: var(--muted);
  margin-left: 14px;
  margin-right: 14px;
}
.meta-dot::before {
  content: "";
  margin-right: 0;
}

.button {
  border: 1px solid #0d327d;
  border-radius: 7px;
  background: var(--blue);
  color: #fff;
  min-height: 36px;
  padding: 8px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.button:hover { background: #1148b5; color: #fff; text-decoration: none; }
.button.secondary {
  background: #fff;
  color: var(--text);
  border: 1px solid #d1d5db;
  font-weight: 500;
}
.button.danger {
  background: var(--red);
  border-color: #8a1f1f;
}
.button[disabled] {
  opacity: .55;
  cursor: not-allowed;
}
.icon-button { gap: 8px; }
.icon-button .ui-icon { width: 16px; height: 16px; }

.card,
.list-card,
.recent-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.card { padding: 18px; }
.recent-card {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  max-width: none;
  width: 100%;
  margin-bottom: 16px;
}
.recent-project {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
}
.recent-title {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 10px;
  letter-spacing: 0;
}
.recent-project {
  display: flex;
  align-items: center;
  gap: 12px;
  line-height: 1.3;
}
.recent-project > div { min-width: 0; }
.recent-project a {
  font-size: 13px;
  font-weight: 500;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recent-project p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recent-project p a {
  font-size: 13px;
  font-weight: 500;
  color: var(--blue);
}
.repo-mark {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: transparent;
  color: #111;
  display: inline-grid;
  place-items: center;
  flex: 0 0 22px;
}
.repo-mark .ui-icon { width: 22px; height: 22px; }
.small-mark {
  width: 22px;
  height: 22px;
  margin-right: 8px;
  display: inline-grid;
  place-items: center;
  vertical-align: middle;
}
.small-mark .ui-icon { width: 16px; height: 16px; }
.table-mark {
  width: 28px; height: 28px; flex: 0 0 28px; margin-right: 8px;
  display: inline-grid; place-items: center; vertical-align: middle;
}
.table-mark .ui-icon { width: 24px; height: 24px; }
.recent-mark {
  width: 32px; height: 32px; flex: 0 0 32px;
  display: inline-grid; place-items: center;
}
.recent-mark .ui-icon { width: 28px; height: 28px; }
.project-name-link { color: var(--text); font-weight: 500; }
.project-name-link:hover { color: var(--blue); }
.hero-mark {
  width: 42px;
  height: 42px;
  font-size: 15px;
}
.hero-mark .ui-icon { width: 26px; height: 26px; }

.list-card .toolbar,
.list-card .empty-row,
.list-footer {
  padding: 12px 18px;
}
.list-footer {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}
.list-footer .count-strong,
.count-strong {
  color: var(--text);
  font-weight: 600;
}
.list-card .toolbar {
  border-bottom: 1px solid var(--line);
}
.toolbar.cardless { margin: 16px 0; }
.activity-card {
  padding: 0;
  overflow: hidden;
}
.activity-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 0;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.activity-toolbar .search {
  width: min(520px, 100%);
  border-radius: 7px 0 0 7px;
}
.activity-toolbar .status-filter {
  width: 220px;
  margin-left: -1px;
}
.activity-toolbar .status-filter span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
}
.activity-toolbar .status-filter select {
  border-radius: 0 7px 7px 0;
  font-weight: 500;
}
.inline-toolbar {
  justify-content: flex-start;
  margin: 12px 0 18px;
}
.search {
  width: min(320px, 100%);
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  padding: 0 12px;
  background: #fff;
  color: var(--muted);
  min-height: 36px;
}
.search:focus-within {
  border-color: var(--blue);
  background: #f0f6ff;
  box-shadow: 0 0 0 1px var(--blue);
}
.search .ui-icon { width: 16px; height: 16px; }
.search input {
  border: 0;
  padding: 10px 0;
  background: transparent;
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
}
.search input::placeholder {
  color: #8b949e;
  font-weight: 400;
}
.search input:focus {
  border-color: transparent;
  box-shadow: none;
  background: transparent;
}
.repo-cell-tools {
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  margin-right: 10px;
}
.repo-cell-tools .ui-icon,
.branch-icon .ui-icon {
  width: 21px;
  height: 21px;
}
.branch-icon {
  display: inline-flex;
  align-items: center;
  color: #606a78;
  margin-right: 8px;
  vertical-align: middle;
}
.status-filter {
  width: 180px;
}
.empty-row {
  color: var(--muted);
}
.info-copy {
  padding: 14px 18px;
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  border-bottom: 1px solid var(--line);
}

table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 10px 18px;
  vertical-align: middle;
}
th {
  color: #4b5462;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
}
td { font-size: 13px; font-weight: 400; }
tbody tr:last-child td { border-bottom: 0; }
.scroll-x { overflow-x: auto; }

.table-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.table-card-head h3 {
  margin: 0 !important;
  line-height: 1;
}
.table-card-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}
.deployments-card {
  padding: 0;
}

input, select, textarea {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  padding: 9px 11px;
  font: inherit;
  font-size: 13px;
  background: #fff;
  color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: 0;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(22, 84, 209, .12);
  background: #f8fbff;
}
textarea {
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
}
label small {
  color: var(--muted);
  font-weight: 400;
  font-size: 12px;
}
.form {
  display: grid;
  gap: 14px;
}
.detail-form {
  padding: 0;
  gap: 0;
  overflow: hidden;
}
.detail-form > label,
.detail-form > .form-section,
.detail-form > p,
.detail-form > .flash {
  margin-left: 22px;
  margin-right: 22px;
}
.detail-form > label,
.detail-form > .form-section,
.detail-form > p {
  margin-top: 12px;
}
.form-section {
  display: grid;
  gap: 12px;
}
.field-title {
  font-weight: 600;
}
.choice-stack {
  display: grid;
  gap: 12px;
  max-width: 320px;
}
.choice {
  min-height: 40px;
}
.form.compact {
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.4fr) minmax(130px, .7fr) auto;
  align-items: end;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}
.check,
.radio {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
}
.check input,
.radio input {
  width: 18px;
  height: 18px;
}
.radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}
.editor-shell {
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  background: #fff;
}
.editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}
.editor-shell textarea {
  border: 0;
  border-radius: 0;
}
.small-button {
  min-height: 30px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
}
.sticky-actions {
  padding: 14px 22px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
  position: sticky;
  bottom: 0;
  background: var(--panel);
  z-index: 5;
  box-shadow: 0 -4px 12px rgba(15, 23, 42, .04);
}
/* `.detail-form` has overflow: hidden which breaks sticky positioning. */
.detail-form { overflow: visible; }
.detail-form > .sticky-actions {
  margin-left: 0;
  margin-right: 0;
  border-bottom-left-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
}
.rule-note {
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

code, .block {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #f3f6fa;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 13px;
}
.block {
  display: block;
  padding: 12px;
  margin-top: 8px;
  overflow-x: auto;
  word-break: break-all;
}
.ellipsis {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 10px;
  background: #eef2f7;
  color: var(--text);
  font-weight: 500;
  font-size: 12px;
  line-height: 1.5;
}
.badge.ok { background: var(--green-soft); color: var(--green); border: 1px solid #9ad9c3; }
.badge.bad { background: var(--red-soft); color: var(--red); border: 1px solid #efb4b4; }
.badge.warn { background: #fff5d8; color: #8a6a13; border: 1px solid #ecd49e; }
.github-setup-form { margin: 10px 0 6px 0; }
.github-last-error { margin: 4px 0 8px 0; color: var(--red); }
.build-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.3;
}
.build-cell .build-top {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.build-cell .build-bottom {
  color: var(--blue);
  font-weight: 500;
}
.agent-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c0c8d6;
  margin-right: 4px;
}
.agent-dot-up { background: var(--green); box-shadow: 0 0 0 2px rgba(4,120,87,.15); }
.agent-dot-down { background: var(--red); box-shadow: 0 0 0 2px rgba(198,40,40,.15); }
.agent-dot-unknown { background: #c0c8d6; }
.label-hint {
  color: var(--muted);
  font-weight: 400;
  font-size: 13px;
  margin-left: 4px;
}
.symlink-example {
  margin-top: 14px !important;
}
.symlink-example .field-title {
  margin-bottom: 6px;
  display: block;
}
.example-grid {
  display: flex;
  align-items: center;
  gap: 14px;
}
.example-card {
  flex: 1 1 0;
  min-width: 0;
  background: #f5f7fb;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}
.example-card .example-head {
  padding: 10px 14px 4px;
  font-weight: 600;
  font-size: 13px;
  background: #f5f7fb;
}
.example-card .example-body {
  padding: 10px 14px;
  color: var(--muted);
  font-size: 13px;
  overflow-x: auto;
  background: #f5f7fb;
}
.example-card code {
  background: none;
  padding: 0;
  white-space: nowrap;
}
.example-body code {
  border: none;
}
.example-arrow {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  color: var(--muted);
}
.example-arrow .ui-icon {
  width: 20px;
  height: 20px;
}

.password-field {
  position: relative;
  display: block;
}
.password-field input {
  padding-right: 40px;
}
.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 4px 6px;
  display: inline-flex;
  align-items: center;
  color: var(--blue);
  border-radius: 4px;
}
.password-toggle:hover { background: var(--blue-soft); }
.password-toggle .ui-icon { width: 18px; height: 18px; }

.editor-section { margin-top: 14px !important; }
.editor-shell {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
}
.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #f5f7fb;
  border-bottom: 1px solid var(--line);
}
.editor-title { font-weight: 700; font-size: 14px; }
.editor-actions {
  display: flex;
  gap: 8px;
  background: none;
  border: none;
}
.editor-actions .small-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 15px;
  font-size: 12px;
  background: transparent;
  color: var(--text);
  border: 0;
  box-shadow: none;
}
.editor-actions .small-button:hover { background: rgba(15, 23, 42, 0.06); }
.editor-actions .small-button .ui-icon { width: 14px; height: 14px; }
.editor-shell.is-dark .editor-actions .small-button {
  background: transparent;
  color: #e2e8f0;
}
.editor-shell.is-dark .editor-actions .small-button:hover {
  background: rgba(255, 255, 255, 0.08);
}
.editor-body {
  display: flex;
  align-items: stretch;
  min-height: 220px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  background: #fff;
}
.editor-gutter {
  background: none;
  border: none;
  padding: 10px 0;
  min-width: 30px;
  flex: 0 0 auto;
  text-align: right;
  color: #9aa3b2;
  user-select: none;
  white-space: pre;
}
.editor-gutter span {
  display: block;
  padding: 0 8px;
}
.editor-gutter span.is-active {
  background: rgba(15, 23, 42, 0.06);
  color: var(--text);
}
.editor-shell.is-dark .editor-gutter span.is-active {
  background: rgba(255, 255, 255, 0.07);
  color: #f1f5f9;
}
.editor-body textarea {
  flex: 1;
  min-width: 0;
  resize: vertical;
  padding: 10px 12px;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  line-height: inherit;
  color: var(--text);
}
.editor-body textarea:focus { box-shadow: none; }

.editor-shell.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 200;
  border-radius: 0;
  border: 0;
}
.editor-shell.is-fullscreen .editor-body { flex: 1; min-height: 0; }
.editor-shell.is-fullscreen .editor-body textarea { resize: none; }

.editor-shell.is-dark {
  background: #0e1525;
  color: #e2e8f0;
  border-color: #1e2a3f;
}
.editor-shell.is-dark .editor-toolbar {
  background: #0e1525;
  border-bottom-color: #1e2a3f;
}
.editor-shell.is-dark .editor-title { color: #f1f5f9; }
.editor-shell.is-dark .editor-body { background: #0b1120; }
.editor-shell.is-dark .editor-gutter {
  background: #0e1525;
  color: #4b5b76;
  border-right-color: #1e2a3f;
}
.editor-shell.is-dark textarea { color: #e2e8f0; }
.project-info-body .info-line {
  display: flex;
  align-items: center;
  gap: 8px;
}
.project-info-body .info-line .ui-icon {
  width: 18px;
  height: 18px;
}
.project-info-body .info-line .info-label {
  min-width: 175px;
  display: inline-block;
}
.badge.run { background: var(--blue-soft); color: var(--blue); border: 1px solid #c8d9ff; }
.ok-text { color: var(--green); font-weight: 600; }
.bad-text { color: var(--red); font-weight: 600; }

.project-layout {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 44px;
}
.project-nav {
  display: grid;
  align-content: start;
  gap: 9px;
  position: fixed;
  top: calc(var(--topbar) + 24px);
  left: calc(var(--icon-rail) + 22px);
  width: 160px;
  max-height: calc(100vh - var(--topbar) - 48px);
  overflow-y: auto;
  font-size: 13px;
  z-index: 2;
}
.project-layout > .project-content {
  grid-column: 2;
}
body.project-context::before {
  content: '';
  position: fixed;
  top: var(--topbar);
  bottom: 0;
  left: calc(var(--icon-rail) + 22px + 160px + 22px);
  width: 1px;
  background: var(--line);
  pointer-events: none;
  z-index: 1;
}

.hero-action-form { margin: 0; }
.hero-action {
  background: transparent;
  border: 0;
  color: var(--text);
  font-weight: 500;
  font-size: 14px;
  padding: 8px 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border-radius: 6px;
}
.hero-action:hover:not([disabled]) {
  color: var(--blue);
  background: #f3f6fa;
}
.hero-action[disabled] {
  color: var(--muted);
  cursor: not-allowed;
}
.hero-action .ui-icon {
  width: 18px;
  height: 18px;
}

.project-hero {
  display: block;
  margin-bottom: 24px;
}
.project-hero .project-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.project-hero .title-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.project-hero .title-left h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-hero .hero-mark {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
}
.project-hero .hero-mark .ui-icon {
  width: 28px;
  height: 28px;
}
.project-hero .sub-header {
  list-style: none;
  padding: 12px 0 0 0;
  margin: 0;
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  align-items: center;
}
.project-hero .sub-header li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}
.project-hero .sub-header li .ui-icon {
  width: 18px;
  height: 18px;
  color: #6d7686;
}
.project-hero .sub-header li a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--blue);
}

.webhook-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.webhook-label {
  font-weight: 500;
  font-size: 13px;
  color: var(--text);
  margin: 0;
}
.copy-label {
  background: transparent;
  border: 0;
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  padding: 4px 6px;
  border-radius: 4px;
}
.copy-label:hover {
  background: var(--blue-soft);
}
.copy-label .ui-icon {
  width: 16px;
  height: 16px;
}

.card.deployments-card,
.card.summary-deployments,
.card.summary-side,
.card.project-info,
.list-card {
  overflow: hidden;
}
.project-info-body {
  padding: 18px;
}
.project-info-body .info-line,
.project-info-body .settings-link {
  margin: 8px 0 0 0;
}
.project-info-body code.block {
  display: block;
  margin: 0;
}
.project-nav a {
  color: var(--text);
  font-weight: 500;
}
.project-nav a.active,
.project-nav a:hover {
  color: var(--blue);
  text-decoration: none;
}
.project-content { min-width: 0; }

.project-hero {
  margin-bottom: 14px;
}
.project-title-row h1 {
  margin-bottom: 4px;
}
.project-title-row p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.project-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-size: 12px;
}
.project-meta span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.project-meta .ui-icon {
  width: 18px;
  height: 18px;
  color: #697586;
}
.summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, .95fr);
  gap: 16px;
}
.summary-deployments {
  padding: 0;
}
.summary-deployments h3,
.project-info h3 {
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}
.summary-cells {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.summary-cells div {
  padding: 16px 18px;
  border-right: 1px solid var(--line);
}
.summary-cells div:last-child {
  border-right: 0;
}
.summary-cells span {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 8px;
  letter-spacing: 0;
  text-transform: none;
}
.summary-cells span.ok-text { color: var(--green); }
.summary-cells span.bad-text { color: var(--red); }
.summary-cells strong,
.summary-side strong {
  display: block;
  font-size: 24px;
  line-height: 1.1;
  font-weight: 500;
  color: var(--text);
}
.summary-side {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 0;
}
.summary-side > div {
  padding: 16px 18px;
  border-right: 1px solid var(--line);
  position: relative;
}
.summary-side > div:last-child {
  border-right: 0;
}
.summary-side a {
  display: inline-block;
  margin-top: 12px;
  font-size: 13px;
}
.summary-icon {
  position: absolute;
  right: 18px;
  top: 42px;
  width: 24px;
  height: 24px;
  color: var(--blue);
}
.project-info {
  padding: 0 18px 16px;
}
.project-info label {
  padding-top: 14px;
}
.copy-label {
  float: right;
  color: var(--blue);
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.copy-label .ui-icon,
.info-line .ui-icon,
.settings-link .ui-icon {
  width: 18px;
  height: 18px;
}
.info-line {
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.settings-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.phase {
  padding: 0;
  overflow: hidden;
}
.phase-heading {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.phase-heading h3 {
  margin: 0 !important;
  line-height: 1;
}
.phase .inline-toolbar,
.phase p {
  padding-left: 18px;
  padding-right: 18px;
}
/* Padding now centralized in .section-card; .settings-card kept as alias for specific overrides. */
.settings-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 14px 0 8px 0;
  padding-top: 0;
  padding-bottom: 0;
  color: var(--text);
}
/* Unified: any card flagged .section-card has padding: 0 so .table-card-head
   spans edge-to-edge; child content gets 18px horizontal padding instead. */
.section-card {
  padding: 0 !important;
  overflow: hidden;
}
.section-card > * {
  padding-left: 18px;
  padding-right: 18px;
}
.section-card > .table-card-head {
  padding: 14px 18px;
  margin: 0;
}
.section-card > .table-card-head h3 {
  margin: 0 !important;
}
.section-card > h3 {
  padding-top: 4px;
  padding-bottom: 4px;
}
.section-card > .form-actions,
.section-card > .sticky-actions,
.section-card > .button-row {
  padding: 14px 18px;
  margin: 0;
  background: var(--panel);
  border-top: 1px solid var(--line);
}
/* hidden inputs should not get padding */
.section-card > input[type=hidden] { padding: 0 !important; }
/* Standalone textarea (not inside label): inset from card edges like other inputs */
.section-card > textarea {
  width: calc(100% - 36px);
  margin: 0 18px;
  padding: 10px 12px;
  display: block;
}
.settings-card > label,
.settings-card > .check {
  padding-top: 4px;
  padding-bottom: 4px;
}
.settings-card .rule-note {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
/* form-actions styling now centralized in .section-card > .form-actions */
.danger-card {
  border-color: #efc2c2;
  background: #fffafa;
}
.danger-card .form-actions { justify-content: flex-end; }

.meta {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.meta span { color: var(--muted); }
.meta strong { color: var(--text); }
.log {
  white-space: pre-wrap;
  overflow-x: auto;
  background: #111827;
  color: #e5e7eb;
  border-radius: 7px;
  padding: 16px;
  min-height: 120px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  margin: 0;
}

.timeline-day {
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  margin: 0;
  padding: 10px 22px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  letter-spacing: .04em;
}
.timeline { padding: 0; }
.timeline div {
  display: grid;
  grid-template-columns: 140px 90px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 14px 22px;
  font-size: 13px;
}
.timeline div:last-child { border-bottom: 0; }
.timeline time { color: var(--muted); font-size: 13px; }
.timeline p { margin: 0; min-width: 0; }

.notifications { padding: 0 22px; }
.notice {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.notice:last-child { border-bottom: 0; }
.notice-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 600;
}
.notice-icon .ui-icon { width: 18px; height: 18px; }
.notice-body h3 { margin: 2px 0 4px; font-size: 14px; font-weight: 600; }
.notice-body p { margin: 0 0 8px; font-size: 13px; color: #4b5462; }
.notice.unread .notice-icon::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff3131;
  position: absolute;
  top: 12px;
  left: 26px;
  border: 2px solid #fff;
}

.flash {
  border-radius: 7px;
  padding: 12px 16px;
  margin-bottom: 18px;
  background: var(--blue-soft);
  border: 1px solid #bed5ff;
  font-weight: 500;
  font-size: 13px;
}
.flash.success { background: var(--green-soft); border-color: #b8e5d5; color: var(--green); }
.flash.error { background: var(--red-soft); border-color: #f5bcbc; color: var(--red); }

.error-card {
  border-color: #f5bcbc;
  background: #fff7f7;
}
.error-card .table-card-head {
  border-bottom-color: #f5bcbc;
}
.error-card .table-card-head h3 {
  color: var(--red);
}
.error-card .log {
  background: #221111;
  color: #fbd8d8;
  margin-top: 12px;
  margin-bottom: 16px;
  max-height: 240px;
  overflow: auto;
}
.recent-failure p { margin: 6px 0 0; }
.recent-failure .button.secondary { margin-top: 6px; }

.webapp-agent-card { padding: 0; }
.webapp-agent-card .table-card-head h3 { margin: 0; }
.webapp-agent-card .table-card-head .small {
  font-weight: 500;
  text-align: right;
  max-width: 60%;
}
.agent-empty { padding: 16px 22px; font-size: 13px; }
.agent-empty p { margin: 0; }
.agent-list {
  display: grid;
  gap: 0;
}
.agent-row {
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.agent-row:last-child { border-bottom: 0; }
.agent-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
}
.agent-row-head h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}
.agent-detail {
  display: grid;
  grid-template-columns: minmax(140px, 180px) minmax(0, 1fr);
  gap: 6px 18px;
  margin: 0;
}
.agent-detail dt {
  color: var(--muted);
  font-weight: 500;
}
.agent-detail dd {
  margin: 0;
  min-width: 0;
  word-break: break-all;
}
.agent-detail dd code { display: inline-block; max-width: 100%; }
.agent-hint {
  margin: 12px 0 0;
  font-size: 13px;
}

.deployment-events-card { padding: 0; }
.deployment-events-card .table-card-head h3 { margin: 0; }
.deployment-events-card .table-card-head .small {
  font-weight: 500;
  text-align: right;
  max-width: 60%;
}
.event-empty {
  padding: 14px 18px;
  margin: 0;
  font-size: 13px;
}
.event-log {
  max-height: 320px;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  background: #0f172a;
  color: #e2e8f0;
}
.event-row {
  display: grid;
  grid-template-columns: minmax(140px, 160px) minmax(80px, 110px) minmax(60px, 80px) minmax(0, 1fr);
  gap: 12px;
  padding: 9px 18px;
  border-bottom: 1px solid #1f2937;
  align-items: baseline;
}
.event-row:last-child { border-bottom: 0; }
.event-row time { color: #94a3b8; white-space: nowrap; }
.event-row .event-tag {
  color: #c4b5fd;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.event-row .event-level-tag {
  color: #93c5fd;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .03em;
  font-weight: 800;
}
.event-row.event-level-bad .event-level-tag { color: #fca5a5; }
.event-row.event-level-ok .event-level-tag { color: #86efac; }
.event-row.event-level-run .event-level-tag { color: #93c5fd; }
.event-row .event-msg { white-space: pre-wrap; word-break: break-word; }

.event-tail {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 0;
}
.event-tail .badge {
  padding: 2px 8px;
  font-size: 11px;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--blue);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}
.link-button:disabled,
.link-button[disabled],
.link-button[data-busy="1"] {
  color: var(--muted);
  cursor: not-allowed;
  opacity: .55;
  pointer-events: none;
}
.button:disabled,
.button[disabled],
.button[data-busy="1"] {
  opacity: .55;
  cursor: not-allowed;
  pointer-events: none;
}
.drawer-scrim,
.mobile-nav-scrim,
.search-scrim,
.modal-scrim {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(8, 30, 58, .55);
  backdrop-filter: blur(4px);
  display: none;
}
.drawer-scrim.is-open,
.mobile-nav-scrim.is-open,
.search-scrim.is-open,
.modal-scrim.is-open {
  display: flex;
}
.drawer-scrim {
  justify-content: flex-end;
  padding: 14px 52px 14px 14px;
}
.mobile-nav-scrim,
.search-scrim {
  padding: 12px;
}
.search-scrim {
  justify-content: center;
  align-items: flex-start;
}
.notification-drawer {
  width: min(480px, calc(100vw - 40px));
  height: calc(100vh - 28px);
  overflow: auto;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 18px 44px rgba(15, 23, 42, .2);
}
.drawer-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--line);
}
.drawer-head h2,
.modal-head h2 {
  margin: 0;
  font-size: 15px;
  line-height: 1.2;
  font-weight: 600;
  flex: 1;
}
.drawer-head form { font-size: 13px; }
.drawer-close {
  color: #1f2937;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
}
.drawer-close:hover {
  background: #f3f6fa;
  text-decoration: none;
}
.drawer-close .ui-icon {
  width: 18px;
  height: 18px;
}
.drawer-list { padding: 0 18px 18px; }
.drawer-notice {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.drawer-notice:last-child { border-bottom: 0; }
.drawer-notice-icon {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f5f7fb;
  color: #607086;
  display: grid;
  place-items: center;
}
.drawer-notice-icon .ui-icon {
  width: 18px;
  height: 18px;
}
.drawer-notice.unread .drawer-notice-icon::after {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ff3131;
  border: 2px solid #fff;
  position: absolute;
  top: -1px;
  right: -1px;
}
.drawer-notice-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
  font-weight: 500;
}
.drawer-notice-body h3 {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 600;
}
.drawer-notice-body p {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.45;
  color: #4b5462;
}
.drawer-action { font-size: 13px; font-weight: 500; }
.drawer-empty { padding: 18px 0; font-size: 13px; }

.mobile-nav-drawer,
.search-panel {
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 18px 44px rgba(15, 23, 42, .16);
  overflow: auto;
}
.mobile-nav-drawer {
  width: min(360px, calc(100vw - 24px));
  height: calc(100vh - 24px);
  border-radius: 10px;
}
.mobile-nav-section {
  display: grid;
  gap: 3px;
  padding: 14px 18px 18px;
  border-bottom: 1px solid var(--line);
}
.mobile-nav-section:last-child { border-bottom: 0; }
.mobile-nav-section strong {
  color: var(--muted);
  font-size: 12px;
  margin: 8px 0;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.mobile-nav-section a {
  color: #202123;
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 42px;
  border-radius: 8px;
  padding: 8px 10px;
  font-weight: 500;
}
.mobile-nav-section a.active,
.mobile-nav-section a:hover {
  color: var(--blue);
  background: var(--blue-soft);
  text-decoration: none;
}
.mobile-nav-section .ui-icon {
  width: 22px;
  height: 22px;
  color: #687386;
}
.project-mobile-links a {
  color: var(--blue);
  padding-left: 0;
}

.search-panel {
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100vh - 24px);
  margin-top: 70px;
  border-radius: 9px;
  box-shadow: 0 20px 50px rgba(15,23,42,.2);
}
.search-panel-input {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px 0 14px;
  border-bottom: 1px solid var(--line);
}
.search-panel-input .ui-icon {
  width: 16px;
  height: 16px;
  color: #687386;
}
.search-panel-input input {
  border: 0;
  padding: 0;
  min-width: 0;
  flex: 1;
  font-size: 14px;
  font-weight: 400;
  background: transparent;
}
.search-panel-input input:focus {
  box-shadow: none;
  background: transparent;
}
.search-panel-body {
  display: grid;
  gap: 12px;
  padding: 12px 14px 16px;
}
.search-panel-body h3 {
  color: var(--muted);
  font-size: 11px;
  margin: 0;
  letter-spacing: .04em;
  font-weight: 500;
}
.filter-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.filter-pills button {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #273142;
  border-radius: 999px;
  padding: 5px 10px;
  font-weight: 500;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}
.filter-pills button.active {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-soft);
}
.recent-searches {
  display: grid;
  gap: 2px;
}
.recent-searches a {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 18px;
  gap: 8px;
  align-items: center;
  color: #202123;
  min-height: 32px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  padding: 0 6px;
}
.recent-searches a:hover {
  color: var(--blue);
  background: var(--blue-soft);
  text-decoration: none;
}
.recent-searches small {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recent-searches .ui-icon {
  width: 15px;
  height: 15px;
  color: #7b8493;
}
.recent-delete {
  cursor: pointer;
  color: #aab2bd;
  display: grid;
  place-items: center;
}
.recent-delete:hover {
  color: var(--text);
}
.recent-delete .ui-icon {
  width: 14px;
  height: 14px;
}
.search-panel-footer {
  border-top: 1px solid var(--line);
  padding: 9px 14px;
  text-align: right;
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}
.modal-scrim {
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-scrim:not([hidden]) {
  display: flex;
}
.project-modal {
  width: min(520px, calc(100vw - 36px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: 0 22px 55px rgba(15,23,42,.22);
  display: grid;
  gap: 0;
}
.project-modal:focus-within {
  border-color: #b8cdf8;
  box-shadow: 0 22px 55px rgba(15,23,42,.22), 0 0 0 3px rgba(22, 84, 209, .12);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 {
  font-size: 15px;
  font-weight: 600;
}
.modal-body {
  display: grid;
  gap: 14px;
  padding: 18px 20px;
}
.important-notice {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 14px;
  background: var(--warning-soft);
  border-top: 3px solid #ffa12b;
  border-radius: 0;
  padding: 16px 20px;
  margin: -18px -20px 2px;
}
.important-notice h3 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
}
.important-notice p {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.55;
}
.important-notice p:last-child {
  margin-bottom: 0;
}
.important-notice strong {
  font-weight: 600;
}
.important-notice a {
  color: #202123;
  text-decoration: underline;
  text-decoration-style: dashed;
  text-underline-offset: 4px;
  font-weight: 500;
}
.notice-round {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #f59e0b;
  background: #ffe3b4;
}
.notice-round .ui-icon {
  width: 20px;
  height: 20px;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
}

.combo {
  position: relative;
}
.combo-control {
  display: flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  overflow: hidden;
}
.combo.is-open .combo-control,
.combo:focus-within .combo-control {
  border-color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue);
  background: #f8fbff;
}
.combo-control input {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
.combo-control input:focus {
  box-shadow: none;
  border: 0;
  background: transparent;
}
.combo-control button {
  width: 48px;
  min-height: 48px;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.combo-control button span {
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 7px solid #8b949e;
}
.combo.is-open .combo-control button span {
  border-top: 0;
  border-bottom: 7px solid #8b949e;
}
.combo-menu {
  display: none;
  position: absolute;
  z-index: 60;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 16px 30px rgba(15, 23, 42, .14);
  padding: 8px;
}
.combo.is-open .combo-menu {
  display: grid;
  gap: 4px;
}
.combo-menu button {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 6px;
  padding: 10px 12px;
  color: #314155;
  font: inherit;
  cursor: pointer;
}
.combo-menu button:hover,
.combo-menu button.is-active {
  background: var(--blue-soft);
  color: var(--blue);
}

/* .git-card layout now handled by .section-card pattern (padding 0 + child padding 18px) */
.git-card > h3:not(:first-child),
.git-card > label,
.git-card > p,
.git-card > textarea,
.git-card > .button-row {
  margin-top: 14px;
}
.git-note {
  display: flex;
  align-items: center;
  gap: 16px;
  border-top: 3px solid #202123;
  background: #eef2f8;
  border-radius: 0 0 8px 8px;
  padding: 18px;
  margin-top: 24px;
}
.git-note p {
  margin: 0;
}
.notice-round.small {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  color: #6b7280;
  background: #d9dee8;
}
.provider-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
  margin-top: 24px;
}
.provider-card {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: #202123;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  position: relative;
}
.provider-card .ui-icon {
  width: 20px;
  height: 20px;
}
.provider-card.active {
  border-color: var(--blue);
  background: var(--blue-soft);
  box-shadow: 0 0 0 1px var(--blue);
}
.provider-card.is-disabled {
  opacity: .55;
  filter: grayscale(1);
  cursor: not-allowed;
}
.provider-card.is-disabled:hover::after {
  content: attr(title);
  position: absolute;
  transform: translateY(42px);
  background: #111827;
  color: #fff;
  border-radius: 5px;
  padding: 5px 8px;
  font-size: 12px;
}

/* RunCloud parity polish: denser surfaces, softer focus, lighter visual weight. */
:root {
  --shadow: 0 1px 2px rgba(15, 23, 42, .045);
}

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible,
summary:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 2px rgba(22, 84, 209, .16);
}

h1 { font-size: 20px; font-weight: 800; }
h3,
.table-card-head h3,
.summary-deployments h3,
.project-info h3,
.drawer-head h2,
.modal-head h2 {
  font-weight: 500;
}

.button,
.space-switcher,
.quick-search,
.rail a,
.project-nav a,
.badge,
label {
  font-weight: 500;
}

.card { padding: 14px 16px; }
.card.summary-deployments,
.card.summary-side,
.card.project-info,
.card.deployments-card,
.card.detail-form,
.card.phase,
.list-card {
  padding: 0;
}
.card,
.list-card {
  box-shadow: var(--shadow);
}
.list-card .toolbar,
.list-card .empty-row,
.list-footer,
.table-card-head,
.summary-deployments h3,
.project-info h3 {
  padding-left: 16px;
  padding-right: 16px;
}
th,
td {
  padding: 9px 16px;
}
th {
  font-weight: 500;
  color: var(--muted);
  background: #f5f7fb;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  letter-spacing: .02em;
}
.list-card thead tr,
.card thead tr {
  background: #f5f7fb;
}

.project-hero { margin-bottom: 12px; }
.project-layout { gap: 44px; }
.project-meta { gap: 12px; }
.summary-grid { gap: 14px; }
.summary-cells div,
.summary-side > div {
  padding: 14px 16px;
}
.summary-cells strong,
.summary-side strong {
  font-size: 22px;
  font-weight: 500;
}

.recent-card {
  max-width: none;
  width: 100%;
  margin-bottom: 12px;
  padding-bottom: 4px;
}
.recent-title {
  font-size: 12px;
  margin-bottom: 7px;
}
.recent-project {
  gap: 10px;
  line-height: 1.25;
}
.recent-project a {
  color: #202123;
  font-weight: 500;
}
.recent-project a:hover {
  color: var(--blue);
  text-decoration: none;
}
.recent-project p {
  margin-top: 1px;
  font-size: 12px;
}
.recent-project p a {
  color: #6d7686;
  font-size: 12px;
  font-weight: 400;
}
.recent-project p a:hover {
  color: var(--blue);
}
.recent-project:hover .repo-mark {
  color: var(--blue);
}
.list-footer {
  color: #5f6978;
  font-size: 12px;
}
.list-footer .count-strong,
.count-strong {
  color: #202123;
  font-weight: 500;
}

.search-scrim {
  background: rgba(8, 30, 58, .5);
  backdrop-filter: blur(3px);
}
.search-panel {
  width: min(640px, calc(100vw - 32px));
  margin-top: 64px;
  border-color: #d8dee8;
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, .18);
}
.search-panel-input {
  min-height: 46px;
  padding: 0 12px;
}
.search-panel-input:focus-within {
  border-bottom-color: #cfd8e6;
  box-shadow: none;
}
.search-panel-input input {
  outline: 0;
  font-size: 13px;
}
.search-panel-input input:focus {
  outline: 0;
  border-color: transparent;
  box-shadow: none;
}
.search-panel-body {
  gap: 10px;
  padding: 12px;
}
.filter-pills button {
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 500;
}
.recent-searches {
  gap: 2px;
  border: 0;
  border-radius: 0;
}
.recent-searches a {
  grid-template-columns: 18px minmax(0, 1fr) 16px;
  min-height: 36px;
  border-radius: 6px;
  padding: 6px 8px;
  border: 0;
  font-weight: 500;
}
.recent-searches small {
  font-size: 12px;
}
.search-panel-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #fbfcfe;
}
.search-panel-footer kbd {
  min-width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #d9e0ea;
  border-bottom-color: #c5ceda;
  border-radius: 4px;
  background: #fff;
  color: #4b5563;
  font: inherit;
  font-size: 11px;
  line-height: 1;
  box-shadow: 0 1px 0 rgba(15, 23, 42, .05);
}

input:focus,
select:focus,
textarea:focus {
  border-color: #7fa4ee;
  box-shadow: 0 0 0 2px rgba(22, 84, 209, .1);
  background: #fff;
}
.search:focus-within {
  border-color: #8cadf0;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(22, 84, 209, .08);
}
.project-modal {
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(15, 23, 42, .18);
}
.project-modal:focus-within {
  border-color: var(--line);
  box-shadow: 0 18px 44px rgba(15, 23, 42, .18);
}
.combo.is-open .combo-control,
.combo:focus-within .combo-control,
.provider-card.active {
  border-color: #8cadf0;
  box-shadow: 0 0 0 2px rgba(22, 84, 209, .08);
  background: #fff;
}
.combo-menu {
  border-color: #d8dee8;
  box-shadow: 0 12px 26px rgba(15, 23, 42, .12);
  padding: 6px;
}
.combo-menu button {
  padding: 8px 10px;
}

.drawer-scrim {
  padding: 12px 48px 12px 12px;
}
.notification-drawer {
  width: min(440px, calc(100vw - 40px));
  height: calc(100vh - 24px);
  border-radius: 8px;
  box-shadow: 0 16px 38px rgba(15, 23, 42, .18);
}
.drawer-head {
  padding: 12px 16px 10px;
  gap: 10px;
}
.drawer-head h2 {
  font-size: 14px;
}
.drawer-head form,
.drawer-action {
  font-size: 12px;
}
.drawer-list {
  padding: 0 14px 14px;
}
.drawer-notice {
  grid-template-columns: 32px 1fr;
  gap: 10px;
  padding: 10px 0;
}
.drawer-notice-icon {
  width: 30px;
  height: 30px;
  background: #f1f4f8;
  color: #66758a;
}
.drawer-notice-icon .ui-icon {
  width: 16px;
  height: 16px;
}
.drawer-notice-meta {
  gap: 10px;
  margin-bottom: 3px;
  font-size: 11px;
  font-weight: 500;
}
.drawer-notice-body h3 {
  margin-bottom: 3px;
  font-size: 13px;
  font-weight: 500;
}
.drawer-notice-body p {
  margin-bottom: 6px;
  font-size: 12px;
  line-height: 1.45;
  color: #556070;
}

@media (max-width: 1100px) {
  .rail {
    width: 82px;
  }
  .rail a {
    padding-left: 26px;
    padding-right: 26px;
  }
  .rail a span {
    display: none;
  }
  .shell { margin-left: 82px; }
  body.project-context .shell { margin-left: var(--icon-rail); }
  .summary-grid { grid-template-columns: 1fr; }
  .provider-grid { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
}

@media (max-width: 900px) {
  .example-grid {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .example-arrow {
    transform: rotate(90deg);
    justify-self: center;
    align-self: center;
  }
  .example-card { width: 100%; }
  .example-card code {
    white-space: normal;
    word-break: break-all;
  }
  .editor-toolbar {
    flex-wrap: wrap;
    gap: 8px;
  }
}

@media (max-width: 760px) {
  .app-topbar {
    position: static;
    height: var(--topbar);
    flex-wrap: nowrap;
    gap: 8px;
    padding: 0 16px;
    overflow: hidden;
  }
  .mobile-menu { display: inline-flex; }
  .cloud-mark,
  .top-diamond,
  .top-actions .top-icon[aria-label="Announcements"],
  .top-actions .top-icon[aria-label="Help"] {
    display: none;
  }
  .space-switcher {
    min-width: 154px;
    max-width: 154px;
    padding: 0 12px;
    font-size: 14px;
  }
  .quick-search {
    width: 42px;
    height: 42px;
    margin-left: 0;
    padding: 0;
    justify-content: center;
    flex: 0 0 42px;
  }
  .quick-search .quick-search-text,
  .quick-search .shortcut { display: none; }
  .rail { display: none; }
  .global-icon-rail { display: none; }
  .mobile-nav-scrim,
  .search-scrim {
    padding: 8px;
  }
  .mobile-nav-drawer {
    width: 100%;
    height: calc(100vh - 16px);
  }
  .search-panel {
    width: 100%;
    max-height: calc(100vh - 16px);
    margin-top: 80px;
  }
  .shell {
    margin-left: 0;
    padding: 24px 16px;
  }
  body.project-context .shell {
    margin-left: 0;
    padding-left: 16px;
  }
  .top-actions {
    margin-left: 0;
    gap: 8px;
  }
  .top-icon,
  .avatar {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
  }
  .drawer-scrim { padding: 8px; }
  .notification-drawer {
    width: 100%;
    height: calc(100vh - 16px);
  }
  .drawer-notice {
    grid-template-columns: 48px 1fr;
    gap: 14px;
  }
  .drawer-notice-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }
  .modal-head,
  .modal-body,
  .modal-actions {
    padding-left: 20px;
    padding-right: 20px;
  }
  .important-notice {
    grid-template-columns: 1fr;
  }
  h1 { font-size: 23px; }
  .project-layout { grid-template-columns: 1fr; }
  .project-nav {
    display: none;
  }
  .project-hero,
  .toolbar,
  .phase-heading,
  .project-title-row,
  .button-row {
    align-items: stretch;
    flex-direction: column;
  }
  .form.compact,
  .summary-side,
  .summary-cells {
    grid-template-columns: 1fr;
  }
  .provider-grid {
    grid-template-columns: 1fr;
  }
  .activity-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
  }
  .activity-toolbar .search,
  .activity-toolbar .status-filter {
    width: 100%;
    margin-left: 0;
    border-radius: 7px;
  }
  .timeline-day {
    padding: 18px 20px;
  }
  .timeline div {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 18px 20px;
  }
  .summary-cells div,
  .summary-side > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .summary-cells div:last-child,
  .summary-side > div:last-child {
    border-bottom: 0;
  }
  th, td,
  .list-card .toolbar,
  .list-card .empty-row,
  .list-footer {
    padding: 12px 14px;
  }
  .card { padding: 15px; }
  .agent-row { padding: 12px 14px; }
  .agent-row-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .agent-detail {
    grid-template-columns: 1fr;
    gap: 4px 0;
  }
  .agent-detail dt { margin-top: 8px; }
  .event-row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 10px 16px;
  }
  .webapp-agent-card .table-card-head,
  .deployment-events-card .table-card-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .webapp-agent-card .table-card-head .small,
  .deployment-events-card .table-card-head .small {
    text-align: left;
    max-width: 100%;
  }
  .admin-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .admin-tabs::-webkit-scrollbar { display: none; }
  .admin-tab {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 10px 14px;
  }
  .modal-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .modal-tabs::-webkit-scrollbar { display: none; }
  .modal-tab {
    flex: 0 0 auto;
    white-space: nowrap;
  }
  .example-grid {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .example-arrow {
    transform: rotate(90deg);
    justify-self: center;
    align-self: center;
  }
  .example-card { width: 100%; }
  .example-card code {
    white-space: normal;
    word-break: break-all;
  }
  .choice-stack {
    max-width: 100%;
  }
  .editor-toolbar {
    flex-wrap: wrap;
    gap: 8px;
  }
  .editor-actions {
    flex-wrap: wrap;
  }
  .form-actions,
  .sticky-actions {
    flex-wrap: wrap;
    gap: 10px;
  }
  .sticky-actions .button,
  .form-actions .button {
    flex: 1 1 auto;
    min-width: 0;
    text-align: center;
    justify-content: center;
  }
  .scroll-x {
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
  }
  .topline,
  .breadcrumb {
    flex-wrap: wrap;
    row-gap: 4px;
    font-size: 12px;
  }
  .channel-pick {
    grid-template-columns: auto 1fr;
    grid-template-areas: "cb txt" "cb meta";
    gap: 6px 12px;
  }
  .title-left {
    width: 100%;
    min-width: 0;
    flex-wrap: wrap;
  }
  .title-left h1,
  .project-hero h1 {
    min-width: 0;
    max-width: 100%;
    word-break: break-word;
    overflow-wrap: anywhere;
  }
  body.project-context::before {
    display: none;
  }
}

/* Toast notifications */
.toast-stack {
  position: fixed;
  top: calc(var(--topbar) + 12px);
  right: 16px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 10px 16px;
  border-radius: var(--radius);
  background: var(--text);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  pointer-events: auto;
  cursor: pointer;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity .2s, transform .2s;
}
.toast-visible { opacity: 1; transform: translateX(0); }
.toast-success { background: var(--green); }
.toast-error { background: var(--red); }

/* Typeahead */
.typeahead-wrap { position: relative; }
.typeahead-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 8px 20px rgba(0,0,0,.1);
  z-index: 20;
}
.typeahead-option {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  background: none;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.typeahead-option:hover,
.typeahead-option.is-active {
  background: var(--blue-soft);
}
.typeahead-empty {
  padding: 12px;
  color: var(--muted);
  font-size: 12px;
}

/* Admin tabs */
.admin-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--line);
  margin-bottom: 20px;
}
.admin-tab {
  padding: 10px 20px;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  text-decoration: none;
}
.admin-tab:hover { color: var(--text); text-decoration: none; }
.admin-tab.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

/* Admin modal */
.admin-modal {
  width: min(480px, calc(100vw - 32px));
  margin: 80px auto;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 18px 44px rgba(15,23,42,.18);
}
.inline-form { display: inline; }
.link-button.danger { color: var(--red); }
.link-button.danger:hover { text-decoration: underline; }
.row-actions { white-space: nowrap; }
.row-actions a { margin-right: 12px; }
.row-actions { white-space: nowrap; }

/* Search overlay sections */
.search-results {
  max-height: 420px;
  overflow-y: auto;
  padding: 4px 8px;
}
.search-section { margin-bottom: 8px; }
.search-section-header {
  padding: 12px 8px 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.search-result {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  margin-bottom: 6px;
  color: var(--text);
  text-decoration: none;
  border-radius: 10px;
  font-weight: 400;
  background: #fff;
  border: 1.5px solid var(--line);
}
.search-result:hover,
.search-result.is-selected {
  background: var(--blue-soft);
  border-color: var(--blue);
  text-decoration: none;
}
.search-result:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}
.search-result-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #f5f7fb;
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  color: #607086;
}
.search-result-icon .ui-icon {
  width: 20px;
  height: 20px;
}
.search-result:hover .search-result-icon,
.search-result.is-selected .search-result-icon {
  border: 1.5px solid var(--blue);
}
.search-result-text { flex: 1; min-width: 0; }
.search-result-name {
  display: block;
  font-weight: 600;
  font-size: 14px;
}
.search-result-sub {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.search-result-chevron {
  flex: 0 0 16px;
  color: var(--muted);
}
.search-result-chevron .ui-icon {
  width: 16px;
  height: 16px;
}
.search-empty {
  padding: 24px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* Recently viewed grid */
.recently-viewed-grid {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.recently-viewed-item {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 280px;
  width: 280px;
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  box-sizing: border-box;
}
.recently-viewed-item > div {
  min-width: 0;
  flex: 1;
}
.recently-viewed-item strong,
.recently-viewed-item .small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recently-viewed-item strong a {
  color: var(--text);
  font-weight: 600;
}
.recently-viewed-item strong a:hover {
  color: var(--blue);
}
.recently-viewed-item .small a {
  color: var(--muted);
}
.recently-viewed-item .small a:hover {
  color: var(--blue);
}
.recently-viewed-item strong {
  display: block;
  font-size: 13px;
}

/* Modal/drawer transitions */
.modal-scrim:not([hidden]),
.drawer-scrim.is-open,
.search-scrim.is-open {
  animation: fadeIn .15s ease-out;
}
.admin-modal,
.project-modal,
.notification-drawer,
.search-panel {
  animation: slideUp .2s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* Unread notification pulse */
.unread-dot {
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}

/* Mobile search full-screen */
@media (max-width: 760px) {
  .search-panel {
    margin-top: 0;
    height: calc(100vh - 16px);
    max-height: none;
    border-radius: var(--radius);
  }
  .search-results { max-height: calc(100vh - 180px); }
  .admin-modal {
    width: 100%;
    margin: 0;
    height: 100vh;
    border-radius: 0;
  }
  .recently-viewed-grid { flex-direction: column; }
  .recently-viewed-item { min-width: 0; }
}

/* Custom checkbox/radio with rounded corners (script form parity).
   Must explicitly reset padding/margin because the global `input {}` rule
   sets padding: 9px 11px; width: 100%; which breaks box-sizing math. */
.check input[type=checkbox],
.check input[type=radio],
.radio input[type=radio] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  max-width: 18px;
  max-height: 18px;
  padding: 0;
  margin: 0;
  border: 1.5px solid var(--line-strong);
  background: #fff;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  flex-grow: 0;
  transition: border-color .12s, background .12s;
}
.check input[type=checkbox] { border-radius: 5px; }
.check input[type=radio],
.radio input[type=radio] { border-radius: 50%; }
.check input[type=checkbox]:hover,
.check input[type=radio]:hover,
.radio input[type=radio]:hover { border-color: var(--blue); }
.check input[type=checkbox]:checked,
.check input[type=radio]:checked,
.radio input[type=radio]:checked {
  background: var(--blue);
  border-color: var(--blue);
}
.check input[type=checkbox]:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 0px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.check input[type=radio]:checked::after,
.radio input[type=radio]:checked::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: #fff;
}
.check input[type=checkbox]:focus-visible,
.check input[type=radio]:focus-visible,
.radio input[type=radio]:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(22, 84, 209, .18);
}

/* Tighter spacing between input above and a checkbox section title */
.detail-form > .form-section.tight-top { margin-top: 6px; }

/* Searchable single-select combobox (When to Run This Script, etc.) */
.combobox { position: relative; display: block; }
.combobox-input { width: 100%; padding-right: 34px; cursor: text; }
.combobox-chevron {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--muted);
  font-size: 10px;
  line-height: 1;
}
.combobox.is-open .combobox-chevron { color: var(--blue); }
.combobox-listbox {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 300px;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
  z-index: 20;
  list-style: none;
  padding: 4px 0;
  margin: 0;
}
.combobox-option {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
}
.combobox-option.is-highlighted { background: var(--blue-soft); color: var(--blue-dark); }
.combobox-option.is-selected { background: var(--blue); color: #fff; }
.combobox-option.is-selected.is-highlighted { background: var(--blue-dark); }
.combobox-empty {
  padding: 10px 14px;
  color: var(--muted);
  font-size: 13px;
  font-style: italic;
}

/* Login page */
.login-body {
  margin: 0;
  background: var(--bg);
  min-height: 100vh;
  font-family: inherit;
}
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(15, 23, 42, .06);
  padding: 36px;
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
}
.login-card h1 {
  margin: 0;
  text-align: center;
  font-size: 22px;
  font-weight: 800;
}
.login-card .login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 4px;
}
.login-card .login-logo .ui-icon {
  width: 56px;
  height: 56px;
  color: var(--blue);
}

/* Avatar dropdown */
.avatar-wrap { position: relative; display: inline-block; }
.avatar-wrap .avatar {
  cursor: pointer;
  border: 0;
  font: inherit;
}
.avatar-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(15, 23, 42, .14);
  min-width: 200px;
  z-index: 200;
  padding: 6px 0;
}
.avatar-menu-head {
  padding: 10px 14px;
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.avatar-menu a {
  display: block;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
}
.avatar-menu a:hover { background: var(--blue-soft); color: var(--blue-dark); }

/* Notification channel modal */
.modal-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.modal-tab {
  flex: 1;
  background: var(--bg);
  border: 0;
  padding: 12px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border-radius: 0;
}
.modal-tab.is-active {
  background: #fff;
  color: var(--text);
  font-weight: 600;
}
.channels-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.channels-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.channels-empty {
  padding: 24px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.channel-pick {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  background: #fff;
  font-weight: normal;
}
.channel-pick:last-child { border-bottom: 0; }
.channel-pick:hover { background: var(--blue-soft); }
.channel-pick > input[type=checkbox] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  border: 1.5px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
}
.channel-pick > input[type=checkbox]:checked {
  background: var(--blue);
  border-color: var(--blue);
}
.channel-pick > input[type=checkbox]:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 0;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.channel-pick-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}
.channel-pick-text strong { font-size: 13px; font-weight: 600; color: var(--text); }
.channel-pick-text .small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.modal-footer-info {
  margin-right: auto;
}
.badge.small { padding: 3px 8px; font-size: 11px; font-weight: 500; }

/* Required field indication: error border + message styling */
.field-error {
  color: var(--red);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.field-error::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--red);
  position: relative;
  flex-shrink: 0;
  background-image: radial-gradient(circle, #fff 1px, transparent 1.5px), linear-gradient(#fff, #fff);
  background-size: 2px 2px, 2px 7px;
  background-position: center 10px, center 3px;
  background-repeat: no-repeat;
}

/* Loading button (used by Save Project AJAX submit) */
.button.is-loading {
  opacity: .85;
  cursor: wait;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.button.is-loading > * { pointer-events: none; }
.btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: btn-spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* /admin/cloudflare tab: vertical breathing room + zone-id chip styling. */
.cf-admin-section {
  margin-bottom: 1.25rem;
}
.cf-admin-section > p {
  padding: 12px 0px 0;
  margin: 0;
}
.cf-admin-section .cf-admin-pad {
  padding: 12px 18px 16px;
}
.cf-admin-section table th,
.cf-admin-section table td {
  padding: .75rem 1rem;
  vertical-align: middle;
}
.cf-admin-section table small code {
  white-space: nowrap;
  font-size: .78em;
  background: rgba(0,0,0,.04);
  padding: 1px 6px;
  border-radius: 4px;
}
.cf-admin-section form.inline-form {
  margin: 0;
}

/* /admin/cloudflare: checkbox column + sortable headers */
.cf-zone-check-col { width: 56px; text-align: center; }
.cf-zone-check { display: inline-flex; cursor: pointer; }
.cf-zone-check input { transform: scale(1.15); cursor: pointer; }
tr.cf-zone-reviewed { background: rgba(34, 197, 94, .06); }
tr.cf-zone-reviewed td { color: var(--muted); }
tr.cf-zone-reviewed td strong { color: var(--text); opacity: .75; }
[data-cf-zones-table] th[data-sort] { position: relative; padding-right: 22px; }
[data-cf-zones-table] th[data-sort]::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  opacity: .25;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 5px solid currentColor;
}
[data-cf-zones-table] th[data-sort]:hover::after { opacity: .55; }
[data-cf-zones-table] th.cf-sort-asc::after  { opacity: 1; }
[data-cf-zones-table] th.cf-sort-desc::after { opacity: 1; transform: translateY(-50%) rotate(180deg); }

/* /admin/cloudflare: domain expiration colored badge */
.cf-exp {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.25;
  font-weight: 500;
  white-space: nowrap;
}
.cf-exp small { font-weight: 400; opacity: .85; font-size: 11px; }
.cf-exp-ok       { background: rgba(34,197,94,.12);  color: #15803d; }
.cf-exp-warning  { background: rgba(234,179,8,.15);  color: #a16207; }
.cf-exp-urgent   { background: rgba(249,115,22,.18); color: #c2410c; }
.cf-exp-critical { background: rgba(239,68,68,.22);  color: #b91c1c; font-weight: 700; }
.cf-exp-expired  { background: rgba(127,29,29,.85);  color: #fff; font-weight: 700; }

/* /admin/cloudflare zone detail: custom select chevron, flips on focus */
.cf-admin-section select,
.cf-zone-edit select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='none' stroke='%23475569' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M2 2l4 4 4-4'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 11px 7px;
  padding-right: 30px;
  transition: background-image .15s;
}
.cf-admin-section select:focus,
.cf-zone-edit select:focus {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='none' stroke='%231d4ed8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M2 6l4-4 4 4'/></svg>");
}

/* Auto Minify row: align CSS/HTML/JS labels above their selects nicely */
.cf-minify-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(80px, 110px)) auto auto;
  gap: 10px;
  align-items: end;
}
.cf-minify-field { display: flex; flex-direction: column; gap: 4px; }
.cf-minify-field label { font-size: 12px; color: var(--muted); }

/* Stats column on /admin/cloudflare table */
.cf-zones-stats strong { font-size: 15px; }

/* DNS records inline editor */
.cf-dns-table tr[data-cf-dns-row] code { background: rgba(0,0,0,.04); padding: 2px 5px; border-radius: 3px; }
.cf-dns-editor-row > td { padding: 16px 18px; background: rgba(59,130,246,.04); border-top: 2px solid #3b82f6; border-bottom: 2px solid #3b82f6; }
.cf-dns-form-grid {
  display: grid;
  grid-template-columns: 110px 1fr 1.4fr 130px 110px 1fr;
  gap: 12px 14px;
  align-items: end;
}
.cf-dns-form-grid label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.cf-dns-form-grid select,
.cf-dns-form-grid input[type=text] {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
}
.cf-dns-form-actions { margin-top: 14px; display: flex; gap: 10px; justify-content: flex-end; }
.cf-dns-toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.cf-dns-toggle input { appearance: none; -webkit-appearance: none; width: 38px; height: 22px; background: #cbd5e1; border-radius: 999px; position: relative; cursor: pointer; transition: background .15s; }
.cf-dns-toggle input::before { content: ""; position: absolute; left: 2px; top: 2px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: left .15s; }
.cf-dns-toggle input:checked { background: #f97316; }
.cf-dns-toggle input:checked::before { left: 18px; }
.cf-dns-toggle em { font-style: normal; font-size: 12px; color: var(--muted); }
@media (max-width: 1024px) {
  .cf-dns-form-grid { grid-template-columns: 1fr 1fr; }
}

/* Zone analytics dashboard — tabs, range picker, controls */
.cf-dash-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line);
  padding: 0 18px;
  margin-top: 8px;
}
.cf-dash-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  margin-bottom: -1px;
}
.cf-dash-tab:hover { color: #1e293b; }
.cf-dash-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; }
.cf-dash-rangebtn {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #1e293b;
}
.cf-dash-rangebtn:hover { border-color: #94a3b8; }
.cf-dash-rangebtn .cf-dash-cal { font-size: 14px; }
.cf-dash-rangebtn .cf-dash-caret { font-size: 10px; color: #64748b; }
.cf-dash-select {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
}
.cf-dash-panel table { border-collapse: collapse; }
.cf-dash-panel table th { font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); color: #64748b; font-size: 12px; }
.cf-dash-panel table td { padding: 8px 10px; border-bottom: 1px solid #f1f5f9; }
.cf-dash-panel .cf-bar { transition: fill-opacity .12s, stroke .12s; }
.cf-dash-panel .cf-bar.cf-bar-active { fill-opacity: 0.85; stroke: #1e40af; stroke-width: 1.5; }
.cf-dash-tooltip {
  position: absolute;
  z-index: 50;
  background: #0f172a;
  color: #fff;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.5;
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(15,23,42,.25);
  min-width: 160px;
  transform: translate(-50%, -100%);
  margin-top: -8px;
  white-space: nowrap;
}
.cf-dash-tooltip .t-label { font-weight: 600; margin-bottom: 6px; padding-bottom: 6px; border-bottom: 1px solid rgba(255,255,255,.15); }
.cf-dash-tooltip .t-row { display: flex; justify-content: space-between; gap: 14px; }
.cf-dash-tooltip .t-row span:first-child { color: #cbd5e1; }
.cf-dash-tooltip .t-row span:last-child { font-weight: 600; }
.cf-dash-tooltip .t-dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.cf-analytics-card .scroll-x table th { font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); color: #64748b; font-size: 12px; }
.cf-analytics-card .scroll-x table td { padding: 8px 10px; border-bottom: 1px solid #f1f5f9; }

/* daterangepicker — reset global table/th/td bleed + Bootstrap btn fallback */
.daterangepicker table { width: auto; border-collapse: separate; }
.daterangepicker th, .daterangepicker td {
  padding: 0;
  border-bottom: 0;
  text-align: center;
  vertical-align: middle;
  font-size: 13px;
  font-weight: 400;
  color: inherit;
  letter-spacing: normal;
}
.daterangepicker tbody tr:last-child td { border-bottom: 0; }
.daterangepicker .btn {
  display: inline-block;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid transparent;
  line-height: 1.4;
  margin-left: 6px;
}
.daterangepicker .btn-primary { background: #3b82f6; color: #fff; border-color: #3b82f6; }
.daterangepicker .btn-primary:hover { background: #2563eb; border-color: #2563eb; }
.daterangepicker .btn-default { background: #fff; color: #334155; border-color: #cbd5e1; }
.daterangepicker .btn-default:hover { background: #f1f5f9; }
.daterangepicker .ranges li {
  font-size: 13px;
  padding: 8px 14px;
  cursor: pointer;
  border-radius: 4px;
  margin: 1px 0;
}
.daterangepicker .ranges li:hover { background: #f1f5f9; }
.daterangepicker .ranges li.active { background: #3b82f6; color: #fff; }
.daterangepicker td.in-range { background: #eef2ff; color: #1e293b; }
.daterangepicker td.active, .daterangepicker td.active:hover { background: #3b82f6; color: #fff; border-radius: 4px; }
.daterangepicker td.available:hover { background: #e2e8f0; border-radius: 4px; }
.daterangepicker td.off { color: #cbd5e1; }
.daterangepicker td.off.in-range { background: transparent; }
.daterangepicker th.month { font-weight: 600; color: #1e293b; font-size: 13px; }
.daterangepicker th.next, .daterangepicker th.prev { cursor: pointer; padding: 4px; }
.daterangepicker th.next:hover, .daterangepicker th.prev:hover { background: #f1f5f9; border-radius: 4px; }
