/* uplogic — clean, quiet, ChatGPT-ish. One accent, lots of whitespace. */
:root {
  --bg: #ffffff;
  --bg-soft: #f7f7f8;
  --bg-hover: #f0f0f1;
  --border: #e5e5e7;
  --border-strong: #d4d4d8;
  --text: #1d1d20;
  --text-soft: #6b6b73;
  --text-faint: #9a9aa2;
  --accent: #10a37f;
  --accent-soft: #e7f6f1;
  --danger: #d64545;
  --pin: #e8a53d;
  --new: #4a7dff;
  --logo-green: #2ba84a;
  --logo-ink: #383838;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
/* dark palette — applied by system preference (unless user forces light) or by an explicit theme choice */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1a1a1c; --bg-soft: #242427; --bg-hover: #2e2e32;
    --border: #313135; --border-strong: #3d3d42;
    --text: #ececef; --text-soft: #a0a0a8; --text-faint: #6e6e76;
    --accent: #1fb894; --accent-soft: #17352e;
    --logo-green: #34c05e; --logo-ink: #ececef;
    --shadow: 0 1px 3px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
  }
}
:root[data-theme="dark"] {
  --bg: #1a1a1c; --bg-soft: #242427; --bg-hover: #2e2e32;
  --border: #313135; --border-strong: #3d3d42;
  --text: #ececef; --text-soft: #a0a0a8; --text-faint: #6e6e76;
  --accent: #1fb894; --accent-soft: #17352e;
  --logo-green: #34c05e; --logo-ink: #ececef;
  --shadow: 0 1px 3px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%;
  width: 100%; max-width: 100%;
  overflow-x: hidden;              /* fallback */
  overflow-x: clip;                /* clips the off-canvas (fixed) drawer/sidebar reliably */
  overscroll-behavior-x: none;     /* kill horizontal rubber-banding on mobile */
  touch-action: pan-y pinch-zoom;  /* vertical scroll + zoom only — no sideways drag gesture */
}
body {
  font-family: var(--font); background: var(--bg); color: var(--text);
  font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: inherit; color: var(--text); }
.hidden { display: none !important; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100%; display: flex; flex-direction: column; background: var(--bg-soft); }
.auth-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px; background: var(--bg); border-bottom: 1px solid var(--border);
}
.auth-head .logo { font-size: 22px; }
.auth-lang { display: flex; gap: 4px; }
.auth-lang-opt {
  border: 1px solid var(--border); background: var(--bg); color: var(--text-soft);
  padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .03em;
}
.auth-lang-opt.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.auth-main { flex: 1; display: grid; place-items: center; padding: 28px 20px; }
.auth-card {
  width: 100%; max-width: 400px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow); padding: 34px 32px;
}
.auth-title { font-size: 23px; font-weight: 700; letter-spacing: -.02em; margin: 0; text-align: center; }
.auth-sub { color: var(--text-soft); font-size: 14px; margin: 8px 0 24px; text-align: center; line-height: 1.45; }
.auth-foot {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--text-faint); font-size: 12.5px; padding: 24px 20px 30px;
}
.auth-foot .logo { font-size: 18px; }       /* the logo image scales off font-size */
.auth-foot-tag { letter-spacing: .01em; }
.logo {
  font-size: 30px; font-weight: 800; letter-spacing: -.03em; white-space: nowrap;
  font-family: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", var(--font);
}
.logo .lg-up { color: var(--logo-green); }
.logo .lg-logic { color: var(--logo-ink); }
.logo .dot { color: var(--logo-green); }
.logo-img { height: 1.15em; width: auto; display: block; }
.auth-card form { display: flex; flex-direction: column; gap: 0; text-align: left; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text); }
.auth-card input[type=text], .auth-card input[type=email], .auth-card input[type=password] {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--bg); outline: none;
}
.auth-card input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.auth-card input.invalid { border-color: var(--danger); }
.input-wrap { position: relative; display: flex; }
.input-wrap .eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: none; background: transparent; color: var(--text-faint);
  padding: 6px; border-radius: 6px; display: grid; place-items: center;
}
.input-wrap .eye:hover { color: var(--text-soft); }
.input-wrap .eye.on { color: var(--accent); }
.input-wrap input { padding-right: 40px !important; }

/* live password requirements */
.pw-rules { list-style: none; margin: -4px 0 14px; padding: 0; display: grid; gap: 5px; }
.pw-rules li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-faint); }
.pw-rules li .tick {
  width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--border-strong);
  flex: none; position: relative;
}
.pw-rules li.ok { color: var(--text-soft); }
.pw-rules li.ok .tick { background: var(--accent); border-color: var(--accent); }
.pw-rules li.ok .tick:after {
  content: ""; position: absolute; left: 4px; top: 1px; width: 3px; height: 7px;
  border: solid #fff; border-width: 0 1.7px 1.7px 0; transform: rotate(45deg);
}
.remember-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 2px 0 4px; }
.remember { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--text-soft); cursor: pointer; }
.remember input { width: 17px; height: 17px; accent-color: var(--accent); flex: none; }
.link-a { color: var(--accent); font-size: 13.5px; font-weight: 500; cursor: pointer; text-decoration: none; }
.link-a:hover { text-decoration: underline; }

/* "check your email" panel */
.auth-notice { text-align: center; padding: 4px 0 0; }
.notice-icon {
  width: 52px; height: 52px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; margin: 0 auto 16px;
}
.notice-text { color: var(--text-soft); font-size: 14px; line-height: 1.55; margin: 0 0 20px; }
.notice-text b { color: var(--text); }
.notice-link { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 18px; }
.notice-hint { color: var(--text-faint); font-size: 12px; margin: 0 0 6px; }
.notice-link a { font-size: 12.5px; word-break: break-all; }
.auth-notice .btn-ghost { width: 100%; }
.btn-primary {
  padding: 12px 14px; border: none; border-radius: var(--radius-sm);
  background: var(--accent); color: #fff; font-weight: 600; transition: filter .15s;
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:disabled { opacity: .55; cursor: default; }
.btn-ghost {
  padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text); font-weight: 500;
}
.btn-ghost:hover { background: var(--bg-hover); }
.auth-toggle { margin-top: 18px; color: var(--text-soft); font-size: 14px; text-align: center; }
.auth-toggle a { color: var(--accent); cursor: pointer; text-decoration: none; }
.form-error { color: var(--danger); font-size: 14px; min-height: 18px; margin: 2px 0; }
.invite-banner {
  background: var(--accent-soft); color: var(--accent); border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: 14px; margin-bottom: 18px; font-weight: 500;
}

/* ---------- Sidebar ---------- */
.sidebar-overlay {
  position: fixed; inset: 0; z-index: 25; background: rgba(0,0,0,.28);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.sidebar-overlay.open { opacity: 1; pointer-events: auto; }
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 26; width: 272px;
  background: var(--bg-soft); border-right: 1px solid var(--border);
  transform: translateX(-100%); transition: transform .22s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column; padding: 16px 14px;
}
.sidebar.open { transform: translateX(0); }
.sidebar-head { display: flex; align-items: center; margin-bottom: 22px; height: 36px; }
.sidebar-head .logo { font-size: 20px; flex: 1; }
.sidebar-label, .dd-section-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-faint); font-weight: 700; margin: 4px 6px 8px;
}
.ws-list { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.ws-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  border-radius: var(--radius-sm); border: none; background: transparent;
  color: var(--text); text-align: left; width: 100%; font-size: 14.5px;
}
.ws-item:hover { background: var(--bg-hover); }
.ws-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.ws-item .ws-dot {
  width: 22px; height: 22px; border-radius: 6px; flex: none; display: grid; place-items: center;
  background: var(--border); color: var(--text-soft); font-size: 11px; font-weight: 700;
}
.ws-item.active .ws-dot { background: var(--accent); color: #fff; }
.ws-item .ws-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-item .ws-count { flex: none; color: var(--text-faint); font-size: 12px; font-weight: 600; min-width: 16px; text-align: right; }
.ws-item.active .ws-count { color: var(--accent); }
.ws-item .ws-badge { color: var(--text-faint); font-size: 12px; display: inline-flex; align-items: center; gap: 4px; }
.ws-item .ws-badge svg { display: block; }
/* stacked member avatars for shared workspaces */
.ws-members { display: inline-flex; align-items: center; flex: none; }
.mini-av {
  width: 20px; height: 20px; border-radius: 50%; overflow: hidden; flex: none;
  background: var(--accent); color: #fff; font-size: 9px; font-weight: 700;
  display: grid; place-items: center; border: 1.5px solid var(--bg-soft);
  margin-left: -6px;
}
.mini-av:first-child { margin-left: 0; }
.mini-av img { width: 100%; height: 100%; object-fit: cover; }
.mini-av.more { background: var(--border); color: var(--text-soft); }
/* "for me" section + assignee avatar inside task meta (no stacking overlap there) */
.sidebar-label.ws-sub { margin-top: 18px; }
.ws-item .ws-dot.me-dot { background: var(--accent); color: #fff; overflow: hidden; position: relative; }
.ws-item .ws-dot.me-dot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.meta .mini-av { width: 17px; height: 17px; font-size: 8px; margin-left: 0; border: none; }
.seg button .t svg { vertical-align: -2px; margin-right: 5px; }
.ws-new {
  display: flex; align-items: center; gap: 8px; padding: 10px; margin-top: 8px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
  background: transparent; color: var(--text-soft); font-weight: 500; width: 100%;
}
.ws-new:hover { background: var(--bg-hover); color: var(--text); }

.main { min-height: 100%; }

/* ---------- Fixed brand + account corners (logo never moves) ---------- */
.brand {
  position: fixed; top: 12px; left: 16px; z-index: 30;
  display: flex; align-items: center; gap: 6px; border: none; background: transparent;
  padding: 4px 10px 4px 6px; border-radius: 10px; color: var(--text);
}
.brand:hover { background: var(--bg-hover); }
.brand .brand-menu { color: var(--text-soft); display: grid; place-items: center; }
.brand .logo { font-size: 20px; }
.acct-wrap { position: fixed; top: 14px; right: 16px; z-index: 31; }

/* ---------- App shell ---------- */
.app { max-width: 720px; margin: 0 auto; padding: 62px 20px 140px; }
.ws-heading { font-size: 23px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 16px; }
.ws-heading.editable { cursor: text; }
.ws-heading.editable:hover { color: var(--accent); }
.ws-title-input {
  font: inherit; font-size: 23px; font-weight: 700; letter-spacing: -.02em; color: var(--text);
  border: none; border-bottom: 2px solid var(--accent); outline: none; background: transparent; padding: 0;
}
.spacer { flex: 1; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 13px; font-weight: 600; border: none;
}
.icon-btn {
  border: none; background: transparent; color: var(--text-soft);
  width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; flex: none;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }

/* account dropdown */
.dropdown {
  position: absolute; right: 0; top: 44px; z-index: 60; width: 240px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 8px; overflow: hidden;
}
.dropdown-head { padding: 8px 10px 4px; }
.dd-name { font-weight: 600; }
.dd-email { color: var(--text-faint); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.dropdown-sep { height: 1px; background: var(--border); margin: 8px 0; }
.lang-switch { display: flex; gap: 6px; padding: 0 4px; }
.lang-opt {
  flex: 1; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-soft); color: var(--text-soft); font-size: 13px; font-weight: 500;
}
.lang-opt.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.dropdown-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 10px; border: none; background: transparent; color: var(--text);
  border-radius: var(--radius-sm); font-size: 14px;
}
.dropdown-item:hover { background: var(--bg-hover); }

/* search + controls */
.head-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0 0 16px; }
.head-row .ws-heading { margin: 0; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.head-spacer { flex: 1 1 0; min-width: 0; }
.controls { display: flex; gap: 10px; align-items: center; margin: 4px 0 16px; }

/* search collapses to an icon, expands on tap — sits next to the sort icon */
.search {
  display: flex; align-items: center; flex: none;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 999px; overflow: hidden;
}
.search .search-icon {
  border: none; background: transparent; color: var(--text-faint);
  width: 38px; height: 38px; display: grid; place-items: center; flex: none;
}
.search input { border: none; background: transparent; outline: none; width: 0; padding: 0; transition: width .2s ease, padding .2s ease; }
.search.open { border-color: var(--border-strong); }
.search.open .search-icon { color: var(--text-soft); }
.search.open input { width: 168px; padding: 8px 14px 8px 2px; }
.sort-wrap { position: relative; flex: none; }
.sort-btn {
  border: 1px solid var(--border); background: var(--bg-soft); color: var(--text-soft);
  width: 40px; height: 40px; border-radius: 999px; display: grid; place-items: center;
}
.sort-btn:hover { border-color: var(--border-strong); color: var(--text); }
.sort-btn.active { border-color: var(--accent); color: var(--accent); }
.sort-menu {
  position: absolute; right: 0; top: 48px; z-index: 60; width: 210px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 6px;
}
.sort-menu .menu-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-faint); font-weight: 700; padding: 6px 10px 4px;
}
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 10px; border: none; background: transparent; color: var(--text);
  border-radius: var(--radius-sm); font-size: 14px;
}
.menu-item:hover { background: var(--bg-hover); }
.menu-item .tick { width: 16px; color: var(--accent); visibility: hidden; display: grid; place-items: center; }
.menu-item.active .tick { visibility: visible; }
.menu-item.active { font-weight: 600; }

