.desktop-screen { --taskbar-height: 36px; height: 100dvh; min-height: 0; overflow: hidden; color-scheme: light; }
.desktop-screen :is(input, textarea, [contenteditable]:not([contenteditable="false"]), [data-copyable]) {
  -webkit-user-select: text;
  user-select: text;
}
/* Blend only within the wallpaper, never over windows, icons or the taskbar.
   Match Berry's texture: a clear row followed by an opaque #161616 row.
   Generate at display size so Fit/Fill does not resize a baked-in pattern. */
.wallpaper-surface { position: relative; isolation: isolate; background-color: inherit; }
.wallpaper-surface::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(to bottom, transparent 0 1px, #161616 1px 2px);
  mix-blend-mode: luminosity;
  opacity: 1;
  pointer-events: none;
}
.desktop-background { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.desktop-wallpaper { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.desktop-wordmark { pointer-events: none; }
.desktop-icons { position: absolute; top: 14px; left: 8px; display: grid; gap: 12px; width: 84px; }
.desktop-icon { display: grid; justify-items: center; gap: 5px; padding: 7px 2px; color: white; border: 1px solid transparent; background: transparent; font: 12px/1.25 Arial, sans-serif; text-shadow: 1px 1px #222; }
.desktop-icon:hover, .desktop-icon:focus { background: #00008055; border: 1px dotted #fff; }
.app-icon { flex-shrink: 0; shape-rendering: crispEdges; pointer-events: none; }
img.app-icon { object-fit: contain; }
.window-layer { position: absolute; inset: 0 0 var(--taskbar-height); pointer-events: none; }
.window { position: absolute; display: flex; flex-direction: column; padding: 3px; background: #c0c0c0; color: #111; border: 1px solid; border-color: #dfdfdf #000 #000 #dfdfdf; box-shadow: inset -1px -1px #808080, inset 1px 1px #fff; pointer-events: auto; outline: none; font: 13px Arial, sans-serif; }
.titlebar { display: flex; align-items: center; gap: 4px; height: 30px; min-height: 30px; background: #292929; color: #c5c5c5; padding: 3px; touch-action: none; user-select: none; }
.window.active > .titlebar { background: #000; color: white; }
.window-title { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: bold; font-size: 12px; }
.title-icon { display: flex; align-items: center; justify-content: center; border: 0; padding: 0; width: 22px; height: 24px; background: transparent; }
.title-controls { display: flex; gap: 3px; }
.title-button, .classic-button { background: #c0c0c0; color: #111; border: 2px solid; border-color: #fff #404040 #404040 #fff; font: 13px Arial, sans-serif; }
.title-button { width: 25px; height: 23px; padding: 0; position: relative; }
.title-button:active, .classic-button:active { border-color: #404040 #fff #fff #404040; }
.title-button i { display: block; position: absolute; pointer-events: none; }
.title-button.minimize i { width: 9px; height: 3px; background: #111; bottom: 4px; left: 5px; }
.title-button.maximize i { width: 12px; height: 11px; border: 1px solid; border-top-width: 3px; left: 4px; top: 3px; }
.window.maximized .title-button.maximize i { width: 10px; height: 9px; box-shadow: 2px -2px #c0c0c0, 3px -3px #111; left: 3px; top: 5px; }
.title-button.close i::before, .title-button.close i::after { content: ""; position: absolute; width: 13px; height: 2px; top: 9px; left: 4px; background: #111; transform: rotate(45deg); }
.title-button.close i { inset: 0; }
.title-button.close i::after { transform: rotate(-45deg); }
.window-body { flex: 1; min-height: 0; overflow: auto; }
.classic-button { min-height: 31px; padding: 5px 13px; }
.classic-button:disabled { color: #666; }
.properties-app label { display: block; margin-bottom: 6px; }
.properties-app input, .properties-app textarea, .properties-app select { font: 14px Arial, sans-serif; color: #111; background: white; border: 2px solid; border-color: #555 #fff #fff #555; border-radius: 0; }
.properties-app select { width: 100%; min-height: 34px; padding: 4px; }
.resize-handle { position: absolute; touch-action: none; }
.resize-n, .resize-s { left: 4px; right: 4px; height: 5px; cursor: ns-resize; }
.resize-n { top: -1px; } .resize-s { bottom: -1px; }
.resize-e, .resize-w { top: 4px; bottom: 4px; width: 5px; cursor: ew-resize; }
.resize-e { right: -1px; } .resize-w { left: -1px; }
.resize-ne, .resize-nw, .resize-se, .resize-sw { width: 9px; height: 9px; }
.resize-ne { right: -1px; top: -1px; cursor: nesw-resize; }
.resize-nw { left: -1px; top: -1px; cursor: nwse-resize; }
.resize-se { right: -1px; bottom: -1px; cursor: nwse-resize; }
.resize-sw { left: -1px; bottom: -1px; cursor: nesw-resize; }
/* The builder reserves its status bar's final column for this actual resize handle. */
.window[data-app-id="brainrot"] > .resize-se { width: 26px; height: 26px; }
.window[data-app-id="brainrot"] > .resize-se::before {
  content: "";
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 13px;
  height: 13px;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 13 13' fill='none' shape-rendering='crispEdges'%3E%3Cpath d='M1 12L12 1M5 12L12 5M9 12L12 9' stroke='%23808080'/%3E%3Cpath d='M2 12L12 2M6 12L12 6M10 12L12 10' stroke='%23fff'/%3E%3C/svg%3E") no-repeat;
}
.window.maximized .resize-handle { display: none; }
.window[data-app-id="brainrot"].maximized .win95-statusbar { grid-template-columns: minmax(80px, auto) 1fr; }
.window-dragging { user-select: none; }
.modal-scrim { position: absolute; inset: 0; pointer-events: auto; }
.taskbar { height: var(--taskbar-height); gap: 7px; z-index: 100000; }
.taskbar-space { display: flex; gap: 5px; min-width: 0; overflow-x: auto; height: 100%; }
.taskbar-presence { flex: 0 0 10px; height: 10px; margin-inline: 7px 6px; border: 1px solid #168b41; border-radius: 50%; background: #26ce65; }
.task-button { display: flex; align-items: center; gap: 5px; flex: 0 1 190px; min-width: 100px; padding: 3px 8px; border: 2px solid; border-color: #fff #404040 #404040 #fff; background: #c0c0c0; color: #111; font: 12px Arial, sans-serif; text-align: left; }
.task-button span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.task-button.active { border-color: #404040 #fff #fff #404040; background: #ddd; font-weight: bold; }
/* Berry's menu: red-to-black rail, gray panels and navy selection. */
.start-menu { position: absolute; z-index: 100001; left: 3px; bottom: var(--taskbar-height); width: min(280px, calc(100vw - 6px)); max-height: calc(100dvh - var(--taskbar-height) - 8px); display: flex; padding: 3px; background: #c0c0c0; border: 2px solid; border-color: #fff #404040 #404040 #fff; box-shadow: 2px 2px #0007; }
.start-menu-brand { display: flex; align-items: flex-end; flex: 0 0 34px; padding: 10px 5px; background: linear-gradient(to bottom, #b00038, #790027 42%, #000 88%); color: #fff; font-size: 22px; font-weight: bold; }
.start-menu-brand > span { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; }
.start-menu-actions { flex: 1; min-width: 0; overflow-y: auto; padding: 2px 0; }
.start-menu-actions hr { border: 0; border-top: 1px solid #888; border-bottom: 1px solid white; margin: 4px; }
.start-menu-actions :is(button, a) { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 7px 12px; background: transparent; color: #111; border: 0; text-align: left; white-space: nowrap; font: 15px Tahoma, Arial, sans-serif; }
.start-menu-actions a { text-decoration: none; }
.start-link-placeholder { display: grid; place-items: center; flex: 0 0 22px; width: 22px; height: 22px; border: 1px solid #808080; background: #e0e0e0; color: #444; font: bold 17px Georgia, serif; }
.start-link-icon { flex: 0 0 22px; width: 22px; height: 22px; object-fit: contain; }
.start-menu-label { flex: 1; }
.start-menu-arrow { flex: 0 0 10px; width: 10px; height: 10px; }
.start-menu-actions :is(button, a):hover, .start-menu-actions :is(button, a):focus-visible, .start-menu-actions :is(button, a)[aria-expanded="true"] { color: #fff; background: #000080; }
.start-menu-actions :is(button, a):is(:hover, :focus-visible, [aria-expanded="true"]) .start-menu-arrow { filter: brightness(0) invert(1); }
body[data-phase="desktop"] .start-menu-actions :is(button, a):focus-visible { outline-color: #fff; }
.start-submenu { position: fixed; z-index: 1; min-width: 225px; max-height: calc(100dvh - var(--taskbar-height) - 12px); overflow-y: auto; max-width: calc(100vw - 8px); padding: 2px; border: 2px solid; border-color: #fff #404040 #404040 #fff; box-shadow: 2px 2px #0007; background: #c0c0c0; }
.start-submenu :is(button, a) { min-height: 38px; }
.system-icon, .system-icon image { image-rendering: pixelated; }
@media (max-width: 560px) {
  .start-submenu { position: static; min-width: 0; max-width: none; margin: 0 2px 3px 10px; border: 1px solid; border-color: #808080 #fff #fff #808080; box-shadow: none; }
  .start-submenu :is(button, a) { min-height: 44px; white-space: normal; gap: 8px; }
}

.context-menu { position: fixed; z-index: 100002; min-width: 170px; max-width: calc(100vw - 8px); padding: 3px; background: #c0c0c0; border: 2px solid; border-color: white #444 #444 white; box-shadow: 2px 2px #0005; }
.context-menu button { display: block; width: 100%; min-height: 32px; padding: 6px 18px; border: 0; background: transparent; color: #111; text-align: left; font: 13px Arial, sans-serif; }
.context-menu button:hover:not(:disabled), .context-menu button:focus { background: #000080; color: white; }
.context-menu button:disabled { color: #666; }
.context-menu hr { margin: 3px; border: 0; border-top: 1px solid #888; }
.properties-content h1 { font-size: 17px; line-height: 20px; margin: 0 0 10px; }
.messenger-app { display: grid; grid-template-rows: 52px minmax(0, 1fr) auto; overflow: hidden; background: #f9fafc; }
.messenger-header { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: linear-gradient(#e6eefb,#bfcee5); border-bottom: 1px solid #92a2b9; }
.messenger-avatar { position: relative; flex: 0 0 34px; width: 34px; height: 34px; padding: 1px; overflow: hidden; border-radius: 6px; background: inherit; }
.messenger-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.messenger-header h1 { margin: 0; font-size: 15px; color: #253e69; }
.contact-heading { position: sticky; top: 0; z-index: 1; height: 28px; margin: 0; background: #f9fafc; }
.contact-toggle { display: flex; align-items: center; gap: 4px; width: 100%; height: 100%; padding: 0 8px; border: 0; background: transparent; color: #3c4d64; text-align: left; font: 11px Tahoma, Arial, sans-serif; cursor: pointer; }
.contact-toggle::before { content: ''; width: 0; height: 0; border-top: 4px solid transparent; border-bottom: 4px solid transparent; border-left: 6px solid currentColor; margin-right: 2px; }
.contact-toggle[aria-expanded="true"]::before { transform: rotate(90deg); }
.contact-toggle:focus-visible { outline: 1px dotted #3c4d64; outline-offset: -3px; }
.contact-scroll { display: flex; min-height: 0; overflow: hidden; }
.window.maximized .contact-scroll .classic-scrollbar:has([aria-disabled="true"]) { display: none; }
.contact-viewport { flex: 1; min-width: 0; overflow-y: auto; overscroll-behavior: contain; scroll-padding-top: 28px; }
.contact-row { display: flex; align-items: center; gap: 7px; height: 48px; padding: 3px 6px; margin: 0; color: #111; text-decoration: none; border: 1px solid transparent; }
.contact-row:hover, .contact-row:focus { color: white; background: #000080; border-color: #000080; outline: none; }
.contact-row:focus-visible { outline: 1px dotted white; outline-offset: -3px; }
.contact-light { flex: 0 0 10px; height: 10px; border-radius: 50%; background: #26ce65; border: 1px solid #168b41; }
.contact-light[data-status="offline"] { background: #e4bd45; border-color: #9b7c24; }
.contact-light[data-status="unknown"] { background: #aaa; border-color: #666; }
.contact-picture-frame { position: relative; flex: 0 0 30px; width: 30px; height: 30px; padding: 1px; overflow: hidden; border-radius: 5px; background: #edf2fc; }
/* Paint fractional frame widths without native borders snapping to whole pixels. */
.messenger-avatar::after, .contact-picture-frame::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1.25px #d1d5db; pointer-events: none; }
.contact-picture { display: block; width: 100%; height: 100%; object-fit: cover; }
.contact-picture-frame:has(.contact-picture-discord) { background: linear-gradient(#c6a8be, #967e9b); }
.contact-picture-youtube { background-color: #f00; }
.contact-picture-clips { background-color: #fff; transform: translateY(-1.45px) scale(1.18); }
.contact-text { flex: 1; min-width: 0; }
.contact-title { display: block; font-size: 12px; font-weight: bold; line-height: 16px; }
.contact-subtitle { display: block; color: #666; font-size: 10px; line-height: 13px; overflow-wrap: anywhere; }
.contact-subtitle-ending { white-space: nowrap; }
.contact-row:hover .contact-subtitle, .contact-row:focus .contact-subtitle { color: #f4e7ac; }
.contact-emoji { display: inline-block; width: 1.2em; height: 1.2em; object-fit: contain; vertical-align: middle; margin-inline-start: 2px; }
.contact-external { flex: 0 0 8px; width: 8px; height: 8px; vertical-align: middle; }
.contact-row:hover .contact-external, .contact-row:focus .contact-external { filter: brightness(0) invert(1); }
.socials-status-issue { max-height: 180px; overflow: auto; border-top: 1px solid #aaa; padding: 5px 7px; background: #fff5da; font-size: 11px; }
.socials-status-issue summary { cursor: pointer; }
.socials-status-issue p { margin: 6px 0; }
.socials-status-issue pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 10px; }
.socials-status-issue .classic-button { padding: 2px 6px; min-height: 25px; font-size: 11px; }
/* Reusable classic controls around native scroll content; wheel/touch stay native. */
.classic-scroll-viewport { scrollbar-width: none; }
.classic-scroll-viewport::-webkit-scrollbar { display: none; }
.classic-scrollbar { flex: 0 0 16px; display: flex; flex-direction: column; width: 16px; background: #c0c0c0; user-select: none; }
.scroll-arrow, .scroll-thumb { border: 1px solid; border-color: #fff #404040 #404040 #fff; box-shadow: inset -1px -1px #808080; background: #c0c0c0; }
.scroll-arrow { flex: 0 0 16px; width: 16px; height: 16px; display: grid; place-items: center; padding: 0; border-radius: 0; touch-action: none; }
.scroll-arrow::before { content: ''; border: 4px solid transparent; }
.scroll-up::before { border-bottom-color: #111; margin-top: -4px; }
.scroll-down::before { border-top-color: #111; margin-top: 4px; }
.scroll-arrow:disabled { opacity: .55; }
.scroll-arrow:active:not(:disabled) { border-color: #404040 #fff #fff #404040; box-shadow: none; }
.scroll-track { position: relative; flex: 1; min-height: 0; background: repeating-conic-gradient(#ddd 0 25%, #c0c0c0 0 50%) 0 0 / 2px 2px; touch-action: none; }
.scroll-thumb { position: absolute; top: 0; left: 0; width: 100%; min-height: 0; touch-action: none; }
.scroll-thumb:focus-visible { outline: 1px dotted #111; outline-offset: -3px; }
.properties-app { display: grid; grid-template-rows: minmax(0, 1fr) auto; overflow: hidden; }
.properties-content { min-height: 0; overflow: auto; padding: 14px 14px 8px; }
.properties-content label { margin-top: 10px; margin-bottom: 4px; line-height: 16px; }
.wallpaper-preview { height: 112px; border: 4px solid #777; box-shadow: 1px 1px white; display: grid; place-items: center; overflow: hidden; }
.wallpaper-preview img { width: 100%; height: 100%; min-height: 0; object-fit: cover; }
.wallpaper-preview span { position: relative; z-index: 1; color: #ccc; font-size: 11px; }
.properties-app #wallpaper-url { width: 100%; min-height: 34px; padding: 5px; }
.properties-app #wallpaper-url[aria-invalid="true"] { outline: 1px solid #a31935; }
#wallpaper-url-help { font-size: 11px; line-height: 1.4; margin: 5px 0 0; }
.wallpaper-credit, .wallpaper-status { font-size: 11px; line-height: 1.4; margin: 8px 0 0; }
.wallpaper-credit:empty { display: none; }
.properties-footer { padding: 0 14px 12px; }
.wallpaper-status { min-height: 16px; margin: 0 0 8px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
@media (max-width: 699px) {
  .desktop-screen { --taskbar-height: 44px; }
  .taskbar { gap: 4px; padding-inline: 4px; }
  .taskbar-divider { display: none; }
  .desktop-clock { min-width: 54px; padding: 0 2px; font-size: 10px; }
  .mute-button { width: 32px; }
  .start-button { padding-inline: 6px; font-size: 13px; }
  .task-button { min-width: 86px; padding: 3px 5px; flex-basis: 110px; }
  .titlebar { height: 36px; min-height: 36px; }
  .title-button { width: 32px; height: 27px; }
  .title-button.close i::before, .title-button.close i::after { top: 11px; left: 7px; }
  .title-button.maximize i { top: 6px; left: 7px; }
  /* Match the restore rule's specificity; include its upper-right rear window. */
  .window.maximized .title-button.maximize i { top: 8px; left: 7px; }
  .title-button.minimize i { left: 8px; bottom: 5px; }
  .classic-scrollbar { flex-basis: 20px; width: 20px; }
  .scroll-arrow { width: 20px; flex-basis: 20px; height: 20px; }
  .classic-button { min-height: 36px; }
}

/* Imported Brainrot CSS is scoped; only these rules connect it to the shell. */
.brainrot-container { container: brainrot / inline-size; position: relative; overflow: hidden; }
.brainrot-container .brainrot-surface { position: relative; height: 100%; min-height: 0; padding: 0; margin: 0; background: #c0c0c0; color: #000; font: 15px/1.6 Tahoma, Arial, sans-serif; }
.brainrot-scroll { height: 100%; overflow: auto; overscroll-behavior: contain; }
.brainrot-scroll > div { margin-bottom: 0; max-width: none; }
.brainrot-scroll > div > .win95-window { border: 0; box-shadow: none; }
.brainrot-portal { position: absolute; inset: 0; pointer-events: none; z-index: 10; }
.brainrot-portal > * { pointer-events: auto; }
.brainrot-container .win95-dialog-backdrop { overflow: auto; }

.brainrot-help .brainrot-scroll { overflow: hidden; }
