/* FINAL/FROZEN-referens: IUP UTVECKLINGSHISTORIK MOBILE. Canonical och strikt skrivskyddad. */
body.iup-history-open {
  overflow-x: hidden;
  background: #03142d;
}

@media (max-width: 899px) {
  body.iup-history-open .bottom-nav,
  body.iup-history-open .coach-desktop-nav,
  body.iup-history-open #view-iup > .section-title,
  body.iup-history-open .iup-home-mobile,
  body.iup-history-open .iup-desktop-existing {
    display: none !important;
  }

  body.iup-history-open .app-shell {
    min-height: 100dvh;
    padding-bottom: 0 !important;
  }
}

.iup-history-screen {
  display: none;
}

@media (max-width: 899px) {
  .iup-history-screen {
    box-sizing: border-box;
    display: block;
    width: min(100%, 520px);
    min-height: 100dvh;
    margin: 0 auto;
    padding: max(18px, env(safe-area-inset-top)) 17px max(22px, env(safe-area-inset-bottom));
    overflow-x: hidden;
    color: #f9fbff;
  }

  .iup-history-screen button {
    min-width: 44px;
    min-height: 44px;
    font: inherit;
    -webkit-tap-highlight-color: transparent;
  }

  .iup-history-screen button:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
  }

  .iup-history-screen svg {
    width: 24px;
    height: 24px;
  }

  .iup-history-header {
    display: grid;
    min-height: 54px;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 5px;
    align-items: center;
    margin-bottom: 20px;
  }

  .iup-history-header button {
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    color: #fff;
    background: transparent;
  }

  .iup-history-header button svg {
    width: 32px;
    height: 32px;
  }

  .iup-history-header h1 {
    overflow: hidden;
    margin: 0;
    color: #fff;
    font-size: clamp(1.55rem, 7vw, 2rem);
    font-weight: 860;
    letter-spacing: -.04em;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .iup-history-player {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 15px;
    align-items: center;
    min-height: 112px;
    margin-bottom: 24px;
    padding: 15px 17px;
    border: 1px solid rgba(132, 151, 179, .44);
    border-radius: 8px;
    background: rgba(1, 13, 31, .27);
  }

  .iup-history-player > span,
  .iup-history-snapshot-player > span {
    display: grid;
    width: 60px;
    height: 60px;
    place-items: center;
    border: 1px solid rgba(133, 164, 217, .66);
    border-radius: 50%;
    color: #fff;
    background: #11284e;
    font-size: 1.48rem;
    font-weight: 720;
  }

  .iup-history-player > div {
    min-width: 0;
  }

  .iup-history-player h2,
  .iup-history-snapshot-player h2 {
    overflow: hidden;
    margin: 0 0 4px;
    color: #fff;
    font-size: 1.33rem;
    font-weight: 820;
    letter-spacing: -.03em;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .iup-history-player p,
  .iup-history-player strong {
    display: block;
    margin: 0;
    color: rgba(255, 255, 255, .76);
    font-size: .98rem;
    font-weight: 520;
    line-height: 1.4;
  }

  .iup-history-player strong {
    margin-top: 3px;
    color: #fff;
  }

  .iup-history-overview-intro {
    margin: 0 0 15px;
  }

  .iup-history-overview-intro h2,
  .iup-history-periods > h2,
  .iup-history-timeline > h2,
  .iup-history-work-plan > h2,
  .iup-history-snapshot-intro h2,
  .iup-history-empty h2 {
    margin: 0 0 7px;
    color: #fff;
    font-size: clamp(1.65rem, 7.5vw, 2.05rem);
    font-weight: 860;
    letter-spacing: -.04em;
    line-height: 1.08;
  }

  .iup-history-overview-intro p,
  .iup-history-timeline > p,
  .iup-history-snapshot-intro p,
  .iup-history-empty > p {
    margin: 0;
    color: rgba(255, 255, 255, .72);
    font-size: 1rem;
    line-height: 1.45;
  }

  .iup-history-strongest {
    position: relative;
    display: grid;
    width: 100%;
    min-height: 174px;
    grid-template-columns: 62px minmax(0, 1fr) 24px;
    gap: 12px;
    align-items: center;
    margin: 17px 0 24px;
    padding: 45px 15px 47px;
    border: 1.5px solid #ffc400;
    border-radius: 8px;
    color: #fff;
    background: rgba(1, 14, 34, .38);
    text-align: left;
  }

  .iup-history-strongest > small {
    position: absolute;
    top: 13px;
    left: 15px;
    display: flex;
    gap: 7px;
    align-items: center;
    color: #ffc400;
    font-size: .72rem;
    font-weight: 840;
    letter-spacing: .015em;
    text-transform: uppercase;
  }

  .iup-history-strongest > small svg {
    width: 20px;
    height: 20px;
  }

  .iup-history-strongest > span {
    display: grid;
    place-items: center;
    color: #7194ff;
  }

  .iup-history-strongest > span svg {
    width: 58px;
    height: 58px;
  }

  .iup-history-strongest > div {
    min-width: 0;
  }

  .iup-history-strongest em,
  .iup-history-journey-head small,
  .iup-history-snapshot-goal small {
    display: block;
    margin-bottom: 5px;
    color: #7899ff;
    font-size: .78rem;
    font-style: normal;
    font-weight: 780;
    text-transform: uppercase;
  }

  .iup-history-strongest strong {
    display: block;
    overflow: hidden;
    color: #fff;
    font-size: 1.24rem;
    font-weight: 830;
    letter-spacing: -.025em;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .iup-history-strongest p {
    margin: 6px 0 0;
    color: rgba(255, 255, 255, .74);
    font-size: .9rem;
  }

  .iup-history-strongest > b {
    position: absolute;
    bottom: 7px;
    left: 15px;
    display: flex;
    min-height: 40px;
    gap: 5px;
    align-items: center;
    color: #7899ff;
    font-size: .91rem;
    font-weight: 760;
  }

  .iup-history-strongest > b svg {
    width: 18px;
    height: 18px;
  }

  .iup-history-periods {
    display: grid;
    gap: 8px;
  }

  .iup-history-periods > h2 {
    margin: 0 0 4px;
    font-size: 1.55rem;
  }

  .iup-history-period {
    display: grid;
    width: 100%;
    min-height: 94px;
    grid-template-columns: 48px minmax(0, 1fr) 23px;
    gap: 10px;
    align-items: center;
    padding: 12px 13px;
    border: 1px solid rgba(128, 149, 181, .42);
    border-radius: 8px;
    color: #fff;
    background: rgba(1, 14, 34, .3);
    text-align: left;
  }

  .iup-history-period > span {
    color: #7899ff;
  }

  .iup-history-period.is-current > span,
  .iup-history-period.is-current small {
    color: #ffc400;
  }

  .iup-history-period > span svg {
    width: 40px;
    height: 40px;
  }

  .iup-history-period > div {
    min-width: 0;
  }

  .iup-history-period small,
  .iup-history-all-list h2 {
    display: block;
    color: #7899ff;
    font-size: .77rem;
    font-weight: 780;
    text-transform: uppercase;
  }

  .iup-history-period strong {
    display: block;
    margin-top: 3px;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 790;
  }

  .iup-history-period p {
    overflow: hidden;
    margin: 3px 0 0;
    color: rgba(255, 255, 255, .72);
    font-size: .81rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .iup-history-link {
    display: flex;
    width: fit-content;
    min-height: 44px;
    gap: 6px;
    align-items: center;
    margin-top: 10px;
    padding: 0;
    border: 0;
    color: #7899ff;
    background: transparent;
    font-weight: 780;
  }

  .iup-history-link svg {
    width: 19px;
    height: 19px;
  }

  .iup-history-journey-head {
    display: grid;
    grid-template-columns: 66px minmax(0, 1fr);
    gap: 11px;
    margin-bottom: 25px;
    padding: 17px 16px;
    border: 1px solid rgba(132, 151, 179, .44);
    border-radius: 8px;
    background: rgba(1, 13, 31, .3);
  }

  .iup-history-journey-head > span {
    display: grid;
    place-items: start center;
    color: #7194ff;
  }

  .iup-history-journey-head > span svg {
    width: 57px;
    height: 57px;
  }

  .iup-history-journey-head h2 {
    margin: 0 0 4px;
    color: #fff;
    font-size: 1.35rem;
    font-weight: 830;
    letter-spacing: -.03em;
  }

  .iup-history-journey-head p {
    margin: 0;
    color: rgba(255, 255, 255, .72);
  }

  .iup-history-level-summary,
  .iup-history-level-dots {
    grid-column: 1 / -1;
  }

  .iup-history-level-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
    color: rgba(255, 255, 255, .75);
  }

  .iup-history-level-summary strong {
    color: #ffc400;
    font-weight: 720;
  }

  .iup-history-level-dots {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin: 6px 12px 0;
  }

  .iup-history-level-dots::before {
    content: "";
    position: absolute;
    top: 50%;
    right: 8px;
    left: 8px;
    height: 2px;
    background: rgba(255, 255, 255, .45);
    transform: translateY(-50%);
  }

  .iup-history-level-dots i {
    z-index: 1;
    display: grid;
    width: 25px;
    height: 25px;
    place-self: center;
    place-items: center;
    border: 2px solid #7194ff;
    border-radius: 50%;
    background: #041a37;
  }

  .iup-history-level-dots i.done {
    border-color: #ffc400;
    color: #07172e;
    background: #ffc400;
  }

  .iup-history-level-dots svg {
    width: 15px;
    height: 15px;
    stroke-width: 2.5;
  }

  .iup-history-screen.is-completed .iup-history-level-dots::before {
    background: #ffc400;
  }

  .iup-history-timeline {
    margin-bottom: 22px;
  }

  .iup-history-timeline > h2 {
    font-size: 1.55rem;
  }

  .iup-history-timeline ol {
    margin: 20px 0 0 30px;
    padding: 0;
    list-style: none;
  }

  .iup-history-timeline li {
    position: relative;
    display: grid;
    min-height: 88px;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 18px;
  }

  .iup-history-timeline li::before {
    content: "";
    position: absolute;
    top: 33px;
    bottom: -1px;
    left: 18px;
    width: 2px;
    background: #7194ff;
  }

  .iup-history-timeline li:last-child::before {
    display: none;
  }

  .iup-history-timeline li > i {
    z-index: 1;
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: #557ce7;
  }

  .iup-history-timeline li > i svg {
    width: 21px;
    height: 21px;
  }

  .iup-history-timeline li.future > i {
    box-sizing: border-box;
    border: 2px dashed #ffc400;
    background: #03142d;
  }

  .iup-history-timeline time {
    display: block;
    margin-bottom: 3px;
    color: #7899ff;
    font-size: .88rem;
    font-weight: 720;
  }

  .iup-history-timeline li.future time {
    color: #ffc400;
  }

  .iup-history-timeline strong {
    color: #fff;
    font-size: 1.15rem;
    font-weight: 810;
  }

  .iup-history-timeline li p {
    margin: 4px 0 0;
    color: rgba(255, 255, 255, .7);
    font-size: .9rem;
    line-height: 1.35;
  }

  .iup-history-work-plan {
    margin-bottom: 18px;
  }

  .iup-history-work-plan > h2 {
    font-size: 1.15rem;
  }

  .iup-history-work-plan article {
    display: grid;
    min-height: 84px;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 13px;
    align-items: center;
    padding: 13px 15px;
    border: 1px solid #507ae7;
    border-radius: 8px;
    background: rgba(1, 14, 34, .3);
  }

  .iup-history-work-plan article > svg {
    width: 43px;
    height: 43px;
    color: #7194ff;
  }

  .iup-history-work-plan p {
    margin: 0;
    color: #fff;
    font-size: 1rem;
    line-height: 1.42;
  }

  .iup-history-primary {
    display: flex;
    width: 100%;
    min-height: 58px;
    align-items: center;
    justify-content: center;
    padding: 12px 15px;
    border: 0;
    border-radius: 7px;
    color: #06152a;
    background: #ffc400;
    font-size: 1.08rem;
    font-weight: 850;
    text-align: center;
  }

  .iup-history-snapshot-player {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    margin: 0 0 25px;
  }

  .iup-history-snapshot-player > span {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
  }

  .iup-history-snapshot-player h2 {
    overflow: visible;
    font-size: 1.27rem;
    text-overflow: clip;
    white-space: normal;
  }

  .iup-history-snapshot-player p {
    margin: 0;
    color: rgba(255, 255, 255, .72);
    font-size: .9rem;
  }

  .iup-history-snapshot-player > strong {
    display: flex;
    gap: 6px;
    align-items: center;
    color: #ffc400;
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
  }

  .iup-history-snapshot-player > strong svg {
    width: 23px;
    height: 23px;
    padding: 3px;
    border-radius: 50%;
    color: #07172e;
    background: #ffc400;
  }

  @media (max-width: 419px) {
    .iup-history-snapshot-player {
      grid-template-columns: 52px minmax(0, 1fr);
    }

    .iup-history-snapshot-player > strong {
      grid-column: 2;
      justify-self: start;
    }
  }

  .iup-history-snapshot-intro {
    margin-bottom: 17px;
  }

  .iup-history-snapshot-list {
    display: grid;
    gap: 10px;
  }

  .iup-history-snapshot-goal {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 11px;
    padding: 15px;
    border: 1px solid rgba(132, 151, 179, .44);
    border-radius: 8px;
    background: rgba(1, 13, 31, .27);
  }

  .iup-history-snapshot-goal > span {
    display: grid;
    place-items: start center;
    color: #7194ff;
  }

  .iup-history-snapshot-goal > span svg {
    width: 52px;
    height: 52px;
  }

  .iup-history-snapshot-goal h2 {
    margin: 0;
    color: #fff;
    font-size: 1.24rem;
    font-weight: 820;
    letter-spacing: -.025em;
  }

  .iup-history-snapshot-goal > div > p {
    margin: 6px 0 10px;
    color: rgba(255, 255, 255, .72);
  }

  .iup-history-snapshot-goal > div > div {
    display: grid;
    grid-template-columns: 31px minmax(0, 1fr);
    gap: 9px;
    align-items: start;
    padding-top: 10px;
    border-top: 1px solid rgba(137, 155, 182, .36);
  }

  .iup-history-snapshot-goal > div > div svg {
    color: #7194ff;
  }

  .iup-history-snapshot-goal > div > div p {
    margin: 0;
    color: #fff;
    line-height: 1.42;
  }

  .iup-history-snapshot-goal button {
    display: flex;
    min-height: 44px;
    gap: 5px;
    align-items: center;
    margin: 3px 0 -7px;
    padding: 0;
    border: 0;
    color: #7899ff;
    background: transparent;
    font-weight: 760;
  }

  .iup-history-snapshot-goal button svg {
    width: 18px;
    height: 18px;
  }

  .iup-history-saved-at {
    margin: 13px 0 0;
    color: rgba(255, 255, 255, .62);
    text-align: right;
  }

  .iup-history-all-list {
    display: grid;
    gap: 26px;
  }

  .iup-history-all-list section {
    display: grid;
    gap: 8px;
  }

  .iup-history-all-list h2 {
    margin: 0 0 2px 1px;
    color: #7899ff;
    font-size: .89rem;
  }

  .iup-history-all-list section:first-child h2 {
    color: #ffc400;
  }

  .iup-history-conversation-row {
    display: grid;
    width: 100%;
    min-height: 82px;
    grid-template-columns: 46px 57px minmax(0, 1fr) 24px 20px;
    gap: 8px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid rgba(132, 151, 179, .44);
    border-radius: 8px;
    color: #fff;
    background: rgba(1, 13, 31, .27);
    text-align: left;
  }

  .iup-history-conversation-row > span {
    color: #7899ff;
  }

  .iup-history-conversation-row > span svg {
    width: 36px;
    height: 36px;
  }

  .iup-history-conversation-row time {
    color: rgba(255, 255, 255, .72);
    font-size: .86rem;
  }

  .iup-history-conversation-row > div {
    min-width: 0;
    padding-left: 11px;
    border-left: 1px solid rgba(136, 155, 184, .4);
  }

  .iup-history-conversation-row strong {
    display: block;
    color: #fff;
    font-size: 1rem;
    font-weight: 790;
  }

  .iup-history-conversation-row p {
    overflow: hidden;
    margin: 4px 0 0;
    color: rgba(255, 255, 255, .69);
    font-size: .82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .iup-history-conversation-row > svg:nth-last-child(2) {
    padding: 4px;
    border-radius: 50%;
    color: #07172e;
    background: #ffc400;
  }

  .iup-history-conversation-row.is-locked {
    grid-template-columns: 46px 57px minmax(0, 1fr) 24px;
  }

  .iup-history-conversation-row.is-locked > svg:last-child {
    color: #7899ff;
  }

  .iup-history-conversation-row.is-locked p {
    text-transform: uppercase;
  }

  .iup-history-empty {
    display: grid;
    justify-items: center;
    padding-top: 32px;
    text-align: center;
  }

  .iup-history-route {
    display: grid;
    width: 160px;
    height: 160px;
    place-items: center;
    margin-bottom: 18px;
    color: #7899ff;
  }

  .iup-history-route svg {
    width: 145px;
    height: 145px;
    color: #7899ff;
  }

  .iup-history-empty > p {
    max-width: 360px;
  }

  .iup-history-empty > article {
    display: grid;
    width: 100%;
    min-height: 84px;
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    margin: 28px 0 22px;
    padding: 13px 16px;
    border: 1px solid rgba(132, 151, 179, .44);
    border-radius: 8px;
    background: rgba(1, 13, 31, .27);
    text-align: left;
  }

  .iup-history-empty > article > span {
    display: grid;
    width: 50px;
    height: 50px;
    place-items: center;
    border: 1px solid #ffc400;
    border-radius: 50%;
    color: #ffc400;
  }

  .iup-history-empty > article > span svg {
    width: 31px;
    height: 31px;
  }

  .iup-history-empty > article small {
    display: block;
    margin-bottom: 4px;
    color: #ffc400;
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
  }

  .iup-history-empty > article strong {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
  }

  .iup-history-empty > .iup-history-primary + p {
    margin-top: 13px;
    color: rgba(255, 255, 255, .66);
  }

  .iup-history-locked-status {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 1px 10px;
    align-items: center;
    color: rgba(255, 255, 255, .75);
  }

  .iup-history-locked-status svg {
    grid-row: 1 / 3;
    color: #7899ff;
  }

  .iup-history-locked-status strong {
    color: rgba(255, 255, 255, .8);
    font-size: 1.04rem;
  }

  .iup-history-locked-status span {
    color: rgba(255, 255, 255, .65);
    font-size: .91rem;
  }
}

@media (max-width: 350px) {
  .iup-history-screen {
    padding-inline: 12px;
  }

  .iup-history-header {
    grid-template-columns: 45px minmax(0, 1fr);
  }

  .iup-history-header h1 {
    font-size: 1.42rem;
  }

  .iup-history-player {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 11px;
    padding-inline: 13px;
  }

  .iup-history-player > span {
    width: 52px;
    height: 52px;
    font-size: 1.24rem;
  }

  .iup-history-player h2 {
    font-size: 1.15rem;
  }

  .iup-history-period p {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .iup-history-strongest {
    grid-template-columns: 52px minmax(0, 1fr) 20px;
    padding-inline: 12px;
  }

  .iup-history-strongest > span svg {
    width: 48px;
    height: 48px;
  }

  .iup-history-snapshot-player {
    grid-template-columns: 50px minmax(0, 1fr);
  }

  .iup-history-snapshot-player > strong {
    grid-column: 2;
    justify-self: start;
  }

  .iup-history-conversation-row {
    grid-template-columns: 38px 48px minmax(0, 1fr) 22px 18px;
    gap: 6px;
    padding-inline: 9px;
  }

  .iup-history-conversation-row p {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .iup-history-conversation-row.is-locked {
    grid-template-columns: 38px 48px minmax(0, 1fr) 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .iup-history-screen *,
  .iup-history-screen *::before,
  .iup-history-screen *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
