.lf-workspace .ws-home-grid {
  grid-template-areas: "connect access" "shortcuts access" ". extras";
  grid-template-rows: auto auto auto;
}
.ws-home-primary { grid-area: connect; }
.ws-home-access { grid-area: access; }
.ws-home-shortcuts { grid-area: shortcuts; }
.ws-home-extras { grid-area: extras; }
.ws-stat-copy { min-width: 0; }

.lf-workspace .cab-modal-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "kicker close" "title title";
  gap: 6px 12px;
  margin-bottom: 12px;
}
.cab-modal-head #cabDialogKicker { grid-area: kicker; }
.cab-modal-head #cabDialogTitle { grid-area: title; margin: 0; }
.cab-modal-head #cabDialogClose { grid-area: close; }
.cab-modal-head #cabDialogTitle:focus { outline: none; }
.ws-subscription-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 10px; margin: 0; }
.ws-subscription-meta .ws-muted { margin: 0; }
.ws-subscription-state, .ws-device-count {
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--ws-control);
  color: var(--ink);
  font-size: 11px;
  font-weight: 650;
}
.ws-subscription-state[data-active="true"] { background: var(--cabinet-active); color: var(--green); }
.ws-trial-visual .ws-icon { display: none; }

:root[data-theme="light"] .lf-workspace {
  --copy-fill: #d9f3e7;
  --copy-border: #9ed5bf;
  --copy-text: #175541;
}
:root[data-theme="dark"] .lf-workspace {
  --copy-fill: #204639;
  --copy-border: #417963;
  --copy-text: #bcf4d9;
}
:root[data-theme] .cab-site.lf-workspace button[data-copy-confirmed],
:root[data-theme] .cab-site.lf-workspace button[data-copy-confirmed]:hover {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--copy-fill);
  border-color: var(--copy-border);
  color: var(--copy-text);
  box-shadow: inset 0 1px 0 #ffffff32;
  transform: none;
  transition-property: box-shadow;
}
.lf-workspace button .lf-copy-label { font-size: inherit; line-height: inherit; }
.lf-copy-check { display: inline-flex; flex: none; }
.lf-copy-check svg { width: 18px; height: 18px; }
.lf-copy-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
@media (prefers-reduced-motion: no-preference) {
  .lf-workspace button[data-copy-confirmed] { animation: lf-copy-press .24s ease-out; }
  .lf-copy-check { animation: lf-copy-tick .24s ease-out; }
}
@keyframes lf-copy-press {
  0% { transform: scale(.98); }
  100% { transform: scale(1); }
}
@keyframes lf-copy-tick {
  0% { opacity: 0; transform: translateY(3px) scale(.75); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 680px) {
  :root[data-theme="light"] .lf-workspace {
    --mobile-access: linear-gradient(145deg, #f9fbffb8 5%, #e9eaffad 70%, #e3e9ffb8);
    --mobile-tile: #ffffff65;
    --mobile-sheet: linear-gradient(145deg, #f3f6ffd9, #e4e9f9d9);
    --mobile-dock: #eef2f9d9;
    --mobile-current: #efefff;
    --mobile-gift: linear-gradient(130deg, #e9ebffb8, #f5f6ff55 85%);
  }
  :root[data-theme="dark"] .lf-workspace {
    --mobile-access: linear-gradient(145deg, #2b3658ce, #292344ad 78%, #272848dc);
    --mobile-tile: #dbe5ff0b;
    --mobile-sheet: linear-gradient(145deg, #282e48ef, #1b2238ee);
    --mobile-dock: #1e263deb;
    --mobile-current: #35375b;
    --mobile-gift: linear-gradient(135deg, #5555a833, #b3a7ff04 88%);
  }

  .lf-workspace .cab-header { height: 70px; }
  .lf-workspace .cab-header .brand small { display: none; }
  .lf-workspace .cab-header .brand img { width: 32px; height: 32px; }
  .lf-workspace .cab-workspace { padding-top: 4px; }
  .lf-workspace .ws-page-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 10px;
    margin: 8px 0 14px;
  }
  .lf-workspace .ws-page-heading h1 { font-size: clamp(23px, 6.2vw, 30px); line-height: 1.1; }
  .lf-workspace .ws-heading-actions { display: contents; }
  .lf-workspace #cabRefresh {
    grid-column: 2;
    width: 44px;
    min-height: 44px;
    padding: 0;
    justify-content: center;
    gap: 0;
  }
  .lf-workspace #cabRefresh .ws-refresh-label { display: none; }
  .lf-workspace #cabRefresh [aria-hidden] { font-size: 20px; }
  .lf-workspace #wsPageAction:not(:empty) { grid-column: 1 / -1; }
  .lf-workspace #wsPageAction .cab-button {
    width: 100%;
    min-height: 46px;
    justify-content: space-between;
    padding-inline: 15px;
    font-size: 13px;
  }

  .lf-workspace .ws-home-grid {
    grid-template-areas: none;
    grid-template-rows: none;
    gap: 13px;
  }
  .lf-workspace .ws-home-grid > * { grid-area: auto; }
  :root[data-theme] .lf-workspace .ws-home-access {
    padding: 15px;
    background: var(--mobile-access);
  }
  .ws-home-access .ws-section-head { margin-bottom: 12px; gap: 6px; }
  .ws-home-access .ws-section-head .cab-text-button {
    min-height: 36px;
    padding: 4px 0 4px 5px;
    white-space: nowrap;
    font-size: 11px;
  }
  .ws-home-access .ws-stats { gap: 8px; }
  .ws-home-access .ws-stats button {
    align-items: center;
    min-height: 63px;
    padding: 8px;
    border-radius: 16px;
  }
  .ws-home-access .ws-stat-copy { display: flex; flex-direction: column; gap: 2px; font-size: 10.5px; }
  .ws-home-access .ws-stat-copy strong { font-size: 23px; line-height: 1; }
  .ws-home-access .ws-home-list { margin-top: 12px; background: var(--mobile-tile); border-radius: 16px; }
  .ws-home-access .ws-home-list .ws-row { min-height: 56px; padding: 7px 8px; }
  .ws-home-access .ws-home-list .ws-row-copy strong { font-size: 13px; }
  .ws-home-access .ws-home-list .ws-row-copy small { font-size: 11px; }
  .ws-home-access .ws-home-list .ws-row-end small { font-size: 10px; }
  .ws-home-access .ws-home-list .ws-icon { width: 32px; height: 32px; border-radius: 10px; }
  .ws-home-access .ws-home-list .ws-row + .ws-row::before { left: 48px; }

  .lf-workspace .ws-home-grid[data-has-access="true"] .ws-home-primary {
    min-height: 0;
    padding: 12px 14px;
  }
  .ws-home-grid[data-has-access="true"] .ws-home-primary > div {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
  }
  .ws-home-grid[data-has-access="true"] .ws-home-primary h2 { font-size: 15px; letter-spacing: -.025em; }
  .ws-home-grid[data-has-access="true"] .ws-home-primary :is(img,p) { display: none; }
  .ws-home-grid[data-has-access="true"] .ws-home-primary .cab-button {
    flex: none;
    min-height: 44px;
    padding: 8px 12px;
    gap: 8px;
    font-size: 11px;
  }
  .ws-home-shortcuts .ws-shortcut { min-height: 88px; }
  .ws-home-shortcuts .ws-shortcut strong { font-size: 13px; line-height: 1.3; }
  .ws-home-shortcuts .ws-shortcut small { font-size: 11px; line-height: 1.35; }
  .ws-home-extras [data-act="trial"] { background: var(--mobile-gift); }

  :root[data-theme] .lf-workspace #cabNav {
    inset-inline: 12px;
    inset-block-end: calc(9px + env(safe-area-inset-bottom));
    gap: 2px;
    padding: 5px;
    border-radius: 23px;
    background: var(--mobile-dock);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: var(--native-rim), 0 7px 24px -14px #111d4c65;
  }
  .lf-workspace .cab-nav button { min-height: 49px; gap: 4px; border-radius: 17px; font-weight: 600; }
  :root[data-theme] .lf-workspace #cabNav button[aria-current="page"] { background: var(--mobile-current); }

  :root[data-theme] .lf-workspace .cab-modal[open] {
    width: min(500px, calc(100% - 24px));
    max-height: calc(100dvh - env(safe-area-inset-bottom) - env(safe-area-inset-top) - 24px);
    margin: auto auto calc(10px + env(safe-area-inset-bottom));
    padding: 16px;
    border-radius: 24px;
    background: var(--mobile-sheet);
  }
  .lf-workspace .cab-modal::before { display: none; }
  .lf-workspace .cab-modal-head {
    grid-template-areas: "kicker close" "title close";
    gap: 4px 10px;
    align-items: center;
    margin-bottom: 12px;
  }
  .cab-modal-head #cabDialogTitle { font-size: clamp(22px, 6vw, 27px); line-height: 1.12; }
  .cab-modal-head #cabDialogKicker { font-size: 9px; letter-spacing: .1em; }
  .lf-workspace #cabDialogClose { width: 44px; height: 44px; }
  .lf-workspace #cabDialogBody > p:first-child { margin-top: 0; }
  .lf-workspace .cab-modal-scroll { padding-block-end: 3px; }
  .lf-workspace .cab-modal .cab-button { min-height: 47px; font-size: 13px; }
  .lf-workspace .cab-modal .ws-sheet-actions .cab-button { justify-content: space-between; }
  .lf-workspace .cab-modal .ws-sheet-section { margin-top: 14px; padding-top: 12px; }
  .lf-workspace .cab-modal .ws-sheet-section .ws-list { background: var(--mobile-tile); border-radius: 16px; }
  .lf-workspace .cab-modal .cab-field :is(input,select,textarea),
  .lf-workspace .ws-search input { min-height: 47px; font-size: 16px; }
  .lf-workspace #cabDeviceForm > .cab-field { margin-block: 0 12px; }
  .lf-workspace #cabDeviceForm > .cab-button { width: 100%; }
  .ws-trial-visual {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 11px;
    padding: 11px 13px;
    color: var(--accent);
    background: var(--mobile-gift);
    border: 1px solid var(--native-edge);
    border-radius: 17px;
  }
  .ws-trial-visual .ws-icon { display: grid; width: 33px; height: 33px; border-radius: 10px; }
  .ws-trial-visual p { margin: 0; color: var(--ink); font-size: 13px; line-height: 1.45; }
}

@media (max-width: 680px) and (prefers-reduced-transparency: reduce) {
  :root[data-theme] .lf-workspace #cabNav,
  :root[data-theme] .lf-workspace .cab-modal[open] {
    background: var(--native-opaque);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
