/*
 * ArtigianoPro Apple Pro UI · 2026
 * Shared responsive layer inspired by artigiano_area.php and dashboard_finanza.php.
 * Loaded last and deliberately scoped to data-ap-design="apple-pro".
 */

:root {
  --apx-font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --apx-bg: #080a10;
  --apx-bg-deep: #040509;
  --apx-panel: rgba(24, 25, 34, .84);
  --apx-panel-solid: #171821;
  --apx-panel-soft: rgba(255, 255, 255, .055);
  --apx-line: rgba(255, 255, 255, .11);
  --apx-line-strong: rgba(99, 163, 255, .32);
  --apx-text: #f5f7fb;
  --apx-muted: #a4a8b5;
  --apx-blue: #4f9cff;
  --apx-blue-strong: #1477ff;
  --apx-green: #35d99a;
  --apx-yellow: #ffc857;
  --apx-red: #ff6875;
  --apx-violet: #b992ff;
  --apx-radius-xs: 10px;
  --apx-radius-sm: 14px;
  --apx-radius: 20px;
  --apx-radius-lg: 28px;
  --apx-shadow-sm: 0 8px 24px rgba(0, 0, 0, .18);
  --apx-shadow: 0 24px 72px rgba(0, 0, 0, .38);
  --apx-focus: 0 0 0 4px rgba(79, 156, 255, .20);
  --apx-safe-bottom: env(safe-area-inset-bottom, 0px);
  --apx-content: 1280px;
}

html[data-ap-design="apple-pro"] {
  min-width: 0;
  scroll-behavior: smooth;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

html[data-ap-design="apple-pro"] body {
  min-width: 0;
  min-height: 100vh;
  font-family: var(--apx-font) !important;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html[data-ap-design="apple-pro"] body *,
html[data-ap-design="apple-pro"] body *::before,
html[data-ap-design="apple-pro"] body *::after {
  box-sizing: border-box;
}

html[data-ap-design="apple-pro"] body :where(img, video, canvas, svg, iframe) {
  max-width: 100%;
}

html[data-ap-design="apple-pro"] body :where(button, a, input, select, textarea, summary) {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

html[data-ap-design="apple-pro"] body :where(input, select, textarea, button) {
  font-family: inherit;
}

html[data-ap-design="apple-pro"] body :where(input, select, textarea) {
  max-width: 100%;
}

html[data-ap-design="apple-pro"] body :where(pre, code, .rawbox, .summaryBox, .transcriptBox) {
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

html[data-ap-design="apple-pro"] body :where(.app, .wrap, .container, .dashWrap, main) {
  min-width: 0;
}

html[data-ap-design="apple-pro"] body :where(.row, .toprow, .topRow, .cardHead, .sectionHead, .itemTop) > * {
  min-width: 0;
}

html[data-ap-design="apple-pro"] body :where([hidden]) {
  display: none !important;
}

html[data-ap-design="apple-pro"] body :where(a, button, input, select, textarea, summary):focus-visible {
  outline: none !important;
  box-shadow: var(--apx-focus) !important;
}

/* Shared workspace: the pages that previously mixed many unrelated dark themes. */
html[data-ap-design="apple-pro"][data-ap-surface="workspace"] {
  color-scheme: dark;
  background: var(--apx-bg-deep);
}

html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui {
  margin: 0 !important;
  color: var(--apx-text) !important;
  background:
    radial-gradient(900px 520px at 102% -8%, rgba(79, 156, 255, .20), transparent 58%),
    radial-gradient(760px 480px at -8% 2%, rgba(185, 146, 255, .12), transparent 60%),
    radial-gradient(620px 420px at 70% 105%, rgba(53, 217, 154, .08), transparent 62%),
    linear-gradient(180deg, #0c0e16 0%, #070910 48%, #040509 100%) !important;
  background-attachment: fixed !important;
  overflow-x: clip;
  padding-bottom: calc(28px + var(--apx-safe-bottom)) !important;
}

html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui.ap-has-bottom-nav {
  padding-bottom: calc(106px + var(--apx-safe-bottom)) !important;
}

html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .24;
  background-image:
    linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 50% 14%, #000 0, transparent 72%);
}

html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui :where(.app, .wrap, .container, .dashWrap, main) {
  width: min(100%, var(--apx-content)) !important;
  max-width: var(--apx-content) !important;
  margin-inline: auto !important;
}

html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui :where(.app, .wrap, .container, .dashWrap) {
  padding-inline: clamp(12px, 2.2vw, 28px) !important;
}

html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui :where(h1, .title) {
  color: #fff !important;
  font-weight: 800 !important;
  letter-spacing: -.045em !important;
  text-wrap: balance;
}

html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui h1 {
  font-size: clamp(27px, 4vw, 48px) !important;
  line-height: 1.02 !important;
}

html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui :where(h2, h3) {
  color: #f8f9fc !important;
  letter-spacing: -.025em !important;
  text-wrap: balance;
}

html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui :where(.muted, .sub, .info, small) {
  color: var(--apx-muted) !important;
}

html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui :where(.hero, .top) {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid rgba(117, 170, 255, .20) !important;
  border-radius: var(--apx-radius-lg) !important;
  background:
    radial-gradient(400px 210px at 100% 0, rgba(79, 156, 255, .18), transparent 64%),
    linear-gradient(145deg, rgba(29, 29, 40, .94), rgba(13, 14, 21, .94)) !important;
  box-shadow: var(--apx-shadow) !important;
  backdrop-filter: blur(22px) saturate(1.16);
  -webkit-backdrop-filter: blur(22px) saturate(1.16);
}

html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui :where(.hero, .top)::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 220px;
  height: 220px;
  top: -145px;
  right: -75px;
  border-radius: 50%;
  background: rgba(185, 146, 255, .16);
  filter: blur(4px);
}

html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui :where(
  .card, .panel, .box, .tablebox, .tableBox, .kpi, .stat, .item, .cliente,
  .clientPick, .notice, .empty, .widget, dialog
) {
  border: 1px solid var(--apx-line) !important;
  border-radius: var(--apx-radius) !important;
  background: linear-gradient(155deg, rgba(29, 30, 40, .88), rgba(17, 18, 25, .88)) !important;
  color: var(--apx-text) !important;
  box-shadow: var(--apx-shadow-sm), inset 0 1px 0 rgba(255, 255, 255, .045) !important;
  backdrop-filter: blur(18px) saturate(1.12);
  -webkit-backdrop-filter: blur(18px) saturate(1.12);
}

html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui :where(.card, .panel, .box, .tablebox, .tableBox) {
  overflow-wrap: anywhere;
}

html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui :where(.kpi, .stat) {
  position: relative;
  overflow: hidden;
}

html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui :where(.kpi, .stat)::after {
  content: "";
  position: absolute;
  width: 86px;
  height: 86px;
  right: -42px;
  bottom: -46px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(79, 156, 255, .19), transparent 68%);
  pointer-events: none;
}

html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui :where(.kpi, .stat) b {
  color: #fff !important;
  letter-spacing: -.035em;
}

/* Controls */
html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui :where(
  .btn, button, input[type="submit"], input[type="button"], .miniBtn, .ghostBtn, .cta
) {
  width: auto !important;
  min-width: 0;
  min-height: 44px !important;
  border: 1px solid rgba(255, 255, 255, .12) !important;
  border-radius: var(--apx-radius-sm) !important;
  padding: 10px 14px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px;
  color: #f7f9fd !important;
  background: rgba(255, 255, 255, .07) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .055) !important;
  font-weight: 750 !important;
  line-height: 1.15 !important;
  text-decoration: none !important;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}

html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui :where(
  .primary, .btn.primary, button.primary, .cta, .success:not(.notice):not(.card)
) {
  border-color: rgba(79, 156, 255, .52) !important;
  color: #fff !important;
  background: linear-gradient(180deg, #3090ff, #0868e8) !important;
  box-shadow: 0 12px 28px rgba(20, 119, 255, .25), inset 0 1px 0 rgba(255, 255, 255, .28) !important;
}

html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui :where(
  .danger, .dangerBtn, .btn.danger, button.danger
) {
  border-color: rgba(255, 104, 117, .34) !important;
  color: #ffd9dd !important;
  background: rgba(255, 104, 117, .12) !important;
}

html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui :where(
  .btn, button, input[type="submit"], input[type="button"], .miniBtn, .ghostBtn, .cta
):not(:disabled):active {
  transform: scale(.975);
}

html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui :where(
  .btn, button, input[type="submit"], input[type="button"], .miniBtn, .ghostBtn, .cta
):disabled {
  opacity: .52;
  cursor: not-allowed;
}

html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui .ap-icon-button {
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 !important;
  flex: 0 0 44px !important;
}

html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui :where(
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  select, textarea, .input, .select
) {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, .12) !important;
  border-radius: var(--apx-radius-sm) !important;
  padding: 11px 13px !important;
  color: var(--apx-text) !important;
  background: rgba(5, 7, 12, .58) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035) !important;
  outline: none;
}

