/* =================================================================
   DirNav stylesheet
   Dark theme, cyan + magenta accents, Inter. Palette carried over
   from the Stage Intelligence sheet; landing-page classes replaced
   with DirNav components (header, chips, finder, grid, card).
   ================================================================= */

:root {
  /* color palette */
  --color01:     #38BDF8;
  --color02:  #E24BC4;
  --bg:       #0a0a0a;
  --panel:    #161616;
  --panel2:   #1e1e1e;
  --header-bg: rgb(22 22 22 / 96%);
  --text:     #E6E6E6;
  --muted:    #9a9a9a;
  --empty-text: #666666;
  --white:    #ffffff;
  --border:   #333333;
  --gray-dark:  #1a1a1a;
  --gray-light: #e8e8e8;
  --tag-fallback: #888888;
  --ink:        #000000;
  --finder-row-hover-bg: color-mix(in srgb, var(--color01) 7%, transparent);
  --shadow-cyan:    color-mix(in srgb, var(--color01) 18%, transparent);
  --shadow-magenta: color-mix(in srgb, var(--color02) 12%, transparent);
  --card-hover-shadow: 0 0 18px var(--shadow-cyan), 0 0 24px var(--shadow-magenta);
  --blockquote-accent-bg: color-mix(in srgb, var(--color02) 6%, transparent);
  --toast-bg:   #333333;
  --toast-text: #ffffff;
  --radius: 10px;
  /* attribute colors — the single source of truth, edit here */
  --attr-PhD:           #750014;
  --attr-research:      #b40000;
  --attr-venture:       #9c2bbe;
  --attr-coding:        #02c28f;
  --attr-coding-font:   #0a0a0a;
  --attr-productivity:  #046481;
  --attr-website:       #1e1e75;
  --attr-music:         #DAA520;
  --attr-music-font:    #0a0a0a;
  --attr-career:        #d14d00;
  --attr-learning:      #8C5A21;
  --attr-personal:      #2c6da7;
  --attr-font-general:  #eeeeee;
  --attr-chip-off:      #666666;
  /* btn-multi-function tokens — header tools + card Kickoff/Open P00 */
  --btn-mf-bkgd:        linear-gradient(135deg,
                          color-mix(in srgb, var(--color01) 40%, transparent),
                          color-mix(in srgb, var(--color02) 40%, transparent));
  --btn-mf-font:        var(--white);
  /* btn-single-function tokens — muted gray at rest; grayscale hover flow */
  --btn-sf-bkgd:        linear-gradient(135deg,
                          color-mix(in srgb, var(--gray-light) 35%, transparent),
                          color-mix(in srgb, var(--gray-dark) 55%, transparent));
  --btn-sf-font:        var(--white);
  /* btn-plain tokens — outline / muted actions (Reset, About) */
  --btn-plain-bkgd:         transparent;
  --btn-plain-border:       var(--border);
  --btn-plain-font:         var(--muted);
  --btn-plain-hover-font:   var(--text);
  --btn-plain-hover-border: var(--color01);
  /* cursor tips — see "Cursor tips" section in this file */
  --hover-label-font:       var(--btn-plain-font);
  --cursor-tip-bg:          #1e1e1e;
  --cursor-tip-border:      #d4d4d4;
  --cursor-tip-font:        #f5f5f5;
  --cursor-tip-radius:      6px;
  --cursor-tip-mf-font:     .9rem;
  --cursor-tip-fade-ms:     0.3s;
}

/* --- btn-multi-function ---
   Shared appearance for Latest Weekly, projects.json, and card Kickoff/Open P00.
   Layout: .dn-header-row, .dn-actions */
.btn-multi-function {
  background: var(--btn-mf-bkgd);
  color: var(--btn-mf-font);
  border: none;
  padding: .35rem .7rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
  white-space: nowrap;
}

