:root {
  --bg: #f6f2e9;
  --surface: #fffdf8;
  --surface-soft: #fbf8f2;
  --ink: #17202b;
  --muted: #6c737d;
  --faint: #9599a0;
  --navy: #10263f;
  --navy-soft: #1a3a55;
  --red: #b23a31;
  --red-deep: #8f2a24;
  --red-soft: #f6e7e3;
  --gold: #a9783d;
  --green: #487b68;
  --line: rgba(23, 32, 43, 0.12);
  --line-strong: rgba(23, 32, 43, 0.2);
  --shadow: 0 18px 50px rgba(16, 38, 63, 0.1);
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", system-ui, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% -8%, rgba(178, 58, 49, 0.045), transparent 28%),
    radial-gradient(circle at 96% 4%, rgba(16, 38, 63, 0.045), transparent 30%),
    var(--bg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.drawer-open {
  overflow: hidden;
}

::selection {
  color: var(--surface);
  background: var(--red);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.page-grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.4;
  background-image: radial-gradient(rgba(23, 32, 43, 0.07) 0.5px, transparent 0.6px);
  background-size: 4px 4px;
}

.topbar,
.shell {
  position: relative;
  z-index: 1;
}

.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(72, 123, 104, 0.45);
  animation: live-pulse 2.4s infinite;
}

@keyframes live-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(72, 123, 104, 0.35);
  }
  70% {
    box-shadow: 0 0 0 5px rgba(72, 123, 104, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(72, 123, 104, 0);
  }
}

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 242, 233, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 38px;
  width: 100%;
  max-width: 1380px;
  min-height: 72px;
  margin: 0 auto;
  padding: 0 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  color: #fff8ec;
  background: linear-gradient(145deg, #bf4539, #992e27);
  border-radius: 3px;
  box-shadow: 0 5px 12px rgba(143, 42, 36, 0.16);
  transform: rotate(-1.5deg);
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(255, 248, 236, 0.3);
}

.brand-mark span {
  position: relative;
  z-index: 1;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
}

.brand-word {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-word strong {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.2;
}

.brand-word small {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.14em;
  white-space: nowrap;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 72px;
}

.main-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 100%;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.03em;
  transition: color 0.2s var(--ease);
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 17px;
  width: 0;
  height: 2px;
  background: var(--red);
  transform: translateX(-50%);
  transition: width 0.24s var(--ease);
}

.main-nav a:hover,
.main-nav a.is-active {
  color: var(--ink);
}

.main-nav a.is-active::after {
  width: 16px;
}

.nav-count {
  display: inline-grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  color: var(--surface);
  background: var(--red);
  border-radius: 20px;
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 300px;
  height: 39px;
  margin-left: auto;
  padding: 0 10px 0 13px;
  color: var(--muted);
  background: rgba(255, 253, 248, 0.66);
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: text;
  transition:
    border-color 0.2s var(--ease),
    background 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}

.search-field:focus-within {
  background: var(--surface);
  border-color: rgba(178, 58, 49, 0.45);
  box-shadow: 0 0 0 3px rgba(178, 58, 49, 0.06);
}

.search-field .icon {
  width: 15px;
  height: 15px;
}

.search-field input {
  width: 100%;
  min-width: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 12px;
}

.search-field input::placeholder {
  color: var(--faint);
}

.search-field kbd {
  flex: 0 0 auto;
  padding: 2px 5px;
  color: var(--faint);
  background: rgba(23, 32, 43, 0.04);
  border: 1px solid rgba(23, 32, 43, 0.07);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1.4;
}

/* ---------- shell / sidebar ---------- */

.shell {
  display: grid;
  grid-template-columns: 218px minmax(0, 1fr);
  gap: 42px;
  width: 100%;
  max-width: 1380px;
  margin: 0 auto;
  padding: 34px 28px 84px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 124px);
  padding: 8px 24px 18px 0;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  scrollbar-width: thin;
  scrollbar-color: rgba(23, 32, 43, 0.16) transparent;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
}

.sidebar-reset {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  color: var(--faint);
  background: transparent;
  border: 0;
  font-family: var(--sans);
  font-size: 9.5px;
  cursor: pointer;
  transition: color 0.2s var(--ease);
}

.sidebar-reset:hover {
  color: var(--red);
}

.sidebar-reset .icon {
  width: 12px;
  height: 12px;
}

