/* The app's buttons, drawn to be pressed (2.17.0). Loaded last on every
   page (base_site.html), each written under #content, so it wins over the
   older rules in brand.css, admin_overrides.css, agenda.css and crm.css,
   which still size and place most of these. One family of movement for
   all of them: under a mouse they rise a pixel and their shadow opens
   (Vai only brightens);
   pressed they sink and give a little; let go, they come back. On a touch
   screen only the press - a finger has no "under the pointer", and the
   lift would stay on after the tap. Where the computer asks for less
   motion nothing moves; the colours still change.

     1. The buttons that add something - indigo, lit from above.
     2. The secondary buttons beside them - pale orange pills.
     3. Salva - its plain green.
     4. Vai, under a list's Azione - a pale green, compact.
     5. The Agenda's arrows and Oggi - light green.
     6. The Lavoro panel's buttons on a preventivo - the indigo of 1, and
        a light one with an indigo edge.

   --- 1. The buttons that add something --------------------------------

   (2.17.0, the owner's call: "a graphic
   rework - other colours, in line with the app but different enough to
   be thoughtful, beautiful hover and click animations, a polished and
   almost tactile look and feeling", without moving any of them).

   Which: "Aggiungi ... +" at the top of every list (and Evento and Nuovo
   appuntamento on the Agenda's list, Nuova trattativa on the
   trattative's), Evento and Appuntamento on the calendar, Nuova
   trattativa on the Pipeline. Not the round + of a client's panels, the
   menu's green Aggiungi, nor the Dashboard's small + Nuovo in a panel's
   heading: those are other controls, with looks of their own.

   The look: a pill in indigo - the colour of the top bar's violet and
   blue patches, so it belongs to the app, but no other control in it
   wears it, so it reads as "this makes something new". Lit from above:
   a gradient running from a violet-indigo at its top-left to a deeper
   indigo at its bottom-right, a fine highlight along its top edge and a
   darker lip along its bottom one, white words with the faintest shadow
   under them, and a soft indigo shadow on the page. It looks like
   something that can be pressed.

   The feel: under the pointer it rises a pixel, its shadow opens out, its
   colours brighten as the gradient slides (no band of light sweeping
   across, and the + does not turn: the owner's calls). Pressed, it sinks: down
   a pixel and a touch smaller, the light along its top gone, a shadow
   inside it instead, the shadow on the page drawn in - and it springs
   back when let go. On a touch screen the press is the whole of it: a
   finger has no "under the pointer", and the lift would stay on after
   the tap. The keyboard's focus is a ring of the same indigo. Where the
   computer asks for less motion, nothing moves; the colours still
   change.

   Loaded last on every page (base_site.html, the "responsive" block), and
   written under #content, so it wins over the older pill rules in
   brand.css, admin_overrides.css, agenda.css and crm.css, which still
   size and place these buttons. The colours are tokens, light and dark
   (dark twice, as brand.css's are). */

:root {
  --add-btn-bg: linear-gradient(135deg, #7465F4 0%, #5157E6 48%, #3C3FC4 100%);
  --add-btn-bg-size: 160% 160%;
  --add-btn-fg: #FFFFFF;
  --add-btn-text-shadow: 0 1px 0 rgba(23, 18, 84, 0.28);
  --add-btn-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    inset 0 -2px 0 rgba(28, 22, 98, 0.24),
    0 1px 2px rgba(28, 22, 98, 0.22),
    0 4px 12px -5px rgba(72, 64, 214, 0.55);
  --add-btn-hover-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    inset 0 -2px 0 rgba(28, 22, 98, 0.22),
    0 2px 4px rgba(28, 22, 98, 0.16),
    0 12px 24px -10px rgba(72, 64, 214, 0.72);
  --add-btn-press-shadow:
    inset 0 2px 5px rgba(20, 15, 72, 0.42),
    inset 0 -1px 0 rgba(255, 255, 255, 0.10),
    0 1px 1px rgba(28, 22, 98, 0.18);
  --add-btn-press-filter: brightness(0.94) saturate(1.05);
  --add-btn-hover-filter: brightness(1.07) saturate(1.06);
  --add-btn-ring: rgba(99, 91, 240, 0.42);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --add-btn-bg: linear-gradient(135deg, #8578F7 0%, #6268F0 48%, #4A4CD8 100%);
    --add-btn-text-shadow: 0 1px 0 rgba(14, 10, 60, 0.4);
    --add-btn-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.30),
      inset 0 -2px 0 rgba(16, 12, 70, 0.32),
      0 1px 2px rgba(0, 0, 0, 0.5),
      0 6px 16px -8px rgba(110, 104, 245, 0.55);
    --add-btn-hover-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.36),
      inset 0 -2px 0 rgba(16, 12, 70, 0.30),
      0 2px 4px rgba(0, 0, 0, 0.45),
      0 12px 26px -10px rgba(122, 116, 250, 0.75);
    --add-btn-press-shadow:
      inset 0 2px 6px rgba(10, 6, 48, 0.55),
      inset 0 -1px 0 rgba(255, 255, 255, 0.08),
      0 1px 1px rgba(0, 0, 0, 0.4);
    --add-btn-ring: rgba(133, 120, 247, 0.5);
  }
}

