/*
  Caelion workspace · v5 · how each design system reads the suite

  systems.css gives Material 3, Fluent 2 and Liquid Glass their buttons, fields, cards and
  tables. This file is their reading of what is new in v5: the app rail, the sidebar of the
  app you are in, the top bar, the phone's tab bar, the tab strip and filters on a list, Home,
  and the agent window. Each system keeps to its own habits here rather than borrowing
  Space Gold's:

    Material 3    a navigation rail and drawer with pill indicators in the secondary
                  container; a search bar; tonal and filled buttons; filled cards.
    Fluent 2      Mica behind the window; 4px controls; the short accent bar beside what is
                  selected; fields that underline when they have focus.
    Liquid Glass  content on a plain ground, and the navigation layer above it as glass:
                  a floating sidebar, a capsule toolbar, capsule controls.
*/

/* ========================================================================================
   Material 3
   ======================================================================================== */

:root[data-layout="v5"][data-ds="material"] {
  .w5-shell {
    --apps-w: 80px;
    --side-w: 256px;
  }

  /* Navigation rail: the active destination's icon sits in a pill */
  .w5-apps {
    padding-top: 14px;
    gap: 10px;
  }

  .w5-apps-list {
    gap: 8px;
  }

  .w5-app {
    gap: 4px;
    padding: 2px;
  }

  .w5-app-glyph {
    width: 56px;
    height: 32px;
    border-radius: 16px;
    transition: background-color var(--d-2) var(--e-inout), width var(--d-2) var(--e-inout);
  }

  .w5-app .icon {
    width: 22px;
    height: 22px;
  }

  .w5-app-name {
    font-size: .75rem;
    font-weight: 560;
    letter-spacing: .03em;
    color: var(--t-2);
  }

  .w5-app[aria-current="true"] .w5-app-glyph {
    background: var(--m-sec);
    color: var(--m-on-sec);
    box-shadow: none;
  }

  .w5-app[aria-current="true"] .w5-app-name {
    font-weight: 700;
    color: var(--t-1);
  }

  .w5-badge {
    background: var(--bad);
    color: #fff;
    box-shadow: none;
  }

  /* in the dark theme the error role is a light fill, and what stands on it is dark */
  &[data-theme="dark"] .w5-badge {
    color: oklch(.24 .07 28);
  }

  /* Navigation drawer */
  .w5-side {
    padding: 12px 12px 12px 0;
  }

  .w5-company > summary {
    min-height: 56px;
    padding: 8px 12px;
    border-radius: 28px;
  }

  .w5-org-mark {
    border-radius: 12px;
    background: var(--a-fill);
    color: var(--a-on);
    box-shadow: none;
  }

  .w5-nav-label {
    padding-left: 16px;
    font-size: .84rem;
    font-weight: 560;
    letter-spacing: .006em;
    color: var(--t-2);
  }

  .w5-nav ul {
    gap: 0;
  }

  .w5-nav a {
    gap: 12px;
    padding: 0 20px 0 16px;
    border-radius: 999px;
    font-size: .875rem;
    letter-spacing: .006em;
  }

  .w5-nav a .icon {
    width: 20px;
    height: 20px;
    color: var(--t-2);
  }

  .w5-nav a[aria-current="page"] {
    background: var(--m-sec);
    color: var(--m-on-sec);
    font-weight: 650;
    box-shadow: none;
  }

  .w5-nav a[aria-current="page"] .icon {
    color: var(--m-on-sec);
  }

  .w5-side-note {
    border: 0;
    border-radius: 16px;
    background: var(--s-1);
  }

  /* Top app bar: it sits on the frame, and holds the search bar */
  .w5-top {
    padding: 0 6px 0 4px;
    border: 0;
    border-radius: 0;
    background: var(--s-frame);
  }

  /* it is part of the frame: there are no corners to keep round */
  .w5-top::before,
  .w5-top::after {
    content: none;
  }

  body.scrolled & .w5-top {
    border-bottom-color: transparent;
  }

  .w5-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
  }

  .w5-crumb {
    font-size: .92rem;
  }

  .w5-search {
    width: min(440px, 36vw);
    /* by the bar's own width where the browser can: the agent window docked beside it takes a third of the screen */
    width: min(440px, 36cqw);
    height: 44px;
    padding: 0 8px 0 16px;
    border: 0;
    border-radius: 999px;
    background: var(--s-2);
    font-size: .94rem;
  }

  .w5-search .icon {
    width: 20px;
    height: 20px;
  }

  .w5-search kbd {
    border: 0;
    background: transparent;
  }

  @container w5top (max-width: 600px) {
    .w5-search {
      width: 40px;
      height: 40px;
      padding: 0;
      background: none;
    }
  }

  /* the agent's door: a tonal button */
  .w5-ask {
    height: 40px;
    padding: 0 18px 0 12px;
    border: 0;
    border-radius: 999px;
    background: var(--m-pri-c);
    color: var(--m-on-pri-c);
    box-shadow: none;
  }

  .w5-ask:hover {
    background: color-mix(in oklch, var(--m-pri-c) 92%, var(--m-on-pri-c));
  }

  .w5-ask[aria-expanded="true"] {
    background: var(--m-sec);
    color: var(--m-on-sec);
  }

  /* its name gone, the mark sits in a round button */
  @container w5top (max-width: 780px) {
    .w5-ask {
      justify-content: center;
      width: 40px;
      padding: 0;
    }
  }

  /* Primary tabs: the indicator takes the primary colour */
  .w5-links {
    border-bottom-color: var(--b-0);
  }

  .w5-links > :is(a, span) {
    padding: 12px 16px 13px;
    font-size: .875rem;
    font-weight: 600;
    letter-spacing: .006em;
  }

  .w5-links > :first-child {
    padding-left: 16px;
  }

  .w5-links > [aria-current] {
    color: var(--a-ink);
  }

  .w5-links > [aria-current]::after,
  .w5-links > [aria-current]:first-child::after {
    right: 16px;
    left: 16px;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--a-fill);
  }

  /* Filter chips */
  .filterbar > .w5-filter {
    border-color: var(--m-outline);
    border-radius: 8px;
    background: transparent;
    box-shadow: none;
  }

  .filterbar > .w5-filter.is-set {
    border-color: transparent;
    background: var(--m-sec);
    color: var(--m-on-sec);
  }

  .filterbar .search-field {
    height: 40px;
    border: 0;
    border-radius: 999px;
    background: var(--s-2);
  }

  /* Home: the widgets take their shapes from the tokens (static/v5/home.css). What is said here is
     Material's own: the doors of the dock are themed icons, a widget put away is an assist chip,
     and the tools of a widget being arranged stand on a raised tonal surface with no outline */
  .h5a-plate {
    border-radius: 14px;
    background: var(--m-pri-c);
    color: var(--m-on-pri-c);
  }

  .h5-chip {
    height: 32px;
    border-color: var(--m-outline);
    border-radius: 8px;
    background: transparent;
    box-shadow: none;
  }

  .h5-chip .icon {
    color: var(--a-ink);
  }

  .h5w-tools {
    background: var(--s-3);
    box-shadow: var(--sh-2);
  }

  /* The agent window */
  .a6 :is(.a6-nav, .a6-agent, .a6-recent) {
    border-radius: 999px;
  }

  .a6 :is(.a6-nav, .a6-agent, .a6-recent)[aria-current] {
    background: var(--m-sec);
    color: var(--m-on-sec);
  }

  .a6-nav[aria-current] .icon {
    color: var(--m-on-sec);
  }

  .a6 .icon-btn {
    border-radius: 50%;
  }

  .a6 .bubble {
    border-radius: 20px 20px 4px 20px;
    background: var(--m-sec);
    color: var(--m-on-sec);
    box-shadow: none;
  }

  .a6 .assistant-compose {
    border: 0;
    border-radius: 28px;
    background: var(--s-2);
    box-shadow: none;
  }

  .a6 .assistant-compose:focus-within {
    box-shadow: inset 0 0 0 2px var(--a-fill);
  }

  .a6 .assistant-send:not([data-empty="true"], :disabled) {
    background: var(--a-fill);
    color: var(--a-on);
  }

  .a6 .a6-moon-btn[aria-pressed="true"] {
    background: var(--m-sec);
    color: var(--m-on-sec);
  }

  .a6 .approval {
    border: 0;
    border-radius: 20px;
    background: var(--m-pri-c);
    color: var(--m-on-pri-c);
  }

  .a6 .approval-head > .icon {
    color: var(--m-on-pri-c);
  }

  .a6 .approval-body small {
    color: color-mix(in oklch, var(--m-on-pri-c) 78%, transparent);
  }

  .a6 .approval-btn {
    height: 36px;
    padding: 0 18px;
    border-radius: 999px;
  }

  .a6 .approval-btn.primary {
    border: 0;
    background: var(--a-fill);
    color: var(--a-on);
    box-shadow: none;
  }

  .a6 .approval-btn.quiet {
    border-color: var(--m-outline);
    background: transparent;
    color: var(--m-on-pri-c);
  }

  .a6 .approval-pill {
    background: var(--a-fill);
    color: var(--a-on);
  }

  .a6 .approval[data-decision] {
    background: var(--s-1);
    color: var(--t-1);
  }

  .a6 .plan,
  .a6-routine,
  .a6-mode {
    border: 0;
    border-radius: 16px;
    background: var(--s-1);
  }

  .a6-mode[aria-checked="true"] {
    background: var(--m-sec);
    color: var(--m-on-sec);
  }

  .a6-mode[aria-checked="true"] .a6-radio {
    box-shadow: inset 0 0 0 5px var(--a-fill);
  }

  .a6 .menu-item[aria-checked="true"] .switch,
  .a6-switch[aria-checked="true"] {
    background: var(--a-fill);
  }

  .a6 .compose-popover {
    border: 0;
    border-radius: 16px;
    background: var(--s-2);
  }

  .a6 :is(.menu-item, .slash-item) {
    border-radius: 12px;
  }

  .a6-seg {
    border-radius: 999px;
  }

  .a6-seg button {
    border-radius: 999px;
  }

  .a6-seg button[aria-checked="true"] {
    background: var(--m-sec);
    color: var(--m-on-sec);
    box-shadow: none;
  }

  /* the model in the message box, and its effort scale: the knob is the primary colour, as an M3
     slider's handle is, with a state layer round it under a hand */
  .a6 .mode-chip,
  .a6 .a6-model {
    border-radius: 999px;
  }

  .a6 .effort {
    --effort-knob: var(--a-fill);
    --effort-pip: var(--a-on);
  }

  .a6 .effort-thumb {
    box-shadow: 0 1px 2px oklch(0 0 0 / .3), 0 1px 3px 1px oklch(0 0 0 / .15);
  }

  .a6 .effort[data-held] .effort-thumb {
    box-shadow: 0 0 0 9px color-mix(in oklch, var(--a-fill) 16%, transparent), 0 1px 2px oklch(0 0 0 / .3), 0 2px 6px 2px oklch(0 0 0 / .15);
  }
}

