#study-plan {
    max-width: 820px;
    margin: 0 auto 4rem;
    padding: 0 1.25rem;
  }

  .plan-section-heading {
    position: relative;
    margin-bottom: 1.15rem;
  }

  .plan-section-heading .home-eyebrow {
    margin-bottom: 0.25rem;
  }

  .plan-section-heading h2 {
    margin: 0;
    padding-right: 7rem;
    color: #173f35;
  }

  .plan-status {
    position: absolute;
    top: 1.9rem;
    right: 0;
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0.3rem 0.65rem;
    border: 1px solid #cbdad4;
    border-radius: 999px;
    background: #f7faf8;
    color: #416257;
    font-size: 0.8rem;
    font-weight: 700;
  }

  .plan-status.is-custom {
    background: #e8f3ee;
    border-color: #8fb5a6;
    color: #173f35;
  }

  .plan-overview {
    display: grid;
    grid-template-columns:
      repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
    padding: 1rem;
    border: 1px solid #d9e6e0;
    border-radius: 18px;
    background: #ffffff;
  }

  .plan-overview-item {
    min-width: 0;
    padding: 0.3rem 0.75rem;
    border-left: 1px solid #e6eeea;
  }

  .plan-overview-item:first-child {
    border-left: 0;
  }

  .plan-overview-item strong {
    display: block;
    margin-bottom: 0.25rem;
    color: #173f35;
    font-size: 1.45rem;
    line-height: 1.15;
  }

  .plan-overview-item span {
    color: #61766f;
    font-size: 0.86rem;
  }

  .plan-actions {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin: 0.9rem 0 0;
  }

  #toggle-plan-adjustments,
  #restore-plan-defaults {
    appearance: none;
    min-height: 42px;
    padding: 0.65rem 0.9rem;
    border-radius: 999px;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
  }

  #toggle-plan-adjustments {
    border: 1px solid #8fb5a6;
    background: #ffffff;
    color: #173f35;
  }

  #toggle-plan-adjustments:hover {
    background: #eef6f2;
    border-color: #286c5e;
  }

  #restore-plan-defaults {
    border: 1px solid #b8cbc3;
    background: #ffffff;
    color: #416257;
  }

  #restore-plan-defaults:hover {
    background: #eef6f2;
    color: #173f35;
  }

  #toggle-plan-adjustments:focus-visible,
  #restore-plan-defaults:focus-visible {
    outline: 2px solid #286c5e;
    outline-offset: 3px;
  }

  .plan-form {
    display: grid;
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin: 1rem 0 0;
    padding: 1rem;
    border-radius: 18px;
    background: #f7faf8;
    border: 1px solid #d9e6e0;
  }

  .plan-form[hidden] {
    display: none;
  }

  .plan-form p {
    margin: 0;
  }

  .plan-form label {
    display: block;
    margin-bottom: 0.45rem;
    font-weight: 700;
    color: #173f35;
  }

  .plan-form input,
  .plan-form select {
    min-height: 44px;
    padding: 0.65rem 0.8rem;
    border: 1px solid #b8cbc3;
    border-radius: 12px;
    background: #ffffff;
    color: #173f35;
    font: inherit;
    box-sizing: border-box;
  }

  .plan-form input[type="number"] {
    width: 105px;
  }

  .plan-form select {
    width: 100%;
  }

  .plan-form span {
    margin-left: 0.4rem;
    color: #416257;
    font-size: 0.92rem;
  }

  .plan-panel {
    margin-top: 1.35rem;
    padding: 1.1rem 1.15rem;
    border-radius: 18px;
    background: #f7faf8;
    border: 1px solid #d9e6e0;
  }

  .plan-panel .home-eyebrow {
    margin-bottom: 0.7rem;
  }

  .recovery-item {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
  }

  .recovery-item + .recovery-item {
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid #e6eeea;
  }

  .recovery-item-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: #e4f0eb;
    color: #173f35;
    font-size: 1rem;
    font-weight: 700;
  }

  #recovery-profile-title {
    margin: 0 0 0.25rem;
    color: #173f35;
    font-size: 1rem;
  }

  #recovery-focus {
    margin: 0;
    color: #416257;
    font-size: 0.9rem;
  }

  #eye-prompt-row {
    color: #244e43;
  }

  #eye-prompt-row[hidden] {
    display: none;
  }

  #eye-prompt {
    display: block;
    padding-top: 0.35rem;
    color: #173f35;
    font-size: 0.92rem;
  }

  .journey-section {
    max-width: 820px;
    margin: 3rem auto 4rem;
    padding: 0 1.25rem;
  }

  .journey-section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
  }

  .activity-summary-grid {
    display: grid;
    grid-template-columns:
      repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.5rem;
  }

  .activity-stat {
    min-height: 110px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1rem 1.1rem;
    border: 1px solid #d9e6e0;
    border-radius: 18px;
    background: #f7faf8;
  }

  .activity-stat strong {
    display: block;
    margin-bottom: 0.2rem;
    color: #173f35;
    font-size: clamp(
      1.9rem,
      4vw,
      2.7rem
    );
    line-height: 1;
  }

  .activity-stat span {
    color: #416257;
    font-size: 0.92rem;
  }

  .activity-history-panel {
    padding: 1.15rem;
    border: 1px solid #d9e6e0;
    border-radius: 18px;
    background: #ffffff;
  }

  .activity-panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.8rem;
  }

  .activity-panel-heading h3 {
    margin: 0;
  }

  .activity-count {
    color: #5e756d;
    font-size: 0.9rem;
  }

  .activity-context-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 0 0 1rem;
  }

  .activity-filter {
    appearance: none;
    min-height: 38px;
    padding: 0.45rem 0.85rem;
    border: 1px solid #cbdad4;
    border-radius: 999px;
    background: #ffffff;
    color: #416257;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
  }

  .activity-filter span {
    margin-left: 0.3rem;
    color: inherit;
    font-size: 0.85rem;
  }

  .activity-filter:hover {
    background: #f3f8f5;
    border-color: #a9c4b9;
  }

  .activity-filter.is-active {
    background: #e8f3ee;
    border-color: #8fb5a6;
    color: #173f35;
  }

  .activity-filter:focus-visible {
    outline: 2px solid #286c5e;
    outline-offset: 3px;
  }

  .favourite-place-legend {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0 0 0.7rem;
    color: #61766f;
    font-size: 0.82rem;
  }

  .favourite-place-legend span {
    color: #c94a5a;
    font-size: 0.95rem;
  }

  .activity-history-list {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .activity-history-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.9rem 0;
    border-top: 1px solid #e6eeea;
  }

  .activity-history-item:first-child {
    border-top: 0;
  }

  .activity-history-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: #eef6f2;
    color: #173f35;
    font-weight: 700;
  }

  .activity-history-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
  }

  .activity-history-content strong {
    color: #173f35;
    font-size: 0.98rem;
  }

  .activity-history-content span {
    color: #61766f;
    font-size: 0.88rem;
  }

  .activity-history-place {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.25rem;
    color: #416257;
    font-size: 0.88rem;
  }

  .favourite-place-button {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #c94a5a;
    font: inherit;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
  }

  .favourite-place-button:hover {
    background: #fff3f4;
  }

  .favourite-place-button:focus-visible {
    outline: 2px solid #286c5e;
    outline-offset: 2px;
  }

  .activity-empty-state {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 80px;
    color: #61766f;
  }

  .activity-empty-state p {
    margin: 0;
  }

  .activity-empty-state[hidden] {
    display: none;
  }

  .activity-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: #eef6f2;
  }

  .activity-history-expand {
    display: flex;
    justify-content: center;
    padding-top: 0.5rem;
    border-top: 1px solid #e6eeea;
  }

  .activity-view-all {
    appearance: none;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.05rem;
    min-width: 180px;
    min-height: 50px;
    padding: 0.55rem 1rem;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #286c5e;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
  }

  .activity-view-all:hover {
    background: #f3f8f5;
    color: #173f35;
  }

  .activity-view-all:focus-visible {
    outline: 2px solid #286c5e;
    outline-offset: 3px;
  }

  #activity-view-all-icon {
    line-height: 0.8;
    font-size: 1rem;
    letter-spacing: -0.2rem;
  }

  .activity-view-all[hidden] {
    display: none;
  }

  .journey-export {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0.5rem 1rem;
    margin-top: 1.5rem;
    padding: 1.15rem;
    border: 1px solid #d9e6e0;
    border-radius: 18px;
    background: #f7faf8;
  }

  .journey-export .home-eyebrow {
    margin-bottom: 0.25rem;
  }

  .journey-export h3 {
    margin: 0;
    color: #173f35;
  }

  #export-journey-pdf {
    appearance: none;
    min-height: 44px;
    padding: 0.7rem 1rem;
    border: 1px solid #286c5e;
    border-radius: 999px;
    background: #286c5e;
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
  }

  #export-journey-pdf:hover {
    background: #173f35;
    border-color: #173f35;
  }

  #export-journey-pdf:focus-visible {
    outline: 2px solid #286c5e;
    outline-offset: 3px;
  }

  .journey-pdf-status {
    grid-column: 1 / -1;
    min-height: 1.2rem;
    margin: 0;
    color: #61766f;
    font-size: 0.86rem;
  }

  .journey-layout {
    display: grid;
    grid-template-columns: 190px minmax(0, 820px);
    justify-content: center;
    gap: 2rem;
    max-width: 1060px;
    margin: 0 auto 4rem;
    padding: 0 1.25rem;
  }

  .journey-section-nav {
    position: sticky;
    top: 1.5rem;
    align-self: start;
    max-height: calc(100vh - 3rem);
    padding: 1rem 0;
  }

  .journey-section-nav-title {
    margin: 0 0 0.7rem;
    color: #173f35;
    font-size: 0.9rem;
    font-weight: 800;
  }

  .journey-section-nav nav {
    display: grid;
    gap: 0.3rem;
  }

  .journey-section-nav a {
    display: block;
    padding: 0.6rem 0.75rem;
    border-left: 3px solid transparent;
    border-radius: 0 10px 10px 0;
    color: #61766f;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 700;
  }

  .journey-section-nav a:hover,
  .journey-section-nav a:focus-visible {
    color: #173f35;
    background: #f3f8f5;
  }

  .journey-section-nav a.is-active,
  .journey-section-nav a[aria-current="location"] {
    border-left-color: #286c5e;
    background: #e8f3ee;
    color: #173f35;
  }

  .journey-section-nav a:focus-visible {
    outline: 2px solid #286c5e;
    outline-offset: 2px;
  }

  .journey-content {
    min-width: 0;
  }

  .journey-content #study-plan {
    max-width: none;
    margin: 0 0 4rem;
    padding: 0;
  }

  .journey-content .journey-section {
    max-width: none;
    margin: 0 0 4rem;
    padding: 0;
  }

  .journey-anchor-section {
    scroll-margin-top: 1.5rem;
  }

  .journey-progress {
    padding: 1.15rem;
    border: 1px solid #d9e6e0;
    border-radius: 18px;
    background: #ffffff;
  }

  .journey-progress h2 {
    margin-bottom: 0.85rem;
    color: #173f35;
  }

  .journey-improvement-feedback {
    margin: 0 0 1.15rem;
    color: #416257;
    font-size: 0.96rem;
  }

  .journey-improvement-feedback strong {
    color: #173f35;
  }

  .journey-achievements {
    padding-top: 1rem;
    border-top: 1px solid #e6eeea;
  }

  .journey-achievements h3 {
    margin: 0 0 0.75rem;
    color: #173f35;
    font-size: 0.95rem;
  }

  .journey-achievement-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
  }

  .journey-achievement {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 34px;
    padding: 0.4rem 0.7rem;
    border: 1px solid #cbdad4;
    border-radius: 999px;
    background: #f7faf8;
    color: #244e43;
    font-size: 0.86rem;
    font-weight: 700;
  }

  .journey-achievement-icon {
    color: #286c5e;
  }

  .journey-achievement.is-favourite .journey-achievement-icon {
    color: #c94a5a;
  }

  .journey-achievement-empty {
    margin: 0;
    color: #61766f;
    font-size: 0.88rem;
  }

  @media (max-width: 820px) {
    .journey-layout {
      display: block;
      max-width: 820px;
    }

    .journey-section-nav {
      position: sticky;
      top: 0;
      z-index: 20;
      max-height: none;
      margin: 0 -1.25rem 1.5rem;
      padding: 0.6rem 1.25rem;
      background: rgba(255, 255, 255, 0.96);
      border-top: 1px solid #e6eeea;
      border-bottom: 1px solid #e6eeea;
      backdrop-filter: blur(10px);
    }

    .journey-section-nav-title {
      display: none;
    }

    .journey-section-nav nav {
      display: flex;
      gap: 0.4rem;
      overflow-x: auto;
      scrollbar-width: none;
    }

    .journey-section-nav nav::-webkit-scrollbar {
      display: none;
    }

    .journey-section-nav a {
      flex: 0 0 auto;
      padding: 0.5rem 0.7rem;
      border-left: 0;
      border-bottom: 2px solid transparent;
      border-radius: 9px 9px 0 0;
      white-space: nowrap;
      font-size: 0.82rem;
    }

    .journey-section-nav a.is-active,
    .journey-section-nav a[aria-current="location"] {
      border-left-color: transparent;
      border-bottom-color: #286c5e;
    }

    .journey-anchor-section {
      scroll-margin-top: 4.6rem;
    }
  }

  @media (max-width: 640px) {
    .plan-section-heading h2 {
      padding-right: 0;
    }

    .plan-status {
      position: static;
      margin-top: 0.55rem;
    }

    .plan-overview {
      grid-template-columns: 1fr;
    }

    .plan-overview-item {
      padding: 0.65rem 0;
      border-left: 0;
      border-top: 1px solid #e6eeea;
    }

    .plan-overview-item:first-child {
      border-top: 0;
    }

    .plan-actions {
      flex-wrap: wrap;
    }

    .plan-form {
      grid-template-columns: 1fr;
      padding: 1rem;
    }

    .plan-form select,
    .plan-form input[type="number"] {
      width: 100%;
      min-width: 0;
    }

    .plan-form span {
      display: inline-block;
      margin-top: 0.4rem;
      margin-left: 0;
    }

    .activity-summary-grid {
      grid-template-columns: 1fr;
    }

    .activity-stat {
      min-height: 88px;
    }

    .activity-context-filters {
      gap: 0.45rem;
    }

    .activity-filter {
      min-height: 36px;
      padding: 0.4rem 0.75rem;
      font-size: 0.86rem;
    }

    .activity-view-all {
      width: 100%;
    }

    .journey-export {
      grid-template-columns: 1fr;
    }

    #export-journey-pdf {
      justify-self: start;
    }
  }