html[data-theme="dark"] {
  --add-btn-bg: linear-gradient(135deg, #8578F7 0%, #6268F0 48%, #4A4CD8 100%);
  --add-btn-text-shadow: 0 1px 0 rgba(14, 10, 60, 0.4);
  --add-btn-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.30),
    inset 0 -2px 0 rgba(16, 12, 70, 0.32),
    0 1px 2px rgba(0, 0, 0, 0.5),
    0 6px 16px -8px rgba(110, 104, 245, 0.55);
  --add-btn-hover-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.36),
    inset 0 -2px 0 rgba(16, 12, 70, 0.30),
    0 2px 4px rgba(0, 0, 0, 0.45),
    0 12px 26px -10px rgba(122, 116, 250, 0.75);
  --add-btn-press-shadow:
    inset 0 2px 6px rgba(10, 6, 48, 0.55),
    inset 0 -1px 0 rgba(255, 255, 255, 0.08),
    0 1px 1px rgba(0, 0, 0, 0.4);
  --add-btn-ring: rgba(133, 120, 247, 0.5);
}

/* --- At rest ------------------------------------------------------------ */

#content .object-tools a.addlink,
#content .object-tools a.addlink:link,
#content .object-tools a.addlink:visited,
#content a.agenda-add,
#content a.agenda-add:link,
#content a.agenda-add:visited,
#content .crm-toolbar-actions a.button.crm-add,
#content .crm-toolbar-actions a.button.crm-add:link,
#content .crm-toolbar-actions a.button.crm-add:visited {
  position: relative;
  border: none;
  background: var(--add-btn-bg);
  background-size: var(--add-btn-bg-size);
  background-position: 0% 0%;
  color: var(--add-btn-fg);
  box-shadow: var(--add-btn-shadow);
  text-shadow: var(--add-btn-text-shadow);
  text-decoration: none;
  filter: none;
  transform: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.22s ease,
    background-position 0.5s ease,
    filter 0.22s ease;
}

/* The drawn + of the calendar's and the Pipeline's buttons, in the words'
   colour with the same faint shadow. */
#content a.agenda-add .icon-plus,
#content .crm-toolbar-actions a.button.crm-add .icon-plus {
  filter: drop-shadow(0 1px 0 rgba(23, 18, 84, 0.28));
}

/* --- Under the pointer (a mouse or a pen only) --------------------------- */

@media (hover: hover) and (pointer: fine) {
  #content .object-tools a.addlink:hover,
  #content .object-tools a.addlink:focus-visible,
  #content a.agenda-add:hover,
  #content a.agenda-add:focus-visible,
  #content .crm-toolbar-actions a.button.crm-add:hover,
  #content .crm-toolbar-actions a.button.crm-add:focus-visible {
    background: var(--add-btn-bg);
    background-size: var(--add-btn-bg-size);
    background-position: 100% 100%;
    color: var(--add-btn-fg);
    box-shadow: var(--add-btn-hover-shadow);
    filter: var(--add-btn-hover-filter);
    transform: translateY(-1px);
    text-decoration: none;
  }
}

/* No lift on a touch screen, where :hover stays on after a tap; the
   older rules lifted it there too. */
