/*
 * @justapps-it/ui — stili dei componenti custom di login.ticly.it
 * Copiati da login.ticly.it/src/app/globals.css (tolte solo le parti di Tailwind e shadcn).
 */
@import url('https://fonts.googleapis.com/css2?family=Dela+Gothic+One&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=Space+Grotesk:wght@400;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600&display=swap');


:root {
    --font-logo: 'Dela Gothic One', cursive;
    --font-body: var(--font-google-sans, 'Google Sans Flex'), 'Plus Jakarta Sans', sans-serif;
        --bg-color: #000000;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.65);
    --text-muted: rgba(255, 255, 255, 0.45);
    --brand-purple: #8652ff;
    --brand-purple-glow: #6a0dad;
    --glass-bg: rgba(16, 18, 26, 0.85);
    --glass-border: rgba(255, 255, 255, 0.08);
                    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-pill: 9999px;
    --transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

@layer base {
  * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
  }

  body {
      background: linear-gradient(rgba(0, 0, 0, 0.14), rgba(0, 0, 0, 0.36)), url('/dolomiti-default.jpg') center/cover no-repeat, #07090e;
      color: var(--text-primary);
      font-family: var(--font-body);
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      position: relative;
      -webkit-font-smoothing: antialiased;
      overflow-x: hidden;
  }

  a {
      color: inherit;
      text-decoration: none;
  }

  button {
      font-family: var(--font-body);
      cursor: pointer;
      border: none;
      background: none;
  }

  input {
      font-family: var(--font-body);
  }
}

/* ── Layout & Ambient ── */

.page-wrapper {
    position: relative;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 2rem;
    z-index: 10;
    min-height: 100vh;
}

.glow-container {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    overflow: hidden; z-index: 0; pointer-events: none;
    background: #000000;
}

.glow-orb {
    position: absolute; border-radius: 50%;
    filter: blur(100px); opacity: 0.6;
    animation: floatOrb 20s infinite alternate ease-in-out;
}

.orb-1 { width: 50vw; height: 50vw; top: -10%; left: -10%; background: rgba(134,82,255,0.4); animation-delay: 0s; }
.orb-2 { width: 40vw; height: 40vw; bottom: -10%; right: -10%; background: rgba(106,13,173,0.3); animation-delay: -5s; }
.orb-3 { width: 30vw; height: 30vw; top: 40%; left: 40%; background: rgba(80,40,150,0.2); animation-delay: -10s; }

@keyframes floatOrb {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(10vw, 10vh) scale(1.1); }
}

.text-gradient {
    background: linear-gradient(135deg, #b084ff, #8652ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* ── Nav ── */

.dash-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 2rem 0 4rem 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 2rem;
    z-index: 100;
    background: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0.7) 50%, transparent 100%);
    pointer-events: none;
}

.dash-nav > * {
    pointer-events: auto;
}

.logo {
    font-family: var(--font-logo);
    color: var(--text-primary);
    font-size: 1.8rem;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.logo:hover {
    color: var(--brand-purple);
}

.cir-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  background-color: #ffffff;
  color: #000000 !important;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1;
  cursor: pointer;
  box-shadow:
    0 1px 1px rgba(255, 255, 255, 0.06),
    0 14px 28px -18px rgba(255, 255, 255, 0.4);
  transition:
    transform 140ms cubic-bezier(0.22, 1, 0.36, 1),
    background-color 220ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 220ms cubic-bezier(0.22, 1, 0.36, 1);
  text-decoration: none;
}

.cir-btn__arrow {
  width: 16px;
  height: 16px;
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.cir-btn:hover {
  background: #f0f0f0;
  box-shadow:
    0 1px 1px rgba(255, 255, 255, 0.08),
    0 20px 36px -16px rgba(255, 255, 255, 0.48);
}

.cir-btn:hover .cir-btn__arrow {
  transform: translate(2px, -2px);
}

.cir-btn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.32),
    0 14px 28px -18px rgba(255, 255, 255, 0.4);
}

.cir-btn:active {
  transform: translateY(1px);
}

/* ── Bento Glass Panels (ticly.it style) ── */

.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto auto auto;
  grid-template-areas:
    "a a b"
    "c d b"
    "c e e";
  gap: 1rem;
}

.bento-card {
    background: rgba(16, 18, 26, 0.85);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-lg);
    padding: 2rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    min-height: 250px;
}

.col-span-2 { grid-column: span 2; }
.col-span-1 { grid-column: span 1; }

@media (max-width: 768px) {
    .col-span-2 { grid-column: span 1; }
}

.card-hover-effect {
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), border-color 0.3s ease;
}

.card-hover-effect:hover {
    transform: translateY(-5px);
    border-color: rgba(134,82,255,0.5);
}

.card-glow {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at top right, rgba(134,82,255,0.15), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.card-hover-effect:hover .card-glow {
    opacity: 1;
}

.glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    z-index: 10;
    width: 100%;
}

.auth-panel {
    max-width: 450px;
    margin: 0 auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.9), rgba(40, 20, 60, 0.4));
    border: 1px solid rgba(134, 82, 255, 0.3);
}

.dashboard-panel {
    background: rgba(20, 20, 20, 0.6);
    border: 1px solid var(--glass-border);
}

.dashboard-panel:hover {
    transform: translateY(-4px);
    border-color: rgba(134, 82, 255, 0.4);
}

/* ── Typography ── */

h1 {
    font-family: var(--font-body);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

p.subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 2rem;
}

/* ── Form Elements ── */

.form-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-input {
    width: 100%;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-pill);
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
    outline: none;
}

.form-input:focus {
    border-color: rgba(134, 82, 255, 0.8);
    background: rgba(10, 10, 10, 0.8);
    box-shadow: 0 0 0 3px rgba(134, 82, 255, 0.15);
}

/* ── Buttons ── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2.2rem;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    width: 100%;
    cursor: pointer;
    text-decoration: none;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--brand-purple);
    color: #fff;
    border: none;
    box-shadow: 0 4px 20px rgba(140, 82, 255, 0.4);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(134, 82, 255, 0.35);
}

.btn-secondary {
    background: rgba(20, 20, 20, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    backdrop-filter: blur(20px);
}

.btn-secondary:hover:not(:disabled) {
    transform: translateY(-2px);
    border-color: rgba(134, 82, 255, 0.6);
    box-shadow: 0 10px 30px rgba(134, 82, 255, 0.25);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ── Badges & Alerts ── */

.badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-pill);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.auth-error {
    background: rgba(255, 70, 70, 0.1);
    color: #ff8080;
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 70, 70, 0.2);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-align: left;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-muted);
    margin: 1.5rem 0;
}

.auth-divider-line {
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.auth-divider-text {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.auth-footer a {
    color: var(--brand-purple);
    font-weight: 600;
    transition: var(--transition);
}

.auth-footer a:hover {
    color: #a974ff;
}

/* ── Avatar Google Style ── */
.auth-greeting {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 2rem;
}

.auth-greeting-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--brand-purple);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 auto 1rem;
    box-shadow: 0 0 0 4px rgba(134, 82, 255, 0.2), 0 10px 30px rgba(134, 82, 255, 0.4);
}

/* ── Animation ── */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.animate-fade-in {
    animation: fadeIn 0.6s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }

/* ── Password input specific ── */

.password-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.password-row .form-label {
    margin-bottom: 0;
}

.forgot-link {
    font-size: 0.85rem;
    color: var(--brand-purple);
    font-weight: 500;
}

.forgot-link:hover {
    color: #a974ff;
}

/* ── Split Layout for Auth ── */
.split-layout {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background-color: var(--bg-color);
}

.split-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem;
    position: relative;
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.9), rgba(40, 20, 60, 0.4));
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.split-left-content {
    position: relative;
    z-index: 10;
    max-width: 600px;
}

.split-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background: var(--bg-color);
    position: relative;
}

.split-form-container {
    width: 100%;
    max-width: 400px;
    position: relative;
}

.split-mobile-logo {
    display: none;
    margin-bottom: 2rem;
    text-align: center;
}

/* Mobile responsive split layout */
@media (max-width: 900px) {
    .split-layout {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
    }

    .split-left {
        display: none !important;
    }

    .split-right {
        flex: 1;
        width: 100%;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 2.5rem 1.25rem 3rem 1.25rem;
    }

    .split-form-container {
        max-width: 400px;
        width: 100%;
    }

    .split-mobile-logo {
        display: inline-flex;
    }
}

/* ── APPLE STYLE DASHBOARD LAYOUT ── */
/* ── Modern SaaS Workspace Dashboard ── */
/* ── Modern SaaS Workspace Dashboard ── */
.saas-layout {
    display: flex;
    flex-direction: row;
    min-height: 100vh;
    background-color: #000000;
    color: var(--text-primary);
    position: relative;
}

.saas-mobile-bar {
    display: none;
    height: 60px;
    background: rgba(10, 10, 14, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.saas-sidebar {
    width: 300px;
    background: linear-gradient(90deg, #000000 0%, rgba(0, 0, 0, 0.95) 40%, rgba(0, 0, 0, 0.6) 75%, rgba(0, 0, 0, 0) 100%);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-right: none;
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1.15rem;
    position: sticky;
    top: 0;
    height: 100vh;
    flex-shrink: 0;
    z-index: 50;
    overflow-y: auto;
}

.saas-sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding: 0 0.5rem;
}

.saas-sidebar-user-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 999px;
    padding: 0.5rem 1.1rem 0.5rem 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.saas-sidebar-token-widget {
    background: linear-gradient(135deg, rgba(134, 82, 255, 0.12) 0%, rgba(20, 20, 30, 0.7) 100%);
    border: 1px solid rgba(134, 82, 255, 0.25);
    border-radius: 20px;
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
}

.saas-content-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.saas-content {
    flex: 1;
    padding: 3rem 3.5rem;
    max-width: 1250px;
    width: 100%;
    margin: 0 auto;
}

.saas-nav-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
}

.saas-nav-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 0.92rem;
    font-weight: 500;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: all 0.2s ease;
    text-decoration: none;
}

.saas-nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.saas-nav-item.active {
    background: rgba(134, 82, 255, 0.15);
    color: #ffffff;
    border-color: rgba(134, 82, 255, 0.3);
    font-weight: 600;
}

.saas-nav-item.active svg {
    color: var(--brand-purple);
}

/* ── From Uiverse.io by uiverse-astronaut: CIR-TABS PILL SWITCHER ── */
.cir-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  background: linear-gradient(180deg, rgba(24, 24, 34, 0.75) 0%, rgba(10, 10, 14, 0.95) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  box-shadow:
    0 10px 30px -10px rgba(0, 0, 0, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  font-family: inherit;
  user-select: none;
  max-width: 100%;
}

.cir-tabs__r {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.cir-tabs__t {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 18px;
  border-radius: 999px !important;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary, #94a3b8);
  cursor: pointer;
  white-space: nowrap;
  background: transparent;
  border: 1px solid transparent;
  transition:
    background-color 220ms cubic-bezier(0.22, 1, 0.36, 1),
    color 220ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 220ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 180ms ease;
  text-decoration: none;
}

.cir-tabs__t:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.cir-tabs__r:checked + .cir-tabs__t,
.cir-tabs__t.active {
  background: #ffffff !important;
  color: #000000 !important;
  font-weight: 600 !important;
  border-radius: 999px !important;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.12),
    0 8px 18px -6px rgba(255, 255, 255, 0.35) !important;
}

.cir-tabs__r:checked + .cir-tabs__t svg,
.cir-tabs__t.active svg {
  color: #000000 !important;
}

.cir-tabs__r:focus-visible + .cir-tabs__t {
  box-shadow: 0 0 0 3px rgba(134, 82, 255, 0.4);
}

/* Sidebar grouped container strictly matching concentric pill curvature */
.cir-tabs-vertical {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  width: 100%;
  user-select: none;
}

.cir-tabs-vertical .cir-tabs__t {
  height: 42px;
  justify-content: flex-start;
  padding: 0 18px;
  border-radius: 999px !important;
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary, #94a3b8);
  font-size: 13.5px;
  transition: all 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

.cir-tabs-vertical .cir-tabs__t:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.cir-tabs-vertical .cir-tabs__r:checked + .cir-tabs__t {
  background: #ffffff !important;
  color: #000000 !important;
  font-weight: 600 !important;
  border-radius: 999px !important;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.15),
    0 8px 18px -6px rgba(255, 255, 255, 0.35) !important;
}

.cir-tabs-vertical .cir-tabs__r:checked + .cir-tabs__t svg {
  color: #000000 !important;
}

/* Top Horizontal Segmented Pill Bar */
.saas-top-pill-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 2.5rem;
  width: 100%;
}

.saas-hero-card {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0.5rem 0 2rem 0;
    position: relative;
    overflow: visible;
    margin-bottom: 2rem;
}

