/* Foresttasks interface: one token set, calm native controls, glass only on floating chrome. */
@layer reset, base, components, shell, pages;

@layer reset {
*,*::before,*::after{box-sizing:border-box}
[hidden]{display:none!important}
body,h1,h2,h3,p,ol,ul{margin:0}
button,input,textarea,select{font:inherit;color:inherit}
img,svg{max-width:100%}
}

@layer base {
:root{
  color-scheme:light;
  --bg:#eef0f2;--surface:#fff;--sidebar:#f5f6f8;--fill:#e7eaed;--fill-strong:#dce0e4;
  --ink:#1d2329;--muted:#59636c;--line:#dfe3e7;--line-strong:#c9cfd5;
  --brand:#2f6048;--on-brand:#fff;--brand-soft:#e1ece4;--card:var(--surface);
  --danger:#b3261e;--danger-soft:#fbe9e7;--warn:#9a6210;--info:#2f63b8;
  --warn-soft:color-mix(in srgb,var(--warn) 14%,transparent);
  --ring:0 0 0 3px color-mix(in srgb,var(--brand) 22%,transparent);
  --glass-bg:rgb(255 255 255 / .74);--glass-edge:rgb(255 255 255 / .85);--glass-filter:blur(20px) saturate(1.6);
  --glass-shadow:0 8px 28px rgb(20 30 40 / .12),0 1px 3px rgb(20 30 40 / .08);
  --pop-shadow:0 18px 50px rgb(20 30 40 / .18),0 2px 8px rgb(20 30 40 / .08);
  --r:12px;--r-lg:20px;--r-xl:24px;
  --ease:cubic-bezier(.2,.8,.2,1);
  --mono:ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  --state-check:var(--surface);--sheet:var(--bg);
}
:root[data-theme="dark"]{
  color-scheme:dark;--sheet:#1b1f24;
  --bg:#15181c;--surface:#1f2328;--sidebar:#191c20;--fill:#2e3339;--fill-strong:#3a4047;
  --ink:#eceff1;--muted:#a0aab3;--line:#2f353c;--line-strong:#434a52;
  --brand:#93c9a8;--on-brand:#0f2419;--brand-soft:#223a2c;
  --danger:#f29b93;--danger-soft:#3b2220;--warn:#e2b35f;--info:#8fb4f0;
  --glass-bg:rgb(42 47 53 / .72);--glass-edge:rgb(255 255 255 / .12);
  --glass-shadow:0 8px 28px rgb(0 0 0 / .4),0 1px 3px rgb(0 0 0 / .3);
  --pop-shadow:0 18px 50px rgb(0 0 0 / .5),0 2px 8px rgb(0 0 0 / .3);
}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%;-webkit-tap-highlight-color:transparent}
body{
  background:var(--bg);color:var(--ink);
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI Variable Text","Segoe UI",system-ui,Roboto,
    "Helvetica Neue",sans-serif;
  font-size:15px;line-height:1.5;min-height:100dvh;overflow-wrap:anywhere;-webkit-font-smoothing:antialiased
}
a{color:var(--brand);text-decoration:none}
a:hover{text-decoration:underline}
button{cursor:pointer;border:0;background:none;padding:0}
button:disabled{cursor:wait;opacity:.6}
h1,h2,h3{line-height:1.25;letter-spacing:-.015em;font-weight:650}
h1{font-size:1.625rem;letter-spacing:-.025em}
/* Wide windows read on one surface, so raised cards become a quiet fill. */
@media(min-width:1024px){:root{--card:color-mix(in srgb,var(--fill) 55%,transparent)}}
h2{font-size:1.0625rem}
h3{font-size:.9375rem}
p+p{margin-top:.75rem}
small,.muted{color:var(--muted)}
:focus-visible{outline:2px solid var(--brand);outline-offset:2px;border-radius:4px}
::selection{background:color-mix(in srgb,var(--brand) 25%,transparent)}
hr{border:0;border-top:1px solid var(--line);margin:1.5rem 0}
code{font-family:var(--mono);font-size:.88em;background:var(--fill);padding:.1em .35em;border-radius:5px}
pre{white-space:pre-wrap;font-family:var(--mono)}
time{color:var(--muted);font-size:.8125rem;font-variant-numeric:tabular-nums}
summary{cursor:pointer;list-style:none}
summary::-webkit-details-marker{display:none}
ul,ol{padding-left:1.3rem}
label,legend{display:block;font-weight:590;font-size:.8125rem;margin-bottom:.4rem;color:var(--muted)}
input,textarea,select{
  display:block;width:100%;min-width:0;min-height:40px;border:1px solid var(--line-strong);border-radius:var(--r);
  background:var(--surface);color:var(--ink);padding:.55rem .8rem;transition:border-color .15s,box-shadow .15s
}
input::placeholder,textarea::placeholder{color:var(--muted);opacity:.85}
input:focus,textarea:focus,select:focus{outline:none;border-color:var(--brand);box-shadow:var(--ring)}
select{
  appearance:none;padding-right:2.2rem;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23808a93' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right .7rem center;background-size:16px
}
textarea{resize:vertical;min-height:120px;line-height:1.55}
input[type=checkbox]{width:18px;height:18px;min-height:0;flex:none;padding:0;accent-color:var(--brand)}
fieldset{border:0;padding:0;margin:0;min-width:0}
kbd{
  font-family:inherit;font-size:.6875rem;color:var(--muted);background:var(--surface);border:1px solid var(--line);
  border-radius:5px;padding:0 5px;line-height:1.6;white-space:nowrap
}
.sr-only{
  position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;
  border:0
}
.icon-definitions{display:none}
.nav-icon{
  width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.75;stroke-linejoin:round;stroke-linecap:round;
  flex:none
}
@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{scroll-behavior:auto!important;transition:none!important;animation:none!important}
}
}

@layer components {
.skip-link:not(:focus){clip-path:inset(50%)}
.skip-link{
  position:absolute;top:-100px;left:1rem;z-index:100;padding:.75rem 1rem;border-radius:var(--r);
  background:var(--surface);box-shadow:var(--pop-shadow)
}
.skip-link:focus{top:max(1rem,env(safe-area-inset-top))}

/* Buttons: capsules with one primary fill; secondary is a quiet fill. */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:.4rem;min-height:36px;padding:.45rem 1rem;
  border-radius:999px;background:var(--brand);color:var(--on-brand);font-size:.875rem;font-weight:600;line-height:1.3;
  white-space:nowrap;transition:background-color .15s,filter .15s,transform .15s var(--ease)
}
.btn:hover{text-decoration:none;filter:brightness(1.06)}
.btn:active{transform:scale(.97)}
.btn .nav-icon{width:16px;height:16px;stroke-width:2.2}
.btn-secondary{background:var(--fill);color:var(--ink)}
.btn-secondary:hover{background:var(--fill-strong);filter:none}
.btn-quiet{background:transparent;color:var(--brand);padding-inline:.7rem}
.btn-quiet:hover{background:var(--fill);filter:none}
.btn-danger{background:var(--danger);color:var(--surface)}
.btn-small{min-height:30px;padding:.3rem .8rem;font-size:.8125rem}
.wide-btn{width:100%}
.danger-text{color:var(--danger)!important}
.actions,.card-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.icon-button{
  display:inline-grid;place-items:center;flex:none;width:36px;height:36px;border-radius:50%;
  background:var(--fill);color:var(--ink);transition:background-color .15s,transform .15s var(--ease)
}
.icon-button:hover{background:var(--fill-strong);text-decoration:none}
.icon-button:active{transform:scale(.94)}
.icon-button.is-filtered{background:var(--brand-soft);color:var(--brand)}

/* Floating glass controls, used by the compact shell and sheets. Grouped buttons sit on the group's glass. */
:not(.glass-group)>.glass-button,.glass-group,.mobile-tabbar{
  border:1px solid var(--glass-edge);background:var(--glass-bg);-webkit-backdrop-filter:var(--glass-filter);
  backdrop-filter:var(--glass-filter);box-shadow:var(--glass-shadow)
}
.glass-button{
  display:inline-grid;place-items:center;flex:none;width:48px;height:48px;border-radius:50%;color:var(--ink);
  transition:transform .16s var(--ease),background-color .16s
}
.glass-button:hover{text-decoration:none}
.glass-button:active{transform:scale(.92)}
.glass-button .nav-icon{width:22px;height:22px;stroke-width:1.9}
.glass-group{display:flex;align-items:center;border-radius:999px;padding:0 4px}
.glass-group>.glass-button{width:46px}