@media (hover: none), (pointer: coarse) {
  #content .object-tools a.addlink:hover,
  #content a.agenda-add:hover,
  #content .crm-toolbar-actions a.button.crm-add:hover {
    background: var(--add-btn-bg);
    background-size: var(--add-btn-bg-size);
    color: var(--add-btn-fg);
    box-shadow: var(--add-btn-shadow);
    filter: none;
    transform: none;
    text-decoration: none;
  }
}

/* --- Pressed ------------------------------------------------------------ */

#content .object-tools a.addlink:is(:hover, :focus-visible):active,
#content .object-tools a.addlink:link:is(:hover, :focus-visible):active,
#content .object-tools a.addlink:visited:is(:hover, :focus-visible):active,
#content a.agenda-add:is(:hover, :focus-visible):active,
#content .crm-toolbar-actions a.button.crm-add:is(:hover, :focus-visible):active {
  background: var(--add-btn-bg);
  background-size: var(--add-btn-bg-size);
  background-position: 60% 60%;
  color: var(--add-btn-fg);
  box-shadow: var(--add-btn-press-shadow);
  filter: var(--add-btn-press-filter);
  transform: translateY(1px) scale(0.975);
  transition:
    transform 0.08s ease-out,
    box-shadow 0.08s ease-out,
    filter 0.08s ease-out;
  text-decoration: none;
}

/* --- The keyboard -------------------------------------------------------- */

#content .object-tools a.addlink:focus-visible,
#content a.agenda-add:focus-visible,
#content .crm-toolbar-actions a.button.crm-add:focus-visible {
  outline: 3px solid var(--add-btn-ring);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  #content .object-tools a.addlink,
  #content a.agenda-add,
  #content .crm-toolbar-actions a.button.crm-add,
  #content .object-tools a.addlink:active,
  #content a.agenda-add:active,
  #content .crm-toolbar-actions a.button.crm-add:active {
    transition: box-shadow 0.15s ease, filter 0.15s ease;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) and (hover: hover) and (pointer: fine) {
  #content .object-tools a.addlink:hover,
  #content a.agenda-add:hover,
  #content .crm-toolbar-actions a.button.crm-add:hover {
    transform: none;
  }
}

/* --- 2. The secondary buttons -----------------------------------------
   Vista elenco, Vista calendario, Vista pipeline, Solo le mie / i miei,
   Scheda cliente, Fissa appuntamento, Nuovo preventivo, Preleva
   liquidità (2.17.0, the owner's call): the look the buttons that add
   something had until 2.17.0 - a pale orange pill, an orange edge and
   orange words - now that those are indigo. Never bigger than the indigo
   button beside them (2.18.0, the owner's call): as tall, and two pixels
   narrower at each end. Under the mouse a deeper wash, a stronger edge and a soft
   orange shadow; pressed, deeper still. A switch that is on (Solo le
   mie) keeps its underline and the strong edge. In dark mode the same
   orange, as a wash on the dark page. */

:root {
  --sec-btn-bg: #FFF6EC;
  --sec-btn-fg: #B45309;
  --sec-btn-border: #EDB27C;
  --sec-btn-hover-bg: #FFEBD4;
  --sec-btn-hover-fg: #9A4108;
  --sec-btn-hover-border: #DE8B3E;
  --sec-btn-hover-glow: 0 6px 14px -6px rgba(180, 83, 9, 0.5);
  --sec-btn-active-bg: #FFDDB8;
  --sec-btn-active-fg: #7C2D12;
  --sec-btn-active-border: #C2620A;
  --sec-btn-active-glow: inset 0 1px 2px rgba(124, 45, 18, 0.18);
  --sec-btn-ring: rgba(194, 98, 10, 0.35);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --sec-btn-bg: rgba(245, 158, 11, 0.09);
    --sec-btn-fg: #F6B26B;
    --sec-btn-border: rgba(242, 154, 72, 0.42);
    --sec-btn-hover-bg: rgba(245, 158, 11, 0.16);
    --sec-btn-hover-fg: #FFC98A;
    --sec-btn-hover-border: rgba(242, 154, 72, 0.7);
    --sec-btn-hover-glow: 0 6px 16px -8px rgba(242, 154, 72, 0.45);
    --sec-btn-active-bg: rgba(245, 158, 11, 0.24);
    --sec-btn-active-fg: #FFD7A8;
    --sec-btn-active-border: #E38A35;
    --sec-btn-active-glow: inset 0 1px 3px rgba(0, 0, 0, 0.45);
    --sec-btn-ring: rgba(242, 154, 72, 0.45);
  }
}