.saas-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.saas-stat-card {
    background: rgba(20, 20, 20, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: blur(20px);
    transition: all 0.25s ease;
}

.saas-stat-card:hover {
    border-color: rgba(255, 255, 255, 0.16);
    transform: translateY(-2px);
}

.saas-apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.saas-app-card {
    background: rgba(18, 18, 20, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.25s ease;
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
}

.saas-app-card:hover {
    border-color: rgba(134, 82, 255, 0.4);
    background: rgba(24, 22, 30, 0.85);
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(134, 82, 255, 0.15);
}

.saas-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.saas-section-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.saas-card-panel {
    background: rgba(18, 18, 20, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(20px);
}

.saas-sidebar-backdrop {
    display: none;
}

@media (max-width: 900px) {
    .saas-layout {
        flex-direction: column;
        padding-top: 60px;
    }

    .saas-mobile-bar {
        display: flex;
    }

    .saas-sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.75);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        z-index: 190;
    }

    .saas-sidebar {
        position: fixed;
        left: -290px;
        top: 0;
        bottom: 0;
        width: 280px;
        height: 100vh;
        z-index: 200;
        background: #0d0e14;
        border-right: 1px solid rgba(255, 255, 255, 0.12);
        box-shadow: 10px 0 40px rgba(0, 0, 0, 0.85);
        transition: left 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    }

    .saas-sidebar.open {
        left: 0;
    }

    .saas-content {
        padding: 1.25rem 1rem 3rem 1rem;
    }

    .saas-hero-card {
        padding: 1.5rem 1.25rem;
        border-radius: 16px;
    }

    .saas-hero-card h1 {
        font-size: 1.6rem !important;
    }

    .saas-stats-grid {
        grid-template-columns: 1fr;
        gap: 0.85rem;
        margin-bottom: 1.5rem;
    }

    .saas-stat-card {
        padding: 1.15rem;
    }

    .saas-apps-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .saas-app-card {
        padding: 1.25rem;
        border-radius: 16px;
    }

    .saas-card-panel {
        padding: 1.25rem;
        border-radius: 16px;
    }
}

@media (max-width: 480px) {
    .glass-panel {
        padding: 1.5rem 1.15rem;
        border-radius: 18px;
    }

    .auth-panel {
        padding: 1.5rem 1.15rem;
    }

    .btn {
        padding: 0.85rem 1.5rem;
        font-size: 0.95rem;
    }

    .form-input {
        padding: 0.85rem 1.15rem;
        font-size: 0.95rem;
    }

    .saas-header-right {
        gap: 0.4rem;
    }

    .saas-hero-card {
        padding: 1rem;
    }

    .saas-section-title {
        font-size: 1.15rem;
    }
}

/* ── REDESIGNED TICLY ACCOUNT PROFILE STYLES ── */
.profile-hero-banner {
    background: linear-gradient(135deg, rgba(24, 24, 38, 0.75) 0%, rgba(12, 12, 20, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 24px;
    padding: 2rem 2.25rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 50px -15px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.profile-hero-glow {
    position: absolute;
    top: -50px;
    right: -50px;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(134, 82, 255, 0.22) 0%, rgba(0, 0, 0, 0) 70%);
    pointer-events: none;
}

.profile-avatar-circle {
    width: 104px;
    height: 104px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(134, 82, 255, 0.3) 0%, rgba(20, 20, 30, 0.8) 100%);
    border: 3px solid rgba(134, 82, 255, 0.6);
    box-shadow: 0 0 30px rgba(134, 82, 255, 0.25);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.profile-avatar-circle:hover {
    transform: scale(1.03);
    border-color: #a87ffb;
}

.profile-avatar-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 18, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    border-radius: 50%;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 600;
    gap: 4px;
}

.profile-avatar-circle:hover .profile-avatar-overlay {
    opacity: 1;
}

.profile-avatar-preset-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid transparent;
    padding: 0;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-avatar-preset-btn:hover {
    transform: scale(1.12);
    border-color: rgba(134, 82, 255, 0.6);
}

.profile-avatar-preset-btn.selected {
    transform: scale(1.15);
    border-color: var(--brand-purple);
    box-shadow: 0 0 18px rgba(134, 82, 255, 0.6);
}

.profile-grid-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.75rem;
    margin-bottom: 2rem;
}

@media (max-width: 900px) {
    .profile-grid-layout {
        grid-template-columns: 1fr;
    }
}

.profile-sub-card {
    background: linear-gradient(180deg, rgba(20, 20, 30, 0.6) 0%, rgba(10, 10, 16, 0.85) 100%);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 20px;
    padding: 1.75rem;
    position: relative;
    box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.5);
}

.profile-sub-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.profile-badge-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.85rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.profile-copy-id-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-family: monospace;
    cursor: pointer;
    transition: all 0.2s ease;
}

.profile-copy-id-btn:hover {
    background: rgba(255, 255, 255, 0.09);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
}

/* Accessibility: Global Focus Visible */
*:focus-visible {
  outline: 2px solid var(--brand-purple);
  outline-offset: 2px;
}

/* Accessibility: Prefers Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


/* ══════════════════════════════════════════════
   DASHBOARD - PREMIUM SAAS (LINEAR / APPLE STYLE)
══════════════════════════════════════════════ */




.bento-page {
  padding: 3rem 4rem;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.bento-title {
  font-size: 2.2rem;
  font-weight: 500;
  letter-spacing: -0.04em;
  margin-bottom: 2.5rem;
  color: #fff;
  font-family: var(--font-body), sans-serif;
  text-shadow: 0 2px 10px rgba(255,255,255,0.1);
}

/* ══════════════════════════════════════════════
   PANORAMICA · GRIGLIA WIDGET
   3 colonne → 2 → 1 in base alla larghezza reale del contenitore
   (si adatta anche quando il pannello widget è aperto)
══════════════════════════════════════════════ */
.dw-grid-container {
  container-type: inline-size;
  container-name: dwgrid;
  width: 100%;
}

.dw-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 195px;
  grid-auto-flow: row dense;
  gap: 16px;
  width: 100%;
}

/* 3 TIPOLOGIE STANDARDIZZATE (STILE IOS: PICCOLA, MEDIA, GRANDE) */
.dw-tile.span-1x {
  grid-column: span 1;
}

.dw-tile.span-2x {
  grid-column: span 2;
}

.dw-tile.span-full {
  grid-column: 1 / -1;
}

@container dwgrid (max-width: 760px) {
  .dw-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@container dwgrid (max-width: 500px) {
  .dw-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
  .dw-grid .dw-tile.span-1x,
  .dw-grid .dw-tile.span-2x,
  .dw-grid .dw-tile.span-full,
  .dw-add-tile {
    grid-column: 1 / -1;
  }
  .dw-add-tile {
    min-height: 120px;
  }
  .dw-tile-resize {
    display: none !important;
  }
}

/* Superficie widget: vetro scuro con luce dall'alto, come i widget di macOS */
.dw-tile {
  position: relative;
  min-width: 0;
  height: 100%;
  box-sizing: border-box;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.078) 0%, rgba(255, 255, 255, 0.04) 100%);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 14px 34px -16px rgba(0, 0, 0, 0.6);
  color: #fff;
  -webkit-tap-highlight-color: transparent;
  transition:
    background 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.3s ease;
}

.dw-tile:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.095) 0%, rgba(255, 255, 255, 0.05) 100%);
  border-color: rgba(255, 255, 255, 0.13);
}

.dw-tile.is-pressable {
  cursor: pointer;
}

.dw-tile-body {
  height: 100%;
  min-height: 0;
}

.dw-tile.is-preview {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Modalità modifica */
.dw-tile.is-editing {
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: pan-y;
}

.dw-tile.is-editing:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.85), 0 14px 34px -16px rgba(0, 0, 0, 0.6);
}

.dw-tile.is-lifted {
  z-index: 50;
  cursor: grabbing;
  background: linear-gradient(180deg, rgba(62, 64, 74, 0.96) 0%, rgba(42, 44, 52, 0.96) 100%);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 36px 72px -18px rgba(0, 0, 0, 0.85), 0 0 0 0.5px rgba(255, 255, 255, 0.1);
}

.dw-tile.is-resizing {
  z-index: 40;
  box-shadow: 0 26px 54px -18px rgba(0, 0, 0, 0.8);
}

body.is-dragging-widget,
body.is-dragging-widget * {
  cursor: grabbing !important;
}

body.is-resizing-widget,
body.is-resizing-widget * {
  cursor: nwse-resize !important;
  user-select: none !important;
}

/* Pulsante "−" in stile iOS */
.dw-tile-remove {
  position: absolute;
  top: -8px;
  left: -8px;
  z-index: 6;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(118, 118, 128, 0.64);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  backdrop-filter: blur(16px) saturate(180%);
  box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.18), 0 3px 10px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.dw-tile-remove:hover {
  background: rgba(142, 142, 147, 0.82);
}

.dw-tile-remove:active {
  background: rgba(99, 99, 102, 0.92);
}

/* Maniglia di ridimensionamento ad arco, come su iOS 18 */
.dw-tile-resize {
  position: absolute;
  right: -6px;
  bottom: -6px;
  z-index: 6;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  cursor: nwse-resize;
  touch-action: none;
}

.dw-tile-resize svg {
  display: block;
  overflow: visible;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.55));
}

.dw-tile-resize-arc {
  fill: none;
  stroke: rgba(255, 255, 255, 0.88);
  stroke-width: 5;
  stroke-linecap: round;
  transition: stroke 0.18s ease, stroke-width 0.18s ease;
}

.dw-tile-resize:hover .dw-tile-resize-arc,
.dw-tile.is-resizing .dw-tile-resize-arc {
  stroke: #fff;
  stroke-width: 6;
}

/* Tile "Aggiungi widget" e stato vuoto */
.dw-add-tile {
  grid-column: span 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1.5px dashed rgba(255, 255, 255, 0.16);
  background: transparent;
  color: rgba(235, 235, 245, 0.6);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.dw-add-tile:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.03);
}

.dw-add-tile:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.85);
}

.dw-grid-empty {
  grid-column: 1 / -1;
  grid-row: span 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 2rem;
  border-radius: 22px;
  border: 1.5px dashed rgba(255, 255, 255, 0.14);
  color: rgba(235, 235, 245, 0.6);
  text-align: center;
  font-size: 13px;
}

.dw-grid-empty strong {
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Intestazione Panoramica */
.dw-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.dw-header > :first-child {
  flex: 1 1 280px;
}

.dw-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 6px;
  margin-left: auto;
}

.dw-icon-btn {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: rgba(118, 118, 128, 0.24);
  color: #fff;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.dw-icon-btn:hover {
  background: rgba(118, 118, 128, 0.36);
}

.dw-edit-btn,
.dw-done-btn {
  height: 34px;
  padding: 0 17px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.dw-edit-btn {
  background: rgba(118, 118, 128, 0.24);
  color: #fff;
}

.dw-edit-btn:hover {
  background: rgba(118, 118, 128, 0.36);
}

.dw-done-btn {
  background: #fff;
  color: #000;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.dw-done-btn:hover {
  background: #e8e8ed;
}

.dw-icon-btn:active,
.dw-edit-btn:active,
.dw-done-btn:active {
  transform: scale(0.95);
}

.dw-icon-btn:focus-visible,
.dw-edit-btn:focus-visible,
.dw-done-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.85);
}

.dw-hint-touch {
  display: none;
}

@media (hover: none) and (pointer: coarse) {
  .dw-hint-pointer {
    display: none;
  }
  .dw-hint-touch {
    display: inline;
  }
}

/* ══════════════════════════════════════════════
   WIDGET · TIPOGRAFIA E PRIMITIVE (STILE APPLE)
══════════════════════════════════════════════ */
.wg {
  --wg-secondary: rgba(235, 235, 245, 0.6);
  --wg-tertiary: rgba(235, 235, 245, 0.3);
  --wg-separator: rgba(255, 255, 255, 0.08);
  --wg-fill: rgba(255, 255, 255, 0.07);
  --wg-fill-hover: rgba(255, 255, 255, 0.12);
  height: 100%;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  color: #fff;
  font-size: 13px;
  line-height: 1.3;
  letter-spacing: -0.006em;
}

.wg-pressable {
  outline: none;
  border-radius: 8px;
}

.wg-pressable:focus-visible {
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.7);
}

.wg-head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 18px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.012em;
}

.wg-head svg {
  flex-shrink: 0;
}

.wg-head-trailing {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--wg-tertiary);
}

.wg-push {
  margin-top: auto;
  min-width: 0;
}

.wg-row-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.wg-hero {
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.02;
  font-variant-numeric: tabular-nums;
}