/* Badges, chips, avatars. */
.badge{
  display:inline-flex;align-items:center;gap:5px;min-width:0;max-width:100%;padding:2px 9px;border-radius:999px;
  background:var(--fill);color:var(--ink);font-size:.75rem;font-weight:560;line-height:1.5;white-space:normal
}
.badges{display:flex;flex-wrap:wrap;gap:5px;min-width:0;max-width:100%}
.label-color{width:8px;height:8px;flex:none}
.count-badge{
  display:inline-grid;place-items:center;min-width:20px;height:20px;padding:0 6px;border-radius:999px;
  background:var(--brand);color:var(--on-brand);font-size:.6875rem;font-weight:700;line-height:1;
  font-variant-numeric:tabular-nums
}
.avatar{
  display:inline-grid;place-items:center;flex:none;width:28px;height:28px;border-radius:50%;
  background:var(--brand-soft);color:var(--brand);font-size:.6875rem;font-weight:700;letter-spacing:.02em
}
.state-icon{width:18px;height:18px;flex:none;fill:none;stroke:currentColor;stroke-width:1.6;color:var(--muted)}
.state-InProgress{color:var(--warn)}
.state-Done{color:var(--brand)}

/* Fields. */
.field{margin-bottom:1rem;min-width:0;position:relative}
.field small{display:block;margin-top:.35rem;font-size:.8125rem}
.field-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem}
.form-stack{display:grid;gap:1rem}
.form-stack .field{margin:0}
.field-icon{position:absolute;left:12px;top:50%;translate:0 -50%;color:var(--muted);pointer-events:none}
.search-field input{padding-left:38px;border-color:transparent;background:var(--fill)}
.search-field input:focus{background:var(--surface)}
.checklist{display:flex;gap:8px;flex-wrap:wrap}
.checklabel{
  display:flex;align-items:center;gap:8px;margin:0;color:var(--ink);padding:.45rem .75rem;border-radius:999px;
  background:var(--fill);font-size:.875rem;font-weight:500
}
.error,.validation-summary-errors,.notice{
  margin-bottom:1rem;padding:.8rem 1rem;border-radius:var(--r);font-size:.875rem
}
.error,.validation-summary-errors{background:var(--danger-soft);color:var(--danger)}
.validation-summary-errors ul{margin:0;padding-left:1.1rem}
.validation-summary-valid{display:none}
.input-validation-error{border-color:var(--danger)}
.notice{background:var(--brand-soft)}
.live-notice{display:flex;align-items:center;gap:1rem}
.live-notice span{flex:1}
.draft-notice{margin:0 0 .75rem;font-size:.8125rem}

/* Chip filters: selects read as compact pills; auto-submit hides the fallback button. */
.filters,.work-scope{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:20px}
.filters .field,.work-scope .field{margin:0}
.filters .search-field{flex:1 1 260px}
.chip-field{max-width:100%}
.chip-field select,.discussion-filter select{
  field-sizing:content;width:auto;border:0;border-radius:999px;font-weight:500
}
.chip-field select{
  max-width:100%;overflow:hidden;text-overflow:ellipsis;padding:.3rem 2rem .3rem .85rem;background-color:var(--fill);
  font-size:.8125rem;background-position:right .55rem center;background-size:14px
}
input[type=search]::-webkit-search-cancel-button{
  -webkit-appearance:none;appearance:none;width:16px;height:16px;border-radius:50%;
  background:var(--muted) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m5.5 5.5 5 5m0-5-5 5'/%3E%3C/svg%3E") center/16px;
  opacity:.7;cursor:pointer
}
.chip-field select:focus{box-shadow:0 0 0 3px color-mix(in srgb,var(--brand) 25%,transparent)}
.js-enabled .filter-submit{display:none}

/* Page headings and sections. */
.page-heading{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;margin-bottom:20px}
.page-heading>div:first-child{min-width:0;flex:1 1 200px}
.page-heading p{margin-top:2px;color:var(--muted);font-size:.875rem}
.eyebrow{
  margin-bottom:.5rem;color:var(--muted);font-size:.75rem;font-weight:650;letter-spacing:.08em;text-transform:uppercase
}
.section-title{margin:1.5rem 0 .75rem}
.section-heading{display:flex;align-items:center;flex-wrap:wrap;gap:8px 12px;margin-bottom:10px}
.section-heading>span{color:var(--muted);font-size:.8125rem}
.stack{display:grid;gap:24px}

/* Lists: full-width rows with inset hairlines. */
.list-card,.card-grid{border-radius:var(--r-lg);background:var(--surface);overflow:hidden}
.issue-row,.project-card{
  position:relative;display:flex;align-items:center;gap:12px;width:100%;min-height:56px;padding:12px 16px;
  color:var(--ink);text-align:left;transition:background-color .12s
}
.issue-row:hover,.project-card:hover{background:color-mix(in srgb,var(--fill) 60%,transparent);text-decoration:none}
.issue-row:active,.project-card:active{background:var(--fill)}
:is(.list-card,.card-grid)>*+*::before{
  content:"";position:absolute;top:0;left:46px;right:0;border-top:1px solid var(--line)
}
:is(.list-card,.card-grid)>*{position:relative}
.issue-content{display:flex;flex-direction:column;min-width:0;flex:1}
.issue-title{font-weight:560;line-height:1.35}
.issue-meta{display:flex;flex-wrap:wrap;gap:2px 6px;margin-top:2px;color:var(--muted);font-size:.8125rem}
.issue-meta>*+*::before{content:"·";margin-right:6px}
.issue-row>.badges{flex:0 1 40%;justify-content:flex-end}
.insight-chip{
  align-self:flex-start;margin-top:6px;padding:2px 8px;border-radius:6px;background:var(--warn-soft);color:var(--ink);
  font-size:.75rem;font-weight:560
}
.project-card h2{font-size:.9375rem;font-weight:600}
.project-card>div{min-width:0;flex:1}
.project-card::after,.notification .issue-row::after,.tree-row::after{content:""}
.project-card::after,.notification .issue-row::after,.tree-row::after,.side-nav>a::after,.workspace-tree a::after{
  flex:none;width:8px;height:8px;margin-left:auto;border:solid var(--muted);border-width:1.75px 1.75px 0 0;rotate:45deg;
  opacity:.6
}
.project-icon{
  display:grid;place-items:center;flex:none;width:32px;height:32px;padding:6px;border-radius:10px;
  background:var(--brand-soft);color:var(--brand);font-size:.75rem;font-weight:700
}
.pagination{display:flex;justify-content:center;margin-top:12px}

/* Segmented control: a capsule track with one filled segment. */
.segmented{display:flex;min-width:0;border-radius:999px;background:var(--card)}
.segmented>*{
  display:flex;align-items:center;justify-content:center;flex:1 0 auto;min-width:0;min-height:44px;padding:0 14px;
  border-radius:999px;color:var(--muted);font-size:.9375rem;white-space:nowrap;
  transition:background-color .2s var(--ease),color .2s
}
.segmented>:hover{color:var(--ink);text-decoration:none}
.segmented>[aria-current]{background:var(--brand-soft);color:var(--ink);font-weight:600}
.segmented-compact>*{min-height:36px;padding:0 12px;font-size:.8125rem}

/* Grouped sections: a quiet title above one rounded card, rows or stat cells inside, an optional footer. */
.group{display:grid;gap:8px;min-width:0}
.group-title,.section-heading h2,.work-group>h2,.work-section-heading h2{
  padding:0 8px;color:var(--muted);font-size:.875rem;font-weight:560;letter-spacing:0
}
.group-card{min-width:0;overflow:hidden;border-radius:var(--r-xl);background:var(--card)}
.group-footer{padding:0 8px;color:var(--muted);font-size:.8125rem;line-height:1.45}
.group-footer a{color:inherit;text-decoration:underline}
.group-row{display:flex;align-items:center;gap:12px;min-height:56px;padding:14px 16px;color:var(--ink)}
.group-row+.group-row{border-top:1px solid var(--line)}
a.group-row:hover,a.stat-cell:hover{background:color-mix(in srgb,var(--fill) 55%,transparent);text-decoration:none}
.group-row>strong{flex:1;min-width:0;font-weight:500}
.row-value{font-variant-numeric:tabular-nums;font-weight:500}
.share-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:8px 10px}
.share-row>:is(.share-bar,small){grid-column:1/-1}
.share-row>small{font-size:.8125rem}
.share-bar{display:block;width:100%;height:4px;overflow:hidden;border-radius:999px;background:var(--fill)}
.dot{
  display:inline-block;flex:none;width:9px;height:9px;border-radius:50%;background:currentColor;color:var(--line-strong)
}
.tone-bug,.tone-high,.tone-regression{color:var(--danger)}
.tone-feature,.tone-low{color:var(--brand)}
.tone-maintenance,.tone-medium,.tone-incomplete,.tone-attention{color:var(--warn)}
.tone-question,.tone-scope_change{color:var(--info)}
.tone-unknown{color:var(--muted)}
.stat-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
.stat-cell{display:flex;flex-direction:column;gap:2px;min-width:0;padding:16px;color:var(--ink)}
.stat-cell>span{color:var(--muted);font-size:.875rem}
.stat-cell>strong{
  font-size:1.3125rem;font-weight:560;font-variant-numeric:tabular-nums;letter-spacing:-.01em;line-height:1.35
}
.stat-cell>small{font-size:.8125rem;opacity:.85}
@media(min-width:900px){.stat-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}