html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.45;
}

html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui :where(
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  select, textarea, .input, .select
):focus {
  border-color: rgba(79, 156, 255, .72) !important;
  box-shadow: var(--apx-focus) !important;
}

html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui :where(label, legend) {
  color: #d4d7df !important;
  font-weight: 700 !important;
}

html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui select,
html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui select option {
  color-scheme: dark;
  background-color: #13151d !important;
  color: #f5f7fb !important;
}

html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui input[type="checkbox"],
html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui input[type="radio"] {
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  padding: 0 !important;
  accent-color: var(--apx-blue-strong);
}

html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui input[type="file"] {
  min-height: 50px;
  padding: 7px !important;
}

html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui input[type="file"]::file-selector-button {
  min-height: 34px;
  margin-right: 10px;
  border: 0;
  border-radius: 10px;
  padding: 7px 10px;
  color: #fff;
  background: var(--apx-blue-strong);
  font: inherit;
  font-weight: 700;
}

/* Pills, notices and status semantics */
html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui :where(.pill, .chip, .tag, .badge, .status) {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  border: 1px solid rgba(255, 255, 255, .10) !important;
  border-radius: 999px !important;
  padding: 5px 8px !important;
  color: #d9dce4 !important;
  background: rgba(255, 255, 255, .06) !important;
  font-size: 11px !important;
  font-weight: 750 !important;
  line-height: 1.1;
}

html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui :where(.ok, .good, .green, .success) {
  --apx-status: var(--apx-green);
}

html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui :where(.warn, .warning, .yellow) {
  --apx-status: var(--apx-yellow);
}

html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui :where(.bad, .error, .err, .red) {
  --apx-status: var(--apx-red);
}