.btn-multi-function:hover {
  background-image: linear-gradient(115deg,
    var(--color01) 0%, var(--color02) 18%, var(--color01) 37%,
    var(--color02) 55%, var(--color01) 72%, var(--color02) 88%, var(--color01) 100%);
  background-size: 400% 100%;
  animation: dn-btn-flow 2.4s linear infinite;
  color: var(--btn-mf-font);
}

.dn-header-row .btn-multi-function {
  flex: 0 0 auto;
}

@keyframes dn-btn-flow {
  0%   { background-position: 0% 50%; }
  100% { background-position: 400% 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .btn-multi-function:hover {
    animation: none;
    background-position: 0% 50%;
  }
}

/* --- btn-single-function ---
   Muted gray gradient at rest; animated gray flow on hover (Compile). */
.btn-single-function {
  background: var(--btn-sf-bkgd);
  color: var(--btn-sf-font);
  border: none;
  padding: .35rem .7rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
  white-space: nowrap;
}

.btn-single-function:hover {
  background-image: linear-gradient(115deg,
    var(--gray-dark) 0%, var(--gray-light) 18%, var(--gray-dark) 37%,
    var(--gray-light) 55%, var(--gray-dark) 72%, var(--gray-light) 88%, var(--gray-dark) 100%);
  background-size: 400% 100%;
  animation: dn-btn-flow 2.4s linear infinite;
  color: var(--btn-sf-font);
}

.dn-header-row .btn-single-function {
  flex: 0 0 auto;
}

@media (prefers-reduced-motion: reduce) {
  .btn-single-function:hover {
    animation: none;
    background-position: 0% 50%;
  }
}

/* --- btn-plain ---
   Transparent outline button for secondary header/chip actions. */
.btn-plain,
.dn-reset {
  background: var(--btn-plain-bkgd);
  border: 1px solid var(--btn-plain-border);
  color: var(--btn-plain-font);
  padding: .4rem .7rem;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.btn-plain:hover,
.dn-reset:hover {
  color: var(--btn-plain-hover-font);
  border-color: var(--btn-plain-hover-border);
}

.dn-header-row .btn-plain {
  flex: 0 0 auto;
}

/* ========== Cursor tips ==========
   Floating hints (cursor-tip.js). Triggers:
   - .dn-stats[data-tip]  header stat row (whole area, --above, 1s delay, lagged follow)
   - .dn-dates[data-tip]  card date row (same behavior)
   - .btn-multi-function[data-tip]  action buttons (same behavior)
   Tokens: --cursor-tip-* and --hover-label-font in :root. */
.dn-cursor-tip {
  position: fixed;
  z-index: 10000;
  pointer-events: none;
  background: var(--cursor-tip-bg);
  color: var(--cursor-tip-font);
  border: 1px solid var(--cursor-tip-border);
  padding: .35rem .55rem;
  font-weight: 400;
  line-height: 1.4;
  white-space: nowrap;
  border-radius: var(--cursor-tip-radius);
  opacity: 0;
  transition: opacity var(--cursor-tip-fade-ms) ease;
}

.dn-cursor-tip--visible {
  opacity: 1;
}

.dn-cursor-tip--above {
  font-size: var(--cursor-tip-mf-font);
  transform: translate(-50%, calc(-100% - 6px));
}

/* Statistics bar hover box (cursor-tip.js initStatsBoxes). Parked beside
   the cursor; clamped to the viewport. Leave uses a 50px pad around the
   box plus a 1s delay. */
.dn-stats-box {
  position: fixed;
  z-index: 10001;
  display: none;
  left: 0;
  top: 0;
  max-width: min(22rem, calc(100vw - 16px));
  padding: .55rem .7rem;
  background: var(--cursor-tip-bg);
  color: var(--cursor-tip-font);
  border: 1px solid var(--cursor-tip-border);
  border-radius: var(--cursor-tip-radius);
  font-size: var(--cursor-tip-mf-font);
  line-height: 1.45;
  white-space: normal;
  overflow-wrap: break-word;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity var(--cursor-tip-fade-ms) ease, transform var(--cursor-tip-fade-ms) ease;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--ink) 45%, transparent);
}
.dn-stats-box.is-ready { display: block; }
.dn-stats-box.is-in {
  opacity: 1;
  transform: translateY(0);
}
.dn-stats-box-title {
  font-weight: 700;
  color: var(--color01);
  margin-bottom: .2rem;
}
.dn-stats-box-explain {
  margin-bottom: .35rem;
}
.dn-stats-box-detail {
  color: var(--muted);
  font-size: 1rem;
}
.dn-stats-box-link {
  color: var(--color01);
  text-decoration: none;
  border-bottom: 1px dotted color-mix(in srgb, var(--color01) 55%, transparent);
  cursor: pointer;
}
.dn-stats-box-link:hover {
  color: var(--color02);
  border-bottom-color: var(--color02);
}

