:root{
  --bg:#f3f4f6;
  --bg2:#ffffff;
  --ink:#0f172a;
  --muted:#5b6473;
  --line:#e5e7eb;
  --blue:#0a66c2;
  --blue2:#e8f0fe;
  --green:#0f766e;
  --greenBg:#e8f7f4;
  --red:#b42318;
  --redBg:#fdecec;
  --pill:#eef2f7;
  --shadow:0 6px 24px rgba(16,24,40,.08);
  --radius:18px;
  font-synthesis: style;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color:var(--ink);
  background:var(--bg);
}

.topbar{
  position:sticky; top:0; z-index:10;
  display:flex; align-items:center; justify-content:space-between;
  padding:10px 18px;
  background:#fff; border-bottom:1px solid var(--line);
}
.topbar__left{display:flex; align-items:center; gap:10px;}
.logo{
  width:36px; height:36px; border-radius:10px;
  display:grid; place-items:center;
  background:var(--blue2); color:var(--blue); font-weight:800;
}
.brand__name{font-weight:800; font-size:15px;}
.brand__tag{font-size:12px; color:var(--muted);}
.topbar__nav{display:flex; gap:6px; flex-wrap:wrap;}
.navbtn{
  border:0; background:transparent; padding:8px 10px; border-radius:10px;
  color:#111827; font-weight:600; cursor:pointer;
}
.navbtn:hover{background:var(--pill)}
.signin{
  border:1px solid var(--line);
  background:#fff; padding:8px 12px; border-radius:999px; cursor:pointer;
  font-weight:600;
}

