/* JA-052 job A: the desk shell (shelf, window, tints, tokens). */
/* CareerPilot desk look (Revamp V5). Every rule starts with :root[data-ui="desk"], so nothing here applies in the classic
   look (no data-ui attribute on <html>). Values are ported from the V5 prototype (css/revamp-v5.css):
   - the page is a desk (deep green cutting mat with a dot grid);
   - the app sits in one open window (.main-column: ink outline, hard offset shadow), which scrolls inside itself;
   - the side rail is a shelf of labelled folders; the open folder takes its section's tint and steps toward the window,
     and its sub-items hang under it as the folder's contents;
   - the window's title bar (.top-bar) is tinted per section and stays 52px high on desktop;
   - on a phone the window is full-bleed flat paper and the five-item bottom bar becomes a floating dock.
   The first block is the only one with raw colour values (tests/test_desk_shell.py checks this). Motion lives only in the
   prefers-reduced-motion: no-preference block at the end of the file. */

/* ---- Tokens ---------------------------------------------------------------------------------------------------- */
:root[data-ui="desk"] {
  /* The desk */
  --desk-bg: #1E4D43;
  --desk-dot: rgba(255, 252, 245, 0.13);
  --desk-text: #FFFCF5;
  --desk-line: rgba(255, 252, 245, 0.28);
  --desk-hover: rgba(9, 28, 23, 0.45);

  /* The open window */
  --window-bg: #FFFCF5;
  --window-ink: #17283F;
  --window-shadow: 10px 10px 0 rgba(9, 28, 23, 0.55);

  /* Hard offset shadows for paper parts in the window */
  --desk-hard: 4px 4px 0 0 rgba(23, 40, 63, 0.92);
  --desk-hard-sm: 3px 3px 0 0 rgba(23, 40, 63, 0.92);
  --desk-press: 1px 1px 0 0 rgba(23, 40, 63, 0.92);
  --desk-sheet-shadow: 6px 6px 0 0 rgba(23, 40, 63, 0.92);
  --desk-ink-wash: rgba(23, 40, 63, 0.08);

  /* Paper */
  --paper: #FFFEFA;
  --paper-edge: #E9DCC0;
  --paper-shadow: 2px 3px 0 rgba(23, 40, 63, 0.3), 8px 14px 20px rgba(23, 40, 63, 0.12);
  --paper-rule: rgba(49, 95, 200, 0.16);
  --paper-margin: rgba(198, 62, 47, 0.5);

  /* Folders on the shelf */
  --folder: #FFC53D;
  --folder-tab: #FFC53D;
  --folder-open: #FFFFFF;
  --folder-ink: #17283F;
  --folder-small: #F6EDD6;
  --folder-soft: #FFE08A;

  /* Section tints: the title bar and the open folder take the colour of their section */
  --tint-today: #F6EDD6;
  --tint-jobs: #DCE9FF;
  --tint-apply: #FFE9A8;
  --tint-tracker: #DDF2E0;
  --tint-resume: #FFFFFF;
  --tint-network: #F0E6FF;
  --tint-settings: #EFEDE6;
  --tint-thoughts: #FFF3A0;

  /* Sticky notes (My Thoughts) and stamps */
  --sticky-yellow: #FFF3A0;
  --sticky-pink: #FFD3E3;
  --sticky-blue: #CDE6FF;
  --sticky-green: #D4F2C0;
  --sticky-lilac: #F0E6FF;
  --stamp-ink: #264CA7;

  /* Motion and the phone dock */
  --turn-ms: 720ms;
  --desk-dock-bg: rgba(255, 253, 246, 0.98);
  --desk-dock-shadow: 4px 4px 0 rgba(23, 40, 63, 0.9);
  --desk-dock-active-shadow: 2px 2px 0 rgba(23, 40, 63, 0.8);
  --desk-dock-clear: calc(84px + env(safe-area-inset-bottom));
  --desk-field-bg: #FFFFFF;

  /* The product tokens, warmed to the V5 palette. --ink-3 is darker than the prototype's so small text keeps 4.5:1 on
     every tint. */
  --page: #FFFCF5;
  --wash: #FAF2DE;
  --rule: #E9DCC0;
  --ink: #17283F;
  --ink-2: #4D5E73;
  --ink-3: #5A677A;
  --navy: #315FC8;
  --navy-press: #264CA7;
  --navy-wash: #EDF1FE;

  /* The resume assistant sheet on a phone stays above the dock (v7-resume.css reads this). */
  --h-bottom-bar: 84px;
}