.wg-title-xl {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.wg-title-lg {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.25;
}

.wg-secondary {
  color: var(--wg-secondary);
  font-size: 13px;
  line-height: 1.35;
}

.wg-tertiary {
  color: var(--wg-tertiary);
  font-size: 12px;
  line-height: 1.35;
}

.wg-ellipsis {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wg-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wg-link {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: #0a84ff;
  font-weight: 600;
  text-decoration: none;
}

.wg-link:hover {
  color: #409cff;
}

.wg-icon-btn {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
  background: transparent;
  color: var(--wg-tertiary);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.wg-icon-btn:hover {
  background: var(--wg-fill);
  color: #fff;
}

.wg-icon-btn.is-done {
  color: #30d158;
}

/* Account */
.wg-avatar {
  display: block;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 8px 18px -8px rgba(0, 0, 0, 0.6);
}

.wg-monogram {
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #a6abb7 0%, #7d828f 100%);
  color: #fff;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.wg-plan-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--wg-secondary);
}

.wg.wg-split {
  flex-direction: row;
  gap: 22px;
}

.wg-split-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.wg-split-side {
  flex: 0 1 270px;
  align-self: center;
  padding-left: 22px;
  border-left: 1px solid var(--wg-separator);
}

.wg-facts {
  margin: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.wg-facts > div {
  min-width: 0;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--wg-separator);
}

.wg-facts > div:last-child {
  border-bottom: 0;
}

.wg-facts dt {
  flex-shrink: 0;
  color: var(--wg-secondary);
  font-size: 13px;
}

.wg-facts dd {
  margin: 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
}

.wg-mono {
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--wg-secondary);
}

/* Sicurezza */
.wg-security {
  margin-top: auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 16px;
}

.wg-security-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.wg-ring {
  position: relative;
  flex-shrink: 0;
}

.wg-ring svg {
  display: block;
}

.wg-ring-progress {
  transition: stroke-dashoffset 0.9s cubic-bezier(0.16, 1, 0.3, 1), stroke 0.3s ease;
}

.wg-ring-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.wg-ring-value {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.wg-ring-value small {
  margin-left: 1px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--wg-secondary);
}

.wg-checklist {
  flex: 0 1 230px;
  min-width: 0;
  margin: 0 0 0 auto;
  padding: 0 0 0 20px;
  list-style: none;
  border-left: 1px solid var(--wg-separator);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wg-checklist li {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--wg-secondary);
  font-size: 13px;
}

.wg-checklist li.is-ok {
  color: #fff;
}

.wg-check {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: inset 0 0 0 1.5px rgba(235, 235, 245, 0.3);
}

.is-ok .wg-check {
  background: #30d158;
  box-shadow: none;
}

/* Token AI */
.wg-meter {
  height: 6px;
  margin-top: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.wg-meter > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  transition: width 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.wg-meter-legend {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--wg-tertiary);
  font-variant-numeric: tabular-nums;
}

.wg-tokens-wide .wg-hero {
  font-size: 40px;
}

/* Azioni rapide */
.wg.wg-actions {
  display: grid;
  gap: 8px;
}

.wg-actions.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.wg-actions.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.wg-action {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px 11px;
  border: 0;
  border-radius: 14px;
  background: var(--wg-fill);
  color: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.wg-action:hover {
  background: var(--wg-fill-hover);
}

.wg-action:active {
  transform: scale(0.95);
}

.wg-action-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: inset 0 0.5px 0 rgba(255, 255, 255, 0.3);
}

.wg-action-label {
  max-width: 100%;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.012em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* App ticly */
.wg-apps {
  margin-top: auto;
  display: grid;
  gap: 8px;
}

.wg-apps.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wg-apps.cols-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.wg-app {
  height: 56px;
  min-width: 0;
  padding: 0 12px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--wg-fill);
  transition: background-color 0.15s ease, transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.wg-apps.cols-5 .wg-app {
  height: 96px;
}

.wg-app:hover {
  background: var(--wg-fill-hover);
}

.wg-app:active {
  transform: scale(0.95);
}

.wg-app img {
  width: auto;
  height: 19px;
  max-width: 100%;
  object-fit: contain;
}

/* Ricerca (Spotlight) */
.wg-search-field {
  height: 38px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 12px;
  border-radius: 12px;
  background: rgba(118, 118, 128, 0.24);
  color: var(--wg-secondary);
  cursor: text;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.wg-search-field:focus-within {
  background: rgba(118, 118, 128, 0.3);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.55);
}

.wg-search-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 15px;
  letter-spacing: -0.012em;
}

.wg-search-field input::placeholder {
  color: var(--wg-secondary);
}

.wg-search-clear {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(235, 235, 245, 0.45);
  color: #1c1c1e;
  cursor: pointer;
}

.wg-caption {
  min-height: 16px;
  margin: 12px 0 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--wg-tertiary);
}

.wg-results {
  margin: 0;
  padding: 0;
  list-style: none;
}

.wg-results button {
  width: calc(100% + 16px);
  height: 30px;
  margin: 0 -8px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.wg-results button:hover,
.wg-results button:focus-visible {
  outline: none;
  background: var(--wg-fill);
}

.wg-result-title {
  flex: 1;
  min-width: 0;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wg-result-meta {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--wg-tertiary);
}

.wg-empty-text {
  margin-top: 4px;
}

/* Note */
.wg-notes-input {
  flex: 1;
  width: 100%;
  min-height: 0;
  margin-top: 8px;
  padding: 0;
  border: 0;
  outline: none;
  resize: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

.wg-notes-input::placeholder {
  color: var(--wg-tertiary);
}


/* Elenchi (Modelli AI) */
.wg-list {
  margin: auto 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  column-gap: 22px;
}

.wg-list.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wg-list.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.wg-list li {
  min-width: 0;
  height: 34px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--wg-separator);
}

.wg-list.cols-1 li:last-child,
.wg-list.cols-2 li:nth-last-child(-n + 2),
.wg-list.cols-3 li:nth-last-child(-n + 3) {
  border-bottom: 0;
}

.wg-list-title {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wg-list-meta {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--wg-tertiary);
}

/* Connected Subpanel within widgets */
.connected-subpanel {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 0.85rem 1.1rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.connected-subpanel:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.connected-subpanel:active {
  transform: scale(0.98);
}

/* Ecosystem App Tile */
.eco-app-tile {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 1rem 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.eco-app-tile:hover {
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 8px 20px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

.eco-app-tile:active {
  transform: scale(0.98);
}

/* Shape Morphing Corners backward compatibility */
.bento-a, .bento-b, .bento-c, .bento-d, .bento-e {
  min-height: auto;
}

/* Premium Sidebar Elements */
.wf-logo {
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.04em;
  margin-bottom: 1rem;
  padding-left: 0.5rem;
}

.premium-nav-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
}

.premium-nav-item {
  position: relative;
  padding: 0.9rem 1.25rem;
  color: #888;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: rgba(255, 255, 255, 0.02);
  text-align: left;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-radius: 6px;
  user-select: none;
  outline: none;
  transition: 
    border-radius 0.35s cubic-bezier(0.16, 1, 0.3, 1), 
    background 0.25s cubic-bezier(0.16, 1, 0.3, 1), 
    color 0.2s ease, 
    box-shadow 0.3s ease, 
    transform 0.15s ease;
}

/* THE CORNER GAME (Giochetto dei corners) per la navigazione */
.premium-nav-item:first-child {
  border-radius: 20px 20px 6px 6px;
}
.premium-nav-item:last-child {
  border-radius: 6px 6px 20px 20px;
}

/* Hover State */
.premium-nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ccc;
}

.premium-nav-item:active {
  transform: scale(0.98);
}

/* Morphing vero e proprio della forma del pulsante */
.premium-nav-item.is-active,
.premium-nav-item.active {
  background: rgba(255, 255, 255, 0.16) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  border-radius: 999px !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  z-index: 2;
}

/* Morph adjacent siblings so shapes dynamically contour around the active pill */
.premium-nav-item.active + .premium-nav-item {
  border-top-left-radius: 14px !important;
  border-top-right-radius: 14px !important;
}

.premium-nav-group:has(.premium-nav-item.active) .premium-nav-item:has(+ .premium-nav-item.active) {
  border-bottom-left-radius: 14px !important;
  border-bottom-right-radius: 14px !important;
}

/* Bottom Group (User + Esci) Corner Game */
.bottom-corner-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: auto;
}

.wf-user-box {
  background: rgba(255,255,255,0.02);
  border-radius: 20px 20px 6px 6px;
  padding: 1rem 1.25rem;
  color: #777;
  font-size: 0.8rem;
  transition: background 0.2s ease;
}
.wf-user-box:hover {
  background: rgba(255,255,255,0.04);
}

.wf-logout-btn {
  background: rgba(255,255,255,0.02);
  color: #ff6b6b; /* Red tint for logout */
  padding: 1rem 1.25rem;
  border-radius: 6px 6px 20px 20px;
  font-weight: 500;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  border: none;
  width: 100%;
  transition: all 0.2s ease;
}
.wf-logout-btn:hover {
  background: rgba(255,107,107,0.1);
}

/* Token Box Realization */
.token-box {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 20px;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.token-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.token-progress-bg {
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 999px;
  overflow: hidden;
}
.token-progress-fill {
  height: 100%;
  background: #fff;
  border-radius: 999px;
}
/* Premium Typography inside widgets */
.m3-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #777;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}
.m3-value {
  font-size: 2.4rem;
  font-weight: 500;
  color: #fff;
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.m3-sub {
  font-size: 0.9rem;
  color: #888;
  margin-top: 0.3rem;
}
.m3-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.m3-list-item:last-child {
  border-bottom: none;
}
.m3-list-label {
  color: #888;
  font-size: 0.9rem;
}
.m3-list-value {
  color: #fff;
  font-weight: 500;
  font-size: 0.95rem;
}

/* ══════════════════════════════════════════════
   UNIFIED MODULAR VIEWS (CORNERS & ZERO AI SLOP)
══════════════════════════════════════════════ */
.view-container {
  padding: 2.5rem 3.5rem;
  max-width: 1280px;
  width: 100%;
}

.view-header {
  margin-bottom: 2rem;
}

.view-title {
  font-size: 2.2rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: #fff;
  margin-bottom: 0.35rem;
}

.view-subtitle {
  color: #888;
  font-size: 0.95rem;
}

/* Horizontal & Vertical Corner Game Components */
.corner-col-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.corner-col-group > .modular-panel:first-child {
  border-radius: 24px 24px 6px 6px;
}

.corner-col-group > .modular-panel:not(:first-child):not(:last-child) {
  border-radius: 6px;
}

.corner-col-group > .modular-panel:last-child {
  border-radius: 6px 6px 24px 24px;
}

.corner-col-group > .modular-panel:only-child {
  border-radius: 24px;
}

.corner-row-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 4px;
}

.corner-row-group > .modular-panel {
  border-radius: 12px;
}

.corner-row-group > .modular-panel:first-child {
  border-radius: 24px 8px 8px 24px;
}

.corner-row-group > .modular-panel:last-child {
  border-radius: 8px 24px 24px 8px;
}

@media (max-width: 900px) {
  .corner-row-group > .modular-panel:first-child {
    border-radius: 24px 24px 8px 8px;
  }
  .corner-row-group > .modular-panel:last-child {
    border-radius: 8px 8px 24px 24px;
  }
}

.modular-panel {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 10px 25px rgba(0, 0, 0, 0.25);
  padding: 1.5rem;
  transition: all 0.2s ease;
  position: relative;
}

.modular-panel:hover {
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 14px 35px rgba(0, 0, 0, 0.35);
}

/* Card item inside corner group */
.modular-btn-primary {
  background: #ffffff;
  color: #000000;
  border: none;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.75rem 1.35rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 14px rgba(255, 255, 255, 0.2);
}

.modular-btn-primary:hover:not(:disabled) {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.32);
}

.modular-btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.modular-btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: #eee;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-weight: 500;
  font-size: 0.85rem;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.modular-btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.24);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.modular-btn-secondary:active:not(:disabled) {
  transform: translateY(0);
}

.modular-btn-danger {
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
  font-weight: 500;
  font-size: 0.85rem;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.modular-btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.28);
  border-color: rgba(239, 68, 68, 0.6);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.25);
}

.modular-btn-danger:active:not(:disabled) {
  transform: translateY(0);
}

/* Clean glass input */
.modular-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.modular-input:focus {
  border-color: rgba(255, 255, 255, 0.3);
}

@media (max-width: 1024px) {
  .view-container {
    padding: 1.5rem;
  }
  .bento-grid {
    grid-template-columns: 1fr !important;
    grid-template-areas: none !important;
  }
  .bento-a, .bento-b, .bento-c, .bento-d, .bento-e {
    grid-area: auto !important;
    min-height: auto !important;
    border-radius: 16px !important;
  }
}

/* ══════════════════════════════════════════════
   FLOATING DESKTOP WINDOW & WALLPAPER SYSTEM
══════════════════════════════════════════════ */
.desktop-viewport {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

@media (max-width: 900px), (max-height: 720px) {
  .desktop-viewport {
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
    padding: 1.5rem 0;
  }
  .app-window-frame {
    height: auto !important;
    min-height: 90vh;
    flex-direction: column !important;
  }
  .premium-sidebar {
    width: 100% !important;
    height: auto !important;
    border-radius: 28px 28px 8px 8px !important;
  }
  .premium-main-content {
    border-radius: 8px 8px 28px 28px !important;
    min-height: 600px;
  }
}

.app-window-frame {
  width: min(1440px, 94vw);
  height: min(880px, 92vh);
  display: flex;
  gap: 12px;
  position: relative;
  background: transparent;
  border: none;
  box-shadow: none;
  user-select: auto;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-window-frame.is-edit-mode {
  width: min(1680px, 96vw);
}

/* ── Standby Mode & Cinematic Ambient Display (No panels/boxes) ── */
.standby-fullscreen-overlay {
  position: absolute;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(1.5rem, 4vw, 3rem);
  z-index: 60;
  cursor: pointer;
  user-select: none;
  pointer-events: auto;
  overflow: hidden;
}

.standby-hero-clock {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}

.standby-time-huge {
  font-size: clamp(5.5rem, 16vw, 12rem);
  font-weight: 200;
  letter-spacing: -0.05em;
  line-height: 0.92;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  text-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.65),
    0 2px 10px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: baseline;
  justify-content: center;
}

.standby-seconds-quiet {
  font-size: clamp(1.4rem, 3.5vw, 2.5rem);
  font-weight: 200;
  color: rgba(255, 255, 255, 0.45);
  margin-left: 6px;
}

.standby-date-elegant {
  font-size: clamp(1.1rem, 2.4vw, 1.7rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.92);
  margin-top: 1.25rem;
  text-transform: capitalize;
  text-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.7),
    0 2px 6px rgba(0, 0, 0, 0.5);
}

