:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-subtle: #e8e8ed;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
  --separator: rgba(0, 0, 0, 0.08);
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --blue-pressed: #006edb;
  --focus: rgba(0, 113, 227, 0.35);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-float: 0 4px 24px rgba(0, 0, 0, 0.08);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --warn-bg: #fff9e6;
  --warn-border: rgba(255, 179, 0, 0.45);
  --error-bg: #fff5f5;
  --error-border: rgba(255, 59, 48, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47059;
  font-weight: 400;
  letter-spacing: -0.022em;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.page-bg {
  min-height: 100vh;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 980px;
  margin: 0 auto;
  padding: 1rem 1.5rem 0.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text);
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(180deg, #42b4ff 0%, var(--blue) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.nav {
  display: flex;
  gap: 1.5rem;
}

.nav a {
  color: var(--blue);
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
}

.nav a:hover {
  text-decoration: underline;
}

main {
  max-width: 692px;
  margin: 0 auto;
  padding: 0 1.25rem 3.5rem;
}

.hero {
  text-align: center;
  padding: 2rem 0 2.25rem;
}

.hero-eyebrow {
  margin: 0 0 0.35rem;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.08349;
  color: var(--text);
}

.lede {
  margin: 0 auto;
  max-width: 36em;
  font-size: 19px;
  line-height: 1.4211;
  font-weight: 400;
  letter-spacing: 0.012em;
  color: var(--text-secondary);
}

.panel {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.5rem 1.75rem;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--separator);
}

.panel-intro {
  margin: 0 0 1.25rem;
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
}

.segmented {
  display: flex;
  padding: 3px;
  margin-bottom: 1.5rem;
  background: var(--surface-subtle);
  border-radius: 10px;
  gap: 2px;
}

.tab {
  flex: 1;
  padding: 0.65rem 0.75rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.tab:hover {
  color: var(--text);
}

.tab.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.mode-form.hidden {
  display: none;
}

.dropzone {
  border: 2px dashed rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-md);
  padding: 2.25rem 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: 1.5rem;
  background: rgba(0, 113, 227, 0.02);
}

.dropzone:hover,
.dropzone:focus-visible {
  border-color: rgba(0, 113, 227, 0.45);
  background: rgba(0, 113, 227, 0.05);
  outline: none;
}

.dropzone.is-dragover {
  border-color: var(--blue);
  background: rgba(0, 113, 227, 0.08);
}

.drop-icon {
  display: block;
  margin: 0 auto 0.65rem;
  width: 36px;
  height: 36px;
  opacity: 0.45;
}

.drop-title {
  margin: 0 0 0.35rem;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.drop-hint {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.controls {
  margin-bottom: 1.25rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.25rem;
}

@media (max-width: 540px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field span {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.field select,
.field input[type="number"],
.field input[type="text"] {
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--separator);
  background-color: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.field select {
  appearance: none;
  padding-right: 2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236e6e73' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}

.field input[type="number"],
.field input[type="text"] {
  background-image: none;
}

.field select:focus,
.field input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--focus);
}

.field-inline {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 2rem;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.field-inline input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--blue);
  flex-shrink: 0;
  align-self: center;
}

.checkbox.hidden {
  display: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.85rem 1.25rem;
  border: none;
  border-radius: 980px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease, opacity 0.15s ease;
}

.btn.primary {
  background: var(--blue);
  color: #fff;
}

.btn.primary:hover:not(:disabled) {
  background: var(--blue-hover);
}

.btn.primary:active:not(:disabled) {
  background: var(--blue-pressed);
  transform: scale(0.99);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.deploy-limit-banner {
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--warn-border);
  background: var(--warn-bg);
}

.deploy-limit-banner.hidden {
  display: none;
}

.deploy-limit-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.deploy-limit-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.file-queue-panel {
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--separator);
  background: rgba(0, 113, 227, 0.04);
}

.file-queue-panel.hidden {
  display: none;
}

.file-queue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.file-queue-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.file-queue-badge {
  font-size: 12px;
  color: var(--text-secondary);
}

.file-queue-list {
  margin: 0;
  padding: 0 0 0 1.15rem;
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}

.file-queue-hint {
  margin: 0.5rem 0 0;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.status-panel {
  margin-bottom: 1.25rem;
  padding: 1.1rem 1.15rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--separator);
  background: var(--surface-subtle);
}

.status-panel.hidden {
  display: none;
}

.status-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.55rem;
}

.status-phase {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.status-pct {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--blue);
}

.status-panel.is-processing .status-pct {
  color: var(--text-secondary);
}

.status-bar-track {
  height: 6px;
  border-radius: 100px;
  background: rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.status-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 100px;
  background: var(--blue);
  transition: width 0.12s ease-out;
}

.status-panel.is-processing .status-bar-fill {
  width: 100%;
  background: linear-gradient(
    90deg,
    rgba(0, 113, 227, 0.25),
    var(--blue),
    rgba(0, 113, 227, 0.25)
  );
  background-size: 200% 100%;
  animation: status-indeterminate 1.3s linear infinite;
}

@keyframes status-indeterminate {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.status-detail {
  margin: 0.55rem 0 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.results {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--separator);
}

.results.hidden {
  display: none;
}

.results-title {
  margin: 0 0 0.35rem;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

.results-sub {
  margin: 0 0 1rem;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.results-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.results-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--separator);
  border-radius: var(--radius-sm);
  color: var(--blue);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.results-list a:hover {
  border-color: rgba(0, 113, 227, 0.35);
  box-shadow: var(--shadow-card);
}

.results-list a span {
  color: var(--text-tertiary);
  font-size: 13px;
  font-weight: 400;
}

.error-panel {
  margin-top: 1.25rem;
  padding: 1.1rem 1.15rem;
  border-radius: var(--radius-md);
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  font-size: 15px;
}

.error-panel.hidden {
  display: none;
}

.error-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
}

.error-code {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #ff3b30;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  background: rgba(255, 59, 48, 0.12);
}

.error-code:empty {
  display: none;
}

.error-title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.error-message {
  margin: 0 0 0.5rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.error-details {
  margin: 0;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--separator);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 11rem;
  overflow: auto;
}

.error-details.hidden {
  display: none;
}

.help {
  margin-top: 3rem;
  padding-bottom: 2rem;
}

.help h2 {
  margin: 0 0 0.35rem;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
  text-align: center;
}

.help-sub {
  margin: 0 auto 1.75rem;
  max-width: 28em;
  text-align: center;
  font-size: 16px;
  color: var(--text-secondary);
}

.help-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  max-width: 40rem;
  margin-left: auto;
  margin-right: auto;
}

.help article {
  background: var(--surface);
  border: 1px solid var(--separator);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.2rem;
  box-shadow: var(--shadow-card);
}

.help h3 {
  margin: 0 0 0.5rem;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.help p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.help code {
  font-family: var(--mono);
  font-size: 12px;
  padding: 0.15em 0.4em;
  border-radius: 4px;
  background: var(--surface-subtle);
  color: var(--text);
}

.site-footer {
  max-width: 980px;
  margin: 0 auto;
  padding: 2rem 1.5rem 2.5rem;
  text-align: center;
  font-size: 12px;
  color: var(--text-tertiary);
}
