body[data-fintech-page="console"] .support-launch { bottom: 70px; }

body[data-fintech-page="console"] main.shell {
  width: min(calc(100% - 48px), 1500px);
  max-width: none;
  padding-top: 20px;
}

.ledger-desktop {
  --desk-mono: "IBM Plex Mono", monospace;
  --desk-rule: color-mix(in srgb, var(--ink) 19%, var(--ground));
  --desk-panel: var(--surface, var(--ground));
  border: 1px solid var(--desk-rule);
  background: var(--ground);
  color: var(--ink);
  margin: 0;
  padding: 0;
}
.ledger-desktop [hidden] { display: none !important; }
.ledger-desktop button:focus-visible,
.ledger-desktop a:focus-visible,
.ledger-desktop input:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.desk-system, .desk-dock, .desk-titlebar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--desk-panel);
}
.desk-system {
  justify-content: space-between;
  padding: 8px 14px;
  border-bottom: 1px solid var(--desk-rule);
}
.desk-system button, .desk-dock button, .desk-dock a, .desk-quick button, .desk-quick a, .desk-fold,
.desk-window-controls button, .desk-address button, .desk-bookmarks button {
  background: transparent;
  color: inherit;
  font: 12px/1.4 var(--desk-mono);
  border: 1px solid var(--desk-rule);
  padding: 8px 12px;
  min-height: 40px;
  text-decoration: none;
  cursor: pointer;
}
.desk-system button:hover, .desk-dock button:hover, .desk-dock a:hover, .desk-quick button:hover, .desk-quick a:hover, .desk-fold:hover,
.desk-window-controls button:hover, .desk-address button:hover, .desk-bookmarks button:hover {
  border-color: var(--ink);
  background: var(--ft-wash, var(--panel));
}
#desk-home { display: flex; gap: 8px; align-items: center; border-color: transparent; padding: 4px; }
#desk-home span { white-space: nowrap; }
#desk-home em { font-style: normal; color: var(--muted); }
.desk-system p { margin: 0; font: 11px/1.55 var(--desk-mono); color: var(--muted); }
#cx-palette-open kbd { font: inherit; color: var(--muted); margin-left: 6px; }

