:root {
  --ink: #071a17;
  --ink-2: #0d2b26;
  --panel: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.12);
  --text: #eef7f4;
  --muted: #9bb5ae;
  --mint: #5eead4;
  --mint-deep: #2dd4bf;
  --warn: #f0b429;
  --danger: #fb7185;
  --ok: #86efac;
  --radius: 14px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --font-display: "Syne", sans-serif;
  --font-body: "Manrope", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(94, 234, 212, 0.18), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(240, 180, 41, 0.1), transparent 45%),
    linear-gradient(160deg, #04110f 0%, var(--ink) 45%, #0a221e 100%);
  background-attachment: fixed;
}

a {
  color: var(--mint);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.shell {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  animation: rise 0.5s ease both;
}

.brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.55rem;
  letter-spacing: -0.03em;
  color: var(--text);
  text-decoration: none;
}

.brand span {
  color: var(--mint);
}

.topbar-public {
  justify-content: space-between;
}

.lang-switch {
  display: inline-flex;
  gap: 0.3rem;
  align-items: center;
}

.lang-switch a {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
}

.lang-switch a:hover,
.lang-switch a.active {
  color: #04201c;
  background: var(--mint);
  border-color: transparent;
  text-decoration: none;
}

.hero-login {
  min-height: calc(100vh - 3rem);
  display: grid;
  align-items: center;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
  animation: rise 0.6s ease both;
}

.hero-copy h1 {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 7vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin: 0 0 1rem;
}

.hero-copy h1 em {
  font-style: normal;
  color: var(--mint);
}

.hero-copy p {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 28rem;
  margin: 0;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.panel h2,
.section h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0 0 0.85rem;
  letter-spacing: -0.02em;
}

.grid {
  display: grid;
  gap: 1rem;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.section {
  margin-bottom: 1.25rem;
  animation: rise 0.55s ease both;
}

.section:nth-child(2) {
  animation-delay: 0.05s;
}
.section:nth-child(3) {
  animation-delay: 0.1s;
}

label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  margin-bottom: 0.85rem;
}