/* Which tint this screen wears. "other" (not-found, access denied) keeps the plain window colour. */
:root[data-ui="desk"] .app-shell {
  --tint-current: var(--window-bg);
}

:root[data-ui="desk"] .app-shell[data-section="today"] { --tint-current: var(--tint-today); }
:root[data-ui="desk"] .app-shell[data-section="jobs"] { --tint-current: var(--tint-jobs); }
:root[data-ui="desk"] .app-shell[data-section="apply"] { --tint-current: var(--tint-apply); }
:root[data-ui="desk"] .app-shell[data-section="tracker"] { --tint-current: var(--tint-tracker); }
:root[data-ui="desk"] .app-shell[data-section="resume"] { --tint-current: var(--tint-resume); }
:root[data-ui="desk"] .app-shell[data-section="network"] { --tint-current: var(--tint-network); }
:root[data-ui="desk"] .app-shell[data-section="settings"] { --tint-current: var(--tint-settings); }
:root[data-ui="desk"] .app-shell[data-section="thoughts"] { --tint-current: var(--tint-thoughts); }

/* ---- Parts shared by every screen in the window ------------------------------------------------------------------ */
:root[data-ui="desk"] .btn {
  border-radius: 10px;
}

:root[data-ui="desk"] .btn-primary,
:root[data-ui="desk"] .btn-secondary {
  border: 1.5px solid var(--window-ink);
  box-shadow: var(--desk-hard-sm);
}

:root[data-ui="desk"] .btn-secondary {
  background: var(--page);
  color: var(--ink);
}

:root[data-ui="desk"] .btn-secondary:hover:not(:disabled) {
  background: var(--wash);
}

:root[data-ui="desk"] .btn-primary:active:not(:disabled),
:root[data-ui="desk"] .btn-secondary:active:not(:disabled) {
  transform: translate(2px, 2px);
  box-shadow: var(--desk-press);
}

:root[data-ui="desk"] .btn:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}

:root[data-ui="desk"] .input,
:root[data-ui="desk"] .select,
:root[data-ui="desk"] .textarea {
  border: 1.5px solid var(--window-ink);
  border-radius: 9px;
  background: var(--desk-field-bg);
}

:root[data-ui="desk"] .sheet {
  border: 2px solid var(--window-ink);
  border-radius: 18px;
  box-shadow: var(--desk-sheet-shadow);
}

:root[data-ui="desk"] .toast {
  background: var(--window-ink);
  color: var(--page);
  border: 1.5px solid var(--page);
  border-radius: 12px;
  box-shadow: var(--desk-hard-sm);
}

/* ---- The title bar: tinted per section ------------------------------------------------------------------------- */
:root[data-ui="desk"] .top-bar {
  background: var(--tint-current);
  border-bottom: 2px solid var(--window-ink);
}

:root[data-ui="desk"] .top-bar-title {
  color: var(--ink);
  font-weight: 600;
}

:root[data-ui="desk"] .top-bar-back-btn {
  min-height: 34px;
  border: 1.5px solid var(--window-ink);
  border-radius: 10px;
  background: var(--page);
  color: var(--ink);
  box-shadow: var(--desk-hard-sm);
}

:root[data-ui="desk"] .top-bar-back-btn:hover,
:root[data-ui="desk"] .top-bar-back-btn:focus-visible {
  border-color: var(--window-ink);
  background: var(--navy-wash);
  color: var(--ink);
}

:root[data-ui="desk"] .top-bar-badge {
  border: 1.5px solid var(--window-ink);
  background: var(--page);
  color: var(--ink);
}

