:root {
  --paper: #faf8f7; --white: #fff; --ink: #352032; --plum: #49253f;
  --coral: #df6b58; --peach: #f8e3dc; --line: #e9e2e4; --sub: #6f626b;
  --sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --serif: Georgia, "Iowan Old Style", serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 1rem/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
button,input,select,textarea { font: inherit; }
button,a,input,textarea,select { -webkit-tap-highlight-color: transparent; }
button { border: 0; background: transparent; color: inherit; cursor: pointer; }
p,h1,h2,h3,blockquote { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid #99513f; outline-offset: 3px; }
#main:focus { outline: none; }
svg { width: 21px; height: 21px; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; fill: none; flex: none; }
.skip,.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { top: 10px; left: 10px; z-index: 15; width: auto; height: auto; clip-path: none; padding: 12px; background: white; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 222px; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 38px 19px 26px; z-index: 3; }
.brand-wrap { padding: 0 17px; }
.brand { display: inline-flex; align-items: center; }
.brand img { display: block; width: 140px; height: auto; }
.brand-line { display: block; color: var(--sub); font-size: .87rem; margin-top: 5px; }
#nav { display: grid; gap: 7px; margin: 52px 0 0; }
.navitem { min-height: 50px; padding: 0 16px; display: flex; align-items: center; gap: 13px; font-weight: 600; text-decoration: none; border-radius: 14px; color: #6c5f69; }
.navitem:hover { background: #faf6f7; }
.navitem.active { background: #f6e8e6; color: #783d45; }
.navitem.active svg { stroke-width: 2.25; }
.navcount { font-size: .78rem; padding: 0 7px; border-radius: 12px; margin-left: auto; background: #eedae1; color: var(--plum); }
.demo-label { display: flex; align-items: center; gap: 8px; margin: auto 0 0; padding: 20px 15px 0; border-top: 1px solid var(--line); color: var(--sub); font-size: .85rem; }
.demo-label span { padding: 1px 6px; border: 1px solid #d9cfd3; border-radius: 6px; font-size: .76rem; font-weight: 650; }
#main { margin-left: 222px; padding: 36px clamp(25px,4.2vw,82px) 42px; }
#main > * { max-width: 992px; margin-inline: auto; }
.intro { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 29px; }
.intro h1 { font-size: clamp(2.4rem,3.9vw,3.65rem); line-height: 1.08; font-weight: 720; letter-spacing: -.07em; }
.intro h1 em { font-style: normal; }
.intro p { color: var(--sub); margin-top: 6px; }
.btn,.iconbtn,.tag,.pinfo,.textbtn,.actions { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn { border: 1px solid transparent; border-radius: 999px; min-height: 44px; padding: 10px 17px; font-weight: 650; font-size: .94rem; line-height: 1.2; text-decoration: none; }
.btn:hover { filter: brightness(.96); }
.outline,.iconbtn { border-color: #dacfd3; background: white; }
.primary { background: var(--plum); color: white; }
.danger { border-color: #e2bdb6; color: #943f35; }
.dangerfill { background: #943f35; color: white; }
.actions { flex-wrap: wrap; justify-content: start; }
.pinfo { justify-content: flex-start; font-size: .95rem; color: var(--sub); }
.pinfo svg { width: 16px; height: 16px; }
.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tag { font-size: .86rem; border-radius: 20px; padding: 4px 10px; background: #f6eae6; }
.textbtn { font-size: .94rem; color: #754152; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; min-height: 44px; }
.iconbtn { border: 1px solid var(--line); border-radius: 50%; width: 44px; height: 44px; }
.sug-list { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,300px),1fr)); gap: 18px; align-items: start; }
.sug { display: grid; gap: 14px; min-width: 0; padding: clamp(18px,2vw,26px); background: var(--white); border: 1px solid var(--line); border-radius: 21px; }
.sug-head { display: flex; align-items: center; gap: 14px; }
.sug-pic { width: 84px; height: 84px; flex: none; border-radius: 20px; object-fit: cover; object-position: 50% 30%; }
.sug-who { min-width: 0; }
.sug-who h2 { font-size: 1.6rem; line-height: 1.1; font-weight: 720; letter-spacing: -.05em; }
.sug-who h2 span { font-weight: 430; }
.sug-kind { margin-top: 2px; color: var(--sub); font-size: .86rem; }
.sug-label { display: flex; align-items: center; gap: 8px; margin: 0; color: #643347; font-size: 1rem; }
.sug-label svg { color: #ba5a50; }
.sug .aff-list { margin: 0; padding: 0; }
.sug .aff-list li { padding: 6px 0; }
.sug-quote { padding: 12px 14px; border-radius: 14px; background: #f1e6e4; color: #4c2d3e; font: italic 1.08rem/1.4 var(--serif); }
.day-note { margin-top: 10px; text-align: center; }
.quick { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.chip { min-height: 40px; padding: 6px 12px; border: 1px solid #d8c9c4; border-radius: 12px; background: var(--white); font-size: .9rem; }
.chip:hover { background: #faf3f0; }
.status-note { margin: 10px auto !important; padding: 7px 12px; width: fit-content; max-width: 92%; border-radius: 10px; background: #efe9e4; color: #684c54; font-size: .88rem; text-align: center; }
.aff-list { list-style: none; padding: 3px 0 0; margin: 12px 0 14px; }
.aff-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.aff-icon { width: 41px; height: 41px; display: grid; place-items: center; border-radius: 13px; flex: none; }
.aff-icon.tone-0 { background: #e7ede2; color: #516849; }
.aff-icon.tone-1 { background: #f9e9df; color: #975440; }
.aff-icon.tone-2 { background: #ece7f2; color: #6c557c; }
.aff-list small,.aff-list strong { display: block; }
.aff-list small { font-size: .84rem; color: var(--sub); }
.aff-list strong { font-size: .97rem; font-weight: 640; }
.empty,.formbox,.listbox {
  background:var(--white);
  padding:26px;
  border:1px solid var(--line);
  border-radius:18px
}
.empty {
  display:grid;
  gap:12px;
  justify-items:start
}
.empty>svg {
  background:var(--peach);
  border-radius:50%;
  width:46px;
  height:46px;
  padding:12px
}
.empty p,.desc,.muted {
  color:var(--sub)
}
.formbox,.listbox {
  margin-bottom:16px
}
.profilegrid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:18px
}
.formbox h2,.listbox h2 {
  font-size:1.65rem;
  margin:0 0 12px
}
.formbox dl,.listbox dl {
  margin:0 0 15px
}
.row,.prefline,.connection {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px
}
.prefline {
  padding:10px 0;
  border-bottom:1px solid var(--line);
  align-items:baseline
}
.prefline dt {
  color:var(--sub)
}
.prefline dd {
  text-align:right;
  margin:0
}
.mode-note {
  padding:.8rem 1rem;
  background:#f3ebe4;
  border-radius:10px;
  font-size:.9rem;
  color:#684c54
}
.connection {
  padding:12px 0;
  border-bottom:1px solid var(--line)
}
.connection:last-child {
  border-bottom:0
}
.connection .who {
  display:flex;
  gap:13px;
  align-items:center
}
.who img {
  width:51px;
  height:51px;
  object-fit:cover;
  border-radius:50%
}
.who p {
  font-size:.88rem;
  color:var(--sub)
}
dialog {
  width:min(540px,calc(100% - 28px));
  max-height:88dvh;
  border:none;
  border-radius:22px;
  background:var(--paper);
  color:var(--ink);
  padding:0;
  box-shadow:0 14px 60px #25152740
}
dialog::backdrop {
  background:#28192788
}
body:has(dialog[open]) {
  overflow:hidden
}
.sheethead {
  position:sticky;
  top:0;
  z-index:2;
  background:var(--paper);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:18px 22px 14px;
  border-bottom:1px solid var(--line)
}
.sheethead h2 {
  font:normal 1.85rem/1.15 var(--serif);
  letter-spacing:-.04em
}
#dialogBody {
  padding:20px 24px 25px
}
#dialogBody p {
  margin-bottom:13px
}
#dialogBody h3 {
  font-size:1rem;
  margin:16px 0 7px
}
#dialogBody .actions {
  margin-top:18px
}
.blockpic {
  width:100%;
  aspect-ratio:2.15;
  object-fit:cover;
  object-position:50% 33%;
  border-radius:13px;
  margin-bottom:12px
}
.section-rule {
  border:0;
  border-top:1px solid var(--line);
  margin:18px 0
}
.choicegroup {
  border:0;
  padding:0;
  margin:20px 0
}
.choicegroup legend,.field {
  font-weight:650;
  display:block;
  margin-bottom:7px
}
.options {
  display:flex;
  flex-wrap:wrap;
  gap:7px
}
.option {
  position:relative;
  cursor:pointer
}
.option input {
  position:absolute;
  opacity:0;
  inset:0;
  width:100%;
  height:100%;
  margin:0;
  cursor:pointer
}
.option span {
  display:inline-flex;
  align-items:center;
  min-height:40px;
  border:1px solid #d8c9c4;
  border-radius:12px;
  padding:6px 11px;
  background:var(--white);
  font-size:.94rem
}
.option input:checked+span {
  background:#f2d9d2;
  border-color:#91574f;
  color:#492939;
  font-weight:650
}
.option input:focus-visible+span {
  outline:3px solid #a85b47;
  outline-offset:2px
}
.check {
  display:flex;
  align-items:center;
  gap:.55rem;
  font-size:.92rem;
  color:#674c55;
  margin-top:10px
}
.check input {
  width:18px;
  height:18px;
  accent-color:#684260
}
.input {
  width:100%;
  border:1px solid #cdbeb9;
  border-radius:10px;
  background:white;
  padding:10px 12px;
  color:var(--ink);
  min-height:44px;
  margin-bottom:12px
}
textarea.input {
  min-height:68px;
  resize:vertical
}
.chatlog {
  max-height:33vh;
  overflow:auto;
  padding:4px 0
}
.bubble {
  margin:8px 0 8px auto!important;
  max-width:88%;
  width:fit-content;
  background:#eddbe6;
  padding:10px 13px;
  border-radius:14px 14px 3px 14px;
  white-space:pre-wrap;
  overflow-wrap:anywhere
}
.invite {
  background:#f6e4d9;
  padding:12px 14px;
  border-radius:12px;
  margin:10px 0;
  white-space:pre-wrap;
  overflow-wrap:anywhere
}
.softpanel {
  padding:15px;
  background:#f6e7df;
  border-radius:15px;
  margin:12px 0
}
.softpanel p:last-child {
  margin:0!important
}
.formerror {
  color:#943f35;
  font-weight:600
}
.detail-list {
  padding-left:1.1rem;
  color:var(--sub);
  margin:6px 0 12px
}
.detail-list li {
  margin:.3rem 0
}
#toast {
  position:fixed;
  z-index:10;
  left:50%;
  transform:translateX(-50%);
  bottom:20px;
  background:var(--ink);
  color:white;
  border-radius:12px;
  padding:10px 17px;
  width:max-content;
  max-width:90%;
  pointer-events:none;
  box-shadow:0 3px 15px #30182822
}
#toast:empty {
  display:none
}

.formbox h2,.listbox h2,.empty h2,.sheethead h2 { font-family: var(--sans); font-weight: 680; letter-spacing: -.045em; }
.sheethead h2,.empty h2 { font-size: 1.55rem; }
.formbox h2,.listbox h2 { font-size: 1.3rem; }
.deck-empty { min-height: 290px; align-content: center; justify-items: center; text-align: center; }
.deck-empty .actions { justify-content: center; }
.match-scene { display: grid; place-items: center; padding: 4px 0 19px; }
.match-avatar { position: relative; }
.match-avatar img { border-radius: 50%; width: 122px; height: 122px; display: block; object-fit: cover; padding: 4px; background: white; border: 3px solid #dc8a7a; }
.match-avatar span { position: absolute; right: 0; bottom: 1px; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--plum); color: #ffc1ab; }
.match-avatar svg { width: 20px; height: 20px; fill: currentColor; }
.match-modal .match-copy,.match-modal .mode-note { text-align: center; }
.match-modal .actions { width: 100%; justify-content: center; }
form[data-form="prefs"] > .btn { position: sticky; bottom: 8px; box-shadow: 0 3px 12px #3a263333; }
@media (min-width:1600px) { .sidebar { width: 252px; } #main { margin-left: 252px; } }
@media (max-width:1100px) and (min-width:761px) {
  .sidebar { width: 174px; padding-inline: 12px; }
  .brand-wrap { padding-inline: 8px; }
  .brand img { width: 123px; }
  #main { margin-left: 174px; padding-inline: 24px; }
  .aff-list li { gap: 8px; }
  .aff-icon { width: 35px; height: 35px; }
  .profilegrid { grid-template-columns: 1fr; }
}
@media (max-width:760px) {
  .sidebar { position: static; padding: 5px max(17px,env(safe-area-inset-left)); height: 51px; width: 100%; flex-direction: row; align-items: center; justify-content: space-between; border: 0; border-bottom: 1px solid var(--line); }
  .brand-wrap { padding: 0; display: flex; }
  .brand img { width: 97px; }
  .brand-line { display: none; }
  .demo-label { margin: 0; padding: 0; border: 0; font-size: .78rem; gap: 6px; }
  #nav { position: fixed; z-index: 5; inset: auto 0 0; display: grid; grid-template-columns: repeat(3,1fr); gap: 4px; padding: 5px 7px calc(5px + env(safe-area-inset-bottom)); margin: 0; background: #fffdfd; border-top: 1px solid var(--line); }
  .navitem { position: relative; font-size: .78rem; min-height: 44px; gap: 1px; padding: 3px 2px; display: flex; flex-direction: column; justify-content: center; border-radius: 12px; }
  .navitem svg { width: 19px; height: 19px; }
  .navcount { position: absolute; left: calc(50% + 9px); top: 0; }
  #main { margin-left: 0; padding: 16px max(15px,env(safe-area-inset-right)) calc(82px + env(safe-area-inset-bottom)); }
  #main > * { max-width: 520px; }
  .intro { gap: 8px; margin-bottom: 15px; }
  .intro h1 { font-size: clamp(1.9rem,7.2vw,2.5rem); }
  .intro p { font-size: .9rem; margin-top: 2px; }
  .intro .pref-trigger { font-size: .84rem; padding: 8px 12px; }
  .intro .pref-trigger svg { width: 16px; height: 16px; }
  .profilegrid { grid-template-columns: 1fr; gap: 0; }
  .empty,.formbox,.listbox { padding: 18px; }
  #dialogBody { padding: 17px; }
  .sheethead { padding: 13px 16px; }
  #toast { bottom: calc(70px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after { scroll-behavior: auto !important; transition: none !important; }
}

