:root {
  --ink: #15232b;
  --muted: #61717b;
  --line: #d7e0e5;
  --panel: #ffffff;
  --page: #f4f7f8;
  --brand: #154563;
  --brand-strong: #0f354d;
  --accent: #b45f3d;
  --ok: #1f7a4d;
  --warn: #9a6b12;
  --risk: #a43d3d;
  --shadow: 0 10px 28px rgba(21, 35, 43, 0.09);
  font-family: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  background: var(--brand);
  color: #fff;
  box-shadow: var(--shadow);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.15;
}

h2 {
  font-size: 19px;
  line-height: 1.25;
}

main {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 14px;
}

.eyebrow {
  margin-bottom: 4px;
  color: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  opacity: 0.78;
}

.panel {
  margin: 0 0 14px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(21, 35, 43, 0.04);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.field-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-stack {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  background: #fff;
}

textarea {
  resize: vertical;
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 0 12px;
  scrollbar-width: thin;
}

.tab,
button {
  border: 0;
  border-radius: 6px;
  min-height: 42px;
  padding: 10px 13px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.tab {
  flex: 0 0 auto;
  color: var(--brand);
  background: #e8f0f4;
}

.tab.active {
  color: #fff;
  background: var(--brand);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.progress {
  flex: 0 0 auto;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.statement-card {
  padding: 13px;
  border-left: 4px solid var(--accent);
  background: #fbf4f0;
  border-radius: 6px;
  color: #33241e;
  line-height: 1.45;
}

.score-group {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.score {
  min-height: 48px;
  background: #eef2f4;
  color: var(--ink);
  border: 1px solid transparent;
}

.score.selected[data-score="Assured"] {
  color: #fff;
  background: var(--ok);
}

.score.selected[data-score="Partially assured"] {
  color: #fff;
  background: var(--warn);
}

.score.selected[data-score="Not assured"] {
  color: #fff;
  background: var(--risk);
}

.score.selected[data-score="Not reviewed"] {
  color: #fff;
  background: var(--muted);
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

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

.secondary {
  color: var(--brand);
  background: #e8f0f4;
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.icon-button,
.admin-button {
  color: #fff;
  background: var(--brand-strong);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.admin-button {
  background: rgba(15, 53, 77, 0.72);
}

.full-width {
  width: 100%;
  margin-top: 12px;
}

.action-list {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 12px 0 0;
  list-style: none;
}

.action-list li {
  display: grid;
  gap: 5px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfc;
}

.action-list strong {
  font-size: 14px;
}

.action-list span {
  color: var(--muted);
  font-size: 13px;
}

.board-brief textarea {
  min-height: 190px;
  background: #fbfcfc;
}

.sync-status {
  min-height: 20px;
  margin-top: 12px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
}

.sync-status.sync-error {
  color: var(--risk);
}

footer {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 0 14px 24px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

@media (max-width: 720px) {
  .app-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .header-actions {
    width: 100%;
    flex-direction: column;
  }

  .header-actions button {
    width: 100%;
  }

  .header-actions .admin-button {
    display: none;
  }

  h1 {
    font-size: 21px;
  }

  main {
    padding: 10px;
  }

  .panel {
    padding: 13px;
  }

  .field-grid,
  .field-grid.compact {
    grid-template-columns: 1fr;
  }

  .score-group {
    grid-template-columns: 1fr 1fr;
  }

  .button-row {
    grid-template-columns: 1fr;
  }
}

.auth-pending main,
.auth-pending footer {
  visibility: hidden;
}

.auth-controls {
  display: grid;
  gap: 4px;
  min-width: 190px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(11, 45, 66, 0.92);
}

.auth-controls span {
  color: #dbe8ee;
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.auth-controls button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--brand);
  background: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

@media (max-width: 720px) {
  .auth-controls {
    width: 100%;
  }
}