:root[data-ui="desk"] .top-bar-thought-btn {
  background: var(--sticky-yellow);
  color: var(--ink);
  font-weight: 600;
}

:root[data-ui="desk"] .top-bar-thought-btn:hover:not(:disabled) {
  background: var(--folder-soft);
}

:root[data-ui="desk"] .top-bar-report-btn,
:root[data-ui="desk"] .mobile-profile-btn {
  width: 36px;
  min-width: 36px;
  height: 36px;
  border: 1.5px solid var(--window-ink);
  border-radius: 10px;
  background: var(--page);
  color: var(--ink);
  box-shadow: var(--desk-hard-sm);
}

:root[data-ui="desk"] .top-bar-report-btn:hover:not(:disabled),
:root[data-ui="desk"] .top-bar-report-btn:focus-visible,
:root[data-ui="desk"] .mobile-profile-btn:hover:not(:disabled) {
  border-color: var(--window-ink);
  background: var(--wash);
  color: var(--ink);
}

:root[data-ui="desk"] .top-bar-report-btn:focus-visible,
:root[data-ui="desk"] .top-bar-back-btn:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}

:root[data-ui="desk"] .account-menu-panel {
  min-width: 220px;
  padding: 6px;
  border: 2px solid var(--window-ink);
  border-radius: 12px;
  background: var(--page);
  box-shadow: var(--desk-hard);
}

:root[data-ui="desk"] .account-menu-panel .rail-link {
  min-height: 44px;
  border-radius: 8px;
  color: var(--ink);
  font-size: 14px;
}

:root[data-ui="desk"] .account-menu-panel .rail-link:hover,
:root[data-ui="desk"] .account-menu-panel .rail-link:focus-visible {
  background: var(--tint-today);
  color: var(--ink);
}

