/* Roberto Workspace Suite V23 — responsive interaction and system-app fixes */

/* About / introduction dialog: compact on laptop and mobile instead of a fullscreen sheet. */
body .aboutApp,
body .aboutApp[data-hide=false],
body .aboutApp[data-size=mini],
body .aboutApp[data-size=cstm] {
  position: fixed !important;
  inset: auto !important;
  top: 50% !important;
  left: 50% !important;
  width: min(500px, calc(100vw - 36px)) !important;
  height: auto !important;
  max-width: 500px !important;
  max-height: min(720px, calc(100dvh - 32px)) !important;
  transform: translate(-50%, -50%) !important;
  border-radius: 14px !important;
  overflow: hidden !important;
  box-shadow: 0 26px 80px rgba(0, 0, 0, .48) !important;
}
body .aboutApp .windowScreen,
body .aboutApp .restWindow {
  height: auto !important;
  max-height: calc(100dvh - 76px) !important;
  overflow: auto !important;
  border-radius: 0 0 14px 14px !important;
}
body .aboutApp .content {
  padding: clamp(18px, 4vw, 28px) !important;
  font-size: clamp(13px, 2.8vw, 15px) !important;
  line-height: 1.52 !important;
}
body .aboutApp .okbtn {
  padding: 14px 18px !important;
}
body .aboutApp .okbtn button {
  min-height: 42px !important;
}

/* Native workspace: reliable pointer targets and horizontal touch scrolling. */
.robertoNativeHost,
.robertoNativeHost * {
  box-sizing: border-box;
}
.robertoNativeHost button,
.robertoNativeHost label[for],
.robertoNativeHost select,
.robertoNativeHost input[type=range] {
  touch-action: manipulation;
}
.rs-vm-app {
  min-width: 0;
}
.rs-vm {
  min-width: 0;
  overflow: auto !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
  -webkit-overflow-scrolling: touch;
}
.rs-vm::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
.rs-vm::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(128, 153, 183, .58);
  background-clip: padding-box;
}
.rs-vm-sidebar {
  min-width: 238px;
}
.rs-tree button {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
}
.rs-visually-hidden-file {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.rs-file-picker {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin: 6px 0 8px;
  padding: 8px 10px;
  border: 1px solid var(--rs-line);
  border-radius: 8px;
  background: #202b3a;
  color: #f4f8ff;
  font-weight: 650;
  cursor: pointer;
}
.rs-file-picker:hover,
.rs-file-picker:focus-visible,
.rs-visually-hidden-file:focus + .rs-file-picker {
  border-color: #60cdff;
  background: #263750;
  outline: 2px solid rgba(96, 205, 255, .3);
  outline-offset: 1px;
}
.rs-file-name {
  min-height: 36px;
  margin: 0 0 12px;
  padding: 8px 9px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 7px;
  background: rgba(0,0,0,.18);
  color: #aebdd0;
  overflow-wrap: anywhere;
}
.rs-load-boundary {
  margin-top: 10px;
}
.rs-vm-stage {
  min-width: 0;
}
#screen_container {
  width: 100%;
  height: 100%;
  outline: none;
}
#screen_container:focus-visible {
  box-shadow: inset 0 0 0 2px #60cdff;
}