/* ---------- Updates app ---------- */
.updates-bar { margin: 0 0 12px; }
.updates-btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px;
  border: 1px solid var(--border); background: var(--bg-soft); color: var(--text);
  border-radius: 999px; font-size: 13.5px; font-weight: 600;
}
.updates-btn:hover { border-color: var(--accent); color: var(--accent); }
.updates-btn .bolt { color: #f0a51e; flex: none; }
.updates-count {
  background: var(--accent); color: #fff; border-radius: 999px;
  font-size: 11px; font-weight: 700; padding: 1px 7px; min-width: 18px; text-align: center;
}
/* nudge the app icon when there are unread updates since the last sign-in */
.updates-btn .app-icon.sm { transition: transform .2s; }
.updates-btn.has-new .app-icon.sm { animation: appNudge 1.9s ease-in-out infinite; }
@keyframes appNudge {
  0%, 62%, 100% { transform: rotate(0) scale(1); }
  68% { transform: rotate(-11deg) scale(1.13); }
  76% { transform: rotate(9deg) scale(1.13); }
  84% { transform: rotate(-5deg) scale(1.06); }
  92% { transform: rotate(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) { .updates-btn.has-new .app-icon.sm { animation: none; } }
.upd-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 16px; }
.upd-title .bolt { color: #f0a51e; }
.upd-section { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-faint); font-weight: 700; margin: 20px 0 10px; }
.upd-section:first-child { margin-top: 0; }
.upd-item {
  display: flex; gap: 11px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.upd-item:last-child { border-bottom: none; }
.upd-item:hover .upd-text { color: var(--accent); }
.upd-item .mini-av { margin-left: 0; border: none; width: 26px; height: 26px; font-size: 10px; }
.upd-main { flex: 1; min-width: 0; }
.upd-text { font-size: 14px; line-height: 1.45; }
.upd-meta { display: flex; align-items: center; gap: 8px; margin-top: 3px; font-size: 12px; color: var(--text-faint); flex-wrap: wrap; }
.upd-meta .ws-chip { background: var(--accent-soft); color: var(--accent); padding: 1px 8px; border-radius: 999px; font-weight: 600; }
.upd-empty { color: var(--text-faint); font-size: 13.5px; padding: 6px 0 2px; }

/* ---------- Full pages (app store / admin) ---------- */
.page { position: fixed; inset: 0; z-index: 90; background: var(--bg); display: flex; }
.page-side {
  width: 250px; flex: none; border-right: 1px solid var(--border); background: var(--bg-soft);
  padding: 18px 14px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto;
}
.page-back {
  display: flex; align-items: center; gap: 8px; border: none; background: transparent;
  color: var(--text-soft); font-size: 14px; font-weight: 500; padding: 8px 10px; border-radius: var(--radius-sm);
  margin-bottom: 14px;
}
.page-back:hover { background: var(--bg-hover); color: var(--text); }
.page-side-title { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); font-weight: 700; margin: 0 6px 8px; }
.page-nav { display: flex; flex-direction: column; gap: 2px; }
.page-nav button {
  display: flex; align-items: center; gap: 10px; text-align: left; width: 100%;
  border: none; background: transparent; color: var(--text); padding: 9px 10px;
  border-radius: var(--radius-sm); font-size: 14.5px;
}
.page-nav button:hover { background: var(--bg-hover); }
.page-nav button.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.page-main { flex: 1; overflow-y: auto; }
.page-inner { max-width: 720px; margin: 0 auto; padding: 40px 28px 80px; }
.page-h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 6px; }
.page-sub { color: var(--text-soft); font-size: 14.5px; margin: 0 0 28px; }
.page-section { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-faint); font-weight: 700; margin: 28px 0 10px; }
@media (max-width: 720px) {
  /* The side nav becomes one scrollable row of section chips. Wrapping it — and
     keeping the per-app sub-lists — pushed the actual page off the bottom of the
     screen; the apps are listed in the content below anyway. */
  .page { flex-direction: column; }
  .page-side {
    width: auto; flex: none; overflow: visible; gap: 0;
    border-right: none; border-bottom: 1px solid var(--border); padding: 10px 12px;
  }
  .page-back { margin-bottom: 8px; padding: 6px 8px; align-self: flex-start; }
  .page-side-title { display: none; }
  .page-nav {
    flex-direction: row; flex-wrap: nowrap; gap: 8px;
    overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
    margin: 0 -12px; padding: 0 12px;
  }
  .page-nav::-webkit-scrollbar { display: none; }
  .page-side .page-nav > button {
    flex: none; width: auto; white-space: nowrap; align-items: center;
    padding: 8px 14px; border-radius: 999px; font-size: 13.5px; line-height: 1.2;
    border: 1px solid var(--border); background: var(--bg);
  }
  .page-side .page-nav > button.active { border-color: var(--accent); }
  .page-side .page-nav .nav-sub { display: none; }
  .page-main { flex: 1; min-height: 0; }
  .page-inner { padding: 24px 16px 60px; }
}

/* ---------- App store ---------- */
.app-card {
  display: flex; align-items: center; gap: 14px; padding: 14px;
  border: 1px solid var(--border); border-radius: var(--radius); margin-top: 10px; cursor: pointer;
  background: var(--bg);
}
.app-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.app-icon {
  width: 52px; height: 52px; border-radius: 13px; flex: none; display: grid; place-items: center;
  background: linear-gradient(135deg, #ffd76e, #f0a51e); color: #fff; overflow: hidden; position: relative;
}
.app-icon img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.app-icon.lg { width: 96px; height: 96px; border-radius: 22px; }
.app-icon.sm { width: 20px; height: 20px; border-radius: 5px; }
.app-icon.sm svg { width: 13px; height: 13px; }
.app-info { flex: 1; min-width: 0; }
.app-name { font-weight: 600; }
.app-tag { color: var(--text-soft); font-size: 13px; }
.app-star { color: #f0a51e; font-size: 13px; margin-left: 6px; }
.app-installs { display: block; color: var(--text-faint); font-size: 12px; margin-top: 2px; }

/* ---------- the store front: shelves you browse, not a list you scroll ----- */
.app-sec { margin: 0 0 38px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.sec-head h2 { font-size: 20px; font-weight: 700; letter-spacing: -.015em; margin: 0; }
.sec-more { border: 0; background: none; padding: 0; font: inherit; font-size: 14px; color: var(--accent); cursor: pointer; }
.sec-more:hover { text-decoration: underline; }

/* a shelf scrolls sideways and snaps, so more apps just extend it */
.shelf-wrap { position: relative; }
.app-shelf {
  display: flex; gap: 16px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; padding: 2px 4px 4px; margin: 0 -4px;
  scrollbar-width: none;
}
.app-shelf::-webkit-scrollbar { display: none; }
.shelf-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--border); background: var(--bg); color: var(--text-soft);
  cursor: pointer; box-shadow: var(--shadow); opacity: 0; transition: opacity .15s;
}
.shelf-wrap:hover .shelf-nav { opacity: 1; }
.shelf-nav:hover { color: var(--text); border-color: var(--border-strong); }
.shelf-nav.prev { left: -14px; }
.shelf-nav.next { right: -14px; }
.shelf-wrap.at-start .prev, .shelf-wrap.at-end .next, .shelf-wrap.no-scroll .shelf-nav { display: none; }
@media (hover: none) { .shelf-nav { display: none; } }

.app-hero {
  scroll-snap-align: start; flex: 0 0 min(430px, 86%);
  display: flex; align-items: center; gap: 16px; text-align: left; cursor: pointer;
  font: inherit; color: inherit; background: var(--bg-soft);
  border: 1px solid var(--border); border-radius: 20px; padding: 20px 20px 20px 22px;
  transition: border-color .15s, box-shadow .15s;
}
.app-hero:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.hero-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hero-kicker {
  display: block; font-size: 11px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--text-faint);
}
.hero-title { font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; margin-top: 4px; }
.hero-sub { font-size: 13.5px; color: var(--text-soft); line-height: 1.45; margin-top: 5px; }
/* an app icon has one shape — the same rounded square as everywhere else */
.hero-art {
  flex: none; width: 108px; height: 108px; border-radius: 26px; overflow: hidden;
  display: grid; place-items: center;
}
.hero-art img { width: 100%; height: 100%; object-fit: cover; }
.app-icon.hero { width: 108px; height: 108px; border-radius: 26px; }
.app-icon.hero svg { width: 46px; height: 46px; }