html[data-theme="dark"] {
  --sec-btn-bg: rgba(245, 158, 11, 0.09);
  --sec-btn-fg: #F6B26B;
  --sec-btn-border: rgba(242, 154, 72, 0.42);
  --sec-btn-hover-bg: rgba(245, 158, 11, 0.16);
  --sec-btn-hover-fg: #FFC98A;
  --sec-btn-hover-border: rgba(242, 154, 72, 0.7);
  --sec-btn-hover-glow: 0 6px 16px -8px rgba(242, 154, 72, 0.45);
  --sec-btn-active-bg: rgba(245, 158, 11, 0.24);
  --sec-btn-active-fg: #FFD7A8;
  --sec-btn-active-border: #E38A35;
  --sec-btn-active-glow: inset 0 1px 3px rgba(0, 0, 0, 0.45);
  --sec-btn-ring: rgba(242, 154, 72, 0.45);
}

#content .object-tools a.objtool-secondary,
#content .object-tools a.objtool-secondary:link,
#content .object-tools a.objtool-secondary:visited,
#content a.agenda-list-link,
#content a.agenda-list-link:link,
#content a.agenda-list-link:visited,
#content .crm-toolbar-actions a.button.crm-ghost,
#content .crm-toolbar-actions a.button.crm-ghost:link,
#content .crm-toolbar-actions a.button.crm-ghost:visited {
  padding: 8px 16px;
  border: none;
  border-radius: var(--md-pill);
  background: var(--sec-btn-bg);
  color: var(--sec-btn-fg);
  box-shadow: inset 0 0 0 1px var(--sec-btn-border);
  font-weight: 600;
  text-decoration: none;
  transform: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color 0.16s ease,
    color 0.16s ease,
    box-shadow 0.2s ease,
    transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* On the Pipeline the pill beside them is a little bigger. */
#content .crm-toolbar-actions a.button.crm-ghost,
#content .crm-toolbar-actions a.button.crm-ghost:link,
#content .crm-toolbar-actions a.button.crm-ghost:visited {
  padding: 9px 18px;
}

/* A switch that is on: underlined, with the strong edge. */
#content .object-tools a.objtool-toggle.is-on,
#content a.agenda-mine.is-on,
#content .crm-toolbar-actions a.button.crm-ghost.is-on {
  box-shadow: inset 0 0 0 1.5px var(--sec-btn-active-border);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

@media (hover: hover) and (pointer: fine) {
  #content .object-tools a.objtool-secondary:hover,
  #content .object-tools a.objtool-secondary:focus-visible,
  #content a.agenda-list-link:hover,
  #content a.agenda-list-link:focus-visible,
  #content .crm-toolbar-actions a.button.crm-ghost:hover,
  #content .crm-toolbar-actions a.button.crm-ghost:focus-visible {
    background: var(--sec-btn-hover-bg);
    color: var(--sec-btn-hover-fg);
    box-shadow: inset 0 0 0 1px var(--sec-btn-hover-border), var(--sec-btn-hover-glow);
    transform: translateY(-1px);
  }
}

@media (hover: none), (pointer: coarse) {
  #content .object-tools a.objtool-secondary:hover,
  #content a.agenda-list-link:hover,
  #content .crm-toolbar-actions a.button.crm-ghost:hover {
    background: var(--sec-btn-bg);
    color: var(--sec-btn-fg);
    box-shadow: inset 0 0 0 1px var(--sec-btn-border);
    transform: none;
  }
}

#content .object-tools a.objtool-secondary:is(:hover, :focus-visible):active,
#content a.agenda-list-link:is(:hover, :focus-visible):active,
#content .crm-toolbar-actions a.button.crm-ghost:is(:hover, :focus-visible):active {
  background: var(--sec-btn-active-bg);
  color: var(--sec-btn-active-fg);
  box-shadow: inset 0 0 0 1px var(--sec-btn-active-border), var(--sec-btn-active-glow);
  transform: translateY(1px) scale(0.98);
  transition: transform 0.08s ease-out, box-shadow 0.08s ease-out, background-color 0.08s ease-out;
}