/* Cards and grouped settings sections. */
.card{border-radius:var(--r-lg);background:var(--surface);padding:20px}
.card-heading{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px;margin-bottom:6px}
.card-heading>:first-child,.setting-row>:first-child,.member-row>:first-child{min-width:0}
.card-heading h2{color:var(--muted);font-size:.8125rem;font-weight:600}
.member-row,.setting-row{
  display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px;padding:12px 0;
  border-top:1px solid var(--line)
}
.member-row strong,.setting-row strong{font-size:.9375rem;font-weight:590}
.member-row p,.setting-row p{margin-top:2px;color:var(--muted);font-size:.8125rem}
.setting-row>.badge{justify-self:start}
.setting-row>.dialog-disclosure:not([open]){justify-self:end}
.setting-row>.dialog-disclosure[open]:not([data-dialog-bound]){grid-column:1/-1;width:100%}
.setting-row>.dialog-disclosure[open]:not([data-dialog-bound])>summary{margin-bottom:16px}
.dialog-content>.card-actions,.dialog-disclosure>.card-actions{margin-top:20px}
.empty{padding:48px 24px;text-align:center}
.empty-symbol{
  display:block;width:40px;height:40px;margin:0 auto 14px;fill:none;stroke:var(--muted);stroke-width:1.4;
  stroke-linejoin:round;stroke-linecap:round;opacity:.7
}
.empty h2{margin-bottom:6px}
.empty p{max-width:380px;margin:0 auto 18px;color:var(--muted)}
.code-block,.markdown pre{padding:12px 14px;border-radius:var(--r);background:var(--fill)}
.code-block{font-size:.875rem;line-height:1.7}
#projects .setting-row a{color:var(--ink)}

/* Dialogs: centered on roomy screens, bottom sheets on phones and short windows. */
.form-dialog{
  width:min(560px,calc(100vw - 48px));max-height:calc(100dvh - 64px);padding:0;overflow:auto;border:0;
  border-radius:24px;background:var(--surface);color:var(--ink);box-shadow:var(--pop-shadow);overscroll-behavior:contain
}
.form-dialog::backdrop{background:rgb(10 16 22 / .38)}
.dialog-header{
  position:sticky;top:0;z-index:1;display:grid;grid-template-columns:44px minmax(0,1fr) 44px;align-items:center;
  padding:12px 12px 4px;background:var(--surface)
}
.dialog-header h2{grid-column:2;font-weight:700;text-align:center}
.dialog-close{
  grid-column:3;justify-self:end;display:grid;place-items:center;width:36px;height:36px;border-radius:50%;
  background:var(--fill);font-size:1.4rem;line-height:1;transition:transform .15s var(--ease)
}
.dialog-close:active{transform:scale(.92)}
.dialog-content{padding:12px 22px 22px}
.dialog-content>form>.field:last-of-type{margin-bottom:0}
.dialog-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:8px;margin-top:20px}
.dialog-actions>.muted{margin-right:auto;font-size:.75rem}
.js-enabled .dialog-disclosure[data-dialog-external][data-dialog-bound],button[data-dialog-target]:not([data-bound]){
  display:none
}
.confirm-dialog{width:min(420px,calc(100vw - 48px))}
.confirm-dialog .dialog-header{grid-template-columns:minmax(0,1fr);padding:22px 22px 0}
.confirm-dialog .dialog-header h2{grid-column:1}
.confirm-dialog .dialog-content{text-align:center;color:var(--muted)}
.confirm-dialog .dialog-actions{display:grid;grid-template-columns:1fr 1fr}
@media(max-width:639px),(max-height:560px){
  .form-dialog{
    width:100%;max-width:none;max-height:calc(100dvh - 12px - env(safe-area-inset-top));margin:auto 0 0;
    border-radius:30px 30px 0 0;padding-bottom:env(safe-area-inset-bottom)
  }
  .form-dialog::before{
    content:"";display:block;width:38px;height:5px;margin:8px auto 0;border-radius:3px;background:var(--line-strong)
  }
  .dialog-content{padding:12px max(16px,env(safe-area-inset-right)) 16px max(16px,env(safe-area-inset-left))}
  .dialog-header{padding-inline:max(16px,env(safe-area-inset-right)) max(16px,env(safe-area-inset-left))}
  .form-dialog .dialog-actions{position:sticky;bottom:0;padding:12px 0 4px;background:var(--surface)}
  .form-dialog .dialog-actions>.btn{flex:1}
  .dialog-actions>.muted{display:none}
  .confirm-dialog{margin:auto;width:min(360px,calc(100vw - 32px));border-radius:24px;padding-bottom:0}
  .confirm-dialog::before{display:none}
}
@media(prefers-reduced-motion:no-preference){
  .form-dialog[open]{animation:sheet-in .28s var(--ease)}
  @media(min-width:640px) and (min-height:561px){.form-dialog[open]{animation-name:dialog-in}}
}
@keyframes sheet-in{from{translate:0 100%}}
@keyframes scroll-edge{from{opacity:0}}
@keyframes dialog-in{from{opacity:0;scale:.96}}

/* Menus: anchored popovers on desktop, sheets on compact screens. */
.property-popover{position:relative;min-width:0;max-width:100%}
.property-popover>summary{
  display:flex;align-items:center;gap:8px;min-width:0;min-height:34px;padding:6px 10px;border-radius:10px;
  font-size:.8125rem
}
.property-popover>summary:hover,.property-popover[open]>summary{background:var(--fill)}
.property-popover>summary>span:not(.state-icon){min-width:0}
.property-popover>summary>kbd{margin-left:auto;opacity:0;transition:opacity .15s}
.property-popover>summary:hover>kbd,.property-popover:focus-within>summary>kbd{opacity:1}
.popover-panel{
  position:absolute;z-index:40;top:calc(100% + 6px);right:0;width:250px;max-width:calc(100vw - 40px);max-height:340px;
  padding:6px;overflow:auto;border:1px solid var(--line);border-radius:14px;background:var(--surface);
  box-shadow:var(--pop-shadow)
}
.popover-heading{padding:6px 10px;color:var(--muted);font-size:.75rem;font-weight:600}
.menu-option{
  display:flex;align-items:center;gap:10px;width:100%;min-width:0;min-height:34px;padding:7px 10px;border-radius:9px;
  font-size:.875rem;font-weight:450;text-align:left;background:transparent
}
.menu-option:hover{background:var(--fill)}
.menu-option.checklabel{background:transparent}
.menu-option[aria-current]{font-weight:600}
.menu-check{margin-left:auto;color:var(--brand);font-size:1.05rem;font-weight:700}
.popover-empty{padding:8px 10px;font-size:.875rem}
.popover-panel .wide-btn{margin-top:6px}
@media(max-width:1023px){
  @media(prefers-reduced-motion:no-preference){
    .product-body .property-popover[open] .popover-panel{animation:sheet-in .26s var(--ease)}
  }
  .product-body:has(.property-popover[open])::before{
    content:"";position:fixed;inset:0;z-index:55;background:rgb(0 0 0 / .22)
  }
  .popover-heading{padding:6px 12px 10px;color:var(--ink);font-size:1.0625rem;font-weight:700;text-align:center}
  .menu-option{padding:12px 14px;border-radius:16px;font-size:1rem}
}