.standby-footer-dock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 1rem;
  pointer-events: auto;
}

.standby-micro-capsule {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 999px;
  background: rgba(12, 14, 20, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  backdrop-filter: blur(28px) saturate(190%);
  box-shadow: 
    0 16px 36px -10px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.standby-hint-center {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.52);
  font-weight: 500;
  text-shadow: 0 4px 14px rgba(0, 0, 0, 0.7);
  animation: pulse 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.standby-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(12, 14, 20, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.18);
  -webkit-backdrop-filter: blur(32px) saturate(190%);
  backdrop-filter: blur(32px) saturate(190%);
  box-shadow: 
    0 16px 36px -10px rgba(0, 0, 0, 0.65),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  font-size: 0.82rem;
  font-weight: 500;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.standby-action-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 
    0 20px 45px -8px rgba(0, 0, 0, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.standby-action-btn:active {
  transform: translateY(0) scale(0.98);
}

@media (max-width: 768px) {
  .standby-footer-dock {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }
  .standby-hint-center {
    order: 3;
  }
}

.premium-sidebar {
  width: 290px;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  background: rgba(16, 18, 26, 0.68);
  -webkit-backdrop-filter: blur(32px) saturate(190%);
  backdrop-filter: blur(32px) saturate(190%);
  border-radius: 26px 10px 10px 26px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 
    0 30px 80px -20px rgba(0, 0, 0, 0.75),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  flex-shrink: 0;
}

.premium-main-content {
  flex: 1;
  height: 100%;
  background: rgba(12, 14, 20, 0.68);
  -webkit-backdrop-filter: blur(32px) saturate(190%);
  backdrop-filter: blur(32px) saturate(190%);
  border-radius: 10px 26px 26px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 
    0 30px 80px -20px rgba(0, 0, 0, 0.75),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  overscroll-behavior-y: contain;
  scroll-behavior: smooth;
  transition: border-radius 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.premium-main-content.drawer-open {
  border-radius: 10px !important;
}

/* Wallpaper Preset Card in Profilo */
.wallpaper-swatch {
  height: 68px;
  border-radius: 16px;
  border: 2px solid transparent;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: flex-end;
  padding: 0.6rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.wallpaper-swatch:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
}

.wallpaper-swatch.active {
  border-color: #fff;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.35);
}

.wallpaper-swatch-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

/* ══════════════════════════════════════════════
   LOGIN WINDOW & FROSTED GLASS SHELL
══════════════════════════════════════════════ */
.login-window-frame {
  width: min(1040px, 94vw);
  height: min(680px, 90vh);
  display: flex;
  gap: 12px;
  position: relative;
  background: transparent;
  border: none;
  box-shadow: none;
  overflow: visible;
}

.login-left-panel {
  width: 44%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  background: rgba(16, 18, 26, 0.68);
  -webkit-backdrop-filter: blur(32px) saturate(190%);
  backdrop-filter: blur(32px) saturate(190%);
  border-radius: 26px 10px 10px 26px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 
    0 30px 80px -20px rgba(0, 0, 0, 0.75),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  padding: 2.75rem 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.login-right-panel {
  flex: 1;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  background: rgba(12, 14, 20, 0.68);
  -webkit-backdrop-filter: blur(32px) saturate(190%);
  backdrop-filter: blur(32px) saturate(190%);
  border-radius: 10px 26px 26px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 
    0 30px 80px -20px rgba(0, 0, 0, 0.75),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  padding: 2.75rem 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (max-width: 860px) {
  .login-viewport {
    padding: 0 !important;
    height: 100vh !important;
    overflow: hidden !important;
  }
  .login-window-frame {
    flex-direction: column;
    height: 100vh;
    min-height: 100vh;
    width: 100vw;
    margin: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }
  .login-left-panel {
    display: none;
  }
  .login-right-panel {
    width: 100%;
    height: 100vh;
    border-radius: 0;
    border: none;
    box-shadow: none;
    padding: 2rem 1.5rem;
    justify-content: center;
  }
}

/* ══════════════════════════════════════════════
   MODULAR DASHBOARD & CUSTOMIZER DRAWER SYSTEM
══════════════════════════════════════════════ */
.premium-main-content.drawer-open {
  border-radius: 8px !important;
}

.modular-customizer-drawer {
  width: 384px;
  height: 100%;
  background: rgba(24, 24, 28, 0.74);
  -webkit-backdrop-filter: blur(32px) saturate(190%);
  backdrop-filter: blur(32px) saturate(190%);
  border-radius: 10px 26px 26px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 30px 80px -20px rgba(0, 0, 0, 0.75),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: relative;
}

/* Su mobile il pannello diventa un bottom sheet */
.modular-customizer-drawer.is-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2100;
  width: 100% !important;
  max-width: 640px;
  margin-inline: auto;
  height: min(82vh, 720px);
  border-radius: 26px 26px 0 0;
  border-bottom: none;
  background: rgba(14, 16, 22, 0.94);
}

.customizer-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2050;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

/* Header Edit Toggle Button */
.modular-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  height: 34px;
  padding: 0 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #eee;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  vertical-align: middle;
  white-space: nowrap;
}

.modular-edit-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.modular-edit-btn.active {
  background: #ffffff;
  border-color: #ffffff;
  color: #000000;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.modular-edit-btn.active:hover {
  background: #e9e9ec;
  color: #000;
}

/* Drawer Controls (usati anche dal pannello 2FA) */
.widget-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ccc;
  cursor: pointer;
  transition: all 0.18s ease;
}

.widget-edit-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  transform: scale(1.05);
}

.drawer-section-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #888;
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ── Pannello widget (stile Impostazioni / galleria widget di macOS) ── */
.wc-root {
  width: 384px;
  min-width: 384px;
  height: 100%;
  display: flex;
  flex-direction: column;
  color: #fff;
}

.is-sheet .wc-root {
  width: 100%;
  min-width: 0;
}

.is-sheet .wc-root::before {
  content: "";
  display: block;
  width: 36px;
  height: 5px;
  margin: 7px auto 0;
  border-radius: 999px;
  background: rgba(235, 235, 245, 0.3);
}

.wc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 10px 20px;
}

.wc-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.wc-close {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(118, 118, 128, 0.24);
  color: rgba(235, 235, 245, 0.6);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.wc-close:hover {
  background: rgba(118, 118, 128, 0.36);
  color: #fff;
}

.wc-toolbar {
  padding: 4px 20px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.wc-segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 2px;
  border-radius: 9px;
  background: rgba(118, 118, 128, 0.24);
}

.wc-segmented button {
  position: relative;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: none;
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.wc-segmented button.is-active {
  font-weight: 600;
}

.wc-segment-thumb {
  position: absolute;
  inset: 0;
  border-radius: 7px;
  background: #636366;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.14), inset 0 0.5px 0 rgba(255, 255, 255, 0.14);
}

.wc-segment-label {
  position: relative;
  z-index: 1;
}

.wc-body {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 20px 22px;
  scrollbar-width: none;
}

.wc-body::-webkit-scrollbar {
  display: none;
}

.wc-pane {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.wc-section-title {
  margin: 0 0 8px 4px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.006em;
  color: rgba(235, 235, 245, 0.6);
}

/* Layout rapidi */
.wc-presets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.wc-preset {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  background: none;
  color: rgba(235, 235, 245, 0.6);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s ease;
}

.wc-preset-thumb {
  width: 100%;
  aspect-ratio: 1.25;
  padding: 8px 7px;
  border-radius: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 7px;
  grid-auto-flow: row dense;
  align-content: center;
  gap: 3px;
  background: rgba(118, 118, 128, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.wc-preset-thumb > span {
  border-radius: 2px;
  background: rgba(235, 235, 245, 0.3);
  transition: background-color 0.2s ease;
}

.wc-preset-thumb > .span-1x {
  grid-column: span 1;
}

.wc-preset-thumb > .span-2x {
  grid-column: span 2;
}

.wc-preset-thumb > .span-full {
  grid-column: 1 / -1;
}

.wc-preset:hover {
  color: #fff;
}

.wc-preset:hover .wc-preset-thumb {
  background: rgba(118, 118, 128, 0.26);
}

.wc-preset:active .wc-preset-thumb {
  transform: scale(0.95);
}

.wc-preset.is-active {
  color: #fff;
  font-weight: 600;
}

.wc-preset.is-active .wc-preset-thumb {
  background: rgba(10, 132, 255, 0.16);
  box-shadow: inset 0 0 0 2px #0a84ff;
}

.wc-preset.is-active .wc-preset-thumb > span {
  background: rgba(255, 255, 255, 0.88);
}

/* Elenco raggruppato */
.wc-group {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
}

.wc-row {
  position: relative;
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 0 12px;
  background: rgba(44, 44, 46, 0.94);
}

.wc-row:first-child {
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.wc-row:last-child {
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}

.wc-row + .wc-row::before {
  content: "";
  position: absolute;
  top: 0;
  left: 82px;
  right: 0;
  height: 1px;
  background: rgba(84, 84, 88, 0.6);
  transform: scaleY(0.6);
}

.wc-row-remove {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #ff453a;
  color: #fff;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease;
}

.wc-row-remove:hover {
  filter: brightness(1.12);
}

.wc-row-remove:active {
  transform: scale(0.88);
}

.wc-squircle {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #fff;
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.14);
}

.wc-row-title {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.012em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wc-size {
  flex-shrink: 0;
  display: inline-flex;
  padding: 2px;
  border-radius: 8px;
  background: rgba(118, 118, 128, 0.24);
}

.wc-size button {
  width: 28px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: none;
  color: rgba(235, 235, 245, 0.55);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.wc-size button:hover {
  color: #fff;
}

.wc-size button.is-active {
  background: #636366;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
}

.wc-row-grip {
  width: 28px;
  height: 34px;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: none;
  color: rgba(235, 235, 245, 0.3);
  cursor: grab;
  touch-action: none;
  transition: color 0.15s ease;
}

.wc-row-grip:hover {
  color: rgba(235, 235, 245, 0.7);
}

.wc-row-grip:active {
  cursor: grabbing;
}

/* Galleria con anteprime reali */
.wc-search {
  height: 34px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px 0 10px;
  border-radius: 10px;
  background: rgba(118, 118, 128, 0.24);
  color: rgba(235, 235, 245, 0.6);
  transition: box-shadow 0.15s ease;
}

.wc-search:focus-within {
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.55);
}

.wc-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: none;
  color: #fff;
  font: inherit;
  font-size: 14px;
}

.wc-search input::placeholder {
  color: rgba(235, 235, 245, 0.6);
}

.wc-search-clear {
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(235, 235, 245, 0.55);
  color: #2c2c2e;
  cursor: pointer;
}

.wc-gallery {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.wc-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.wc-card-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: rgba(118, 118, 128, 0.12);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.wc-card-stage:hover {
  background: rgba(118, 118, 128, 0.2);
}

.wc-card-frame {
  position: relative;
  display: block;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.wc-card-stage:hover .wc-card-frame {
  transform: scale(1.025);
}

.wc-card-stage:active .wc-card-frame {
  transform: scale(0.97);
}

.wc-card-preview {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: top left;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.wc-card-preview .dw-tile {
  box-shadow: 0 16px 34px -14px rgba(0, 0, 0, 0.7);
}

.wc-card.is-added .wc-card-preview {
  opacity: 0.45;
}

.wc-card-action {
  position: absolute;
  top: -8px;
  left: -8px;
  z-index: 2;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(118, 118, 128, 0.72);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  backdrop-filter: blur(16px) saturate(180%);
  box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.18), 0 3px 10px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.wc-card-stage:hover .wc-card-action:not(.is-added) {
  background: #0a84ff;
}

.wc-card-action:active {
  transform: scale(0.88);
}

.wc-card-action.is-added {
  background: #0a84ff;
}

.wc-card-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 0 8px;
  text-align: center;
}

.wc-card-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.wc-card-subtitle {
  font-size: 12px;
  line-height: 1.35;
  color: rgba(235, 235, 245, 0.6);
}

.wc-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 16px;
  border-radius: 12px;
  background: rgba(44, 44, 46, 0.6);
  color: rgba(235, 235, 245, 0.6);
  font-size: 13px;
  text-align: center;
}

.wc-link-btn,
.wc-text-btn {
  padding: 4px 2px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: #0a84ff;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.wc-link-btn:hover,
.wc-text-btn:hover {
  color: #409cff;
}

.wc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.is-sheet .wc-footer {
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}

.wc-done {
  height: 32px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #000;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.wc-done:hover {
  background: #e8e8ed;
}

.wc-done:active {
  transform: scale(0.95);
}

.wc-root button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.75);
}

/* Scratchpad textarea */
.scratchpad-textarea {
  width: 100%;
  min-height: 130px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.75rem;
  color: #eee;
  font-family: inherit;
  font-size: 0.85rem;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}

.scratchpad-textarea:focus {
  border-color: rgba(134, 82, 255, 0.4);
  background: rgba(0, 0, 0, 0.45);
}

/* Scrollbar Aesthetics for panels */
.premium-main-content::-webkit-scrollbar,
.premium-sidebar::-webkit-scrollbar,
.modular-customizer-drawer::-webkit-scrollbar,
.split-drawer-2fa::-webkit-scrollbar {
  width: 6px;
}

.premium-main-content::-webkit-scrollbar-track,
.premium-sidebar::-webkit-scrollbar-track,
.modular-customizer-drawer::-webkit-scrollbar-track,
.split-drawer-2fa::-webkit-scrollbar-track {
  background: transparent;
}

.premium-main-content::-webkit-scrollbar-thumb,
.premium-sidebar::-webkit-scrollbar-thumb,
.modular-customizer-drawer::-webkit-scrollbar-thumb,
.split-drawer-2fa::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

.premium-main-content::-webkit-scrollbar-thumb:hover,
.premium-sidebar::-webkit-scrollbar-thumb:hover,
.modular-customizer-drawer::-webkit-scrollbar-thumb:hover,
.split-drawer-2fa::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Modalità Barre di Scorrimento Nascoste (Clean Minimalist Mode) */
.hide-scrollbars,
.hide-scrollbars * {
  scrollbar-width: none !important; /* Firefox */
  -ms-overflow-style: none !important; /* IE/Edge */
}
.hide-scrollbars::-webkit-scrollbar,
.hide-scrollbars *::-webkit-scrollbar {
  display: none !important;
  width: 0px !important;
  height: 0px !important;
  background: transparent !important;
}

/* ── Split Window 2FA Drawer & Initial Setup View ── */
.split-drawer-2fa {
  width: 420px;
  max-width: 95vw;
  height: 100%;
  background: rgba(12, 14, 20, 0.78);
  -webkit-backdrop-filter: blur(36px) saturate(200%);
  backdrop-filter: blur(36px) saturate(200%);
  border-radius: 10px 26px 26px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 
    0 30px 80px -20px rgba(0, 0, 0, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.75rem 1.5rem;
  flex-shrink: 0;
  position: relative;
  overscroll-behavior-y: contain;
}

/* Initial simple overview layout */
.overview-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 480px;
  width: 100%;
  max-width: 640px;
  margin: auto;
  padding: 3rem 1.5rem;
  text-align: center;
}

.overview-search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 0.85rem 1.2rem;
  box-shadow: 0 8px 32px -8px rgba(0, 0, 0, 0.4);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.overview-search-bar:focus-within {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 12px 40px -6px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.overview-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 0.95rem;
  font-family: inherit;
}

.overview-search-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

/* ── SEARCH LIVE RESULTS WITH CORNER GAME ── */
.search-results-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 150;
  background: rgba(13, 15, 22, 0.96);
  -webkit-backdrop-filter: blur(32px) saturate(200%);
  backdrop-filter: blur(32px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 8px;
  box-shadow: 
    0 24px 60px -10px rgba(0, 0, 0, 0.85),
    0 0 0 1px rgba(255, 255, 255, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  max-height: 380px;
  overflow-y: auto;
  animation: fadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.search-results-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
}

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
  color: #fff;
  width: 100%;
  text-decoration: none;
}

.search-result-item:first-child {
  border-radius: 14px 14px 6px 6px;
}

.search-result-item:not(:first-child):not(:last-child) {
  border-radius: 6px;
}

.search-result-item:last-child {
  border-radius: 6px 6px 14px 14px;
}

.search-result-item:only-child {
  border-radius: 14px;
}

.search-result-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.search-result-item:active {
  transform: translateY(0);
}

/* Quick search suggestion tags */
.search-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  font-size: 0.72rem;
  color: #aaa;
  cursor: pointer;
  transition: all 0.15s ease;
}

.search-tag-pill:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
}

/* Widget action grid with corner game */
.widget-corner-grid {
  display: grid;
  gap: 3px;
}

.widget-corner-grid > * {
  border-radius: 6px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.widget-corner-grid > *:first-child {
  border-top-left-radius: 14px;
}

.widget-corner-grid > *:last-child {
  border-bottom-right-radius: 14px;
}

.widget-corner-grid.cols-2 > *:nth-child(2) {
  border-top-right-radius: 14px;
}

.widget-corner-grid.cols-2 > *:nth-last-child(2) {
  border-bottom-left-radius: 14px;
}

.widget-corner-grid.cols-4 > *:nth-child(4) {
  border-top-right-radius: 14px;
}

.widget-corner-grid.cols-4 > *:nth-last-child(4) {
  border-bottom-left-radius: 14px;
}

.widget-corner-grid.cols-5 > *:nth-child(5) {
  border-top-right-radius: 14px;
}

.widget-corner-grid.cols-5 > *:nth-last-child(5) {
  border-bottom-left-radius: 14px;
}

.backup-codes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 1rem 0;
}

.backup-code-pill {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  padding: 8px 10px;
  text-align: center;
  color: #fff;
  user-select: all;
  transition: all 0.15s ease;
}

.backup-code-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

/* ══════════════════════════════════════════════
   ACCORDION STACK GROUP (MATCHING USER REFERENCE)
   True 5-bar / multi-bar corner grouped list & accordion
══════════════════════════════════════════════ */
.accordion-stack-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.accordion-stack-item {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 4px 20px rgba(0, 0, 0, 0.18);
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
  position: relative;
}

.accordion-stack-item:first-child {
  border-radius: 24px 24px 6px 6px;
}

.accordion-stack-item:not(:first-child):not(:last-child) {
  border-radius: 6px;
}

.accordion-stack-item:last-child {
  border-radius: 6px 6px 24px 24px;
}

.accordion-stack-item:only-child {
  border-radius: 24px;
}

.accordion-stack-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.14);
}

.accordion-stack-item.is-expanded {
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 12px 30px rgba(0, 0, 0, 0.32);
}

.accordion-stack-item.tier-pro {
  border-color: rgba(168, 85, 247, 0.25);
}

.accordion-stack-item.tier-pro:hover {
  border-color: rgba(168, 85, 247, 0.45);
}

.accordion-stack-item.tier-pro.is-expanded {
  border-color: rgba(168, 85, 247, 0.55);
  box-shadow: inset 0 1px 0 rgba(168, 85, 247, 0.2), 0 0 30px rgba(168, 85, 247, 0.12);
}

.accordion-stack-item.tier-mega {
  border-color: rgba(251, 191, 36, 0.22);
}

.accordion-stack-item.tier-mega:hover {
  border-color: rgba(251, 191, 36, 0.4);
}

.accordion-stack-item.tier-mega.is-expanded {
  border-color: rgba(251, 191, 36, 0.5);
  box-shadow: inset 0 1px 0 rgba(251, 191, 36, 0.15), 0 0 30px rgba(251, 191, 36, 0.1);
}

.accordion-stack-item.tier-ultra {
  border-color: rgba(229, 228, 226, 0.28);
}

.accordion-stack-item.tier-ultra:hover {
  border-color: rgba(229, 228, 226, 0.5);
}

.accordion-stack-item.tier-ultra.is-expanded {
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 0 35px rgba(255, 255, 255, 0.1);
}

.accordion-stack-item.is-active-tier {
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.07);
}

.accordion-stack-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem 1.4rem;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font-family: inherit;
  user-select: none;
  gap: 1rem;
  transition: background 0.15s ease;
}