#content .object-tools a.objtool-secondary:focus-visible,
#content a.agenda-list-link:focus-visible,
#content .crm-toolbar-actions a.button.crm-ghost:focus-visible {
  outline: 3px solid var(--sec-btn-ring);
  outline-offset: 2px;
}

/* --- 3. Salva -----------------------------------------------------------
   (2.17.0, the owner's call: "a little refinement in the shape - pixels -
   and a more clicky, real animation, like the buttons that add
   something"; 2.18.0: "remove the 3d fade, bring back its old plain
   background".) Its own plain green and darker green under the mouse
   (admin_overrides.css), a little more compact than it was (10px 26px
   9px). Under the mouse it rises a pixel and its shadow opens; pressed,
   it sinks a pixel, gives a little and its shadow goes inside; let go, it
   springs back. Where it rides over the page (body.bm-save-floating) it
   keeps its deeper shadow. */

#content .object-tools button.objtool-save,
#content .cf-savedock button.objtool-save {
  padding: 10px 26px 9px;
  letter-spacing: 0.015em;
  transform: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color 0.15s ease,
    transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.22s ease;
}

@media (hover: hover) and (pointer: fine) {
  #content .object-tools button.objtool-save:hover,
  #content .cf-savedock button.objtool-save:hover {
    transform: translateY(-1px);
  }
}

#content .object-tools button.objtool-save:is(:hover, :focus-visible):active,
#content .cf-savedock button.objtool-save:is(:hover, :focus-visible):active {
  box-shadow: inset 0 2px 4px rgba(8, 40, 24, 0.35);
  transform: translateY(1px) scale(0.975);
  transition: transform 0.08s ease-out, box-shadow 0.08s ease-out, background-color 0.08s ease-out;
}

/* --- 4. Vai ---------------------------------------------------------------
   Under a list's Azione (2.17.0, the owner's call: "a bit more tactile";
   2.18.0: "keep the semi-transparent background a bit, with the
   border"). Its own pale green and green edge (brand.css, 2.9.0), in the
   compact shape it went back to. Under the mouse only its wash deepens -
   it does not rise; pressed, it sinks a pixel, gives a little and a
   shadow goes inside it; let go, it comes back. */

#content #changelist .actions .button {
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color 0.15s ease,
    transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.15s ease;
}

#content #changelist .actions .button:is(:hover, :focus-visible):active {
  background: var(--bm-go-btn-hover-bg);
  box-shadow: inset 0 1px 3px rgba(20, 70, 40, 0.28);
  transform: translateY(1px) scale(0.97);
  transition: transform 0.08s ease-out, box-shadow 0.08s ease-out;
}

/* --- 5. The Agenda's arrows and Oggi -----------------------------------
   (2.17.0, the owner's call: "a graphical rework, to fit the smooth and
   pro look", green, in the same places.) Light keys lit from above: white
   melting into a pale green, a fine green edge, a white highlight along
   the top and a soft green shadow under them. Under the mouse the green
   deepens a little, the edge firms up and they rise; pressed, they sink
   into a deeper wash with a shadow inside. Dark mode: dark green keys
   with pale green words. Their sizes are agenda.css's. 2.18.1, the
   owner's calls: a little greener, and the arrow inside no longer leans
   on its own - the whole key moves, arrow and all, at once. */

