:root {
  color-scheme: light;
  --canvas: #f3f1ea;
  --surface: #fffdf8;
  --surface-strong: #ffffff;
  --ink: #173033;
  --ink-soft: #5d6d6e;
  --line: #d9ddd6;
  --teal: #146f69;
  --teal-dark: #0d514d;
  --teal-soft: #dceeea;
  --amber: #b9691e;
  --amber-soft: #f9e9cf;
  --red: #a83e3e;
  --red-soft: #f7dfdd;
  --blue: #36698b;
  --blue-soft: #dfeaf2;
  --shadow: 0 16px 40px rgba(33, 54, 51, 0.08);
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 9px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(20, 111, 105, 0.09), transparent 28rem),
    var(--canvas);
}

button, input, select { font: inherit; }
button, select { cursor: pointer; }

button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(20, 111, 105, 0.24);
  outline-offset: 2px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.15rem clamp(1rem, 4vw, 3rem);
  color: #f7faf7;
  background: #173d3e;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

.brand { display: flex; align-items: center; gap: 0.9rem; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #173d3e;
  background: #bfe3d7;
  border-radius: 13px;
  font-size: 1.1rem;
  font-weight: 800;
}
.brand h1 { margin: 0.1rem 0 0; font-size: clamp(1.15rem, 2vw, 1.45rem); letter-spacing: -0.02em; }
.eyebrow { margin: 0; color: #b9d0cd; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }

.language-switch {
  display: inline-flex;
  padding: 4px;
  background: rgba(255,255,255,0.09);
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 999px;
}
.language-button {
  min-width: 58px;
  padding: 0.48rem 0.72rem;
  color: #cfe0de;
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-weight: 700;
}
.language-button.active { color: #173d3e; background: #f7faf7; }

.page-shell { width: min(1500px, calc(100% - 2rem)); margin: 0 auto; padding: clamp(1.8rem, 4vw, 3.4rem) 0 4rem; }
.intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; margin-bottom: 1.6rem; }
.section-kicker { margin: 0 0 0.42rem; color: var(--teal); font-size: 0.74rem; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; }
.intro h2, .filter-heading h2, .results-heading h2, .dialog-header h2 { margin: 0; letter-spacing: -0.035em; }
.intro h2 { max-width: 820px; font-size: clamp(1.65rem, 3vw, 2.7rem); line-height: 1.12; }
.intro-copy { max-width: 780px; margin: 0.8rem 0 0; color: var(--ink-soft); line-height: 1.65; }
.privacy-pill { display: inline-flex; align-items: center; flex: 0 0 auto; gap: 0.55rem; padding: 0.65rem 0.9rem; color: var(--teal-dark); background: var(--teal-soft); border-radius: 999px; font-size: 0.82rem; font-weight: 700; }
.privacy-dot { width: 8px; height: 8px; background: var(--teal); border-radius: 50%; box-shadow: 0 0 0 4px rgba(20,111,105,0.11); }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.stat-card { position: relative; overflow: hidden; padding: 1.2rem 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: 0 8px 24px rgba(33,54,51,0.04); }
.stat-card::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: #7b8d8c; }
.stat-card-good::after { background: var(--teal); }
.stat-card-review::after { background: var(--amber); }
.stat-card-dead::after { background: var(--red); }
.stat-card p { margin: 0; color: var(--ink-soft); font-size: 0.82rem; font-weight: 700; }
.stat-card strong { display: block; margin: 0.3rem 0 0.15rem; font-size: 2rem; letter-spacing: -0.04em; }
.stat-card span { color: #7b8989; font-size: 0.75rem; }

.filter-panel, .results-panel { background: rgba(255,253,248,0.94); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.filter-panel { padding: clamp(1rem, 2.5vw, 1.5rem); margin-bottom: 1rem; }
.filter-heading, .results-heading, .dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.filter-heading { margin-bottom: 1.2rem; }
.filter-heading h2, .results-heading h2 { font-size: 1.25rem; }
.text-button { padding: 0.45rem 0.2rem; color: var(--teal); background: none; border: 0; font-weight: 800; }
.text-button:hover { color: var(--teal-dark); text-decoration: underline; }

.filter-grid { display: grid; grid-template-columns: repeat(6, minmax(145px, 1fr)); gap: 0.85rem; align-items: end; }
.field-search { grid-column: span 2; }
.field { display: grid; gap: 0.42rem; min-width: 0; }
.field > span, .page-size-control > span { color: var(--ink-soft); font-size: 0.76rem; font-weight: 750; }
.field select, .field input, .page-size-control select {
  width: 100%;
  height: 44px;
  color: var(--ink);
  background: var(--surface-strong);
  border: 1px solid #cfd6d1;
  border-radius: var(--radius-sm);
}
.field select, .page-size-control select { padding: 0 2rem 0 0.75rem; }
.search-control { position: relative; }
.search-control svg { position: absolute; left: 0.78rem; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); fill: none; stroke: #6e7e7e; stroke-width: 2; stroke-linecap: round; }
.field .search-control input { padding: 0 0.8rem 0 2.55rem; }
.field input::placeholder { color: #9aa5a2; }
.field select:hover, .field input:hover, .page-size-control select:hover { border-color: #9fb2ac; }

.check-filter { display: inline-flex; align-items: center; gap: 0.6rem; margin-top: 1rem; color: var(--ink-soft); font-size: 0.86rem; font-weight: 700; cursor: pointer; }
.check-filter input { position: absolute; opacity: 0; pointer-events: none; }
.check-box { display: grid; place-items: center; width: 19px; height: 19px; background: #fff; border: 1px solid #aebbb6; border-radius: 5px; }
.check-filter input:checked + .check-box { background: var(--teal); border-color: var(--teal); }
.check-filter input:checked + .check-box::after { content: "✓"; color: white; font-size: 0.78rem; font-weight: 900; }

.results-panel { overflow: hidden; }
.transfer-panel { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.transfer-panel summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; cursor: pointer; list-style: none; }
.transfer-panel summary::-webkit-details-marker { display: none; }
.transfer-panel summary > span:first-child { display: grid; gap: 0.25rem; }
.transfer-summary-copy { color: var(--ink-soft); font-size: 0.8rem; }
.transfer-body { display: grid; grid-template-columns: minmax(220px, 1fr) auto minmax(260px, 1.35fr) auto; align-items: end; gap: 0.8rem; padding: 1rem 1.25rem 1.2rem; border-top: 1px solid var(--line); }
.transfer-body input[type="password"], .transfer-body input[type="file"] { width: 100%; min-height: 42px; padding: 0.55rem 0.65rem; background: #fff; border: 1px solid #cbd4cf; border-radius: 9px; }
.transfer-body button { min-height: 42px; }
.transfer-status { grid-column: 1 / 4; margin: 0; color: var(--ink-soft); font-size: 0.76rem; }
.transfer-error { color: var(--red); }
.agent-links { display: flex; align-items: center; justify-content: flex-end; gap: 0.75rem; font-size: 0.74rem; }
.agent-links a { color: var(--teal); font-weight: 800; }
.agent-links code { color: var(--ink-soft); }
.guide-back { color: #d7efea; font-size: 0.8rem; font-weight: 800; text-decoration: none; }
.guide-back:hover { color: #fff; text-decoration: underline; }
.guide-shell { display: grid; gap: 1rem; width: min(1120px, calc(100% - 2rem)); margin: 0 auto; padding: 2.5rem 0 4rem; }
.guide-hero, .guide-card, .guide-warning { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.guide-hero { padding: clamp(1.4rem, 4vw, 2.6rem); }
.guide-hero h2 { max-width: 760px; margin: 0.35rem 0 0.8rem; font-size: clamp(1.8rem, 4vw, 3rem); }
.guide-hero p { max-width: 880px; margin: 0.4rem 0; color: #435657; line-height: 1.75; }
.guide-en { color: var(--ink-soft) !important; }
.guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.guide-card { display: grid; align-content: start; gap: 0.8rem; padding: 1.35rem; }
.guide-card h3 { margin: 0; font-size: 1.2rem; }
.guide-card p, .guide-card li { color: #435657; line-height: 1.65; }
.guide-card ul { display: grid; gap: 0.45rem; margin: 0; padding-left: 1.25rem; }
.guide-card pre { overflow-x: auto; margin: 0; padding: 0.9rem; color: #dff5ef; background: #173f3d; border-radius: 10px; font-size: 0.78rem; line-height: 1.65; }
.guide-card a:not(.primary-link) { color: var(--teal); font-weight: 800; }
.guide-note { padding: 0.75rem; background: #fff7e9; border-left: 3px solid var(--amber); border-radius: 8px; }
.guide-warning { padding: 1rem 1.2rem; border-left: 4px solid var(--teal); }
.guide-warning p { margin: 0.35rem 0 0; color: #435657; line-height: 1.6; }
.results-heading { padding: 1.25rem 1.35rem; border-bottom: 1px solid var(--line); }
.page-size-control { display: flex; align-items: center; gap: 0.55rem; }
.page-size-control select { width: 76px; height: 38px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 0.72rem 1rem; color: #6d7b7b; background: #f4f5ef; border-bottom: 1px solid var(--line); font-size: 0.7rem; letter-spacing: 0.07em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 0.9rem 1rem; border-bottom: 1px solid #e7e8e3; vertical-align: middle; font-size: 0.85rem; }
tbody tr { transition: background 140ms ease; }
tbody tr:hover { background: #f8faf6; }
.software-cell { min-width: 230px; }
.software-name { display: flex; align-items: center; gap: 0.48rem; font-weight: 800; }
.software-use { max-width: 430px; margin-top: 0.24rem; color: var(--ink-soft); font-size: 0.78rem; line-height: 1.45; }
.duplicate-tag { padding: 0.18rem 0.42rem; color: #68531f; background: #f6ebbd; border-radius: 999px; font-size: 0.65rem; font-weight: 800; }
.category-text { min-width: 170px; color: #4f6363; line-height: 1.4; }
.stars-cell { min-width: 112px; }
.stars { color: #b76b17; font-weight: 900; letter-spacing: 0.04em; white-space: nowrap; }
.stars-cell small { display: block; margin-top: 0.15rem; color: var(--ink-soft); font-size: 0.68rem; }
.project-fit-cell { min-width: 175px; }
.project-fit-cell strong { display: block; max-width: 190px; margin-bottom: 0.22rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.74rem; }
.project-fit-cell .stars { display: block; font-size: 0.76rem; }
.project-fit-cell small { color: var(--ink-soft); font-size: 0.66rem; }
.developer-cell { min-width: 150px; }
.tech-tag { display: inline-flex; margin: 0.12rem 0.18rem 0.12rem 0; padding: 0.25rem 0.42rem; color: #697575; background: #edf0ed; border-radius: 6px; font-size: 0.64rem; font-weight: 850; }
.tech-yes { color: var(--teal-dark); background: var(--teal-soft); }
.tech-unavailable { color: var(--red); background: var(--red-soft); }
.badge { display: inline-flex; align-items: center; gap: 0.38rem; padding: 0.33rem 0.58rem; border-radius: 999px; font-size: 0.72rem; font-weight: 800; white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-live, .status-redirected { color: var(--teal-dark); background: var(--teal-soft); }
.status-dead, .status-dead_or_hijacked { color: var(--red); background: var(--red-soft); }
.status-dead_or_misconfigured, .status-server_error { color: var(--amber); background: var(--amber-soft); }
.status-unknown, .status-unknown_timeout, .status-no_url, .status-restricted { color: #5d6570; background: #e9ebee; }
.fit-core { color: var(--teal-dark); background: var(--teal-soft); }
.fit-supporting { color: var(--blue); background: var(--blue-soft); }
.fit-optional { color: #60686e; background: #eceeef; }
.priority-badge { display: inline-grid; place-items: center; width: 34px; height: 28px; border-radius: 8px; font-size: 0.75rem; font-weight: 900; }
.priority-1 { color: var(--red); background: var(--red-soft); }
.priority-2 { color: var(--amber); background: var(--amber-soft); }
.priority-3 { color: var(--blue); background: var(--blue-soft); }
.priority-4 { color: #667273; background: #edf0ed; }
.details-button, .secondary-button, .primary-link { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 0.45rem 0.75rem; border-radius: 9px; font-size: 0.76rem; font-weight: 800; text-decoration: none; }
.details-button { color: var(--teal-dark); background: transparent; border: 1px solid #a9c9c1; }
.details-button:hover { color: white; background: var(--teal); border-color: var(--teal); }
.secondary-button { color: var(--ink); background: #fff; border: 1px solid #cbd4cf; }
.secondary-button:disabled { cursor: not-allowed; opacity: 0.45; }
.primary-link { color: white; background: var(--teal); border: 1px solid var(--teal); }
.primary-link:hover { background: var(--teal-dark); }
.state-message { display: grid; gap: 0.35rem; place-items: center; min-height: 220px; padding: 2rem; color: var(--ink-soft); text-align: center; }
.state-error { color: var(--red); }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 0.8rem; padding: 1rem 1.25rem; background: #fafaf7; border-top: 1px solid var(--line); }
.pagination span { min-width: 70px; color: var(--ink-soft); font-size: 0.8rem; font-weight: 800; text-align: center; }

.details-dialog { width: min(980px, calc(100% - 1.5rem)); max-height: calc(100vh - 2rem); padding: 0; color: var(--ink); background: var(--surface); border: 0; border-radius: var(--radius-lg); box-shadow: 0 28px 90px rgba(20,42,41,0.28); }
.details-dialog::backdrop { background: rgba(15,37,37,0.56); backdrop-filter: blur(3px); }
.dialog-shell { max-height: calc(100vh - 2rem); overflow: auto; }
.dialog-header { position: sticky; top: 0; z-index: 2; padding: 1.25rem 1.4rem; background: rgba(255,253,248,0.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.dialog-header h2 { font-size: 1.55rem; }
.icon-button { display: grid; place-items: center; width: 38px; height: 38px; color: var(--ink-soft); background: #eef1ed; border: 0; border-radius: 50%; font-size: 1.5rem; line-height: 1; }
.dialog-body { display: grid; gap: 1rem; padding: 1.35rem; }
.dialog-summary { margin: 0; color: #435657; font-size: 0.98rem; line-height: 1.7; }
.detail-badges { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.stars-pill { display: inline-flex; align-items: center; padding: 0.32rem 0.6rem; color: #84501b; background: #fbecd5; border-radius: 999px; font-size: 0.75rem; font-weight: 850; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.detail-card { padding: 0.9rem; background: #f5f6f1; border: 1px solid #e2e5df; border-radius: 12px; }
.detail-card span { display: block; margin-bottom: 0.3rem; color: #768483; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.detail-card strong, .detail-card p { margin: 0; color: var(--ink); font-size: 0.87rem; line-height: 1.5; }
.recommendation-card { padding: 1rem; background: var(--teal-soft); border-left: 4px solid var(--teal); border-radius: 10px; }
.recommendation-card span { display: block; margin-bottom: 0.35rem; color: var(--teal-dark); font-size: 0.72rem; font-weight: 900; text-transform: uppercase; }
.recommendation-card p { margin: 0; color: #244c49; line-height: 1.6; }
.detail-section { display: grid; gap: 0.7rem; padding-top: 0.2rem; }
.detail-section > h3 { margin: 0; color: var(--teal-dark); font-size: 0.86rem; letter-spacing: 0.035em; text-transform: uppercase; }
.detail-section > p, .redev-content p, .github-content p { margin: 0; color: #435657; line-height: 1.7; }
.function-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.55rem 1.4rem; margin: 0; padding-left: 1.25rem; color: #435657; line-height: 1.55; }
.score-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.65rem; }
.score-card { padding: 0.8rem; background: #f5f6f1; border: 1px solid #e2e5df; border-radius: 12px; }
.score-card span { display: block; min-height: 2.2em; color: var(--ink-soft); font-size: 0.7rem; font-weight: 750; }
.score-card strong { display: block; margin-top: 0.25rem; font-size: 0.92rem; }
.score-card small { color: var(--ink-soft); }
.score-basis, .integration-section { padding: 1rem; background: #f4f7f4; border-radius: 12px; }
.developer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem; }
.developer-card { display: grid; align-content: start; gap: 0.6rem; padding: 0.9rem; background: #f8f8f4; border: 1px solid #e1e5df; border-radius: 12px; }
.developer-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.developer-card p { margin: 0; color: #4f6262; font-size: 0.82rem; line-height: 1.55; }
.support-pill { padding: 0.2rem 0.45rem; color: #626d6d; background: #e9ece9; border-radius: 999px; font-size: 0.63rem; font-weight: 850; }
.support-yes, .support-strong, .support-possible { color: var(--teal-dark); background: var(--teal-soft); }
.support-unavailable { color: var(--red); background: var(--red-soft); }
.redev-content { display: grid; gap: 0.55rem; }
.redev-score { width: max-content; color: #84501b; font-weight: 850; }
.github-content { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.github-content .detail-card { min-width: 210px; flex: 1; }
.source-list { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.source-link { width: max-content; color: var(--teal); font-size: 0.76rem; font-weight: 800; text-decoration: none; }
.source-link:hover { color: var(--teal-dark); text-decoration: underline; }
.project-card-list { display: grid; gap: 0.9rem; }
.project-card { display: grid; gap: 0.75rem; padding: 1rem; background: #f8f8f4; border: 1px solid #dfe4de; border-radius: 14px; }
.project-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.project-card-heading > div { display: grid; gap: 0.25rem; }
.project-card-heading strong { font-size: 1rem; }
.project-card-heading .stars { font-size: 0.82rem; }
.project-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.project-meta-pill { padding: 0.25rem 0.48rem; color: #536565; background: #e9eeea; border-radius: 999px; font-size: 0.65rem; font-weight: 800; }
.project-summary { margin: 0; color: #415454; line-height: 1.65; }
.project-note { padding: 0.75rem 0.85rem; background: #fff; border-left: 3px solid #aab9b3; border-radius: 9px; }
.project-note-integration { background: #edf7f3; border-left-color: var(--teal); }
.project-note-warning { background: #fff7e9; border-left-color: var(--amber); }
.project-note strong { display: block; margin-bottom: 0.3rem; color: var(--ink); font-size: 0.73rem; text-transform: uppercase; }
.project-note p { margin: 0; color: #4d6060; font-size: 0.82rem; line-height: 1.6; }
.url-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 0.4rem; }
.url-text { min-width: 0; color: var(--ink-soft); font-size: 0.75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 1180px) {
  .filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .field-search { grid-column: span 2; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .transfer-body { grid-template-columns: 1fr auto; }
  .transfer-status, .agent-links { grid-column: 1 / -1; }
  .agent-links { justify-content: flex-start; }
}

@media (max-width: 700px) {
  .topbar { padding: 0.9rem 1rem; }
  .eyebrow { display: none; }
  .brand-mark { width: 36px; height: 36px; border-radius: 10px; }
  .language-button { min-width: 48px; padding-inline: 0.55rem; }
  .page-shell { width: min(100% - 1rem, 1500px); padding-top: 1.3rem; }
  .intro { align-items: flex-start; flex-direction: column; gap: 1rem; }
  .privacy-pill { align-self: stretch; justify-content: center; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
  .stat-card { padding: 0.95rem; }
  .stat-card strong { font-size: 1.65rem; }
  .filter-grid { grid-template-columns: 1fr; }
  .field-search { grid-column: auto; }
  .results-heading { align-items: flex-end; }
  th, td { padding-inline: 0.75rem; }
  .detail-grid { grid-template-columns: 1fr; }
  .function-list, .developer-grid { grid-template-columns: 1fr; }
  .score-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .transfer-panel summary { align-items: flex-start; flex-direction: column; }
  .transfer-body { grid-template-columns: 1fr; }
  .transfer-body > *, .transfer-status, .agent-links { grid-column: 1; }
  .url-row { align-items: stretch; flex-direction: column; }
  .guide-grid { grid-template-columns: 1fr; }
  .guide-back { max-width: 140px; text-align: right; }
}