.sidebar-group {
  margin-top: 23px;
}

.sidebar-label {
  margin: 0 0 8px 9px;
  color: var(--faint);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.side-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.side-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 33px;
  padding: 6px 9px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  transition:
    color 0.18s var(--ease),
    background 0.18s var(--ease);
}

.side-item:hover {
  color: var(--ink);
  background: rgba(255, 253, 248, 0.75);
}

.side-item.is-active {
  color: #fffaf0;
  background: var(--navy);
}

.side-item .cat-dot {
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  background: var(--cat);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--cat-soft);
}

.side-item .count {
  margin-left: auto;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 8px;
}

.side-item.is-active .count {
  color: rgba(255, 250, 240, 0.54);
}

.sidebar-divider {
  height: 1px;
  margin: 22px 9px 0;
  background: var(--line);
}

.sidebar-foot {
  margin-top: 30px;
  padding: 15px 9px 0;
  border-top: 1px dashed var(--line-strong);
}

.sidebar-live {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--green);
  font-size: 9.5px;
}

.sidebar-foot p {
  margin: 6px 0 0;
  color: var(--faint);
  font-size: 8.5px;
  line-height: 1.6;
}

.sidebar-foot .sidebar-note {
  margin-top: 12px;
  color: rgba(23, 32, 43, 0.33);
}

/* ---------- content / header ---------- */

.content {
  min-width: 0;
}

.view {
  animation: view-enter 0.35s var(--ease) both;
}

@keyframes view-enter {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
}

.content-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.section-kicker {
  margin: 0 0 7px;
  color: var(--red);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.16em;
  line-height: 1.5;
}

.content-head h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 39px;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.2;
}

.content-sub {
  margin: 8px 0 0;
  color: var(--faint);
  font-size: 10.5px;
  line-height: 1.6;
}

.sub-dot {
  margin: 0 4px;
  color: rgba(23, 32, 43, 0.25);
}

.head-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition:
    color 0.2s var(--ease),
    background 0.2s var(--ease),
    border-color 0.2s var(--ease),
    transform 0.2s var(--ease);
}

.button:hover {
  transform: translateY(-1px);
}

.button .icon {
  width: 14px;
  height: 14px;
}

.button-primary {
  color: #fff8ec;
  background: var(--red);
  border-color: var(--red);
}

.button-primary:hover {
  background: #c04438;
  border-color: #c04438;
}

.button-outline {
  color: var(--ink);
  background: rgba(255, 253, 248, 0.55);
  border-color: var(--line-strong);
}

.button-outline:hover {
  background: var(--surface);
  border-color: var(--ink);
}

.button:disabled {
  cursor: wait;
  opacity: 0.55;
  transform: none;
}

.button.is-spinning .icon {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.refresh-button {
  min-height: 36px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 10.5px;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  color: var(--faint);
  background: transparent;
  border: 0;
  font-size: 10px;
  cursor: pointer;
  transition: color 0.2s var(--ease);
}

.text-button:hover {
  color: var(--ink);
}

.text-button.danger:hover {
  color: var(--red-deep);
}

/* ---------- filter bar ---------- */

.filter-bar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 11px 0;
  margin-bottom: 2px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.filter-menu {
  position: relative;
}

.filter-menu summary {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 35px;
  padding: 0 11px;
  color: var(--faint);
  background: rgba(255, 253, 248, 0.56);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 10.5px;
  list-style: none;
  cursor: pointer;
  user-select: none;
  transition:
    color 0.2s var(--ease),
    border-color 0.2s var(--ease),
    background 0.2s var(--ease);
}

.filter-menu summary::-webkit-details-marker {
  display: none;
}

.filter-menu summary:hover,
.filter-menu[open] summary {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line-strong);
}

.filter-menu summary b {
  color: var(--ink);
  font-weight: 600;
}

.filter-menu summary .icon {
  width: 11px;
  height: 11px;
  color: var(--faint);
  transform: rotate(90deg);
  transition: transform 0.2s var(--ease);
}

.filter-menu[open] summary .icon {
  transform: rotate(-90deg);
}

.filter-menu.is-active summary {
  border-color: rgba(178, 58, 49, 0.32);
}

.filter-menu.is-active summary b {
  color: var(--red);
}

.filter-options {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 40;
  min-width: 166px;
  max-width: calc(100vw - 30px);
  padding: 5px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: var(--shadow);
}

