/* ISIONXXX // ui — styles for ui.js. Tokens are --ui-* custom properties: override them on any ancestor to retheme.
   Dim text is #8f8a7e (5.7:1 on the panel) instead of the apps' #78746a (4.0:1, under the 4.5:1 WCAG AA minimum). */
:root{
  --ui-bg:#070707;--ui-panel:#0c0c0c;--ui-line:#1c1c1c;--ui-line2:#2c2c2c;--ui-track:#161616;
  --ui-tx:#d9d5c8;--ui-dim:#8f8a7e;--ui-amber:#ffb000;--ui-green:#33ff66;--ui-red:#ff5a5a;--ui-on-amber:#000;
  --ui-f:'IBM Plex Mono',ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;--ui-tap:44px;--ui-ease:cubic-bezier(.2,.8,.2,1);
}
.ui-sr{position:absolute!important;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}

/* status */
.ui-status{flex:none;display:inline-flex;align-items:center;gap:5px;font:600 10px var(--ui-f);letter-spacing:.12em;text-transform:uppercase;padding:3px 7px;border:1px solid var(--ui-line2);color:var(--ui-dim);white-space:nowrap}
.ui-status.ui-ok{color:var(--ui-green);border-color:#1d6b3f}.ui-status.ui-bad{color:var(--ui-red);border-color:#6b1d1d}
.ui-status.ui-live{color:var(--ui-green);border-color:#1d6b3f}.ui-status.ui-live i{width:6px;height:6px;border-radius:50%;background:currentColor;animation:ui-pulse 1.6s ease-in-out infinite}
@keyframes ui-pulse{50%{opacity:.25}}

/* meter */
.ui-meter{margin-top:12px}
.ui-meter-row{display:flex;justify-content:space-between;gap:8px;font:11px var(--ui-f);color:var(--ui-dim);margin-bottom:5px}.ui-meter-row b{color:var(--ui-tx);font-weight:500;white-space:nowrap}
.ui-meter-bar{height:6px;background:var(--ui-track);overflow:hidden}
.ui-meter-bar i{display:block;height:100%;background:var(--ui-amber);transition:width .5s var(--ui-ease)}
.ui-meter.ui-done .ui-meter-bar i{background:var(--ui-green)}

/* week */
.ui-week{display:grid;grid-template-columns:repeat(7,1fr);gap:4px;margin:14px 0 0;padding:0;list-style:none}
.ui-week li{display:flex;flex-direction:column;align-items:center;gap:4px;font:9px var(--ui-f);color:var(--ui-dim)}
.ui-week li.ui-today{color:var(--ui-amber)}
.ui-week i{display:block;width:100%;height:6px;background:var(--ui-track)}
.ui-week i.ui-on{background:var(--ui-amber)}.ui-week i.ui-half{background:rgba(255,176,0,.38)}.ui-week i.ui-pos{background:var(--ui-green)}.ui-week i.ui-neg{background:var(--ui-red)}
.ui-week i.ui-live{background:var(--ui-amber);animation:ui-pulse 1.6s ease-in-out infinite}

/* buttons */
.ui-btn{position:relative;display:inline-flex;align-items:center;justify-content:center;min-height:var(--ui-tap);padding:10px 14px;border:1px solid var(--ui-line2);background:none;color:var(--ui-tx);font:600 11px var(--ui-f);letter-spacing:.1em;text-transform:uppercase;cursor:pointer;-webkit-tap-highlight-color:transparent;touch-action:manipulation;transition:background-color .15s,border-color .15s,color .15s,transform .12s}
.ui-btn:hover:not(:disabled){border-color:var(--ui-amber);color:var(--ui-amber)}
.ui-btn:active:not(:disabled){transform:scale(.97)}
.ui-btn.ui-primary{background:var(--ui-amber);border-color:var(--ui-amber);color:var(--ui-on-amber)}.ui-btn.ui-primary:hover:not(:disabled){filter:brightness(1.1);color:var(--ui-on-amber)}
.ui-btn.ui-ghost{border-color:transparent;color:var(--ui-dim)}
.ui-btn:disabled{opacity:.45;cursor:not-allowed}
.ui-btn.ui-busy{opacity:1;cursor:progress}.ui-btn.ui-busy span{color:transparent}
.ui-btn.ui-busy::after{content:'';position:absolute;width:14px;height:14px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:ui-spin .7s linear infinite}
@keyframes ui-spin{to{transform:rotate(1turn)}}

/* card: one button stretched over the card opens it; actions sit above that layer */
.ui-card{position:relative;display:flex;flex-direction:column;min-width:0;background:var(--ui-panel);border:1px solid var(--ui-line);padding:16px;color:var(--ui-tx);font-family:var(--ui-f);transition:border-color .15s}
.ui-card:hover{border-color:var(--ui-line2)}
.ui-card:has(.ui-card-open:focus-visible){outline:2px solid var(--ui-amber);outline-offset:2px}
.ui-card-head{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:4px}
.ui-card-head h3{margin:0;font:inherit}
.ui-card-open{all:unset;cursor:pointer;font:600 11px var(--ui-f);letter-spacing:.16em;text-transform:uppercase;color:var(--ui-amber)}
.ui-card-open::before{content:'> ';color:var(--ui-dim)}
.ui-card-open::after{content:'';position:absolute;inset:0}
.ui-card .ui-status,.ui-card .ui-actions{position:relative;z-index:1}
.ui-big{margin:2px 0;font:600 24px/1.25 var(--ui-f);overflow-wrap:anywhere}.ui-big.ui-pos{color:var(--ui-green)}.ui-big.ui-neg{color:var(--ui-red)}
.ui-sub{margin:0;font:12px/1.5 var(--ui-f);color:var(--ui-dim)}
.ui-rows{margin:8px 0 0;font:12px var(--ui-f)}.ui-rows>div{display:flex;justify-content:space-between;gap:8px;padding:3px 0;border-top:1px solid var(--ui-line)}
.ui-rows dt{color:var(--ui-dim);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-rows dd{margin:0;white-space:nowrap}
.ui-actions{display:flex;gap:8px;margin-top:14px}.ui-actions .ui-btn{flex:1}
.ui-week{margin-top:auto;padding-top:14px}

/* segmented + rating */
.ui-seg{display:flex;min-width:0}
.ui-seg>button{flex:1;min-width:var(--ui-tap);min-height:var(--ui-tap);border:1px solid var(--ui-line2);background:none;color:var(--ui-tx);font:13px var(--ui-f);cursor:pointer;-webkit-tap-highlight-color:transparent;touch-action:manipulation;transition:background-color .15s,color .15s}
.ui-seg>button+button{border-left:0}
.ui-seg>button[aria-checked=true]{background:var(--ui-amber);border-color:var(--ui-amber);color:var(--ui-on-amber);font-weight:600}
.ui-seg>button:disabled{opacity:.45;cursor:not-allowed}
.ui-rating{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.ui-field-label{font:12px var(--ui-f);color:var(--ui-dim)}.ui-field-label em{font-style:normal;color:var(--ui-amber);margin-left:6px}
.ui-rating .ui-seg{flex:0 1 220px}

/* choice list */
.ui-list{display:flex;flex-direction:column;border-top:1px solid var(--ui-line)}
.ui-list>button{display:flex;align-items:center;gap:12px;width:100%;min-height:var(--ui-tap);padding:10px 4px;border:0;border-bottom:1px solid var(--ui-line);background:none;color:var(--ui-tx);font:13px var(--ui-f);text-align:left;cursor:pointer;-webkit-tap-highlight-color:transparent;transition:background-color .15s,color .15s}
.ui-list>button::before{content:'';flex:none;width:9px;height:9px;border-radius:50%;border:1px solid var(--ui-line2);transition:background-color .15s,border-color .15s,box-shadow .15s}
.ui-list.ui-multi>button::before{width:15px;height:15px;border-radius:2px;display:grid;place-items:center;font:600 10px/1 var(--ui-f);color:var(--ui-on-amber)}
.ui-list>button[aria-checked=true]{color:var(--ui-amber);background:rgba(255,176,0,.06)}
.ui-list>button[aria-checked=true]::before{background:var(--ui-amber);border-color:var(--ui-amber);box-shadow:0 0 10px rgba(255,176,0,.55)}
.ui-list.ui-multi>button[aria-checked=true]::before{content:'✓';box-shadow:none}
.ui-list>button:disabled{opacity:.45;cursor:not-allowed}
.ui-list-label{min-width:0;overflow-wrap:anywhere}
.ui-list em{margin-left:auto;padding-left:8px;font-style:normal;font-size:11px;color:var(--ui-dim);text-align:right}
.ui-list>button[aria-checked=true] em{color:var(--ui-amber)}
.ui-empty-inline{margin:0;font:12px var(--ui-f);color:var(--ui-dim)}

/* stepper */
.ui-stepper{display:inline-flex;align-items:center;gap:4px}
.ui-stepper>button{width:var(--ui-tap);height:var(--ui-tap);border:1px solid var(--ui-line2);background:none;color:var(--ui-tx);font:16px var(--ui-f);cursor:pointer;touch-action:manipulation;transition:transform .12s}
.ui-stepper>button:active:not(:disabled){transform:scale(.94)}.ui-stepper>button:disabled{opacity:.35;cursor:not-allowed}
.ui-stepper>output{min-width:72px;text-align:center;font:600 16px var(--ui-f);color:var(--ui-tx);padding:6px 2px}

/* empty + loading */
.ui-empty{display:flex;flex-direction:column;align-items:flex-start;gap:8px;padding:18px;border:1px dashed var(--ui-line2);font-family:var(--ui-f)}
.ui-empty-title{margin:0;font:600 13px var(--ui-f);color:var(--ui-tx)}
.ui-skeleton{display:flex;flex-direction:column;gap:10px;padding:16px;border:1px solid var(--ui-line);background:var(--ui-panel)}
.ui-skeleton i{display:block;height:12px;background:linear-gradient(90deg,var(--ui-track) 0,#222 50%,var(--ui-track) 100%);background-size:200% 100%;animation:ui-shimmer 1.3s linear infinite}
@keyframes ui-shimmer{to{background-position:-200% 0}}

/* toast */
.ui-toast{position:fixed;left:50%;bottom:calc(var(--isx-tabs,24px) + 16px);transform:translate(-50%,8px);max-width:min(90vw,420px);padding:10px 14px;background:var(--ui-panel);border:1px solid var(--ui-amber);color:var(--ui-amber);font:12px var(--ui-f);opacity:0;pointer-events:none;transition:opacity .2s,transform .2s var(--ui-ease);z-index:50}
.ui-toast.ui-on{opacity:1;transform:translate(-50%,0)}.ui-toast.ui-bad{border-color:var(--ui-red);color:var(--ui-red)}

/* focus: always visible for keyboard users, never for taps */
.ui-btn:focus-visible,.ui-seg>button:focus-visible,.ui-list>button:focus-visible,.ui-stepper>button:focus-visible,.ui-stepper>output:focus-visible{outline:2px solid var(--ui-amber);outline-offset:2px;position:relative;z-index:2}
.ui-card-open:focus-visible{outline:none}

/* small screens: rating scales take the full row */
@media(max-width:420px){.ui-rating .ui-seg{flex-basis:100%}}
/* motion + forced colours */
@media(prefers-reduced-motion:reduce){.ui-status i,.ui-week i.ui-live,.ui-skeleton i,.ui-btn.ui-busy::after{animation:none}.ui-meter-bar i,.ui-btn,.ui-toast{transition:none}}
@media(forced-colors:active){.ui-meter-bar,.ui-week i{border:1px solid CanvasText}.ui-meter-bar i,.ui-week i.ui-on,.ui-week i.ui-pos{background:Highlight}.ui-seg>button[aria-checked=true],.ui-list>button[aria-checked=true]{outline:2px solid Highlight}}

/* hero */
.ui-hero{position:relative;overflow:hidden;background:radial-gradient(120% 90% at 0% 0%,rgba(255,176,0,.10),transparent 60%),var(--ui-panel);border:1px solid var(--ui-line);padding:18px 16px 16px;margin-bottom:12px;color:var(--ui-tx);font-family:var(--ui-f)}
.ui-hero-top{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.ui-hero h2{margin:0;font:600 18px var(--ui-f);letter-spacing:.02em}.ui-hero .ui-sub{margin-top:4px}
.ui-hero-big{margin:0;text-align:right;font-size:11px;color:var(--ui-dim)}.ui-hero-big b{display:block;font-size:26px;line-height:1.1;color:var(--ui-amber);font-weight:600}.ui-hero-big span{display:block;margin-top:2px}.ui-hero-big b.ui-pos{color:var(--ui-green)}.ui-hero-big b.ui-neg{color:var(--ui-red)}
/* rings sit in three fixed slots under the title: the same spacing at every width and in every app (an app with two
   rings fills the first two), instead of spreading across whatever width the card has */
.ui-rings{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:8px;margin:16px 0 2px;padding:0;list-style:none}
.ui-ring{display:flex;flex-direction:column;align-items:center;gap:4px;text-align:center}
.ui-ring svg{width:56px;height:56px;transform:rotate(-90deg);overflow:visible}
.ui-ring circle{fill:none;stroke-width:4.5}.ui-rt{stroke:#1d1d1d}
.ui-rf{stroke:var(--ui-amber);stroke-linecap:round;transition:stroke-dasharray 1s var(--ui-ease)}
.ui-rf[data-to="0.0"]{stroke:transparent}   /* empty: a round cap on a zero-length arc would draw a dot */
.ui-ring.ui-done .ui-rf{stroke:var(--ui-green)}
.ui-ck{fill:none;stroke:var(--ui-green);stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round;transform:rotate(90deg);transform-origin:22px 22px;stroke-dasharray:20;animation:ui-ck .5s .5s var(--ui-ease) both}
@keyframes ui-ck{from{stroke-dashoffset:20}}
.ui-ring-l{font-size:9.5px;letter-spacing:.1em;text-transform:uppercase;color:var(--ui-dim)}.ui-ring b{font-size:11.5px;font-weight:500}
.ui-ring.ui-pop svg{animation:ui-pop .6s cubic-bezier(.2,1.6,.4,1)}@keyframes ui-pop{40%{transform:rotate(-90deg) scale(1.2)}}
.ui-hero .ui-actions{margin-top:12px}
/* timeline */
.ui-tl-wrap{background:var(--ui-panel);border:1px solid var(--ui-line);padding:14px 16px;margin-bottom:12px;font-family:var(--ui-f);color:var(--ui-tx)}
.ui-tl-h{margin:0;font:600 11px var(--ui-f);letter-spacing:.16em;text-transform:uppercase;color:var(--ui-amber)}.ui-tl-h::before{content:'> ';color:var(--ui-dim)}
.ui-tl{list-style:none;margin:8px 0 0;padding:0;position:relative}
.ui-tl::before{content:'';position:absolute;left:72px;top:8px;bottom:8px;width:1px;background:var(--ui-line2)}
.ui-tl li{display:grid;grid-template-columns:64px 17px 1fr;align-items:baseline;padding:6px 0;font-size:12.5px}
.ui-tl time{color:var(--ui-dim);font-size:11px;text-align:right;padding-right:4px;white-space:nowrap}
.ui-tl i{width:9px;height:9px;border-radius:50%;background:var(--ui-amber);justify-self:center;align-self:center;position:relative;z-index:1;box-shadow:0 0 0 3px var(--ui-panel)}
.ui-tl li.ui-pos i{background:var(--ui-green)}.ui-tl li.ui-neg i{background:var(--ui-red)}
.ui-tl b{font-size:10px;letter-spacing:.12em;color:var(--ui-dim);font-weight:600;margin-right:4px;text-transform:uppercase}
@media(prefers-reduced-motion:reduce){.ui-rf,.ui-ck,.ui-ring.ui-pop svg{animation:none!important;transition:none!important}}

/* fluid: exits, new entries, charts */
.ui-ghost-bd{position:fixed;inset:0;background:rgba(0,0,0,.6);z-index:2147483645;pointer-events:none;animation:ui-out .26s ease forwards}
/* the exit copy outranks the dialogs' own entrance rules, and its insides don't replay their fade-in */
.ui-ghost.ui-ghost-box{animation:ui-box-out .22s cubic-bezier(.4,0,1,1) forwards!important}
.ui-ghost.ui-ghost-sheet{animation:ui-sheet-out .3s cubic-bezier(.4,0,1,1) forwards!important}
.ui-ghost *{animation:none!important;transition:none!important}
@keyframes ui-out{to{opacity:0}}
@keyframes ui-box-out{to{opacity:0;transform:translateY(14px) scale(.98)}}
@keyframes ui-sheet-out{to{opacity:0;transform:translateY(40%)}}
.ui-tl li.ui-new{animation:ui-new 1.6s var(--ui-ease)}
.ui-tl li.ui-new i,.tl li.ui-new i{animation:ui-dot 1.6s ease}
@keyframes ui-new{from{opacity:0;transform:translateX(-10px);background:rgba(255,176,0,.14)}30%{opacity:1;transform:none;background:rgba(255,176,0,.10)}to{background:transparent}}
@keyframes ui-dot{0%,40%{box-shadow:0 0 0 3px var(--ui-panel),0 0 12px 3px var(--ui-amber)}}
/* lines wipe in left to right. A clip, not a stroke dash: dashes are measured wrongly on stretched charts
   (preserveAspectRatio=none + non-scaling strokes), which left lines stopping short on wide screens */
svg.ui-draw .ui-trace{animation:ui-trace .9s var(--ui-ease) both}
@keyframes ui-trace{from{clip-path:inset(-10% 100% -10% 0)}to{clip-path:inset(-10% 0 -10% 0)}}
svg.ui-draw .ui-grow{transform-box:fill-box;transform-origin:50% 100%;animation:ui-grow .55s var(--ui-ease) both}
@keyframes ui-grow{from{transform:scaleY(0)}}
svg.ui-draw polygon,svg.ui-draw path:not(.ui-trace){animation:ui-fade .8s ease both}
@keyframes ui-fade{from{opacity:0}}
@media(prefers-reduced-motion:reduce){.ui-ghost-bd,.ui-ghost-box,.ui-ghost-sheet,.ui-new,svg.ui-draw *{animation:none!important}}

/* hero log: today's entries inside the Today card, under the rings */
.ui-hero-side{margin:14px 0 0;padding-top:8px;border-top:1px solid var(--ui-line)}.ui-hero-side.ui-empty{display:none}
.ui-hero-side-h{display:none}.ui-hero-log{margin:0}.ui-hero-log::before{top:8px}.ui-hero .ui-tl i{box-shadow:0 0 0 3px #0e0d0a}

/* app header on phones: name and sync status on one row, the buttons in one swipeable row under it */
@media (max-width:640px){
  header.top:not(.th){flex-wrap:wrap;row-gap:10px}
  header.top:not(.th) .acts{flex:1 0 100%;flex-wrap:nowrap;overflow-x:auto;justify-content:flex-start;scrollbar-width:none;-webkit-overflow-scrolling:touch;padding-bottom:2px}
  header.top:not(.th) .acts::-webkit-scrollbar{display:none}
  header.top:not(.th) .acts>*{flex:none}
}

/* wide screens: the Today card in two columns. Left (at most 520 px): title and big number, the rings spread evenly
   across that width and the button the same width under them. Right: today's entries, or a quiet placeholder until
   there are some, so the card never has a hole in the middle. On phones it stays one column and the placeholder hides. */
.ui-hero-none{margin:0;color:var(--ui-dim);font-size:12px}
@media (min-width:700px){
  .ui-hero{display:grid;grid-template-columns:minmax(0,520px) minmax(240px,1fr);column-gap:40px;align-items:start}
  .ui-hero>*{grid-column:1}
  .ui-hero>.ui-hero-side,.ui-hero>.ui-hero-side.ui-empty{grid-column:2;grid-row:1/span 3;align-self:stretch;display:flex;flex-direction:column;margin:0;
    padding:12px 16px 10px;border:1px solid var(--ui-line);background:rgba(0,0,0,.22)}
  .ui-hero-side-h{display:flex;justify-content:space-between;gap:12px;margin-bottom:6px;font:600 10.5px var(--ui-f);letter-spacing:.14em;text-transform:uppercase;color:var(--ui-amber)}
  .ui-hero-side-h span+span{color:var(--ui-dim);font-weight:500;letter-spacing:.08em}
  .ui-hero .ui-tl i{box-shadow:0 0 0 3px #090908}
  .ui-hero-none{flex:1;display:flex;align-items:center;justify-content:center;text-align:center;padding:12px}
}

/* settings dialog rows: label and hint on the left, the control on the right */
.ui-set{margin:6px 0 4px;min-width:min(440px,calc(100vw - 72px))}
.ui-set>div{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:12px 0;border-top:1px solid var(--ui-line)}
.ui-set>div:first-child{border-top:0}
.ui-set b{display:block;font-weight:500;font-size:13px;color:var(--ui-tx);letter-spacing:.02em}
.ui-set small{display:block;margin-top:2px;font-size:11px;color:var(--ui-dim);line-height:1.4}
.ui-set-btns{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end;flex:none}
.ui-set select{flex:none}
button.ui-danger{color:var(--ui-red);border-color:rgba(255,69,69,.45)}button.ui-danger:hover{background:rgba(255,69,69,.1);border-color:var(--ui-red);color:var(--ui-red)}

/* layout rhythm shared by the apps' stat grids (wide screens). Every multi-column row sits on the same four columns
   as the stat cards, so card edges line up from row to row: pairs (.g21 / .gm) are 3/4 + 1/4 (1/2 + 1/2 below 1280 px), three-card rows (.g3)
   are 1/2 + 1/4 + 1/4. A chart card grows its chart to the row's height instead of leaving a blank strip under it. */
@media (min-width:1001px){
  :is(#app,#top) .g21,:is(#app,#top) .gm,:is(#app,#top) .g3{grid-template-columns:repeat(4,minmax(0,1fr))}
  :is(#app,#top) .g21>:first-child,:is(#app,#top) .gm>:first-child{grid-column:span 2}
  :is(#app,#top) .g3>:first-child{grid-column:span 2}
  :is(#app,#top) :is(.g21,.gm,.g3)>.card:has(svg.chart){display:flex;flex-direction:column}
  :is(#app,#top) :is(.g21,.gm,.g3)>.card>.bd:has(>svg.chart){flex:1 1 auto;display:flex;flex-direction:column}
  :is(#app,#top) :is(.g21,.gm,.g3)>.card svg.chart:last-of-type{flex:1 1 auto;min-height:160px;height:auto}
  /* the Today card on the same grid: two equal halves with the grid's 12 px gap put its columns exactly over the
     stat cards' (left half = cards 1-2, right panel = cards 3-4), at any width */
  .ui-hero{grid-template-columns:minmax(0,1fr) minmax(0,1fr);column-gap:12px}
}
/* from 1280 px the side panel of a pair is narrow enough to give the main card (calendar, chart) three columns;
   below that it keeps half, so its label · value rows still fit. Either way the edges stay on the grid */
@media (min-width:1280px){:is(#app,#top) .g21>:first-child,:is(#app,#top) .gm>:first-child{grid-column:span 3}}
/* label · value rows in narrow side panels: the value stays on one line, the label wraps if it must */
@media (min-width:1280px){#app .ev>b{white-space:nowrap}}

/* column filters: the header button and its menu */
.ui-lf{all:unset;box-sizing:border-box;display:inline-flex;align-items:center;gap:5px;cursor:pointer;font:inherit;color:inherit;letter-spacing:inherit;text-transform:inherit;min-height:24px;white-space:nowrap}
.ui-lf i{font-style:normal;font-size:9px;color:var(--ui-line2);transition:color .15s}
.ui-lf:hover,.ui-lf:hover i,.ui-lf[aria-expanded=true] i{color:var(--ui-amber)}
.ui-lf.ui-on,.ui-lf.ui-on i{color:var(--ui-amber)}
.ui-lf:focus-visible{outline:1px solid var(--ui-amber);outline-offset:2px}
.ui-lf-clear{all:unset;cursor:pointer;color:var(--ui-amber);font:inherit;margin-left:10px;text-decoration:underline;text-underline-offset:3px}
.ui-lf-clear:focus-visible{outline:1px solid var(--ui-amber);outline-offset:2px}
.ui-lf-pop{position:fixed;z-index:60;width:min(260px,calc(100vw - 16px));max-height:min(440px,calc(100vh - 16px));display:flex;flex-direction:column;background:var(--ui-panel);border:1px solid var(--ui-line2);box-shadow:0 12px 32px rgba(0,0,0,.6);font:12px var(--ui-f);color:var(--ui-tx);text-transform:none;letter-spacing:0;animation:ui-lf-in .14s var(--ui-ease)}
@keyframes ui-lf-in{from{opacity:0;transform:translateY(-4px)}}
.ui-lf-pop button{all:unset;box-sizing:border-box;cursor:pointer;text-align:center;padding:8px 10px;border:1px solid var(--ui-line2);font:inherit;color:var(--ui-tx)}
.ui-lf-pop button:hover,.ui-lf-pop button:focus-visible{border-color:var(--ui-amber);color:var(--ui-amber)}
.ui-lf-pop button[aria-pressed=true]{background:var(--ui-amber);border-color:var(--ui-amber);color:var(--ui-on-amber)}
.ui-lf-s{display:grid;grid-template-columns:1fr 1fr;gap:6px;padding:10px;border-bottom:1px solid var(--ui-line)}
.ui-lf-q{margin:10px 10px 4px;padding:7px 9px;background:var(--ui-bg);border:1px solid var(--ui-line2);color:var(--ui-tx);font:inherit;outline:0}
.ui-lf-q:focus{border-color:var(--ui-amber)}
.ui-lf-vals{overflow:auto;flex:1 1 auto;min-height:0;padding:0 0 4px}
.ui-lf-pop label.ui-lf-v{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:8px;margin:0;padding:6px 10px;cursor:pointer;min-height:30px;box-sizing:border-box;text-align:left;text-transform:none;letter-spacing:0;font:12px var(--ui-f);color:var(--ui-tx)}
.ui-lf-v[hidden]{display:none}
.ui-lf-v:hover{background:#111}
.ui-lf-v span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ui-lf-v em{color:var(--ui-dim)}.ui-lf-v small{color:var(--ui-dim);font-size:11px}
.ui-lf-pop .ui-lf-allv{border-bottom:1px solid var(--ui-line);color:var(--ui-dim);margin-top:4px}
.ui-lf-pop .ui-lf-v input{accent-color:var(--ui-amber);margin:0;padding:0;width:14px;height:14px;min-height:0;flex:none;appearance:auto;-webkit-appearance:checkbox}
.ui-lf-rng{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:10px}
.ui-lf-pop .ui-lf-rng label{display:flex;flex-direction:column;align-items:stretch;gap:4px;margin:0;color:var(--ui-dim);font:11px var(--ui-f);text-align:left;text-transform:none;letter-spacing:0}
.ui-lf-rng input{padding:7px 9px;background:var(--ui-bg);border:1px solid var(--ui-line2);color:var(--ui-tx);font:inherit;outline:0;width:100%;box-sizing:border-box}
.ui-lf-rng input:focus{border-color:var(--ui-amber)}
.ui-lf-ft{display:flex;justify-content:space-between;gap:6px;padding:10px;border-top:1px solid var(--ui-line)}
.ui-lf-ft button{flex:1}
@media (pointer:coarse){.ui-lf{min-height:32px}.ui-lf-v{min-height:40px}}

/* hero stat tiles: figures side by side (e.g. today / week / month); a tile with attrs is a button */
.ui-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(0,1fr));gap:8px;margin:16px 0 4px}
.ui-stat{all:unset;box-sizing:border-box;display:flex;flex-direction:column;gap:3px;min-width:0;padding:10px clamp(8px,2.4vw,12px);border:1px solid var(--ui-line);background:rgba(255,255,255,.02);font-family:var(--ui-f);color:var(--ui-tx);border-radius:12px}
.ui-stat .ui-stat-l{font-size:10px;letter-spacing:.14em;text-transform:uppercase;color:var(--ui-dim)}
.ui-stat b{font-size:clamp(15px,4.2vw,21px);font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ui-stat b.ui-pos{color:var(--ui-green)}.ui-stat b.ui-neg{color:var(--ui-red)}
.ui-stat small{font-size:11px;line-height:1.35;color:var(--ui-dim)}
button.ui-stat{cursor:pointer;transition:border-color .2s,background-color .2s,transform .3s cubic-bezier(.32,.72,0,1)}
button.ui-stat:hover{border-color:var(--ui-line2);background:rgba(255,255,255,.04)}button.ui-stat:active{transform:scale(.97)}
button.ui-stat:focus-visible{outline:1px solid var(--ui-amber);outline-offset:2px}
.ui-stat.ui-on{border-color:rgba(255,176,0,.55);background:rgba(255,176,0,.07)}.ui-stat.ui-on .ui-stat-l{color:var(--ui-amber)}

/* ---------- glass: rounded, layered, translucent surfaces (the terminal look stays: mono, amber on black) ----------
   Scoped with "html body" so it wins over each app's own (later, equal-weight) rules. Real backdrop blur only on what
   floats over content (dialogs, sheets, menus, toasts, banners); cards get depth from translucency and light, which
   keeps long dashboards smooth to scroll on phones. */
:root{--g-r:16px;--g-r2:12px;--g-r3:10px;--g-line:rgba(255,255,255,.075);--g-line2:rgba(255,255,255,.13);
  --g-card:linear-gradient(180deg,rgba(255,255,255,.04),rgba(255,255,255,.012) 40%),rgba(13,13,13,.78);
  --g-float:rgba(18,18,18,.72);--g-blur:saturate(170%) blur(24px);--g-hi:inset 0 1px 0 rgba(255,255,255,.055);
  --g-drop:0 18px 40px -22px rgba(0,0,0,.95);--g-spring:cubic-bezier(.32,.72,0,1)}
/* a faint amber glow behind everything, so the glass has something to pick up. With a mouse it drifts after the
   pointer (ui.js sets --gx/--gy); registered so the move eases instead of jumping */
@property --gx{syntax:'<length-percentage>';inherits:true;initial-value:8%}
@property --gy{syntax:'<length-percentage>';inherits:true;initial-value:-12%}
html{transition:--gx 1.2s var(--g-spring),--gy 1.2s var(--g-spring)}
@media (prefers-reduced-motion:reduce){html{transition:none}}
html body{background:radial-gradient(1100px 620px at var(--gx) var(--gy),rgba(255,176,0,.075),transparent 62%),radial-gradient(900px 560px at 108% 4%,rgba(255,122,51,.05),transparent 60%),var(--bg,#070707) fixed}
/* and a soft light over the whole page, cards included, that sits on the pointer while a mouse is moving */
html body::after{content:'';position:fixed;inset:0;z-index:40;pointer-events:none;opacity:0;mix-blend-mode:screen;
  background:radial-gradient(520px circle at var(--gx) var(--gy),rgba(255,176,0,.075),rgba(255,176,0,.025) 45%,transparent 70%);transition:opacity .6s}
html.g-ptr body::after{opacity:1}
@media (prefers-reduced-transparency:reduce){html body::after{display:none}}
/* cards */
html body :is(.card,.ui-card){border-radius:var(--g-r);background:var(--g-card);border-color:var(--g-line);box-shadow:var(--g-hi),var(--g-drop);
  transition:border-color .3s var(--g-spring),box-shadow .3s var(--g-spring)}
html body .ui-hero{border-radius:calc(var(--g-r) + 4px);border-color:var(--g-line);box-shadow:var(--g-hi),0 24px 60px -30px rgba(255,176,0,.25),var(--g-drop)}
html body :is(.ui-hero-side,.ui-hero-none){border-radius:var(--g-r2)}
html body :is(.card,.ui-card).empty{border-style:dashed}
/* TODAY's own surfaces (check-in, hero) keep their colours and get the same corners and depth */
html body #today :is(.ci,.hero){border-radius:calc(var(--g-r) + 4px);box-shadow:var(--g-hi),var(--g-drop)}
/* segmented controls read as one pill, not separate keys */
html body .ui-seg>button{border-radius:0}html body .ui-seg>button:first-child{border-radius:var(--g-r3) 0 0 var(--g-r3)}html body .ui-seg>button:last-child{border-radius:0 var(--g-r3) var(--g-r3) 0}
@media (hover:hover){html body :is(.card,.ui-card):hover{border-color:var(--g-line2);box-shadow:var(--g-hi),0 22px 46px -24px rgba(0,0,0,1)}}
/* a card's footer and the cells inside follow its corners */
html body .card>.ft{border-radius:0 0 var(--g-r) var(--g-r)}
html body :is(.cd,.cell,.pday){border-radius:var(--g-r3)}
html body :is(.cal,.cg)>*{border-radius:8px}
html body .tw{border-radius:var(--g-r2)}
html body .hb,html body .hb i,html body .ui-meter-bar,html body .ui-meter-bar i,html body .ui-week i{border-radius:999px}
html body svg.chart rect:not(.hit){rx:2px}
/* controls */
html body :is(button,.btn,select,input:not([type=checkbox]):not([type=radio]):not([type=range]),textarea):not(.ui-lf):not(.tl-go):not(.cd):not(.cell):not(.ui-seg>*):not(nav *):not(.ui-stat){border-radius:var(--g-r3)}
html body :is(select,input:not([type=checkbox]):not([type=radio]):not([type=range]),textarea){background-color:rgba(255,255,255,.035);border-color:var(--g-line2)}
/* the open list of a dropdown: Chrome on Windows paints it from the select's own, nearly clear background over white,
   which leaves light text on light grey; options get a solid dark background instead */
html body select :is(option,optgroup){background-color:#141311;color:#d9d5c8}
html body select option:checked{background-color:#2a2416;color:#ffb000}
html body select option:disabled{color:#6f6a5f}
html body :is(.pill,.chip,.chips button,.xf button,.ui-status){border-radius:999px}
html body :is(button,.btn){transition:transform .35s var(--g-spring),background-color .2s,border-color .2s,color .2s,box-shadow .2s}
html body :is(button,.btn):not(nav *):active:not(:disabled){transform:scale(.965)}
html body :is(button.pri,.btn.go,.ui-btn.ui-primary){box-shadow:0 8px 22px -10px rgba(255,176,0,.55)}
/* floating layers: real glass */
html body :is(dialog,.modal>.box,#isx-sd,.ui-lf-pop){border-radius:20px;background:var(--g-float);-webkit-backdrop-filter:var(--g-blur);backdrop-filter:var(--g-blur);
  border-color:rgba(255,176,0,.32);box-shadow:var(--g-hi),0 30px 80px -20px rgba(0,0,0,.85)}
html body .ui-lf-pop{border-radius:14px;border-color:var(--g-line2)}
html body dialog::backdrop{background:rgba(0,0,0,.42);-webkit-backdrop-filter:blur(8px) saturate(120%);backdrop-filter:blur(8px) saturate(120%)}
html body .modal{background:rgba(0,0,0,.42);-webkit-backdrop-filter:blur(8px) saturate(120%);backdrop-filter:blur(8px) saturate(120%)}
html body :is(.ui-toast,.toast,#isx-full){border-radius:14px;background:rgba(20,20,20,.74);-webkit-backdrop-filter:var(--g-blur);backdrop-filter:var(--g-blur);box-shadow:var(--g-hi),0 18px 40px -12px rgba(0,0,0,.8)}
/* phones: dialogs rise as a sheet from the bottom, with a grabber */
@media (max-width:640px){
  html body dialog[open]:not(#isx-sd){margin:auto 0 0;width:100%;max-width:100%;max-height:calc(100dvh - 24px);border-radius:22px 22px 0 0;border-width:1px 0 0;padding-top:26px;
    padding-bottom:calc(20px + env(safe-area-inset-bottom));animation:g-sheet .45s var(--g-spring) both}
  html body dialog[open]:not(#isx-sd)::before{content:'';position:absolute;top:9px;left:50%;width:38px;height:5px;margin-left:-19px;border-radius:3px;background:rgba(255,255,255,.22)}
  html body .modal>.box{border-radius:22px 22px 0 0;align-self:flex-end;animation:g-sheet .45s var(--g-spring) both}
  html body .modal>.box{position:relative;padding-top:26px;border-width:1px 0 0;max-height:calc(100dvh - 24px);overflow:auto}
  html body .modal>.box::before{content:'';position:absolute;top:9px;left:50%;width:38px;height:5px;margin-left:-19px;border-radius:3px;background:rgba(255,255,255,.22)}
  html body .modal{align-items:flex-end;padding:0}
}
@keyframes g-sheet{from{transform:translateY(40px);opacity:0}}
/* first paint: cards rise into place, one after another (once, not on every redraw) */
html.g-boot body :is(.card,.ui-card,.ui-hero){animation:g-in .6s var(--g-spring) both}
html.g-boot body :is(.g,.grid,section)>:nth-child(2){animation-delay:.04s}html.g-boot body :is(.g,.grid,section)>:nth-child(3){animation-delay:.08s}
html.g-boot body :is(.g,.grid,section)>:nth-child(4){animation-delay:.12s}
@keyframes g-in{from{opacity:0;transform:translateY(10px) scale(.985)}}
/* accessibility: solid surfaces when asked for less transparency; no movement when asked for less motion */
@media (prefers-reduced-transparency:reduce){html body :is(dialog,.modal>.box,#isx-sd,.ui-lf-pop,.ui-toast,.toast,#isx-full){background:#141414;-webkit-backdrop-filter:none;backdrop-filter:none}}
@media (prefers-reduced-motion:reduce){html body :is(.card,.ui-card,.ui-hero,dialog,.modal>.box){animation:none!important}html body :is(button,.btn):active{transform:none}}
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){html body :is(dialog,.modal>.box,#isx-sd,.ui-lf-pop,.ui-toast,.toast,#isx-full){background:#141414}}

/* touch screens: form fields at 16px, so iOS doesn't zoom the page in when you tap one (it does for anything
   smaller). !important because some fields set their size with id-level rules (the sync dialog's); pinch-zoom still
   works, since nothing blocks it in the viewport tag */
@media (pointer:coarse){html body :is(input:not([type=checkbox]):not([type=radio]):not([type=range]),select,textarea){font-size:16px!important}}

/* ---------- glass on colour: green, red and amber fills are see-through tinted glass with a light top edge ---------- */
html body{--gl-sheen:linear-gradient(180deg,rgba(255,255,255,.16),rgba(255,255,255,0) 50%);
  --gl-g:rgba(51,255,102,.28);--gl-r:rgba(255,69,69,.28);--gl-a:rgba(255,176,0,.28)}
/* solid amber buttons and the chosen segment become amber-tinted glass with dark text */
html body :is(button.pri,.btn.go,.ui-btn.ui-primary),html body .ui-seg>button[aria-checked=true]{background:var(--gl-sheen),rgba(255,176,0,.9);border-color:rgba(255,176,0,.95);color:#000;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.14),0 6px 18px -12px var(--gl-a)}
html body :is(button.pri,.btn.go,.ui-btn.ui-primary):hover:not(:disabled){background:var(--gl-sheen),rgba(255,176,0,1);color:#000;filter:none}
/* bars and dots: the fill shows a little of the card through it */
html body :is(.hb i,.ui-meter-bar i,.ui-week i:is(.ui-on,.ui-pos,.ui-neg)){background-image:var(--gl-sheen);opacity:.78;box-shadow:inset 0 1px 0 rgba(255,255,255,.25)}
html body .dot:is(.bgp,.bgn,.bga,.bgm,[style]){opacity:.85}
/* calendar days that are green, red or amber: a light inner edge */
html body :is(.cd.p,.cd.n,.cell.on){background-image:linear-gradient(180deg,rgba(255,255,255,.05),rgba(255,255,255,0) 55%);box-shadow:inset 0 1px 0 rgba(255,255,255,.06)}
/* charts, gauges and rings: a faint edge glow */
html body svg.chart :is(.fp,.fn,.fa),html body svg.chart:is(.cg,.cr) .ln{opacity:.85}
html body .gauge :is(.sg,path[stroke="#33ff66"]),html body :is(.ui-ring.ui-done .ui-rf,.ring.done .rf){filter:drop-shadow(0 0 2px var(--gl-g))}
html body .gauge :is(.sr,path[stroke="#ff4545"]){filter:drop-shadow(0 0 2px var(--gl-r))}
html body .gauge path[stroke="#ffb000"],html body :is(.ui-ring:not(.ui-done) .ui-rf,.ring:not(.done):not(.rest) .rf){filter:drop-shadow(0 0 2px var(--gl-a))}
@media (prefers-reduced-transparency:reduce){html body :is(.gauge path,.ui-rf,.rf){filter:none}html body :is(.hb i,.ui-meter-bar i,.ui-week i,.dot,svg.chart *){opacity:1}
  html body :is(button.pri,.btn.go,.ui-btn.ui-primary),html body .ui-seg>button[aria-checked=true]{background:#ffb000;color:#000}}
/* no double-tap zoom anywhere */
html{touch-action:manipulation}
/* ---------- app header: a rounded frosted bar pinned to the top, the rarely used buttons behind ··· ---------- */
html body header.top:not(.th){position:sticky;top:8px;z-index:7;padding:10px 14px;margin-top:-6px;gap:12px;border-bottom-color:transparent}
/* the glass sits on a rounded layer behind the header, so it floats like the tab bar */
html body header.top:not(.th)::before{content:'';position:absolute;z-index:-1;inset:0;border-radius:18px;background:rgba(16,15,13,.72);
  border:1px solid rgba(255,255,255,.08);box-shadow:0 12px 30px -18px rgba(0,0,0,.9),inset 0 1px 0 rgba(255,255,255,.05);
  -webkit-backdrop-filter:saturate(1.6) blur(18px);backdrop-filter:saturate(1.6) blur(18px)}
html body header.top:not(.th) .brand{line-height:22px}
.ui-more{position:relative;flex:none}
html body .ui-more-btn{min-width:44px;display:inline-flex;align-items:center;justify-content:center;line-height:1}
/* the three dots are drawn, not typed, so they sit centred and round in every app and font */
.ui-more-h,.ui-more-v{display:block;flex:none;background:radial-gradient(circle,currentColor 1.7px,transparent 2.2px)}
.ui-more-h{width:18px;height:6px;background-size:6px 6px;background-repeat:repeat-x}
.ui-more-v{width:6px;height:18px;background-size:6px 6px;background-repeat:repeat-y}
html body .ui-more-btn[aria-expanded=true]{background:rgba(255,255,255,.08)}
.ui-more-pop{position:absolute;right:0;top:calc(100% + 8px);z-index:30;min-width:190px;padding:6px;display:flex;flex-direction:column;gap:2px;
  background:rgba(22,21,19,.95);-webkit-backdrop-filter:saturate(1.6) blur(22px);backdrop-filter:saturate(1.6) blur(22px);
  border:1px solid rgba(255,255,255,.1);border-radius:14px;box-shadow:0 18px 40px -12px rgba(0,0,0,.8);animation:ui-more-in .16s var(--ui-ease,ease-out)}
.ui-more-pop[hidden]{display:none}
html body .ui-more-pop>button{all:unset;box-sizing:border-box;display:block;width:100%;padding:11px 12px;border-radius:9px;cursor:pointer;
  font:600 11px var(--ui-f);letter-spacing:.1em;text-transform:uppercase;color:var(--ui-tx);white-space:nowrap;-webkit-tap-highlight-color:transparent}
html body .ui-more-pop>button:hover,html body .ui-more-pop>button:focus-visible{background:rgba(255,255,255,.08)}
html body .ui-more-pop>button:focus-visible{outline:1px solid var(--ui-amber);outline-offset:-1px}
@keyframes ui-more-in{from{opacity:0;transform:translateY(-4px) scale(.98)}}
/* phones: the same rounded bar on one line: the app name, the main button, a vertical ⋮ holding everything else, and
   the sync dot. The everyday buttons show as the first items of the menu instead. */
.ui-more-v,html body .ui-more-pop>.ui-more-m,.ui-more-sep{display:none}
.ui-more-sep{border:0;border-top:1px solid rgba(255,255,255,.08);margin:4px 6px}
@media (max-width:640px){
  html body header.top:not(.th){flex-wrap:nowrap;padding:7px 6px 7px 14px;gap:8px}
  html body header.top:not(.th) .brand{flex:0 1 auto;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  html body header.top:not(.th) .acts{flex:1 1 auto;justify-content:flex-end;gap:6px}
  html body header.top:not(.th) .acts>button:not(.pri):not(.go){display:none}
  .ui-brand-pre{display:none}
  .ui-more-h{display:none}.ui-more-v{display:block}
  html body .ui-more-btn{min-width:38px;padding-left:8px;padding-right:8px}
  html body .ui-more-pop>.ui-more-m,.ui-more-sep{display:block}
  html body header.top:not(.th) #isx-sync.inl{order:9;margin:-4px -2px -4px -4px}
}
@media (prefers-reduced-transparency:reduce){html body header.top:not(.th)::before,.ui-more-pop{background:#111;-webkit-backdrop-filter:none;backdrop-filter:none}}
@media (prefers-reduced-motion:reduce){.ui-more-pop{animation:none}}
@media (max-width:640px){html body header.top:not(.th) .acts{overflow:visible}}
/* ---------- dropdown lists on desktop: the same glass panel as the ··· menu (ui.js builds it in place of the browser's list) ---------- */
.ui-sel-pop{position:fixed;inset:auto;margin:0;z-index:70;box-sizing:border-box;max-width:min(420px,calc(100vw - 16px));overflow:auto;overscroll-behavior:contain;
  padding:6px;display:flex;flex-direction:column;gap:2px;color:var(--ui-tx);
  background:rgba(22,21,19,.95);-webkit-backdrop-filter:saturate(1.6) blur(22px);backdrop-filter:saturate(1.6) blur(22px);
  border:1px solid rgba(255,255,255,.1);border-radius:14px;box-shadow:0 18px 40px -12px rgba(0,0,0,.8);animation:ui-more-in .16s var(--ui-ease,ease-out)}
html body .ui-sel-pop .ui-sel-opt{all:unset;box-sizing:border-box;display:flex;align-items:center;gap:10px;width:100%;padding:10px 12px;border-radius:9px;cursor:pointer;
  font:13px var(--ui-f);color:var(--ui-tx);white-space:nowrap;-webkit-tap-highlight-color:transparent}
html body .ui-sel-pop .ui-sel-opt::before{content:'';flex:none;width:12px;text-align:center;color:var(--ui-amber)}
html body .ui-sel-pop .ui-sel-opt[aria-selected=true]{color:var(--ui-amber)}
html body .ui-sel-pop .ui-sel-opt[aria-selected=true]::before{content:'\2713'}
html body .ui-sel-pop .ui-sel-opt:hover,html body .ui-sel-pop .ui-sel-opt:focus-visible,html body .ui-sel-pop .ui-sel-opt:focus{background:rgba(255,255,255,.08)}
html body .ui-sel-pop .ui-sel-opt:focus-visible{outline:1px solid var(--ui-amber);outline-offset:-1px}
html body .ui-sel-pop .ui-sel-opt:disabled{opacity:.4;cursor:default}
html body .ui-sel-pop .ui-sel-in{padding-left:22px}
.ui-sel-grp{padding:8px 12px 4px;font:600 10px var(--ui-f);letter-spacing:.12em;text-transform:uppercase;color:var(--ui-dim)}
@media (prefers-reduced-transparency:reduce){.ui-sel-pop{background:#111;-webkit-backdrop-filter:none;backdrop-filter:none}}
@media (prefers-reduced-motion:reduce){.ui-sel-pop{animation:none}}
