/* The two hero devices of the start page in the approved style of 2026-12-03 (the Mac window and the
   phone of the hero): the state 8b of the Mac, and the phone in the same style. It loads after
   css/site.css, which draws the frame, the size and the motion of the devices. This file, scoped
   to .ns:
   1. gives the sidebars the deep-blue frei gradient with no grain, and a splash of colour;
   2. sets one neutral grey scale for the chat and the app;
   3. sets one accent per app (the default blue #0A7AFF; Run is green #66B21D, .accent-green);
   4. sets the Mac chat at a smaller size, and draws the Run app of the Mac in the clean style of
      Truffle: white cards, a lot of air, light titles, no card inside a card;
   5. puts a calm grey background with one soft bloom of colour behind the Run app. */

/* 1, 2 and 3. The gradient, the greys and the accent. --grey-h and --grey-s set every grey: a
   neutral, slightly cool grey. The sidebar gradient has the splash of the real app (frei-mkt
   4002:23548): a warm coral glow at the bottom and a teal tint in the lower half. */
.ns {
  --ns-frei-blue: radial-gradient(26% 30% at 8% 104%, rgba(222, 112, 84, 0.55), transparent),
    radial-gradient(22% 28% at 24% 66%, rgba(54, 140, 160, 0.4), transparent),
    radial-gradient(45% 40% at 35% 0%, rgba(7, 30, 85, 0.6), transparent),
    radial-gradient(40% 45% at 0% 100%, rgba(28, 72, 150, 0.45), transparent),
    linear-gradient(118deg, #11367c 0%, #12326e 29%, #11367c 47%, #184ca1 58.5%, #2568be 67%, #3e8ecc 81%, #52a6cb 100%);
  --grey-h: 220;
  --grey-s: 8%;
  --ns-chat-card: hsl(var(--grey-h) var(--grey-s) 97.6%);
  --ns-chat-line: hsl(var(--grey-h) var(--grey-s) 93%);
  --grey-100: hsl(var(--grey-h) var(--grey-s) 90%);
  --grey-200: hsl(var(--grey-h) var(--grey-s) 86%);
  --grey-300: hsl(var(--grey-h) var(--grey-s) 77%);
  --grey-500: hsl(var(--grey-h) calc(var(--grey-s) * 0.57) 50%);
  --grey-600: hsl(var(--grey-h) calc(var(--grey-s) * 0.71) 38%);
  --ink: #0b0b0f;
  --line: rgba(11, 11, 15, 0.07);
  --accent: #0a7aff;
}
/* The accent of an app: one class on the root of the app. Run is the bright green of its icon. */
.ns .accent-green {
  --accent: #66b21d;
}

/* 1. The sidebar: the gradient in place of the wallpaper and the grain (the page has neither). */
.ns .mac {
  background: var(--ns-frei-blue);
  background-clip: padding-box;
}
/* The phone side list is tall, so its splash sits as in the real app (frei-mkt 4002:23548): the
   coral glow at the bottom centre, the teal tint at the lower right. The blue is the same. */
.ns .side {
  background:
    radial-gradient(70% 24% at 38% 94%, rgba(222, 112, 84, 0.6), transparent),
    radial-gradient(50% 26% at 100% 66%, rgba(54, 140, 160, 0.45), transparent),
    radial-gradient(45% 40% at 35% 0%, rgba(7, 30, 85, 0.6), transparent),
    linear-gradient(160deg, #11367c 0%, #12326e 35%, #153f8c 70%, #1c529f 100%);
}

/* 2. The chat greys: the day label and the prompt box of the Mac, the snippets and the prompt box
   of the phone. The chat background stays white. */
.ns .mac-day {
  color: var(--grey-500);
}
/* The prompt box of the Mac: white with the outline of the chat cards (1 px --ns-chat-line), no shadow. */
.ns .mac-prompt {
  border: 1px solid var(--ns-chat-line);
  background: white;
  box-shadow: none;
  color: var(--grey-500);
}
.ns .snippet {
  border-color: var(--ns-chat-line);
  background: var(--ns-chat-card);
}
.ns .snippet b + span {
  color: var(--grey-600);
}
/* The phone chat: the prompt box white with the outline of the chat cards (the border of /new is
   0.938 px, 1 px of Figma at the scale of the display), no shadow; the two round buttons on top of
   the chat solid white with a hairline, as the app controls of the Mac. The text stays at 15.94 px
   on a display of 377 px (4.2 %), under the ratio of iOS Messages (17 pt on 393 pt, 4.3 %). */
.ns .prompt {
  border-color: var(--ns-chat-line);
  background: white;
  box-shadow: none;
  color: var(--grey-500);
}
.ns .chat-round {
  background: white;
  box-shadow: inset 0 0 0 0.5px rgba(11, 11, 15, 0.08);
}

/* The chat of the Mac at a smaller size: 14 px text instead of 16 px, and every part of the column
   at 0.875 of its size on /new: the messages, the bubbles, the day label, the result card (with the
   large icon of /new, in the neutral grey) and the placeholder of the prompt box. */
.ns .mac-messages {
  gap: 12px;
  font-size: 14px;
  line-height: 20px;
}
.ns .mac-day {
  font-size: 10.5px;
  line-height: 13px;
}
.ns .mac-user {
  padding: 8px 12px;
  border-radius: 16px;
  line-height: 18px;
}
.ns .mac-result {
  gap: 10px;
  padding: 10px 14px 10px 10px;
  border-color: var(--ns-chat-line);
  border-radius: 16px;
  background: var(--ns-chat-card);
  font-size: 12.25px;
  line-height: 16px;
}
.ns .mac-result img {
  width: 35px;
  height: 35px;
}
.ns .mac-result b + span {
  color: var(--grey-600);
}
.ns .mac-prompt {
  font-size: 14px;
  line-height: 18px;
}

/* 5. The background of an app: a calm, light, low-saturation grey with large soft patches and one
   bloom of colour. Change the five values to give an app its own background. */
.ns .ns-app {
  --ns-bg-base: #e3e6ea;
  --ns-bg-light: #f6f8fb;
  --ns-bg-cool: #cfd6df;
  --ns-bg-warm: #e9e3db;
  --ns-bg-bloom: #e9d3cf;
  background:
    radial-gradient(70% 42% at 100% 0%, var(--ns-bg-bloom), transparent 72%),
    radial-gradient(55% 32% at 12% 10%, var(--ns-bg-light), transparent 72%),
    radial-gradient(46% 36% at 100% 50%, var(--ns-bg-cool), transparent 72%),
    radial-gradient(60% 40% at 0% 78%, var(--ns-bg-warm), transparent 72%),
    radial-gradient(52% 30% at 92% 100%, var(--ns-bg-cool), transparent 72%),
    var(--ns-bg-base);
  box-shadow: inset 1px 0 var(--line);
}
/* 4. The app controls on the row of the title pill: the collapse button at the left, "..." at the
   right. The size of the round buttons of the sidebar (36 px), solid white, no glass, no shadow. */
.ns .ns-control {
  position: absolute;
  top: 14px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: white;
  box-shadow: inset 0 0 0 0.5px rgba(11, 11, 15, 0.08);
  color: var(--ink);
}
.ns .ns-collapse {
  left: 16px;
}
.ns .ns-more {
  right: 16px;
}
.ns .ns-app .mac-title {
  border-color: rgba(11, 11, 15, 0.08);
  box-shadow: none;
  font-weight: 500;
}
.ns .ns-app-content {
  position: absolute;
  left: 20px;
  top: 64px;
  width: 380px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  color: var(--ink);
}
/* The page title: 32 px to the week card under it (12 px of margin and the gap of 20 px). */
.ns .ns-date {
  margin: 4px 4px 12px;
  font-size: 22px;
  font-weight: 500;
  line-height: 28px;
  letter-spacing: -0.3px;
}

/* The card of an app: solid white, a hairline rim, an almost invisible shadow. Radius 24, padding
   18 / 20. Inside an app a card has no app name and no icon. */
.ns .ns-card {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 18px 20px;
  border-radius: 24px;
  background: white;
  box-shadow:
    inset 0 0 0 0.5px rgba(11, 11, 15, 0.06),
    0 1px 2px rgba(11, 11, 15, 0.03);
}
/* A short grey label, where it is content: 12 Regular, 6 px above the title. */
.ns .ns-label {
  margin: 0 0 4px;
  font-size: 12px;
  line-height: 16px;
  color: var(--grey-600);
}
/* The title: 15 Medium, as in Truffle. */
.ns .ns-title {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  line-height: 20px;
  letter-spacing: -0.1px;
}
.ns .ns-note {
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 18px;
  color: var(--grey-600);
}
/* The run of today: space between the title and the note, a hairline, then the stats directly on
   the card (no sub-card). */
.ns .ns-run-note {
  margin-top: 12px;
}
.ns .ns-divider {
  width: 100%;
  height: 1px;
  margin: 14px 0;
  border: 0;
  background: var(--line);
}

/* The week: seven days in one white card, the selected day in the accent. */
.ns .ns-week {
  flex-direction: row;
  justify-content: space-between;
  padding: 12px 18px 10px;
  list-style: none;
}
.ns .ns-week li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.ns .ns-week span {
  font-size: 11px;
  line-height: 14px;
  color: var(--grey-600);
}
.ns .ns-week b {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 400;
}
.ns .ns-week .selected b {
  background: var(--accent);
  color: white;
  font-weight: 500;
}
.ns .ns-week i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
}
.ns .ns-week i.run {
  background: var(--accent);
}

/* The metrics, directly on the card: a small grey label, the value in 15 Regular with its unit grey. */
.ns .ns-metrics {
  display: flex;
  justify-content: space-between;
}
.ns .ns-metrics div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ns .ns-metrics dt {
  font-size: 11px;
  line-height: 14px;
  color: var(--grey-600);
}
.ns .ns-metrics dd,
.ns .ns-value b {
  display: flex;
  align-items: baseline;
  gap: 3px;
  margin: 0;
  font-size: 15px;
  font-weight: 400;
  line-height: 20px;
  white-space: nowrap;
}
.ns .ns-metrics small,
.ns .ns-value small {
  font-size: 12px;
  color: var(--grey-600);
}

/* The weekly distance: the title and the note at the left, the value of this week at the right. */
.ns .ns-chart-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.ns .ns-value {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin: 0;
  white-space: nowrap;
}
.ns .ns-value b {
  font-size: 17px;
  line-height: 20px;
}
.ns .ns-value > span {
  font-size: 12px;
  line-height: 16px;
  color: var(--grey-600);
}
/* The chart: twenty thin bars of 3 px, one for each week, in a light grey; this week in the accent.
   The recovery week is a lower bar, with no label. Three faint lines at 10, 20 and 30 km (2 px for
   each km), the axis labels small and grey at the right. */
.ns .ns-plot {
  position: relative;
  height: 86px;
  margin-top: 16px;
  font-size: 11px;
  line-height: 14px;
  color: var(--grey-500);
}
.ns .ns-grid {
  position: absolute;
  left: 0;
  right: 24px;
  height: 1px;
  background: var(--line);
}
.ns .ns-axis {
  position: absolute;
  right: 0;
  transform: translateY(-50%);
}
.ns .ns-grid.g10,
.ns .ns-axis.g10 {
  top: 50px;
}
.ns .ns-grid.g20,
.ns .ns-axis.g20 {
  top: 30px;
}
.ns .ns-grid.g30,
.ns .ns-axis.g30 {
  top: 10px;
}
.ns .ns-bars {
  position: absolute;
  left: 8px;
  right: 40px;
  top: 10px;
  height: 60px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin: 0;
  border-bottom: 1px solid var(--grey-200);
}
.ns .ns-bars i {
  width: 3px;
  border-radius: 1.5px 1.5px 0 0;
  background: var(--grey-300);
}
.ns .ns-bars .now {
  background: var(--accent);
}
/* The height of a bar: 2 px for each km of its week. */
.ns .k8 {
  height: 16px;
}
.ns .k12 {
  height: 24px;
}
.ns .k13 {
  height: 26px;
}
.ns .k14 {
  height: 28px;
}
.ns .k15 {
  height: 30px;
}
.ns .k16 {
  height: 32px;
}
.ns .k17 {
  height: 34px;
}
.ns .k18 {
  height: 36px;
}
.ns .k19 {
  height: 38px;
}
.ns .k20 {
  height: 40px;
}
.ns .k21 {
  height: 42px;
}
.ns .k22 {
  height: 44px;
}
.ns .k23 {
  height: 46px;
}
.ns .k24 {
  height: 48px;
}
.ns .k25 {
  height: 50px;
}
.ns .k27 {
  height: 54px;
}
.ns .k29 {
  height: 58px;
}
.ns .k30 {
  height: 60px;
}
/* The weeks under the first, the middle and the last bar. */
.ns .ns-weeks {
  position: absolute;
  left: 0;
  right: 30px;
  top: 74px;
  display: flex;
  justify-content: space-between;
  margin: 0;
}

/* The goal: the title and the note at the left, a small ring of progress in the accent at the
   right. */
.ns .ns-goal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ns .ns-goal-row > div {
  min-width: 0;
}
.ns .ns-goal .ns-title {
  white-space: nowrap;
}
.ns .ns-ring {
  position: relative;
  flex: none;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 500;
}
.ns .ns-ring::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(var(--accent) 0 34%, var(--grey-100) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3.5px), black calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3.5px), black calc(100% - 3px));
}