html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui :where(
  .pill, .chip, .tag, .badge, .status
).ok,
html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui :where(
  .pill, .chip, .tag, .badge, .status
).good,
html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui :where(
  .pill, .chip, .tag, .badge, .status
).green {
  border-color: rgba(53, 217, 154, .30) !important;
  color: #bff8df !important;
  background: rgba(53, 217, 154, .10) !important;
}

html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui :where(.notice, .flash, .msg, .alert) {
  border-radius: var(--apx-radius-sm) !important;
  line-height: 1.42;
}

/* Tables: JavaScript supplies data-label from the real headers. */
html[data-ap-design="apple-pro"] body.ap-apple-ui .ap-table-host {
  min-width: 0;
  max-width: 100%;
}

html[data-ap-design="apple-pro"] body.ap-apple-ui table.ap-scroll-table,
html[data-ap-design="apple-pro"] body.ap-apple-ui table.ap-responsive-table {
  width: 100%;
  max-width: 100%;
}

html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui table.ap-responsive-table {
  border-collapse: separate !important;
  border-spacing: 0 8px !important;
}

html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui table.ap-responsive-table th {
  padding: 6px 11px !important;
  color: #969ba9 !important;
  background: transparent !important;
  border: 0 !important;
  font-size: 11px !important;
  font-weight: 750 !important;
  letter-spacing: .055em;
  text-transform: uppercase;
}

html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui table.ap-responsive-table td {
  padding: 12px 11px !important;
  color: #eef0f5 !important;
  background: rgba(255, 255, 255, .045) !important;
  border-block: 1px solid rgba(255, 255, 255, .075) !important;
  vertical-align: top;
}

html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui table.ap-responsive-table td:first-child {
  border-left: 1px solid rgba(255, 255, 255, .075) !important;
  border-radius: 15px 0 0 15px !important;
}

html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui table.ap-responsive-table td:last-child {
  border-right: 1px solid rgba(255, 255, 255, .075) !important;
  border-radius: 0 15px 15px 0 !important;
}

html[data-ap-design="apple-pro"] body.ap-apple-ui table.ap-scroll-table {
  display: table !important;
  min-width: max-content;
}

html[data-ap-design="apple-pro"] body.ap-apple-ui table.ap-scroll-table thead {
  display: table-header-group !important;
}

html[data-ap-design="apple-pro"] body.ap-apple-ui table.ap-scroll-table tbody {
  display: table-row-group !important;
}

html[data-ap-design="apple-pro"] body.ap-apple-ui table.ap-scroll-table tr {
  display: table-row !important;
}

html[data-ap-design="apple-pro"] body.ap-apple-ui table.ap-scroll-table :where(th, td) {
  display: table-cell !important;
}

html[data-ap-design="apple-pro"] body.ap-apple-ui .ap-table-host:has(> table.ap-scroll-table),
html[data-ap-design="apple-pro"] body.ap-apple-ui :where(.tableScroll, .tableWrap) {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}

/* Unified navigation: light glass on signature-light, dark glass elsewhere. */
html[data-ap-design="apple-pro"] body.ap-apple-ui :where(.apMenuBtn, .apMenuPanel, .apBottomNav, .apUnifiedBottomNav) {
  font-family: var(--apx-font) !important;
  backdrop-filter: blur(24px) saturate(1.28) !important;
  -webkit-backdrop-filter: blur(24px) saturate(1.28) !important;
}

html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui :where(.apMenuBtn, .apMenuPanel) {
  border-color: rgba(255, 255, 255, .13) !important;
  color: #f7f9fd !important;
  background: rgba(15, 16, 23, .88) !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .42) !important;
}

html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui .apMenuItem {
  border-color: rgba(255, 255, 255, .075) !important;
  border-radius: 14px !important;
  color: #e8eaf0 !important;
  background: rgba(255, 255, 255, .045) !important;
}

html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui .apMenuItem.active {
  border-color: rgba(79, 156, 255, .42) !important;
  color: #fff !important;
  background: rgba(79, 156, 255, .15) !important;
  box-shadow: inset 3px 0 0 var(--apx-blue) !important;
}

html[data-ap-design="apple-pro"][data-ap-surface="signature-light"] body.ap-apple-ui :where(
  .apMenuBtn, .apMenuPanel, .apBottomNav, .apUnifiedBottomNav
) {
  border-color: rgba(15, 23, 42, .10) !important;
  color: #13213a !important;
  background: rgba(255, 255, 255, .86) !important;
  box-shadow: 0 18px 50px rgba(29, 62, 112, .14) !important;
}

/*
 * Bottom navigation on light pages.
 * The legacy production layer uses near-white text for dark glass; without
 * this explicit light-surface state the inactive tabs disappear on white.
 */
html[data-ap-design="apple-pro"][data-ap-surface="signature-light"] body.ap-apple-ui :where(
  .apBottomNav.apIphoneBottomNav, .apUnifiedBottomNav.apIphoneBottomNav
) {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
}

html[data-ap-design="apple-pro"][data-ap-surface="signature-light"] body.ap-apple-ui :where(
  .apBottomNav.apIphoneBottomNav, .apUnifiedBottomNav.apIphoneBottomNav
) :where(a, button) {
  color: #536176 !important;
  background: rgba(15, 23, 42, .035) !important;
  border-color: transparent !important;
  opacity: 1 !important;
}

