:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ink: #172033;
  --muted: #6f7891;
  --line: #e4e7f1;
  --violet: #6257f6;
  --violet-soft: #eeecff;
  --green: #079b6d;
  --green-soft: #e5f7f0;
  --orange: #f47732;
  --orange-soft: #fff1e8;
  --red: #e64952;
  background: #f8f9fd;
  color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: linear-gradient(180deg, #fff 0, #f9faff 62%, #f5f7fc 100%); }
button, input, select { font: inherit; }
button { border: 0; border-radius: 14px; padding: .75rem 1rem; background: var(--green); color: #fff; font-weight: 750; cursor: pointer; transition: transform .16s ease, box-shadow .16s ease, background .16s ease; }
button:hover { transform: translateY(-1px); }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid rgb(98 87 246 / 24%); outline-offset: 2px; }
button:disabled { opacity: .55; cursor: wait; transform: none; }
button.quiet { border: 1px solid var(--line); background: #fff; color: #56617c; }
main { width: min(780px, 100%); margin: 0 auto; padding: max(1.35rem, env(safe-area-inset-top)) 1rem max(2.5rem, env(safe-area-inset-bottom)); }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2rem, 7vw, 3rem); letter-spacing: -.045em; line-height: 1.05; }
h2 { font-size: clamp(1.35rem, 4.5vw, 1.75rem); letter-spacing: -.03em; }
.card, .notification, .task-card { border: 1px solid var(--line); border-radius: 22px; background: rgb(255 255 255 / 94%); box-shadow: 0 12px 30px rgb(44 53 88 / 7%); }
.app-header, .section-title, .push-card { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.app-header { margin: .2rem 0 1.35rem; }
.brand { display: flex; align-items: center; gap: .55rem; margin-bottom: .55rem; color: var(--violet); font-size: .92rem; font-weight: 850; letter-spacing: .24em; text-transform: uppercase; }
.brand img { width: 44px; height: 44px; object-fit: contain; }
.logout { color: var(--violet) !important; font-weight: 750; }
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: .3rem; margin-bottom: 2rem; padding: .36rem; border: 1px solid #dfe3ee; border-radius: 22px; background: rgb(255 255 255 / 88%); box-shadow: 0 8px 24px rgb(52 62 98 / 4%); }
.tabs .tab { display: flex; align-items: center; justify-content: center; gap: .45rem; min-width: 0; padding: .82rem .45rem; background: transparent; color: #68728a; font-weight: 700; }
.tabs .tab svg { width: 1.35rem; height: 1.35rem; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.tabs .tab.active { background: linear-gradient(135deg, #6e65ff, #574be9); color: #fff; box-shadow: 0 7px 18px rgb(98 87 246 / 28%); }
.push-card { margin-bottom: 1.15rem; padding: 1rem 1.05rem; border-color: #cceee2; background: linear-gradient(110deg, #f3fcf9, #fff); }
.push-icon { display: grid; flex: 0 0 auto; place-items: center; width: 50px; height: 50px; border-radius: 50%; background: var(--green-soft); color: var(--green); }
.push-icon svg { width: 27px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.push-copy { flex: 1 1 auto; }
.push-copy strong { display: block; margin-bottom: .16rem; font-size: 1rem; }
.push-card p, .auth p, .meta, .section-copy { color: var(--muted); font-size: .88rem; line-height: 1.45; }
.push-card.is-active #enable-push { background: var(--green-soft); color: var(--green); }
.passkey-card { border-color: #ddd9ff; background: linear-gradient(110deg, #f6f5ff, #fff); }
.passkey-card .push-icon { background: var(--violet-soft); color: var(--violet); }
.passkey-card button { background: var(--violet); }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; margin-bottom: 2rem; }
.metric { display: grid; gap: .13rem; min-width: 0; padding: .9rem; }
.metric-icon { display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: .2rem; border-radius: 50%; background: var(--violet-soft); color: var(--violet); font-size: 1.2rem; font-weight: 800; }
.metric strong { color: var(--violet); font-size: 1.9rem; line-height: 1.1; }
.metric > span:not(.metric-icon) { font-size: .88rem; font-weight: 760; }
.metric small { overflow: hidden; color: var(--muted); font-size: .74rem; text-overflow: ellipsis; white-space: nowrap; }
.metric-today .metric-icon { background: var(--orange-soft); color: var(--orange); }
.metric-today strong { color: var(--orange); }
.metric-waiting .metric-icon { background: var(--green-soft); color: var(--green); }
.metric-waiting strong { color: var(--green); }
.section-title { margin: 0 0 .9rem; }
.section-title.spaced { margin-top: 2rem; }
.section-title .quiet, .view-link { flex: 0 0 auto; padding: .58rem .76rem; border-color: transparent; color: var(--violet); font-size: .84rem; }
.section-copy { margin-top: .25rem; }
.feed { display: grid; gap: .85rem; }
.notification, .task-card { position: relative; overflow: visible; padding: 1rem 1rem 1rem 1.12rem; }
.task-card::before { position: absolute; top: 0; bottom: 0; left: 0; width: 4px; border-radius: 22px 0 0 22px; background: var(--violet); content: ""; }
.event-card { border-color: #ffd5bc; background: linear-gradient(110deg, #fffaf7, #fff); }
.event-card::before { background: var(--orange); }
.group-card::before { background: var(--green); }
.notification .top, .task-card .top { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .55rem; }
.notification h3, .task-card h3 { margin: 0; color: var(--ink); font-size: 1rem; line-height: 1.4; }
.notification .body { color: #505b73; line-height: 1.5; white-space: pre-wrap; }
.compact-card .body { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.badge { flex: 0 0 auto; align-self: flex-start; border-radius: 999px; padding: .28rem .58rem; color: var(--green); background: var(--green-soft); font-size: .72rem; font-weight: 800; white-space: nowrap; }
.badge.waiting { color: #a46519; background: #fff4de; }
.badge.pending-action { color: var(--violet); background: var(--violet-soft); }
.event-card .badge { color: var(--orange); background: var(--orange-soft); }
.task-details { display: flex; flex-wrap: wrap; gap: .42rem; }
.task-details span { border-radius: 999px; padding: .28rem .56rem; background: #f3f4f9; color: #737d94; font-size: .75rem; }
.task-details span:first-child { background: var(--violet-soft); color: var(--violet); font-weight: 750; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; padding-top: .85rem; border-top: 1px solid #eef0f5; }
.actions button { padding: .62rem .78rem; font-size: .81rem; }
.actions > button:first-child { background: linear-gradient(135deg, #0bab79, #078b62); box-shadow: 0 6px 14px rgb(7 155 109 / 18%); }
.event-card .actions > button.quiet:first-child { background: #fff; box-shadow: none; color: #505b73; }
.event-card .actions .open { border: 0; background: linear-gradient(135deg, #ff8a42, #f36a22); color: #fff; }
.actions .quiet, .actions .open { border: 1px solid #dfe3ed; background: #fff; color: #505b73; }
.actions .danger { border: 1px solid #ffcaca; background: #fff; color: var(--red); }
.task-actions { align-items: center; }
.more-actions { position: relative; margin-left: auto; }
.more-actions summary { list-style: none; border: 1px solid #dfe3ed; border-radius: 13px; padding: .62rem .78rem; background: #fff; color: #505b73; font-size: .81rem; font-weight: 750; cursor: pointer; }
.more-actions summary::-webkit-details-marker { display: none; }
.more-actions summary[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.more-actions-menu { position: absolute; z-index: 10; top: calc(100% + .4rem); right: 0; display: grid; width: min(260px, 78vw); gap: .4rem; padding: .55rem; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 18px 48px rgb(31 39 67 / 18%); }
.task-context { margin: .15rem .25rem .4rem; color: #68728a; font-size: .82rem; line-height: 1.4; }
.more-actions-menu button { width: 100%; box-shadow: none !important; text-align: left; }
dialog { width: min(480px, calc(100% - 2rem)); border: 1px solid var(--line); border-radius: 22px; padding: 0; background: #fff; color: var(--ink); box-shadow: 0 24px 70px rgb(31 39 67 / 26%); }
dialog::backdrop { background: rgb(22 29 48 / 45%); backdrop-filter: blur(3px); }
.dialog-form { padding: 1.15rem; }
.dialog-heading, .dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.dialog-heading { margin-bottom: 1rem; }
.icon-button { width: 2.3rem; height: 2.3rem; padding: 0; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: #677189; font-size: 1.35rem; }
.dialog-fields { display: grid; gap: .85rem; }
.quick-times { display: flex; flex-wrap: wrap; gap: .45rem; }
.quick-times button { padding: .55rem .7rem; font-size: .8rem; }
.dialog-actions { justify-content: flex-end; margin-top: .3rem; }
.auth { max-width: 430px; margin: 10vh auto 0; padding: 1.4rem; }
.auth-brand { font-size: 1.05rem; }
.auth form { display: grid; gap: .9rem; margin-top: 1.25rem; }
.auth form > button { width: 100%; }
.password-login { border-top: 1px solid var(--line); padding-top: .8rem; }
.password-login summary { color: var(--violet); font-size: .86rem; font-weight: 750; text-align: center; cursor: pointer; }
.password-login label { margin-top: .9rem; }
.password-login button { width: 100%; margin-top: .8rem; }
#device-link { display: grid; gap: 1rem; margin-top: 1.25rem; }
#device-link button { width: 100%; }
label { display: grid; gap: .42rem; color: #59647c; font-size: .86rem; }
input, select { width: 100%; border: 1px solid #dfe3ed; border-radius: 13px; padding: .82rem; background: #fff; color: var(--ink); }
select:disabled { opacity: .55; }
.group-card label { margin-top: .9rem; }
.error { min-height: 1.25rem; margin-top: .8rem !important; color: var(--red) !important; }
.error.notice { color: var(--green) !important; }
.app-error { text-align: center; }
.empty { padding: 1.5rem; color: var(--muted); text-align: center; }
@media (max-width: 560px) {
  main { padding-right: .75rem; padding-left: .75rem; }
  .tabs .tab { gap: .25rem; font-size: .8rem; }
  .tabs .tab svg { width: 1.15rem; }
  .push-card { align-items: center; gap: .7rem; }
  .push-icon { width: 42px; height: 42px; }
  .push-card button { padding: .65rem .72rem; font-size: .78rem; }
  .metrics { gap: .45rem; }
  .metric { padding: .72rem .58rem; }
  .metric strong { font-size: 1.55rem; }
  .metric small { font-size: .68rem; }
  .notification .top, .task-card .top { gap: .55rem; }
  .task-card h3 { font-size: .95rem; }
  .actions { gap: .4rem; }
  .actions button, .more-actions summary { padding: .56rem .62rem; font-size: .76rem; }
}
@media (max-width: 380px) {
  .tabs .tab { flex-direction: column; font-size: .72rem; }
  .metrics { grid-template-columns: 1fr; }
  .metric { grid-template-columns: auto 1fr; align-items: center; }
  .metric-icon { grid-row: 1 / 4; margin: 0 .3rem 0 0; }
  .metric strong { font-size: 1.35rem; }
}