textarea {
  min-height: 5rem;
  resize: vertical;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1.15rem;
  background: var(--mint);
  color: #04201c;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn:hover {
  background: var(--mint-deep);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.btn-danger {
  background: var(--danger);
  color: #2a0610;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.flash {
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  margin-bottom: 1rem;
  border: 1px solid var(--line);
}

.flash-ok {
  background: rgba(134, 239, 172, 0.12);
  color: var(--ok);
}

.flash-err {
  background: rgba(251, 113, 133, 0.12);
  color: var(--danger);
}

.status-pill {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.status-open {
  background: rgba(94, 234, 212, 0.15);
  color: var(--mint);
}

.status-closed {
  background: rgba(155, 181, 174, 0.15);
  color: var(--muted);
}

.status-pending {
  background: rgba(240, 180, 41, 0.15);
  color: var(--warn);
}

.status-paid {
  background: rgba(134, 239, 172, 0.15);
  color: var(--ok);
}

.status-cancelled {
  background: rgba(251, 113, 133, 0.12);
  color: var(--danger);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th,
td {
  text-align: start;
  padding: 0.7rem 0.4rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.muted {
  color: var(--muted);
}

.stat {
  font-family: var(--font-display);
  font-size: 1.8rem;
  letter-spacing: -0.03em;
  margin: 0.2rem 0 0;
}

.mono {
  font-variant-numeric: tabular-nums;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 860px) {
  .hero-login,
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
}

html[dir="rtl"] body {
  font-family: "Vazirmatn", var(--font-body);
}

html[dir="rtl"] .brand,
html[dir="rtl"] .hero-copy h1,
html[dir="rtl"] .panel h2,
html[dir="rtl"] .section h2,
html[dir="rtl"] .stat {
  font-family: "Vazirmatn", var(--font-display);
}

html[dir="rtl"] th {
  text-transform: none;
  letter-spacing: 0;
}

html[dir="rtl"] .flip-rtl {
  display: inline-block;
  transform: scaleX(-1);
}

/* ---- API tokens --------------------------------------------------------- */

.token-copy {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

.token-copy input {
  flex: 1;
}

label.check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  font-size: 0.9rem;
}

label.check input {
  width: auto;
  margin: 0;
}

.status-token-active {
  background: rgba(134, 239, 172, 0.15);
  color: var(--ok);
}

.status-token-expired,
.status-token-revoked {
  background: rgba(251, 113, 133, 0.12);
  color: var(--danger);
}

/* ---- app layout + sidebar ----------------------------------------------
   Logical properties (inline-start/end) so the sidebar sits on the right in RTL.
   Desktop: sticky sidebar that collapses to icons (html.sb-collapsed).
   Mobile (<= 900px): off-canvas drawer opened by the hamburger (body.sb-open). */

:root {
  --sb-w: 252px;
  --sb-w-collapsed: 72px;
  --sb-bg: rgba(4, 17, 15, 0.72);
  --sb-hover: rgba(94, 234, 212, 0.08);
  --sb-active: rgba(94, 234, 212, 0.14);
  --content-max: 1180px;
}

.app-layout {
  display: grid;
  grid-template-columns: var(--sb-w) minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 0.2s ease;
}

html.sb-collapsed .app-layout {
  grid-template-columns: var(--sb-w-collapsed) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem 0.75rem;
  background: var(--sb-bg);
  border-inline-end: 1px solid var(--line);
  backdrop-filter: blur(14px);
  overflow: hidden;
  z-index: 40;
}

.sb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.15rem 0.25rem 0.75rem;
}

.sb-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
  min-width: 0;
}

.sb-brand:hover {
  text-decoration: none;
}

.sb-brand .brand {
  font-size: 1.35rem;
}

.brand-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  color: #04201c;
  background: linear-gradient(135deg, var(--mint), var(--mint-deep));
}

.icon {
  flex: none;
  width: 20px;
  height: 20px;
}

.icon-sm {
  width: 16px;
  height: 16px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.icon-btn:hover,
.icon-btn:focus-visible {
  color: var(--text);
  background: var(--sb-hover);
  border-color: var(--line);
}

.sb-close {
  display: none;
}

.sb-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  margin-inline: -0.25rem;
  padding-inline: 0.25rem;
}

.sb-group + .sb-group {
  margin-top: 0.6rem;
}

.sb-group-label {
  padding: 0 0.7rem 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.75;
  white-space: nowrap;
}

.sb-nav ul,
.sb-sub {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sb-item {
  position: relative;
}

.sb-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.15rem;
  padding: 0.35rem 0.7rem;
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.sb-link:hover,
.sb-link:focus-visible {
  color: var(--text);
  background: var(--sb-hover);
  text-decoration: none;
}

.sb-link.active {
  color: var(--text);
  background: var(--sb-active);
  box-shadow: inset 3px 0 0 var(--mint);
}

html[dir="rtl"] .sb-link.active {
  box-shadow: inset -3px 0 0 var(--mint);
}

.sb-link.active .icon {
  color: var(--mint);
}

.sb-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sb-sub-toggle {
  position: absolute;
  top: 0.18rem;
  inset-inline-end: 0.3rem;
  display: grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.sb-sub-toggle:hover {
  color: var(--text);
  background: var(--sb-hover);
}

.sb-sub-toggle .icon {
  transition: transform 0.15s ease;
}

.sb-sub-toggle[aria-expanded="true"] .icon {
  transform: rotate(90deg);
}

html[dir="rtl"] .sb-sub-toggle .icon {
  transform: scaleX(-1);
}

html[dir="rtl"] .sb-sub-toggle[aria-expanded="true"] .icon {
  transform: rotate(90deg);
}

.sb-nav .sb-sub {
  margin: 0.1rem 0 0.2rem;
  padding-inline-start: 1.6rem;
}

.sb-sublink {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.28rem 0.6rem;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.85rem;
  text-decoration: none;
  white-space: nowrap;
}

.sb-sublink:hover {
  color: var(--text);
  background: var(--sb-hover);
  text-decoration: none;
}

.sb-sublink.active {
  color: var(--text);
  background: var(--sb-active);
}

.sb-dot {
  flex: none;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--mint-deep);
  opacity: 0.7;
}

.sb-foot {
  display: grid;
  gap: 0.15rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--line);
}

.sb-lang,
.sb-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.15rem;
  padding: 0.2rem 0.7rem;
  color: var(--muted);
  white-space: nowrap;
}

.sb-user {
  padding-inline-end: 0;
}

.sb-user-text {
  flex: 1;
}

.sb-logout {
  flex: none;
  margin-inline-start: auto;
}

.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  margin-inline: -0.1rem;
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  background: rgba(255, 255, 255, 0.12);
}

.sb-user-text {
  display: grid;
  line-height: 1.2;
}