html[data-ap-design="apple-pro"][data-ap-surface="signature-light"] body.ap-apple-ui :where(
  .apBottomNav.apIphoneBottomNav, .apUnifiedBottomNav.apIphoneBottomNav
) :where(a, button) :where(i, span) {
  color: inherit !important;
  opacity: 1 !important;
}

html[data-ap-design="apple-pro"][data-ap-surface="signature-light"] body.ap-apple-ui :where(
  .apBottomNav.apIphoneBottomNav, .apUnifiedBottomNav.apIphoneBottomNav
) :where(a.active, button.active) {
  color: #21830f !important;
  background: linear-gradient(145deg, rgba(126, 255, 76, .22), rgba(126, 255, 76, .10)) !important;
  border-color: rgba(72, 199, 39, .38) !important;
  box-shadow: 0 8px 22px rgba(50, 155, 31, .14), inset 0 1px 0 rgba(255, 255, 255, .92) !important;
}

html[data-ap-design="apple-pro"][data-ap-surface="signature-light"] body.ap-apple-ui :where(
  .apBottomNav.apIphoneBottomNav, .apUnifiedBottomNav.apIphoneBottomNav
) :where(a.active, button.active) i {
  filter: drop-shadow(0 2px 5px rgba(50, 155, 31, .22)) !important;
}

@media (max-width: 350px) {
  html[data-ap-design="apple-pro"] body.ap-apple-ui :where(
    .apBottomNav.apIphoneBottomNav, .apUnifiedBottomNav.apIphoneBottomNav
  ) :where(a, button) {
    padding-inline: 1px !important;
    font-size: 8.7px !important;
    letter-spacing: -.035em !important;
  }
}

html[data-ap-design="apple-pro"][data-ap-surface="signature-light"] body.ap-apple-ui .apMenuItem {
  border-color: rgba(15, 23, 42, .08) !important;
  color: #15213a !important;
  background: rgba(15, 23, 42, .035) !important;
}

html[data-ap-design="apple-pro"][data-ap-surface="signature-light"] body.ap-apple-ui .apMenuItem.active {
  border-color: rgba(20, 119, 255, .25) !important;
  color: #0756c8 !important;
  background: rgba(20, 119, 255, .10) !important;
}

/* Preserve the two reference pages and their purpose-built controls. */
html[data-ap-design="apple-pro"][data-ap-page="artigiano-area"] body.ap-apple-ui,
html[data-ap-design="apple-pro"][data-ap-page="dashboard-finanza"] body.ap-apple-ui {
  font-family: var(--apx-font) !important;
}

html[data-ap-design="apple-pro"][data-ap-page="dashboard-finanza"] body.ap-apple-ui .fcc-card {
  box-shadow: 0 16px 48px rgba(0, 0, 0, .22), inset 0 1px 0 rgba(255, 255, 255, .035);
}

/* Signature page: finance always remains a coherent dark command center. */
html[data-ap-design="apple-pro"][data-ap-page="dashboard-finanza"] body.ap-apple-ui {
  color-scheme: dark !important;
  color: var(--fcc-text) !important;
  background: var(--fcc-bg) !important;
}

html[data-ap-design="apple-pro"][data-ap-page="dashboard-finanza"] body.ap-apple-ui :where(
  .apMenuBtn, .apMenuPanel, .apBottomNav, .apUnifiedBottomNav
),
html[data-ap-design="apple-pro"][data-ap-surface="signature-dark"] body.ap-apple-ui :where(
  .apMenuBtn, .apMenuPanel, .apBottomNav, .apUnifiedBottomNav
) {
  border-color: rgba(255, 255, 255, .13) !important;
  color: #f7f9fd !important;
  background: rgba(18, 17, 25, .90) !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .44) !important;
}

html[data-ap-design="apple-pro"][data-ap-surface="signature-dark"] body.ap-apple-ui .apMenuItem {
  border-color: rgba(255, 255, 255, .08) !important;
  color: #eef0f5 !important;
  background: rgba(255, 255, 255, .05) !important;
}

html[data-ap-design="apple-pro"][data-ap-surface="signature-dark"] body.ap-apple-ui .apMenuItem.active {
  border-color: rgba(79, 156, 255, .38) !important;
  color: #fff !important;
  background: rgba(79, 156, 255, .14) !important;
}

html[data-ap-design="apple-pro"][data-ap-page="dashboard-finanza"] body.ap-apple-ui .fcc-field :where(input, select, textarea) {
  border: 1px solid var(--fcc-line) !important;
  border-radius: 11px !important;
  padding: 11px !important;
  color: #fff !important;
  background: #160f1d !important;
  color-scheme: dark !important;
}

html[data-ap-design="apple-pro"][data-ap-page="dashboard-finanza"] body.ap-apple-ui .fcc-date input {
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  color: #fff !important;
  background: transparent !important;
  box-shadow: none !important;
}

html[data-ap-design="apple-pro"][data-ap-page="dashboard-finanza"] body.ap-apple-ui :where(
  .fcc-field label, .fcc-field > span, .fcc-card small
) {
  color: var(--fcc-muted) !important;
}