/* Markdown. */
.markdown{font-size:.9375rem;line-height:1.6}
.markdown>:first-child{margin-top:0}
.markdown>:last-child{margin-bottom:0}
.markdown p{margin:.6rem 0}
.markdown :is(h1,h2,h3){margin:1.2rem 0 .4rem;font-size:1.0625rem}
.markdown :is(ul,ol){margin:.5rem 0}
.markdown li+li{margin-top:.2rem}
.markdown pre{font-size:.85rem}
.markdown pre code{padding:0;background:none}
.markdown blockquote{margin:.6rem 0;padding-left:12px;border-left:3px solid var(--line-strong);color:var(--muted)}
.markdown a{text-decoration:underline;text-underline-offset:2px}
.markdown table{display:block;max-width:100%;overflow-x:auto;border-collapse:collapse;font-size:.875rem}
.markdown :is(th,td){
  min-width:8rem;padding:.5rem .7rem;border-bottom:1px solid var(--line);text-align:left;vertical-align:top
}
.issue-description{white-space:pre-wrap}
.issue-description.markdown{white-space:normal}
.markdown-editor{overflow:hidden;border:1px solid var(--line-strong);border-radius:var(--r);background:var(--surface)}
.markdown-editor:focus-within{border-color:var(--brand);box-shadow:var(--ring)}
.markdown-editor textarea{
  min-height:150px;padding:12px 14px;border:0;border-radius:0;box-shadow:none!important;resize:none
}
.editor-tabs{display:flex;align-items:center;gap:2px;margin:8px 8px 0;border-radius:999px;background:var(--fill)}
.editor-tabs button{
  flex:0 0 auto;min-height:30px;padding:3px 16px;border-radius:999px;color:var(--muted);font-size:.8125rem;
  font-weight:560
}
.editor-tabs button[aria-selected=true]{background:var(--brand-soft);color:var(--ink);font-weight:600}
.editor-tabs>span{margin-left:auto;padding-right:8px;color:var(--muted);font-size:.75rem}
.editor-preview{min-height:150px;padding:12px 14px}
.editor-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:8px;padding-top:10px}
.editor-actions>.muted,.editor-actions>small{margin-right:auto;font-size:.75rem}
.new-issue-title{
  min-height:44px;padding:4px 0;border:0;border-bottom:1px solid var(--line);border-radius:0;background:transparent;
  font-size:1.25rem;font-weight:650;box-shadow:none!important
}
}

@layer shell {
.brand{
  display:inline-flex;align-items:center;gap:10px;color:var(--ink);font-size:1rem;font-weight:700;letter-spacing:-.02em
}
.brand:hover{text-decoration:none}
.brand-mark{
  display:block;width:28px;height:28px;flex:none;border-radius:8px;background:url("/favicon.svg") center/cover
}
.app-dock,.sheet-title{display:none}

/* Desktop: persistent sidebar beside an edge-to-edge reading surface. */
@media(min-width:1024px){
  .product-body{background:var(--surface);font-size:14px}
  .app-frame{display:flex;align-items:flex-start;min-height:100dvh}
  .app-sidebar{
    position:sticky;inset:0 auto auto;z-index:20;display:flex;flex-direction:column;gap:2px;width:248px;height:100dvh;
    margin:0;padding:14px 12px 12px;overflow-y:auto;overscroll-behavior:contain;border:0;
    border-right:1px solid var(--line);background:var(--sidebar);color:var(--ink)
  }
  .sidebar-top{display:flex;align-items:center;min-height:36px;padding:0 6px 10px}
  .sheet-close{display:none}
  .sidebar-main{flex:1}
  .sidebar-create{width:100%;margin-bottom:6px}
  .sidebar-search{
    display:flex;align-items:center;gap:10px;min-height:34px;margin-bottom:10px;padding:0 10px;border-radius:8px;
    color:var(--muted);font-size:.8125rem
  }
  .sidebar-search:hover{background:var(--fill);text-decoration:none}
  .sidebar-search[aria-current]{background:var(--fill-strong);color:var(--ink);font-weight:600}
  .sidebar-search kbd{margin-left:auto}
  .side-nav{display:flex;flex-direction:column;gap:1px}
  .side-nav a,.sidebar-theme,.workspace-tree a{
    display:flex;align-items:center;gap:10px;min-height:32px;padding:5px 10px;border-radius:8px;color:var(--ink);
    font-size:.8125rem
  }
  .side-nav a,.sidebar-theme{width:100%;font-weight:500;text-align:left}
  .workspace-tree a{gap:9px}
  .side-nav :is(a,button) .nav-icon{color:var(--muted)}
  .side-nav a:hover,.sidebar-theme:hover{background:var(--fill);text-decoration:none}
  .side-nav a[aria-current]{background:var(--fill-strong);font-weight:600}
  .side-nav a[aria-current] .nav-icon{color:var(--ink)}
  .side-nav .count-badge{margin-left:auto}
  .sidebar-section{
    margin:18px 10px 6px;color:var(--muted);font-size:.6875rem;font-weight:650;letter-spacing:.06em;
    text-transform:uppercase
  }
  .sidebar-bottom{padding-top:12px}
  .app-content{flex:1;min-width:0}
  .app-bar{display:flex;align-items:center;max-width:1144px;margin:0 auto;padding:18px 32px 0}
  .app-bar:not(:has(.breadcrumbs)),.app-bar>:not(.breadcrumbs){display:none}
  .product-body .main-shell{width:100%;max-width:1144px;margin:0 auto;padding:20px 32px 64px}
  .product-body .main-shell:is([data-live-page="/Settings"],[data-live-page="/Account"],[data-live-page="/Device"],
    [data-live-page="/Capture"])>*{
    max-width:880px
  }
  .product-body :is(.card,.list-card,.card-grid){border:1px solid var(--line);border-radius:var(--r)}
}
@media(min-width:1500px){.app-sidebar{width:264px}}

.breadcrumbs ol{display:flex;flex-wrap:wrap;align-items:center;gap:4px;padding:0;list-style:none;font-size:.8125rem}
.breadcrumbs li+li::before{content:"/";margin-right:4px;color:var(--line-strong)}
.breadcrumbs a{color:var(--muted)}
.breadcrumbs a:hover{color:var(--ink)}
.breadcrumbs [aria-current]{font-weight:560}

/* Workspace tree, shared by the sidebar and the compact menu sheet. */
.workspace-tree,.project-children{padding:0;list-style:none}
.workspace-branch+.workspace-branch{margin-top:8px}
.workspace-tree a:hover{background:var(--fill);text-decoration:none}
.workspace-tree a[aria-current]{background:var(--fill-strong);font-weight:600}
.workspace-tree .workspace-link{font-weight:600}
.workspace-tree .nav-icon{color:var(--muted)}
.workspace-link>span,.project-name{min-width:0;flex:1}
.project-children{margin-left:18px}
.project-marker{flex:none;width:6px;height:6px;border-radius:50%;background:var(--line-strong);font-size:0}
.workspace-tree a[aria-current] .project-marker{background:var(--brand)}
.workspace-tree .archived{color:var(--muted)}
.archive-marker{flex:none;padding:0 6px;border-radius:999px;background:var(--fill);font-size:.6875rem}
.empty-project-link{color:var(--muted)!important}
.empty-project-link .project-marker{background:none;font-size:.875rem;width:auto;height:auto}

/* Compact: floating glass controls over the canvas, a tab dock, and a menu sheet. */
@media(max-width:1023px){
  .product-body{font-size:16px;line-height:1.45}
  html{
    scroll-padding-top:calc(76px + env(safe-area-inset-top));
    scroll-padding-bottom:calc(110px + env(safe-area-inset-bottom))
  }
  .app-bar{
    position:sticky;top:0;z-index:30;display:flex;align-items:center;gap:10px;
    padding:max(10px,env(safe-area-inset-top)) max(14px,env(safe-area-inset-right)) 10px
      max(14px,env(safe-area-inset-left));
    pointer-events:none
  }
  .app-bar>*{pointer-events:auto}
  .app-bar::before{
    content:"";position:absolute;inset:0 0 -16px;animation:scroll-edge linear both;animation-timeline:scroll(root);
    animation-range:0 48px;z-index:-1;
    background:linear-gradient(var(--bg) 35%,color-mix(in srgb,var(--bg) 0%,transparent));
    -webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);mask-image:linear-gradient(#000 55%,transparent)
  }
  .app-bar .breadcrumbs{display:none}
  .app-bar-brand .brand-mark{width:26px;height:26px}
  .app-bar-title{display:flex;flex-direction:column;flex:1;min-width:0;line-height:1.2;pointer-events:none}
  .app-bar-title>*{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .app-bar-title strong{font-size:1.0625rem;letter-spacing:-.01em}
  .app-bar-title span{margin-top:1px;color:var(--muted);font-size:.8125rem}
  .product-body .page-heading h1,.product-body .page-heading>div:first-child>p{
    position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap
  }
  .product-body .page-heading>div:first-child{flex:0 0 0}
  .product-body .page-heading{justify-content:flex-end}
  .product-body .page-heading:not(:has(>:nth-child(2))){margin:0}
  .product-body .main-shell{
    max-width:760px;margin:0 auto;
    padding:6px max(16px,env(safe-area-inset-right)) calc(136px + env(safe-area-inset-bottom))
      max(16px,env(safe-area-inset-left))
  }
  .product-body .main-shell[data-live-page="/Issue"]{max-width:820px}

  .app-dock{
    position:fixed;z-index:25;left:max(14px,env(safe-area-inset-left));right:max(14px,env(safe-area-inset-right));
    bottom:max(12px,env(safe-area-inset-bottom));display:flex;align-items:center;gap:10px;max-width:520px;margin:0 auto
  }
  .mobile-tabbar{display:flex;flex:1;min-width:0;gap:2px;padding:4px;border-radius:999px}
  .mobile-tabbar a{
    position:relative;display:flex;flex:1;flex-direction:column;align-items:center;justify-content:center;gap:1px;
    min-width:0;min-height:54px;padding:4px 2px;border-radius:999px;color:var(--ink);font-size:.6875rem;font-weight:600;
    line-height:1.2;transition:color .16s,background-color .16s,transform .16s var(--ease)
  }
  .mobile-tabbar a:active{transform:scale(.95)}
  .mobile-tabbar a[aria-current]{background:color-mix(in srgb,var(--ink) 9%,transparent);color:var(--brand)}
  .mobile-tabbar .nav-icon{width:24px;height:24px;stroke-width:1.8}
  .mobile-tabbar span{white-space:nowrap}
  .tab-badge{position:absolute;top:3px;left:calc(50% + 6px)}
  .create-button{
    display:grid;place-items:center;width:62px;height:62px;border-radius:50%;background:var(--brand);
    color:var(--on-brand);box-shadow:var(--glass-shadow);transition:transform .16s var(--ease)
  }
  .create-button:active{transform:scale(.92)}
  .create-button .nav-icon{width:26px;height:26px;stroke-width:2.2}
  .product-body::after{
    content:"";position:fixed;z-index:24;inset:auto 0 0;height:calc(96px + env(safe-area-inset-bottom));
    background:linear-gradient(color-mix(in srgb,var(--bg) 0%,transparent),var(--bg) 80%);pointer-events:none
  }
  .product-body:has(dialog[open],.app-sidebar:popover-open,.property-popover[open]) .app-dock{visibility:hidden}
  .property-popover>summary>kbd,.sidebar-search kbd{display:none}

  /* Sheets rise from the bottom edge under a grabber. */
  .app-sidebar:popover-open,.product-body .property-popover .popover-panel{
    position:fixed;inset:auto 0 0;width:min(100%,560px);margin:0 auto;border:0;border-top:1px solid var(--glass-edge);
    box-shadow:var(--pop-shadow)
  }
  .app-sidebar:popover-open{
    z-index:50;display:flex;flex-direction:column;max-height:min(88dvh,760px);
    padding:8px max(16px,env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom))
      max(16px,env(safe-area-inset-left));
    overscroll-behavior:contain;border-radius:32px 32px 0 0;background:var(--sheet);color:var(--ink)
  }
  .product-body .property-popover .popover-panel{
    z-index:60;max-width:none;max-height:min(520px,calc(100dvh - 80px));
    padding:8px max(14px,env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom))
      max(14px,env(safe-area-inset-left));
    border-radius:30px 30px 0 0
  }
  .app-sidebar::before,.product-body .property-popover .popover-panel::before{
    content:"";display:block;flex:none;width:38px;height:5px;margin:0 auto 6px;border-radius:3px;
    background:var(--line-strong)
  }
  /* The navigation sheet reuses the sidebar with grouped sections. */
  .app-sidebar::backdrop{background:rgb(0 0 0 / .32)}
  .sidebar-top{
    position:sticky;top:-8px;z-index:1;display:grid;grid-template-columns:48px 1fr 48px;align-items:center;
    margin:0 -4px 8px;padding:4px 0;background:var(--sheet)
  }
  .sidebar-top .brand{display:none}
  .sheet-title{display:block;grid-column:2;text-align:center;font-size:1.0625rem;font-weight:700}
  .sheet-close{grid-column:3;justify-self:end}
  .tab-destination,.sidebar-create,.sidebar-search{display:none!important}
  .sidebar-section{margin:18px 16px 6px;color:var(--muted);font-size:.8125rem;font-weight:500}
  .side-nav,.workspace-navigation{
    display:flex;flex-direction:column;border-radius:var(--r-lg);background:var(--surface);overflow:hidden
  }
  .side-nav:not(:has(a:not(.tab-destination))){display:none}
  .sidebar-bottom{margin-top:20px}
  .side-nav>:is(a,button),.workspace-tree a{
    position:relative;display:flex;align-items:center;gap:14px;width:100%;padding:10px 16px;
    color:var(--ink);font-weight:450;text-align:left
  }
  .side-nav>:is(a,button):not(.tab-destination)~:is(a,button)::before,.workspace-tree li+li>a::before,
  .project-children>li:first-child>a::before{
    content:"";position:absolute;top:0;left:52px;right:0;border-top:1px solid var(--line)
  }
  .side-nav>:is(a,button) .nav-icon{width:22px;height:22px}
  .side-nav>a::after,.workspace-tree a::after{content:"";opacity:.55}
  .side-nav a[aria-current],.workspace-tree a[aria-current]{background:var(--fill)}
  .workspace-branch+.workspace-branch{margin-top:0}
  .workspace-tree .nav-icon{width:22px;height:22px}
  .project-children{margin-left:0}
  .project-children a{padding-left:52px}
  .workspace-tree .project-marker{position:absolute;left:25px}
}
}