/* ---- Desktop: the desk, the shelf of folders and the one open window ------------------------------------------- */
@media (min-width: 900px) {
  :root[data-ui="desk"]:has(.app-shell),
  :root[data-ui="desk"] body:has(.app-shell) {
    background: var(--desk-bg);
  }

  :root[data-ui="desk"] .app-shell {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    padding: 16px 20px 18px 8px;
    background: radial-gradient(var(--desk-dot) 1px, transparent 1.4px) 0 0 / 22px 22px, var(--desk-bg);
  }

  :root[data-ui="desk"] body.has-view-as .app-shell {
    height: calc(100vh - var(--view-as-bar-h, 0px));
    height: calc(100dvh - var(--view-as-bar-h, 0px));
    min-height: 0;
  }

  /* The shelf. It scrolls on its own when every folder is open on a short screen. */
  :root[data-ui="desk"] .side-rail {
    position: relative;
    top: auto;
    align-self: stretch;
    flex: 0 0 190px;
    width: 190px;
    height: auto;
    padding: 4px 22px 8px 8px;
    gap: 12px;
    border-right: 0;
    background: transparent;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--desk-line) transparent;
  }

  :root[data-ui="desk"] body.has-view-as .side-rail {
    top: auto;
    height: auto;
  }

  :root[data-ui="desk"] .side-rail .brand-title {
    padding: 4px 4px 0;
    color: var(--desk-text);
    font-size: 16px;
    font-weight: 600;
  }

  :root[data-ui="desk"] .side-rail .brand-title:focus-visible,
  :root[data-ui="desk"] .side-rail .rail-footer-util:focus-visible {
    outline: 2px solid var(--desk-text);
    outline-offset: 2px;
  }

  :root[data-ui="desk"] .rail-nav {
    gap: 12px;
  }

  :root[data-ui="desk"] .rail-group {
    gap: 0;
  }

  /* A folder: the row of a top-level link (and its chevron), and the My Thoughts, Career records and profile links in the
     footer. The tab is drawn by ::before. */
  :root[data-ui="desk"] .rail-item-row,
  :root[data-ui="desk"] .rail-footer-links > [data-testid="nav-thoughts"],
  :root[data-ui="desk"] .rail-footer-links > [data-testid="nav-records"],
  :root[data-ui="desk"] .rail-footer-links > .rail-profile-anchor {
    position: relative;
    margin-top: 9px;
    border: 1.5px solid var(--window-ink);
    border-radius: 4px 10px 10px 10px;
    background: var(--folder);
    color: var(--folder-ink);
    box-shadow: var(--desk-hard-sm);
  }

  :root[data-ui="desk"] .rail-item-row::before,
  :root[data-ui="desk"] .rail-footer-links > [data-testid="nav-thoughts"]::before,
  :root[data-ui="desk"] .rail-footer-links > [data-testid="nav-records"]::before,
  :root[data-ui="desk"] .rail-footer-links > .rail-profile-anchor::before {
    content: "";
    position: absolute;
    top: -9px;
    left: -1.5px;
    width: 46px;
    height: 9px;
    border: 1.5px solid var(--window-ink);
    border-bottom: 0;
    border-radius: 6px 9px 0 0;
    background: var(--folder-tab);
    pointer-events: none;
  }

  :root[data-ui="desk"] .rail-item-row > .rail-link,
  :root[data-ui="desk"] .rail-footer-links > [data-testid="nav-thoughts"],
  :root[data-ui="desk"] .rail-footer-links > [data-testid="nav-records"] {
    min-height: 40px;
    padding: 0 10px 0 11px;
    color: var(--folder-ink);
    font-size: 14px;
    line-height: 18px;
    font-weight: 600;
  }

  :root[data-ui="desk"] .rail-item-row > .rail-link {
    border-radius: 4px 10px 10px 10px;
    background: transparent;
  }

  :root[data-ui="desk"] .rail-link:hover,
  :root[data-ui="desk"] .rail-link.active,
  :root[data-ui="desk"] .rail-link[aria-current="page"] {
    color: var(--folder-ink);
    background: transparent;
  }

  :root[data-ui="desk"] .rail-footer-links > [data-testid="nav-thoughts"]:hover {
    background: var(--folder);
  }

  :root[data-ui="desk"] .rail-footer-links > [data-testid="nav-records"]:hover {
    background: var(--folder-small);
  }

  :root[data-ui="desk"] .side-rail .rail-link-main {
    gap: 9px;
  }

  :root[data-ui="desk"] .side-rail .rail-link-main .jp-icon,
  :root[data-ui="desk"] .side-rail .rail-link:hover .rail-link-main .jp-icon,
  :root[data-ui="desk"] .side-rail .rail-link.active .rail-link-main .jp-icon {
    width: 17px;
    height: 17px;
    color: var(--folder-ink);
  }

  :root[data-ui="desk"] .rail-item-row:hover,
  :root[data-ui="desk"] .rail-footer-links > [data-testid="nav-thoughts"]:hover,
  :root[data-ui="desk"] .rail-footer-links > [data-testid="nav-records"]:hover,
  :root[data-ui="desk"] .rail-footer-links > .rail-profile-anchor:hover {
    box-shadow: var(--desk-hard);
  }

  /* The open folder: the section's tint, a little toward the window, above its neighbours. */
  :root[data-ui="desk"] .rail-item-row.is-active-row,
  :root[data-ui="desk"] .rail-footer-links > .rail-link.active,
  :root[data-ui="desk"] .rail-footer-links > .rail-profile-anchor.active {
    z-index: 2;
    margin-right: -6px;
    background: var(--tint-current, var(--folder-open));
    box-shadow: var(--desk-hard);
    transform: translateX(6px);
  }

  :root[data-ui="desk"] .rail-item-row.is-active-row::before,
  :root[data-ui="desk"] .rail-footer-links > .rail-link.active::before,
  :root[data-ui="desk"] .rail-footer-links > .rail-profile-anchor.active::before {
    background: var(--tint-current, var(--folder-open));
  }

  /* Keyboard focus on a folder: a cream ring on the desk around the whole folder. */
  :root[data-ui="desk"] .rail-item-row > .rail-link:focus-visible {
    outline: none;
  }

  :root[data-ui="desk"] .rail-item-row:has(> .rail-link:focus-visible),
  :root[data-ui="desk"] .rail-footer-links > [data-testid="nav-thoughts"]:focus-visible,
  :root[data-ui="desk"] .rail-footer-links > [data-testid="nav-records"]:focus-visible,
  :root[data-ui="desk"] .rail-footer-links > .rail-profile-anchor:focus-visible {
    outline: 2px solid var(--desk-text);
    outline-offset: 3px;
  }

  /* Only Roles carries a count: a round label on the folder's corner. */
  :root[data-ui="desk"] .rail-item-row .rail-count {
    position: absolute;
    top: -10px;
    right: -8px;
    min-width: 22px;
    padding: 0 6px;
    border: 1.5px solid var(--window-ink);
    border-radius: 999px;
    background: var(--page);
    color: var(--ink);
    font-size: 12px;
    line-height: 18px;
  }

  :root[data-ui="desk"] .rail-chevron-btn {
    flex: 0 0 30px;
    height: 30px;
    margin-right: 5px;
    border-radius: 8px;
    color: var(--folder-ink);
  }

  :root[data-ui="desk"] .rail-chevron-btn:hover,
  :root[data-ui="desk"] .rail-chevron-btn:focus-visible {
    background: var(--desk-ink-wash);
    color: var(--folder-ink);
  }

  :root[data-ui="desk"] .rail-chevron-btn:focus-visible {
    outline: 2px solid var(--window-ink);
    outline-offset: -2px;
  }

  /* The folder's contents: its sub-items on a sheet of paper under the folder. */
  :root[data-ui="desk"] .rail-subnav {
    gap: 1px;
    margin: 0 4px 0 10px;
    padding: 6px 5px 5px;
    border: 1.5px solid var(--window-ink);
    border-top: 0;
    border-radius: 0 0 10px 10px;
    background: var(--paper);
    box-shadow: var(--desk-hard-sm);
  }

  :root[data-ui="desk"] .rail-item-row.is-active-row + .rail-subnav {
    margin-right: -2px;
    transform: translateX(6px);
  }

  :root[data-ui="desk"] .rail-sublink {
    min-height: 28px;
    padding: 4px 8px;
    border-radius: 6px;
    color: var(--ink-2);
    font-size: 13px;
    line-height: 17px;
  }

  :root[data-ui="desk"] .rail-sublink:hover {
    background: var(--wash);
    color: var(--ink);
  }

  :root[data-ui="desk"] .rail-sublink.active,
  :root[data-ui="desk"] .rail-sublink[aria-current="page"] {
    background: var(--tint-current, var(--wash));
    color: var(--ink);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--window-ink);
  }

  :root[data-ui="desk"] .rail-sublink:focus-visible {
    outline: 2px solid var(--navy);
    outline-offset: -2px;
  }

  /* The footer's children join the shelf: My Thoughts sits right after the Resume folder, Career records starts the low
     shelf at the bottom, then the profile folder, Admin console and Sign out. The DOM order is unchanged. */
  :root[data-ui="desk"] .side-rail .rail-footer,
  :root[data-ui="desk"] .side-rail .rail-footer-links {
    display: contents;
  }

  :root[data-ui="desk"] .rail-footer-links > [data-testid="nav-records"],
  :root[data-ui="desk"] .rail-footer-links > .rail-profile-anchor {
    --folder-tab: var(--folder-small);
    background: var(--folder-small);
  }

  /* My Thoughts keeps room below it for the shelf line, however full the shelf is. */
  :root[data-ui="desk"] .rail-footer-links > [data-testid="nav-thoughts"] {
    margin-bottom: 12px;
  }

  :root[data-ui="desk"] .rail-footer-links > [data-testid="nav-records"] {
    margin-top: auto;
    min-height: 34px;
    font-size: 13px;
  }

  /* The line across the shelf above the low folders. */
  :root[data-ui="desk"] .rail-footer-links > [data-testid="nav-records"]::after {
    content: "";
    position: absolute;
    top: -20px;
    right: -4px;
    left: -4px;
    height: 2px;
    background: var(--desk-line);
    pointer-events: none;
  }

  :root[data-ui="desk"] .rail-footer-links > .rail-profile-anchor {
    padding: 6px 8px;
    gap: 7px;
  }

  :root[data-ui="desk"] .rail-footer-links > .rail-profile-anchor:hover,
  :root[data-ui="desk"] .rail-footer-links > .rail-profile-anchor.active,
  :root[data-ui="desk"] .rail-footer-links > .rail-profile-anchor[aria-current="page"] {
    border-color: var(--window-ink);
    color: var(--folder-ink);
  }

  :root[data-ui="desk"] .rail-footer-links > .rail-profile-anchor:hover {
    background: var(--folder-small);
  }

  :root[data-ui="desk"] .rail-footer-links > .rail-profile-anchor .rail-avatar {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    font-size: 10px;
  }

  :root[data-ui="desk"] .rail-footer-links > .rail-profile-anchor .jp-icon {
    color: var(--folder-ink);
  }

  :root[data-ui="desk"] .side-rail .rail-footer-util {
    min-height: 32px;
    margin-top: -8px;
    padding: 0 6px;
    border-radius: 8px;
    color: var(--desk-text);
    font-size: 13px;
    font-weight: 500;
  }

  :root[data-ui="desk"] .side-rail .rail-footer-util:hover {
    background: var(--desk-hover);
    color: var(--desk-text);
    text-decoration: underline;
  }

  /* The window. The title bar stays at the top; the screen scrolls inside the window. */
  :root[data-ui="desk"] .main-column {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border: 2.5px solid var(--window-ink);
    border-radius: 18px;
    background: var(--window-bg);
    box-shadow: var(--window-shadow);
    overflow: hidden;
  }

  /* position: relative makes the window's scroll area the containing block of absolutely placed parts (screen-reader
     labels, pop-overs), so they scroll and clip with the window instead of stretching the page. */
  :root[data-ui="desk"] .main-column > main {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  :root[data-ui="desk"] .main-column > main .main-content {
    margin-inline: auto;
  }

  :root[data-ui="desk"] .top-bar,
  :root[data-ui="desk"] body.has-view-as .top-bar {
    position: relative;
    top: auto;
    flex: 0 0 auto;
    padding: 0 14px 0 18px;
  }

  :root[data-ui="desk"] .top-bar-title {
    font-size: 17px;
  }

  /* The Resume assistant dock opens as a second window beside the first; its 52px header lines up with the title bar. */
  :root[data-ui="desk"] .v7-right-dock.is-open,
  :root[data-ui="desk"] body.has-view-as .v7-right-dock.is-open {
    position: relative;
    top: auto;
    align-self: stretch;
    height: auto;
    margin-left: 14px;
    border: 2.5px solid var(--window-ink);
    border-radius: 18px;
    background: var(--window-bg);
    box-shadow: var(--window-shadow);
    overflow: hidden;
  }

  :root[data-ui="desk"] .v7-right-dock .v7-controls-head {
    border-bottom: 2px solid var(--window-ink);
    background: var(--tint-current);
  }
}