/* Signature page: the artisan dashboard is now genuinely fluid on desktop. */
@media (min-width: 900px) {
  html[data-ap-design="apple-pro"][data-ap-page="artigiano-area"] body.ap-apple-ui {
    align-items: flex-start !important;
    padding: clamp(20px, 3vw, 42px) !important;
  }

  html[data-ap-design="apple-pro"][data-ap-page="artigiano-area"] body.ap-apple-ui .phone {
    width: min(1180px, calc(100vw - 48px)) !important;
    max-width: 1180px !important;
    min-height: 0 !important;
    border-radius: 36px !important;
    padding: 8px !important;
  }

  html[data-ap-design="apple-pro"][data-ap-page="artigiano-area"] body.ap-apple-ui .screen {
    min-height: 760px !important;
    border-radius: 29px !important;
  }

  html[data-ap-design="apple-pro"][data-ap-page="artigiano-area"] body.ap-apple-ui .statusbar {
    border-radius: 28px 28px 0 0;
  }

  html[data-ap-design="apple-pro"][data-ap-page="artigiano-area"] body.ap-apple-ui .header {
    padding-inline: clamp(22px, 3vw, 38px) !important;
  }

  html[data-ap-design="apple-pro"][data-ap-page="artigiano-area"] body.ap-apple-ui .brand h1 {
    font-size: 22px;
  }

  html[data-ap-design="apple-pro"][data-ap-page="artigiano-area"] body.ap-apple-ui .brand small {
    max-width: 520px;
    font-size: 13px;
  }

  html[data-ap-design="apple-pro"][data-ap-page="artigiano-area"] body.ap-apple-ui .content.commandContent {
    grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
    align-items: start;
    gap: 14px !important;
    padding: 18px clamp(18px, 2.2vw, 28px) 26px !important;
  }

  html[data-ap-design="apple-pro"][data-ap-page="artigiano-area"] body.ap-apple-ui .commandContent > :where(
    .commandHero, .primaryActions, .flowPanel, .bottomStatsWrap, .logout-wrap, .home-indicator
  ) {
    grid-column: 1 / -1;
  }

  html[data-ap-design="apple-pro"][data-ap-page="artigiano-area"] body.ap-apple-ui .commandContent > .commandHero {
    grid-column: span 5;
    min-height: 100%;
  }

  html[data-ap-design="apple-pro"][data-ap-page="artigiano-area"] body.ap-apple-ui .commandContent > .taxReserveCard {
    grid-column: span 7;
    min-height: 100%;
  }

  html[data-ap-design="apple-pro"][data-ap-page="artigiano-area"] body.ap-apple-ui .commandContent:not(:has(.taxReserveCard)) > .commandHero {
    grid-column: 1 / -1;
  }

  html[data-ap-design="apple-pro"][data-ap-page="artigiano-area"] body.ap-apple-ui section[aria-label="Da fare ora"],
  html[data-ap-design="apple-pro"][data-ap-page="artigiano-area"] body.ap-apple-ui section[aria-label="Pulsanti rapidi"] {
    grid-column: span 5;
  }

  html[data-ap-design="apple-pro"][data-ap-page="artigiano-area"] body.ap-apple-ui .compactDrop,
  html[data-ap-design="apple-pro"][data-ap-page="artigiano-area"] body.ap-apple-ui section[aria-label="Ultimi lavori"] {
    grid-column: span 7;
  }

  html[data-ap-design="apple-pro"][data-ap-page="artigiano-area"] body.ap-apple-ui .commandContent:not(:has(section[aria-label="Da fare ora"])) > .compactDrop {
    grid-column: 1 / -1;
  }

  html[data-ap-design="apple-pro"][data-ap-page="artigiano-area"] body.ap-apple-ui .quickGrid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  html[data-ap-design="apple-pro"][data-ap-page="artigiano-area"] body.ap-apple-ui .quickGrid.artisanQuick {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Readability corrections for the compact artisan flow. */
html[data-ap-design="apple-pro"][data-ap-page="artigiano-area"] body.ap-apple-ui :where(
  .taxReserveMetric small, .taxReserveFoot, .waCallStatus, .waCallMeta,
  .fineSource, .fineExpenseLine, .fineReadonlyNote, .controlSub,
  .controlHero small, .controlField span, .controlPhoto
) {
  font-size: max(11.5px, .72rem) !important;
}

html[data-ap-design="apple-pro"][data-ap-page="artigiano-area"] body.ap-apple-ui :where(
  .controlField b, .payerChoice, .payerChoice b, .payerChoice small,
  .controlStatusPills span, .jobFlowStep b
) {
  font-size: max(11px, .69rem) !important;
  line-height: 1.2 !important;
}

html[data-ap-design="apple-pro"][data-ap-page="artigiano-area"] body.ap-apple-ui :where(
  .controlQuickActions a, .quickBtn, .assignFooter button
) {
  min-height: 44px !important;
}

/* Purpose-built pages with their own fixed controls keep one navigation layer. */
html[data-ap-design="apple-pro"][data-ap-page="preventivi-preventivi"] body.ap-apple-ui [data-ap-global-bottom-nav] {
  display: none !important;
}

html[data-ap-design="apple-pro"][data-ap-page="preventivi-preventivi"] body.ap-apple-ui :where(
  input, select, textarea
) {
  font-size: 16px !important;
}

html[data-ap-design="apple-pro"][data-ap-page="preventivi-preventivi"] body.ap-apple-ui :where(
  .moveBtn, .trash, .rowMic, .fieldMic, .optionalQuickBtn
) {
  min-width: 44px !important;
  min-height: 44px !important;
}

html[data-ap-design="apple-pro"][data-ap-page="preventivi-miei-preventivi"] body.ap-apple-ui .filters input[type="date"] {
  display: block !important;
}

/* The new recurring-cost editor grows into a real desktop form. */
@media (min-width: 900px) {
  html[data-ap-design="apple-pro"][data-ap-page="spese-ricorrenti-new-view"] body.ap-apple-ui .costPhone {
    width: min(960px, calc(100vw - 48px)) !important;
    max-width: 960px !important;
  }

  html[data-ap-design="apple-pro"][data-ap-page="spese-ricorrenti-new-view"] body.ap-apple-ui .costHeader {
    padding-inline: 22px;
  }

  html[data-ap-design="apple-pro"][data-ap-page="spese-ricorrenti-new-view"] body.ap-apple-ui .costTitle {
    font-size: 22px;
  }

  html[data-ap-design="apple-pro"][data-ap-page="spese-ricorrenti-new-view"] body.ap-apple-ui .costSurface {
    padding: 24px;
  }

  html[data-ap-design="apple-pro"][data-ap-page="spese-ricorrenti-new-view"] body.ap-apple-ui .costGrid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }

  html[data-ap-design="apple-pro"][data-ap-page="spese-ricorrenti-new-view"] body.ap-apple-ui .costField.full {
    grid-column: auto;
  }

  html[data-ap-design="apple-pro"][data-ap-page="spese-ricorrenti-new-view"] body.ap-apple-ui .costField.full:has(textarea) {
    grid-column: 1 / -1;
  }

  html[data-ap-design="apple-pro"][data-ap-page="spese-ricorrenti-new-view"] body.ap-apple-ui .costField label {
    font-size: 12px;
  }
}

/* Centralino: retain its visual identity, but remove the 430px tablet bottleneck. */
@media (min-width: 601px) and (max-width: 900px) {
  html[data-ap-design="apple-pro"][data-ap-page="centralino-didww"] body.ap-apple-ui :where(.app, .neoDashInner) {
    width: min(100%, 880px) !important;
    max-width: 880px !important;
    margin-inline: auto !important;
  }
}

@media (max-width: 900px) {
  html[data-ap-design="apple-pro"][data-ap-page="centralino-didww"] body.ap-apple-ui :where(
    .neoPrimaryActions a, .neoReceivedActions a, .neoCardFooter > a,
    .neoCardFooter > button, .neoCardFooter > details > summary,
    .neoFastButton, .neoFastDrawer summary, .neoFilterPill
  ) {
    min-height: 44px !important;
    font-size: max(11px, .69rem) !important;
  }
}

@media (min-width: 901px) {
  html[data-ap-design="apple-pro"][data-ap-page="centralino-didww"] body.ap-apple-ui .legacyCentralinoWrap {
    content-visibility: auto;
    contain-intrinsic-size: 1px 900px;
  }
}

/* One navigation layer per breakpoint, with reliable overlay stacking. */
html[data-ap-design="apple-pro"] body.ap-menu-open .apMenuWrap.open {
  z-index: 100100 !important;
}

html[data-ap-design="apple-pro"] body.ap-menu-open .apHomeQuick,
html[data-ap-design="apple-pro"] body.ap-ui.ap-page-preventivi-preventivi.ap-menu-open .mobileStickyTotal {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

@media (max-width: 900px) {
  html[data-ap-design="apple-pro"] body.ap-apple-ui .apHomeQuick {
    display: none !important;
  }

  html[data-ap-design="apple-pro"] body.ap-has-top-menu.ap-has-bottom-nav .apMenuWrap:not(.open),
  html[data-ap-design="apple-pro"] body.ap-has-top-menu.ap-has-bottom-nav .apMenuFixedSpacer {
    display: none !important;
  }

  /* Collapse the many legacy spacers to the real height of the sticky toolbar. */
  body.ap-ui.ap-page-preventivi-preventivi {
    padding-bottom: 0 !important;
  }

  body.ap-ui.ap-page-preventivi-preventivi .wrap {
    padding-bottom: calc(88px + var(--apx-safe-bottom)) !important;
  }

  body.ap-ui.ap-page-preventivi-preventivi :where(.mobileBuilder, #rows) {
    padding-bottom: 0 !important;
  }

  body.ap-ui.ap-page-preventivi-preventivi #rows::after {
    display: none !important;
    height: 0 !important;
  }

  body.ap-ui.ap-page-preventivi-preventivi #rows .mobileVoiceCard:last-child {
    margin-bottom: 14px !important;
  }

  body.ap-ui.ap-page-preventivi-preventivi #rows .mobileVoiceCard:last-child .addVoiceAfterBtn {
    margin-bottom: 0 !important;
  }

  body.ap-ui.ap-page-preventivi-preventivi .totals {
    margin-bottom: 16px !important;
  }
}