#category-menu .filter-options {
  right: 0;
  left: auto;
}

.filter-options button {
  display: block;
  width: 100%;
  min-height: 32px;
  padding: 5px 9px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 5px;
  font-size: 11px;
  text-align: left;
  cursor: pointer;
}

.filter-options button:hover {
  color: var(--ink);
  background: rgba(23, 32, 43, 0.04);
}

.filter-options button.is-selected {
  color: #fffaf0;
  background: var(--navy);
}

.sort-group {
  display: flex;
  align-items: center;
  gap: 1px;
  height: 35px;
  margin-left: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.sort-group > span {
  padding: 0 6px;
  color: var(--faint);
  font-size: 8.5px;
  letter-spacing: 0.05em;
}

.sort-group button {
  height: 27px;
  padding: 0 9px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 5px;
  font-size: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition:
    color 0.2s var(--ease),
    background 0.2s var(--ease);
}

.sort-group button:hover {
  color: var(--ink);
}

.sort-group button.is-active {
  color: #fffaf0;
  background: var(--navy);
}

.result-meta {
  margin-left: auto;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.active-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 12px 0 1px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 7px 0 9px;
  color: var(--muted);
  background: rgba(255, 253, 248, 0.7);
  border: 1px solid var(--line);
  border-radius: 20px;
  font-size: 9.5px;
  cursor: pointer;
}

.filter-chip:hover {
  color: var(--red);
  border-color: rgba(178, 58, 49, 0.3);
}

.filter-chip .icon {
  width: 10px;
  height: 10px;
  opacity: 0.55;
}

.filter-chip.clear-all {
  color: var(--faint);
  background: transparent;
  border-color: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- feed cards ---------- */

.feed-list {
  border-top: 1px solid var(--line);
}

.feed-card {
  position: relative;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 20px;
  padding: 21px 9px 21px 0;
  border-bottom: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  animation: card-enter 0.45s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 32ms);
  transition:
    background 0.2s var(--ease),
    padding 0.2s var(--ease),
    opacity 0.2s var(--ease);
}

.feed-card:hover {
  padding-right: 9px;
  padding-left: 9px;
  background: rgba(255, 253, 248, 0.65);
}

.feed-card.is-read {
  opacity: 0.62;
}

.feed-card.is-read:hover {
  opacity: 0.88;
}

.feed-card.is-unread::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 30px;
  width: 4px;
  height: 4px;
  background: var(--red);
  border-radius: 50%;
}

@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.date-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-top: 2px;
}

.date-day {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
}

.date-mon {
  margin-top: 4px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.12em;
}

.date-year {
  margin-top: 1px;
  color: rgba(23, 32, 43, 0.3);
  font-family: var(--mono);
  font-size: 7px;
}

.date-today {
  display: inline-block;
  margin-top: 6px;
  padding: 1px 4px;
  color: var(--red);
  border: 1px solid rgba(178, 58, 49, 0.26);
  font-family: var(--mono);
  font-size: 6px;
  letter-spacing: 0.05em;
}

.card-body {
  min-width: 0;
}

.card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  min-height: 18px;
}

.category-tag,
.scope-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 18px;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
  white-space: nowrap;
}

.category-tag {
  color: var(--cat);
  background: var(--cat-soft);
}

.category-tag::before {
  content: "";
  width: 3px;
  height: 3px;
  background: var(--cat);
  border-radius: 50%;
}

.scope-tag {
  color: var(--faint);
  border: 1px solid var(--line);
  font-weight: 400;
}

.scope-tag.college {
  color: var(--red);
  background: rgba(178, 58, 49, 0.04);
  border-color: rgba(178, 58, 49, 0.17);
}

.scope-tag.university {
  color: var(--green);
  background: rgba(72, 123, 104, 0.04);
  border-color: rgba(72, 123, 104, 0.17);
}

.card-source {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 7.5px;
}

.card-title {
  margin: 7px 0 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.008em;
  line-height: 1.55;
  text-wrap: pretty;
}

.card-title mark,
.drawer-scroll h2 mark {
  color: inherit;
  background: linear-gradient(transparent 58%, rgba(225, 178, 121, 0.42) 58%);
  padding: 0 1px;
}

.card-summary {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 880px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11.8px;
  line-height: 1.75;
}

