/* Home dashboard styles. Scoped to .db-* so article pages keep their layout. */

.db-root {
  --db-surface: color-mix(in oklab, var(--bg) 94%, var(--fg) 6%);
  --db-surface-strong: color-mix(in oklab, var(--bg) 88%, var(--fg) 12%);
  --db-line: color-mix(in oklab, var(--border) 78%, var(--fg) 22%);
  --db-text-soft: color-mix(in oklab, var(--fg) 68%, var(--bg) 32%);
  --db-blue: #2f6fed;
  --db-green: #15835b;
  --db-amber: #9d6400;
  --db-red: #b64c45;
  width: 100%;
  padding: 1.5rem 0 4rem;
  box-sizing: border-box;
}

.db-root *,
.db-root *::before,
.db-root *::after {
  box-sizing: border-box;
}

.db-kicker {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-transform: uppercase;
}

.db-hero {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  margin-bottom: 1rem;
  background: var(--db-surface);
  border: 1px solid var(--db-line);
  border-radius: 8px;
}

.db-hero__brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.db-hero__logo {
  width: clamp(64px, 10vw, 96px);
  height: clamp(64px, 10vw, 96px);
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--db-line);
  background: var(--bg);
  flex: 0 0 auto;
}

.db-hero__title {
  margin: 0;
  color: var(--fg);
  font-size: clamp(2.4rem, 7vw, 5rem);
  font-weight: 900;
  line-height: 0.95;
}

.db-hero__sub {
  max-width: 58ch;
  margin: 0.55rem 0 0;
  color: var(--db-text-soft);
  font-size: 0.98rem;
  line-height: 1.55;
}

.db-now {
  display: grid;
  align-content: center;
  min-width: min(100%, 230px);
  padding: 1rem;
  background: color-mix(in oklab, var(--bg) 84%, var(--fg) 16%);
  border: 1px solid var(--db-line);
  border-radius: 8px;
}

.db-now__label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.db-now__clock {
  display: block;
  margin: 0.2rem 0 0.85rem;
  color: var(--fg);
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  line-height: 1;
}

.db-command {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
  gap: 1rem;
  align-items: center;
  padding: 1rem 0;
}

.db-command__title {
  margin: 0;
  color: var(--fg);
  font-size: clamp(1.2rem, 3vw, 1.85rem);
  line-height: 1.15;
}

.db-command__search {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 48px;
  padding: 0 0.85rem;
  background: var(--db-surface);
  border: 1px solid var(--db-line);
  border-radius: 8px;
}

.db-command__search:focus-within {
  border-color: var(--db-blue);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--db-blue) 18%, transparent);
}

.db-search-icon {
  color: var(--muted);
  font-size: 1.1rem;
}

.db-command__search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--fg);
  font: inherit;
}

.db-command__search input::placeholder {
  color: var(--muted);
}

.db-quicknav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0 0 1.25rem;
}

.db-qn-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "icon label"
    "icon meta";
  column-gap: 0.7rem;
  align-items: center;
  min-height: 76px;
  padding: 0.9rem;
  color: var(--fg);
  text-decoration: none;
  background: var(--db-surface);
  border: 1px solid var(--db-line);
  border-left: 4px solid var(--db-blue);
  border-radius: 8px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.db-qn-item:hover,
.db-qn-item:focus-visible {
  color: var(--fg);
  text-decoration: none;
  border-color: color-mix(in oklab, var(--db-blue) 55%, var(--db-line));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.db-qn-item.is-hidden {
  display: none;
}

.db-qn-item--writing,
.db-qn-item--notes { border-left-color: var(--db-blue); }
.db-qn-item--career,
.db-qn-item--wird { border-left-color: var(--db-green); }
.db-qn-item--lima,
.db-qn-item--status { border-left-color: var(--db-amber); }
.db-qn-item--system,
.db-qn-item--zone { border-left-color: var(--db-red); }

.db-qn-icon {
  grid-area: icon;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--fg);
  background: color-mix(in oklab, var(--fg) 8%, transparent);
  border: 1px solid var(--db-line);
  border-radius: 8px;
  font-size: 1.05rem;
  line-height: 1;
}

.db-qn-label {
  grid-area: label;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 1rem;
  font-weight: 850;
}