.accordion-stack-trigger:active {
  transform: scale(0.997);
}

.accordion-stack-body {
  padding: 0 1.4rem 1.4rem 1.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

@media (max-width: 640px) {
  .accordion-stack-trigger {
    padding: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  .accordion-stack-body {
    padding: 0 1rem 1rem 1rem;
  }
}

.mobile-sidebar-overlay {
  display: none;
}
.mobile-header-bar {
  display: none;
}
@media (max-width: 860px) {
  .app-window-frame {
    flex-direction: column !important;
    height: 100vh !important;
    min-height: 100vh !important;
    width: 100vw !important;
    border-radius: 0 !important;
    margin: 0 !important;
  }
  .premium-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: -320px !important;
    width: 300px !important;
    height: 100vh !important;
    border-radius: 0 !important;
    z-index: 2000 !important;
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-shadow: 10px 0 30px rgba(0,0,0,0.8) !important;
  }
  .premium-sidebar.open {
    left: 0 !important;
  }
  .mobile-sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1900;
  }
  .mobile-header-bar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: rgba(10, 10, 14, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
  }
  .mobile-menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    margin-left: -0.5rem;
  }
  .mobile-logo {
    display: block !important;
  }
  .premium-main-content {
    border-radius: 0 !important;
    padding: 0 !important;
    height: 100vh !important;
    overflow-y: auto;
  }
  .view-container {
    padding: 1.5rem !important;
  }
}

/* ══════════════════════════════════════════════
   MOBILE (≤860px): una sola area di scorrimento e
   elementi fixed ancorati allo schermo
══════════════════════════════════════════════ */
@media (max-width: 860px) {
  .desktop-viewport {
    height: 100dvh;
    min-height: 0;
    padding: 0;
    overflow: hidden;
  }
  /* filter/transform residui dell'animazione d'ingresso renderebbero la finestra
     il riferimento dei position: fixed (menu laterale, overlay) */
  .app-window-frame {
    height: 100dvh !important;
    min-height: 0 !important;
    gap: 0 !important;
    filter: none !important;
    transform: none !important;
  }
  .premium-main-content {
    height: 100dvh !important;
    border: 0 !important;
    box-shadow: none !important;
    background: rgba(12, 14, 20, 0.78);
    overscroll-behavior-y: contain;
  }
  .premium-sidebar {
    height: 100dvh !important;
    padding-top: max(24px, env(safe-area-inset-top)) !important;
  }
  .mobile-header-bar {
    padding: max(12px, env(safe-area-inset-top)) 16px 12px;
  }
  .view-container {
    padding: 20px 16px calc(40px + env(safe-area-inset-bottom)) !important;
  }
}

@media (max-width: 600px) {
  .dw-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 6px 12px;
    margin-bottom: 1.5rem;
  }
  .dw-header .view-title {
    font-size: 1.85rem;
  }
  .dw-header-actions {
    padding-top: 2px;
  }
  .dw-edit-label-long {
    display: none;
  }
}

/* Barra di navigazione mobile (stile iOS) */
@media (max-width: 860px) {
  .mobile-header-bar {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    align-items: center;
    gap: 8px;
    min-height: 56px;
    padding: max(8px, env(safe-area-inset-top)) 16px 8px;
    background: transparent;
    border-bottom: 1px solid transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    transition: background-color 0.25s ease, border-color 0.25s ease;
  }
  .mobile-header-bar.is-scrolled {
    background: rgba(22, 22, 26, 0.72);
    border-bottom-color: rgba(255, 255, 255, 0.08);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    backdrop-filter: blur(24px) saturate(180%);
  }
  .mobile-nav-btn,
  .mobile-nav-avatar {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.15s ease, background-color 0.15s ease;
  }
  .mobile-nav-btn {
    background: rgba(118, 118, 128, 0.24);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
  }
  .mobile-nav-avatar {
    justify-self: end;
    overflow: hidden;
    background: linear-gradient(180deg, #a6abb7 0%, #7d828f 100%);
    font-size: 15px;
    font-weight: 600;
  }
  .mobile-nav-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .mobile-nav-btn:active,
  .mobile-nav-avatar:active {
    transform: scale(0.92);
  }
  .mobile-nav-title {
    text-align: center;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
  }
  .is-scrolled .mobile-nav-title {
    opacity: 1;
    transform: none;
  }
  .view-container {
    padding-top: 4px !important;
  }
}

/* ══════════════════════════════════════════════
   just UI — aggiunte a login.ticly.it
   Bottoni connessi in orizzontale (ButtonGroup orientation="horizontal"):
   stesso aspetto di .premium-nav-item, con il "corner game" ruotato:
   angoli esterni grandi a sinistra e a destra, pillola sull'attivo e
   vicini che si modellano attorno.
══════════════════════════════════════════════ */
.arc-corner-row {
  display: inline-flex;
  flex-direction: row;
  gap: 3px;
  position: relative;
  max-width: 100%;
}

.arc-corner-row__item {
  position: relative;
  padding: 0.9rem 1.25rem;
  color: #888;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  white-space: nowrap;
  border-radius: 6px;
  user-select: none;
  outline: none;
  transition:
    border-radius 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    background 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    color 0.2s ease,
    box-shadow 0.3s ease,
    transform 0.15s ease;
}

.arc-corner-row__item:first-child {
  border-radius: 20px 6px 6px 20px;
}

.arc-corner-row__item:last-child {
  border-radius: 6px 20px 20px 6px;
}

.arc-corner-row__item:only-child {
  border-radius: 20px;
}

.arc-corner-row__item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ccc;
}

.arc-corner-row__item:active {
  transform: scale(0.98);
}

.arc-corner-row__item.active {
  background: rgba(255, 255, 255, 0.16) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  border-radius: 999px !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  z-index: 2;
}

.arc-corner-row__item.active + .arc-corner-row__item {
  border-top-left-radius: 14px;
  border-bottom-left-radius: 14px;
}

.arc-corner-row:has(.arc-corner-row__item.active) .arc-corner-row__item:has(+ .arc-corner-row__item.active) {
  border-top-right-radius: 14px;
  border-bottom-right-radius: 14px;
}

/* ══════════════════════════════════════════════
   SidePanel: il pannello per vedere e modificare un contenuto.
   Dentro Drawer (desktop) o BottomSheet (telefono): intestazione fissa,
   contenuto che scorre e azioni sempre visibili in fondo.
══════════════════════════════════════════════ */
.arc-side-panel-host {
  padding: 0 !important;
  gap: 0 !important;
  overflow: hidden !important;
}

