:root {
  color-scheme: light;
  --bg: #f0f2f5;
  --panel: #ffffff;
  --inset: #f4f4f7;
  --text: #000000;
  --muted: #707579;
  --line: #dfe1e5;
  --blue: #24a1de;
  --green: #16a34a;
  --gold: #d9a441;
  --danger: #ff595a;
  --success: #34c759;
}

* {
  box-sizing: border-box;
}

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

.app {
  position: relative;
  width: min(100%, 672px);
  margin: 0 auto;
  min-height: 100vh;
  box-shadow: 0 25px 50px rgba(15, 23, 42, 0.16);
}

.app.login-mode {
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}

.app.login-mode .topbar,
.app.login-mode .bottom-nav {
  display: none;
}

.app.login-mode main {
  width: 100%;
  max-width: 390px;
  padding: 16px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.8);
  border-bottom: 1px solid #f1f5f9;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(20px);
}

.brand-row,
.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon,
.login-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  background: linear-gradient(135deg, var(--blue), #38bdf8);
  box-shadow: 0 8px 18px rgba(36, 161, 222, 0.22);
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 12px;
}

.login-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  border-radius: 16px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 16px;
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  font-size: 15px;
}

p,
label {
  color: var(--muted);
  font-size: 12px;
}

main {
  display: grid;
  gap: 12px;
  padding: 16px 16px 132px;
}

.panel,
.screen-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.section-head,
.login-row {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

input,
textarea,
button {
  border-radius: 10px;
  border: 1px solid transparent;
  font: inherit;
}

input,
textarea {
  width: 100%;
  background: var(--inset);
  padding: 0 10px;
}

input,
button {
  height: 38px;
}

textarea {
  min-height: 86px;
  padding: 10px 14px;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--blue);
  background: #fff;
  outline: none;
}

button {
  padding: 0 12px;
  background: var(--blue);
  color: white;
  border-color: var(--blue);
  font-weight: 700;
}

button:disabled {
  opacity: 0.45;
}

.pill {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.pill::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 999px;
  background: var(--success);
}

.ghost-button {
  height: 28px;
  padding: 0 8px;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.card h3 {
  margin: 0 0 6px;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.card p {
  line-height: 1.45;
}

.formats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.formats button {
  height: 34px;
  background: #111827;
  border-color: #111827;
  font-size: 12px;
}

.formats button.busy {
  position: relative;
  padding-left: 32px;
}

.formats button.busy::before {
  position: absolute;
  left: 12px;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 999px;
  content: "";
  animation: spin 0.8s linear infinite;
}

.formats button.gold {
  background: var(--gold);
  border-color: var(--gold);
}

.formats button.green {
  background: var(--green);
  border-color: var(--green);
}

.formats button.bundle {
  background: var(--blue);
  border-color: var(--blue);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.job-card {
  cursor: pointer;
}

.job-card:active {
  transform: translateY(1px);
}

pre {
  min-height: 180px;
  margin: 12px 0 0;
  padding: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  background: #111827;
  color: #f9fafb;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
}

.login-icon + h2,
.login-icon + h2 + p {
  text-align: center;
}

.login-icon + h2 + p {
  margin: 8px 0 18px;
}

.login-mode .panel {
  padding: 24px;
  border-radius: 16px;
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  display: flex;
  width: min(100%, 672px);
  margin: 0 auto;
  justify-content: space-around;
  padding: 8px 16px 24px;
  border-top: 0.5px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
}

.nav-item {
  display: flex;
  width: 25%;
  height: auto;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: none;
  background: none;
  color: #8e8e93;
}

.nav-item.active {
  color: var(--blue);
}

.nav-label {
  font-size: 10px;
  font-weight: 500;
}

.compact .card {
  padding: 10px;
}

.hidden {
  display: none;
}