.card-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 24px;
  margin-top: 8px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.mini-tag {
  color: var(--faint);
  font-size: 8px;
  white-space: nowrap;
}

.mini-tag::before {
  content: "#";
  margin-right: 1px;
  color: rgba(178, 58, 49, 0.5);
}

.deadline-pill,
.event-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 5px;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 7.5px;
  white-space: nowrap;
}

.deadline-pill {
  color: var(--red);
  background: var(--red-soft);
}

.event-pill {
  color: var(--navy-soft);
  background: rgba(16, 38, 63, 0.055);
}

.deadline-pill .icon,
.event-pill .icon {
  width: 9px;
  height: 9px;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.card-save {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  padding: 0;
  color: var(--faint);
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition:
    color 0.2s var(--ease),
    background 0.2s var(--ease);
}

.card-save:hover {
  color: var(--red);
  background: rgba(178, 58, 49, 0.06);
}

.card-save .icon {
  width: 14px;
  height: 14px;
}

.card-save.is-saved {
  color: var(--red);
}

.card-save.is-saved .icon {
  fill: currentColor;
}

.card-arrow {
  width: 12px;
  height: 12px;
  color: var(--faint);
  opacity: 0;
  transform: translateX(-3px);
  transition:
    opacity 0.2s var(--ease),
    transform 0.2s var(--ease);
}

.feed-card:hover .card-arrow {
  opacity: 1;
  transform: translateX(0);
}

.loading-state {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 0;
}

.skeleton-card {
  height: 106px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent) -200% 0 / 200% 100%,
    rgba(255, 253, 248, 0.58);
  animation: skeleton 1.4s infinite;
}

@keyframes skeleton {
  to {
    background-position:
      200% 0,
      0 0;
  }
}

.feed-error {
  padding: 32px;
  border: 1px solid rgba(178, 58, 49, 0.2);
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.65);
}

.feed-error h3 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 19px;
}

.feed-error p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 11px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  padding: 36px 20px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.empty-seal {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  margin-bottom: 14px;
  color: var(--red);
  border: 1px solid rgba(178, 58, 49, 0.3);
  font-family: var(--serif);
  font-size: 21px;
  transform: rotate(-4deg);
}

.empty-state h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
}

.empty-state p {
  margin: 6px 0 16px;
  color: var(--faint);
  font-size: 11px;
}

.load-more-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 0 0;
}

.load-more {
  min-height: 36px;
  padding: 0 18px;
  font-size: 10px;
}

.load-more span {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 8px;
}

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

.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(270px, 0.64fr);
  gap: 26px;
  align-items: start;
}

.calendar-card {
  padding: 22px 22px 20px;
  background: rgba(255, 253, 248, 0.74);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 35px rgba(16, 38, 63, 0.05);
}

.calendar-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 62px;
  margin-bottom: 10px;
}

.calendar-nav-group {
  position: absolute;
  left: 0;
  display: flex;
  gap: 5px;
}

.calendar-nav {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  transition:
    color 0.2s var(--ease),
    border-color 0.2s var(--ease);
}

.calendar-nav:hover {
  color: var(--red);
  border-color: rgba(178, 58, 49, 0.4);
}

.calendar-nav .icon {
  width: 13px;
  height: 13px;
}

.calendar-title {
  text-align: center;
}

.calendar-title p {
  margin: 0 0 1px;
  color: var(--red);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.15em;
}

.calendar-title h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.3;
}

.calendar-today {
  position: absolute;
  right: 0;
  height: 28px;
  padding: 0 9px;
  color: var(--faint);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 8.5px;
  cursor: pointer;
}

.calendar-today:hover {
  color: var(--red);
  border-color: rgba(178, 58, 49, 0.4);
}

.calendar-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 1px 14px;
  color: var(--faint);
  font-size: 8.5px;
}

.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.legend-dot.deadline {
  background: var(--red);
}

.legend-dot.event {
  background: var(--navy-soft);
}

.calendar-count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 7.5px;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 0 1px 7px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 7.5px;
  text-align: center;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.calendar-day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 82px;
  padding: 8px 7px 6px;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.92);
  border: 0;
  cursor: pointer;
  text-align: left;
  transition:
    background 0.2s var(--ease),
    color 0.2s var(--ease);
}

.calendar-day:hover {
  background: #f7f1e6;
}

.calendar-day.is-outside {
  color: rgba(23, 32, 43, 0.22);
  background: rgba(243, 239, 230, 0.62);
}

