:root {
  color-scheme: light;
  --paper: #f6f8f6;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --ink: #1e2725;
  --muted: #66736e;
  --line: #d8e0da;
  --green: #2d7566;
  --blue: #315d7e;
  --coral: #c35c43;
  --gold: #ad842b;
  --shadow: 0 16px 40px rgba(31, 41, 37, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "PingFang SC", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

.siteHeader {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
  padding: 14px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid rgba(221, 216, 204, 0.86);
  background: rgba(246, 248, 246, 0.94);
  backdrop-filter: blur(16px);
}

.brandBlock {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.brandMark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid rgba(22, 59, 53, 0.28);
  border-radius: 8px;
  background: #193f38;
  box-shadow: 0 10px 22px rgba(45, 117, 102, 0.16);
  text-decoration: none;
}

.brandMark img {
  display: block;
  width: 100%;
  height: 100%;
}

.brandBlock h1 {
  margin: 0;
  font-size: 21px;
  line-height: 1.2;
}

.brandBlock p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.siteActions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.iconButton {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.iconButton:hover,
.iconButton:focus-visible {
  border-color: var(--green);
  box-shadow: 0 8px 18px rgba(45, 117, 102, 0.14);
  outline: none;
  transform: translateY(-1px);
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

main {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 28px clamp(16px, 4vw, 48px) 42px;
}

.controlBand {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 520px);
  gap: 28px;
  align-items: end;
  padding: 20px 0 26px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--coral);
  font-size: 13px;
  font-weight: 750;
}

.introColumn h2 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(32px, 5vw, 62px);
  line-height: 1.02;
  letter-spacing: 0;
}

.lead {
  max-width: 660px;
  margin: 16px 0 0;
  color: #52615b;
  font-size: 17px;
  line-height: 1.75;
}

.searchPanel {
  display: grid;
  gap: 12px;
}

.searchBox {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 16px;
  border: 1px solid #ccd6d0;
  border-radius: 8px;
  background: var(--surface-strong);
  box-shadow: 0 12px 26px rgba(49, 93, 126, 0.08);
}

.searchBox:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(49, 93, 126, 0.13);
}

.searchBox input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  outline: none;
}

.sortRow {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

.sortRow select {
  min-width: 130px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--ink);
  padding: 0 10px;
}

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

.statsStrip div {
  min-width: 0;
  padding: 18px;
  background: var(--surface);
}

.statsStrip strong {
  display: block;
  color: var(--green);
  font-size: 24px;
  line-height: 1.1;
}

.statsStrip span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.contentShell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 24px;
  margin-top: 26px;
  align-items: start;
}

.filterRail {
  position: sticky;
  top: 98px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef5f1;
}

.railHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.railHeader h3 {
  margin: 0;
  font-size: 16px;
}

.railHeader button {
  border: 0;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  font-size: 13px;
}

.tagFilters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.tagFilters button,
.chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 30px;
  border: 1px solid #ccd8d2;
  border-radius: 999px;
  background: var(--surface-strong);
  color: #394641;
  font-size: 13px;
  line-height: 1.2;
  padding: 6px 10px;
}

.tagFilters button {
  cursor: pointer;
}

.tagFilters button.isActive {
  border-color: var(--green);
  background: #e2eee9;
  color: #17483e;
}

.resultsHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  color: var(--muted);
  font-size: 14px;
}

.resultsHeader p {
  margin: 0;
}

.bookmarkGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.bookmarkCard {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  box-shadow: 0 10px 30px rgba(31, 41, 37, 0.06);
}

.thumbLink {
  display: block;
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #e7ece8;
}

.thumbLink img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 220ms ease;
}

.bookmarkCard:hover .thumbLink img {
  transform: scale(1.03);
}

.thumbFallback {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(45, 117, 102, 0.96), rgba(49, 93, 126, 0.92)),
    #2d7566;
  color: #fff8e8;
  font-size: 40px;
  font-weight: 800;
}

.cardBody {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 16px;
}

.metaLine {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.domain {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--blue);
  font-weight: 700;
}

.savedAt {
  flex: 0 0 auto;
}

.bookmarkCard h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
}

.bookmarkCard h3 a {
  text-decoration: none;
}

.bookmarkCard h3 a:hover,
.bookmarkCard h3 a:focus-visible {
  color: var(--green);
  outline: none;
}

.summary {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  max-height: calc(1.58em * 3);
  margin: 0;
  color: #52615b;
  font-size: 14px;
  line-height: 1.58;
}

.qualityLine {
  min-height: 22px;
  color: var(--gold);
  font-size: 13px;
  line-height: 1.4;
}

.cardTags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cardFooter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 2px;
}

.status {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}

.openLink {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  border-radius: 8px;
  background: #193f38;
  color: #f5fbf5;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.openLink:hover,
.openLink:focus-visible {
  background: #24594f;
  outline: none;
}

.emptyState {
  padding: 60px 20px;
  border: 1px dashed #c7d2cb;
  border-radius: 8px;
  background: #eef5f1;
  text-align: center;
}

.emptyState h3 {
  margin: 0 0 8px;
}

.emptyState p {
  margin: 0;
  color: var(--muted);
}

.siteFooter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 26px clamp(16px, 4vw, 48px) 36px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.siteFooter a {
  color: var(--ink);
  text-decoration: none;
}

.siteFooter a:hover,
.siteFooter a:focus-visible {
  color: var(--green);
  outline: none;
}

.modalBackdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(22, 27, 25, 0.48);
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 60;
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  transform: translate(-50%, -50%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  padding: 24px;
  text-align: center;
}

.modal h2 {
  margin: 0 34px 14px;
  font-size: 22px;
}

.modal p {
  margin: 0 0 14px;
  color: var(--muted);
}

.modal img {
  display: block;
  width: min(280px, 100%);
  height: auto;
  margin: 0 auto;
  border-radius: 8px;
}

.modalClose {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.modalLinks {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 16px;
}

.modalLinks a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

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

@media (max-width: 820px) {
  .siteHeader {
    position: static;
    align-items: flex-start;
  }

  .brandBlock p {
    display: none;
  }

  .controlBand,
  .contentShell {
    grid-template-columns: 1fr;
  }

  .filterRail {
    position: static;
    order: 2;
  }

  .resultsArea {
    order: 1;
  }

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

@media (max-width: 620px) {
  .siteHeader {
    padding: 12px 14px;
  }

  .siteActions {
    gap: 6px;
  }

  .iconButton {
    width: 36px;
    height: 36px;
  }

  main {
    padding: 18px 14px 32px;
  }

  .introColumn h2 {
    font-size: 34px;
  }

  .lead {
    font-size: 15px;
  }

  .sortRow {
    justify-content: space-between;
  }

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

  .summary {
    min-height: auto;
  }

  .siteFooter {
    justify-content: flex-start;
  }
}
