/* Home arranged by the person (home-arrange.js; the Founder, 5 October 2026, 20:10): every section one box, moved whole. */
.home-boxes{position:relative}
.home-box{position:relative;min-width:0;-webkit-touch-callout:none}
.home-box:empty,.home-box[hidden]{display:none!important}
.home-box>.card,.home-box>.home-section,.home-box>.quick-work-strip{margin-top:0;margin-bottom:0}
.home-box[data-home-box=chief]>.empty{margin-top:30px}
.home-box[data-home-box=chief]>.home-grip{position:absolute;top:-4px;inset-inline-end:0;z-index:2}

/* The grip: the box's handle, at the end of its top. */
.home-grip{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;margin:-6px -8px -6px 0;border-radius:10px;color:var(--muted);cursor:grab;touch-action:none;flex:0 0 auto}
.home-grip .icon{width:20px;height:20px;stroke-width:3.2}
.home-grip:hover,.home-grip[aria-expanded=true]{background:var(--soft);color:var(--purple)}
.home-head{display:flex;align-items:center;justify-content:space-between;gap:10px;min-width:0}
.home-head-tools{display:inline-flex;align-items:center;gap:6px;flex:0 0 auto;margin-inline-start:auto}
.quick-work-strip>.home-grip{margin:0 -6px 0 2px;align-self:center}