/* the picture row — grows on its own as screenshots get uploaded */
.app-feature {
  scroll-snap-align: start; flex: 0 0 min(310px, 80%); display: flex; flex-direction: column;
  text-align: left; border: 0; background: none; padding: 0; cursor: pointer; font: inherit; color: inherit;
}
.feature-art {
  display: block; width: 100%; aspect-ratio: 16 / 10; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--border); background: var(--bg-soft);
}
.feature-art img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.app-feature:hover .feature-art img { transform: scale(1.03); }
.feature-kicker {
  margin-top: 13px; font-size: 11px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--text-faint);
}
.feature-title { font-size: 17px; font-weight: 700; margin-top: 3px; }
.feature-sub { font-size: 13.5px; color: var(--text-soft); line-height: 1.45; margin-top: 3px; }

/* compact rows, several to a line on a wide screen */
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 2px 24px; }
.app-tile {
  display: flex; align-items: center; gap: 13px; padding: 10px; border-radius: 12px; cursor: pointer;
}
.app-tile:hover { background: var(--bg-hover); }
.tile-body { flex: 1; min-width: 0; }
.tile-name { display: block; font-weight: 600; font-size: 14.5px; }
.tile-tag {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  color: var(--text-soft); font-size: 13px; line-height: 1.35; margin-top: 2px;
}
.tile-installs { display: block; color: var(--text-faint); font-size: 12px; margin-top: 1px; }
.tile-new {
  margin-left: 7px; font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 2px 7px;
}
.app-pill {
  flex: none; font: inherit; font-size: 13px; font-weight: 600; border: 0; border-radius: 999px;
  padding: 6px 16px; background: var(--bg-hover); color: var(--accent); cursor: pointer;
}
.app-tile:hover .app-pill { background: var(--accent-soft); }
.app-pill:disabled { opacity: .5; cursor: default; }
.app-pill.on { background: none; color: var(--text-faint); font-weight: 500; cursor: default; padding-right: 8px; }

@media (max-width: 640px) {
  .app-hero { flex: 0 0 88%; padding: 16px; gap: 12px; }
  .hero-art, .app-icon.hero { width: 84px; height: 84px; border-radius: 20px; }
  .app-icon.hero svg { width: 36px; height: 36px; }
  .hero-title { font-size: 20px; }
  .app-sec { margin-bottom: 30px; }
  .sec-head h2 { font-size: 18px; }
}

.apps-title { min-width: 0; }
.apps-title .page-h1, .apps-title .page-sub { margin: 0; }
.apps-title .page-sub { margin-top: 3px; }
.ads-row { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--border); }

/* app store toolbar */
.apps-toolbar { display: flex; gap: 10px; align-items: center; margin: 0 0 6px; flex-wrap: wrap; }
.apps-search {
  flex: 1; min-width: 180px; display: flex; align-items: center; gap: 8px;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 999px; padding: 9px 14px;
}
.apps-search svg { color: var(--text-faint); flex: none; }
.apps-search input { flex: 1; border: none; background: transparent; outline: none; min-width: 0; }
.apps-sort {
  border: 1px solid var(--border); background: var(--bg-soft); color: var(--text-soft);
  border-radius: 999px; padding: 9px 12px; outline: none; flex: none;
}
.apps-empty { color: var(--text-faint); font-size: 14px; padding: 26px 2px; }

/* App screenshots on the app's own page: full width, one under the other —
   a screenshot you have to squint at may as well not be there. */
.app-gallery { display: flex; flex-direction: column; gap: 16px; margin: 4px 0 28px; }
.app-shot {
  width: 100%; height: auto; display: block; border-radius: 16px;
  border: 1px solid var(--border); background: var(--bg-soft); cursor: zoom-in;
}
/* the admin editor still wants thumbnails it can delete */
.admin-gallery { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; margin: 0 0 12px; flex-wrap: wrap; }
.admin-gallery img { height: 110px; border-radius: 10px; border: 1px solid var(--border); display: block; }
.admin-img { position: relative; flex: none; }
.admin-img .x {
  position: absolute; top: 5px; right: 5px; border: none; background: rgba(0,0,0,.6); color: #fff;
  width: 22px; height: 22px; border-radius: 50%; font-size: 12px; line-height: 1; cursor: pointer;
}

/* sub-apps listed under a sidebar category */
.page-nav .nav-sub { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 8px 10px; }
.page-nav .nav-sub button {
  font-size: 13.5px; padding: 6px 9px; color: var(--text-soft); gap: 8px;
}
.page-nav .nav-sub button.active { color: var(--accent); background: transparent; font-weight: 600; }
.page-nav .nav-sub .more { color: var(--text-faint); font-size: 12.5px; }

/* drop a file anywhere on the open task */
.drop-target { position: absolute; inset: 0; z-index: 5; display: none; pointer-events: none;
  background: color-mix(in srgb, var(--accent) 82%, transparent);
  align-items: center; justify-content: center; flex-direction: column; gap: 10px; color: #fff;
  border-radius: 0; font-weight: 600; font-size: 15px;
}
.drawer.file-over .drop-target { display: flex; }
.drop-target svg { opacity: .95; }
.app-state { font-size: 12px; font-weight: 700; color: var(--accent); flex: none; }
.app-detail-head { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; }
.app-desc { color: var(--text-soft); font-size: 14.5px; line-height: 1.6; margin: 0 0 24px; }

/* admin forms */
.admin-field { margin-bottom: 16px; }
.admin-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.admin-field input, .admin-field textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--bg); outline: none; font-size: 14px;
}
.admin-field textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.admin-field input:focus, .admin-field textarea:focus { border-color: var(--accent); }
.admin-icon-row { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.admin-hint { color: var(--text-faint); font-size: 12.5px; margin-top: 6px; }
.admin-actions { display: flex; gap: 10px; margin-top: 22px; }

/* tag filter row */
.tag-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.tag-filter:empty { display: none; }
.tag-pill {
  border: 1px solid var(--border); background: var(--bg-soft); color: var(--text-soft);
  padding: 5px 11px; border-radius: 999px; font-size: 13px; display: inline-flex; gap: 6px; align-items: center;
}
.tag-pill:hover { border-color: var(--border-strong); }
.tag-pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.tag-pill .cnt { opacity: .6; font-size: 11px; }

/* ---------- Task list ---------- */
.list { display: flex; flex-direction: column; gap: 8px; }
.task {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 13px 14px;
  transition: border-color .15s, box-shadow .15s; cursor: pointer; position: relative;
}
.task:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.task.dragging { opacity: .4; }
.drag-handle {
  color: var(--text-faint); cursor: grab; opacity: 0; transition: opacity .15s;
  flex: none; height: 22px; display: grid; place-items: center; touch-action: none;
}
.task:hover .drag-handle { opacity: .55; }
.drag-handle:active { cursor: grabbing; }
.check {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--border-strong); background: var(--bg);
  display: grid; place-items: center; color: #fff;
  transition: background .15s, border-color .15s; padding: 0;
}
/* the check and the in-progress dot share one grid cell, so both stay centred */
.check svg { grid-area: 1 / 1; display: block; opacity: 0; transition: opacity .12s; }
.check.done svg { opacity: 1; }                                  /* white check on green */
.check:not(.done):hover { border-color: var(--accent); color: var(--accent); }
.check:not(.done):hover svg { opacity: 1; }                     /* accent check preview on hover */
.check.in_progress { border-color: var(--accent); }
.check.in_progress::after {
  content: ""; grid-area: 1 / 1; align-self: center; justify-self: center;
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent); transition: opacity .12s;
}
.check.in_progress:hover::after { opacity: 0; }                 /* hide the dot so the check shows */
.check.done { background: var(--accent); border-color: var(--accent); }
.task-main { flex: 1; min-width: 0; }
.task-title {
  font-weight: 500; word-break: break-word; line-height: 22px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 22px;
}
.task.done-row .task-title { color: var(--text-faint); text-decoration: line-through; }
.task-desc {
  color: var(--text-soft); font-size: 13.5px; margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
}
.meta { display: flex; align-items: center; gap: 12px; margin-top: 8px; font-size: 12.5px; color: var(--text-faint); flex-wrap: wrap; }
.meta .m { display: inline-flex; align-items: center; gap: 4px; }
.meta .due.overdue { color: var(--danger); }
.meta .tag-mini { background: var(--bg-hover); color: var(--text-soft); padding: 1px 7px; border-radius: 999px; }
.badge {
  font-size: 10.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px;
}
.badge.new { background: color-mix(in srgb, var(--new) 15%, transparent); color: var(--new); }
.badge.progress { background: var(--accent-soft); color: var(--accent); }
.pin-btn { border: none; background: transparent; color: var(--text-faint); padding: 2px; border-radius: 6px; flex: none; margin-top: 1px; }
.pin-btn:hover { color: var(--pin); background: var(--bg-hover); }
.pin-btn.active { color: var(--pin); }

.section-head {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  margin: 26px 0 10px; color: var(--text-soft); font-size: 13px; font-weight: 600; user-select: none;
}
.section-head .chev { transition: transform .15s; }
.section-head.collapsed .chev { transform: rotate(-90deg); }
.section-head .count { color: var(--text-faint); font-weight: 500; }
.empty { text-align: center; color: var(--text-faint); padding: 70px 20px; }
.empty .big { font-size: 40px; margin-bottom: 10px; }