@media (min-width: 901px) {
  html[data-ap-design="apple-pro"] body.ap-has-top-menu.ap-has-bottom-nav :where(
    .apBottomNav, .apUnifiedBottomNav
  ),
  html[data-ap-design="apple-pro"][data-ap-page="artigiano-area"] body :where(
    .apBottomNav, .apUnifiedBottomNav
  ),
  html[data-ap-design="apple-pro"][data-ap-page="spese-ricorrenti-new-view"] body :where(
    .apBottomNav, .apUnifiedBottomNav
  ) {
    display: none !important;
  }

  html[data-ap-design="apple-pro"] body.ap-has-top-menu.ap-has-bottom-nav {
    padding-bottom: calc(28px + var(--apx-safe-bottom)) !important;
  }
}

/* Tablet layouts: neither a narrow phone mockup nor an oversized desktop grid. */
@media (min-width: 769px) and (max-width: 899px) {
  html[data-ap-design="apple-pro"][data-ap-page="artigiano-area"] body.ap-apple-ui {
    align-items: flex-start !important;
    padding: 18px !important;
  }

  html[data-ap-design="apple-pro"][data-ap-page="artigiano-area"] body.ap-apple-ui .phone {
    width: min(860px, calc(100vw - 36px)) !important;
    max-width: 860px !important;
    min-height: 0 !important;
    border-radius: 34px !important;
  }

  html[data-ap-design="apple-pro"][data-ap-page="artigiano-area"] body.ap-apple-ui .screen {
    min-height: 760px !important;
    padding-bottom: calc(100px + var(--apx-safe-bottom)) !important;
  }

  html[data-ap-design="apple-pro"][data-ap-page="artigiano-area"] body.ap-apple-ui .quickGrid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }

  html[data-ap-design="apple-pro"][data-ap-page="artigiano-area"] body.ap-apple-ui .quickGrid.artisanQuick {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (min-width: 600px) and (max-width: 899px) {
  html[data-ap-design="apple-pro"][data-ap-page="spese-ricorrenti-new-view"] body.ap-apple-ui .costPhone {
    width: min(820px, calc(100vw - 32px)) !important;
    max-width: 820px !important;
  }

  html[data-ap-design="apple-pro"][data-ap-page="spese-ricorrenti-new-view"] body.ap-apple-ui .costSurface {
    padding: 22px 20px 28px !important;
  }

  html[data-ap-design="apple-pro"][data-ap-page="spese-ricorrenti-new-view"] body.ap-apple-ui .costGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 15px !important;
  }

  html[data-ap-design="apple-pro"][data-ap-page="spese-ricorrenti-new-view"] body.ap-apple-ui .costField.full {
    grid-column: auto !important;
  }

  html[data-ap-design="apple-pro"][data-ap-page="spese-ricorrenti-new-view"] body.ap-apple-ui .costField.full:has(textarea) {
    grid-column: 1 / -1 !important;
  }
}

