:root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: #f5f7fb;
}

body { margin: 0; }
a { color: #2557a7; text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px;
  background: white;
  border-bottom: 1px solid #e6e8ef;
}
.topbar h1 { margin: 0; font-size: 26px; }
.brand-title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.version-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: #eef3ff;
  color: #2557a7;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.topbar p { margin: 6px 0 0; color: #687085; }
.userbox { text-align: right; color: #687085; font-size: 14px; }
.container { max-width: 1100px; margin: 0 auto; padding: 32px; }
.intro h2 { margin-bottom: 4px; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.card, .detail {
  background: white;
  border: 1px solid #e6e8ef;
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 10px 30px rgba(20, 31, 55, 0.06);
}
.card-header { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.card h3 { margin: 0; }
.badge {
  background: #eef3ff;
  color: #2557a7;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  text-transform: uppercase;
}
.badge.success { background: #e8f8ee; color: #166534; }
.badge.danger { background: #fef2f2; color: #991b1b; }
.badge.neutral { background: #f1f3f8; color: #687085; }
dl { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; }
dt { color: #687085; }
dd { margin: 0; font-weight: 600; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.button {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 12px;
  background: #2557a7;
  color: white;
  font-weight: 700;
  border: 0;
  cursor: pointer;
}
.button.secondary { background: #172033; }
.button:hover { text-decoration: none; filter: brightness(0.96); }
.warning { border-color: #ffd5d5; }
code { background: #f1f3f8; padding: 2px 6px; border-radius: 6px; }
pre { overflow-x: auto; background: #f1f3f8; padding: 12px; border-radius: 12px; }

.platforms { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #f1f3f8;
  color: #172033;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}
.chip:hover { text-decoration: none; filter: brightness(0.97); }
.email-chip { background: #eef3ff; color: #2557a7; text-transform: none; }
.active-chip { background: #e8f8ee; color: #166534; }
.inactive-chip { background: #f1f3f8; color: #8a93a6; }
.neutral-chip { background: #f1f3f8; color: #687085; }
.downloads-table { display: grid; gap: 10px; margin: 14px 0 22px; }
.download-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid #e6e8ef;
  border-radius: 14px;
  background: #fbfcff;
}
.download-row span { color: #687085; font-size: 13px; }
.format { color: #687085; font-size: 13px; font-weight: 700; }
.download-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.diagnostic-link { font-size: 13px; color: #687085; font-weight: 700; }

.login-panel {
  min-height: 58vh;
  display: grid;
  place-items: center;
}
.login-card {
  width: min(620px, 100%);
  background: white;
  border: 1px solid #e6e8ef;
  border-radius: 22px;
  padding: 30px;
  box-shadow: 0 14px 34px rgba(20, 31, 55, 0.08);
  text-align: center;
}
.login-icon {
  width: 52px;
  height: 52px;
  display: inline-grid;
  place-items: center;
  border-radius: 16px;
  background: #eef3ff;
  color: #2557a7;
  font-weight: 900;
  margin-bottom: 10px;
}
.login-actions { display: grid; gap: 12px; margin: 22px 0; }
.button.google { background: #2557a7; }
.notice {
  text-align: left;
  background: #fff8e6;
  border: 1px solid #ffe3a3;
  border-radius: 14px;
  padding: 14px;
  color: #5b4100;
  margin-bottom: 16px;
}
.hint { color: #687085; font-size: 14px; margin: 0; }
.setup-box {
  text-align: left;
  background: #f5f7fb;
  border: 1px solid #e6e8ef;
  border-radius: 16px;
  padding: 14px;
  margin-top: 18px;
}
.setup-box h3 { margin: 0 0 8px; font-size: 16px; }
.setup-box p { margin: 0 0 8px; color: #687085; }
.userbox { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.avatar { width: 38px; height: 38px; border-radius: 999px; border: 1px solid #e6e8ef; }
.role-label { color: #687085; font-size: 12px; font-weight: 800; text-transform: uppercase; }

.notice.error {
  border-color: #ef4444;
  background: #fef2f2;
  color: #991b1b;
}

.nav-links { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.nav-links a { font-size: 14px; font-weight: 700; color: #2557a7; }
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}
.status-card h3 { margin-top: 0; }
.status-list { display: grid; gap: 10px; }
.status-row, .file-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e6e8ef;
  border-radius: 14px;
  background: #fbfcff;
}
.status-row.ok strong { color: #166534; }
.status-row.warn strong { color: #92400e; }
.files-table { display: grid; gap: 10px; }
.file-row span { color: #687085; font-size: 13px; }

.admin-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  align-items: end;
}
.admin-form.vertical { display: block; }
.admin-form label { font-weight: 700; color: #687085; font-size: 13px; }
.admin-form input, .admin-form select {
  width: 100%;
  box-sizing: border-box;
  margin-top: 5px;
  padding: 10px 12px;
  border: 1px solid #d9deea;
  border-radius: 12px;
  font: inherit;
  background: white;
}
.admin-form .chip-toggle input { width: auto; margin: 0; }
.checkline { display: flex; align-items: center; gap: 8px; }
.checkline input { width: auto; }
.admin-list { display: grid; gap: 12px; }
.admin-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 150px 120px auto;
  gap: 12px;
  align-items: end;
  padding: 12px;
  border: 1px solid #e6e8ef;
  border-radius: 14px;
  background: #fbfcff;
}
.admin-row.compact { grid-template-columns: 1fr auto; align-items: center; }
.admin-row input, .admin-row select {
  width: 100%;
  box-sizing: border-box;
  margin-top: 5px;
  padding: 9px 10px;
  border: 1px solid #d9deea;
  border-radius: 10px;
  font: inherit;
}
.user-admin-row { grid-template-columns: 1.8fr 1fr 150px 110px auto; }
.user-chip-block { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 7px 10px;
  border-radius: 999px;
  background: #f1f3f8;
  color: #8a93a6;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.chip-toggle input { accent-color: #166534; }
.chip-toggle:has(input:checked) { background: #e8f8ee; color: #166534; }
.visibility-toggle { margin: 0 10px 10px 0; }
.permission-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid #e6e8ef;
  border-radius: 14px;
  background: #fbfcff;
}
.chip-permission-row { flex-wrap: wrap; }
.chip-permission-row input { width: auto; }
.permission-row small { color: #687085; }

@media (max-width: 820px) {
  .admin-row, .user-admin-row { grid-template-columns: 1fr; align-items: stretch; }
}

@media (max-width: 680px) {
  .topbar { align-items: flex-start; flex-direction: column; gap: 14px; }
  .userbox { text-align: left; justify-content: flex-start; }
  .download-row { grid-template-columns: 1fr; }
  .status-row, .file-row { align-items: flex-start; flex-direction: column; }
}