/* ---------- Composer ---------- */
.composer {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 22;
  background: linear-gradient(0deg, var(--bg) 70%, transparent); padding: 16px 20px 20px;
}
.composer-inner {
  max-width: 720px; margin: 0 auto; display: flex; align-items: flex-end; gap: 10px;
  background: var(--bg); border: 1px solid var(--border-strong);
  border-radius: 26px; padding: 8px 8px 8px 18px; box-shadow: var(--shadow);
}
.composer-inner textarea {
  flex: 1; border: none; outline: none; background: transparent; resize: none;
  max-height: 140px; padding: 8px 0; line-height: 1.4; overflow-y: auto;
}
.composer-inner .send, .composer-inner .mic {
  flex: none; width: 40px; height: 40px; border-radius: 50%; border: none; display: grid; place-items: center;
}
.composer-inner .send { background: var(--accent); color: #fff; }
.composer-inner .send:disabled { background: var(--border-strong); cursor: default; }
.composer-inner .mic {
  background: var(--bg-soft); color: var(--text-soft);
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  touch-action: none;                 /* hold-to-record without triggering scroll/gestures */
}
/* while recording, nothing on the page is selectable and no iOS callout appears */
body.recording, body.recording * {
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.composer-inner .mic:hover { background: var(--bg-hover); }
.composer-inner .mic.recording { background: var(--danger); color: #fff; animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(214,69,69,.5);} 50% { box-shadow: 0 0 0 8px rgba(214,69,69,0);} }
.rec-hint { text-align: center; color: var(--text-faint); font-size: 12px; margin-top: 8px; min-height: 15px; }

/* pull-to-refresh spinner (mobile) */
.ptr {
  position: fixed; top: 8px; left: 50%; z-index: 190;
  transform: translateX(-50%) translateY(-48px);
  width: 36px; height: 36px; border-radius: 50%; background: var(--bg);
  box-shadow: var(--shadow); display: grid; place-items: center; color: var(--text-soft);
  opacity: 0; pointer-events: none;
}
.ptr svg { transition: transform .2s ease; }
.ptr.armed svg { transform: rotate(-180deg); color: var(--accent); }
.ptr.spin svg { animation: ptrSpin .7s linear infinite; }
@keyframes ptrSpin { to { transform: rotate(360deg); } }

/* full-width recording indicator pinned to the top while the mic is held */
.rec-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  display: none; align-items: center; justify-content: center; gap: 12px;
  background: var(--danger); color: #fff; font-weight: 600; font-size: 14px; letter-spacing: .01em;
  padding: calc(11px + env(safe-area-inset-top, 0px)) 16px 11px;
  box-shadow: 0 3px 14px rgba(0,0,0,.25);
}
body.recording .rec-banner { display: flex; animation: recSlide .18s ease; }
@keyframes recSlide { from { transform: translateY(-100%); } to { transform: translateY(0); } }
.rec-banner .rec-eq { display: inline-flex; align-items: center; gap: 3px; height: 18px; }
.rec-banner .rec-eq i { width: 3px; height: 100%; background: #fff; border-radius: 2px; transform-origin: center; animation: recEq .85s ease-in-out infinite; }
.rec-banner .rec-eq i:nth-child(2) { animation-delay: .16s; }
.rec-banner .rec-eq i:nth-child(3) { animation-delay: .32s; }
.rec-banner .rec-eq i:nth-child(4) { animation-delay: .48s; }
.rec-banner .rec-eq i:nth-child(5) { animation-delay: .64s; }
@keyframes recEq { 0%, 100% { transform: scaleY(.25); } 50% { transform: scaleY(1); } }

/* ---------- Detail drawer ---------- */
.overlay { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.28); opacity: 0; pointer-events: none; transition: opacity .2s; }
.overlay.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 50; width: min(560px, 100%);
  background: var(--bg);
  transform: translateX(100%); transition: transform .25s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
}
/* Only cast the shadow while open — parked off-screen it spilled 30px of grey
   back across the right edge of the page. */
.drawer.open { transform: translateX(0); box-shadow: -8px 0 30px rgba(0,0,0,.18); }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
/* Autosave confirms itself here, quietly, instead of throwing a toast every
   time you pause mid-sentence. */
.saved-hint {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px;
  color: var(--text-faint); opacity: 0; transition: opacity .3s ease;
  pointer-events: none; white-space: nowrap;
}
.saved-hint.show { opacity: 1; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 22px 24px; }
/* comment composer pinned to the bottom of the drawer */
.drawer-foot {
  flex: none; border-top: 1px solid var(--border); background: var(--bg);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
}
.drawer-foot .drawer-composer { margin-top: 0; }
.drawer-title {
  font-size: 21px; font-weight: 600; width: 100%; border: none; outline: none;
  background: transparent; padding: 4px 0; resize: none; line-height: 1.3; overflow: hidden;
}
.field-label { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-faint); margin: 22px 0 8px; font-weight: 600; }
.fmt-toolbar { display: flex; align-items: center; gap: 3px; margin-bottom: 8px; }
.fmt-toolbar button {
  border: 1px solid var(--border); background: var(--bg-soft); color: var(--text-soft);
  width: 32px; height: 30px; border-radius: 6px; display: grid; place-items: center; font-size: 14px;
}
.fmt-toolbar button:hover { background: var(--bg-hover); color: var(--text); }
.fmt-sep { width: 1px; height: 20px; background: var(--border); margin: 0 3px; }
.drawer-desc {
  position: relative; width: 100%; min-height: 180px; max-height: 340px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px; outline: none; background: var(--bg-soft); line-height: 1.5;
}
.drawer-desc:focus { border-color: var(--accent); background: var(--bg); }
.drawer-desc.empty:before { content: attr(data-ph); color: var(--text-faint); pointer-events: none; }
.drawer-desc ul, .drawer-desc ol { margin: 4px 0; padding-left: 22px; }
.drawer-desc li { margin: 2px 0; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > div { flex: 1; min-width: 140px; }
.mini { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-soft); outline: none; }
.mini:focus { border-color: var(--accent); }
/* due date as a clean calendar button (hides the fiddly native date box) */
.due-field { position: relative; }
.due-btn { display: flex; align-items: center; gap: 8px; text-align: left; cursor: pointer; color: var(--text); }
.due-btn .cal { color: var(--text-soft); flex: none; }
.due-btn.empty #dueLabel { color: var(--text-faint); }
.due-input { position: absolute; left: 12px; bottom: 0; width: 1px; height: 1px; opacity: 0; border: 0; padding: 0; pointer-events: none; }
.due-clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: none; background: transparent; color: var(--text-faint); font-size: 13px; padding: 4px 6px; border-radius: 6px; }
.due-clear:hover { color: var(--danger); background: var(--bg-hover); }

/* assignee: avatar + name, chevron opens a member picker (shared workspaces) */
.assignee-wrap { position: relative; }
.assignee-btn { display: flex; align-items: center; gap: 8px; text-align: left; cursor: pointer; color: var(--text); }
.assignee-btn.solo { cursor: default; }
.assignee-btn.solo .assignee-chev { display: none; }
.assignee-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assignee-chev { color: var(--text-faint); flex: none; }
.assignee-av {
  width: 22px; height: 22px; border-radius: 50%; overflow: hidden; flex: none; position: relative;
  background: var(--accent); color: #fff; font-size: 9px; font-weight: 700; display: grid; place-items: center;
}
.assignee-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.assignee-menu {
  position: absolute; left: 0; right: 0; top: 46px; z-index: 60;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 6px; max-height: 240px; overflow-y: auto;
}
.assignee-item {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  padding: 8px 9px; border: none; background: transparent; color: var(--text);
  border-radius: var(--radius-sm); font-size: 14px;
}
.assignee-item:hover { background: var(--bg-hover); }
.assignee-item.active { font-weight: 600; }

.status-pills { display: flex; gap: 8px; }
.status-pill {
  flex: 1; padding: 9px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-soft); color: var(--text-soft); font-weight: 500; font-size: 13px;
}
.status-pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* tags in drawer */
.tag-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 999px;
  font-size: 13px; border: 1px solid var(--border); background: var(--bg-soft); color: var(--text-soft);
}
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip .x { cursor: pointer; opacity: .7; font-weight: 700; }
.chip .x:hover { opacity: 1; }
.chip-add { border-style: dashed; color: var(--text-faint); }
.tag-input { border: 1px solid var(--accent); background: var(--bg); border-radius: 999px; padding: 5px 11px; font-size: 13px; outline: none; width: 130px; }

.comment { padding: 12px 0; border-bottom: 1px solid var(--border); }
.comment:last-child { border-bottom: none; }
.comment .who { font-weight: 600; font-size: 13px; }
.comment .when { color: var(--text-faint); font-size: 12px; margin-left: 6px; }
.comment .body { margin-top: 3px; white-space: pre-wrap; }
.comment-box { display: flex; gap: 8px; margin-top: 10px; }
.comment-box input { flex: 1; }
.drawer-composer { margin-top: 12px; }
.drawer-composer .composer-inner { box-shadow: none; }
.drawer-composer .rec-hint { text-align: left; margin-top: 6px; }

/* file drop zone */
.drop-zone {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius-sm);
  padding: 18px; text-align: center; color: var(--text-faint); font-size: 13.5px;
  cursor: pointer; transition: all .15s;
}
.drop-zone:hover { border-color: var(--accent); color: var(--text-soft); }
.drop-zone.dragover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.attach { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-top: 8px; }
.attach a { color: var(--text); text-decoration: none; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach .size { color: var(--text-faint); font-size: 12px; }
.attach .x { color: var(--text-faint); border: none; background: transparent; }
.attach .x:hover { color: var(--danger); }
.text-danger { color: var(--danger); }

/* attachment previews */
.att-list { display: flex; flex-direction: column; gap: 8px; }
.att-card { display: flex; align-items: center; gap: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; }
.att-thumb {
  width: 46px; height: 46px; border-radius: 6px; flex: none; object-fit: cover;
  background: var(--bg-soft); display: grid; place-items: center; color: var(--text-faint); cursor: pointer;
}
img.att-thumb { cursor: zoom-in; }
.att-info { flex: 1; min-width: 0; }
.att-info a { color: var(--text); text-decoration: none; font-size: 14px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-info a:hover { color: var(--accent); }
.att-info .size { color: var(--text-faint); font-size: 12px; }
.att-card .x { color: var(--text-faint); border: none; background: transparent; flex: none; padding: 4px; }
.att-card .x:hover { color: var(--danger); }

/* activity / history */
.activity { margin-top: 22px; display: flex; flex-direction: column; gap: 3px; }
.activity .ev { color: var(--text-faint); font-size: 12px; }
.activity .ev .who { color: var(--text-soft); font-weight: 500; }

/* editable comments */
.comment.editable { cursor: text; border-radius: 8px; margin: 0 -8px; padding: 12px 8px; }
.comment.editable:hover { background: var(--bg-hover); }
.comment .edited-flag { color: var(--text-faint); font-size: 11px; margin-left: 6px; font-style: italic; }
.comment .from-voice { color: var(--text-faint); font-size: 12px; margin-top: 4px; display: inline-flex; align-items: center; gap: 4px; }
.comment-edit { width: 100%; margin-top: 4px; min-height: 40px; }

/* workspace chip on tasks (Everything view) */
.meta .ws-chip { background: var(--accent-soft); color: var(--accent); padding: 1px 8px; border-radius: 999px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }

/* Everything sidebar entry */
.ws-item .ws-dot.all { background: var(--text); color: var(--bg); }
.ws-item.active .ws-dot.all { background: var(--accent); color: #fff; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;   /* above the full pages (90) */
  background: rgba(0,0,0,.35);
  display: grid; place-items: center; padding: 20px;
}
.modal {
  width: 100%; max-width: 420px; background: var(--bg); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px;
}
.modal h3 { margin: 0 0 4px; font-size: 19px; }
.modal p.hint { color: var(--text-soft); font-size: 14px; margin: 0 0 18px; }
.modal .field-label { margin-top: 16px; }
.modal input[type=text], .modal input[type=email] {
  width: 100%; padding: 11px 13px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--bg); outline: none;
}
.modal input:focus { border-color: var(--accent); }
.seg { display: flex; gap: 8px; margin-top: 8px; }
.seg button {
  flex: 1; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-soft); color: var(--text-soft); text-align: left;
}
.seg button.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.seg button .t { font-weight: 600; font-size: 14px; display: block; }
.seg button .d { font-size: 12px; opacity: .8; }
.modal-actions { display: flex; gap: 10px; margin-top: 22px; }
.modal-actions > * { flex: 1; }
.share-link { display: flex; gap: 8px; margin-top: 8px; }
.share-link input { flex: 1; font-size: 13px; color: var(--text-soft); }
.link-btn { border: none; background: transparent; color: var(--accent); font-weight: 500; padding: 6px 0; }

/* avatars — img is absolutely positioned so it fills the circle regardless
   of the grid centering used for the initials fallback. */
