/*
  Caelion workspace · v5 · the suite shell

  The frame every page sits in. From the left: the app rail (Caelion's apps, your Moon,
  settings and you), the sidebar of the app you are in (headed by the company, whose
  workspace this is), and the sheet the page is laid on, with a top bar that says where you
  are, searches, and opens the agent.

  Everything here reads tokens (tokens.css), so the four design systems reshape the same
  markup; what a system needs beyond its tokens is in systems.css.
*/

:root[data-layout="v5"] {
  font-family: var(--font-ui);
  background: var(--s-frame);
  interpolate-size: allow-keywords;

  /*
    What the window stands on: flat for Space Gold and Material, Mica's breath of colour for
    Fluent, a ground with a little colour in it for Liquid Glass (systems-shell.css). Three things
    paint it: the page, the cap over the frame's top gap (it hides what scrolls up behind the top
    bar), and the two pieces that keep the sheet's top corners round while the page passes beneath
    the bar. The coloured grounds are fixed to the window, so the three line up exactly.
  */
  body {
    --w5-ground: var(--s-frame);
    background: var(--w5-ground);
    color: var(--t-1);
  }

  body:has(> .app-shell)::before {
    background: var(--w5-ground);
  }

  ::selection {
    background: color-mix(in oklch, var(--a-fill) 34%, transparent);
  }

  :focus-visible {
    outline: 2px solid var(--a-ring);
    outline-offset: 2px;
  }

  /*
    Whatever a link jumps to (a Moon's tabs, which open the page again at their strip; a section
    further down) lands just below the top bar, which stays where it is, and not behind it.
  */
  :target {
    scroll-margin-top: calc(var(--top-h) + var(--frame, 0px) + 12px);
  }

  /* ---------- Frame ---------- */

  .w5-shell {
    --apps-w: 68px;
    --side-w: 236px;
    --rail-w: calc(var(--apps-w) + var(--side-w));
    position: relative;
    isolation: isolate;
    transition: grid-template-columns var(--d-3) var(--e-drawer);
  }

  .w5-shell.is-slim {
    --side-w: 0px;
  }

  .w5-chrome {
    position: sticky;
    top: 0;
    z-index: 12;
    display: flex;
    height: 100dvh;
    min-width: 0;
    view-transition-name: rail;
  }

  .work-area {
    margin: var(--frame) var(--frame) var(--frame) 0;
    min-height: calc(100dvh - 2 * var(--frame));
    background: var(--s-base);
    border: 1px solid var(--b-1);
    border-radius: var(--r-pane);
    box-shadow: var(--sh-1);
  }

  .workspace-content {
    max-width: 1320px;
    padding: clamp(18px, 2vw, 28px) var(--pad) 88px;
  }

  /* ---------- The app rail ---------- */

  .w5-apps {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: var(--apps-w);
    padding: 12px 0 10px;
    gap: 6px;
  }

  .w5-apps-mark {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin-bottom: 8px;
    border-radius: 12px;
    transition: background-color var(--d-1) ease;
  }

  .w5-apps-mark > span {
    display: block;
    width: 30px;
    height: 30px;
  }

  .w5-apps-list {
    display: grid;
    gap: 2px;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .w5-apps-foot {
    margin-top: auto;
    justify-items: center;
  }

  .w5-app {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 3px;
    width: 100%;
    padding: 5px 2px 6px;
    border: 0;
    background: none;
    color: var(--t-3);
    font: inherit;
    cursor: pointer;
    transition: color var(--d-1) ease;
  }

  .w5-app-glyph {
    position: relative;
    display: grid;
    place-items: center;
    width: 40px;
    height: 32px;
    border-radius: var(--r-ctl);
    transition:
      background-color var(--d-1) ease,
      transform var(--d-1) var(--e-out);
  }

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

  .w5-app-name {
    font-size: .7rem;
    font-weight: 540;
    line-height: 1.15;
    letter-spacing: .005em;
  }

  .w5-app:hover {
    color: var(--t-1);
  }

  .w5-app:hover .w5-app-glyph {
    background: var(--f-hover);
  }

  .w5-app:active .w5-app-glyph {
    transform: scale(.94);
  }

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

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

  .w5-app[aria-current="true"] .icon .fill {
    fill: var(--icon-tint);
  }

  .w5-app[aria-current="true"] .w5-app-name {
    font-weight: 640;
  }

  .w5-app:focus-visible {
    outline: 0;
  }

  .w5-app:focus-visible .w5-app-glyph {
    outline: 2px solid var(--a-ring);
    outline-offset: 1px;
  }

  /* what waits on the Moon is counted on its glyph */
  .w5-badge {
    position: absolute;
    top: -3px;
    right: 0;
    display: grid;
    place-items: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--a-fill);
    color: var(--a-on);
    box-shadow: 0 0 0 2px var(--s-frame);
    font-size: .7rem;
    font-weight: 700;
    font-style: normal;
    line-height: 1;
  }

  .w5-me {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin-top: 6px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    cursor: pointer;
    transition: transform var(--d-1) var(--e-out);
  }

  .w5-me .avatar {
    width: 32px;
    height: 32px;
    font-size: .74rem;
    box-shadow: 0 0 0 1px var(--b-1);
    transition: box-shadow var(--d-1) ease;
  }

  .w5-me:hover .avatar,
  .w5-me[aria-expanded="true"] .avatar {
    box-shadow:
      0 0 0 2px var(--s-frame),
      0 0 0 3.5px var(--b-2);
  }

  .w5-me:active {
    transform: scale(.95);
  }

  /* ---------- The sidebar of the app you are in ---------- */

  .w5-side {
    position: relative;
    top: auto;
    flex: none;
    width: var(--side-w);
    height: auto;
    padding: 10px 8px 12px 2px;
    gap: 0;
    overflow: hidden;
    background: transparent;
    color: var(--t-1);
    view-transition-name: none;
    transition:
      width var(--d-3) var(--e-drawer),
      opacity var(--d-2) ease,
      visibility 0s;
  }

  .w5-shell.is-slim .w5-side {
    padding-inline: 0;
    opacity: 0;
    visibility: hidden;
    transition:
      width var(--d-3) var(--e-drawer),
      opacity var(--d-1) ease,
      visibility 0s var(--d-3);
  }

  .w5-side > * {
    min-width: calc(236px - 10px);
  }

  .w5-side-head {
    margin-bottom: 10px;
  }

  .w5-company {
    position: relative;
    margin: 0;
  }

  .w5-company > summary {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) 16px;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 6px 8px;
    border: 0;
    border-radius: var(--r-ctl);
    background: none;
    cursor: pointer;
    transition: background-color var(--d-1) ease;
  }

  .w5-company > summary:hover,
  .w5-company[open] > summary {
    background: var(--f-hover);
  }

  .w5-org-mark {
    width: 30px;
    height: 30px;
    overflow: hidden;
    border-radius: 8px;
    /* the company's color when it has set one (operations/branding.py), ink otherwise */
    background: var(--org, var(--t-1));
    color: var(--s-frame);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .02em;
    box-shadow: none;
  }

  .w5-org-mark[style*="--org"] {
    color: #fff;
  }

  /* its logo, when it has one, on a plate of its own so any logo reads in light and dark */
  .w5-org-mark.has-logo {
    background: #fff;
    box-shadow: inset 0 0 0 1px var(--b-1);
  }

  .w5-org-mark img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .w5-two-line {
    display: grid;
    min-width: 0;
    line-height: 1.25;
    text-align: left;
  }

  .w5-two-line b {
    overflow: hidden;
    font-size: .9rem;
    font-weight: 620;
    letter-spacing: -.008em;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--t-1);
  }

  .w5-two-line small {
    overflow: hidden;
    font-size: .78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--t-3);
  }

  .w5-company > summary > .icon {
    width: 15px;
    height: 15px;
    color: var(--t-4);
  }

  .w5-company .picker-options {
    inset: calc(100% + 6px) 0 auto 0;
    min-width: 0;
  }

  .w5-nav {
    flex: 1;
    min-height: 0;
    padding: 2px 0 10px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--b-2) transparent;
  }

  /* the app's name stands over its sections where a section has no heading of its own */
  .w5-nav-app,
  .w5-nav-label {
    margin: 0;
    padding: 0 10px;
    font-size: .76rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: .01em;
    color: var(--t-3);
  }

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

  .w5-nav-app:has(+ section > .w5-nav-label) {
    display: none;
  }

  .w5-nav-label {
    margin: 0 0 6px;
  }

  .w5-nav section + section {
    margin-top: 18px;
  }

  .w5-nav ul {
    display: grid;
    gap: 1px;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .w5-nav a {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-height: var(--h-nav);
    padding: 5px 10px;
    border-radius: var(--r-item);
    color: var(--t-2);
    font-size: .9rem;
    font-weight: 520;
    letter-spacing: -.004em;
    text-decoration: none;
    transition:
      background-color var(--d-1) ease,
      color var(--d-1) ease;
  }

  /* a long name takes a second line rather than losing its end ("Gastos y facturas de prov…") */
  .w5-nav a > span {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    line-height: 1.22;
    overflow-wrap: anywhere;
  }

  .w5-nav a .icon {
    width: 17px;
    height: 17px;
    color: var(--t-3);
    transition: color var(--d-1) ease;
  }

  .w5-nav a:hover {
    background: var(--f-hover);
    color: var(--t-1);
  }

  .w5-nav a:hover .icon {
    color: var(--t-2);
  }

  .w5-nav a:active {
    background: var(--f-press);
  }

  .w5-nav a[aria-current="page"] {
    background: var(--f-selected);
    color: var(--t-1);
    font-weight: 620;
    box-shadow: inset 0 0 0 1px var(--b-0);
  }

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

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

  .w5-side-note {
    margin: 8px 6px 0;
    padding: 10px 12px;
    border-radius: var(--r-ctl);
    background: var(--s-well);
    box-shadow: inset 0 0 0 1px var(--b-0);
    font-size: .78rem;
    line-height: 1.45;
    color: var(--t-3);
  }

  .w5-drawer-apps {
    display: none;
  }

  /* ---------- The top bar ---------- */

  .w5-top {
    /* the bar gives things up by its own width: the agent window docked beside it takes a third of the screen */
    container: w5top / inline-size;
    height: var(--top-h);
    gap: 6px;
    padding: 0 14px 0 12px;
    border-radius: var(--r-pane) var(--r-pane) 0 0;
    background: color-mix(in oklch, var(--s-base) 86%, transparent);
    border-bottom: 1px solid transparent;
  }

  body.scrolled & .w5-top {
    border-bottom-color: var(--b-0);
  }

  /* the corner pieces: the window's ground, cut to the sheet's own radius */
  .w5-top::before,
  .w5-top::after {
    width: var(--r-pane);
    height: var(--r-pane);
    background: var(--w5-ground);
    -webkit-mask-image: radial-gradient(circle at var(--turn), transparent calc(var(--r-pane) - .5px), #000 var(--r-pane));
    mask-image: radial-gradient(circle at var(--turn), transparent calc(var(--r-pane) - .5px), #000 var(--r-pane));
  }

  .w5-top::before {
    --turn: 100% 100%;
  }

  .w5-top::after {
    --turn: 0 100%;
  }

  .w5-icon-btn {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: var(--h-ctl-s);
    height: var(--h-ctl-s);
    padding: 0;
    border: 0;
    border-radius: var(--r-item);
    background: none;
    color: var(--t-3);
    cursor: pointer;
    transition:
      background-color var(--d-1) ease,
      color var(--d-1) ease,
      transform var(--d-1) var(--e-out);
  }

  .w5-icon-btn .icon {
    width: 17px;
    height: 17px;
  }

  .w5-icon-btn:hover {
    background: var(--f-hover);
    color: var(--t-1);
  }

  .w5-icon-btn:active {
    transform: scale(.94);
  }

  .w5-top .menu-toggle {
    display: none;
  }

  .w5-crumb {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    margin-left: 4px;
    font-size: .88rem;
    color: var(--t-3);
  }

  .w5-crumb a {
    flex: none;
    color: inherit;
    text-decoration: none;
    transition: color var(--d-1) ease;
  }

  .w5-crumb a:hover {
    color: var(--t-1);
  }

  .w5-crumb > span {
    flex: none;
    color: var(--t-4);
  }

  .w5-crumb strong {
    overflow: hidden;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--t-1);
  }

  .w5-search {
    display: flex;
    align-items: center;
    gap: 8px;
    width: min(300px, 30vw);
    /* the older layouts hold it at 240px; here it gives way to the page's name */
    min-width: 0;
    height: var(--h-ctl-s);
    margin-left: auto;
    padding: 0 6px 0 10px;
    border: 1px solid var(--b-1);
    border-radius: var(--r-ctl);
    background: var(--s-well);
    color: var(--t-3);
    font-size: .86rem;
    text-decoration: none;
    box-shadow: none;
    transition:
      border-color var(--d-1) ease,
      background-color var(--d-1) ease,
      color var(--d-1) ease;
  }

  .w5-search:hover {
    border-color: var(--b-2);
    color: var(--t-2);
  }

  .w5-search .icon {
    width: 15px;
    height: 15px;
    flex: none;
    /* an icon is a span, and the older layouts push a field's spans to the left */
    margin: 0;
  }

  .w5-search span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .w5-search kbd {
    flex: none;
  }

  .w5-top-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 4px;
  }

  /* language, and light or dark: small, and always in the same place */
  .w5-quick {
    display: flex;
    align-items: center;
    gap: 2px;
  }

  :is(.w5-quick, .w5-drawer-quick) .lang-switch {
    height: var(--h-ctl-s);
    margin: 0;
    padding: 2px;
    border-color: var(--b-1);
    background: var(--s-well);
  }

  :is(.w5-quick, .w5-drawer-quick) .lang-btn {
    height: calc(var(--h-ctl-s) - 6px);
    min-width: 28px;
    padding: 0 7px;
    color: var(--t-3);
    transition: color var(--d-1) ease, background-color var(--d-1) ease;
  }

  :is(.w5-quick, .w5-drawer-quick) .lang-btn.is-active {
    background: var(--s-1);
    color: var(--t-1);
    box-shadow: var(--sh-1);
  }

  .w5-quick .lang-glyph {
    display: none;
  }

  :is(.w5-quick, .w5-drawer-quick) .theme-toggle {
    width: var(--h-ctl-s);
    height: var(--h-ctl-s);
  }

  .w5-drawer-quick {
    display: none;
  }

  .w5-ask {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 8px;
    height: var(--h-ctl-s);
    white-space: nowrap;
    padding: 0 12px 0 6px;
    border: 1px solid var(--b-1);
    border-radius: var(--r-ctl);
    background: var(--s-1);
    color: var(--t-1);
    font: inherit;
    font-size: .86rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--sh-1);
    transition:
      border-color var(--d-1) ease,
      background-color var(--d-1) ease,
      transform var(--d-1) var(--e-out);
  }

  .w5-ask .trigger-mark {
    display: block;
    width: 20px;
    height: 20px;
  }

  .w5-ask:hover {
    border-color: var(--b-2);
    background: var(--s-1);
  }

  .w5-ask:active {
    transform: scale(.97);
  }

  /* open: pressed in, like any other toggle; gold stays for decisions */
  .w5-ask[aria-expanded="true"] {
    border-color: var(--b-2);
    background: var(--f-press);
    box-shadow: none;
  }

  /*
    A narrow bar. First the agent's name and the shortcut go (the mark and the field say them),
    then the search field folds to its icon. Below the rules they change, so they win.
  */
  @container w5top (max-width: 780px) {
    .w5-ask > span:not(.trigger-mark),
    .w5-search kbd {
      display: none;
    }

    .w5-ask {
      padding: 0 6px;
    }

    .w5-search {
      width: min(230px, 32cqw);
      padding-right: 10px;
    }
  }

  @container w5top (max-width: 600px) {
    .w5-search > span:not(.icon) {
      display: none;
    }

    .w5-search {
      flex: none;
      justify-content: center;
      width: var(--h-ctl-s);
      padding: 0;
      border-color: transparent;
      background: none;
    }

    .w5-search:hover {
      border-color: transparent;
      background: var(--f-hover);
      color: var(--t-1);
    }

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

  /* ---------- Segmented control ---------- */

  .w5-seg {
    position: relative;
    display: inline-grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    padding: 2px;
    border-radius: var(--r-ctl);
    background: var(--s-well);
    box-shadow: inset 0 0 0 1px var(--b-0);
    isolation: isolate;
  }

  .w5-seg::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: 2px;
    bottom: 2px;
    left: 0;
    width: var(--thumb-w, 0);
    border-radius: calc(var(--r-ctl) - 2px);
    background: var(--s-1);
    box-shadow:
      var(--sh-1),
      inset 0 0 0 1px var(--b-0);
    opacity: 0;
    transform: translateX(var(--thumb-x, 0));
    transition:
      transform var(--d-3) var(--e-out),
      width var(--d-3) var(--e-out);
  }

  .w5-seg[data-ready]::before {
    opacity: 1;
  }

  .w5-seg > button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 34px;
    height: 28px;
    padding: 0 9px;
    border: 0;
    border-radius: calc(var(--r-ctl) - 2px);
    background: none;
    color: var(--t-3);
    font: inherit;
    font-size: .84rem;
    font-weight: 560;
    cursor: pointer;
    transition: color var(--d-1) ease;
  }

  .w5-seg > button .icon {
    width: 15px;
    height: 15px;
  }

  .w5-seg > button:hover,
  .w5-seg > button:is([aria-pressed="true"], [aria-checked="true"], .is-active) {
    color: var(--t-1);
  }

  /* ---------- You: the account popover ---------- */

  .w5-account {
    position: fixed;
    inset: auto;
    width: 288px;
    margin: 0;
    padding: 6px;
    border: 1px solid var(--b-1);
    border-radius: var(--r-pop);
    background: var(--s-3);
    color: var(--t-1);
    box-shadow: var(--sh-3);
    opacity: 0;
    transform: translateY(6px) scale(.985);
    transform-origin: 0 100%;
    transition:
      opacity var(--d-2) ease,
      transform var(--d-2) var(--e-out),
      overlay var(--d-2) allow-discrete,
      display var(--d-2) allow-discrete;
  }

  .w5-account:popover-open {
    opacity: 1;
    transform: none;

    @starting-style {
      opacity: 0;
      transform: translateY(6px) scale(.985);
    }
  }

  .w5-account-who {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    align-items: center;
    gap: 11px;
    padding: 10px 10px 12px;
  }

  .w5-account-who .avatar {
    width: 36px;
    height: 36px;
    font-size: .8rem;
  }

  .w5-account-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 40px;
    padding: 4px 6px 4px 10px;
    font-size: .88rem;
    color: var(--t-2);
  }

  .w5-account-row .lang-switch {
    margin: 0;
  }

  .w5-menu {
    display: grid;
    gap: 1px;
    margin: 6px 0 0;
    padding: 6px 0 0;
    border-top: 1px solid var(--b-0);
    list-style: none;
  }

  .w5-menu a,
  .w5-account-out button {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 34px;
    padding: 0 10px;
    border: 0;
    border-radius: var(--r-item);
    background: none;
    color: var(--t-2);
    font: inherit;
    font-size: .88rem;
    font-weight: 520;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition:
      background-color var(--d-1) ease,
      color var(--d-1) ease;
  }

  .w5-menu .icon,
  .w5-account-out .icon {
    width: 16px;
    height: 16px;
    color: var(--t-3);
  }

  .w5-menu a:hover,
  .w5-account-out button:hover {
    background: var(--f-hover);
    color: var(--t-1);
  }

  .w5-account-out {
    margin: 6px 0 0;
    padding: 6px 0 0;
    border-top: 1px solid var(--b-0);
  }

  /* ---------- Search and jump ---------- */

  .palette {
    border: 1px solid var(--b-1);
    border-radius: calc(var(--r-pop) + 2px);
    background: var(--s-3);
    box-shadow: var(--sh-4);
  }

  /* the finder's field is the finder: it needs no box of its own to say it is being typed in */
  .palette-input input:focus,
  .palette-input input:focus-visible {
    outline: 0;
    box-shadow: none;
  }

  /* reached with the keyboard, the search field in the top bar is ringed the way a field is, not boxed */
  .w5-search:focus-visible {
    outline: 0;
    border-color: var(--a-ring);
    box-shadow: 0 0 0 3px color-mix(in oklch, var(--a-ring) 22%, transparent);
  }

  /* ---------- Phones: the rail becomes the tab bar, the sidebar a drawer ---------- */

  @media (max-width: 859px) {
    .w5-shell {
      --side-w: min(300px, 86vw);
    }

    .w5-chrome {
      position: static;
      display: block;
      height: 0;
      /* a named transition group would also become the drawer's containing block, and this box has no height */
      view-transition-name: none;
    }

    .w5-apps {
      display: none;
    }

    .w5-side,
    .w5-shell.is-slim .w5-side {
      position: fixed;
      top: 0;
      bottom: 0;
      left: 0;
      width: var(--side-w);
      height: auto;
      padding: max(12px, env(safe-area-inset-top)) 10px max(12px, env(safe-area-inset-bottom));
      overflow-y: auto;
      background: var(--s-base);
      opacity: 1;
      transition:
        transform .32s var(--e-drawer),
        visibility 0s .32s,
        box-shadow .32s;
    }

    .nav-open .w5-side {
      transition:
        transform .32s var(--e-drawer),
        visibility 0s,
        box-shadow .32s;
    }

    .w5-side > * {
      min-width: 0;
    }

    .w5-drawer-apps {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
      gap: 4px;
      margin: 0 0 14px;
      padding: 4px;
      border-radius: var(--r-ctl);
      background: var(--s-well);
      list-style: none;
    }

    .w5-drawer-apps a {
      display: grid;
      justify-items: center;
      gap: 4px;
      padding: 8px 4px 7px;
      border-radius: calc(var(--r-ctl) - 3px);
      color: var(--t-3);
      font-size: .74rem;
      font-weight: 560;
      text-decoration: none;
    }

    .w5-drawer-apps a .icon {
      width: 19px;
      height: 19px;
    }

    .w5-drawer-apps a[aria-current="true"] {
      background: var(--s-1);
      color: var(--t-1);
      box-shadow: var(--sh-1);
    }

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

    .w5-nav {
      overflow: visible;
    }

    .w5-nav a {
      height: 42px;
      font-size: .96rem;
    }

    .work-area {
      margin: 0;
      min-height: 100dvh;
      border: 0;
      border-radius: 0;
      box-shadow: none;
    }

    .w5-top {
      height: 54px;
      padding: 0 10px;
      border-radius: 0;
    }

    .w5-top .menu-toggle {
      display: inline-grid;
    }

    .w5-top .w5-fold,
    .w5-top .w5-quick,
    .w5-crumb a,
    .w5-crumb > span,
    .w5-search > span:not(.icon),
    .w5-search kbd,
    .w5-ask > span:not(.trigger-mark) {
      display: none;
    }

    .w5-drawer-quick {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      margin-top: 14px;
      padding: 12px 8px 2px;
      border-top: 1px solid var(--b-0);
    }

    .w5-crumb strong {
      font-size: 1rem;
    }

    .w5-search {
      flex: none;
      width: 36px;
      height: 36px;
      justify-content: center;
      padding: 0;
      border-color: transparent;
      background: none;
    }

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

    .w5-ask {
      padding: 0 6px;
    }

    .w5-tabbar {
      display: grid;
      grid-template-columns: repeat(5, minmax(0, 1fr));
      position: fixed;
      z-index: 20;
      inset: auto 0 0;
      padding: 6px 6px max(6px, env(safe-area-inset-bottom));
      border-top: 1px solid var(--b-1);
      background: color-mix(in oklch, var(--s-base) 88%, transparent);
      backdrop-filter: saturate(1.4) blur(18px);
      -webkit-backdrop-filter: saturate(1.4) blur(18px);
    }

    .w5-tabbar > :is(a, button) {
      display: grid;
      justify-items: center;
      gap: 3px;
      min-height: 46px;
      padding: 6px 2px 4px;
      border: 0;
      border-radius: var(--r-ctl);
      background: none;
      color: var(--t-3);
      font: inherit;
      font-size: .7rem;
      font-weight: 560;
      text-decoration: none;
    }

    .w5-tabbar .icon {
      width: 21px;
      height: 21px;
    }

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

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

    .w5-tabbar [aria-current="page"] .icon .fill {
      fill: var(--icon-tint);
    }

    .w5-tab-ask .trigger-mark {
      display: block;
      width: 24px;
      height: 24px;
    }

    .w5-tab-ask {
      color: var(--t-1) !important;
    }

    .workspace-content {
      padding-bottom: calc(96px + env(safe-area-inset-bottom));
    }

    .w5-account {
      inset: auto 10px calc(74px + env(safe-area-inset-bottom)) auto;
      width: min(320px, calc(100vw - 20px));
      transform-origin: 100% 100%;
    }
  }

  @media (min-width: 860px) {
    .w5-tabbar {
      display: none;
    }
  }

  @media (max-width: 1079px) {
    .w5-shell:has(> .assistant-panel:not([hidden])) > .w5-chrome {
      display: none;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    .w5-shell,
    .w5-side,
    .w5-account,
    .w5-seg::before {
      transition: none;
    }
  }

  @media print {
    .w5-chrome,
    .w5-top,
    .w5-tabbar {
      display: none !important;
    }

    .work-area {
      margin: 0;
      border: 0;
      box-shadow: none;
    }
  }
}