@media (max-width: 859px) {
  :root[data-layout="v5"][data-ds="material"] {
    /* Navigation bar: the active tab's icon in a pill */
    .w5-tab[aria-current="true"] .icon,
    .w5-tab.is-current .icon {
      box-sizing: content-box;
      padding: 4px 20px;
      border-radius: 16px;
      background: var(--m-sec);
      color: var(--m-on-sec);
    }
  }
}

/* ========================================================================================
   Fluent 2
   ======================================================================================== */

:root[data-layout="v5"][data-ds="fluent"] {
  .w5-shell {
    --side-w: 248px;
  }

  /* Mica: the window's base takes a breath of the accent and of its opposite */
  body {
    --w5-ground: linear-gradient(120deg, var(--mica-a), var(--s-frame) 46%, var(--mica-b)) fixed;
    background: var(--w5-ground);
  }

  .w5-apps {
    gap: 4px;
  }

  .w5-app-glyph {
    width: 44px;
    height: 36px;
    border-radius: 6px;
  }

  .w5-app-name {
    font-size: .68rem;
    letter-spacing: 0;
  }

  .w5-app[aria-current="true"] .w5-app-glyph {
    background: var(--f-selected);
    color: var(--a-ink);
    box-shadow: none;
  }

  /* the short accent bar beside what is selected */
  .w5-app[aria-current="true"]::before,
  .w5-nav a[aria-current="page"]::before,
  .a6 :is(.a6-nav, .a6-agent, .a6-recent)[aria-current]::before {
    content: "";
    position: absolute;
    left: 0;
    width: 3px;
    height: 16px;
    border-radius: 2px;
    background: var(--a-fill);
  }

  .w5-app[aria-current="true"]::before {
    top: 13px;
    left: 5px;
  }

  .w5-nav a {
    position: relative;
    border-radius: 4px;
    font-size: .88rem;
    letter-spacing: 0;
  }

  .w5-nav a[aria-current="page"] {
    background: var(--f-selected);
    font-weight: 600;
    box-shadow: none;
  }

  .w5-nav a[aria-current="page"]::before {
    top: calc(50% - 8px);
  }

  .w5-nav a[aria-current="page"] .icon {
    color: var(--a-ink);
  }

  .w5-company > summary {
    border-radius: 4px;
  }

  .w5-org-mark {
    border-radius: 4px;
  }

  .w5-side-note {
    border-radius: 4px;
  }

  /* the pane runs to the window's edge here and has no edge of its own for the bar to lie over: the
     bar's right side had stood a pixel outside the window, and every page slid sideways by it */
  .w5-top {
    margin-right: 0;
    border-right: 0;
    border-radius: var(--r-pane) var(--r-pane) 0 0;
  }

  .w5-top::after {
    right: 0;
  }

  .w5-icon-btn {
    border-radius: 4px;
  }

  /* a text field: a firmer edge underneath, the accent when it has focus */
  .w5-search {
    border-radius: 4px;
    border-color: var(--b-1);
    border-bottom-color: var(--b-2);
    background: var(--s-1);
  }

  @container w5top (max-width: 600px) {
    .w5-search {
      border-color: transparent;
      background: none;
    }
  }

  .w5-ask {
    border-radius: 4px;
    box-shadow: none;
  }

  .w5-links > [aria-current]::after,
  .w5-links > [aria-current]:first-child::after {
    right: 12px;
    left: 12px;
    height: 3px;
    border-radius: 3px;
    background: var(--a-fill);
  }

  .w5-links > [aria-current]:first-child::after {
    left: 4px;
  }

  .filterbar .search-field,
  .filterbar > .w5-filter {
    border-radius: 4px;
    border-bottom-color: var(--b-2);
    box-shadow: none;
  }

  .filterbar .search-field:focus-within,
  .filterbar > .w5-filter:focus-within {
    border-color: var(--b-1);
    border-bottom-color: var(--a-fill);
    box-shadow: inset 0 -1px 0 var(--a-fill);
  }

  /* Home: the widgets take their shapes from the tokens (static/v5/home.css). Fluent's own: a
     door's plate has the surface corner, and a widget put away is a button, square as the rest */
  .h5a-plate {
    border-radius: 8px;
  }

  .h5-chip {
    padding: 0 12px 0 8px;
    border-radius: var(--r-ctl);
    border-bottom-color: var(--b-2);
    box-shadow: none;
  }

  /* The agent window */
  .a6 :is(.a6-nav, .a6-agent, .a6-recent) {
    position: relative;
    border-radius: 4px;
  }

  .a6 :is(.a6-nav, .a6-agent, .a6-recent)[aria-current]::before {
    top: calc(50% - 8px);
  }

  .a6 .icon-btn,
  .a6 .mode-chip,
  .a6 .a6-model,
  .a6 .usage-ring,
  .a6 .foot-btn,
  .a6 .work-toggle {
    border-radius: 4px;
  }

  .a6 .bubble {
    border-radius: 8px;
  }

  .a6 .assistant-compose {
    border-radius: 8px;
    border-bottom-color: var(--b-2);
    box-shadow: var(--sh-2);
  }

  .a6 .assistant-compose:focus-within {
    border-color: var(--b-1);
    border-bottom-color: var(--a-fill);
    box-shadow: var(--sh-2), inset 0 -2px 0 var(--a-fill);
  }

  .a6 .assistant-send {
    border-radius: 4px;
  }

  .a6 .assistant-send:not([data-empty="true"], :disabled) {
    background: var(--a-fill);
    color: var(--a-on);
  }

  .a6 .approval {
    border-radius: 8px;
  }

  .a6 .approval-btn {
    height: 32px;
    border-radius: 4px;
  }

  .a6 .approval-btn.primary {
    border-color: transparent;
    background: var(--a-fill);
    color: var(--a-on);
    box-shadow: none;
  }

  .a6 .approval-pill,
  .a6 .step-detail,
  .a6-chip {
    border-radius: 4px;
  }

  .a6 .plan,
  .a6-routine,
  .a6-mode,
  .a6-table,
  .a6 .compose-popover {
    border-radius: 8px;
  }

  .a6 :is(.menu-item, .slash-item),
  .a6-skill,
  .a6-result {
    border-radius: 4px;
  }

  .a6-mode[aria-checked="true"] {
    border-color: var(--a-fill);
  }

  .a6-mode[aria-checked="true"] .a6-radio {
    box-shadow: inset 0 0 0 5px var(--a-fill);
  }

  .a6 .menu-item[aria-checked="true"] .switch,
  .a6-switch[aria-checked="true"] {
    background: var(--a-fill);
  }

  .a6-seg,
  .a6-seg button {
    border-radius: 4px;
  }

  /* the effort scale: squarer ends to the bar, and the accent at the heart of the knob, as a
     Fluent slider's thumb has it (it gives way to the four pips at Ultra) */
  .a6 .effort {
    --effort-track-r: 4px;
  }

  .a6 .effort-scale {
    border-radius: 4px;
  }

  .a6 .effort-thumb::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    border-radius: 50%;
    background: var(--a-fill);
    opacity: calc(1 - var(--open, 0));
    transition: scale var(--d-1) var(--e-out);
  }

  .a6 .effort[data-held] .effort-thumb::after {
    scale: .8;
  }

  /* flyouts are Acrylic */
  &:not([data-translucency="off"]) :is(.a6 .compose-popover, .w5-account) {
    background: color-mix(in oklch, var(--s-3) 78%, transparent);
    -webkit-backdrop-filter: blur(30px) saturate(1.25);
    backdrop-filter: blur(30px) saturate(1.25);
  }
}

