/* PURPOSE: Vereint Remote-Dashboard und GPT-Arbeitszugang im mobilen Bento-Glass-System. */
/* Bestehende Funktionen, Sidebar, Core-Tokens und Form-Zustände bleiben unverändert. */
@layer modules {
  .enterprise-shell:is([data-shell-route="devices"],[data-shell-route="work"]) {
    --bento-glass: color-mix(in srgb,var(--surface-strong) 87%,transparent);
    --bento-glass-deep: color-mix(in srgb,var(--surface) 93%,transparent);
    --bento-edge: color-mix(in srgb,var(--primary) 13%,var(--line));
    --bento-glow: color-mix(in srgb,var(--primary) 11%,transparent);
    --bento-shine: color-mix(in srgb,var(--surface-strong) 67%,transparent);
    --bento-shadow: 0 1.15rem 2.8rem rgb(6 24 19 / .07),inset 0 1px 0 var(--bento-shine);
  }
  .enterprise-shell:is([data-shell-route="devices"],[data-shell-route="work"]) .workspace {
    background:
      radial-gradient(ellipse 36rem 23rem at 80% 4%,color-mix(in srgb,var(--primary) 8%,transparent),transparent 78%),
      radial-gradient(ellipse 27rem 25rem at 7% 58%,color-mix(in srgb,var(--primary) 5%,transparent),transparent 83%),var(--bg);
  }
  .enterprise-shell:is([data-shell-route="devices"],[data-shell-route="work"]) .sidebar {
    background: linear-gradient(155deg,color-mix(in srgb,var(--surface-strong) 97%,var(--primary-soft)),var(--surface-strong) 65%,color-mix(in srgb,var(--surface-strong) 90%,var(--primary-soft)));
    border-inline-end: 1px solid var(--bento-edge);
  }
  .enterprise-shell:is([data-shell-route="devices"],[data-shell-route="work"]) .topbar {
    background: color-mix(in srgb,var(--surface-strong) 88%,transparent);
    border-bottom-color: var(--bento-edge);
    backdrop-filter: blur(1.5rem) saturate(130%);
    -webkit-backdrop-filter: blur(1.5rem) saturate(130%);
  }
  .enterprise-shell:is([data-shell-route="devices"],[data-shell-route="work"]) .workspace-title h1 {
    letter-spacing: -.045em;
    font-weight: 730;
    font-size: clamp(1.55rem,2.3vw,2.1rem);
  }
  .enterprise-shell:is([data-shell-route="devices"],[data-shell-route="work"]) .workspace-subtitle {
    max-width: 69rem;
    font-size: .94rem;
    margin-bottom: 1.35rem;
  }
  .enterprise-shell:is([data-shell-route="devices"],[data-shell-route="work"]) .nav-list a[aria-current="page"] {
    background: linear-gradient(110deg,var(--primary-soft),color-mix(in srgb,var(--primary-soft) 58%,transparent));
    border: 1px solid color-mix(in srgb,var(--primary) 24%,transparent);
    box-shadow: inset 3px 0 0 var(--primary);
  }
  .enterprise-shell:is([data-shell-route="devices"],[data-shell-route="work"]) :where(.button.primary):not(:disabled) {
    background: linear-gradient(135deg,var(--primary),color-mix(in srgb,var(--primary) 83%,var(--primary-strong)));
    box-shadow: 0 .3rem 1.05rem color-mix(in srgb,var(--primary) 16%,transparent);
    border-color: color-mix(in srgb,var(--primary) 64%,var(--line));
    border-radius: .88rem;
    transition: transform .18s ease,box-shadow .18s ease,filter .18s ease;
  }
  .enterprise-shell:is([data-shell-route="devices"],[data-shell-route="work"]) .button.primary:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 .55rem 1.3rem color-mix(in srgb,var(--primary) 20%,transparent);
    filter: brightness(1.04);
  }
  .enterprise-shell:is([data-shell-route="devices"],[data-shell-route="work"]) .button.quiet {
    border-radius: .88rem;
  }

  /* Übersicht: drei übersichtliche Kennzahlen und unterschiedlich gewichtete Bento-Flächen. */
  .enterprise-shell[data-shell-route="devices"] .remote-stats {
    gap: clamp(.65rem,1.1vw,1rem);
    margin-bottom: clamp(.9rem,1.7vw,1.4rem);
  }
  .enterprise-shell[data-shell-route="devices"] .remote-stats > .remote-stat {
    position: relative;
    min-width: 0;
    min-height: 7.7rem;
    padding: clamp(1rem,1.5vw,1.4rem);
    border: 1px solid var(--bento-edge);
    border-radius: 1.3rem;
    background: linear-gradient(147deg,var(--bento-glass),var(--bento-glass-deep));
    box-shadow: var(--bento-shadow);
    backdrop-filter: blur(1.2rem);
    -webkit-backdrop-filter: blur(1.2rem);
  }
  .enterprise-shell[data-shell-route="devices"] .remote-stats > .remote-stat:nth-child(2) {
    background: radial-gradient(ellipse at 94% 0%,var(--bento-glow),transparent 75%),linear-gradient(150deg,var(--bento-glass),var(--bento-glass-deep));
  }
  .enterprise-shell[data-shell-route="devices"] .remote-stat strong {
    font-weight: 750;
    letter-spacing: -.065em;
    margin: .35rem .55rem .25rem 0;
    font-size: clamp(1.9rem,2.9vw,2.45rem);
  }
  .enterprise-shell[data-shell-route="devices"] .remote-stat :where(span,small) {
    line-height: 1.45;
  }
  .enterprise-shell[data-shell-route="devices"] .dashboard-grid {
    grid-template-columns: minmax(0,1.65fr) minmax(17.5rem,.94fr);
    gap: clamp(.8rem,1.3vw,1.25rem);
  }
  .enterprise-shell[data-shell-route="devices"] :where(.dashboard-devices,.dashboard-card) {
    min-width: 0;
    border: 1px solid var(--bento-edge);
    border-radius: 1.45rem;
    box-shadow: var(--bento-shadow);
    background: radial-gradient(ellipse 26rem 13rem at 94% 0%,var(--bento-glow),transparent 82%),linear-gradient(150deg,var(--bento-glass),var(--bento-glass-deep));
    backdrop-filter: blur(1.2rem) saturate(115%);
    -webkit-backdrop-filter: blur(1.2rem) saturate(115%);
  }
  .enterprise-shell[data-shell-route="devices"] .dashboard-card {
    padding: clamp(1.05rem,1.6vw,1.6rem);
  }
  .enterprise-shell[data-shell-route="devices"] .dashboard-card:nth-child(2) {
    background: radial-gradient(ellipse 20rem 13rem at 98% 2%,color-mix(in srgb,var(--primary) 13%,transparent),transparent 85%),linear-gradient(155deg,var(--bento-glass),var(--bento-glass-deep));
  }
  .enterprise-shell[data-shell-route="devices"] .dashboard-devices .section-heading {
    gap: .8rem;
    align-items: center;
  }
  .enterprise-shell[data-shell-route="devices"] .dashboard-devices .section-heading h2,
  .enterprise-shell[data-shell-route="devices"] .dashboard-card h2 {
    font-weight: 720;
    letter-spacing: -.025em;
  }
  .enterprise-shell[data-shell-route="devices"] #device-list {
    max-height: min(55rem,78svh);
    gap: .75rem;
    scrollbar-gutter: stable;
  }
  .enterprise-shell[data-shell-route="devices"] .dashboard-devices .device-row {
    border: 1px solid color-mix(in srgb,var(--primary) 11%,var(--line));
    border-radius: 1.1rem;
    padding: clamp(.85rem,1.15vw,1.05rem);
    background: linear-gradient(140deg,color-mix(in srgb,var(--surface-strong) 94%,transparent),color-mix(in srgb,var(--surface) 90%,transparent));
    box-shadow: inset 0 1px 0 var(--bento-shine),0 .28rem .8rem rgb(5 22 15 / .025);
    transition: border-color .18s ease,transform .18s ease;
  }
  .enterprise-shell[data-shell-route="devices"] .dashboard-devices .device-row:hover {
    border-color: color-mix(in srgb,var(--primary) 30%,var(--line));
  }
  .enterprise-shell[data-shell-route="devices"] .device-description strong {
    font-weight: 720;
    font-size: .95rem;
  }
  .enterprise-shell[data-shell-route="devices"] .device-actions {
    gap: .48rem;
  }
  .enterprise-shell[data-shell-route="devices"] .device-actions .button {
    border-radius: .83rem;
    min-height: 2.8rem;
    font-weight: 650;
    text-align: center;
    white-space: normal;
  }
  .enterprise-shell[data-shell-route="devices"] .device-actions .badge {
    border-radius: 999px;
    padding: .36rem .64rem;
  }
  .enterprise-shell[data-shell-route="devices"] .device-options {
    margin-inline-start: auto;
  }
  .enterprise-shell[data-shell-route="devices"] .device-options > summary {
    border-radius: .7rem;
    padding: .5rem .65rem;
    min-height: 2.75rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .16s ease,color .16s ease;
  }
  .enterprise-shell[data-shell-route="devices"] .device-options > summary:hover {
    background: var(--primary-soft);
    color: var(--primary-strong);
  }
  .enterprise-shell[data-shell-route="devices"] .dashboard-card > .dashboard-text-link {
    display: flex;
    justify-content: center;
    width: fit-content;
    min-width: min(100%,10rem);
    padding: .58rem 1rem;
    margin-inline: auto;
    min-height: 2.75rem;
    border-radius: .85rem;
    border: 1px solid var(--bento-edge);
    background: color-mix(in srgb,var(--surface-strong) 73%,var(--primary-soft));
    color: var(--ink);
    font-size: .85rem;
    text-align: center;
    text-decoration: none;
    font-weight: 670;
    transition: background .18s ease,border-color .18s ease;
  }
  .enterprise-shell[data-shell-route="devices"] .dashboard-card > .dashboard-text-link:hover {
    color: var(--primary-strong);
    border-color: color-mix(in srgb,var(--primary) 40%,var(--line));
    background: var(--primary-soft);
  }
  .enterprise-shell[data-shell-route="devices"] .dashboard-card .button {
    min-height: 2.9rem;
    font-weight: 680;
    border-radius: .9rem;
  }
  .enterprise-shell[data-shell-route="devices"] .dashboard-jobs {
    border: 1px solid var(--bento-edge);
    border-radius: .95rem;
    overflow: hidden;
    background: color-mix(in srgb,var(--surface) 82%,transparent);
  }
  .enterprise-shell[data-shell-route="devices"] .dashboard-jobs:empty {
    display: none;
  }
  .enterprise-shell[data-shell-route="devices"] .dashboard-jobs .dashboard-job {
    padding-inline: .85rem;
  }
  .enterprise-shell[data-shell-route="devices"] .dashboard-disclosure {
    border-color: var(--bento-edge);
    border-radius: 1rem;
    background: var(--bento-glass-deep);
  }

  /* GPT-Arbeitszugang: echte Sprungziele als klare, unterstreichungsfreie Segment-Navigation. */
  .enterprise-shell[data-shell-route="work"] .work-overview-nav {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    align-items: stretch;
    padding: .74rem;
    margin: 0 0 1.05rem;
    border: 1px solid var(--bento-edge);
    border-radius: 1.4rem;
    background: linear-gradient(120deg,var(--bento-glass),var(--bento-glass-deep));
    box-shadow: var(--bento-shadow);
    backdrop-filter: blur(1.2rem) saturate(125%);
    -webkit-backdrop-filter: blur(1.2rem) saturate(125%);
  }
  .enterprise-shell[data-shell-route="work"] .work-overview-nav > a {
    display: inline-flex;
    min-width: 0;
    flex: 0 1 auto;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .64rem .95rem;
    min-height: 3rem;
    border: 1px solid color-mix(in srgb,var(--primary) 10%,var(--line));
    border-radius: .96rem;
    background: color-mix(in srgb,var(--surface-strong) 60%,var(--surface));
    color: var(--ink);
    font-size: .84rem;
    font-weight: 680;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    box-shadow: inset 0 1px 0 var(--bento-shine);
    transition: border-color .18s ease,color .18s ease,background .18s ease,transform .18s ease;
  }
  .enterprise-shell[data-shell-route="work"] .work-overview-nav > a:hover,
  .enterprise-shell[data-shell-route="work"] .work-overview-nav > a:focus-visible {
    border-color: color-mix(in srgb,var(--primary) 44%,var(--line));
    color: var(--primary-strong);
    background: var(--primary-soft);
    text-decoration: none;
    transform: translateY(-1px);
  }
  .enterprise-shell[data-shell-route="work"] .work-overview-nav > a::before {
    content: "";
    width: .42rem;
    height: .42rem;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 .2rem color-mix(in srgb,var(--primary) 12%,transparent);
  }
  .enterprise-shell[data-shell-route="work"] .work-overview-nav > a .badge {
    display: inline-flex;
    min-height: 1.4rem;
    max-width: 100%;
    padding: .22rem .48rem;
    border-radius: 999px;
    font-size: .67rem;
    line-height: 1.2;
    font-weight: 690;
    overflow-wrap: anywhere;
    text-decoration: none;
  }
  .enterprise-shell[data-shell-route="work"] .work-overview-nav :is(a,a span) {
    text-decoration: none;
  }
  .enterprise-shell[data-shell-route="work"] .work-layout {
    gap: clamp(.8rem,1.3vw,1.25rem);
    grid-template-columns: minmax(0,1fr) minmax(17rem,19rem);
  }
  .enterprise-shell[data-shell-route="work"] .work-primary { gap: .9rem; }
  .enterprise-shell[data-shell-route="work"] :where(.work-section,.work-aside > .work-section) {
    position: relative;
    min-width: 0;
    border: 1px solid var(--bento-edge);
    border-radius: 1.38rem;
    background: radial-gradient(ellipse 21rem 12rem at 100% 0%,var(--bento-glow),transparent 82%),
      linear-gradient(150deg,var(--bento-glass),var(--bento-glass-deep));
    box-shadow: var(--bento-shadow);
    backdrop-filter: blur(1rem) saturate(118%);
    -webkit-backdrop-filter: blur(1rem) saturate(118%);
    padding: clamp(1rem,1.45vw,1.4rem);
  }
  .enterprise-shell[data-shell-route="work"] .work-section .eyebrow {
    letter-spacing: .14em;
    font-size: .68rem;
    font-weight: 760;
    color: var(--primary-strong);
  }
  .enterprise-shell[data-shell-route="work"] .work-heading h2 {
    font-weight: 730;
    letter-spacing: -.025em;
  }
  .enterprise-shell[data-shell-route="work"] .work-aside { gap: .9rem; }
  .enterprise-shell[data-shell-route="work"] .work-aside > .work-section {
    padding: clamp(.95rem,1.25vw,1.3rem);
  }
  .enterprise-shell[data-shell-route="work"] #work-power {
    background: radial-gradient(ellipse 27rem 15rem at 92% 0%,color-mix(in srgb,var(--primary) 13%,transparent),transparent 81%),
      linear-gradient(150deg,var(--bento-glass),var(--bento-glass-deep));
  }
  .enterprise-shell[data-shell-route="work"] .power-grid { gap: .75rem; }
  .enterprise-shell[data-shell-route="work"] .power-card {
    border: 1px solid color-mix(in srgb,var(--primary) 11%,var(--line));
    border-radius: 1.05rem;
    padding: 1rem;
    background: linear-gradient(145deg,color-mix(in srgb,var(--surface-strong) 92%,transparent),
      color-mix(in srgb,var(--surface) 92%,transparent));
    box-shadow: inset 0 1px 0 var(--bento-shine);
  }
  .enterprise-shell[data-shell-route="work"] .power-card h3 {
    font-weight: 725;
    color: var(--ink);
    letter-spacing: -.017em;
  }
  .enterprise-shell[data-shell-route="work"] .power-card p { line-height: 1.5; }
  .enterprise-shell[data-shell-route="work"] .power-actions .button {
    min-height: 2.85rem;
    border-radius: .83rem;
    font-weight: 680;
  }
  .enterprise-shell[data-shell-route="work"] :where(.power-setup,.work-reauth) {
    border-color: color-mix(in srgb,var(--warning) 38%,var(--bento-edge));
    background: radial-gradient(ellipse 20rem 13rem at 100% 0%,color-mix(in srgb,var(--warning) 13%,transparent),transparent 86%),
      linear-gradient(160deg,var(--bento-glass),var(--bento-glass-deep));
  }
  .enterprise-shell[data-shell-route="work"] .work-compact-list,
  .enterprise-shell[data-shell-route="work"] .work-grant-group {
    border-radius: 1rem;
    border-color: var(--bento-edge);
    background: color-mix(in srgb,var(--surface) 92%,transparent);
  }
  .enterprise-shell[data-shell-route="work"] .work-row { padding: .85rem; }
  .enterprise-shell[data-shell-route="work"] .work-trusted .work-automation { border-radius: .9rem; }
  .enterprise-shell[data-shell-route="work"] .work-connection select,
  .enterprise-shell[data-shell-route="work"] .work-search input {
    border: 1px solid var(--bento-edge);
    border-radius: .8rem;
    background: color-mix(in srgb,var(--surface-strong) 83%,transparent);
  }
  .enterprise-shell[data-shell-route="work"] .work-empty {
    padding: 1.25rem;
    border: 1px dashed color-mix(in srgb,var(--primary) 16%,var(--line));
    border-radius: .85rem;
    background: color-mix(in srgb,var(--surface) 73%,transparent);
  }
  .enterprise-shell[data-shell-route="work"] .work-section :is(a,summary):not(.button):hover {
    color: var(--primary-strong);
  }
  .enterprise-shell[data-shell-route="work"] .work-connect > summary { text-decoration: none; }
  @supports selector(:has(*)) {
    .enterprise-shell[data-shell-route="work"]:has(#work-power-heading:target) .work-overview-nav a[href="#work-power-heading"],
    .enterprise-shell[data-shell-route="work"]:has(#work-jobs-heading:target) .work-overview-nav a[href="#work-jobs-heading"],
    .enterprise-shell[data-shell-route="work"]:has(#trusted-terminal:target) .work-overview-nav a[href="#trusted-terminal"],
    .enterprise-shell[data-shell-route="work"]:has(#work-grants-heading:target) .work-overview-nav a[href="#work-grants-heading"] {
      background: var(--primary-soft);
      border-color: color-mix(in srgb,var(--primary) 50%,var(--line));
      color: var(--primary-strong);
    }
  }
  @media (max-width: 80rem) {
    .enterprise-shell[data-shell-route="work"] .work-layout {
      grid-template-columns: minmax(0,1fr);
    }
    .enterprise-shell[data-shell-route="work"] .work-aside {
      position: static;
      grid-template-columns: repeat(2,minmax(0,1fr));
    }
    .enterprise-shell[data-shell-route="work"] .work-connect,
    .enterprise-shell[data-shell-route="work"] .work-policy { grid-column: 1 / -1; }
  }
  @media (max-width: 76rem) {
    .enterprise-shell[data-shell-route="devices"] .dashboard-grid {
      grid-template-columns: minmax(0,1fr);
    }
    .enterprise-shell[data-shell-route="devices"] .dashboard-aside {
      grid-template-columns: repeat(2,minmax(0,1fr));
    }
  }
  @media (max-width: 52rem) {
    .enterprise-shell[data-shell-route="work"] .work-overview-nav {
      display: grid;
      grid-template-columns: repeat(2,minmax(0,1fr));
      padding: .65rem;
      gap: .55rem;
    }
    .enterprise-shell[data-shell-route="work"] .work-overview-nav > a {
      min-width: 0;
      width: 100%;
      padding: .7rem .6rem;
      justify-content: center;
      overflow-wrap: anywhere;
    }
  }
  @media (max-width: 44rem) {
    .enterprise-shell[data-shell-route="devices"] .remote-stats {
      grid-template-columns: repeat(2,minmax(0,1fr));
      gap: .55rem;
    }
    .enterprise-shell[data-shell-route="devices"] .remote-stats > .remote-stat {
      min-height: 7.4rem;
      padding: .9rem;
      border-radius: 1.13rem;
    }
    .enterprise-shell[data-shell-route="devices"] .remote-stats > .remote-stat:last-child {
      grid-column: 1 / -1;
      min-height: 6.2rem;
    }
    .enterprise-shell[data-shell-route="devices"] .dashboard-aside { display: contents; }
    .enterprise-shell[data-shell-route="devices"] .dashboard-devices { order: 1; }
    .enterprise-shell[data-shell-route="devices"] .dashboard-aside > .dashboard-card { order: 2; }
    .enterprise-shell[data-shell-route="devices"] .dashboard-aside > [aria-labelledby="dashboard-jobs-heading"] { order: 0; }
    .enterprise-shell[data-shell-route="devices"] :where(.dashboard-devices,.dashboard-card) {
      border-radius: 1.15rem;
      padding: 1rem;
    }
    .enterprise-shell[data-shell-route="devices"] #device-list {
      max-height: none;
      overflow: visible;
      scrollbar-gutter: auto;
    }
    .enterprise-shell[data-shell-route="devices"] .dashboard-devices .device-row {
      padding: .85rem;
      border-radius: .95rem;
    }
    .enterprise-shell[data-shell-route="devices"] .device-actions .button {
      flex: 1 1 9rem;
      min-width: 0;
    }
    .enterprise-shell[data-shell-route="work"] .work-aside { grid-template-columns: minmax(0,1fr); }
    .enterprise-shell[data-shell-route="work"] :where(.work-section,.work-aside > .work-section) {
      border-radius: 1.15rem;
      padding: 1rem;
    }
    .enterprise-shell[data-shell-route="work"] .work-connect,
    .enterprise-shell[data-shell-route="work"] .work-policy { grid-column: auto; }
    .enterprise-shell[data-shell-route="work"] .power-grid { grid-template-columns: minmax(0,1fr); }
    .enterprise-shell[data-shell-route="work"] .power-actions .button { width: 100%; }
  }
  @media (max-width: 23.5rem) {
    .enterprise-shell[data-shell-route="devices"] .remote-stats { grid-template-columns: minmax(0,1fr); }
    .enterprise-shell[data-shell-route="devices"] .remote-stats > .remote-stat:last-child { grid-column: auto; }
    .enterprise-shell[data-shell-route="work"] .work-overview-nav { grid-template-columns: minmax(0,1fr); }
  }
  @media (prefers-reduced-transparency: reduce) {
    .enterprise-shell:is([data-shell-route="devices"],[data-shell-route="work"]) :where(.remote-stat,.dashboard-devices,.dashboard-card,.work-overview-nav,.work-section,.power-card) {
      background: var(--surface-strong);
      backdrop-filter: none;
      -webkit-backdrop-filter: none;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .enterprise-shell:is([data-shell-route="devices"],[data-shell-route="work"]) :where(.button,.device-row,.work-overview-nav a,.power-card) {
      transition: none;
      transform: none;
    }
  }
}
