:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #18202b;
  --muted: #657386;
  --line: #d9e0e8;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --warn: #9a3412;
  --shadow: 0 18px 40px rgba(24, 32, 43, 0.08);
}

* {
  box-sizing: border-box;
}

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

.app-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 28px clamp(18px, 4vw, 56px);
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.back-link,
.header-link,
.open-link,
.copy-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
}

.layout {
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto 56px;
}

.toolbar,
.summary {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 16px;
  margin-bottom: 16px;
}

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

.toolbar label,
.summary > div,
.workflow-card,
.empty-state {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.toolbar label {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.toolbar span,
.summary span,
.meta {
  color: var(--muted);
  font-size: 0.88rem;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  padding: 0 12px;
}

.summary > div {
  padding: 16px;
}

.summary strong {
  display: block;
  font-size: 1.35rem;
}

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.workflow-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 260px;
  padding: 18px;
}

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

.card-head h2 {
  margin-bottom: 0;
  font-size: 1.15rem;
  line-height: 1.25;
}

.status {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 9px;
  background: #e6f4f1;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
}

.status.inactive {
  background: #f5eee8;
  color: var(--warn);
}

.meta {
  margin-bottom: 0;
  line-height: 1.5;
}

.node-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.node-list span {
  max-width: 100%;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--muted);
  font-size: 0.8rem;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}

.copy-button {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.empty-state {
  padding: 36px;
  text-align: center;
}

.empty-state p {
  margin-bottom: 0;
  color: var(--muted);
}

@media (max-width: 760px) {
  .app-header,
  .toolbar,
  .summary {
    grid-template-columns: 1fr;
  }

  .header-link,
  .back-link {
    width: 100%;
  }
}