/* The box in hand, and the boxes it passes sliding into their places. */
body.home-dragging{-webkit-user-select:none;user-select:none;cursor:grabbing}
body.home-dragging .home-grip{cursor:grabbing}
.home-box-lifted{z-index:20;transition:box-shadow .15s ease,scale .15s ease;scale:1.015;pointer-events:none}
.home-box-lifted>.card,.home-box-lifted>.home-section,.home-box-lifted>.quick-work-strip{box-shadow:0 18px 40px -12px rgba(36,20,64,.35),0 0 0 2px var(--purple);border-radius:var(--radius,14px)}
.home-box-lifted>.home-section{background:var(--surface,#fff)}
.home-box-settle{transition:transform .18s ease}
@media (prefers-reduced-motion:reduce){.home-box-settle,.home-box-lifted{transition:none}.home-box-lifted{scale:none}}

/* The grip's menu. */
.home-grip-menu{position:fixed;z-index:1000;min-width:200px;padding:6px;border:1px solid var(--line);border-radius:12px;background:var(--surface,#fff);color:var(--ink,#24212d);box-shadow:0 14px 34px -10px rgba(20,12,40,.35);display:flex;flex-direction:column}
.home-grip-menu [role=menuitem]{display:flex;align-items:center;gap:10px;min-height:44px;padding:8px 12px;border-radius:8px;font-size:.9375rem;font-weight:550;color:inherit;text-align:start;text-decoration:none}
.home-grip-menu [role=menuitem]:hover,.home-grip-menu [role=menuitem]:focus-visible{background:var(--soft);outline:none}
.home-grip-menu [role=menuitem][aria-disabled=true]{opacity:.45;cursor:default}
.home-grip-menu a[role=menuitem]{border-top:1px solid var(--line);margin-top:4px;border-radius:0 0 8px 8px;color:var(--purple);font-size:.875rem}

/* The Overview in its own card. */
.home-tiles .home-stats{margin:0}
.home-stat[hidden]{display:none!important}
.home-check{display:inline-flex;align-items:center;gap:8px;min-height:44px;font-size:.9375rem;cursor:pointer}
.home-check input{width:20px;height:20px;accent-color:var(--purple);margin:0}

/* Settings · Home screen: one sentence, then the list. */
.home-screen>.muted{margin:-6px 0 14px}
.home-screen-list{list-style:none;margin:0;padding:0;border:1px solid var(--line);border-radius:12px;overflow:hidden}
.home-screen-row{display:flex;align-items:center;gap:12px;min-height:56px;padding:6px 8px 6px 14px;border-top:1px solid var(--line);background:var(--surface,#fff)}
.home-screen-row:first-child{border-top:0}
.home-screen-row.is-hidden .home-screen-name{color:var(--muted)}
.home-screen-place{width:22px;flex:0 0 22px;color:var(--muted);font-variant-numeric:tabular-nums;font-size:.875rem}
.home-screen-name{flex:1 1 auto;min-width:0;font-weight:600;overflow-wrap:anywhere}
.home-screen-show{flex:0 0 auto;min-height:44px}
.home-screen-moves{display:inline-flex;gap:2px;flex:0 0 auto}
.home-screen-moves .icon-button{width:44px;height:44px}
@media (max-width:700px){
 .home-screen-row{gap:6px;padding-inline-start:10px}
}
/* Home with every box hidden: one line to Settings · Home screen. */
.home-empty{margin:8px 0}
.home-box .home-briefs>.card:last-child{margin-bottom:0}
.home-box>.quick-work-strip{justify-content:flex-start}
.home-box>.quick-work-strip>[data-action=new-task]{margin-inline-start:auto}
/*
 * The Overview (the Founder, 5 October 2026, night): one row, five equal tiles, each as wide as the longest label needs
 * ("Workspaces", "Needs you") — a grid sized to its content, whose equal tracks take the widest tile's width. On a
 * phone the row fills the card and the words get smaller to keep one row; it scrolls sideways only if it still cannot.
 */
/*
 * The Overview's counts: one row of equal tiles across the whole card, at every width, never wrapping and never
 * scrolling (the Founder, 6 October 2026). Each tile is one centred stack, the same in all five: the icon, the number,
 * the label. Sizes follow the tile's own width (container units), so every tile in the row draws the same size; a
 * long value ("Unlimited", "$1,250.00", data-fit from terminal-views.js) steps down until it fits its tile. The same
 * tiles (`.home-tiles`) count Home's Tasks and an agent's Funds (the Founder, 8 October 2026).
 */
.home-tiles .home-stats{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:10px;width:100%;overflow:visible}
.home-tiles .home-stat{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;min-width:0;min-height:100px;padding:14px 8px;text-align:center;container-type:inline-size}
.home-tiles .home-stat>.icon{flex:none;width:22px;height:22px}
.home-tiles .home-stat-text{display:flex;flex-direction:column;align-items:center;gap:3px;width:100%;min-width:0}
.home-tiles .home-stat strong{max-width:100%;font-size:clamp(1rem,24cqi,1.5rem);line-height:1.15;letter-spacing:-.01em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.home-tiles .home-stat[data-fit=m] strong{font-size:clamp(.625rem,19cqi,1.5rem)}
.home-tiles .home-stat[data-fit=l] strong{font-size:clamp(.5625rem,16.5cqi,1.5rem)}
.home-tiles .home-stat[data-fit=xl] strong{font-size:clamp(.5rem,13cqi,1.5rem)}
.home-tiles .home-stat-text>span{max-width:100%;font-size:clamp(.5625rem,15cqi,.8125rem);line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media (max-width:700px){
 .home-tiles .home-stats{gap:4px}
 .home-tiles .home-stat{gap:4px;min-height:74px;padding:9px 3px 8px;border-radius:10px}
 .home-tiles .home-stat>.icon{width:18px;height:18px}
}
/* Narrower than a 390 phone (320): each tile as wide as its words need, the row still the card's width. */
@media (max-width:370px){
 .home-tiles .home-stats{grid-auto-columns:minmax(max-content,1fr);gap:3px}
 .home-tiles .home-stat{container-type:normal;padding:9px 2px 8px}
 .home-tiles .home-stat strong{font-size:.875rem}
 .home-tiles .home-stat[data-fit] strong{font-size:.625rem}
 .home-tiles .home-stat-text>span{font-size:.5625rem;overflow:visible}
}
/*
 * The Agent Crew on Home (the Founder, 5 October 2026, night): every agent's tile the same box — the same padding, the
 * same edge, the face in the same place — and only the Chief tab with its crown and the purple edge mark the
 * Chief. Every tile has the same one-pixel edge; the Chief's second pixel is drawn inside, as on Agents, so its face and
 * words sit where every other tile's do.
 */
[data-home-crew] .list-row,[data-home-crew] .list-row:first-child,[data-home-crew] .list-row:last-child{position:relative;padding:12px;border:1px solid var(--line);border-radius:12px;margin:0 0 8px}
[data-home-crew] .list-row:last-child{margin-bottom:0}
[data-home-crew] .list-row.chief-frame{padding:12px;margin-bottom:8px;border:1px solid var(--chief-frame);box-shadow:inset 0 0 0 1px var(--chief-frame)}

[data-home-crew] .list-row .primary-star{display:none}

/*
 * One Home (the Founder, 6 October 2026, at 390): every box the same card with the same inner edge, and the same head —
 * the icon inside the box, left of the title and centred with it, one icon size, one title size, one gap under it —
 * then the box's own links and its ⋮⋮. Every box's content starts at that inner edge; one gap between boxes.
 */
.home-boxes{--home-pad:22px;--home-gap:16px;--home-head-gap:16px;gap:var(--home-gap)}
.home-box>.card,.home-box>.home-tasks{padding:var(--home-pad);border:1px solid var(--line);border-radius:14px;background:var(--surface,#fff)}
.home-box>.card.chief-frame{border:2px solid var(--chief-frame);padding:calc(var(--home-pad) - 1px)}
.home-box .home-head{display:flex;align-items:center;justify-content:space-between;flex-wrap:nowrap;gap:10px;min-width:0;min-height:36px;margin:0 0 var(--home-head-gap);-webkit-user-select:none;user-select:none}
.home-box .home-head>.home-title{display:flex;align-items:center;gap:10px;flex:1 1 auto;min-width:0;margin:0;font-size:1.125rem;line-height:1.3;font-weight:700;letter-spacing:-.01em}
.home-box .home-head>.home-title>svg{flex:0 0 22px;width:22px;height:22px;margin:0;color:var(--purple);stroke:currentColor;stroke-width:1.8}
/* The title's box is its capital letters' height, so the icon is centred on the words, whatever the font's spacing. */
.home-box .home-head>.home-title>span{min-width:0;overflow-wrap:anywhere;text-box:trim-both cap alphabetic}
.home-box .home-head-tools{display:inline-flex;align-items:center;gap:4px;flex:0 0 auto;margin-inline-start:auto}
.home-box .home-head-tools>.text-button{display:inline-flex;align-items:center;gap:2px;min-height:36px;padding:6px 4px;font-size:.9375rem;font-weight:650;white-space:nowrap}
.home-box .home-head-tools>.text-button>.icon{width:16px;height:16px}
.home-box .home-head-tools>.btn{min-height:36px;height:36px;margin:0;padding:0 12px;font-family:inherit;font-size:.875rem;font-weight:650;gap:6px}
.home-box .home-head-tools>.btn .button-label{font-size:inherit}
.home-box .home-head-tools>.badge{flex:none}

/* Briefs: the same card and head; the brief inside it starts at the card's inner edge, with no second frame. */
.home-box>.home-briefs-card{display:block}
.home-briefs-card .home-briefs{display:flex;flex-direction:column;gap:12px}
.home-briefs-card .home-briefs>[data-morning-brief]{margin:0;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none}

/* Tasks: the same card and head, and its one line under it. */
.home-box>.home-tasks{display:block;margin:0}
/* Home's Tasks box: two rows of Home's Overview tiles, Status and Priority (the Founder, 8 October 2026, 03:50), each row
   under its small label, the tiles on the card's own grid as the Overview's are; each tile's icon in its own colour:
   a state's in muted ink and Done's check in the success colour, a priority's in its level's (task-page.css). Quick task
   stays on the heading; See all tasks sits below Priority at the tiles’ right edge. */
.home-tasks .home-tasks-row+.home-tasks-row{margin-top:14px}
.home-tasks .home-tasks-label{margin:0 0 8px;font-size:.75rem;line-height:1.3;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.home-tasks .home-task-stat>.task-state-icon{color:var(--muted,#686577);stroke-width:2;fill:none}
.home-tasks .home-task-stat>.task-state-icon[data-task-status=done]{color:var(--green,#16794d)}
[data-theme=dark] .home-tasks .home-task-stat>.task-state-icon[data-task-status=done]{color:#4ade80}
.home-tasks .home-task-stat>.task-priority-icon{color:var(--level);fill:none}
.home-tasks .home-tasks-all{white-space:nowrap}
.home-tasks .home-head-tools{flex-wrap:nowrap}
.home-tasks .home-task-stat[data-home-task-filter=all]>.icon{color:var(--muted,#686577)}
.home-tasks-footer{display:flex;justify-content:flex-end;margin-top:14px}
.home-tasks-footer .home-tasks-all{padding:6px 0;min-height:36px;font-size:.9375rem;font-weight:650}
[data-home-details] .home-tasks [data-action=new-task]{min-height:36px}
.home-tasks .home-head-tools>.btn>.icon{width:16px;height:16px}

/* The Agent Crew: the Chief's tab one standard gap under the head, joined to its row with no line between them. */
[data-home-crew] .list-row.has-primary-tab{margin-top:calc(28px + var(--home-head-gap))!important}
[data-home-crew] .list-row.chief-frame{padding:11px;border:2px solid var(--chief-frame);box-shadow:none}
[data-home-crew] .list-row.chief-frame>.primary-tab{inset-inline-start:10px}
/* The tab reaches down over the frame's own edge, so nothing is drawn between "Chief" and the agent. */
[data-home-crew] .primary-tab{top:-30px;height:32px;padding:5px 12px 7px;align-items:center;line-height:18px;z-index:1}
/* The crown sits on the word's line: its foot on the baseline, its points level with the capitals. */
[data-home-crew] .primary-tab .primary-crown{position:relative;top:-3px;width:18px;height:18px}

/* History: one row per event — the face, what was done and what about (a line each), the time on the right. */
.home-history-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.home-history-list>li{margin:0;padding:0;border-top:1px solid var(--line)}
.home-history-list>li:first-child{border-top:0}
.home-history-row{display:grid;grid-template-columns:32px minmax(0,1fr) auto;align-items:center;column-gap:12px;min-height:56px;padding:10px 0;color:inherit;text-decoration:none}
.home-history-row:hover .home-history-what{color:var(--purple)}
.home-history-row:focus-visible{outline:2px solid var(--purple);outline-offset:2px;border-radius:8px}
.home-history-face{display:grid;place-items:center;width:32px;height:32px}
.home-history-face .portrait-box.tiny,.home-history-face .human-photo{width:32px;height:32px;min-width:32px;border-radius:50%;overflow:hidden;font-size:.75rem}
.home-history-face .human-photo{display:grid;place-items:center;background:var(--soft);color:var(--purple);font-weight:650}
.home-history-text{display:flex;flex-direction:column;gap:2px;min-width:0}
.home-history-what,.home-history-about{display:block;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.home-history-what{font-size:.9375rem;line-height:1.35;font-weight:600}
.home-history-about{font-size:.8125rem;line-height:1.35;color:var(--muted)}
.home-history-side{display:flex;flex-direction:column;align-items:flex-end;gap:4px;align-self:start;padding-top:2px}
.home-history-when{font-size:.8125rem;line-height:1.35;color:var(--muted);font-variant-numeric:tabular-nums;white-space:nowrap}
.home-history-times{padding:0 7px;border-radius:999px;background:var(--soft);color:var(--purple);font-size:.75rem;font-weight:650;line-height:1.5}
[data-home-history] [data-home-week-slot]:not(:empty)+.home-history-list,[data-home-history] [data-home-week-slot]:not(:empty)+.muted{margin-top:6px}

@media (max-width:700px){
 .home-boxes{--home-pad:18px;--home-gap:12px;--home-head-gap:14px}
 .home-box .home-head>.home-title{font-size:1.0625rem}
 .home-box .home-head-tools>.text-button{font-size:.875rem}
}
.home-box>.home-briefs-card:has(>.home-briefs:empty){display:none}

/* A head's own button stays one line and its own size (the Founder, 6 October 2026: Quick task wrapped into a tall pill). */
.home-head-tools .btn{white-space:nowrap;flex:none;min-height:36px;padding-block:6px}
/* Every Overview tile on one grid (the Founder, 6 October 2026: "Unlimited" sat higher than the numbers): the icon,
   the value and the label each keep a row of fixed height, whatever the value's length or size. */
.home-tiles .home-stat{justify-content:flex-start}
.home-tiles .home-stat strong{display:flex;align-items:center;justify-content:center;height:1.75rem;min-height:1.75rem}
@media (max-width:640px){.home-tiles .home-stat strong{height:1.5rem;min-height:1.5rem}}
/*
 * One presentation for every Home list (the Founder, 7 October 2026): each item a title in bold and one muted line under
 * it, a chevron on the right, the whole line opening it; items parted by a hairline, as History's rows are.
 */
.home-items{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.home-items>li{margin:0;padding:0;border-top:1px solid var(--line)}
.home-items>li:first-child{border-top:0}
.home-item{display:flex;align-items:center;gap:12px;min-height:56px;padding:10px 0;color:inherit;text-decoration:none;min-width:0}
.home-item:hover .home-item-title{color:var(--purple)}
.home-item:focus-visible{outline:2px solid var(--purple);outline-offset:2px;border-radius:8px}
.home-item-copy{flex:1 1 auto;display:flex;flex-direction:column;gap:2px;min-width:0}
.home-item-title,.home-item-body{display:block;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.home-item-title{font-size:.9375rem;line-height:1.35;font-weight:600}
.home-item-body{font-size:.8125rem;line-height:1.35;color:var(--muted)}
.home-item>.icon{flex:0 0 18px;width:18px;height:18px;color:var(--muted)}
.home-item:hover>.icon{color:var(--purple)}

/* Home owns its reading anchor while asynchronous sections arrive. Native anchoring would move it a second time. */
html:has(#main [data-home-boxes]){overflow-anchor:none}

/* Remove from Home's line, with Undo (the Founder, 8 October 2026, 22:44). home-arrange.js */
.home-undo{position:fixed;z-index:1001;left:50%;bottom:calc(96px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);display:flex;align-items:center;gap:12px;max-width:calc(100vw - 32px);padding:6px 6px 6px 16px;border-radius:12px;background:#24212d;color:#fff;box-shadow:0 12px 30px -8px rgba(20,12,40,.45);font-size:.9375rem}
.home-undo-text{min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.home-undo-button{flex:none;min-height:44px;padding:0 14px;border:0;border-radius:8px;background:none;color:#d8c2f5;font:inherit;font-weight:700;cursor:pointer}
.home-undo-button:hover,.home-undo-button:focus-visible{background:rgba(255,255,255,.12);outline:none}
[data-theme=dark] .home-undo{background:#f0f1f5;color:#24212d}
[data-theme=dark] .home-undo-button{color:#6d28b5}