@layer pages {
/* Issue detail. */
.issue-layout{
  display:grid;grid-template-areas:"title" "properties" "reading";grid-template-columns:minmax(0,1fr);gap:16px;
  align-items:start
}
.title-edit{grid-area:title;min-width:0}
.title-display{display:flex;align-items:flex-start;gap:8px}
.product-body .title-display h1{font-size:1.5rem}
.edit-affordance{
  display:inline-grid;place-items:center;flex:none;width:32px;height:32px;border-radius:50%;color:var(--muted)
}
.title-input{font-size:1.25rem;font-weight:650}
.issue-properties{grid-area:properties;display:flex;flex-wrap:wrap;align-items:center;gap:6px;min-width:0}
.issue-properties>.property-popover>summary,.issue-kind-property,.issue-context>summary{
  min-height:34px;padding:6px 12px;border-radius:999px;background:var(--fill);font-size:.8125rem;font-weight:560
}
.issue-properties>.property-popover>summary:hover{background:var(--fill-strong)}
.issue-kind-property{display:flex;align-items:center;gap:6px}
.issue-advance .btn{min-height:34px}
.issue-advance .state-icon{width:16px;height:16px;color:currentColor}
.issue-properties .muted{font-weight:450}
.issue-properties .property-value{max-width:16rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.issue-properties .property-labels{order:3;flex-basis:100%}
.issue-danger>summary{width:34px;padding:0!important;justify-content:center}
.issue-context{order:1;min-width:0;font-size:.8125rem}
.issue-danger{order:2}
.issue-context>summary{display:flex;align-items:center;gap:6px}
.issue-context>summary::after{
  content:"";width:6px;height:6px;border:solid currentColor;border-width:0 1.5px 1.5px 0;rotate:45deg;translate:0 -2px
}
.issue-context[open]{flex-basis:100%;padding:12px 16px;border-radius:var(--r-lg);background:var(--fill)}
.issue-context[open]>summary{min-height:0;padding:0;background:none}
.issue-properties dl{
  display:grid;grid-template-columns:max-content minmax(0,1fr);gap:6px 14px;margin:10px 0 0;font-size:.8125rem
}
.issue-properties dt{color:var(--muted)}
.issue-properties dd{margin:0}
.issue-reading{grid-area:reading;min-width:0;max-width:800px}
.description-edit{min-width:0;padding:18px 20px;border-radius:var(--r-lg);background:var(--surface)}
.description-edit .icon-button{width:32px;height:32px;background:transparent;color:var(--muted)}
.description-edit [data-inline-display]{cursor:text}
.discussion-section{margin-top:28px}
.discussion-section .section-heading{justify-content:space-between}
.discussion-filter{display:flex;align-items:center;gap:8px}
.discussion-filter select{
  min-height:32px;padding:.25rem 2rem .25rem .8rem;background-color:transparent;color:var(--brand)
}
.timeline-event{display:flex;align-items:baseline;gap:10px;padding:6px 0 6px 12px;color:var(--muted);font-size:.8125rem}
.timeline-event p{flex:1;min-width:0}
.timeline-event strong{color:var(--ink);font-weight:560}
.timeline-event time{font-size:.75rem;white-space:nowrap}
.timeline-dot{flex:none;width:6px;height:6px;border-radius:50%;background:var(--line-strong);translate:0 -1px}
.comment-card{margin:10px 0;padding:14px 16px;border-radius:var(--r-lg);background:var(--card)}
.comment-header{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px}
.comment-author{display:flex;align-items:center;flex-wrap:wrap;gap:8px;min-width:0}
.comment-author strong{font-size:.875rem;font-weight:600}
.comment-author :is(time,small){font-size:.75rem}
.comment-menu>summary{width:32px;min-height:32px;justify-content:center;padding:0;color:var(--muted)}
.comment-menu .popover-panel{width:180px}
.comment-insights{margin:6px 0}
.js-enabled .inline-comment-editor>summary,.js-enabled .inline-comment-editor:not([open]){display:none}
[data-inline-edit][data-bound]>[data-inline-disclosure]>summary{display:none}
.comment-composer{
  margin-top:16px;padding:12px 14px;border:1px solid var(--line-strong);border-radius:var(--r-lg);
  background:var(--surface)
}
.comment-composer:focus-within{border-color:var(--brand);box-shadow:var(--ring)}
.comment-composer textarea{min-height:64px;padding:0;border:0;box-shadow:none!important;resize:none}
.conflict-notice{margin-top:12px;font-size:.8125rem}
.conflict-notice .checklabel{align-items:flex-start;margin-top:10px}
.conflict-notice details{margin-top:8px}
.conflict-notice .issue-description{max-height:220px;overflow:auto;padding:8px}
@media(min-width:1024px){
  .product-body .issue-layout{padding-top:4px}
  .description-edit{padding:0;background:none;border-radius:0}
}
@media(min-width:1280px){
  .issue-layout{
    grid-template-areas:"title properties" "reading properties";grid-template-columns:minmax(0,1fr) 240px;
    column-gap:40px
  }
  .issue-properties{
    position:sticky;top:20px;flex-direction:column;align-items:stretch;gap:2px;padding-left:20px;
    border-left:1px solid var(--line)
  }
  .issue-properties>.property-popover>summary,.issue-kind-property,.issue-context>summary{
    border-radius:10px;background:transparent
  }
  .issue-properties>.property-popover>summary:hover{background:var(--fill)}
  .issue-danger{align-self:flex-start}
  .issue-properties .property-labels{margin:8px 10px 0}
}
@media(min-width:1024px) and (max-width:1279px){
  .issue-properties :is(.issue-kind-control,[data-shortcut=s])>.popover-panel{left:0;right:auto}
}

/* Public pages. */
.public-body{background:var(--surface)}
.app-header{padding-top:env(safe-area-inset-top)}
.header-inner{
  display:flex;align-items:center;justify-content:space-between;gap:1rem;max-width:1120px;margin:auto;
  padding:16px max(20px,env(safe-area-inset-right)) 16px max(20px,env(safe-area-inset-left))
}
.header-inner nav{display:flex;align-items:center;gap:12px}
.header-inner nav a{color:var(--ink);font-weight:600}
.public-body .main-shell{
  max-width:1120px;min-height:calc(100dvh - 140px);margin:auto;
  padding:32px max(20px,env(safe-area-inset-right)) 48px max(20px,env(safe-area-inset-left))
}
.app-footer{
  max-width:1120px;margin:auto;text-align:center;
  padding:16px max(20px,env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom))
    max(20px,env(safe-area-inset-left));
  color:var(--muted);font-size:.8125rem
}
.hero{max-width:720px;margin:3rem auto;text-align:center}
.hero h1{font-size:clamp(2.4rem,7vw,4rem);line-height:1.05;letter-spacing:-.045em;font-weight:750}
.hero>p{max-width:540px;margin:1.25rem auto 1.75rem;color:var(--muted);font-size:1.125rem}
.hero .actions{justify-content:center}
.hero .btn{min-height:48px;padding-inline:1.5rem;font-size:1rem}
.hero .eyebrow{margin-bottom:1.25rem}
.hero-example{
  max-width:560px;margin:3rem auto;overflow:hidden;border:1px solid var(--line);border-radius:var(--r-xl);
  background:var(--surface);box-shadow:var(--glass-shadow);text-align:left
}
.hero-example header{
  padding:12px 18px;border-bottom:1px solid var(--line);color:var(--muted);font-size:.8125rem;font-weight:600
}
.hero-example .issue-row+.issue-row{border-top:1px solid var(--line)}

.narrow{max-width:420px;margin:1.5rem auto}
.narrow .card{padding:24px;border:1px solid var(--line)}
.public-body .narrow .card{background:var(--bg);border:0}
.auth-heading{margin-bottom:1.5rem;text-align:center}
.auth-heading h1{font-size:1.75rem}
.auth-heading p{margin-top:.5rem;color:var(--muted)}
.auth-links{margin-top:1rem;text-align:center;font-size:.875rem}
.narrow .btn.wide-btn{min-height:44px}

/* Compact reading: plain full-width lists, grouped cards for settings and editors. */
@media(max-width:1023px){
  .product-body h1{font-size:1.75rem;letter-spacing:-.03em}
  .product-body :is(.list-card,.card-grid){margin-inline:-16px;border-radius:0;background:transparent}
  .product-body :is(.issue-row,.project-card){padding:14px 16px;min-height:64px}
  .product-body :is(.issue-row,.project-card):hover{background:transparent}
  .product-body :is(.issue-row,.project-card):active{background:var(--fill)}
  .issue-title{font-size:1rem}
  .issue-row{flex-wrap:wrap}
  .issue-row>.badges{flex-basis:100%;justify-content:flex-start}
  .product-body .list-card .empty{padding:40px 16px}
  .product-body .card{border-radius:22px}
  .filters,.work-scope{flex-wrap:nowrap;overflow-x:auto;margin-inline:-16px;padding:2px 16px 4px;scrollbar-width:none}
  .filters::-webkit-scrollbar,.work-scope::-webkit-scrollbar{display:none}
  .filters .search-field{flex:0 0 calc(100vw - 32px);max-width:640px}
  .filters:has(.search-field){flex-wrap:wrap;overflow:visible;padding-bottom:0}
  .filters:has(.search-field) .search-field{flex:1 1 100%;max-width:none}
  .field-row{grid-template-columns:1fr}
  .product-body .page-heading .btn:not(.btn-secondary){background:var(--fill);color:var(--ink)}
  .timeline-event{flex-wrap:wrap}
}
@media(max-width:599px){
  .setting-row>form,.setting-row>a.btn,.setting-row>.dialog-disclosure:has(>.btn){grid-column:1/-1;justify-self:start}
}

/* Install guidance. */
[data-pwa-install] details>p{margin:8px 0 12px;color:var(--muted)}
[data-pwa-install-button]{display:none}
:root[data-pwa-install-available] [data-pwa-install-button]{display:inline-flex}
:root[data-pwa-installed] [data-pwa-install]{display:none}
@media(display-mode:standalone){[data-pwa-install]{display:none}}
}