.hero{
  background:linear-gradient(180deg,#ffffff 0%, #f7f9fb 70%, var(--bg) 100%);
  padding:54px 18px 30px;
}
.hero__content{max-width:980px; margin:0 auto; text-align:center;}
.hero h1{
  margin:0 0 6px; font-size:40px; letter-spacing:.04em;
}
.hero__sub{font-size:18px; font-weight:700; margin:0; color:#111827;}
.hero__text{max-width:680px; margin:12px auto 18px; color:var(--muted);}

.hero__pills{
  display:flex; gap:10px; justify-content:center; flex-wrap:wrap; margin-bottom:16px;
}
.pill{
  display:flex; align-items:center; gap:8px;
  border:1px solid var(--line); background:#fff; border-radius:999px;
  padding:8px 12px; cursor:pointer; font-weight:700;
  box-shadow:0 2px 6px rgba(0,0,0,.04);
}
.pill__icon{font-size:16px}
.pill:hover{background:var(--blue2); border-color:#cddcf5}

.card{
  background:var(--bg2); border:1px solid var(--line); border-radius:var(--radius);
  box-shadow:var(--shadow); padding:16px;
}

.hero__card{max-width:640px; margin:0 auto; text-align:left;}
.row{display:flex; gap:12px; flex-wrap:wrap; align-items:end;}
.row.between{justify-content:space-between; align-items:center;}
label{display:flex; flex-direction:column; gap:6px; font-weight:600; font-size:14px; flex:1;}
input, select{
  padding:10px 12px; border-radius:12px; border:1px solid var(--line);
  font-size:15px; background:#fff;
}
input:focus, select:focus{outline:2px solid #cfdff6; border-color:#bcd0f3}

.primary{
  background:var(--blue); color:#fff; border:0;
  padding:12px 14px; border-radius:999px; font-weight:800; cursor:pointer;
}
.primary.small{padding:10px 12px; margin-top:22px;}
.primary:hover{filter:brightness(.95)}
.ghost{
  border:1px dashed var(--line); background:transparent; padding:10px 14px;
  border-radius:999px; cursor:pointer; font-weight:700; color:#111827;
}
.ghost:hover{background:#fff}

.hero__quote{margin-top:14px; color:var(--muted); font-style:italic;}

.section{max-width:980px; margin:18px auto; padding:0 18px;}
.section__head h2{margin:0}
.section__head{margin:10px 0 10px}

.muted{color:var(--muted)}
.tiny{font-size:12px}

.profile-card .row{align-items:center}
.profile-result{margin-top:14px; display:grid; grid-template-columns:260px 1fr; gap:16px;}
.profile-left{display:flex; gap:12px; align-items:center;}
.animal-portrait{
  width:96px; height:96px; object-fit:cover; border-radius:16px; border:1px solid var(--line);
}
.profile-animal .value{font-size:22px; font-weight:800}
.profile-right{display:flex; flex-direction:column; gap:10px}

.chips{display:flex; gap:8px; flex-wrap:wrap;}
.chip{
  display:flex; gap:8px; align-items:center; padding:6px 10px; border-radius:999px;
  background:#f1f5f9; font-weight:700; font-size:13px;
}
.chip-green{background:var(--greenBg); color:var(--green);}
.chip-red{background:var(--redBg); color:var(--red);}

.list-block{background:#f8fafc; border:1px solid var(--line); border-radius:14px; padding:10px;}
.list-block h4{margin:0 0 6px}

.pair-list{display:flex; flex-wrap:wrap; gap:6px;}
.pair{
  display:flex; align-items:center; gap:6px; padding:6px 8px;
  background:#fff; border:1px solid var(--line); border-radius:999px; font-weight:700; font-size:13px; cursor:pointer;
}
.pair img{width:20px; height:20px; border-radius:6px; object-fit:cover}

.team-card label{margin-bottom:8px;}
.member{
  display:grid; grid-template-columns:1fr 1fr auto; gap:8px; margin-bottom:8px; align-items:end;
  padding:8px; background:#f8fafc; border:1px solid var(--line); border-radius:12px;
}
.member .remove{background:#fff; border:1px solid var(--line); padding:8px 10px; border-radius:10px; cursor:pointer; font-weight:700;}
.member .remove:hover{background:#fee2e2}

.group-summary{
  margin-top:12px; padding:10px; background:#f8fafc; border:1px solid var(--line); border-radius:12px;
  display:flex; flex-direction:column; gap:6px;
}
#pairList{display:flex; flex-direction:column; gap:8px; margin-top:8px;}
.pair-row{
  display:flex; justify-content:space-between; align-items:center; gap:10px;
  padding:10px; background:#fff; border:1px solid var(--line); border-radius:12px;
}
.pair-row .left{display:flex; align-items:center; gap:8px; font-weight:800;}
.pair-row .left img{width:26px; height:26px; border-radius:8px; object-fit:cover; border:1px solid var(--line);}
.pair-row .meta{font-size:13px; color:var(--muted); font-weight:600;}
.score{font-weight:900; font-size:18px;}
.score.green{color:var(--green)}
.score.red{color:var(--red)}
.score.neutral{color:#b45309}

.method-card p{line-height:1.5; margin:0 0 10px}

.animal-grid{
  display:grid; grid-template-columns:repeat(3,1fr); gap:12px;
}
@media (max-width:800px){
  .profile-result{grid-template-columns:1fr}
  .animal-grid{grid-template-columns:repeat(2,1fr)}
  .member{grid-template-columns:1fr 1fr}
}
.animal-tile{
  background:#fff; border:1px solid var(--line); border-radius:16px; padding:10px;
  display:flex; gap:10px; align-items:center; cursor:pointer;
}
.animal-tile img{width:72px; height:72px; border-radius:12px; object-fit:cover; border:1px solid var(--line)}
.animal-tile .name{font-weight:900; font-size:18px;}
.animal-tile .years{font-size:12px; color:var(--muted);}

.footer{
  margin-top:30px; padding:20px; text-align:center; color:var(--muted); font-size:13px;
}

/* modal */
.modal{position:fixed; inset:0; display:grid; place-items:center;}
.modal__backdrop{position:fixed; inset:0; background:rgba(15,23,42,.5);}
.modal__panel{
  position:relative; width:min(640px, 92vw); background:#fff; border-radius:18px; padding:16px; box-shadow:var(--shadow); z-index:2;
}
.modal__close{
  position:absolute; top:8px; right:10px; width:34px; height:34px;
  border-radius:999px; border:1px solid var(--line); background:#fff; cursor:pointer; font-size:20px; line-height:0;
}
.hidden{display:none;}