.desk-preview {
  --desk-track: 204px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 100dvh;
  background: #f4f6f8;
  color: var(--ink);
}
.desk-review, .desk-review-label, .desk-review .actions, .desk-review .switcher,
.desk-caption-left, .desk-caption-title, .window-lights, .desk-connection-state,
.desk-sidebar a, .desk-drawer-head, .desk-menu-button {
  display: flex;
  align-items: center;
}
.desk-review {
  min-height: 38px;
  padding: 3px 17px;
  gap: 8px;
  justify-content: space-between;
  background: #313c4b;
  color: #f0f3f6;
}
.desk-review-label { gap: 7px; color: #edf1f6; font-size: var(--small-label); font-weight: 570; white-space: nowrap; }
.desk-review-label svg { width: 13px; height: 13px; }
.desk-review .actions { gap: 6px; flex-wrap: nowrap; }
.desk-review .switcher { gap: 1px; padding: 2px; border: 1px solid #536071; border-radius: var(--radius-small); background: #27313f; }
.desk-review .switcher a { min-height: 22px; padding: 3px 8px; color: #dce3ed; border-radius: 3px; font-size: var(--small-label); }
.desk-review .switcher a.current { color: #243042; background: #edf1f6; box-shadow: none; }
.desk-review .switcher a:not(.current):hover, .desk-review .btn.quiet:hover { color: #fff; background: #485566; }
.desk-review .btn.quiet { min-height: 25px; padding: 3px 6px; border: 1px solid transparent; color: #e6ecf4; font-size: var(--small-label); }
.desk-review .btn svg { width: 13px; height: 13px; }

.desk-window {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  background: white;
}
.window-caption {
  display: grid;
  align-items: stretch;
  grid-template-columns: var(--desk-track) minmax(0, 1fr) auto;
  min-height: 52px;
  padding-right: 22px;
  background: #eef1f4;
  border-block: 1px solid #d7dde3;
}
.desk-caption-left { gap: 18px; padding-inline: 18px; }
.window-lights { gap: 6px; }
.window-lights i { width: 11px; height: 11px; flex: none; border: 1px solid #c9605b; border-radius: 50%; background: #ed827b; }
.window-lights i:nth-child(2) { border-color: #cc9c45; background: #edc168; }
.window-lights i:nth-child(3) { border-color: #6ba279; background: #89bc93; }
.desk-shell-brand { width: 56px; height: auto; }
.desk-caption-title { gap: 8px; min-width: 0; padding: 0 19px 0 24px; }
.desk-app-name { color: #28374a; font-weight: 680; font-size: var(--type-subheading); }
.desk-caption-title strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: #425267; font-weight: 550; font-size: var(--type-ui); white-space: nowrap; }
.desk-caption-title > svg { width: 15px; height: 15px; color: #627286; }
.desk-caption-divider { height: 13px; width: 1px; flex: none; margin: 0 2px; background: #c8d0da; }
.desk-connection-state { align-self: center; justify-self: end; gap: 6px; color: var(--da-state,#435369); font-size: var(--type-caption); white-space: nowrap; }
.desk-connection-state i { height: 7px; width: 7px; flex: none; border-radius: 50%; background: var(--da-dot,#687e96); }
.desk-menu-button, .desk-drawer-head, .desk-nav-scrim { display: none; }

.desk-window > .desk-body {
  position: relative;
  display: grid;
  grid-template-columns: var(--desk-track) minmax(0, 1fr);
  height: auto;
  min-height: 0;
}
.desk-sidebar {
  display: flex; flex-direction: column;
  min-width: 0; min-height: 0; padding: 17px 12px 8px;
  background: linear-gradient(155deg, #f2f5f8, #eaf0f5);
  border-right: 1px solid #d4dce4;
}
.desk-sidebar > nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 2px; }
.desk-sidebar-footer { display: flex; flex: none; justify-content: flex-end; margin-top: 10px; padding-top: 7px; border-top: 1px solid #d4dce4; }
.desk-sidebar a.desk-gear {
  width: 34px; height: 34px; min-height: 34px; justify-content: center; padding: 0;
  border: 0; border-radius: var(--control-radius); color: #65788d;
}
.desk-sidebar .desk-gear svg { width: 18px; height: 18px; }
.desk-sidebar .desk-gear[aria-current="page"] { color: #244a76; background: #dce8f4; }
.desk-gear-tip {
  position: absolute; z-index: 2; right: 0; bottom: calc(100% + 5px); pointer-events: none;
  visibility: hidden; padding: 4px 8px; border-radius: var(--radius-small); color: #fff; background: #344054; font-size: var(--small-label); white-space: nowrap;
}
.desk-gear:is(:hover,:focus-visible) .desk-gear-tip { visibility: visible; }
.desk-settings-tabs {
  display: flex; align-items: stretch; gap: 18px; margin: 0 0 18px;
  padding: 0 2px; border-bottom: 1px solid var(--line);
}
.desk-settings-tabs a {
  padding: 8px 3px 10px; color: #56667a; font-size: var(--type-ui); font-weight: 550;
  border-bottom: 2px solid transparent; text-decoration: none; white-space: nowrap;
}
.desk-settings-tabs a:hover { color: #284f7b; }
.desk-settings-tabs a[aria-selected="true"] { color: #214e7f; border-bottom-color: #3e6e9c; font-weight: 650; }
.desk-nav-group + .desk-nav-group { margin-top: 24px; }
.desk-nav-group h2 { margin: 0 10px 5px; color: #5e6f82; font-size: var(--small-label); font-weight: 620; }
.desk-sidebar a {
  position: relative; gap: 9px; min-height: 36px; padding: 7px 11px;
  border: 1px solid transparent; border-radius: var(--control-radius); color: #415167;
  text-decoration: none; font-size: var(--type-ui);
}
.desk-sidebar a + a { margin-top: 2px; }
.desk-sidebar a svg { width: 16px; height: 16px; flex: none; }
.desk-sidebar a:hover { background: #e4ebf2; }
.desk-sidebar a[aria-current="page"] {
  color: #244a76; border-color: #c7d7e8; background: #dce8f4; font-weight: 650;
}
.desk-sidebar nav a[aria-current="page"]::before {
  content: ''; width: 3px; height: 12px; position: absolute; left: -1px;
  border-radius: 0 2px 2px 0; background: #4e759f;
}
.desk-preview :is(button,a,input,select,summary):focus-visible { outline: 2px solid var(--blue-strong); outline-offset: 2px; }
.desk-review :is(button,a):focus-visible { outline-color: var(--blue-strong); }
.desk-viewport { min-width: 0; background: #fbfcfd; }
.desk-viewport > #main { width: 100%; max-width: 1500px; margin: 0 auto; padding: 25px clamp(18px,2.2vw,38px) 34px; }
.desk-viewport h1 { font-size: 26px; letter-spacing: -.03em; }
.desk-viewport h2 { font-size: var(--type-subheading); }
.desk-viewport .page-head { min-height: 0; margin: 0 0 17px; }
.desk-viewport .page-head p { margin-top: 4px; font-size: var(--type-caption); }
.desk-viewport .page-head p:empty { display: none; }
.desk-viewport .panel { border-radius: var(--control-radius); }
.desk-viewport .panel-head { padding: 12px 16px; background: var(--surface-muted); }
.desk-viewport .stats { gap: 0; border: 1px solid var(--line); border-radius: var(--control-radius); background: #f8fafc; }
.desk-viewport .stat { padding: 12px 15px; background: transparent; border: 0; border-radius: 0; }
.desk-viewport .stat + .stat { border-left: 1px solid var(--line); }
.desk-viewport .stat strong { font-size: 28px; }

.desk-storage-panel { margin-bottom: 14px; }
.desk-folder-form { padding: 15px 16px; }
.desk-folder-field { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 12px; align-items: end; max-width: 820px; }
.desk-folder-field > svg { box-sizing: content-box; width: 19px; height: 19px; border-radius: var(--control-radius); padding: 9px; color: #4c6687; background: #eef2f7; }
.desk-folder-field .field { margin: 0; }
.desk-folder-field .btn { min-height: 37px; }
@media (min-width: 701px) {
  .desk-preview { height: 100dvh; min-height: 295px; }
  .desk-viewport { overflow-y: auto; }
}
@media (min-width: 701px) and (max-width: 960px) {
  .desk-preview { --desk-track: 166px; }
  .desk-sidebar { padding-inline: 8px; }
  .desk-viewport .split { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 700px) {
  .desk-review { padding: 3px 8px; min-height: 35px; }
  .desk-review-label { gap: 4px; font-size: 10px; }
  .desk-review .actions { gap: 2px; }
  .desk-review .switcher a { padding: 3px 6px; }
  .window-caption { grid-template-columns: auto minmax(0,1fr) auto; padding-right: 9px; min-height: 45px; }
  .desk-caption-left { padding: 0 0 0 10px; }
  .window-lights { gap: 4px; }
  .window-lights i { height: 8px; width: 8px; }
  .desk-shell-brand { display: none; }
  .desk-caption-title { gap: 5px; padding: 0 7px; }
  .desk-caption-title > svg { display: none; }
  .desk-app-name { font-size: var(--type-ui); }
  .desk-caption-title strong { font-size: var(--type-caption); }
  .desk-connection-state { gap: 4px; font-size: var(--small-label); }
  .desk-window > .desk-body { display: block; }
  .desk-menu-button, .desk-drawer-head button {
    display: grid; place-items: center; width: 31px; height: 31px; flex: none;
    padding: 0; border: 1px solid #cdd6df; border-radius: var(--control-radius); background: #fafbfc; color: #3c5068;
  }
  .desk-menu-button svg, .desk-drawer-head svg { width: 16px; height: 16px; }
  .desk-sidebar { display: none; }
  .desk-body.show-nav .desk-sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 42; display: flex;
    width: min(264px,82vw); max-height: 100dvh; overflow-y: auto;
    padding: 11px 11px 20px; box-shadow: var(--drawer-shadow);
  }
  .desk-drawer-head {
    display: flex; justify-content: space-between; gap: 9px;
    min-height: 39px; padding: 0 3px 8px 9px; margin: 0 0 15px;
    border-bottom: 1px solid #ced7e1; color: #30435a; font-size: var(--type-body);
  }
  .desk-sidebar a { min-height: 40px; }
  .desk-nav-group + .desk-nav-group { margin-top: 16px; }
  .desk-body.show-nav .desk-nav-scrim { display: block; position: fixed; inset: 0; z-index: 41; width: 100%; height: 100%; border: 0; padding: 0; background: #18253466; }
  body:has(.desk-body.show-nav) { overflow: hidden; }
  .desk-viewport > #main { padding: 17px 12px 28px; }
  .desk-viewport .split { grid-template-columns: minmax(0,1fr); }
  .desk-folder-field { grid-template-columns: minmax(0,1fr) auto; gap: 7px; }
  .desk-folder-field > svg { display: none; }
  .desk-viewport .stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .desk-viewport .stat:nth-child(3) { border-left: 0; }
  .desk-viewport .stat:nth-child(n + 3) { border-top: 1px solid var(--line); }
}