:root {
  --nav-btn-bg: linear-gradient(180deg, #F2FAF5 0%, #DDF1E5 100%);
  --nav-btn-fg: #22633F;
  --nav-btn-border: rgba(47, 133, 90, 0.48);
  --nav-btn-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 1px 2px rgba(16, 60, 36, 0.12), 0 3px 8px -4px rgba(47, 133, 90, 0.4);
  --nav-btn-hover-bg: linear-gradient(180deg, #EAF7EF 0%, #CFEBDA 100%);
  --nav-btn-hover-fg: #1B5536;
  --nav-btn-hover-border: rgba(47, 133, 90, 0.7);
  --nav-btn-hover-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 2px 3px rgba(16, 60, 36, 0.1), 0 8px 16px -8px rgba(47, 133, 90, 0.55);
  --nav-btn-press-bg: linear-gradient(180deg, #C5E5D1 0%, #D2EBDC 100%);
  --nav-btn-press-shadow: inset 0 2px 4px rgba(16, 60, 36, 0.18);
  --nav-btn-ring: rgba(47, 133, 90, 0.4);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --nav-btn-bg: linear-gradient(180deg, #24392D 0%, #1A2C22 100%);
    --nav-btn-fg: #8FD9AE;
    --nav-btn-border: rgba(104, 211, 145, 0.4);
    --nav-btn-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 1px 2px rgba(0, 0, 0, 0.45);
    --nav-btn-hover-bg: linear-gradient(180deg, #2A4435 0%, #20362A 100%);
    --nav-btn-hover-fg: #B4EBCB;
    --nav-btn-hover-border: rgba(104, 211, 145, 0.55);
    --nav-btn-hover-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 6px 14px -8px rgba(104, 211, 145, 0.4);
    --nav-btn-press-bg: linear-gradient(180deg, #17221C 0%, #1C2922 100%);
    --nav-btn-press-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.55);
    --nav-btn-ring: rgba(104, 211, 145, 0.45);
  }
}

html[data-theme="dark"] {
  --nav-btn-bg: linear-gradient(180deg, #24392D 0%, #1A2C22 100%);
  --nav-btn-fg: #8FD9AE;
  --nav-btn-border: rgba(104, 211, 145, 0.4);
  --nav-btn-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 1px 2px rgba(0, 0, 0, 0.45);
  --nav-btn-hover-bg: linear-gradient(180deg, #2A4435 0%, #20362A 100%);
  --nav-btn-hover-fg: #B4EBCB;
  --nav-btn-hover-border: rgba(104, 211, 145, 0.55);
  --nav-btn-hover-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 6px 14px -8px rgba(104, 211, 145, 0.4);
  --nav-btn-press-bg: linear-gradient(180deg, #17221C 0%, #1C2922 100%);
  --nav-btn-press-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.55);
  --nav-btn-ring: rgba(104, 211, 145, 0.45);
}

#content a.agenda-arrow,
#content a.agenda-arrow:link,
#content a.agenda-arrow:visited,
#content a.agenda-today,
#content a.agenda-today:link,
#content a.agenda-today:visited {
  border: none;
  border-radius: var(--md-pill);
  background: var(--nav-btn-bg);
  color: var(--nav-btn-fg);
  box-shadow: inset 0 0 0 1px var(--nav-btn-border), var(--nav-btn-shadow);
  font-weight: 600;
  text-decoration: none;
  transform: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.2s ease,
    color 0.16s ease;
}

@media (hover: hover) and (pointer: fine) {
  #content a.agenda-arrow:hover,
  #content a.agenda-arrow:focus-visible,
  #content a.agenda-today:hover,
  #content a.agenda-today:focus-visible {
    background: var(--nav-btn-hover-bg);
    color: var(--nav-btn-hover-fg);
    box-shadow: inset 0 0 0 1px var(--nav-btn-hover-border), var(--nav-btn-hover-shadow);
    transform: translateY(-1px);
  }
}

@media (hover: none), (pointer: coarse) {
  #content a.agenda-arrow:hover,
  #content a.agenda-today:hover {
    background: var(--nav-btn-bg);
    color: var(--nav-btn-fg);
    box-shadow: inset 0 0 0 1px var(--nav-btn-border), var(--nav-btn-shadow);
    transform: none;
  }
}

#content a.agenda-arrow:is(:hover, :focus-visible):active,
#content a.agenda-today:is(:hover, :focus-visible):active {
  background: var(--nav-btn-press-bg);
  color: var(--nav-btn-hover-fg);
  box-shadow: inset 0 0 0 1px var(--nav-btn-hover-border), var(--nav-btn-press-shadow);
  transform: translateY(1px) scale(0.96);
  transition: transform 0.08s ease-out, box-shadow 0.08s ease-out;
}

#content a.agenda-arrow:focus-visible,
#content a.agenda-today:focus-visible {
  outline: 3px solid var(--nav-btn-ring);
  outline-offset: 2px;
}

/* --- 6. The Lavoro panel's buttons --------------------------------------
   On a preventivo, where IVA is charged (2.18.0, the owner's call: "more
   professional and polished"; they were the theme's flat orange, a fill
   and an outline). What makes the job's next document is the indigo of
   the buttons that add something (1), with their light, lift and press:
   Accettato oggi, and Fattura di saldo. Fattura d'acconto beside it is
   the same shape in a light key: a white face shading to the palest
   indigo, a fine indigo edge, indigo words, a small shadow. Each has a
   small icon before its words (a tick; a document), and its words are
   centred by their capitals. The shape is in jobs.css. */

:root {
  --job-btn2-bg: linear-gradient(180deg, #FFFFFF 0%, #F5F4FF 100%);
  --job-btn2-fg: #4338CA;
  --job-btn2-border: rgba(79, 70, 229, 0.32);
  --job-btn2-shadow: inset 0 1px 0 #FFFFFF, 0 1px 2px rgba(28, 22, 98, 0.08), 0 3px 8px -4px rgba(72, 64, 214, 0.28);
  --job-btn2-hover-bg: linear-gradient(180deg, #FFFFFF 0%, #ECEAFF 100%);
  --job-btn2-hover-fg: #3730A3;
  --job-btn2-hover-border: rgba(79, 70, 229, 0.58);
  --job-btn2-hover-shadow: inset 0 1px 0 #FFFFFF, 0 2px 4px rgba(28, 22, 98, 0.08), 0 10px 20px -10px rgba(72, 64, 214, 0.55);
  --job-btn2-press-bg: #E8E6FD;
  --job-btn2-press-shadow: inset 0 2px 4px rgba(49, 46, 129, 0.2);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --job-btn2-bg: linear-gradient(180deg, rgba(140, 132, 250, 0.16) 0%, rgba(140, 132, 250, 0.08) 100%);
    --job-btn2-fg: #C9C5FF;
    --job-btn2-border: rgba(140, 132, 250, 0.4);
    --job-btn2-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 1px 2px rgba(0, 0, 0, 0.45);
    --job-btn2-hover-bg: linear-gradient(180deg, rgba(140, 132, 250, 0.26) 0%, rgba(140, 132, 250, 0.14) 100%);
    --job-btn2-hover-fg: #E0DDFF;
    --job-btn2-hover-border: rgba(165, 158, 255, 0.65);
    --job-btn2-hover-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 10px 20px -10px rgba(122, 116, 250, 0.6);
    --job-btn2-press-bg: rgba(140, 132, 250, 0.28);
    --job-btn2-press-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.4);
  }
}

html[data-theme="dark"] {
  --job-btn2-bg: linear-gradient(180deg, rgba(140, 132, 250, 0.16) 0%, rgba(140, 132, 250, 0.08) 100%);
  --job-btn2-fg: #C9C5FF;
  --job-btn2-border: rgba(140, 132, 250, 0.4);
  --job-btn2-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 1px 2px rgba(0, 0, 0, 0.45);
  --job-btn2-hover-bg: linear-gradient(180deg, rgba(140, 132, 250, 0.26) 0%, rgba(140, 132, 250, 0.14) 100%);
  --job-btn2-hover-fg: #E0DDFF;
  --job-btn2-hover-border: rgba(165, 158, 255, 0.65);
  --job-btn2-hover-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 10px 20px -10px rgba(122, 116, 250, 0.6);
  --job-btn2-press-bg: rgba(140, 132, 250, 0.28);
  --job-btn2-press-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.4);
}