.sb-user-text strong {
  color: var(--text);
  font-size: 0.86rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sb-user-text small {
  font-size: 0.72rem;
}

.app-main {
  min-width: 0;
}

.content {
  width: 100%;
  max-width: calc(var(--content-max) + 4rem);
  margin-inline: auto;
  padding: 2rem 2rem 3rem;
  animation: rise 0.4s ease both;
}

/* Full-width content for multi-pane pages (e.g. a project list + tree + detail panel). */
.content.content-wide {
  max-width: none;
  padding: 0;
  animation: none;
}

.mobile-bar,
.sb-overlay {
  display: none;
}

/* Collapsed (desktop only): icons, tooltips via title. */
@media (min-width: 901px) {
  html.sb-collapsed .sidebar {
    padding-inline: 0.6rem;
  }

  html.sb-collapsed .sb-label,
  html.sb-collapsed .sb-sub-toggle,
  html.sb-collapsed .sb-sub {
    display: none;
  }

  html.sb-collapsed .sb-head {
    flex-direction: column;
    gap: 0.6rem;
  }

  html.sb-collapsed .sb-group-label {
    height: 1px;
    margin: 0.4rem 0.7rem 0.6rem;
    padding: 0;
    overflow: hidden;
    color: transparent;
    background: var(--line);
  }

  html.sb-collapsed .sb-link,
  html.sb-collapsed .sb-lang,
  html.sb-collapsed .sb-user {
    justify-content: center;
    padding-inline: 0;
  }

  html.sb-collapsed .sb-user {
    flex-direction: column;
    gap: 0.35rem;
  }

  html.sb-collapsed .sb-logout {
    margin: 0;
  }

  html.sb-collapsed .sb-collapse .icon {
    transform: scaleX(-1);
  }

  html[dir="rtl"] .sb-collapse .icon {
    transform: scaleX(-1);
  }

  html[dir="rtl"].sb-collapsed .sb-collapse .icon {
    transform: none;
  }
}

@media (max-width: 900px) {
  .app-layout,
  html.sb-collapsed .app-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    width: min(86vw, 300px);
    height: 100dvh;
    background: rgba(4, 17, 15, 0.97);
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    box-shadow: var(--shadow);
  }

  html[dir="rtl"] .sidebar {
    transform: translateX(105%);
  }

  body.sb-open .sidebar,
  html[dir="rtl"] body.sb-open .sidebar {
    transform: none;
  }

  .sb-collapse {
    display: none;
  }

  .sb-close {
    display: inline-grid;
  }

  .sb-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  body.sb-open .sb-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  body.sb-open {
    overflow: hidden;
  }

  .mobile-bar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1rem;
    background: rgba(4, 17, 15, 0.85);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
  }

  .mobile-bar .brand {
    font-size: 1.25rem;
  }

  .content {
    padding: 1.25rem 1rem 2.5rem;
  }

  /* Wide tables scroll inside their panel instead of widening the page. */
  .content table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-layout,
  .sidebar,
  .sb-overlay,
  .sb-sub-toggle .icon {
    transition: none;
  }
}

/* ---- docs (/help): rendered docs/API.md ---------------------------------- */

.help-links {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.6rem;
}

.prose {
  max-width: 920px;
  line-height: 1.65;
  font-family: var(--font-body);
}

.prose h1,
.prose h2,
.prose h3 {
  font-family: var(--font-display);
  line-height: 1.2;
  scroll-margin-top: 4.5rem;
}

.prose h1 {
  margin-top: 0;
  font-size: 1.9rem;
}

.prose h2 {
  margin-top: 2.4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 1.35rem;
}

.prose h3 {
  margin-top: 1.6rem;
  font-size: 1.08rem;
}

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
  padding: 0.1em 0.35em;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
}

.prose pre {
  overflow-x: auto;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
}

.prose pre code {
  padding: 0;
  background: none;
  font-size: 0.82rem;
}

.prose table {
  display: block;
  overflow-x: auto;
  margin: 1rem 0;
}

.prose th,
.prose td {
  vertical-align: top;
  font-size: 0.88rem;
}

.prose li + li {
  margin-top: 0.25rem;
}

html[dir="rtl"] .prose,
html[dir="rtl"] .prose h1,
html[dir="rtl"] .prose h2,
html[dir="rtl"] .prose h3 {
  font-family: var(--font-body);
}
.prose a,
.prose code {
  overflow-wrap: anywhere;
}

/* ---- tasks: Quire-like tree list (static/tasks.js) ------------------------
   Compact rows, hover gutter, inline editing and a right detail panel.
   Logical properties (inline-start/end) so everything flips for RTL. */

.tq {
  --tq-row: 26px;
  --tq-indent: 18px;
  --tq-due: #67c7ee;
  --tq-select: rgba(94, 234, 212, 0.13);
  --tq-hover: rgba(255, 255, 255, 0.045);
  --tq-divider: rgba(255, 255, 255, 0.07);
  --tq-surface: #0c2924;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 100vh;
}

.tq.has-panel {
  grid-template-columns: minmax(0, 1fr) 350px;
}

.tq [hidden],
.tq-pop[hidden],
.tq-help[hidden] {
  display: none !important;
}

.tq-main {
  min-width: 0;
  padding: 1.1rem 2rem 4rem;
}

.tq-bar,
.tq-list,
.tq-admin {
  max-width: 860px;
  margin-inline: auto;
}

.tq-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.55rem;
  margin-bottom: 0.4rem;
  border-bottom: 1px solid var(--line);
}

.tq-heading {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.tq-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.3rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tq.is-saving .tq-name::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-inline-start: 0.5rem;
  vertical-align: middle;
  border-radius: 50%;
  background: var(--mint);
  animation: tq-pulse 0.9s ease-in-out infinite alternate;
}

@keyframes tq-pulse {
  from {
    opacity: 0.25;
  }
}

.tq-tools {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.tq-tool {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 30px;
  padding: 0 0.55rem;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  font-size: 0.8rem;
  cursor: pointer;
}

.tq-tool:hover,
.tq-tool:focus-visible {
  background: var(--tq-hover);
  color: var(--text);
}

.tq-tool[aria-pressed="true"] {
  color: var(--mint);
}

/* rows */

.tq-list {
  font-size: 13.5px;
  outline: none;
  user-select: none;
}

.tq-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 28px;
  align-items: center;
  min-height: var(--tq-row);
}

