:root {
  color-scheme: light dark;
  --bg: #0f1419;
  --surface: #1a2332;
  --border: #2d3a4f;
  --text: #e8eef7;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-dim: #0ea5e9;
  --danger: #f87171;
  --ok: #4ade80;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f6fb;
    --surface: #ffffff;
    --border: #dbe3f0;
    --text: #0f172a;
    --muted: #475569;
    --accent: #0284c7;
    --accent-dim: #0369a1;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(1200px 600px at 10% -10%, rgba(56, 189, 248, 0.12), transparent),
    var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem clamp(1rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--surface) 85%, transparent);
  backdrop-filter: blur(8px);
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.brand {
  display: flex;
  gap: 0.85rem;
  align-items: center;
}

.logo {
  font-size: 2rem;
  line-height: 1;
}

h1 {
  margin: 0;
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-weight: 650;
}

.muted {
  color: var(--muted);
}

.brand p {
  margin: 0.15rem 0 0;
  font-size: 0.95rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 1.25rem;
  padding: 1.25rem clamp(1rem, 4vw, 2.5rem) 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem 1.35rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.hint {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.upload {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.file-drop {
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.file-drop:hover,
.file-drop:focus-within {
  border-color: var(--accent);
  background: color-mix(in oklab, var(--accent) 6%, transparent);
}

.file-drop input {
  display: none;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 0.65rem 1rem;
  font-weight: 600;
  cursor: pointer;
  font-size: 1rem;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  color: #04121f;
}

.btn.ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.msg {
  min-height: 1.25rem;
  font-size: 0.92rem;
}

.msg.error {
  color: var(--danger);
}

.msg.ok {
  color: var(--ok);
}

.status {
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.88rem;
  white-space: pre-wrap;
  padding: 0.75rem;
  border-radius: 8px;
  background: color-mix(in oklab, var(--border) 35%, transparent);
  border: 1px solid var(--border);
}

.status.loading {
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pill.ok {
  background: color-mix(in oklab, var(--ok) 22%, transparent);
  color: var(--ok);
}

.pill.bad {
  background: color-mix(in oklab, var(--danger) 22%, transparent);
  color: var(--danger);
}

.jobs {
  margin-top: 0.85rem;
}

.job-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  justify-content: space-between;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.job-row:last-child {
  border-bottom: none;
}

.job-row code {
  font-size: 0.82rem;
}

.small-title {
  margin: 1rem 0 0.35rem;
  font-size: 0.95rem;
}

.tips {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.nettips {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.85rem;
}

.login-wrap {
  max-width: 400px;
  margin: 3rem auto;
  padding: 0 1rem;
}

.login-wrap label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}

.login-wrap input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  margin-bottom: 1rem;
  font-size: 1rem;
}