.avatar { overflow: hidden; position: relative; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* account modal */
.modal.account-modal { max-width: 440px; max-height: 86vh; overflow-y: auto; }
.account-top { display: flex; align-items: center; gap: 16px; margin: 4px 0 18px; }
.account-avatar {
  width: 72px; height: 72px; border-radius: 50%; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 26px; font-weight: 600; overflow: hidden; flex: none;
  position: relative;
}
.account-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.account-name-big { font-size: 18px; font-weight: 600; }
.account-email-sub { color: var(--text-faint); font-size: 13px; }
.change-photo { color: var(--accent); font-size: 13px; font-weight: 500; border: none; background: transparent; padding: 4px 0; }
.account-row { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.account-row .k { color: var(--text-soft); }
.account-row .v { color: var(--text); font-weight: 500; text-align: right; }
.notify-row { display: flex; align-items: center; gap: 10px; margin: 14px 0 2px; font-size: 14px; color: var(--text); cursor: pointer; }
.notify-row input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.acct-ws-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.acct-ws-wrap { border: 1px solid var(--border); border-radius: var(--radius-sm); }
.acct-ws { display: flex; align-items: center; gap: 10px; padding: 8px 10px; font-size: 14px; }
.acct-ws-members { display: flex; flex-wrap: wrap; gap: 10px 14px; padding: 0 10px 9px 10px; }
.acct-ws-members .mem { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-soft); }
.acct-ws-members .mini-av { border-color: var(--bg); }
.acct-ws .dot { width: 24px; height: 24px; border-radius: 6px; flex: none; display: grid; place-items: center; background: var(--border); color: var(--text-soft); font-size: 11px; font-weight: 700; }
.acct-ws .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-ws .role { color: var(--text-faint); font-size: 12px; display: inline-flex; align-items: center; gap: 4px; margin-left: auto; }
.acct-ws-link { border: none; background: transparent; color: var(--text-faint); padding: 5px; border-radius: 6px; display: grid; place-items: center; flex: none; }
.acct-ws-link:hover { color: var(--accent); background: var(--bg-hover); }
.acct-ws-act { border: none; background: transparent; color: var(--text-faint); padding: 5px; border-radius: 6px; display: grid; place-items: center; flex: none; }
.acct-ws-act:hover { background: var(--bg-hover); color: var(--text); }
.acct-ws-act.del:hover { color: var(--danger); }

/* avatar cropper */
.crop-modal { max-width: 340px; }
.crop-stage {
  position: relative; width: 260px; height: 260px; max-width: 100%; margin: 14px auto;
  border-radius: 12px; overflow: hidden; background: var(--bg-soft); touch-action: none; cursor: grab;
}
.crop-stage:active { cursor: grabbing; }
.crop-img { position: absolute; top: 0; left: 0; max-width: none; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.crop-mask { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 999px rgba(0,0,0,.5); pointer-events: none; }
.crop-stage.square .crop-mask { border-radius: 22%; }   /* app icons are rounded squares */
.crop-zoom { width: 100%; margin: 6px 0; accent-color: var(--accent); }

/* toasts — stack at the bottom, closable, can link to a task */
/* toasts — light cards stacked in the top-right, below the account avatar */
.toast-stack {
  /* above the full pages (90) and modals (100) so confirmations are never hidden */
  position: fixed; top: 58px; right: 16px; z-index: 130;
  display: flex; flex-direction: column; gap: 9px; align-items: flex-end;
  width: max-content; max-width: min(92vw, 400px); pointer-events: none;
}
.toast {
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border-strong); border-left: 3px solid var(--accent);
  padding: 10px 8px 10px 12px; border-radius: 12px;
  font-size: 13.5px; box-shadow: 0 10px 30px rgba(0,0,0,.18); display: flex; align-items: center; gap: 9px;
  max-width: 100%; pointer-events: auto;
  /* Visible by default — no entrance animation. rAF and CSS animations are
     throttled in background tabs, which previously left toasts stuck at
     opacity 0 exactly when a notification arrived. Only the exit animates. */
  opacity: 1;
  transition: opacity .2s, transform .2s;
}
.toast.hide { opacity: 0; transform: translateX(16px); }
.toast .tk { flex: none; color: var(--accent); }
.toast .toast-av {
  width: 24px; height: 24px; border-radius: 50%; flex: none; overflow: hidden; position: relative;
  background: var(--accent); color: #fff; font-size: 9.5px; font-weight: 700; display: grid; place-items: center;
}
.toast .toast-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.toast .toast-msg { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast .toast-open { border: none; background: transparent; color: var(--accent); font-weight: 600; padding: 3px 5px; cursor: pointer; flex: none; border-radius: 6px; }
.toast .toast-open:hover { background: var(--accent-soft); }
.toast .toast-x { border: none; background: transparent; color: var(--text-faint); font-size: 15px; line-height: 1; padding: 4px 6px; cursor: pointer; flex: none; border-radius: 6px; }
.toast .toast-x:hover { color: var(--text); background: var(--bg-hover); }
@media (max-width: 560px) { .toast-stack { top: 56px; right: 10px; left: 10px; max-width: none; } }

@media (max-width: 560px) {
  .app { padding: 62px 14px 150px; }
  .drawer-body { padding: 18px 16px 20px; }
}

/* Filter Pro pill counts */
.tag-pill .cnt { margin-left: 6px; opacity: .6; font-size: 11px; font-weight: 700; }
.tag-pill.active .cnt { opacity: .9; }

/* @mention picker + rendered mentions */
.mention-menu {
  position: fixed; z-index: 140; min-width: 210px; max-height: 240px; overflow-y: auto;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 6px;
}
.mention-item {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  border: none; background: transparent; color: var(--text);
  padding: 7px 9px; border-radius: var(--radius-sm); font-size: 14px;
}
.mention-item:hover, .mention-item.sel { background: var(--bg-hover); }
.mention-item .mini-av { margin-left: 0; border: none; }
.mention-chip {
  display: inline-flex; align-items: center; gap: 5px;
  vertical-align: middle;            /* sit on the text line, not below it */
  line-height: 1;
  background: var(--accent-soft); color: var(--accent); font-weight: 600;
  padding: 2px 9px 2px 3px; border-radius: 999px;
}
.mention-chip .mini-av { width: 17px; height: 17px; font-size: 8px; margin-left: 0; border: none; }
/* keep surrounding words on the same centre line as the chip */
.comment .body, .drawer-desc { line-height: 1.7; }
.comment .body { vertical-align: middle; }

/* "@me" view: plain text links instead of pills */
#mineBar { gap: 18px; }
.mine-link {
  border: none; background: transparent; padding: 2px 0;
  color: var(--text-soft); font-size: 14px; font-weight: 500;
}
.mine-link:hover { color: var(--text); }
.mine-link.active { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; font-weight: 600; }

/* +Tags multi-select filter */
#tagFilter { align-items: center; position: relative; }
.tags-btn {
  border: 1px solid var(--border); background: var(--bg-soft); color: var(--text-soft);
  padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; flex: none;
}
.tags-btn:hover { border-color: var(--border-strong); color: var(--text); }
.tags-btn.on { background: var(--accent); border-color: var(--accent); color: #fff; }
#tagsMenu { top: 34px; right: 0; left: auto; min-width: 200px; }
#tagsMenu .cnt { margin-left: auto; color: var(--text-faint); font-size: 11px; font-weight: 700; }
.tag-pill .x { opacity: .7; font-size: 11px; }

/* account: shortcuts list */
.sc-list { display: flex; flex-direction: column; }
.sc-row { display: flex; align-items: center; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.sc-row:last-of-type { border-bottom: none; }
.sc-keys { display: flex; gap: 5px; flex: none; min-width: 118px; }
.sc-keys kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; font-weight: 600;
  background: var(--bg-soft); border: 1px solid var(--border-strong); border-bottom-width: 2px;
  border-radius: 6px; padding: 3px 7px; color: var(--text);
}
.sc-desc { color: var(--text-soft); font-size: 14px; }
.sc-more { color: var(--text-faint); font-size: 12.5px; padding-top: 10px; }

/* Updates panel: scope filter */
.upd-scope { display: flex; gap: 18px; padding: 0 0 14px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }

/* drop a file on the composer → creates a task */
.composer-drop {
  position: absolute; left: 20px; right: 20px; bottom: 20px; height: 52px;
  display: none; align-items: center; justify-content: center; gap: 10px;
  max-width: 720px; margin: 0 auto;
  border: 2px dashed var(--accent); border-radius: 26px;
  background: var(--accent-soft); color: var(--accent);
  font-weight: 600; font-size: 14px; pointer-events: none;
}
.composer.file-over .composer-drop { display: flex; }
.composer.file-over .composer-inner { opacity: 0; }

/* ---------- Desktop: sidebar docks open and pushes the content across ---------- */
.main, .composer { transition: padding-left .22s cubic-bezier(.4,0,.2,1), left .22s cubic-bezier(.4,0,.2,1); }
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  body.sb-docked .main { padding-left: 272px; }
  body.sb-docked .composer { left: 272px; }
  body.sb-docked .sidebar-overlay { display: none; }   /* docked, so the page stays usable */
}

/* ---------- Report app ---------- */
.report-bar { margin-bottom: 14px; }
.report-ready {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 13px 16px; border-radius: var(--radius);
  border: 1px solid var(--accent); background: var(--accent-soft);
  color: var(--accent); font-weight: 600; font-size: 14.5px; text-align: left;
}
.report-ready:hover { filter: brightness(.98); }
.report-ready .rp-spark { display: grid; place-items: center; flex: none; }

.report-panel {
  position: fixed; z-index: 40; top: 56px; bottom: 96px;
  left: 50%; transform: translateX(-50%); width: min(720px, calc(100% - 32px));
  background: var(--bg); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden;
}
body.sb-docked .report-panel { left: calc(50% + 136px); }
.report-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px 12px; border-bottom: 1px solid var(--border);
}
.report-title { display: flex; align-items: center; gap: 9px; font-weight: 600; flex: 1; min-width: 0; }
.report-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.report-ctrl {
  border: 1px solid var(--border-strong); background: var(--bg); color: var(--text-soft);
  padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
}
.report-ctrl:hover { background: var(--bg-hover); color: var(--text); }
.report-ctrl.is-paused { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.report-x {
  border: none; background: transparent; color: var(--text-soft);
  padding: 6px; border-radius: 8px; display: grid; place-items: center;
}
.report-x:hover { background: var(--bg-hover); color: var(--text); }
.report-track { height: 3px; background: var(--bg-soft); flex: none; }
.report-fill { display: block; height: 100%; width: 0; background: var(--accent); transition: width .12s linear; }
.report-body { flex: 1; overflow-y: auto; padding: 26px 30px 34px; scroll-behavior: smooth; }

.rp-greeting { font-size: 25px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 2px; }
.rp-date { color: var(--text-faint); font-size: 13px; margin: 0 0 22px; }
.rp-head {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-faint); font-weight: 700; margin: 26px 0 8px;
}
.rp-intro, .rp-mention, .rp-todo, .rp-overdue, .rp-people, .rp-file, .rp-close {
  margin: 0 0 12px; line-height: 1.65; font-size: 15.5px;
}
.rp-intro { color: var(--text-soft); }
.rp-overdue { color: var(--danger); font-weight: 500; }
.rp-mention { font-weight: 500; }
.rp-close { color: var(--text-soft); margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--border); }
.rp-open {
  border: none; background: transparent; color: var(--accent);
  font: inherit; font-size: 14px; font-weight: 600; padding: 0; text-decoration: underline;
}