#content .bm-job-btn,
#content .bm-job-btn:link,
#content .bm-job-btn:visited {
  border: 1px solid var(--job-btn2-border);
  background: var(--job-btn2-bg);
  color: var(--job-btn2-fg);
  box-shadow: var(--job-btn2-shadow);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.22s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    filter 0.22s ease;
}

#content .bm-job-btn-main,
#content .bm-job-btn-main:link,
#content .bm-job-btn-main:visited {
  border-color: transparent;
  background: var(--add-btn-bg);
  background-size: var(--add-btn-bg-size);
  background-position: 0% 0%;
  color: var(--add-btn-fg);
  box-shadow: var(--add-btn-shadow);
  text-shadow: var(--add-btn-text-shadow);
}

#content .bm-job-btn-main .bm-job-btn-icon {
  filter: drop-shadow(0 1px 0 rgba(23, 18, 84, 0.28));
}

@media (hover: hover) and (pointer: fine) {
  #content .bm-job-btn:is(:hover, :focus-visible) {
    border-color: var(--job-btn2-hover-border);
    background: var(--job-btn2-hover-bg);
    color: var(--job-btn2-hover-fg);
    box-shadow: var(--job-btn2-hover-shadow);
    transform: translateY(-1px);
    text-decoration: none;
  }

  #content .bm-job-btn-main:is(:hover, :focus-visible) {
    border-color: transparent;
    background: var(--add-btn-bg);
    background-size: var(--add-btn-bg-size);
    background-position: 100% 100%;
    color: var(--add-btn-fg);
    box-shadow: var(--add-btn-hover-shadow);
    filter: var(--add-btn-hover-filter);
  }
}

