/* The desk: Studio's frame. One box that searches and opens, the tree, tabs in groups that split and dock, the
   agent's panel. Taken from Rheaface's desk.css: the frame came over, Rhea's business screens did not. Everything
   inside a tab is a component from base.css, and every colour is a token. */

.desk-body { margin: 0; height: 100vh; overflow: hidden; background: var(--ground); }
/* the desk's scrollbars, slim: 8 px to catch,
   4 px drawn in the rule's colour, 6 px and darker under the pointer, no track; Firefox, which has no such parts, its thin bar */
.desk-body ::-webkit-scrollbar { width: 8px; height: 8px; }
.desk-body ::-webkit-scrollbar-track, .desk-body ::-webkit-scrollbar-corner { background: transparent; }
.desk-body ::-webkit-scrollbar-thumb { background: var(--rule-2) padding-box; border: 2px solid transparent; border-radius: 4px; }
.desk-body ::-webkit-scrollbar-thumb:hover, .desk-body ::-webkit-scrollbar-thumb:active { background-color: var(--ink-3); border-width: 1px; }
@supports not selector(::-webkit-scrollbar) { .desk-body * { scrollbar-width: thin; scrollbar-color: var(--rule-2) transparent; } }
.desk-body [hidden], .d-omni[hidden], .d-help[hidden] { display: none !important; }
.desk {
  --act-w: 52px; --nav-w: 288px; --conv-w: 380px; --talk-w: 720px; --row-h: 32px;
  height: 100vh; display: grid;
  grid-template-columns: var(--act-w) var(--nav-w) minmax(0, 1fr) 5px var(--conv-w);
  grid-template-rows: 48px minmax(0, 1fr);
  grid-template-areas: "top top top top top" "act nav work sash conv";
  font-size: 14px;
}
/* the conversation in the middle, as Claude Desktop has it: a reading column, the group you work in beside it */
.desk[data-lead="talk"] { grid-template-columns: var(--act-w) var(--nav-w) var(--talk-w) 5px minmax(0, 1fr); grid-template-areas: "top top top top top" "act nav conv sash work"; }
.desk[data-conv="off"] { grid-template-columns: var(--act-w) var(--nav-w) minmax(0, 1fr) 0 44px; }
.desk[data-conv="off"][data-lead="talk"] { grid-template-columns: var(--act-w) var(--nav-w) 44px 0 minmax(0, 1fr); }
.desk[data-nav="off"] .d-nav { display: none; }
.desk[data-conv="off"] .d-conv, .desk[data-conv="off"] .d-csash { display: none; }
.d-csash { grid-area: sash; cursor: col-resize; outline: none; }
/* folded, the agent stays on its own side: a strip with its mark that opens it again */
.d-rail { grid-area: conv; display: none; flex-direction: column; align-items: center; gap: 10px; padding: 12px 0; border: 0; border-left: 1px solid var(--rule);
  background: var(--sheet); cursor: pointer; color: var(--ink-2); font: 600 12px/1 var(--f-ui); letter-spacing: .06em; }
.desk[data-lead="talk"] .d-rail { border-left: 0; border-right: 1px solid var(--rule); }
.desk[data-conv="off"] .d-rail { display: flex; }
.d-rail svg { width: 26px; height: 26px; }
.d-rail span { writing-mode: vertical-rl; transform: rotate(180deg); }
.d-rail:hover { color: var(--ink); background: var(--doc); }

/* the top: FadoDB's mark, the box, the server, the person */
.d-top { grid-area: top; display: flex; align-items: center; gap: 14px; padding: 0 12px 0 12px; border-bottom: 1px solid var(--rule); background: var(--sheet); min-width: 0; }
.d-brand { background: none; border: 0; padding: 0; border-radius: 50%; cursor: pointer; }   /* the way home: it opens the server's page */
.d-brand img { width: 30px; height: 30px; display: block; border-radius: 50%; }
.d-box { flex: 0 1 560px; margin: 0 auto; display: flex; align-items: center; gap: 8px; min-width: 0;
  background: var(--doc); border: 1px solid var(--rule-2); border-radius: 9px; padding: 6px 10px; color: var(--ink-3); font-size: 13.5px; cursor: pointer; text-align: left; }