.desk-stage {
  position: relative;
  isolation: isolate;
  height: clamp(510px, calc(100dvh - 202px), 920px);
  overflow: hidden;
  background: var(--ground);
}
.desk-wallpaper { position: absolute; inset: 0; pointer-events: none; }
[data-wallpaper="seal"] .desk-wallpaper, [data-wallpaper="grid"] .desk-wallpaper {
  background-image: linear-gradient(to right, var(--desk-rule) 1px, transparent 1px),
                    linear-gradient(to bottom, var(--desk-rule) 1px, transparent 1px);
  background-size: 42px 42px;
  opacity: .25;
}
[data-wallpaper="seal"] .desk-wallpaper::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 10%;
  transform: translateY(-50%);
  width: min(37%, 430px);
  aspect-ratio: 1;
  background: url("/favicon.svg") center/contain no-repeat;
  opacity: .68;
}
[data-wallpaper="custom"] .desk-wallpaper { background: var(--desk-custom-wallpaper) center/cover no-repeat; opacity: .63; }
.desk-welcome {
  position: absolute;
  left: clamp(24px, 7vw, 112px);
  top: 50%;
  transform: translateY(-50%);
  max-width: min(560px, calc(100% - 48px));
}
.desk-welcome h1 { font: 500 clamp(54px, 8vw, 125px)/.94 "Space Grotesk", sans-serif; letter-spacing: -.083em; margin: 0 0 23px; }
.desk-welcome h1 em { font: italic 1.12em/.8 "Instrument Serif", Georgia, serif; letter-spacing: -.045em; }
.desk-welcome p { color: var(--muted); font-size: 15px; margin: 0 0 26px; }
.desk-welcome .desk-kicker { font: 11px var(--desk-mono); letter-spacing: .21em; margin-bottom: 18px; }
[data-wallpaper="custom"] .desk-welcome { background: var(--ground); padding: 26px; }
.desk-quick { display: flex; flex-wrap: wrap; gap: 8px; }
.desk-quick button, .desk-quick a { background: var(--desk-panel); }
.desk-quick button:first-child { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.desk-boot { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; z-index: 9; background: var(--ground); font: 12px var(--desk-mono); pointer-events: none; }

.desk-dock { min-height: 57px; padding: 7px 14px; border-top: 1px solid var(--desk-rule); gap: 6px; overflow-x: auto; }
.desk-dock button, .desk-dock a { flex: none; white-space: nowrap; border-color: transparent; }
.desk-dock button[data-state="open"], .desk-dock button[data-state="minimized"] { border-bottom-color: var(--muted); }
.desk-dock button[data-state="active"] { border-color: var(--ink); background: var(--ft-wash, var(--panel)); }
.desk-dock span { margin-right: 4px; }

.desk-window {
  position: absolute;
  left: var(--window-x, 7%);
  top: var(--window-y, 6%);
  width: var(--window-width, min(740px, 83%));
  height: var(--window-height, 78%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin: 0;
  padding: 0;
  border: 1px solid var(--desk-rule);
  background: var(--desk-panel);
  box-shadow: 0 18px 50px #0004;
}
.desk-window[data-active] { border-color: var(--muted); }
.desk-window[data-maximized] { inset: 0 !important; width: 100%; height: 100%; }
#desk-tools { --window-x: 3%; --window-y: 3%; --window-width: 92%; --window-height: 93%; }
#desk-terminal { --window-x: 12%; --window-y: 12%; }
#desk-assistant { --window-x: 31%; --window-y: 10%; --window-width: min(660px, 66%); }
#desk-browser { --window-x: 16%; --window-y: 8%; --window-width: min(920px, 80%); --window-height: 86%; }
#desk-settings { --window-x: 49%; --window-y: 14%; --window-width: min(480px, 47%); --window-height: 75%; }
.desk-titlebar { justify-content: space-between; padding-left: 16px; border-bottom: 1px solid var(--desk-rule); cursor: grab; touch-action: none; user-select: none; }
main.shell .ledger-desktop .desk-titlebar h2 { margin: 0; font: 13px var(--desk-mono); }
.desk-titlebar h2 span { margin-right: 6px; }
.desk-window-controls { display: flex; }
.desk-window-controls button { border: 0; border-left: 1px solid var(--desk-rule); min-width: 40px; font-size: 16px; }
.desk-window-body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.desk-app-content { max-width: 900px; padding: 18px; }
.desk-app-content h3 { margin-top: 0; }
.desk-app-content .nx-form { margin: 14px 0; }
.desk-app-content input:not([type="radio"]), .desk-app-content textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--desk-rule);
  background: var(--ground);
  color: var(--ink);
  font: 14px var(--desk-mono);
}
.desk-address { display: flex; gap: 8px; }
.desk-address input { min-width: 0; }
.desk-bookmarks { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
#desk-browser-status, #desk-wallpaper-status { color: var(--muted); font: 12px/1.6 var(--desk-mono); }
#desk-reader { overflow-wrap: anywhere; }
#desk-reader table { display: block; overflow-x: auto; }
#desk-reader pre { overflow-x: auto; }
#desk-wallpapers { border: 0; margin: 0 0 18px; padding: 0; }
#desk-wallpapers label { display: block; padding-block: 8px; }
.desk-file { display: block; margin-bottom: 8px; }
.desk-file span { display: block; font: 11px var(--desk-mono); color: var(--muted); margin-top: 4px; }

body[data-fintech-page="console"] #desk-tools .cx {
  grid-template-columns: minmax(156px, 22%) minmax(0, 1fr);
  border-radius: 0;
  border-inline: 0;
}
body[data-fintech-page="console"] #desk-tools .cx[data-collapsed] { grid-template-columns: 0 minmax(0, 1fr); }
body[data-fintech-page="console"] #desk-tools .cx-side { min-height: auto; }
body[data-fintech-page="console"] #desk-tools .cx-main { min-height: 310px; }
body[data-fintech-page="console"] #desk-tools .ft-investigation-input { grid-template-columns: minmax(0, 1fr); margin-top: 16px; }
body[data-fintech-page="console"] #desk-tools .ft-credentials { padding-inline: 16px; }
.desk-fold { display: block; margin: 8px 16px; }
.desk-tool-footer { margin: 10px 16px; }
#desk-terminal .cx-terminal { padding: 6px 18px; min-height: 100%; }
#desk-terminal .cx-terminal-output { flex: 1; min-height: 160px; height: 160px; }
#desk-terminal .cx-terminal-form { flex-wrap: nowrap; }
#desk-terminal .cx-terminal-form input { font-size: 16px; }

@media (max-width: 760px) {
  body[data-fintech-page="console"] main.shell { width: calc(100% - 20px); padding-top: 10px; }
  .desk-system { padding: 6px; gap: 5px; }
  .desk-system p { font-size: 10px; gap: 3px; }
  .desk-system p span:not(:first-child), #desk-home em, #cx-palette-open kbd { display: none; }
  .desk-stage { height: max(360px, calc(100dvh - 196px)); }
  [data-wallpaper="seal"] .desk-wallpaper::after { width: 61%; right: 2%; top: 35%; opacity: .4; }
  .desk-welcome { top: 57%; }
  .desk-window, .desk-window[data-maximized] { inset: 0 !important; width: 100%; height: 100%; border: 0; box-shadow: none; }
  .desk-window:not([data-active]) { display: none; }
  .desk-titlebar { cursor: auto; touch-action: auto; }
  .desk-window-controls [data-window-action="maximize"] { display: none; }
  .desk-dock { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding-inline: 4px; gap: 2px; }
  .desk-dock button { padding-inline: 0; font-size: 10px; }
  .desk-dock button span { display: block; }
  body[data-fintech-page="console"] .support-launch { display: none; }
  .desk-dock span { margin-right: 0; }
  body[data-fintech-page="console"] #desk-tools .cx,
  body[data-fintech-page="console"] #desk-tools .cx[data-collapsed] { grid-template-columns: minmax(0, 1fr); }
  body[data-fintech-page="console"] #desk-tools .cx-side { max-height: 220px; }
  body[data-fintech-page="console"] #desk-tools .cx-main { padding: 16px; }
  .desk-app-content input, .desk-app-content textarea { font-size: 16px !important; }
}
