:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --border: #2d3a4f;
  --text: #e7ecf3;
  --muted: #8b9cb3;
  --primary: #3b82f6;
  --success: #22c55e;
  --danger: #ef4444;
  --radius: 10px;
  font-family: "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

.layout {
  max-width: 880px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

header h1 {
  margin: 0 0 1.5rem;
  font-size: 1.75rem;
}

.subtitle {
  color: var(--muted);
  margin: 0 0 1.5rem;
}

.subtitle.workflow {
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: 52rem;
}

.https-banner {
  background: #7f1d1d;
  border: 1px solid #ef4444;
  color: #fecaca;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.88rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  margin-bottom: 1rem;
}

.card h2 {
  margin: 0 0 0.65rem;
  font-size: 1.05rem;
}

.hint {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 1rem;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.stats {
  gap: 1.5rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.stats span {
  font-weight: 700;
  color: var(--primary);
}

button {
  border: none;
  border-radius: 8px;
  padding: 0.55rem 1.1rem;
  font-size: 0.95rem;
  cursor: pointer;
  font-weight: 600;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.primary {
  background: var(--primary);
  color: #fff;
}

.success {
  background: var(--success);
  color: #052e14;
}

.danger {
  background: var(--danger);
  color: #fff;
}

.card-warn {
  border-color: #7f4a2a;
}

.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.82rem;
}

.match-list {
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
}

.match-list.empty {
  padding: 1rem;
  color: var(--muted);
}

.match-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.match-item:last-child {
  border-bottom: none;
}

.match-item .path {
  word-break: break-all;
}

.match-item .badge {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

.progress-wrap {
  margin-top: 1rem;
}

.progress-wrap.hidden {
  display: none;
}

.progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar > div {
  height: 100%;
  width: 0%;
  background: var(--success);
  transition: width 0.2s;
}

#progressText {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0.4rem 0 0;
}

.log {
  margin-top: 1rem;
  padding: 0.75rem;
  background: #0a0e14;
  border-radius: 8px;
  font-size: 0.78rem;
  max-height: 200px;
  overflow: auto;
  color: #a8b8d0;
  white-space: pre-wrap;
}

code {
  background: #0a0e14;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  font-size: 0.88em;
}

.service-list {
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 0.75rem;
}

.service-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.service-item:last-child {
  border-bottom: none;
}

.service-item input {
  margin: 0;
}

.service-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.status-running {
  color: #4ade80;
}

.status-stopped {
  color: var(--muted);
}

.status-other {
  color: #fbbf24;
}

.log-compact {
  max-height: 120px;
  margin-top: 0.75rem;
}

.path-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: stretch;
}

.path-input {
  flex: 1 1 240px;
  min-width: 200px;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0a0e14;
  color: var(--text);
  font-size: 0.9rem;
}

.path-label {
  margin: 0.5rem 0 0;
  word-break: break-all;
}

.path-field {
  display: block;
  margin-top: 1rem;
}

.path-field-label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.path-field .path-input {
  width: 100%;
}

.ps-banner {
  background: #14532d;
  border: 1px solid var(--success);
  color: #bbf7d0;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.88rem;
  line-height: 1.45;
}

.ps-banner.hidden {
  display: none;
}
