:root {
  --background: 210 8% 11%;
  --foreground: 210 6% 96%;
  --card: 210 8% 14%;
  --card-foreground: 210 6% 96%;
  --primary: 210 6% 77%;
  --primary-foreground: 210 8% 11%;
  --secondary: 210 7% 18%;
  --secondary-foreground: 210 6% 96%;
  --muted: 210 7% 18%;
  --muted-foreground: 210 4% 50%;
  --border: 210 6% 22%;
  --input: 210 7% 18%;
  --ring: 210 6% 77%;
  --radius: 0.375rem;
  --header-text-underglow: 0 1px 0 rgba(245, 246, 247, 0.2), 0 0 10px rgba(193, 196, 200, 0.22), 0 3px 12px rgba(43, 46, 51, 0.35);
}

body.light {
  --background: 210 20% 98%;
  --foreground: 210 10% 12%;
  --card: 0 0% 100%;
  --card-foreground: 210 10% 12%;
  --primary: 210 12% 30%;
  --primary-foreground: 0 0% 100%;
  --secondary: 210 16% 93%;
  --secondary-foreground: 210 10% 20%;
  --muted: 210 16% 93%;
  --muted-foreground: 210 8% 46%;
  --border: 210 14% 86%;
  --input: 210 16% 93%;
  --ring: 210 12% 30%;
  --header-text-underglow: 0 1px 0 rgba(245, 246, 247, 0.6), 0 0 8px rgba(193, 196, 200, 0.46), 0 2px 8px rgba(43, 46, 51, 0.24);
}

*,
*::before,
*::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Jost', 'Avenir Next', 'Avenir', system-ui, sans-serif;
  font-feature-settings: "rlig" 1, "calt" 1;
  letter-spacing: 0.01em;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
}

.flow-page {
  max-width: 1500px;
  margin: 0 auto;
  padding: 20px;
}

.flow-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, hsl(210 8% 11%) 0%, hsl(210 8% 16%) 100%);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 20px;
}

body.light .flow-header {
  background: linear-gradient(135deg, hsl(210 12% 30%) 0%, hsl(210 10% 22%) 100%);
}

.flow-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.flow-logo {
  height: 50px;
  width: auto;
  filter: brightness(0) invert(1);
}

body.light .flow-logo {
  filter: none;
}

.flow-header h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0.02em;
  color: #fff;
}

.flow-header p {
  margin: 4px 0 0;
  opacity: 0.92;
  color: #fff;
}

.flow-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.flow-header h1,
.flow-header p,
.flow-header .btn-secondary,
.flow-header .lang-btn {
  text-shadow: var(--header-text-underglow);
}

.language-toggle {
  display: inline-flex;
  align-items: center;
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  overflow: hidden;
}

body.light .language-toggle {
  border-color: rgba(255, 255, 255, 0.4);
}

.lang-btn {
  min-width: 44px;
  height: 2.5rem;
  border: none;
  border-right: 1px solid hsl(var(--border));
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0 10px;
}

.lang-btn:last-child {
  border-right: none;
}

