/* Knowledge Plaza: compact, scan-first daily digest */
.knowledge-page {
  isolation: isolate;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 88% -6%, color-mix(in srgb, #75988f 13%, transparent), transparent 28%),
    radial-gradient(circle at 7% 34%, color-mix(in srgb, #a68b67 6%, transparent), transparent 25%),
    var(--surface);
}

.knowledge-page::before {
  position: fixed;
  z-index: -1;
  top: -140px;
  right: -120px;
  width: 440px;
  height: 440px;
  border: 1px solid color-mix(in srgb, #75988f 13%, transparent);
  border-radius: 50%;
  box-shadow: 0 0 0 30px color-mix(in srgb, #75988f 3%, transparent), 0 0 0 62px color-mix(in srgb, #75988f 2%, transparent);
  content: "";
  opacity: .72;
  pointer-events: none;
  animation: knowledge-orbit 18s ease-in-out infinite alternate;
}

.knowledge-page-inner { position: relative; z-index: 1; }

.knowledge-top {
  position: relative;
  overflow: hidden;
  margin-bottom: 22px;
  padding: 20px 21px 19px;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  box-shadow: 0 10px 28px rgba(25, 31, 37, .035);
  backdrop-filter: blur(12px);
}

.knowledge-top::after {
  position: absolute;
  top: -55px;
  right: 10%;
  width: 220px;
  height: 120px;
  border-radius: 50%;
  background: color-mix(in srgb, #75988f 9%, transparent);
  content: "";
  filter: blur(24px);
  opacity: .54;
  pointer-events: none;
}

.knowledge-top > * { position: relative; z-index: 1; }

.knowledge-search {
  position: relative;
  z-index: 2;
  box-shadow: 0 5px 18px rgba(25, 31, 37, .035);
  transition: border-color .2s, box-shadow .2s, transform .2s;
}

.knowledge-search:focus-within {
  border-color: color-mix(in srgb, #75988f 46%, var(--border));
  box-shadow: 0 8px 22px color-mix(in srgb, #75988f 10%, transparent);
  transform: translateY(-1px);
}

.knowledge-daily {
  margin: 0 0 26px;
  margin: 0 0 26px;
  padding: 20px 22px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 7px 24px rgba(25, 31, 37, .045);
  animation: knowledge-rise .42s ease both;
}

.knowledge-daily-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.knowledge-daily-eyebrow {
  display: block;
  margin-bottom: 6px;
  color: var(--text-tertiary);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .16em;
}

.knowledge-daily-head strong {
  color: var(--text);
  font-size: 16px;
  font-weight: 650;
}

.knowledge-daily-head > div:first-child > span:not(.knowledge-daily-eyebrow) {
  margin-left: 9px;
  color: var(--text-tertiary);
  font-size: 10px;
}

.knowledge-daily-head h2 {
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--text);
  font-size: clamp(18px, 2vw, 23px);
  font-weight: 620;
  letter-spacing: -.025em;
  line-height: 1.25;
}

.knowledge-daily-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
}

.knowledge-daily-head button {
  min-height: 30px;
  padding: 0 10px;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--text-secondary);
  font-size: 10px;
  transition: border-color .18s, color .18s, background .18s;
}

.knowledge-daily-head button:hover,
.knowledge-daily-head button:focus-visible {
  border-color: color-mix(in srgb, var(--text) 28%, var(--border));
  background: var(--surface);
  color: var(--text);
  outline: none;
}

.knowledge-daily-intro {
  max-width: 760px;
  margin: 10px 0 17px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.7;
}

.knowledge-daily-projects { display: none; }

.knowledge-daily-board {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 0;
}

.knowledge-daily-card {
  min-height: 0;
  padding: 14px 15px 13px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--surface-soft);
  transition: border-color .18s, background .18s, transform .18s;
  animation: knowledge-rise .38s ease both;
}

.knowledge-daily-card:nth-child(2) { animation-delay: 35ms; }
.knowledge-daily-card:nth-child(3) { animation-delay: 70ms; }
.knowledge-daily-card:nth-child(4) { animation-delay: 105ms; }
.knowledge-daily-card:nth-child(5) { animation-delay: 140ms; }
.knowledge-daily-card:nth-child(6) { animation-delay: 175ms; }
.knowledge-daily-card:nth-child(7) { animation-delay: 210ms; }
.knowledge-daily-card:nth-child(8) { animation-delay: 245ms; }

.knowledge-daily-card:hover {
  border-color: color-mix(in srgb, var(--text) 23%, var(--border));
  background: var(--surface);
  transform: translateY(-1px);
}

.knowledge-daily-card-top {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.knowledge-daily-index {
  flex: 0 0 22px;
  padding-top: 1px;
  color: var(--text-tertiary);
  font: 650 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.knowledge-daily-title {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 8px;
}

.knowledge-daily-title a {
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}

.knowledge-daily-title a:hover { text-decoration: underline; text-underline-offset: 3px; }
.knowledge-daily-title strong { font-size: 14px; font-weight: 650; line-height: 1.35; }
.knowledge-daily-stars { color: var(--text-tertiary); font-size: 10px; white-space: nowrap; }

.knowledge-daily-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 9px;
  margin-top: 9px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.65;
}

.knowledge-daily-row b {
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.9;
}

.knowledge-daily-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 11px 0 0 67px;
}

.knowledge-daily-stack {
  max-width: 70%;
  overflow: hidden;
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-tertiary);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knowledge-daily-open {
  color: var(--text-tertiary);
  font-size: 10px;
  text-decoration: none;
  white-space: nowrap;
}

.knowledge-daily-open:hover { color: var(--text); }
.knowledge-daily-empty { padding: 18px; color: var(--text-tertiary); font-size: 12px; text-align: center; }
.knowledge-daily-loading { display: flex; min-height: 72px; align-items: center; justify-content: center; gap: 9px; color: var(--text-tertiary); font-size: 11px; }
.knowledge-daily-spinner { width: 13px; height: 13px; border: 1.5px solid var(--border); border-top-color: #71968b; border-radius: 50%; animation: knowledge-spin .8s linear infinite; }

.knowledge-daily-body {
  max-height: 420px;
  margin-top: 14px;
  overflow: auto;
  padding: 15px 16px;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.75;
}

.knowledge-daily-body h1,
.knowledge-daily-body h2,
.knowledge-daily-body h3 { margin: 0 0 8px; color: var(--text); font-size: 14px; }
.knowledge-daily-body p { margin: 0 0 9px; }
.knowledge-daily-body pre { overflow: auto; padding: 10px; border-radius: 6px; background: #20272d; color: #e8f0ee; }
.knowledge-daily.loading { opacity: .62; }
.knowledge-daily-error { color: var(--danger); font-size: 11px; }

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

@keyframes knowledge-orbit {
  from { transform: translate3d(0, 0, 0) rotate(0deg); }
  to { transform: translate3d(-14px, 20px, 0) rotate(8deg); }
}
@keyframes knowledge-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .knowledge-page::before,
  .knowledge-daily,
  .knowledge-daily-card { animation: none; }
  .knowledge-daily-spinner { animation: none; }
  .knowledge-search { transition: none; }
}

@media (max-width: 620px) {
  .knowledge-daily { padding: 16px 13px 14px; }
  .knowledge-daily-head { flex-direction: column; gap: 12px; }
  .knowledge-daily-actions { width: 100%; }
  .knowledge-daily-actions button { flex: 1; }
  .knowledge-daily-title { flex-wrap: wrap; gap: 3px 8px; }
  .knowledge-daily-bottom { margin-left: 67px; }
}
