:root {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: #1a2723;
  background: #f4f6f3;
  color-scheme: light;
  --background: #f4f6f3;
  --surface: #fff;
  --border: #dbe2dc;
  --muted: #5e6d65;
  --accent: #206b50;
  --accent-hover: #174f3e;
  --sidebar: #142622;
  --sidebar-muted: #a9bcb3;
  --sidebar-text: #eef5ee;
  --radius: 12px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
h1 {
  font-size: clamp(1.85rem, 3vw, 2.6rem);
  line-height: 1.12;
  letter-spacing: -0.05em;
  overflow-wrap: anywhere;
}
h2 { font-size: 1.15rem; line-height: 1.3; letter-spacing: -0.02em; }
h3 { font-size: 1.04rem; }
::selection { color: #102921; background: #c5e6d4; }
:focus-visible { outline: 2px solid #207f62; outline-offset: 3px; }
.muted { color: var(--muted); font-weight: 400; }

.skip-link {
  position: fixed;
  z-index: 5;
  inset: 12px auto auto 12px;
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--surface);
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.shell { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100dvh; }
.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 35px;
  min-height: 100dvh;
  height: max-content;
  padding: 30px 17px 18px;
  color: var(--sidebar-text);
  background: var(--sidebar);
}
.sidebar :focus-visible { outline-color: #8ad5b4; }
.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: inherit;
  font-weight: 720;
  font-size: 1.02rem;
  line-height: 1.18;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.sidebar .brand { margin: 0 7px; }
.brand-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 10px;
  background: #d7eddc;
  color: #24654e;
}
.brand-mark i {
  width: 3px;
  height: 14px;
  border-radius: 3px;
  background: currentColor;
  transform: rotate(28deg);
}
.brand-mark i:nth-child(2) { height: 19px; }
.brand-mark i:nth-child(3) { height: 10px; }
.main-nav { display: grid; gap: 4px; }
.main-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 43px;
  padding: 8px 11px;
  color: var(--sidebar-muted);
  border: 1px solid transparent;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 550;
}
.main-nav a:hover { background: #233a33; color: #f4fbf4; }
.main-nav a[aria-current] {
  background: #2a463b;
  border-color: #3c5649;
  color: #f1fbf0;
  font-weight: 680;
}
.nav-icon { position: relative; display: block; flex: 0 0 15px; width: 15px; height: 15px; }
.overview-icon {
  border: 1.35px solid currentColor;
  border-radius: 3px;
  background: linear-gradient(90deg, transparent calc(50% - .6px), currentColor calc(50% - .6px), currentColor calc(50% + .6px), transparent calc(50% + .6px)),
    linear-gradient(transparent calc(50% - .6px), currentColor calc(50% - .6px), currentColor calc(50% + .6px), transparent calc(50% + .6px));
}
.workflows-icon::before, .workflows-icon::after {
  position: absolute;
  content: '';
  width: 8px;
  height: 8px;
  border: 1.35px solid currentColor;
  border-radius: 2px;
}
.workflows-icon::before { left: 0; top: 0; }
.workflows-icon::after { right: 0; bottom: 0; background: var(--sidebar); }
.main-nav a:hover .workflows-icon::after { background: #233a33; }
.main-nav a[aria-current] .workflows-icon::after { background: #2a463b; }
.runs-icon {
  border: 1.35px solid currentColor;
  border-radius: 3px;
}
.runs-icon::before {
  content: '';
  position: absolute;
  inset: 3px 3px auto;
  height: 1px;
  background: currentColor;
  box-shadow: 0 3px 0 currentColor;
}
.sidebar-footer { margin-top: auto; }
.runtime {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 7px 13px;
  color: var(--sidebar-muted);
  font-size: 0.78rem;
  font-weight: 620;
}
.runtime::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #79b998;
}
.account {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 5px 8px;
  padding: 11px 7px 0;
  border-top: 1px solid #3a5046;
}
.account-mark {
  grid-row: span 2;
  display: grid;
  place-items: center;
  align-self: start;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #dcf1e3;
  background: #375547;
  font-weight: 670;
  font-size: 0.83rem;
}
.account-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.78rem; }
.signout {
  grid-column: 2;
  width: max-content;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--sidebar-muted);
  font-size: 0.76rem;
}
.signout:hover { color: white; text-decoration: underline; }

.main-wrap { min-width: 0; }
.main-content { max-width: 1310px; margin: 0 auto; padding: 48px clamp(22px, 4.3vw, 68px) 65px; }
.main-content:focus { outline: none; }
.mode-notice {
  padding: 10px clamp(22px, 4.3vw, 68px);
  color: #5e4a20;
  background: #f8f0d9;
  border-bottom: 1px solid #e9ddbb;
  font-size: 0.81rem;
  font-weight: 580;
}
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 25px;
  margin-bottom: 25px;
  border-bottom: 1px solid var(--border);
}
.page-description { margin-top: 7px; color: var(--muted); font-size: 0.94rem; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; flex-shrink: 0; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 39px;
  padding: 7px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 670;
  line-height: 1.25;
  white-space: nowrap;
  text-decoration: none;
}
.button.primary { background: var(--accent); color: white; }
.button.primary:hover { background: var(--accent-hover); }
.button.secondary { color: #274238; border-color: var(--border); background: var(--surface); }
.button.secondary:hover { border-color: #9eb7aa; background: #f5faf6; }
.button.danger { color: #9e3c36; border-color: #efd4d0; background: #fff; }
.button.danger:hover { background: #fff2ef; border-color: #e0a9a4; }
.button.compact { min-height: 32px; padding: 5px 10px; font-size: 0.84rem; }
.button:disabled { opacity: 0.64; }
.text-link, .back-link, .item-link { color: var(--accent-hover); font-weight: 660; text-decoration: none; }
.text-link { font-size: 0.87rem; white-space: nowrap; }
.back-link { display: inline-block; margin-bottom: 16px; font-size: 0.88rem; }
.text-link:hover, .back-link:hover, .item-link:hover { text-decoration: underline; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 22px;
}
.stat {
  position: relative;
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 16px 38px 15px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
}
.stat:hover { border-color: #a8bfb1; background: #fbfdfb; }
.stat-label { color: var(--muted); font-size: 0.82rem; font-weight: 620; line-height: 1.35; }
.stat-value { font-size: 2rem; font-weight: 710; line-height: 1; letter-spacing: -0.065em; font-variant-numeric: tabular-nums; }
.stat-arrow {
  position: absolute;
  top: 13px;
  right: 13px;
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 6px;
  color: #386651;
  background: #edf5ef;
  font-size: 0.87rem;
  font-weight: 700;
}
.review-stat { border-color: #eadfbe; background: #fffdf6; }
.review-stat .stat-arrow { color: #745920; background: #f7ecd0; }
.panel {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 59px;
  padding: 13px 17px;
  border-bottom: 1px solid var(--border);
}
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 12px 17px; border-bottom: 1px solid #edf0ed; vertical-align: middle; }
th { color: var(--muted); background: #f7f9f7; font-size: 0.78rem; font-weight: 670; }
td { font-size: 0.86rem; }
td:last-child { color: #53645b; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f8fbf8; }
.item-link { display: inline-block; line-height: 1.25; overflow-wrap: anywhere; }
.run-workflow-cell { width: 56%; min-width: 126px; }
.run-revision { display: block; margin-top: 3px; color: var(--muted); font-size: 0.75rem; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 20px;
  background: #edf1ee;
  color: #4d5c53;
  font-size: 0.73rem;
  line-height: 1.35;
  font-weight: 680;
  white-space: nowrap;
}
.badge-dot { flex: 0 0 5px; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-running { background: #e6eef9; color: #245b91; }
.badge-needs_review { background: #f9eed3; color: #745420; }
.badge-approved, .badge-succeeded { background: #e3f1e8; color: #246248; }
.badge-failed, .badge-rejected { background: #fae9e7; color: #933a35; }
.empty-state {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 36px 20px;
  text-align: center;
}
.empty-state p { color: var(--muted); font-size: 0.9rem; }
.empty-state .button { margin-top: 9px; }
.empty-symbol, .workflow-mark {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border-radius: 9px;
  color: #307055;
  background: #e8f2e9;
  font-size: 1.3rem;
  line-height: 1;
}
.empty-symbol { margin-bottom: 5px; }
.loading-text { padding: 18px; color: var(--muted); font-size: 0.86rem; }
.main-content > .loading-text { padding-left: 0; }

.workflow-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 265px), 1fr)); gap: 14px; }
.workflow-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
  min-height: 175px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.workflow-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 2px; }
.workflow-card h2 { overflow-wrap: anywhere; }
.workflow-version, .review-label { color: var(--muted); font-size: 0.75rem; font-weight: 650; }
.workflow-description {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.87rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.workflow-footer { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 8px; }
.workflow-actions { display: flex; gap: 6px; margin-left: auto; }
.workflow-actions .button { min-height: 32px; padding: 5px 10px; font-size: 0.84rem; }
.review-label { color: #73561f; }
.filters { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.filters select { max-width: 185px; min-height: 33px; padding: 4px 8px; font-size: 0.83rem; }

.run-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 20px;
  padding: 13px 16px;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.run-facts dt { margin-bottom: 4px; color: var(--muted); font-size: 0.77rem; font-weight: 650; }
.run-facts dd { margin: 0; font-size: 0.85rem; }
.detail-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 14px; }
.run-text {
  margin: 0;
  padding: 16px 17px;
  font: inherit;
  font-size: 0.92rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.error-output { color: #88332d; }
.run-placeholder { padding: 16px 17px; color: var(--muted); font-size: 0.87rem; }
.alert-error {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 15px;
  padding: 11px 13px;
  border: 1px solid #edcfcb;
  border-radius: 8px;
  color: #88332d;
  background: #fff4f2;
  font-size: 0.86rem;
}

.signin-page {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: 22px;
  background: radial-gradient(ellipse at 48% 32%, #edf5ed 0, #f4f6f3 61%);
}
.startup-status { color: var(--muted); }
.signin-card {
  width: min(100%, 430px);
  padding: clamp(22px, 5vw, 37px);
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--surface);
  box-shadow: 0 16px 45px #1a463015;
}
.signin-brand { margin-bottom: 23px; }
.signin-card h1 { margin: 0 0 20px; font-size: 2rem; }
.signin-card .button { width: 100%; margin-top: 6px; }
form { display: grid; gap: 6px; }
form label { font-size: 0.89rem; font-weight: 670; color: #2a3930; }
form input + label, form textarea + label, form p.field-note + label { margin-top: 7px; }
input:not([type=checkbox]), textarea, select {
  width: 100%;
  min-height: 39px;
  border: 1px solid #cdd8d0;
  border-radius: 7px;
  padding: 7px 9px;
  color: #203127;
  background: #fff;
}
textarea { display: block; resize: vertical; min-height: 96px; }
input::placeholder, textarea::placeholder { color: #718078; opacity: 1; }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; flex: 0 0 16px; margin: 0; }
.checkbox-label { display: flex; gap: 8px; align-items: start; margin: 7px 0; }
.field-note { min-height: 17px; color: var(--muted); font-size: 0.79rem; }
.form-error { padding: 8px 9px; border-radius: 6px; color: #88332d; background: #fff0ed; font-size: 0.86rem; }
dialog {
  width: min(calc(100% - 30px), 560px);
  max-height: calc(100dvh - 30px);
  margin: auto;
  padding: 21px 23px 19px;
  border: 1px solid var(--border);
  border-radius: 15px;
  color: #203127;
  background: var(--surface);
  box-shadow: 0 20px 68px #14262238;
  overflow: auto;
}
dialog::backdrop { background: #15231d77; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.dialog-header h2 { font-size: 1.28rem; }
.close-button {
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #50655a;
  font-size: 1.4rem;
  line-height: 1;
}
.close-button:hover { background: #edf4ed; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 9px; }
.notification {
  position: fixed;
  z-index: 2;
  bottom: 20px;
  right: 20px;
  max-width: min(370px, calc(100vw - 40px));
  padding: 10px 14px;
  border: 1px solid #4c6b5e;
  border-radius: 8px;
  background: #18352a;
  color: #fff;
  font-size: 0.88rem;
  pointer-events: none;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 130ms ease, transform 130ms ease;
}
.notification.visible { transform: translateY(0); opacity: 1; }

@media (max-width: 1040px) {
  .shell { grid-template-columns: 202px minmax(0, 1fr); }
  .sidebar { padding-inline: 13px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .shell { display: block; }
  .sidebar {
    position: static;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    min-height: 0;
    padding: 11px 15px 8px;
  }
  .sidebar .brand { margin: 0; }
  .sidebar-footer { grid-column: 2; grid-row: 1; margin: 0; }
  .runtime, .account-email, .account-mark { display: none; }
  .account { display: block; border: 0; padding: 0; }
  .signout { padding: 6px; }
  .main-nav { grid-template-columns: repeat(3, minmax(0, max-content)); grid-column: span 2; }
  .main-nav a { min-height: 35px; padding: 5px 8px; gap: 7px; }
  .nav-icon { transform: scale(.84); }
  .main-content { padding: 24px 16px 52px; }
  .mode-notice { padding-inline: 16px; }
  .page-header { padding-bottom: 16px; margin-bottom: 16px; }
  .run-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 485px) {
  .detail-columns { grid-template-columns: minmax(0, 1fr); }
  .page-header { flex-wrap: wrap; gap: 11px; }
  .section-heading { flex-wrap: wrap; }
  .filters { justify-content: flex-start; }
  th, td { padding-inline: 10px; }
  td:last-child { white-space: normal; min-width: 85px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
