/* The dashboard's home laid out like a coding agent's new session (the owner, 2026-11-18): an empty work area with one
   small card in the middle (recent projects, the environment, any project to work in) and the box at the foot of the
   screen, with where it runs and which project on the left under it, and the model, its effort and the mode on the
   right. A banner over the box says when a usage limit is near. Loaded after calm.css; dashboard.js renderEnv.
   No outlines: surfaces are told apart by fill alone. Contrast on --c-card #262626: --text #ededed 13.9:1, --body
   #cfcfcf 10.6:1, --muted #a3a3a3 6.6:1. */

/* the old home's parts give way: the greeting, the connectors link and the side cards. The shelf of templates stays,
   under the first screen, so the templates can be seen and opened before they're used (the owner, 2026-11-26) */
.dash .view-home .home-main > :is(.connect, .greet, .greet-sub, .dfirst) { display: none; }
.dash .view-home .home-rail { display: none; }
.dash .view-home > .shelf { margin: 0 auto 48px; }
.dash .home-main::after { content: none; }

/* ---------------- the card in the middle ---------------- */
.dash .env-card { order: 1; display: grid; gap: 10px; width: min(320px, 100%); margin: auto 0; }
.dash .env-box { padding: 6px; border-radius: 14px; background: var(--c-card); }
.dash .env-recent { display: grid; gap: 2px; margin: 0 0 4px; padding: 0; list-style: none; }
.dash .env-recent[hidden] { display: none; }
.dash :is(.env-pick, .env-line, .env-folder) {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 0 10px; border-radius: 9px;
  background: none; color: var(--text); font: inherit; font-size: 14px; text-align: left;
}
.dash :is(.env-pick, .env-line, .env-folder):hover { background: var(--c-hover); }
.dash :is(.env-pick, .env-folder) .ic { flex: none; width: 16px; height: 16px; color: var(--body); }
.dash .env-pick span { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dash .env-pick.is-on { background: var(--c-sel); }
.dash .env-pick .env-on { margin-left: auto; color: var(--text); }
.dash .env-line { color: var(--body); font-weight: 500; }
.dash .env-chev { width: 14px; height: 14px; flex: none; opacity: 0.8; }
.dash .env-folder { min-height: 40px; padding: 0 14px; border-radius: 12px; background: var(--c-card); }
.dash .env-folder span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dash :is(.env-folder, .dbar-btn):disabled { opacity: 0.55; cursor: default; }
.dash .env-folder:disabled:hover { background: var(--c-card); }
.dash .env-card .dmenu { top: calc(100% + 6px); bottom: auto; left: 0; right: auto; width: 100%; min-width: 240px; --origin: top left; }
.dash :is(.env-menu, .folder-menu) a[role="menuitem"] { display: flex; align-items: center; gap: 10px; }
.dash :is(.env-menu, .folder-menu) :is(button, a) .ic:not(.pm-tick) { width: 16px; height: 16px; color: var(--body); }
.dash .folder-menu { max-height: min(360px, 60vh); overflow-y: auto; }

/* ---------------- the box at the foot ---------------- */
.dash .view-home .dcomp {
  order: 2; position: sticky; bottom: 14px; z-index: 4; display: flex; flex-direction: column; gap: 8px;
  width: 100%; max-width: 768px; margin: 24px 0 0; padding: 0; background: none; box-shadow: none; border-radius: 0;
}
.dash .view-home .dcomp:focus-within { background: none; box-shadow: none; }
.dash .view-home .dcomp-box {
  order: 2; display: grid; grid-template-columns: auto 1fr auto auto; align-items: end; column-gap: 4px; row-gap: 0;
  padding: 7px 8px; border-radius: 16px; background: var(--c-card); box-shadow: none;
}
.dash .view-home .dcomp:focus-within .dcomp-box { box-shadow: none; background: color-mix(in srgb, var(--c-card) 88%, #ffffff); }
.dash .view-home .dcomp-box > :is(.dcomp-chips, .dcomp-media) { grid-column: 1 / -1; }
.dash .view-home .dcomp-box > :is(.dcomp-chips, .dcomp-media):not(:has(*)) { display: none; }
/* rows above the line only take room when they hold something */
.dash .view-home .dcomp-box > :is(.dcomp-chips, .dcomp-media):has(> :not([hidden])) { margin-bottom: 6px; }
.dash .view-home .dcomp-row { display: contents; }
.dash .view-home .dcomp-row > .pop-wrap { grid-column: 1; grid-row: 3; }
.dash .view-home .dcomp-row > .spacer { display: none; }
.dash .view-home .dcomp textarea { grid-column: 2; grid-row: 3; min-height: 36px; max-height: 220px; padding: 7px 6px; font-size: 15px; line-height: 1.45; resize: none; }
.dash .view-home .dcomp #mic { grid-column: 3; grid-row: 3; }
.dash .view-home .dcomp .send-btn { grid-column: 4; grid-row: 3; }
:root .dash .view-home .dcomp .dcomp-plus { width: 36px; height: 36px; box-shadow: none; }
.dash .view-home .dcomp :is(#mic, .send-btn) { width: 36px; height: 36px; margin: 0; }
.dash .view-home .dcomp :is(textarea, .dcomp-plus) { margin: 0; }

/* under the box: environment and project on the left; team, model and effort, and the mode on the right */
.dash .view-home .dbar { order: 3; display: flex; align-items: center; gap: 2px; min-height: 32px; padding: 0 4px; }
.dash .view-home .dbar .spacer { flex: 1; }
.dash .dbar-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; max-width: 220px; padding: 0 10px; border-radius: 999px;
  background: none; color: var(--body); font: inherit; font-size: 13.5px; font-weight: 500;
}
.dash .dbar-btn > span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dash .dbar-btn:hover:not(:disabled) { background: var(--c-hover); color: var(--text); }
.dash .dbar-btn .ic { width: 15px; height: 15px; flex: none; }
.dash .view-home .dbar .dcomp-top, .dash .view-home .dcomp-top.dbar { box-shadow: none; }
/* the bar's menus open above the whole box, placed from the form (sticky, so it frames them), not over the card;
   those on the right half open from its right edge */
.dash .view-home .dbar > .pop-wrap { position: static; }
.dash .view-home .dbar .dmenu.up { bottom: calc(100% + 8px); z-index: 6; }
.dash .view-home .dbar > .pop-wrap:nth-last-child(-n+2) .dmenu.up { left: auto; right: 0; --origin: bottom right; }

/* the usage banner over the box */
.dash .use-warn { order: 1; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 8px 6px 14px; border-radius: 14px; background: var(--c-card); font-size: 13.5px; color: var(--muted); }
.dash .use-warn[hidden] { display: none; }
.dash .use-warn > .ic { width: 16px; height: 16px; flex: none; }
.dash .use-warn b { color: var(--text); font-weight: 600; }
.dash .use-warn .spacer { flex: 1; }
.dash .use-more { height: 32px; padding: 0 12px; border-radius: 999px; background: var(--c-quiet); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; }
.dash .use-more:hover { background: var(--c-quiet-hover); }
.dash .use-x { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: none; color: var(--muted); }
.dash .use-x:hover { background: var(--c-hover); color: var(--text); }
.dash .use-x .ic { width: 15px; height: 15px; }

/* ---------------- the sidebar's foot: the account with its plan, and settings beside it ---------------- */
.dash .side .beta.plan-chip { display: none; }
.dash .acct { display: flex; align-items: center; gap: 4px; }
.dash .acct > .acct-btn { flex: 1; min-width: 0; }
.dash .acct-gear { flex: none; width: 34px; height: 34px; border-radius: 10px; color: var(--body); }
.dash .acct-gear:hover { background: var(--c-hover); color: var(--text); }
.dash.is-collapsed .acct-gear { display: none; }

@media (max-width: 600px) {
  .dash .view-home .dbar { flex-wrap: wrap; row-gap: 2px; }
  .dash .dbar-btn { max-width: 160px; padding: 0 8px; }
  .dash .use-warn { flex-wrap: wrap; }
  .dash .env-card { width: 100%; }
}
@media (pointer: coarse) { .dash :is(.env-pick, .env-line, .env-folder, .dbar-btn) { min-height: 44px; } }

/* No frame round the box (the owner, 2026-11-18, over a wallpaper: "fix this"). Two older rules still drew one:
   over a background, the glass panel and edge the old composer wore (dashboard.css :root[data-bg] .dcomp). The card
   and the bar under it are the box now, so the frame goes. */
:root .dash .view-home .dcomp.dcomp, :root .dash .view-home .dcomp.dcomp:focus-within { background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }

/* ---------------- the box as a coding agent's composer (the owner, 2026-11-23, from a screenshot: "make anticode's look
   more like this") ----------------
   Measured from the screenshot: a 44px field of #303030 with a 1px #404040 edge and 10px corners on the #191919 ground,
   a bare plus at the left and a bare microphone at the right (no discs), and under it a row of plain words with small
   icons, no fills or outlines: where it runs and which project on the left, team, effort and mode on the right, the
   effort in a dimmer grey. No model name or token count goes in the row (the effort menu still picks the model when
   an account has more than one). The send keeps its near-white disc once there is something to send.
   Contrast: words #f7f7f7 on the box 12.3:1, placeholder #999999 4.6:1; the row's words 16.2:1 on the ground, the
   effort #9f9f9f 6.6:1. Typing brightens the edge to #575757 rather than the fill, so the placeholder keeps 4.6:1. */
.dash .view-home .dcomp { gap: 6px; }
.dash .view-home .dcomp-box { padding: 4px 6px; border-radius: 10px; background: var(--c-box); box-shadow: inset 0 0 0 1px var(--c-box-edge); }
.dash .view-home .dcomp:focus-within .dcomp-box { background: var(--c-box); box-shadow: inset 0 0 0 1px var(--c-box-edge-on); }
.dash .view-home .dcomp textarea { scrollbar-width: none; }
.dash .view-home .dcomp textarea::placeholder { color: var(--c-box-ph); opacity: 1; }
:root .dash .view-home .dcomp :is(.dcomp-plus, #mic) { background: none; color: var(--text); box-shadow: none; }
:root .dash .view-home .dcomp :is(.dcomp-plus, #mic):not(:focus-visible) { outline: none; }
:root .dash .view-home .dcomp :is(.dcomp-plus, #mic):hover { background: color-mix(in srgb, var(--text) 8%, transparent); }
.dash .view-home .dcomp :is(.dcomp-plus, #mic) .ic { width: 18px; height: 18px; }
.dash .view-home .dbar { gap: 0; min-height: 30px; padding: 0 2px; }
.dash .view-home .dbar :is(.dbar-btn, .team-btn, .effort-btn) {
  height: 30px; min-height: 0; gap: 6px; padding: 0 8px; border-radius: 999px; background: none; box-shadow: none;
  color: var(--text); font-size: 13px; font-weight: 500;
}
.dash .view-home .dbar :is(.dbar-btn, .team-btn, .effort-btn):not(:focus-visible) { outline: none; }
.dash .view-home .dbar :is(.dbar-btn, .team-btn, .effort-btn):hover:not(:disabled),
.dash .view-home .dbar :is(.dbar-btn, .team-btn, .effort-btn)[aria-expanded="true"] { background: color-mix(in srgb, var(--text) 7%, transparent); color: var(--text); }
.dash .view-home .dbar :is(.dbar-btn, .team-btn) > .ic:first-child { width: 15px; height: 15px; color: var(--text); }
.dash .view-home .dbar :is(.env-chev, .effort-btn .ic) { width: 12px; height: 12px; color: var(--muted); opacity: 1; }
.dash .view-home .dbar .effort-btn { color: var(--muted); }
@media (pointer: coarse) { .dash .view-home .dbar :is(.dbar-btn, .team-btn, .effort-btn) { height: 44px; } }
