:root {
  --accent: #62bbcd;
  --tint: #e6f8fb;
  --art: none;
  --text: #1d2226;
  --muted: #9aa1a8;
  --card: #fff;
  --line: #eef0f2;
  --field: #f3f5f7;
  --on-icon: #fff;
  --shadow: 0 6px 24px rgb(20 40 60 / .10);
  color-scheme: light;
}
:root[data-dark="1"] {
  --text: #e9ecef;
  --muted: #7d858d;
  --card: #1a1d21;
  --line: #292d33;
  --field: #24282d;
  --on-icon: #1a1d21;
  --shadow: 0 6px 24px rgb(0 0 0 / .5);
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; }
body { font: 1rem/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text); background: var(--tint); }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; text-align: inherit; }
button:disabled { cursor: default; opacity: .4; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a { color: inherit; }
small { font-size: .8rem; color: var(--muted); display: block; }
h1 { font-size: 1.4rem; font-weight: 750; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
h2 { font-size: 1.05rem; margin-bottom: .9rem; }

#app { height: 100%; height: 100dvh; display: flex; flex-direction: column; position: relative; max-width: 560px; margin: 0 auto; background: linear-gradient(color-mix(in srgb, var(--tint) 55%, var(--card)), var(--tint)); overflow: hidden; }
:root[data-dark="1"] #app { background: var(--tint); }
:root[data-art="1"] #app::before { content: ""; position: absolute; inset: 0 0 auto; height: 220px; background: var(--art) center / cover; -webkit-mask-image: linear-gradient(#000 35%, transparent); mask-image: linear-gradient(#000 35%, transparent); opacity: .6; pointer-events: none; }
:root[data-art="1"] .top h1, :root[data-art="1"] .top .iconbtn { text-shadow: 0 0 8px var(--card), 0 0 3px var(--card); filter: drop-shadow(0 0 4px var(--card)); }
#screen { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
#screen.enter > .content { animation: rise .22s ease-out; }
#side { display: none; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.top { display: flex; align-items: center; gap: .5rem; padding: calc(env(safe-area-inset-top) + 1rem) 1rem .6rem; min-height: 4.2rem; position: relative; }
.top h1 { flex: 1; }
.top-right { display: flex; align-items: center; margin-left: auto; }
.content { flex: 1; overflow-y: auto; overflow-x: hidden; padding: .25rem 1rem 6rem; display: flex; flex-direction: column; gap: .8rem; position: relative; overscroll-behavior: contain; }
.content > * { flex-shrink: 0; }
.content.center { align-items: center; text-align: center; }
.content.center > .widget, .content.center > .stats { align-self: stretch; }

.ic { display: inline-flex; width: 1.35rem; height: 1.35rem; flex: none; }
.ic svg { width: 100%; height: 100%; }
.ic.accent { color: var(--accent); }
.ic.muted { color: var(--muted); }
.ic.tiny { width: .85rem; height: .85rem; }
.ic.chev { width: 1rem; height: 1rem; color: var(--muted); }
.ic.big { width: 2.8rem; height: 2.8rem; }
.iconbtn { display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; flex: none; }
.iconbtn:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.iconbtn.small { width: 1.9rem; height: 1.9rem; }
.iconbtn.small .ic { width: 1.05rem; height: 1.05rem; color: var(--muted); }
.iconbtn.up .ic { transform: rotate(90deg); }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.centered { text-align: center; justify-content: center; }
.inline { display: flex; align-items: center; gap: .6rem; }
.hint { font-size: .85rem; color: var(--muted); padding: 0 1.2rem; }
.section-label { color: var(--muted); padding: .5rem 1.2rem 0; font-size: .95rem; }
.pad-x { padding: 0 .4rem; }

/* cards and rows */
.card { background: var(--card); border-radius: 1.25rem; overflow: hidden; box-shadow: 0 1px 2px rgb(0 0 0 / .03); }
.card.pad { padding: 1rem 1.2rem; }
.row { display: flex; align-items: center; gap: .9rem; width: 100%; padding: .9rem 1.2rem; min-height: 3.6rem; text-align: left; }
button.row:hover, .row.clickable:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.row.clickable { cursor: pointer; }
.row.danger { color: #e03131; }
.row-title { display: block; }
.row .value { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
.card.pad .row { padding-inline: 0; }
.plain { text-align: left; }
.thumb { width: 2.6rem; height: 2.6rem; object-fit: cover; border-radius: .5rem; }
kbd { background: var(--field); border-radius: .4rem; padding: .15rem .55rem; font-size: .85rem; }

.switch { width: 2.8rem; height: 1.5rem; border-radius: 1rem; background: color-mix(in srgb, var(--muted) 40%, transparent); position: relative; flex: none; transition: background .2s; }
.switch i { position: absolute; top: -.1rem; left: 0; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: #f4f7f9; box-shadow: 0 1px 4px rgb(0 0 0 / .25); transition: transform .2s; }
.switch.on { background: color-mix(in srgb, var(--accent) 35%, transparent); }
.switch.on i { transform: translateX(1.15rem); background: var(--accent); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; background: var(--accent); color: #fff; font-weight: 600; padding: .6rem 1.2rem; border-radius: .8rem; transition: transform .1s, filter .2s; }
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: scale(.97); }
.btn.ghost { background: var(--field); color: var(--text); }
.btn.ghost.danger { color: #e03131; margin-right: auto; }
.btn.soft { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--text); }
.btn.invert { background: #fff; color: var(--accent); }
.btn.outline { background: transparent; border: 1.5px solid #f08c4a; color: #f08c4a; border-radius: 2rem; padding: .45rem .9rem; }
.btn.wide { width: 100%; }
.btn.big { padding: .8rem 2.4rem; border-radius: 3rem; font-size: 1.1rem; }
.btn.round { width: 2.5rem; height: 2.5rem; padding: 0; border-radius: 50%; }
.link { color: var(--accent); font-weight: 600; }
.todaybtn { font-size: .85rem; font-weight: 600; color: var(--accent); padding: .3rem .6rem; border-radius: 1rem; background: color-mix(in srgb, var(--accent) 12%, transparent); }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; justify-content: flex-start; }
.center > .chips { justify-content: center; }
.chip { display: inline-block; padding: .3rem .75rem; border-radius: 2rem; background: var(--field); font-size: .85rem; white-space: nowrap; }
.chip.on { background: color-mix(in srgb, var(--accent) 18%, transparent); color: color-mix(in srgb, var(--accent) 65%, var(--text)); }
.segmented { display: inline-flex; background: var(--card); border-radius: 2rem; padding: .25rem; }
.segmented button { padding: .35rem 1rem; border-radius: 2rem; }
.segmented button.on { background: var(--accent); color: #fff; font-weight: 600; }

input:not([type=checkbox]):not([type=file]), textarea, select { width: 100%; background: var(--field); border: 1.5px solid transparent; border-radius: .8rem; padding: .65rem .8rem; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
textarea { resize: vertical; }
.field { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: .5rem 0; }
.field > span { flex: none; color: var(--muted); }
.field input, .field select { max-width: 60%; }
.checkline { display: flex; align-items: center; gap: .6rem; margin: .6rem 0; }
.searchbox { background: var(--card) !important; }

/* tasks */
.card.group { padding: .2rem 0; }
.group-head { display: flex; align-items: center; gap: .5rem; width: 100%; padding: .7rem 1.1rem; }
.group-head small { margin-left: auto; }
.group-head .ic { width: 1rem; height: 1rem; color: var(--muted); transition: transform .2s; }
.group-head .ic.rot { transform: rotate(-90deg); }
.swipe { position: relative; overflow: hidden; touch-action: pan-y; }
.swipe-bg { position: absolute; inset: 0; display: flex; align-items: center; padding: 0 1.4rem; color: #fff; font-weight: 600; }
.swipe-bg:empty { display: none; }
.swipe-bg.r { justify-content: flex-end; }
.task { position: relative; display: flex; align-items: flex-start; gap: .8rem; padding: .75rem 1.1rem; background: var(--card); cursor: pointer; user-select: none; transition: transform .18s; }
.swipe.colored .task { box-shadow: inset 3px 0 var(--list); }
.task:hover { background: color-mix(in srgb, var(--accent) 6%, var(--card)); }
.task-title { display: block; overflow-wrap: anywhere; }
.task.is-done .task-title, .task.is-done .meta, .task.is-done .when { color: var(--muted); opacity: .7; }
.task.is-done.strike .task-title { text-decoration: line-through; }
.meta { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.snippet { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tagchip { background: color-mix(in srgb, var(--accent) 15%, transparent); padding: 0 .45rem; border-radius: 1rem; }
.when { font-size: .8rem; color: var(--accent); white-space: nowrap; padding-top: .15rem; }
.overdue, .when.overdue { color: #e5484d; }
.check { width: 1.2rem; height: 1.2rem; flex: none; margin-top: .1rem; border: 2px solid var(--muted); border-radius: .35rem; display: grid; place-items: center; color: #fff; transition: transform .15s, background .2s; }
.check:active { transform: scale(.8); }
.check .ic { width: .95rem; height: .95rem; }
.check.p1 { border-color: #4772fa; }
.check.p2 { border-color: #f5b100; }
.check.p3 { border-color: #e5484d; }
.check.done { background: color-mix(in srgb, var(--muted) 65%, transparent); border-color: transparent; animation: pop .25s; }
@keyframes pop { 50% { transform: scale(1.25); } }
.iconbtn.p1 { color: #4772fa; } .iconbtn.p2 { color: #f5b100; } .iconbtn.p3 { color: #e5484d; }

.empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 1rem 0 2rem; gap: .25rem; }
.empty .illus { width: min(16rem, 70%); margin-bottom: 1rem; }
.empty b { font-size: 1.1rem; }
.empty span { color: var(--muted); }

.fab { position: absolute; right: 1.4rem; bottom: 1.4rem; width: 3.7rem; height: 3.7rem; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 45%, transparent); z-index: 4; transition: transform .15s; }
.fab:hover { transform: scale(1.06); }
.fab .ic { width: 1.8rem; height: 1.8rem; }

/* tab bar */
#tabbar { display: flex; justify-content: space-around; padding: .5rem .5rem calc(env(safe-area-inset-bottom) + .5rem); position: relative; }
.brandmark { display: none; }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; color: var(--muted); padding: .35rem 0; border-radius: .8rem; }
.tab.on { color: var(--accent); }
.tab-ic { position: relative; display: inline-flex; }
.tab-ic .ic { width: 1.8rem; height: 1.8rem; transition: transform .2s; }
.tab.on .tab-ic .ic { transform: scale(1.08); }
.tab-ic em { position: absolute; inset: .45rem 0 0; text-align: center; font: 700 .75rem/1.2rem system-ui; color: var(--on-icon); }
.tab-name { display: none; }

/* layers */
.layer { position: absolute; inset: 0; z-index: 20; background: rgb(10 16 22 / .4); display: flex; animation: fade .18s; }
.layer.leaving { animation: fade .18s reverse forwards; pointer-events: none; }
@keyframes fade { from { opacity: 0; } }
.layer.bottom { align-items: flex-end; }
.layer.center { align-items: center; justify-content: center; padding: 1.5rem; }
.sheet { width: 100%; max-height: 85%; overflow-y: auto; background: var(--card); border-radius: 1.5rem 1.5rem 0 0; padding: .5rem 1.2rem calc(env(safe-area-inset-bottom) + 1.2rem); animation: up .25s cubic-bezier(.2, .8, .2, 1); }
@keyframes up { from { transform: translateY(40%); } }
.grab { width: 2.5rem; height: .25rem; background: var(--line); border-radius: 1rem; margin: .2rem auto .8rem; }
.sheet-title { margin-bottom: .4rem; font-size: 1rem; }
.drawer { width: min(82%, 20rem); height: 100%; background: var(--card); overflow-y: auto; animation: side .25s cubic-bezier(.2, .8, .2, 1); }
@keyframes side { from { transform: translateX(-100%); } }
.dialog { width: min(100%, 24rem); max-height: 100%; overflow-y: auto; background: var(--card); border-radius: 1.3rem; padding: 1.3rem; box-shadow: var(--shadow); animation: rise .2s; }
.dialog h3 { margin-bottom: .8rem; }
.dialog form { display: flex; flex-direction: column; gap: .7rem; }
.actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1rem; }
.actions.stack { flex-direction: column; }
.card > .pad.centered { padding: 1.2rem; display: flex; flex-direction: column; gap: 1rem; }
.avatar.small .thumb { width: 100%; height: 100%; border-radius: 50%; }
.menu-item { display: flex; align-items: center; gap: .8rem; width: 100%; padding: .75rem .3rem; text-align: left; border-bottom: 1px solid var(--line); }
.menu-item:last-child { border: 0; }
.menu-item.danger { color: #e03131; }
.menu-item.checked { color: var(--accent); font-weight: 600; }
.menu-item .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

#toasts { position: absolute; left: 1rem; right: 1rem; bottom: 5.5rem; z-index: 30; display: flex; flex-direction: column; gap: .4rem; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 1rem; background: #263238; color: #fff; padding: .7rem 1rem; border-radius: .8rem; box-shadow: var(--shadow); font-size: .9rem; animation: rise .2s; max-width: 100%; }
.toast button { color: #7fe0f0; font-weight: 700; }

.quick { display: flex; flex-direction: column; gap: .5rem; }
.quick input.quick-title, .quick textarea { background: transparent; border: 0; padding: .3rem 0; resize: none; }
.quick input.quick-title { font-size: 1.15rem; font-weight: 600; }
.quick-tools { display: flex; align-items: center; gap: .1rem; }
.datepicker .chips { margin-bottom: .6rem; }

.drawer-body { padding: calc(env(safe-area-inset-top) + 1rem) .6rem 1.5rem; display: flex; flex-direction: column; gap: .1rem; }
.drawer-user { display: flex; align-items: center; gap: .7rem; padding: 0 .5rem .8rem; }
.drawer-item { display: flex; align-items: center; border-radius: .8rem; }
.drawer-item.on { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.drawer-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: .7rem; padding: .6rem .7rem; text-align: left; }
.drawer-link .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-link.add { color: var(--accent); margin-top: .5rem; }
.dot { width: .5rem; height: .5rem; border-radius: 50%; }
.swatches { display: flex; flex-wrap: wrap; gap: .45rem; }
.swatches button { width: 1.9rem; height: 1.9rem; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); }
.swatches button.on { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--accent); }
.emoji-pick { margin-bottom: .6rem; }
.inline > input[maxlength] { width: 3.6rem; text-align: center; flex: none; }

/* detail */
.listpill { display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .8rem; background: var(--card); border-radius: 2rem; font-size: .9rem; margin-right: auto; max-width: 70%; }
.listpill .ic { width: .9rem; height: .9rem; }
.top h1:empty { flex: 0; }
.datebtn { display: inline-flex; align-items: center; gap: .4rem; color: var(--accent); font-size: .9rem; }
.datebtn.overdue { color: #e5484d; }
textarea.detail-title, textarea.detail-note { background: transparent !important; border: 0 !important; padding: .4rem 0; resize: none; overflow: hidden; }
.detail-title { font-size: 1.3rem; font-weight: 700; }
.sub { display: flex; align-items: center; gap: .6rem; }
.sub .check { margin: 0; }
.sub input, input.sub-input { background: transparent !important; padding: .4rem 0 !important; border: 0 !important; }
.struck { text-decoration: line-through; color: var(--muted); }

/* calendar */
[data-screen=calendar] .top { gap: .1rem; }
.strip { touch-action: none; }
.cal-grid { display: flex; flex-direction: column; }
.cal-row { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-row.wn { grid-template-columns: 1.6rem repeat(7, 1fr); }
.heads span { text-align: center; color: var(--muted); font-size: .8rem; padding: .3rem 0; }
.weeknum { font-size: .7rem; color: var(--muted); align-self: center; text-align: center; }
.day { display: flex; flex-direction: column; align-items: center; padding: .2rem 0; min-width: 0; }
.day b { width: 2.3rem; height: 2.3rem; display: grid; place-items: center; border-radius: 50%; font-weight: 500; transition: background .15s; }
.day em { font: .65rem system-ui; color: var(--muted); margin-top: -.2rem; }
.day.today b { color: var(--accent); font-weight: 800; }
.day.selected b { background: var(--accent); color: #fff; }
.day.other { opacity: .38; }
.day i { width: .3rem; height: .3rem; border-radius: 50%; }
.day i.has { background: var(--accent); }
.handle { display: block; width: 100%; padding: .3rem; }
.handle i { display: block; width: 2.2rem; height: .22rem; border-radius: 1rem; background: color-mix(in srgb, var(--muted) 50%, transparent); margin: 0 auto; }
.card.flush { padding: .4rem 0 0; touch-action: pan-y; }
.detailed .day { align-items: stretch; border-top: 1px solid var(--line); border-left: 1px solid var(--line); min-height: 5rem; padding: .1rem; }
.detailed .day b { width: 1.6rem; height: 1.6rem; font-size: .85rem; align-self: center; }
.detailed .day em { text-align: center; }
.pills { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pills span { font-size: .65rem; border-radius: .25rem; padding: 0 .15rem; white-space: nowrap; overflow: hidden; text-align: left; }
.pills span.done, .pill.done, .event.done { opacity: .5; text-decoration: line-through; }
/* event chips are always pastel, so their text stays dark in every theme */
.pills span, .pill, .event, .event small, .w-cal em, .w-line span { color: #20262b; }
.banner { position: relative; background: var(--accent); color: #fff; border-radius: 1.2rem; padding: 1.2rem; display: grid; grid-template-columns: auto 1fr; gap: .2rem 1rem; }
.banner p { padding-right: 1.5rem; font-size: .95rem; }
.banner .actions { grid-column: 1 / -1; }
.banner .btn.soft { color: #fff; background: rgb(255 255 255 / .2); }
.banner-close { position: absolute; top: .3rem; right: .3rem; }
.card.timeline { flex: 1; display: flex; flex-direction: column; min-height: 24rem; }
.tl-head { display: grid; grid-template-columns: 3.2rem; grid-auto-flow: column; grid-auto-columns: 1fr; border-bottom: 1px solid var(--line); }
.tl-head button { text-align: center; padding: .4rem 0; min-width: 0; }
.tl-head button.today { color: var(--accent); }
.allday > span { font-size: .65rem; color: var(--muted); align-self: center; text-align: center; }
.allday > div { display: flex; flex-direction: column; gap: 2px; padding: 3px 1px; min-width: 0; }
.pill { font-size: .7rem; border-radius: .3rem; padding: .1rem .2rem; white-space: nowrap; overflow: hidden; text-align: left; }
.tl-scroll { flex: 1; overflow-y: auto; min-height: 0; }
.tl-body { display: grid; grid-template-columns: 3.2rem; grid-auto-flow: column; grid-auto-columns: 1fr; height: 1152px; }
.tl-hours span { display: block; height: 48px; font-size: .65rem; color: var(--muted); text-align: center; transform: translateY(-.5em); }
.tl-col { position: relative; border-left: 1px solid var(--line); background: repeating-linear-gradient(transparent 0 47px, var(--line) 47px 48px); min-width: 0; cursor: cell; }
.event { position: absolute; border-radius: .4rem; padding: .15rem .25rem; font-size: .72rem; line-height: 1.15; overflow: hidden; text-align: left; overflow-wrap: anywhere; }
.nowline { position: absolute; left: 0; right: 0; height: 2px; background: #e5484d; pointer-events: none; }

/* settings */
.profile { display: flex; align-items: center; gap: 1.2rem; padding: .5rem .2rem; text-align: left; }
.avatar { width: 5rem; height: 5rem; border-radius: 50%; background: #8d6e63; color: #fff; display: grid; place-items: center; font-size: 2.4rem; flex: none; }
.avatar.small { width: 2.4rem; height: 2.4rem; font-size: 1.1rem; }
.profile b { display: block; font-size: 1.15rem; }
.profile em { display: inline-block; font-style: normal; font-size: .8rem; color: #fff; border-radius: 1rem; padding: .1rem .8rem; margin: .4rem .6rem 0 0; }
.lv { background: #40c98a; }
.badges { background: #7d86a8; }
.premium { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.2rem; }
.premium .crown { color: #fff; background: #ffa800; border-radius: 50%; padding: .45rem; width: 2.5rem; height: 2.5rem; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); gap: .8rem; padding: 1rem; text-align: center; }
.badge-grid div { opacity: .45; filter: grayscale(1); }
.badge-grid .earned { opacity: 1; filter: none; }
.badge-grid span { font-size: 2rem; }
.badge-grid b { display: block; font-size: .8rem; line-height: 1.2; }
.round-toggle { width: 1.4rem; height: 1.4rem; border-radius: 50%; color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; line-height: 1; }
.round-toggle.plus { background: #12c9a0; }
.round-toggle.minus { background: #e5484d; }
.round-toggle:disabled { background: var(--muted); }
.movers { display: flex; }
.top.tabbed { gap: .2rem; }
.toptab { font-size: 1.15rem; font-weight: 700; padding: .3rem .6rem; border-bottom: 3px solid transparent; white-space: nowrap; }
.toptab.on { color: var(--accent); border-color: var(--accent); }
.themes { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.themes.colors { grid-template-columns: repeat(4, 1fr); }
.theme, .option, .appicons button { position: relative; text-align: center; min-width: 0; }
.theme .art { display: block; aspect-ratio: 2 / 1; border-radius: .8rem; overflow: hidden; background-size: cover; background-position: center; transition: transform .15s; position: relative; }
.theme:hover .art { transform: translateY(-2px); }
.theme .art svg { width: 100%; height: 100%; display: block; }
.themes.colors .art { aspect-ratio: 1; }
.theme small, .option small { margin-top: .4rem; font-weight: 600; }
.art.add { background-color: var(--field); display: grid !important; place-items: center; }
.dots3 { position: absolute; inset: auto 0 .5rem; color: #4772fa; font-size: .7rem; }
.tick { position: absolute; top: -.35rem; right: -.35rem; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; border: 2px solid var(--card); }
.tick .ic { width: .85rem; height: .85rem; }
.appicons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.1rem; }
.appicons span { display: block; }
.appicons svg, .logo svg, .brandmark svg, .badge-icon svg { display: block; width: 100%; height: 100%; }
.appicons span { aspect-ratio: 1; border-radius: 22%; box-shadow: 0 0 0 1px var(--line); }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.preview-box { display: flex; flex-direction: column; gap: .8rem; border: 1px solid var(--line); border-radius: .6rem; padding: 1rem .6rem; text-align: left; font-size: .9rem; }
.demo { display: flex; justify-content: space-between; padding-left: .4rem; white-space: nowrap; }
.demo em { font-style: normal; color: var(--muted); }
.demo.faded { color: var(--muted); }
.option.on .preview-box { border-color: var(--accent); }
.warning { display: flex; gap: .8rem; padding: 0 .8rem; color: var(--muted); }
.warning .ic { color: #f5b100; margin-top: .6rem; }
.brand { width: 1.9rem; height: 1.9rem; border-radius: .5rem; color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .85rem; flex: none; }
.pattern { display: grid; grid-template-columns: repeat(3, 1fr); width: min(18rem, 80vw); aspect-ratio: 1; margin: 1rem auto; touch-action: none; user-select: none; cursor: pointer; }
.pattern i { place-self: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 3px solid var(--muted); display: grid; place-items: center; font-style: normal; font-weight: 700; color: #fff; transition: transform .1s; }
.pattern i.on { background: var(--accent); border-color: var(--accent); transform: scale(1.15); }
.lockscreen { position: fixed; inset: 0; z-index: 100; background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; }
.lockscreen .logo { width: 4rem; height: 4rem; }

/* features */
.content.fill { padding-bottom: 1rem; }
.matrix { flex: 1; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: .6rem; min-height: 26rem; }
.quad { background: var(--card); border-radius: 1rem; display: flex; flex-direction: column; min-height: 0; min-width: 0; padding: .6rem; }
.quad-head { display: flex; align-items: flex-start; justify-content: space-between; font-size: .85rem; line-height: 1.2; margin-bottom: .4rem; }
.quad-body { overflow-y: auto; flex: 1; }
.quad-item { display: flex; gap: .45rem; padding: .25rem 0; font-size: .9rem; cursor: grab; }
.quad-item button:last-child { text-align: left; min-width: 0; overflow-wrap: anywhere; }
.dial { position: relative; width: min(17rem, 75vw); aspect-ratio: 1; display: grid; place-items: center; flex-shrink: 0; }
.dial > div, .dial svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.dial svg { transform: rotate(-90deg); }
.dial circle, .arc circle { fill: none; stroke-width: 1.4; }
.dial .track, .arc .track { stroke: color-mix(in srgb, var(--muted) 22%, transparent); }
.dial .bar, .arc .bar { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .5s linear; }
.dial .time { font-size: 3.6rem; font-weight: 300; font-variant-numeric: tabular-nums; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.stats > div { background: var(--card); border-radius: 1rem; padding: .8rem; text-align: center; }
.stats b { font-size: 1.3rem; }
.weekhead { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; gap: .2rem; }
.weekhead > * { display: flex; flex-direction: column; align-items: center; text-align: center; }
.weekhead .today { color: var(--accent); }
.habit-head { display: flex; align-items: center; gap: .8rem; width: 100%; text-align: left; margin-bottom: .8rem; }
.bubble { width: 2.6rem; height: 2.6rem; border-radius: 50%; display: inline-grid; place-items: center; font-size: 1.3rem; flex: none; }
.mark { width: 2rem; height: 2rem; border-radius: 50%; background: var(--field); justify-content: center; margin: 0 auto; font-weight: 800; font-size: .85rem; }
.mark.done { background: #5fce72; color: #fff; }
.mark.miss { color: #e5484d; }
.mark.skip { color: var(--muted); }
.heat { display: grid; grid-template-columns: repeat(7, 1fr); gap: .35rem; text-align: center; margin-top: .6rem; }
.heat button { aspect-ratio: 1; border-radius: 50%; text-align: center; font-size: .85rem; background: var(--field); }
.heat button.miss { color: #e5484d; text-decoration: line-through; }
.heat button.skip { color: var(--muted); border: 1px dashed var(--muted); }
.cards2 { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.count { text-align: center; }
.count strong, .w-count strong { display: block; font-size: 3rem; color: var(--accent); line-height: 1.2; }
.capture { background: transparent !important; border: 0 !important; padding: 0 !important; font-size: 1.05rem; }

/* widgets */
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; grid-auto-flow: row dense; }
.gallery figure { display: flex; flex-direction: column; gap: .5rem; min-width: 0; }
.gallery figure.wide { grid-column: 1 / -1; }
.gallery figure > .widget { flex: 1; }
figcaption { display: flex; align-items: center; justify-content: center; gap: .6rem; font-size: .85rem; flex-wrap: wrap; }
.widget { padding: .9rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .4rem; flex-shrink: 0; }
.widget.half { min-height: 11rem; }
.w-head { display: flex; align-items: center; justify-content: space-between; gap: .3rem; }
.w-task { display: flex; align-items: center; gap: .6rem; padding: .2rem 0; }
.w-task .check { margin: 0; }
.w-task > button:not(.check) { flex: 1; min-width: 0; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-empty { color: var(--muted); font-size: .9rem; margin: auto; text-align: center; padding: .8rem 0; }
.w-center { margin: auto; display: flex; flex-direction: column; align-items: center; gap: .5rem; text-align: center; width: 100%; }
.tomato { font-size: 3rem; }
.w-habit, .w-ai, .w-quick, .w-count { flex: 1; display: flex; flex-direction: column; border-radius: .9rem; text-align: left; gap: .3rem; }
.w-habit { margin: -.9rem; padding: 1rem; color: #14351a; border-radius: 0; }
.w-habit strong { font-size: 1.25rem; }
.w-habit b { font-size: 1.2rem; }
.big-emoji { font-size: 3rem; align-self: flex-end; margin-top: auto; }
.w-ai { margin: -.9rem; padding: 1.2rem; background: linear-gradient(150deg, #4a4050, #26282c); color: #8fb4ff; border-radius: 0; justify-content: space-between; }
.w-ai .ic { width: 2.4rem; height: 2.4rem; }
.w-quick .ic { align-self: flex-end; margin-top: auto; width: 1.8rem; height: 1.8rem; }
.w-count { text-align: center; justify-content: center; }
.w-big { font-size: 1.8rem; }
.spark { display: flex; align-items: flex-end; gap: 2px; height: 5rem; margin-top: auto; }
.spark i { flex: 1; background: color-mix(in srgb, var(--muted) 60%, transparent); border-radius: 2px; }
.spark i.now { background: var(--accent); }
.badge-icon { position: relative; width: 4rem; height: 4rem; display: block; }
.badge-icon > span { display: block; width: 100%; height: 100%; filter: drop-shadow(0 2px 6px rgb(0 0 0 / .15)); }
.badge-icon em { position: absolute; top: -.4rem; right: -.4rem; background: #f03e3e; color: #fff; border-radius: 1rem; min-width: 1.4rem; text-align: center; font-style: normal; font-size: .8rem; }
.w-pomo { display: flex; align-items: center; }
.w-pomo .time { flex: 1; font-size: 1.9rem; color: #f06060; text-align: left; font-variant-numeric: tabular-nums; }
.w-totals { gap: 2rem; }
.w-totals b { font-size: 1.4rem; }
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: .5rem; text-align: center; }
.stack { height: 6rem; display: flex; flex-direction: column-reverse; border-bottom: 1px solid var(--line); padding: 0 18%; }
.stack i { display: block; flex-shrink: 0; }
.legend { display: flex; flex-wrap: wrap; gap: .7rem; font-size: .8rem; }
.legend i { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; margin-right: .3rem; }
.w-habits { display: grid; grid-template-columns: minmax(0, 1fr) repeat(7, 1.7rem); gap: .4rem; align-items: center; text-align: center; }
.w-habits .name { text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .9rem; }
.w-habits button { height: 1.7rem; border-radius: .4rem; background: var(--field); text-align: center; font-size: .8rem; }
.w-habits .today { color: var(--accent); font-weight: 800; }
.arc { position: relative; width: 11rem; height: 11rem; margin: 0 auto; }
.arc > div, .arc svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.arc > span { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.w-matrix { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); margin: 0 -.9rem -.9rem; border-top: 1px solid var(--line); }
.w-matrix > button { background: var(--card); padding: .6rem .8rem; display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; min-height: 7rem; min-width: 0; font-size: .85rem; text-align: left; gap: .25rem; }
.w-matrix span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-line { display: grid; grid-template-columns: 8rem 1fr; gap: .6rem; align-items: center; text-align: left; }
.w-line span { border-radius: .4rem; padding: .3rem .5rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); text-align: center; row-gap: .15rem; }
.w-cal button { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; font-size: .8rem; border-radius: .4rem; min-height: 1.7rem; }
.w-cal button > span { width: 1.5rem; height: 1.5rem; display: grid; place-items: center; border-radius: 50%; }
.w-cal .today > span { background: var(--accent); color: #fff; }
.w-cal .other { opacity: .35; }
.w-cal i { width: .25rem; height: .25rem; border-radius: 50%; background: var(--accent); }
.w-cal.pills button { min-height: 3rem; align-items: stretch; border-top: 1px solid var(--line); }
.w-cal.pills button > span { align-self: center; }
.w-cal em { font: .6rem system-ui; border-radius: .2rem; white-space: nowrap; overflow: hidden; }
.w-split { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.w-split .w-task small { display: none; }

@media (max-width: 420px) {
  .w-split { grid-template-columns: 1fr; }
  .toptab { font-size: 1rem; padding-inline: .4rem; }
  [data-screen=calendar] .iconbtn { width: 2rem; }
}

/* desktop */
@media (min-width: 900px) {
  #app { max-width: none; display: grid; grid-template-columns: 14rem minmax(0, 1fr); grid-template-rows: 100%; }
  #app.with-side { grid-template-columns: 14rem 17rem minmax(0, 1fr); }
  #tabbar { grid-column: 1; grid-row: 1; flex-direction: column; justify-content: flex-start; gap: .2rem; padding: 1.2rem .8rem; background: var(--card); border-right: 1px solid var(--line); overflow-y: auto; }
  .brandmark { display: flex; align-items: center; gap: .7rem; padding: 0 .6rem 1rem; font-size: 1.2rem; }
  .brandmark span { width: 2rem; height: 2rem; }
  .tab { flex: none; flex-direction: row; gap: .8rem; padding: .6rem .8rem; }
  .tab.on { background: color-mix(in srgb, var(--accent) 12%, transparent); }
  .tab-ic .ic { width: 1.4rem; height: 1.4rem; }
  .tab-ic em { inset: .3rem 0 0; font-size: .6rem; line-height: 1rem; }
  .tab-name { display: block; color: var(--text); white-space: nowrap; }
  #screen { grid-column: -2 / -1; grid-row: 1; width: 100%; max-width: 48rem; justify-self: center; }
  #app.with-side #side { display: block; grid-column: 2; grid-row: 1; overflow-y: auto; border-right: 1px solid var(--line); background: color-mix(in srgb, var(--card) 70%, transparent); position: relative; }
  #app.with-side .drawer-btn { display: none; }
  .layer.bottom { align-items: center; justify-content: center; }
  .layer.bottom .sheet { width: 32rem; border-radius: 1.3rem; box-shadow: var(--shadow); animation: rise .2s; }
  .grab { display: none; }
  .sheet { padding-top: 1.2rem; }
  #toasts { bottom: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
