:root{
  --bg:#f5f0e8;
  --paper:#fbf8f3;
  --ink:#101311;
  --muted:#6f706b;
  --line:#d8d1c6;
  --soft:#ebe5dc;
  --terracotta:#b7482e;
  --green:#244b3a;
  color-scheme:light;
}
*{box-sizing:border-box}
html{background:var(--bg)}
body{
  margin:0;background:var(--bg);color:var(--ink);
  font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
button,input,select{font:inherit}
button{color:inherit}
a{color:inherit}
[hidden]{display:none!important}
.skip-link{position:fixed;left:16px;top:-80px;z-index:200;background:var(--paper);padding:10px 14px;border:2px solid var(--green);border-radius:8px}
.skip-link:focus{top:12px}
.visually-hidden{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}

.global-header{
  position:relative;height:68px;border-bottom:1px solid rgba(16,19,17,.12);
  display:flex;align-items:center;background:rgba(245,240,232,.96);z-index:20;
}
.header-inner{
  width:min(1160px,calc(100% - 40px));margin:auto;
  display:flex;align-items:center;justify-content:space-between;gap:30px;
}
.brand{
  font-family:Georgia,serif;font-size:25px;font-weight:700;letter-spacing:-.7px;
  text-decoration:none;color:var(--ink);
}
.main-nav{display:flex;gap:27px;font-size:14px}
.main-nav a{text-decoration:none;color:#53544f}
.main-nav a.active,.main-nav a[aria-current=page]{color:var(--ink);font-weight:650}
.header-actions{display:flex;gap:18px;align-items:center;font-size:13px}
.language-button{border:0;background:none;padding:8px 2px;cursor:pointer}
.world-link{
  border:1px solid #bbb4a9;border-radius:999px;padding:9px 15px;
  background:rgba(255,255,255,.35);cursor:pointer;
}

.hero{position:relative;overflow:hidden;border-bottom:1px solid rgba(16,19,17,.08)}
.hero-inner{
  width:min(1020px,calc(100% - 40px));margin:auto;
  min-height:250px;padding:54px 0 46px;
  display:grid;grid-template-columns:1.35fr .75fr;gap:85px;align-items:center;
}
.eyebrow{
  text-transform:uppercase;letter-spacing:.22em;font-size:11px;
  font-weight:700;color:#75736d;margin-bottom:10px;
}
h1{
  font-family:Georgia,serif;font-size:52px;line-height:.95;
  letter-spacing:-2px;margin:0 0 18px;
}
.hero-copy{font-size:18px;line-height:1.48;max-width:590px}
.hero-note{
  background:rgba(255,255,255,.7);border:1px solid #ded8ce;
  border-radius:15px;padding:18px 20px;
  box-shadow:0 7px 24px rgba(50,40,30,.05);
  font-size:13px;line-height:1.45;
}
.hero-note strong{display:block;margin-bottom:7px}
.hero-note span{color:#77756f}

.workspace{width:min(940px,calc(100% - 40px));margin:0 auto;padding:62px 0 100px}
.section-label{font-size:15px;font-weight:700;margin-bottom:20px}
.filter-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
.field label{display:block;font-size:12px;font-weight:650;color:#5f5d58;margin-bottom:7px}
select,.search-input{
  width:100%;border:1px solid #d7d0c6;background:rgba(255,255,255,.82);
  border-radius:10px;height:44px;padding:0 12px;outline:none;
}
select:focus-visible,.search-input:focus-visible,button:focus-visible,a:focus-visible{
  outline:3px solid rgba(36,75,58,.3);outline-offset:2px;
}
.search-row{display:grid;grid-template-columns:1fr auto auto;gap:10px;margin-top:13px}
.search-input{height:48px;padding:0 16px}
.search-btn{
  height:48px;border:0;background:var(--terracotta);color:white;
  border-radius:10px;padding:0 25px;font-weight:700;cursor:pointer;
}
.search-counters{
  display:flex;align-items:center;flex-wrap:wrap;gap:8px 18px;
  margin:10px 0 0;color:#62635d;font-size:12px;
}
.counter-item strong{color:var(--green);font-size:14px}
.count-info{
  border:0;background:none;padding:0;color:var(--green);
  font-size:12px;font-weight:700;cursor:pointer;
}
.count-info:hover{text-decoration:underline}
.search-btn[disabled]{opacity:.6;cursor:wait}
.more-row{margin-top:14px;display:flex;justify-content:space-between;align-items:center}
.more-btn,.clear-btn,.text-action,.ranking-edit,.reset-ranking{
  border:0;background:none;padding:0;cursor:pointer;
}
.more-btn{font-size:13px;font-weight:650}
.clear-btn{font-size:12px;color:#77746d}
.text-action{font-size:12px;font-weight:650}
.text-action:hover,.ranking-edit:hover,.reset-ranking:hover{text-decoration:underline}
.advanced{
  display:none;margin-top:18px;padding:18px;border:1px solid var(--line);
  border-radius:12px;background:rgba(255,255,255,.32);
}
.advanced.open{display:block}
.advanced-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
.search-status{min-height:22px;margin:18px 0 0;color:var(--muted);font-size:13px}
.search-status.error{color:#9b2e22;font-weight:650}

.results-head{
  margin-top:45px;padding-bottom:12px;border-bottom:1px solid var(--line);
  display:flex;justify-content:space-between;align-items:flex-end;
}
.results-head h2{margin:0;font-family:Georgia,serif;font-size:27px;letter-spacing:-.5px}
.result-count{font-size:13px;color:var(--muted)}
.ranking-bar{
  display:flex;justify-content:space-between;align-items:center;
  gap:25px;padding:13px 0 14px;border-bottom:1px solid var(--line);font-size:12px;
}
.ranking-message{color:#555750}
.ranking-message strong{color:var(--green);font-weight:700}
.ranking-controls{display:flex;align-items:center;gap:7px;white-space:nowrap}
.ranking-state{color:#62635d;font-weight:650}
.ranking-edit{font-weight:700;color:var(--green)}

.result{padding:25px 0 26px;border-bottom:1px solid var(--line)}
.result-meta{display:flex;flex-wrap:wrap;gap:6px;font-size:12px;color:#676761;margin-bottom:9px}
.dot{color:#aaa49a}
.result-title{margin:0 0 8px;font-family:Georgia,serif;font-size:23px;line-height:1.18;letter-spacing:-.35px}
.result-title a{text-decoration:none}
.result-title a:hover{text-decoration:underline;text-underline-offset:3px}
.snippet{max-width:790px;margin:0;color:#353833;font-size:14px;line-height:1.55}
.tags{display:flex;flex-wrap:wrap;gap:7px;margin-top:14px}
.tag{padding:5px 9px;border-radius:999px;background:#ebe5db;color:#57574f;font-size:11px}
.result-footer{margin-top:15px;display:flex;justify-content:space-between;align-items:center;gap:20px}
.curation{display:flex;align-items:center;flex-wrap:wrap;gap:7px;font-size:12px;color:#68675f}
.collection{color:var(--green);font-weight:700}
.result-actions{display:flex;align-items:center;flex-wrap:wrap;gap:13px}
.why-rank{color:#686a64}
.original-link{font-size:12px;font-weight:700;color:var(--terracotta);text-decoration:none}
.original-link:hover{text-decoration:underline}
.empty-state{padding:34px 0;color:var(--muted);font-size:15px}

.modal-backdrop{
  position:fixed;inset:0;background:rgba(15,17,15,.34);
  backdrop-filter:blur(3px);display:none;align-items:center;justify-content:center;
  padding:20px;z-index:100;
}
.modal-backdrop.open{display:flex}
.modal{
  width:min(570px,100%);max-height:90vh;overflow:auto;
  background:#faf7f1;border:1px solid #d5cec3;border-radius:18px;
  box-shadow:0 25px 80px rgba(0,0,0,.18);padding:27px 28px 26px;
}
.modal-top{display:flex;align-items:flex-start;justify-content:space-between;gap:20px}
.modal-eyebrow{font-size:11px;text-transform:uppercase;letter-spacing:.16em;color:#817e76;margin-bottom:8px}
.modal h3{font-family:Georgia,serif;font-size:28px;margin:0 0 8px}
.modal-intro{color:#555650;font-size:14px;line-height:1.5;margin:0 0 24px}
.close{
  flex:0 0 auto;width:32px;height:32px;border-radius:50%;
  border:1px solid #d4cec4;background:transparent;cursor:pointer;font-size:18px;
}
.rank-item{padding:15px 0;border-top:1px solid var(--line)}
.rank-top{display:flex;justify-content:space-between;gap:20px;margin-bottom:9px}
.rank-name{font-size:13px;font-weight:700}
.rank-value{font-size:11px;color:#77746d}
input[type="range"]{width:100%;accent-color:var(--green)}
.range-labels{display:flex;justify-content:space-between;font-size:10px;color:#89867e;margin-top:3px}
.rank-note,.disclaimer{
  margin-top:18px;padding:12px 14px;background:#eee8de;border-radius:10px;
  color:#69675f;font-size:11px;line-height:1.45;
}
.modal-actions{margin-top:21px;display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap}
.reset-ranking{font-size:12px;color:#696861}
.apply-group{display:flex;gap:8px;flex-wrap:wrap}
.secondary-btn,.primary-btn{border-radius:9px;padding:10px 13px;font-size:12px;font-weight:700;cursor:pointer}
.secondary-btn{border:1px solid #bbb5aa;background:transparent}
.primary-btn{border:0;background:var(--green);color:white}
.reason-list{list-style:none;padding:0;margin:20px 0 0}
.reason-list li{padding:11px 0;border-top:1px solid var(--line);display:flex;justify-content:space-between;gap:20px;font-size:13px}
.reason-strength{color:var(--green);font-weight:700}
.modal-link{display:inline-flex;margin-top:18px;color:var(--green);font-weight:700}

@media(max-width:800px){
  .main-nav{display:none}
  .hero-inner{grid-template-columns:1fr;gap:24px}
  .filter-grid{grid-template-columns:1fr 1fr}
  .advanced-grid{grid-template-columns:1fr}
}
@media(max-width:560px){
  .header-inner,.hero-inner,.workspace{width:calc(100% - 28px)}
  .filter-grid{grid-template-columns:1fr}
  .search-row{grid-template-columns:1fr}
  .ranking-bar{align-items:flex-start;flex-direction:column;gap:8px}
  .result-footer{align-items:flex-start;flex-direction:column}
  .result-actions{width:100%;justify-content:space-between}
  h1{font-size:44px}
}