.tq-cell {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
  min-height: var(--tq-row);
  padding-inline: calc(var(--depth, 0) * var(--tq-indent)) 0.3rem;
  border-bottom: 1px solid var(--tq-divider);
  border-radius: 4px;
}

.tq-row:hover .tq-cell {
  background: var(--tq-hover);
}

.tq-row.is-selected .tq-cell {
  background: var(--tq-select);
}

.tq-list:focus-visible .tq-row.is-selected .tq-cell {
  box-shadow: inset 0 0 0 1px rgba(94, 234, 212, 0.35);
}

.tq-gutter {
  display: flex;
  align-items: center;
  justify-content: center;
}

.tq-row button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.tq-row button svg {
  width: 14px;
  height: 14px;
}

.tq-row .tq-check,
.tq-row .tq-add,
.tq-row .tq-tag,
.tq-row .tq-prio:not(.has-value),
.tq-row .tq-due:not(.has-value),
.tq-row .tq-who:not(.has-value) {
  opacity: 0;
}

.tq-row:hover .tq-check,
.tq-row:hover .tq-add,
.tq-row:hover .tq-tag,
.tq-row:hover .tq-prio,
.tq-row:hover .tq-due,
.tq-row:hover .tq-who,
.tq-row.is-selected .tq-check,
.tq-row.is-selected .tq-add,
.tq-row.is-selected .tq-tag,
.tq-row.is-selected .tq-prio,
.tq-row.is-selected .tq-due,
.tq-row.is-selected .tq-who,
.tq-row.is-done .tq-check {
  opacity: 1;
}

.tq-check {
  position: relative;
  flex: none;
  width: 15px;
  height: 15px;
  padding: 0;
  border: 1.5px solid var(--muted) !important;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}

.tq-check:hover {
  border-color: var(--mint) !important;
}

.tq-check.is-doing,
.tq-row.is-doing .tq-check {
  background: linear-gradient(90deg, var(--warn) 50%, transparent 50%) !important;
  border-color: var(--warn) !important;
}

html[dir="rtl"] .tq-row.is-doing .tq-check,
html[dir="rtl"] .tq-check.is-doing {
  background: linear-gradient(270deg, var(--warn) 50%, transparent 50%) !important;
}

.tq-check[aria-pressed="true"] {
  background: var(--mint) !important;
  border-color: var(--mint) !important;
}

.tq-check[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  inset: 2px 4px 4px 4px;
  border: solid #04201c;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.tq-arrow {
  flex: none;
  width: 14px;
  height: 14px;
}

.tq-row .tq-arrow svg {
  width: 9px;
  height: 9px;
  transition: transform 0.12s ease;
}

html[dir="rtl"] .tq-row .tq-arrow svg {
  transform: scaleX(-1);
}

.tq-row[aria-expanded="true"] .tq-arrow svg,
html[dir="rtl"] .tq-row[aria-expanded="true"] .tq-arrow svg {
  transform: rotate(90deg);
}

.tq-title {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  line-height: var(--tq-row);
}

.tq-row.is-done .tq-title {
  color: var(--muted);
  text-decoration: line-through;
}

.tq-row.is-pending .tq-title {
  opacity: 0.7;
}

.tq-edit {
  flex: 1;
  min-width: 0;
  height: 22px;
  margin: 1px 0;
  padding: 0 0.4rem;
  border: 1.5px solid var(--mint);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.3);
  font-size: inherit;
  user-select: text;
}

.tq-edit:focus {
  outline: none;
}

.tq-meta {
  display: flex;
  flex: none;
  align-items: center;
  gap: 0.35rem;
}

.tq-fill {
  flex: 1;
  align-self: stretch;
  min-width: 0.5rem;
}

.tq-row.is-context .tq-title {
  color: var(--muted);
}

.tq-row .tq-due,
.tq-row .tq-who,
.tq-row .tq-prio,
.tq-row .tq-tag {
  min-width: 22px;
  height: 22px;
  border-radius: 4px;
}

.tq-row .tq-due:hover,
.tq-row .tq-who:hover,
.tq-row .tq-prio:hover,
.tq-row .tq-tag:hover,
.tq-row .tq-add:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.tq-row .tq-due.has-value {
  padding: 0 0.3rem;
  color: var(--tq-due);
  font-size: 12px;
}

.tq-row .tq-due.is-overdue {
  color: var(--danger);
}

.tq-avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--mint-deep);
  color: #04201c;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.tq-avatar.is-empty {
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.tq-avatar svg {
  width: 12px;
  height: 12px;
}

.tq-addrow {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 30px;
  padding-inline-start: 28px;
  color: var(--muted);
  cursor: pointer;
}

.tq-addrow:hover {
  color: var(--text);
}

.tq-addrow-icon svg {
  display: block;
  width: 14px;
  height: 14px;
}

.tq-empty,
.tq-noscript {
  padding: 1rem 0 0.25rem;
  padding-inline-start: 28px;
  color: var(--muted);
}

/* drag and drop */

.tq-row.is-dragging {
  opacity: 0.4;
}

.tq-row.drop-before .tq-cell {
  box-shadow: inset 0 2px 0 var(--mint);
}