.calendar-day.has-events {
  background: #fdfaf4;
}

.calendar-day.is-today .day-number {
  color: var(--red);
  font-weight: 600;
}

.calendar-day.is-today::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 7px;
  width: 4px;
  height: 4px;
  background: var(--red);
  border-radius: 50%;
}

.calendar-day.is-selected {
  color: var(--surface);
  background: var(--navy);
}

.calendar-day.is-selected .day-number {
  color: #fff8ec;
}

.calendar-day.is-selected::after {
  background: var(--gold);
}

.day-number {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.1;
}

.day-events {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  margin-top: auto;
}

.day-event {
  display: flex;
  align-items: center;
  gap: 3px;
  width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 7px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-event::before {
  content: "";
  width: 3px;
  height: 3px;
  flex: 0 0 auto;
  background: var(--red);
  border-radius: 50%;
}

.day-event.is-event::before {
  background: var(--navy-soft);
}

.calendar-day.is-selected .day-event {
  color: rgba(255, 255, 255, 0.58);
}

.calendar-day.is-selected .day-event::before {
  background: var(--gold);
}

.day-more {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 6px;
}

.calendar-day.is-selected .day-more {
  color: rgba(255, 255, 255, 0.4);
}

.calendar-side {
  position: sticky;
  top: 100px;
  padding: 3px 0 0 23px;
  border-left: 1px solid var(--line);
}

.calendar-side-head {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.calendar-side-head h3 {
  margin: 4px 0 2px;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 600;
}

.calendar-side-head > p:last-child {
  margin: 0;
  color: var(--faint);
  font-size: 9px;
}

.day-list {
  display: flex;
  flex-direction: column;
}

.day-list-item {
  display: grid;
  grid-template-columns: 39px minmax(0, 1fr);
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.day-list-time {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  color: var(--red);
  background: rgba(178, 58, 49, 0.06);
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 6.5px;
  line-height: 1.5;
}

.day-list-time b {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 600;
}

.day-list-item h4 {
  margin: 0;
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}

.day-list-item p {
  margin: 3px 0 0;
  color: var(--faint);
  font-size: 8.5px;
}

.day-list-type {
  display: inline-block;
  margin-right: 5px;
  color: var(--red);
  font-family: var(--mono);
  font-size: 7px;
}

.day-list-type.event {
  color: var(--navy-soft);
}

.day-list-empty {
  padding: 26px 0;
  color: var(--faint);
  font-size: 10px;
  line-height: 1.8;
}

/* ---------- saved ---------- */

.saved-list {
  max-width: 940px;
  border-top: 1px solid var(--line);
}

.saved-list .feed-card {
  padding-right: 6px;
}

/* ---------- drawer ---------- */

.drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(11, 29, 49, 0.38);
  backdrop-filter: blur(3px);
  animation: scrim-in 0.2s var(--ease);
}

@keyframes scrim-in {
  from {
    opacity: 0;
  }
}

.detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  height: 100dvh;
  background:
    radial-gradient(circle at 100% 0, rgba(178, 58, 49, 0.03), transparent 27%),
    var(--surface-soft);
  border-left: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: -24px 0 65px rgba(11, 29, 49, 0.15);
  transform: translateX(103%);
  transition: transform 0.38s var(--ease);
}

.detail-drawer.is-open {
  transform: translateX(0);
}

.detail-drawer:focus,
.detail-drawer:focus-visible {
  outline: none;
}

.drawer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  min-height: 62px;
  padding: 0 25px;
  border-bottom: 1px solid var(--line);
}

.drawer-source {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.05em;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}

.icon-button:hover {
  color: var(--ink);
  background: rgba(23, 32, 43, 0.04);
}

