
:root{
  color-scheme:dark;
  --bg:#0c090c;
  --bg-soft:#171014;
  --surface:#211519;
  --surface-2:#160f12;
  --surface-3:#2a1b1e;
  --text:#f2e5d2;
  --muted:#bda98d;
  --gold:#d6a552;
  --gold-2:#efc979;
  --line:rgba(214,165,82,.28);
  --line-strong:rgba(214,165,82,.55);
  --danger:#9f4a53;
  --shadow:0 24px 60px rgba(0,0,0,.30);
  --radius:22px;
}
html[data-theme="light"]{
  color-scheme:light;
  --bg:#eadfcd;
  --bg-soft:#f6ecdd;
  --surface:#fffaf1;
  --surface-2:#f5ead9;
  --surface-3:#efe0ca;
  --text:#38271f;
  --muted:#765f4d;
  --gold:#986126;
  --gold-2:#7b4718;
  --line:rgba(126,82,45,.22);
  --line-strong:rgba(126,82,45,.48);
  --danger:#a24d55;
  --shadow:0 22px 50px rgba(79,51,30,.14);
}
*{box-sizing:border-box}
html{background:var(--bg);scroll-behavior:smooth}
body{
  margin:0;
  min-height:100vh;
  color:var(--text);
  font:16px/1.55 system-ui,-apple-system,"Segoe UI",sans-serif;
  background:
    radial-gradient(circle at 50% -10%,rgba(112,43,54,.30),transparent 35%),
    linear-gradient(135deg,#08060a,#170d12 55%,#09070a);
  transition:background .25s ease,color .25s ease;
}
body:before{
  content:"";
  position:fixed;inset:0;z-index:-1;pointer-events:none;
  opacity:.13;
  background-image:linear-gradient(45deg,transparent 47%,rgba(190,139,74,.48) 48%,transparent 49%);
  background-size:58px 58px;
}
html[data-theme="light"] body{
  background:
    radial-gradient(circle at 50% -10%,rgba(191,131,66,.18),transparent 37%),
    linear-gradient(135deg,#e6d8c3,#f7eee0 55%,#eadfce);
}
html[data-theme="light"] body:before{opacity:.09}
a{color:var(--gold-2)}
button,input,select,textarea{font:inherit}
button{cursor:pointer}
h1,h2,h3{font-family:Georgia,"Times New Roman",serif;color:var(--text)}
h2{margin:0 0 16px;font-size:clamp(25px,2vw,31px);line-height:1.1}
p{margin-top:0}
.muted,.empty,.appearance-hint,.activity-note{color:var(--muted)}
.eyebrow{
  margin:0 0 4px;
  color:var(--gold);
  font-size:11px;
  letter-spacing:.18em;
  text-transform:uppercase;
}

/* Auth pages */
.account-shell{width:min(560px,calc(100% - 28px));margin:auto;padding:38px 0 70px}
.auth-card{text-align:center}
.seal{display:grid;place-items:center;width:58px;height:58px;margin:0 auto 16px;border:1px solid var(--gold);border-radius:50%;color:var(--gold);font:28px serif}
.lead{color:var(--muted)}
.social,.primary,.quiet{border-radius:11px;text-decoration:none}
.social{display:block;margin:9px 0;padding:12px 16px;border:1px solid var(--line);background:var(--surface-2);color:var(--text)}
.divider{display:flex;align-items:center;gap:12px;margin:20px 0;color:var(--muted)}
.divider:before,.divider:after{content:"";height:1px;flex:1;background:var(--line)}

/* Dashboard shell */
.dashboard{width:min(1180px,calc(100% - 36px));margin:0 auto;padding:28px 0 80px}
.dashboard-head{
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  gap:24px;
  padding:10px 2px 22px;
}
.dashboard-head .back{margin:0;text-decoration:none;color:var(--muted);white-space:nowrap}
.dashboard-identity h1{margin:2px 0 0;font-size:clamp(34px,4vw,52px);line-height:1}
.dashboard-identity p:last-child{margin:7px 0 0;color:var(--muted)}
.dashboard-actions{display:flex;align-items:center;gap:10px}
.dashboard-actions form{margin:0}
.theme-switch,.quiet{
  width:auto!important;
  min-height:42px;
  padding:0 14px;
  display:inline-flex!important;
  align-items:center;
  justify-content:center;
  gap:7px;
  border:1px solid var(--line-strong)!important;
  border-radius:999px!important;
  background:color-mix(in srgb,var(--surface) 92%,transparent)!important;
  color:var(--text)!important;
  box-shadow:none!important;
}
.theme-switch__sun{display:none}
html[data-theme="light"] .theme-switch__sun{display:inline}
html[data-theme="light"] .theme-switch__moon{display:none}
.theme-switch__text{font-size:12px;letter-spacing:.08em;text-transform:uppercase}

/* Cards */
.account-card{
  position:relative;
  min-width:0;
  overflow:hidden;
  padding:26px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:
    linear-gradient(145deg,color-mix(in srgb,var(--surface) 96%,transparent),color-mix(in srgb,var(--surface-2) 97%,transparent));
  box-shadow:var(--shadow);
  transition:border-color .2s ease,transform .2s ease,background .25s ease;
}
.account-card:hover{border-color:var(--line-strong)}
.dashboard-top{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:18px;
}
.dashboard-main{
  display:grid;
  grid-template-columns:minmax(0,1.15fr) minmax(340px,.85fr);
  gap:18px;
  margin-top:18px;
}
.dashboard-side{display:grid;gap:18px;align-content:start}
.dashboard-comments{margin-top:18px}
.dashboard-profile>.account-card{height:100%}

/* Reading and bookmarks */
.reading-list,.bookmark-list{display:grid;gap:10px}
.reading-list a,.bookmark-list a{
  position:relative;
  display:grid;
  gap:4px;
  padding:14px 15px;
  overflow:hidden;
  text-decoration:none;
  color:var(--text);
  border:1px solid var(--line);
  border-radius:13px;
  background:var(--surface-2);
}
.reading-list a{grid-template-columns:1fr auto}
.reading-list i{position:absolute;left:0;bottom:0;height:3px;width:var(--progress);background:var(--gold)}
.bookmark-list span{font-size:13px;color:var(--muted)}

/* Chibi scene */
.character-card{min-height:248px;padding-right:210px}
.character-card>*:not(.character-art){position:relative;z-index:3}
.character-art{
  position:absolute;
  z-index:2;
  right:10px;
  bottom:4px;
  width:190px;
  height:232px;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  isolation:isolate;
  pointer-events:none;
}
.character-art:before{
  content:"";
  position:absolute;
  z-index:-2;
  left:50%;
  bottom:6px;
  width:78%;
  height:66%;
  transform:translateX(-50%);
  border-radius:50%;
  background:radial-gradient(ellipse,rgba(214,165,82,.22),transparent 70%);
  filter:blur(11px);
}
.character-art>img{display:block;max-width:100%;max-height:100%;object-fit:contain;filter:drop-shadow(0 12px 15px rgba(0,0,0,.34));pointer-events:none}
.character-lian .character-art{width:205px}
.character-feng .character-art{width:188px}
.character-yu .character-art{width:170px;height:238px}
.character-yunxi .character-art{width:215px;height:258px}
.companion-hitbox{display:none;position:absolute;inset:0;z-index:50;border:0;background:transparent}
body.companion-lian .character-lian .companion-hitbox,
body.companion-yu .character-yu .companion-hitbox,
body.companion-feng .character-feng .companion-hitbox,
body.companion-yunxi .character-yunxi .companion-hitbox{display:block;pointer-events:auto}
body.companion-lian .character-lian .character-art,
body.companion-yu .character-yu .character-art,
body.companion-feng .character-feng .character-art,
body.companion-yunxi .character-yunxi .character-art{pointer-events:auto;cursor:pointer}
.companion-badge{
  display:none;
  position:absolute;
  top:-12px;
  left:50%;
  transform:translateX(-50%);
  z-index:60;
  padding:5px 9px;
  border:1px solid var(--gold);
  border-radius:999px;
  background:var(--surface-2);
  color:var(--gold);
  font-size:9px;
  letter-spacing:.1em;
  text-transform:uppercase;
  white-space:nowrap;
}
body.companion-lian .character-lian .companion-badge,
body.companion-yu .character-yu .companion-badge,
body.companion-feng .character-feng .companion-badge,
body.companion-yunxi .character-yunxi .companion-badge{display:block}
.companion-inline{
  position:absolute!important;
  z-index:20!important;
  right:165px!important;
  top:60px!important;
  width:200px!important;
  padding:10px 12px!important;
  border:1px solid var(--line-strong)!important;
  border-radius:12px!important;
  background:color-mix(in srgb,var(--surface-2) 97%,transparent)!important;
  box-shadow:0 12px 30px rgba(0,0,0,.18)!important;
}
.companion-inline p{margin:0!important;color:var(--text)!important;font:italic 12px/1.45 Georgia,serif!important}
.character-yunxi .companion-inline{right:155px!important;top:54px!important}

/* Profile */
.profile-card{padding-right:230px}
.account-form{display:grid;gap:15px;max-width:460px}
.account-form label{display:grid;gap:7px;color:var(--muted);font-size:14px}
.account-form input,.account-form select{
  width:100%;
  padding:13px 14px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--surface-2);
  color:var(--text);
}
.account-form input:focus,.account-form select:focus{outline:2px solid color-mix(in srgb,var(--gold) 60%,transparent);outline-offset:1px}
fieldset{border:0;padding:0;margin:0}
legend{margin-bottom:7px;color:var(--muted);font-size:14px}
.appearance-hint{margin:0 0 12px;font-size:12px}
.avatar-gallery{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px!important;margin-bottom:4px}
.avatar-choice{position:relative;cursor:pointer;min-width:0}
.avatar-choice input{position:absolute;opacity:0}
.avatar-choice__visual{
  display:flex!important;
  align-items:flex-end;
  justify-content:center;
  height:105px;
  padding:4px!important;
  overflow:hidden;
  border:1px solid var(--line)!important;
  border-radius:14px!important;
  background:var(--surface-2)!important;
  transition:.18s ease;
}
.avatar-choice__visual img{max-width:90%;max-height:96px;object-fit:contain;filter:drop-shadow(0 6px 7px rgba(0,0,0,.28))}
.avatar-choice__name{display:block!important;margin-top:6px!important;text-align:center;font-size:11px;color:var(--muted)!important;border:0!important;background:none!important;padding:0!important}
.avatar-choice input:checked + .avatar-choice__visual{
  border-color:var(--gold)!important;
  box-shadow:0 0 0 1px color-mix(in srgb,var(--gold) 50%,transparent),0 0 22px color-mix(in srgb,var(--gold) 20%,transparent);
}
.avatar-choice input:checked + .avatar-choice__visual:after{
  content:"✓";
  position:absolute;
  right:6px;top:6px;
  width:22px;height:22px;
  display:grid;place-items:center;
  border-radius:50%;
  background:var(--gold);
  color:var(--surface-2);
  font-weight:800;
}
.avatar-choice input:checked ~ .avatar-choice__name{color:var(--gold)!important;font-weight:700}
.primary{
  display:block;width:100%;
  padding:13px 16px;
  border:1px solid var(--gold-2);
  border-radius:12px;
  background:linear-gradient(180deg,color-mix(in srgb,var(--gold) 92%,#fff 8%),color-mix(in srgb,var(--gold) 78%,#603414 22%));
  color:#1a100b;
  font-weight:700;
}

/* Activity */
.activity-head,.comments-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}
.activity-seal{display:grid;place-items:center;width:42px;height:42px;border:1px solid var(--line-strong);border-radius:50%;color:var(--gold);font-family:serif}
.activity-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;margin-top:16px}
.activity-stats>div{padding:14px 8px;text-align:center;border:1px solid var(--line);border-radius:13px;background:var(--surface-2)}
.activity-stats b{display:block;color:var(--gold-2);font:700 24px Georgia,serif}
.activity-stats span{display:block;margin-top:4px;color:var(--muted);font-size:9px}
.activity-note{margin:13px 0 0;font-size:11px}

/* Comments */
.comments-heading{align-items:center;margin-bottom:14px}
.comments-heading h2{margin-bottom:0}
.comments-heading>span{padding:6px 10px;border:1px solid var(--line);border-radius:999px;color:var(--muted);font-size:11px}
.my-comments-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.my-comment{display:block;padding:14px;text-decoration:none;color:var(--text);border:1px solid var(--line);border-radius:13px;background:var(--surface-2)}
.my-comment>div{display:flex;justify-content:space-between;gap:12px}
.my-comment time{color:var(--muted);font-size:11px;white-space:nowrap}
.my-comment p{margin:8px 0;color:var(--muted);font-size:13px}
.my-comment>span{color:var(--gold);font-size:12px}
.my-comments.is-empty .empty{margin:0;padding:14px;border:1px dashed var(--line);border-radius:13px;background:var(--surface-2)}

/* Toast / errors */
.account-toast{
  position:fixed;top:18px;left:50%;z-index:9999;
  transform:translateX(-50%);
  display:flex;align-items:center;gap:10px;
  min-width:min(420px,calc(100vw - 28px));
  padding:12px 15px;
  border:1px solid var(--line-strong);
  border-radius:13px;
  background:var(--surface);
  box-shadow:var(--shadow);
}
.account-toast>span{color:var(--gold);font-size:20px}
.account-toast strong,.account-toast small{display:block}
.account-toast small{color:var(--muted)}
.account-error{margin:15px 0;padding:12px 14px;border:1px solid var(--danger);border-radius:12px;background:color-mix(in srgb,var(--danger) 20%,var(--surface));color:var(--text)}

/* Real light-theme details */
html[data-theme="light"] .character-art>img{filter:drop-shadow(0 12px 15px rgba(84,53,31,.16))}
html[data-theme="light"] .theme-switch,
html[data-theme="light"] .quiet{background:rgba(255,250,241,.85)!important}

/* Existing Yunxi animated webp */
.character-yunxi .yunxi-animated{display:block!important;width:100%!important;height:100%!important;object-fit:contain!important;max-width:100%!important;max-height:100%!important}

/* Responsive */
@media(max-width:980px){
  .dashboard-main{grid-template-columns:1fr}
  .dashboard-side{grid-template-columns:1fr 1fr}
  .profile-card{padding-right:220px}
}
@media(max-width:760px){
  .dashboard{width:min(100% - 18px,680px);padding:18px 0 70px}
  .dashboard-head{grid-template-columns:1fr auto;gap:14px;padding-bottom:18px}
  .dashboard-head .back{grid-column:1/-1}
  .dashboard-identity h1{font-size:38px}
  .dashboard-actions{align-self:start}
  .theme-switch__text{display:none}
  .theme-switch{width:42px!important;min-width:42px;padding:0!important}
  .dashboard-top,.dashboard-side{grid-template-columns:1fr}
  .dashboard-main,.dashboard-comments{margin-top:12px}
  .dashboard-top,.dashboard-side,.dashboard-main{gap:12px}
  .account-card{padding:20px;border-radius:18px}
  .character-card,.profile-card{padding-right:20px;min-height:0}
  .character-card .character-art{
    position:relative;
    right:auto;bottom:auto;
    width:min(250px,72vw)!important;
    height:245px!important;
    margin:16px auto -4px;
  }
  .profile-card .character-art{height:275px!important}
  .character-card .companion-inline,
  .profile-card .companion-inline{
    position:relative!important;
    inset:auto!important;
    width:100%!important;
    margin:8px 0 12px!important;
  }
  .companion-badge{top:3px}
  .avatar-gallery{grid-template-columns:repeat(2,minmax(0,1fr))}
  .avatar-choice__visual{height:122px}
  .avatar-choice__visual img{max-height:114px}
  .my-comments-list{grid-template-columns:1fr}
  .my-comment>div{display:block}
  .my-comment time{display:block;margin-top:4px}
}
@media(max-width:430px){
  .dashboard{width:calc(100% - 12px)}
  .dashboard-head{grid-template-columns:1fr}
  .dashboard-actions{justify-content:space-between}
  .dashboard-actions .theme-switch{width:auto!important;min-width:42px}
  .dashboard-actions .theme-switch__text{display:inline}
  .character-card .character-art{width:min(235px,76vw)!important;height:235px!important}
  .profile-card .character-art{height:255px!important}
}

/* Keep interaction animation hooks functional */
.character-art.reaction-lian{animation:reactLian 1.25s ease!important}
.character-art.reaction-yu{animation:reactYu 1.25s ease!important}
.character-art.reaction-feng{animation:reactFeng 1.15s ease!important}
.character-art.reaction-yunxi{animation:reactYunxi 1.25s ease!important}
.character-art.reaction-hover{animation:reactHover .75s ease!important}
@keyframes reactLian{50%{transform:translateY(-10px) rotate(-1deg)}}
@keyframes reactYu{50%{transform:translateY(-7px) scale(1.025)}}
@keyframes reactFeng{30%{transform:translateX(-6px)}60%{transform:translateX(6px)}}
@keyframes reactYunxi{35%{transform:translateY(-12px) rotate(-1.5deg)}65%{transform:translateY(-5px) rotate(1deg)}}
@keyframes reactHover{50%{transform:translateY(-5px)}}

@media(prefers-reduced-motion:reduce){
  *,*:before,*:after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}
}