.tq-row.drop-after .tq-cell {
  box-shadow: inset 0 -2px 0 var(--mint);
}

.tq-row.drop-inside .tq-cell {
  background: rgba(94, 234, 212, 0.1);
  box-shadow: inset 0 0 0 1px var(--mint);
}

.tq-addrow.drop-end {
  box-shadow: inset 0 2px 0 var(--mint);
}

/* members & settings */

.tq-admin {
  margin-top: 2.5rem;
}

.tq-admin > summary {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
}

/* detail panel */

.tq-panel {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 0.85rem 1.1rem 2rem;
  border-inline-start: 1px solid var(--line);
  background: rgba(4, 17, 15, 0.55);
}

.tqp-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 32px;
  color: var(--muted);
  font-size: 12px;
}

.tqp-parent {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tqp-spacer {
  flex: 1;
}

.tqp-titlebox {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin: 0.4rem 0 0.8rem;
}

.tqp-check {
  width: 20px;
  height: 20px;
  margin-top: 0.55rem;
}

.tqp-check[aria-pressed="true"]::after {
  inset: 3px 6px 6px 6px;
}

.tqp-title {
  min-height: 0;
  margin: 0;
  padding: 0.25rem 0.35rem;
  overflow: hidden;
  resize: none;
  border-color: transparent;
  background: transparent;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.35;
}

.tqp-title:focus,
.tqp-title:hover {
  border-color: var(--line);
}

.tqp-field {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 0.5rem;
  margin: 0.55rem 0;
}

.tqp-field-col {
  grid-template-columns: minmax(0, 1fr);
  gap: 0.3rem;
  margin-top: 1rem;
}

.tqp-label {
  color: var(--muted);
  font-size: 12px;
}

.tq-panel input,
.tq-panel select,
.tq-pop input {
  margin: 0;
  padding: 0.4rem 0.55rem;
  border-radius: 6px;
  font-size: 13px;
}

.tq-panel .is-invalid,
.tq-pop .is-invalid {
  border-color: var(--danger);
}

.tqp-notes {
  min-height: 6.5rem;
  margin: 0;
  padding: 0.55rem 0.65rem;
  border-radius: 6px;
  font-size: 13.5px;
  line-height: 1.5;
  resize: none;
}

.tqp-status {
  display: flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.tqp-status button {
  flex: 1 1 auto;
  padding: 0.3rem 0.4rem;
  white-space: nowrap;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
}

.tqp-status button + button {
  border-inline-start: 1px solid var(--line);
}

.tqp-status button[aria-checked="true"] {
  background: rgba(94, 234, 212, 0.16);
  color: var(--mint);
}

.tq-date-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.4rem;
}

.tq-chip {
  padding: 0.15rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font-size: 11.5px;
  cursor: pointer;
}

.tq-chip:hover {
  border-color: var(--mint);
  color: var(--text);
}

.tqp-section {
  margin-top: 1.1rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
}

.tqp-subtasks {
  margin: 0.35rem 0 0;
  padding: 0;
  list-style: none;
}

.tqp-sub {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.3rem 0.2rem;
  border: 0;
  border-bottom: 1px solid var(--tq-divider);
  background: none;
  color: var(--text);
  font-size: 13px;
  text-align: start;
  cursor: pointer;
}

.tqp-sub:hover {
  background: var(--tq-hover);
}

.tqp-sub.is-done {
  color: var(--muted);
  text-decoration: line-through;
}

.tq-dot {
  flex: none;
  width: 9px;
  height: 9px;
  border: 1.5px solid var(--muted);
  border-radius: 50%;
}

.tqp-sub.is-done .tq-dot {
  border-color: var(--mint);
  background: var(--mint);
}

.tqp-created {
  margin-top: 1rem;
  font-size: 12px;
}

/* priority flags and label chips */

:root {
  --p-urgent: #f2555a;
  --p-high: #f7853b;
  --p-medium: #f5c518;
  --p-low: #4aa8ff;
}

.tq .p-urgent,
.tq-pop .p-urgent {
  color: var(--p-urgent);
}

.tq .p-high,
.tq-pop .p-high {
  color: var(--p-high);
}

.tq .p-medium,
.tq-pop .p-medium {
  color: var(--p-medium);
}

.tq .p-low,
.tq-pop .p-low {
  color: var(--p-low);
}

.tq .p-none,
.tq-pop .p-none {
  color: var(--muted);
}

.tq-flag {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 16px;
  height: 16px;
}

.tq-flag svg,
.tq-prio svg {
  width: 14px;
  height: 14px;
}

.tq-flag:not(.p-none) .flag-body,
.tq-prio.has-value .flag-body {
  fill: currentColor;
}

.tq-row .tq-prio.p-urgent:hover {
  color: var(--p-urgent);
}

.tq-row .tq-prio.p-high:hover {
  color: var(--p-high);
}

.tq-row .tq-prio.p-medium:hover {
  color: var(--p-medium);
}

.tq-row .tq-prio.p-low:hover {
  color: var(--p-low);
}


.tq-labels {
  display: inline-flex;
  flex: 0 1 auto;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
  margin-inline-start: 0.5rem;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: none;
  cursor: pointer;
}

.tq-label-chip {
  --label: #8d8d8d;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  max-width: 12rem;
  height: 18px;
  padding: 0 0.45rem;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--label) 55%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--label) 24%, transparent);
  color: color-mix(in srgb, var(--label) 45%, #ffffff);
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tq-row.is-done .tq-label-chip {
  opacity: 0.6;
}

.tq-chip-x {
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  margin-inline-end: -0.25rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: inherit;
  cursor: pointer;
}

.tq-chip-x:hover {
  background: rgba(255, 255, 255, 0.18);
}

.tq-chip-x svg {
  width: 10px;
  height: 10px;
}

.tqp-picker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: none;
  color: var(--text);
  font-size: 12.5px;
  cursor: pointer;
}