/* time-of-day picker on the app page */
.app-setting { margin: 4px 0 26px; }
.slot-row { display: flex; gap: 10px; flex-wrap: wrap; }
.slot-opt {
  display: flex; flex-direction: column; gap: 2px; align-items: flex-start;
  padding: 11px 16px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text); min-width: 118px;
}
.slot-opt:hover { background: var(--bg-hover); }
.slot-opt.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.slot-name { font-weight: 600; font-size: 14px; }
.slot-hint { font-size: 12px; color: var(--text-faint); }
.slot-opt.active .slot-hint { color: var(--accent); }

@media (max-width: 720px) {
  .report-panel { top: 52px; bottom: 88px; width: calc(100% - 20px); border-radius: 14px; }
  .report-body { padding: 20px 18px 26px; }
  .rp-greeting { font-size: 21px; }
}

/* Report: attachments inside the briefing */
.rp-files { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 4px; }
.rp-thumb {
  width: 108px; height: 84px; padding: 0; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border); background: var(--bg-soft); display: block;
}
.rp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rp-thumb:hover { border-color: var(--accent); }
.rp-chip {
  display: inline-flex; align-items: center; gap: 8px; max-width: 260px;
  padding: 8px 13px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--bg); color: var(--text); font-size: 13px; font-weight: 500;
}
.rp-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-chip:hover { border-color: var(--accent); color: var(--accent); }
.rp-chip svg { flex: none; color: var(--text-faint); }
.rp-chip:hover svg { color: var(--accent); }

/* Report settings: multi-select slots + email opt-in */
.setting-hint { color: var(--text-soft); font-size: 13.5px; margin: -2px 0 12px; }
.slot-opt { position: relative; padding-right: 34px; }
.slot-tick {
  position: absolute; top: 10px; right: 11px; width: 16px; height: 16px; border-radius: 50%;
  border: 1.5px solid var(--border-strong); display: grid; place-items: center; color: transparent;
}
.slot-opt.active .slot-tick { background: var(--accent); border-color: var(--accent); color: #fff; }
.setting-row {
  display: flex; align-items: flex-start; gap: 11px; margin-top: 20px;
  cursor: pointer; max-width: 460px;
}
.setting-row input { width: 17px; height: 17px; accent-color: var(--accent); flex: none; margin-top: 2px; }
.setting-name { display: block; font-weight: 600; font-size: 14px; }
.setting-sub { display: block; color: var(--text-soft); font-size: 13px; margin-top: 1px; }

/* Email app — one row per kind of letter, its cadence tucked underneath */
.em-row { border-bottom: 1px solid var(--border); padding: 0 0 16px; }
.em-row:first-of-type { border-top: 1px solid var(--border); }
.em-row .setting-row { margin-top: 16px; }
.em-tail { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 10px 0 0 28px; }
.em-freqs { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; }
.em-freq {
  border: 0; background: none; color: var(--text-soft); cursor: pointer;
  font: inherit; font-size: 13px; padding: 6px 12px; border-right: 1px solid var(--border-strong);
}
.em-freq:last-child { border-right: 0; }
.em-freq:hover:not(:disabled) { background: var(--bg-hover); }
.em-freq.active { background: var(--accent); color: #fff; font-weight: 600; }
.em-freq:disabled { cursor: default; opacity: .45; }
.em-sample {
  border: 0; background: none; padding: 0; cursor: pointer; font: inherit; font-size: 13px;
  color: var(--accent); text-decoration: underline; text-underline-offset: 3px;
}
.em-row.off .setting-name, .em-row.off .setting-sub { color: var(--text-faint); }
/* the holiday pause — loud while it runs, so you can't forget it's on */
.em-paused {
  display: flex; align-items: center; gap: 12px; margin-top: 2px;
  border: 1px solid var(--accent); background: var(--accent-soft);
  border-radius: 14px; padding: 14px 16px;
}
.pause-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.pause-text { flex: 1 1 210px; min-width: 0; }
.em-paused { flex-wrap: wrap; }
.em-paused .btn-ghost { flex: none; background: var(--bg); }
@media (max-width: 640px) {
  /* the wrapped button gets its own line, and the dot marks the first one */
  .em-paused { align-items: flex-start; }
  .em-paused .pause-dot { margin-top: 6px; }
  .em-paused .btn-ghost { width: 100%; margin-top: 2px; }
}
/* a pause you book for later: from one date to another */
.pause-range { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.range-label { color: var(--text-soft); font-size: 13.5px; }
.range-field {
  display: flex; align-items: center; gap: 8px; padding: 9px 14px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--bg);
  font-size: 14px; cursor: pointer;
}
.range-field > span { font-weight: 600; color: var(--text-soft); }
.range-field input {
  border: 0; background: none; color: inherit; font: inherit; font-size: 13.5px;
  outline: none; padding: 0; cursor: pointer; color-scheme: light dark;
}
.pause-range .btn-ghost:disabled { opacity: .45; cursor: default; }
@media (max-width: 640px) {
  /* label on its own line, the two dates side by side, the button underneath */
  .range-label { flex: 1 0 100%; }
  .range-field { flex: 1 1 44%; justify-content: space-between; padding: 9px 12px; }
  .pause-range .btn-ghost { flex: 1 0 100%; }
}
.em-paused.booked { border-color: var(--border-strong); background: var(--bg-soft); }
.em-paused.booked .pause-dot { background: var(--text-faint); }
.em-pause-flag.booked {
  border-color: var(--border-strong); background: var(--bg-soft); color: var(--text-soft);
}
.em-pause-date input {
  border: 0; background: none; color: inherit; font: inherit; font-size: 13.5px;
  outline: none; padding: 0; cursor: pointer; color-scheme: light dark;
}
/* seven short days sit in one row, so the muted week reads at a glance */
.slot-opt.em-day { min-width: 0; width: 56px; padding: 9px 0; align-items: center; }
.em-digest { margin-top: 14px; }
@media (max-width: 640px) {
  .em-tail { margin-left: 0; }
  .em-freq { padding: 6px 10px; font-size: 12.5px; }
}

/* The PNG wordmark is dark ink on transparent — dark mode gets the lifted variant.
   Two <img> swapped by CSS rather than <picture>, so the in-app theme toggle wins too. */
.logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo-dark { display: block; }
}
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }
:root[data-theme="light"] .logo-light { display: block; }
:root[data-theme="light"] .logo-dark { display: none; }

/* ---------- Housekeeping ---------- */
.hk-panel { display: flex; flex-direction: column; }
.hk-count { color: var(--text-faint); font-size: 13px; font-weight: 600; margin-right: 4px; }
.hk-stage {
  flex: 1; position: relative; display: grid; place-items: center;
  padding: 26px 26px 8px; min-height: 0;
}
.hk-card {
  grid-area: 1 / 1; width: 100%; max-width: 520px;
  /* a shared height is what makes the offset read as a pile rather than noise */
  min-height: 216px; display: flex; flex-direction: column;
  background: var(--bg); border: 1px solid var(--border-strong);
  border-radius: 16px; padding: 24px 26px; box-shadow: var(--shadow);
  transform: translateY(calc(var(--n) * 14px)) scale(calc(1 - var(--n) * .045));
  transition: transform .19s ease, opacity .19s ease;
}
.hk-behind { pointer-events: none; }
.hk-behind::after {                       /* veil the cards underneath */
  content: ""; position: absolute; inset: 0; border-radius: 16px;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
}
.hk-card { position: relative; }
.hk-fly-keep { transform: translateX(120%) rotate(9deg); opacity: 0; }
.hk-fly-done { transform: translateX(-120%) rotate(-9deg); opacity: 0; }
.hk-reason {
  align-self: flex-start;                 /* the card is a column, don't stretch the pill */
  font-size: 12.5px; font-weight: 600;
  color: var(--pin); background: color-mix(in srgb, var(--pin) 14%, transparent);
  padding: 5px 11px; border-radius: 999px; margin-bottom: 14px;
}
.hk-card-title { font-size: 20px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 8px; line-height: 1.3; }
.hk-card-desc { color: var(--text-soft); font-size: 14.5px; line-height: 1.6; margin: 0 0 14px; }
.hk-card-meta { color: var(--text-faint); font-size: 12.5px; display: flex; flex-wrap: wrap; align-items: center; }
.hk-dot { margin: 0 7px; opacity: .6; }
.hk-od { color: var(--danger); font-weight: 600; }
.hk-open {
  margin-top: auto; padding-top: 16px; align-self: flex-start; border: none; background: transparent; color: var(--accent);
  font: inherit; font-size: 14px; font-weight: 600; padding: 0; text-decoration: underline;
}
.hk-actions { display: flex; gap: 12px; justify-content: center; padding: 14px 26px 24px; flex: none; }
.hk-btn {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  flex: 1; max-width: 200px; padding: 14px 20px; border-radius: 999px;
  font-size: 15px; font-weight: 600; border: 1.5px solid transparent; color: #fff;
}
.hk-done { background: var(--danger); }
.hk-keep { background: var(--accent); }
.hk-btn:hover { filter: brightness(1.06); }
.hk-empty { text-align: center; max-width: 380px; }
.hk-empty-icon {
  width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 16px;
  display: grid; place-items: center; font-size: 24px;
  background: var(--accent-soft); color: var(--accent);
}
.hk-empty h3 { font-size: 20px; font-weight: 700; margin: 0 0 6px; }
.hk-empty p { color: var(--text-soft); margin: 0; line-height: 1.6; }
.slot-opt.hk-day { min-width: 0; padding: 10px 15px; }

@media (prefers-reduced-motion: reduce) {
  .hk-card { transition: none; }
}
@media (max-width: 720px) {
  .hk-stage { padding: 18px 16px 4px; }
  .hk-card { padding: 20px; }
  .hk-card-title { font-size: 18px; }
  .hk-actions { padding: 12px 16px 20px; }
}

/* Housekeeping: who the task came from */
.hk-from { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 13px; }
.hk-from .mini-av {
  width: 22px; height: 22px; border-radius: 50%; flex: none; overflow: hidden; position: relative;
  background: var(--accent); color: #fff; display: grid; place-items: center;
  font-size: 9px; font-weight: 700; border: none; margin: 0;
}
.hk-from .mini-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hk-from-name { color: var(--text); font-weight: 500; }
.hk-to { color: var(--text-faint); }

