:root {
  --navy: #0b2545;
  --blue: #1a5fb4;
  --green: #1a7a4c;
  --amber: #b58900;
  --gray: #5c6773;
  --border: #d8dee6;
  --bg: #f4f6f9;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: #1c2733;
}

.hero-banner {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.hero-banner img.org-logo-large {
  height: 60px;
  width: auto;
}

.hero-banner h1 {
  margin: 0;
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.01em;
}

.hero-banner .hero-sharepoint-link {
  margin-left: auto;
  text-decoration: none;
}

@media (max-width: 480px) {
  .hero-banner img.org-logo-large { height: 42px; }
  .hero-banner h1 { font-size: 1.3rem; }
}

.topbar {
  background: var(--navy);
  color: #fff;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar .brand {
  font-weight: 600;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar .brand img.org-logo {
  height: 24px;
  width: auto;
  background: #fff;
  padding: 3px 6px;
  border-radius: 4px;
}

.login-card img.org-logo {
  height: 32px;
  width: auto;
  margin-bottom: 18px;
}

.topbar .user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
}

.topbar button {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}

.topbar button:hover { background: rgba(255,255,255,0.12); }

.topbar-link {
  color: #fff;
  text-decoration: none;
  font-size: 0.85rem;
  opacity: 0.85;
}

.topbar-link:hover { opacity: 1; text-decoration: underline; }

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 32px 24px;
}

.dev-banner {
  background: #fff3cd;
  color: #6b5300;
  border-bottom: 1px solid #f0d78c;
  padding: 8px 24px;
  font-size: 0.85rem;
  text-align: center;
}

.login-card {
  max-width: 380px;
  margin: 6vh auto 4vh;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 36px 32px;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}

.login-card h1, .login-card h2 {
  font-size: 1.3rem;
  margin-bottom: 4px;
  color: var(--navy);
}

.login-card p.sub {
  color: var(--gray);
  font-size: 0.9rem;
  margin-bottom: 28px;
}

.ms-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: #2f2f2f;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 11px 16px;
  font-size: 0.95rem;
  cursor: pointer;
}

.ms-btn:hover { background: #1f1f1f; }

.ms-btn svg { flex-shrink: 0; }

.dev-btn {
  margin-top: 14px;
  width: 100%;
  background: #fff;
  border: 1px dashed var(--amber);
  color: #6b5300;
  border-radius: 6px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 0.85rem;
}

.blocks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.block-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: box-shadow 0.15s;
}

.block-card.active:hover {
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  border-color: var(--blue);
}

.block-card.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.block-card .num {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray);
  letter-spacing: 0.04em;
}

.block-card h3 {
  margin: 6px 0 8px;
  font-size: 1.05rem;
}

.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
}

.badge.active { background: #e6f4ea; color: var(--green); }
.badge.construction { background: #fdf0e0; color: var(--amber); }

h2.section-title {
  color: var(--navy);
  font-size: 1.1rem;
  margin: 28px 0 12px;
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 22px;
  margin-bottom: 16px;
}

label { font-weight: 500; font-size: 0.9rem; }

input[type="text"], textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.9rem;
  font-family: inherit;
  margin-top: 6px;
}

textarea { min-height: 70px; resize: vertical; }

.btn {
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 9px 16px;
  font-size: 0.88rem;
  cursor: pointer;
}

.btn:hover { background: #164e94; }
.btn.secondary { background: #fff; color: var(--blue); border: 1px solid var(--blue); }
.btn.secondary:hover { background: #eef4fc; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.q-block { margin-bottom: 16px; }
.q-text { font-size: 0.92rem; margin-bottom: 6px; }
.q-options label { display: flex; align-items: center; gap: 6px; font-weight: 400; font-size: 0.88rem; margin: 3px 0; }

.open-item {
  background: #fff8e1;
  border-left: 3px solid var(--amber);
  padding: 6px 10px;
  font-size: 0.85rem;
  margin: 4px 0;
}

.muted { color: var(--gray); font-size: 0.85rem; }
.error { color: #b3261e; font-size: 0.88rem; margin-top: 10px; }

.context-box {
  margin-top: 8px;
  width: 100%;
}

.context-box textarea {
  min-height: 44px;
  font-size: 0.85rem;
}

.spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 7px;
}

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

.build-footer {
  text-align: center;
  padding: 16px 24px 24px;
  font-size: 0.75rem;
  color: var(--gray);
}

/* Glossary tooltips - dotted underline, hover on desktop, tap-to-focus on
   mobile (no JS click handler needed - tabindex makes tap trigger :focus). */
.gterm {
  position: relative;
  border-bottom: 1px dotted var(--blue);
  cursor: help;
  outline: none;
}

.gtip {
  position: absolute;
  left: 0;
  bottom: calc(100% + 6px);
  z-index: 20;
  width: max-content;
  max-width: 260px;
  background: var(--navy);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.4;
  padding: 8px 10px;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.12s, transform 0.12s;
  pointer-events: none;
}

.gterm:hover .gtip,
.gterm:focus .gtip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

@media (max-width: 480px) {
  .gtip { max-width: 200px; }
}