/* Music and media workspace: all visible regions behave as controls. */
.rs-media-app .rs-toolbar .rs-btn.primary {
  min-height: 38px;
}
.rs-library-button {
  min-height: 42px;
  display: flex !important;
  align-items: center;
  justify-content: space-between !important;
  width: 100%;
  margin: 4px 0;
}
.rs-library-button small {
  opacity: .65;
}
.rs-library-button.active,
.rs-library-button:hover {
  background: #2a3850 !important;
  border-color: #536a8a !important;
}
.rs-album-button {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.rs-album-button:focus-visible {
  outline: 2px solid #b26cff;
  outline-offset: 5px;
  border-radius: 12px;
}
.rs-art {
  display: grid;
  place-items: center;
}
.rs-art span {
  font-size: 44px;
  color: rgba(255,255,255,.88);
  text-shadow: 0 6px 18px rgba(0,0,0,.3);
}
.rs-wave {
  cursor: pointer;
}
.rs-wave:hover {
  border-color: #8461b7;
}
.rs-track-button,
.rs-queue-item,
.rs-video-bin-item,
.rs-chip {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--rs-line);
  border-radius: 8px;
  background: #202b3a;
  color: #eef4ff;
  cursor: pointer;
}
.rs-track-button {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 8px;
  text-align: left;
}
.rs-track-button b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rs-queue-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 10px;
  text-align: left;
}
.rs-queue-item span {
  color: #98aac0;
  font-size: 11px;
}
.rs-chip {
  min-height: 36px;
  padding: 7px 8px;
}
.rs-chip.active,
.rs-chip:hover,
.rs-track-button:hover,
.rs-queue-item:hover,
.rs-video-bin-item:hover {
  border-color: #b26cff;
  background: #302844;
}
.rs-media-tools {
  margin-top: 14px;
}
.rs-eq input {
  cursor: ns-resize;
}
.rs-timeline-actions {
  display: flex;
  gap: 8px;
}
.rs-video-preview,
.rs-clip {
  cursor: pointer;
}
.rs-audio-clip {
  background: linear-gradient(90deg,#1f7c66,#39b388) !important;
}

/* Start menu and search results: clean, wrapping-safe Recommended layout. */
.recApps {
  min-height: 0 !important;
  overflow: auto !important;
  overscroll-behavior: contain;
}
.reApps {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 7px 12px !important;
  padding: 2px 2px 8px !important;
}
.reApps .rnApp {
  width: auto !important;
  min-width: 0 !important;
  min-height: 58px !important;
  margin: 0 !important;
  padding: 7px 9px !important;
  display: grid !important;
  grid-template-columns: 38px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 9px !important;
  border: 1px solid transparent;
  border-radius: 8px;
}
.reApps .rnApp:hover,
.reApps .rnApp:focus-visible {
  border-color: rgba(255,255,255,.12);
  background: rgba(255,255,255,.075) !important;
}
.reApps .rnApp .pnIcon {
  width: 34px !important;
  height: 34px !important;
  margin: 0 !important;
}
.reApps .rnApp .acInfo {
  min-width: 0;
}
.reApps .rnApp .appName,
.reApps .rnApp .timeUsed {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reApps .rnApp .appName {
  font-size: 12px !important;
  line-height: 1.25 !important;
}
.reApps .rnApp .timeUsed {
  margin-top: 3px;
  color: rgba(255,255,255,.58);
  font-size: 10px;
}
.topApps {
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scrollbar-width: thin;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
}
.topApp {
  min-width: 132px !important;
}
.topApp .text-xs {
  max-width: 116px;
  overflow-wrap: anywhere;
}

/* File Explorer Desktop folder mirrors the real desktop shortcuts. */
.roberto-explorer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  align-content: start;
  gap: 5px;
  width: 100%;
  padding: 7px;
}
.roberto-explorer-app {
  min-width: 0;
  min-height: 62px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: default;
}
.roberto-explorer-app:hover,
.roberto-explorer-app.selected,
.roberto-explorer-app:focus-visible {
  border-color: rgba(92, 168, 255, .45);
  background: rgba(0, 103, 192, .16);
  outline: none;
}
.roberto-explorer-app img {
  grid-row: 1 / 3;
  width: 38px;
  height: 38px;
  object-fit: contain;
}
.roberto-explorer-app span,
.roberto-explorer-app small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.roberto-explorer-app span {
  font-size: 12px;
  font-weight: 600;
}
.roberto-explorer-app small {
  color: rgba(150, 165, 185, .88);
  font-size: 10px;
}

/* Recycle Bin: File Explorer-style details view instead of oversized cards. */
.recyclebin.recycleSolidWindow {
  --recycle-surface: #f5f6f8 !important;
  --recycle-surface-2: #ffffff !important;
  --recycle-border: rgba(15, 23, 42, .13) !important;
  --recycle-text: #202124 !important;
  --recycle-muted: #667085 !important;
  --recycle-accent: #0067c0 !important;
  --recycle-accent-soft: rgba(0, 103, 192, .12) !important;
}
body[data-theme=dark] .recyclebin.recycleSolidWindow {
  --recycle-surface: #191919 !important;
  --recycle-surface-2: #202020 !important;
  --recycle-border: rgba(255,255,255,.11) !important;
  --recycle-text: #f3f3f3 !important;
  --recycle-muted: #a9a9a9 !important;
  --recycle-accent: #60cdff !important;
  --recycle-accent-soft: rgba(96,205,255,.12) !important;
}
.recycleCommandBar {
  min-height: 48px !important;
  padding: 6px 10px !important;
  gap: 5px !important;
  background: var(--recycle-surface) !important;
  box-shadow: none !important;
}
.recycleCommandBar button,
.recycleDemoButton {
  min-height: 36px !important;
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
  font-weight: 500 !important;
}
.recycleCommandBar button:hover:not(:disabled),
.recycleCommandBar button:focus-visible:not(:disabled),
.recycleDemoButton:hover,
.recycleDemoButton:focus-visible {
  border-color: var(--recycle-border) !important;
  background: var(--recycle-accent-soft) !important;
  outline: none !important;
}
.recycleBody {
  padding: 0 10px 12px !important;
  background: var(--recycle-surface) !important;
}
.recycleGrid {
  display: block !important;
  width: 100%;
  border: 1px solid var(--recycle-border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--recycle-surface-2);
}
.recycleDetailsHeader,
.recycleItem {
  display: grid !important;
  grid-template-columns: minmax(240px, 1.5fr) minmax(190px, 1fr) minmax(140px, .72fr) minmax(80px, .38fr) !important;
  align-items: center !important;
  column-gap: 12px !important;
}
.recycleDetailsHeader {
  min-width: 720px;
  min-height: 34px;
  padding: 0 12px 0 54px;
  border-bottom: 1px solid var(--recycle-border);
  color: var(--recycle-muted);
  font-size: 11px;
  font-weight: 600;
}
.recycleItem {
  position: relative;
  width: 100% !important;
  min-width: 720px !important;
  min-height: 48px !important;
  padding: 6px 12px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--recycle-border) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  text-align: left !important;
  transform: none !important;
}
.recycleItem:last-child {
  border-bottom: 0 !important;
}
.recycleItem img,
.recycleItem .uicon {
  position: absolute;
  left: 12px;
  width: 30px !important;
  height: 30px !important;
}
.recycleItem strong {
  grid-column: 1;
  padding-left: 42px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 500;
}
.recycleItem > small {
  display: none !important;
}
.recycleOriginal,
.recycleDate,
.recycleSize {
  min-width: 0;
  color: var(--recycle-muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recycleOriginal { grid-column: 2; }
.recycleDate { grid-column: 3; }
.recycleSize { grid-column: 4; text-align: right; }
.recycleItem:hover,
.recycleItem:focus-visible,
.recycleItem[data-selected=true] {
  background: var(--recycle-accent-soft) !important;
  outline: none !important;
}
.recycleEmpty {
  min-height: 100% !important;
  padding: 28px 18px !important;
}
.recycleEmptyIcon {
  width: 108px !important;
  height: 108px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.recycleEmpty h2 {
  margin-top: 2px !important;
  font-size: 19px !important;
  font-weight: 600 !important;
}
.recycleEmpty p {
  font-size: 12px;
}

/* Functional local system-app windows. */
.rsys-window {
  position: fixed;
  top: 9vh;
  left: 50%;
  width: min(1040px, calc(100vw - 46px));
  height: min(720px, calc(100dvh - 104px));
  min-width: 520px;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 12px;
  background: #101722;
  color: #edf4ff;
  box-shadow: 0 28px 90px rgba(0,0,0,.58), 0 0 0 1px rgba(0,0,0,.28);
  transform: translateX(-50%);
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  isolation: isolate;
}
.rsys-window[hidden] { display: none !important; }
.rsys-window[data-active=false] { filter: saturate(.82) brightness(.93); }
.rsys-window[data-maximized=true] {
  inset: 0 0 48px 0 !important;
  width: 100vw !important;
  height: calc(100dvh - 48px) !important;
  min-width: 0 !important;
  min-height: 0 !important;
  border-radius: 0 !important;
  transform: none !important;
}
.rsys-titlebar {
  flex: 0 0 40px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #111823;
  border-bottom: 1px solid rgba(255,255,255,.08);
  user-select: none;
  touch-action: none;
}
.rsys-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 10px;
}
.rsys-title img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}
.rsys-title strong,
.rsys-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rsys-title strong { font-size: 12px; }
.rsys-title span { color: #8fa0b4; font-size: 10px; }
.rsys-controls {
  height: 100%;
  display: flex;
}
.rsys-controls button {
  width: 48px;
  height: 100%;
  border: 0;
  background: transparent;
  color: #dfe9f7;
  font-size: 16px;
  cursor: pointer;
}
.rsys-controls button:hover { background: rgba(255,255,255,.09); }
.rsys-controls button:last-child:hover { background: #c42b1c; }
.rsys-body {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  background: #0d1420;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.rsys-body button,
.rsys-body input,
.rsys-body textarea,
.rsys-body label {
  font: inherit;
}
.rsys-body button,
.rsys-body label[for] {
  min-height: 40px;
  cursor: pointer;
  touch-action: manipulation;
}
.rsys-body input,
.rsys-body textarea {
  border: 1px solid #334157;
  border-radius: 8px;
  background: #111a28;
  color: #f4f8ff;
  outline: none;
}
.rsys-body input:focus,
.rsys-body textarea:focus {
  border-color: #60cdff;
  box-shadow: 0 0 0 2px rgba(96,205,255,.16);
}
.rsys-toast {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 10;
  max-width: calc(100% - 28px);
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  background: #202a38;
  color: #fff;
  box-shadow: 0 14px 40px rgba(0,0,0,.45);
  transform: translateX(-50%);
  font-size: 12px;
}

/* Shared system app building blocks. */
.rsys-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  border-radius: 50%;
  background: linear-gradient(145deg,#0b7bdc,#43b8ef);
  color: #fff;
  font-weight: 700;
}
.rsys-social-layout,
.rsys-teams,
.rsys-sharepoint,
.rsys-todo,
.rsys-yammer,
.rsys-phone {
  min-height: 100%;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 230px;
}
.rsys-rail,
.rsys-teams > nav,
.rsys-sharepoint > aside,
.rsys-todo > aside,
.rsys-yammer > aside,
.rsys-phone > aside {
  padding: 16px 10px;
  border-right: 1px solid rgba(255,255,255,.09);
  background: #111a27;
}
.rsys-rail button,
.rsys-teams > nav button,
.rsys-sharepoint > aside button,
.rsys-todo > aside button,
.rsys-yammer > aside button,
.rsys-phone > aside button {
  width: 100%;
  margin: 3px 0;
  padding: 9px 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #b8c7da;
  text-align: left;
}
.rsys-rail button:hover,
.rsys-rail button.active,
.rsys-teams > nav button:hover,
.rsys-teams > nav button.active,
.rsys-sharepoint > aside button:hover,
.rsys-sharepoint > aside button.active,
.rsys-todo > aside button:hover,
.rsys-todo > aside button.active,
.rsys-yammer > aside button:hover,
.rsys-yammer > aside button.active,
.rsys-phone > aside button:hover,
.rsys-phone > aside button.active {
  background: #22314a;
  color: #fff;
}

/* Twitter */
.rsys-feed {
  min-width: 0;
  border-right: 1px solid rgba(255,255,255,.09);
}
.rsys-feed > header,
.rsys-teams main > header,
.rsys-sharepoint main > header,
.rsys-todo main > header,
.rsys-yammer main > header,
.rsys-phone main > header {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,.09);
}
.rsys-feed h2,
.rsys-teams h2,
.rsys-sharepoint h2,
.rsys-todo h2,
.rsys-yammer h2,
.rsys-phone h2 { margin: 0; font-size: 20px; }
.rsys-feed header span,
.rsys-teams header span,
.rsys-sharepoint header p,
.rsys-todo header span,
.rsys-yammer header p,
.rsys-phone header p { color: #91a3b9; font-size: 11px; }
.rsys-composer,
.rsys-yammer form {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,.09);
}
.rsys-composer textarea,
.rsys-yammer textarea {
  width: 100%;
  min-height: 88px;
  padding: 11px;
  resize: vertical;
}
.rsys-composer > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}
.rsys-composer button,
.rsys-yammer form button,
.rsys-sharepoint main > header button,
.rsys-teams form button,
.rsys-todo form button,
.rsys-phone form button {
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
  background: #0879d8;
  color: #fff;
  font-weight: 650;
}
.rsys-post {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.rsys-post > div:last-child { min-width: 0; flex: 1; }
.rsys-post header { display: flex; gap: 7px; }
.rsys-post header span { color: #8fa0b4; }
.rsys-post p { margin: 7px 0 10px; line-height: 1.45; }
.rsys-post button {
  min-height: 32px;
  border: 0;
  background: transparent;
  color: #8fa0b4;
}
.rsys-sidecard { padding: 16px; }
.rsys-sidecard h3 { margin-top: 0; }
.rsys-sidecard p {
  padding: 10px;
  border-radius: 8px;
  background: #151f2e;
}

/* Xbox */
.rsys-xbox { min-height: 100%; padding: clamp(16px,3vw,28px); background: radial-gradient(circle at 90% 0,#0d7a35 0,transparent 35%),#0c1410; }
.rsys-xbox > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.rsys-xbox > header span { color: #77e09a; font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.rsys-xbox h2 { margin: 6px 0; font-size: clamp(24px,4vw,38px); }
.rsys-xbox p { color: #a9baa9; }
.rsys-gamerscore { padding: 10px 14px; border-radius: 999px; background: rgba(18,151,65,.2); }
.rsys-game-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin: 22px 0; }
.rsys-game-grid button { min-height: 126px; display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid #2d4935; border-radius: 12px; background: rgba(15,31,20,.9); color: #fff; text-align: left; }
.rsys-game-grid button > strong { width: 58px; height: 58px; display: grid; place-items: center; flex: 0 0 58px; border-radius: 14px; background: linear-gradient(145deg,#18a94e,#0d692f); }
.rsys-game-grid button span { display: flex; flex-direction: column; gap: 5px; }
.rsys-game-grid small { color: #91a497; }
.rsys-game-grid button:hover,
.rsys-game-grid button.active { border-color: #64d987; background: #14291b; }
.rsys-playground { position: relative; min-height: 280px; overflow: hidden; padding: 20px; border: 1px solid #2d4935; border-radius: 14px; background: rgba(5,12,8,.8); }
.rsys-playground > button[data-start-game] { padding: 9px 15px; border: 0; border-radius: 8px; background: #107c10; color: #fff; }
.rsys-target { position: absolute; width: 46px; min-height: 46px !important; border: 3px solid #fff; border-radius: 50%; background: #27d45e; box-shadow: 0 0 0 9px rgba(39,212,94,.2); }

/* SharePoint */
.rsys-sharepoint { grid-template-columns: 190px minmax(0,1fr); }
.rsys-sharepoint main { position: relative; min-width: 0; padding-bottom: 14px; }
.rsys-doc-table { margin: 14px; border: 1px solid rgba(255,255,255,.1); border-radius: 8px; overflow: hidden; }
.rsys-doc-table .head,
.rsys-doc-table [data-docs] button { display: grid; grid-template-columns: minmax(200px,1.4fr) minmax(100px,.55fr) minmax(90px,.45fr); gap: 10px; align-items: center; width: 100%; min-height: 44px; padding: 7px 12px; border: 0; border-bottom: 1px solid rgba(255,255,255,.08); background: transparent; color: #e9f1fc; text-align: left; }
.rsys-doc-table .head { background: #172231; color: #93a4b9; font-size: 11px; font-weight: 650; }
.rsys-doc-table [data-docs] button:hover { background: #1a2b42; }
.rsys-editor { position: absolute; inset: 86px 20px 20px; display: flex; flex-direction: column; gap: 9px; padding: 16px; border: 1px solid #39506e; border-radius: 12px; background: #111a27; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.rsys-editor[hidden] { display: none; }
.rsys-editor input { height: 42px; padding: 8px 10px; }
.rsys-editor textarea { flex: 1; min-height: 180px; padding: 12px; resize: none; font-family: ui-monospace,Consolas,monospace; }
.rsys-editor > div { display: flex; justify-content: flex-end; gap: 8px; }
.rsys-editor button { padding: 8px 15px; border: 1px solid #40536b; border-radius: 8px; background: #202c3b; color: #fff; }

/* Teams */
.rsys-teams { grid-template-columns: 190px minmax(0,1fr); }
.rsys-teams main { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.rsys-teams main > header button { min-height: 36px; border: 1px solid #39475d; border-radius: 7px; background: #182334; color: #dfe9f7; }
.rsys-messages { flex: 1; min-height: 0; overflow: auto; padding: 16px; }
.rsys-messages article { display: flex; gap: 10px; margin-bottom: 16px; }
.rsys-messages article header { display: flex; gap: 8px; }
.rsys-messages article header span { color: #8496ad; }
.rsys-messages p { margin: 5px 0; }
.rsys-teams form { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.09); }
.rsys-teams form input { flex: 1; min-width: 0; height: 42px; padding: 8px 11px; }

/* Snipping Tool */
.rsys-snipping { min-height: 100%; display: flex; flex-direction: column; }
.rsys-snipping > header { min-height: 54px; display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-bottom: 1px solid rgba(255,255,255,.09); }
.rsys-snipping header button { padding: 8px 12px; border: 1px solid #39475d; border-radius: 8px; background: #182334; color: #fff; }
.rsys-snipping header button:first-child { background: #0879d8; }
.rsys-snipping header span { margin-left: auto; color: #93a4b9; }
.rsys-canvas-wrap { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; overflow: auto; padding: 18px; background: #0a0d12; }
.rsys-canvas-wrap canvas { max-width: 100%; max-height: 100%; background: #151a22; box-shadow: 0 10px 35px rgba(0,0,0,.45); }
.rsys-empty-canvas { position: absolute; max-width: 380px; padding: 18px; color: #91a3b9; text-align: center; }

/* Tips */
.rsys-tips { min-height: 100%; padding: clamp(18px,4vw,34px); background: linear-gradient(135deg,#0e315e,#111825 55%); }
.rsys-tips > header { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.rsys-tips h2 { font-size: 30px; }
.rsys-tips input { width: min(360px,50vw); height: 42px; padding: 8px 12px; }
.rsys-tips [data-tips] { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.rsys-tips article { display: flex; gap: 12px; padding: 16px; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; background: rgba(12,27,47,.72); }
.rsys-tips article > span { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 42px; border-radius: 12px; background: #0b74de; font-weight: 800; }
.rsys-tips h3 { margin: 0 0 6px; }
.rsys-tips p { margin: 0; color: #aabbd0; line-height: 1.5; }

/* To Do */
.rsys-todo { grid-template-columns: 190px minmax(0,1fr); }
.rsys-todo main { min-width: 0; padding: 0 16px 18px; background: linear-gradient(160deg,#2a195f,#111827 48%); }
.rsys-todo main > header { padding-left: 0; padding-right: 0; }
.rsys-todo form { display: flex; gap: 8px; margin: 16px 0; }
.rsys-todo form input { flex: 1; min-width: 0; height: 44px; padding: 8px 11px; }
.rsys-todo [data-tasks] { display: grid; gap: 7px; }
.rsys-todo [data-tasks] article { min-height: 48px; display: grid; grid-template-columns: 38px minmax(0,1fr) 38px; align-items: center; gap: 8px; padding: 4px 8px; border: 1px solid rgba(255,255,255,.1); border-radius: 8px; background: rgba(17,24,39,.8); }
.rsys-todo [data-tasks] button { min-height: 34px; border: 0; background: transparent; color: #a6c8ff; font-size: 20px; }
.rsys-todo article.done span { color: #8491a3; text-decoration: line-through; }

/* Voice Recorder */
.rsys-recorder { min-height: 100%; display: grid; grid-template-rows: auto minmax(280px,1fr) auto; background: radial-gradient(circle at 50% 35%,#45213f,#10131a 45%); }
.rsys-recorder > header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; }
.rsys-recorder h2 { margin: 0; }
.rsys-recorder header span { color: #c6a8c3; }
.rsys-recorder-main { display: grid; place-items: center; align-content: center; gap: 18px; }
.rsys-wave-bars { height: 100px; display: flex; align-items: center; gap: 4px; }
.rsys-wave-bars i { width: 4px; height: calc(12px + (var(--i) % 7) * 9px); border-radius: 999px; background: #e56cc8; animation: rsysWave 1.1s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -35ms); }
.rsys-record-time { font-size: 34px; font-variant-numeric: tabular-nums; }
.rsys-record-button { width: 74px; min-height: 74px !important; border: 8px solid rgba(255,255,255,.12); border-radius: 50%; background: #dc3c64; color: #fff; font-size: 26px; }
.rsys-record-button.recording { background: #f3f3f3; color: #dc3c64; }
.rsys-recorder > section { max-height: 210px; overflow: auto; padding: 12px 18px 18px; border-top: 1px solid rgba(255,255,255,.09); }
.rsys-recorder section h3 { margin-top: 0; }
.rsys-recorder section article { display: grid; grid-template-columns: minmax(140px,.6fr) minmax(220px,1fr) auto; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.rsys-recorder section article div { display: flex; flex-direction: column; }
.rsys-recorder section audio { width: 100%; }
.rsys-recorder section a { color: #80c9ff; }
@keyframes rsysWave { to { transform: scaleY(.32); opacity: .45; } }

/* Yammer */
.rsys-yammer { grid-template-columns: 210px minmax(0,1fr); }
.rsys-yammer main { min-width: 0; }
.rsys-yammer form { display: flex; gap: 8px; }
.rsys-yammer form textarea { flex: 1; min-height: 72px; }
.rsys-yammer [data-yammer-feed] { padding: 14px; }
.rsys-yammer [data-yammer-feed] article { margin-bottom: 10px; padding: 14px; border: 1px solid rgba(255,255,255,.1); border-radius: 10px; background: #141e2c; }
.rsys-yammer article header { display: flex; gap: 10px; }
.rsys-yammer article header > div:last-child { display: flex; flex-direction: column; }
.rsys-yammer article header span { color: #8ea0b6; }
.rsys-yammer article p { line-height: 1.5; }
.rsys-yammer article button { min-height: 34px; border: 0; background: transparent; color: #7dc7ff; }

/* Your Phone */
.rsys-phone { grid-template-columns: 210px minmax(0,1fr); }
.rsys-phone > aside { display: flex; flex-direction: column; }
.rsys-phone-device { width: 72px; height: 120px; display: grid; place-items: center; margin: 4px auto 10px; border: 5px solid #57657a; border-radius: 18px; background: linear-gradient(#0b6bb5,#102137); font-size: 34px; }
.rsys-phone > aside h3,
.rsys-phone > aside > span { text-align: center; }
.rsys-phone > aside > span { margin-bottom: 15px; color: #8fa0b4; }
.rsys-phone main { min-width: 0; padding-bottom: 18px; }
.rsys-phone main > header label { min-height: 40px; display: grid; place-items: center; padding: 8px 14px; border-radius: 8px; background: #0879d8; color: #fff; }
.rsys-phone-cards { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; padding: 14px; }
.rsys-phone-cards article { padding: 14px; border: 1px solid rgba(255,255,255,.1); border-radius: 10px; background: #151f2e; }
.rsys-phone-cards button { padding: 7px 10px; border: 1px solid #3a4b62; border-radius: 8px; background: #202d3e; color: #fff; }
.rsys-phone form { display: flex; gap: 7px; }
.rsys-phone form input { min-width: 0; flex: 1; padding: 8px 10px; }
.rsys-phone [data-phone-notes] p { margin: 7px 0; padding: 7px 9px; border-radius: 8px; background: #203048; }
.rsys-phone main > section:last-child { padding: 0 14px; }
.rsys-photo-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(120px,1fr)); gap: 8px; }
.rsys-photo-grid figure { min-width: 0; margin: 0; overflow: hidden; border: 1px solid rgba(255,255,255,.1); border-radius: 9px; background: #111927; }
.rsys-photo-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.rsys-photo-grid figcaption { padding: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }

@media (max-width: 760px) {
  body .aboutApp,
  body .aboutApp[data-hide=false] {
    width: min(440px, calc(100vw - 20px)) !important;
    max-height: calc(100dvh - 20px) !important;
    border-radius: 12px !important;
  }
  body .aboutApp .content {
    padding: 16px !important;
    font-size: 13px !important;
  }
  body .aboutApp .okbtn {
    padding: 11px 14px !important;
  }

  .rs-vm {
    display: flex !important;
    grid-template-columns: none !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x proximity;
    touch-action: pan-x pan-y;
  }
  .rs-vm-sidebar {
    display: block !important;
    flex: 0 0 min(82vw, 280px);
    min-width: min(82vw, 280px);
    overflow-y: auto;
    scroll-snap-align: start;
  }
  .rs-vm-stage {
    flex: 0 0 max(620px, calc(100vw - 24px));
    min-width: max(620px, calc(100vw - 24px));
    scroll-snap-align: start;
  }
  .rs-vm-serial {
    min-width: 600px;
  }
  .rs-toolbar {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }
  .rs-toolbar::-webkit-scrollbar { display: none; }
  .rs-toolbar > * { flex: 0 0 auto; }
  .rs-toolbar .rs-spacer { flex: 1 0 18px; }

  .rs-music-grid {
    display: grid !important;
    grid-template-columns: minmax(150px, 42vw) minmax(520px, 1fr) minmax(180px, 240px) !important;
    min-width: 860px;
    overflow: visible;
  }
  .rs-media {
    overflow-x: auto;
    overflow-y: hidden;
    touch-action: pan-x pan-y;
    overscroll-behavior: contain;
  }
  .rs-library,
  .rs-queue {
    display: block !important;
  }
  .rs-video-grid {
    min-width: 820px;
  }

  .reApps {
    grid-template-columns: 1fr !important;
  }
  .reApps .rnApp {
    min-height: 54px !important;
  }
  .topApps {
    display: flex !important;
    gap: 7px !important;
  }
  .topApp {
    flex: 0 0 132px !important;
    width: 132px !important;
  }

  .roberto-explorer-grid {
    grid-template-columns: 1fr;
    padding: 5px;
  }
  .roberto-explorer-app {
    min-height: 58px;
  }

  .recycleBody {
    overflow-x: auto !important;
  }
  .recycleGrid {
    min-width: 720px;
  }

  .rsys-window,
  .rsys-window[data-maximized=true] {
    inset: 0 0 48px 0 !important;
    width: 100vw !important;
    height: calc(100dvh - 48px) !important;
    min-width: 0 !important;
    min-height: 0 !important;
    border-radius: 0 !important;
    transform: none !important;
  }
  .rsys-titlebar { flex-basis: 46px; min-height: 46px; }
  .rsys-title span { display: none; }
  .rsys-controls button { width: 44px; }
  .rsys-social-layout,
  .rsys-teams,
  .rsys-sharepoint,
  .rsys-todo,
  .rsys-yammer,
  .rsys-phone {
    grid-template-columns: 1fr !important;
  }
  .rsys-rail,
  .rsys-teams > nav,
  .rsys-sharepoint > aside,
  .rsys-todo > aside,
  .rsys-yammer > aside,
  .rsys-phone > aside,
  .rsys-sidecard {
    display: none !important;
  }
  .rsys-feed { border-right: 0; }
  .rsys-game-grid,
  .rsys-tips [data-tips],
  .rsys-phone-cards {
    grid-template-columns: 1fr !important;
  }
  .rsys-game-grid button { min-height: 96px; }
  .rsys-xbox > header { flex-direction: column; }
  .rsys-tips > header { align-items: stretch; flex-direction: column; }
  .rsys-tips input { width: 100%; }
  .rsys-doc-table { overflow-x: auto; }
  .rsys-doc-table .head,
  .rsys-doc-table [data-docs] button { min-width: 600px; }
  .rsys-recorder section article { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  body .aboutApp,
  body .aboutApp[data-hide=false] {
    width: calc(100vw - 12px) !important;
    max-height: calc(100dvh - 12px) !important;
  }
  .reApps .rnApp .timeUsed { display: none; }
  .reApps .rnApp { min-height: 48px !important; }
  .rsys-title strong { max-width: calc(100vw - 150px); }
  .rsys-controls button:first-child { display: none; }
  .rsys-post { padding: 12px 10px; }
  .rsys-composer { padding: 10px; }
  .rsys-snipping > header { overflow-x: auto; }
  .rsys-snipping header > * { flex: 0 0 auto; }
}

@media (prefers-reduced-motion: reduce) {
  .rsys-wave-bars i { animation: none !important; }
}

/* V23 Start refinements: pinned and recommended sections stay compact and readable. */
.startMenu .menuUp {
  height: calc(100% - 64px) !important;
  padding: 24px 28px 16px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain;
}
.startMenu .pinnedApps {
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
}
.startMenu .pnApps {
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  align-items: start !important;
  gap: 10px 6px !important;
  padding: 12px 0 18px !important;
  overflow: visible !important;
}
.startMenu .pnApp {
  width: auto !important;
  min-width: 0 !important;
  height: 76px !important;
  min-height: 76px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 6px !important;
  padding: 6px 3px !important;
  border: 1px solid transparent;
  border-radius: 8px;
}
.startMenu .pnApp:hover,
.startMenu .pnApp:focus-visible {
  border-color: rgba(255,255,255,.12);
  background: rgba(255,255,255,.075) !important;
  outline: none;
}
.startMenu .pnApp .pnIcon {
  flex: 0 0 32px !important;
  width: 32px !important;
  height: 32px !important;
  margin: 0 !important;
}
.startMenu .pnApp .appName {
  width: 100% !important;
  min-width: 0 !important;
  max-height: 30px;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  text-align: center;
  overflow-wrap: anywhere;
  font-size: 10.5px !important;
  line-height: 1.28 !important;
}
.startMenu .recApps {
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
}
.startMenu .reApps {
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 10px 0 4px !important;
  align-content: start !important;
  justify-content: stretch !important;
  grid-auto-rows: minmax(56px, auto) !important;
}
.startMenu .reApps .rnApp {
  height: auto !important;
  min-height: 56px !important;
  align-self: stretch !important;
}

@media (max-width: 760px) {
  .startMenu .menuUp {
    padding: 18px 18px 14px !important;
  }
  .startMenu .pnApps {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 8px 4px !important;
  }
  .startMenu .pnApp {
    height: 72px !important;
    min-height: 72px !important;
  }
}

@media (max-width: 420px) {
  .startMenu .menuUp {
    padding: 15px 12px 12px !important;
  }
  .startMenu .pnApps {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
  .startMenu .pnApp .appName {
    font-size: 10px !important;
  }
}

/* Keep Recommended in normal document flow; the upstream menu positions it absolutely. */
.startMenu .recApps {
  position: static !important;
  inset: auto !important;
  top: auto !important;
  left: auto !important;
}
.startMenu .pnApp,
.startMenu .reApps .rnApp {
  box-sizing: border-box !important;
}
.startMenu .pnApp .appName {
  white-space: normal !important;
  text-overflow: clip !important;
}