/* ========================================================================================
   Liquid Glass
   ======================================================================================== */

:root[data-layout="v5"][data-ds="glass"] {
  --glass: var(--lg-tint);
  --glass-edge: var(--lg-shadow), inset 0 0 0 1px var(--lg-rim-2), inset 0 1px 0 var(--lg-rim);
  --glass-filter: blur(max(var(--lg-blur), 14px)) saturate(var(--lg-sat));

  /* a ground with a little colour in it, so the glass has something to hold */
  body {
    --w5-ground:
      radial-gradient(70% 55% at 0 0, color-mix(in oklch, var(--a-fill) 16%, transparent), transparent 70%) fixed,
      radial-gradient(60% 60% at 100% 100%, oklch(.82 .07 250 / .2), transparent 70%) fixed,
      var(--s-frame);
    background: var(--w5-ground);
  }

  .w5-shell {
    --side-w: 252px;
  }

  /* the sidebar of the app you are in floats: a sheet of glass, inset from the window's edge */
  .w5-side {
    margin: var(--frame) 10px var(--frame) 0;
    padding: 10px 8px 12px;
    border-radius: 24px;
    background: var(--glass);
    -webkit-backdrop-filter: var(--glass-filter);
    backdrop-filter: var(--glass-filter);
    box-shadow: var(--glass-edge);
  }

  .w5-shell.is-slim .w5-side {
    margin-inline: 0;
  }

  .w5-side > * {
    padding-right: 0;
  }

  .w5-app-glyph {
    width: 44px;
    height: 36px;
    border-radius: 999px;
  }

  .w5-app[aria-current="true"] .w5-app-glyph {
    background: var(--lg-tint-strong);
    color: var(--t-1);
    box-shadow: var(--glass-edge);
  }

  .w5-nav a {
    border-radius: 999px;
    padding: 0 14px 0 12px;
  }

  .w5-nav a[aria-current="page"] {
    background: var(--lg-tint-strong);
    box-shadow: inset 0 0 0 1px var(--lg-rim-2), inset 0 1px 0 var(--lg-rim), 0 1px 3px var(--lg-shade);
  }

  .w5-nav a[aria-current="page"] .icon {
    color: var(--t-1);
  }

  .w5-company > summary {
    border-radius: 18px;
  }

  .w5-side-note {
    border-radius: 16px;
    background: var(--s-well);
    border-color: transparent;
  }

  /* content rests on the ground itself */
  .work-area {
    margin-left: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  /* the toolbar: a capsule of glass the page scrolls beneath */
  .w5-top {
    top: var(--frame);
    height: 52px;
    margin: 0 4px;
    padding: 0 8px;
    border: 0;
    border-radius: 999px;
    background: var(--glass);
    -webkit-backdrop-filter: var(--glass-filter);
    backdrop-filter: var(--glass-filter);
    box-shadow: var(--glass-edge);
  }

  body.scrolled & .w5-top {
    border-bottom-color: transparent;
  }

  /* a capsule has no corners to keep: the page passes beneath it and round its ends */
  .w5-top::before,
  .w5-top::after {
    content: none;
  }

  .w5-icon-btn {
    border-radius: 50%;
  }

  .w5-search {
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: var(--s-well);
  }

  @container w5top (max-width: 600px) {
    .w5-search {
      width: 36px;
      background: none;
    }
  }

  .w5-ask {
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: var(--lg-tint-strong);
    box-shadow: inset 0 0 0 1px var(--lg-rim-2), inset 0 1px 0 var(--lg-rim), 0 1px 3px var(--lg-shade);
  }

  .w5-links > [aria-current]::after {
    height: 3px;
    border-radius: 3px;
  }

  .filterbar .search-field,
  .filterbar > .w5-filter {
    border-radius: 999px;
  }

  .filterbar > .w5-filter :is(select, input) {
    border-radius: 0 999px 999px 0;
  }

  /* Home: the widgets take their shapes from the tokens (static/v5/home.css). Liquid Glass's own:
     a widget put away waits on the ground itself, so its chip is glass */
  .h5a-plate {
    border-radius: 13px;
  }

  .h5-chip {
    border: 0;
    background: var(--lg-tint-strong);
    box-shadow: inset 0 0 0 1px var(--lg-rim-2), inset 0 1px 0 var(--lg-rim), 0 1px 3px var(--lg-shade);
  }

  /* The agent window: a sheet of its own; its message box and menus are glass */
  .a6 :is(.a6-nav, .a6-agent, .a6-recent) {
    border-radius: 999px;
  }

  .a6 :is(.a6-nav, .a6-agent, .a6-recent)[aria-current] {
    background: var(--lg-tint-strong);
    box-shadow: inset 0 0 0 1px var(--lg-rim-2), inset 0 1px 0 var(--lg-rim), 0 1px 3px var(--lg-shade);
  }

  .a6 .icon-btn {
    border-radius: 50%;
  }

  .a6 .bubble {
    border-radius: 20px 20px 6px 20px;
  }

  .a6 .assistant-compose {
    border: 0;
    border-radius: 26px;
    background: var(--lg-tint-strong);
    -webkit-backdrop-filter: var(--glass-filter);
    backdrop-filter: var(--glass-filter);
    box-shadow: var(--glass-edge);
  }

  .a6 .assistant-compose:focus-within {
    box-shadow: var(--glass-edge), 0 0 0 3px color-mix(in oklch, var(--t-3) 16%, transparent);
  }

  /* it opens over the conversation from inside the composer's own glass, where it gets no blur:
     the menu's tint is solid */
  .a6 .compose-popover {
    border: 0;
    border-radius: 22px;
    background: var(--lg-tint-menu);
    -webkit-backdrop-filter: var(--glass-filter);
    backdrop-filter: var(--glass-filter);
    box-shadow: var(--lg-shadow), inset 0 0 0 1px var(--lg-rim-2), inset 0 1px 0 var(--lg-rim), var(--sh-3);
  }

  .a6 :is(.menu-item, .slash-item) {
    border-radius: 14px;
  }

  .a6 .approval {
    border-radius: 20px;
  }

  .a6 .approval-btn,
  .a6 .mode-chip,
  .a6 .a6-model {
    border-radius: 999px;
  }

  .a6 .plan,
  .a6-routine,
  .a6-mode,
  .a6-table {
    border-radius: 18px;
  }

  .a6-seg,
  .a6-seg button {
    border-radius: 999px;
  }

  /* the effort scale: the knob is glass, with a bright rim, and what is under it shows through softly */
  .a6 .effort {
    --effort-knob: linear-gradient(oklch(1 0 0 / .94), oklch(1 0 0 / .78));
  }

  .a6 .effort-thumb {
    box-shadow: inset 0 0 0 .5px oklch(1 0 0 / .9), inset 0 1px 0 oklch(1 0 0), 0 0 0 .5px oklch(0 0 0 / .14), 0 1px 3px oklch(0 0 0 / .2), 0 6px 14px -4px oklch(0 0 0 / .34);
    -webkit-backdrop-filter: blur(5px) saturate(1.5);
    backdrop-filter: blur(5px) saturate(1.5);
  }

  .a6 .effort[data-held] .effort-thumb {
    box-shadow: inset 0 0 0 .5px oklch(1 0 0 / .9), inset 0 1px 0 oklch(1 0 0), 0 0 0 .5px oklch(0 0 0 / .14), 0 2px 5px oklch(0 0 0 / .22), 0 10px 20px -4px oklch(0 0 0 / .42);
  }
}

@media (max-width: 859px) {
  :root[data-layout="v5"][data-ds="glass"] {
    .w5-side,
    .w5-shell.is-slim .w5-side {
      margin: 8px;
      top: 0;
      bottom: 0;
      border-radius: 28px;
      background: var(--lg-tint-strong);
    }

    .w5-top {
      top: 6px;
      margin: 0 8px;
    }

    /* the tab bar floats too */
    .w5-tabbar {
      right: 10px;
      bottom: max(10px, env(safe-area-inset-bottom));
      left: 10px;
      border: 0;
      border-radius: 999px;
      background: var(--lg-tint-strong);
      -webkit-backdrop-filter: var(--glass-filter);
      backdrop-filter: var(--glass-filter);
      box-shadow: var(--glass-edge);
    }
  }
}