.lang-btn.active {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

body.light .lang-btn {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border-right-color: rgba(255, 255, 255, 0.4);
}

body.light .lang-btn.active {
  background: #fff;
  color: hsl(210 12% 30%);
}

.theme-toggle-btn {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid hsl(var(--border));
  background: hsl(var(--secondary));
  color: hsl(var(--foreground));
  cursor: pointer;
}

body.light .theme-toggle-btn {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.theme-icon-light { display: none; }
.theme-icon-dark { display: inline; }
body.light .theme-icon-light { display: inline; }
body.light .theme-icon-dark { display: none; }

.btn-primary, .btn-secondary {
  height: 2.5rem;
  padding: 10px 16px;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid hsl(var(--border));
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn-primary {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
}

.btn-secondary {
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}

body.light .flow-header .btn-secondary {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

.flow-toolbar {
  margin-top: 16px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.toolbar-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toolbar-group label {
  font-size: 13px;
  color: hsl(var(--muted-foreground));
}

.toolbar-group select {
  min-width: 220px;
  height: 2.5rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid hsl(var(--border));
  background: hsl(var(--input));
  color: hsl(var(--foreground));
  padding: 0 10px;
}

.toolbar-actions {
  flex-direction: row;
  align-items: center;
}

.flow-layout {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
}

.flow-card,
.manual-card,
.legend-card,
.all-steps-card {
  background: hsl(var(--card));
  color: hsl(var(--card-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 18px;
}

.flow-card h2,
.manual-card h2,
.legend-card h2,
.all-steps-card h2 {
  margin: 0 0 8px;
  letter-spacing: 0.02em;
}

.card-description,
.manual-summary {
  color: hsl(var(--muted-foreground));
  margin: 0 0 14px;
}

.flow-map {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.flow-node-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.flow-node {
  width: 100%;
  text-align: left;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  border-radius: calc(var(--radius) - 1px);
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}

.flow-node:hover {
  border-color: hsl(var(--ring));
  transform: translateY(-1px);
}

.flow-node:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.theme-toggle-btn:focus-visible,
.lang-btn:focus-visible,
select:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}

.flow-node.active {
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.22);
}

.flow-node.dimmed {
  opacity: 0.4;
}

.flow-node-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.flow-node-title {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.flow-node-owner {
  margin-top: 6px;
  color: hsl(var(--muted-foreground));
  font-size: 13px;
}

.flow-connector {
  margin: 0 auto;
  width: 2px;
  height: 14px;
  background: hsl(var(--border));
}

.flow-connector.highlight {
  background: hsl(var(--primary));
}

.manual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.manual-item {
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  padding: 10px;
  background: hsl(var(--muted) / 0.4);
}

.manual-item h3,
.manual-list-card h3 {
  margin: 0 0 6px;
  font-size: 14px;
  color: hsl(var(--muted-foreground));
}

.manual-item p {
  margin: 0;
}

.manual-list-card {
  margin-top: 10px;
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  padding: 10px;
  background: hsl(var(--muted) / 0.3);
}

.manual-list-card ol,
.manual-list-card ul {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.legend-card {
  margin-top: 16px;
}

.legend-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.legend-item p {
  margin: 8px 0 0;
  color: hsl(var(--muted-foreground));
  font-size: 14px;
}

.status-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
}

.flow-node.status-pending {
  background: linear-gradient(130deg, rgba(245, 246, 247, 0.14) 0%, rgba(193, 196, 200, 0.2) 55%, rgba(123, 127, 133, 0.28) 100%);
  border-color: rgba(193, 196, 200, 0.5);
}

.flow-node.status-in_progress {
  background: linear-gradient(130deg, rgba(193, 196, 200, 0.18) 0%, rgba(123, 127, 133, 0.25) 56%, rgba(43, 46, 51, 0.38) 100%);
  border-color: rgba(123, 127, 133, 0.58);
}

.flow-node.status-completed {
  background: linear-gradient(130deg, rgba(245, 246, 247, 0.16) 0%, rgba(193, 196, 200, 0.24) 45%, rgba(123, 127, 133, 0.22) 100%);
  border-color: rgba(193, 196, 200, 0.55);
}

.flow-node.status-canceled {
  background: linear-gradient(130deg, rgba(123, 127, 133, 0.25) 0%, rgba(43, 46, 51, 0.44) 100%);
  border-color: rgba(123, 127, 133, 0.6);
}

.status-pill.status-pending {
  background: linear-gradient(135deg, rgba(245, 246, 247, 0.28) 0%, rgba(193, 196, 200, 0.46) 100%);
  color: #f5f6f7;
  border-color: rgba(193, 196, 200, 0.6);
}

.status-pill.status-in_progress {
  background: linear-gradient(135deg, rgba(193, 196, 200, 0.26) 0%, rgba(123, 127, 133, 0.5) 100%);
  color: #f5f6f7;
  border-color: rgba(123, 127, 133, 0.62);
}

.status-pill.status-completed {
  background: linear-gradient(135deg, rgba(245, 246, 247, 0.24) 0%, rgba(193, 196, 200, 0.42) 100%);
  color: #f5f6f7;
  border-color: rgba(193, 196, 200, 0.62);
}

.status-pill.status-canceled {
  background: linear-gradient(135deg, rgba(123, 127, 133, 0.28) 0%, rgba(43, 46, 51, 0.62) 100%);
  color: #f5f6f7;
  border-color: rgba(123, 127, 133, 0.55);
}

body.light .flow-node.status-pending {
  background: linear-gradient(130deg, rgba(245, 246, 247, 0.96) 0%, rgba(193, 196, 200, 0.86) 56%, rgba(193, 196, 200, 0.72) 100%);
}

body.light .flow-node.status-in_progress {
  background: linear-gradient(130deg, rgba(193, 196, 200, 0.82) 0%, rgba(123, 127, 133, 0.38) 100%);
}

body.light .flow-node.status-completed {
  background: linear-gradient(130deg, rgba(245, 246, 247, 0.95) 0%, rgba(193, 196, 200, 0.8) 100%);
}

body.light .flow-node.status-canceled {
  background: linear-gradient(130deg, rgba(123, 127, 133, 0.4) 0%, rgba(43, 46, 51, 0.26) 100%);
}

body.light .status-pill.status-pending,
body.light .status-pill.status-in_progress,
body.light .status-pill.status-completed,
body.light .status-pill.status-canceled {
  color: #2b2e33;
  border-color: rgba(123, 127, 133, 0.4);
}

.all-steps-card { margin-top: 16px; }

.all-step-item {
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  padding: 12px;
  margin-bottom: 10px;
}

.all-step-item h3 {
  margin: 0 0 8px;
}

@media (max-width: 1024px) {
  .flow-layout {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 720px) {
  .flow-page {
    padding: 12px;
  }

  .flow-header-right {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .toolbar-group select {
    min-width: 100%;
  }

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

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

/* artinian-site-footer */
.artinian-site-footer { text-align:center; padding:14px 12px 10px; margin-top:32px; border-top:1px solid rgba(193,196,200,0.28); font-size:0.75rem; color:rgba(193,196,200,0.75); }
.artinian-site-footer p { margin:0; }