/* ---------- Reactions ---------- */
.rx-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.rx-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px 3px 7px; border-radius: 999px; font-size: 12.5px; line-height: 1.4;
  border: 1px solid var(--border); background: var(--bg-soft); color: var(--text-soft);
}
.rx-chip .rx-e { font-size: 14px; line-height: 1; }
.rx-chip.mine { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.rx-chip:hover { border-color: var(--border-strong); }
.rx-chip.mine:hover { border-color: var(--accent); }
.rx-add {
  display: grid; place-items: center; width: 26px; height: 24px; padding: 0;
  border: 1px solid transparent; border-radius: 999px; background: transparent; color: var(--text-faint);
}
.comment:hover .rx-add, .rx-row .rx-chip ~ .rx-add { color: var(--text-soft); }
.rx-add:hover { background: var(--bg-hover); color: var(--accent); }

/* the picker */
.emoji-pop {
  position: fixed; z-index: 140; width: min(332px, calc(100vw - 16px));
  background: var(--bg); border: 1px solid var(--border-strong); border-radius: 14px;
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
  max-height: 380px;
}
.emoji-search {
  border: none; border-bottom: 1px solid var(--border); background: transparent;
  padding: 12px 14px; font-size: 14px; outline: none; width: 100%;
}
.emoji-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 10px 12px; overscroll-behavior: contain; }
.emoji-head {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700;
  color: var(--text-faint); margin: 12px 4px 6px; position: sticky; top: 0;
  background: var(--bg); padding: 4px 0;
}
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.emoji-cell {
  border: none; background: transparent; font-size: 21px; line-height: 1;
  padding: 5px 0; border-radius: 7px; aspect-ratio: 1; display: grid; place-items: center;
}
.emoji-cell:hover { background: var(--bg-hover); }
.emoji-empty { color: var(--text-faint); font-size: 13px; padding: 18px 4px; text-align: center; }

/* one scrollbar: the page behind a full-screen view must not scroll too */
body.page-open { overflow: hidden; }

/* auto-detected links in comments and descriptions */
.auto-link { color: var(--accent); text-decoration: underline; word-break: break-word; }
.auto-link:hover { filter: brightness(1.1); }
.drawer-desc a { color: var(--accent); text-decoration: underline; cursor: pointer; }

/* sidebar: drag workspaces into order */
.ws-item[data-ws] { cursor: grab; }
.ws-item.ws-dragging { opacity: .45; cursor: grabbing; }

/* "someone here already uses this app" nudge, shown where the app would be */
.app-hint {
  display: flex; align-items: center; gap: 9px; margin-top: 8px;
  padding: 7px 11px 7px 8px; border: 1px dashed var(--border-strong);
  border-radius: 999px; color: var(--text-soft); font-size: 12.5px;
}
.app-hint .app-icon.sm { flex: none; }
.app-hint span { flex: 1; min-width: 0; }
.hint-go {
  flex: none; border: none; background: transparent; color: var(--accent);
  font: inherit; font-size: 12.5px; font-weight: 600; text-decoration: underline; padding: 0;
}

/* ---------- Notes ---------- */
.ws-item .ws-app-dot { background: transparent; display: grid; place-items: center; }
.ws-item .ws-app-dot .app-icon.sm { width: 22px; height: 22px; border-radius: 6px; }
.ws-item.ws-notes { margin-top: 4px; }

/* the notes view stands in for the task list */
body.notes-open .head-row,
body.notes-open #reportBar,
body.notes-open #hkBar,
body.notes-open #updatesBar,
body.notes-open #mineBar,
body.notes-open #fproBar,
body.notes-open #tagFilter,
body.notes-open #activeList,
body.notes-open #doneSection,
body.notes-open #emptyState,
body.notes-open #noResults,
body.notes-open .composer { display: none !important; }
body.notes-open .app { padding-bottom: 40px; }

.notes-view { display: flex; flex-direction: column; min-height: calc(100vh - 130px); }
.notes-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.notes-head .ws-heading { margin: 0; flex: 1; }
.notes-head .app-icon.sm { width: 24px; height: 24px; border-radius: 7px; }
.notes-saved {
  font-size: 12.5px; color: var(--text-faint); opacity: 0; transition: opacity .18s;
}
.notes-saved.is-on { opacity: 1; }
.notes-body {
  flex: 1; width: 100%; min-height: 60vh; resize: none;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); padding: 20px 22px; outline: none;
  font-size: 15.5px; line-height: 1.7; font-family: inherit;
}
.notes-body:focus { border-color: var(--border-strong); }
.notes-body::placeholder { color: var(--text-faint); }

@media (max-width: 720px) {
  .notes-view { min-height: calc(100vh - 110px); }
  .notes-body { padding: 16px; min-height: 55vh; }
}

/* Notes: subtitle, selection button, selection popover */
.notes-sub { color: var(--text-soft); font-size: 14px; margin: -8px 0 16px; }
.notes-wrap { position: relative; flex: 1; display: flex; }
.notes-sel-btn {
  position: absolute; right: 14px; z-index: 3;
  padding: 7px 14px; border-radius: 999px; border: none;
  background: var(--accent); color: #fff; font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow);
}
.notes-sel-btn:hover { filter: brightness(1.06); }
.sel-pop {
  position: fixed; z-index: 140; width: min(320px, calc(100vw - 16px));
  background: var(--bg); border: 1px solid var(--border-strong); border-radius: 14px;
  box-shadow: var(--shadow); padding: 16px;
}
.sel-quote {
  font-size: 13px; color: var(--text-soft); line-height: 1.5; margin-bottom: 14px;
  padding-left: 10px; border-left: 3px solid var(--border-strong);
  max-height: 76px; overflow: hidden; white-space: pre-wrap;
}
.sel-label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }
.sel-ws {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--bg); margin-bottom: 14px;
}
.sel-actions { display: flex; gap: 8px; justify-content: flex-end; }
.sel-actions button { padding: 9px 16px; font-size: 13.5px; }

/* first-run spotlight */
.spot { position: fixed; inset: 0; z-index: 200; }
.spot-hole {
  position: fixed; border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,.55);
  outline: 2px solid var(--accent); outline-offset: 2px;
  transition: none; pointer-events: none;
}
.spot-note {
  position: fixed; width: min(300px, calc(100vw - 32px));
  background: var(--bg); border-radius: 14px; box-shadow: var(--shadow); padding: 18px;
}
.spot-title { font-weight: 700; font-size: 16px; margin-bottom: 6px; }
.spot-body { color: var(--text-soft); font-size: 14px; line-height: 1.55; margin-bottom: 14px; }
.spot-note .btn-primary { width: 100%; padding: 10px; }

/* spotlight without a target: dim the whole screen, no cutout */
.spot-hole.hidden { display: none; }
.spot:has(.spot-hole.hidden) { background: rgba(0,0,0,.55); }

/* workspace subtitle */
.ws-sub { color: var(--text-soft); font-size: 14px; margin: -10px 0 14px; }

/* quoting a comment */
.comment { position: relative; }
.cmt-quote {
  position: absolute; top: 4px; right: 4px; opacity: 0; transition: opacity .12s;
  border: none; background: var(--bg-soft); color: var(--text-faint);
  width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center;
}
.comment:hover .cmt-quote, .cmt-quote:focus-visible { opacity: 1; }
.cmt-quote:hover { color: var(--accent); background: var(--bg-hover); }
.cmt-quote-pill {
  position: fixed; z-index: 150; border: none; border-radius: 999px;
  background: var(--text); color: var(--bg); font-size: 12.5px; font-weight: 600;
  padding: 6px 13px; box-shadow: var(--shadow);
}
/* quoted text: indented, on its own shaded panel */
.comment .body blockquote,
.drawer-desc blockquote {
  margin: 8px 0; padding: 9px 13px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  border-left: 3px solid var(--border-strong); background: var(--bg-soft);
  color: var(--text-soft); font-size: 14px; line-height: 1.55;
}

/* the "+" entries in the mention menu */
.mention-item .tag-dot {
  width: 17px; height: 17px; border-radius: 5px; flex: none;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  background: var(--bg-hover); color: var(--text-soft);
}

/* delete a comment, next to the quote icon */
.cmt-del {
  position: absolute; top: 4px; right: 32px; opacity: 0; transition: opacity .12s;
  border: none; background: var(--bg-soft); color: var(--text-faint);
  width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center;
}
.comment:hover .cmt-del, .cmt-del:focus-visible { opacity: 1; }
.cmt-del:hover { color: var(--danger); background: var(--bg-hover); }

/* @name inside the description, shown while the field isn't being edited */
.drawer-desc .mention-tag {
  background: var(--accent-soft); color: var(--accent);
  border-radius: 5px; padding: 1px 5px; font-weight: 600; white-space: nowrap;
}

/* upload progress, shown inside the drop zone */
.drop-zone.busy { border-style: solid; border-color: var(--accent); cursor: default; }
.drop-zone.busy .dz-idle { display: none; }
.drop-zone.ok { background: var(--accent-soft); }
.dz-busy { width: 100%; text-align: left; }
.dz-line { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; font-size: 13px; }
.dz-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.dz-pct { flex: none; color: var(--text-soft); font-variant-numeric: tabular-nums; font-size: 12.5px; }
.dz-spin {
  flex: none; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--border-strong); border-top-color: var(--accent);
  animation: dz-spin .7s linear infinite;
}
.drop-zone.ok .dz-spin { border-color: var(--accent); animation: none; }
@keyframes dz-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .dz-spin { animation-duration: 2s; } }
.dz-track { height: 4px; border-radius: 999px; background: var(--bg-hover); overflow: hidden; }
.dz-fill { display: block; height: 100%; width: 0; background: var(--accent); transition: width .15s ease; }

/* report folded down to a strip while you read a task out of it */
.report-panel.collapsed {
  top: auto; height: auto; bottom: 96px; cursor: pointer;
  box-shadow: var(--shadow);
}
.report-panel.collapsed .report-body,
.report-panel.collapsed .report-track,
.report-panel.collapsed .report-ctrl { display: none; }
.report-panel.collapsed .report-head { border-bottom: none; }
.report-panel.collapsed:hover { border-color: var(--accent); }
.report-mini { display: none; color: var(--text-soft); font-size: 13px; margin-left: 4px; }
.report-panel.collapsed .report-mini { display: inline; }
.report-panel.collapsed .report-title { flex: none; }
@media (max-width: 720px) { .report-panel.collapsed { bottom: 88px; } }

/* brief flash so a Tab jump is visible */
.ws-item.ws-flash { box-shadow: inset 0 0 0 2px var(--accent); }

/* ---------- Desktop sidebar: arrows instead of a burger ---------- */
.sb-collapse { display: none; }
.brand-open { display: none; }

@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  /* the burger is a phone affordance; on desktop the arrows say it better */
  .brand .brand-menu { display: none; }
  .brand { padding-left: 10px; }

  /* ⇠ sits on the sidebar's right edge, showing you can tuck it away */
  body.sb-docked .sb-collapse {
    display: grid; place-items: center;
    position: absolute; top: 18px; right: -1px;
    width: 22px; height: 26px; padding: 0;
    border: 1px solid var(--border); border-right: none;
    border-radius: 8px 0 0 8px;
    background: var(--bg); color: var(--text-faint);
    font-size: 13px; line-height: 1; opacity: 0; transition: opacity .15s, color .15s;
  }
  .sidebar:hover .sb-collapse, .sb-collapse:focus-visible { opacity: 1; }
  .sb-collapse:hover { color: var(--accent); border-color: var(--accent); }

  /* ⇢ appears on the logo only while the sidebar is away */
  body:not(.sb-docked) .brand:hover .brand-open {
    display: inline; color: var(--text-faint); font-size: 13px; margin-left: 2px;
  }
  body:not(.sb-docked) .brand:hover .brand-open { color: var(--accent); }
}
.sidebar { position: fixed; }   /* anchor for the pull-tab */

