/* Desktop window experiment. Keep the existing type and appearance controls. */
.terminal-page {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 40px 32px;
  background: #17191e;
  isolation: isolate;
}
.terminal-page :is(.terminal-shell, .terminal-system) {
  width: min(1040px, 100%);
  height: min(760px, calc(100svh - 112px));
  min-height: 460px;
  margin: 0;
  padding: 0 32px 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: rgb(15 16 21 / 88%);
  border: 1px solid #ffffff29;
  border-radius: 10px;
  box-shadow: 0 32px 100px #0008, 0 4px 16px #0006, inset 0 0 0 1px #0003;
  overflow: hidden;
}
.window-titlebar { flex-shrink: 0; display: flex; align-items: center; height: 42px; margin: 0 -32px 8px; padding-left: 18px; color: #b9bac1; background: #24252be6; border-bottom: 1px solid #ffffff0d; font: 12px/1 ui-monospace, monospace; }
.window-app-icon { color: var(--terminal-accent); font-size: 16px; margin-right: 14px; }
.window-title { flex: 1; text-align: center; padding-left: 70px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.window-controls { align-self: stretch; display: flex; margin-left: auto; padding-inline: 12px; gap: 4px; }
.window-controls span { display: grid; place-items: center; width: 30px; font: 18px/1 ui-monospace, monospace; color: #a6a7af; }
.terminal-command, .terminal-page .fetch-prompt { font-size: 16px; line-height: 24px; margin: 0; }
.prompt-user { color: var(--terminal-accent); }
.prompt-directory, .fetch-prompt [data-journal-path] { color: #a7c7b7; }
.command-text { color: var(--terminal-text); }
.terminal-page .terminal-header { flex: 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 20px 32px; padding: 8px 0 16px; }
.terminal-page .terminal-logo { width: 200px; height: 228px; }
.terminal-page .terminal-heading.fetch-summary { min-height: 0; padding: 0; justify-content: center; }
.terminal-page .fetch-summary h1 { font-family: var(--simple-font), monospace; font-size: 16px; line-height: 24px; margin-bottom: 8px; padding-bottom: 8px; }
.fetch-details > div { grid-template-columns: 72px minmax(0, 1fr); }
.terminal-page .fetch-prompt { flex-basis: 100%; }
.terminal-page .terminal-workspace { display: flex; flex: 1; min-height: 0; border: 0; padding: 0; }
.terminal-page .journal { width: 100%; min-height: 0; border: 0; padding: 0; }
.terminal-page .journal-columns, .terminal-page .post-select { grid-template-columns: 112px 64px 136px minmax(0, 1fr); gap: 16px; padding: 6px 12px; font-size: 16px; line-height: 24px; }
.terminal-page .journal-columns { min-height: 32px; color: #96949d; border: 0; font-size: 16px; line-height: 20px; letter-spacing: .06em; }
.terminal-page .journal-columns span { text-align: left; }
.terminal-page .journal-columns-scroll { direction: ltr; }
.terminal-page .journal-list { direction: ltr; width: 100%; margin: 0; max-height: none; flex: 1; scrollbar-color: #77758055 transparent; }
.terminal-page .journal-list > li { margin: 0; border: 0; }
.terminal-page .post-select { min-height: 36px; border-radius: 2px; }
.terminal-page .post-select::before { display: none; }
.terminal-page .post-select:is(:hover,:focus-visible,[aria-pressed='true']) { background: color-mix(in srgb, var(--terminal-accent) 16%, transparent); color: var(--terminal-text); }
.terminal-page .post-select:is(:hover,:focus-visible) .post-date { visibility: visible; }
.post-permissions, .post-size, .terminal-page .post-date { color: #aaa5ae; font-size: 16px; }
.terminal-page .post-date { grid-column: 3; grid-row: 1; text-align: left; }
.terminal-page .post-name { grid-column: 4; grid-row: 1; color: var(--terminal-accent); font-size: 16px; line-height: 24px; font-weight: 400; }
.post-size { text-align: right; }
.terminal-page .journal-list::-webkit-scrollbar-track { background: transparent; }
.terminal-page .journal-list::-webkit-scrollbar-thumb { border-radius: 4px; background: #77758055; }
.terminal-page .terminal-copyright { position: fixed; left: 0; right: 0; bottom: 14px; text-align: center; font: 10px/16px ui-monospace, monospace; color: #fff; opacity: .55; margin: 0; pointer-events: none; }
@media (max-width: 760px) {
  .terminal-page { padding: 24px 16px 52px; }
  .terminal-page .terminal-shell { height: calc(100svh - 76px); min-height: 460px; padding-inline: 20px; }
  .window-titlebar { margin-inline: -20px; margin-bottom: 8px; }
  .window-title { padding-left: 0; font-size: 11px; }
  .window-controls { gap: 0; padding-inline: 6px; }
  .window-controls span { width: 24px; }
  .terminal-page .terminal-logo { width: 100px; height: 114px; }
  .terminal-page .terminal-header { gap: 20px; }
  .terminal-page .journal-columns, .terminal-page .post-select { grid-template-columns: 64px 136px minmax(0,1fr); gap: 12px; padding-inline: 8px; }
  .post-permissions, .column-permissions { display: none; }
  .terminal-page .post-date { grid-column: 2; }
  .terminal-page .post-name { grid-column: 3; }
}
@media (max-width: 480px) {
  .terminal-page { padding: 12px 8px 48px; }
  .terminal-page .terminal-shell { padding: 0 12px 12px; height: calc(100svh - 60px); min-height: 430px; border-radius: 8px; }
  .window-titlebar { margin-inline: -12px; margin-bottom: 8px; height: 36px; padding-left: 12px; }
  .window-app-icon { margin-right: 4px; }
  .window-controls span { width: 20px; }
  .terminal-page .terminal-header { gap: 16px; }
  .terminal-page .terminal-logo { width: 50px; height: 57px; }
  .terminal-page .fetch-details > div { display: flex; gap: 8px; margin-bottom: 0; }
  .fetch-details dt { margin: 0; }
  .terminal-page .terminal-command, .terminal-page .fetch-prompt { font-size: 16px; line-height: 20px; }
  .terminal-page .journal-columns, .terminal-page .post-select { grid-template-columns: 112px minmax(0,1fr); gap: 10px; padding-inline: 4px; }
  .post-size, .column-size { display: none; }
  .terminal-page .post-date { grid-column: 1; font-size: 16px; }
  .terminal-page .post-name { grid-column: 2; }
}
.command-entry { display: inline-block; white-space: nowrap; }
@media (max-width: 480px) { .terminal-page .terminal-cursor { width: 6px; height: 12px; margin-left: 4px; } }

/* Two overlapping sessions on the same desktop. */
.terminal-page :is(.terminal-system, .terminal-projects) {
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.desktop-terminals { position: relative; width: min(1220px, 100%); height: min(800px, calc(100svh - 100px)); min-height: 620px; }
.terminal-page .terminal-system { position: absolute; inset: 0 auto auto 0; width: min(760px, calc(100% - 160px)); height: 570px; min-height: 0; background: rgb(15 16 21 / 94%); }
.terminal-page .terminal-system .terminal-header { align-items: flex-start; padding-top: 12px; }
.terminal-system .terminal-heading.fetch-summary { padding-top: 8px; }
.terminal-system .system-output { font-size: 16px; line-height: 24px; color: var(--terminal-muted); }
.system-output p { margin: 0; }
.system-ok { color: #a7c7b7; }
.system-output .system-memory { margin: 16px 0; }
.terminal-page .terminal-projects { position: absolute; inset: 134px 192px 0 256px; z-index: 1; width: auto; height: auto; min-height: 0; background: rgb(15 16 21 / 94%); }
.projects-header { flex-shrink: 0; padding: 12px 0 20px; }
@media (min-width: 1101px) {
  .terminal-page .terminal-projects .journal-columns, .terminal-page .terminal-projects .post-select { grid-template-columns: 112px 56px 136px minmax(0,1fr); gap: 12px; }
}
@media (min-width: 761px) and (max-width: 1100px) {
  .desktop-terminals { min-height: 720px; }
  .terminal-page .terminal-system { width: min(760px, calc(100% - 40px)); }
  .terminal-page .terminal-projects { inset: 312px 0 0 auto; width: calc(100% - 40px); }
  .terminal-page .terminal-projects .journal-columns, .terminal-page .terminal-projects .post-select { grid-template-columns: 112px 136px minmax(0,1fr); gap: 12px; }
  .terminal-projects :is(.post-permissions,.column-permissions) { display: none; }
  .terminal-page .terminal-projects .post-date { grid-column: 2; }
  .terminal-page .terminal-projects .post-name { grid-column: 3; }
}
@media (max-width: 760px) {
  .desktop-terminals { height: calc(100svh - 76px); min-height: 650px; }
  .terminal-page .terminal-system { width: 100%; height: 420px; padding-inline: 20px; }
  .terminal-page .terminal-projects { inset: 240px 0 0 0; width: auto; height: auto; }
  .terminal-system .system-output { font-size: 16px; }
}
@media (max-width: 480px) {
  .desktop-terminals { height: calc(100svh - 60px); min-height: 640px; }
  .terminal-page .terminal-system { padding-inline: 12px; width: 100%; }
  .terminal-page .terminal-system .terminal-logo { width: 100px; height: 114px; }
  .terminal-page .terminal-system .terminal-header { gap: 12px; }
  .terminal-page .terminal-system .fetch-summary h1, .terminal-system .fetch-details { font-size: 16px; line-height: 20px; }
  .terminal-page .terminal-projects { inset: 242px 0 0 0; }
  .projects-header { padding-top: 8px; padding-bottom: 12px; }
}

/* System chrome stays small so the artwork remains the desktop. */
.desktop-panel { position: fixed; z-index: 30; inset: 0 0 auto; height: 28px; display: flex; align-items: center; gap: 20px; padding-inline: 20px; background: #131419e8; border-bottom: 1px solid #ffffff12; color: #b6b4bd; font: 11px/1 ui-monospace, monospace; }
.desktop-brand { color: var(--terminal-text); }
.desktop-date { margin-left: auto; color: #b6b4bd; white-space: nowrap; }
.desktop-panel time { min-width: 5ch; font-variant-numeric: tabular-nums; }
.terminal-page .desktop-terminals [data-desktop-window] { z-index: 0; }
.terminal-page .desktop-terminals [data-desktop-window].is-active { z-index: 2; }
[data-desktop-window]:not(.is-active) .window-titlebar { background: #1d1e24; }
[data-desktop-window]:not(.is-active) .window-titlebar :is(.prompt-user,.window-controls,.window-app-icon) { color: #77747f; }
.terminal-page .ls-total { flex-shrink: 0; margin: 0 0 8px; padding-inline: 12px; color: var(--terminal-muted); font-size: 16px; line-height: 24px; }
.terminal-page .post-date { white-space: pre; }
.terminal-page .list-end-prompt { padding: 16px 12px 8px; font-size: 16px; line-height: 24px; }
[data-desktop-window]:not(.is-active) .terminal-cursor { visibility: hidden; }
@media (max-width: 760px) {
  .terminal-page { padding-top: 40px; }
  .desktop-terminals { height: calc(100svh - 92px); }
}
@media (max-width: 480px) {
  .terminal-page { padding-top: 40px; }
  .desktop-terminals { height: calc(100svh - 88px); }
  .terminal-page .ls-total { padding-inline: 4px; font-size: 16px; }
  .terminal-page .list-end-prompt { padding-inline: 4px; font-size: 16px; line-height: 20px; }
  .desktop-panel { padding-inline: 12px; gap: 12px; }
}

/* The background session doubles as the readable About window. */
.system-body { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #77758055 transparent; padding-right: 8px; }
.system-body:focus-visible { outline: 1px solid var(--terminal-rule); outline-offset: -1px; }
.terminal-page .terminal-system .terminal-header { flex-wrap: nowrap; }
.system-about { padding-top: 12px; }
.about-command, .about-end-prompt { font-size: 16px; line-height: 24px; }
.terminal-about-copy { font-size: 16px; line-height: 1.65; overflow-wrap: anywhere; }
.terminal-about-copy p { margin: 18px 0; }
.about-end-prompt { margin-bottom: 12px; }
@media (max-width: 760px) {
  .terminal-page .terminal-system { height: min(600px, 100%); }
}
@media (max-width: 480px) {
  .system-body { padding-right: 0; }
  .terminal-about-copy { font-size: 16px; line-height: 1.65; }
  .about-command, .about-end-prompt { font-size: 16px; line-height: 20px; }
}

/* Task buttons mirror the current window focus. */
.desktop-tasks { display: flex; align-self: stretch; align-items: center; gap: 6px; min-width: 0; }
.desktop-task { display: flex; align-items: center; gap: 8px; padding: 5px 12px; color: #aaa7b0; border: 1px solid #ffffff16; border-radius: 3px; background: #ffffff04; white-space: nowrap; }
.desktop-task:hover { color: var(--terminal-text); background: #ffffff10; border-color: #ffffff35; }
.desktop-task span { color: var(--terminal-accent); }

.desktop-task { font: inherit; cursor: pointer; }
.desktop-task[aria-pressed='true'] { background: var(--terminal-accent); border-color: var(--terminal-accent); color: var(--terminal-accent-ink); }
.desktop-task:focus-visible { outline: 1px solid var(--terminal-accent); outline-offset: 2px; }
.terminal-page .desktop-panel { height: 32px; }
@media (max-width: 700px) {
  .terminal-page .desktop-panel { height: 64px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 0 12px; }
  .terminal-page .desktop-brand { grid-column: 1; grid-row: 1; }
  .terminal-page .desktop-date { grid-column: 2; grid-row: 1; justify-self: end; margin: 0; }
  .terminal-page #desktopClock { grid-column: 3; grid-row: 1; }
  .terminal-page .desktop-tasks { grid-column: 1 / -1; grid-row: 2; padding-bottom: 4px; }
  .terminal-page .desktop-task { padding: 4px 12px; }
  .terminal-page { padding-top: 76px; }
  .terminal-page .desktop-terminals { height: calc(100svh - 124px); min-height: 600px; }
}

/* Scale the overlapping sessions with the viewport, keeping their combined bounds centered. */
@media (min-width: 1101px) {
  .terminal-page .desktop-terminals {
    width: min(88vw, 100%);
    height: min(76svh, calc(100svh - 112px));
    min-height: 460px;
  }
  .terminal-page .terminal-system { inset: 0 auto auto 0; width: 62.3%; height: 91.6%; }
  .terminal-page .terminal-projects { inset: 21.9% 0 0 21%; width: auto; height: auto; }
}
@media (max-width: 1100px) {
  .terminal-page .desktop-terminals { display: grid; gap: 24px; height: auto; min-height: 0; }
  .terminal-page .terminal-system,
  .terminal-page .terminal-projects { position: relative; inset: auto; width: 100%; min-height: 0; }
  .terminal-page .terminal-system { height: 460px; }
  .terminal-page .terminal-projects { height: 600px; }
}