.drawer-scroll {
  flex: 1 1 auto;
  padding: 27px 32px 34px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.drawer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.drawer-scroll h2 {
  margin: 13px 0 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(25px, 3vw, 31px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.45;
  text-wrap: pretty;
}

.drawer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 14px;
  margin-top: 14px;
  padding-bottom: 17px;
  color: var(--faint);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1.6;
}

.drawer-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.drawer-meta .icon {
  width: 10px;
  height: 10px;
}

.drawer-deadline {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 16px;
  padding: 10px 12px;
  color: var(--red);
  background: var(--red-soft);
  border-left: 2px solid var(--red);
  font-size: 10.5px;
}

.drawer-deadline .icon {
  width: 14px;
  height: 14px;
}

.drawer-deadline b {
  font-family: var(--mono);
  font-size: 9px;
}

.drawer-deadline span {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 7.5px;
}

.drawer-deadline.is-passed {
  color: var(--faint);
  background: rgba(23, 32, 43, 0.045);
  border-left-color: var(--line-strong);
}

.drawer-summary {
  margin: 18px 0 0;
  padding: 13px 15px;
  color: var(--muted);
  background: rgba(255, 253, 248, 0.74);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.85;
}

.drawer-summary:empty {
  display: none;
}

.drawer-content {
  margin-top: 19px;
  color: #3b434d;
  font-family: var(--serif);
  font-size: 13px;
  line-height: 2;
}

.drawer-content p {
  margin: 0 0 13px;
}

.drawer-content p:last-child {
  margin-bottom: 0;
}

.drawer-content .drawer-placeholder {
  color: var(--faint);
  font-family: var(--sans);
  font-size: 11px;
  line-height: 1.85;
}

.drawer-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 22px;
  padding-top: 15px;
  border-top: 1px dashed var(--line-strong);
}

.drawer-tag {
  padding: 3px 6px;
  color: var(--faint);
  background: rgba(23, 32, 43, 0.035);
  border-radius: 3px;
  font-size: 8.5px;
}

.drawer-tag::before {
  content: "#";
  margin-right: 2px;
  color: var(--red);
}

.drawer-disclaimer {
  margin: 22px 0 0;
  padding-top: 13px;
  color: rgba(23, 32, 43, 0.32);
  border-top: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 8px;
  line-height: 1.75;
}