/* Touch sizing: any coarse pointer gets 44-point targets and 16-pixel fields. */
@media(max-width:1023px),(any-pointer:coarse){
  .btn,.icon-button,.edit-affordance,.dialog-close,.editor-tabs button,.menu-option,.property-popover>summary,
  .issue-kind-property,.issue-context>summary,.dialog-disclosure>summary,.checklabel,.side-nav a,.sidebar-theme,
  .workspace-tree a,.sidebar-search{
    min-width:44px;min-height:44px
  }
  .icon-button,.edit-affordance,.dialog-close,.comment-menu>summary,.issue-danger>summary{width:44px;height:44px}
  .btn-small{padding-inline:1rem}
  input:not([type=checkbox]),textarea,select{min-height:44px}
  input:not([type=checkbox],.new-issue-title,.title-input),textarea,select{font-size:16px}
}

/* Accessibility preferences: glass becomes solid, borders gain contrast. */
@media(prefers-reduced-transparency:reduce),(prefers-contrast:more){
  :root{
    --glass-bg:var(--surface);--glass-filter:none;--glass-edge:var(--line-strong);
    --glass-shadow:0 2px 10px rgb(0 0 0 / .12)
  }
  .app-bar::before{-webkit-backdrop-filter:none;backdrop-filter:none;background:var(--bg);mask-image:none}
}
@media(prefers-contrast:more){
  :root{--line:var(--muted);--line-strong:var(--ink)}
  .mobile-tabbar a[aria-current]{outline:1.5px solid currentColor;outline-offset:-3px}
}
@media(forced-colors:active){
  :root{--glass-bg:Canvas;--glass-filter:none;--glass-edge:CanvasText;--glass-shadow:none}
  .glass-button,.glass-group,.mobile-tabbar,.app-sidebar:popover-open,.popover-panel,.form-dialog,.create-button,
  .dialog-close{
    border:1px solid CanvasText;box-shadow:none
  }
  .mobile-tabbar a[aria-current]{outline:2px solid Highlight;outline-offset:-3px}
  .app-bar::before,.product-body::after{display:none}
}
.markdown li:has(>input[type=checkbox]){list-style:none;margin-left:-1.3rem}
.markdown li>input[type=checkbox]{
  appearance:none;display:inline-block;margin:0 8px 0 0;vertical-align:-3px;border:1.5px solid var(--line-strong);
  border-radius:50%
}
.markdown li>input[type=checkbox]:checked{
  border-color:var(--brand);
  background:var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 9.3 2.6 2.6L13 6.5'/%3E%3C/svg%3E") center/18px
}
.markdown li:has(>input:checked){color:var(--muted)}

