:root {
  color-scheme: light;
  --bg: #f7f7f3;
  --surface: #ffffff;
  --text: #1f2933;
  --muted: #68737d;
  --line: #d7ded9;
  --accent: #16665b;
  --accent-dark: #0f4d45;
  --danger: #a83a32;
  --ok: #28784f;
  --warn: #946200;
}

* {
  box-sizing: border-box;
}

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

.topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand,
.back {
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 700;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto 60px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 18px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: 28px;
  margin-bottom: 4px;
}

h2 {
  font-size: 18px;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 0 18px;
  color: #fff;
  background: var(--accent);
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: var(--accent-dark);
}

.ghost {
  color: var(--accent-dark);
  background: transparent;
  border: 1px solid var(--line);
}

.login-panel {
  max-width: 420px;
  margin: 80px auto;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.form {
  display: grid;
  gap: 16px;
}

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

input {
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
}

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

.table-wrap,
.text-block,
.summary-grid article,
.layer {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.table-wrap {
  overflow-x: auto;
}

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

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

th {
  color: var(--muted);
  font-size: 13px;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: #eef5f2;
}

.clip {
  max-width: 320px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eceff1;
  color: #334;
  font-size: 13px;
  font-weight: 700;
}

.status.completed {
  background: #e7f4ec;
  color: var(--ok);
}

.status.running,
.status.pending {
  background: #fff4d8;
  color: var(--warn);
}

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

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.summary-grid article,
.text-block,
.layer {
  padding: 18px;
}

pre {
  direction: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0;
  padding: 14px;
  background: #f1f4f2;
  border-radius: 6px;
  font: 14px/1.7 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.layers {
  margin-top: 24px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}

.hint {
  color: var(--muted);
  font-size: 14px;
}

.layer {
  margin-bottom: 14px;
}

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

dl {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 6px 12px;
  margin: 10px 0 16px;
}

dt {
  color: var(--muted);
  font-weight: 700;
}

dd {
  margin: 0;
}

.empty {
  color: var(--muted);
  text-align: center;
}

@media (max-width: 720px) {
  .topbar,
  .page-head,
  .section-head,
  .layer header {
    align-items: stretch;
    flex-direction: column;
  }

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

  .container {
    width: min(100% - 20px, 1180px);
    margin-top: 18px;
  }
}