.db-qn-meta {
  grid-area: meta;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.db-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

.db-panel {
  grid-column: span 4;
  min-width: 0;
  padding: 1rem;
  background: var(--db-surface);
  border: 1px solid var(--db-line);
  border-radius: 8px;
}

.db-panel--wide {
  grid-column: span 8;
}

.db-panel--stats,
.db-panel--focus {
  grid-column: span 4;
}

.db-panel--about {
  grid-column: span 8;
}

.db-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.db-panel__title {
  margin: 0;
  color: var(--fg);
  font-size: 1.05rem;
  line-height: 1.25;
}

.db-panel__more {
  flex: 0 0 auto;
  color: var(--link);
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
}

.db-panel__more:hover {
  text-decoration: underline;
}

.db-panel__desc {
  margin: 0;
  color: var(--db-text-soft);
  font-size: 0.92rem;
  line-height: 1.6;
}

.db-feed {
  display: grid;
  gap: 0.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.db-feed__item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.6rem;
  align-items: baseline;
  min-width: 0;
  padding: 0.62rem 0;
  margin: 0;
  border-top: 1px solid color-mix(in oklab, var(--db-line) 70%, transparent);
  line-height: 1.35;
}

.db-feed__item::before {
  content: none !important;
}

.db-feed__dot {
  width: 0.48rem;
  height: 0.48rem;
  margin-top: 0.25rem;
  background: var(--db-green);
  border-radius: 999px;
}

.db-feed__item a {
  min-width: 0;
  color: var(--fg);
  font-size: 0.92rem;
  font-weight: 700;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.db-feed__item a:hover {
  color: var(--link);
  text-decoration: underline;
}

.db-feed__meta {
  color: var(--muted);
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  white-space: nowrap;
}

.db-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.db-stat {
  min-height: 92px;
  padding: 0.8rem;
  background: color-mix(in oklab, var(--bg) 82%, var(--fg) 18%);
  border: 1px solid var(--db-line);
  border-radius: 8px;
}

.db-stat__num {
  display: block;
  color: var(--fg);
  font-size: clamp(1.55rem, 4vw, 2.1rem);
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  line-height: 1;
}

.db-stat__label {
  display: block;
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.db-year-bar {
  position: relative;
  height: 8px;
  background: color-mix(in oklab, var(--border) 75%, var(--bg) 25%);
  border-radius: 999px;
}

.db-year-bar__fill {
  width: 0%;
  min-width: 6px;
  height: 100%;
  background: var(--db-green);
  border-radius: 999px;
  transition: width 0.45s ease;
}

.db-year-bar__label {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.35rem);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
}

.db-task-list,
.db-link-stack {
  display: grid;
  gap: 0.55rem;
}

.db-task-list a,
.db-link-stack a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 44px;
  padding: 0.65rem 0.75rem;
  color: var(--fg);
  background: color-mix(in oklab, var(--bg) 85%, var(--fg) 15%);
  border: 1px solid var(--db-line);
  border-radius: 8px;
  font-weight: 750;
  text-decoration: none;
}

.db-task-list a:hover,
.db-link-stack a:hover {
  color: var(--link);
  text-decoration: none;
  border-color: color-mix(in oklab, var(--link) 45%, var(--db-line));
}

.db-task-list strong {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.db-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.9rem;
}

.db-tag {
  padding: 0.28rem 0.62rem;
  color: var(--chip-fg);
  background: var(--chip-bg);
  border: 1px solid var(--db-line);
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 750;
}

:root[data-theme="dark"] .db-root {
  --db-surface: color-mix(in oklab, var(--bg) 82%, var(--fg) 18%);
  --db-surface-strong: color-mix(in oklab, var(--bg) 72%, var(--fg) 28%);
  --db-line: color-mix(in oklab, var(--border) 80%, var(--fg) 20%);
  --db-blue: #78a6ff;
  --db-green: #63c995;
  --db-amber: #d7a451;
  --db-red: #e28982;
}

@media (max-width: 980px) {
  .db-quicknav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .db-panel,
  .db-panel--wide,
  .db-panel--stats,
  .db-panel--focus,
  .db-panel--about {
    grid-column: span 6;
  }
}

@media (max-width: 720px) {
  .db-root {
    padding-top: 0.75rem;
  }

  .db-hero,
  .db-command {
    grid-template-columns: 1fr;
  }

  .db-hero {
    flex-direction: column;
  }

  .db-hero__brand {
    align-items: flex-start;
  }

  .db-now {
    min-width: 0;
  }

  .db-quicknav,
  .db-grid {
    grid-template-columns: 1fr;
  }

  .db-panel,
  .db-panel--wide,
  .db-panel--stats,
  .db-panel--focus,
  .db-panel--about {
    grid-column: span 1;
  }

  .db-feed__item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .db-feed__meta {
    grid-column: 2;
  }
}

@media (max-width: 460px) {
  .db-hero__brand {
    display: grid;
  }

  .db-hero__logo {
    width: 58px;
    height: 58px;
  }

  .db-qn-item {
    min-height: 68px;
  }

  .db-stats-grid {
    grid-template-columns: 1fr;
  }
}
