/* ==========================================================================
   FixIt demo — page chrome.
   The app fills the window and then some: the frame is taller than the viewport,
   so the page scrolls normally, with a slim sticky bar for the role switch,
   restart and help.
   ========================================================================== */

:root {
  --bar-h: 64px;
  --extra: 200px;
  --bg: #f7f9fc;
  --text: #10223b;
  --text-strong: #0b1a2e;
  --muted: #5a6a80;
  --amber: #a86200;
  --amber-2: #f5a623;
  --line: rgba(16, 34, 59, 0.12);
  --line-soft: rgba(16, 34, 59, 0.07);
  --green: #0f7a54;
  --font: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

a { color: inherit; text-decoration: none; }

/* --------------------------------------------------------------------- bar */

.bar {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: var(--bar-h);
  padding: 0 clamp(12px, 3vw, 28px);
  background: #fff;
  border-bottom: 1px solid var(--line-soft);
  z-index: 10;
}

.bar__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 0 0 auto;
}

.bar__brand img {
  height: 30px;
  width: auto;
  display: block;
}

.bar__label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

.bar__tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.role {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: #eef2f7;
  border: 1px solid var(--line-soft);
}

.role__btn {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 7px 13px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.18s var(--ease), color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.role__btn:hover { color: var(--text); }

.role__short { display: none; }

.role__btn.is-on {
  background: #fff;
  color: var(--text);
  box-shadow: 0 2px 8px rgba(16, 34, 59, 0.12);
}

.bar__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease);
}

.bar__btn:hover,
.bar__btn:focus-visible { border-color: var(--amber-2); color: var(--amber); }

.bar__btn--icon {
  width: 34px;
  padding: 0;
}

.bar__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  background: var(--text);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.18s var(--ease);
}

.bar__back:hover { background: #1b3a63; }

/* --------------------------------------------------------------------- app */

.app {
  height: calc(100vh - var(--bar-h) + var(--extra));
  height: calc(100dvh - var(--bar-h) + var(--extra));
  background: #fff;
}

.app iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

/* -------------------------------------------------------------------- help */

.help {
  width: min(460px, calc(100vw - 28px));
  max-height: calc(100dvh - 40px);
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--line-soft);
  border-radius: 22px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 40px 90px -30px rgba(16, 34, 59, 0.45);
}

.help::backdrop {
  background: rgba(16, 34, 59, 0.38);
}

.help__head {
  position: relative;
  margin-bottom: 14px;
  padding-right: 40px;
}

.help__eyebrow {
  margin: 0 0 3px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
}

.help__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--text-strong);
}

.help__close {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}

.help__close:hover { border-color: var(--amber-2); color: var(--amber); }

/* steps */

.steps {
  list-style: none;
  margin: 0 0 16px;
  padding: 4px 16px;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
}

.steps li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
  transition: color 0.25s var(--ease);
}

.steps li:last-child { border-bottom: 0; }

.steps li strong { color: var(--text); font-weight: 700; }

.steps__tick {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 50%;
  border: 1.5px solid rgba(16, 34, 59, 0.18);
  background: #fff;
  position: relative;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease);
}

.steps__tick::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 3px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0.4);
  opacity: 0;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}

.steps li.is-done { color: var(--text); }

.steps li.is-done .steps__tick {
  background: var(--green);
  border-color: var(--green);
}

.steps li.is-done .steps__tick::after {
  opacity: 1;
  transform: rotate(45deg) scale(1);
}

.help__note {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}

.help__note a {
  color: var(--amber);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.help__fine {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  font-size: 12px;
  line-height: 1.55;
  color: #7a8699;
}

/* --------------------------------------------------------------- responsive */

@media (max-width: 700px) {
  :root {
    --bar-h: 56px;
    --extra: 150px;
  }

  .bar {
    height: var(--bar-h);
    padding-inline: 10px;
    gap: 8px;
  }

  .bar__brand img { height: 26px; }
  .bar__label { display: none; }

  .role__btn {
    padding: 6px 9px;
    font-size: 11.5px;
  }

  .bar__btn {
    width: 32px;
    height: 32px;
    padding: 0;
  }

  .bar__btn span { display: none; }

  .bar__back {
    width: 32px;
    height: 32px;
    padding: 0;
    justify-content: center;
  }

  .bar__back span { display: none; }

  .help {
    padding: 18px;
    border-radius: 18px;
  }

  .help__title { font-size: 26px; }
}

/* Narrow phones: keep the brand mark, shorten the role labels. */
@media (max-width: 400px) {
  .role__full { display: none; }
  .role__short { display: inline; }

  .role__btn {
    padding: 6px 9px;
    font-size: 11px;
  }

  .bar__brand img { height: 24px; }

  .bar {
    padding-inline: 8px;
    gap: 6px;
  }

  .bar__tools { gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; }
}
