:root {
  color-scheme: light;
  --bg: #f3efe8;
  --panel: rgba(255, 255, 255, 0.82);
  --text: #1f2937;
  --muted: #6b7280;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --border: rgba(15, 23, 42, 0.12);
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; font-family: Georgia, "Times New Roman", serif; color: var(--text); background: radial-gradient(circle at top left, rgba(15, 118, 110, 0.16), transparent 30%), radial-gradient(circle at right 20%, rgba(17, 94, 89, 0.10), transparent 24%), linear-gradient(180deg, #fbf8f3 0%, var(--bg) 100%); }
.shell { width: min(920px, calc(100% - 2rem)); margin: 0 auto; padding: 3rem 0 4rem; }
.shell-narrow { width: min(560px, calc(100% - 2rem)); }
.app-frame {
  width: min(920px, calc(100vw - 24px));
  margin: 12px auto;
  border: 1px solid var(--border);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: rgba(255, 255, 255, 0.04);
}

.header-shell {
  width: 100%;
}
.hero { margin-bottom: 1.5rem; }
.hero-bar { display: flex; justify-content: space-between; align-items: start; gap: 1rem; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.75rem; }
.eyebrow { margin: 0 0 0.75rem; text-transform: uppercase; letter-spacing: 0.18em; font: 700 0.78rem/1.2 system-ui, sans-serif; color: var(--accent-strong); }
h1 { margin: 0; font-size: clamp(2.2rem, 5vw, 4rem); line-height: 1; }
.lede { max-width: 60ch; margin: 1rem 0 0; color: var(--muted); font-size: 1.05rem; line-height: 1.7; }
.card { padding: 1.5rem; border: 1px solid var(--border); border-radius: 24px; background: var(--panel); box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.card-spaced { margin-top: 1.5rem; }
.upload-form, .admin-form { display: grid; gap: 1rem; }
.admin-form-inline { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid rgba(15, 23, 42, 0.10); }
.button-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.auth-cta-grid { display: flex; flex-wrap: wrap; gap: 0.85rem; align-items: center; margin: 1.25rem 0; }
.auth-cta-grid-inline { margin-top: 0; }
.auth-cta { min-width: 220px; }
.auth-cta-secondary { background: linear-gradient(135deg, #475569, #334155); box-shadow: 0 12px 24px rgba(51, 65, 85, 0.22); }
.home-login-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr); gap: 1.25rem; align-items: start; }
.field { display: grid; gap: 0.45rem; }
.field span { font: 600 0.95rem/1.2 system-ui, sans-serif; }
input[type="email"], input[type="password"], select { width: 100%; padding: 0.92rem 1rem; border-radius: 14px; border: 1px solid rgba(15, 23, 42, 0.14); background: rgba(255, 255, 255, 0.9); color: var(--text); font: inherit; }
input:focus { outline: 2px solid rgba(15, 118, 110, 0.22); outline-offset: 2px; }
button, .button-link { display: inline-flex; align-items: center; justify-content: center; width: fit-content; padding: 0.95rem 1.25rem; border: 0; border-radius: 999px; background: linear-gradient(135deg, var(--accent), var(--accent-strong)); color: white; font: 700 0.95rem/1 system-ui, sans-serif; text-decoration: none; cursor: pointer; box-shadow: 0 12px 24px rgba(15, 118, 110, 0.24); }
button:hover, .button-link:hover, .logout-link:hover { filter: brightness(1.04); }
button.button-danger {
  background: linear-gradient(135deg, #b91c1c, #7f1d1d);
  box-shadow: 0 12px 24px rgba(127, 29, 29, 0.22);
}
button.button-danger:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
}
.notes { margin-top: 1rem; color: var(--muted); font-size: 0.95rem; line-height: 1.7; }
.messages { display: grid; gap: 0.75rem; margin-bottom: 1rem; }
.message { padding: 0.9rem 1rem; border-radius: 14px; font-family: system-ui, sans-serif; }
.message-error { color: #7f1d1d; background: #fee2e2; border: 1px solid #fecaca; }
.message-message { color: #14532d; background: #dcfce7; border: 1px solid #bbf7d0; }
.portal-warning {
  margin-bottom: 1rem;
  padding: 0.95rem 1rem;
  border-radius: 14px;
  border: 1px solid #f59e0b;
  background: #fffbeb;
  color: #92400e;
  font: 600 0.95rem/1.6 system-ui, sans-serif;
}
.app-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.75rem; }
.portal-launch-card {
  width: 100%;
  margin: 0;
  padding: 1.25rem;
  border-left: 0;
  border-right: 0;
  border-radius: 0;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.68);
}

.app-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.18), rgba(255, 255, 255, 0.82) 42%, rgba(17, 94, 89, 0.10)),
    rgba(255, 255, 255, 0.76);
  color: inherit;
  text-decoration: none;
  text-align: center;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
}
.app-card h3 { margin: 0; font-size: 1rem; line-height: 1.1; }
.app-card:hover,
.app-card:focus-visible {
  background:
    linear-gradient(135deg, rgba(20, 184, 166, 0.22), rgba(255, 255, 255, 0.96) 44%, rgba(15, 118, 110, 0.14)),
    rgba(255, 255, 255, 0.94);
  border-color: rgba(15, 118, 110, 0.26);
  outline: none;
  transform: translateY(-1px);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.75rem; }
.checkbox-row { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--text); font: 600 0.95rem/1.3 system-ui, sans-serif; }
.checkbox-row input { width: 1rem; height: 1rem; margin: 0; }
.admin-list { display: grid; gap: 1rem; }
.admin-user { padding: 1rem; border-radius: 20px; background: rgba(255, 255, 255, 0.72); border: 1px solid rgba(15, 23, 42, 0.08); }
.admin-user-head { display: flex; justify-content: space-between; align-items: start; gap: 1rem; }
.admin-user h3 { margin: 0; font-size: 1.1rem; }
.provider-badge {
  display: inline-flex;
  align-items: center;
  margin-right: 0.55rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.14);
  color: var(--accent-strong);
  font: 700 0.72rem/1 system-ui, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.logout-link { display: inline-flex; align-items: center; padding: 0.7rem 1rem; border-radius: 999px; border: 1px solid rgba(15, 23, 42, 0.14); background: rgba(255, 255, 255, 0.72); color: var(--accent-strong); text-decoration: none; font: 600 0.92rem/1 system-ui, sans-serif; }
.status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin: 0; }
.status-grid div { padding: 1rem; border-radius: 18px; background: rgba(255, 255, 255, 0.7); border: 1px solid rgba(15, 23, 42, 0.08); }
dt { margin: 0 0 0.35rem; color: var(--muted); font: 600 0.82rem/1.2 system-ui, sans-serif; text-transform: uppercase; letter-spacing: 0.08em; }
dd { margin: 0; font: 700 1rem/1.5 system-ui, sans-serif; word-break: break-word; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.back-link { margin-top: 1rem; }
.back-link a { color: var(--accent-strong); text-decoration: none; font: 600 0.95rem/1 system-ui, sans-serif; }
.back-link a:hover { text-decoration: underline; }
.download-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.progress-wrap { margin: 1.25rem 0; display: grid; gap: 0.55rem; }
.progress-meta { display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font: 600 0.9rem/1.2 system-ui, sans-serif; }
.progress-track { width: 100%; height: 14px; overflow: hidden; border-radius: 999px; background: rgba(15, 23, 42, 0.10); border: 1px solid rgba(15, 23, 42, 0.10); }
.progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(135deg, #0f766e, #14b8a6); transition: width 0.35s ease; }
