:root {
  --ink: #17202a;
  --muted: #64748b;
  --line: #d8dee8;
  --paper: #f7f8fb;
  --white: #ffffff;
  --blue: #1d5d9b;
  --blue-dark: #134a7f;
  --green: #247a55;
  --amber: #b36b00;
  --red: #b42318;
  --violet: #6554c0;
  --shadow: 0 16px 40px rgba(23, 32, 42, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-logo {
  width: clamp(170px, 24vw, 310px);
  height: auto;
  display: block;
}

.brand h1,
.brand p {
  margin: 0;
}

.brand h1 {
  font-size: 18px;
  line-height: 1.2;
}

.brand p {
  color: var(--muted);
  font-size: 13px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.page {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 26px 0 40px;
}

.login-page {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 460px);
}

.login-hero {
  display: flex;
  min-height: 100vh;
  align-items: end;
  padding: 48px;
  background:
    linear-gradient(rgba(15, 23, 42, 0.1), rgba(15, 23, 42, 0.72)),
    url("https://images.unsplash.com/photo-1523050854058-8df90110c9f1?auto=format&fit=crop&w=1600&q=80");
  background-position: center;
  background-size: cover;
  color: white;
}

.login-hero h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(42px, 7vw, 86px);
  line-height: 0.94;
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  padding: 42px;
  background: white;
}

.login-panel h2 {
  margin: 0;
  font-size: 30px;
}

.login-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.field label {
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
}

.field textarea {
  min-height: 106px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(29, 93, 155, 0.14);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 14px;
  border-radius: 8px;
  background: var(--blue);
  color: white;
  font-weight: 800;
}

.button:hover {
  background: var(--blue-dark);
}

.button.secondary {
  background: #edf2f7;
  color: var(--ink);
}

.button.secondary:hover {
  background: #dfe7f1;
}

.button.warning {
  background: var(--amber);
}

.button.danger {
  background: var(--red);
}

.button.ghost {
  background: transparent;
  color: var(--blue);
}

.status-pill,
.group-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #e9f2fb;
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill.live {
  background: #eaf7ef;
  color: var(--green);
}

.status-pill.wait {
  background: #fff3df;
  color: #8a5200;
}

.grid {
  display: grid;
  gap: 18px;
}

.two-col {
  grid-template-columns: minmax(0, 1fr) 340px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.card,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.card {
  padding: 18px;
}

.panel {
  padding: 22px;
}

.moment-card {
  display: grid;
  min-height: 166px;
  gap: 12px;
  align-content: start;
  text-align: left;
  box-shadow: none;
}

.moment-card:hover {
  border-color: #b7c4d7;
}

.moment-card.active {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(29, 93, 155, 0.13);
}

.moment-card.done {
  border-color: #94d3ae;
  background: #fbfffd;
}

.moment-card.locked {
  background: #f9fafb;
  color: #64748b;
}

.moment-number {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: #e6ecf4;
  font-weight: 900;
}

.moment-card.done .moment-number {
  background: #dff5e8;
  color: var(--green);
}

.moment-card.active .moment-number {
  background: #e9f2fb;
  color: var(--blue-dark);
}

.moment-card.locked .moment-number {
  background: #edf2f7;
  color: #64748b;
}

.moment-state {
  width: fit-content;
  border-radius: 999px;
  background: #edf2f7;
  color: #475569;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 900;
}

.moment-card.done .moment-state {
  background: #eaf7ef;
  color: var(--green);
}

.moment-card.active .moment-state {
  background: #e9f2fb;
  color: var(--blue-dark);
}

.moment-detail {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.moment-card h3,
.panel h2,
.panel h3,
.card h3 {
  margin: 0;
}

.moment-card h3 {
  font-size: 17px;
}

.moment-card p,
.small,
.empty {
  color: var(--muted);
  line-height: 1.45;
}

.moment-card p,
.small {
  margin: 0;
  font-size: 14px;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 16px;
}

.section-title h2 {
  margin: 0;
  font-size: 28px;
}

.section-title p {
  margin: 4px 0 0;
  color: var(--muted);
}

.reading-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
}

.material {
  display: grid;
  gap: 16px;
  line-height: 1.65;
}

.material h2,
.material h3,
.material p,
.material ul {
  margin-top: 0;
}

.slide-stage {
  min-height: 520px;
}

.slide-card {
  display: grid;
  min-height: 520px;
  align-content: center;
  gap: 18px;
  border-radius: 8px;
  padding: clamp(28px, 5vw, 62px);
  background:
    linear-gradient(135deg, rgba(29, 93, 155, 0.92), rgba(36, 122, 85, 0.84)),
    url("https://images.unsplash.com/photo-1509062522246-3755977927d7?auto=format&fit=crop&w=1600&q=80");
  background-position: center;
  background-size: cover;
  color: white;
  box-shadow: var(--shadow);
}

.slide-kicker {
  width: fit-content;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.slide-card h2 {
  max-width: 860px;
  margin: 0;
  font-size: clamp(32px, 4.6vw, 62px);
  line-height: 1.02;
}

.slide-card p {
  max-width: 800px;
  margin: 0;
  font-size: 19px;
  line-height: 1.45;
}

.slide-bullets {
  display: grid;
  max-width: 820px;
  gap: 9px;
  margin: 0;
  padding-left: 22px;
  font-size: 17px;
  line-height: 1.38;
}

.slide-bullets li::marker {
  color: rgba(255, 255, 255, 0.9);
}

.slide-focus {
  display: grid;
  gap: 6px;
  max-width: 760px;
  border-left: 5px solid rgba(255, 255, 255, 0.72);
  padding-left: 16px;
  margin-top: 2px;
}

.slide-focus span {
  line-height: 1.45;
}

.slide-progress {
  display: grid;
  max-width: 380px;
  gap: 8px;
  font-weight: 800;
}

.slide-progress .bar-track {
  background: rgba(255, 255, 255, 0.3);
}

.slide-progress .bar-fill {
  background: white;
}

.reading-side {
  display: grid;
  align-content: start;
  gap: 12px;
  box-shadow: none;
}

.reading-side > strong {
  font-size: 28px;
}

.slide-countdown {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid #f3d08b;
  border-radius: 8px;
  background: #fff8e8;
  color: #7a4a00;
  padding: 10px 12px;
}

.slide-countdown[hidden] {
  display: none;
}

.slide-countdown span {
  font-size: 13px;
  font-weight: 800;
}

.slide-countdown strong {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  background: white;
  font-size: 18px;
}

.audio-status {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  color: var(--muted);
  padding: 9px 10px;
  font-size: 13px;
  line-height: 1.35;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid .wide {
  grid-column: 1 / -1;
}

.response-list {
  display: grid;
  gap: 12px;
}

.action-list {
  display: grid;
  gap: 14px;
}

.action-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 16px;
}

.action-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.action-number {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: #e8f1fb;
  color: var(--blue-dark);
  font-weight: 900;
}

.action-head h3,
.action-head p,
.action-measure {
  margin: 0;
}

.action-head h3 {
  font-size: 15px;
}

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

.action-measure {
  margin-top: 12px;
  line-height: 1.5;
}

.choice-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.choice {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  font-weight: 800;
}

.choice input {
  width: 18px;
  height: 18px;
  margin-right: 8px;
  accent-color: var(--blue);
}

.response-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: white;
}

.response-item header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.response-item h4 {
  margin: 0;
}

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

.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfe;
}

.metric strong {
  display: block;
  margin-top: 7px;
  font-size: 30px;
}

.bars {
  display: grid;
  gap: 9px;
}

.bar-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 28px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: #e7edf5;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.protocol-list {
  display: grid;
  gap: 8px;
}