.tqp-picker:hover {
  border-color: var(--mint);
}

.tqp-picker.tqp-prio {
  color: var(--text);
}

.tqp-picker svg {
  width: 13px;
  height: 13px;
}

.tqp-labels {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
}

.tqp-labels .tq-label-chip {
  height: 22px;
  font-size: 12px;
}

.tqp-addlabel {
  padding: 0.15rem 0.5rem;
  border-style: dashed;
  color: var(--muted);
}

.tq-pop-head {
  margin: 0.35rem 0.45rem 0.15rem;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tq-pop-head:first-child {
  margin-top: 0.1rem;
}

.tq-pop-check {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 15px;
  height: 15px;
  border: 1.5px solid var(--muted);
  border-radius: 4px;
}

.tq-pop-item[aria-checked="true"] .tq-pop-check {
  border-color: var(--mint);
  background: var(--mint);
  color: #04201c;
}

.tq-pop-check svg,
.tq-pop-plus svg {
  width: 11px;
  height: 11px;
}

.tq-pop-plus {
  display: inline-grid;
  place-items: center;
  width: 15px;
}

.tq-pop-labels input {
  width: 100%;
  margin-bottom: 0.3rem;
}

.tq-pop-empty {
  margin: 0.3rem 0.45rem;
  font-size: 12px;
}

.tq-view-count {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: var(--mint);
  color: #04201c;
  font-size: 10.5px;
}

.tq-view-count[hidden] {
  display: none;
}

.tq-label-list {
  margin: 0.4rem 0 0.8rem;
  padding: 0;
  list-style: none;
}

.tq-label-list li {
  display: grid;
  grid-template-columns: 30px auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--tq-divider);
}

.tq-label-list input {
  margin: 0;
  padding: 0.3rem 0.5rem;
  font-size: 13px;
}

.tq-label-list input[type="color"] {
  width: 30px;
  height: 26px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.tq-label-new {
  display: flex;
  gap: 0.5rem;
}

.tq-label-new input {
  flex: 1;
  margin: 0;
}

/* popover, toasts, help */

.tq-pop {
  position: absolute;
  z-index: 60;
  min-width: 210px;
  max-height: 320px;
  overflow-y: auto;
  padding: 0.4rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--tq-surface, #0c2924);
  box-shadow: var(--shadow);
  font-size: 13px;
}

.tq-pop-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.35rem 0.45rem;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text);
  text-align: start;
  cursor: pointer;
}

.tq-pop-item:hover,
.tq-pop-item:focus-visible {
  background: rgba(255, 255, 255, 0.07);
  outline: none;
}

.tq-pop-item.is-current {
  color: var(--mint);
}

.tq-toasts {
  position: fixed;
  inset-inline: 0;
  bottom: 1.25rem;
  z-index: 70;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.tq-toast {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  max-width: min(520px, calc(100% - 2rem));
  padding: 0.45rem 0.55rem 0.45rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f302a;
  box-shadow: var(--shadow);
  font-size: 13px;
  pointer-events: auto;
  animation: rise 0.2s ease both;
}

.tq-toast.is-error {
  border-color: var(--danger);
}

.tq-toast span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tq-toast button {
  flex: none;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.tq-toast .tq-toast-undo {
  color: var(--mint);
  font-weight: 700;
}

.tq-help {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 80;
  width: min(560px, calc(100% - 2rem));
  max-height: 82vh;
  overflow-y: auto;
  padding: 1rem 1.3rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0c2924;
  box-shadow: var(--shadow);
  transform: translate(-50%, -50%);
  font-size: 13px;
}

.tq-help-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tq-help h2 {
  margin: 0;
  font-size: 1.05rem;
}

.tq-help dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.45rem 1rem;
  margin: 0.9rem 0;
}

.tq-help dt {
  white-space: nowrap;
}

.tq-help dd {
  margin: 0;
  color: var(--muted);
}

kbd {
  display: inline-block;
  min-width: 1.5em;
  padding: 0.05rem 0.4rem;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.05);
  font-family: inherit;
  font-size: 11.5px;
  text-align: center;
}