/* v14 — theme switch feedback */
.theme-switch{
  transition:background .2s ease,border-color .2s ease,color .2s ease,transform .15s ease!important;
}
.theme-switch:active{transform:scale(.96)}
html[data-theme="light"] .theme-switch{
  background:#fff8eb!important;
  border-color:#9a6429!important;
  color:#5a361a!important;
}
html[data-theme="light"] .account-card{
  background:linear-gradient(145deg,#fffaf1,#f3e6d2)!important;
  color:#38271f!important;
}
html[data-theme="light"] body:before{
  opacity:.075!important;
}


/* =========================================================
   v15 — визуальная доводка ЛК
   ========================================================= */

.dashboard{
  width:min(1220px,calc(100% - 40px));
  padding-top:22px;
}

.dashboard-head{
  padding:8px 0 16px;
}

.dashboard-identity h1{
  letter-spacing:-.025em;
}

/* Верхняя сводка */
.account-overview{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr)) minmax(190px,1.1fr);
  gap:10px;
  margin:0 0 26px;
}
.overview-item,
.overview-companion{
  min-height:76px;
  padding:13px 16px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  border:1px solid var(--line);
  border-radius:16px;
  background:color-mix(in srgb,var(--surface) 92%,transparent);
  box-shadow:0 10px 28px rgba(0,0,0,.10);
}
.overview-item span,
.overview-companion span{
  color:var(--muted);
  font-size:10px;
  letter-spacing:.12em;
  text-transform:uppercase;
}
.overview-item strong{
  margin-top:2px;
  color:var(--gold-2)!important;
  font:700 24px Georgia,serif;
}
.overview-companion strong{
  margin-top:3px;
  font:700 18px Georgia,serif;
}

/* Заголовки разделов */
.section-kicker{
  display:flex;
  align-items:center;
  gap:12px;
  margin:4px 2px 10px;
  color:var(--gold);
  font-size:10px;
  letter-spacing:.18em;
  text-transform:uppercase;
}
.section-kicker i{
  height:1px;
  flex:1;
  background:linear-gradient(90deg,var(--line),transparent);
}
.section-kicker--main{margin-top:20px}
.section-kicker--comments{margin-top:20px}

.card-heading{
  margin-bottom:14px;
}
.card-heading .eyebrow{
  margin-bottom:5px;
}
.card-heading h2{
  margin-bottom:0;
}

/* Основная сетка */
.dashboard-top{
  gap:16px;
}
.dashboard-top>.account-card{
  min-height:236px;
}
.dashboard-main{
  grid-template-columns:minmax(0,1.12fr) minmax(350px,.88fr);
  gap:16px;
  margin-top:0;
}
.dashboard-side{
  gap:16px;
}
.dashboard-comments{
  margin-top:0;
}

/* Карточки чуть воздушнее и спокойнее */
.account-card{
  padding:24px;
  border-radius:20px;
}
.account-card:hover{
  transform:translateY(-1px);
}

/* Профиль */
.dashboard-profile .profile-card{
  padding-bottom:24px;
}
.dashboard-profile .account-form{
  max-width:470px;
}
.profile-card .appearance-hint{
  max-width:360px;
}
.avatar-gallery{
  gap:9px!important;
}
.avatar-choice__visual{
  height:112px;
}

/* Выбранный персонаж подчёркивается именно миниатюрой */
.avatar-choice input:checked + .avatar-choice__visual{
  background:
    radial-gradient(circle at 50% 80%,color-mix(in srgb,var(--gold) 17%,transparent),transparent 60%),
    var(--surface-2)!important;
}

/* Персонажи визуально ближе к контенту, меньше пустой зоны */
.character-card{
  padding-right:205px;
}
.character-art{
  right:8px;
}
.character-yunxi .character-art{
  right:8px;
}

/* Реплика у спутника мягче и читаемее */
.companion-inline{
  max-width:210px!important;
  border-radius:14px!important;
  backdrop-filter:blur(8px);
}
.companion-inline p{
  line-height:1.5!important;
}

/* Активность */
.reader-activity{
  padding:22px;
}
.activity-stats>div{
  min-height:82px;
  display:flex;
  flex-direction:column;
  justify-content:center;
}
.activity-note{
  max-width:380px;
}

/* Комментарии */
.my-comments{
  padding:22px 24px;
}
.my-comments.is-empty .empty{
  min-height:62px;
  display:flex;
  align-items:center;
}

/* Светлая тема — чуть теплее и менее стерильно */
html[data-theme="light"] .overview-item,
html[data-theme="light"] .overview-companion{
  background:rgba(255,249,238,.80);
}
html[data-theme="light"] .account-card{
  box-shadow:0 18px 45px rgba(79,51,30,.10)!important;
}