.arc-side-panel {
  display: flex;
  flex-direction: column;
  width: 384px;
  min-width: 384px;
  height: 100%;
  min-height: 0;
}

.arc-side-panel--split {
  width: 420px;
  min-width: 420px;
}

.is-sheet .arc-side-panel {
  width: 100%;
  min-width: 0;
}

.arc-side-panel__header {
  flex: none;
  padding: 1.5rem 1.5rem 0;
}

.arc-side-panel__body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding: 1.25rem 1.5rem 1.5rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.arc-side-panel__footer {
  flex: none;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 1rem 1.5rem max(1.25rem, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.arc-side-panel__footer > :only-child {
  flex: 1;
}

/* ══════════════════════════════════════════════
   just UI — componenti per telefono
   Stesso "corner game" del resto: spazio di 3px, angoli interni piccoli,
   esterni grandi, l'elemento attivo diventa una pillola. Niente sfondo in
   vetro: superfici piene su una schermata scura.
══════════════════════════════════════════════ */
:root {
  --ju-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ju-screen: #0c0c0f;
  --ju-surface: #1a1a1f;
  /* Le barre che galleggiano sopra i contenuti sono di vetro: si vede sfocato quello che passa sotto */
  --ju-bar: rgba(22, 22, 27, 0.58);
  --ju-bar-blur: blur(24px) saturate(170%);
  --ju-piece: #26262c;
  --ju-piece-hover: #303037;
  --ju-active: #4a4a53;
  --ju-muted: rgba(255, 255, 255, 0.65);
  --ju-line: 1px solid rgba(255, 255, 255, 0.1);
  --ju-danger: #ff8f8f;
}

[class^="ju-"],
[class*=" ju-"],
:is([class^="ju-"], [class*=" ju-"]) *:where(div, span, b, i, button, input, h1, svg) {
  box-sizing: border-box;
}

:where(.ju-piece, .ju-row__main, .ju-tabbar__circle, .ju-tabbar__clear, .ju-appbar__avatar, .ju-fab__item, .ju-fab__button, .ju-message__main, .ju-setting__main, .ju-day, .ju-slide__knob, .ju-toast button, .ju-message__rec button, .ju-tabbar__search input, .ju-message__line input) {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  -webkit-tap-highlight-color: transparent;
}

:is(.ju-piece, .ju-row__main, .ju-tabbar__circle, .ju-tabbar__clear, .ju-appbar__avatar, .ju-fab__item, .ju-fab__button, .ju-message__main, .ju-setting__main, .ju-day, .ju-toast button, .ju-message__rec button):not(div) {
  cursor: pointer;
}

:is(.ju-piece, .ju-row__main, .ju-tabbar__circle, .ju-appbar__avatar, .ju-fab__item, .ju-fab__button, .ju-message__main, .ju-setting__main, .ju-day, .ju-slide__knob):focus-visible {
  outline: 2px solid #fff;
  outline-offset: -2px;
}

/* ── Schermata ── */
.ju-screen {
  position: relative;
  height: 100dvh;
  overflow: clip;
  isolation: isolate;
  background: var(--ju-screen);
  color: #fff;
  font-family: var(--ju-font, "Google Sans Flex", system-ui, sans-serif);
  text-align: left;
}

.ju-screen__scroll {
  position: absolute;
  inset: 0;
  padding: 14px;
  overflow: hidden auto;
  scrollbar-width: none;
}

.ju-screen__scroll::-webkit-scrollbar {
  display: none;
}

.ju-screen__scroll.has-header {
  padding-top: calc(106px + env(safe-area-inset-top, 0px));
}

.ju-screen__scroll.has-footer {
  padding-bottom: calc(124px + env(safe-area-inset-bottom, 0px));
}

.ju-screen__top,
.ju-screen__bottom {
  position: absolute;
  left: 0;
  right: 0;
  pointer-events: none;
}

.ju-screen__top {
  top: 0;
  z-index: 4;
  height: calc(106px + env(safe-area-inset-top, 0px));
  background: linear-gradient(var(--ju-screen) 60%, transparent);
}

.ju-screen__bottom {
  bottom: 0;
  z-index: 3;
  height: calc(130px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(transparent, var(--ju-screen) 60%);
}

.ju-section-title {
  margin: 24px 6px 10px;
  color: var(--ju-muted);
  font-size: 14px;
  font-weight: 600;
}

.ju-section-title:first-child {
  margin-top: 4px;
}

/* ── Il pezzo: il tasto unito agli altri, dentro tutte le barre ── */
.ju-piece {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
  border-radius: 8px;
  background: var(--ju-piece);
  color: rgba(255, 255, 255, 0.75);
  transition:
    border-radius 0.35s var(--ju-ease),
    background 0.25s var(--ju-ease),
    flex 0.45s var(--ju-ease),
    opacity 0.25s,
    transform 0.15s;
}

button.ju-piece:active {
  transform: scale(0.97);
}

button.ju-piece:hover {
  background: var(--ju-piece-hover);
}

.ju-piece.is-active,
button.ju-piece.is-active:hover {
  background: var(--ju-active);
  color: #fff;
  font-weight: 600;
}

.ju-piece.is-danger,
.ju-fab__item.is-danger {
  color: var(--ju-danger) !important;
}

/* ── App bar ── */
.ju-appbar {
  position: absolute;
  z-index: 6;
  top: calc(20px + env(safe-area-inset-top, 0px));
  left: 14px;
  right: 14px;
  height: 70px;
}

.ju-appbar > * {
  position: absolute;
}

.ju-appbar__frame {
  top: 0;
  right: 0;
  width: var(--ju-appbar-actions);
  height: 70px;
  border: var(--ju-line);
  border-radius: 35px;
  background: var(--ju-bar);
  -webkit-backdrop-filter: var(--ju-bar-blur);
  backdrop-filter: var(--ju-bar-blur);
  transition: width 0.5s var(--ju-ease), opacity 0.25s;
}

.ju-appbar__actions {
  top: 7px;
  right: 7px;
  display: flex;
  gap: 3px;
}

.ju-appbar__actions .ju-piece {
  width: 52px;
  height: 56px;
  color: #fff;
}

.ju-appbar__actions .ju-piece:first-child {
  border-radius: 28px 8px 8px 28px;
}

.ju-appbar__actions .ju-piece:last-child {
  border-radius: 8px 28px 28px 8px;
}

.ju-appbar__actions .ju-piece:only-child {
  width: 56px;
  border-radius: 28px;
}

.ju-appbar__title {
  top: 0;
  left: 8px;
  max-width: calc(100% - var(--ju-appbar-actions) - 16px);
  margin: 0;
  overflow: hidden;
  color: #fff;
  font-size: 38px;
  font-weight: 700;
  line-height: 70px;
  letter-spacing: -0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
  transform-origin: left center;
  transition: transform 0.5s var(--ju-ease);
}

.ju-appbar__avatar {
  top: 7px;
  left: 7px;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--ju-active);
  color: #fff;
  font-size: 19px;
  font-weight: 600;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.25s, transform 0.5s var(--ju-ease);
}

.ju-appbar__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ju-appbar__subtitle {
  top: 37px;
  left: 76px;
  color: var(--ju-muted);
  font-size: 14px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.ju-appbar.is-framed .ju-appbar__frame {
  width: 100%;
}

.ju-appbar.is-framed .ju-appbar__title {
  max-width: calc((100% - var(--ju-appbar-actions) - 92px) * 2);
  transform: translate(68px, -10px) scale(0.5);
}

.ju-appbar.is-framed .ju-appbar__avatar {
  opacity: 1;
  transform: none;
}

.ju-appbar.is-framed .ju-appbar__subtitle {
  opacity: 1;
  transition-delay: 0.15s;
}

.ju-appbar {
  color: #fff;
  font-family: var(--ju-font, "Google Sans Flex", system-ui, sans-serif);
}

/* Senza sottotitolo il titolo piccolo sta al centro della cornice */
.ju-appbar.is-framed:has(.ju-appbar__subtitle:empty) .ju-appbar__title {
  transform: translate(68px, 0) scale(0.5);
}

/* Senza profilo né freccia il titolo resta a sinistra */
.ju-appbar.is-bare .ju-appbar__avatar {
  display: none;
}

.ju-appbar.is-bare .ju-appbar__subtitle {
  left: 22px;
}

.ju-appbar.is-bare.is-framed .ju-appbar__title {
  max-width: calc((100% - var(--ju-appbar-actions) - 40px) * 2);
  transform: translate(14px, -10px) scale(0.5);
}

.ju-appbar.is-bare.is-framed:has(.ju-appbar__subtitle:empty) .ju-appbar__title {
  transform: translate(14px, 0) scale(0.5);
}

/* Nelle viste la barra sta nel flusso e resta in alto mentre si scorre */
.ju-appbar.ju-appbar--view {
  position: sticky;
  top: 12px;
  left: auto;
  right: auto;
  margin: 0 0 6px;
}

.ju-view-mark {
  height: 0;
}

.ju-view-below {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  margin: 0 0 1.75rem 8px;
}

.ju-view-below .view-subtitle {
  margin: 0;
}

/* Su schermo largo la vista ha l'intestazione classica, sul telefono l'app bar */
.ju-view-classic {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.ju-view-classic__text {
  min-width: 0;
}

.ju-view-classic__back {
  margin-bottom: 14px;
}

.ju-view-classic__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ju-view-classic__below {
  flex-basis: 100%;
}

@media (min-width: 701px) {
  .ju-appbar.ju-appbar--view,
  .ju-view-mark,
  .ju-view-below {
    display: none;
  }
}

@media (max-width: 700px) {
  .ju-view-classic {
    display: none;
  }
}

/* ── Tab bar ── */
.ju-tabbar {
  position: absolute;
  z-index: 9;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  left: 14px;
  right: 14px;
  display: flex;
  gap: 8px;
  height: 70px;
}

/* Dentro le barre di vetro anche i tasti sono velati, così lo sfocato si vede */
.ju-tabbar,
.ju-appbar,
.ju-row,
.ju-message,
.ju-slide {
  --ju-piece: rgba(255, 255, 255, 0.08);
  --ju-piece-hover: rgba(255, 255, 255, 0.14);
  --ju-active: rgba(255, 255, 255, 0.24);
}

.ju-tabbar__box,
.ju-tabbar__search {
  height: 70px;
  overflow: hidden;
  border: var(--ju-line);
  border-radius: 35px;
  background: var(--ju-bar);
  -webkit-backdrop-filter: var(--ju-bar-blur);
  backdrop-filter: var(--ju-bar-blur);
  transition: flex 0.5s var(--ju-ease);
}

.ju-tabbar__box {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  padding: 6px;
}

.ju-tabbar__tabs {
  display: flex;
  gap: 3px;
  transition: opacity 0.2s;
}

.ju-tabbar__tabs .ju-piece {
  flex: 1 1 0;
  height: 56px;
}

.ju-tabbar__tabs .ju-piece:first-child {
  border-radius: 28px 8px 8px 28px;
}

.ju-tabbar__tabs .ju-piece:last-child {
  border-radius: 8px 28px 28px 8px;
}

.ju-tabbar__tabs .ju-piece.is-active {
  border-radius: 28px;
}

.ju-tabbar__tabs .ju-piece.is-active + .ju-piece {
  border-top-left-radius: 16px;
  border-bottom-left-radius: 16px;
}

.ju-tabbar__tabs .ju-piece:has(+ .is-active) {
  border-top-right-radius: 16px;
  border-bottom-right-radius: 16px;
}

.ju-tabbar__badge {
  position: absolute;
  top: 9px;
  left: calc(50% + 5px);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #fff;
  color: #000;
  font-size: 12px;
  font-style: normal;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
}

.ju-tabbar__search {
  display: flex;
  flex: 0 0 70px;
  align-items: center;
  min-width: 0;
}

.ju-tabbar__circle {
  display: grid;
  flex: 0 0 68px;
  place-items: center;
  height: 68px;
  border-radius: 50%;
}

.ju-tabbar__circle span {
  display: grid;
  grid-area: 1 / 1;
  transition: opacity 0.2s, transform 0.4s var(--ju-ease);
}

.ju-tabbar__icon-close {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}

.ju-tabbar__search input {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  height: 60px;
  outline: 0;
  font-size: 16px;
  opacity: 0;
  pointer-events: none;
}

:is(.ju-tabbar__search, .ju-message__line) input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.ju-tabbar__clear {
  display: grid;
  flex: 0 0 52px;
  place-items: center;
  height: 60px;
  color: var(--ju-muted);
}

.ju-tabbar.is-searching .ju-tabbar__box {
  flex: 0 0 70px;
}

.ju-tabbar.is-searching .ju-tabbar__tabs {
  gap: 0;
}

.ju-tabbar.is-searching .ju-tabbar__tabs .ju-piece:not(.is-active) {
  flex-grow: 0;
  opacity: 0;
  pointer-events: none;
}

.ju-tabbar.is-searching .ju-tabbar__badge {
  display: none;
}

.ju-tabbar.is-searching .ju-tabbar__search {
  flex: 1 1 0;
}

.ju-tabbar.is-searching .ju-tabbar__search input {
  opacity: 1;
  pointer-events: auto;
}

.ju-tabbar.is-searching .ju-tabbar__circle {
  flex-basis: 56px;
}

.ju-tabbar__selection .ju-piece {
  flex: 0 0 58px;
  color: #fff;
}

.ju-tabbar__selection .ju-tabbar__count {
  flex: 1;
  border-radius: 28px;
  background: var(--ju-active);
  font-weight: 600;
  white-space: nowrap;
}

.ju-tabbar__count + .ju-piece {
  border-radius: 16px 8px 8px 16px;
}

.ju-tabbar__selection .ju-piece:last-child:not(:first-child) {
  border-radius: 8px 28px 28px 8px;
}

.ju-tabbar.is-selecting .ju-tabbar__selection {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.ju-tabbar.is-selecting .ju-tabbar__tabs {
  opacity: 0;
}

.ju-tabbar.is-selecting .ju-tabbar__icon-search {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

.ju-tabbar.is-selecting .ju-tabbar__icon-close {
  opacity: 1;
  transform: none;
}

/* Le opzioni della tab bar: pallino, scheda spenta, barra piena, posizione */
.ju-tabbar.is-fixed {
  position: fixed;
}

.ju-tabbar.is-static {
  position: relative;
  bottom: auto;
  left: auto;
  right: auto;
}

.ju-tabbar.is-searching .ju-tabbar__dot {
  display: none;
}

.ju-tabbar__dot {
  position: absolute;
  top: 13px;
  left: calc(50% + 8px);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
}

.ju-tabbar__tabs .ju-piece:disabled {
  opacity: 0.35;
  cursor: default;
}

.ju-tabbar__search input::-webkit-search-cancel-button {
  display: none;
}

.ju-tabbar.is-solid {
  --ju-piece: #26262c;
  --ju-piece-hover: #303037;
  --ju-active: #4a4a53;
}

.ju-tabbar.is-solid .ju-tabbar__box,
.ju-tabbar.is-solid .ju-tabbar__search {
  background: var(--ju-surface);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* ── Gli altri tipi della tab bar: azione, attività in corso, modifica, passi ── */
.ju-tabbar__layer {
  position: absolute;
  inset: 6px;
  display: flex;
  gap: 3px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.25s, transform 0.4s var(--ju-ease);
}

.ju-tabbar.is-activity .ju-tabbar__activity,
.ju-tabbar.is-editing .ju-tabbar__editing,
.ju-tabbar.is-steps .ju-tabbar__steps {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.ju-tabbar:is(.is-activity, .is-editing, .is-steps) .ju-tabbar__tabs {
  opacity: 0;
}

.ju-tabbar__layer .ju-piece {
  flex: 0 0 58px;
  color: #fff;
}

.ju-tabbar__layer .ju-piece:first-child {
  border-radius: 28px 8px 8px 28px;
}

.ju-tabbar__layer .ju-piece:last-child {
  border-radius: 8px 28px 28px 8px;
}

.ju-tabbar__layer .ju-piece:only-child {
  border-radius: 28px;
}

.ju-tabbar__layer .ju-piece:disabled {
  opacity: 0.35;
  cursor: default;
}

/* La selezione tiene il contatore tondo e la prima azione appoggiata */
.ju-tabbar__layer .ju-tabbar__count:first-child {
  flex: 1 1 0;
  border-radius: 28px;
}

.ju-tabbar__layer .ju-tabbar__count + .ju-piece:not(:last-child) {
  border-radius: 16px 8px 8px 16px;
}

.ju-tabbar__layer .ju-tabbar__count + .ju-piece:last-child {
  border-radius: 16px 28px 28px 16px;
}

/* Attività in corso: il testo prende lo spazio e l'avanzamento lo riempie da sinistra */
.ju-tabbar__activity .ju-tabbar__info {
  flex: 1 1 0;
  justify-content: flex-start;
  gap: 12px;
  padding: 0 18px;
  text-align: left;
}

.ju-tabbar__info > svg {
  position: relative;
  flex: none;
}

.ju-tabbar__info span {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ju-tabbar__info b {
  overflow: hidden;
  font-size: 15px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ju-tabbar__info small {
  overflow: hidden;
  color: var(--ju-muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ju-tabbar__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--ju-progress, 0) * 100%);
  background: rgba(255, 255, 255, 0.16);
  pointer-events: none;
  transition: width 0.4s var(--ju-ease);
}

/* Modifica: Annulla e Salva a metà */
.ju-tabbar__editing .ju-piece {
  flex: 1 1 0;
  font-size: 15px;
  font-weight: 600;
}

.ju-tabbar__editing button.ju-tabbar__save,
.ju-tabbar__steps button.ju-tabbar__next {
  background: #fff;
  color: #000;
}

.ju-tabbar__editing button.ju-tabbar__save:hover:not(:disabled),
.ju-tabbar__steps button.ju-tabbar__next:hover:not(:disabled) {
  background: #e4e4e8;
}

/* Passi: Indietro, i pallini e Avanti */
.ju-tabbar__steps .ju-tabbar__dots {
  flex: 1 1 0;
  gap: 7px;
}

.ju-tabbar__dots i {
  width: 7px;
  height: 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.28);
  transition: width 0.4s var(--ju-ease), background 0.25s;
}

.ju-tabbar__dots i.is-done {
  background: rgba(255, 255, 255, 0.6);
}

.ju-tabbar__dots i.is-on {
  width: 22px;
  background: #fff;
}

.ju-tabbar__steps .ju-tabbar__next {
  flex: 0 0 auto;
  min-width: 104px;
  padding: 0 22px;
  font-size: 15px;
  font-weight: 600;
}

/* Il cerchio: azione in bianco, e sparisce durante attività, modifica e passi così la barra ha tutto lo spazio */
.ju-tabbar__search {
  transition: flex 0.5s var(--ju-ease), margin 0.5s var(--ju-ease), opacity 0.25s, background 0.25s, color 0.25s;
}

.ju-tabbar.has-action:not(.is-selecting) .ju-tabbar__search {
  background: #fff;
  color: #000;
}

.ju-tabbar:is(.is-activity, .is-editing, .is-steps) .ju-tabbar__search {
  flex-basis: 0;
  margin-left: -8px;
  border-width: 0;
  opacity: 0;
  pointer-events: none;
}

/* ── Righe ── */
.ju-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: #fff;
  font-family: var(--ju-font, "Google Sans Flex", system-ui, sans-serif);
  text-align: left;
}

.ju-row {
  flex: none;
  overflow: hidden;
  border-radius: 6px;
  background: var(--ju-bar);
  -webkit-backdrop-filter: var(--ju-bar-blur);
  backdrop-filter: var(--ju-bar-blur);
  scroll-margin-bottom: 112px;
  transition: border-radius 0.35s var(--ju-ease), background 0.25s var(--ju-ease), margin-top 0.4s var(--ju-ease);
}

.ju-list > :first-child {
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
}

.ju-list > :last-child {
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
}

.ju-row__main {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 12px 14px;
  text-align: left;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.ju-row__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 38px;
  height: 38px;
  overflow: hidden;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  font-size: 15px;
  font-weight: 600;
}

.ju-row__text {
  flex: 1;
  min-width: 0;
}

.ju-row__text b,
.ju-row__text i {
  display: block;
  overflow: hidden;
  font-style: normal;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ju-row__text b {
  font-size: 16px;
  font-weight: 500;
}

.ju-row__text b.is-strike {
  text-decoration: line-through;
}

.ju-row__text i {
  color: var(--ju-muted);
  font-size: 14px;
}

.ju-row__trailing {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
  color: var(--ju-muted);
  font-size: 14px;
}

.ju-row.is-dim .ju-row__text {
  opacity: 0.6;
}

.ju-list > .ju-row.is-selected {
  border-radius: 32px;
  background: var(--ju-active);
}

.ju-row:not(.is-selected):has(+ .is-selected) {
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 14px;
}

.ju-row.is-selected + .ju-row:not(.is-selected) {
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
}

.ju-row__menu {
  display: flex;
  gap: 3px;
  max-height: 0;
  overflow: hidden;
  background: var(--ju-screen);
  opacity: 0;
  transition: max-height 0.4s var(--ju-ease), opacity 0.25s, padding 0.4s var(--ju-ease);
}

.ju-row__menu .ju-piece {
  flex: 1;
  flex-direction: column;
  gap: 3px;
  height: 60px;
  border-radius: 6px;
  color: #fff;
  font-size: 13px;
}

.ju-list > .ju-row.is-open {
  margin-block: 6px !important;
  border-radius: 24px;
  background: none;
}

.ju-list > .ju-row.is-open:first-child {
  margin-top: 0 !important;
}

.ju-row.is-open .ju-row__main {
  border-radius: 0 0 6px 6px;
  background: var(--ju-active);
}

.ju-row.is-open .ju-row__menu {
  max-height: 63px;
  padding-top: 3px;
  opacity: 1;
}

/* ── List: azioni a scorrimento e riga scelta ── */
.accordion-stack-item,
.search-result-item {
  transition: border-radius 0.35s var(--ju-ease), background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.ju-swipe {
  position: relative;
}

.ju-swipe__layer {
  position: relative;
  z-index: 1;
  touch-action: pan-y;
  transition: transform 0.45s var(--ju-ease);
  -webkit-touch-callout: none;
}

.ju-swipe__actions {
  position: absolute;
  z-index: 0;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 3px;
  padding: 6px 6px 6px 0;
  overflow: hidden;
  transition: width 0.45s var(--ju-ease);
}

.ju-swipe__actions .ju-piece {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 70px;
  height: 100%;
  border-radius: 6px;
  color: #fff;
  font-family: var(--ju-font, "Google Sans Flex", system-ui, sans-serif);
  font-size: 12px;
}

.ju-swipe__actions .ju-piece.is-danger {
  color: var(--ju-danger);
}

.accordion-stack-item:first-child .ju-swipe__actions .ju-piece:last-child,
.search-result-item:first-child .ju-swipe__actions .ju-piece:last-child {
  border-top-right-radius: 18px;
}

.accordion-stack-item:last-child .ju-swipe__actions .ju-piece:last-child,
.search-result-item:last-child .ju-swipe__actions .ju-piece:last-child {
  border-bottom-right-radius: 18px;
}

.accordion-stack-item.is-selected,
.search-result-item.is-selected {
  border-color: rgba(255, 255, 255, 0.22);
  border-radius: 32px !important;
  background: rgba(255, 255, 255, 0.12);
}

.accordion-stack-item:not(.is-selected):has(+ .is-selected),
.search-result-item:not(.is-selected):has(+ .is-selected) {
  border-bottom-left-radius: 14px !important;
  border-bottom-right-radius: 14px !important;
}

.is-selected + .accordion-stack-item:not(.is-selected),
.is-selected + .search-result-item:not(.is-selected) {
  border-top-left-radius: 14px !important;
  border-top-right-radius: 14px !important;
}

/* ── Impostazioni ── */
.ju-setting {
  color: #fff;
  font-family: var(--ju-font, "Google Sans Flex", system-ui, sans-serif);
}

.ju-setting__main {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 68px;
  padding: 14px 18px;
  text-align: left;
}

.ju-setting__main .ju-row__text i {
  white-space: normal;
}

.ju-setting__toggle {
  position: relative;
  flex: none;
  width: 54px;
  height: 34px;
  border-radius: 17px;
  background: var(--ju-active);
  transition: background 0.3s;
}

.ju-setting__toggle::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background: #fff;
  transition: left 0.4s var(--ju-ease), border-radius 0.4s var(--ju-ease), background 0.4s var(--ju-ease);
}

.ju-setting.is-on .ju-setting__toggle {
  background: #fff;
}

.ju-setting.is-on .ju-setting__toggle::after {
  left: 24px;
  border-radius: 13px;
  background: #000;
}

.ju-setting__options {
  display: flex;
  gap: 3px;
  max-height: 0;
  padding: 0 8px;
  opacity: 0;
  transition: max-height 0.45s var(--ju-ease), opacity 0.25s, padding 0.45s var(--ju-ease);
}

.ju-setting.is-on .ju-setting__options {
  max-height: 60px;
  padding-bottom: 8px;
  opacity: 1;
}

.ju-setting__options .ju-piece {
  flex: 1;
  height: 48px;
  font-size: 14px;
}

.ju-setting__options .ju-piece:first-child {
  border-radius: 24px 8px 8px 24px;
}

.ju-setting__options .ju-piece:last-child {
  border-radius: 8px 24px 24px 8px;
}

.ju-setting__options .ju-piece.is-active {
  border-radius: 24px;
}

/* ── Caricamento ── */
.ju-skeleton > * {
  animation: ju-pulse 1.2s ease-in-out infinite alternate;
}

.ju-skeleton .accordion-stack-trigger {
  gap: 14px;
  cursor: default;
}

.ju-skeleton b,
.ju-skeleton i {
  height: 14px;
  margin-block: 5px;
  border-radius: 8px;
  background: var(--ju-piece);
}

.ju-skeleton i {
  height: 11px;
}

.ju-skeleton .ju-row__icon {
  background: var(--ju-piece);
}

@keyframes ju-pulse {
  to {
    opacity: 0.45;
  }
}

/* ── Tasto che si apre ── */
.ju-fab {
  position: absolute;
  z-index: 8;
  right: 14px;
  bottom: calc(106px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
  transition: bottom 0.5s var(--ju-ease);
}

.ju-fab > * {
  pointer-events: auto;
}

.ju-fab__menu {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.ju-fab__menu[inert] {
  pointer-events: none;
}

.ju-fab__item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 180px;
  height: 56px;
  padding: 0 20px;
  border-radius: 8px;
  background: var(--ju-bar);
  -webkit-backdrop-filter: var(--ju-bar-blur);
  backdrop-filter: var(--ju-bar-blur);
  color: #fff;
  opacity: 0;
  transform: translateY(60px) scale(0.6);
  transform-origin: bottom right;
  transition: opacity 0.2s, transform 0.5s var(--ju-ease), background 0.25s;
}

.ju-fab__item:first-child {
  border-radius: 28px 28px 8px 8px;
  transition-delay: 0.06s;
}

.ju-fab__item:nth-child(2) {
  transition-delay: 0.03s;
}

.ju-fab__item:last-child {
  border-radius: 8px 8px 28px 28px;
}

.ju-fab__item:only-child {
  border-radius: 28px;
}

.ju-fab__item:hover {
  background: var(--ju-piece-hover);
}

.ju-fab.is-open .ju-fab__item {
  opacity: 1;
  transform: none;
}

.ju-fab__button {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border-radius: 24px;
  background: #fff;
  color: #000;
  transition: border-radius 0.4s var(--ju-ease);
}

.ju-fab__button svg {
  transition: transform 0.4s var(--ju-ease);
}

.ju-fab.is-open .ju-fab__button {
  border-radius: 34px;
}

.ju-fab.is-open .ju-fab__button svg {
  transform: rotate(45deg);
}

/* Con un avviso aperto il tasto sale */
:root:has(.ju-toast.is-on) .ju-fab {
  bottom: calc(172px + env(safe-area-inset-bottom, 0px));
}

/* ── Barra messaggi ── */
.ju-message {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  color: #fff;
  font-family: var(--ju-font, "Google Sans Flex", system-ui, sans-serif);
}

.ju-screen > .ju-message {
  position: absolute;
  z-index: 6;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  left: 14px;
  right: 14px;
}

.ju-message__box {
  flex: 1;
  min-width: 0;
  padding: 5px;
  border: var(--ju-line);
  border-radius: 32px;
  background: var(--ju-bar);
  -webkit-backdrop-filter: var(--ju-bar-blur);
  backdrop-filter: var(--ju-bar-blur);
}

.ju-message__line {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
}

.ju-message__plus {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 26px;
  color: #fff;
}

.ju-message__plus svg {
  transition: transform 0.4s var(--ju-ease);
}

.ju-message__line > input {
  flex: 1;
  min-width: 0;
  height: 52px;
  outline: 0;
  font-size: 16px;
}

.ju-message__line > input:first-child {
  padding-left: 16px;
}

.ju-message__attach {
  display: flex;
  gap: 3px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.45s var(--ju-ease), opacity 0.25s, margin 0.45s var(--ju-ease);
}

.ju-message__attach .ju-piece {
  flex: 1;
  flex-direction: column;
  gap: 6px;
  height: 84px;
  font-size: 13px;
}

.ju-message__attach .ju-piece:first-child {
  border-radius: 26px 8px 8px 16px;
}

.ju-message__attach .ju-piece:last-child {
  border-radius: 8px 26px 16px 8px;
}

.ju-message.is-attaching .ju-message__attach {
  max-height: 84px;
  margin-bottom: 5px;
  opacity: 1;
}

.ju-message.is-attaching .ju-message__plus svg {
  transform: rotate(45deg);
}

.ju-message__main {
  display: grid;
  flex: none;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #fff;
  color: #000;
  transition: border-radius 0.4s var(--ju-ease), background 0.3s;
}

.ju-message__main span {
  display: grid;
  grid-area: 1 / 1;
  transition: opacity 0.2s, transform 0.35s var(--ju-ease);
}

.ju-message:is(.is-typed, .is-recording) .ju-message__mic,
.ju-message:not(.is-typed) .ju-message__send,
.ju-message:not(.is-recording) .ju-message__stop {
  opacity: 0;
  transform: scale(0.4);
}

.ju-message.is-recording .ju-message__main {
  border-radius: 24px;
  background: #ff6b6b;
}

.ju-message__rec {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border-radius: 26px;
  background: var(--ju-bar);
  -webkit-backdrop-filter: var(--ju-bar-blur);
  backdrop-filter: var(--ju-bar-blur);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.ju-message.is-recording .ju-message__rec {
  opacity: 1;
  pointer-events: auto;
}

.ju-message__rec em {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff6b6b;
}

.ju-message__rec button {
  display: grid;
  place-items: center;
}

.ju-message__time {
  font-variant-numeric: tabular-nums;
}

.ju-message__bars {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  height: 30px;
  overflow: hidden;
}

.ju-message__bars s {
  flex: none;
  width: 3px;
  border-radius: 2px;
  background: #fff;
}

/* ── Avviso con annulla ── */
.ju-toast {
  position: absolute;
  z-index: 8;
  bottom: calc(100px + env(safe-area-inset-bottom, 0px));
  left: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  padding: 0 6px 0 22px;
  overflow: hidden;
  border: var(--ju-line);
  border-radius: 30px;
  background: var(--ju-bar);
  -webkit-backdrop-filter: var(--ju-bar-blur);
  backdrop-filter: var(--ju-bar-blur);
  color: #fff;
  font-size: 15px;
  opacity: 0;
  transform: translateY(60px);
  transition: transform 0.5s var(--ju-ease), opacity 0.25s;
}

.ju-toast.is-on {
  opacity: 1;
  transform: none;
}

.ju-toast {
  box-sizing: border-box;
  font-family: var(--ju-font, "Google Sans Flex", system-ui, sans-serif);
}

/* L'avviso automatico di toast(): in fondo alla pagina, sopra la tab bar se c'è */
.ju-toast.ju-toast--global {
  position: fixed;
  z-index: 1000;
  left: 50%;
  right: auto;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  width: min(440px, calc(100vw - 28px));
  transform: translate(-50%, 90px);
}

.ju-toast.ju-toast--global.is-on {
  transform: translate(-50%, 0);
}

:root:has(.ju-tabbar) .ju-toast.ju-toast--global {
  bottom: calc(100px + env(safe-area-inset-bottom, 0px));
}

.ju-toast button {
  height: 48px;
  padding: 0 20px;
  border-radius: 24px;
  background: var(--ju-active);
  font-weight: 600;
}

.ju-toast u {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: #fff;
  transform: scaleX(0);
  transform-origin: left;
  animation: ju-countdown 5s linear;
}

@keyframes ju-countdown {
  from {
    transform: scaleX(1);
  }
}

/* ── Conferma a scorrimento ── */
.ju-slide {
  position: relative;
  height: 72px;
  overflow: hidden;
  border: var(--ju-line);
  border-radius: 36px;
  background: var(--ju-bar);
  -webkit-backdrop-filter: var(--ju-bar-blur);
  backdrop-filter: var(--ju-bar-blur);
  color: #fff;
  font-family: var(--ju-font, "Google Sans Flex", system-ui, sans-serif);
  touch-action: pan-y;
}

.ju-slide__label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding-left: 66px;
  color: var(--ju-muted);
}

.ju-slide__knob {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 5px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 31px;
  background: var(--ju-danger);
  color: #2a0000;
  font-weight: 600;
  white-space: nowrap;
  cursor: grab;
  touch-action: none;
  transition: width 0.5s var(--ju-ease);
}

/* ── Calendario ── */
.ju-calendar,
.ju-month {
  --ju-day: 48px;
  color: #fff;
  font-family: var(--ju-font, "Google Sans Flex", system-ui, sans-serif);
}

.ju-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  color: #fff;
  container-type: inline-size;
}

/* Il titolo si rimpicciolisce quando lo spazio è poco, così il mese resta intero */
.ju-cal-header b {
  min-width: 0;
  padding-left: 4px;
  overflow: hidden;
  font-size: clamp(16px, 6.4cqi, 22px);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ju-cal-header__group {
  display: flex;
  flex: none;
  gap: 3px;
}

.ju-cal-header .ju-piece {
  width: 46px;
  height: 46px;
  color: #fff;
  background: var(--ju-bar);
  -webkit-backdrop-filter: var(--ju-bar-blur);
  backdrop-filter: var(--ju-bar-blur);
}

.ju-cal-header .ju-piece:hover {
  background: rgba(40, 40, 47, 0.66);
}

.ju-cal-header .ju-piece:first-child {
  border-radius: 23px 8px 8px 23px;
}

.ju-cal-header .ju-piece:last-child {
  border-radius: 8px 23px 23px 8px;
}

.ju-month {
  --ju-spring: linear(0, 0.14 6%, 0.5 15%, 0.84 25%, 1.03 35%, 1.08 42%, 1.05 54%, 0.995 70%, 1);
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
}

.ju-month__weekday {
  padding: 0 0 4px;
  color: var(--ju-muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.ju-day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: var(--ju-day);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 15px;
  touch-action: manipulation;
  transition: border-radius 0.6s var(--ju-spring), background 0.25s, color 0.25s, transform 0.6s var(--ju-spring);
}

.ju-day.is-tl {
  border-top-left-radius: 28px;
}

.ju-day.is-tr {
  border-top-right-radius: 28px;
}

.ju-day.is-bl {
  border-bottom-left-radius: 28px;
}

.ju-day.is-br {
  border-bottom-right-radius: 28px;
}

@media (hover: hover) {
  .ju-day:hover {
    background: rgba(255, 255, 255, 0.18);
  }
}

.ju-day.is-out {
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.45);
}

.ju-day.is-today {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  font-weight: 800;
}

.ju-day.is-between {
  background: rgba(255, 255, 255, 0.32);
  color: #fff;
}

.ju-day.is-selected {
  z-index: 1;
  border-radius: calc(var(--ju-day) / 2);
  background: #f5f5f7;
  color: #0b0c10;
  font-weight: 800;
  transform: scale(1.04);
}

.ju-day__marks {
  display: flex;
  gap: 2px;
  height: 5px;
}

.ju-day__marks i {
  width: 5px;
  height: 5px;
  border-radius: 3px;
  background: #fff;
}

.ju-day__marks i.is-bar {
  width: 9px;
  background: rgba(255, 255, 255, 0.6);
}

.ju-day.is-selected .ju-day__marks i {
  background: #0b0c10;
}

.ju-week-row__day {
  display: grid;
  flex: none;
  justify-items: center;
  width: 44px;
  color: var(--ju-muted);
}

.ju-week-row__day small {
  font-size: 13px;
  text-transform: capitalize;
}

.ju-week-row__day b {
  color: #fff;
  font-size: 22px;
  line-height: 1.1;
}

.ju-week-row__day.is-today b {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.ju-week-row__items {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}

.ju-week-row__items s {
  max-width: 100%;
  padding: 4px 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ju-week-row__items em {
  color: var(--ju-muted);
  font-size: 14px;
  font-style: normal;
}

@media (max-width: 359px) {
  .ju-cal-header b {
    font-size: 18px;
  }

  .ju-cal-header .ju-piece {
    width: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  :is([class^="ju-"], [class*=" ju-"]):not(.ju-toast u) {
    transition-duration: 0.01ms !important;
  }

  .ju-skeleton .ju-row {
    animation: none;
  }
}

/* ── Superfici leggere sulla foto ──
   Liste, pannelli, righe e bottoni hanno un velo bianco quasi trasparente pensato per stare dentro
   una finestra di vetro. Appoggiati direttamente sullo sfondo prendono un vetro scuro, così si leggono;
   dentro finestre, sidebar e pannelli il filtro si spegne e restano leggeri come prima (e costano meno). */
.accordion-stack-item,
.search-result-item,
.modular-panel,
.premium-nav-item,
.cir-tabs-vertical,
.overview-search-bar,
.token-box,
.wf-user-box,
.modular-btn-secondary,
.connected-subpanel,
.dw-tile,
.ju-surface {
  -webkit-backdrop-filter: blur(22px) saturate(140%) brightness(0.62);
  backdrop-filter: blur(22px) saturate(140%) brightness(0.62);
}

:is(.app-window-frame, .login-window-frame, .premium-sidebar, .premium-main-content, .login-left-panel, .login-right-panel, .glass-panel, .modular-panel, .saas-sidebar, .saas-card-panel, .dashboard-panel, .auth-panel, .search-results-dropdown, .modular-customizer-drawer, .split-drawer-2fa, .wc-card-frame, .arc-side-panel)
  :is(.accordion-stack-item, .search-result-item, .modular-panel, .premium-nav-item, .cir-tabs-vertical, .overview-search-bar, .token-box, .wf-user-box, .modular-btn-secondary, .connected-subpanel, .dw-tile, .ju-surface) {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* Chi chiede meno trasparenza ha un fondo pieno al posto del vetro */
@media (prefers-reduced-transparency: reduce) {
  .ju-appbar__frame,
  .ju-tabbar__box,
  .ju-tabbar__search,
  .ju-row,
  .ju-message__box,
  .ju-message__rec,
  .ju-slide,
  .ju-fab__item,
  .ju-toast,
  .ju-cal-header .ju-piece {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: var(--ju-surface);
  }

  .accordion-stack-item,
  .search-result-item,
  .modular-panel,
  .premium-nav-item,
  .cir-tabs-vertical,
  .overview-search-bar,
  .token-box,
  .wf-user-box,
  .modular-btn-secondary,
  .connected-subpanel,
  .dw-tile,
  .ju-surface {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background-color: #17171d;
  }
}