/* ---------- Dashboard ---------- */
/* Palette validated with the dataviz six-checks (ported to Python — no node here):
   light CVD ΔE 11.5 / normal 24.7, dark 10.2 / 21.8, both above target. Every
   segment is directly labelled, so colour never carries meaning alone. */
.viz-root {
  --d-done: #10a37f;   /* completed — the single series in the flow chart */
  --d-new:  #4a7dff;
  --d-prog: #10a37f;
  --d-over: #c0392b;
  --d-grid: var(--border);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .viz-root {
    --d-done: #22ab89; --d-new: #5f88f5; --d-prog: #22ab89; --d-over: #d4483c;
  }
}
:root[data-theme="dark"] .viz-root {
  --d-done: #22ab89; --d-new: #5f88f5; --d-prog: #22ab89; --d-over: #d4483c;
}

body.dash-open .head-row, body.dash-open #reportBar, body.dash-open #hkBar,
body.dash-open #updatesBar, body.dash-open #mineBar, body.dash-open #fproBar,
body.dash-open #tagFilter, body.dash-open #activeList, body.dash-open #doneSection,
body.dash-open #emptyState, body.dash-open #noResults,
body.dash-open .composer { display: none !important; }
body.dash-open .app { padding-bottom: 60px; }

.dash-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 22px; }
.dash-seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 999px; overflow: hidden; }
.dash-seg button {
  border: none; background: transparent; color: var(--text-soft);
  padding: 7px 15px; font-size: 13px; font-weight: 500;
}
.dash-seg button.active { background: var(--accent); color: #fff; font-weight: 600; }
.dash-ws {
  padding: 7px 12px; border: 1px solid var(--border-strong); border-radius: 999px;
  background: var(--bg); font-size: 13px;
}

.dash-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tile {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; background: var(--bg);
  display: flex; flex-direction: column; gap: 2px;
}
.t-num { font-size: 30px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.t-lab { font-size: 12.5px; color: var(--text-soft); }
.tile.t-alert .t-num { color: var(--d-over); }
.dash-net { font-size: 13.5px; color: var(--text-soft); margin: 14px 0 26px; }
.dash-net.good { color: var(--accent); } .dash-net.bad { color: var(--d-over); }

.dash-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.dash-card h3 { font-size: 14px; font-weight: 700; margin: 0 0 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-head h3 { margin: 0; }
.legend, .split-keys { display: flex; gap: 14px; flex-wrap: wrap; }
.key { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-soft); }
.key b { color: var(--text); font-weight: 600; }
.sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.sw.b-done, .sw.s-prog { background: var(--d-done); }
.sw.b-created, .sw.s-new { background: var(--d-new); }
.sw.s-over { background: var(--d-over); }

/* bars: thin marks, rounded data-end, 2px surface gap between them */
.bar-chart { display: flex; align-items: flex-end; gap: 2px; height: 132px; margin-top: 16px; }
.bar-col { flex: 1; height: 100%; display: flex; align-items: flex-end; min-width: 0; }
.bar-col:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.bar-pair { display: flex; align-items: flex-end; gap: 2px; width: 100%; height: 100%; }
.bar { flex: 1; min-height: 2px; border-radius: 3px 3px 0 0; }
.bar.b-done { background: var(--d-done); }
.bar.b-created { background: var(--d-new); opacity: .55; }
.bar-col:hover .bar { filter: brightness(1.08); }
.axis { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-faint); margin-top: 8px; }

.split { display: flex; gap: 2px; height: 12px; border-radius: 999px; overflow: hidden; margin-bottom: 14px; }
.split-seg { display: block; border-radius: 3px; }
.split-seg.s-new { background: var(--d-new); }
.split-seg.s-prog { background: var(--d-prog); }
.split-seg.s-over { background: var(--d-over); }

.row-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 9px; font-size: 13.5px; }
.rb-name { width: 120px; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rb-track { flex: 1; height: 8px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; }
.rb-fill { display: block; height: 100%; background: var(--d-done); border-radius: 999px; }
.rb-val { width: 32px; text-align: right; color: var(--text-soft); font-variant-numeric: tabular-nums; }
.dash-empty { color: var(--text-faint); font-size: 14px; padding: 30px 0; }

@media (max-width: 720px) {
  .dash-tiles { grid-template-columns: repeat(2, 1fr); }
  .rb-name { width: 88px; }
  .bar-chart { height: 108px; }
}

/* ---------- Votes ---------- */
.vote-pair { display: inline-flex; align-items: center; gap: 2px; }
.vote-btn {
  display: inline-flex; align-items: center; gap: 5px;
  border: none; background: transparent; color: var(--text-soft);
  padding: 6px 8px; border-radius: var(--radius-sm); font-size: 12.5px; font-weight: 600;
}
.vote-btn:hover { background: var(--bg-hover); color: var(--text); }
.vote-n { font-variant-numeric: tabular-nums; min-width: 6px; }
#voteUp.mine { color: var(--accent); background: var(--accent-soft); }
#voteDown.mine { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
#voteUp.mine:hover { color: var(--accent); }
#voteDown.mine:hover { color: var(--danger); }

/* ---------- App recommendation ---------- */
.app-ad {
  position: fixed; right: 22px; bottom: 22px; z-index: 160;
  width: 320px; display: flex; gap: 14px; align-items: flex-start;
  padding: 16px 18px 16px 16px;
  background: var(--bg); border: 1px solid var(--border-strong);
  border-radius: 16px; box-shadow: var(--shadow);
  opacity: 0; transform: translateY(10px);
  transition: opacity .22s ease, transform .22s ease;
}
.app-ad.in { opacity: 1; transform: translateY(0); }
.app-ad .ad-icon { flex: none; }
.app-ad .app-icon.lg { width: 46px; height: 46px; border-radius: 12px; }
.app-ad .app-icon.lg svg { width: 24px; height: 24px; }
.ad-body { flex: 1; min-width: 0; }
.ad-name { font-weight: 700; font-size: 14.5px; margin-bottom: 2px; }
.ad-tag { color: var(--text-soft); font-size: 13px; line-height: 1.45; margin-bottom: 10px; }
.ad-go {
  border: none; background: transparent; color: var(--accent);
  font: inherit; font-size: 13px; font-weight: 600; padding: 0; text-decoration: underline;
}
.ad-x {
  position: absolute; top: 8px; right: 10px;
  border: none; background: transparent; color: var(--text-faint);
  font-size: 13px; line-height: 1; padding: 4px; border-radius: 6px;
}
.ad-x:hover { color: var(--text); background: var(--bg-hover); }
.ads-row { margin: 0 0 22px; }

/* the recommendation is a desktop-only courtesy */
@media (max-width: 1023px), (pointer: coarse) { .app-ad { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .app-ad { transition: opacity .22s ease; transform: none; } }

/* ---------- Votes in the task list ---------- */
.vote-chip { display: inline-flex; align-items: center; gap: 8px; flex: none; margin-right: 2px; }
.vote-chip .vc { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 600; }
.vote-chip .vc.up { color: var(--accent); }
.vote-chip .vc.down { color: var(--danger); }

/* ---------- Polls ---------- */
.poll-block {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; margin: 6px 0 22px;   /* breathing room under the tags */
}
.poll-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.poll-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  font-weight: 700; color: var(--text-faint);
}
.poll-total { flex: 1; font-size: 12.5px; color: var(--text-soft); }
.poll-del {
  border: none; background: transparent; color: var(--text-faint);
  padding: 4px; border-radius: 6px; display: grid; place-items: center;
}
.poll-del:hover { color: var(--danger); background: var(--bg-hover); }

.poll-row {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  border: none; background: transparent; padding: 7px 8px; border-radius: var(--radius-sm);
}
.poll-row:hover { background: var(--bg-hover); }
.poll-mark {
  width: 15px; height: 15px; border-radius: 50%; flex: none;
  border: 2px solid var(--border-strong); position: relative;
}
.poll-row.mine .poll-mark { border-color: var(--accent); }
.poll-row.mine .poll-mark::after {
  content: ""; position: absolute; inset: 2px; border-radius: 50%; background: var(--accent);
}
.poll-body { flex: 1; min-width: 0; }
.poll-line { display: flex; align-items: baseline; gap: 10px; margin-bottom: 5px; }
.poll-text { flex: 1; min-width: 0; font-size: 14px; word-break: break-word; }
.poll-row.mine .poll-text { font-weight: 600; }
.poll-num { flex: none; font-size: 12px; color: var(--text-soft); font-variant-numeric: tabular-nums; }
.poll-track { display: block; height: 6px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; }
.poll-fill {
  display: block; height: 100%; width: 0; background: var(--accent); border-radius: 999px;
  transition: width .45s cubic-bezier(.22,.68,.31,1);
}
@media (prefers-reduced-motion: reduce) { .poll-fill { transition: none; } }
.poll-row.bare .poll-text { padding: 2px 0; }
.poll-hint { color: var(--text-faint); font-size: 12.5px; margin: 8px 0 0 8px; }

.poll-inputs { display: grid; gap: 8px; margin-bottom: 10px; }
.poll-in {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--bg); outline: none;
}
.poll-in:focus { border-color: var(--accent); }

/* a task carrying a poll, marked in the list */
.poll-chip {
  display: inline-grid; place-items: center; flex: none;
  color: var(--text-faint); margin-right: 6px;
}
.task:hover .poll-chip { color: var(--text-soft); }

/* attachments: the card opens the file, the arrow downloads it */
.att-card { cursor: pointer; }
.att-open {
  border: none; background: transparent; padding: 0; font: inherit; text-align: left;
  color: var(--text); text-decoration: underline; cursor: pointer; word-break: break-word;
}
.att-open:hover { color: var(--accent); }
.att-dl {
  flex: none; display: grid; place-items: center; width: 28px; height: 28px;
  border-radius: var(--radius-sm); color: var(--text-faint); text-decoration: none;
}
.att-dl:hover { background: var(--bg-hover); color: var(--accent); }

/* report repository: unread marker + the already-seen notice */
.ws-count.unread { color: var(--accent); font-size: 18px; line-height: 1; }
.report-notice {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 11px 16px; background: var(--accent-soft); color: var(--accent);
  font-size: 13px; border-bottom: 1px solid var(--border);
}
.rn-link {
  border: none; background: transparent; color: var(--accent);
  font: inherit; font-weight: 600; text-decoration: underline; padding: 0;
}

/* the pause, restated at the top of the settings — it overrides everything below */
.em-pause-flag {
  display: flex; align-items: center; gap: 10px; width: 100%; margin: 0 0 4px;
  border: 1px solid var(--accent); background: var(--accent-soft); color: var(--accent);
  border-radius: 12px; padding: 11px 15px; font: inherit; font-size: 13.5px; font-weight: 600;
  cursor: pointer; text-align: left;
}
.em-pause-flag .pause-dot { background: currentColor; }
