/* Weiyang · warm paper, botanical ink. Shared shell and discovery surfaces. */
:root {
  color-scheme: light;
  --bg: #f6f5f0;
  --panel: #fffefa;
  --panel2: #eef1e9;
  --border: #e0e4dc;
  --text: #263e36;
  --muted: #6d7971;
  --accent: #2f6252;
  --accent-bright: #214d40;
  --soft: #e9efe8;
}
body { background: var(--bg); color: var(--text); }
::selection { color: #173c2c; background: #d9e8cc; }
input::placeholder, textarea::placeholder { color: #7d877f; }
button, a { transition: background-color .18s, color .18s, border-color .18s, box-shadow .18s; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.sidebar { background: #fcfcf8; border-right-color: var(--border); }
.module-sidebar { padding-top: 32px; }
.brand { color: #244c3e; font-size: 23px; letter-spacing: 1px; }
.brand-mark { background: #2f6252; color: #fffef5; border: 0; border-radius: 12px; transform: none; width: 38px; height: 40px; }
.brand-mark .icon { fill: #fffefa15; width: 26px; height: 26px; }
.brand small { color: #718478; font-size: 8px; letter-spacing: 1.6px; }
.side-caption { color: #7b877e; font-size: 10px; letter-spacing: .5px; }
.module-sidebar .main-nav { gap: 6px; }
.module-sidebar .nav-item { font-size: 13px; min-height: 46px; color: #68796e; border-radius: 9px; }
.module-sidebar .nav-item:hover { background: #f0f3ec; color: var(--accent); }
.module-sidebar .nav-item.active { background: #e8efe5; color: #2b5c47; font-weight: 600; }
.nav-item.active:before { display: none; }
.nav-item.active .icon { stroke-width: 1.9; }
.nav-dot { background: var(--accent); }
.nav-plus { color: #748277; }
.module-sidebar .sidebar-divider { margin: 23px 12px; }
.side-note { padding: 0 15px; }
.tiny-star { color: #9ba98c; font-size: 25px; }
.side-note p { color: #728169; }
.side-note small { color: #889181; }
.profile-avatar, .avatar-button { background: #edf1e6; border: 1px solid #dce4d3; color: #486345; }
.local-profile div>span, .local-label { color: #7b877b; font-size: 10px; }
.local-profile strong { color: #3e5145; font-size: 13px; }
.topbar { height: 68px; background: #fcfcf9b3; border-color: var(--border); }
.breadcrumb { color: #7d887f; font-size: 12px; }
.breadcrumb span { color: #bac1b7; }
.breadcrumb strong { color: #44574a; }
.module-directory-toggle { min-height: 35px; padding: 7px 12px; font-size: 12px; color: #5f7464; background: #fafbf6; border-color: #dfe5d9; border-radius: 7px; }
.module-directory-toggle:hover { color: #2f6252; background: #e9efe8; border-color: #b7cbbd; }
main { max-width: 1450px; padding-top: 32px; }
.eyebrow, .hub-heading .eyebrow, .module-heading .eyebrow { color: #7f8b79; font-size: 10px; font-weight: 500; letter-spacing: 1.8px; }
.page-heading h1, .module-heading h1 { color: #263e36; font-family: var(--serif); font-weight: 500; }
.page-heading h1 span { color: #6f8d6e; }
.page-heading p, .module-heading p { color: #6d7971; font-size: 13px; line-height: 1.9; }
.primary-button { color: #fffefa; background: #2f6252; border: 1px solid #2f6252; font-size: 13px; border-radius: 8px; min-height: 44px; padding: 11px 19px; box-shadow: none; }
.primary-button:hover { background: #244d41; border-color: #244d41; transform: translateY(-1px); }
.outline-button { color: #426450; background: #fffefa; border-color: #cbd7c9; font-size: 12px; min-height: 40px; border-radius: 7px; }
.outline-button:hover { background: #e9efe8; border-color: #9eb6a1; }
.subtle-button { color: #607466; font-size: 12px; }
.subtle-button:hover { color: #244d41; }
.page-footer { color: #7b877b; border-color: var(--border); font-size: 11px; }
.empty-state { background: #fffefa; color: #738173; border-color: #d0dccd; }
.empty-state > .icon { color: #7f9b79; }
.empty-state h3 { color: #355441; }
.empty-state p { font-size: 13px; line-height: 1.9; }
.toast { background: #264c40; border-color: #416957; color: #fffefa; font-size: 13px; box-shadow: 0 7px 25px #24392c24; }
dialog { background: var(--panel); border-color: #d6dfd2; box-shadow: 0 20px 80px #1c332c30; }
dialog::backdrop { background: #20352d70; backdrop-filter: blur(5px); }
.dialog-close { color: #486252; border-color: #d9e2d5; background: #f5f7efed; }
.dialog-close:hover { background: #e4ecdf; }
/* The homepage is an invitation, followed by clearly separated destinations. */
#homeView { padding-bottom: 12px; }
.hub-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; max-width: none; margin: 0 0 26px; }
.hub-heading h1 { color: #2d4438; font-size: clamp(26px, 2.4vw, 34px); line-height: 1.5; letter-spacing: .5px; }
.hub-heading > p { font-size: 12px; color: #7c887c; padding-bottom: 5px; margin: 0; }
.home-feature { position: relative; isolation: isolate; min-height: 306px; background: #e5ecdf; border-radius: 16px; overflow: hidden; }
.home-feature-art { position: absolute; inset: 0 0 0 43%; z-index: -2; background: url('assets/simulators/countryside.webp') 50% 45%/cover; }
.home-feature::after { content: ''; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg, #e5ecdf 0%, #e5ecdf 35%, #e5ecdfeb 43%, #e5ecdf50 58%, #e5ecdf00 75%); }
.home-feature-copy { padding: 29px 36px 30px; }
.home-feature-kicker { display: flex; align-items: center; gap: 8px; color: #637e5e; font-size: 11px; letter-spacing: .8px; }
.home-feature-kicker > span { width: 5px; height: 5px; background: #7a9867; border-radius: 50%; }
.home-feature-copy h2 { margin-top: 13px; color: #284b37; font: 500 clamp(28px, 2.65vw, 39px)/1.5 var(--serif); letter-spacing: 1px; }
.home-feature-copy h2 span { color: #64835b; }
.home-feature-copy > p { margin-top: 13px; font-size: 13px; line-height: 1.95; color: #63755d; }
.home-feature-actions { display: flex; align-items: center; gap: 25px; margin-top: 22px; }
.home-feature-link { background: transparent; color: #4d6d4f; padding: 10px 0; font-size: 12px; border-bottom: 1px solid #94aa8c; }
.home-feature-link:hover { color: #20422d; border-color: #446a44; }
.home-feature-caption { position: absolute; bottom: 17px; right: 22px; padding: 5px 11px; border-radius: 5px; background: #17352366; color: #fffdf4; backdrop-filter: blur(10px); font-size: 10px; letter-spacing: .4px; }
.home-section-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 29px 0 15px; }
.home-section-title h2 { font-size: 17px; font-weight: 600; letter-spacing: .5px; }
.home-section-title > span { font-size: 11px; color: #6d7867; }
.home-explore-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 17px; }
.home-explore-card { display: flex; justify-content: space-between; position: relative; overflow: hidden; min-width: 0; min-height: 190px; border: 1px solid #e0e4dc; border-radius: 12px; background: #fffefa; text-align: left; padding: 0; }
.home-explore-card:hover { border-color: #a5b99c; box-shadow: 0 5px 20px #29412b0c; }
.home-explore-card img { width: 33%; align-self: stretch; object-fit: cover; object-position: center 25%; transition: transform .45s; }
.home-explore-card:hover img { transform: scale(1.04); }
.home-explore-copy { position: relative; flex: 1; min-width: 0; padding: 20px 0 18px 21px; z-index: 1; }
.home-explore-label { font-size: 8px; letter-spacing: 1.4px; color: #8a9682; }
.home-explore-copy h3 { margin-top: 8px; font: 600 19px/1.6 var(--serif); color: #304a3b; }
.home-explore-copy p { color: #6d7867; font-size: 12px; line-height: 1.9; margin-top: 6px; }
.home-explore-action { display: flex; align-items: center; gap: 13px; margin-top: 16px; color: #557550; font-size: 11px; }
.home-explore-action .icon { width: 14px; height: 14px; }
.home-personal-title { margin-top: 27px; }
.hub-grid { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; }
.hub-card { min-height: 129px; padding: 18px 20px; border: 1px solid #e0e4dc; border-radius: 10px; background: #fffefa; }
.hub-card:hover { background: #fcfdf8; border-color: #a5b99c; transform: translateY(-2px); }
.hub-card-icon { display: grid; width: 29px; height: 29px; border: none; border-radius: 0; background: transparent; color: #7b8e6e; margin: 0 0 11px; }
.hub-card-icon .icon { width: 23px; height: 23px; }
.hub-card h2 { font-size: 14px; color: #445944; font-weight: 600; letter-spacing: .4px; }
.hub-card > p { color: #6e7968; font-size: 12px; margin: 6px 0 0; line-height: 1.8; }
.hub-card-arrow { position: absolute; top: 22px; right: 20px; width: 16px; height: 16px; color: #a6b19b; }
.hub-card:nth-child(2) .hub-card-icon { color: #ac7d73; }
.hub-card:nth-child(3) .hub-card-icon { color: #a38d55; }
.hub-card:nth-child(4) .hub-card-icon { color: #678592; }
.hub-note { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 9px; padding: 17px 0 0; margin-top: 19px; border-top: 1px solid #e1e6dc; color: #929c8a; font-size: 10px; }
.hub-note > span > span { margin: 0 10px; color: #8b9a7c; }
.hub-note button { margin: 0; font-size: 10px; color: #83917c; }
.hub-note button:hover { color: #2f6252; }
/* Character atlas: retain illustrated mood while cleaning the reading surfaces. */
#discoverView { --atlas-muted: #728071; }
#discoverView .atlas-heading .eyebrow { color: #7c8e70; }
#discoverView .section-heading h2 { color: #304a3b; }
#discoverView .search-box, .search-box { color: #36523e; border-color: #d3decd; background: #fffefa; border-radius: 8px; }
.search-box > .icon, .search-box button { color: #809577; }
.search-box:focus-within, #discoverView .search-box:focus-within { border-color: #789b78; box-shadow: 0 0 0 3px #e4eddf; }
#discoverView .category-tabs button { color: #778571; }
#discoverView .category-tabs button.active { color: #365b3d; border-color: #bed0b4; background: #e7efdf; }
#discoverView .category-tabs button:hover { color: #2c5535; background: #edf2e6; }
#discoverView .sort-control select, .sort-control select { color: #6f8265; }
.sort-control option { background: #fffefa; }
#discoverView .results-line, #discoverView .results-line>span:last-child { color: #83917b; }
.atlas-feature { border-color: #d3ddce; background: #233d35; }
.atlas-feature-art { opacity: .95; }
.atlas-feature::after { background: linear-gradient(90deg,#233d35 0%,#233d35fa 29%,#233d35b3 48%,#233d3500 76%),linear-gradient(0deg,#18352c80,transparent 55%); }
.atlas-feature-label, .atlas-feature-label>span, .atlas-feature-meta { color: #c5d9bf; }
.atlas-feature-label i { background: #bad3ac; box-shadow: none; }
.atlas-feature h2 { color: #fffdf4; }
.atlas-feature p { color: #cfdbc8; }
.atlas-feature-actions .primary-button { color: #2c4b30; background: #e7eddb; border-color: #e7eddb; }
.atlas-feature-actions .primary-button:hover { background: #f3f6e9; }
.atlas-feature-detail { color: #d2e1c7; border-color: #92a88a; }
.atlas-feature-meta>span+span::before { color: #879f7e; }
.atlas-feature-seal { color: #e4ecd8; border-color: #ccdcb87a; }
.character-card, .atlas-card { background: #fffefa; border-color: #dce3d6; }
.atlas-card { padding: 25px; }
.atlas-card:hover { border-color: #aec4a1; box-shadow: 0 8px 25px #243f2710; }
.atlas-avatar { background: #e8eedf; border-color: #d1dec5; color: #517544; box-shadow: none; }
.atlas-name, .card-title { color: #2f4a38; }
.atlas-role, .card-subtitle { color: #798675; }
.atlas-description { color: #667761; font-size: 13px; }
.atlas-favorite { color: #8b9a82; width: 36px; height: 36px; }
.atlas-favorite:hover { color: #ac6e64; background: #f4e7e1; border-color: #e9d2c6; }
.atlas-favorite.is-active { color: #a46059; background: #f7e9e2; }
.atlas-favorite.is-active .icon { fill: #c27d7233; }
.atlas-tags>span, .card-tags span { color: #76866d; border-color: #d8e2d0; background: transparent; font-size: 11px; }
.atlas-tags>.atlas-temperament { color: #5c7950; background: #edf2e6; border-color: #dae4cc; }
.atlas-encounter { border-color: #e5eadd; }
.atlas-encounter>span { color: #8a9981; font-size: 11px; }
.atlas-encounter p { color: #4d6945; font-size: 14px; }
.atlas-encounter i { background: #8ca779; }
.atlas-detail { color: #84937a; font-size: 12px; }
.atlas-detail:hover { color: #426a3e; }
.atlas-start { color: #3f6b3f; background: #eef3e8; border-color: #d4dfc9; font-size: 12px; min-height: 39px; }
.atlas-start:hover { background: #e2ecd9; border-color: #9fbc8b; }
.card-category { color: #7c906e; }
.card-footer { color: #7c8a72; border-color: #e5eadd; }
.card-footer button { color: #527447; }
.story-invite, .recent-story { background: #eef2e7; border-color: #dce5d3; }
.story-invite h3 { color: #4c6942; }
.story-invite p { color: #7c8a71; }
.invite-icon { color: #789767; border-color: #bcccac; }
#discoverView .page-footer { color: #839178; }
/* Module picker stays available on every compact screen. */
.module-directory-dialog h2 { color: #2e4c38; }
.module-directory-dialog > header p { color: #7c8b73; font-size: 13px; }
.module-directory-grid > button { background: #f3f6ec; border-color: #dce5d3; color: #46663e; }
.module-directory-grid > button:hover { background: #e7efde; border-color: #abc199; }
.module-directory-grid > button:is(.active,[aria-current="page"]) { background: #dce9cf; border-color: #a7bc98; }
.module-directory-grid .icon { color: #789767; }
.module-directory-grid small { color: #85947a; }
@media (min-width: 901px) {
  .sidebar { width: 214px; flex-basis: 214px; padding-left: 18px; padding-right: 18px; }
  .workspace { margin-left: 214px; width: calc(100% - 214px); }
}
@media (min-width: 901px) and (max-width: 1180px) {
  .hub-heading { display: block; }
  .hub-heading > p { margin-top: 8px; }
  .home-explore-grid { gap: 12px; }
  .home-explore-copy { padding-left: 16px; }
  .home-explore-copy h3 { font-size: 17px; }
  .home-explore-card img { width: 28%; }
  .hub-grid { gap: 11px; }
  .hub-card { padding: 16px; }
  .hub-card > p { font-size: 10px; }
}
@media (max-width: 900px) {
  .hub-heading { display: block; }
  .hub-heading > p { margin-top: 8px; }
  .home-feature-copy { padding: 28px; }
  .home-feature-copy h2 { font-size: 32px; }
  .home-feature-art { left: 38%; }
  .home-feature::after { background: linear-gradient(90deg,#e5ecdf 0%,#e5ecdf 30%,#e5ecdfce 48%,#e5ecdf00 86%); }
  .home-explore-grid { grid-template-columns: 1fr; gap: 12px; }
  .home-explore-card { min-height: 145px; }
  .home-explore-card img { width: 35%; max-height: 178px; }
  .home-explore-copy { padding: 17px 22px; }
  .home-explore-copy p br { display: none; }
  .home-explore-action { margin-top: 12px; }
  .hub-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 650px) {
  body:has(.module-sidebar) .module-sidebar { background: #fbfcf8f5; border-color: #dce4d6; }
  body:has(.module-sidebar) .module-sidebar .main-nav .nav-item[data-mobile-main] { color: #87957c; }
  body:has(.module-sidebar) .module-sidebar .main-nav .nav-item[data-mobile-main].active { color: #355b39; }
  body:has(.module-sidebar) .module-sidebar .main-nav .nav-item > span:not(.nav-plus):not(.nav-dot) { font-size: 10px; }
  body:not(.story-reading):not(.story-searching):has(.module-sidebar) main { padding-top: 25px; }
  .topbar { height: 58px; }
  .breadcrumb { font-size: 11px; }
  .module-directory-toggle { font-size: 11px; }
  .hub-heading { margin-bottom: 21px; }
  .hub-heading .eyebrow { font-size: 8px; letter-spacing: 1.5px; }
  .hub-heading h1 { font-size: 26px; letter-spacing: 0; }
  .hub-heading > p { font-size: 12px; }
  .home-feature { min-height: 352px; border-radius: 12px; }
  .home-feature-art { left: 0; opacity: .66; background-position: 50% 42%; }
  .home-feature::after { background: linear-gradient(90deg,#e5ecdfed 0%,#e5ecdfd9 45%,#e5ecdf7a 100%),linear-gradient(0deg,#e5ecdfe6,transparent 80%); }
  .home-feature-copy { padding: 25px 23px 49px; }
  .home-feature-kicker { font-size: 10px; letter-spacing: .2px; }
  .home-feature-copy h2 { font-size: clamp(27px,7.3vw,34px); line-height: 1.6; letter-spacing: 0; margin-top: 16px; }
  .home-feature-copy h2 span { display: block; }
  .home-feature-copy > p { font-size: 12px; margin-top: 12px; }
  .home-feature-actions { gap: 17px; margin-top: 20px; flex-wrap: wrap; }
  .home-feature-actions .primary-button { font-size: 12px; padding: 10px 14px; gap: 10px; }
  .home-feature-link { font-size: 11px; }
  .home-feature-caption { right: 18px; bottom: 11px; font-size: 9px; color: #4c6743; background: #eff3e6c2; backdrop-filter: none; }
  .home-section-title { margin-top: 27px; }
  .home-section-title h2 { font-size: 16px; }
  .home-section-title > span { font-size: 10px; }
  .home-explore-copy h3 { font-size: 20px; }
  .home-explore-label { font-size: 8px; }
  .home-explore-copy p { font-size: 12px; }
  .home-explore-action { font-size: 12px; }
  .home-explore-card img { width: 30%; }
  .hub-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; }
  .hub-card { padding: 17px 15px; min-height: 135px; }
  .hub-card h2 { font-size: 14px; }
  .hub-card > p { font-size: 11px; }
  .hub-card-arrow { right: 15px; }
  .hub-note { font-size: 10px; margin-top: 25px; gap: 5px; }
  .hub-note button { font-size: 10px; }
  .page-heading p { font-size: 12px; }
  .empty-state p { font-size: 12px; }
  .atlas-feature::after { background: linear-gradient(90deg,#233d35 0%,#233d35e8 38%,#233d3550 100%),linear-gradient(0deg,#233d35b3,transparent 70%); }
  #discoverView .atlas-heading .eyebrow { font-size: 9px; }
  #discoverView .search-box input { font-size: 16px; }
  #discoverView .category-tabs button { font-size: 12px; }
  .atlas-card { padding: 22px; }
  .atlas-tags>span { font-size: 11px; }
  .atlas-feature-actions { gap: 17px; }
  .atlas-feature-actions .primary-button { font-size: 12px; }
  .atlas-feature-meta { font-size: 10px; }
}
@media (max-width: 359px) {
  .home-feature-copy { padding-left: 19px; padding-right: 15px; }
  .home-feature-copy h2 { font-size: 26px; }
  .home-feature-actions { gap: 10px; }
  .home-feature-actions .primary-button { font-size: 11px; padding-inline: 10px; }
  .home-feature-link { font-size: 10px; }
  .home-section-title > span { display: none; }
  .hub-card > p { font-size: 11px; }
  .hub-card { min-height: 145px; }
  .home-explore-copy { padding-left: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .home-explore-card img, .hub-card, button, a { transition: none; }
  .home-explore-card:hover img, .hub-card:hover, .primary-button:hover { transform: none; }
}
/* Story module navigation belongs to the host, outside .story-mode. */
.story-module-nav { border-color: #dce4d6; background: #fffefaf2; border-radius: 9px; }
.story-module-nav > button { font-size: 12px; color: #66785f; }
.story-module-nav > button:hover { background: #eef3e8; color: #34583d; }
.story-module-nav > button:is(.active,.is-active,[aria-current="page"]) { background: #e5eddf; border-color: #cfddc7; color: #2f5839; }
.story-module-nav > span { color: #73836b; }
.jh-gallery-entry { background: #e9efe4; border-color: #d8e2ce; color: #365b3c; }
.jh-gallery-entry:hover { background: #e0e9d9; border-color: #b1c59f; }

/* Change destinations immediately; avoid a blank frame between pages. */
.view { animation: none; }
.jh-gallery-entry strong { font-size: 20px; letter-spacing: .7px; line-height: 1.6; }
.jh-gallery-entry small { color: #66775d; line-height: 1.8; }
@media (max-width: 650px) {
  .jh-gallery-entry { padding: 16px 17px; gap: 13px; margin-bottom: 19px; }
  .jh-gallery-entry strong { font-size: 16px; letter-spacing: 0; }
  .jh-gallery-entry small { font-size: 11px; margin-top: 5px; }
  .jh-gallery-entry > span:last-child { font-size: 11px; }
}