.dn-stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .2rem;
  justify-content: flex-end;
  font-variant-numeric: tabular-nums;
  cursor: default;
  color: var(--hover-label-font);
  font-size: .85rem;
  font-weight: 600;
  white-space: nowrap;
}

.dn-stat-sep {
  color: var(--muted);
  font-size: .85rem;
  font-weight: 600;
  user-select: none;
}

.dn-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--toast-bg);
  color: var(--toast-text);
  padding: .45rem 1rem;
  border-radius: .4rem;
  font-size: .85rem;
  pointer-events: none;
  z-index: 9999;
  opacity: 1;
  transition: opacity .4s;
}






/* --- global --- */


* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--color01);
  text-decoration: none;
  cursor: pointer;
}

a:hover {
  color: var(--color02);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--panel);
}

::-webkit-scrollbar-thumb {
  background: var(--color01);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color02);
}

/* --- header --- */
.dn-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: .7rem 1rem;
  flex-shrink: 0;
}

.dn-header-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 1400px;
  margin: 0 auto;
}

.dn-brand-h {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
}

.dn-brand {
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-block;
  background: linear-gradient(135deg, var(--color01), var(--color02));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.dn-brand:hover {
  opacity: 0.88;
}

.dn-search {
  flex: 1 1 auto;
  background: var(--panel2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: .5rem .8rem;
  border-radius: 8px;
  font-size: .95rem;
}

.dn-search:focus {
  outline: none;
  border-color: var(--color01);
}

.dn-toggle {
  color: var(--btn-plain-font);
  font-size: .85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: .35rem;
  white-space: nowrap;
  cursor: pointer;
}

.dn-chips-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  max-width: 1400px;
  margin: .6rem auto 0;
}

.dn-chips-row > .dn-chips {
  flex: 1 1 auto;
  margin: 0;
  max-width: none;
  min-width: 0;
}

.dn-chips-trail {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
  flex: 0 0 auto;
}

.dn-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  max-width: 1400px;
  margin: .6rem auto 0;
}

.dn-chip {
  background: transparent;
  border: 1px solid var(--border);
  border-left: 6px solid var(--tag, var(--border));
  color: var(--attr-chip-off);
  padding: .25rem .6rem .25rem .72rem;
  border-radius: 999px;
  font-size: 1.0rem;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transform: translateZ(0);
  transition: color .16s ease, background-color .16s ease, border-color .16s ease, transform .16s ease;
}

.dn-chip:hover {
  color: var(--text);
  transform: translateY(-1px);
}

.dn-chip.on {
  background: var(--tag, var(--color01));
  color: var(--tag-font, var(--attr-font-general));
  border-width: 1px;
  border-color: var(--tag, var(--color01));
  font-weight: 600;
}

.dn-chip.dn-chip-pop {
  animation: dn-chip-pop .4s ease-out;
}

.dn-chip.dn-chip-pop::after {
  content: "";
  position: absolute;
  inset: -45%;
  background: radial-gradient(circle, color-mix(in srgb, var(--tag, var(--color01)) 42%, transparent) 0 18%, transparent 52%);
  opacity: 0;
  pointer-events: none;
  animation: dn-chip-ripple .55s ease-out;
}