#content .bm-job-btn:is(:hover, :focus-visible):active {
  background: var(--job-btn2-press-bg);
  box-shadow: var(--job-btn2-press-shadow);
  filter: none;
  transform: translateY(1px) scale(0.975);
  transition: transform 0.08s ease-out, box-shadow 0.08s ease-out, filter 0.08s ease-out;
}

#content .bm-job-btn-main:is(:hover, :focus-visible):active {
  background: var(--add-btn-bg);
  background-size: var(--add-btn-bg-size);
  background-position: 60% 60%;
  box-shadow: var(--add-btn-press-shadow);
  filter: var(--add-btn-press-filter);
}

#content .bm-job-btn:focus-visible {
  outline: 3px solid var(--add-btn-ring);
  outline-offset: 2px;
}

/* --- Pressed, and then dragged away -------------------------------------
   A button looks pressed only while the pointer is on it (or the keyboard
   presses it): held down and moved off, it goes back to rest, as a
   click let go elsewhere does nothing (2.18.0, the owner's call - Vai
   stayed sunk). The press rules above ask for :hover with :active; this
   undoes brand.css's and django's older ":active" lift for the same
   case. And after the mouse lets go, a button keeps the focus without
   showing it: django's dark grey edge on Vai's focus read as still
   pressed. The keyboard's focus keeps its ring. */

#content :is(.object-tools a.addlink, a.agenda-add, .crm-toolbar-actions a.button,
             .object-tools a.objtool-secondary, a.agenda-list-link,
             .object-tools button.objtool-save, .cf-savedock button.objtool-save,
             #changelist .actions .button, a.agenda-arrow, a.agenda-today,
             .bm-job-btn):active:not(:hover, :focus-visible) {
  transform: none;
}

#content #changelist .actions .button:focus:not(:focus-visible) {
  border-color: var(--bm-go-btn-border);
  outline: none;
}

#content #changelist .actions .button:focus-visible {
  outline: 3px solid var(--bm-go-btn-border);
  outline-offset: 2px;
}

/* --- Less motion, for every button above -------------------------------- */

@media (prefers-reduced-motion: reduce) {
  #content .object-tools a.objtool-secondary,
  #content a.agenda-list-link,
  #content .crm-toolbar-actions a.button.crm-ghost,
  #content .object-tools button.objtool-save,
  #content .cf-savedock button.objtool-save,
  #content #changelist .actions .button,
  #content a.agenda-arrow,
  #content a.agenda-today,
  #content .bm-job-btn {
    transition: none;
  }

  #content .object-tools a.objtool-secondary:is(:hover, :active),
  #content a.agenda-list-link:is(:hover, :active),
  #content .crm-toolbar-actions a.button.crm-ghost:is(:hover, :active),
  #content .object-tools button.objtool-save:is(:hover, :active),
  #content .cf-savedock button.objtool-save:is(:hover, :active),
  #content #changelist .actions .button:is(:hover, :active),
  #content a.agenda-arrow:is(:hover, :active),
  #content a.agenda-today:is(:hover, :active),
  #content .bm-job-btn:is(:hover, :active) {
    transform: none;
  }
}