.d-box:hover { border-color: var(--ink-3); }
.d-box span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.desk-body kbd, .d-omni kbd, .d-help kbd { font-family: var(--f-fig); font-stretch: var(--fig-stretch); font-size: 11px; color: var(--ink-3); border: 1px solid var(--rule-2); border-radius: 5px; padding: 0 5px; white-space: nowrap; }
.d-top-r { display: flex; align-items: center; gap: 6px; min-width: 0; }
.d-server { display: inline-flex; align-items: center; gap: 6px; max-width: 280px; font: inherit; font-size: 13px; color: var(--ink-2); background: none; border: 1px solid transparent; border-radius: 8px; padding: 4px 8px; cursor: pointer; }
.d-server .t { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.d-server:hover:not(:disabled) { color: var(--ink); border-color: var(--rule-2); }
.d-server:disabled { cursor: default; }
.d-server-c { color: var(--ink-3); font-size: 11px; }
.d-me { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--rule-2); background: none; color: var(--ink-2); font: 600 11px/1 var(--f-ui); letter-spacing: .02em; cursor: pointer; }
.d-me:hover { color: var(--ink); border-color: var(--ink-3); }
.d-mine { position: fixed; z-index: 70; width: 260px; }   /* the person's own menu, under their initials */
.d-icon { background: none; border: 1px solid transparent; border-radius: 7px; width: 30px; height: 30px; display: grid; place-items: center; color: var(--ink-2); cursor: pointer; font-size: 14px; font-weight: 600; }
.d-icon:hover { background: var(--sunk); color: var(--ink); }

/* the activity bar */
.d-act { grid-area: act; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0; background: var(--sunk); border-right: 1px solid var(--rule); }
.d-act button { width: 38px; height: 38px; border-radius: 9px; border: 1px solid transparent; background: none; color: var(--ink-3); cursor: pointer; display: grid; place-items: center; }
.d-act button { position: relative; }
.d-act button:hover { color: var(--ink); background: var(--doc); }
/* Alt Q: each activity shows the letter that opens it */
.d-act[data-keys] button::after { content: attr(data-key); position: absolute; right: -2px; bottom: -2px; min-width: 15px; padding: 0 3px; border-radius: 4px;
  font: 600 10px/15px var(--f-fig); font-stretch: var(--fig-stretch); text-align: center; background: var(--accent-fill); color: var(--on-accent); box-shadow: 0 0 0 2px var(--sunk); }
.d-act button[aria-current="true"] { color: var(--ink); background: var(--doc); border-color: var(--rule); box-shadow: 3px 2px 9px -3px color-mix(in srgb, var(--accent) 85%, transparent); }   /* raised, the accent falling to the right */
.d-act svg { width: 20px; height: 20px; }

