:root {
  --bg: #1a1a1a;
  --fg: #e8e8e8;
  --card: #2a2a2a;
  --border: #444;
  --accent: #5a9fd4;
  --success: #4a7a3a;
  --error: #8a3a3a;
  --warn: #6a6a3a;
  --muted: #888;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f5f5;
    --fg: #1a1a1a;
    --card: #fff;
    --border: #ccc;
    --accent: #1a5a8a;
    --success: #2a5a1a;
    --error: #8a1a1a;
    --warn: #5a4a1a;
    --muted: #666;
  }
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  padding: 1rem;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  max-width: 640px;
  margin: 0 auto;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}
header h1 { font-size: 1.25rem; margin: 0; }
.logout-form { display: inline; }
.logout-form button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
  cursor: pointer;
  border-radius: 3px;
}
footer {
  margin-top: 2rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--muted);
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.card h2 { margin-top: 0; }

form label {
  display: block;
  margin: 0.75rem 0 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
}
input[type="url"],
input[type="password"],
input[type="text"] {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--fg);
  font-size: 1rem;
}
button[type="submit"] {
  margin-top: 1rem;
  padding: 0.6rem 1.2rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  width: 100%;
}
button[type="submit"]:hover { filter: brightness(1.1); }

.error {
  background: var(--error);
  color: #fff;
  padding: 0.6rem;
  border-radius: 4px;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}
.error-box {
  background: var(--error);
  color: #fff;
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}
.success {
  background: var(--success);
  color: #fff;
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}
.success a {
  color: #fff;
  font-weight: bold;
  text-decoration: underline;
}
.download-btn {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  background: #fff;
  color: var(--success);
  border: 2px solid var(--success);
  border-radius: 4px;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.05rem;
  margin: 0.5rem 0;
}
.warn {
  background: var(--warn);
  color: #fff;
  padding: 0.6rem;
  border-radius: 4px;
  font-size: 0.875rem;
  margin-top: 0.5rem;
}
.info {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 0.6rem;
  border-radius: 4px;
  font-size: 0.875rem;
  color: var(--muted);
}

.status-meta {
  font-size: 0.8rem;
  margin-bottom: 1rem;
}
.status-meta dt {
  color: var(--muted);
  font-weight: normal;
  margin-top: 0.5rem;
}
.status-meta dd {
  margin: 0 0 0 0;
  padding: 0;
}
.status-succeeded { color: var(--success); font-weight: bold; }
.status-failed { color: var(--error); font-weight: bold; }
.status-running, .status-pending { color: var(--warn); font-weight: bold; }

.log {
  margin-top: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 0.5rem;
}
.log summary {
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--muted);
}
.log pre {
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.7rem;
  overflow-x: auto;
  max-height: 300px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--muted);
}

code {
  background: var(--bg);
  padding: 0.1rem 0.3rem;
  border-radius: 2px;
  font-size: 0.85em;
  color: var(--muted);
}

.tabs {
  display: flex;
  gap: 0.25rem;
  margin: 0.75rem 0 0;
  border-bottom: 1px solid var(--border);
}
.tab {
  background: transparent;
  border: 1px solid var(--border);
  border-bottom: none;
  color: var(--muted);
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  cursor: pointer;
  border-radius: 4px 4px 0 0;
}
.tab.active {
  background: var(--card);
  color: var(--fg);
  border-color: var(--border);
  border-bottom: 1px solid var(--card);
  position: relative;
  top: 1px;
}
.tab-panel { padding-top: 0.5rem; }
.hidden { display: none; }

.hint {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0.25rem 0 0;
}

/* share box on status page */
.share-box {
  margin-top: 0.75rem;
  padding: 0.75rem;
  border: 1px dashed var(--border);
  border-radius: 4px;
}
.share-box code.share-url {
  display: block;
  word-break: break-all;
  font-size: 0.8rem;
  color: var(--accent);
}
.inline-form { display: inline; }
