    :root {
      --black: #050b0c;
      --charcoal: #081011;
      --green: #006b4e;
      --green-2: #005d48;
      --teal: #0b7a62;
      --lime: #dfff13;
      --warm: #f7f1e7;
      --muted: rgba(247, 241, 231, 0.68);
      --danger: #d92d3f;
    }

    * {
      box-sizing: border-box;
      -webkit-tap-highlight-color: transparent;
    }

    html,
    body {
      margin: 0;
      min-height: 100%;
      background: #0b1011;
      color: var(--warm);
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    }

    body {
      display: grid;
      place-items: center;
      padding: 18px;
      min-height: 100vh;
    }

    .app-shell {
      position: relative;
      width: min(390px, calc(100vw - 48px), 50vh);
      aspect-ratio: 941 / 1672;
      background: var(--black);
      overflow: clip;
      box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
      isolation: isolate;
    }

    .screen {
      position: absolute;
      inset: 0;
      display: none;
      background: var(--black);
      overflow: hidden;
    }

    .screen:not(#home-screen) {
      overflow-y: auto;
      overscroll-behavior: contain;
      scrollbar-width: none;
    }

    .screen:not(#home-screen)::-webkit-scrollbar {
      display: none;
    }

    .screen.active {
      display: block;
    }

    .home-image {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
      user-select: none;
      pointer-events: none;
    }

    .hotspot {
      position: absolute;
      border: 0;
      padding: 0;
      background: transparent;
      cursor: pointer;
      border-radius: 999px;
    }

    .hotspot:focus-visible {
      outline: 3px solid rgba(223, 255, 19, 0.9);
      outline-offset: 4px;
    }

    .hotspot.profile {
      left: 3.1%;
      top: 3.25%;
      width: 48.1%;
      height: 12.8%;
      border-radius: 24px;
    }

    .hotspot.profile::before {
      content: "";
      position: absolute;
      left: 59%;
      top: 25%;
      width: 38%;
      height: 28%;
      border-radius: 0;
      background: rgb(1 49 41);
    }

    .home-profile-status {
      position: absolute;
      left: 45%;
      top: 56%;
      width: 47%;
      height: 24%;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 5px;
      border-radius: 999px;
      background: var(--lime);
      color: var(--black);
      box-shadow: 0 0 0 1px rgba(5, 11, 12, 0.18);
      font-size: 10px;
      font-weight: 800;
      line-height: 1;
      white-space: nowrap;
    }

    .home-profile-status::before {
      content: "";
      width: 6px;
      height: 6px;
      flex: 0 0 6px;
      border-radius: 50%;
      background: var(--black);
    }

    .hotspot.data {
      left: 5.3%;
      top: 86.8%;
      width: 18.7%;
      height: 10.7%;
    }

    .hotspot.train {
      left: 26.1%;
      top: 86.8%;
      width: 18.7%;
      height: 10.7%;
    }

    .hotspot.start {
      left: 48.8%;
      top: 66.5%;
      width: 51.2%;
      height: 33.5%;
      border-radius: 100% 0 0 0;
    }

    .page {
      min-height: 100%;
      padding: max(18px, env(safe-area-inset-top)) 22px max(22px, env(safe-area-inset-bottom));
      display: flex;
      flex-direction: column;
      gap: 14px;
    }

    .screen:not(#home-screen) .page {
      padding-bottom: max(24px, env(safe-area-inset-bottom));
    }

    .page::before {
      content: "";
      position: absolute;
      width: 360px;
      height: 360px;
      right: -210px;
      bottom: -120px;
      border-radius: 50%;
      background: var(--lime);
      z-index: -1;
    }

    .page::after {
      content: "";
      position: absolute;
      width: 440px;
      height: 440px;
      left: -190px;
      top: 255px;
      border-radius: 50%;
      background: var(--green);
      z-index: -2;
    }

    .topbar {
      position: sticky;
      top: 0;
      z-index: 50;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin: -6px -4px 0;
      padding: 6px 4px 8px;
      background: linear-gradient(180deg, rgba(5, 11, 12, 0.96) 0%, rgba(5, 11, 12, 0.78) 72%, rgba(5, 11, 12, 0) 100%);
      backdrop-filter: blur(10px);
    }

    .back {
      border: 1px solid rgba(247, 241, 231, 0.16);
      background: rgba(255, 255, 255, 0.06);
      color: var(--warm);
      border-radius: 999px;
      min-width: 38px;
      height: 36px;
      padding: 0 12px;
      font-size: 12px;
      font-weight: 900;
      cursor: pointer;
    }

    .screen-title {
      margin: 0;
      font-size: clamp(28px, 8.8vw, 38px);
      line-height: 0.96;
      letter-spacing: -0.055em;
      color: var(--lime);
      text-transform: uppercase;
    }

    .subtitle {
      margin: 6px 0 0;
      color: var(--muted);
      font-weight: 700;
      font-size: 13px;
    }

    #data-screen {
      --data-bg: #050907;
      --data-surface: #111814;
      --data-surface-raised: #18211c;
      --data-primary: #10392b;
      --data-primary-raised: #174a38;
      --data-accent: #c8f135;
      --data-text: #f4f7f2;
      --data-muted: #a9b4ac;
      --data-border: rgba(200, 241, 53, 0.28);
      background: var(--data-bg);
    }

    #data-screen .page {
      gap: 12px;
      background: var(--data-bg);
    }

    #data-screen .page::before,
    #data-screen .page::after {
      display: none;
    }

    #data-screen .topbar {
      background: linear-gradient(180deg, rgba(5, 9, 7, 0.98) 0%, rgba(5, 9, 7, 0.86) 72%, rgba(5, 9, 7, 0) 100%);
    }

    #data-screen .back {
      border-color: var(--data-border);
      background: var(--data-surface);
      color: var(--data-text);
    }

    .data-heading .screen-title {
      white-space: nowrap;
      font-size: clamp(30px, 8.4vw, 40px);
      letter-spacing: -0.055em;
      color: var(--data-accent);
      text-align: center;
    }

    .card {
      background: rgba(0, 93, 72, 0.92);
      border: 1px solid rgba(223, 255, 19, 0.18);
      border-radius: 22px;
      padding: 16px;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    }

    .hero-metric {
      margin-top: 4px;
      min-height: 86px;
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      align-items: center;
      gap: 0;
      padding: 14px 16px;
      border-radius: 20px;
      background: var(--lime);
      color: var(--black);
    }

    .result-overview {
      display: grid;
      gap: 10px;
    }

    .result-content {
      flex: 1;
      min-height: 0;
      display: flex;
      flex-direction: column;
      justify-content: center;
      gap: 9px;
      padding-bottom: 8px;
    }

    .result-heading {
      text-align: center;
    }

    .result-heading .screen-title {
      color: var(--lime);
    }

    .result-hero-stat {
      min-width: 0;
      display: flex;
      flex-direction: column;
      align-items: center;
      text-align: center;
    }

    .result-hero-stat + .result-hero-stat {
      border-left: 1px solid rgba(5, 11, 12, 0.2);
      text-align: center;
    }

    .result-hero-time {
      font-size: 32px;
      letter-spacing: 0;
      font-variant-numeric: tabular-nums;
    }

    .result-hero-hits {
      font-size: 42px;
      letter-spacing: -0.04em;
      font-variant-numeric: tabular-nums;
    }

    .flow-note {
      display: inline-flex;
      width: fit-content;
      align-items: center;
      gap: 8px;
      border-radius: 999px;
      padding: 6px 10px;
      background: rgba(223, 255, 19, 0.12);
      color: var(--lime);
      font-size: 10px;
      font-weight: 950;
      letter-spacing: 0.02em;
      text-transform: uppercase;
    }

    .metric-number {
      font-size: 46px;
      line-height: 0.9;
      letter-spacing: -0.08em;
      font-weight: 950;
    }

    .metric-label {
      margin-top: 5px;
      font-size: 12px;
      font-weight: 900;
      opacity: 0.78;
    }

    .result-details-inline {
      width: 100%;
      display: block;
      color: var(--warm);
      text-align: left;
    }

    .result-details-panel {
      margin-top: 8px;
      border: 1px solid rgba(223, 255, 19, 0.2);
      border-radius: 18px;
      padding: 14px;
      background: rgba(255, 255, 255, 0.055);
    }

    .result-details-panel[hidden] {
      display: none;
    }

    .result-details-heading {
      width: 100%;
      min-height: 58px;
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 12px;
      border: 1px solid rgba(223, 255, 19, 0.2);
      border-radius: 18px;
      padding: 12px 14px;
      background: rgba(255, 255, 255, 0.055);
      color: var(--warm);
      font: inherit;
      text-align: left;
      cursor: pointer;
      touch-action: manipulation;
      transition: border-color 180ms ease, background 180ms ease;
    }

    .result-details-heading:hover,
    .result-details-heading:focus-visible {
      border-color: rgba(223, 255, 19, 0.72);
      background: rgba(223, 255, 19, 0.075);
      outline: 2px solid rgba(223, 255, 19, 0.18);
      outline-offset: 2px;
    }

    .result-details-heading h2 {
      margin: 0;
      color: var(--warm);
      font-size: 16px;
      line-height: 1.2;
      font-weight: 950;
    }

    .result-details-heading span {
      color: var(--lime);
      font-size: 9px;
      line-height: 1.2;
      font-weight: 850;
      text-align: right;
    }

    .result-details-heading > span {
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 3px;
    }

    #result-trend-toggle-label {
      color: rgba(247, 241, 231, 0.7);
    }

    .result-ai-card {
      width: 100%;
      min-height: 84px;
      display: grid;
      grid-template-columns: 38px minmax(0, 1fr) auto;
      align-items: center;
      gap: 10px;
      border: 1px solid rgba(223, 255, 19, 0.34);
      border-radius: 18px;
      padding: 11px 13px;
      background: rgba(223, 255, 19, 0.085);
      color: var(--warm);
      font: inherit;
      text-align: left;
      cursor: pointer;
      touch-action: manipulation;
      transition: border-color 180ms ease, background 180ms ease;
    }

    .result-ai-card:hover,
    .result-ai-card:focus-visible {
      border-color: rgba(223, 255, 19, 0.78);
      background: rgba(223, 255, 19, 0.13);
      outline: none;
    }

    .result-ai-icon {
      width: 38px;
      height: 38px;
      display: grid;
      place-items: center;
      border-radius: 11px;
      background: var(--lime);
      color: var(--black);
    }

    .result-ai-icon svg {
      width: 21px;
      height: 21px;
    }

    .result-ai-copy {
      min-width: 0;
    }

    .result-ai-copy strong,
    .result-ai-copy span {
      display: block;
    }

    .result-ai-copy strong {
      color: var(--lime);
      font-size: 13px;
      line-height: 1.2;
      font-weight: 950;
    }

    .result-ai-copy span {
      margin-top: 4px;
      overflow: hidden;
      color: rgba(247, 241, 231, 0.74);
      font-size: 9px;
      line-height: 1.35;
      font-weight: 750;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .result-ai-chevron {
      color: var(--lime);
      font-size: 22px;
      line-height: 1;
      font-weight: 800;
    }

    .result-trend-head {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 12px;
    }

    .result-trend-head strong {
      font-size: 13px;
      font-weight: 950;
    }

    .result-trend-head span {
      flex: 0 0 auto;
      color: var(--lime);
      font-size: 10px;
      font-weight: 900;
    }

    .result-trend-bars {
      height: 48px;
      display: grid;
      grid-template-columns: repeat(8, minmax(0, 1fr));
      align-items: end;
      gap: 5px;
      margin-top: 8px;
      border-bottom: 1px solid rgba(247, 241, 231, 0.14);
    }

    .result-trend-bars-expanded {
      height: 76px;
      margin: 2px 0 14px;
      padding: 8px 8px 0;
      border: 1px solid rgba(247, 241, 231, 0.1);
      border-radius: 12px;
      background: rgba(255, 255, 255, 0.035);
    }

    .result-trend-bar {
      min-height: 10px;
      height: var(--bar-height, 50%);
      border-radius: 4px 4px 1px 1px;
      background: var(--lime);
    }

    .result-trend-bar.adjusting {
      background: #5ee1b7;
    }

    .result-trend-bar.recovery {
      background: rgba(247, 241, 231, 0.42);
    }

    .result-trend-summary {
      display: block;
      margin-top: 6px;
      color: var(--muted);
      font-size: 9px;
      line-height: 1.2;
      font-weight: 800;
    }

    .result-ai-dialog {
      position: absolute;
      inset: 0;
      z-index: 90;
      display: grid;
      align-items: end;
      background: rgba(0, 0, 0, 0.64);
    }

    .result-ai-dialog[hidden] {
      display: none;
    }

    .result-ai-sheet {
      width: 100%;
      max-height: 82%;
      overflow-y: auto;
      padding: 18px 18px max(22px, env(safe-area-inset-bottom));
      border-top: 1px solid rgba(223, 255, 19, 0.28);
      border-radius: 20px 20px 0 0;
      background: #101715;
      color: var(--warm);
    }

    .result-ai-sheet {
      height: min(82%, 470px);
      display: grid;
      grid-template-rows: auto auto minmax(0, 1fr) auto auto;
      overflow: hidden;
    }

    .result-trend-detail-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 14px;
    }

    .result-trend-detail-head h2 {
      margin: 0;
      color: var(--lime);
      font-size: 19px;
      line-height: 1.1;
      font-weight: 950;
    }

    .result-ai-close {
      width: 44px;
      height: 44px;
      flex: 0 0 auto;
      display: grid;
      place-items: center;
      border: 1px solid rgba(247, 241, 231, 0.18);
      border-radius: 50%;
      background: rgba(255, 255, 255, 0.055);
      color: var(--warm);
      cursor: pointer;
    }

    .result-ai-close svg {
      width: 20px;
      height: 20px;
    }

    .result-trend-close:focus-visible,
    .result-ai-close:focus-visible,
    .result-ai-send:focus-visible {
      outline: 2px solid var(--lime);
      outline-offset: 2px;
    }

    .result-detail-metrics {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 7px;
      margin-bottom: 13px;
    }

    .result-detail-metric {
      min-width: 0;
      padding: 9px 10px;
      border: 1px solid rgba(247, 241, 231, 0.1);
      border-radius: 12px;
      background: rgba(255, 255, 255, 0.045);
    }

    .result-detail-metric strong,
    .result-detail-metric span {
      display: block;
    }

    .result-detail-metric strong {
      color: var(--lime);
      font-size: 15px;
      line-height: 1;
      font-weight: 950;
      font-variant-numeric: tabular-nums;
    }

    .result-detail-metric span {
      margin-top: 5px;
      color: var(--muted);
      font-size: 8px;
      font-weight: 800;
    }

    .result-trend-detail-chart {
      height: 72px;
      display: grid;
      grid-template-columns: repeat(8, minmax(0, 1fr));
      align-items: end;
      gap: 6px;
      margin: 2px 0 14px;
      padding: 8px 8px 0;
      border: 1px solid rgba(247, 241, 231, 0.1);
      border-radius: 12px;
      background: rgba(255, 255, 255, 0.035);
    }

    .result-trend-detail-bar {
      min-height: 10px;
      height: var(--bar-height, 50%);
      border-radius: 4px 4px 1px 1px;
      background: var(--lime);
    }

    .result-trend-detail-bar.adjusting {
      background: #5ee1b7;
    }

    .result-trend-detail-bar.recovery {
      background: rgba(247, 241, 231, 0.42);
    }

    .result-ai-context {
      margin: -7px 0 10px;
      color: var(--muted);
      font-size: 10px;
      line-height: 1.4;
      font-weight: 750;
    }

    .result-ai-conversation {
      min-height: 0;
      display: flex;
      flex-direction: column;
      gap: 9px;
      overflow-y: auto;
      padding: 4px 2px 12px;
      scrollbar-width: none;
    }

    .result-ai-message {
      max-width: 88%;
      padding: 10px 11px;
      border-radius: 13px;
      font-size: 11px;
      line-height: 1.5;
      font-weight: 720;
      white-space: pre-wrap;
    }

    .result-ai-message.assistant {
      align-self: flex-start;
      border: 1px solid rgba(223, 255, 19, 0.2);
      background: rgba(223, 255, 19, 0.08);
      color: rgba(247, 241, 231, 0.9);
    }

    .result-ai-message.user {
      align-self: flex-end;
      background: var(--lime);
      color: var(--black);
    }

    .result-ai-form {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 44px;
      align-items: end;
      gap: 8px;
      padding-top: 10px;
      border-top: 1px solid rgba(247, 241, 231, 0.1);
    }

    .result-ai-form textarea {
      width: 100%;
      min-height: 44px;
      max-height: 88px;
      resize: none;
      border: 1px solid rgba(247, 241, 231, 0.16);
      border-radius: 13px;
      padding: 11px 12px;
      background: rgba(255, 255, 255, 0.055);
      color: var(--warm);
      font: inherit;
      font-size: 11px;
      line-height: 1.4;
    }

    .result-ai-form textarea:focus {
      border-color: var(--lime);
      outline: 2px solid rgba(223, 255, 19, 0.16);
    }

    .result-ai-send {
      width: 44px;
      height: 44px;
      display: grid;
      place-items: center;
      border: 0;
      border-radius: 13px;
      background: var(--lime);
      color: var(--black);
      cursor: pointer;
    }

    .result-ai-send:disabled {
      cursor: wait;
      opacity: 0.5;
    }

    .result-ai-send svg {
      width: 19px;
      height: 19px;
    }

    .result-ai-status {
      min-height: 15px;
      margin-top: 5px;
      color: rgba(247, 241, 231, 0.48);
      font-size: 8px;
      font-weight: 700;
    }

    .result-trend-detail-summary {
      margin: 0 0 12px;
      color: var(--muted);
      font-size: 11px;
      font-weight: 750;
    }

    .result-trend-detail-list {
      border-top: 1px solid rgba(247, 241, 231, 0.1);
    }

    .result-trend-detail-row {
      min-height: 54px;
      display: grid;
      grid-template-columns: 72px minmax(0, 1fr) auto;
      align-items: center;
      gap: 10px;
      border-bottom: 1px solid rgba(247, 241, 231, 0.1);
    }

    .result-trend-detail-row time,
    .result-trend-detail-row strong,
    .result-trend-detail-row span {
      display: block;
    }

    .result-trend-detail-row time {
      color: var(--lime);
      font-size: 11px;
      font-variant-numeric: tabular-nums;
      font-weight: 900;
    }

    .result-trend-detail-row strong {
      font-size: 12px;
      font-weight: 900;
    }

    .result-trend-detail-row span {
      margin-top: 3px;
      color: var(--muted);
      font-size: 9px;
      font-weight: 750;
    }

    .result-trend-detail-value {
      color: var(--warm);
      font-size: 12px;
      font-variant-numeric: tabular-nums;
      font-weight: 900;
      white-space: nowrap;
    }

    #result-screen > .page {
      gap: 0;
      overflow-y: auto;
      padding-bottom: max(14px, env(safe-area-inset-bottom));
    }

    #result-screen .result-content {
      flex: 0 0 auto;
      min-height: auto;
      justify-content: flex-start;
    }

    #result-screen .primary-action {
      margin-top: 0;
      min-height: 50px;
      border-radius: 20px;
      font-size: 19px;
    }

    .grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
    }

    .choice-block {
      display: grid;
      gap: 9px;
    }

    .choice-title {
      margin: 0;
      color: var(--warm);
      font-size: 15px;
      font-weight: 950;
      letter-spacing: -0.03em;
    }

    .choice-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }

    .choice {
      border: 1px solid rgba(255, 255, 255, 0.12);
      border-radius: 18px;
      min-height: 76px;
      padding: 12px;
      text-align: left;
      background: rgba(255, 255, 255, 0.06);
      color: var(--warm);
      cursor: pointer;
    }

    .choice strong {
      display: block;
      font-size: 15px;
      font-weight: 950;
      letter-spacing: -0.035em;
    }

    .choice span {
      display: block;
      margin-top: 6px;
      color: var(--muted);
      font-size: 11px;
      font-weight: 800;
      line-height: 1.35;
    }

    .choice.selected {
      background: var(--lime);
      border-color: var(--black);
      color: var(--black);
      box-shadow: 0 0 0 3px rgba(223, 255, 19, 0.16);
    }

    .choice.selected span {
      color: rgba(5, 11, 12, 0.66);
    }

    .training-page {
      position: absolute;
      inset: 0;
      height: auto;
      min-height: 0;
      overflow: hidden;
      gap: 0;
      padding-top: max(20px, env(safe-area-inset-top));
      padding-bottom: max(12px, env(safe-area-inset-bottom));
      padding-left: 22px;
      padding-right: 22px;
    }

    .training-page::before {
      width: 230px;
      height: 230px;
      right: -150px;
      bottom: -110px;
      opacity: 0.96;
    }

    .training-page::after {
      width: 280px;
      height: 280px;
      left: -210px;
      top: 105px;
      opacity: 0.35;
    }

    .training-header {
      margin-top: 18px;
    }

    .training-kicker {
      margin: 0 0 8px;
      color: var(--lime);
      font-size: 12px;
      font-weight: 950;
      letter-spacing: 0.16em;
      text-transform: uppercase;
    }

    .training-title {
      margin: 0;
      color: var(--warm);
      font-size: clamp(38px, 11vw, 52px);
      font-weight: 950;
      line-height: 0.98;
      letter-spacing: -0.065em;
    }

    .training-intro {
      margin: 8px 0 0;
      color: var(--muted);
      font-size: 14px;
      font-weight: 750;
      line-height: 1.45;
    }

    .mode-grid {
      flex: 1;
      min-height: 0;
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      grid-template-rows: repeat(2, auto);
      align-content: center;
      gap: 12px;
      margin-top: 14px;
    }

    .mode-card {
      min-width: 0;
      min-height: 0;
      padding: 0;
      display: grid;
      grid-template-rows: auto auto;
      overflow: hidden;
      border: 2px solid rgba(247, 241, 231, 0.1);
      border-radius: 22px;
      background: #0d1817;
      color: var(--warm);
      text-align: left;
      cursor: pointer;
      transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
    }

    .mode-card:hover,
    .mode-card:focus-visible {
      transform: translateY(-2px);
      border-color: rgba(223, 255, 19, 0.7);
      outline: none;
    }

    .mode-card.selected {
      transform: translateY(-2px) scale(0.985);
      border-color: var(--lime);
      box-shadow: 0 0 0 4px rgba(223, 255, 19, 0.12);
    }

    .mode-card img {
      width: 100%;
      height: auto;
      aspect-ratio: 3 / 2;
      min-height: 0;
      display: block;
      object-fit: cover;
      object-position: center;
    }

    .mode-label {
      min-height: 48px;
      padding: 8px 11px 9px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      border-top: 1px solid rgba(247, 241, 231, 0.08);
      background: #0c1615;
    }

    .mode-label strong {
      font-size: 16px;
      font-weight: 950;
      letter-spacing: -0.035em;
    }

    .mode-label span {
      color: var(--lime);
      font-size: 11px;
      font-weight: 950;
      letter-spacing: 0.05em;
      text-transform: uppercase;
    }

    .step-progress {
      min-height: 36px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 14px;
    }

    .confirm-mode {
      width: 100%;
      min-height: 50px;
      margin-top: 10px;
      border: 0;
      border-radius: 18px;
      background: var(--lime);
      color: var(--black);
      font-size: 17px;
      font-weight: 950;
      letter-spacing: -0.025em;
      cursor: pointer;
      transition: transform 160ms ease, opacity 160ms ease;
    }

    .confirm-mode:hover:not(:disabled),
    .confirm-mode:focus-visible:not(:disabled) {
      transform: translateY(-2px);
      outline: 3px solid rgba(223, 255, 19, 0.18);
      outline-offset: 3px;
    }

    .confirm-mode:disabled {
      cursor: not-allowed;
      opacity: 0.28;
    }

    .progress-dot {
      width: 22px;
      height: 22px;
      display: grid;
      place-items: center;
      border: 2px solid rgba(247, 241, 231, 0.38);
      border-radius: 50%;
      color: transparent;
      font-size: 14px;
      font-weight: 950;
      line-height: 1;
      transition: width 180ms ease, background 180ms ease, border-color 180ms ease, color 180ms ease;
    }

    .progress-dot.current {
      width: 22px;
      border-color: var(--lime);
      background: rgba(223, 255, 19, 0.12);
    }

    .progress-dot.done {
      width: 22px;
      border-color: var(--lime);
      background: var(--lime);
      color: var(--black);
    }

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

    .goal-card {
      min-height: 150px;
      padding: 18px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      border: 2px solid rgba(247, 241, 231, 0.1);
      border-radius: 22px;
      background: rgba(13, 24, 23, 0.96);
      color: var(--warm);
      text-align: left;
      cursor: pointer;
      transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
    }

    .goal-card:hover,
    .goal-card:focus-visible {
      transform: translateY(-2px);
      border-color: rgba(223, 255, 19, 0.7);
      outline: none;
    }

    .goal-card.selected {
      border-color: var(--lime);
      background: var(--lime);
      color: var(--black);
    }

    .goal-index {
      color: var(--lime);
      font-size: 13px;
      font-weight: 950;
      letter-spacing: 0.08em;
    }

    .goal-card.selected .goal-index {
      color: var(--black);
    }

    .goal-card strong {
      display: block;
      font-size: 21px;
      font-weight: 950;
      letter-spacing: -0.045em;
    }

    .goal-card small {
      display: block;
      margin-top: 7px;
      color: var(--muted);
      font-size: 12px;
      font-weight: 750;
      line-height: 1.35;
    }

    .goal-card.selected small {
      color: rgba(5, 11, 12, 0.64);
    }

    #train-goal-screen {
      overflow-y: auto;
    }

    #train-goal-screen .training-page {
      position: relative;
      min-height: 100%;
      height: auto;
      overflow: visible;
    }

    .goal-list {
      display: grid;
      gap: 10px;
      margin-top: 22px;
    }

    .goal-item {
      display: grid;
    }

    .goal-item .goal-card {
      min-height: 78px;
      display: grid;
      grid-template-columns: 32px minmax(0, 1fr) auto;
      align-items: center;
      gap: 12px;
      padding: 14px 16px;
      border-radius: 20px;
      transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, border-radius 180ms ease;
    }

    .goal-item .goal-card:hover,
    .goal-item .goal-card:focus-visible {
      transform: translateY(-1px);
    }

    .goal-item.open .goal-card {
      border-radius: 20px 20px 12px 12px;
    }

    .goal-card .goal-radio {
      width: 22px;
      height: 22px;
      display: grid;
      place-items: center;
      border: 2px solid rgba(247, 241, 231, 0.38);
      border-radius: 50%;
    }

    .goal-card.selected .goal-radio {
      border-color: var(--black);
      background: var(--black);
      box-shadow: inset 0 0 0 5px var(--lime);
    }

    .goal-copy {
      min-width: 0;
    }

    .goal-copy strong,
    .goal-copy small {
      display: block;
    }

    .goal-copy strong {
      font-size: 17px;
      font-weight: 950;
      letter-spacing: -0.035em;
    }

    .goal-copy small {
      margin-top: 4px;
      overflow: hidden;
      color: var(--muted);
      font-size: 11px;
      font-weight: 750;
      line-height: 1.35;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .goal-card.selected .goal-copy small {
      color: rgba(5, 11, 12, 0.64);
    }

    .goal-chevron {
      color: var(--muted);
      font-size: 20px;
      line-height: 1;
      transform: rotate(0deg);
      transition: transform 180ms ease, color 180ms ease;
    }

    .goal-item.open .goal-chevron {
      color: var(--black);
      transform: rotate(90deg);
    }

    .goal-details-wrap {
      display: grid;
      grid-template-rows: 0fr;
      opacity: 0;
      visibility: hidden;
      transition: grid-template-rows 260ms ease, opacity 180ms ease, visibility 260ms ease;
    }

    .goal-item.open .goal-details-wrap {
      grid-template-rows: 1fr;
      opacity: 1;
      visibility: visible;
    }

    .goal-details-clip {
      min-height: 0;
      overflow: hidden;
    }

    .goal-details {
      margin-top: 8px;
      padding: 14px;
      border: 1px solid rgba(247, 241, 231, 0.12);
      border-radius: 16px;
      background: rgba(8, 16, 17, 0.96);
      box-shadow: inset 0 1px rgba(255, 255, 255, 0.04);
    }

    .detail-heading {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 10px;
      margin-bottom: 11px;
    }

    .detail-heading strong {
      font-size: 12px;
      font-weight: 900;
    }

    .detail-heading span {
      color: var(--muted);
      font-size: 10px;
      font-weight: 750;
    }

    .history-metrics {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      padding: 11px 0;
      border-top: 1px solid rgba(247, 241, 231, 0.1);
      border-bottom: 1px solid rgba(247, 241, 231, 0.1);
    }

    .history-metric {
      min-width: 0;
      padding: 0 7px;
      border-right: 1px solid rgba(247, 241, 231, 0.1);
    }

    .history-metric:first-child {
      padding-left: 0;
    }

    .history-metric:last-child {
      padding-right: 0;
      border-right: 0;
    }

    .history-metric strong,
    .history-metric span {
      display: block;
    }

    .history-metric strong {
      color: #cfeaab;
      font-size: 14px;
      line-height: 1.2;
      font-weight: 920;
      white-space: nowrap;
    }

    .history-metric span {
      margin-top: 4px;
      overflow: hidden;
      color: var(--muted);
      font-size: 9px;
      line-height: 1.3;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .ai-result {
      margin-top: 12px;
      padding: 10px 11px;
      border-left: 3px solid #7fa466;
      border-radius: 0 10px 10px 0;
      background: rgba(23, 39, 32, 0.9);
      color: rgba(247, 241, 231, 0.86);
      font-size: 10px;
      line-height: 1.4;
      font-weight: 720;
    }

    .custom-request {
      display: grid;
      gap: 7px;
      margin-top: 12px;
    }

    .custom-request label {
      color: var(--warm);
      font-size: 11px;
      font-weight: 850;
    }

    .custom-request textarea {
      width: 100%;
      min-height: 70px;
      resize: vertical;
      border: 1px solid rgba(247, 241, 231, 0.12);
      border-radius: 12px;
      padding: 10px;
      background: rgba(5, 11, 12, 0.92);
      color: var(--warm);
      font-size: 11px;
      line-height: 1.5;
    }

    .custom-request textarea::placeholder {
      color: rgba(247, 241, 231, 0.34);
    }

    .custom-request textarea:focus {
      border-color: rgba(223, 255, 19, 0.58);
      outline: 3px solid rgba(223, 255, 19, 0.1);
    }

    .confirm-goal {
      width: 100%;
      min-height: 50px;
      margin-top: 18px;
      border: 0;
      border-radius: 18px;
      background: var(--lime);
      color: var(--black);
      font-size: 16px;
      font-weight: 950;
      cursor: pointer;
      transition: transform 160ms ease, opacity 160ms ease;
    }

    .confirm-goal:hover:not(:disabled),
    .confirm-goal:focus-visible:not(:disabled) {
      transform: translateY(-2px);
      outline: 3px solid rgba(223, 255, 19, 0.18);
      outline-offset: 3px;
    }

    .confirm-goal:disabled {
      cursor: not-allowed;
      opacity: 0.28;
    }

    @media (prefers-reduced-motion: reduce) {
      .goal-item .goal-card,
      .goal-chevron,
      .goal-details-wrap,
      .confirm-goal {
        transition: none;
      }
    }

    #countdown-screen {
      overflow: hidden;
      background: var(--lime);
    }

    .countdown-page {
      height: 100%;
      min-height: 0;
      display: grid;
      place-items: center;
      overflow: hidden;
      background: var(--lime);
      color: var(--black);
      text-align: center;
    }

    .countdown-content {
      transform: translateY(-4vh);
    }

    .countdown-kicker {
      margin: 0 0 16px;
      color: rgba(5, 11, 12, 0.66);
      font-size: 12px;
      font-weight: 900;
    }

    .countdown-value {
      display: block;
      min-width: 1.1em;
      color: var(--black);
      font-size: clamp(118px, 40vw, 190px);
      font-variant-numeric: tabular-nums;
      font-weight: 950;
      line-height: 0.8;
    }

    .countdown-value.pulse {
      animation: countdown-pulse 720ms cubic-bezier(0.2, 0.8, 0.2, 1);
    }

    @keyframes countdown-pulse {
      from { opacity: 0.18; transform: scale(0.76); }
      to { opacity: 1; transform: scale(1); }
    }

    .timer-page {
      position: relative;
      isolation: isolate;
      height: 100%;
      min-height: 0;
      padding: max(16px, env(safe-area-inset-top)) 20px max(18px, env(safe-area-inset-bottom));
      gap: 0;
      overflow: clip;
      background: var(--black);
      color: var(--lime);
    }

    #timer-screen {
      overflow: clip;
    }

    .timer-page::before,
    .timer-page::after {
      content: none;
      display: none;
    }

    .timer-topbar {
      position: relative;
      top: auto;
      z-index: 2;
      margin: 0;
      padding: 0;
      background: none;
      backdrop-filter: none;
    }

    .timer-session-content {
      flex: 1;
      min-height: 0;
      display: flex;
      flex-direction: column;
      justify-content: center;
      gap: clamp(72px, 10vh, 96px);
      padding-bottom: 0;
    }

    .device-status {
      min-height: 34px;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 0 11px;
      border: 1px solid rgba(223, 255, 19, 0.22);
      border-radius: 999px;
      background: rgba(223, 255, 19, 0.08);
      color: var(--lime);
      font-size: 11px;
      font-weight: 900;
    }

    .device-status svg {
      width: 14px;
      height: 14px;
      color: var(--lime);
    }

    .device-status::after {
      content: "";
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: var(--lime);
      box-shadow: 0 0 0 4px rgba(223, 255, 19, 0.12);
    }

    .timer-main {
      flex: none;
      min-height: 0;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      padding: 0;
      text-align: center;
      transform: translateY(clamp(-64px, -8vh, -44px));
    }

    .timer-eyebrow {
      margin: 0 0 9px;
      color: rgba(223, 255, 19, 0.62);
      font-size: 11px;
      font-weight: 950;
      letter-spacing: 0.13em;
    }

    .timer-value {
      color: var(--lime);
      font-size: clamp(50px, 15vw, 70px);
      font-variant-numeric: tabular-nums;
      font-weight: 950;
      line-height: 0.88;
      letter-spacing: -0.06em;
    }

    .live-phase {
      min-height: 28px;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      margin-top: 18px;
      padding: 0 11px;
      border-radius: 999px;
      background: rgba(223, 255, 19, 0.1);
      color: rgba(223, 255, 19, 0.7);
      font-size: 11px;
      font-weight: 900;
    }

    .live-phase::before {
      content: "";
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: currentColor;
    }

    .live-phase.running {
      background: var(--lime);
      color: var(--black);
    }

    .live-phase.running::before {
      animation: live-pulse 1.2s ease-in-out infinite;
    }

    @keyframes live-pulse {
      50% { opacity: 0.35; transform: scale(0.72); }
    }

    .live-data {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      border-top: 1px solid rgba(223, 255, 19, 0.2);
      border-bottom: 1px solid rgba(223, 255, 19, 0.2);
    }

    .live-data-item {
      min-width: 0;
      padding: 16px 7px 15px;
      text-align: center;
    }

    .live-data-item + .live-data-item {
      border-left: 1px solid rgba(223, 255, 19, 0.18);
    }

    .live-data-value {
      display: block;
      color: var(--lime);
      font-size: 21px;
      line-height: 1;
      font-variant-numeric: tabular-nums;
      font-weight: 950;
      letter-spacing: -0.045em;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .live-data-label {
      display: block;
      margin-top: 7px;
      color: rgba(223, 255, 19, 0.64);
      font-size: 10px;
      line-height: 1.2;
      font-weight: 800;
    }

    .timer-controls {
      position: absolute;
      left: 20px;
      right: 20px;
      bottom: max(34px, calc(env(safe-area-inset-bottom) + 20px));
      z-index: 2;
      padding-top: 0;
    }

    .timer-control-row {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 16px;
    }

    .timer-control {
      position: relative;
      width: 64px;
      height: 64px;
      display: inline-grid;
      place-items: center;
      border: 1px solid rgba(223, 255, 19, 0.26);
      border-radius: 50%;
      background: rgba(223, 255, 19, 0.08);
      color: var(--lime);
      overflow: hidden;
      cursor: pointer;
      touch-action: manipulation;
      transition: background 180ms ease, border-color 180ms ease, color 180ms ease, opacity 180ms ease;
    }

    .timer-control svg {
      position: relative;
      z-index: 1;
      width: 27px;
      height: 27px;
      display: block;
    }

    .timer-control.start {
      border-color: var(--lime);
      background: var(--lime);
      color: var(--black);
    }

    .timer-control:disabled {
      cursor: not-allowed;
      border-color: rgba(223, 255, 19, 0.1);
      background: rgba(223, 255, 19, 0.04);
      color: rgba(223, 255, 19, 0.28);
    }

    .timer-control#pause-session::after {
      content: "";
      position: absolute;
      inset: 0;
      z-index: 0;
      border-radius: inherit;
      background: var(--danger);
      transform: scale(0);
      opacity: 0;
      pointer-events: none;
    }

    .timer-control#pause-session {
      display: inline-grid;
      place-items: center;
      overflow: visible;
    }

    .timer-control#pause-session svg {
      width: 27px;
      height: 27px;
    }

    .timer-hold-hint {
      position: absolute;
      top: calc(100% + 7px);
      left: 50%;
      z-index: 1;
      transform: translateX(-50%);
      font-size: 10px;
      font-weight: 900;
      line-height: 1;
      letter-spacing: 0;
      pointer-events: none;
      white-space: nowrap;
    }

    .timer-control#pause-session.holding {
      color: #fff;
      border-color: var(--danger);
    }

    .timer-control#pause-session.holding::after {
      opacity: 1;
      animation: hold-to-finish 700ms linear forwards;
    }

    @keyframes hold-to-finish {
      from { transform: scale(0); }
      to { transform: scale(1); }
    }

    .timer-control:focus-visible {
      outline: 3px solid var(--lime);
      outline-offset: 3px;
    }

    @media (prefers-reduced-motion: reduce) {
      .countdown-value.pulse,
      .live-phase.running::before {
        animation: none;
      }

      .timer-control#pause-session.holding::after {
        animation-duration: 700ms;
      }
    }

    .mini-card {
      min-height: 84px;
      border-radius: 18px;
      padding: 13px;
      background: rgba(255, 255, 255, 0.06);
      border: 1px solid rgba(255, 255, 255, 0.08);
    }

    .mini-value {
      color: var(--warm);
      font-size: 24px;
      font-weight: 950;
      letter-spacing: -0.055em;
      line-height: 1;
    }

    .mini-label {
      margin-top: 6px;
      color: var(--muted);
      font-size: 11px;
      font-weight: 800;
    }

    .section-label {
      margin: 2px 0 -6px;
      color: var(--muted);
      font-size: 10px;
      font-weight: 950;
      letter-spacing: 0.08em;
      text-transform: uppercase;
    }

    .chart-card {
      border-radius: 20px;
      padding: 14px;
      background: rgba(255, 255, 255, 0.06);
      border: 1px solid rgba(255, 255, 255, 0.08);
    }

    .chart-head {
      display: flex;
      justify-content: space-between;
      align-items: baseline;
      gap: 12px;
      margin-bottom: 10px;
    }

    .chart-head strong {
      font-size: 15px;
      font-weight: 950;
      letter-spacing: -0.03em;
    }

    .chart-head span {
      color: var(--lime);
      font-size: 12px;
      font-weight: 950;
    }

    .bars {
      height: 74px;
      display: grid;
      grid-template-columns: repeat(7, 1fr);
      align-items: end;
      gap: 7px;
    }

    .bar {
      border-radius: 999px 999px 6px 6px;
      background: linear-gradient(180deg, var(--lime), #8faa00);
      min-height: 20px;
    }

    .data-row {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 10px;
      align-items: center;
      padding: 12px 14px;
      border-radius: 16px;
      background: rgba(255, 255, 255, 0.055);
      border: 1px solid rgba(255, 255, 255, 0.075);
    }

    .data-row strong {
      font-size: 13px;
      font-weight: 950;
    }

    .data-row small {
      display: block;
      margin-top: 3px;
      color: var(--muted);
      font-size: 11px;
      font-weight: 750;
    }

    .data-row b {
      color: var(--lime);
      font-size: 16px;
      font-weight: 950;
    }

    .today-panel {
      min-width: 0;
      border-radius: 22px;
      padding: 12px;
      background: var(--data-bg);
      color: var(--data-accent);
      border: 1px solid var(--data-border);
    }

    .today-top {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 12px;
    }

    .today-kicker {
      font-size: 12px;
      font-weight: 950;
      letter-spacing: 0.08em;
      color: var(--data-accent);
    }

    .today-time {
      margin-top: 5px;
      font-size: 32px;
      line-height: 0.86;
      font-weight: 950;
      letter-spacing: 0;
      color: var(--data-accent);
      font-variant-numeric: tabular-nums;
      white-space: nowrap;
    }

    .today-tag {
      flex: 0 0 auto;
      border-radius: 999px;
      padding: 7px 10px;
      background: var(--black);
      color: var(--lime);
      font-size: 11px;
      font-weight: 950;
    }

    .today-main-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
      margin-top: 12px;
    }

    .today-main-grid .item {
      min-width: 0;
      border-radius: 16px;
      padding: 10px 7px;
      background: var(--data-bg);
      border: 1px solid var(--data-border);
    }

    .today-main-grid strong {
      display: block;
      font-size: 21px;
      line-height: 1;
      font-weight: 950;
      letter-spacing: -0.05em;
      color: var(--data-accent);
      font-variant-numeric: tabular-nums;
    }

    .today-main-grid span {
      display: block;
      margin-top: 6px;
      font-size: 11px;
      font-weight: 850;
      color: rgba(200, 241, 53, 0.76);
      white-space: normal;
    }

    .today-sub-grid {
      display: grid;
      grid-template-columns: 1fr;
      gap: 4px;
      margin-top: 6px;
    }

    .today-sub-grid .item {
      min-height: 36px;
      display: grid;
      grid-template-columns: 54px minmax(0, 1fr);
      align-items: center;
      gap: 8px;
      border-radius: 12px;
      padding: 6px 8px;
      background: var(--data-bg);
      color: var(--data-accent);
      border: 1px solid var(--data-border);
      text-align: left;
    }

    .today-sub-grid strong {
      display: block;
      color: var(--data-accent);
      font-size: 17px;
      line-height: 1;
      font-weight: 950;
      text-align: left;
      font-variant-numeric: tabular-nums;
    }

    .today-sub-grid span {
      display: block;
      margin-top: 0;
      color: rgba(200, 241, 53, 0.76);
      font-size: 10px;
      line-height: 1.3;
      font-weight: 800;
      white-space: normal;
    }

    .data-summary-grid {
      display: grid;
      grid-template-columns: minmax(0, 2.2fr) minmax(96px, 0.8fr);
      align-items: stretch;
      gap: 10px;
    }

    .calendar-card {
      width: 100%;
      border-radius: 22px;
      padding: 14px;
      background: var(--data-surface);
      border: 1px solid var(--data-border);
      color: inherit;
      font: inherit;
      text-align: left;
      cursor: pointer;
      touch-action: manipulation;
      transition: border-color 180ms ease, background 180ms ease;
    }

    .calendar-card:hover,
    .calendar-card:focus-visible,
    .calendar-card[aria-expanded="true"] {
      border-color: var(--data-accent);
      background: var(--data-surface-raised);
    }

    .calendar-card:focus-visible {
      outline: 3px solid rgba(200, 241, 53, 0.28);
      outline-offset: 3px;
    }

    .calendar-head {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 12px;
    }

    .calendar-head strong {
      font-size: 15px;
      font-weight: 950;
      letter-spacing: -0.03em;
      color: var(--data-text);
    }

    .calendar-head span {
      color: var(--data-accent);
      font-size: 12px;
      font-weight: 950;
    }

    .calendar-head-meta {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      flex: 0 0 auto;
    }

    .calendar-toggle-chevron {
      width: 15px;
      height: 15px;
      color: var(--data-accent);
      transition: transform 180ms ease;
    }

    .calendar-card[aria-expanded="true"] .calendar-toggle-chevron {
      transform: rotate(90deg);
    }

    .week {
      display: grid;
      grid-template-columns: repeat(7, minmax(0, 1fr));
      gap: 6px;
    }

    .day {
      min-width: 0;
      min-height: 60px;
      border-radius: 18px;
      padding: 8px 2px;
      text-align: center;
      background: var(--data-surface-raised);
      border: 1px solid var(--data-border);
    }

    .day b {
      display: block;
      font-size: 10px;
      color: var(--data-muted);
      white-space: nowrap;
    }

    .day i {
      display: block;
      width: 24px;
      height: 24px;
      margin: 7px auto 5px;
      border-radius: 50%;
      background: #3d4842;
      font-style: normal;
    }

    .day span {
      display: none;
      font-size: 9px;
      font-weight: 900;
      color: rgba(247, 241, 231, 0.62);
    }

    .day.done i {
      background: var(--data-accent);
    }

    .day.today {
      display: grid;
      place-items: center;
      background: var(--data-accent);
      color: var(--data-bg);
      border: 2px solid var(--data-accent);
    }

    .day.today b,
    .day.today span {
      color: var(--data-bg);
    }

    .day.today i {
      display: none;
    }

    .history-panel[hidden],
    .history-details[hidden] {
      display: none;
    }

    .history-panel {
      position: absolute;
      inset: 0;
      z-index: 30;
      min-width: 0;
      height: 100%;
      padding: max(16px, env(safe-area-inset-top)) var(--app-gutter) max(16px, env(safe-area-inset-bottom));
      border: 0;
      border-radius: 0;
      background: var(--data-bg);
      overflow-y: auto;
      overscroll-behavior: contain;
      animation: history-reveal 180ms ease-out both;
    }

    .history-panel-head {
      position: sticky;
      top: 0;
      z-index: 2;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      min-height: 56px;
      margin-bottom: 14px;
      padding-bottom: 12px;
      background: linear-gradient(180deg, var(--data-bg) 0%, var(--data-bg) 78%, rgba(5, 9, 7, 0) 100%);
    }

    .history-panel-heading {
      min-width: 0;
    }

    .history-panel-heading span,
    .history-panel-heading strong {
      display: block;
    }

    .history-panel-head strong {
      margin-top: 3px;
      color: var(--data-accent);
      font-size: 28px;
      line-height: 1;
      font-weight: 950;
    }

    .history-panel-head span {
      color: var(--data-muted);
      font-size: 10px;
      font-weight: 800;
    }

    .history-close {
      width: 44px;
      height: 44px;
      flex: 0 0 44px;
      display: grid;
      place-items: center;
      border: 1px solid var(--data-border);
      border-radius: 50%;
      background: var(--data-surface);
      color: var(--data-accent);
      cursor: pointer;
      touch-action: manipulation;
      transition: border-color 180ms ease, background 180ms ease;
    }

    .history-close:hover,
    .history-close:active {
      border-color: var(--data-accent);
      background: var(--data-surface-raised);
    }

    .history-close:focus-visible {
      outline: 3px solid rgba(200, 241, 53, 0.3);
      outline-offset: 3px;
    }

    .history-close svg {
      width: 20px;
      height: 20px;
    }

    .history-list {
      display: grid;
      gap: 7px;
    }

    .history-entry {
      overflow: hidden;
      border: 1px solid var(--data-border);
      border-radius: 16px;
      background: var(--data-bg);
    }

    .history-entry:has(.history-summary[aria-expanded="true"]) {
      border-color: rgba(200, 241, 53, 0.42);
    }

    .history-summary {
      width: 100%;
      min-height: 76px;
      display: grid;
      grid-template-columns: 46px minmax(0, 1fr) 18px;
      align-items: center;
      column-gap: 10px;
      border: 0;
      padding: 10px;
      background: transparent;
      color: var(--data-text);
      font: inherit;
      text-align: left;
      cursor: pointer;
      touch-action: manipulation;
    }

    .history-summary:hover,
    .history-summary:focus-visible {
      background: rgba(200, 241, 53, 0.06);
    }

    .history-summary:focus-visible {
      outline: 2px solid var(--data-accent);
      outline-offset: -2px;
    }

    .history-date {
      width: 46px;
      height: 46px;
      display: grid;
      place-content: center;
      border-radius: 13px;
      background: var(--data-surface-raised);
      text-align: center;
    }

    .history-date b,
    .history-date small,
    .history-copy strong,
    .history-copy small,
    .history-stat b,
    .history-stat small {
      display: block;
    }

    .history-date b {
      color: var(--data-accent);
      font-size: 11px;
      line-height: 1;
    }

    .history-date small {
      margin-top: 4px;
      color: var(--data-muted);
      font-size: 8px;
      font-weight: 800;
    }

    .history-copy {
      min-width: 0;
    }

    .history-copy strong {
      overflow: hidden;
      color: var(--data-text);
      font-size: 12px;
      font-weight: 950;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .history-copy small {
      margin-top: 4px;
      color: var(--data-muted);
      font-size: 9px;
      font-weight: 800;
    }

    .history-chevron {
      width: 17px;
      height: 17px;
      color: var(--data-muted);
      transition: transform 180ms ease, color 180ms ease;
    }

    .history-summary[aria-expanded="true"] .history-chevron {
      color: var(--data-accent);
      transform: rotate(90deg);
    }

    .history-summary-stats {
      grid-column: 2 / 4;
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      margin-top: 8px;
      padding-top: 8px;
      border-top: 1px solid rgba(43, 55, 48, 0.72);
    }

    .history-stat {
      min-width: 0;
      padding-inline: 7px;
    }

    .history-stat:first-child {
      padding-left: 0;
    }

    .history-stat + .history-stat {
      border-left: 1px solid rgba(43, 55, 48, 0.72);
    }

    .history-stat b {
      overflow: hidden;
      color: var(--data-accent);
      font-size: 11px;
      line-height: 1;
      font-variant-numeric: tabular-nums;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .history-stat small {
      margin-top: 4px;
      color: var(--data-muted);
      font-size: 8px;
      font-weight: 750;
      white-space: nowrap;
    }

    .history-details {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 6px;
      padding: 0 10px 10px 66px;
      animation: history-reveal 180ms ease-out both;
    }

    .history-detail {
      min-width: 0;
      padding: 8px;
      border-radius: 10px;
      background: var(--data-surface-raised);
    }

    .history-detail strong,
    .history-detail span {
      display: block;
    }

    .history-detail strong {
      overflow: hidden;
      color: var(--data-text);
      font-size: 11px;
      font-weight: 950;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .history-detail span {
      margin-top: 4px;
      color: var(--data-muted);
      font-size: 8px;
      font-weight: 800;
    }

    @keyframes history-reveal {
      from { opacity: 0; transform: translateY(-5px); }
      to { opacity: 1; transform: translateY(0); }
    }

    @media (prefers-reduced-motion: reduce) {
      .history-panel,
      .history-details {
        animation: none;
      }

      .calendar-card,
      .calendar-toggle-chevron,
      .history-close,
      .history-chevron {
        transition: none;
      }
    }

    .trend-mini {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
      margin-top: 10px;
    }

    .trend-mini div {
      border-radius: 14px;
      padding: 9px;
      background: rgba(5, 11, 12, 0.42);
    }

    .trend-mini strong {
      display: block;
      color: var(--lime);
      font-size: 13px;
      font-weight: 950;
    }

    .trend-mini span {
      display: block;
      margin-top: 4px;
      color: var(--muted);
      font-size: 9px;
      font-weight: 800;
      line-height: 1.2;
    }

    .ai-card {
      width: 100%;
      border: 1px solid rgba(223, 255, 19, 0.22);
      border-radius: 22px;
      padding: 15px;
      text-align: left;
      background: rgba(0, 93, 72, 0.72);
      color: var(--warm);
      cursor: pointer;
    }

    .ai-card.compact {
      min-width: 0;
      min-height: 100%;
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 10px;
      border-radius: 22px;
      padding: 12px;
      background: var(--data-surface);
      border-color: var(--data-border);
      color: var(--data-text);
      transition: border-color 180ms ease, background-color 180ms ease;
    }

    .ai-card.compact:hover,
    .ai-card.compact:focus-visible {
      background: var(--data-surface-raised);
      border-color: var(--data-accent);
    }

    .ai-card.compact:focus-visible {
      outline: 2px solid var(--data-accent);
      outline-offset: 2px;
    }

    .ai-card strong {
      display: block;
      color: var(--lime);
      font-size: 16px;
      font-weight: 950;
      letter-spacing: -0.025em;
    }

    .ai-card.compact strong {
      font-size: 15px;
      line-height: 1.1;
      white-space: normal;
      color: var(--data-accent);
    }

    .ai-card p {
      margin: 8px 0 0;
      color: rgba(247, 241, 231, 0.78);
      font-size: 12px;
      line-height: 1.45;
      font-weight: 760;
    }

    .ai-card.compact p {
      margin: 0;
      color: var(--data-muted);
      font-size: 11px;
      line-height: 1.45;
      font-weight: 760;
      white-space: normal;
    }

    .ai-card span {
      display: inline-block;
      margin-top: 10px;
      font-size: 11px;
      color: var(--lime);
      font-weight: 950;
    }

    .ai-card.compact span {
      margin: auto 0 0;
      font-size: 12px;
      color: var(--data-accent);
      line-height: 1.35;
      white-space: normal;
    }

    .community-card {
      border: 0;
      width: 100%;
      text-align: left;
      border-radius: 20px;
      padding: 14px;
      color: var(--warm);
      background: rgba(255, 255, 255, 0.06);
      border: 1px solid rgba(255, 255, 255, 0.08);
      cursor: pointer;
    }

    .community-card.featured {
      background: var(--lime);
      color: var(--black);
    }

    .community-card strong {
      display: block;
      font-size: 16px;
      font-weight: 950;
      letter-spacing: -0.035em;
    }

    .community-card p {
      margin: 6px 0 0;
      color: inherit;
      opacity: 0.72;
      font-size: 11px;
      line-height: 1.4;
      font-weight: 750;
    }

    .community-meta {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-top: 10px;
      gap: 12px;
      font-size: 11px;
      font-weight: 950;
    }

    .avatar-stack {
      display: flex;
      align-items: center;
    }

    .avatar-dot {
      width: 24px;
      height: 24px;
      display: grid;
      place-items: center;
      margin-left: -8px;
      border-radius: 50%;
      border: 2px solid var(--black);
      background: var(--green);
      color: var(--warm);
      font-size: 11px;
      font-weight: 950;
    }

    .avatar-dot:first-child {
      margin-left: 0;
    }

    .community-card.featured .avatar-dot {
      border-color: var(--lime);
      background: var(--black);
      color: var(--lime);
    }

    .club-page {
      gap: 10px;
      background: radial-gradient(circle at 88% 20%, rgba(223, 255, 19, 0.11), transparent 30%), var(--black);
    }

    .club-page::before,
    .club-page::after { display: none; }

    .club-heading {
      width: 100%;
      text-align: center;
    }

    .club-heading .screen-title {
      width: 100%;
      font-size: clamp(32px, 9vw, 42px);
      line-height: 1;
      letter-spacing: -0.055em;
      white-space: nowrap;
    }

    .online-count {
      padding: 6px 9px;
      border-radius: 999px;
      background: rgba(223, 255, 19, 0.1);
      color: var(--lime);
      font-size: 10px;
      font-weight: 900;
      white-space: nowrap;
    }

    .online-count::before {
      content: "";
      display: inline-block;
      width: 6px;
      height: 6px;
      margin-right: 5px;
      border-radius: 50%;
      background: var(--lime);
      box-shadow: 0 0 0 4px rgba(223, 255, 19, 0.1);
    }

    .club-panel { display: flex; flex-direction: column; gap: 10px; }

    .club-stories {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      align-self: center;
      width: min(300px, 92%);
      gap: 6px;
      padding: 0 0 2px;
    }

    .story-button {
      display: flex;
      min-width: 0;
      min-height: 66px;
      padding: 0;
      border: 0;
      background: transparent;
      color: var(--warm);
      flex-direction: column;
      align-items: center;
      justify-content: flex-start;
      gap: 4px;
      cursor: pointer;
    }

    .story-ring {
      display: grid;
      place-items: center;
      width: 46px;
      height: 46px;
      padding: 2px;
      border-radius: 50%;
      background: linear-gradient(145deg, var(--lime), #0d8062 70%);
      transition: opacity 180ms ease, transform 180ms ease;
    }

    .story-button:active .story-ring { opacity: 0.78; transform: scale(0.96); }

    .story-avatar {
      display: grid;
      place-items: center;
      width: 100%;
      height: 100%;
      border: 2px solid var(--black);
      border-radius: 50%;
      background: linear-gradient(150deg, #0d8062, #003d30);
      color: var(--lime);
      font-size: 13px;
      font-weight: 950;
    }

    .story-button.add .story-avatar {
      background: var(--lime);
      color: var(--black);
      font-size: 18px;
    }

    .story-button small {
      display: block;
      width: 100%;
      overflow: hidden;
      color: rgba(247, 241, 231, 0.72);
      font-size: 8.5px;
      font-weight: 800;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .section-line {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-top: 2px;
    }

    .section-line strong { font-size: 14px; letter-spacing: -0.02em; }
    .section-line span { color: var(--muted); font-size: 10px; font-weight: 800; }

    .feed-card {
      padding: 0;
      overflow: hidden;
      border: 1px solid rgba(247, 241, 231, 0.09);
      border-radius: 22px;
      background: rgba(255, 255, 255, 0.05);
    }

    .feed-head {
      display: grid;
      grid-template-columns: 40px 1fr auto;
      align-items: center;
      gap: 9px;
      padding: 12px;
    }

    .feed-avatar {
      display: grid;
      place-items: center;
      width: 40px;
      height: 40px;
      border-radius: 50%;
      background: var(--green);
      color: var(--lime);
      font-size: 12px;
      font-weight: 950;
      border: 1px solid rgba(223, 255, 19, 0.32);
    }

    .feed-head strong { display: block; font-size: 13px; }
    .feed-head small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }

    .follow-button {
      border: 0;
      border-radius: 999px;
      min-width: 58px;
      min-height: 44px;
      padding: 0 10px;
      background: rgba(223, 255, 19, 0.12);
      color: var(--lime);
      font-size: 9px;
      font-weight: 900;
      cursor: pointer;
    }

    .feed-media {
      position: relative;
      width: 100%;
      aspect-ratio: 16 / 9;
      overflow: hidden;
      background: #032b23;
    }

    .feed-media img {
      width: 100%;
      height: 100%;
      display: block;
      object-fit: cover;
    }

    .feed-media-tag {
      position: absolute;
      top: 10px;
      left: 10px;
      padding: 6px 9px;
      border-radius: 999px;
      background: rgba(5, 11, 12, 0.78);
      color: var(--lime);
      font-size: 9px;
      font-weight: 900;
      backdrop-filter: blur(8px);
    }

    .feed-body { padding: 12px 12px 4px; }
    .feed-copy { margin: 0; color: rgba(247, 241, 231, 0.9); font-size: 12px; line-height: 1.5; font-weight: 680; }

    .feed-actions {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 4px;
      padding: 4px 8px 8px;
      color: var(--muted);
      font-size: 10px;
      font-weight: 850;
    }

    .feed-action {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 5px;
      min-height: 44px;
      border: 0;
      border-radius: 12px;
      padding: 0 6px;
      background: transparent;
      color: inherit;
      font: inherit;
      cursor: pointer;
      transition: background 180ms ease, color 180ms ease;
    }

    .feed-action:active { background: rgba(247, 241, 231, 0.08); }
    .feed-action svg { width: 16px; height: 16px; flex: 0 0 auto; }
    .feed-action.liked { color: var(--lime); }

    .story-button:focus-visible,
    .feed-action:focus-visible,
    .follow-button:focus-visible {
      outline: 2px solid var(--lime);
      outline-offset: 2px;
    }

    @media (prefers-reduced-motion: reduce) {
      .story-ring,
      .feed-action {
        transition: none;
      }
    }

    .primary-action {
      margin-top: auto;
      width: 100%;
      border: 0;
      border-radius: 24px;
      background: var(--lime);
      color: var(--black);
      min-height: 58px;
      font-size: 22px;
      font-weight: 950;
      letter-spacing: -0.05em;
      cursor: pointer;
    }

    .primary-action:disabled {
      cursor: not-allowed;
      background: rgba(255, 255, 255, 0.12);
      color: rgba(247, 241, 231, 0.42);
    }

    .secondary-action {
      width: 100%;
      border: 1px solid rgba(247, 241, 231, 0.16);
      border-radius: 20px;
      background: rgba(255, 255, 255, 0.07);
      color: var(--warm);
      min-height: 46px;
      font-size: 13px;
      font-weight: 900;
      cursor: pointer;
    }

    #profile-screen {
      --profile-surface: #111918;
      --profile-border: rgba(247, 241, 231, 0.12);
      --profile-muted: rgba(247, 241, 231, 0.64);
    }

    .profile-page {
      gap: 12px;
    }

    .profile-page::before,
    .profile-page::after {
      display: none;
    }

    .profile-heading {
      min-height: 40px;
      display: flex;
      align-items: center;
    }

    .profile-heading .screen-title {
      white-space: nowrap;
      font-size: 32px;
      line-height: 1;
      letter-spacing: 0;
    }

    .profile-head {
      min-height: 92px;
      display: flex;
      align-items: center;
      gap: 14px;
      padding: 13px 14px;
      border-radius: 18px;
      background: linear-gradient(115deg, rgba(0, 107, 78, 0.98), rgba(0, 74, 59, 0.98));
    }

    .profile-avatar {
      width: 64px;
      height: 64px;
      flex: 0 0 64px;
      border-radius: 50%;
      border: 2px solid #10c7a0;
      background-image: url('../assets/tennis-home-selected.png');
      background-repeat: no-repeat;
      background-size: 390px auto;
      background-position: -21px -33px;
      box-shadow: 0 0 0 2px rgba(5, 11, 12, 0.5);
    }

    .profile-meta {
      min-width: 0;
    }

    .profile-name {
      font-size: 22px;
      font-weight: 950;
      letter-spacing: 0;
    }

    .pill {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      margin-top: 7px;
      border-radius: 999px;
      background: var(--lime);
      color: var(--black);
      padding: 6px 10px;
      font-size: 11px;
      font-weight: 950;
      letter-spacing: 0;
      white-space: nowrap;
    }

    .profile-section {
      display: grid;
      gap: 7px;
    }

    .profile-section-title {
      margin: 0;
      color: var(--warm);
      font-size: 14px;
      line-height: 1.4;
      letter-spacing: 0;
    }

    .profile-connection {
      min-height: 32px;
      display: flex;
      align-items: center;
      gap: 7px;
      padding: 0 10px;
      border: 1px solid var(--profile-border);
      border-radius: 12px;
      background: var(--profile-surface);
      color: var(--profile-muted);
      font-size: 10px;
      font-weight: 800;
    }

    .profile-connection svg {
      width: 14px;
      height: 14px;
      color: var(--lime);
    }

    .profile-ble-connect {
      margin-left: auto;
    }

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

    .profile-quick-action {
      min-width: 0;
      min-height: 64px;
      display: grid;
      grid-template-columns: 32px minmax(0, 1fr);
      align-items: center;
      gap: 8px;
      border: 1px solid var(--profile-border);
      border-radius: 14px;
      padding: 8px 10px;
      background: var(--profile-surface);
      color: var(--warm);
      font: inherit;
      text-align: left;
      cursor: pointer;
      touch-action: manipulation;
      transition: background 180ms ease, border-color 180ms ease;
    }

    .profile-quick-action:hover,
    .profile-quick-action:active {
      border-color: rgba(223, 255, 19, 0.34);
      background: rgba(223, 255, 19, 0.07);
    }

    .profile-quick-action:focus-visible {
      outline: 2px solid var(--lime);
      outline-offset: 2px;
    }

    .profile-quick-icon {
      width: 32px;
      height: 32px;
      display: grid;
      place-items: center;
      border-radius: 10px;
      background: rgba(223, 255, 19, 0.1);
      color: var(--lime);
    }

    .profile-quick-icon svg {
      width: 19px;
      height: 19px;
    }

    .profile-quick-copy {
      min-width: 0;
      display: grid;
      gap: 3px;
    }

    .profile-quick-label,
    .profile-quick-value {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .profile-quick-label {
      color: var(--profile-muted);
      font-size: 9px;
      font-weight: 750;
    }

    .profile-quick-value {
      color: var(--warm);
      font-size: 12px;
      font-weight: 900;
    }

    .profile-menu {
      overflow: hidden;
      border: 1px solid var(--profile-border);
      border-radius: 16px;
      background: var(--profile-surface);
    }

    .profile-menu-action {
      width: 100%;
      min-height: 48px;
      display: grid;
      grid-template-columns: 22px minmax(0, 1fr) auto 16px;
      align-items: center;
      gap: 10px;
      border: 0;
      border-bottom: 1px solid var(--profile-border);
      padding: 0 12px;
      background: transparent;
      color: var(--warm);
      font: inherit;
      text-align: left;
      cursor: pointer;
      touch-action: manipulation;
      transition: background 180ms ease;
    }

    .profile-menu-action:last-child {
      border-bottom: 0;
    }

    .profile-menu-action:hover,
    .profile-menu-action:active {
      background: rgba(247, 241, 231, 0.07);
    }

    .profile-menu-action:focus-visible {
      position: relative;
      z-index: 1;
      outline: 2px solid var(--lime);
      outline-offset: -2px;
    }

    .profile-menu-icon,
    .profile-menu-chevron {
      width: 18px;
      height: 18px;
      color: var(--lime);
    }

    .profile-menu-chevron {
      width: 15px;
      height: 15px;
      color: var(--profile-muted);
    }

    .profile-menu-label {
      min-width: 0;
      font-size: 13px;
      font-weight: 850;
    }

    .profile-menu-state {
      color: var(--profile-muted);
      font-size: 10px;
      font-weight: 750;
      white-space: nowrap;
    }

    @media (max-height: 700px) {
      .profile-page {
        gap: 8px;
      }

      .profile-heading {
        min-height: 36px;
      }

      .profile-head {
        min-height: 82px;
        padding-block: 9px;
      }

      .profile-avatar {
        width: 56px;
        height: 56px;
        flex-basis: 56px;
        background-size: 342px auto;
        background-position: -18px -29px;
      }

      .profile-menu-action {
        min-height: 44px;
      }
    }

    @media (prefers-reduced-motion: reduce) {
      .profile-menu-action,
      .profile-quick-action {
        transition: none;
      }
    }

    @media (orientation: landscape) and (max-height: 520px) {
      .profile-page {
        display: grid;
        grid-template-columns: minmax(240px, 0.85fr) minmax(320px, 1.15fr);
        grid-template-rows: 44px 36px 82px minmax(0, 1fr);
        column-gap: 20px;
        row-gap: 8px;
        padding: 10px 18px;
      }

      .profile-page > .topbar {
        grid-column: 1;
        grid-row: 1;
        align-self: start;
      }

      .profile-page > .profile-heading {
        grid-column: 1;
        grid-row: 2;
      }

      .profile-page > .profile-head {
        grid-column: 1;
        grid-row: 3;
      }

      .profile-page > .profile-section:first-of-type {
        grid-column: 1;
        grid-row: 4;
      }

      .profile-page > .profile-section:last-of-type {
        grid-column: 2;
        grid-row: 1 / 5;
        align-self: center;
      }

      .profile-heading .screen-title {
        font-size: 28px;
      }
    }

    .toast {
      position: absolute;
      left: 24px;
      right: 24px;
      bottom: 24px;
      transform: translateY(150%);
      transition: transform 220ms ease;
      background: rgba(5, 11, 12, 0.92);
      border: 1px solid rgba(223, 255, 19, 0.24);
      color: var(--warm);
      border-radius: 18px;
      padding: 14px 16px;
      font-size: 14px;
      font-weight: 800;
      z-index: 30;
    }

    .toast.show {
      transform: translateY(0);
    }

    .app-shell.coach-mode {
      width: min(1180px, calc(100vw - 48px));
      height: min(820px, calc(100vh - 36px));
      aspect-ratio: auto;
      border: 1px solid rgba(223, 255, 19, 0.14);
    }

    #coach-screen {
      overflow: hidden;
    }

    .coach-layout {
      position: relative;
      min-height: 100%;
      display: grid;
      grid-template-columns: 220px minmax(0, 1fr);
      background: var(--black);
    }

    .coach-sidebar {
      position: relative;
      z-index: 2;
      display: flex;
      flex-direction: column;
      padding: 34px 22px 26px;
      border-right: 1px solid rgba(247, 241, 231, 0.14);
      background: rgba(5, 11, 12, 0.94);
    }

    .coach-brand {
      margin: 0 0 42px;
      color: var(--warm);
      font-family: Impact, "Arial Narrow", sans-serif;
      font-size: 26px;
      font-style: italic;
      letter-spacing: -0.025em;
    }

    .coach-brand small {
      display: block;
      margin-top: 5px;
      color: var(--lime);
      font-family: inherit;
      font-size: 9px;
      letter-spacing: 0.08em;
    }

    .coach-nav {
      display: grid;
      gap: 8px;
      margin: 0 -22px;
    }

    .coach-nav button {
      position: relative;
      min-height: 52px;
      display: flex;
      align-items: center;
      gap: 14px;
      border: 0;
      padding: 0 26px;
      background: transparent;
      color: rgba(247, 241, 231, 0.68);
      font: inherit;
      font-size: 14px;
      font-weight: 850;
      text-align: left;
      cursor: pointer;
    }

    .coach-nav button::before {
      content: "";
      position: absolute;
      inset: 0 auto 0 0;
      width: 4px;
      background: transparent;
    }

    .coach-nav button.active {
      color: var(--lime);
      background: rgba(223, 255, 19, 0.06);
    }

    .coach-nav button.active::before {
      background: var(--lime);
    }

    .coach-nav svg,
    .coach-send svg,
    .coach-back svg {
      width: 22px;
      height: 22px;
      flex: 0 0 auto;
    }

    .coach-sidebar-status {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-top: auto;
      padding-top: 22px;
      border-top: 1px solid rgba(247, 241, 231, 0.16);
      color: var(--lime);
      font-size: 12px;
      font-weight: 900;
    }

    .coach-dot {
      width: 9px;
      height: 9px;
      border-radius: 50%;
      background: var(--lime);
      box-shadow: 0 0 0 0 rgba(223, 255, 19, 0.3);
      animation: coach-pulse 2.2s ease-out infinite;
    }

    @keyframes coach-pulse {
      70%, 100% { box-shadow: 0 0 0 9px rgba(223, 255, 19, 0); }
    }

    .coach-main {
      position: relative;
      min-width: 0;
      height: 100%;
      display: grid;
      grid-template-rows: auto auto minmax(0, 1fr) auto;
      overflow: hidden;
      isolation: isolate;
    }

    .coach-main::before,
    .coach-main::after {
      content: "";
      position: absolute;
      z-index: -1;
      width: 430px;
      height: 430px;
      border: 3px solid rgba(111, 143, 71, 0.25);
      border-radius: 50%;
      pointer-events: none;
    }

    .coach-main::before {
      right: -285px;
      top: -170px;
    }

    .coach-main::after {
      right: -345px;
      bottom: -280px;
    }

    .coach-header,
    .coach-context,
    .coach-conversation,
    .coach-bottom {
      width: min(100%, 860px);
      margin-inline: auto;
    }

    .coach-header {
      display: flex;
      align-items: center;
      gap: 16px;
      padding: 30px 28px 14px;
    }

    .coach-back {
      display: none;
      place-items: center;
      width: 44px;
      height: 44px;
      flex: 0 0 auto;
      border: 1px solid rgba(223, 255, 19, 0.4);
      border-radius: 50%;
      background: transparent;
      color: var(--warm);
      cursor: pointer;
    }

    .coach-title-wrap h1 {
      margin: 0;
      color: var(--warm);
      font-family: Impact, "Arial Narrow", ui-sans-serif, sans-serif;
      font-size: 44px;
      font-style: italic;
      line-height: 0.98;
      letter-spacing: -0.035em;
    }

    .coach-online {
      display: flex;
      align-items: center;
      gap: 7px;
      margin-top: 8px;
      color: rgba(247, 241, 231, 0.7);
      font-size: 11px;
      font-weight: 800;
    }

    .coach-context {
      display: flex;
      align-items: baseline;
      gap: 10px;
      padding: 12px 18px;
      border: 1px solid rgba(223, 255, 19, 0.62);
      color: rgba(247, 241, 231, 0.74);
      font-size: 12px;
      font-weight: 800;
      white-space: nowrap;
    }

    .coach-context strong {
      color: var(--warm);
    }

    .coach-context b {
      color: var(--lime);
      font-size: 15px;
    }

    .coach-context-icon,
    .coach-compose-icon {
      display: grid;
      place-items: center;
      color: var(--lime);
    }

    .coach-context-icon svg,
    .coach-compose-icon svg,
    .coach-quick-prompts svg {
      width: 17px;
      height: 17px;
    }

    .coach-conversation {
      min-height: 0;
      overflow-y: auto;
      padding: 26px 28px 18px;
      scrollbar-width: thin;
      scrollbar-color: rgba(223, 255, 19, 0.28) transparent;
      scroll-behavior: smooth;
    }

    .coach-message {
      display: flex;
      align-items: flex-start;
      gap: 12px;
      margin-bottom: 18px;
      animation: coach-rise 220ms ease-out both;
    }

    @keyframes coach-rise {
      from { opacity: 0; transform: translateY(7px); }
      to { opacity: 1; transform: translateY(0); }
    }

    .coach-message.user {
      justify-content: flex-end;
    }

    .coach-avatar {
      width: 36px;
      height: 36px;
      flex: 0 0 auto;
      display: grid;
      place-items: center;
      border-radius: 50%;
      background: var(--lime);
      color: var(--black);
      font-family: Impact, sans-serif;
      font-size: 19px;
      font-style: italic;
    }

    .coach-bubble {
      max-width: min(620px, 78%);
      padding: 14px 16px;
      border-radius: 4px 20px 20px 20px;
      background: rgba(0, 73, 57, 0.78);
      border: 1px solid rgba(247, 241, 231, 0.07);
      color: var(--warm);
      font-size: 14px;
      line-height: 1.65;
      font-weight: 650;
      white-space: pre-wrap;
    }

    .coach-message.user .coach-bubble {
      max-width: min(520px, 78%);
      border: 0;
      border-radius: 20px 4px 20px 20px;
      background: var(--lime);
      color: var(--black);
      font-weight: 850;
    }

    .coach-message.loading .coach-bubble {
      display: flex;
      gap: 5px;
      align-items: center;
      min-height: 46px;
    }

    .coach-message.loading i {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: var(--lime);
      animation: coach-typing 900ms ease-in-out infinite alternate;
    }

    .coach-message.loading i:nth-child(2) { animation-delay: 140ms; }
    .coach-message.loading i:nth-child(3) { animation-delay: 280ms; }

    @keyframes coach-typing {
      to { opacity: 0.28; transform: translateY(-3px); }
    }

    .coach-bottom {
      padding: 8px 28px 28px;
      background: var(--black);
    }

    .coach-quick-prompts {
      display: flex;
      gap: 10px;
      margin-bottom: 12px;
      overflow-x: auto;
      scrollbar-width: none;
    }

    .coach-quick-prompts::-webkit-scrollbar { display: none; }

    .coach-quick-prompts button {
      min-height: 40px;
      flex: 0 0 auto;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      border: 1px solid rgba(223, 255, 19, 0.72);
      border-radius: 999px;
      padding: 0 16px;
      background: transparent;
      color: var(--warm);
      font: inherit;
      font-size: 12px;
      font-weight: 850;
      cursor: pointer;
    }

    .coach-quick-prompts button:hover,
    .coach-quick-prompts button:focus-visible {
      background: rgba(223, 255, 19, 0.08);
      color: var(--lime);
    }

    .coach-form {
      display: flex;
      align-items: flex-end;
      gap: 10px;
      min-height: 58px;
      padding: 8px 8px 8px 18px;
      border: 1px solid rgba(247, 241, 231, 0.32);
      border-radius: 20px;
      background: #081011;
    }

    .coach-form textarea {
      width: 100%;
      min-height: 40px;
      max-height: 120px;
      resize: none;
      border: 0;
      outline: 0;
      padding: 10px 0 7px;
      background: transparent;
      color: var(--warm);
      font: inherit;
      font-size: 14px;
      line-height: 1.5;
    }

    .coach-compose-icon {
      align-self: center;
      color: rgba(247, 241, 231, 0.52);
    }

    .coach-form textarea::placeholder {
      color: rgba(247, 241, 231, 0.38);
    }

    .coach-send {
      width: 44px;
      height: 44px;
      flex: 0 0 auto;
      display: grid;
      place-items: center;
      border: 0;
      border-radius: 50%;
      background: var(--lime);
      color: var(--black);
      cursor: pointer;
    }

    .coach-send:disabled {
      cursor: wait;
      opacity: 0.5;
    }

    .coach-status {
      min-height: 16px;
      margin: 7px 4px 0;
      color: rgba(247, 241, 231, 0.5);
      font-size: 10px;
      font-weight: 700;
    }

    @media (prefers-reduced-motion: reduce) {
      .coach-dot,
      .coach-message,
      .coach-message.loading i {
        animation: none;
      }
    }

    @media (max-width: 520px) {
      body {
        padding: 0;
        background: var(--black);
      }

      .app-shell {
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
      }

      .training-page {
        min-height: 0;
      }
    }

    @media (max-width: 767px) {
      .app-shell.coach-mode {
        width: 100vw;
        height: 100dvh;
        max-height: 100dvh;
        border: 0;
      }

      .coach-layout {
        grid-template-columns: 1fr;
      }

      .coach-sidebar {
        display: none;
      }

      .coach-main::before {
        right: -350px;
        top: -250px;
      }

      .coach-main::after {
        right: auto;
        left: -380px;
        bottom: -300px;
      }

      .coach-header {
        padding: max(14px, env(safe-area-inset-top)) 16px 10px;
      }

      .coach-back {
        display: grid;
      }

      .coach-title-wrap h1 {
        font-size: 32px;
      }

      .coach-online {
        margin-top: 4px;
      }

      .coach-context {
        width: 100%;
        overflow-x: auto;
        border-width: 1px 0;
        padding: 11px 16px;
        scrollbar-width: none;
      }

      .coach-context-icon,
      .coach-compose-icon {
        display: none;
      }

      .coach-conversation {
        width: 100%;
        padding: 20px 16px 12px;
      }

      .coach-message {
        gap: 9px;
        margin-bottom: 14px;
      }

      .coach-avatar {
        width: 32px;
        height: 32px;
        font-size: 17px;
      }

      .coach-bubble,
      .coach-message.user .coach-bubble {
        max-width: 84%;
        padding: 12px 14px;
        font-size: 13px;
        line-height: 1.6;
      }

      .coach-bottom {
        width: 100%;
        padding: 6px 14px max(10px, env(safe-area-inset-bottom));
      }

      .coach-quick-prompts {
        gap: 7px;
        margin-inline: -14px;
        padding-inline: 14px;
      }

      .coach-quick-prompts button {
        min-height: 38px;
        gap: 6px;
        padding-inline: 11px;
        font-size: 11px;
      }

      .coach-quick-prompts svg {
        width: 15px;
        height: 15px;
      }

      .coach-form {
        border-radius: 17px;
      }
    }

    /* One viewport and one density system for every app screen. */
    :root {
      --app-gutter: 20px;
      --app-topbar-height: 44px;
      --app-control-height: 50px;
      --app-flow-gap: 10px;
    }

    .screen:not(#home-screen) {
      overflow: hidden;
    }

    .screen:not(#home-screen) > .page {
      width: 100%;
      height: 100%;
      min-height: 100%;
      overflow-y: auto;
      padding: max(16px, env(safe-area-inset-top)) var(--app-gutter) max(16px, env(safe-area-inset-bottom));
      gap: 12px;
    }

    .topbar {
      min-height: var(--app-topbar-height);
      flex: 0 0 var(--app-topbar-height);
      margin: 0;
      padding: 0;
    }

    .back {
      min-width: 44px;
      height: 44px;
      padding-inline: 14px;
      font-size: 12px;
    }

    .screen-title,
    .data-heading .screen-title,
    .training-title {
      font-size: 40px;
      line-height: 1;
      letter-spacing: 0;
    }

    .training-page,
    #train-goal-screen .training-page {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      min-height: 100%;
      overflow: hidden;
      display: grid;
      grid-template-rows: var(--app-topbar-height) auto minmax(0, 1fr) var(--app-control-height) 28px;
      gap: var(--app-flow-gap);
      padding: max(16px, env(safe-area-inset-top)) var(--app-gutter) max(12px, env(safe-area-inset-bottom));
    }

    #start-screen.screen > .page.training-page,
    #train-goal-screen.screen > .page.training-page,
    #timer-screen.screen > .page.timer-page {
      overflow-y: hidden;
    }

    .training-header {
      margin: 0;
    }

    .training-kicker {
      margin: 0 0 4px;
      font-size: 10px;
      letter-spacing: 0.12em;
    }

    .training-intro {
      margin: 5px 0 0;
      font-size: 12px;
      line-height: 1.4;
    }

    .mode-grid,
    .goal-list {
      width: 100%;
      height: 100%;
      min-height: 0;
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      grid-template-rows: repeat(2, minmax(0, 1fr));
      align-content: stretch;
      gap: 10px;
      margin: 0;
    }

    .mode-card {
      width: 100%;
      height: 100%;
      grid-template-rows: minmax(0, 1fr) 44px;
      border-radius: 18px;
    }

    .mode-card img {
      width: 100%;
      height: 100%;
      aspect-ratio: auto;
    }

    .mode-label {
      min-height: 44px;
      padding: 7px 10px;
    }

    .mode-label strong,
    .goal-copy strong {
      font-size: 16px;
      letter-spacing: 0;
    }

    .mode-label span {
      font-size: 10px;
      letter-spacing: 0.04em;
    }

    .goal-item {
      min-width: 0;
      min-height: 0;
      display: block;
    }

    .goal-list {
      position: relative;
      isolation: isolate;
    }

    .goal-list.details-open ~ .confirm-goal {
      opacity: 0.28;
      pointer-events: none;
    }

    .goal-item .goal-card {
      width: 100%;
      height: 100%;
      min-height: 0;
      grid-template-columns: minmax(0, 1fr) 18px;
      grid-template-rows: 24px minmax(0, 1fr);
      align-items: start;
      gap: 8px;
      padding: 14px;
      border-radius: 18px;
    }

    .goal-item.open .goal-card {
      border-radius: 18px;
    }

    .goal-card .goal-radio {
      width: 22px;
      height: 22px;
      grid-column: 1;
      grid-row: 1;
    }

    .goal-chevron {
      grid-column: 2;
      grid-row: 1;
      justify-self: end;
    }

    .goal-copy {
      grid-column: 1 / -1;
      grid-row: 2;
      align-self: center;
    }

    .goal-copy small {
      margin-top: 5px;
      font-size: 11px;
      line-height: 1.4;
      white-space: normal;
      text-overflow: clip;
    }

    .confirm-mode,
    .confirm-goal {
      height: var(--app-control-height);
      min-height: var(--app-control-height);
      margin: 0;
      border-radius: 16px;
      font-size: 16px;
    }

    .step-progress {
      min-height: 28px;
      height: 28px;
    }

    .goal-details-wrap {
      --goal-inset-top: 50%;
      --goal-inset-right: 50%;
      --goal-inset-bottom: 50%;
      --goal-inset-left: 50%;
      position: absolute;
      inset: 0;
      z-index: 70;
      display: block;
      padding: 0;
      overflow: hidden;
      border: 1px solid rgba(223, 255, 19, 0.52);
      border-radius: 18px;
      background: var(--black);
      clip-path: inset(var(--goal-inset-top) var(--goal-inset-right) var(--goal-inset-bottom) var(--goal-inset-left) round 18px);
      visibility: hidden;
      pointer-events: none;
      transition: clip-path 320ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 320ms;
    }

    .goal-item.open .goal-details-wrap {
      clip-path: inset(0 round 18px);
      visibility: visible;
      pointer-events: auto;
      transition: clip-path 320ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s;
    }

    .goal-details-clip {
      width: 100%;
      height: 100%;
      max-height: none;
      overflow: hidden;
    }

    .goal-details {
      position: relative;
      width: 100%;
      height: 100%;
      min-height: 0;
      margin: 0;
      padding: 58px 14px 14px;
      overflow-y: auto;
      border: 0;
      border-radius: 0;
      background: var(--black);
      color: var(--lime);
      box-shadow: none;
      opacity: 0;
      transform: translateY(8px);
      transition: opacity 120ms ease, transform 180ms ease;
    }

    .goal-item.open .goal-details {
      opacity: 1;
      transform: translateY(0);
      transition-delay: 160ms;
    }

    .goal-details .detail-heading {
      margin-bottom: 8px;
    }

    .goal-details .detail-heading strong,
    .goal-details .detail-heading span,
    .goal-details .history-metric strong,
    .goal-details .custom-request label {
      color: var(--lime);
    }

    .goal-details .detail-heading span,
    .goal-details .history-metric span {
      color: rgba(223, 255, 19, 0.72);
    }

    .goal-details .history-metrics {
      padding: 9px 0;
      border-color: rgba(223, 255, 19, 0.22);
    }

    .goal-details .history-metric {
      border-color: rgba(223, 255, 19, 0.22);
    }

    .goal-details .ai-result {
      margin-top: 10px;
      padding: 8px 10px;
      border-left-color: var(--lime);
      background: rgba(223, 255, 19, 0.08);
      color: rgba(223, 255, 19, 0.88);
    }

    .goal-details .custom-request {
      margin-top: 10px;
      gap: 6px;
    }

    .goal-details .custom-request textarea {
      min-height: 54px;
      resize: none;
      border-color: rgba(223, 255, 19, 0.42);
      background: rgba(223, 255, 19, 0.06);
      color: var(--lime);
    }

    .goal-details .custom-request textarea::placeholder {
      color: rgba(223, 255, 19, 0.5);
    }

    .goal-details .custom-request textarea:focus {
      border-color: var(--lime);
      outline-color: rgba(223, 255, 19, 0.16);
    }

    .close-goal-details,
    .save-goal-details {
      position: absolute;
      top: 10px;
      width: 44px;
      height: 44px;
      min-height: 44px;
      display: grid;
      place-items: center;
      margin: 0;
      padding: 0;
      border: 1px solid rgba(223, 255, 19, 0.42);
      border-radius: 50%;
      background: rgba(223, 255, 19, 0.06);
      color: var(--lime);
      cursor: pointer;
    }

    .close-goal-details {
      left: 10px;
    }

    .save-goal-details {
      right: 10px;
    }

    .close-goal-details svg,
    .save-goal-details svg {
      width: 22px;
      height: 22px;
    }

    .close-goal-details:hover,
    .close-goal-details:focus-visible,
    .save-goal-details:hover,
    .save-goal-details:focus-visible {
      background: rgba(223, 255, 19, 0.14);
      outline: 3px solid rgba(223, 255, 19, 0.18);
      outline-offset: 2px;
    }

    .app-shell.coach-mode {
      width: min(390px, calc(100vw - 48px), 50vh);
      height: auto;
      max-height: none;
      aspect-ratio: 941 / 1672;
      border: 0;
    }

    .coach-layout {
      height: 100%;
      min-height: 100%;
      grid-template-columns: 1fr;
    }

    .coach-sidebar {
      display: none;
    }

    .coach-back {
      display: grid;
    }

    .coach-header,
    .coach-context,
    .coach-conversation,
    .coach-bottom {
      width: 100%;
    }

    .coach-header {
      min-height: 68px;
      padding: max(14px, env(safe-area-inset-top)) var(--app-gutter) 10px;
    }

    .coach-title-wrap h1 {
      font-size: 32px;
      letter-spacing: 0;
    }

    .coach-context {
      overflow-x: auto;
      border-width: 1px 0;
      padding: 10px var(--app-gutter);
      scrollbar-width: none;
    }

    .coach-conversation {
      padding: 16px var(--app-gutter) 10px;
    }

    .coach-bottom {
      padding: 6px var(--app-gutter) max(12px, env(safe-area-inset-bottom));
    }

    @media (max-width: 520px) {
      .app-shell,
      .app-shell.coach-mode {
        width: 100vw;
        height: 100dvh;
        max-height: 100dvh;
        aspect-ratio: auto;
      }
    }

    @media (max-height: 700px) {
      :root {
        --app-flow-gap: 7px;
      }

      .screen-title,
      .data-heading .screen-title,
      .training-title {
        font-size: 34px;
      }

      .training-kicker {
        font-size: 9px;
      }

      .training-intro {
        font-size: 11px;
      }

      .mode-grid,
      .goal-list {
        gap: 7px;
      }

      .mode-card,
      .goal-item .goal-card {
        border-radius: 14px;
      }

      .mode-label {
        min-height: 40px;
      }
    }

    @media (orientation: landscape) and (max-height: 520px) {
      body {
        padding: 0;
      }

      .app-shell,
      .app-shell.coach-mode {
        width: 100vw;
        height: 100dvh;
        max-height: 100dvh;
        aspect-ratio: auto;
      }

      .training-page,
      #train-goal-screen .training-page {
        grid-template-columns: minmax(180px, 28%) minmax(0, 1fr);
        grid-template-rows: var(--app-topbar-height) minmax(0, 1fr) var(--app-control-height) 28px;
        column-gap: 20px;
        row-gap: 6px;
      }

      .training-page > .topbar {
        grid-column: 1 / -1;
        grid-row: 1;
      }

      .training-page > .training-header {
        grid-column: 1;
        grid-row: 2 / 5;
        align-self: start;
        padding-top: 8px;
      }

      .training-page > .mode-grid,
      .training-page > .goal-list {
        grid-column: 2;
        grid-row: 2;
      }

      .training-page > .confirm-mode,
      .training-page > .confirm-goal {
        grid-column: 2;
        grid-row: 3;
      }

      .training-page > .step-progress {
        grid-column: 2;
        grid-row: 4;
      }

      .training-title {
        font-size: 34px;
      }

      .training-intro {
        max-width: 220px;
        font-size: 12px;
      }

      .goal-details-clip {
        width: 100%;
        max-height: none;
      }

      #data-screen .page {
        display: grid;
        grid-template-columns: 170px minmax(0, 1fr);
        grid-template-rows: 110px minmax(0, 1fr);
        column-gap: 20px;
        row-gap: 10px;
        overflow: hidden;
      }

      #data-screen .topbar {
        position: static;
        grid-column: 1;
        grid-row: 1;
        align-self: start;
      }

      #data-screen .data-heading {
        grid-column: 1;
        grid-row: 2;
        align-self: start;
      }

      #data-screen .calendar-card {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
        padding: 10px 12px;
        border-radius: 18px;
      }

      #data-screen .calendar-head {
        margin-bottom: 6px;
      }

      #data-screen .day {
        min-height: 48px;
        border-radius: 14px;
        padding-block: 4px;
      }

      #data-screen .day i {
        width: 18px;
        height: 18px;
        margin: 4px auto 0;
      }

      #data-screen .data-summary-grid {
        grid-column: 2;
        grid-row: 2;
        min-height: 0;
        grid-template-columns: minmax(0, 2.6fr) minmax(150px, 1fr);
      }

      #data-screen .today-panel {
        height: 100%;
        display: grid;
        grid-template-columns: 150px minmax(0, 1fr);
        grid-template-rows: repeat(2, minmax(0, 1fr));
        column-gap: 12px;
      }

      #data-screen .today-top {
        grid-column: 1;
        grid-row: 1 / 3;
        align-self: center;
      }

      #data-screen .today-main-grid {
        grid-column: 2;
        grid-row: 1;
        align-self: stretch;
        margin-top: 0;
      }

      #data-screen .today-main-grid .item {
        display: flex;
        flex-direction: column;
        justify-content: center;
      }

      #data-screen .today-sub-grid {
        grid-column: 2;
        grid-row: 2;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        margin-top: 6px;
        gap: 6px;
      }

      #data-screen .today-sub-grid .item {
        min-height: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 3px;
        padding: 6px;
        text-align: center;
      }

      #data-screen .today-sub-grid strong,
      #data-screen .today-sub-grid span {
        margin: 0;
        text-align: center;
      }

      #data-screen .today-sub-grid span {
        font-size: 9px;
      }

      .timer-main {
        justify-content: center;
        padding: 0;
        transform: translateY(-12px);
      }

      .timer-session-content {
        gap: 32px;
      }

      .live-phase {
        margin-top: 8px;
      }

      .live-data-item {
        padding-top: 10px;
        padding-bottom: 9px;
      }

      .timer-controls {
        padding-top: 0;
      }

      #result-screen > .page {
        display: flex;
        flex-direction: column;
        gap: 0;
        padding: 10px 18px;
        overflow-y: auto;
      }

      #result-screen .result-content {
        flex: 1;
        min-height: 0;
        display: grid;
        grid-template-columns: minmax(230px, 0.9fr) minmax(0, 1.1fr);
        grid-template-rows: auto auto 46px;
        column-gap: 20px;
        row-gap: 8px;
        padding-bottom: 0;
      }

      #result-screen .topbar {
        flex: 0 0 var(--app-topbar-height);
      }

      #result-screen .result-overview {
        grid-column: 1;
        grid-row: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        gap: 10px;
      }

      #result-screen .hero-metric {
        min-height: 86px;
        flex: 0 0 auto;
        margin-top: 0;
      }

      #result-screen .result-ai-card {
        grid-column: 2;
        grid-row: 1;
        min-height: 0;
        height: 100%;
      }

      #result-screen .result-details-inline {
        grid-column: 1 / -1;
        grid-row: 2;
        min-height: 0;
      }

      #result-screen .primary-action {
        grid-column: 1 / -1;
        grid-row: 3;
        min-height: 46px;
      }

      .result-ai-sheet {
        width: min(520px, 100%);
        max-height: 94%;
        justify-self: center;
      }
    }

    @media (prefers-reduced-motion: reduce) {
      .goal-details-wrap,
      .goal-details,
      .result-ai-card {
        transition: none;
      }
    }

    /* ── BLE 连接状态 ──────────────────────── */
    .home-ble-dot {
      display: inline-block;
      width: 7px;
      height: 7px;
      border-radius: 50%;
      margin-left: 4px;
      vertical-align: middle;
      background: #999;
      transition: background 0.3s ease;
    }
    .home-ble-dot.ble-connected { background: var(--green); }
    .home-ble-dot.ble-connecting { background: var(--green-2); animation: ble-pulse 1.2s ease-in-out infinite; }
    .home-ble-dot.ble-error { background: #E74C3C; }
    .home-ble-dot.ble-disconnected { background: #999; }

    @keyframes ble-pulse {
      0%, 100% { opacity: 1; }
      50% { opacity: 0.3; }
    }

    .profile-ble-connect {
      display: inline-flex;
      align-items: center;
      padding: 5px 16px;
      border-radius: 100px;
      font-size: 12px;
      font-weight: 600;
      font-family: inherit;
      border: 1.5px solid var(--green);
      background: transparent;
      color: var(--green);
      cursor: pointer;
      transition: all 0.25s ease;
      white-space: nowrap;
    }
    .profile-ble-connect:hover {
      background: var(--green);
      color: #fff;
    }
    .profile-ble-connect.connected {
      background: var(--green);
      color: #fff;
      border-color: var(--green);
    }
    .profile-ble-connect:disabled {
      opacity: 0.5;
      cursor: not-allowed;
    }

    /* BLE 状态灯在不同屏幕上的适配 */
    .ble-status-dot {
      vertical-align: middle;
      margin-left: 6px;
      flex-shrink: 0;
    }

    /* profile-connection 容器内的 BLE 状态灯样式 */
    .profile-connection .ble-status-dot {
      margin-left: 6px;
      margin-right: 0;
    }

    /* 设备状态栏内的 BLE 状态灯样式 */
    .device-status .ble-status-dot {
      margin-left: 8px;
    }

    /* ── AI 训练总结卡片 ─────────────────── */
    .result-ai-summary-card {
      margin: 20px 0 16px;
      padding: 16px 18px;
      border-radius: 14px;
      background: linear-gradient(115deg, rgba(0, 107, 78, 0.06), rgba(0, 74, 59, 0.03));
      border: 1px solid rgba(0, 107, 78, 0.15);
    }
    .result-ai-summary-head {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 10px;
      font-size: 13px;
      font-weight: 700;
      color: var(--green);
    }
    .result-ai-summary-head svg {
      width: 18px;
      height: 18px;
    }
    .result-ai-summary-card p {
      margin: 0;
      font-size: 14px;
      line-height: 1.7;
      color: var(--text);
    }