.protocol-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 10px 12px;
  font-size: 13px;
}

.protocol-row strong {
  white-space: nowrap;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table th,
.admin-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.admin-table th {
  color: #475569;
  font-size: 12px;
  text-transform: uppercase;
}

.admin-upload {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.admin-upload h3,
.admin-upload p {
  margin: 0;
}

.admin-upload p {
  margin-top: 6px;
}

.csv-help {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.csv-help span {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  color: var(--muted);
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.35;
}

.admin-responses {
  display: grid;
  gap: 14px;
}

.admin-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 16px;
}

.admin-group-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.admin-group h3,
.admin-group h4,
.admin-group p {
  margin: 0;
}

.admin-response-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 14px;
  margin-top: 16px;
}

.admin-response-grid h4 {
  margin-bottom: 8px;
}

.admin-details {
  display: grid;
  gap: 8px;
}

.admin-details details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 10px 12px;
}

.admin-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  font-weight: 800;
}

.admin-details summary strong {
  color: var(--blue-dark);
  white-space: nowrap;
}

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

.answer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px;
  gap: 10px;
  border-top: 1px solid #edf2f7;
  padding-top: 8px;
  font-size: 13px;
  line-height: 1.35;
}

.answer-row strong {
  color: var(--ink);
}

.answer-row em {
  grid-column: 1 / -1;
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9;
  max-width: 360px;
  border-radius: 8px;
  background: #102033;
  color: white;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}

@media (max-width: 980px) {
  .login-page,
  .two-col,
  .reading-layout {
    grid-template-columns: 1fr;
  }

  .login-hero {
    min-height: 42vh;
  }

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

  .admin-upload {
    align-items: flex-start;
    flex-direction: column;
  }

  .csv-help,
  .admin-response-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .topbar {
    align-items: start;
    flex-direction: column;
    padding: 14px 16px;
  }

  .brand {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-logo {
    width: min(280px, 100%);
  }

  .page {
    width: min(100% - 24px, 1180px);
    padding-top: 18px;
  }

  .login-panel,
  .login-hero {
    padding: 26px;
  }

  .cards,
  .metric-grid,
  .form-grid,
  .choice-row {
    grid-template-columns: 1fr;
  }

  .slide-card {
    min-height: 430px;
  }

  .slide-card p {
    font-size: 17px;
  }

  .section-title {
    align-items: start;
    flex-direction: column;
  }
}