/* Dialogs become a comfortable iPhone sheet without changing their open/close logic. */
html[data-ap-design="apple-pro"] body.ap-apple-ui dialog {
  max-width: min(680px, calc(100vw - 24px));
  max-height: min(86vh, 860px);
}

html[data-ap-design="apple-pro"] body.ap-apple-ui dialog::backdrop {
  background: rgba(2, 4, 9, .70);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

/* Desktop: more breathing room and a calm hover language. */
@media (min-width: 1100px) {
  html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui :where(.card, .panel, .box) {
    padding: clamp(16px, 1.5vw, 22px);
  }

  html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui :where(
    .contentGrid, .grid2, .layout:not(.layout-fixed)
  ) {
    gap: clamp(14px, 1.4vw, 22px) !important;
  }
}

@media (hover: hover) and (pointer: fine) {
  html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui :where(
    .btn, button, input[type="submit"], input[type="button"], .miniBtn, .ghostBtn, .cta
  ):not(:disabled):hover {
    transform: translateY(-1px);
    border-color: rgba(79, 156, 255, .42) !important;
    background: rgba(255, 255, 255, .10) !important;
  }

  html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui :where(
    .card, .item, .cliente, .clientPick
  ):hover {
    border-color: rgba(79, 156, 255, .22) !important;
  }
}

/* Tablet and phone */
@media (max-width: 960px) {
  html[data-ap-design="apple-pro"] body.ap-apple-ui {
    overflow-x: clip;
  }

  html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui :where(
    .contentGrid, .grid2, .analysisGrid, .layout:not(.layout-fixed), .twoCol,
    .two-col, .two-columns, .cols, .formgrid, .formGrid
  ) {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui :where(
    .kpis, .kpiGrid, .stats, .metrics, .apKpiGrid
  ) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 740px) {
  html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui {
    background-attachment: scroll !important;
  }

  html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui :where(
    .app, .wrap, .container, .dashWrap
  ) {
    width: 100% !important;
    max-width: 100% !important;
    padding-inline: 9px !important;
  }

  html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui :where(.hero, .top) {
    border-radius: 22px !important;
    padding: 15px !important;
  }

  html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui :where(
    .card, .panel, .box, .tablebox, .tableBox, .kpi, .stat, .item, .cliente, .clientPick
  ) {
    border-radius: 18px !important;
  }

  html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui h1 {
    font-size: clamp(25px, 8vw, 34px) !important;
  }

  html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui :where(
    .toprow, .topRow, .cardHead, .sectionHead
  ) {
    align-items: stretch !important;
    flex-wrap: wrap !important;
  }

  html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui :where(
    .filters, form.filters, .search, .formline
  ) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 8px !important;
    width: 100% !important;
  }

  html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui :where(
    .filters, form.filters, .search, .formline
  ) > * {
    width: 100% !important;
    min-width: 0 !important;
  }

  html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui :where(
    .actions, .topActions, .apProdActions
  ) {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 7px !important;
    width: 100% !important;
  }

  html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui :where(
    .actions, .topActions, .apProdActions
  ) > :where(a, button, input[type="submit"], input[type="button"], form) {
    width: 100% !important;
    min-width: 0 !important;
  }

  html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui :where(
    .actions, .topActions, .apProdActions
  ) > form {
    display: contents;
  }

  html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui :where(
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea
  ) {
    font-size: 16px !important;
  }

  /* Do not let the older global CSS turn every button into a full-width control. */
  html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui button.ap-icon-button {
    width: 44px !important;
    min-width: 44px !important;
  }

  /* Mobile table cards */
  html[data-ap-design="apple-pro"] body.ap-apple-ui table.ap-responsive-table,
  html[data-ap-design="apple-pro"] body.ap-apple-ui table.ap-responsive-table :where(tbody, tr, td) {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  html[data-ap-design="apple-pro"] body.ap-apple-ui table.ap-responsive-table thead {
    display: none !important;
  }

  html[data-ap-design="apple-pro"] body.ap-apple-ui table.ap-responsive-table tbody {
    display: grid !important;
    gap: 10px;
  }

  html[data-ap-design="apple-pro"] body.ap-apple-ui table.ap-responsive-table tr {
    margin: 0 !important;
    overflow: hidden;
    border: 1px solid var(--apx-line) !important;
    border-radius: 18px !important;
    background: linear-gradient(155deg, rgba(28, 29, 39, .92), rgba(15, 16, 23, .94)) !important;
    box-shadow: var(--apx-shadow-sm) !important;
  }

  html[data-ap-design="apple-pro"] body.ap-apple-ui table.ap-responsive-table td {
    display: grid !important;
    grid-template-columns: minmax(88px, .38fr) minmax(0, 1fr) !important;
    gap: 9px !important;
    align-items: start;
    padding: 9px 11px !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, .07) !important;
    border-radius: 0 !important;
    background: transparent !important;
    overflow-wrap: anywhere;
  }

  html[data-ap-design="apple-pro"] body.ap-apple-ui table.ap-responsive-table td:last-child {
    border-bottom: 0 !important;
  }

  html[data-ap-design="apple-pro"] body.ap-apple-ui table.ap-responsive-table td::before {
    content: attr(data-label);
    color: #8ba1c3;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .035em;
    line-height: 1.25;
    text-transform: uppercase;
  }

  html[data-ap-design="apple-pro"] body.ap-apple-ui dialog {
    width: 100% !important;
    max-width: none !important;
    max-height: 88vh !important;
    margin: auto 0 0 !important;
    border-radius: 22px 22px 0 0 !important;
    border-bottom: 0 !important;
    padding-bottom: var(--apx-safe-bottom) !important;
  }

  html[data-ap-design="apple-pro"][data-ap-page="artigiano-area"] body.ap-apple-ui .screen {
    padding-bottom: calc(94px + var(--apx-safe-bottom)) !important;
  }

  html[data-ap-design="apple-pro"][data-ap-page="artigiano-area"] body.ap-apple-ui .jobFlowSteps {
    display: flex !important;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 6px !important;
    padding: 2px 1px 7px;
    scroll-snap-type: x mandatory;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
  }

  html[data-ap-design="apple-pro"][data-ap-page="artigiano-area"] body.ap-apple-ui .jobFlowStep {
    flex: 0 0 92px;
    min-height: 50px !important;
    padding: 7px 5px 5px 17px !important;
    scroll-snap-align: start;
  }

  html[data-ap-design="apple-pro"][data-ap-page="artigiano-area"] body.ap-apple-ui .jobFlowStep b {
    font-size: 10.5px !important;
    line-height: 1.12 !important;
  }

  html[data-ap-design="apple-pro"][data-ap-page="preventivi-preventivi"] body.ap-apple-ui .mobileStickyTotal {
    min-height: 58px !important;
    max-height: none !important;
    height: auto !important;
    bottom: max(7px, var(--apx-safe-bottom)) !important;
  }
}

@media (max-width: 440px) {
  html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui :where(
    .actions, .topActions, .apProdActions
  ) {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  /* The six quote actions intentionally remain 3 × 2 as requested. */
  html[data-ap-design="apple-pro"][data-ap-page="preventivi-miei-preventivi"] body.ap-apple-ui .pvActions {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  html[data-ap-design="apple-pro"][data-ap-page="preventivi-miei-preventivi"] body.ap-apple-ui .pvActions :where(
    a, button, form
  ) {
    min-width: 0 !important;
  }

  html[data-ap-design="apple-pro"][data-ap-page="preventivi-miei-preventivi"] body.ap-apple-ui .pvActions :where(
    a, button, .shareManager
  ) {
    grid-column: auto !important;
  }

  html[data-ap-design="apple-pro"][data-ap-page="preventivi-miei-preventivi"] body.ap-apple-ui .pvActions .shareManager[open] {
    grid-column: 1 / -1 !important;
  }

  html[data-ap-design="apple-pro"][data-ap-surface="workspace"] body.ap-apple-ui :where(
    .kpis, .kpiGrid, .stats, .metrics, .apKpiGrid
  ) {
    gap: 7px !important;
  }

  html[data-ap-design="apple-pro"] body.ap-apple-ui table.ap-responsive-table td {
    grid-template-columns: minmax(76px, .34fr) minmax(0, 1fr) !important;
    padding: 8px 9px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html[data-ap-design="apple-pro"] {
    scroll-behavior: auto;
  }

  html[data-ap-design="apple-pro"] *,
  html[data-ap-design="apple-pro"] *::before,
  html[data-ap-design="apple-pro"] *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@media print {
  html[data-ap-design="apple-pro"] body {
    color: #000 !important;
    background: #fff !important;
    padding: 0 !important;
  }

  html[data-ap-design="apple-pro"] body::before,
  html[data-ap-design="apple-pro"] body :where(.apMenuWrap, .apBottomNav, .apUnifiedBottomNav, .bottomNav) {
    display: none !important;
  }
}
