:root {
  --tps-navy: #163a56;
  --tps-navy-dark: #102a3f;
  --tps-navy-light: #23577f;
  --tps-green: #5fa052;
  --tps-green-dark: #4a8440;
  --tps-bg: #f4f6f8;
  --tps-card-bg: #f0f3f6;
  --tps-note-bg: #eef8ec;
  --tps-note-border: #bfe0b6;
  --tps-warn-bg: #fdecec;
  --tps-warn-border: #f3bcbc;
  --tps-text: #1f2b36;
  --tps-text-muted: #5b6b78;
  --tps-border: #dde3e8;
  --tps-radius: 10px;
  --tps-shadow: 0 2px 10px rgba(16, 42, 63, 0.07);
  --tps-shadow-lg: 0 8px 30px rgba(16, 42, 63, 0.12);
  font-size: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--tps-text);
  background: var(--tps-bg);
}

img { max-width: 100%; display: block; }
button { font-family: inherit; }

/* Intentionally no min-height:100vh here. This app is designed to be embedded
   in a DNN iframe that auto-sizes to content height (see notifyResize() in
   app.js) -- forcing a full-viewport height would fight that and cause the
   panel to always stretch to fill whatever height the iframe currently has. */
.tps-app {
  display: flex;
  min-height: 480px;
  width: 100%;
}

/* ---------- Mobile top bar ---------- */
.tps-mobilebar {
  display: none;
  align-items: center;
  gap: 12px;
  background: var(--tps-navy-dark);
  color: #fff;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.tps-menu-toggle {
  background: transparent;
  border: none;
  color: #fff;
  width: 30px;
  height: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tps-menu-toggle svg { width: 22px; height: 22px; }
.tps-mobilebar-title { font-weight: 600; font-size: 15px; }

.tps-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 30, 0.45);
  z-index: 25;
}
.tps-overlay.tps-open { display: block; }

/* ---------- Sidebar ---------- */
.tps-sidebar {
  width: 272px;
  min-width: 272px;
  background: linear-gradient(180deg, var(--tps-navy) 0%, var(--tps-navy-dark) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
}

.tps-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 22px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  margin-bottom: 18px;
}
.tps-brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--tps-green) 0%, var(--tps-green-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.tps-brand-text { display: flex; flex-direction: column; line-height: 1.3; }
.tps-brand-text strong { font-size: 15px; font-weight: 700; }
.tps-brand-text span { font-size: 12px; color: rgba(255,255,255,0.65); }

.tps-nav-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.45);
  padding: 0 10px;
  margin-bottom: 8px;
  font-weight: 600;
}

.tps-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.tps-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 11px 12px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.82);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.tps-nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.tps-nav-item.tps-active {
  background: var(--tps-green);
  color: #fff;
  box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}
.tps-nav-item .tps-nav-icon {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  opacity: 0.9;
}
.tps-nav-item .tps-nav-label-text { flex: 1; }
.tps-nav-item .tps-nav-progress {
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  font-weight: 600;
}
.tps-nav-item.tps-active .tps-nav-progress { color: rgba(255,255,255,0.85); }

.tps-sidebar-footer {
  font-size: 11.5px;
  color: rgba(255,255,255,0.4);
  padding: 14px 10px 4px 10px;
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: 12px;
  line-height: 1.5;
}

.tps-footer-link {
  color: var(--tps-green);
  font-weight: 600;
  text-decoration: underline;
}
.tps-footer-link:hover { color: #fff; }

/* ---------- Main ---------- */
.tps-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Welcome state */
.tps-welcome {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}
.tps-welcome-inner { max-width: 440px; text-align: center; }
.tps-welcome-mark {
  width: 60px;
  height: 60px;
  margin: 0 auto 20px auto;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--tps-green) 0%, var(--tps-green-dark) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 20px;
}
.tps-welcome h1 { font-size: 22px; margin: 0 0 10px 0; color: var(--tps-navy-dark); }
.tps-welcome p { color: var(--tps-text-muted); font-size: 14.5px; line-height: 1.6; margin: 0; }