@keyframes dn-chip-pop {
  0% { transform: scale(.96); }
  52% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

@keyframes dn-chip-ripple {
  0% { opacity: .65; transform: scale(.35); }
  100% { opacity: 0; transform: scale(1); }
}

/* --- finder --- */
.dn-finder {
  max-width: 1400px;
  margin: .6rem auto 0;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 8px;
  max-height: 50vh;
  overflow: auto;
}

.dn-result {
  display: flex;
  gap: .6rem;
  align-items: baseline;
  padding: .4rem .7rem;
  border-bottom: 1px solid var(--border);
}

.dn-result:hover {
  background: var(--finder-row-hover-bg);
}

.dn-result-kind {
  font-size: .7rem;
  text-transform: uppercase;
  color: var(--color02);
  min-width: 46px;
}

.dn-result-name {
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}

/* Project rows sit above the item rows in the finder and are the Enter target.
   Cyan kind-label and a left rail distinguish them from the magenta item rows. */
.dn-result-project .dn-result-kind {
  color: var(--color01);
}
.dn-result-project {
  border-left: 3px solid transparent;
}
.dn-result-project.is-active {
  background: var(--finder-row-hover-bg);
  border-left-color: var(--color01);
}
.dn-result-hint {
  margin-left: .5rem;
  padding: 0 .3rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: .65rem;
  letter-spacing: .5px;
  color: var(--color01);
  text-transform: uppercase;
}

.dn-result-path {
  color: var(--muted);
  font-size: .8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- main + groups --- */
.dn-main {
  flex: 1 0 auto;
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem;
  width: 100%;
}

/* --- page sections (Goals / Projects / Statistics) --- */
.dn-section {
  margin-bottom: 2.5rem;
}
.dn-section-goals { --section-accent: var(--color02); }
.dn-section-projects,
.dn-section-stats { --section-accent: var(--color01); }
.dn-section-h {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: .3px;
  color: var(--color01);
  margin: 0 0 .75rem;
  padding-left: .75rem;
  border-left: 8px solid var(--section-accent, var(--color01));
}
.dn-section-sub {
  font-weight: 400;
  font-size: .95rem;
  color: var(--muted);
  margin-left: .35rem;
}
.dn-section-projects .dn-group:last-child {
  margin-bottom: 0;
}

/* ---------- Statistics band (inside .dn-section-stats, above the footer) ---------- */
.dn-stats-band {
  padding: .9rem 1.1rem 1.05rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
/* Panel header carrying a timestamp and an action, used by the recent-dirs
   panel. The other three panels keep the bare .dn-stats-panel-h heading. */
.dn-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .5rem;
}
.dn-panel-head .dn-stats-panel-h {
  margin-bottom: 0;
}
.dn-panel-tools {
  display: flex;
  align-items: center;
  gap: .45rem;
}
.dn-panel-stamp {
  font-size: .7rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.dn-panel-btn {
  padding: .12rem .5rem;
  font-size: .72rem;
  border-radius: 5px;
}

/* Placeholder panel for a feature that is specified but not built. Dashed so it
   reads as deliberately unfinished rather than as an empty state or an error. */
.dn-rank-placeholder {
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: .6rem .7rem;
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.5;
}
.dn-rank-placeholder p {
  margin: 0 0 .45rem;
}
.dn-rank-placeholder p:last-child {
  margin-bottom: 0;
}
.dn-rank-placeholder code {
  color: var(--text);
}

/* Rank lists. Reuse the stats band's panel and two-column body, so the 1x2
   layout and the panel chrome are defined in exactly one place. Rows are links
   into the grid via data-act="related", the same jump the related chips use. */
.dn-rank {
  display: flex;
  flex-direction: column;
}
.dn-rank-row {
  display: grid;
  grid-template-columns: 1.6rem 1fr auto;
  align-items: baseline;
  gap: .5rem;
  padding: .22rem .3rem;
  border-radius: 4px;
  text-decoration: none;
  color: inherit;
}
.dn-rank-row:hover {
  background: var(--finder-row-hover-bg);
}
.dn-rank-num {
  font-size: .72rem;
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.dn-rank-name {
  color: var(--text);
  font-size: .86rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dn-rank-row:hover .dn-rank-name {
  color: var(--color01);
}
.dn-rank-val {
  font-size: .78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Recent band: larger type than Rank below, and the directories list shows
   ten rows then scrolls (P05 still returns 20). Row height is explicit so
   the viewport is exactly ten rows after the font bump. */
#dn-recent-band {
  --dn-rank-row-h: 1.85rem;
}
#dn-recent-band .dn-rank-row {
  min-height: var(--dn-rank-row-h);
  box-sizing: border-box;
}
#dn-recent-band .dn-rank-name { font-size: 1rem; }
#dn-recent-band .dn-rank-num,
#dn-recent-band .dn-rank-val { font-size: .9rem; }
.dn-rank--scroll {
  max-height: calc(10 * var(--dn-rank-row-h, 1.85rem));
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Two columns like .dn-week-body, so the next stats panel sits beside this one
   instead of stretching a single chart across the full band. */
.dn-stats-band-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.5rem;
}
@media (max-width: 800px) {
  .dn-stats-band-body { grid-template-columns: 1fr; }
}
.dn-stats-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.dn-stats-panel-h {
  font-size: .78rem;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .5rem;
  flex: 0 0 auto;
}
/* Plot (rows + axis + caption) sits on the shared baseline so the shorter
   status chart's extra height becomes a gap under its title. */
.dn-stats-plot {
  margin-top: auto;
}
/* Each row is its own grid on the same template, so the label column, the bar
   track, and the count column stay aligned across rows and the axis. */
.dn-prchart-row {
  display: grid;
  grid-template-columns: 1.6rem 1fr 1.9rem;
  align-items: center;
  gap: .5rem;
  height: 1.15rem;
}
.dn-prchart-label {
  font-size: 1rem;
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.dn-prchart-track {
  position: relative;
  height: 100%;
  border-left: 1px solid var(--border);
}
.dn-prchart-bar {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: .62rem;
  width: var(--w, 0%);
  border-radius: 0 3px 3px 0;
  /* Priority drives the hue: 10 lands on --color02, 0 on --color01. */
  background: color-mix(in srgb, var(--color02) calc(var(--p, 0) * 10%), var(--color01));
  transition: width .18s ease;
}
.dn-prchart-count {
  font-size: .74rem;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.dn-prchart-count.is-zero { color: var(--border); }
.dn-prchart-row:hover .dn-prchart-label,
.dn-prchart-row:hover .dn-prchart-count { color: var(--color01); }
.dn-prchart-axis {
  height: 1.1rem;
  align-items: start;
}
.dn-prchart-axis .dn-prchart-track {
  border-left: none;
  border-top: 1px solid var(--border);
}
.dn-prchart-tick {
  position: absolute;
  top: .15rem;
  left: var(--t, 0%);
  transform: translateX(-50%);
  font-size: .68rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.dn-prchart-axis-caption {
  margin-top: .15rem;
  font-size: .68rem;
  letter-spacing: .4px;
  color: var(--muted);
  text-align: center;
}
/* Status chart: same bars/axis as priority, wider label column for names. */
.dn-stchart .dn-prchart-row {
  grid-template-columns: 7.6rem 1fr 1.9rem;
}
.dn-stchart .dn-prchart-label {
  font-variant-numeric: normal;
  text-align: left;
  white-space: nowrap;
}

.dn-week-band {
  padding: .9rem 1.1rem 1.05rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
/* Two columns: Active on the left, and a right column holding Secondary
   above Quick wins. The stack is a flex child so the two lists sit in one
   grid cell and an empty Quick wins collapses without leaving a gap. */
.dn-week-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.5rem;
}
.dn-week-col-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}
@media (max-width: 800px) {
  .dn-week-body { grid-template-columns: 1fr; }
}
.dn-week-col-h {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--color02);
  margin-bottom: .4rem;
}
.dn-week-col ul {
  margin: 0;
  padding-left: 1.1rem;
}
.dn-week-item {
  margin: .28rem 0;
  line-height: 1.45;
  font-size: .92rem;
  color: var(--text, inherit);
}
.dn-week-link,
.dn-week-slug {
  color: var(--color01);
  text-decoration: none;
  border-bottom: 1px dotted color-mix(in srgb, var(--color01) 55%, transparent);
  cursor: pointer;
}
.dn-week-link:hover,
.dn-week-slug:hover {
  color: var(--color02);
  border-bottom-color: var(--color02);
}
.dn-week-extra {
  font-size: .85rem;
  opacity: .85;
}

.dn-group {
  margin-bottom: 2rem;
}

.dn-group-h {
  font-size: 1.15rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color01);
  border-bottom: 2px solid var(--tag, var(--color02));
  padding-bottom: .35rem;
  margin: 0 0 1.1rem;
}

.dn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

/* --- card --- */
.dn-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .9rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  position: relative;
  overflow: hidden;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.dn-card:hover {
  border-color: transparent;
  box-shadow: var(--card-hover-shadow);
  transform: translateY(-2px);
}

.dn-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(115deg, var(--color01), var(--color02), var(--color01));
  background-size: 240% 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
  mask: linear-gradient(var(--ink) 0 0) content-box, linear-gradient(var(--ink) 0 0);
  mask-composite: exclude;
  -webkit-mask: linear-gradient(var(--ink) 0 0) content-box, linear-gradient(var(--ink) 0 0);
  -webkit-mask-composite: xor;
}

.dn-card:hover::before {
  opacity: 1;
  animation: dn-card-edge-flow 1.35s linear infinite;
}

@keyframes dn-card-edge-flow {
  0% { background-position: 0% 50%; }
  100% { background-position: 240% 50%; }
}

.dn-card.dn-dim {
  opacity: .45;
}

.dn-card.dn-dim:hover {
  opacity: 1;
}

.dn-card.dn-flash {
  border-color: var(--color02);
  box-shadow: 0 0 0 2px var(--color02);
}

.dn-card.dn-filter-enter {
  animation: dn-filter-enter .22s ease-out both;
}

@keyframes dn-filter-enter {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .dn-chip,
  .dn-chip:hover,
  .dn-chip.dn-chip-pop,
  .dn-chip.dn-chip-pop::after,
  .dn-card:hover,
  .dn-card:hover::before,
  .dn-card.dn-filter-enter {
    animation: none;
    transform: none;
    transition: none;
  }
}

.dn-name {
  font-size: 1.2rem;
  color: var(--text);
}

.dn-meta {
  font-size: 1.0rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  align-items: center;
}

.dn-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  align-items: center;
}

.dn-tag {
  font-size:      1rem;
  padding:        .05rem .4rem;
  border-radius:  4px;
  color:          var(--tag-font, var(--attr-font-general));
  background:     var(--tag, var(--tag-fallback));
  font-weight:    600;
}

.dn-pri {
  color: var(--color01);
  font-weight: 700;
}

.dn-status {
  text-transform: uppercase;
  font-size: .8rem;
  letter-spacing: .5px;
}

.dn-dates {
  font-size: .8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  cursor: default;
}

.dn-dates .dn-stat-sep {
  font-size: .8rem;
}

.dn-date-last {
  color: var(--text);
  font-weight: 600;
}

.dn-actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.dn-sec {
  border-top: 1px solid var(--border);
  padding-top: .4rem;
}

.dn-sec-h {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: .25rem;
}

.dn-item {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: .83rem;
  padding: .05rem 0;
}

.dn-chk {
  accent-color: var(--color01);
  flex: none;
}

.dn-link {
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dn-empty {
  font-size: .78rem;
  color: var(--empty-text);
  font-style: italic;
}

.dn-related {
  font-size: .78rem;
  color: var(--muted);
}

.dn-parked .dn-group-h {
  color: var(--muted);
  border-bottom-color: var(--border);
}

/* --- about page (rendered from README.md by the Python generator) --- */
.dn-about-page {
  max-width: 820px;
  margin: 1.5rem auto 3rem;
  padding: 1.5rem 2rem;
  color: var(--text);
  line-height: 1.65;
}

.dn-about-page h1,
.dn-about-page h2,
.dn-about-page h3,
.dn-about-page h4 {
  color: var(--color01);
  letter-spacing: .3px;
  margin: 1.6rem 0 .7rem;
}

.dn-about-page h1 { font-size: 1.75rem; margin-top: 0; }
.dn-about-page h2 { font-size: 1.3rem; border-bottom: 1px solid var(--border); padding-bottom: .3rem; }
.dn-about-page h3 { font-size: 1.05rem; }
.dn-about-page h4 { font-size: .95rem; color: var(--color02); }

.dn-about-page p {
  margin: .7rem 0;
}

.dn-about-page ul,
.dn-about-page ol {
  margin: .7rem 0;
  padding-left: 1.6rem;
}

.dn-about-page li {
  margin: .3rem 0;
}

.dn-about-page a {
  color: var(--color01);
}

.dn-about-page a:hover {
  color: var(--color02);
}

.dn-about-page code {
  background: var(--panel2);
  padding: .1rem .35rem;
  border-radius: 3px;
  font-size: .9em;
  font-family: 'Consolas', 'Monaco', monospace;
  color: var(--text);
}

.dn-about-page pre {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .8rem 1rem;
  overflow: auto;
  margin: .8rem 0;
}

.dn-about-page pre code {
  background: transparent;
  padding: 0;
  border-radius: 0;
  font-size: .85rem;
  line-height: 1.5;
}

.dn-about-page blockquote {
  border-left: 3px solid var(--color02);
  margin: .8rem 0;
  padding: .2rem 1rem;
  color: var(--muted);
  background: var(--blockquote-accent-bg);
  border-radius: 4px;
}

.dn-about-page hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

.dn-about-page img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  display: block;
  margin: 1rem 0;
}

.dn-about-page .dn-table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0;
  font-size: .9rem;
}

.dn-about-page .dn-table th,
.dn-about-page .dn-table td {
  border: 1px solid var(--border);
  padding: .4rem .7rem;
  text-align: left;
}

.dn-about-page .dn-table th {
  background: var(--panel2);
  color: var(--color01);
}

/* --- footer --- */
.dn-footer {
  flex-shrink: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  margin-top: auto;
  padding: 1.5rem 2rem 2rem;
  color: var(--muted);
  font-size: .85rem;
  border-top: 1px solid var(--border);
  background: var(--panel);
  box-sizing: border-box;
}

.dn-footer-meta,
.dn-footer-legal {
  margin: 0;
  text-align: center;
  line-height: 1.5;
}

.dn-footer-legal {
  margin-top: 1rem;
  font-size: .8rem;
}

.dn-footer-instructions {
  margin: 1rem auto 0;
  padding-left: 1.5rem;
  max-width: 52rem;
  text-align: left;
  line-height: 1.6;
  font-size: .9rem;
}

.dn-footer-instructions li + li {
  margin-top: .5rem;
}

.dn-footer code {
  font-size: .85em;
  padding: .1em .35em;
  border-radius: 3px;
  background: var(--bg);
  border: 1px solid var(--border);
}

@media (max-width: 520px) {
  .dn-header-row {
    flex-wrap: wrap;
  }

  .dn-grid {
    grid-template-columns: 1fr;
  }
}