@media (max-width: 900px) {
  .tq {
    --tq-row: 38px;
    --tq-indent: 14px;
  }

  .tq.has-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .tq-main {
    padding: 0.75rem 0.6rem 5rem;
  }

  .tq-panel {
    position: fixed;
    inset: 0;
    z-index: 65;
    height: auto;
    border: 0;
    background: var(--ink);
  }

  body.tq-sheet-open {
    overflow: hidden;
  }

  .tq-row .tq-check {
    opacity: 1;
  }

  .tq-row .tq-add,
  .tq-row .tq-tag,
  .tq-row .tq-prio:not(.has-value),
  .tq-row .tq-due:not(.has-value),
  .tq-row .tq-who:not(.has-value) {
    display: none;
  }

  .tq-labels .tq-label-chip:nth-child(n + 3) {
    display: none;
  }

  .tq-row {
    grid-template-columns: 32px minmax(0, 1fr) 4px;
  }

  .tq-check {
    width: 18px;
    height: 18px;
  }

  .tq-check[aria-pressed="true"]::after {
    inset: 2px 5px 5px 5px;
  }

  .tq-tool span {
    display: none;
  }
}

html[lang="en"] .tqp-status button {
  text-transform: capitalize;
}

.tq-label-list .icon-btn svg {
  width: 14px;
  height: 14px;
}

/* ---- calendar ------------------------------------------------------------ */

.cal {
  --tq-hover: rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 0.9rem 1.5rem 1rem;
}

.cal-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1rem;
  padding-bottom: 0.55rem;
  margin-bottom: 0.6rem;
  border-bottom: 1px solid var(--line);
}

.cal-heading {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  min-width: 0;
}

.cal-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.3rem;
  white-space: nowrap;
}

.cal-status {
  font-size: 12px;
}

.cal-tools,
.cal-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.cal-tools {
  gap: 0.9rem;
}

[dir="rtl"] .cal-nav svg {
  transform: scaleX(-1);
}

.cal-views {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.cal-views button {
  height: 26px;
  padding: 0 0.75rem;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.cal-views button[aria-checked="true"] {
  background: rgba(94, 234, 212, 0.16);
  color: var(--mint);
}

.cal-weekdays,
.cal-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 7), minmax(0, 1fr));
}