/* Viewer */
.tps-welcome[hidden],
.tps-viewer[hidden] {
  display: none !important;
}

.tps-viewer {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 32px 24px 32px;
}

.tps-viewer-header { margin-bottom: 18px; }
.tps-viewer-eyebrow {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--tps-green-dark);
  font-weight: 700;
}
.tps-viewer-heading h1 {
  font-size: 21px;
  margin: 4px 0 14px 0;
  color: var(--tps-navy-dark);
}

.tps-progress-wrap { display: flex; flex-direction: column; gap: 6px; }
.tps-progress-text { font-size: 12.5px; color: var(--tps-text-muted); font-weight: 600; }
.tps-progress-track {
  height: 6px;
  width: 100%;
  background: var(--tps-border);
  border-radius: 999px;
  overflow: hidden;
}
.tps-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--tps-green) 0%, var(--tps-green-dark) 100%);
  border-radius: 999px;
  transition: width 0.25s ease;
}

/* Slide */
.tps-slide {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 26px 26px 30px 26px;
  background: #fff;
  border: 1px solid var(--tps-border);
  border-radius: var(--tps-radius);
  box-shadow: var(--tps-shadow);
  min-height: 320px;
  animation: tps-fade 0.2s ease;
}
@keyframes tps-fade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.tps-step-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.tps-step-badge {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--tps-navy);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tps-step-caption {
  font-size: 16.5px;
  line-height: 1.5;
  color: var(--tps-text);
  padding-top: 4px;
  font-weight: 500;
}

.tps-shot-frame {
  border: 1px solid var(--tps-border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--tps-card-bg);
  box-shadow: 0 1px 4px rgba(16,42,63,0.06);
}
.tps-shot-frame img { width: 100%; height: auto; }

/* Note / warning callouts (no image) */
.tps-callout {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 20px;
  border-radius: 10px;
  border: 1px solid var(--tps-note-border);
  background: var(--tps-note-bg);
}
.tps-callout.tps-warning {
  border-color: var(--tps-warn-border);
  background: var(--tps-warn-bg);
}
.tps-callout-icon {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tps-green);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}
.tps-callout.tps-warning .tps-callout-icon { background: #d16a6a; }
.tps-callout-text {
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--tps-text);
}
.tps-callout-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--tps-green-dark);
  margin-bottom: 4px;
}
.tps-callout.tps-warning .tps-callout-label { color: #b23b3b; }

/* Footer / nav buttons */
.tps-viewer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
}

.tps-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 8px;
  border: none;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
}
.tps-btn:active { transform: scale(0.98); }
.tps-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.tps-btn-primary {
  background: var(--tps-navy);
  color: #fff;
}
.tps-btn-primary:hover:not(:disabled) { background: var(--tps-navy-light); }
.tps-btn-ghost {
  background: #fff;
  color: var(--tps-navy);
  border: 1px solid var(--tps-border);
}
.tps-btn-ghost:hover:not(:disabled) { background: #f2f5f7; }

.tps-dots {
  display: none;
  gap: 5px;
  flex: 1;
  justify-content: center;
  flex-wrap: wrap;
}
.tps-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tps-border);
  cursor: pointer;
  border: none;
  padding: 0;
}
.tps-dot.tps-dot-active { background: var(--tps-green); width: 20px; border-radius: 4px; }
.tps-dot.tps-dot-done { background: #b9c6cf; }

@media (min-width: 760px) {
  .tps-dots { display: flex; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .tps-viewer { padding: 22px 18px; }
}

@media (max-width: 760px) {
  .tps-mobilebar { display: flex; }
  .tps-app { flex-direction: column; }
  .tps-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 30;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    width: 82%;
    max-width: 300px;
  }
  .tps-sidebar.tps-open { transform: translateX(0); }
  .tps-viewer { padding: 18px 14px 20px 14px; }
  .tps-viewer-heading h1 { font-size: 18px; }
  .tps-step-caption { font-size: 15px; }
  .tps-btn { padding: 10px 14px; font-size: 13.5px; }
  .tps-viewer-footer { flex-wrap: wrap; }
}