/* Планшеты */
@media(max-width:980px){
  .account-overview{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .dashboard-main{
    grid-template-columns:1fr;
  }
  .dashboard-side{
    grid-template-columns:1fr 1fr;
  }
}

/* Телефоны */
@media(max-width:760px){
  .dashboard{
    width:min(100% - 16px,680px);
  }
  .account-overview{
    grid-template-columns:1fr 1fr;
    gap:8px;
    margin-bottom:18px;
  }
  .overview-item,
  .overview-companion{
    min-height:68px;
    padding:11px 13px;
  }
  .section-kicker{
    margin-top:14px;
  }
  .section-kicker--main,
  .section-kicker--comments{
    margin-top:16px;
  }
  .dashboard-top,
  .dashboard-side{
    grid-template-columns:1fr;
  }
  .account-card{
    padding:18px;
    border-radius:18px;
  }
  .avatar-gallery{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  .avatar-choice__visual{
    height:132px;
  }
}

/* Узкие телефоны */
@media(max-width:430px){
  .account-overview{
    grid-template-columns:1fr 1fr;
  }
  .overview-item strong{
    font-size:21px;
  }
  .overview-companion strong{
    font-size:15px;
  }
}


/* =========================================================
   v16 — убираем дубль «Активность» + справка о спутниках
   ========================================================= */

/* Правая колонка после удаления дубля активности */
.dashboard-side{
  grid-template-rows:auto!important;
}
.dashboard-side .character-yu{
  min-height:100%;
}

/* Легенда "Облик" с вопросом */
.appearance-legend{
  width:100%;
  display:flex;
  align-items:center;
  gap:8px;
  margin-bottom:7px;
}

.appearance-help{
  width:22px!important;
  height:22px!important;
  min-width:22px!important;
  padding:0!important;
  display:inline-grid!important;
  place-items:center;
  border:1px solid var(--line-strong)!important;
  border-radius:50%!important;
  background:var(--surface-2)!important;
  color:var(--gold)!important;
  font:700 12px/1 Georgia,serif!important;
  box-shadow:none!important;
  transform:none!important;
}

.appearance-help:hover{
  border-color:var(--gold)!important;
  background:color-mix(in srgb,var(--gold) 11%,var(--surface-2))!important;
}

.appearance-help[aria-expanded="true"]{
  background:var(--gold)!important;
  color:var(--surface-2)!important;
}

.appearance-help-panel{
  position:relative;
  z-index:30;
  margin:-1px 0 12px;
  padding:12px 14px;
  border:1px solid var(--line-strong);
  border-radius:13px;
  background:var(--surface-2);
  box-shadow:0 14px 32px rgba(0,0,0,.16);
}

.appearance-help-panel[hidden]{
  display:none!important;
}

.appearance-help-panel strong{
  display:block;
  margin-bottom:6px;
  color:var(--gold-2)!important;
  font:700 14px Georgia,serif;
}

.appearance-help-panel p{
  margin:0;
  color:var(--muted);
  font-size:12px;
  line-height:1.5;
}

.appearance-help-panel p + p{
  margin-top:7px;
}

/* Светлая тема */
html[data-theme="light"] .appearance-help-panel{
  background:#fff9ef;
  box-shadow:0 12px 28px rgba(79,51,30,.12);
}

/* На телефоне подсказка чуть крупнее для тапа */
@media(max-width:760px){
  .appearance-help{
    width:26px!important;
    height:26px!important;
    min-width:26px!important;
    font-size:13px!important;
  }

  .appearance-help-panel{
    padding:13px 14px;
  }

  .appearance-help-panel p{
    font-size:13px;
  }
}


/* =========================================================
   v18 — MOBILE LAYOUT PASS
   Пересобираем мобильную композицию, не трогая desktop.
   ========================================================= */

@media(max-width:760px){

  /* Общая геометрия */
  body{
    overflow-x:hidden;
  }

  .dashboard{
    width:100%!important;
    max-width:none!important;
    padding:14px 12px 86px!important;
  }

  .dashboard-head{
    display:grid!important;
    grid-template-columns:1fr auto!important;
    gap:8px 10px!important;
    align-items:start!important;
    padding:0 2px 14px!important;
  }

  .dashboard-head .back{
    grid-column:1/-1!important;
    margin:0 0 2px!important;
    font-size:12px!important;
  }

  .dashboard-identity h1{
    margin:0!important;
    font-size:34px!important;
    line-height:1!important;
  }

  .dashboard-identity .eyebrow{
    font-size:9px!important;
    letter-spacing:.16em!important;
  }

  .dashboard-identity p:last-child{
    margin-top:5px!important;
    font-size:12px!important;
  }

  .dashboard-actions{
    display:flex!important;
    gap:6px!important;
    align-items:center!important;
  }

  .dashboard-actions .theme-switch,
  .dashboard-actions .quiet{
    min-height:36px!important;
    height:36px!important;
    padding:0 10px!important;
    font-size:11px!important;
  }

  .dashboard-actions .theme-switch__text{
    display:none!important;
  }

  /* Сводка */
  .account-overview{
    grid-template-columns:1fr 1fr!important;
    gap:8px!important;
    margin-bottom:14px!important;
  }

  .overview-item,
  .overview-companion{
    min-height:62px!important;
    padding:10px 12px!important;
    border-radius:13px!important;
  }

  .overview-item span,
  .overview-companion span{
    font-size:8px!important;
  }

  .overview-item strong{
    font-size:19px!important;
  }

  .overview-companion strong{
    font-size:14px!important;
  }

  .section-kicker{
    margin:14px 2px 8px!important;
    font-size:8px!important;
  }

  /* Все колонки на телефоне — строго одной колонкой */
  .dashboard-top,
  .dashboard-main,
  .dashboard-side{
    display:block!important;
    margin:0!important;
  }

  .dashboard-top>.account-card,
  .dashboard-main .account-card,
  .dashboard-side>.account-card,
  .dashboard-comments>.account-card{
    margin-bottom:12px!important;
  }

  .account-card{
    width:100%!important;
    min-width:0!important;
    padding:18px!important;
    border-radius:17px!important;
  }

  .account-card h2{
    font-size:25px!important;
    line-height:1.02!important;
  }

  .card-heading{
    margin-bottom:10px!important;
  }

  .card-heading .eyebrow{
    font-size:8px!important;
  }

  /* Ключевое: карточки чтения с персонажем сверху, а не справа */
  .character-card{
    display:flex!important;
    flex-direction:column!important;
    padding-right:18px!important;
    min-height:0!important;
  }

  .character-card .character-art{
    order:1!important;
    position:relative!important;
    inset:auto!important;
    width:min(230px,68vw)!important;
    height:215px!important;
    margin:2px auto 8px!important;
    transform:none!important;
  }

  .character-card .card-heading,
  .character-card h2,
  .character-card .reading-list,
  .character-card .bookmark-list,
  .character-card>p,
  .character-card .account-form{
    order:2!important;
  }

  .character-card .companion-inline{
    order:2!important;
    position:relative!important;
    inset:auto!important;
    width:100%!important;
    max-width:none!important;
    margin:0 0 10px!important;
    padding:10px 12px!important;
  }

  .character-card .companion-badge{
    top:4px!important;
  }

  /* Continue reading: character first, title after */
  .character-lian .character-art{
    width:min(220px,66vw)!important;
    height:205px!important;
  }

  /* Feng */
  .character-feng .character-art{
    width:min(205px,62vw)!important;
    height:205px!important;
  }

  /* Yu login card */
  .character-yu .character-art{
    width:min(185px,58vw)!important;
    height:220px!important;
  }

  /* Yunxi profile */
  .profile-card.character-yunxi{
    display:block!important;
    padding:18px!important;
  }

  .profile-card.character-yunxi .character-art{
    position:relative!important;
    width:min(245px,72vw)!important;
    height:250px!important;
    margin:8px auto 6px!important;
  }

  .profile-card.character-yunxi .companion-inline{
    position:relative!important;
    width:100%!important;
    inset:auto!important;
    margin:0 0 12px!important;
  }

  /* Формы */
  .account-form{
    max-width:none!important;
    gap:12px!important;
  }

  .account-form label{
    font-size:12px!important;
    gap:5px!important;
  }

  .account-form input,
  .account-form select{
    padding:11px 12px!important;
    border-radius:10px!important;
  }

  .appearance-hint{
    font-size:11px!important;
    line-height:1.45!important;
  }

  /* Спутники 2x2, крупнее и ровнее */
  .avatar-gallery{
    grid-template-columns:1fr 1fr!important;
    gap:10px!important;
  }

  .avatar-choice__visual{
    height:128px!important;
    border-radius:13px!important;
  }

  .avatar-choice__visual img{
    max-height:118px!important;
  }

  .avatar-choice__name{
    margin-top:5px!important;
    font-size:11px!important;
  }

  /* Help-panel не должен ломать сетку */
  .appearance-help-panel{
    margin-bottom:10px!important;
    font-size:12px!important;
  }

  /* Кнопка профиля */
  .primary{
    padding:12px 14px!important;
    font-size:14px!important;
  }

  /* Login card — текст после персонажа */
  .character-yu p{
    font-size:13px!important;
  }

  /* Комментарии */
  .dashboard-comments{
    margin-top:0!important;
  }

  .comments-heading{
    align-items:flex-start!important;
    gap:10px!important;
  }

  .comments-heading h2{
    font-size:24px!important;
  }

  .comments-heading>span{
    font-size:9px!important;
    padding:5px 8px!important;
  }

  .my-comments.is-empty .empty{
    min-height:0!important;
    padding:12px!important;
    font-size:12px!important;
  }

  /* Пузырь реплики — аккуратный */
  .companion-inline p{
    font-size:11px!important;
    line-height:1.45!important;
  }

  /* Убираем визуальные эффекты, которые на маленьком экране съедают пространство */
  .account-card:hover{
    transform:none!important;
  }
}

@media(max-width:430px){
  .dashboard{
    padding-left:8px!important;
    padding-right:8px!important;
  }

  .dashboard-identity h1{
    font-size:31px!important;
  }

  .account-card{
    padding:16px!important;
  }

  .character-card .character-art{
    width:min(220px,72vw)!important;
  }

  .profile-card.character-yunxi .character-art{
    width:min(235px,76vw)!important;
  }

  .avatar-choice__visual{
    height:120px!important;
  }
}


/* =========================================================
   v18.1 — Бай Юнси без швов
   ========================================================= */
.character-yunxi .yunxi-animated{display:none!important}

.character-yunxi .yunxi-static-clean{
    display:block!important;
    width:100%!important;
    height:100%!important;
    max-width:100%!important;
    max-height:100%!important;
    object-fit:contain!important;
    pointer-events:none!important;
    transform-origin:50% 88%;
    filter:drop-shadow(0 12px 16px rgba(0,0,0,.24));
}

body.companion-yunxi .character-yunxi .yunxi-static-clean{
    animation:yunxiCleanIdle 5.4s ease-in-out infinite;
}
@keyframes yunxiCleanIdle{
    0%,100%{transform:translateY(0) rotate(0deg) scale(1)}
    35%{transform:translateY(-2px) rotate(-.18deg) scale(1.002)}
    68%{transform:translateY(-1px) rotate(.16deg) scale(1.001)}
}

.character-yunxi .character-art.reaction-yunxi .yunxi-static-clean{
    animation:yunxiCleanReact 1.25s cubic-bezier(.16,.85,.24,1)!important;
}
@keyframes yunxiCleanReact{
    0%,100%{transform:translateY(0) rotate(0) scale(1)}
    25%{transform:translateY(-9px) rotate(-1.2deg) scale(1.018)}
    50%{transform:translateY(-3px) rotate(.8deg) scale(1.008)}
    75%{transform:translateY(-6px) rotate(-.35deg) scale(1.012)}
}

@media(max-width:760px){
    body.companion-yunxi .character-yunxi .yunxi-static-clean{
        animation:yunxiCleanIdleMobile 6.2s ease-in-out infinite;
    }
    @keyframes yunxiCleanIdleMobile{
        0%,100%{transform:translateY(0) scale(1)}
        50%{transform:translateY(-1.5px) scale(1.001)}
    }
    .character-yunxi .character-art.reaction-yunxi .yunxi-static-clean{
        animation:yunxiCleanReactMobile 1.15s ease!important;
    }
    @keyframes yunxiCleanReactMobile{
        0%,100%{transform:translateY(0) scale(1)}
        45%{transform:translateY(-6px) scale(1.012)}
    }
}

@media(prefers-reduced-motion:reduce){
    .character-yunxi .yunxi-static-clean{animation:none!important}
}


/* ===== Tenimper v5: addressing style ===== */
.addressing-fieldset{
  margin:18px 0 8px;
  padding:16px;
  border:1px solid var(--line,rgba(180,145,95,.35));
  border-radius:14px;
}
.addressing-fieldset legend{
  padding:0 8px;
  font-weight:700;
}
.addressing-hint{
  margin:0 0 12px;
  color:var(--muted,#9f9187);
  font-size:13px;
  line-height:1.5;
}
.addressing-options{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:9px;
}
.addressing-options label{
  position:relative;
  cursor:pointer;
}
.addressing-options input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}
.addressing-options span{
  min-height:72px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:4px;
  padding:12px;
  border:1px solid var(--line,rgba(180,145,95,.35));
  border-radius:11px;
  background:rgba(255,255,255,.025);
  transition:.18s ease;
}
.addressing-options strong{font-size:14px}
.addressing-options small{color:var(--muted,#9f9187);font-size:11px}
.addressing-options input:checked + span{
  border-color:#b67a2b;
  box-shadow:0 0 0 2px rgba(182,122,43,.13);
}
@media(max-width:620px){
  .addressing-options{grid-template-columns:1fr}
  .addressing-options span{min-height:58px}
}


/* ===== Tenimper v5.0.1: addressing polish ===== */
.addressing-title{
  margin:0 0 6px;
  font-weight:700;
  color:var(--text,#2b211c);
}
.addressing-options span{
  position:relative;
  overflow:hidden;
}
.addressing-options span::after{
  content:"";
  position:absolute;
  inset:auto 10px 8px;
  height:1px;
  background:linear-gradient(90deg,transparent,rgba(182,122,43,.28),transparent);
}
.addressing-options input:checked + span{
  transform:translateY(-1px);
  background:rgba(182,122,43,.07);
}
.addressing-preview{
  margin-top:12px;
  display:flex;
  align-items:flex-start;
  gap:9px;
  padding:10px 12px;
  border-radius:10px;
  background:rgba(182,122,43,.06);
  color:var(--muted,#8f7b6c);
  font-size:12px;
  line-height:1.5;
}
.addressing-preview-mark{
  flex:0 0 auto;
  width:24px;
  height:24px;
  display:grid;
  place-items:center;
  border:1px solid rgba(182,122,43,.4);
  border-radius:50%;
  color:#a66c21;
  font-size:11px;
}
@media(max-width:620px){
  .addressing-fieldset{
    padding:14px;
  }
  .addressing-title{
    font-size:14px;
  }
  .addressing-hint{
    font-size:12px;
  }
}

.login-methods-card{min-height:310px}
.login-methods{position:relative;z-index:4;display:grid;gap:9px;margin-top:15px}
.login-method{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 12px;border:1px solid var(--line);border-radius:13px;background:var(--surface-2)}
.login-method>div{display:flex;align-items:center;gap:9px;min-width:0}
.login-method strong,.login-method small{display:block}
.login-method small{margin-top:2px;color:var(--muted);font-size:11px}
.login-method__icon{width:32px;height:32px;flex:0 0 32px;display:grid;place-items:center;border:1px solid var(--line-strong);border-radius:50%;color:var(--gold-2);font-weight:700}
.login-method form{margin:0}
.connection-button{display:inline-flex;align-items:center;justify-content:center;min-height:34px;padding:0 10px;border:1px solid var(--line-strong);border-radius:9px;background:var(--surface-3);color:var(--text);text-decoration:none;font-size:11px;white-space:nowrap}
button.connection-button{width:auto}
.connection-button--danger{border-color:rgba(159,74,83,.55);color:#d7878e}
.connection-lock{padding:5px 8px;border:1px solid var(--line);border-radius:999px;color:var(--muted);font-size:9px}
.connection-safety-note{position:relative;z-index:4;margin:12px 0 0;color:var(--muted);font-size:10px}
@media(max-width:560px){.login-method{align-items:flex-start;flex-direction:column}.login-method form,.connection-button{width:100%}}


/* =========================================================
   POKOI READER ROOMS v2
   ========================================================= */
.rooms-v2{width:min(1180px,calc(100% - 36px));margin:0 auto;padding:22px 0 80px}
.rooms-topbar{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:26px}
.rooms-back{color:var(--muted);text-decoration:none}
.rooms-topbar-actions{display:flex;align-items:center;gap:10px}

.rooms-identity{
  display:grid;
  grid-template-columns:112px minmax(0,1fr) 150px;
  align-items:center;
  gap:24px;
  padding:24px 28px 30px;
  border-bottom:1px solid var(--line);
}
.rooms-avatar{
  width:108px;height:108px;display:grid;place-items:end center;
  overflow:hidden;border:1px solid var(--line-strong);border-radius:50%;
  background:radial-gradient(circle at 50% 70%,color-mix(in srgb,var(--gold) 18%,transparent),transparent 66%);
}
.rooms-avatar img{max-width:92%;max-height:106px;object-fit:contain;filter:drop-shadow(0 8px 12px rgba(0,0,0,.25))}
.rooms-identity h1{margin:2px 0 4px;font-size:clamp(42px,5vw,66px);line-height:.94;font-weight:400}
.rooms-login{margin:0;color:var(--muted)}
.rooms-title{margin:12px 0 0;color:var(--gold-2);font:400 18px/1.2 Georgia,serif}
.rooms-since{margin:5px 0 0;color:var(--muted);font-size:12px}
.rooms-seal{justify-self:end;text-align:center}
.rooms-seal span{width:86px;height:86px;display:grid;place-items:center;margin:0 auto 7px;border:2px double var(--gold);color:var(--gold);font:34px serif;box-shadow:inset 0 0 0 5px color-mix(in srgb,var(--gold) 7%,transparent)}
.rooms-seal small{color:var(--muted);font-size:10px;letter-spacing:.12em;text-transform:uppercase}

.rooms-continue{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:24px;min-height:300px;margin-top:24px;padding:34px 36px;overflow:hidden}
.rooms-continue-copy{align-self:center}
.rooms-continue h2{font-size:clamp(34px,4vw,52px);margin-bottom:4px}
.rooms-chapter-name{margin:0 0 18px;color:var(--muted);font:400 19px/1.35 Georgia,serif}
.rooms-progress,.rooms-overall-track{height:6px;overflow:hidden;border-radius:999px;background:color-mix(in srgb,var(--line) 65%,transparent)}
.rooms-progress span,.rooms-overall-track span{display:block;height:100%;background:var(--gold)}
.rooms-progress-meta{display:flex;justify-content:space-between;gap:16px;margin:7px 0 20px;color:var(--muted);font-size:11px}
.rooms-primary-link{display:inline-flex;align-items:center;min-height:46px;padding:0 18px;border:1px solid var(--gold);border-radius:999px;color:var(--gold-2);text-decoration:none}
.rooms-companion{position:relative;min-height:230px}
.rooms-companion .character-art{right:10px;width:220px!important;height:245px!important}
.rooms-companion-quote{right:135px!important;top:28px!important;width:190px!important}

.rooms-scrolls{margin-top:52px}
.rooms-section-head{display:flex;align-items:end;justify-content:space-between;gap:20px;margin-bottom:15px}
.rooms-section-head h2{margin:0;font-size:clamp(30px,4vw,44px)}
.rooms-section-head--compact{align-items:center}
.rooms-tab-counts{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px}
.rooms-tab-counts span{padding:6px 10px;border:1px solid var(--line);border-radius:999px;color:var(--muted);font-size:10px}
.rooms-tabs{display:flex;gap:8px;margin-bottom:12px;border-bottom:1px solid var(--line)}
.rooms-tabs button{padding:11px 14px;border:0;border-bottom:2px solid transparent;background:transparent;color:var(--muted)}
.rooms-tabs button.is-active{border-bottom-color:var(--gold);color:var(--gold-2)}
.rooms-tab-panel{display:none}
.rooms-tab-panel.is-active{display:block}
.rooms-bookmarks{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.rooms-bookmarks a{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:17px 18px;border:1px solid var(--line);border-radius:14px;background:var(--surface-2);color:var(--text);text-decoration:none}
.rooms-bookmarks small,.rooms-bookmarks strong{display:block}
.rooms-bookmarks small{color:var(--muted);font-size:10px}
.rooms-bookmarks i{color:var(--gold);font-style:normal;font-size:11px;white-space:nowrap}
.rooms-empty-note{padding:24px;border:1px dashed var(--line);border-radius:14px;color:var(--muted);background:color-mix(in srgb,var(--surface-2) 76%,transparent)}

.rooms-traces{margin-top:42px}
.rooms-counter{min-width:46px;height:46px;display:grid;place-items:center;border:1px solid var(--line-strong);border-radius:50%;color:var(--gold-2);font:700 18px Georgia,serif}

.rooms-lower-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin-top:18px}
.rooms-path h2{font-size:34px}
.rooms-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:18px}
.rooms-stats div{padding:13px;border:1px solid var(--line);border-radius:12px;background:var(--surface-2);text-align:center}
.rooms-stats strong,.rooms-stats span{display:block}
.rooms-stats strong{color:var(--gold-2);font:700 22px Georgia,serif}
.rooms-stats span{margin-top:3px;color:var(--muted);font-size:9px}
.rooms-table{position:relative;overflow:hidden}
.rooms-table:after{content:"影";position:absolute;right:-15px;bottom:-60px;color:var(--gold);font:180px/1 serif;opacity:.04}
.rooms-table-seal{width:52px;height:52px;display:grid;place-items:center;margin:10px 0 18px;border:1px solid var(--gold);color:var(--gold);font:22px serif}
.rooms-table p:last-child{max-width:420px;font:italic 18px/1.6 Georgia,serif}

.rooms-settings{width:min(720px,calc(100% - 22px));max-height:92vh;padding:0;border:0;border-radius:22px;background:transparent;color:var(--text)}
.rooms-settings::backdrop{background:rgba(0,0,0,.66);backdrop-filter:blur(5px)}
.rooms-settings-card{position:relative;display:grid;gap:17px;padding:30px;border:1px solid var(--line-strong);border-radius:22px;background:var(--surface);box-shadow:var(--shadow)}
.rooms-settings-card>label{display:grid;gap:7px;color:var(--muted)}
.rooms-settings-card input[type="text"],.rooms-settings-card input:not([type]),.rooms-settings-card select{width:100%;padding:13px;border:1px solid var(--line);border-radius:11px;background:var(--surface-2);color:var(--text)}
.rooms-settings-close{position:absolute;right:14px;top:12px;width:38px;height:38px;border:0;background:transparent;color:var(--muted);font-size:28px}
.rooms-settings-security{padding-top:18px;border-top:1px solid var(--line)}
.rooms-login-links{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:12px}
.rooms-login-links a{padding:8px 11px;border:1px solid var(--line);border-radius:999px;text-decoration:none}

html[data-theme="light"] .rooms-avatar img{filter:drop-shadow(0 8px 12px rgba(70,45,26,.15))}

@media(max-width:820px){
  .rooms-identity{grid-template-columns:88px 1fr 90px;gap:16px;padding-inline:8px}
  .rooms-avatar{width:84px;height:84px}.rooms-avatar img{max-height:84px}
  .rooms-seal span{width:66px;height:66px;font-size:26px}
  .rooms-continue{grid-template-columns:1fr}
  .rooms-companion{min-height:210px}
  .rooms-companion .character-art{position:relative!important;right:auto!important;margin:0 auto!important}
  .rooms-companion-quote{position:relative!important;inset:auto!important;width:100%!important;margin:0!important}
  .rooms-lower-grid{grid-template-columns:1fr}
}
@media(max-width:620px){
  .rooms-v2{width:calc(100% - 16px);padding-top:12px}
  .rooms-topbar{align-items:flex-start;flex-direction:column}
  .rooms-topbar-actions{width:100%;justify-content:space-between}
  .rooms-furnish-toggle{font-size:11px}
  .rooms-identity{grid-template-columns:72px 1fr;align-items:center;padding:14px 4px 22px}
  .rooms-avatar{width:70px;height:70px}.rooms-avatar img{max-height:70px}
  .rooms-seal{grid-column:1/-1;justify-self:start;display:flex;align-items:center;gap:10px;margin-top:4px}
  .rooms-seal span{width:48px;height:48px;margin:0;font-size:20px}
  .rooms-identity h1{font-size:38px}
  .rooms-continue{padding:22px 18px}
  .rooms-progress-meta{flex-direction:column;gap:3px}
  .rooms-section-head{align-items:flex-start;flex-direction:column}
  .rooms-tab-counts{justify-content:flex-start}
  .rooms-tabs{overflow-x:auto}
  .rooms-bookmarks{grid-template-columns:1fr}
  .rooms-traces{padding:19px}
  .my-comments-list{grid-template-columns:1fr}
  .rooms-stats{grid-template-columns:1fr 1fr 1fr}
  .rooms-settings-card{padding:24px 16px}
}


/* =========================================================
   POKOI v2 — native reader bookmarks / annotations
   ========================================================= */
#nativeReaderBridge{display:none}
.rooms-tab-counts b{font:inherit;color:inherit}
.rooms-native-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.rooms-native-card{
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;
  gap:13px;
  padding:17px 18px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--surface-2);
  color:var(--text);
  text-decoration:none;
}
.rooms-native-card:hover,
.rooms-native-annotation:hover{border-color:var(--line-strong)}
.rooms-native-icon{
  width:34px;height:34px;display:grid;place-items:center;
  border:1px solid var(--line-strong);
  border-radius:50%;
  color:var(--gold);
  font-size:13px;
}
.rooms-native-copy{min-width:0}
.rooms-native-copy small,.rooms-native-copy strong{display:block}
.rooms-native-copy small{color:var(--muted);font-size:10px}
.rooms-native-copy strong{margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rooms-native-card i{color:var(--gold);font-style:normal;font-size:11px;white-space:nowrap}

.rooms-native-annotations{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.rooms-native-annotation{
  display:flex;
  min-height:160px;
  flex-direction:column;
  justify-content:space-between;
  gap:16px;
  padding:19px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--surface-2);
  color:var(--text);
  text-decoration:none;
}
.rooms-native-annotation blockquote{
  margin:0;
  font:italic 16px/1.55 Georgia,serif;
}
.rooms-native-annotation footer{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:12px;
  color:var(--muted);
  font-size:10px;
}
.rooms-native-annotation footer span{color:var(--gold-2)}
.rooms-native-annotation footer small{white-space:nowrap}

@media(max-width:680px){
  .rooms-native-grid,
  .rooms-native-annotations{grid-template-columns:1fr}
  .rooms-native-card{grid-template-columns:auto minmax(0,1fr)}
  .rooms-native-card i{grid-column:2}
}

.rooms-personal-notes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.rooms-personal-note{display:flex;min-height:220px;flex-direction:column;gap:14px;padding:19px;border:1px solid var(--line);border-radius:14px;background:var(--surface-2)}
.rooms-personal-note blockquote{margin:0;color:var(--muted);font:italic 14px/1.5 Georgia,serif}
.rooms-personal-note>p{margin:0;flex:1;white-space:pre-wrap;font:17px/1.55 Georgia,serif}
.rooms-personal-note footer{display:flex;flex-direction:column;gap:9px;padding-top:12px;border-top:1px solid var(--line);color:var(--muted);font-size:10px}
.rooms-note-actions{display:flex;flex-wrap:wrap;gap:10px}
.rooms-note-actions a,.rooms-note-actions button{padding:0;border:0;background:none;color:var(--gold);font:inherit;text-decoration:none;cursor:pointer}
.rooms-note-actions button:last-child{color:var(--muted)}
@media(max-width:680px){.rooms-personal-notes{grid-template-columns:1fr}}


/* =========================================================
   Покои · личные заметки — polished v1
   ========================================================= */

.rooms-tab-panel[data-rooms-panel="notes"]{
  max-width:1180px;
}

.rooms-personal-notes{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:18px;
  align-items:start;
}

.rooms-personal-note{
  position:relative;
  display:flex;
  flex-direction:column;
  min-height:0;
  padding:22px 22px 18px;
  gap:17px;
  overflow:hidden;
  border:1px solid rgba(177,125,57,.42);
  border-radius:16px;
  background:
    radial-gradient(circle at 100% 0,rgba(180,125,58,.055),transparent 34%),
    rgba(21,13,15,.76);
  box-shadow:0 14px 38px rgba(0,0,0,.10);
  transition:border-color .18s ease,transform .18s ease,box-shadow .18s ease;
}

.rooms-personal-note:hover{
  border-color:rgba(202,150,73,.62);
  transform:translateY(-1px);
  box-shadow:0 18px 44px rgba(0,0,0,.14);
}

.rooms-personal-note__top{
  display:grid;
  grid-template-columns:28px minmax(0,1fr);
  gap:11px;
  align-items:start;
}

.rooms-personal-note__mark{
  display:grid;
  place-items:center;
  width:26px;
  height:26px;
  border:1px solid rgba(194,139,67,.46);
  border-radius:50%;
  color:#c7934d;
  font:13px/1 Georgia,serif;
}

.rooms-personal-note blockquote{
  margin:2px 0 0;
  color:#cbb89e;
  font:italic 14px/1.55 Georgia,"Times New Roman",serif;
  letter-spacing:.005em;
}

.rooms-personal-note__text{
  margin:0;
  color:#f0e3d2;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  font:600 18px/1.55 Georgia,"Times New Roman",serif;
}

.rooms-personal-note footer{
  display:flex;
  flex-direction:column;
  gap:13px;
  margin-top:3px;
  padding-top:14px;
  border-top:1px solid rgba(177,125,57,.25);
}

.rooms-personal-note__meta{
  display:flex;
  flex-wrap:wrap;
  justify-content:space-between;
  gap:6px 16px;
  color:#bba58b;
  font:11px/1.4 system-ui,-apple-system,"Segoe UI",sans-serif;
}

.rooms-personal-note__date{
  color:#7f7061;
}

.rooms-note-actions{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
}

.rooms-note-action,
.rooms-note-actions .rooms-note-action{
  display:inline-flex;
  align-items:center;
  min-height:34px;
  box-sizing:border-box;
  margin:0;
  padding:0 11px;
  border:1px solid rgba(177,125,57,.30);
  border-radius:999px;
  background:rgba(177,125,57,.045);
  color:#c9954d;
  font:600 11px/1 system-ui,-apple-system,"Segoe UI",sans-serif;
  text-decoration:none;
  cursor:pointer;
  transition:background .16s ease,border-color .16s ease,color .16s ease;
}

.rooms-note-action:hover,
.rooms-note-actions .rooms-note-action:hover{
  border-color:rgba(201,149,74,.58);
  background:rgba(177,125,57,.10);
  color:#e1b46d;
}

.rooms-note-action--place{
  margin-right:auto!important;
}

.rooms-note-action--delete,
.rooms-note-actions .rooms-note-action--delete{
  color:#927c70;
  border-color:rgba(143,106,88,.25);
  background:transparent;
}

.rooms-note-action--delete:hover,
.rooms-note-actions .rooms-note-action--delete:hover{
  color:#c18f7b;
  border-color:rgba(172,111,88,.48);
  background:rgba(137,72,52,.08);
}

@media(max-width:980px){
  .rooms-personal-notes{
    grid-template-columns:1fr;
  }
}

@media(max-width:600px){
  .rooms-personal-notes{gap:12px}
  .rooms-personal-note{
    padding:18px 15px 15px;
    border-radius:13px;
    gap:14px;
  }
  .rooms-personal-note__top{
    grid-template-columns:24px minmax(0,1fr);
    gap:9px;
  }
  .rooms-personal-note__mark{
    width:22px;height:22px;font-size:11px;
  }
  .rooms-personal-note blockquote{font-size:13px}
  .rooms-personal-note__text{font-size:17px}
  .rooms-personal-note__meta{
    flex-direction:column;
    gap:3px;
  }
  .rooms-note-actions{
    display:grid;
    grid-template-columns:1fr 1fr;
  }
  .rooms-note-action--place{
    grid-column:1/-1;
    justify-content:center;
    margin-right:0!important;
  }
  .rooms-note-action{
    justify-content:center;
  }
}


/* =========================================================
   Покои · Продолжить чтение
   ========================================================= */

.rooms-continue{
  position:relative;
  max-width:1180px;
  margin:0 0 26px;
  padding:22px 24px;
  overflow:hidden;
  border:1px solid rgba(184,130,60,.48);
  border-radius:17px;
  background:
    radial-gradient(circle at 88% 20%,rgba(187,128,55,.10),transparent 30%),
    linear-gradient(135deg,rgba(40,24,25,.88),rgba(19,12,15,.92));
  box-shadow:0 18px 48px rgba(0,0,0,.12);
}

.rooms-continue[hidden]{display:none!important}

.rooms-continue::after{
  content:"影";
  position:absolute;
  right:28px;
  top:-17px;
  color:rgba(197,139,65,.055);
  font:92px/1 Georgia,serif;
  pointer-events:none;
}

.rooms-continue__eyebrow{
  position:relative;
  z-index:1;
  margin-bottom:12px;
  color:#a98a68;
  font:600 10px/1.2 system-ui,-apple-system,"Segoe UI",sans-serif;
  text-transform:uppercase;
  letter-spacing:.18em;
}

.rooms-continue__body{
  position:relative;
  z-index:1;
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:28px;
}

.rooms-continue__copy{
  min-width:0;
  max-width:760px;
}

.rooms-continue h2{
  margin:0 0 8px;
  color:#f0dfc8;
  font:600 25px/1.15 Georgia,"Times New Roman",serif;
}

.rooms-continue__excerpt{
  margin:0 0 10px;
  max-width:720px;
  color:#c6b29a;
  font:italic 14px/1.55 Georgia,"Times New Roman",serif;
}

.rooms-continue__meta{
  color:#8e7b69;
  font:11px/1.4 system-ui,-apple-system,"Segoe UI",sans-serif;
}

.rooms-continue__button{
  display:inline-flex;
  flex:0 0 auto;
  align-items:center;
  justify-content:center;
  min-height:44px;
  padding:0 17px;
  border:1px solid rgba(196,142,72,.58);
  border-radius:999px;
  background:rgba(183,126,56,.08);
  color:#d5a35f;
  font:600 12px/1 system-ui,-apple-system,"Segoe UI",sans-serif;
  text-decoration:none;
  transition:background .16s ease,border-color .16s ease,transform .16s ease;
}

.rooms-continue__button:hover{
  border-color:rgba(216,163,90,.78);
  background:rgba(183,126,56,.14);
  transform:translateY(-1px);
}

@media(max-width:700px){
  .rooms-continue{
    margin-bottom:18px;
    padding:19px 16px 16px;
    border-radius:14px;
  }
  .rooms-continue__body{
    display:block;
  }
  .rooms-continue h2{font-size:22px}
  .rooms-continue__excerpt{font-size:13px}
  .rooms-continue__button{
    width:100%;
    box-sizing:border-box;
    margin-top:16px;
  }
}


/* =========================================================
   Continue reading · layout correction v2
   Используем родной верхний hero Покоев, второй блок не рисуем.
   ========================================================= */

.rooms-continue{
  display:none!important;
}

.account-reading-excerpt{
  max-width:520px;
  margin:14px 0 8px;
  color:#b9a58e;
  font:italic 14px/1.55 Georgia,"Times New Roman",serif;
}

.account-reading-meta{
  margin:0 0 16px;
  color:#8d7965;
  font:11px/1.4 system-ui,-apple-system,"Segoe UI",sans-serif;
}

/* Не позволяем hero последнего чтения раздувать страницу из-за динамического текста. */
[data-reading-title]{
  max-width:620px;
  overflow-wrap:anywhere;
}

@media(max-width:700px){
  .account-reading-excerpt{
    max-width:none;
    font-size:13px;
  }
}


/* =========================================================
   Покои · История чтения
   ========================================================= */

.rooms-history-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:24px;
  max-width:1180px;
  margin:8px 0 22px;
}

.rooms-history-kicker{
  margin-bottom:7px;
  color:#a87b42;
  font:600 10px/1.2 system-ui,-apple-system,"Segoe UI",sans-serif;
  text-transform:uppercase;
  letter-spacing:.18em;
}

.rooms-history-head h2{
  margin:0;
  color:#eee0cf;
  font:600 27px/1.1 Georgia,"Times New Roman",serif;
}

.rooms-history-clear{
  padding:0;
  border:0;
  border-bottom:1px solid transparent;
  background:none;
  color:#806f60;
  font:11px/1.5 system-ui,-apple-system,"Segoe UI",sans-serif;
  cursor:pointer;
}
.rooms-history-clear:hover{
  color:#b99a77;
  border-bottom-color:#765b3e;
}

.rooms-history-list{
  display:flex;
  flex-direction:column;
  max-width:1180px;
  border-top:1px solid rgba(177,125,57,.30);
}

.rooms-history-item{
  display:grid;
  grid-template-columns:42px minmax(0,1fr);
  gap:16px;
  padding:19px 4px 19px 0;
  border-bottom:1px solid rgba(177,125,57,.22);
}

.rooms-history-item__number{
  padding-top:3px;
  color:#705b47;
  font:11px/1.4 system-ui,-apple-system,"Segoe UI",sans-serif;
  letter-spacing:.08em;
}

.rooms-history-item__main{min-width:0}

.rooms-history-item__top{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:18px;
}

.rooms-history-item h3{
  margin:0;
  color:#ead9c4;
  font:600 18px/1.3 Georgia,"Times New Roman",serif;
}

.rooms-history-item__top > span{
  flex:0 0 auto;
  color:#78695c;
  font:10px/1.4 system-ui,-apple-system,"Segoe UI",sans-serif;
}

.rooms-history-item p{
  max-width:800px;
  margin:7px 0 13px;
  overflow:hidden;
  color:#a99580;
  text-overflow:ellipsis;
  white-space:nowrap;
  font:italic 13px/1.5 Georgia,"Times New Roman",serif;
}

.rooms-history-item__bottom{
  display:grid;
  grid-template-columns:minmax(120px,280px) auto 1fr;
  align-items:center;
  gap:12px;
}

.rooms-history-progress{
  height:2px;
  overflow:hidden;
  background:rgba(177,125,57,.16);
}
.rooms-history-progress span{
  display:block;
  height:100%;
  background:#a97739;
}

.rooms-history-item__meta{
  color:#806f60;
  font:10px/1.3 system-ui,-apple-system,"Segoe UI",sans-serif;
  white-space:nowrap;
}

.rooms-history-item a{
  justify-self:end;
  color:#c28c43;
  font:600 11px/1.4 system-ui,-apple-system,"Segoe UI",sans-serif;
  text-decoration:none;
}
.rooms-history-item a:hover{color:#dfa75e}

.rooms-history-empty{
  max-width:1180px;
  padding:34px 0;
  color:#897665;
  font:italic 15px/1.5 Georgia,"Times New Roman",serif;
}

@media(max-width:700px){
  .rooms-history-head{
    align-items:flex-start;
    margin-bottom:15px;
  }
  .rooms-history-head h2{font-size:23px}
  .rooms-history-item{
    grid-template-columns:28px minmax(0,1fr);
    gap:10px;
    padding:16px 0;
  }
  .rooms-history-item__top{
    display:block;
  }
  .rooms-history-item__top > span{
    display:block;
    margin-top:3px;
  }
  .rooms-history-item p{
    white-space:normal;
    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
  }
  .rooms-history-item__bottom{
    grid-template-columns:1fr auto;
  }
  .rooms-history-progress{
    grid-column:1/-1;
  }
  .rooms-history-item a{justify-self:end}
}


/* History placement/hide correction */
[data-rooms-panel="history"][hidden]{
  display:none!important;
}

[data-rooms-panel="history"]{
  max-width:1180px;
  padding-top:16px;
}

button.rooms-history-clear{
  appearance:none;
  -webkit-appearance:none;
  min-height:0;
  padding:0 0 2px!important;
  border:0!important;
  border-bottom:1px solid transparent!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  color:#806f60!important;
  font:11px/1.5 system-ui,-apple-system,"Segoe UI",sans-serif!important;
  text-transform:none!important;
  letter-spacing:0!important;
}

button.rooms-history-clear:hover{
  color:#b99a77!important;
  border-bottom-color:#765b3e!important;
}

/* history v3 hard fix */
.rooms-tab-panel[hidden],
[data-rooms-panel][hidden]{display:none!important}

[data-rooms-panel="history"]:not([hidden]){
  display:block!important;
}

[data-rooms-panel="history"] .rooms-history-head{
  display:flex!important;
  align-items:flex-end;
  justify-content:space-between;
  gap:20px;
  margin:0 0 22px!important;
}

[data-rooms-panel="history"] .rooms-history-kicker{
  margin:0 0 7px!important;
  color:#a87b42!important;
  font:600 10px/1.2 system-ui,-apple-system,"Segoe UI",sans-serif!important;
  letter-spacing:.18em!important;
  text-transform:uppercase!important;
}

[data-rooms-panel="history"] .rooms-history-head h2{
  margin:0!important;
  color:#eee0cf!important;
  font:600 27px/1.1 Georgia,"Times New Roman",serif!important;
}

[data-rooms-panel="history"] button[data-reading-history-clear]{
  all:unset;
  box-sizing:border-box;
  cursor:pointer;
  color:#8d7966;
  font:11px/1.4 system-ui,-apple-system,"Segoe UI",sans-serif;
  border-bottom:1px solid rgba(166,118,60,.28);
  padding:3px 0;
}
[data-rooms-panel="history"] button[data-reading-history-clear]:hover{
  color:#c59a62;
  border-bottom-color:#9b6d37;
}


/* =========================================================
   History v4 — clean tab integration
   История теперь обычная вкладка внутри «Моих свитков».
   ========================================================= */

.rooms-tab-panel[data-rooms-panel="history"]{
  display:none!important;
  max-width:none!important;
  padding-top:18px!important;
}

.rooms-tab-panel[data-rooms-panel="history"].is-active{
  display:block!important;
}

.rooms-tab-panel[data-rooms-panel="history"] .rooms-history-head{
  display:flex!important;
  align-items:flex-end!important;
  justify-content:space-between!important;
  gap:18px!important;
  margin:0 0 18px!important;
}

.rooms-tab-panel[data-rooms-panel="history"] .rooms-history-head h2{
  margin:0!important;
  font:600 28px/1.1 Georgia,"Times New Roman",serif!important;
  color:var(--text)!important;
}

.rooms-tab-panel[data-rooms-panel="history"] .rooms-history-clear{
  all:unset!important;
  box-sizing:border-box!important;
  cursor:pointer!important;
  padding:3px 0!important;
  color:var(--muted)!important;
  font:11px/1.4 system-ui,-apple-system,"Segoe UI",sans-serif!important;
  border-bottom:1px solid transparent!important;
}

.rooms-tab-panel[data-rooms-panel="history"] .rooms-history-clear:hover{
  color:var(--gold)!important;
  border-bottom-color:var(--line-strong)!important;
}


/* =========================================================
   Покои · единый поиск по свиткам
   ========================================================= */

.pokoi-search{
  max-width:1180px;
  margin:0 0 18px;
}

.pokoi-search__field{
  position:relative;
  display:flex;
  align-items:center;
  max-width:620px;
  height:46px;
  border:1px solid rgba(177,125,57,.34);
  border-radius:999px;
  background:rgba(18,11,14,.48);
  transition:border-color .16s ease,background .16s ease;
}

.pokoi-search__field:focus-within{
  border-color:rgba(205,151,75,.70);
  background:rgba(24,14,17,.68);
}

.pokoi-search__icon{
  flex:0 0 auto;
  margin-left:17px;
  color:#9d7544;
  font:19px/1 Georgia,serif;
}

.pokoi-search input{
  width:100%;
  height:100%;
  min-width:0;
  padding:0 10px;
  border:0;
  outline:0;
  background:transparent;
  color:#eadbc8;
  font:14px/1 system-ui,-apple-system,"Segoe UI",sans-serif;
}

.pokoi-search input::placeholder{color:#78695d}

.pokoi-search [data-pokoi-search-clear]{
  all:unset;
  flex:0 0 auto;
  display:grid;
  place-items:center;
  width:34px;
  height:34px;
  margin-right:6px;
  border-radius:50%;
  color:#8f7966;
  cursor:pointer;
  font:18px/1 system-ui,sans-serif;
}
.pokoi-search [data-pokoi-search-clear]:hover{
  background:rgba(177,125,57,.08);
  color:#c99a5b;
}
.pokoi-search [data-pokoi-search-clear][hidden]{display:none!important}

.pokoi-search__hint{
  margin:7px 0 0 18px;
  color:#66594f;
  font:10px/1.3 system-ui,-apple-system,"Segoe UI",sans-serif;
  letter-spacing:.04em;
}

.rooms-tab-panel[data-rooms-panel="search"]{
  display:none!important;
  max-width:none!important;
  padding-top:18px!important;
}
.rooms-tab-panel[data-rooms-panel="search"].is-active{
  display:block!important;
}

.pokoi-search-results-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:18px;
  max-width:1180px;
  margin:0 0 17px;
}

.pokoi-search-results-kicker{
  margin-bottom:6px;
  color:#a87b42;
  font:600 10px/1.2 system-ui,-apple-system,"Segoe UI",sans-serif;
  text-transform:uppercase;
  letter-spacing:.18em;
}

.pokoi-search-results-head h2{
  margin:0;
  color:#eee0cf;
  font:600 27px/1.1 Georgia,"Times New Roman",serif;
}

.pokoi-search-results-head > span{
  color:#79695b;
  font:11px/1.4 system-ui,-apple-system,"Segoe UI",sans-serif;
}

.pokoi-search-results{
  max-width:1180px;
  border-top:1px solid rgba(177,125,57,.28);
}

.pokoi-search-result{
  display:grid;
  grid-template-columns:82px minmax(0,1fr) auto;
  align-items:center;
  gap:16px;
  padding:17px 2px;
  border-bottom:1px solid rgba(177,125,57,.20);
}

.pokoi-search-result__type{
  align-self:start;
  padding-top:3px;
  color:#a87940;
  font:600 9px/1.3 system-ui,-apple-system,"Segoe UI",sans-serif;
  text-transform:uppercase;
  letter-spacing:.12em;
}

.pokoi-search-result__body{min-width:0}

.pokoi-search-result__top{
  display:flex;
  align-items:baseline;
  gap:12px;
}

.pokoi-search-result h3{
  margin:0;
  color:#e8d8c4;
  font:600 16px/1.3 Georgia,"Times New Roman",serif;
}

.pokoi-search-result__top span{
  color:#75665a;
  font:10px/1.3 system-ui,-apple-system,"Segoe UI",sans-serif;
}

.pokoi-search-result p{
  margin:5px 0 0;
  overflow:hidden;
  color:#a99580;
  text-overflow:ellipsis;
  white-space:nowrap;
  font:italic 13px/1.5 Georgia,"Times New Roman",serif;
}

.pokoi-search-result__go{
  color:#c18c46;
  font:600 11px/1.4 system-ui,-apple-system,"Segoe UI",sans-serif;
  text-decoration:none;
  white-space:nowrap;
}
.pokoi-search-result__go:hover{color:#dfa85f}

.pokoi-search-empty{
  display:flex;
  flex-direction:column;
  gap:7px;
  max-width:1180px;
  padding:32px 0;
}
.pokoi-search-empty strong{
  color:#cdbca7;
  font:600 16px/1.4 Georgia,"Times New Roman",serif;
}
.pokoi-search-empty span{
  color:#79695c;
  font:12px/1.5 system-ui,-apple-system,"Segoe UI",sans-serif;
}

@media(max-width:700px){
  .pokoi-search__field{max-width:none}
  .pokoi-search__hint{display:none}
  .pokoi-search-results-head{align-items:flex-start}
  .pokoi-search-results-head h2{font-size:23px}
  .pokoi-search-result{
    grid-template-columns:1fr auto;
    gap:8px 12px;
    padding:15px 0;
  }
  .pokoi-search-result__type{
    grid-column:1/-1;
    padding:0;
  }
  .pokoi-search-result__top{
    display:block;
  }
  .pokoi-search-result__top span{
    display:block;
    margin-top:2px;
  }
  .pokoi-search-result p{
    white-space:normal;
    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
  }
  .pokoi-search-result__go{
    align-self:end;
  }
}


/* =========================================================
   Search visual fix v2 — isolated from global form styles
   ========================================================= */

.rooms-scrolls > .pokoi-search{
  display:block!important;
  width:min(620px,calc(100% - 2px))!important;
  margin:4px 0 20px!important;
  padding:0!important;
  border:0!important;
  background:transparent!important;
}

.rooms-scrolls .pokoi-searchbox{
  box-sizing:border-box!important;
  display:flex!important;
  align-items:center!important;
  width:100%!important;
  height:46px!important;
  margin:0!important;
  padding:0 7px 0 16px!important;
  overflow:hidden!important;
  border:1px solid rgba(181,128,61,.42)!important;
  border-radius:999px!important;
  background:rgba(20,12,15,.72)!important;
  box-shadow:none!important;
  cursor:text!important;
}

.rooms-scrolls .pokoi-searchbox:focus-within{
  border-color:rgba(214,158,79,.78)!important;
  background:rgba(25,14,18,.88)!important;
}

.rooms-scrolls .pokoi-searchbox__glyph{
  display:block!important;
  flex:0 0 auto!important;
  margin:0 11px 1px 0!important;
  padding:0!important;
  color:#a9793f!important;
  font:20px/1 Georgia,"Times New Roman",serif!important;
}

.rooms-scrolls input.pokoi-searchbox__input{
  all:unset!important;
  box-sizing:border-box!important;
  display:block!important;
  flex:1 1 auto!important;
  width:100%!important;
  min-width:0!important;
  height:44px!important;
  color:#eadbc8!important;
  caret-color:#d39b52!important;
  font:14px/44px system-ui,-apple-system,"Segoe UI",sans-serif!important;
  cursor:text!important;
}

.rooms-scrolls input.pokoi-searchbox__input::placeholder{
  color:#75675d!important;
  opacity:1!important;
}

.rooms-scrolls button.pokoi-searchbox__clear{
  all:unset!important;
  box-sizing:border-box!important;
  display:grid!important;
  place-items:center!important;
  flex:0 0 32px!important;
  width:32px!important;
  height:32px!important;
  border-radius:50%!important;
  color:#8e7865!important;
  font:18px/1 system-ui,sans-serif!important;
  cursor:pointer!important;
}

.rooms-scrolls button.pokoi-searchbox__clear:hover{
  background:rgba(180,126,57,.10)!important;
  color:#d09a53!important;
}

.rooms-scrolls button.pokoi-searchbox__clear[hidden]{
  display:none!important;
}

.rooms-scrolls .pokoi-search__hint{
  display:block!important;
  margin:7px 0 0 17px!important;
  padding:0!important;
  border:0!important;
  background:none!important;
  color:#695b50!important;
  font:10px/1.3 system-ui,-apple-system,"Segoe UI",sans-serif!important;
  font-weight:400!important;
  text-transform:none!important;
  letter-spacing:.035em!important;
}

@media(max-width:700px){
  .rooms-scrolls > .pokoi-search{
    width:100%!important;
    margin-bottom:14px!important;
  }
  .rooms-scrolls .pokoi-search__hint{
    display:none!important;
  }
}


/* =========================================================
   POKOI · Profile settings v3 — desktop + mobile
   ========================================================= */

.sr-only{
  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;
}

.rooms-settings{
  box-sizing:border-box!important;
  width:min(920px,calc(100vw - 48px))!important;
  max-width:none!important;
  max-height:min(88dvh,860px)!important;
  margin:auto!important;
  padding:0!important;
  overflow:hidden!important;
  border:1px solid var(--line-strong)!important;
  border-radius:20px!important;
  background:var(--surface)!important;
  color:var(--text)!important;
  box-shadow:0 30px 110px rgba(0,0,0,.48)!important;
}

.rooms-settings::backdrop{
  background:rgba(4,2,4,.74)!important;
  backdrop-filter:blur(7px)!important;
  -webkit-backdrop-filter:blur(7px)!important;
}

.rooms-settings-card{
  box-sizing:border-box!important;
  display:grid!important;
  grid-template-rows:auto minmax(0,1fr) auto!important;
  width:100%!important;
  max-height:min(88dvh,860px)!important;
  margin:0!important;
  padding:0!important;
  gap:0!important;
  overflow:hidden!important;
  border:0!important;
  border-radius:20px!important;
  background:
    radial-gradient(circle at 92% 2%,rgba(187,130,61,.065),transparent 28%),
    var(--surface)!important;
  box-shadow:none!important;
}

.rooms-settings-head{
  position:relative;
  z-index:4;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:28px;
  padding:25px 30px 20px;
  border-bottom:1px solid var(--line);
  background:color-mix(in srgb,var(--surface) 94%,transparent);
}

.rooms-settings-head .eyebrow{margin:0 0 7px}
.rooms-settings-head h2{
  margin:0!important;
  color:var(--text);
  font:600 clamp(28px,3vw,38px)/1.08 Georgia,"Times New Roman",serif!important;
}
.rooms-settings-intro{
  max-width:590px;
  margin:8px 0 0;
  color:var(--muted);
  font:12px/1.55 system-ui,-apple-system,"Segoe UI",sans-serif;
}

.rooms-settings-close{
  all:unset!important;
  box-sizing:border-box!important;
  display:grid!important;
  place-items:center!important;
  flex:0 0 36px!important;
  width:36px!important;height:36px!important;
  border-radius:50%!important;
  color:var(--muted)!important;
  font:25px/1 system-ui,sans-serif!important;
  cursor:pointer!important;
}
.rooms-settings-close:hover{
  background:var(--surface-2)!important;
  color:var(--text)!important;
}

.rooms-settings-scroll{
  min-height:0;
  overflow:auto;
  overscroll-behavior:contain;
  scrollbar-width:thin;
  padding:24px 30px 28px;
}

.rooms-settings-grid{
  display:grid;
  grid-template-columns:minmax(0,1.02fr) minmax(340px,.98fr);
  gap:22px;
  align-items:start;
}

.rooms-settings-section,
.rooms-settings-security{
  box-sizing:border-box;
  min-width:0;
}

.rooms-settings-section{
  padding:19px;
  border:1px solid var(--line);
  border-radius:16px;
  background:rgba(255,255,255,.018);
}

.rooms-settings-section-head{
  display:grid;
  grid-template-columns:28px minmax(0,1fr);
  gap:11px;
  align-items:start;
  margin-bottom:17px;
}

.rooms-settings-section-head>span{
  display:grid;
  place-items:center;
  width:26px;height:26px;
  border:1px solid var(--line-strong);
  border-radius:50%;
  color:var(--gold);
  font:600 9px/1 system-ui,sans-serif;
}

.rooms-settings-section-head h3{
  margin:0!important;
  color:var(--text);
  font:600 17px/1.25 Georgia,"Times New Roman",serif!important;
}
.rooms-settings-section-head p{
  margin:4px 0 0;
  color:var(--muted);
  font:11px/1.45 system-ui,-apple-system,"Segoe UI",sans-serif;
}

.rooms-settings-name{
  display:grid!important;
  gap:7px!important;
  margin:0 0 16px!important;
  color:var(--muted)!important;
  font-size:11px!important;
}
.rooms-settings-name input{
  box-sizing:border-box!important;
  width:100%!important;
  min-height:46px!important;
  padding:0 13px!important;
  border:1px solid var(--line)!important;
  border-radius:11px!important;
  background:var(--surface-2)!important;
  color:var(--text)!important;
  font:15px/1 system-ui,-apple-system,"Segoe UI",sans-serif!important;
  outline:none!important;
}
.rooms-settings-name input:focus{
  border-color:var(--gold)!important;
  box-shadow:0 0 0 3px color-mix(in srgb,var(--gold) 12%,transparent)!important;
}

/* addressing */
.rooms-settings .addressing-fieldset{
  margin:0!important;
  padding:0!important;
  border:0!important;
}
.rooms-settings .addressing-fieldset legend{
  margin:0 0 8px!important;
  padding:0!important;
  color:var(--muted)!important;
  font:600 11px/1.3 system-ui,sans-serif!important;
}
.rooms-settings .addressing-options{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:7px!important;
}
.rooms-settings .addressing-options span{
  box-sizing:border-box!important;
  min-height:76px!important;
  padding:10px!important;
  border-radius:10px!important;
}
.rooms-settings .addressing-options strong{
  font-size:12px!important;
}
.rooms-settings .addressing-options small{
  font-size:9px!important;
}

/* companions */
.rooms-settings .appearance-fieldset{
  margin:0!important;
  padding:0!important;
  border:0!important;
}
.rooms-settings .avatar-gallery{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:9px!important;
}
.rooms-settings .avatar-choice{
  display:block!important;
  min-width:0!important;
  cursor:pointer!important;
}
.rooms-settings .avatar-choice__visual{
  box-sizing:border-box!important;
  display:flex!important;
  align-items:flex-end!important;
  justify-content:center!important;
  height:118px!important;
  padding:5px 4px 0!important;
  overflow:hidden!important;
  border-radius:12px!important;
}
.rooms-settings .avatar-choice__visual img{
  max-width:94%!important;
  max-height:108px!important;
  object-fit:contain!important;
}
.rooms-settings .avatar-choice__name{
  margin-top:5px!important;
  font-size:10px!important;
}

/* security */
.rooms-settings-security{
  margin-top:22px!important;
  padding:19px!important;
  border:1px solid var(--line)!important;
  border-radius:16px!important;
  background:rgba(255,255,255,.014)!important;
}

.rooms-security-row{
  display:grid;
  grid-template-columns:minmax(170px,1fr) auto auto;
  gap:14px;
  align-items:center;
  min-width:0;
}

.rooms-security-row>div:first-child small,
.rooms-security-row>div:first-child strong{display:block}
.rooms-security-row>div:first-child small{
  margin-bottom:3px;color:var(--muted);font-size:9px;text-transform:uppercase;letter-spacing:.08em
}
.rooms-security-row>div:first-child strong{
  overflow:hidden;color:var(--text);font-size:12px;text-overflow:ellipsis;white-space:nowrap
}

.rooms-settings .rooms-login-links{
  display:flex!important;
  justify-content:flex-end!important;
  gap:7px!important;
  margin:0!important;
}
.rooms-settings .rooms-login-links a{
  padding:7px 10px!important;
  font-size:10px!important;
}

.rooms-logout-button{
  width:auto!important;
  min-height:34px!important;
  padding:0 10px!important;
  border:1px solid rgba(157,91,91,.32)!important;
  border-radius:9px!important;
  color:#b88a85!important;
  white-space:nowrap!important;
}

/* sticky actions */
.rooms-settings-actions{
  position:relative;
  z-index:4;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  padding:15px 30px;
  border-top:1px solid var(--line);
  background:color-mix(in srgb,var(--surface) 95%,transparent);
  box-shadow:0 -12px 30px rgba(0,0,0,.09);
}
.rooms-settings-actions>span{
  color:var(--muted);
  font:10px/1.4 system-ui,-apple-system,"Segoe UI",sans-serif;
}
.rooms-settings-actions .primary{
  width:auto!important;
  min-width:220px!important;
  margin:0!important;
  padding:12px 18px!important;
}

/* tablet */
@media(max-width:820px){
  .rooms-settings{
    width:min(720px,calc(100vw - 28px))!important;
    max-height:92dvh!important;
  }
  .rooms-settings-card{max-height:92dvh!important}
  .rooms-settings-grid{
    grid-template-columns:1fr!important;
  }
  .rooms-settings .avatar-gallery{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
  }
  .rooms-settings .avatar-choice__visual{
    height:105px!important;
  }
  .rooms-settings .avatar-choice__visual img{
    max-height:96px!important;
  }
}

/* phone */
@media(max-width:560px){
  .rooms-settings{
    width:100vw!important;
    height:100dvh!important;
    max-height:100dvh!important;
    margin:0!important;
    border:0!important;
    border-radius:0!important;
  }
  .rooms-settings-card{
    height:100dvh!important;
    max-height:100dvh!important;
    border-radius:0!important;
  }
  .rooms-settings-head{
    padding:17px 16px 14px!important;
    gap:12px!important;
  }
  .rooms-settings-head h2{
    font-size:28px!important;
  }
  .rooms-settings-intro{
    max-width:92%;
    margin-top:6px;
    font-size:11px;
  }
  .rooms-settings-close{
    flex-basis:34px!important;
    width:34px!important;height:34px!important;
  }
  .rooms-settings-scroll{
    padding:15px 12px 20px!important;
  }
  .rooms-settings-section{
    padding:15px!important;
    border-radius:14px!important;
  }
  .rooms-settings-grid{
    gap:12px!important;
  }
  .rooms-settings-section-head{
    grid-template-columns:24px minmax(0,1fr)!important;
    gap:9px!important;
    margin-bottom:13px!important;
  }
  .rooms-settings-section-head>span{
    width:22px!important;height:22px!important;font-size:8px!important;
  }
  .rooms-settings-section-head h3{
    font-size:16px!important;
  }
  .rooms-settings-section-head p{
    font-size:10px!important;
  }

  .rooms-settings .addressing-options{
    grid-template-columns:1fr!important;
    gap:6px!important;
  }
  .rooms-settings .addressing-options span{
    min-height:54px!important;
    padding:9px 11px!important;
  }
  .rooms-settings .addressing-options span::after{
    display:none!important;
  }

  .rooms-settings .avatar-gallery{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
  }
  .rooms-settings .avatar-choice__visual{
    height:110px!important;
  }
  .rooms-settings .avatar-choice__visual img{
    max-height:100px!important;
  }

  .rooms-settings-security{
    margin-top:12px!important;
    padding:15px!important;
    border-radius:14px!important;
  }
  .rooms-security-row{
    grid-template-columns:1fr!important;
    gap:10px!important;
  }
  .rooms-settings .rooms-login-links{
    justify-content:flex-start!important;
  }
  .rooms-settings .rooms-login-links a,
  .rooms-logout-button{
    min-height:34px!important;
  }

  .rooms-settings-actions{
    padding:11px 12px max(11px,env(safe-area-inset-bottom))!important;
  }
  .rooms-settings-actions>span{
    display:none!important;
  }
  .rooms-settings-actions .primary{
    width:100%!important;
    min-width:0!important;
    min-height:46px!important;
  }
}


/* =========================================================
   POKOI · Profile scrollbar polish
   ========================================================= */

.rooms-settings-scroll{
  scrollbar-width:thin;
  scrollbar-color:rgba(189,139,72,.55) transparent;
}

.rooms-settings-scroll::-webkit-scrollbar{
  width:8px;
}

.rooms-settings-scroll::-webkit-scrollbar-track{
  background:transparent;
}

.rooms-settings-scroll::-webkit-scrollbar-thumb{
  min-height:46px;
  border:2px solid transparent;
  border-radius:999px;
  background:
    linear-gradient(
      180deg,
      rgba(210,157,87,.72),
      rgba(157,104,48,.58)
    )
    padding-box;
}

.rooms-settings-scroll::-webkit-scrollbar-thumb:hover{
  background:
    linear-gradient(
      180deg,
      rgba(224,174,103,.88),
      rgba(177,119,58,.74)
    )
    padding-box;
}

.rooms-settings-scroll::-webkit-scrollbar-corner{
  background:transparent;
}

/* На телефоне полоса тоньше и визуально спокойнее */
@media(max-width:560px){
  .rooms-settings-scroll::-webkit-scrollbar{
    width:5px;
  }

  .rooms-settings-scroll{
    scrollbar-color:rgba(189,139,72,.42) transparent;
  }
}


/* =========================================================
   POKOI · Personal seal maker
   ========================================================= */

.rooms-seal--round span{border-radius:50%!important}
.rooms-seal--diamond span{
  transform:rotate(45deg);
}
.rooms-seal--diamond span::first-letter{
  transform:rotate(-45deg);
}

.rooms-settings-section--seal{
  grid-column:1/-1;
}

.seal-maker{
  display:grid;
  grid-template-columns:150px minmax(0,1fr);
  gap:22px;
  align-items:center;
}

.seal-maker__preview{
  display:grid;
  justify-items:center;
  gap:8px;
  padding:17px 12px;
  border:1px dashed rgba(177,125,57,.28);
  border-radius:14px;
  background:rgba(177,125,57,.025);
}

.seal-maker__preview small{
  color:var(--muted);
  font:9px/1.2 system-ui,-apple-system,"Segoe UI",sans-serif;
  text-transform:uppercase;
  letter-spacing:.12em;
}

.seal-maker__stamp{
  width:82px;
  height:82px;
  display:grid;
  place-items:center;
  box-sizing:border-box;
  border:2px double var(--gold);
  color:var(--gold);
  background:color-mix(in srgb,var(--gold) 4%,transparent);
  box-shadow:inset 0 0 0 5px color-mix(in srgb,var(--gold) 7%,transparent);
  font:32px/1 Georgia,"Times New Roman",serif;
  transition:border-radius .18s ease,transform .18s ease;
}

.seal-maker__stamp--square{border-radius:2px}
.seal-maker__stamp--round{border-radius:50%}
.seal-maker__stamp--diamond{
  width:66px;
  height:66px;
  margin:8px;
  transform:rotate(45deg);
}
.seal-maker__stamp--diamond span{
  transform:rotate(-45deg);
}

.seal-maker__controls{
  min-width:0;
}

.seal-maker__label,
.seal-custom>span,
.seal-shapes legend{
  display:block;
  margin:0 0 7px;
  color:var(--muted);
  font:600 10px/1.3 system-ui,-apple-system,"Segoe UI",sans-serif;
}

.seal-presets{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  margin-bottom:14px;
}

.seal-preset{
  all:unset;
  box-sizing:border-box;
  display:grid;
  place-items:center;
  width:42px;
  height:42px;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--surface-2);
  color:var(--muted);
  font:20px/1 Georgia,"Times New Roman",serif;
  cursor:pointer;
}

.seal-preset:hover{
  border-color:var(--line-strong);
  color:var(--text);
}

.seal-preset.is-active{
  border-color:var(--gold);
  color:var(--gold);
  box-shadow:0 0 0 2px color-mix(in srgb,var(--gold) 10%,transparent);
}

.seal-custom{
  display:grid;
  gap:0;
  max-width:190px;
  margin-bottom:14px;
}

.rooms-settings .seal-custom input{
  box-sizing:border-box!important;
  width:100%!important;
  min-height:42px!important;
  padding:0 12px!important;
  border:1px solid var(--line)!important;
  border-radius:10px!important;
  background:var(--surface-2)!important;
  color:var(--text)!important;
  text-align:center!important;
  font:20px/1 Georgia,"Times New Roman",serif!important;
  outline:none!important;
}

.rooms-settings .seal-custom input:focus{
  border-color:var(--gold)!important;
}

.seal-shapes{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  margin:0;
  padding:0;
  border:0;
}

.seal-shapes legend{
  width:100%;
}

.seal-shapes label{
  position:relative;
  cursor:pointer;
}

.seal-shapes input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}

.seal-shapes span{
  display:flex;
  align-items:center;
  min-height:34px;
  box-sizing:border-box;
  padding:0 10px;
  border:1px solid var(--line);
  border-radius:999px;
  background:var(--surface-2);
  color:var(--muted);
  font:10px/1 system-ui,-apple-system,"Segoe UI",sans-serif;
}

.seal-shapes input:checked + span{
  border-color:var(--gold);
  color:var(--gold);
  background:color-mix(in srgb,var(--gold) 6%,var(--surface-2));
}

@media(max-width:820px){
  .rooms-settings-section--seal{
    grid-column:auto;
  }
}

@media(max-width:560px){
  .seal-maker{
    grid-template-columns:1fr;
    gap:14px;
  }

  .seal-maker__preview{
    grid-template-columns:auto 1fr;
    align-items:center;
    justify-items:start;
    padding:12px 14px;
  }

  .seal-maker__preview small{
    font-size:9px;
  }

  .seal-maker__stamp{
    width:62px;
    height:62px;
    font-size:26px;
  }

  .seal-maker__stamp--diamond{
    width:50px;
    height:50px;
    margin:6px;
  }

  .seal-presets{
    gap:6px;
  }

  .seal-preset{
    width:39px;
    height:39px;
    font-size:18px;
  }

  .seal-custom{
    max-width:none;
  }

  .seal-shapes{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
  }

  .seal-shapes span{
    justify-content:center;
    padding:0 6px;
  }
}

/* POKOI Seal Atelier v2 */
.seal-symbols{position:absolute;width:0;height:0;overflow:hidden}.rooms-settings-section--seal{grid-column:1/-1}
.seal-atelier{display:grid;grid-template-columns:200px minmax(0,1fr);gap:22px}.seal-paper{min-height:220px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;border:1px solid rgba(177,125,57,.3);border-radius:14px;background:rgba(177,125,57,.025)}.seal-paper>div:last-child{text-align:center}.seal-paper strong{display:block;color:var(--text);font:600 13px Georgia,serif}.seal-paper small{color:var(--muted);font:9px system-ui,sans-serif}
.seal-stamp{position:relative;width:108px;height:108px;display:grid;place-items:center;box-sizing:border-box;border:3px double #a84d43;color:#a84d43;box-shadow:inset 0 0 0 5px rgba(168,77,67,.07)}.seal-stamp>svg:first-child{width:68%;height:68%;fill:none;stroke:currentColor;stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round}.seal-stamp>svg:first-child use[href="#seal-paw"]{fill:currentColor}.seal-stamp b{position:absolute;right:7px;bottom:5px;font:700 15px Georgia,serif}.seal-accent{position:absolute;left:7px;top:7px;width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:2.5}.seal-accent[hidden]{display:none}.seal-stamp--round{border-radius:50%}.seal-stamp--diamond{width:84px;height:84px;margin:12px;transform:rotate(45deg)}.seal-stamp--diamond>*{transform:rotate(-45deg)}.seal-stamp--worn{opacity:.9}.seal-stamp--ancient{opacity:.72;filter:contrast(.9)}
.seal-tools{display:grid;gap:15px}.seal-caption,.seal-choices legend{display:block;width:100%;margin:0 0 8px;color:var(--muted);font:600 10px system-ui,sans-serif}.seal-motifs{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:7px}.seal-motif{all:unset;box-sizing:border-box;display:grid;justify-items:center;gap:4px;padding:7px 2px;border:1px solid var(--line);border-radius:9px;color:var(--muted);cursor:pointer;background:var(--surface-2)}.seal-motif svg{width:27px;height:27px;fill:none;stroke:currentColor;stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round}.seal-motif small{font:8px system-ui,sans-serif}.seal-motif:hover,.seal-motif.is-active{border-color:var(--gold);color:var(--gold)}.seal-row{display:grid;grid-template-columns:1fr 1.5fr;gap:15px;align-items:end;padding-top:13px;border-top:1px solid rgba(177,125,57,.18)}.seal-inscription small{display:block;margin-top:4px;color:var(--muted);font:8px system-ui,sans-serif}.rooms-settings .seal-inscription input{box-sizing:border-box;width:100%;height:36px;border:1px solid var(--line);border-radius:8px;background:var(--surface-2);color:var(--text);text-align:center;font:18px Georgia,serif}.seal-choices{display:flex;flex-wrap:wrap;gap:6px;margin:0;padding:0;border:0}.seal-choices label{position:relative}.seal-choices input{position:absolute;opacity:0}.seal-choices span{display:flex;align-items:center;min-height:31px;padding:0 9px;border:1px solid var(--line);border-radius:999px;color:var(--muted);font:9px system-ui,sans-serif;cursor:pointer}.seal-choices input:checked+span{border-color:var(--gold);color:var(--gold)}
@media(max-width:820px){.rooms-settings-section--seal{grid-column:auto}.seal-atelier{grid-template-columns:150px 1fr}.seal-motifs{grid-template-columns:repeat(4,1fr)}}@media(max-width:560px){.seal-atelier{grid-template-columns:1fr}.seal-paper{min-height:145px;flex-direction:row}.seal-stamp{width:78px;height:78px}.seal-stamp--diamond{width:62px;height:62px;margin:8px}.seal-motifs{grid-template-columns:repeat(4,1fr)}.seal-row{grid-template-columns:1fr}.seal-choices span{min-height:34px}}


/* =========================================================
   POKOI Seal Atelier v3 — real cinnabar seal
   ========================================================= */

/* Paper / ink feeling instead of "UI icon" */
.seal-paper{
  position:relative;
  overflow:hidden;
  background:
    radial-gradient(circle at 22% 16%,rgba(255,245,222,.11),transparent 28%),
    radial-gradient(circle at 76% 70%,rgba(152,103,58,.06),transparent 38%),
    linear-gradient(145deg,rgba(218,195,156,.085),rgba(117,76,43,.018))!important;
}

.seal-paper::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  opacity:.28;
  background:
    repeating-linear-gradient(
      6deg,
      transparent 0 8px,
      rgba(216,188,145,.025) 9px 10px
    );
}

.seal-stamp{
  --seal-red:#a4473e;
  --seal-red-soft:rgba(164,71,62,.13);
  position:relative!important;
  isolation:isolate;
  color:var(--seal-red)!important;
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
}

/* Outer carved border */
.seal-stamp::before{
  content:"";
  position:absolute;
  inset:3px;
  z-index:-1;
  border:3px solid currentColor;
  border-radius:inherit;
  box-shadow:
    inset 0 0 0 2px rgba(164,71,62,.18),
    0 0 0 1px rgba(164,71,62,.24);
}

/* imperfect ink gaps */
.seal-stamp::after{
  content:"";
  position:absolute;
  inset:0;
  z-index:5;
  pointer-events:none;
  border-radius:inherit;
  background:
    radial-gradient(circle at 18% 22%,rgba(22,12,10,.33) 0 1.1px,transparent 1.5px),
    radial-gradient(circle at 73% 17%,rgba(22,12,10,.23) 0 1px,transparent 1.4px),
    radial-gradient(circle at 42% 78%,rgba(22,12,10,.28) 0 1.2px,transparent 1.6px),
    radial-gradient(circle at 84% 62%,rgba(22,12,10,.22) 0 .9px,transparent 1.3px),
    linear-gradient(112deg,transparent 0 46%,rgba(22,12,10,.17) 47% 48%,transparent 49% 100%);
  mix-blend-mode:multiply;
  opacity:.48;
}

.seal-stamp--clean::after{opacity:.14}
.seal-stamp--worn::after{opacity:.42}
.seal-stamp--ancient::after{
  opacity:.68;
  background:
    radial-gradient(circle at 11% 19%,rgba(22,12,10,.45) 0 1.3px,transparent 1.7px),
    radial-gradient(circle at 25% 71%,rgba(22,12,10,.38) 0 1.6px,transparent 2px),
    radial-gradient(circle at 72% 22%,rgba(22,12,10,.34) 0 1.1px,transparent 1.5px),
    radial-gradient(circle at 83% 76%,rgba(22,12,10,.42) 0 1.5px,transparent 1.9px),
    repeating-linear-gradient(118deg,transparent 0 12px,rgba(22,12,10,.12) 13px 14px);
}

/* Motif: one visual size / baseline for every drawing */
.seal-stamp>svg:first-child{
  position:absolute;
  left:50%;
  top:50%;
  width:58%!important;
  height:58%!important;
  transform:translate(-50%,-50%);
  transform-box:fill-box;
  transform-origin:center;
  overflow:visible;
  stroke-width:3!important;
}

/* Per-symbol optical centering */
.seal-stamp[data-motif="lotus"]>svg:first-child{transform:translate(-50%,-49%) scale(.93)}
.seal-stamp[data-motif="paw"]>svg:first-child{transform:translate(-50%,-49%) scale(.88)}
.seal-stamp[data-motif="moon"]>svg:first-child{transform:translate(-47%,-50%) scale(.92)}
.seal-stamp[data-motif="plum"]>svg:first-child{transform:translate(-50%,-50%) scale(.84)}
.seal-stamp[data-motif="bamboo"]>svg:first-child{transform:translate(-49%,-50%) scale(.93)}
.seal-stamp[data-motif="crane"]>svg:first-child{transform:translate(-47%,-49%) scale(.92)}
.seal-stamp[data-motif="fan"]>svg:first-child{transform:translate(-50%,-47%) scale(.90)}
.seal-stamp[data-motif="blade"]>svg:first-child{transform:translate(-50%,-50%) scale(.82)}
.seal-stamp[data-motif="ink"]>svg:first-child{transform:translate(-50%,-49%) scale(.86)}
.seal-stamp[data-motif="lantern"]>svg:first-child{transform:translate(-50%,-50%) scale(.84)}
.seal-stamp[data-motif="moth"]>svg:first-child{transform:translate(-50%,-48%) scale(.86)}
.seal-stamp[data-motif="cloud"]>svg:first-child{transform:translate(-50%,-49%) scale(.92)}

.seal-stamp b{
  right:9px!important;
  bottom:7px!important;
  z-index:3;
  color:currentColor;
  font:700 14px/1 "Noto Serif CJK SC","Songti SC","SimSun",Georgia,serif!important;
  letter-spacing:-.07em;
  opacity:.92;
}

.seal-accent{
  left:8px!important;
  top:8px!important;
  z-index:3;
  width:20px!important;
  height:20px!important;
  stroke-width:3!important;
}

/* Diamond should rotate the stone, but keep contents visually upright */
.seal-stamp--diamond{
  width:84px!important;
  height:84px!important;
  margin:12px!important;
  transform:rotate(45deg)!important;
}
.seal-stamp--diamond>svg:first-child,
.seal-stamp--diamond>b,
.seal-stamp--diamond>.seal-accent{
  transform-origin:center!important;
}
.seal-stamp--diamond>svg:first-child{
  transform:translate(-50%,-50%) rotate(-45deg) scale(.78)!important;
}
.seal-stamp--diamond>b{
  transform:rotate(-45deg)!important;
}
.seal-stamp--diamond>.seal-accent{
  transform:rotate(-45deg)!important;
}

/* Motif chooser: align drawings optically too */
.seal-motif{
  min-height:72px;
  align-content:center;
}
.seal-motif svg{
  display:block;
  width:30px!important;
  height:30px!important;
  margin:auto;
  overflow:visible;
  transform-box:fill-box;
  transform-origin:center;
}
.seal-motif[data-seal-motif="lotus"] svg{transform:scale(.92)}
.seal-motif[data-seal-motif="paw"] svg{transform:scale(.82)}
.seal-motif[data-seal-motif="moon"] svg{transform:translateX(2px) scale(.90)}
.seal-motif[data-seal-motif="plum"] svg{transform:scale(.80)}
.seal-motif[data-seal-motif="bamboo"] svg{transform:scale(.88)}
.seal-motif[data-seal-motif="crane"] svg{transform:translateX(2px) scale(.88)}
.seal-motif[data-seal-motif="fan"] svg{transform:translateY(1px) scale(.87)}
.seal-motif[data-seal-motif="blade"] svg{transform:scale(.78)}
.seal-motif[data-seal-motif="ink"] svg{transform:scale(.82)}
.seal-motif[data-seal-motif="lantern"] svg{transform:scale(.80)}
.seal-motif[data-seal-motif="moth"] svg{transform:translateY(1px) scale(.82)}
.seal-motif[data-seal-motif="cloud"] svg{transform:scale(.89)}

/* Actual seal in profile header: cinnabar, not gold UI */
.rooms-seal__stamp{
  color:#a4473e!important;
  border-color:#a4473e!important;
  background:rgba(164,71,62,.025)!important;
  box-shadow:
    inset 0 0 0 4px rgba(164,71,62,.06),
    0 0 0 1px rgba(164,71,62,.18)!important;
}
.rooms-seal__stamp svg{
  width:58%!important;
  height:58%!important;
  stroke-width:3!important;
}
.rooms-seal__stamp b{
  right:5px!important;
  bottom:4px!important;
  color:#a4473e!important;
  font-size:10px!important;
}

/* Light theme: closer to ink on paper */
html[data-theme="light"] .seal-stamp,
html[data-theme="light"] .rooms-seal__stamp{
  --seal-red:#9c352f;
  color:#9c352f!important;
}

@media(max-width:560px){
  .seal-stamp::before{inset:2px}
  .seal-stamp>svg:first-child{width:56%!important;height:56%!important}
  .seal-motif{min-height:66px}
  .seal-motif svg{width:27px!important;height:27px!important}
}


/* =========================================================
   POKOI · На столе / Архив Чёрного Лотоса
   ========================================================= */

.rooms-black-lotus-table{
  position:relative;
  min-height:330px;
  overflow:hidden!important;
}

.rooms-black-lotus-table::before{
  content:"";
  position:absolute;
  right:-35px;
  bottom:-54px;
  width:180px;
  height:180px;
  border:1px solid rgba(167,115,56,.07);
  border-radius:50%;
  box-shadow:inset 0 0 0 10px rgba(167,115,56,.018);
}

.rooms-black-lotus-head{
  position:relative;
  z-index:2;
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:16px;
}

.rooms-black-lotus-head h2{
  margin:3px 0 0!important;
  font-size:24px!important;
}

.rooms-black-lotus-count{
  color:var(--muted);
  font:9px/1.2 system-ui,-apple-system,"Segoe UI",sans-serif;
  text-transform:uppercase;
  letter-spacing:.08em;
  white-space:nowrap;
}

.rooms-black-lotus-empty{
  position:relative;
  z-index:1;
  display:grid;
  grid-template-columns:64px minmax(0,1fr);
  gap:16px;
  align-items:center;
  margin-top:30px;
}

.rooms-black-lotus-empty .rooms-table-seal{
  margin:0!important;
}

.rooms-black-lotus-empty p{
  margin:0!important;
  color:var(--muted);
  font:italic 13px/1.55 Georgia,"Times New Roman",serif;
}

.rooms-black-lotus-stack{
  position:relative;
  z-index:2;
  height:184px;
  margin:17px 0 4px;
}

.rooms-black-lotus-note{
  all:unset;
  box-sizing:border-box;
  position:absolute;
  width:74%;
  min-height:116px;
  padding:14px 16px;
  border:1px solid rgba(171,118,57,.30);
  background:
    linear-gradient(145deg,rgba(46,27,29,.96),rgba(25,15,18,.98));
  color:var(--text);
  box-shadow:0 13px 30px rgba(0,0,0,.18);
  cursor:pointer;
  transition:transform .17s ease,border-color .17s ease;
}

.rooms-black-lotus-note:hover{
  z-index:8;
  border-color:rgba(196,143,75,.57);
  transform:translateY(-3px)!important;
}

.rooms-black-lotus-note--1{left:0;top:3px;transform:rotate(-1.2deg)}
.rooms-black-lotus-note--2{right:0;top:35px;transform:rotate(1deg)}
.rooms-black-lotus-note--3{left:9%;top:66px;transform:rotate(-.35deg)}

.rooms-black-lotus-note small{
  display:block;
  overflow:hidden;
  margin-bottom:5px;
  color:#947143;
  font:8px/1.2 system-ui,-apple-system,"Segoe UI",sans-serif;
  text-overflow:ellipsis;
  text-transform:uppercase;
  letter-spacing:.08em;
  white-space:nowrap;
}

.rooms-black-lotus-note strong{
  display:block;
  overflow:hidden;
  color:#e8d8c4;
  font:600 15px/1.25 Georgia,"Times New Roman",serif;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.rooms-black-lotus-note p{
  display:-webkit-box;
  overflow:hidden;
  margin:7px 0 0!important;
  color:#9f8c79;
  font:italic 11px/1.45 Georgia,"Times New Roman",serif;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
}

.rooms-black-lotus-more{
  all:unset;
  position:relative;
  z-index:3;
  color:var(--gold);
  font:600 10px/1.3 system-ui,-apple-system,"Segoe UI",sans-serif;
  cursor:pointer;
}

.rooms-lotus-archive,
.rooms-lotus-reading{
  width:min(720px,calc(100vw - 32px));
  max-height:min(82dvh,760px);
  padding:0;
  border:1px solid var(--line-strong);
  border-radius:18px;
  background:#171014;
  color:#eadbc8;
  box-shadow:0 30px 110px rgba(0,0,0,.48);
}

.rooms-lotus-reading{
  width:min(680px,calc(100vw - 32px));
}

.rooms-lotus-archive::backdrop,
.rooms-lotus-reading::backdrop{
  background:rgba(4,2,4,.76);
  backdrop-filter:blur(7px);
}

.rooms-lotus-archive__card{
  display:grid;
  grid-template-rows:auto minmax(0,1fr);
  max-height:min(82dvh,760px);
}

.rooms-lotus-archive__card>header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  padding:22px 24px 17px;
  border-bottom:1px solid var(--line);
}

.rooms-lotus-archive__card h2,
.rooms-lotus-reading h2{
  margin:2px 0 0!important;
}

.rooms-lotus-archive__card header button,
.rooms-lotus-reading>article>button{
  all:unset;
  display:grid;
  place-items:center;
  width:34px;
  height:34px;
  border-radius:50%;
  color:#9a8672;
  font:24px/1 system-ui,sans-serif;
  cursor:pointer;
}

.rooms-lotus-archive__body{
  min-height:0;
  overflow:auto;
  padding:8px 24px 24px;
}

.rooms-lotus-archive__item{
  all:unset;
  box-sizing:border-box;
  display:block;
  width:100%;
  padding:15px 2px;
  border-bottom:1px solid rgba(177,125,57,.18);
  cursor:pointer;
}

.rooms-lotus-archive__item span{
  display:block;
  margin-bottom:4px;
  color:#8b6a43;
  font:8px/1.2 system-ui,sans-serif;
  text-transform:uppercase;
  letter-spacing:.08em;
}

.rooms-lotus-archive__item strong{
  color:#e5d4bf;
  font:600 16px/1.3 Georgia,serif;
}

.rooms-lotus-reading>article{
  position:relative;
  max-height:min(82dvh,760px);
  overflow:auto;
  padding:45px clamp(24px,6vw,56px) 42px;
}

.rooms-lotus-reading>article>button{
  position:absolute;
  right:18px;
  top:16px;
}

.rooms-lotus-reading [data-table-lotus-content]{
  margin-top:24px;
  color:#d9cdbc;
  font:17px/1.75 Georgia,"Times New Roman",serif;
}

.rooms-lotus-reading__source{
  margin:28px 0 0!important;
  color:#d0b999;
  font:600 16px/1.4 Georgia,serif;
}

.rooms-lotus-reading [data-table-lotus-chapter]{
  display:block;
  margin-top:19px;
  padding-top:13px;
  border-top:1px solid rgba(177,125,57,.18);
  color:#75675b;
  font:9px/1.3 system-ui,sans-serif;
}

@media(max-width:700px){
  .rooms-black-lotus-table{min-height:300px}
  .rooms-black-lotus-head{align-items:flex-start}
  .rooms-black-lotus-head h2{font-size:21px!important}
  .rooms-black-lotus-stack{height:auto;display:grid;gap:8px;margin-top:14px}
  .rooms-black-lotus-note{
    position:relative!important;
    inset:auto!important;
    width:100%!important;
    min-height:0!important;
    transform:none!important;
    padding:12px 13px!important;
  }
  .rooms-black-lotus-note--3{display:none}
  .rooms-lotus-archive,
  .rooms-lotus-reading{
    width:calc(100vw - 16px);
    max-height:92dvh;
    border-radius:14px;
  }
  .rooms-lotus-reading>article{
    max-height:92dvh;
    padding:42px 20px 30px;
  }
  .rooms-lotus-reading [data-table-lotus-content]{
    font-size:15px;
    line-height:1.7;
  }
}


/* Black Lotus reveal rule: before the first discovery, "На столе" stays ordinary. */
.rooms-table--quiet{
  min-height:260px;
}
.rooms-table--quiet .rooms-table-seal{
  margin:22px 0 12px;
}

/* STRICT REVEAL: before first discovery, the table must look 100% ordinary. */
.rooms-table--quiet{
  min-height:230px!important;
  background:var(--surface)!important;
}
.rooms-table--quiet::before,
.rooms-table--quiet::after{
  content:none!important;
}
.rooms-table--quiet .rooms-table__ordinary-note{
  max-width:34rem;
  margin:34px 0 0!important;
  color:var(--muted);
  font:italic 14px/1.7 Georgia,"Times New Roman",serif;
}


/* Memories / Personal archive v3 */
.pokoi-memory-head{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;margin:10px 0 28px}.pokoi-memory-head h2{margin:.2rem 0 .45rem}.pokoi-memory-head p{margin:0;max-width:760px;line-height:1.6}.pokoi-memory-count{border:1px solid rgba(154,91,25,.25);border-radius:999px;padding:8px 13px;color:var(--ink-soft,#805b43);font-size:13px;white-space:nowrap}.pokoi-memory-notice{margin:0 0 22px;padding:14px 17px;border:1px solid rgba(166,103,32,.28);border-radius:14px;background:rgba(187,127,55,.08)}.pokoi-memory-chapter{margin:0 0 38px}.pokoi-memory-chapter>h3{font-family:Georgia,serif;font-weight:400;font-size:30px;margin:4px 0 18px;color:var(--ink,#35231b)}.pokoi-memory-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.pokoi-memory-card{overflow:hidden;border:1px solid rgba(120,75,35,.22);background:rgba(255,250,242,.48);border-radius:18px}.pokoi-memory-photo{aspect-ratio:4/3;background:#d9c8b2;overflow:hidden;display:grid;place-items:center;font-family:Georgia,serif;font-size:42px;color:#9b6a32}.pokoi-memory-photo img{display:block;width:100%;height:100%;object-fit:cover}.pokoi-memory-body{padding:18px}.pokoi-memory-body h4{font-family:Georgia,serif;font-size:28px;font-weight:400;margin:4px 0 16px}.pokoi-memory-body>strong{display:block;font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:#a36524;margin-bottom:7px}.pokoi-memory-body>p:last-child{line-height:1.65;margin:0}.pokoi-memory-empty{padding:30px}.rooms-tabs [data-rooms-tab="memories"] span{display:inline-block;margin-left:5px;font-size:.75em;opacity:.7}@media(max-width:900px){.pokoi-memory-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:620px){.pokoi-memory-grid{grid-template-columns:1fr}.pokoi-memory-head{align-items:flex-start;flex-direction:column}}


/* POKOI v4 — selectable title + independent profile avatar */
.rooms-avatar--profile{
  overflow:hidden;
  background:color-mix(in srgb,var(--panel) 88%,transparent);
}
.rooms-avatar--profile img{
  width:100%!important;
  height:100%!important;
  max-width:none!important;
  max-height:none!important;
  object-fit:cover!important;
  object-position:center;
  filter:none!important;
}
.rooms-rank{
  margin:.35rem 0 0;
  font-size:.78rem;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--muted);
}
.rooms-title-fieldset,
.profile-avatar-fieldset{
  border:0;
  padding:0;
  margin:18px 0 0;
}
.rooms-title-fieldset legend{
  font:600 13px/1.2 Georgia,serif;
  color:var(--text);
  margin-bottom:7px;
}
.rooms-field-hint{
  margin:0 0 10px;
  font-size:12px;
  line-height:1.45;
  color:var(--muted);
}
.rooms-title-options{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.rooms-title-options label{
  position:relative;
  cursor:pointer;
}
.rooms-title-options input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}
.rooms-title-options span{
  display:block;
  padding:9px 12px;
  border:1px solid color-mix(in srgb,var(--line) 90%,transparent);
  border-radius:999px;
  background:color-mix(in srgb,var(--panel) 88%,transparent);
  color:var(--muted);
  font-size:12px;
  transition:.18s ease;
}
.rooms-title-options input:checked + span{
  border-color:var(--gold);
  color:var(--gold);
  box-shadow:0 0 0 1px color-mix(in srgb,var(--gold) 18%,transparent) inset;
}
.profile-avatar-gallery{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
}
.profile-avatar-choice{
  position:relative;
  cursor:pointer;
  min-width:0;
}
.profile-avatar-choice input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}
.profile-avatar-choice__visual{
  display:block;
  aspect-ratio:1/1;
  overflow:hidden;
  border-radius:18px;
  border:1px solid color-mix(in srgb,var(--line) 90%,transparent);
  background:color-mix(in srgb,var(--panel) 88%,transparent);
  transition:.18s ease;
}
.profile-avatar-choice__visual img{
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:center;
}
.profile-avatar-choice input:checked + .profile-avatar-choice__visual{
  border-color:var(--gold);
  box-shadow:0 0 0 2px color-mix(in srgb,var(--gold) 22%,transparent);
}
.profile-avatar-choice__name{
  display:block;
  margin-top:6px;
  text-align:center;
  font-size:11px;
  line-height:1.25;
  color:var(--muted);
}
.profile-avatar-choice input:checked ~ .profile-avatar-choice__name{
  color:var(--gold);
  font-weight:700;
}
.profile-avatar-choice__upload{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:4px;
}
.profile-avatar-choice__upload b{
  font-size:30px;
  font-weight:300;
  color:var(--gold);
}
.profile-avatar-choice__upload small{
  color:var(--muted);
}
.profile-avatar-upload{
  display:grid;
  gap:6px;
  margin-top:14px;
}
.profile-avatar-upload>span{
  font-size:12px;
  font-weight:700;
}
.profile-avatar-upload input[type=file]{
  width:100%;
  padding:10px;
  border:1px dashed color-mix(in srgb,var(--line) 90%,transparent);
  border-radius:12px;
  background:color-mix(in srgb,var(--panel) 82%,transparent);
  color:var(--text);
}
.profile-avatar-upload small{
  color:var(--muted);
  font-size:11px;
  line-height:1.4;
}
@media(max-width:900px){
  .profile-avatar-gallery{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:560px){
  .profile-avatar-gallery{grid-template-columns:repeat(2,minmax(0,1fr))}
  .rooms-title-options{gap:6px}
  .rooms-title-options span{padding:8px 10px}
}


/* POKOI v5 — hand-painted seal artwork from the supplied sprite */
.seal-motif--art{
  min-height:88px!important;
  padding:6px 4px 7px!important;
  overflow:hidden;
}
.seal-motif--art>img{
  display:block;
  width:58px;
  height:58px;
  object-fit:contain;
  filter:drop-shadow(0 2px 2px rgba(92,25,17,.16));
  transition:transform .16s ease, filter .16s ease;
}
.seal-motif--art:hover>img,
.seal-motif--art.is-active>img{
  transform:scale(1.05);
  filter:drop-shadow(0 2px 4px rgba(122,42,26,.28));
}
.seal-motif--art small{
  font-size:9px!important;
}
.seal-legacy-symbol,
.seal-legacy-accent{
  opacity:0!important;
  pointer-events:none!important;
}
.seal-art-symbol{
  position:absolute;
  left:50%;
  top:50%;
  width:86%;
  height:86%;
  object-fit:contain;
  transform:translate(-50%,-50%);
  z-index:1;
  pointer-events:none;
}
.seal-stamp>b[data-seal-preview-text]{
  z-index:4;
}
.seal-art-accent{
  position:absolute;
  left:-13px;
  top:-14px;
  width:43px;
  height:43px;
  object-fit:contain;
  z-index:5;
  pointer-events:none;
}
.seal-stamp--diamond>.seal-art-symbol{
  transform:translate(-50%,-50%) rotate(-45deg);
}
.seal-stamp--diamond>.seal-art-accent{
  transform:rotate(-45deg);
}
.seal-accent-choices{
  gap:7px!important;
}
.seal-accent-choices label span{
  min-width:56px;
  min-height:58px!important;
  padding:4px 7px!important;
  border-radius:10px!important;
  display:grid!important;
  place-items:center;
  gap:1px;
}
.seal-accent-choices label span img{
  display:block;
  width:34px;
  height:34px;
  object-fit:contain;
}
.seal-accent-choices label span em{
  font-style:normal;
  font-size:8px;
  line-height:1;
}
@media(max-width:700px){
  .seal-motif--art{min-height:78px!important}
  .seal-motif--art>img{width:48px;height:48px}
  .seal-accent-choices label span{min-width:50px}
}


/* =========================================================
   POKOI v10 — title achievements
   ========================================================= */
.title-unlock-toast{
  margin:16px 0 22px;
  padding:15px 18px;
  display:flex;
  align-items:center;
  gap:14px;
  border:1px solid color-mix(in srgb,var(--gold) 60%,var(--line));
  border-radius:18px;
  background:color-mix(in srgb,var(--panel) 90%,var(--gold) 10%);
  box-shadow:0 16px 36px rgba(77,43,15,.08);
}
.title-unlock-toast__seal{
  width:46px;
  height:46px;
  flex:0 0 46px;
  display:grid;
  place-items:center;
  border:1px solid var(--gold);
  color:var(--gold);
  font:600 22px/1 Georgia,serif;
  transform:rotate(-4deg);
}
.title-unlock-toast strong{display:block;font:600 17px/1.2 Georgia,serif}
.title-unlock-toast p{margin:4px 0 2px;color:var(--gold);font-weight:700}
.title-unlock-toast small{color:var(--muted)}

.rooms-titles-overview{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto auto;
  align-items:center;
  gap:22px;
}
.rooms-titles-overview h2{margin:.15rem 0 .45rem}
.rooms-title-progress{
  min-width:92px;
  padding:12px 16px;
  text-align:center;
  border:1px solid var(--line);
  border-radius:14px;
}
.rooms-title-progress strong{
  display:block;
  font:600 27px/1 Georgia,serif;
  color:var(--gold);
}
.rooms-title-progress span{display:block;margin-top:4px;font-size:10px;color:var(--muted)}
.rooms-title-open-settings{white-space:nowrap}

.rooms-title-collection-head{
  margin:10px 0 12px;
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:end;
}
.rooms-title-collection-head span{
  color:var(--gold);
  font-size:12px;
}
.rooms-title-collection-head b{font-size:17px}
.rooms-title-collection-head small{
  max-width:340px;
  text-align:right;
  color:var(--muted);
  font-size:10px;
  line-height:1.4;
}

.rooms-title-cards{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:9px;
}
.rooms-title-card{
  position:relative;
  display:grid;
  gap:6px;
  min-height:124px;
  padding:13px;
  border:1px solid var(--line);
  border-radius:14px;
  background:color-mix(in srgb,var(--panel) 90%,transparent);
  transition:border-color .18s ease,transform .18s ease,background .18s ease;
}
.rooms-title-card input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}
.rooms-title-card.is-unlocked{cursor:pointer}
.rooms-title-card.is-unlocked:hover{
  transform:translateY(-1px);
  border-color:color-mix(in srgb,var(--gold) 58%,var(--line));
}
.rooms-title-card.is-active{
  border-color:var(--gold);
  background:color-mix(in srgb,var(--panel) 86%,var(--gold) 14%);
  box-shadow:0 0 0 1px color-mix(in srgb,var(--gold) 16%,transparent) inset;
}
.rooms-title-card.is-locked{
  opacity:.58;
  background:color-mix(in srgb,var(--panel) 72%,transparent);
}
.rooms-title-card__top{
  display:flex;
  justify-content:space-between;
  gap:8px;
}
.rooms-title-card__top em{
  font-style:normal;
  font-size:9px;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:var(--gold);
}
.rooms-title-card__top i{
  font-style:normal;
  font-size:9px;
  color:var(--muted);
}
.rooms-title-card>strong{
  font:600 16px/1.15 Georgia,serif;
  color:var(--text);
}
.rooms-title-card>small{
  font-size:10px;
  line-height:1.4;
  color:var(--muted);
}
.rooms-title-card__requirement{
  margin-top:auto;
  padding-top:6px;
  border-top:1px solid color-mix(in srgb,var(--line) 70%,transparent);
  font-size:9px;
  line-height:1.35;
  color:var(--gold);
}
.rooms-title-card.is-locked .rooms-title-card__requirement{color:var(--muted)}

@media(max-width:760px){
  .rooms-titles-overview{
    grid-template-columns:1fr auto;
  }
  .rooms-title-open-settings{
    grid-column:1/-1;
    justify-self:start;
  }
}
@media(max-width:560px){
  .rooms-title-cards{grid-template-columns:1fr}
  .rooms-title-collection-head{align-items:start;flex-direction:column}
  .rooms-title-collection-head small{text-align:left}
}


/* v12 — скрываем общее количество титулов */
.rooms-title-progress span,
.rooms-title-collection-head span{
  letter-spacing:.02em;
}


/* =========================================================
   POKOI v15 — PROFILE REWARDS / AVATAR FRAMES
   ========================================================= */
.frame-unlock-toast{
  margin:16px 0 22px;
  padding:15px 18px;
  display:flex;
  align-items:center;
  gap:14px;
  border:1px solid color-mix(in srgb,#8b6b3d 56%,var(--line));
  border-radius:18px;
  background:color-mix(in srgb,var(--panel) 88%,#b99559 12%);
}
.frame-unlock-toast__seal{
  width:46px;height:46px;flex:0 0 46px;
  display:grid;place-items:center;
  border:1px solid #9b7138;
  color:#9b7138;
  font:600 21px/1 Georgia,serif;
  transform:rotate(3deg);
}
.frame-unlock-toast strong{display:block;font:600 17px/1.2 Georgia,serif}
.frame-unlock-toast p{margin:4px 0 2px;color:#9b7138;font-weight:700}
.frame-unlock-toast small{color:var(--muted)}

.rooms-rewards-overview{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto auto;
  gap:22px;
  align-items:center;
}
.rooms-reward-current{
  min-width:180px;
  display:flex;
  gap:11px;
  align-items:center;
  padding:10px 13px;
  border:1px solid var(--line);
  border-radius:15px;
}
.rooms-reward-current small{display:block;color:var(--muted);font-size:9px;text-transform:uppercase;letter-spacing:.1em}
.rooms-reward-current strong{display:block;margin-top:3px;font:600 14px/1.2 Georgia,serif}
.reward-mini-frame{
  width:40px;height:40px;border-radius:50%;
  display:block;position:relative;flex:0 0 40px;
  background:color-mix(in srgb,var(--panel) 75%,transparent);
}

/* Shared frame construction */
.profile-frame{
  position:relative;
  display:grid;
  place-items:center;
  border-radius:50%;
  isolation:isolate;
}
.profile-frame__inner{
  position:relative;
  z-index:2;
  display:block;
  width:86%;
  height:86%;
  border-radius:inherit;
  overflow:hidden;
  background:var(--panel);
}
.profile-frame__inner img{
  width:100%!important;
  height:100%!important;
  object-fit:cover!important;
  display:block!important;
}
.profile-frame::before,
.profile-frame::after{
  content:"";
  position:absolute;
  border-radius:inherit;
  pointer-events:none;
}
.profile-frame::before{inset:0;z-index:0}
.profile-frame::after{inset:5%;z-index:1}

/* Frames */
.profile-frame--plain::before{background:transparent}
.profile-frame--plain::after{border:1px solid color-mix(in srgb,var(--line) 82%,transparent)}

.profile-frame--silk::before{
  background:linear-gradient(135deg,#f7ead0,#c8b18b,#fff5df,#b99e76);
  box-shadow:0 0 0 1px rgba(137,103,59,.20),0 8px 22px rgba(81,54,20,.12);
}
.profile-frame--silk::after{border:1px solid rgba(255,250,236,.85)}

.profile-frame--bronze::before{
  background:linear-gradient(135deg,#5e381f,#b57942,#6e4528,#d09a5c,#4a2b19);
  box-shadow:0 0 0 1px rgba(86,47,21,.36),0 10px 26px rgba(74,42,16,.18);
}
.profile-frame--bronze::after{border:2px solid rgba(230,181,111,.45)}

.profile-frame--gold::before{
  background:linear-gradient(135deg,#26150c,#9d6a28,#d5ae5b,#4b2b12,#c99843,#1e1009);
  box-shadow:0 0 0 1px rgba(104,67,19,.45),0 0 20px rgba(194,145,58,.16);
}
.profile-frame--gold::after{border:2px solid rgba(235,204,133,.55)}

.profile-frame--jade::before{
  background:linear-gradient(135deg,#163a34,#4f8e77,#b7d3b8,#376a5d,#102f2c);
  box-shadow:0 0 0 1px rgba(25,70,59,.45),0 0 24px rgba(60,132,106,.16);
}
.profile-frame--jade::after{border:2px solid rgba(206,231,207,.48)}

.profile-frame--shadow::before{
  background:linear-gradient(135deg,#070707,#3b2e28,#a17036,#15100e,#060606);
  box-shadow:0 0 0 1px rgba(185,132,57,.40),0 0 28px rgba(0,0,0,.28);
}
.profile-frame--shadow::after{
  border:2px solid rgba(166,116,50,.48);
  box-shadow:inset 0 0 14px rgba(0,0,0,.45);
}

.profile-frame--ink::before{
  background:linear-gradient(135deg,#111216,#4a4e55,#111216,#797e83,#191a1d);
  box-shadow:0 0 0 1px rgba(21,23,27,.45),0 0 18px rgba(25,28,34,.16);
}
.profile-frame--ink::after{border:2px solid rgba(182,188,192,.40)}

.profile-frame--cinnabar::before{
  background:linear-gradient(135deg,#421410,#a83a2f,#e08463,#7c211b,#3d100d);
  box-shadow:0 0 0 1px rgba(112,26,18,.50),0 0 22px rgba(153,49,38,.18);
}
.profile-frame--cinnabar::after{border:2px solid rgba(231,155,125,.48)}

.profile-frame--court::before{
  background:
    linear-gradient(135deg,#20130b,#b27c32,#e3c271,#193e35,#78a58c,#3a2010);
  box-shadow:0 0 0 1px rgba(111,78,33,.45),0 0 26px rgba(125,92,43,.20);
}
.profile-frame--court::after{
  border:2px solid rgba(240,215,154,.60);
  box-shadow:inset 0 0 0 2px rgba(59,103,84,.16);
}

.profile-frame--mystery::before{
  background:linear-gradient(135deg,#433c35,#1d1a18,#5a5047);
}
.profile-frame--mystery::after{border:1px dashed rgba(255,255,255,.24)}
.profile-frame--mystery .profile-frame__inner{
  display:grid;place-items:center;
  background:rgba(17,15,14,.72);
  color:rgba(255,255,255,.55);
}
.profile-frame--mystery b{font:500 25px/1 Georgia,serif}

/* Main profile avatar size preservation */
.rooms-avatar--profile.profile-frame{
  padding:0!important;
  overflow:visible!important;
}
.rooms-avatar--profile.profile-frame .profile-frame__inner{
  width:84%;
  height:84%;
}

/* Mini reward sample */
.reward-mini-frame::before,
.reward-mini-frame::after{content:"";position:absolute;border-radius:50%}
.reward-mini-frame::before{inset:0}
.reward-mini-frame::after{inset:5%}
.reward-mini-frame--plain::before{border:1px solid var(--line)}
.reward-mini-frame--silk::before{background:linear-gradient(135deg,#f7ead0,#c8b18b,#fff5df,#b99e76)}
.reward-mini-frame--bronze::before{background:linear-gradient(135deg,#5e381f,#b57942,#d09a5c,#4a2b19)}
.reward-mini-frame--gold::before{background:linear-gradient(135deg,#26150c,#d5ae5b,#4b2b12,#c99843)}
.reward-mini-frame--jade::before{background:linear-gradient(135deg,#163a34,#b7d3b8,#376a5d)}
.reward-mini-frame--shadow::before{background:linear-gradient(135deg,#070707,#a17036,#060606)}
.reward-mini-frame--ink::before{background:linear-gradient(135deg,#111216,#797e83,#191a1d)}
.reward-mini-frame--cinnabar::before{background:linear-gradient(135deg,#421410,#e08463,#3d100d)}
.reward-mini-frame--court::before{background:linear-gradient(135deg,#b27c32,#193e35,#e3c271)}

/* Settings gallery */
.profile-frame-fieldset{border:0;padding:0;margin:0}
.profile-frame-gallery{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
}
.profile-frame-choice{
  position:relative;
  display:flex;
  align-items:center;
  gap:11px;
  padding:10px;
  border:1px solid var(--line);
  border-radius:15px;
  background:color-mix(in srgb,var(--panel) 90%,transparent);
}
.profile-frame-choice input{position:absolute;opacity:0;pointer-events:none}
.profile-frame-choice.is-unlocked{cursor:pointer}
.profile-frame-choice.is-unlocked:hover{border-color:color-mix(in srgb,var(--gold) 60%,var(--line))}
.profile-frame-choice.is-active{
  border-color:var(--gold);
  box-shadow:0 0 0 1px color-mix(in srgb,var(--gold) 16%,transparent) inset;
}
.profile-frame-choice.is-locked{opacity:.58}
.profile-frame-choice__preview{
  width:62px;
  height:62px;
  flex:0 0 62px;
}
.profile-frame-choice__copy{display:grid;gap:4px;min-width:0}
.profile-frame-choice__copy strong{font:600 13px/1.2 Georgia,serif}
.profile-frame-choice__copy small{font-size:9px;line-height:1.35;color:var(--muted)}

@media(max-width:800px){
  .rooms-rewards-overview{grid-template-columns:1fr auto}
  .rooms-reward-open-settings{grid-column:1/-1;justify-self:start}
  .profile-frame-gallery{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:560px){
  .rooms-rewards-overview{grid-template-columns:1fr}
  .rooms-reward-current{justify-self:start}
  .profile-frame-gallery{grid-template-columns:1fr}
}


/* =========================================================
   POKOI v16 — REWORK OF "ОБУСТРОИТЬ ПОКОИ"
   Goal: no giant dead column; long sections span full width.
   ========================================================= */

.rooms-settings{
  width:min(1180px,calc(100vw - 40px))!important;
  max-height:min(92dvh,940px)!important;
}

.rooms-settings-card{
  max-height:min(92dvh,940px)!important;
}

.rooms-settings-scroll{
  padding:22px 24px 28px!important;
}

.rooms-settings-grid{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
  gap:16px!important;
  align-items:start!important;
}

.rooms-settings-section--wide,
.rooms-settings-security.rooms-settings-section--wide{
  grid-column:1 / -1!important;
}

/* Top pair */
.rooms-settings-section--identity,
.rooms-settings-section--profile-avatar{
  min-height:100%;
}

/* identity is now intentionally compact */
.rooms-settings-section--identity .addressing-fieldset{
  margin-top:14px!important;
}

/* Titles get the full width they actually need */
.rooms-settings-section--titles{
  padding:18px!important;
}
.rooms-settings-section--titles .rooms-title-fieldset{
  margin-top:0!important;
}
.rooms-settings-section--titles .rooms-title-collection-head{
  margin-top:0!important;
}
.rooms-settings-section--titles .rooms-title-cards{
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:9px!important;
}
.rooms-settings-section--titles .rooms-title-card{
  min-height:118px!important;
  padding:12px!important;
}
.rooms-settings-section--titles .rooms-title-card>strong{
  font-size:15px!important;
}

/* Rewards and companion form the next balanced row */
.rooms-settings-section--frames,
.rooms-settings-section--companion{
  align-self:stretch!important;
}
.rooms-settings-section--frames .profile-frame-gallery{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
}

/* Avatar chooser: use available horizontal space better */
.rooms-settings-section--profile-avatar .profile-avatar-gallery{
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:8px!important;
}
.rooms-settings-section--profile-avatar .profile-avatar-choice__visual{
  aspect-ratio:1/1!important;
}

/* Seal atelier should never be squeezed into half a column */
.rooms-settings-section--seal{
  grid-column:1 / -1!important;
}
.rooms-settings-section--seal .seal-maker{
  max-width:none!important;
}

/* Security also belongs on its own row */
.rooms-settings-security{
  grid-column:1 / -1!important;
}

/* Slightly denser cards = less endless scrolling */
.rooms-settings-section{
  padding:17px!important;
}
.rooms-settings-section-head{
  margin-bottom:14px!important;
}
.rooms-settings-section-head h3{
  font-size:16px!important;
}
.rooms-settings-section-head p{
  font-size:10px!important;
}

/* tablet */
@media(max-width:980px){
  .rooms-settings{
    width:min(860px,calc(100vw - 28px))!important;
  }
  .rooms-settings-section--titles .rooms-title-cards{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }
  .rooms-settings-section--profile-avatar .profile-avatar-gallery{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }
}

/* narrow tablet / phone: one clean column */
@media(max-width:760px){
  .rooms-settings-grid{
    grid-template-columns:1fr!important;
  }
  .rooms-settings-section,
  .rooms-settings-section--wide,
  .rooms-settings-security{
    grid-column:1!important;
  }
  .rooms-settings-section--titles .rooms-title-cards{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  .rooms-settings-section--frames .profile-frame-gallery{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
}

@media(max-width:520px){
  .rooms-settings-scroll{
    padding:14px 12px 20px!important;
  }
  .rooms-settings-section--titles .rooms-title-cards{
    grid-template-columns:1fr!important;
  }
  .rooms-settings-section--profile-avatar .profile-avatar-gallery{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  .rooms-settings-section--frames .profile-frame-gallery{
    grid-template-columns:1fr!important;
  }
}


/* =========================================================
   POKOI v17 — hide locked titles completely
   ========================================================= */
.rooms-settings-section--titles .rooms-title-cards{
  align-items:stretch!important;
}
.rooms-settings-section--titles .rooms-title-card{
  opacity:1!important;
}
.rooms-settings-section--titles .rooms-title-card.is-locked{
  display:none!important;
}
.rooms-title-collection-head small{
  color:var(--muted)!important;
}


/* =========================================================
   POKOI v18 — hide locked profile frames completely
   ========================================================= */
.profile-frame-choice.is-locked,
.profile-frame--mystery{
  display:none!important;
}
.profile-frame-gallery{
  align-items:stretch!important;
}


/* =========================================================
   POKOI v23 — selected personal seal in profile header
   ========================================================= */
.rooms-profile-seal{
  display:grid;
  justify-items:center;
  gap:12px;
  min-width:150px;
}
.rooms-profile-seal__stamp{
  width:120px;
  height:120px;
  display:grid;
  place-items:center;
}
.rooms-profile-seal__visual{
  width:96px!important;
  height:96px!important;
}
.rooms-profile-seal__label{
  font-size:11px;
  letter-spacing:.16em;
  color:var(--muted);
}
@media(max-width:720px){
  .rooms-profile-seal{
    min-width:0;
  }
  .rooms-profile-seal__stamp{
    width:92px;
    height:92px;
  }
  .rooms-profile-seal__visual{
    width:76px!important;
    height:76px!important;
  }
}