.drawer-footer {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
  padding: 12px 23px calc(12px + env(safe-area-inset-bottom));
  background: rgba(251, 248, 242, 0.95);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.drawer-save {
  flex: 0 0 auto;
}

.drawer-save .icon {
  fill: transparent;
}

.drawer-save.is-saved {
  color: var(--red);
  border-color: rgba(178, 58, 49, 0.35);
}

.drawer-save.is-saved .icon {
  fill: currentColor;
}

.drawer-link {
  flex: 1;
}

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 200;
  max-width: calc(100% - 32px);
  padding: 9px 15px;
  color: #fff8ec;
  background: rgba(16, 38, 63, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  box-shadow: 0 10px 30px rgba(11, 29, 49, 0.22);
  font-size: 10.5px;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition:
    opacity 0.24s var(--ease),
    transform 0.24s var(--ease);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.is-error {
  background: rgba(143, 42, 36, 0.97);
}

/* ---------- responsive ---------- */

@media (max-width: 1180px) {
  .shell {
    grid-template-columns: 198px minmax(0, 1fr);
    gap: 30px;
  }

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

  .calendar-side {
    position: static;
    padding: 17px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .day-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 22px;
  }

  .day-list-item:nth-child(odd) {
    border-right: 1px solid var(--line);
    padding-right: 18px;
  }
}

@media (max-width: 900px) {
  .topbar-inner {
    flex-wrap: wrap;
    gap: 10px 16px;
    min-height: 0;
    padding: 11px 18px 0;
  }

  .brand-mark {
    width: 35px;
    height: 35px;
  }

  .brand-mark span {
    font-size: 19px;
  }

  .brand-word strong {
    font-size: 20px;
  }

  .main-nav {
    order: 3;
    flex: 0 0 100%;
    height: 38px;
    gap: 24px;
    border-top: 1px solid var(--line);
  }

  .main-nav a {
    height: 38px;
    font-size: 11.5px;
  }

  .main-nav a::after {
    bottom: 0;
  }

  .search-field {
    width: min(42vw, 280px);
  }

  .search-field kbd {
    display: none;
  }

  .shell {
    display: block;
    padding: 22px 18px 60px;
  }

  .sidebar {
    position: static;
    max-height: none;
    margin-bottom: 22px;
    padding: 0 0 12px;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-head,
  .sidebar-label,
  .sidebar-divider,
  .sidebar-foot {
    display: none;
  }

  .sidebar-group {
    display: block;
    margin: 0 0 8px;
  }

  .sidebar-group:last-of-type {
    margin-bottom: 0;
  }

  .side-list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 5px;
  }

  .side-item {
    width: auto;
    min-height: 29px;
    padding: 4px 9px;
    border: 1px solid var(--line);
    white-space: nowrap;
  }

  .side-item.is-active {
    border-color: var(--navy);
  }

  .side-item .count {
    margin-left: 3px;
  }

  .content-head h1 {
    font-size: 34px;
  }

  .filter-bar {
    flex-wrap: wrap;
    padding: 10px 0;
  }

  .filter-menu,
  .sort-group {
    flex: 0 0 auto;
  }

  .result-meta {
    display: none;
  }

  .calendar-card {
    padding: 17px 14px 15px;
  }

  .calendar-day {
    min-height: 68px;
  }

  .saved-list {
    max-width: none;
  }
}

@media (max-width: 600px) {
  .topbar-inner {
    padding: 9px 14px 0;
  }

  .brand {
    gap: 8px;
  }

  .brand-word small {
    display: none;
  }

  .brand-word strong {
    font-size: 19px;
  }

  .brand-mark {
    width: 33px;
    height: 33px;
  }

  .brand-mark span {
    font-size: 18px;
  }

  .search-field {
    width: auto;
    min-width: 0;
    flex: 1 1 150px;
    height: 36px;
    padding-left: 10px;
  }

  .search-field input {
    font-size: 11px;
  }

  .main-nav {
    gap: 20px;
  }

  .shell {
    padding: 18px 14px 52px;
  }

  .content-head {
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 17px;
  }

  .content-head h1 {
    font-size: 31px;
  }

  .content-sub {
    font-size: 9.5px;
    line-height: 1.65;
  }

  .refresh-button {
    width: 35px;
    min-height: 34px;
    padding: 0;
    font-size: 0;
  }

  .refresh-button .icon {
    width: 15px;
    height: 15px;
  }

  .head-actions {
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
  }

  .head-actions .button {
    min-height: 34px;
    padding: 0 10px;
    font-size: 9.5px;
  }

  .filter-menu summary {
    height: 33px;
    padding: 0 9px;
  }

  .sort-group {
    height: 33px;
  }

  .sort-group > span {
    display: none;
  }

  .sort-group button {
    height: 25px;
    padding: 0 7px;
    font-size: 9px;
  }

  .active-filter-bar {
    padding-top: 10px;
  }

  .feed-card {
    grid-template-columns: 43px minmax(0, 1fr);
    gap: 12px;
    padding: 17px 2px;
  }

  .feed-card:hover {
    padding-right: 2px;
    padding-left: 2px;
  }

  .date-day {
    font-size: 23px;
  }

  .card-source {
    display: none;
  }

  .card-title {
    font-size: 16.5px;
    line-height: 1.5;
  }

  .card-summary {
    font-size: 11px;
    line-height: 1.7;
  }

  .category-tag,
  .scope-tag {
    height: 17px;
    font-size: 7.5px;
  }

  .card-arrow {
    display: none;
  }

  .calendar-head {
    min-height: 52px;
  }

  .calendar-title h2 {
    font-size: 24px;
  }

  .calendar-nav {
    width: 28px;
    height: 28px;
  }

  .calendar-today {
    height: 26px;
    padding: 0 7px;
    font-size: 7.5px;
  }

  .calendar-legend {
    gap: 9px;
    padding-bottom: 10px;
    font-size: 7.5px;
  }

  .calendar-day {
    min-height: 58px;
    padding: 6px 5px;
  }

  .day-number {
    font-size: 13px;
  }

  .day-events {
    display: none;
  }

  .calendar-day.has-events::before {
    content: "";
    position: absolute;
    bottom: 7px;
    left: 50%;
    width: 3px;
    height: 3px;
    background: var(--red);
    border-radius: 50%;
    transform: translateX(-50%);
  }

  .calendar-day.has-event-only::before {
    background: var(--navy-soft);
  }

  .calendar-day.is-selected::before {
    background: var(--gold);
  }

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

  .day-list-item:nth-child(odd) {
    border-right: 0;
    padding-right: 0;
  }

  .drawer-scroll {
    padding: 23px 19px 29px;
  }

  .drawer-top {
    min-height: 56px;
    padding: 0 15px;
  }

  .drawer-scroll h2 {
    font-size: 24px;
  }

  .drawer-content {
    font-size: 12.5px;
    line-height: 1.95;
  }

  .drawer-footer {
    padding-right: 14px;
    padding-left: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