/* Native page navigation only: live updates and editors do not start transitions. */
@media(max-width:1023px) and (prefers-reduced-motion:no-preference) and (scripting:enabled){
  @view-transition{navigation:auto}

  /* Floating controls stay in place while the page beneath cross-fades. */
  .app-bar-brand,.app-bar-back{view-transition-name:app-leading}
  .app-bar-actions{view-transition-name:app-actions}
  .app-bar-title{view-transition-name:app-title}
  .mobile-tabbar{view-transition-name:mobile-tabs}
  .create-button{view-transition-name:mobile-create}
  .mobile-tabbar a{isolation:isolate}
  .mobile-tabbar a[aria-current]{background:transparent}
  .mobile-tabbar a[aria-current]::before{
    content:"";position:absolute;inset:0;z-index:-1;border-radius:inherit;
    background:color-mix(in srgb,var(--ink) 9%,transparent);view-transition-name:mobile-selection
  }

  ::view-transition-group(*){animation-duration:240ms;animation-timing-function:var(--ease)}
  ::view-transition-old(*),::view-transition-new(*){animation-duration:200ms;animation-timing-function:ease-out}
  ::view-transition-group(mobile-selection){z-index:1}
  ::view-transition-group(mobile-tabs){z-index:0}
}

/* Signed-in screens: lists, Home, search, capture, settings. */
.work-scope select,.global-search select{contain:paint}
.work-groups{display:grid;gap:28px}
.work-group>h2{margin:0 0 8px}
.work-group>.list-card{overflow:visible}
.work-empty{padding:14px 16px;color:var(--muted);font-size:.9375rem}
.work-item{display:flex;align-items:center;min-width:0}
.work-item>.issue-row{flex:1;min-width:0;padding-left:8px;background:transparent}
.work-state{order:-1;flex:none;position:relative;margin-left:8px}
.work-state>summary{display:grid;place-items:center;width:34px;height:34px;padding:0;border-radius:50%}
.work-state>summary .state-icon{width:20px;height:20px}
.work-state .popover-panel{left:0;right:auto;min-width:200px}
.global-search{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-bottom:6px}
.global-search .field{margin:0}
.global-search .search-field{flex:1 1 280px}
.search-status{min-height:22px;margin-bottom:10px;font-size:.8125rem}
.work-section-heading{
  display:flex;align-items:baseline;justify-content:space-between;flex-wrap:wrap;gap:4px 16px;margin:0 0 8px
}
.work-section-heading>.muted{font-size:.75rem}
.search-result{align-items:flex-start}
.search-result .state-icon{margin-top:2px}
.search-excerpt{
  display:-webkit-box;margin-top:6px;overflow:hidden;color:var(--muted);font-size:.875rem;line-height:1.5;
  white-space:pre-line;-webkit-box-orient:vertical;-webkit-line-clamp:2
}
.capture-form{padding:20px 22px}
.capture-form .new-issue-title{font-size:1.375rem}
.capture-labels>summary{display:flex;align-items:center;gap:6px;min-height:44px;font-weight:560}
.capture-labels .field{margin-top:8px}
.insight-evidence a{display:block;padding:12px;border-radius:var(--r);background:var(--fill)}
.notification .issue-row{align-items:flex-start;padding-left:30px}
.notification .issue-row>time{flex:none;margin-top:2px;font-size:.75rem}
.notification-message{color:var(--muted);font-size:.875rem}
.unread-dot{position:absolute;left:12px;top:21px;width:9px;height:9px;border-radius:50%;background:var(--brand)}
.notification-unread .issue-title{font-weight:700}
.notification+.notification::before{left:30px}
@media(max-width:1023px){
  .work-item>.issue-row{padding-left:6px}
  .work-state{margin-left:4px}
  .notification .issue-row>time{order:-1;flex-basis:100%;margin:0 0 2px;text-align:left}
}
/* Workspaces: each workspace heads a grouped list of its projects with open-work counts. */
.home,.home-focus,.workspace-list{display:grid;gap:24px;max-width:880px}
/* Wide windows keep what needs you beside the project tree. */
@media(min-width:1280px){
  .home{grid-template-columns:minmax(0,1fr) minmax(300px,360px);align-items:start;max-width:1100px}
  .home-focus{align-content:start}
  .workspace-list{position:sticky;top:20px}
}
.group-heading{display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding-right:8px}
.group-heading>a{font-size:.875rem;font-weight:560}
.new-workspace{justify-self:start}
.tree-heading{display:flex;align-items:center;gap:8px;padding-left:8px}
.tree-heading>a:first-child{
  display:flex;align-items:center;gap:10px;flex:1;min-width:0;min-height:44px;color:var(--ink)
}
.tree-heading h2{min-width:0;font-size:1rem;font-weight:700}
.tree-heading .project-icon{width:26px;height:26px;padding:0;border-radius:8px;font-size:.6875rem}
.tree-count{color:var(--muted);font-size:.875rem;font-weight:560}
.tree-action{display:grid;place-items:center;flex:none;width:40px;height:40px;border-radius:50%;color:var(--muted)}
.tree-action:hover,.edit-affordance:hover,.description-edit .icon-button:hover{background:var(--fill);color:var(--ink)}
.tree-row{min-height:60px;padding:10px 16px}
.tree-row>.nav-icon{color:var(--muted)}
.tree-row::after{margin-left:4px}
.tree-text{display:flex;flex-direction:column;flex:1;min-width:0}
.tree-text strong{font-weight:560}
.tree-text small{font-size:.8125rem}
.tree-progress{
  display:inline-flex;align-items:center;gap:5px;flex:none;padding:3px 10px 3px 7px;border-radius:999px;
  background:var(--warn-soft);color:var(--warn);font-size:.8125rem;font-weight:650;font-variant-numeric:tabular-nums
}
.tree-progress .state-icon{width:15px;height:15px}
.tree-empty{min-height:48px}
/* Rows with a state menu: the menu escapes clipping while open; touch rows swipe right to advance. */
:is(.list-card,.group-card):has(.work-state[open]){overflow:visible}
.work-item{touch-action:pan-y}
.work-item.swiping::after{
  content:attr(data-swipe-label);position:absolute;inset:0;z-index:0;display:flex;align-items:center;padding-left:18px;
  background:var(--fill);color:var(--muted);font-size:.875rem;font-weight:650
}
.work-item.swipe-armed::after{background:var(--brand-soft);color:var(--brand)}
.work-item.swiping>.issue-row{position:relative;z-index:1;background:var(--surface)}
.work-item:not(.swiping)>.issue-row{transition:transform .2s var(--ease)}
@media(max-width:1023px){.work-item.swiping>.issue-row{background:var(--bg)}}
.project-list-flat{margin-left:0}
.tree-archive>summary{min-height:48px;color:var(--muted);font-size:.875rem}
.tree-archive>summary,.tree-archive>.tree-row{border-top:1px solid var(--line)}
.tree-archive .tree-row{opacity:.75}
.tree-heading>.group-title{flex:1;padding:0}
/* Project states: one segmented control with counts above the list. */
.project-states{max-width:560px;margin-bottom:16px;overflow-x:auto;scrollbar-width:none}
.segment-count{margin-left:4px;color:var(--muted);font-weight:500;font-variant-numeric:tabular-nums}
/* Review: agent-finished work with Reopen and Accept beside each row. */
.group-heading>.muted{font-size:.8125rem}
.review-item{flex-wrap:wrap}
.review-item>.issue-row{flex:1 1 240px}
.review-actions{display:flex;gap:8px;padding:0 16px 14px 36px}
@media(min-width:700px){.review-actions{padding:0 16px 0 0}}
.search-projects,.search-recent{margin-bottom:24px}
/* Attention signals on Home: chips that open My work filtered to the signal. */
.signal-chips{display:flex;flex-wrap:wrap;gap:8px}
.signal-chip{
  display:inline-flex;align-items:center;gap:5px;min-height:36px;padding:6px 14px;border-radius:999px;
  background:var(--warn-soft);color:var(--ink);font-size:.875rem
}
.signal-chip strong{color:var(--warn);font-variant-numeric:tabular-nums}
.signal-chip:hover{background:color-mix(in srgb,var(--warn) 22%,transparent);text-decoration:none}
/* Project controls: search and a filter button share one row. */
.project-filters{flex-wrap:nowrap}
.project-filters>.search-form{display:flex;flex:1;min-width:0}
.project-filters .search-field{flex:1}
.icon-button.field-button{width:44px;height:44px}
/* Account and workspace settings: grouped sections with the title and its action above one card. */
.settings-group>.group-heading{align-items:center;min-height:36px;padding-right:4px}
.settings-group>.group-heading>div{min-width:0}
.settings-group>.group-heading .icon-button{background:transparent;color:var(--brand)}
.settings-group>.group-heading .icon-button:hover{background:var(--fill)}
.settings-card :is(.setting-row,.member-row){padding:12px 16px}
.settings-card>:is(.setting-row,.member-row):first-child,
.settings-card>:first-child>:is(.setting-row,.member-row):first-child{
  border-top:0
}
.settings-card p.muted{margin:0;padding:14px 16px}
.settings-subtitle{
  padding:14px 16px 2px;border-top:1px solid var(--line);color:var(--muted);font-size:.8125rem;font-weight:600
}
.settings-padded{padding:2px 16px}
.settings-padded>details>summary{display:flex;align-items:center;min-height:48px;font-weight:560}
.settings-padded>details[open]{padding-bottom:16px}