/* ---- Phone: full-bleed flat paper and a floating dock ------------------------------------------------------------ */
@media (max-width: 899px) {
  :root[data-ui="desk"] .app-shell {
    padding-bottom: var(--desk-dock-clear);
    background: var(--window-bg);
  }

  :root[data-ui="desk"] .top-bar-report-btn,
  :root[data-ui="desk"] .mobile-profile-btn {
    width: 44px;
    min-width: 44px;
    height: 44px;
  }

  :root[data-ui="desk"] .bottom-bar {
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    left: 10px;
    gap: 2px;
    min-height: 64px;
    padding: 5px 4px;
    border: 1.5px solid var(--window-ink);
    border-radius: 16px;
    background: var(--desk-dock-bg);
    box-shadow: var(--desk-dock-shadow);
  }

  :root[data-ui="desk"] .bottom-link {
    min-height: 50px;
    border: 1.5px solid transparent;
    border-radius: 10px;
    color: var(--ink-2);
    font-size: 11px;
    font-weight: 600;
  }

  :root[data-ui="desk"] .bottom-link.active,
  :root[data-ui="desk"] .bottom-link[aria-current="page"] {
    border-color: var(--window-ink);
    background: var(--folder-open);
    color: var(--ink);
    box-shadow: var(--desk-dock-active-shadow);
  }

  :root[data-ui="desk"] .bottom-link:focus-visible {
    outline: 2px solid var(--navy);
    outline-offset: 1px;
  }

  :root[data-ui="desk"] .bottom-link-count {
    top: 1px;
    left: calc(50% + 6px);
    min-width: 18px;
    height: 17px;
    padding: 0 4px;
    border: 1.5px solid var(--window-ink);
    background: var(--page);
    color: var(--ink);
    font-size: 10px;
  }

  :root[data-ui="desk"] .toast {
    bottom: calc(var(--desk-dock-clear) + 8px);
  }

  /* One column that may shrink below its content's widest line (a long select option), so nothing in the window is
     wider than a 320px phone. The classic look has the same gap in base.css (reported, not changed here). */
  :root[data-ui="desk"] .detail-grid,
  :root[data-ui="desk"] .detail-grid-equal {
    grid-template-columns: minmax(0, 1fr);
  }

  /* A button is never wider than the space it sits in: a long label wraps onto a second line instead. */
  :root[data-ui="desk"] .main-column .btn {
    max-width: 100%;
    white-space: normal;
    text-align: center;
  }

  /* The local sections (Apply, Resume) as the prototype's row of pills under the title bar. */
  :root[data-ui="desk"] .v7-mobile-only-tabs {
    padding: 8px 10px;
    border-bottom: 1.5px solid var(--window-ink);
    background: var(--paper);
  }

  :root[data-ui="desk"] .v7-mobile-subtab {
    border: 1.5px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: var(--ink-2);
  }

  :root[data-ui="desk"] .v7-mobile-subtab.active,
  :root[data-ui="desk"] .v7-mobile-subtab[aria-current="page"] {
    border-color: var(--window-ink);
    background: var(--tint-current);
    color: var(--ink);
    font-weight: 600;
    box-shadow: var(--desk-dock-active-shadow);
  }
}