/* the panel: captioned, a box to find in, then the tree in folders (Alpha's drawer) */
.d-nav { grid-area: nav; position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--sheet); border-right: 1px solid var(--rule); }
.d-nav-head { display: grid; gap: 8px; padding: 12px 12px 6px; }
.d-nav-head h2 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 0; font: 600 15px/1.2 var(--f-ui); }
.d-nav-head h2 span, .d-nav-head h2 button { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* a caption that opens something: the caption's own look, a line under it at the pointer */
.d-nav-head h2 button { font: inherit; color: inherit; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
.d-nav-head h2 button:hover { text-decoration: underline; text-underline-offset: 3px; }
.d-nav-body { flex: 1 1 0; min-height: 0; overflow-y: auto; padding: 2px 8px 18px; }
.d-nav-item { display: flex; align-items: baseline; gap: 8px; width: 100%; min-width: 0; text-align: left; background: none; border: 0; border-radius: 7px;
  padding: 6px 8px; font-size: 12.5px; line-height: 1.35; color: var(--ink); cursor: pointer; }   /* one size down the whole tree (the owner, 2026-11-21): a folder is heavier, not larger */
.d-nav-item:hover { background: var(--sunk); }
.d-nav-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.d-nav-item .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-nav-item .c { color: var(--ink-3); font-size: 11.5px; flex: none; }
.d-nav-item.on { background: color-mix(in srgb, var(--accent-fill) 34%, var(--doc)); }
.d-nav-item.folder { font-weight: 600; color: var(--ink-2); margin-top: 4px; }
.d-nav-item.folder .chev { width: 10px; height: 10px; flex: none; align-self: center; display: grid; color: var(--ink-3); transition: transform .15s; }
.d-nav-item .chev svg { width: 10px; height: 10px; }
.d-nav-item .i { flex: none; align-self: center; display: grid; color: var(--ink-3); }   /* the icon of the kind a folder holds */
.d-nav-item .i svg { width: 14px; height: 14px; }
/* an app leads its parts: its name in full ink, a little air above the next app */
.d-nav-folder.app > .d-nav-item { color: var(--ink); }
.d-nav-folder.app > .d-nav-item .i { color: var(--ink-2); }
.d-nav-folder.app + .d-nav-folder.app { margin-top: 8px; }
.d-nav-folder[aria-expanded="true"] > .d-nav-item .chev { transform: rotate(90deg); }
.d-nav-folder > .kids { display: none; padding-left: 18px; }   /* a step of 18 px: what a folder holds starts under its icon, so three levels still leave a name its room */
.d-nav-folder[aria-expanded="true"] > .kids { display: block; }
.d-nav-none { color: var(--ink-3); font-size: 13px; padding: 12px 8px; margin: 0; }
.d-nsash { position: absolute; top: 0; bottom: 0; right: -3px; width: 6px; cursor: col-resize; z-index: 3; }
.d-nsash:hover, .d-nsash.live { background: linear-gradient(to right, transparent 2px, var(--accent) 2px, var(--accent) 4px, transparent 4px); }

/* settings */
.d-settings { max-width: 720px; margin: 0 auto; padding: 22px 26px 48px; display: grid; gap: 26px; align-content: start; }
.d-settings h2 { font: 600 24px/1.2 var(--f-ui); margin: 4px 0 0; }
.d-settings section { display: grid; gap: 6px; }

/* the work: a tree of splits, each leaf a group of tabs */
.d-work { grid-area: work; min-width: 0; min-height: 0; display: flex; background: var(--ground); }
.d-split { display: flex; flex: 1 1 0; min-width: 0; min-height: 0; }
.d-split[data-dir="col"] { flex-direction: column; }
/* an edge you can take: a 1px rule in a 5px grip, the accent while held */
.d-sash, .d-csash { --edge: var(--rule); background: linear-gradient(to right, transparent 2px, var(--edge) 2px, var(--edge) 3px, transparent 3px); }
.d-sash { flex: 0 0 5px; cursor: col-resize; position: relative; z-index: 2; }
.d-split[data-dir="col"] > .d-sash { background: linear-gradient(to bottom, transparent 2px, var(--edge) 2px, var(--edge) 3px, transparent 3px); }
.d-split[data-dir="col"] > .d-sash { cursor: row-resize; }
.d-sash:hover, .d-sash.live, .d-csash:hover, .d-csash.live, .d-csash:focus-visible { --edge: var(--accent); background-color: color-mix(in srgb, var(--accent) 22%, transparent); }
.d-group { display: flex; flex-direction: column; min-width: 0; min-height: 0; flex: 1 1 0; background: var(--doc); }
.d-tabs { display: flex; align-items: stretch; background: var(--sunk); border-bottom: 1px solid var(--rule); min-height: 36px; overflow-x: auto; scrollbar-width: none; position: relative; }
.d-tabs::-webkit-scrollbar { display: none; }
/* a row of tabs with more than it shows: the hidden end fades into the strip's ground; a thin bar over
   its edge, opposite the accent, shows under the pointer where the row stands and drags; it takes no room of its own */
.d-strip { --strip-ground: var(--sunk); position: relative; display: flex; min-width: 0; flex: none; }
.d-strip > * { flex: 1 1 auto; min-width: 0; }
.d-strip::before, .d-strip::after { content: ''; position: absolute; top: 0; bottom: 1px; width: 32px; z-index: 1; pointer-events: none; opacity: 0; transition: opacity .15s; }
.d-strip::before { left: 0; background: linear-gradient(to right, var(--strip-ground), transparent); }
.d-strip::after { right: 0; background: linear-gradient(to left, var(--strip-ground), transparent); }
.d-strip[data-more~="l"]::before, .d-strip[data-more~="r"]::after { opacity: 1; }
.d-strip > .d-strip-bar { position: absolute; left: 0; right: 0; bottom: 1px; height: 3px; z-index: 2; opacity: 0; transition: opacity .15s, height .1s; }
.d-strip:not([data-more]) > .d-strip-bar, .d-strip[data-more=""] > .d-strip-bar { display: none; }
.d-strip:hover > .d-strip-bar, .d-strip > .d-strip-bar.live { opacity: 1; }
.d-strip > .d-strip-bar:hover, .d-strip > .d-strip-bar.live { height: 6px; }
.d-strip-bar span { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: var(--rule-2); }
.d-strip-bar:hover span, .d-strip-bar.live span { background: var(--ink-3); }
.d-tab { display: flex; align-items: center; gap: 8px; padding: 0 6px 0 12px; font-size: 13px; color: var(--ink-2); border: 0; border-right: 1px solid var(--rule);
  background: none; white-space: nowrap; cursor: pointer; max-width: 240px; min-width: 0; flex: 0 0 auto; }
.d-tab .t { overflow: hidden; text-overflow: ellipsis; }
.d-tab .k { color: var(--ink-3); display: grid; flex: none; }   /* the icon of what the tab holds */
.d-tab .k svg { width: 14px; height: 14px; }
.d-tab .x { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 5px; color: var(--ink-3); opacity: 0; }
.d-tab .x svg { width: 12px; height: 12px; }
.d-tab:hover .x, .d-tab[aria-selected="true"] .x { opacity: 1; }
.d-tab .x:hover { background: var(--sunk); color: var(--ink); }
.d-tab[aria-selected="true"] { background: var(--doc); color: var(--ink); box-shadow: inset 0 2px 0 var(--rule-2); }
.d-group.focus .d-tab[aria-selected="true"] { box-shadow: inset 0 2px 0 var(--accent); }
.d-tab.dragging { opacity: .45; }
.d-tab.preview .t { font-style: italic; }
/* a tab's own menu (right click): the table's menu look, at the pointer */
.d-ctx { position: fixed; z-index: 70; width: auto; min-width: 230px; }
.d-ctx:focus { outline: none; }
.d-ctx .g-menu > button { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.d-ctx .g-menu > button:disabled { color: var(--ink-3); opacity: .55; cursor: default; background: none; }
.d-ins { position: absolute; top: 4px; bottom: 4px; width: 2px; background: var(--accent); pointer-events: none; }
.d-pane { flex: 1 1 0; min-height: 0; overflow: auto; position: relative; }
.d-drop { position: absolute; z-index: 5; pointer-events: none; border: 2px solid var(--accent); border-radius: 8px; background: color-mix(in srgb, var(--accent) 14%, transparent); transition: all .1s; }
.d-empty { height: 100%; display: grid; place-items: center; color: var(--ink-3); font-size: 13px; text-align: center; padding: 24px; }
.d-empty > div { display: grid; gap: 6px; }
.d-empty p { margin: 0; }

/* the menus behind the activity bar */
.d-menu { padding: 22px 26px 40px; display: grid; gap: 22px; align-content: start; max-width: 980px; }
.d-menu h2 { font: 600 20px/1.2 var(--f-ui); margin: 0; }
.d-menu p { margin: 0; }
.d-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 10px; }
.d-tile { text-align: left; background: var(--sheet); border: 1px solid var(--rule); border-radius: 12px; padding: 12px 14px; cursor: pointer; display: grid; gap: 4px; }
.d-tile:hover { border-color: var(--rule-2); }
.d-tile b { font-weight: 600; font-size: 14px; }
.d-tile span { color: var(--ink-3); font-size: 12.5px; }
/* the mark of a hidden app, beside its name: in the tree, on its tile, on its own page */
.d-hid { flex: none; align-self: center; display: inline-grid; width: 15px; height: 15px; color: var(--ink-3); }
.d-hid svg { width: 15px; height: 15px; }
.d-tile b .d-hid { margin-left: 6px; vertical-align: -2px; }
.d-hidden { display: flex; align-items: center; gap: 6px; }
/* the choice of a homepage: a title, and under it rows of settings (base.css) */
.d-home { display: grid; gap: 10px; }
.d-home select { max-width: 60%; padding: 5px 8px; border: 1px solid var(--rule-2); border-radius: 8px; background: var(--doc); color: var(--ink); font: inherit; font-size: 13px; }
.d-home button:disabled, .d-home select:disabled { opacity: .45; cursor: default; }

/* the conversation */
.d-conv { grid-area: conv; background: var(--sheet); display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.d-conv-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 14px; border-bottom: 1px solid var(--rule); min-width: 0; }
.d-conv-head .agent-mark { font-size: 14px; }
.d-conv-title { flex: 1; min-width: 0; color: var(--ink-2); font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.d-thread { flex: 1 1 0; min-height: 0; overflow-y: auto; padding: 14px; align-content: start; }
.d-thread:empty::before { content: attr(data-empty); color: var(--ink-3); font-size: 13px; }
.d-thread .bubble { max-width: 94%; }
.d-focus { margin: 0 12px 8px; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); background: var(--doc); border: 1px solid var(--rule); border-radius: 999px; padding: 3px 4px 3px 12px; justify-self: start; max-width: calc(100% - 24px); }
.d-focus span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-focus button { background: none; border: 0; color: var(--ink-3); cursor: pointer; padding: 5px 6px; border-radius: 999px; display: grid; place-items: center; }
.d-focus button svg { width: 11px; height: 11px; }
.d-focus button:hover { background: var(--sunk); color: var(--ink); }
.d-compose { padding: 0 12px 12px; }
.desk[data-lead="talk"] .d-thread { padding: 28px max(20px, calc((100% - 720px) / 2)) 16px; }
.desk[data-lead="talk"] .d-thread:empty::before { display: block; text-align: center; margin-top: 22vh; font-size: 15px; }
.desk[data-lead="talk"] .d-thread .bubble { font-size: 15px; max-width: 86%; }
.desk[data-lead="talk"] .d-compose { padding: 0 max(16px, calc((100% - 720px) / 2)) 20px; }
.desk[data-lead="talk"] .d-focus { align-self: center; }
.d-conv.dropping { box-shadow: inset 0 0 0 2px var(--accent); }
.d-threads { border-bottom: 1px solid var(--rule); max-height: 40vh; overflow-y: auto; padding: 6px; display: grid; gap: 2px; background: var(--doc); }
.d-threads button { text-align: left; background: none; border: 0; border-radius: 7px; padding: 7px 9px; cursor: pointer; display: grid; gap: 1px; font-size: 13px; color: var(--ink); }
.d-threads button:hover { background: var(--sunk); }
.d-threads small { color: var(--ink-3); font-size: 11.5px; }
.d-threads p { margin: 6px 8px; }

/* the box */
.d-omni { position: fixed; inset: 0; z-index: 50; background: var(--scrim); display: grid; justify-items: center; align-items: start; padding-top: 11vh; }
.d-omni-panel { width: min(660px, 92vw); background: var(--doc); border: 1px solid var(--rule-2); border-radius: 14px; box-shadow: var(--doc-shadow); overflow: hidden; display: flex; flex-direction: column; max-height: 72vh; }
.d-omni-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--rule); color: var(--ink-3); }
.d-omni-row input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: 400 16px/1.3 var(--f-ui); color: var(--ink); }
.d-omni-res { overflow-y: auto; padding: 6px; display: grid; gap: 1px; }
.d-omni-res .o { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 7px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.d-omni-res .o[aria-selected="true"] { background: var(--sunk); }
.d-omni-res .o .gl { color: var(--ink-3); display: grid; place-items: center; align-self: center; }
.d-omni-res .o .gl svg { width: 15px; height: 15px; }
.d-omni-res .o .m { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.d-omni-res .o .m small { color: var(--ink-3); font-size: 12.5px; margin-left: 6px; }
.d-omni-res .o .r { font-size: 13px; color: var(--ink-2); }
.d-omni-res .o.ask .m { color: var(--accent-text); }
.d-omni-res mark { background: none; color: inherit; font-weight: 650; }
.d-omni-res .sec { font: 500 10.5px/1.2 var(--f-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: 8px 10px 3px; }
.d-omni-foot { display: flex; justify-content: space-between; gap: 10px; padding: 7px 12px; border-top: 1px solid var(--rule); font-size: 12px; color: var(--ink-3); flex-wrap: wrap; }

/* keys */
.d-help { position: fixed; inset: 0; z-index: 60; background: var(--scrim); display: grid; place-items: center; }
.d-help > div { background: var(--doc); border: 1px solid var(--rule-2); border-radius: 14px; padding: 18px 22px; width: min(520px, 92vw); display: grid; gap: 10px; box-shadow: var(--doc-shadow); }
.d-help h2 { font: 600 17px/1.2 var(--f-ui); margin: 0; }
.d-help dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: 13.5px; }
.d-help dt { white-space: nowrap; }
.d-help dd { margin: 0; color: var(--ink-2); }

/* a window of its own: one tab, nothing around it */
.desk.solo { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); grid-template-areas: "work"; }
/* the server asks who this is: the desk shows only its mark and the way to sign in */
.desk.out { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "work"; }
.desk.out .d-act, .desk.out .d-nav, .desk.out .d-conv, .desk.out .d-csash, .desk.out .d-rail, .desk.out .d-box, .desk.out .d-top-r { display: none !important; }
.d-door { flex: 1 1 auto; color: var(--ink); font-size: 15px; }   /* in the middle of the desk */
.d-door a.btn { display: inline-block; margin-top: 8px; text-decoration: none; }
.desk.solo .d-top, .desk.solo .d-act, .desk.solo .d-nav, .desk.solo .d-conv, .desk.solo .d-csash, .desk.solo .d-rail { display: none !important; }

@media (prefers-reduced-motion: reduce) { .d-drop { transition: none; } }
/* a question in a menu's place: remove a table, delete rows (docs/adr/0013) */
.d-ctx .d-ctx-q { margin: 0; padding: 8px 9px 2px; font-size: 13px; font-weight: 600; color: var(--ink); max-width: 300px; }
.d-ctx .d-ctx-n { margin: 0; padding: 0 9px 6px; font-size: 12.5px; color: var(--ink-2); max-width: 300px; }
.d-ctx .g-menu > button[data-do="yes"] { color: var(--due); }