/* Metrics: tabs, period controls, one hero chart card, then grouped totals and breakdowns. */
.metrics-content,.metrics-issues{display:grid;gap:24px;max-width:880px}
.metrics-issues{margin-top:24px;scroll-margin-top:100px}
.metrics-controls{display:flex;flex-wrap:wrap;gap:12px}
.metrics-controls>.segmented{flex:1 1 150px;max-width:420px}
.metrics-controls>.metrics-series{flex:0 1 auto}
.metric-hero{display:grid;gap:16px;min-width:0;padding:16px 16px 14px;border-radius:var(--r-xl);background:var(--card)}
.hero-top{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.hero-figure{display:grid;gap:2px;min-width:0}
.hero-figure h2{color:var(--muted);font-size:.875rem;font-weight:500;letter-spacing:0}
.hero-figure a{justify-self:start;color:var(--ink)}
.hero-figure strong{font-size:2.25rem;font-variant-numeric:tabular-nums;letter-spacing:-.03em;line-height:1.15}
.hero-figure a>span,.hero-figure p{color:var(--muted);font-size:.875rem}
.hero-figure a>span{margin-left:4px}
.hero-aside{color:var(--muted);font-size:.8125rem;opacity:.85;white-space:nowrap}
.hero-legend{
  display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:6px 16px;color:var(--muted);
  font-size:.8125rem
}
.hero-legend>*{display:inline-flex;align-items:center;gap:6px;color:inherit}
.hero-legend .dot{width:8px;height:8px}
.hero-legend .state-InProgress{color:color-mix(in srgb,var(--warn) 55%,var(--surface))}
.metrics-trend{display:flex;gap:2px;height:180px;min-width:0}
.metrics-trend.dense{gap:1px}
.metrics-trend>a{flex:1 1 0;min-width:0;border-radius:3px}
.metrics-trend>a:hover{background:var(--fill)}
.metrics-trend svg{display:block;width:100%;height:100%}
:is(.metrics-trend,.share-bar) rect{fill:currentColor}
.metric-completed{color:var(--brand)}
.metric-created{color:color-mix(in srgb,var(--ink) 78%,transparent)}
.split-bar{display:block;width:100%;height:28px;border-radius:8px;background:var(--fill)}
.split-bar path{stroke:var(--muted);opacity:.45}
.split-rest{fill:url(#todo-hatch)}
.split-fill{fill:color-mix(in srgb,var(--warn) 55%,var(--surface))}
.dot-hatch{background:repeating-linear-gradient(135deg,var(--muted) 0 1px,transparent 1px 3px)}
.group-disclosure>summary{display:flex;align-items:center;justify-content:space-between;min-height:52px;padding:0 16px}
.metrics-table-scroll{max-height:360px;overflow:auto;overscroll-behavior:contain;border-top:1px solid var(--line)}
.metrics-table-scroll table{width:100%;border-collapse:collapse;font-size:.875rem;font-variant-numeric:tabular-nums}
.metrics-table-scroll :is(th,td){padding:6px 16px;text-align:right;white-space:nowrap}
.metrics-table-scroll th:first-child{text-align:left;font-weight:500}
.metrics-table-scroll thead{position:sticky;top:0;background:var(--surface);color:var(--muted);font-size:.8125rem}
.metrics-table-scroll td a{display:inline-grid;place-items:center;min-width:32px;min-height:32px;color:var(--ink)}
@media(any-pointer:coarse){.metrics-table-scroll td a{min-width:44px;min-height:44px}}
.metrics-bar{display:flex;flex-wrap:wrap;align-items:center;gap:12px}
.metrics-bar>.segmented{flex:1;max-width:560px}
.metrics-bar>details{margin-left:auto}
.metrics-bar .icon-button{width:44px;height:44px;background:var(--card)}
.metrics-bar .icon-button.is-filtered{background:var(--brand-soft)}

/* Insights. */
.insight-panel{min-width:0;margin-top:16px;padding:2px 20px;border-radius:var(--r-lg);background:var(--card)}
.insight-disclosure>summary{display:flex;align-items:center;flex-wrap:wrap;gap:8px 12px;min-height:48px;font-weight:600}
.insight-disclosure>summary>.insight-chip{margin-top:0}
:is(.tree-archive,.group-disclosure,.insight-disclosure,[data-pwa-install] details)>summary::after{
  content:"";width:7px;height:7px;margin-left:auto;border:solid var(--muted);border-width:0 1.75px 1.75px 0;
  rotate:45deg;translate:0 -2px;transition:rotate .2s
}
:is(.tree-archive,.group-disclosure,.insight-disclosure,[data-pwa-install] details)[open]>summary::after{
  rotate:225deg;translate:0 2px
}
.insight-disclosure[open]{padding-bottom:12px}
.insight-caption{margin:8px 0 12px;color:var(--muted);font-size:.8125rem;line-height:1.5}
.insight-signals{margin:10px 0;padding:0;list-style:none}
.insight-signals li{
  display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:44px;font-size:.875rem
}
.insight-signals li+li{border-top:1px solid var(--line)}
.insight-evidence{display:grid;gap:8px;margin:12px 0}
.insight-evidence a{color:var(--ink)}
.insight-evidence a:hover{background:var(--fill-strong)}
.insight-source{display:block;margin-bottom:4px;color:var(--muted);font-size:.75rem;font-weight:600}
.insight-quote{display:block;max-height:10rem;overflow:auto;font-size:.875rem;line-height:1.55;white-space:pre-wrap}
.insight-corrections{margin:8px 0 0}
.insight-corrections>summary{
  display:flex;align-items:center;min-height:44px;color:var(--brand);font-size:.875rem;font-weight:560
}
.insight-correction{
  display:grid;grid-template-columns:minmax(110px,1fr) minmax(140px,2fr) auto;align-items:center;gap:10px;margin:10px 0
}
.insight-correction label{margin:0;font-size:.8125rem}
.issue-kind{white-space:nowrap}
.assignee-avatar{width:26px;height:26px;font-size:.625rem}
@media(max-width:1023px){
  .insight-correction{grid-template-columns:minmax(0,1fr) auto}
  .insight-correction label{grid-column:1/-1}
}
/* Live regions without content take no space. */
:is(.badges,.home-focus,.comment-insights,.metrics-issues,.dock-create):not(:has(*)){display:none}
