:root {
  --navy: #0b1f3a;
  --teal: #127a8a;
  --gold: #c88b1b;
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #1b2233;
  --muted: #6b7280;
  --border: #e3e6ee;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

header {
  background: linear-gradient(135deg, var(--navy), var(--teal));
  color: white;
  padding: 28px 32px;
}
header h1 { margin: 0; font-size: 24px; }
header .tag { margin: 6px 0 0; opacity: 0.85; max-width: 720px; }

main {
  max-width: 920px;
  margin: 24px auto;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  box-shadow: 0 1px 2px rgba(11, 31, 58, 0.04);
}
.card h2 {
  margin: 0 0 10px;
  font-size: 16px;
  color: var(--navy);
  letter-spacing: 0.01em;
}

label {
  display: block;
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

input[type="text"], input[type="number"], select, textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  margin-top: 4px;
  background: white;
}
textarea { resize: vertical; }

.grid.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.row {
  display: flex;
  gap: 8px;
  align-items: end;
}
.row label { flex: 0 0 100%; margin-bottom: 0; }
.row input { flex: 1; }
.row button { flex: 0 0 auto; }

button, .button {
  background: white;
  color: var(--navy);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button.primary, .primary.button {
  background: var(--teal);
  color: white;
  border-color: var(--teal);
  font-weight: 600;
}
button.primary:hover, .primary.button:hover { background: #0f6776; }
button:disabled { opacity: 0.55; cursor: not-allowed; }

.actions { display: flex; align-items: center; gap: 16px; }
.status { color: var(--muted); font-size: 13px; }
.hint { color: var(--muted); font-size: 12px; margin: 6px 0 0; }
code { background: #f0f2f7; padding: 0 4px; border-radius: 3px; font-size: 12px; }

.bar {
  height: 8px;
  background: #eef0f7;
  border-radius: 4px;
  overflow: hidden;
  margin: 8px 0;
}
#bar-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  transition: width 0.4s ease;
}

.scripts {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.script-item {
  background: #fafbff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 13px;
}
.script-item .num { color: var(--teal); font-weight: 700; margin-right: 6px; }

.browser {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  max-height: 280px;
  overflow: auto;
  background: #fafbff;
}
.browser .dir-row {
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
  background: #eef1f8;
  font-size: 12px;
  color: var(--muted);
  display: flex; justify-content: space-between; gap: 8px;
}
.browser .entry {
  padding: 7px 12px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #f0f2f7;
}
.browser .entry:hover { background: #eef5f8; }
.browser .entry.dir { color: var(--navy); font-weight: 600; }

.hidden { display: none; }

#download-row {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

footer {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 16px;
}
