:root {
  --bg0: #e8eef2;
  --bg1: #f7fafb;
  --ink: #14212b;
  --muted: #5b6b78;
  --line: rgba(20, 33, 43, 0.12);
  --accent: #0f7a6c;
  --accent-2: #d97706;
  --danger: #b42318;
  --panel: rgba(255, 255, 255, 0.78);
  --shadow: 0 18px 50px rgba(20, 33, 43, 0.08);
  --radius: 18px;
  --font: "Sora", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg0);
  line-height: 1.45;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(15, 122, 108, 0.18), transparent 60%),
    radial-gradient(700px 400px at 90% 0%, rgba(217, 119, 6, 0.16), transparent 55%),
    linear-gradient(160deg, #dfe8ee, #f4f7f8 45%, #e7eef3);
}

a { color: inherit; }
code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: rgba(20, 33, 43, 0.06);
  padding: 0.1em 0.35em;
  border-radius: 6px;
}

.top, .layout, .gate {
  width: min(1100px, calc(100% - 2rem));
  margin-inline: auto;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  padding: 2rem 0 1.25rem;
}

.brand {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.04em;
}

.tagline, .muted, .hint, .eyebrow {
  color: var(--muted);
}

.tagline { margin: 0.35rem 0 0; max-width: 36rem; }
.eyebrow {
  margin: 0 0 0.5rem;
  font-family: var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.layout {
  display: grid;
  gap: 1rem;
  padding-bottom: 3rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  padding: 1.15rem 1.25rem 1.3rem;
  animation: rise 0.45s ease both;
}

.panel:nth-child(2) { animation-delay: 0.05s; }
.panel:nth-child(3) { animation-delay: 0.1s; }
.panel:nth-child(4) { animation-delay: 0.15s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

h2 { margin: 0 0 0.9rem; font-size: 1.15rem; }
h3 { margin: 0; font-size: 1rem; }

.account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.account {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem;
  background: rgba(255,255,255,0.55);
}

.account-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.account-meta { margin: 0.45rem 0 0.8rem; min-height: 1.3em; font-size: 0.92rem; }

.pill {
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
}
.pill[data-state="on"] {
  color: #065f52;
  background: rgba(15, 122, 108, 0.12);
  border-color: rgba(15, 122, 108, 0.25);
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.btn, .ghost, button, input, textarea {
  font: inherit;
}

.btn, .ghost {
  appearance: none;
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn:hover { transform: translateY(-1px); background: #0c655a; }

.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.ghost:hover { background: rgba(20,33,43,0.04); }
.ghost.danger { color: var(--danger); }

.hint { margin: 0.75rem 0 0; font-size: 0.85rem; }

.browser-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}
.browser-head h2 { margin: 0; }

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.85rem 0 0.7rem;
  font-family: var(--mono);
  font-size: 0.8rem;
}
.crumbs button {
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
}
.crumbs span { color: var(--muted); }

.files {
  display: grid;
  gap: 0.35rem;
  max-height: 420px;
  overflow: auto;
  padding-right: 0.25rem;
}

.file-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(255,255,255,0.45);
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.file-row:hover, .file-row.active {
  border-color: rgba(15, 122, 108, 0.35);
  background: #fff;
}
.file-name { font-weight: 500; word-break: break-all; }
.file-meta {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

label {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.8rem;
  font-size: 0.92rem;
}
input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  background: #fff;
}
input:focus, textarea:focus {
  outline: 2px solid rgba(15, 122, 108, 0.25);
  border-color: rgba(15, 122, 108, 0.45);
}

.jobs-list { display: grid; gap: 0.55rem; }
.job {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.8rem 0.9rem;
  background: rgba(255,255,255,0.55);
}
.job-top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
}
.job-title { margin: 0; font-weight: 600; word-break: break-word; }
.job-status {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}
.bar {
  margin-top: 0.55rem;
  height: 8px;
  border-radius: 999px;
  background: rgba(20,33,43,0.08);
  overflow: hidden;
}
.bar > span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.35s ease;
}
.job-error { margin: 0.45rem 0 0; color: var(--danger); font-size: 0.88rem; }
.job-link {
  display: inline-block;
  margin-top: 0.4rem;
  color: var(--accent);
  font-size: 0.9rem;
}

.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
}
.gate-box {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  display: grid;
  gap: 0.75rem;
}
.gate-box h1 { margin: 0; }

dialog {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.2rem;
  width: min(480px, calc(100% - 2rem));
  background: #fff;
}
dialog::backdrop { background: rgba(20, 33, 43, 0.35); }

@media (max-width: 800px) {
  .account-grid { grid-template-columns: 1fr; }
  .file-row { grid-template-columns: 1fr; gap: 0.25rem; }
  .top { align-items: start; flex-direction: column; }
}
