:root {
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #20232b;
  background: #f7f8fa;
  font-size: 16px;
  --bg: #f7f8fa;
  --surface: #fff;
  --sidebar: #f0f2f6;
  --text: #20232b;
  --muted: #626b79;
  --line: #e3e6ec;
  --accent: #315fe9;
  --accent-soft: #e9efff;
  --red: #b3313a;
  --green: #237249;
  --shadow: 0 24px 80px #18223526;
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
select {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  padding: 10px 16px;
  min-height: 44px;
  font-size: 0.875rem;
  font-weight: 550;
  transition:
    background 0.15s,
    transform 0.15s;
}
button:hover {
  background: var(--sidebar);
}
button:active {
  transform: scale(0.98);
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
button.danger {
  color: var(--red);
}
button.quiet {
  border-color: transparent;
  background: transparent;
}
button.small {
  padding: 6px 12px;
  font-size: 0.875rem;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
input,
textarea,
select {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px 12px;
  min-height: 44px;
  width: 100%;
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23626b79' stroke-width='1.5'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-position: right 12px center;
  background-repeat: no-repeat;
  padding-right: 36px;
}
textarea {
  min-height: 108px;
  resize: vertical;
}
label {
  display: grid;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 550;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 2rem;
  font-weight: 650;
  letter-spacing: -0.045em;
  line-height: 1.2;
}
h2 {
  font-size: 1.125rem;
  font-weight: 620;
  letter-spacing: -0.02em;
}
h3 {
  font-size: 1rem;
  font-weight: 600;
}
p {
  line-height: 1.6;
}
small,
.muted {
  color: var(--muted);
}
small {
  font-size: 0.8125rem;
  line-height: 1.5;
}
.shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  position: fixed;
  inset: 0 auto 0 0;
  width: 236px;
  padding: 28px 16px 16px;
  display: flex;
  flex-direction: column;
  overflow: auto;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 12px 28px;
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.04em;
}
.mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--text);
  color: var(--surface);
  display: grid;
  place-items: center;
  font-size: 21px;
}
.brand small {
  display: block;
  font-size: 0.6875rem;
  letter-spacing: 0.13em;
  font-weight: 550;
}
.nav-caption {
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  color: var(--muted);
  padding: 20px 12px 8px;
}
.nav-link {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  padding: 11px 12px;
  border-radius: 8px;
  font-size: 0.875rem;
  margin: 2px 0;
  min-height: 44px;
}
.nav-link:hover {
  text-decoration: none;
  background: var(--line);
}
.nav-link.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 1px 3px #19233a08;
  font-weight: 600;
}
.icon {
  height: 19px;
  width: 19px;
  flex: none;
}
.sidebar-bottom {
  margin-top: auto;
  padding-top: 32px;
}
.identity {
  border-top: 1px solid var(--line);
  padding: 20px 8px 4px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.avatar {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 11px;
  font-size: 0.875rem;
  font-weight: 650;
}
.main {
  grid-column: 2;
  min-width: 0;
}
.topbar {
  height: 84px;
  border-bottom: 1px solid var(--line);
  padding: 16px 40px;
  display: flex;
  gap: 16px;
  align-items: center;
  background: var(--surface);
}
.context {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.context select {
  width: auto;
  max-width: 220px;
  border-color: transparent;
  font-size: 0.875rem;
  font-weight: 550;
}
.divider {
  color: var(--line);
}
.topbar .quiet {
  color: var(--muted);
}
.content {
  max-width: 1440px;
  margin: 0 auto;
  padding: 40px 48px 80px;
}
.eyebrow {
  font-size: 0.75rem;
  font-weight: 550;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 12px;
}
.pagehead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}
.pagehead p {
  color: var(--muted);
  font-size: 0.9375rem;
  margin-top: 10px;
}
.actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  padding: 18px 22px;
  margin-bottom: 32px;
}
.banner h3 {
  font-size: 0.9375rem;
  margin-bottom: 4px;
}
.banner p {
  font-size: 0.875rem;
  color: var(--muted);
}
.banner.warning {
  border-color: #d4a75b;
  color: var(--text);
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 32px;
  margin-bottom: 36px;
}
.stat {
  padding: 8px 0;
}
.stat .value {
  font-size: 2.25rem;
  font-weight: 600;
  letter-spacing: -0.05em;
  margin: 12px 0 4px;
}
.stat .label {
  font-size: 0.875rem;
  color: var(--muted);
}
.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr);
  gap: 32px;
}
.section {
  margin-bottom: 36px;
}
.sectionhead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.row:last-child {
  border-bottom: 0;
}
.row .grow {
  flex: 1;
  min-width: 0;
}
.row p {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 4px;
}
.row h3 {
  overflow-wrap: anywhere;
}
.badge {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  padding: 5px 9px;
  border-radius: 6px;
  background: var(--sidebar);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 550;
}
.badge.running,
.badge.active,
.badge.verified {
  color: var(--green);
  background: #e3f3e9;
}
.badge.failed,
.badge.blocked,
.badge.cancelled {
  color: var(--red);
  background: #fbeaec;
}
.badge.awaiting_approval,
.badge.pending {
  color: #8c5b12;
  background: #fff0d6;
}
.badge.completed {
  color: var(--accent);
  background: var(--accent-soft);
}
.empty {
  text-align: center;
  padding: 52px 24px;
  color: var(--muted);
}
.empty .icon {
  width: 28px;
  height: 28px;
  margin-bottom: 16px;
}
.empty h3 {
  color: var(--text);
  margin-bottom: 8px;
}
.empty p {
  font-size: 0.875rem;
  max-width: 420px;
  margin: 0 auto 20px;
}
.tablewrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.875rem;
  white-space: nowrap;
}
th {
  text-align: left;
  padding: 15px 20px;
  background: var(--bg);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 550;
}
td {
  border-top: 1px solid var(--line);
  padding: 18px 20px;
}
td:first-child {
  font-weight: 550;
  white-space: normal;
  min-width: 190px;
}
td small {
  display: block;
  font-weight: 400;
  margin-top: 5px;
}
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
  overflow: auto;
}
.tabs button {
  border: 0;
  border-radius: 0;
  white-space: nowrap;
  color: var(--muted);
  background: transparent;
  border-bottom: 2px solid transparent;
}
.tabs button.selected {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.note {
  padding: 20px 24px;
  background: var(--accent-soft);
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.875rem;
}
.note strong {
  color: var(--text);
}
.pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.875rem;
  line-height: 1.7;
}
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.loginbox {
  width: 100%;
  max-width: 410px;
}
.loginbox .mark {
  width: 48px;
  height: 48px;
  margin-bottom: 32px;
}
.loginbox h1 {
  margin-bottom: 12px;
}
.loginbox form {
  display: grid;
  gap: 20px;
  margin: 32px 0;
}
.loginbox footer {
  font-size: 0.8125rem;
  color: var(--muted);
  margin-top: 32px;
}
.loading {
  padding: 48px;
  color: var(--muted);
}
dialog {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 28px;
  width: min(640px, calc(100% - 32px));
  max-height: 90vh;
}
dialog::backdrop {
  background: #121b354d;
  backdrop-filter: blur(4px);
}
.modalhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.formgrid {
  display: grid;
  gap: 20px;
}
.formactions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 12px;
}
.fieldhint {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.8125rem;
}
.error {
  color: var(--red);
  font-size: 0.875rem;
  line-height: 1.5;
}
.check {
  display: flex;
  align-items: center;
  gap: 10px;
}
.check input {
  width: 20px;
  min-height: 20px;
}
#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--surface);
  padding: 14px 22px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 20;
  display: none;
  max-width: 90vw;
  font-size: 0.875rem;
}
.search {
  margin-bottom: 24px;
}
.search-results {
  display: grid;
  gap: 8px;
}
.search-results button {
  text-align: left;
}
.source {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 16px;
}
.source p {
  font-size: 0.875rem;
}
.detailhead {
  margin-bottom: 24px;
}
.detailhead p {
  margin-top: 12px;
  color: var(--muted);
}
.mobile-menu {
  display: none;
}
.cost {
  font-variant-numeric: tabular-nums;
}
.activity {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.875rem;
}
.activity small {
  display: block;
  margin-top: 4px;
}
.cardgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.workspace-card {
  padding: 24px;
}
.workspace-card h2 {
  margin: 20px 0 8px;
}
.workspace-card p {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 24px;
}
.workspace-card .actions {
  margin-top: 16px;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #14161a;
  --surface: #1c1f25;
  --sidebar: #181b20;
  --text: #f1f3f6;
  --muted: #a1a9b7;
  --line: #30343e;
  --accent: #8ba8ff;
  --accent-soft: #253250;
  --red: #ff9ca6;
  --green: #9bdeb6;
  background: var(--bg);
  color: var(--text);
}
html[data-theme="dark"] button.primary {
  background: #496ee7;
  color: white;
  border-color: #496ee7;
}
html[data-theme="dark"] .badge.active,
html[data-theme="dark"] .badge.running,
html[data-theme="dark"] .badge.verified {
  background: #223c2e;
}
html[data-theme="dark"] .badge.blocked,
html[data-theme="dark"] .badge.failed,
html[data-theme="dark"] .badge.cancelled {
  background: #422b30;
}
html[data-theme="dark"] .badge.pending,
html[data-theme="dark"] .badge.awaiting_approval {
  color: #f0c681;
  background: #403421;
}
@media (max-width: 1100px) {
  .content {
    padding: 32px;
  }
  .topbar {
    padding: 16px 24px;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .sidebar {
    width: 210px;
  }
  .shell {
    grid-template-columns: 210px 1fr;
  }
  .context select {
    max-width: 180px;
  }
  .topbar .searchlabel {
    display: none;
  }
}
@media (max-width: 760px) {
  .shell {
    display: block;
  }
  .main {
    width: 100%;
  }
  .sidebar {
    display: none;
    width: 236px;
    z-index: 10;
    box-shadow: var(--shadow);
  }
  .sidebar.open {
    display: flex;
  }
  .mobile-menu {
    display: block;
  }
  .topbar {
    height: auto;
    padding: 12px 16px;
    gap: 4px;
  }
  .context {
    gap: 0;
  }
  .context select {
    max-width: 145px;
    font-size: 0.8125rem;
    padding-left: 4px;
  }
  .context .divider {
    display: none;
  }
  .content {
    padding: 28px 20px;
  }
  .pagehead {
    align-items: flex-start;
    gap: 16px;
  }
  .pagehead p {
    font-size: 0.875rem;
  }
  h1 {
    font-size: 1.65rem;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .stat .value {
    font-size: 1.9rem;
  }
  .banner {
    padding: 16px;
    align-items: flex-start;
    flex-direction: column;
  }
  .row {
    padding: 18px 16px;
    gap: 12px;
    flex-wrap: wrap;
  }
  .row .actions {
    width: 100%;
  }
  .pagehead .actions {
    flex: none;
  }
  .pagehead .actions button {
    padding: 10px;
  }
  .sectionhead {
    gap: 8px;
  }
  .sectionhead h2 {
    font-size: 1rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
.brand small {
  white-space: nowrap;
}
button {
  white-space: nowrap;
}
@media (max-width: 760px) {
  .topbar {
    flex-wrap: wrap;
  }
  .topbar > .context {
    order: 4;
    flex: 1 1 100%;
    width: 100%;
  }
  .topbar > .context select {
    flex: 1;
    width: 50%;
    max-width: none;
    min-width: 0;
  }
  .topbar > button[data-action="search"] {
    margin-left: auto;
  }
  .pagehead {
    flex-wrap: wrap;
  }
  .pagehead .actions {
    width: auto;
  }
}