.cal-weekdays div {
  padding: 0 0.5rem 0.35rem;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cal-grid {
  flex: 1;
  grid-auto-rows: minmax(118px, 1fr);
  border-top: 1px solid var(--line);
  border-inline-start: 1px solid var(--line);
}

.cal[data-view="week"] .cal-grid,
.cal[data-view="day"] .cal-grid {
  grid-auto-rows: minmax(420px, 1fr);
}

.cal-day {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding: 4px 0 6px;
  border-bottom: 1px solid var(--line);
  border-inline-end: 1px solid var(--line);
}

.cal-day.is-other {
  background: rgba(0, 0, 0, 0.16);
}

.cal-day.is-other .cal-date {
  opacity: 0.45;
}

.cal-day.is-drop {
  background: rgba(94, 234, 212, 0.1);
  box-shadow: inset 0 0 0 1px var(--mint);
}

.cal-date {
  align-self: flex-start;
  min-width: 24px;
  height: 22px;
  margin: 0 4px 2px;
  padding: 0 6px;
  border: 0;
  border-radius: 11px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.cal-date:hover {
  background: var(--tq-hover);
  color: var(--text);
}

.cal-day.is-today .cal-date {
  background: var(--mint);
  color: var(--ink);
}

.cal-chip {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0 4px;
  padding: 2px 8px;
  border-inline-start: 3px solid var(--chip);
  border-radius: 5px;
  background: color-mix(in srgb, var(--chip) 16%, transparent);
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
  cursor: grab;
}

.cal-chip:hover {
  background: color-mix(in srgb, var(--chip) 26%, transparent);
  text-decoration: none;
}

/* A task spanning several days: one bar broken at the day borders. */
.cal-chip.is-span:not(.is-first) {
  margin-inline-start: 0;
  border-inline-start-color: transparent;
  border-start-start-radius: 0;
  border-end-start-radius: 0;
}

.cal-chip.is-span:not(.is-last) {
  margin-inline-end: 0;
  border-start-end-radius: 0;
  border-end-end-radius: 0;
}

.cal-chip.is-done .cal-chip-title {
  color: var(--muted);
  text-decoration: line-through;
}

.cal-chip.is-dragging {
  opacity: 0.4;
}

.cal-chip-title,
.cal-chip-meta {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.cal-chip-meta {
  color: var(--muted);
  font-size: 11px;
}

.cal-resize {
  position: absolute;
  inset-block: 0;
  inset-inline-end: 0;
  width: 7px;
  border-start-end-radius: 5px;
  border-end-end-radius: 5px;
  cursor: ew-resize;
}

.cal-chip:hover .cal-resize {
  background: color-mix(in srgb, var(--chip) 55%, transparent);
}

.cal-more {
  align-self: flex-start;
  margin: 0 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
}

.cal-more:hover {
  color: var(--mint);
}

.cal-empty,
.cal-hint {
  margin: 0.8rem 0 0;
  font-size: 12.5px;
}

@media (max-width: 700px) {
  .cal {
    min-height: 0;
    padding: 0.75rem;
  }

  .cal-grid {
    grid-auto-rows: minmax(84px, auto);
  }

  .cal[data-view="month"] .cal-chip {
    padding: 1px 4px;
    font-size: 10.5px;
  }

  .cal-hint {
    display: none;
  }
}

/* ---- dependencies --------------------------------------------------------- */

.tq-lock {
  flex: none;
  display: inline-flex;
  width: 14px;
  height: 14px;
  margin-inline-start: 0.4rem;
  color: var(--warn);
}

.tq-lock svg {
  width: 14px;
  height: 14px;
}

.tq-dot.s-doing {
  border-color: var(--warn);
  background: linear-gradient(90deg, var(--warn) 50%, transparent 50%);
}

.tq-dot.s-done {
  border-color: var(--mint);
  background: var(--mint);
}

.tqp-deps-group {
  margin-bottom: 0.45rem;
}

.tqp-deps-head {
  margin-bottom: 0.15rem;
  font-size: 11.5px;
}

.tqp-deplist {
  margin: 0;
  padding: 0;
  list-style: none;
}

.tqp-dep {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 26px;
  font-size: 13px;
}

.tqp-dep.is-hidden {
  padding-inline-start: 1.1rem;
  font-size: 12px;
  font-style: italic;
}

.tqp-dep-link {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  padding: 0.15rem 0.3rem;
  border: 0;
  border-radius: 5px;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.tqp-dep-link:hover {
  background: var(--tq-hover);
  text-decoration: none;
}

.tqp-dep-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tqp-dep.is-done .tqp-dep-title {
  color: var(--muted);
  text-decoration: line-through;
}

.tqp-dep-project,
.tq-pop-sub {
  flex: none;
  max-width: 40%;
  overflow: hidden;
  font-size: 11.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tq-pop-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tqp-dep .tq-chip-x {
  opacity: 0.6;
}

.tqp-dep:hover .tq-chip-x {
  opacity: 1;
}

.tqp-adddep {
  padding: 0.15rem 0.5rem;
  border-style: dashed;
  color: var(--muted);
}

.tq-pop-deps {
  width: 340px;
}

/* ---- today ---------------------------------------------------------------- */

.td {
  max-width: 860px;
  padding: 0.9rem 1.5rem 2rem;
}

.td-section {
  margin-top: 1.1rem;
}

.td-heading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.3rem;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.td-overdue .td-heading {
  color: var(--danger);
}

.td-count {
  min-width: 1.4rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--panel);
  font-size: 11.5px;
  text-align: center;
}

.td-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.td-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.5rem 0.25rem;
  border-bottom: 1px solid var(--line);
}

.td-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.td-row .tq-check {
  margin-top: 3px;
}

.td-body {
  min-width: 0;
  flex: 1;
}

.td-title {
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.td-title:hover {
  color: var(--mint);
}

.td-row.is-done .td-title {
  color: var(--muted);
  text-decoration: line-through;
}

.td-meta,
.td-why {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.6rem;
  margin-top: 0.15rem;
  font-size: 12px;
  color: var(--muted);
}

.td-why {
  gap: 0 0.25rem;
  color: var(--warn);
}

.td-why .tq-lock {
  margin-inline: 0 0.15rem;
}

.td-why a {
  color: inherit;
}

.td-why.is-ready {
  color: var(--ok);
}

.td-due.is-late {
  color: var(--danger);
}

.td-pill {
  padding: 0 0.4rem;
  border-radius: 999px;
  background: rgba(240, 180, 41, 0.15);
  color: var(--warn);
}

.td-prio.p-urgent,
.td-prio.p-high {
  color: var(--danger);
}

.td-prio.p-medium {
  color: var(--warn);
}

.td-empty {
  margin-top: 1.5rem;
}

@media (max-width: 700px) {
  .td {
    padding: 0.75rem;
  }
}

/* ---- recurring tasks ------------------------------------------------------ */

.tq-repeat {
  flex: none;
  display: inline-flex;
  width: 13px;
  height: 13px;
  margin-inline-start: 0.4rem;
  color: var(--muted);
}

.tq-repeat svg {
  width: 13px;
  height: 13px;
}

.tqp-repeat.has-value {
  color: var(--mint);
}

.tq-pop-repeat {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  width: 300px;
  max-height: none;
  padding: 0.7rem;
}

.tq-pop-repeat select,
.tq-pop-repeat input {
  width: 100%;
}

.tq-repeat-week {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.tq-repeat-week .tq-chip[aria-pressed="true"] {
  border-color: var(--mint);
  background: rgba(94, 234, 212, 0.18);
  color: var(--mint);
}

.tq-repeat-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 12px;
  color: var(--muted);
}

.tq-repeat-row[hidden],
.tq-repeat-week[hidden] {
  display: none;
}

.tq-repeat-save {
  align-self: flex-end;
}

/* projected occurrences of repeating tasks on the calendar */
.cal-chip.is-projected {
  border: 1px dashed color-mix(in srgb, var(--chip) 55%, transparent);
  border-inline-start: 3px dashed var(--chip);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.cal-chip.is-projected .tq-repeat {
  margin-inline: 0 0.25rem;
  vertical-align: -2px;
}