/* ---- Motion: only when the person has not asked for less ---------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  :root[data-ui="desk"] .rail-item-row,
  :root[data-ui="desk"] .rail-subnav,
  :root[data-ui="desk"] .rail-footer-links > [data-testid="nav-thoughts"],
  :root[data-ui="desk"] .rail-footer-links > [data-testid="nav-records"],
  :root[data-ui="desk"] .rail-footer-links > .rail-profile-anchor {
    transition: transform 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
  }

  :root[data-ui="desk"] .rail-item-row:not(.is-active-row):hover,
  :root[data-ui="desk"] .rail-footer-links > [data-testid="nav-thoughts"]:not(.active):hover,
  :root[data-ui="desk"] .rail-footer-links > [data-testid="nav-records"]:not(.active):hover,
  :root[data-ui="desk"] .rail-footer-links > .rail-profile-anchor:not(.active):hover {
    transform: translate(-1px, -2px);
  }

  /* The open folder steps toward the window each time a screen opens. */
  @starting-style {
    :root[data-ui="desk"] .rail-item-row.is-active-row,
    :root[data-ui="desk"] .rail-item-row.is-active-row + .rail-subnav,
    :root[data-ui="desk"] .rail-footer-links > .rail-link.active,
    :root[data-ui="desk"] .rail-footer-links > .rail-profile-anchor.active {
      transform: none;
    }
  }
}

@media (prefers-reduced-motion: no-preference) and (min-width: 900px) {
  /* The window opens once, when the app first appears. */
  :root[data-ui="desk"] .main-column.is-opening {
    transition: transform 260ms cubic-bezier(0.2, 0.8, 0.3, 1), opacity 200ms ease;
  }

  @starting-style {
    :root[data-ui="desk"] .main-column.is-opening {
      opacity: 0;
      transform: translateY(14px) scale(0.985);
    }
  }
}
