/*! 小桃源·剧场自有代码保留所有权利。未经授权，不得复制、转载、出售或用于制作衍生产品。第三方代码及用户自有内容的权利归原权利人。 */
/*! 小桃源·剧场自有代码保留所有权利。未经授权，不得复制、转载、出售或用于制作衍生产品。第三方代码及用户自有内容的权利归原权利人。 */
/*! 小桃源·剧场自有代码保留所有权利。未经授权，不得复制、转载、出售或用于制作衍生产品。第三方代码及用户自有内容的权利归原权利人。 */
/*! 小桃源·剧场自有代码保留所有权利。未经授权，不得复制、转载、出售或用于制作衍生产品。第三方代码及用户自有内容的权利归原权利人。 */
/*! 小桃源·剧场自有代码保留所有权利。未经授权，不得复制、转载、出售或用于制作衍生产品。第三方代码及用户自有内容的权利归原权利人。 */
/*! 小桃源·剧场自有代码保留所有权利。未经授权，不得复制、转载、出售或用于制作衍生产品。第三方代码及用户自有内容的权利归原权利人。 */
/*! 小桃源·剧场自有代码保留所有权利。未经授权，不得复制、转载、出售或用于制作衍生产品。第三方代码及用户自有内容的权利归原权利人。 */
/*! 小桃源·剧场自有代码保留所有权利。未经授权，不得复制、转载、出售或用于制作衍生产品。第三方代码及用户自有内容的权利归原权利人。 */
/*! 小桃源·剧场自有代码保留所有权利。未经授权，不得复制、转载、出售或用于制作衍生产品。第三方代码及用户自有内容的权利归原权利人。 */
@import "./story-image-components.css";
@import "./story-info-ui.css";
@import "./role-notebook-ui.css";
@import "./role-chat-ui.css";
@import "./api-model-picker.css";
@import "./setting-media-editor.css";
@import "./api-settings.css";
@import "./voice-settings.css";
@import "./voice-settings-full.css";
@import "./peach-ui.css";
@import "./desktop-navigation.css";
@import "./random-unlock-dialog.css";
@import "./role-chat-main-mobile.css";
/*! 小桃源·剧场自有代码保留所有权利。未经授权，不得复制、转载、出售或用于制作衍生产品。第三方代码及用户自有内容的权利归原权利人。 */
/*! 小桃源·剧场自有代码保留所有权利。未经授权，不得复制、转载、出售或用于制作衍生产品。第三方代码及用户自有内容的权利归原权利人。 */
/*! 小桃源·剧场自有代码保留所有权利。未经授权，不得复制、转载、出售或用于制作衍生产品。第三方代码及用户自有内容的权利归原权利人。 */
/*! 小桃源·剧场自有代码保留所有权利。未经授权，不得复制、转载、出售或用于制作衍生产品。第三方代码及用户自有内容的权利归原权利人。 */
/*! 小桃源·剧场自有代码保留所有权利。未经授权，不得复制、转载、出售或用于制作衍生产品。第三方代码及用户自有内容的权利归原权利人。 */
/*! 小桃源·剧场自有代码保留所有权利。未经授权，不得复制、转载、出售或用于制作衍生产品。第三方代码及用户自有内容的权利归原权利人。 */
/*! 小桃源·剧场自有代码保留所有权利。未经授权，不得复制、转载、出售或用于制作衍生产品。第三方代码及用户自有内容的权利归原权利人。 */
/*! 小桃源·剧场自有代码保留所有权利。未经授权，不得复制、转载、出售或用于制作衍生产品。第三方代码及用户自有内容的权利归原权利人。 */
/*! 小桃源·剧场自有代码保留所有权利。未经授权，不得复制、转载、出售或用于制作衍生产品。第三方代码及用户自有内容的权利归原权利人。 */
/*! 小桃源·剧场自有代码保留所有权利。未经授权，不得复制、转载、出售或用于制作衍生产品。第三方代码及用户自有内容的权利归原权利人。 */
/*! 小桃源·剧场自有代码保留所有权利。未经授权，不得复制、转载、出售或用于制作衍生产品。第三方代码及用户自有内容的权利归原权利人。 */
/*! 小桃源·剧场自有代码保留所有权利。未经授权，不得复制、转载、出售或用于制作衍生产品。第三方代码及用户自有内容的权利归原权利人。 */
/*! 小桃源·剧场自有代码保留所有权利。未经授权，不得复制、转载、出售或用于制作衍生产品。第三方代码及用户自有内容的权利归原权利人。 */
/*! 小桃源·剧场自有代码保留所有权利。未经授权，不得复制、转载、出售或用于制作衍生产品。第三方代码及用户自有内容的权利归原权利人。 */
/*! 小桃源·剧场自有代码保留所有权利。未经授权，不得复制、转载、出售或用于制作衍生产品。第三方代码及用户自有内容的权利归原权利人。 */
/*! 小桃源·剧场自有代码保留所有权利。未经授权，不得复制、转载、出售或用于制作衍生产品。第三方代码及用户自有内容的权利归原权利人。 */
/*! 小桃源·剧场自有代码保留所有权利。未经授权，不得复制、转载、出售或用于制作衍生产品。第三方代码及用户自有内容的权利归原权利人。 */
/*! 小桃源·剧场自有代码保留所有权利。未经授权，不得复制、转载、出售或用于制作衍生产品。第三方代码及用户自有内容的权利归原权利人。 */
/*! 小桃源·剧场自有代码保留所有权利。未经授权，不得复制、转载、出售或用于制作衍生产品。第三方代码及用户自有内容的权利归原权利人。 */
/*! 小桃源·剧场自有代码保留所有权利。未经授权，不得复制、转载、出售或用于制作衍生产品。第三方代码及用户自有内容的权利归原权利人。 */
/*! 小桃源·剧场自有代码保留所有权利。未经授权，不得复制、转载、出售或用于制作衍生产品。第三方代码及用户自有内容的权利归原权利人。 */
/*! 小桃源·剧场自有代码保留所有权利。未经授权，不得复制、转载、出售或用于制作衍生产品。第三方代码及用户自有内容的权利归原权利人。 */
/*! 小桃源·剧场自有代码保留所有权利。未经授权，不得复制、转载、出售或用于制作衍生产品。第三方代码及用户自有内容的权利归原权利人。 */
:root {
  --bg:#f5f3ec;
  --paper:#fffcf5;
  --ink:#303d35;
  --muted:#85887e;
  --line:#dcded2;
  --accent:#486050;
  --soft:#eeeee4;
  --glass:rgba(252,249,243,.95);
  --edge:rgba(255,255,255,.76);
  --shadow:rgba(40,40,28,.08);
  --reading-size:18px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size:14px;line-height:1.6;font-weight:normal;font-style:normal;font-family:inherit;
}
body[data-night=true] {
  --bg:#18191b;
  --paper:#202123;
  --ink:#d6d4cf;
  --muted:#98999b;
  --line:#37393c;
  --accent:#b4b2a7;
  --soft:#26282b;
  --glass:rgba(38,40,43,.96);
  --edge:rgba(255,255,255,.07);
  --shadow:rgba(0,0,0,.2);
  color-scheme: dark;
}
button,
input,
textarea,
select {
  font: inherit;
}
button {
  font-size: 14px;
  line-height: 1.4;
  padding: calc(.35em - 1px) .9em;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: inset 0 1px 0 var(--edge), 0 1px 2px var(--shadow);
  cursor: pointer;
}
button:hover {
  border-color: var(--accent);
  filter: brightness(.985);
}
button:active {
  transform: translateY(1px);
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
}
body[data-night=true] button.primary {
  color: #202123;
}
button.quiet {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
button.icon {
  width: 32px;
  height: 30px;
  padding: 0;
  font-size: 21px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}
.full {
  width: 100%;
}
.small {
  font-size: 12px;
}
.soft {
  color: var(--muted);
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3,
.serif {
  font-family:inherit;
  font-weight: 400;
}
h1 {
  font-size: 30px;
  line-height: 1.5;
}
h2 {
  font-size: 23px;
}
h3 {
  font-size: 19px;
}
a {
  color: inherit;
}
small {
  font-size: 12px;
  color: var(--muted);
}
.kicker {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--muted);
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.between {
  justify-content: space-between;
}
.stack {
  display: grid;
  gap: 13px;
}
.muted {
  color: var(--muted);
}
.hint {
  font-size: 12px;
  line-height: 1.85;
  color: var(--muted);
  margin-top: 12px;
}
.lead {
  color: var(--muted);
  margin: 9px 0 26px;
  line-height: 1.9;
}
.separator {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 25px 0;
}
.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 34px 42px 110px;
  min-width: 0;
}
.page.narrow {
  max-width: 780px;
}
.top {
  height: 64px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 38px;
  gap: 12px;
}
.top-title {
  font-size: 15px;
  letter-spacing: 1px;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--accent);
  border-radius: 50%;
  width: 29px;
  height: 29px;
  margin-right: 10px;
  font-size:20px;line-height:normal;font-weight:normal;font-style:normal;font-family:inherit;
}
.preview-label {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 1px;
}
.nav {
  display: flex;
  justify-content: center;
  gap: 55px;
  position: fixed;
  z-index: 3;
  bottom: 0;
  left: 0;
  right: 0;
  height: 62px;
  padding-bottom: env(safe-area-inset-bottom);
  align-items: center;
  background: var(--glass);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.nav button {
  border: 0;
  box-shadow: none;
  background: transparent;
  font-size: 12px;
  padding: 7px 15px;
}
.nav .selected {
  color: var(--accent);
  background: var(--soft);
}
.headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 26px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 34px 0 20px;
}
.section-head h2 {
  font-size: 21px;
}
.section-head button {
  font-size: 12px;
}
.books {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 36px 32px;
  align-items: start;
}
.book-cell {
  min-width: 0;
}
.book-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: none;
  text-align: left;
  border-radius: 0;
}
.cover {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  aspect-ratio: .73;
  background: var(--cover,#647367);
  padding: 26px 20px 20px 27px;
  color: #fff8e5;
  border-radius: 2px 4px 4px 2px;
  box-shadow:
    3px 6px 11px rgba(30, 34, 25, .14),
    inset 8px 0 0 rgba(0, 0, 0, .075),
    inset -2px 0 0 rgba(255, 255, 255, .12);
  isolation: isolate;
}
.cover:after {
  content: "";
  position: absolute;
  inset: 13px 11px 13px 19px;
  border: 1px solid rgba(255, 255, 255, .25);
  z-index: -1;
}
.cover-number {
  font-size: 10px;
  letter-spacing: 2px;
  opacity: .7;
}
.cover h3 {
  font-size: 25px;
  line-height: 1.7;
  letter-spacing: 3px;
  overflow-wrap: anywhere;
}
.cover-foot {
  font-size: 10px;
  letter-spacing: 3px;
  opacity: .7;
}
.book-title {
  font-size:16px;line-height:1.6;font-weight:normal;font-style:normal;font-family:inherit;
  margin-top: 13px;
  display: block;
}
.book-meta {
  font-size: 11px;
  margin-top: 3px;
  color: var(--muted);
}
.book-caption {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 4px;
}
.book-caption .icon {
  font-size: 17px;
  margin-top: 7px;
  flex-shrink: 0;
}
.book-add {
  aspect-ratio: .73;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: transparent;
  border: 1px dashed var(--line);
  box-shadow: none;
  font-size: 13px;
}
.book-add span {
  font-size:36px;line-height:normal;font-weight:normal;font-style:normal;font-family:inherit;
}
.reading-hero {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  align-items: center;
  gap: 50px;
  padding: 14px 0 30px;
  max-width: 720px;
  margin: 0 auto 20px;
}
.reading-hero h1 {
  font-size: 32px;
  letter-spacing: 1px;
  margin: 10px 0;
}
.reading-hero p {
  margin-bottom: 20px;
  line-height: 1.9;
}
.reading-hero .primary {
  min-width: 180px;
}
.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 22px;
}
.booklets {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}
.booklet {
  display: flex;
  gap: 15px;
  align-items: center;
  text-align: left;
  box-shadow: none;
  background: transparent;
  border: 0;
  padding: 0;
}
.mini-cover {
  display: grid;
  place-items: center;
  width: 45px;
  height: 61px;
  background: var(--soft);
  box-shadow: inset 4px 0 0 var(--line), 2px 3px 6px var(--shadow);
  font-family:inherit;
  font-size: 18px;
}
.shelf-tabs {
  display: flex;
  gap: 20px;
  margin-bottom: 27px;
}
.shelf-tabs button {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 4px 0;
  color: var(--muted);
}
.shelf-tabs .selected {
  border-bottom: 1px solid var(--accent);
  color: var(--ink);
}
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 62dvh;
  max-width: 410px;
  margin: auto;
  padding: 24px 0;
}
.empty h1 {
  font-size: 27px;
  margin: 28px 0 12px;
}
.empty > p {
  line-height: 2;
  color: var(--muted);
  margin-bottom: 24px;
}
.empty-actions {
  display: grid;
  gap: 13px;
  width: 100%;
  max-width: 290px;
}
.empty-illustration {
  width: 113px;
  height: 127px;
  position: relative;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--paper);
  box-shadow: 5px 6px 0 var(--soft), inset 6px 0 0 var(--soft);
  display: grid;
  place-items: center;
  font-size:32px;line-height:normal;font-weight:normal;font-style:normal;font-family:inherit;
  color: var(--accent);
}
.empty-illustration:after {
  content: "";
  position: absolute;
  bottom: 25px;
  width: 35px;
  border-bottom: 1px solid var(--line);
}
.empty-guide {
  margin-top: 29px;
  font-size: 12px;
  line-height: 1.9;
  max-width: 310px;
}
.empty-guide button {
  margin-top: 11px;
  font-size: 12px;
}
.empty-reader {
  padding: 0 22px;
  min-height: 100%;
}
.empty-reader .empty {
  min-height: 100%;
  padding-bottom: 45px;
}
.empty-reader .empty h1 {
  font-size: 25px;
}
.reader {
  height: 100dvh;
  display: grid;
  grid-template-rows: 56px minmax(0, 1fr) calc(48px + env(safe-area-inset-bottom));
  background: var(--bg);
}
.reader-header {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 12px;
  width: min(920px, 100%);
  margin: auto;
  padding: 0 18px;
  height: 56px;
}
.reader-header h1 {
  font-size:14px;line-height:1.4;font-weight:normal;font-style:normal;font-family:inherit;
  letter-spacing: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  color: var(--muted);
}
.reader-header button {
  justify-self: center;
}
.reader-scroll {
  overflow-y: auto;
  min-height: 0;
  overscroll-behavior: contain;
  background: var(--paper);
  scrollbar-gutter: stable;
}
.reader .reader-chapter-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: max-content;
  min-width: 44px;
  min-height: 36px;
  margin-inline: auto;
  padding-inline: 8px;
  color: var(--section-ink, var(--ink));
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  text-decoration: none;
  text-shadow: 0 0 3px var(--section-paper, var(--paper)), 0 0 7px var(--section-paper, var(--paper));
  background: transparent;
  border: 0;
}
.reader .reader-chapter-link span:not(.reader-chapter-link-arrow) {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.reader .reader-chapter-link-arrow {
  font-size: 18px;
}
.reader .reader-chapter-link[aria-busy=true] {
  opacity: .65;
  cursor: progress;
}
.manuscript {
  max-width: 720px;
  width: calc(100% - 96px);
  margin: auto;
  padding: 36px 0 72px;
}
.chapter {
  scroll-margin-top: 24px;
}
.chapter h2 {
  font-size: 27px;
  letter-spacing: 2px;
  margin-bottom: 36px;
}
.chapter h2 small {
  display: block;
  margin-bottom: 13px;
  font-size:12px;line-height:1.5;font-weight:normal;font-style:normal;font-family:inherit;
  letter-spacing: 3px;
}
.prose {
  font-size: var(--reading-size);
  line-height: 2.1;
  letter-spacing: .4px;
  font-family:inherit;
  overflow-wrap: anywhere;
}
.prose p {
  margin-bottom: 23px;
  text-align: justify;
}
.part-actions {
  display: flex;
  justify-content: end;
  margin: 14px 0 36px;
  height: 40px;
}
.part-actions .icon {
  font-size: 17px;
  color: var(--muted);
}
.reader-bottom {
  display: flex;
  justify-content: center;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.reader-bottom button {
  font-size: 13px;
  border: 0;
  box-shadow: none;
  background: transparent;
  letter-spacing: 2px;
}
.web-content {
  width: 100%;
  border: 0;
  display: block;
  min-height: 500px;
}
.reader-sub {
  max-width: 700px;
  padding: 30px 24px 80px;
  margin: auto;
}
.reader-sub h2 {
  margin-bottom: 20px;
}
.entry-text {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  line-height: 2;
}
.entry-text h3 {
  margin-bottom: 10px;
}
dialog {
  width: min(580px, calc(100% - 36px));
  max-height: calc(100dvh - 60px);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--glass);
  color: var(--ink);
  backdrop-filter: blur(22px);
  box-shadow: inset 0 1px 0 var(--edge), 0 12px 34px var(--shadow);
}
dialog::backdrop {
  background: rgba(15, 16, 17, .28);
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 22px;
}
.sheet-head h2 {
  font-size: 22px;
}
.sheet-section {
  padding: 17px 0;
  border-top: 1px solid var(--line);
}
.sheet-section:first-of-type {
  padding-top: 0;
  border-top: 0;
}
.sheet-section > small {
  display: block;
  margin-bottom: 12px;
}
.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 9px;
}
.menu-grid button {
  text-align: left;
  border-color: transparent;
  background: none;
  box-shadow: none;
  font-size: 13px;
  padding: 3px 2px;
}
.menu-list {
  display: grid;
  gap: 12px;
}
.menu-list button {
  display: flex;
  justify-content: space-between;
  text-align: left;
  background: none;
  box-shadow: none;
  border: 0;
  padding: 6px 0;
}
.write-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}
.write-actions {
  display: flex;
  justify-content: end;
  margin-top: 14px;
}
.write-actions button {
  min-width: 76px;
}
#toast {
  position: fixed;
  left: 50%;
  bottom: 80px;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  padding: 7px 15px;
  border-radius: 5px;
  z-index: 20;
  max-width: calc(100% - 36px);
  font-size: 12px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
}
#toast.show {
  opacity: 1;
}
.field {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
  min-width: 0;
}
.field label,
.field-label {
  font-size: 12px;
  color: var(--muted);
}
input:not([type=checkbox]),
textarea,
select {
  width: 100%;
  min-width: 0;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 7px 10px;
  box-shadow: inset 0 1px 2px var(--shadow);
}
textarea {
  line-height: 1.9;
  resize: vertical;
  min-height: 115px;
}
input[type=checkbox] {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
  margin: 0;
  flex-shrink: 0;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 3px;
  background: var(--soft);
  border-radius: 6px;
  margin-bottom: 22px;
}
.segmented button {
  border-color: transparent;
  background: none;
  box-shadow: none;
}
.segmented button.selected {
  background: var(--paper);
  border-color: var(--line);
}
.file-area {
  padding: 22px;
  border: 1px dashed var(--line);
  text-align: center;
  margin: 18px 0;
  display: grid;
  gap: 13px;
}
.file-area input {
  background: transparent;
  padding: 0;
  border: 0;
  box-shadow: none;
  font-size: 12px;
}
.import-layout {
  display: grid;
  grid-template-columns: 185px minmax(0, 1fr);
  gap: 30px;
}
.chapter-index {
  display: grid;
  gap: 9px;
  align-content: start;
}
.chapter-index button {
  text-align: left;
  background: none;
  box-shadow: none;
  border-color: transparent;
  font-size: 12px;
  padding: 7px;
}
.chapter-index button.selected {
  background: var(--soft);
  border-color: var(--line);
}
.form-footer {
  display: grid;
  gap: 12px;
  margin-top: 26px;
}
.form-footer button {
  width: 100%;
}
.preview-paper {
  background: var(--paper);
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 3px;
  margin: 24px 0;
  overflow-wrap: anywhere;
}
.preview-paper h3 {
  margin-bottom: 20px;
}
.preview-paper .prose {
  font-size: 16px;
}
.preview-paper .web-content {
  min-height: 300px;
}
.step {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 2px;
  margin-bottom: 12px;
}
.line-list {
  display: grid;
}
.line-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  width: 100%;
  text-align: left;
  padding: 20px 0;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  box-shadow: none;
}
.line-item strong {
  display: block;
  font-size:19px;line-height:1.6;font-weight:normal;font-style:normal;font-family:inherit;
}
.line-item small {
  display: block;
  margin-top: 5px;
}
.line-item span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.library-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 24px;
}
.library-tabs button {
  font-size: 12px;
  box-shadow: none;
  background: transparent;
  border-color: transparent;
  padding: 5px 2px;
}
.library-tabs .selected {
  border-color: var(--line);
  background: var(--paper);
}
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.check-row input {
  margin-top: 5px;
}
.check-content {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.check-content strong {
  font-weight: 400;
  font-size: 15px;
}
.check-content small {
  display: block;
  margin: 4px 0;
}
.check-content details {
  font-size: 12px;
  line-height: 1.9;
  color: var(--muted);
}
.check-content pre {
  white-space: pre-wrap;
  font: 12px/1.9 inherit;
}
.group-section {
  margin: 28px 0;
}
.group-section h3 {
  font-size: 20px;
  margin-bottom: 6px;
}
.group-summary {
  border-left: 2px solid var(--line);
  padding: 4px 0 4px 15px;
  font-size: 12px;
  line-height: 2;
  margin: 20px 0;
}
.rule-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.rule-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  padding: 24px;
  min-height: 190px;
  background: var(--paper);
  border-radius: 3px;
  box-shadow: 0 3px 9px var(--shadow);
}
.rule-card h2 {
  font-size: 23px;
  margin: 13px 0;
}
.rule-card p {
  font-size: 12px;
  line-height: 1.9;
  color: var(--muted);
}
.rule-symbol {
  font-size:25px;line-height:normal;font-weight:normal;font-style:normal;font-family:inherit;
  color: var(--accent);
}
details {
  margin: 16px 0;
}
summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--muted);
}
.selection-pill {
  font-size: 12px;
  background: var(--soft);
  padding: 4px 9px;
  border-radius: 4px;
}
.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.guide-grid a {
  display: block;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}
.guide-grid a strong {
  font-weight: 400;
  display: block;
}
.guide-grid a small {
  display: block;
  margin-top: 5px;
}
@media (max-width: 760px) {
  .top {
    height: 62px;
    padding: 0 20px;
  }
  .top-title {
    font-size: 14px;
  }
  .preview-label {
    display: none;
  }
  .page {
    padding: 25px 22px 108px;
  }
  .page.narrow {
    padding-inline: 22px;
  }
  h1 {
    font-size: 28px;
  }
  .headline {
    margin-bottom: 24px;
  }
  .books {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 25px;
  }
  .cover {
    padding: 20px 16px 17px 23px;
  }
  .cover h3 {
    font-size: 22px;
    letter-spacing: 2px;
    line-height: 1.7;
  }
  .book-title {
    font-size: 15px;
  }
  .cover-foot {
    letter-spacing: 2px;
    font-size: 9px;
  }
  .reading-hero {
    grid-template-columns: 123px minmax(0, 1fr);
    gap: 23px;
    padding: 10px 0 20px;
  }
  .reading-hero .cover h3 {
    font-size: 18px;
  }
  .reading-hero .cover {
    padding: 20px 12px 15px 20px;
  }
  .reading-hero h1 {
    font-size: 24px;
    line-height: 1.6;
    margin: 7px 0;
  }
  .reading-hero p {
    font-size: 12px;
    margin-bottom: 17px;
  }
  .reading-hero .primary {
    min-width: 0;
    width: 100%;
    font-size: 13px;
  }
  .hero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-top: 13px;
    gap: 12px;
  }
  .hero-actions button {
    padding-inline: 5px;
    font-size: 12px;
  }
  .section-head {
    margin: 30px 0 18px;
  }
  .booklets {
    gap: 21px;
  }
  .booklet {
    gap: 11px;
    max-width: calc(50% - 11px);
  }
  .booklet strong {
    font-size: 13px;
    font-weight: 400;
  }
  .booklet small {
    font-size: 10px;
  }
  .mini-cover {
    width: 35px;
    height: 49px;
    flex-shrink: 0;
  }
  .nav {
    gap: 18px;
    height: calc(62px + env(safe-area-inset-bottom));
  }
  .empty {
    min-height: 67dvh;
  }
  .empty h1 {
    font-size: 25px;
  }
  .empty-actions button {
    font-size: 14px;
  }
  .empty-illustration {
    width: 96px;
    height: 116px;
  }
  .reader-header {
    padding: 0 10px;
    gap: 8px;
  }
  .reader-header h1 {
    font-size: 13px;
  }
  .reader-scroll {
    scrollbar-gutter: auto;
  }
  .manuscript {
    width: auto;
    max-width: none;
    padding: 24px 22px 56px;
  }
  .chapter h2 {
    font-size: 25px;
    margin-bottom: 28px;
  }
  .chapter h2 small {
    font-size: 11px;
    margin-bottom: 10px;
  }
  .prose {
    line-height: 2;
    letter-spacing: .2px;
  }
  .prose p {
    margin-bottom: 21px;
  }
  .part-actions {
    margin: 8px 0 28px;
  }
  .reader-sub {
    padding: 24px 22px 48px;
  }
  dialog {
    width: 100%;
    max-height: calc(100dvh - 30px);
    margin: auto 0 0;
    inset: auto 0 0;
    border-radius: 14px 14px 0 0;
    padding: 23px 22px calc(23px + env(safe-area-inset-bottom));
  }
  .sheet-head {
    margin-bottom: 18px;
  }
  .sheet-head h2 {
    font-size: 21px;
  }
  .menu-grid {
    gap: 11px 10px;
  }
  .menu-grid button {
    font-size: 12px;
  }
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .import-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .chapter-index {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
  }
  .chapter-index button {
    font-size: 11px;
  }
  .rule-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 17px;
  }
  .rule-card {
    padding: 19px 16px;
    min-height: 196px;
  }
  .rule-card h2 {
    font-size: 22px;
    line-height: 1.7;
  }
  .rule-card p {
    font-size: 11px;
  }
  .library-tabs {
    gap: 2px;
  }
  .library-tabs button {
    font-size: 11px;
  }
  .guide-grid {
    grid-template-columns: 1fr 1fr;
    gap: 9px 20px;
  }
  .preview-paper {
    padding: 22px 18px;
  }
  .shelf-tabs {
    gap: 23px;
    font-size: 12px;
  }
  .group-section {
    margin: 24px 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
.cover h3 {
  text-wrap: balance;
}
.page {
  max-width: 1560px;
  padding: 36px 48px 100px;
}
.page.narrow {
  max-width: 1240px;
}
.top-config {
  font-size: 13px;
}
.top .row {
  flex-wrap: nowrap;
}
button.icon {
  display: inline-grid;
  place-items: center;
  line-height: 1;
  flex-shrink: 0;
}
.dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 24px;
  height: 24px;
}
.dots i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
}
.reader-header {
  grid-template-columns: 32px minmax(0, 1fr) 32px;
}
.reader-header .icon {
  justify-self: center;
}
.reader-bottom {
  display: block;
  padding: 0 0 env(safe-area-inset-bottom);
  background: var(--glass);
}
.reader-tools {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}
.reader-tools button {
  letter-spacing: 0;
  font-size: 13px;
  padding: 4px 12px;
  line-height: 1.4;
}
.reader-tools button + button {
  position: relative;
}
.reader-tools button + button:before {
  content: "";
  position: absolute;
  left: -13px;
  top: 7px;
  bottom: 7px;
  border-left: 1px solid var(--line);
}
.reader.composing {
  grid-template-rows: 56px minmax(0, 1fr) auto;
}
.compose-box {
  max-width: 760px;
  margin: auto;
  padding: 12px 24px 0;
}
.compose-box textarea {
  margin: 6px 0 9px;
  min-height: 90px;
  max-height: 28dvh;
}
.compose-box .primary {
  background: var(--accent);
  color: var(--paper);
  border: 1px solid var(--accent);
  box-shadow: inset 0 1px 0 var(--edge);
}
body[data-night=true] .compose-box .primary {
  color: #202123;
}
dialog {
  max-width: none;
  padding: 0;
  width: min(660px, calc(100vw - 48px));
  overflow: hidden;
  margin: auto;
  inset: 0;
}
.sheet-head {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 32px;
  gap: 12px;
  padding: 18px 24px;
  margin: 0;
  border-bottom: 1px solid var(--line);
}
.sheet-head h2 {
  text-align: center;
  font-size:17px;line-height:1.5;font-weight:normal;font-style:normal;font-family:inherit;
}
.sheet-body {
  padding: 8px 26px 26px;
  max-height: calc(100dvh - 160px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.sheet-body > form {
  padding-top: 20px;
}
.sheet-body > p {
  margin-top: 18px;
}
.menu-list {
  display: block;
}
.menu-list .menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0;
  width: 100%;
  border-radius: 0;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
  text-align: left;
  background: transparent;
  box-shadow: none;
  line-height: 1.5;
}
.menu-item strong {
  display: block;
  font-size: 16px;
  font-weight: 500;
}
.menu-item small {
  display: block;
  font-size: 11px;
  margin-top: 5px;
  line-height: 1.6;
  color: var(--muted);
}
.item-arrow {
  font-size: 21px;
  color: var(--muted);
  font-weight: 400;
}
.menu-item:last-child {
  border-bottom: 0;
}
.line-item {
  border-bottom-color: color-mix(in srgb, var(--line) 65%, transparent);
}
.line-item strong {
  font-size:17px;line-height:1.6;font-weight:500;font-style:normal;font-family:inherit;
}
.line-item small {
  font-size: 11px;
}
.block-note {
  display: block;
  font-size: 11px;
  margin: 6px 0 15px;
}
.library-tabs {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.group-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 56px;
}
.group-section h3 {
  font-size:18px;line-height:1.6;font-weight:500;font-style:normal;font-family:inherit;
}
.target-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
  color: var(--muted);
  font-size: 11px;
}
.target-label select {
  width: 128px;
  font-size: 12px;
  padding: 3px 8px;
}
.check-content pre {
  font-size:13px;line-height:1.8;font-weight:normal;font-style:normal;font-family:inherit;
}
.import-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
}
.import-heading .lead {
  margin-bottom: 24px;
}
.import-beauty {
  flex-shrink: 0;
}
.import-beauty .row {
  justify-content: flex-end;
}
.import-beauty > small {
  display: block;
  margin: 8px 0 16px;
  font-size: 11px;
}
.import-layout {
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 28px;
}
.import-content {
  min-width: 0;
}
.import-source {
  max-width: 500px;
}
.chapter-index {
  border-right: 1px solid var(--line);
  padding-right: 18px;
}
.chapter-index > small {
  padding-left: 7px;
  margin-bottom: 8px;
}
.chapter-index button {
  padding: 7px 8px;
  overflow-wrap: anywhere;
}
.chapter-fields {
  grid-template-columns: 2fr 1fr;
}
.import-workspace,
.process-workspace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
  align-items: stretch;
}
.import-editor {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.import-editor .field {
  flex: 1;
  grid-template-rows: auto 1fr;
  margin-bottom: 8px;
}
.import-editor textarea {
  min-height: clamp(420px, calc(100dvh - 390px), 900px);
  resize: vertical;
}
.import-preview {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  min-width: 0;
  overflow: hidden;
}
.preview-heading {
  padding: 10px 18px;
  font-size: 12px;
  border-bottom: 1px solid var(--line);
  min-height: 43px;
}
.preview-surface {
  padding: 26px;
  min-height: 420px;
  max-height: calc(100dvh - 235px);
  overflow: auto;
  overflow-wrap: anywhere;
}
.preview-surface:has(iframe) {
  padding: 0;
}
.preview-empty {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  min-height: 350px;
  text-align: center;
  color: var(--muted);
}
.preview-empty .serif {
  font-size: 21px;
}
.preview-empty small {
  font-size: 11px;
}
.preview-surface .web-content {
  min-height: 420px;
}
.mobile-preview-tabs {
  display: none;
}
.confirm-layout .preview-surface {
  max-height: none;
  min-height: 500px;
}
.import-content .prose {
  font-size: 17px;
}
.process-workspace {
  margin-top: 30px;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
}
.process-workspace .process-editor {
  padding: 0 20px 0 0;
}
.process-workspace .preview-surface {
  min-height: 540px;
}
.guide-grid {
  gap: 4px 36px;
}
.guide-grid a {
  padding: 21px 0;
  border-bottom-color: color-mix(in srgb, var(--line) 65%, transparent);
}
.guide-grid a strong {
  font-size: 16px;
  font-weight: 500;
}
.guide-grid a small {
  font-size: 10px;
  margin-top: 8px;
  line-height: 1.6;
  padding-left: 30px;
}
.guide-number {
  display: inline-block;
  color: var(--muted);
  font-size: 10px;
  min-width: 30px;
  font-weight: 400;
}
.guide-grid a:hover strong {
  color: var(--accent);
}
@media (min-width: 761px) {
  body[data-page=entry] textarea,
  body[data-page=rule-edit] textarea {
    min-height: calc(100dvh - 365px);
  }
  body[data-page=api] form {
    max-width: 100%;
  }
  .page .books {
    grid-template-columns: repeat(auto-fit, minmax(180px, 260px));
  }
  .top {
    padding-inline: 48px;
  }
}
@media (max-width: 1050px) and (min-width: 761px) {
  .page {
    padding-inline: 30px;
  }
  .import-layout {
    grid-template-columns: 135px minmax(0, 1fr);
    gap: 20px;
  }
  .import-workspace {
    gap: 16px;
  }
  .preview-surface {
    padding: 20px;
  }
  .import-heading {
    gap: 16px;
  }
  .import-beauty > small {
    max-width: 210px;
  }
}
@media (max-width: 760px) {
  .page,
  .page.narrow {
    padding: 25px 22px 100px;
    max-width: none;
  }
  .top {
    padding: 0 18px;
  }
  .reader-header {
    padding: 0 16px;
    gap: 10px;
  }
  .reader-tools {
    gap: 12px;
  }
  .reader-tools button + button:before {
    left: -7px;
  }
  .reader-tools button {
    padding-inline: 14px;
  }
  .compose-box {
    padding: 12px 20px 0;
  }
  .sheet-head {
    padding: 14px 18px;
    padding-top: calc(14px + env(safe-area-inset-top));
    min-height: 62px;
  }
  .sheet-head h2 {
    font-size: 17px;
  }
  .sheet-body {
    flex: 1;
    min-height: 0;
    max-height: none;
    padding: 0 22px calc(22px + env(safe-area-inset-bottom));
    overflow-y: auto;
  }
  dialog {
    width: 100vw;
    height: 100dvh;
    max-width: none;
    max-height: none;
    inset: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: var(--bg);
    box-shadow: none;
  }
  dialog[open] {
    display: flex;
    flex-direction: column;
  }
  .menu-list .menu-item {
    padding: 20px 0;
    gap: 16px;
  }
  .menu-item strong {
    font-size: 16px;
  }
  .menu-item small {
    font-size: 10px;
  }
  .line-item small {
    font-size: 10px;
  }
  .import-heading {
    display: block;
  }
  .import-beauty {
    margin: 0 0 24px;
  }
  .import-beauty .row {
    justify-content: start;
    gap: 10px;
  }
  .import-beauty > small {
    font-size: 10px;
    margin-bottom: 0;
  }
  .import-layout {
    display: block;
  }
  .chapter-index {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0 0 14px;
    margin-bottom: 20px;
  }
  .chapter-index > small {
    display: none;
  }
  .chapter-fields {
    grid-template-columns: 1fr;
  }
  .mobile-preview-tabs {
    display: grid;
  }
  .import-workspace {
    display: block;
  }
  .import-workspace[data-view=edit] .import-preview {
    display: none;
  }
  .import-workspace[data-view=preview] .import-editor {
    display: none;
  }
  .import-editor textarea {
    min-height: 340px;
  }
  .preview-surface {
    min-height: 360px;
    max-height: none;
    padding: 22px 20px;
  }
  .preview-empty {
    min-height: 320px;
  }
  .preview-heading {
    padding-inline: 18px;
  }
  .preview-surface .web-content {
    min-height: 360px;
  }
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .import-source {
    max-width: none;
  }
  .process-workspace {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .process-workspace .process-editor {
    padding: 0;
  }
  .process-workspace .preview-surface {
    min-height: 380px;
  }
  .group-columns {
    display: block;
  }
  .library-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 26px;
  }
  .library-tabs button {
    font-size: 12px;
  }
  .group-section {
    margin: 28px 0;
  }
  .guide-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .guide-grid a {
    padding: 20px 0;
  }
  .guide-grid a strong {
    font-size: 16px;
  }
  .guide-grid a small {
    font-size: 10px;
    margin-top: 7px;
  }
  .guide-grid .guide-number {
    min-width: 30px;
  }
  .preview-label {
    display: none;
  }
}
@media (min-width: 761px) {
  body[data-page=import] .page {
    padding-top: 24px;
    padding-bottom: 30px;
  }
  body[data-page=import] .field {
    margin-bottom: 16px;
  }
  body[data-page=import] .import-editor textarea {
    min-height: max(350px, calc(100dvh - 565px));
  }
  body[data-page=import] .import-workspace .preview-surface {
    min-height: 350px;
    max-height: calc(100dvh - 520px);
  }
  body[data-page=import] .form-footer {
    margin-top: 20px;
  }
  .import-workspace .preview-empty {
    min-height: 300px;
  }
}
.library-tabs button {
  padding: 8px 2px;
}
.library-tabs strong {
  display: block;
  font-size: 13px;
  font-weight: 500;
}
.library-tabs small {
  display: block;
  font-size: 9px;
  margin-top: 4px;
  line-height: 1.5;
}
html,
body,
#app,
#sheet,
#sheet *,
#app * {
  scrollbar-width: none;
}
html::-webkit-scrollbar,
body::-webkit-scrollbar,
#app::-webkit-scrollbar,
#app *::-webkit-scrollbar,
#sheet::-webkit-scrollbar,
#sheet *::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
.reader-scroll {
  scrollbar-gutter: auto;
}
.cover {
  justify-content: center;
}
.cover-art {
  align-items: center;
}
.cover-motif {
  font-size: 64px;
  color: rgba(255, 248, 229, .68);
  font-family:inherit;
}
.book-caption {
  justify-content: flex-end;
}
.top .back-label {
  font-size: 13px;
  padding-left: 0;
  letter-spacing: 0;
}
.top-title:empty {
  display: none;
}
.nav {
  background: var(--paper);
  box-shadow: 0 -5px 18px var(--shadow);
  height: calc(62px + env(safe-area-inset-bottom));
}
.nav .selected {
  background: transparent;
  font-weight: 600;
}
body[data-page=home] .page {
  max-width: 1000px;
}
.reading-hero {
  margin: 0 0 28px;
  max-width: 780px;
  grid-template-columns: 180px minmax(0, 1fr);
}
.read-again .section-head {
  margin: 20px 0 16px;
}
.read-again h2 {
  font-size:15px;line-height:1.6;font-weight:normal;font-style:normal;font-family:inherit;
  color: var(--muted);
}
.read-again .books {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding: 2px 8px 12px 0;
}
.read-again .book-cell {
  flex: 0 0 126px;
}
.read-again .cover {
  padding: 20px 13px 20px 20px;
}
.read-again .cover h3 {
  font-size: 18px;
  letter-spacing: 1px;
  line-height: 1.6;
}
.read-again .book-caption {
  display: none;
}
.shelf-entry {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 18px;
}
.shelf-entry button {
  padding-left: 0;
  color: var(--muted);
}
.shelf-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.shelf-toolbar .shelf-tabs {
  margin: 0;
}
.shelf-filter {
  display: flex;
  justify-content: flex-end;
  margin: -8px 0 18px;
}
.shelf-filter button {
  color: var(--muted);
}
.shelf-filter [aria-pressed=true] {
  color: var(--accent);
}
.collection-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.collection-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 22px;
  padding: 26px 22px;
  text-align: left;
  background: var(--paper);
  box-shadow: none;
  border-radius: 8px;
}
.collection-card strong {
  display: block;
  font-size:21px;line-height:1.6;font-weight:normal;font-style:normal;font-family:inherit;
}
.collection-card small {
  display: block;
  margin-top: 7px;
}
.collection-art {
  display: flex;
  align-items: center;
  height: 64px;
}
.collection-art i {
  width: 24px;
  height: 54px;
  background: var(--accent);
  opacity: .6;
  border: 2px solid var(--paper);
  transform: rotate(-9deg);
}
.collection-art i:nth-child(2) {
  height: 62px;
  transform: rotate(0);
  opacity: .9;
  margin-left: -9px;
}
.collection-art i:nth-child(3) {
  transform: rotate(9deg);
  margin-left: -9px;
  opacity: .45;
}
.collection-empty {
  padding: 38px 0;
  color: var(--muted);
  line-height: 2;
}
.book-overview {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 38px;
  align-items: center;
  max-width: 750px;
  margin: 12px auto 40px;
}
.book-overview h1 {
  font-size: 30px;
}
.detail-count {
  font-size: 12px;
  color: var(--muted);
  margin: 12px 0 22px;
}
.book-overview .primary {
  min-width: 160px;
}
.chapter-list {
  max-width: 750px;
  margin: auto;
}
.chapter-list h2 {
  font-size: 18px;
}
.chapter-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 0;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  text-align: left;
  font-size:18px;line-height:1.6;font-weight:normal;font-style:normal;font-family:inherit;
}
.chapter-link span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}
.chapter-link span:last-child {
  color: var(--muted);
}
@media (max-width: 760px) {
  .reading-hero {
    grid-template-columns: 146px minmax(0, 1fr);
    gap: 24px;
    padding: 12px 0 20px;
    margin: 0 0 20px;
  }
  .reading-hero h1 {
    font-size: 24px;
  }
  .read-again .books {
    gap: 16px;
    margin-right: -2px;
  }
  .read-again .book-cell {
    flex-basis: calc((100vw - 76px)/2.8);
  }
  .read-again .cover h3 {
    font-size: 16px;
    line-height: 1.6;
  }
  .read-again .cover {
    padding: 17px 10px 17px 17px;
  }
  .read-again .cover:after {
    inset: 9px 7px 9px 12px;
  }
  .shelf-entry {
    margin-top: 20px;
  }
  .shelf-toolbar {
    gap: 8px;
  }
  .shelf-toolbar .shelf-tabs {
    gap: 20px;
  }
  .collection-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .collection-card {
    padding: 24px 18px;
    gap: 15px;
    grid-template-columns: 64px minmax(0, 1fr) 14px;
  }
  .collection-card strong {
    font-size: 20px;
  }
  .collection-card small {
    margin-top: 14px;
  }
  .book-overview {
    grid-template-columns: 116px minmax(0, 1fr);
    gap: 24px;
    margin: 10px 0 34px;
  }
  .book-overview h1 {
    font-size: 24px;
    line-height: 1.55;
  }
  .book-overview .primary {
    min-width: 0;
    width: 100%;
    font-size: 13px;
  }
  .detail-count {
    margin: 10px 0 18px;
  }
  .chapter-link {
    font-size: 17px;
    padding: 21px 0;
  }
}
.nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  justify-items: center;
  padding-inline: max(0px, calc((100% - 780px)/2));
}
.menu-object {
  margin: 18px 0 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.menu-object small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 5px;
}
.menu-object strong {
  display: block;
  font-size:22px;line-height:1.5;font-weight:normal;font-style:normal;font-family:inherit;
  font-weight: 400;
  overflow-wrap: anywhere;
}
.cover.cover-image {
  padding: 0;
  overflow: hidden;
}
.cover.cover-image::after {
  display: none;
}
.cover-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.cover-preview {
  width: min(160px, 100%);
  margin: 20px auto;
}
body[data-page=home] #app {
  padding-bottom: calc(var(--mobile-nav-height,62px) + env(safe-area-inset-bottom));
}
.reading-hero h1 {
  text-wrap: balance;
}
.book-caption {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 4px;
}
.book-caption .book-title {
  display: block;
  flex: 1;
  min-width: 0;
  text-align: left;
  padding: 0;
  margin: 9px 0 0;
  font-size:15px;line-height:1.55;font-weight:normal;font-style:normal;font-family:inherit;
  white-space: normal;
  overflow-wrap: anywhere;
}
.book-caption .icon {
  margin-top: 5px;
  flex: none;
}
body[data-page=home] .page:not(:has(.empty)) {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 126px - env(safe-area-inset-bottom));
  padding-top: 24px;
  padding-bottom: 12px;
}
.reading-hero {
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 36px;
  align-items: stretch;
  padding: 0;
  max-width: 730px;
  margin: 0 0 26px;
}
.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-top: 18px;
  min-width: 0;
}
.hero-copy h1 {
  margin-top: 7px;
}
.hero-copy .primary {
  margin-top: auto;
  margin-bottom: 0;
  width: 100%;
}
.hero-copy p {
  margin-bottom: 12px;
}
.read-again .books {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 20px;
  overflow: visible;
  padding: 0;
  margin: 0;
}
.read-again .book-cell {
  flex: none;
  max-width: 126px;
  width: 100%;
  min-width: 0;
  justify-self: center;
}
.read-again .book-caption {
  display: flex;
}
.read-again .book-caption .icon {
  display: none;
}
.read-again .book-title {
  font-size: 12px;
  line-height: 1.45;
  margin-top: 8px;
  min-height: 2.9em;
}
.read-again .section-head {
  margin: 0 0 14px;
}
.shelf-entry {
  margin-top: auto;
  padding-top: 6px;
  padding-bottom: 4px;
}
.read-again {
  margin-bottom: 12px;
}
.favorite-view {
  font-size: 12px;
  margin-bottom: 20px;
}
.object-top .row {
  flex: 1;
  min-width: 0;
  flex-wrap: nowrap;
  gap: 10px;
}
.object-top .object-title {
  font-size:16px;line-height:1.5;font-weight:normal;font-style:normal;font-family:inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.object-top > .icon {
  flex: none;
}
.book-overview {
  align-items: stretch;
  margin-top: 0;
  margin-bottom: 30px;
}
.detail-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  padding-top: 8px;
}
.cast-label {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 8px;
}
.cast-names {
  font-size:23px;line-height:1.6;font-weight:normal;font-style:normal;font-family:inherit;
  overflow-wrap: anywhere;
}
.detail-copy .primary {
  width: 100%;
  margin-top: auto;
}
.detail-count {
  margin: 12px 0 16px;
}
.chapter-list .section-head {
  margin: 18px 0 12px;
}
.chapter-link {
  font-size: 17px;
  line-height: 1.5;
  padding: 8px 0;
  gap: 12px;
}
.chapter-section {
  padding-left: 12px;
}
.reader {
  grid-template-rows: 32px minmax(0, 1fr) calc(28px + env(safe-area-inset-bottom));
}
.reader.composing {
  grid-template-rows: 32px minmax(0, 1fr) auto;
}
.reader-header {
  height: 32px;
}
.reader-header h1 {
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: .3px;
}
.reader-header .icon {
  height: 26px;
  width: 26px;
  font-size: 18px;
}
.reader-header .dots {
  width: 20px;
  height: 20px;
  gap: 2px;
}
.reader-header .dots i {
  width: 2.5px;
  height: 2.5px;
}
.reader-tools {
  width: 100%;
  max-width: 780px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  gap: 0;
  height: 28px;
  padding: 0 22px;
}
.reader-tools button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  line-height: 18px;
  padding: 0;
  border: 0;
  border-radius: 2px;
}
.reader-tools button + button::before {
  display: none;
}
.tool-symbol {
  width: 12px;
  height: 12px;
  flex: none;
}
@media (max-width: 1100px) and (min-width: 761px) {
  .read-again .books {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: 560px;
  }
}
@media (max-width: 760px) {
  body[data-page=home] .page:not(:has(.empty)) {
    min-height: calc(100dvh - 124px - env(safe-area-inset-bottom));
    padding-top: 20px;
    padding-bottom: 10px;
  }
  .reading-hero {
    position: relative;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 22px;
    margin-bottom: calc(56px + var(--reading-inset));
  }
  .reading-hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(0px - var(--reading-inset));
    height: 1px;
    background:
      linear-gradient(
        90deg,
        transparent,
        var(--line) 20%,
        var(--line) 80%,
        transparent);
    opacity: .75;
    pointer-events: none;
  }
  .hero-copy {
    padding-top: 14px;
  }
  .reading-hero h1 {
    font-size: 20px;
    line-height: 1.55;
    margin: 8px 0;
  }
  .read-again .books {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px 16px;
  }
  .read-again .book-cell {
    max-width: 90px;
    flex: none;
  }
  .read-again .cover {
    padding: 12px 8px 12px 13px;
  }
  .read-again .cover h3 {
    font-size: 14px;
    line-height: 1.6;
    letter-spacing: 1px;
  }
  .read-again .cover::after {
    inset: 8px 6px 8px 10px;
  }
  .read-again .book-title {
    font-size: 12px;
    margin-top: 7px;
  }
  .read-again .section-head {
    margin: 0 0 12px;
  }
  .read-again h2 {
    font-size: 14px;
  }
  .object-top {
    padding-inline: 14px;
  }
  .object-top .object-title {
    font-size: 15px;
  }
  .cast-names {
    font-size: 20px;
  }
  .detail-count {
    margin: 9px 0 12px;
  }
  .chapter-link {
    font-size: 16px;
    padding: 8px 0;
    line-height: 1.5;
  }
  .chapter-section {
    padding-left: 10px;
  }
  .reader-header h1 {
    font-size: 11px;
  }
  .reader-tools {
    padding-inline: 22px;
  }
}
.read-again .books {
  grid-template-columns: repeat(3, minmax(0, 126px));
  gap: 24px;
}
.shelf-entry {
  margin-top: 6px;
}
@media (max-width: 760px) {
  .read-again .books {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }
}
body[data-page=book] .detail-count {
  margin-top: auto;
  margin-bottom: 6px;
}
body[data-page=book] .detail-copy .primary {
  margin-top: 0;
}
body[data-page=book] .book-overview {
  margin-bottom: 60px;
}
.reader {
  grid-template-rows: 32px minmax(0, 1fr) calc(37px + env(safe-area-inset-bottom));
}
.reader.composing {
  grid-template-rows: 32px minmax(0, 1fr) auto;
}
.reader-bottom {
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
}
.reader-tools {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  padding-inline: 0;
  justify-items: stretch;
}
.reader-tools button {
  width: 100%;
  height: 28px;
  justify-content: center;
}
.manuscript {
  padding-top: 52px;
}
.chapter {
  scroll-margin-top: 40px;
}
@media (max-width: 760px) {
  .manuscript {
    padding-top: 40px;
  }
}
.hero-cast {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
body[data-page=book] .book-overview {
  margin-top: 18px;
  margin-bottom: 42px;
}
@media (max-width: 760px) {
  .manuscript {
    padding-top: 55px;
  }
}
.chapter {
  scroll-margin-top: 63px;
}
.top {
  height: 32px;
  padding-inline: 24px;
}
.nav {
  height: calc(32px + env(safe-area-inset-bottom));
}
.nav button {
  min-height: 28px;
  padding: 2px 15px;
}
body[data-page=home] .page:not(:has(.empty)) {
  min-height: calc(100dvh - 64px - env(safe-area-inset-bottom));
}
.chapter-group {
  margin: 0;
  border-bottom: 1px solid var(--line);
  padding: 0;
}
.chapter-group-title {
  margin: 0;
  padding: 8px 0 6px;
  font-size:17px;line-height:1.5;font-weight:normal;font-style:normal;font-family:inherit;
}
.chapter-group .chapter-section {
  padding: 6px 0 6px 14px;
  font-size:14px;line-height:1.5;font-weight:normal;font-style:normal;font-family:inherit;
  color: var(--muted);
}
.chapter-group .chapter-section:last-child {
  border-bottom: 0;
}
@media (max-width: 760px) {
  .top {
    height: 32px;
    padding-inline: 14px;
  }
  .top .brand-mark {
    width: 22px;
    height: 22px;
    font-size: 16px;
    vertical-align: middle;
  }
  .nav {
    height: calc(32px + env(safe-area-inset-bottom));
  }
  body[data-page=home] .page:not(:has(.empty)) {
    min-height: calc(100dvh - 64px - env(safe-area-inset-bottom));
  }
  .chapter-group-title {
    font-size: 16px;
    padding-top: 8px;
  }
  .chapter-group .chapter-section {
    font-size: 13px;
    padding: 6px 0 6px 12px;
  }
}
body[data-page=home] .shelf-entry {
  margin-top: 0;
  padding: 10px 0 14px;
  max-width: 730px;
  width: 100%;
}
body[data-page=home] .home-chapters {
  flex: 1;
  min-height: 180px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  max-width: 730px;
  width: 100%;
}
.home-chapters .section-head {
  margin: 0 0 12px;
}
.home-chapters p {
  color: var(--muted);
}
body[data-page=home] .reading-hero {
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 30px;
  margin-bottom: 26px;
}
body[data-page=home] .reading-hero::after {
  content: none;
}
@media (max-width: 760px) {
  body[data-page=home] .top {
    height: 40px;
  }
  body[data-page=home] .reading-hero {
    grid-template-columns: minmax(0, .9fr) minmax(0, 1fr);
    gap: 22px;
    margin-bottom: 26px;
  }
  body[data-page=home] .hero-copy {
    padding-top: 8px;
  }
  body[data-page=home] .page:not(:has(.empty)) {
    min-height: calc(100dvh - 72px - env(safe-area-inset-bottom));
    padding-top: 36px;
  }
}
@media (min-width: 761px) {
  body:is([data-page=shelf], [data-page=collection]) .page .books {
    grid-template-columns: repeat(4, minmax(0, 180px));
    gap: 28px 32px;
  }
  body:is([data-page=shelf], [data-page=collection]) .page .books .cover:not(.cover-image) {
    padding: 22px 16px 18px 22px;
  }
  body:is([data-page=shelf], [data-page=collection]) .page .books .cover h3 {
    font-size: 21px;
    letter-spacing: 2px;
  }
}
@media (max-width: 760px) {
  body:is([data-page=shelf], [data-page=collection]) .page .books {
    column-gap: 32px;
    row-gap: 14px;
    padding-inline: 8px;
  }
  body:is([data-page=shelf], [data-page=collection]) .page .books > .book-cell {
    width: 100%;
    max-width: 136px;
    justify-self: center;
  }
  body:is([data-page=shelf], [data-page=collection]) .page .books .cover:not(.cover-image) {
    padding: 18px 12px 16px 18px;
  }
  body:is([data-page=shelf], [data-page=collection]) .page .books .cover h3 {
    font-size: 19px;
    letter-spacing: 1.5px;
  }
  body:is([data-page=shelf], [data-page=collection]) .page .books .book-title {
    font-size: 12px;
    margin-top: 6px;
    color: color-mix(in srgb, var(--ink) 70%, transparent);
  }
  body[data-page=shelf] .page .books .book-caption .icon {
    width: 24px;
    height: 24px;
    margin-top: 3px;
  }
}
body[data-page=pool] .rule-add {
  align-items: center;
  justify-content: center;
  border-style: dashed;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
}
body[data-page=pool] .rule-add svg {
  width: 56px;
  height: 64px;
}
dialog[open]:has(.script-workspace) {
  display: flex;
  flex-direction: column;
  height: min(800px, calc(100dvh - 48px));
}
dialog:has(.script-workspace) .sheet-head {
  flex-shrink: 0;
}
.sheet-body:has(.script-workspace) {
  display: flex;
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: hidden;
}
.script-workspace {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  min-height: 0;
}
.script-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.script-heading .menu-object {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.script-heading .quiet {
  flex-shrink: 0;
  padding: 4px 0;
  font-size: 12px;
  color: var(--muted);
}
.script-workspace > label {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
}
.script-writing {
  position: relative;
  flex: 1;
  min-height: 0;
}
.script-writing textarea {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  resize: none;
  padding: 14px 14px 46px;
  font-size: 15px;
  line-height: 1.9;
}
.script-writing output {
  position: absolute;
  right: 1px;
  bottom: 1px;
  left: 1px;
  padding: 8px 13px;
  text-align: right;
  font-size: 11px;
  line-height: 18px;
  color: var(--muted);
  background: var(--paper);
  border-radius: 0 0 3px 3px;
  pointer-events: none;
}
.script-create-footer {
  flex-shrink: 0;
  padding-top: 20px;
}
.script-create-footer > .primary {
  width: 100%;
}
@media (max-width: 760px) {
  dialog[open]:has(.script-workspace) {
    height: 100dvh;
  }
  .sheet-body:has(.script-workspace) {
    padding-top: 0;
  }
}
body[data-page=book] .page {
  padding-bottom: calc(80px + env(safe-area-inset-bottom));
}
.book-switch {
  position: fixed;
  inset: auto 0 0;
  z-index: 10;
  border-top: 1px solid var(--line);
  background: var(--glass);
  padding: 4px 22px calc(8px + env(safe-area-inset-bottom));
  box-shadow: 0 -5px 16px var(--shadow);
}
.book-switch > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  max-width: 760px;
  margin: auto;
}
.book-switch button {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 28px;
  padding: 0;
  font-size: 13px;
  line-height: 20px;
}
.book-switch button span {
  font-size: 17px;
  color: var(--muted);
}
.top.top-menu-only {
  justify-content: flex-end;
}
.nav button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  padding-inline: 8px;
}
.nav-icon {
  display: block;
  width: 20px;
  height: 20px;
  flex: none;
  background: currentColor;
  mask-position: center;
  mask-size: contain;
  mask-repeat: no-repeat;
}
.nav-icon-home {
  mask-image: url(nav/eye.ae7e85dacd31.webp);
}
.nav-icon-shelf {
  mask-image: url(nav/book.b3e2ef75259c.webp);
}
.nav-icon-pool {
  mask-image: url(nav/search.f7fa8a3631c0.webp);
}
.reader,
.reader.composing {
  touch-action: pan-x pan-y;
  position: relative;
  display: block;
  height: var(--app-viewport-height,100dvh);
  overflow: clip;
}
.reader .reader-scroll {
  height: 100%;
  width: 100%;
  outline-offset: -3px;
}
.reader .reader-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 20;
  width: 100%;
  margin: 0;
  height: calc(32px + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  padding-inline: max(16px, calc((100vw - 920px)/2));
  background: var(--glass);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 12px var(--shadow);
}
.reader .reader-bottom {
  position: absolute;
  inset: auto 0 0;
  z-index: 20;
  width: 100%;
  max-height: 75%;
  overflow-y: auto;
  background: var(--glass);
  box-shadow: 0 -4px 12px var(--shadow);
}
.reader .reader-header,
.reader .reader-bottom {
  transition: opacity .14s ease, transform .14s ease;
  opacity: 1;
  visibility: visible;
  backdrop-filter: blur(10px);
}
.reader[data-controls=false] .reader-header {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-100%);
  pointer-events: none;
}
.reader[data-controls=false] .reader-bottom {
  opacity: 0;
  visibility: hidden;
  transform: translateY(100%);
  pointer-events: none;
}
.reader .manuscript {
  padding-top: calc(40px + env(safe-area-inset-top));
  padding-bottom: calc(56px + env(safe-area-inset-bottom));
}
@media (prefers-reduced-motion: reduce) {
  .reader .reader-header,
  .reader .reader-bottom {
    transition: none;
  }
}
dialog[open]:has(.book-settings) {
  display: flex;
  flex-direction: column;
  height: min(780px, calc(100dvh - 48px));
}
dialog:has(.book-settings) .sheet-head {
  flex-shrink: 0;
}
.sheet-body:has(.book-settings) {
  display: flex;
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
}
.book-settings {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.book-settings .menu-object {
  flex-shrink: 0;
}
.book-settings-footer {
  margin-top: auto;
  padding-top: 28px;
  padding-bottom: 32px;
  flex-shrink: 0;
}
.book-settings-footer button {
  border: 1px solid var(--line);
  color: #875f59;
  min-height: 32px;
}
body[data-night=true] .book-settings-footer button {
  color: #c69b90;
}
@media (max-width: 760px) {
  dialog[open]:has(.book-settings) {
    height: 100dvh;
  }
}
dialog[open]:has(.book-cover-workspace) {
  display: flex;
  flex-direction: column;
  height: min(780px, calc(100dvh - 48px));
}
dialog:has(.book-cover-workspace) .sheet-head {
  flex-shrink: 0;
}
.sheet-body:has(.book-cover-workspace) {
  display: flex;
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
}
.book-cover-workspace {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.book-cover-workspace > * {
  flex-shrink: 0;
}
.cover-name {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.cover-name strong {
  font-size:22px;line-height:1.5;font-weight:normal;font-style:normal;font-family:inherit;
  font-weight: 400;
  overflow-wrap: anywhere;
  min-width: 0;
}
.cover-name .icon {
  flex-shrink: 0;
  color: var(--muted);
}
.cover-name svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.cover-name [hidden],
.cover-file-row [hidden] {
  display: none;
}
.cover-file-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.cover-file-row input {
  flex: 1;
  min-width: 0;
}
.cover-file-row .icon {
  flex-shrink: 0;
}
.book-cover-workspace .form-footer {
  margin-top: 0;
  padding-top: 20px;
  padding-bottom: 24px;
}
.book-cover-workspace .form-footer .primary {
  width: 100%;
}
@media (max-width: 760px) {
  dialog[open]:has(.book-cover-workspace) {
    height: 100dvh;
  }
}
.top-menu-only {
  position: relative;
}
.top-section-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  font-size:14px;line-height:1.5;font-weight:normal;font-style:normal;font-family:inherit;
  font-weight: 400;
}
.reader.composing .reader-header {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-100%);
  pointer-events: none;
}
.compose-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.compose-heading .field-label {
  margin: 0;
}
.compose-collapse {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  color: var(--muted);
}
.compose-collapse svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}
body:is([data-page=home], [data-page=shelf], [data-page=pool]) .top {
  border-bottom: 0;
}
body[data-page=import] .import-heading {
  margin-bottom: 20px;
}
body[data-page=import] .import-beauty {
  margin: 18px 0 0;
}
body[data-page=import] .chapter-fields .field {
  gap: 6px;
  margin-bottom: 12px;
}
body[data-page=import] .mobile-preview-tabs {
  margin-bottom: 12px;
}
body[data-page=import] .import-editor .field {
  grid-template-rows: 1fr;
  margin-bottom: 0;
}
body[data-page=import] .chapter-index {
  margin-bottom: 14px;
  padding-bottom: 10px;
}
.create-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}
.create-heading > .kicker {
  margin-top: 8px;
}
.create-cover {
  position: relative;
  flex-shrink: 0;
  width: 96px;
}
.create-cover-select {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  aspect-ratio: .73;
  border: 1px dashed var(--line);
  background: var(--paper);
  border-radius: 3px;
  color: var(--muted);
  overflow: hidden;
  cursor: pointer;
}
.create-cover-select > span {
  font-size: 26px;
  line-height: 1;
}
.create-cover-select small {
  font-size: 11px;
}
.create-cover-select img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
  border-radius: 3px;
}
.create-cover > .icon {
  position: absolute;
  right: -8px;
  top: -8px;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--line);
}
.create-cover > [hidden] {
  display: none;
}
.create-group-view {
  display: flex;
  margin: -8px 0 18px;
}
.create-group-view .quiet {
  font-size: 12px;
  padding: 0;
}
.create-heading {
  align-items: stretch;
  justify-content: flex-start;
  gap: 24px;
  min-height: 170px;
}
.create-heading .create-cover {
  width: 124px;
  align-self: flex-start;
}
.create-heading-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  min-width: 0;
  flex: 1;
}
.create-title-preview {
  font-size:22px;line-height:1.6;font-weight:normal;font-style:normal;font-family:inherit;
  overflow-wrap: anywhere;
  margin: 0;
  min-height: 35px;
}
.create-heading-copy .kicker {
  margin: 0;
  font-size: 11px;
  line-height: 1.8;
}
body[data-page=library] .headline {
  align-items: center;
  margin-bottom: 26px;
}
body[data-page=library] .headline h1 {
  margin-bottom: 16px;
}
body[data-page=library] .headline > div > small {
  display: block;
  line-height: 1.8;
}
body[data-page=library] .headline > .icon {
  font-size: 30px;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
}
body[data-page=library] .library-tabs {
  gap: 0;
  padding: 2px 0;
  margin-bottom: 32px;
  position: relative;
}
body[data-page=library] .library-tabs button {
  border-radius: 3px;
  min-height: 56px;
}
body[data-page=library] .library-tabs button + button {
  border-left: 1px solid color-mix(in srgb, var(--line) 45%, transparent);
}
body[data-page=library] .library-tabs::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -11px;
  height: 1px;
  background:
    linear-gradient(
      90deg,
      transparent,
      var(--line) 18%,
      var(--line) 82%,
      transparent);
  opacity: .65;
}
body[data-page=library] .line-list {
  position: relative;
  padding-bottom: 18px;
  margin-bottom: 22px;
}
body[data-page=library] .line-list .line-item:last-child {
  border-bottom: 0;
}
body[data-page=library] .line-list::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background:
    linear-gradient(
      90deg,
      transparent,
      var(--line) 18%,
      var(--line) 82%,
      transparent);
  opacity: .65;
}
@media (max-width: 760px) {
  body[data-page=library] .library-tabs button:nth-child(3n+1) {
    border-left: 0;
  }
  body[data-page=library] .library-tabs button:nth-child(n+4) {
    border-top: 1px solid color-mix(in srgb, var(--line) 45%, transparent);
  }
  body[data-page=library] .library-tabs button {
    min-height: 62px;
  }
}
.group-editor-title {
  font-size:20px;line-height:1.6;font-weight:normal;font-style:normal;font-family:inherit;
  margin: 8px 0 24px;
  overflow-wrap: anywhere;
}
.group-kind-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding: 8px 0 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}
.group-kind-tabs button {
  font-size: 13px;
  min-height: 36px;
  padding: 5px 4px;
  background: none;
  box-shadow: none;
  border-color: transparent;
}
.group-kind-tabs button.selected {
  background: var(--paper);
  border-color: var(--line);
  color: var(--accent);
}
.group-panels .group-section {
  margin: 0 0 26px;
}
.group-panels .group-section[hidden] {
  display: none;
}
.group-section-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.group-section-heading h3 {
  font-size:17px;line-height:1.5;font-weight:normal;font-style:normal;font-family:inherit;
  margin: 0;
}
.group-section-heading small {
  font-size: 11px;
  color: var(--muted);
}
.group-section-heading .group-import {
  margin-left: auto;
  font-size: 13px;
  min-width: 64px;
  padding: 5px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: none;
}
.group-panels .check-row {
  min-height: 54px;
}
@media (max-width: 760px) {
  .group-kind-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
body[data-page=process] .page > h1 {
  font-size: clamp(16px, 5vw, 20px);
  line-height: 1.6;
  white-space: nowrap;
}
body[data-page=process] textarea[name=request]::placeholder {
  color: var(--muted);
  opacity: .8;
}
#import-form input::placeholder,
#import-form textarea::placeholder {
  color: var(--muted);
  opacity: .8;
}
body[data-page=library] .library-entry {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 16px;
  gap: 10px;
  padding: 6px 0;
  min-height: 50px;
}
body[data-page=library] .entry-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--soft);
  color: color-mix(in srgb, var(--accent) 55%, var(--bg));
  overflow: hidden;
}
body[data-page=library] .entry-avatar svg {
  display: block;
  width: 26px;
  height: 26px;
}
body[data-page=library] .entry-copy strong {
  font-size: 14px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body[data-page=library] .entry-copy small {
  margin-top: 2px;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body[data-page=library] .entry-arrow {
  text-align: right;
  font-size: 14px;
}
body[data-page=library] .line-list {
  padding-bottom: 6px;
  margin-bottom: 16px;
}
.entry-avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--soft);
  color: color-mix(in srgb, var(--accent) 55%, var(--bg));
  overflow: hidden;
  flex-shrink: 0;
}
.entry-avatar svg {
  display: block;
  width: 32px;
  height: 32px;
}
.entry-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.entry-editor-heading {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  margin: 4px 0 28px;
}
.entry-visual-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.entry-visual-heading label {
  font-size: 12px;
  color: var(--muted);
}
.entry-visual-heading button {
  white-space: nowrap;
}
.entry-visual-field > .hint {
  display: block;
  margin: 0;
}
.entry-visual-field > :is([data-world-description-status], [data-person-brief-status]):empty {
  display: none;
}
body[data-page=entry] .entry-visual-field textarea {
  min-height: 120px;
  height: 120px;
}
.nai-fixed-prompts h3 {
  font-size: 14px;
  font-weight: 500;
  margin: 22px 0 16px;
}
.nai-fixed-prompts textarea {
  min-height: 110px;
  line-height: 1.9;
  padding-bottom: 28px;
}
.entry-avatar-button {
  display: grid;
  justify-items: center;
  gap: 8px;
  border: 0;
  padding: 0;
  background: none;
  box-shadow: none;
  width: 100%;
}
.entry-avatar-button .entry-avatar {
  width: 88px;
  height: 88px;
  border-radius: 8px;
}
.entry-avatar-button svg {
  width: 62px;
  height: 62px;
}
.entry-avatar-button small {
  font-size: 11px;
  color: var(--muted);
}
.entry-editor-meta .field {
  margin-bottom: 12px;
}
.entry-editor-meta > .field input {
  font-size: 17px;
}
.entry-person-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}
.entry-person-fields .field {
  margin-bottom: 0;
}
.entry-person-fields input {
  font-size: 12px;
}
.entry-editor-meta:has(> .field:last-child) .field {
  margin: 0;
}
.group-check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}
.group-check-item .check-row {
  flex: 1;
  min-width: 0;
  border: 0;
}
.group-entry-view {
  width: 34px;
  min-height: 34px;
  padding: 0;
  font-size: 24px;
  color: var(--muted);
  background: transparent;
  border: 0;
  box-shadow: none;
  flex-shrink: 0;
}
.group-entry-detail {
  padding: 24px 0;
}
.entry-detail-heading {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}
.entry-detail-heading h2 {
  font-size: 20px;
  overflow-wrap: anywhere;
}
.entry-detail-heading .entry-avatar {
  width: 64px;
  height: 64px;
}
.entry-detail-content {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.9;
}
.entry-detail-content p {
  margin: 0 0 15px;
}
.import-body-actions {
  display: flex;
  justify-content: flex-end;
  margin: 12px 0 0;
}
.import-body-actions + .form-footer {
  margin-top: 16px;
}
body[data-page=records] .generation-record {
  padding: 16px 0 20px;
  border-bottom: 1px solid var(--line);
}
body[data-page=records] .generation-record:first-child {
  padding-top: 0;
}
.generation-record h3 {
  font-size: 17px;
  margin: 0 0 10px;
}
.record-time {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
}
.record-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0 0;
}
.record-metrics dt {
  font-size: 11px;
  color: var(--muted);
}
.record-metrics dd {
  font-size: 14px;
  margin: 5px 0 0;
}
.record-request {
  font-size: 12px;
  margin-top: 12px;
  line-height: 1.7;
}
@media (max-width: 380px) {
  .entry-editor-heading {
    grid-template-columns: 80px minmax(0, 1fr);
    gap: 14px;
  }
  .entry-avatar-button .entry-avatar {
    width: 78px;
    height: 78px;
  }
  .entry-person-fields {
    gap: 8px;
  }
}
.association-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.association-heading h3 {
  font-size:14px;line-height:1.6;font-weight:500;font-style:normal;font-family:inherit;
}
.association-heading small {
  font-size: 10px;
  color: var(--muted);
}
.entry-association {
  margin: 0 0 12px;
}
.association-options {
  max-height: 154px;
  overflow-y: auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.association-options .check-row {
  padding: 10px 0;
  font-size: 12px;
  align-items: center;
}
.association-options .check-row:last-child {
  border-bottom: 0;
}
.association-options .check-row input {
  margin: 0;
}
.association-hint {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.7;
  margin: 8px 0 22px;
}
.background-notes {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
}
.background-notes .check-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.world-library-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin: 0 0 10px;
}
.world-library-tools .shelf-tabs {
  margin: 0;
  gap: 16px;
}
.world-library-tools .shelf-tabs button {
  padding: 5px 0;
  font-size: 13px;
}
.world-library-tools .shelf-tabs button.selected {
  border-bottom: 1px solid var(--accent);
}
.world-set-members .check-row {
  padding: 14px 0;
}
.world-set-members .check-content small {
  font-size: 11px;
  color: var(--muted);
}
.world-set-choices + button {
  margin-top: 10px;
}
.individual-worlds {
  margin: 18px 0;
}
.world-set-name {
  font-size: 21px;
  margin: 24px 0 12px;
}
.bound-npc-note {
  color: var(--accent);
  font-size: 10px;
}
.bound-npc-note[hidden] {
  display: none !important;
}
.key-input {
  display: flex;
  align-items: center;
  gap: 6px;
}
.key-input input {
  flex: 1;
  min-width: 0;
}
.api-parameters {
  margin: 12px 0 24px;
}
.parameter-fields {
  padding-top: 16px;
}
.reading-frame-wrap {
  position: relative;
  width: 100%;
  height: 300px;
}
.reading-frame {
  position: absolute;
  left: 0;
  top: 0;
  border: 0;
  transform-origin: top left;
  max-width: none;
}
.original-reply {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.record-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  background: transparent;
}
.record-item small {
  display: block;
  margin-top: 6px;
}
.record-details {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 10px;
}
.record-details dd {
  margin: 0;
  overflow-wrap: anywhere;
}
input[type=number] {
  max-width: 100%;
}
.template-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  align-items: stretch;
  margin: 0 0 20px;
  border-bottom: 1px solid var(--line);
}
.template-actions button {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 8px 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
}
.template-actions button + button {
  border-left: 1px solid var(--line);
}
.template-actions button[aria-pressed=true] {
  color: var(--accent);
}
.template-actions button:hover {
  background: transparent;
  filter: none;
  color: var(--accent);
}
.template-actions button:active {
  transform: none;
}
.reader.has-book-style .chapter:not(.own-version) > h2 {
  display: none;
}
.reading-settings-actions {
  display: grid;
  gap: 14px;
  margin: 24px 0;
}
.chapter-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.chapter-entry .chapter-link {
  border-bottom: 0;
}
.chapter-entry > .icon {
  width: 34px;
  height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
}
.cast-section {
  margin: 0 0 22px;
}
.cast-section h3 {
  margin-bottom: 8px;
}
.cast-empty {
  padding: 10px 0 16px;
  border-bottom: 1px solid var(--line);
}
.cast-empty p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}
.cast-empty button {
  padding-inline: 0;
}
.settings-danger {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.settings-danger button,
.danger {
  color: #87534d;
  border-color: #b99a94;
}
body[data-night=true] .settings-danger button,
body[data-night=true] .danger {
  color: #d0a29a;
  border-color: #765952;
}
.delete-archive-intro {
  line-height: 1.9;
  margin: 0 0 24px;
}
.delete-options {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.delete-options legend {
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted);
}
.delete-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 17px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
  cursor: pointer;
}
.delete-option input {
  margin-top: 4px;
}
.delete-option span {
  min-width: 0;
}
.delete-option strong {
  display: block;
  font-size: 15px;
  font-weight: 500;
}
.delete-option small {
  display: block;
  margin-top: 5px;
  line-height: 1.7;
}
.delete-review {
  padding-top: 20px;
}
.delete-review > p:first-child {
  margin: 0 0 10px;
}
.delete-review ul {
  margin: 0;
  padding-left: 1.4em;
  line-height: 2;
}
.delete-warning {
  margin-top: 22px;
  color: #87534d;
}
body[data-night=true] .delete-warning {
  color: #d0a29a;
}
.compose-box textarea {
  max-height: min(28dvh, calc(var(--app-viewport-height,100dvh) * .32));
}
.reader .manuscript {
  width: calc(100% - 2 * var(--reading-gutter,12px));
  max-width: 960px;
}
.reader .manuscript:has([data-reading-source]) {
  width: 100%;
}
.reader .reader-scroll {
  container-type: inline-size;
}
.reader .reading-frame-wrap {
  width: calc(100cqw - 4px);
  margin-inline: calc((100% - 100cqw)/2 + 2px);
}
.reader-web-popup {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(360px, calc(100% - 32px));
  max-height: calc(100dvh - 48px);
  box-sizing: border-box;
  padding: 20px;
  border: 1px solid #d8d8ce;
  border-radius: 10px;
  background: #f8f6ee;
  color: #243c34;
  overflow: auto;
}
.reader-web-popup::backdrop {
  background: #0005;
}
.reader-web-popup p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.reader-web-popup .form-footer {
  display: flex;
  gap: 12px;
}
.section-heading {
  font-size: 1.15em;
  margin: 1.5em 0 .8em;
}
.reader-web-popup {
  height: auto;
  min-height: 0;
  max-height: calc(100dvh - 48px);
}
.reader-web-popup[open] {
  display: block;
  inset: auto;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  height: fit-content;
  margin: 0;
}
dialog[open]:has(.reader-directory) {
  inset: auto 0 0;
  margin: 0 auto;
  width: min(580px, 100%);
  height: auto;
  max-height: 80dvh;
  display: flex;
  flex-direction: column;
  border-radius: 16px 16px 0 0;
  box-sizing: border-box;
  animation: directory-rise .18s ease-out;
}
.reader-directory .chapter-link {
  min-width: 0;
  flex: 1;
  text-align: left;
  white-space: normal;
}
dialog[open]:has(.reader-directory) .sheet-head {
  flex-shrink: 0;
}
dialog[open]:has(.reader-directory) .sheet-head h2 {
  font-size: 16px;
}
dialog[open]:has(.reader-directory) .sheet-body {
  flex: 0 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
}
.reader-directory .chapter-link {
  font-size: 14px;
  line-height: 1.5;
}
.reader-directory .icon {
  flex-shrink: 0;
  font-size: 15px;
}
@keyframes directory-rise {
  from {
    transform: translateY(35px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  dialog[open]:has(.reader-directory) {
    animation: none;
  }
}
dialog[open]:has(.delete-book-confirm) {
  display: block;
  inset: 0;
  margin: auto;
  width: min(360px, calc(100vw - 36px));
  height: fit-content;
  max-height: calc(100dvh - 48px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--glass);
  box-shadow: inset 0 1px 0 var(--edge), 0 12px 34px var(--shadow);
}
dialog:has(.delete-book-confirm) .sheet-head {
  padding: 15px 18px;
  min-height: 0;
}
dialog:has(.delete-book-confirm) .sheet-head > [data-action=close]:first-child {
  visibility: hidden;
}
.sheet-body:has(.delete-book-confirm) {
  padding: 0 22px 22px;
  overflow: visible;
}
.delete-book-confirm p {
  margin: 20px 0 7px;
  line-height: 1.7;
}
.delete-book-confirm > small {
  display: block;
  color: var(--muted);
  line-height: 1.7;
}
.delete-book-confirm .form-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 24px;
}
.delete-book-confirm .form-footer button {
  width: 100%;
}
.settings-symbol {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.hero-cast-select {
  padding: 0 2px;
  font-size: inherit;
  color: var(--accent);
  vertical-align: baseline;
}
#sheet:has(.bindings-editor) {
  height: min(820px, calc(100dvh - 48px));
}
#sheet[open]:has(.bindings-editor) {
  display: flex;
  flex-direction: column;
}
#sheet .sheet-body:has(.bindings-editor) {
  display: flex;
  flex: 1;
  min-height: 0;
  max-height: none;
  padding: 0;
  overflow: hidden;
}
#sheet .bindings-editor {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
  padding: 0;
}
.bindings-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 22px 26px 12px;
  overscroll-behavior: contain;
}
.binding-intro {
  margin-bottom: 16px;
}
.binding-intro small {
  font-size: 12px;
}
.binding-intro h3 {
  font-size: 21px;
  line-height: 1.5;
  margin: 4px 0 6px;
  overflow-wrap: anywhere;
}
.binding-intro p {
  font-size: 13px;
  color: var(--muted);
}
.binding-group {
  margin-bottom: 16px;
}
.binding-group label {
  font-size: 14px;
  color: var(--ink);
}
.binding-group select {
  min-height: 42px;
  font-size: 14px;
}
.binding-section {
  margin: 0;
  border-top: 1px solid var(--line);
}
.binding-section > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px;
  gap: 4px 12px;
  padding: 12px 0;
  list-style: none;
  color: var(--ink);
}
.binding-section > summary::-webkit-details-marker {
  display: none;
}
.binding-section-title {
  font-size: 16px;
  font-weight: 500;
}
.binding-selected {
  grid-row: 2;
  font-size: 13px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.binding-chevron {
  grid-column: 2;
  grid-row: 1/3;
  align-self: center;
  text-align: center;
  font-size: 20px;
  color: var(--muted);
}
.binding-section[open] > summary .binding-chevron {
  transform: rotate(180deg);
}
.binding-section[open] > summary .binding-selected {
  display: none;
}
.binding-section[open] > summary .binding-chevron {
  grid-row: 1;
}
.binding-choices {
  padding: 0 0 10px;
}
.bindings-editor .check-row {
  align-items: flex-start;
  gap: 12px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  min-height: 48px;
}
.bindings-editor .check-row:has(input:checked) {
  background: var(--soft);
  border-color: var(--line);
}
.bindings-editor .check-row input {
  flex: none;
  width: 17px;
  height: 17px;
  margin: 3px 0 0;
  accent-color: var(--accent);
}
.binding-choice-copy {
  min-width: 0;
  flex: 1;
}
.binding-choice-copy strong {
  font-size: 15px;
  font-weight: 400;
  overflow-wrap: anywhere;
}
.binding-excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.7;
  margin-top: 4px;
}
.binding-empty {
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
  padding: 0 0 8px;
}
.bindings-editor .group-check-item {
  border: 0;
}
.bindings-editor .individual-worlds {
  margin: 10px 0 0;
}
.bindings-editor .individual-worlds > summary {
  font-size: 13px;
  padding: 8px 0;
}
.binding-save {
  flex: none;
  border-top: 1px solid var(--line);
  background: var(--bg);
  padding: 14px 26px calc(14px + env(safe-area-inset-bottom));
}
.binding-save button {
  min-height: 40px;
}
@media (max-width: 760px) {
  #sheet:has(.bindings-editor) {
    height: 100dvh;
  }
  .bindings-scroll {
    padding: 20px 22px 12px;
  }
  .binding-save {
    padding-inline: 22px;
  }
}
.record-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.record-row .record-item {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 68px;
  padding: 12px 0 4px;
  border: 0;
  box-shadow: none;
  overflow-wrap: anywhere;
}
.record-row .record-item small {
  margin-top: auto;
  padding-top: 6px;
}
.record-row .record-delete {
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1;
}
.record-row .record-delete:hover {
  color: var(--ink);
  background: var(--soft);
}
@media (max-width: 760px) {
  dialog[open]:has(.delete-book-confirm) {
    bottom: 16dvh;
    max-height: calc(84dvh - 48px);
    overflow-y: auto;
  }
}
dialog[open]:has(.regenerate-confirm) {
  display: flex;
  flex-direction: column;
  inset: 0;
  margin: auto;
  width: min(420px, calc(100vw - 36px));
  height: fit-content;
  max-height: calc(100dvh - 48px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--glass);
  box-shadow: inset 0 1px 0 var(--edge), 0 12px 34px var(--shadow);
}
dialog:has(.regenerate-confirm) .sheet-head {
  padding: 15px 18px;
  min-height: 0;
  flex-shrink: 0;
}
dialog:has(.regenerate-confirm) .sheet-head > [data-action=close]:first-child {
  visibility: hidden;
}
dialog:has(.regenerate-confirm) .sheet-body {
  padding: 0 22px 22px;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  flex: 0 1 auto;
}
.regenerate-confirm .hint {
  margin: 18px 0;
  line-height: 1.7;
}
.regenerate-confirm textarea {
  height: 150px;
  min-height: 100px;
  max-height: 35dvh;
}
.regenerate-confirm .form-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}
.regenerate-confirm .form-footer button {
  width: 100%;
}
dialog[open]:has(.delete-confirm, .delete-review, [data-form=delete-archive]) {
  display: flex;
  flex-direction: column;
  inset: 0;
  margin: auto;
  width: min(400px, calc(100vw - 36px));
  height: fit-content;
  max-height: 80dvh;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--glass);
  box-shadow: inset 0 1px 0 var(--edge), 0 12px 34px var(--shadow);
}
dialog:has(.delete-confirm, .delete-review, [data-form=delete-archive]) .sheet-head {
  padding: 15px 18px;
  min-height: 0;
  flex-shrink: 0;
}
dialog:has(.delete-confirm, .delete-review, [data-form=delete-archive]) .sheet-head > [data-action=close]:first-child {
  visibility: hidden;
}
dialog:has(.delete-confirm, .delete-review, [data-form=delete-archive]) .sheet-body {
  padding: 0 22px 22px;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  flex: 0 1 auto;
}
.delete-confirm > p,
.delete-review > p {
  margin: 18px 0;
  line-height: 1.7;
}
:is(.delete-confirm, .delete-review, [data-form=delete-archive]) .form-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 22px;
}
:is(.delete-confirm, .delete-review, [data-form=delete-archive]) .form-footer button {
  width: 100%;
  min-width: 0;
}
dialog:has(.book-settings) .sheet-head h2 {
  overflow-wrap: anywhere;
  min-width: 0;
}
html,
body {
  overscroll-behavior-y: none;
}
.shelf-add svg {
  width: 32px;
  height: 36px;
  display: block;
}
.shelf-add {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
}
.settings-danger {
  display: grid;
  gap: 12px;
}
.create-submit-actions {
  display: grid;
  gap: 12px;
}
.create-rule-button {
  margin-top: 10px;
}
body:is([data-page=shelf], [data-page=pool], [data-page=script-collection], [data-page=create], [data-page=rule-edit], [data-page=rule-view]) .page {
  max-width: 520px;
  margin-inline: auto;
  padding: 26px 24px 100px;
}
body:is([data-page=shelf], [data-page=pool], [data-page=script-collection], [data-page=create], [data-page=rule-edit], [data-page=rule-view]) .top {
  position: relative;
  max-width: 520px;
  margin: auto;
  justify-content: space-between;
}
body:is([data-page=script-collection], [data-page=create], [data-page=rule-edit], [data-page=rule-view]) .top .row {
  display: contents;
}
body:is([data-page=script-collection], [data-page=create], [data-page=rule-edit], [data-page=rule-view]) .top :is(.object-title, .top-title) {
  position: absolute;
  left: 60px;
  right: 60px;
  text-align: center;
  pointer-events: none;
}
.nav > * {
  flex: 1;
  max-width: 174px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.nav {
  gap: 0;
}
.nav button.selected {
  background: #e1eadb;
  color: #24543b;
  border-radius: 6px;
  font-weight: 600;
}
.nav-unavailable {
  color: var(--muted);
  font-size: 12px;
}
.nav-unavailable small {
  display: block;
  font-size: 9px;
  text-align: center;
}
.nav-unavailable svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
}
.shelf-tabs,
.script-group-tabs {
  display: flex;
  gap: 22px;
  margin-bottom: 25px;
}
.shelf-tabs button,
.script-group-tabs button {
  padding: 8px 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: none;
  color: var(--muted);
}
.shelf-tabs button.selected,
.script-group-tabs button.selected {
  color: var(--ink);
  border-bottom: 1px solid var(--accent);
}
.shelf-tools {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}
body:is([data-page=shelf], [data-page=pool], [data-page=script-collection]) .page .books {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 27px 25px;
}
body:is([data-page=shelf], [data-page=pool], [data-page=script-collection]) .books > article {
  width: 80%;
  justify-self: center;
  min-width: 0;
}
body:is([data-page=shelf], [data-page=pool], [data-page=script-collection]) .books .cover {
  aspect-ratio: 3/4;
  padding: 19px 14px;
  justify-content: center;
}
body:is([data-page=shelf], [data-page=pool], [data-page=script-collection]) .books .cover h3 {
  font-size: 18px;
  letter-spacing: 1.6px;
}
.shelf-book-name {
  display: block;
  margin-top: 12px;
  overflow-wrap: anywhere;
  font-size: 14px;
}
.shelf-book small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
}
.add-books {
  margin-top: 27px;
}
.shelf-book-add .cover {
  border: 1px dashed var(--line);
  background: transparent;
  box-shadow: none;
  color: var(--accent);
  align-items: center;
}
.shelf-book-add .cover:after {
  display: none;
}
.shelf-book-add svg {
  width: 37px;
  height: 47px;
}
.shelf-book-add .shelf-book-name {
  text-align: center;
  color: var(--muted);
}
.script-collection-mark {
  width: 54px;
  height: 60px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--soft);
  color: var(--accent);
}
.script-collection-mark svg {
  width: 44px;
  height: 44px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}
.script-collection-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 3px;
}
.script-collection-mark[data-source=\81ea\5df1\7f16\5199] {
  color: #76694d;
  background: #ece8dc;
}
.script-collection-mark[data-source=\5e7f\573a\6536\85cf] {
  color: #54716c;
  background: #e5e9e8;
}
.shelf-cover-editor {
  display: flex;
  gap: 20px;
  align-items: center;
  margin: 0 0 24px;
}
.shelf-cover-preview {
  width: 120px;
  flex: none;
}
.shelf-cover-preview .cover {
  aspect-ratio: 3/4;
  justify-content: center;
  padding: 16px 12px;
}
.shelf-cover-preview .cover h3 {
  font-size: 16px;
  letter-spacing: 1px;
}
.shelf-cover-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}
.cover-upload {
  cursor: pointer;
  color: var(--accent);
  border-bottom: 1px solid var(--line);
  padding: 5px 0;
}
.shelf-cover-editor .script-collection-mark {
  width: 90px;
  height: 100px;
}
.rule-detail-cover {
  margin: 0 auto 20px;
}
.rule-body {
  white-space: normal;
  overflow-wrap: anywhere;
}
.rule-random-settings {
  margin: 24px 0;
}
.group-name-row {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  box-shadow: none;
  padding: 20px 0;
  margin-bottom: 24px;
}
.group-name-row small,
.group-name-row strong {
  display: block;
}
.group-name-row small {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 12px;
}
.group-name-row strong {
  font-size: 20px;
  font-weight: 400;
}
.script-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin: 15px 0;
}
.script-search input {
  min-width: 0;
}
.script-search select {
  max-width: 130px;
}
.check-row[hidden],
.search-empty[hidden] {
  display: none;
}
.check-row small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.creation-selected {
  text-align: right;
  color: var(--muted);
  font-size: 12px;
  margin-top: -38px;
  margin-right: 28px;
  margin-bottom: 24px;
  pointer-events: none;
  padding-left: 95px;
  overflow-wrap: anywhere;
}
[data-form=create] .menu-item small:empty {
  display: none;
}
.bound-script-names {
  font-size: 12px;
  color: var(--muted);
}
@media (max-width: 370px) {
  body:is([data-page=shelf], [data-page=pool], [data-page=script-collection]) .books .cover h3 {
    font-size: 16px;
  }
}
.creation-choice {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 20px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  text-align: left;
}
.creation-choice-value {
  flex: 1;
  min-width: 0;
  text-align: right;
  color: var(--muted);
  overflow-wrap: anywhere;
}
body[data-page=shelf] .collection-list {
  display: block;
}
body[data-page=shelf] .collection-card {
  width: 100%;
  grid-template-columns: 54px minmax(0, 1fr) 18px;
  gap: 22px;
  padding: 22px 0;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}
body[data-page=shelf] .collection-card small {
  margin-top: 4px;
}
body:is([data-page=shelf], [data-page=pool]) .top-menu-only > button {
  margin-left: auto;
}
[data-api-channel] .key-input {
  display: block;
  position: relative;
}
[data-api-channel] .key-input input {
  width: 100%;
  padding-right: 60px;
}
[data-api-channel] .api-key-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  padding: 6px 10px;
  min-width: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  font-size: 12px;
  color: var(--accent);
}
[data-api-channel] .api-model-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
}
[data-api-channel] .api-model-row input {
  flex: 1;
  min-width: 0;
  width: 0;
}
[data-api-channel] .api-model-fetch {
  flex: none;
  white-space: nowrap;
  padding: 0 10px;
  font-size: 12px;
  margin: 0;
  box-shadow: none;
}
body[data-page=api] [data-action=source-list] {
  margin-bottom: 22px;
}
body[data-page=api] .top {
  position: relative;
}
body[data-page=api] .top-title {
  position: absolute;
  left: 60px;
  right: 60px;
  text-align: center;
  pointer-events: none;
}
body:is([data-page=library], [data-page=json-import]) .top {
  position: relative;
}
body:is([data-page=library], [data-page=json-import]) .top-title {
  position: absolute;
  left: 60px;
  right: 60px;
  text-align: center;
  pointer-events: none;
}
#card-file {
  display: block;
  width: auto;
  max-width: 100%;
  margin: 16px auto;
}
#card-file[hidden] {
  display: none;
}
.file-area .card-file-button {
  display: table;
  margin: 18px auto;
  padding: 8px 18px;
  border: 1px solid var(--line);
  border-radius: 5px;
  cursor: pointer;
  background: var(--paper);
  color: var(--ink);
}
.card-file-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.entry-editor-heading.background-heading {
  grid-template-columns: minmax(0, 1fr);
}
.background-notes {
  grid-template-columns: minmax(0, 1fr);
}
.association-search {
  margin: 10px 0;
}
.association-no-results[hidden] {
  display: none;
}
body[data-page=entry] .top {
  position: relative;
}
body[data-page=entry] .top-title {
  position: absolute;
  left: 60px;
  right: 60px;
  text-align: center;
  pointer-events: none;
}
body[data-page=group] .top ,body .group-choice-scope .top{
  position: relative;
}
body[data-page=group] .top-title ,body .group-choice-scope .top-title{
  position: absolute;
  left: 60px;
  right: 60px;
  text-align: center;
  pointer-events: none;
}
.library-import-area {
  border: 1px dashed var(--line);
  border-radius: 6px;
  padding: 22px;
  margin-top: 24px;
  display: flex;
  justify-content: center;
}
.library-import-area button {
  margin: 0;
}
.shelf-tools.shelf-work-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.shelf-work-actions .shelf-action {
  width: 100%;
  margin: 0;
  padding: 10px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: none;
}
.shelf-work-actions .shelf-action.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
}
.script-random-action {
  display: flex;
  justify-content: center;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.script-random-button {
  padding: 10px 20px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: none;
}
.shelf-random {
  margin-bottom: 18px;
}
.shelf-random-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.shelf-random-buttons .shelf-action {
  width: 100%;
  margin: 0;
  padding: 10px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: none;
}
.shelf-random-buttons .shelf-action.random-start {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
}
.random-group-note {
  display: block;
  margin: 10px 0 0;
  padding: 2px 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: var(--muted);
  font-size: 12px;
}
.book-group {
  border-bottom: 1px solid var(--line);
  padding-bottom: 24px;
  margin-bottom: 24px;
}
.book-group:last-of-type {
  border-bottom: 0;
}
.book-group > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  list-style: none;
  cursor: pointer;
  padding: 6px 0;
  margin-bottom: 16px;
}
.book-group > summary::-webkit-details-marker {
  display: none;
}
.book-group-name {
  font-size: 15px;
  font-weight: 600;
}
.book-group > summary small {
  color: var(--muted);
}
.book-group-chevron {
  margin-left: auto;
  color: var(--muted);
  transition: transform .15s;
}
.book-group:not([open]) > summary {
  margin-bottom: 0;
}
.book-group:not([open]) .book-group-chevron {
  transform: rotate(-90deg);
}
.creation-locked {
  cursor: default;
}
.creation-locked-note {
  flex-shrink: 0;
  color: var(--accent);
  font-size: 11px;
}
.binding-locked-note {
  margin: 4px 0 12px;
}
.import-rule-extra {
  margin: 0 0 18px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  padding: 0 14px;
}
.import-rule-extra > summary {
  padding: 12px 0;
  cursor: pointer;
  color: var(--muted);
}
.import-rule-extra[open] > summary {
  color: var(--ink);
}
@media (min-width: 761px) {
  .hero-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 8px;
  }
  .hero-switch {
    white-space: nowrap;
  }
  .shelf-random-buttons {
    display: flex;
    justify-content: flex-start;
    gap: 12px;
  }
  .shelf-random-buttons .shelf-action {
    width: auto;
    min-width: 160px;
    padding: 9px 20px;
  }
}
body[data-page=shelf] .page > .shelf-tabs {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}
.script-group-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 24px;
}
.script-group-tabs button {
  margin: 0;
  padding: 10px 4px;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 13px;
  text-align: center;
  color: var(--muted);
}
.script-group-tabs button.selected {
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--accent);
  font-weight: 600;
}
.script-group-empty {
  padding: 36px 16px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}
.script-group-empty p {
  margin: 0;
}
.empty-guide .empty-api-button {
  display: block;
  width: 100%;
  margin: 16px auto;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: none;
}
#story-files[hidden] {
  display: none;
}
body[data-page=import] .import-editor {
  position: relative;
}
body[data-page=import] .import-editor textarea {
  padding-bottom: 76px;
}
.import-beauty-inline {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 5px 10px;
  border: 0;
  background: var(--paper);
  box-shadow: none;
  color: var(--accent);
}
.import-beauty-inline > span {
  font-size: 26px;
  line-height: 1;
}
.import-beauty-inline small {
  color: inherit;
}
.binding-create {
  width: 100%;
  padding: 12px;
  border: 1px dashed var(--line);
  background: transparent;
  box-shadow: none;
}
.nav {
  height: auto;
  min-height: calc(32px + env(safe-area-inset-bottom));
  padding-top: 8px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
}
.import-beauty-inline svg {
  width: 30px;
  height: 30px;
}
.script-top {
  display: grid !important;
  grid-template-columns: 80px 1fr 80px !important;
  align-items: center;
}
.script-top h1 {
  font-size: 17px;
  font-weight: 400;
  text-align: center;
  margin: 0;
}
.script-top > div {
  display: flex;
  justify-content: flex-end;
}
.script-top .icon {
  width: 40px;
  padding: 8px;
}
.script-top > button {
  justify-self: start;
}
.script-cover-row {
  gap: 16px;
}
.script-cover-row .shelf-cover-preview {
  width: 90px;
  flex: none;
}
.script-cover-row .shelf-cover-actions {
  flex: 1;
  min-width: 0;
}
.script-cover-row .field {
  margin: 0 0 10px;
  width: 100%;
}
.script-cover-row .row {
  flex-wrap: wrap;
}
.script-dynamic,
.script-regex-item {
  border-bottom: 1px solid var(--line,#dcded2);
  padding: 16px 0;
  margin-bottom: 20px;
}
.script-dynamic > summary {
  margin-bottom: 12px;
  cursor: pointer;
}
.script-dynamic small {
  color: #85887e;
  margin-left: 8px;
}
.script-dynamic-list {
  max-height: 45vh;
  overflow: auto;
  margin: 12px 0;
}
.script-dynamic-item {
  border: 1px solid var(--line,#dcded2);
  border-radius: 6px;
  padding: 10px;
  margin: 8px 0;
}
.script-dynamic-item > summary {
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.script-dynamic-item textarea {
  margin: 12px 0;
}
.script-small-delete {
  font-size: 12px !important;
  padding: 2px 9px !important;
  border: 1px dashed #bfc6b8 !important;
  background: transparent !important;
}
.script-regex-item > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  margin-bottom: 12px;
}
.script-regex-item > summary:before {
  content: "\203a";
}
.script-regex-item[open] > summary:before {
  content: "\2304";
}
.script-regex-item:not([open]) .script-small-delete {
  display: none;
}
.script-regex-item label {
  display: block;
  margin: 12px 0;
}
.script-regex-item textarea {
  width: 100%;
  margin-top: 8px;
}
.script-dashed {
  border: 1px dashed #bfc6b8 !important;
  background: transparent !important;
}
.script-tool-row {
  display: flex;
  gap: 8px;
  margin: 18px 0;
}
.script-tool-row button {
  flex: 1;
  min-height: 44px;
  padding: 8px 4px;
}
.script-regex-area[hidden],
.script-dynamic-item[hidden] {
  display: none;
}
.script-import-actions {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}
.script-prompt-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size:13px;line-height:1.8;font-weight:normal;font-style:normal;font-family:inherit;
}
.script-beauty-switch {
  margin: 20px 0;
}
body[data-page=rule-edit] .script-text-editor > textarea {
  display: block;
  min-height: 0;
  height: max(57.5px, calc((100dvh - 365px)/2));
  margin: 0;
  width: 100%;
  resize: vertical;
}
.script-text-editor {
  min-width: 0;
  margin: 8px 0 14px;
}
.script-text-tools {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  min-height: 32px;
}
.script-text-count {
  font-size: 12px;
  color: var(--muted);
}
.script-expand {
  display: grid;
  place-items: center;
  width: 34px;
  height: 32px;
  padding: 4px;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.script-expand img {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
}
body[data-night=true] .script-expand img {
  filter: brightness(1.8);
}
dialog.script-fullscreen {
  position: fixed;
  inset: 0;
  margin: 0;
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom);
  border: 0;
  border-radius: 0;
  background: var(--bg);
  color: var(--ink);
}
dialog.script-fullscreen[open] {
  display: flex;
  flex-direction: column;
}
dialog.script-fullscreen header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  flex: none;
}
dialog.script-fullscreen h2 {
  font-size: 17px;
  font-weight: 400;
  margin: 0;
}
body dialog.script-fullscreen textarea {
  flex: 1;
  width: 100%;
  min-height: 0;
  height: auto;
  margin: 0;
  resize: none;
  font-size: 16px;
  line-height: 1.9;
}
dialog.script-fullscreen footer {
  text-align: right;
  padding: 10px 0;
  color: var(--muted);
  font-size: 12px;
  flex: none;
}
.script-text-editor {
  position: relative;
}
.script-text-editor > textarea {
  display: block;
}
body[data-page=rule-edit] .script-text-editor > textarea {
  padding-bottom: 44px;
}
.script-text-tools {
  position: absolute;
  left: 8px;
  right: 18px;
  bottom: 5px;
  justify-content: space-between;
  pointer-events: none;
}
.script-text-tools .script-expand {
  order: -1;
  pointer-events: auto;
  background: var(--paper);
  border-radius: 4px;
}
.script-text-count {
  background: var(--paper);
  padding: 2px 4px;
}
@media (min-width: 761px) {
  #app:has(> .nav) {
    padding-right: 160px;
    padding-bottom: 0;
  }
  body[data-page=home] #app:has(> .nav) {
    padding-bottom: 0;
  }
  .nav {
    left: auto;
    right: 0;
    top: 0;
    bottom: 0;
    width: 160px;
    height: 100dvh;
    min-height: 0;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
    padding: 24px 16px;
    border-top: 0;
    border-left: 1px solid var(--line);
    box-shadow: -3px 0 14px var(--shadow);
  }
  .nav > * {
    flex: none;
    width: 100%;
    max-width: none;
    min-height: 52px;
    justify-content: flex-start;
    padding: 12px 16px;
  }
  .nav button {
    justify-content: flex-start;
    padding: 12px 16px;
    font-size: 14px;
  }
  .nav-unavailable {
    font-size: 14px;
  }
  .nav-unavailable small {
    text-align: left;
  }
  body:is([data-page=shelf], [data-page=pool], [data-page=script-collection]) .page {
    max-width: 1280px;
    padding: 36px 48px 48px;
  }
  body:is([data-page=create], [data-page=rule-edit], [data-page=rule-view]) .page {
    max-width: 1000px;
    padding: 36px 48px 48px;
  }
  body:is([data-page=shelf], [data-page=pool], [data-page=script-collection], [data-page=create], [data-page=rule-edit], [data-page=rule-view]) .top {
    max-width: none;
    padding-inline: 48px;
  }
  body:is([data-page=shelf], [data-page=pool], [data-page=script-collection]) .page .books {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 36px 30px;
  }
  body:is([data-page=shelf], [data-page=pool], [data-page=script-collection]) .books > article {
    width: 100%;
    max-width: 220px;
    justify-self: start;
  }
  body[data-page=rule-edit] .script-text-editor > textarea {
    height: max(180px, calc(100dvh - 365px));
  }
}
@media (min-width: 761px) {
  .nav {
    display: flex;
  }
  .nav > * {
    white-space: nowrap;
  }
  .shelf-tools.shelf-work-actions {
    display: flex;
    justify-content: flex-start;
  }
  .shelf-work-actions .shelf-action {
    width: auto;
    min-width: 140px;
    padding: 9px 20px;
  }
}
@media (max-width: 760px) {
  body[data-page=rule-edit] .script-text-editor > textarea {
    height: max(100px, calc((100dvh - 365px)/4));
  }
}
[data-form=rule] > .field:has(.script-text-editor),
[data-form=book-rule] > .field:has(.script-text-editor) {
  margin-bottom: 8px;
}
.script-dynamic {
  margin-top: 0;
  padding-top: 8px;
  margin-bottom: 12px;
  padding-bottom: 12px;
}
.rule-binding-entry {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  margin: 18px 0 22px;
  text-align: left;
  box-shadow: none;
}
.rule-binding-entry .binding-summary {
  flex: 1;
  min-width: 0;
  text-align: right;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.library-advanced {
  margin: 12px 0 20px;
}
.library-advanced > summary {
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}
.library-advanced input {
  margin: 12px 0;
}
.library-create {
  margin-bottom: 16px;
}
.library-entry[hidden] {
  display: none;
}
#library-batch-file[hidden] {
  display: none;
}
#library-batch-text {
  width: 100%;
  min-height: 220px;
  margin: 18px 0;
}
body[data-page=library] .line-list .library-entry[hidden] {
  display: none !important;
}
@media (max-width: 760px) {
  body[data-page] #app > .page {
    padding-left: 18px;
    padding-right: 18px;
  }
  .sheet-body {
    padding-left: 18px;
    padding-right: 18px;
  }
  body[data-page=rule-edit] #app > .page {
    padding-top: 14px;
  }
  body[data-page=rule-edit] .script-top {
    height: 40px;
    padding: 0 18px 5px;
    align-items: end;
    gap: 4px;
    grid-template-columns: 64px minmax(0, 1fr) 64px !important;
  }
  .script-top > div {
    align-items: end;
    gap: 0;
  }
  .script-top .icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 28px;
    padding: 5px 7px;
  }
  .script-top .icon svg {
    display: block;
    width: 18px;
    height: 18px;
    flex: none;
  }
  .script-top h1 {
    font-size: 16px;
    line-height: 28px;
  }
  .script-cover-row {
    margin-bottom: 12px;
    gap: 14px;
  }
  .script-cover-row .shelf-cover-actions {
    gap: 8px;
  }
  .script-cover-row .field {
    margin-bottom: 4px;
  }
  .script-cover-row [data-action=rule-cover-pick] {
    border: 1px solid var(--line);
    background: var(--paper);
    box-shadow: none;
    padding: 5px 12px;
    font-size: 12px;
    line-height: 1.4;
  }
  [data-form=rule] > .field:has(.script-text-editor),
  [data-form=book-rule] > .field:has(.script-text-editor) {
    gap: 3px;
    margin-bottom: 6px;
  }
  .script-text-editor {
    margin: 0 0 4px;
  }
  .script-text-tools {
    left: 5px;
    right: 14px;
    bottom: 2px;
    min-height: 20px;
    height: 20px;
    align-items: end;
  }
  .script-text-tools .script-expand {
    width: 24px;
    height: 22px;
    padding: 4px;
  }
  .script-expand img {
    width: 16px;
    height: 16px;
  }
  .script-text-count {
    font-size: 10px;
    line-height: 16px;
    padding: 0 2px;
  }
  body[data-page=rule-edit] .script-text-editor > textarea {
    padding-bottom: 28px;
  }
  .script-dynamic {
    margin: 0 0 10px;
    padding: 4px 0 10px;
  }
  .script-dynamic > summary {
    margin-bottom: 6px;
  }
  .script-dynamic-search {
    margin: 0 0 8px;
  }
  .script-dynamic-list {
    margin: 6px 0;
  }
  .script-dynamic-list:empty {
    display: none;
  }
  .script-beauty-switch {
    margin: 12px 0;
  }
  .rule-binding-entry {
    margin: 12px 0;
    padding: 10px 12px;
  }
  .rule-random-settings {
    margin: 14px 0;
  }
}
.script-cover-row .shelf-cover-preview {
  width: 60px;
}
.script-cover-row .shelf-cover-preview .cover {
  padding: 10px 8px 10px 13px;
}
.script-cover-row .shelf-cover-preview .cover h3 {
  font-size: 12px;
  line-height: 1.6;
  letter-spacing: 0;
}
.script-cover-row .shelf-cover-preview .cover:after {
  inset: 8px 7px 8px 12px;
}
.script-name-editor {
  position: relative;
  width: 100%;
}
.script-name-editor input {
  margin: 0;
  padding-right: 36px;
}
.script-name-pencil {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 6px;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.script-name-pencil svg {
  width: 16px;
  height: 16px;
  display: block;
}
.script-name-pencil:active {
  transform: translateY(-50%);
}
.rule-binding-entry {
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
}
:is([data-form=rule], [data-form=book-rule]) summary {
  list-style: none;
}
:is([data-form=rule], [data-form=book-rule]) summary::-webkit-details-marker {
  display: none;
}
:is([data-form=rule], [data-form=book-rule]) summary::marker {
  content: "";
}
:is([data-form=rule], [data-form=book-rule]) summary:before {
  content: "" !important;
  display: inline-block;
  width: 14px;
  height: 14px;
  min-width: 14px;
  vertical-align: -2px;
  margin-right: 7px;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m6 3 5 5-5 5' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
}
:is([data-form=rule], [data-form=book-rule]) details[open] > summary:before {
  transform: rotate(90deg);
}
:is([data-form=rule], [data-form=book-rule]) summary:after {
  content: none !important;
}
.desktop-only,
.desktop-chapter-count {
  display: none;
}
.desktop-rule-columns,
.desktop-rule-column {
  display: contents;
}
@media (min-width: 761px) {
  body {
    font-family:inherit;
  }
  body #app,
  body #app:has(> .nav) {
    padding: 0 0 0 var(--desktop-side);
    min-height: 100dvh;
  }
  #app > .nav {
    display: none !important;
  }
  body #app > .top {
    height: 76px;
    min-height: 76px;
    max-width: none;
    width: 100%;
    padding: 0 40px;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 1px solid var(--line);
    background: var(--paper);
  }
  .top :is(h1, .top-title, .object-title) {
    font-size:13px;line-height:1.5;font-weight:normal;font-style:normal;font-family:inherit;
    text-align: left;
    flex: none;
    margin: 0;
  }
  .top .row {
    justify-content: flex-start;
  }
  .top-menu-only > .top-section-title,
  .top-menu-only > [data-action=app-menu] {
    display: none !important;
  }
  body[data-page=desktop-settings] .top .top-title {
    display: none;
  }
  .top .brand-mark {
    display: none;
  }
  .top > .desktop-save {
    margin-left: auto;
    width: auto;
  }
  body #app > .page {
    max-width: 1300px;
    margin: 0 auto;
    padding: 32px 40px 48px;
    width: 100%;
  }
  body #app > .page.narrow {
    max-width: 1100px;
  }
  .desktop-only {
    display: block;
  }
  .desktop-chapter-count {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: var(--muted);
  }
  body :is(input:not([type=checkbox]):not([type=radio]):not([type=file]), select) {
    min-height: 0;
    height: 34px;
    max-width: 420px;
    padding: 5px 10px;
    font-size: 13px;
    border-radius: 5px;
  }
  body button {
    min-height: 0;
    padding: 6px 12px;
    font-size: 12px;
    box-shadow: none;
    line-height: 20px;
  }
  body button.full {
    width: auto;
  }
  body .icon {
    width: 30px;
    height: 30px;
    min-height: 0;
    padding: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  body .field {
    margin-bottom: 16px;
    gap: 6px;
  }
  body .field label {
    font-size: 12px;
  }
  body textarea {
    font-size: 13px;
    padding: 8px 10px;
  }
  .key-input {
    position: relative;
    max-width: 420px;
    display: block;
  }
  .key-input input {
    width: 100%;
    padding-right: 36px !important;
    margin: 0;
  }
  body .key-input .api-key-toggle {
    position: absolute;
    right: 3px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    padding: 5px;
    display: grid;
    place-items: center;
    border: 0;
    background: none;
    font-size: 0;
  }
  .api-key-toggle svg {
    width: 17px;
    height: 17px;
    display: block;
  }
  .api-model-row {
    max-width: 420px;
    display: flex;
    gap: 6px;
  }
  .api-model-row input {
    flex: 1;
    min-width: 0;
  }
  .api-model-row button {
    flex: none;
    white-space: nowrap;
    font-size: 11px;
    padding: 5px 9px;
  }
  body .shelf-tabs {
    height: 76px;
    margin: 0;
    border: 0;
    display: flex;
    gap: 28px;
    align-items: stretch;
    width: auto;
  }
  body .shelf-tabs button {
    height: 100%;
    padding: 0 2px;
    border-radius: 0;
    background: none;
    box-shadow: none;
    min-width: 0;
    font-size: 14px;
  }
  body .shelf-work-actions {
    margin: 0 0 24px;
    justify-content: flex-end;
  }
  .shelf-work-actions .shelf-action {
    min-width: 0;
    padding: 6px 12px;
  }
  body:is([data-page=shelf], [data-page=pool], [data-page=script-collection]) .page .books,
  body .script-books {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 30px;
    align-items: start;
  }
  body .books > article {
    max-width: 210px;
    width: 100%;
  }
  body .books .book-button {
    width: 100%;
    padding: 0;
  }
  .books .cover {
    width: 100%;
    aspect-ratio: .72;
    height: auto;
  }
  body .book-caption {
    margin-top: 12px;
  }
  .book-caption .book-title {
    padding: 0;
    text-align: left;
    font-size: 14px;
  }
  body[data-page=home] .page {
    max-width: 1080px;
  }
  .reading-hero {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 48px;
    padding: 32px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    align-items: center;
  }
  .reading-hero > .book-button {
    width: 190px;
    padding: 0;
  }
  .reading-hero .cover {
    width: 190px;
    height: 264px;
  }
  .reading-hero .hero-copy h1 {
    font-size: 30px;
  }
  .reading-hero .hero-copy > .primary {
    width: auto;
    display: inline-flex;
    padding: 6px 18px;
    min-height: 34px;
  }
  .home-chapters {
    margin-top: 30px;
  }
  .desktop-settings-list {
    max-width: 920px;
  }
  .desktop-setting-link,
  .desktop-setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 20px 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: none;
    text-align: left;
  }
  .desktop-setting-link {
    font-size: 14px;
  }
  .desktop-reading-settings {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 48px;
  }
  .desktop-reading-sample {
    border-left: 1px solid var(--line);
    line-height: 2.2;
  }
  .desktop-reading-sample h2 {
    font-size: 24px;
  }
  .desktop-api-tabs {
    display: flex;
    align-items: center;
    gap: 28px;
    border-bottom: 1px solid var(--line);
    height: 48px;
    margin-bottom: 26px;
  }
  .desktop-api-tabs > button {
    height: 48px;
    border: 0;
    background: none;
    padding: 0 3px;
    border-radius: 0;
    font-size: 14px;
  }
  .desktop-api-tabs > [aria-selected=true] {
    border-bottom: 2px solid var(--accent);
    font-weight: 600;
  }
  .desktop-api-tabs > [data-action=source-list] {
    margin-left: auto;
    height: 34px;
    border: 1px solid var(--line);
    padding: 5px 12px;
    border-radius: 5px;
    font-size: 12px;
  }
  [data-form=api] > h2,
  [data-desktop-api] > summary {
    display: none;
  }
  [data-desktop-api] {
    max-width: 600px;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  #app[data-api-tab=main] [data-desktop-api]:not([data-desktop-api=main]),
  #app[data-api-tab=secondary] [data-desktop-api]:not([data-desktop-api=secondary]),
  #app[data-api-tab=image] [data-desktop-api]:not([data-desktop-api=image]) {
    display: none;
  }
  [data-form=api] .field {
    display: grid;
    grid-template-columns: 106px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
  }
  [data-form=api] .field label {
    margin: 0;
  }
  [data-form=api] .parameter-fields {
    display: block;
  }
  .api-parameters {
    margin-top: 20px;
  }
  .desktop-rule-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px;
    align-items: start;
  }
  [data-form=rule] > .script-cover-row {
    width: calc((100% - 32px)/2);
  }
  .desktop-rule-column {
    display: block;
    min-width: 0;
  }
  body[data-page=rule-edit] .script-text-editor > textarea {
    height: 220px;
    max-width: none;
    padding-bottom: 30px;
  }
  .script-text-tools {
    height: 22px;
    min-height: 0;
    bottom: 3px;
    left: 5px;
    right: 12px;
  }
  .script-expand {
    width: 24px !important;
    height: 22px !important;
    padding: 4px !important;
  }
  .script-expand img {
    width: 16px;
    height: 16px;
  }
  .script-text-count {
    font-size: 10px;
    padding: 0 2px;
  }
  body .script-tool-row {
    display: flex;
    gap: 8px;
  }
  .script-tool-row button {
    flex: none;
    width: auto;
  }
  .script-cover-row [data-action=rule-cover-pick] {
    padding: 5px 12px;
    border: 1px solid var(--line);
    background: var(--paper);
  }
  body #sheet {
    max-width: 640px;
    border-radius: 10px;
  }
  .sheet-head {
    height: 64px;
  }
  .sheet-head h2 {
    font-size: 16px;
  }
  .sheet-body {
    padding: 22px;
  }
  .sheet-body textarea {
    min-height: 150px;
  }
  .sheet-body button.full {
    width: auto;
  }
  .reader {
    margin-left: 0;
    width: 100%;
  }
  .reader-header,
  .reader-bottom {
    left: var(--desktop-side);
    width: calc(100% - var(--desktop-side));
  }
  .reader-header {
    height: 76px;
  }
  .reader-header h1 {
    text-align: left;
    font-size: 14px;
  }
  .reader-scroll {
    max-width: none;
  }
  body[data-night=true] .desktop-sidebar {
    background: var(--paper);
  }
}
@media (max-width: 760px) {
  .desktop-api-tabs {
    display: block;
  }
  .desktop-api-tabs > [data-action=desktop-api-tab] {
    display: none;
  }
  .desktop-api-tabs > [data-action=source-list] {
    width: 100%;
  }
  .desktop-reading-settings {
    display: block;
  }
  .desktop-reading-sample {
    display: none;
  }
}
@media (min-width: 761px) {
  body #app > .top :is(.top-title, .object-title, h1) {
    position: static;
    inset: auto;
    transform: none;
    width: auto;
    max-width: none;
    text-align: left !important;
    justify-content: flex-start;
  }
  body #app > .top .row {
    width: auto;
    flex: none;
    gap: 14px;
  }
  body .desktop-sidebar > .desktop-settings {
    border-radius: 6px;
  }
  body .desktop-sidebar > .desktop-settings::before {
    content: none;
  }
  body[data-page=rule-edit] .script-top > h1 {
    margin-right: auto;
  }
  body .script-group-tabs,
  body .script-collection-modes {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }
}
.api-key-toggle svg {
  width: 17px;
  height: 17px;
  display: block;
}
@media (min-width: 761px) {
  body[data-page=create] [data-form=create] {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px 36px;
    align-items: start;
  }
  [data-form=create] > .shelf-cover-editor {
    grid-column: 1;
    grid-row: 1/3;
    max-width: 420px;
  }
  [data-form=create] > .field {
    grid-column: 2;
    margin: 0;
  }
  [data-form=create] > .create-submit-actions {
    grid-column: 1/-1;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
  }
  body .creation-choice {
    padding: 9px 12px;
    width: 100%;
    font-size: 13px;
  }
  .desktop-settings-list button {
    background: none;
    border-radius: 0;
    box-shadow: none;
  }
  body .script-group-tabs > button {
    width: 100%;
    min-width: 0;
  }
  body .top .script-top {
    justify-content: flex-start;
  }
  body summary {
    list-style: none;
  }
  body summary::-webkit-details-marker {
    display: none;
  }
  body summary::before {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 7px;
    background: currentColor;
    vertical-align: -2px;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m6 3 5 5-5 5' fill='none' stroke='black' stroke-width='1.6'/%3E%3C/svg%3E") center/contain no-repeat;
  }
  body details[open] > summary::before {
    transform: rotate(90deg);
  }
  body summary::after {
    content: none !important;
  }
}
@media (min-width: 761px) {
  .script-name-editor {
    max-width: 420px;
  }
  .script-name-editor input {
    width: 100%;
  }
  body[data-page=rule-edit] .script-top > h1 {
    margin-right: 0;
  }
  body[data-page=rule-edit] .script-top > div {
    margin-left: auto;
    display: flex;
    gap: 8px;
  }
  body[data-page=rule-edit] .script-top > .desktop-save {
    margin-left: 0;
  }
}
@media (min-width: 761px) {
  body #app > .top > .row {
    display: flex !important;
  }
  body .library-tabs {
    display: flex;
    gap: 28px;
    border-bottom: 1px solid var(--line);
    padding: 0 0 0;
    margin-bottom: 24px;
    justify-content: flex-start;
  }
  body .library-tabs > button {
    width: auto;
    min-width: 0;
    flex: none;
    padding: 10px 2px;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    font-size: 14px;
  }
  body .library-tabs > button.selected {
    border-bottom: 2px solid var(--accent);
    background: none;
  }
  body .library-tabs small {
    display: none;
  }
  body .library-tabs strong {
    font-size: 14px;
    font-weight: 400;
  }
  body .cover-upload {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--paper);
    font-size: 12px;
  }
}
@media (min-width: 761px) {
  body[data-page=library] .library-tabs {
    gap: 28px !important;
  }
  body[data-page=library] .library-tabs > button {
    border-right: 0 !important;
    border-radius: 0 !important;
    padding: 10px 2px !important;
  }
  body[data-page=library] .library-tabs > button::after {
    content: none !important;
  }
}
.mobile-chapter-picker {
  display: none;
}
@media (max-width: 760px) {
  body .shelf-work-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 24px;
  }
  body .shelf-work-actions > [data-action=import] {
    width: auto;
    min-width: 0;
    flex: none;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 12px;
  }
  body .shelf-work-actions > [data-action=favorite-filter] {
    width: auto;
    min-width: 0;
    flex: none;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 12px;
  }
  .mobile-chapter-picker {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 18px 0;
    width: 100%;
    min-width: 0;
  }
  .mobile-chapter-picker select {
    flex: 1;
    min-width: 0;
    width: 0;
    margin: 0;
  }
  .mobile-chapter-picker button {
    flex: none;
    white-space: nowrap;
    padding: 8px 12px;
    font-size: 13px;
  }
  body[data-page=import] .chapter-index {
    display: none;
  }
  body .script-beauty-switch {
    display: flex;
    flex-direction: row-reverse;
    justify-content: space-between;
    align-items: center;
  }
  .script-beauty-switch input {
    appearance: none;
    flex: none;
    width: 38px;
    height: 22px;
    border-radius: 15px;
    background: #cbd0c5;
    border: 1px solid #cbd0c5;
    position: relative;
    padding: 0;
    margin: 0;
  }
  .script-beauty-switch input:before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    background: #fffdf5;
    border-radius: 50%;
    left: 2px;
    top: 2px;
    transition: transform .15s;
  }
  .script-beauty-switch input:checked {
    background: var(--accent);
    border-color: var(--accent);
  }
  .script-beauty-switch input:checked:before {
    transform: translateX(16px);
  }
}
@media (max-width: 760px) {
  body[data-page=import] .import-editor textarea {
    height: 340px;
    min-height: 340px;
  }
}
.detail-cast-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.detail-cast-heading .cast-label {
  margin: 0;
}
.favorite-star {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 5px;
  border: 0;
  background: none;
  box-shadow: none;
}
.favorite-star svg {
  width: 22px;
  height: 22px;
}
.favorite-star[aria-pressed=true] {
  color: #c69b27;
}
.favorite-star[aria-pressed=true] svg {
  fill: #f0c34e;
}
.chapter-list .section-head > [data-action=append] {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 5px 10px;
  font-size: 12px;
  background: transparent;
  box-shadow: none;
}
@media (max-width: 760px) {
  body[data-page] #app > .top,
  body[data-page] #sheet > .sheet-head {
    box-sizing: border-box;
    height: 48px;
    min-height: 48px;
    padding: 0 18px;
    align-items: center;
    border-bottom: 1px solid var(--line);
  }
  body:is([data-page=home], [data-page=shelf], [data-page=pool]) #app > .top {
    display: flex;
    position: relative;
  }
  body:is([data-page=home], [data-page=shelf], [data-page=pool]) .top-section-title {
    position: absolute;
    left: 56px;
    right: 56px;
    top: 0;
    bottom: 0;
    transform: none;
    width: auto;
    max-width: none;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1.4;
    pointer-events: none;
  }
  body:is([data-page=home], [data-page=shelf], [data-page=pool]) .top > [data-action=app-menu] {
    margin-left: auto;
  }
  body[data-page] #sheet > .sheet-head {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) 32px;
    gap: 6px;
  }
  body #sheet > .sheet-head h2 {
    font-size: 16px;
    line-height: 1.4;
    margin: 0;
    text-align: center;
  }
  body[data-page=book] #app > .object-top {
    position: relative;
    display: flex;
    justify-content: space-between;
  }
  body[data-page=book] .object-top > .row {
    display: contents;
  }
  body[data-page=book] .object-top .object-title {
    position: absolute;
    left: 60px;
    right: 60px;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: none;
    width: auto;
    margin: 0;
    font-size: 16px;
  }
  body[data-page=book] .object-top > [data-action=book-current-menu] {
    margin-left: auto;
  }
  body[data-page] .top .icon,
  body[data-page] #sheet > .sheet-head .icon {
    width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  body .book-switch {
    padding-inline: 18px;
  }
  body .book-switch > div {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: none;
    margin: 0;
    gap: 24px;
  }
  body .book-switch button {
    width: auto;
    flex: none;
  }
  .book-switch button:first-child {
    justify-content: flex-start;
  }
  .book-switch button:last-child {
    justify-content: flex-end;
  }
  body[data-page=shelf] .shelf-tools.shelf-work-actions {
    display: flex !important;
    grid-template-columns: none;
    justify-content: space-between !important;
  }
  body[data-page=shelf] .shelf-tools.shelf-work-actions > [data-action=import] {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 0;
    max-width: max-content;
    padding: 3px 10px;
    font-size: 11px;
    line-height: 20px;
  }
  body[data-page=shelf] .shelf-tools.shelf-work-actions > [data-action=favorite-filter] {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 0;
    max-width: max-content;
    padding: 3px 8px;
    font-size: 11px;
    line-height: 20px;
    border-color: transparent;
    background: transparent;
    box-shadow: none;
  }
  body[data-page=shelf] .shelf-tools.shelf-work-actions > [data-action=favorite-filter].selected {
    color: var(--accent);
    background: var(--soft);
  }
}
.field:has(> select[name=builtinCarrier]):has(+ [data-diary-chapters]) {
  margin-bottom: 0;
}
[data-diary-chapters] {
  margin-top: 0;
  padding-top: 8px;
  padding-bottom: 8px;
}
.reader .manuscript:has(.serial-diary) {
  width: 100%;
  max-width: none;
  padding: 0;
}
.reader .chapter:has(.serial-diary) {
  margin: 0;
  padding: 0;
  scroll-margin-top: 0;
}
[data-form=rule] textarea::placeholder,
[data-form=book-rule] textarea::placeholder {
  color: var(--muted);
  opacity: .45;
}
.rule-random-settings {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 16px 0;
}
.rule-random-settings > .check-row {
  margin: 0;
  flex-shrink: 0;
  white-space: nowrap;
}
.rule-random-settings .random-weight {
  min-width: 0;
  flex: 1;
}
.rule-random-settings .random-weight .field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.rule-random-settings .random-weight label {
  white-space: nowrap;
  margin: 0;
}
.rule-random-settings .random-weight input {
  min-width: 0;
  width: 100%;
  max-width: 100px;
}
[data-format-instructions][hidden],
.random-weight[hidden] {
  display: none !important;
}
@media (min-width: 761px) {
  .desktop-rule-heading {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px;
    align-items: start;
    margin-bottom: 12px;
  }
  .desktop-rule-heading > .script-cover-row {
    width: 100%;
    margin: 0;
  }
  .desktop-rule-heading .script-format-choice select {
    max-width: none;
    width: 100%;
  }
  .desktop-rule-heading .check-row {
    margin: 0;
  }
  .desktop-rule-heading .field {
    margin-bottom: 8px;
  }
}
@media (min-width: 761px) {
  [data-form=rule] .desktop-rule-column > .script-dynamic {
    margin: 16px 0 0;
    padding: 0;
    border: 0;
  }
  [data-form=rule] .script-dynamic > summary {
    display: flex;
    align-items: center;
    min-height: 48px;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    border-bottom: 1px solid var(--line);
  }
  [data-form=rule] .script-dynamic > summary small {
    margin-left: 8px;
  }
  [data-form=rule] .script-dynamic-search {
    display: block;
    width: 100%;
    max-width: none;
    margin: 12px 0;
  }
  [data-form=rule] .script-dynamic > .script-dashed {
    display: block;
    width: 100%;
    min-height: 34px;
    margin: 0;
  }
  [data-form=rule] .desktop-rule-column > .rule-random-settings {
    min-height: 48px;
    margin: 16px 0 0;
    padding: 6px 0;
    gap: 16px;
    border-bottom: 1px solid var(--line);
    box-sizing: border-box;
  }
  [data-form=rule] .rule-random-settings > .check-row {
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    align-items: center;
  }
  [data-form=rule] .rule-random-settings .random-weight .field {
    margin: 0;
    align-items: center;
  }
  [data-form=rule] .rule-random-settings input[name=weight] {
    max-width: 100px;
  }
  [data-form=rule] .desktop-rule-column > .script-beauty-switch {
    display: flex;
    align-items: center;
    min-height: 48px;
    margin: 0;
    padding: 12px 0;
    box-sizing: border-box;
    border-bottom: 1px solid var(--line);
  }
  [data-form=rule] .desktop-rule-column > .rule-binding-entry {
    min-height: 48px;
    margin: 12px 0 0;
    padding: 12px 14px;
    box-sizing: border-box;
  }
  [data-form=rule] .rule-binding-entry + .hint {
    margin: 10px 0 0;
    line-height: 1.7;
  }
}
.writing-user-list,
.writing-pick-grid {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}
.writing-custom {
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--paper);
}
.writing-official {
  padding: 16px;
  border: 1px solid #d4c8a5;
  border-left: 4px solid #b09a63;
  border-radius: 8px;
  background: #f6f0df;
  color: #51492f;
}
.writing-pick {
  display: flex;
  text-align: left;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}
.writing-pick small,
.writing-badge {
  white-space: nowrap;
  font-size: 11px;
  opacity: .7;
}
.writing-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--paper);
}
.writing-choice.is-official {
  border-left: 3px solid #b09a63;
}
.script-writing-choices {
  display: grid;
  gap: 12px;
  margin: 16px 0;
}
.script-writing-choices .field {
  margin: 0;
}
.writing-none {
  width: 100%;
  text-align: left;
  padding: 12px;
}
.writing-user-list h3 {
  margin: 8px 0;
}
[data-form=writing-rules] textarea,
[data-form=writing-entry] textarea {
  width: 100%;
  min-height: 220px;
  padding-bottom: 32px;
}
body[data-night=true] .writing-official {
  background: #353126;
  color: #ede6d5;
}
@media (min-width: 761px) {
  .writing-pick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.script-random-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0;
}
.script-random-tools button {
  font-size: 12px;
}
.script-random-dialog .sheet-head {
  grid-template-columns: auto minmax(0, 1fr) auto;
}
.script-random-dialog textarea {
  width: 100%;
  resize: vertical;
  min-height: 100px;
}
.random-option {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.random-option .row {
  margin-bottom: 8px;
}
.random-option strong {
  margin-right: auto;
  font-weight: 500;
}
.random-option button {
  font-size: 12px;
}
.script-fullscreen > .script-random-tools {
  padding: 8px 18px;
  max-height: 25vh;
  overflow: auto;
  flex-shrink: 0;
}
.script-random-tools {
  display: block;
  padding: 0 0 16px;
  margin: 0 0 12px;
  border-bottom: 1px solid var(--line);
}
.random-help {
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted);
  margin: 8px 0;
}
.random-help code {
  display: block;
  color: var(--ink);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.random-region-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.random-region-list button {
  display: grid;
  gap: 5px;
  width: 100%;
  text-align: left;
  padding: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: none;
}
.random-region-list strong {
  font-size: 13px;
  font-weight: 500;
}
.random-region-list span {
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.random-region-list small {
  color: var(--muted);
}
.script-fullscreen > .script-random-tools {
  padding: 8px 0;
  margin: 0;
  max-height: 32vh;
}
.script-text-editor > textarea {
  line-height: 1.85;
}
.script-random-tools[hidden] {
  display: none;
}
.script-dynamic-help {
  margin: 0 0 12px;
  line-height: 1.8;
}
.script-dynamic-item > .script-text-editor {
  margin: 10px 0;
}
.script-random-tools:empty {
  display: none;
}
.random-group-list {
  display: grid;
  gap: 0;
  margin-bottom: 12px;
}
.random-group-row {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line,#deded3);
  gap: 12px;
}
.random-group-open {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 14px 0;
}
.random-group-open strong {
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.random-group-open span {
  font-size: 12px;
  color: var(--muted,#888);
  white-space: nowrap;
}
.script-random-dialog .sheet-body > label {
  display: block;
  margin: 0 0 16px;
}
.script-random-dialog .sheet-body > label input,
.script-random-dialog .sheet-body > label select {
  display: block;
  width: 100%;
  margin-top: 6px;
  box-sizing: border-box;
}
.script-legacy-dynamic {
  margin-top: 18px;
}
.script-legacy-dynamic[hidden] {
  display: none;
}
.script-fullscreen {
  position: fixed;
}
.script-fullscreen > textarea {
  margin-bottom: 0;
  padding-bottom: 42px;
}
.script-fullscreen > footer {
  position: absolute;
  bottom: 20px;
  right: 24px;
  background: transparent;
  padding: 0;
  pointer-events: none;
}
.script-text-editor textarea[hidden],
.random-text-preview[hidden],
.random-view-switch[hidden] {
  display: none;
}
.random-text-preview {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  min-height: 160px;
  padding: 12px 12px 46px;
  background: var(--paper,#fffdf5);
  border: 1px solid var(--line,#deded3);
  border-radius: 5px;
  box-sizing: border-box;
  line-height: 2.2;
}
.random-inline-chip {
  display: inline;
  padding: 2px 8px;
  border: 1px dashed var(--line,#b7c3b3);
  box-shadow: none;
  background: var(--selected,#e9eee3);
  font-size: inherit;
  line-height: 1.6;
}
.random-view-switch {
  margin-right: auto;
  font-size: 12px;
  padding: 2px 6px;
  box-shadow: none;
  background: transparent;
  border: 0;
}
.script-text-tools .random-view-switch {
  pointer-events: auto;
}
@media (min-width: 761px) {
  .random-text-preview {
    min-height: 220px;
  }
}
.script-text-editor > textarea[hidden] {
  display: none !important;
}
.script-text-tools .script-text-count {
  order: 3;
  margin-left: auto;
}
.random-batch-actions {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.random-batch-actions button {
  font-size: 12px;
}
.random-import-dialog textarea {
  width: 100%;
  box-sizing: border-box;
  line-height: 1.8;
}
.script-random-tools > .script-dashed {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  min-height: 34px;
}
.random-group-list:empty {
  display: none;
}
.random-batch-actions button {
  margin: 0;
}
.script-dynamic > textarea[hidden] {
  display: none !important;
}
.random-choice-list {
  margin: 8px 0 16px;
  padding-left: 24px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}
.random-choice-list li {
  padding: 3px 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.random-dynamic-group {
  min-width: 0;
}
.carrier-multiselect {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
}
.carrier-multiselect .check-row {
  margin: 0;
  min-height: 36px;
}
.carrier-multiselect input {
  flex-shrink: 0;
}
.carrier-dropdown {
  position: relative;
  min-width: 0;
}
.carrier-dropdown > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  padding: 8px 12px;
  min-height: 38px;
  box-sizing: border-box;
}
.carrier-dropdown > summary::-webkit-details-marker {
  display: none;
}
.carrier-dropdown [data-carrier-label] {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  min-width: 0;
}
.carrier-dropdown > summary:focus-visible {
  outline: 2px solid var(--accent,#496252);
  outline-offset: 2px;
}
.carrier-dropdown-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 30;
  padding: 10px;
  background: var(--paper,#fffdf6);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 8px 20px #0002;
}
.carrier-dropdown-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.carrier-dropdown-tools input {
  min-width: 0;
  width: 100%;
  margin: 0;
}
.carrier-dropdown-tools button {
  flex: none;
  white-space: nowrap;
  margin: 0;
}
.carrier-dropdown .carrier-multiselect {
  display: block;
  max-height: min(280px, 40dvh);
  overflow-y: auto;
}
.carrier-dropdown .carrier-multiselect .check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px 8px;
  min-height: 44px;
  border: 0;
  box-sizing: border-box;
  cursor: pointer;
}
.carrier-dropdown .carrier-multiselect .check-row:hover {
  background: #66756612;
}
.carrier-dropdown .carrier-multiselect .check-row[hidden],
.carrier-dropdown [data-carrier-empty][hidden] {
  display: none;
}
.carrier-dropdown [data-carrier-empty] {
  margin: 12px 8px;
  color: var(--muted);
}
.carrier-dropdown > summary::before {
  display: none !important;
}
.carrier-dropdown [data-carrier-label] {
  flex: 1;
  text-align: left;
}
@media (max-width: 760px) {
  .nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.nav-icon-library {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5'%3E%3Ccircle cx='8' cy='7' r='3'/%3E%3Cpath d='M2 20v-3a6 6 0 0 1 12 0v3M16 5h6M16 10h6M18 15h4'/%3E%3C/svg%3E");
}
.script-books .shelf-book {
  position: relative;
}
.script-books .shelf-book-name {
  text-align: center;
}
.script-card-favorite {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  opacity: 1;
}
.script-card-favorite svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
}
.script-card-favorite:hover,
.script-card-favorite:focus-visible {
  opacity: 1;
}
.script-card-favorite[aria-pressed=true] {
  opacity: 1;
}
.script-card-favorite[aria-pressed=true] svg {
  fill: #f0c34e;
  stroke: #c69b27;
}
.script-type-corner {
  position: absolute;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  overflow: hidden;
  pointer-events: none;
  --ribbon-bg:var(--soft);
  --ribbon-ink:var(--ink);
}
.script-type-corner[data-type=long] {
  --ribbon-bg:#dfebf4;
  --ribbon-ink:#526f88;
}
.script-type-corner[data-type=medium] {
  --ribbon-bg:#f3e1e7;
  --ribbon-ink:#885d70;
}
.script-type-corner[data-type=game] {
  --ribbon-bg:#e1ece1;
  --ribbon-ink:#5b775e;
}
.script-type-corner[data-type=call] {
  --ribbon-bg:#e9e2f3;
  --ribbon-ink:#79618e;
}
.script-type-corner[data-type=image] {
  --ribbon-bg:#f5e7ce;
  --ribbon-ink:#8d7041;
}
.script-type-corner > span {
  position: absolute;
  width: 64px;
  left: -20px;
  top: 8px;
  transform: rotate(-45deg);
  text-align: center;
  font-size: 10px;
  line-height: 14px;
  background: var(--ribbon-bg);
  color: var(--ribbon-ink);
}
body[data-night=true] .script-type-corner > span {
  background: color-mix(in srgb, var(--ribbon-bg) 18%, var(--paper));
  color: var(--ribbon-bg);
}
.script-cover-wrap {
  display: block;
  position: relative;
  width: 100%;
}
.script-source-badge {
  position: absolute;
  bottom: 0;
  left: 0;
  padding: 4px 9px;
  border-radius: 0 7px 0 0;
  color: #fff;
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: 1px;
  box-shadow: 1px -2px 4px #0002;
}
.script-source-badge.is-preset {
  background: #87683a;
}
.script-source-badge.is-written {
  background: #416778;
}
.script-source-badge.is-collected {
  background: #78618b;
}
.writing-current {
  padding: 0 0 14px;
  font-size: 14px;
  line-height: 1.6;
}
.writing-search {
  display: block;
  width: 100%;
  margin-bottom: 12px;
}
.writing-none {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.writing-pick.is-selected,
.writing-none.is-selected {
  outline: 2px solid var(--accent,#486454);
  outline-offset: -2px;
}
.writing-pick.is-selected small,
.writing-none.is-selected span {
  color: var(--accent,#486454);
  opacity: 1;
  font-weight: 600;
}
.writing-pick[hidden],
[data-writing-section][hidden],
[data-writing-empty][hidden] {
  display: none;
}
.script-cover-wrap .cover-image img {
  object-position: center top;
}
.script-random-dialog .sheet-body > label.random-format-switch {
  display: flex;
  align-items: center;
  gap: 8px;
}
.script-random-dialog .sheet-body > label.random-format-switch input {
  width: auto;
  margin: 0;
  flex: 0 0 auto;
}
.script-cover-favorite {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.script-cover-favorite svg {
  width: 16px;
  height: 16px;
  flex: none;
}
.script-cover-favorite[aria-pressed=true] svg {
  fill: #f0c34e;
  stroke: #c69b27;
}
.script-delete-row {
  margin-top: 12px;
}
.script-delete-row > [data-action=rule-delete] {
  display: block;
  width: 100%;
}
body[data-page=rule-edit] #app > .page.narrow {
  max-width: 1000px;
}
[data-form=rule] > .script-cover-row {
  width: 100%;
  align-items: center;
  margin-bottom: 24px;
  gap: 24px;
}
[data-form=rule] .shelf-cover-preview {
  width: 120px;
}
[data-form=rule] .shelf-cover-preview .cover {
  height: 180px;
  width: 120px;
  aspect-ratio: 2/3;
}
[data-form=rule] .script-name-editor {
  width: fit-content;
  max-width: 100%;
  margin-bottom: 14px;
}
[data-form=rule] .script-name-editor input {
  width: 270px;
  max-width: 100%;
  font-size:26px;line-height:1.5;font-weight:normal;font-style:normal;font-family:inherit;
  font-size: 26px !important;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  padding-left: 0;
}
[data-form=rule] .script-name-editor input:not([readonly]) {
  border-color: var(--accent);
  background: var(--paper);
  padding-left: 10px;
}
.script-editor[data-form=rule] .script-synopsis {
  margin-bottom: 8px;
}
.script-editor-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}
.script-editor-tabs > button {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  font-size: 15px;
  min-height: 48px;
  padding: 10px 4px;
  border-bottom: 2px solid transparent;
}
.script-editor[data-form=rule] .script-editor-tabs {
  margin-bottom: 8px;
}
.script-editor[data-form=rule] .script-editor-tabs > button {
  padding: 18px 4px 4px;
}
.script-editor-tabs > [aria-selected=true] {
  border-bottom-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.script-editor-panel[hidden] {
  display: none !important;
}
.script-editor-panel > .field > label:first-child {
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 10px;
}
.script-editor-panel > .field:has([name=content]) > label {
  display: none;
}
.script-editor[data-form=rule] .script-editor-panel > .field:has([name=content]) > .script-text-editor {
  margin-top: 0;
}
@media (min-width: 761px) {
  .script-editor .script-synopsis textarea {
    height: calc((100dvh - 365px)/5);
    min-height: 0;
  }
}
.script-editor .script-editor-panel .script-text-editor > textarea {
  height: calc(320px * 2 / 3);
  min-height: calc(320px * 2 / 3);
  max-height: none;
  font-size: 16px;
  line-height: 1.95;
  padding: 18px 20px 44px;
}
.script-editor .script-editor-panel .script-text-tools {
  position: absolute;
  left: 8px;
  right: 18px;
  bottom: 6px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.script-editor-panel .script-dynamic {
  margin: 0;
  padding: 0;
  border: 0;
}
.script-editor-panel .script-dynamic > summary {
  display: none;
}
.script-editor-panel .script-format-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.script-editor-panel .script-format-choice .check-row {
  grid-column: 1/-1;
}
.script-format-choice > [data-script-chapter-count][hidden],
.script-format-choice > [data-script-section-count][hidden] {
  display: none;
}
.script-setting-fold {
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.script-setting-fold > summary {
  padding: 18px 0;
  cursor: pointer;
  font-size: 15px;
}
.script-setting-fold .rule-random-settings {
  margin: 0 0 18px;
}
.script-setting-fold .script-beauty-switch {
  margin: 0 0 18px;
}
.script-editor-panel .rule-binding-entry {
  margin: 22px 0;
}
.random-dynamic-group > .random-group-row {
  display: flex;
  align-items: center;
  cursor: pointer;
  min-height: 60px;
  padding: 12px 0;
  gap: 12px;
}
.random-dynamic-group > .random-group-row::before {
  content: "\203a";
  display: block;
  flex: none;
  width: 12px;
  height: auto;
  background: none;
  mask: none;
  font-size: 20px;
  margin: 0;
  transform: none;
}
.random-dynamic-group[open] > .random-group-row::before {
  transform: rotate(90deg);
}
.random-group-caption {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}
.random-group-caption strong {
  font-size: 15px;
  font-weight: 500;
  overflow-wrap: anywhere;
  color: var(--ink);
}
.random-group-caption > span {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.random-group-row .random-group-open {
  width: auto;
  flex: none;
  padding: 6px 10px;
  font-size: 13px;
}
.random-group-row > .quiet {
  font-size: 13px;
}
.random-choice-list {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.95;
  margin: 16px 0 22px;
  padding-left: 30px;
}
.random-choice-list li {
  padding: 6px 0;
}
.script-delete-row {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.script-delete-row > [data-action=rule-delete] {
  min-height: 40px;
  font-size: 14px;
}
@media (max-width: 760px) {
  [data-form=rule] > .script-cover-row {
    gap: 18px;
    margin-bottom: 20px;
  }
  [data-form=rule] .shelf-cover-preview {
    width: 96px;
  }
  [data-form=rule] .shelf-cover-preview .cover {
    width: 96px;
    height: 144px;
  }
  [data-form=rule] .script-name-editor input {
    width: 210px;
    font-size: 22px !important;
  }
  [data-form=rule] .shelf-cover-actions > .row {
    gap: 6px;
  }
  [data-form=rule] .shelf-cover-actions > .row > button {
    font-size: 12px;
    padding: 6px 8px;
  }
  .script-editor-tabs > button {
    font-size: 14px;
    min-height: 48px;
  }
  .script-editor-panel .script-format-choice {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .script-editor .script-editor-panel .script-text-editor > textarea {
    padding: 14px 14px 44px;
    height: calc(300px * 2 / 3);
    min-height: calc(300px * 2 / 3);
  }
  .script-editor > button[type=submit] {
    min-height: 40px;
    font-size: 14px;
    margin-top: 20px;
  }
  .random-group-caption {
    display: block;
  }
  .random-group-caption > span {
    display: block;
    margin-top: 3px;
  }
}
body[data-page=rule-edit] #app > .top.script-top {
  position: relative;
  display: grid !important;
  grid-template-columns: 40px minmax(0, 1fr) 40px !important;
  gap: 8px;
  align-items: center;
  justify-content: initial;
}
body[data-page=rule-edit] #app > .top.script-top h1 {
  position: static;
  transform: none;
  width: auto;
  min-width: 0;
  max-width: none;
  margin: 0;
  text-align: center !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 18px;
  line-height: 1.5;
  pointer-events: auto;
}
.script-bottom-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 26px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.script-bottom-tools > button {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 14px;
}
.script-bottom-tools svg {
  width: 18px;
  height: 18px;
  flex: none;
}
.script-default-row {
  margin-top: 18px;
}
body[data-page=rule-edit] .script-default-row > button {
  width: 100%;
  min-height: 44px;
  font-size: 14px;
}
.script-exit-confirm {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  padding: 0;
  width: min(420px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
}
.script-exit-confirm::backdrop {
  background: rgba(0, 0, 0, .25);
}
.script-exit-body {
  padding: 28px;
}
.script-exit-body h2 {
  font-size: 20px;
  line-height: 1.5;
  margin: 0 0 12px;
}
.script-exit-body p {
  font-size: 15px;
  line-height: 1.8;
  margin: 0 0 24px;
}
.script-exit-actions {
  display: grid;
  gap: 12px;
}
.script-exit-actions > button {
  min-height: 44px;
  font-size: 15px;
}
@media (max-width: 760px) {
  body[data-page=rule-edit] .top.script-top h1 {
    font-size: 16px;
  }
  .script-bottom-tools {
    gap: 10px;
  }
  .script-exit-body {
    padding: 24px;
  }
}
body[data-page=home]:has(.empty-gemini) {
  --bg:#f5f5f0;
  --paper:#fff;
  --ink:#2c3e50;
  --muted:#6b7280;
  --line:#e5e7eb;
  --accent:#4a6750;
  --empty-hover:#3b5240;
  --empty-button-line:#d1d5db;
}
body[data-page=home]:has(.empty-gemini) #app > .page {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: none;
  min-height: calc(100dvh - 110px);
  padding: 16px;
}
.empty.empty-gemini {
  width: 100%;
  max-width: 448px;
  min-height: 0;
  padding: 0 16px;
  color: var(--ink);
  font-family:inherit;
}
.empty-gemini .empty-illustration {
  width: 80px;
  height: 110px;
  border: 2px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, .05);
  margin: 0 auto 32px;
  font-size:32px;line-height:normal;font-weight:normal;font-style:normal;font-family:inherit;
  color: var(--accent);
}
.empty-gemini .empty-illustration:before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #f3f4f6;
}
.empty-gemini .empty-illustration:after {
  content: none;
}
.empty.empty-gemini h1 {
  font-family: inherit;
  font-size: 24px;
  line-height: 32px;
  font-weight: 500;
  letter-spacing: 0;
  margin: 0 0 12px;
}
.empty.empty-gemini > .empty-intro {
  font-size: 14px;
  line-height: 1.625;
  color: var(--muted);
  margin: 0 0 32px;
}
.empty-gemini .empty-intro br {
  display: none;
}
.empty-gemini .empty-actions {
  width: 100%;
  max-width: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0 auto;
}
.empty-gemini .empty-actions > button {
  width: 100%;
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
  margin: 0;
  padding: 12px 16px;
  border: 1px solid var(--empty-button-line);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
  transition: background-color .2s, border-color .2s;
  min-height: 50px;
}
.empty-gemini .empty-actions > button:hover {
  background: #f9fafb;
  filter: none;
}
.empty-gemini .empty-actions > button.primary {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .1), 0 1px 2px rgba(0, 0, 0, .1);
  font-weight: 500;
  min-height: 48px;
  padding: 12px 16px;
  border-width: 0;
}
.empty-gemini .empty-actions > button.primary:hover {
  background: var(--empty-hover);
}
.empty-gemini .empty-guide {
  max-width: none;
  width: 100%;
  margin: 32px 0 0;
  padding: 24px 0 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
}
.empty-gemini .empty-guide p {
  margin: 0;
}
.empty-gemini .empty-guide .empty-settings {
  display: block;
  min-height: 44px;
  min-width: 160px;
  margin: 0 auto 16px;
  padding: 10px 16px;
  font-size: 14px;
}
@media (min-width: 640px) {
  .empty.empty-gemini {
    padding: 0 24px;
  }
  .empty.empty-gemini h1 {
    font-size: 30px;
    line-height: 36px;
  }
  .empty.empty-gemini > .empty-intro {
    font-size: 16px;
  }
  .empty-gemini .empty-intro br {
    display: block;
  }
  .empty-gemini .empty-actions {
    width: 83.333333%;
  }
}
@media (min-width: 761px) {
  body[data-page=home]:has(.empty-gemini) #app > .page {
    min-height: calc(100dvh - 76px);
  }
}
body[data-page=home][data-night=true]:has(.empty-gemini) {
  --bg:#18191b;
  --paper:#202123;
  --ink:#d6d4cf;
  --muted:#98999b;
  --line:#37393c;
  --accent:#b4b2a7;
  --empty-hover:#c5c3b9;
  --empty-button-line:#37393c;
}
body[data-night=true] .empty-gemini .empty-illustration:before {
  background: var(--line);
}
body[data-night=true] .empty-gemini .empty-actions > button:hover {
  background: var(--soft);
}
body[data-night=true] .empty-gemini .empty-actions > button.primary {
  color: #202123;
}
.desktop-library-actions,
.desktop-shelf-actions,
.desktop-list-actions {
  display: none;
}
.script-list-filter {
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}
.script-list-filter summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
}
.script-list-filter summary::-webkit-details-marker {
  display: none;
}
.script-list-filter summary > span:first-child {
  flex: none;
}
.filter-chevron {
  margin-left: auto;
}
.script-list-filter[open] .filter-chevron {
  transform: rotate(180deg);
}
.script-list-filter [data-filter-indicator] {
  color: var(--accent);
  overflow-wrap: anywhere;
}
.script-filter-fields {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding: 16px;
}
.script-filter-fields input[type=search] {
  flex: 1 1 200px;
  min-width: 0;
  margin: 0;
}
.script-filter-fields select {
  width: auto;
  margin: 0;
}
.script-filter-fields .check-row {
  margin: 0;
}
.script-filter-fields [data-filter-clear] {
  background: none;
  border: 0;
  box-shadow: none;
  text-decoration: underline;
  color: var(--muted);
}
.script-list-scope [data-script-name][hidden],
.script-filter-empty[hidden],
.script-list-filter [hidden] {
  display: none !important;
}
.script-filter-empty {
  text-align: center;
  padding: 64px 16px;
  color: var(--muted);
}
@media (min-width: 761px) {
  body:is([data-page=library], [data-page=shelf], [data-page=pool], [data-page=script-collection]):not([data-night=true]) {
    --bg:#f5f5f0;
    --paper:#fff;
    --ink:#2c3e50;
    --muted:#6b7280;
    --line:#e5e7eb;
    --accent:#4a6750;
    --soft:#e8efe9;
  }
  body:is([data-page=home], [data-page=library], [data-page=shelf], [data-page=pool], [data-page=script-collection]):not([data-night=true]) #app > .top {
    background: var(--bg);
  }
  body[data-page=home]:not([data-night=true]) {
    --bg:#f5f5f0;
  }
  body:is([data-page=library], [data-page=shelf], [data-page=pool], [data-page=script-collection]) {
    font-family:inherit;
  }
  body:is([data-page=library], [data-page=shelf], [data-page=pool], [data-page=script-collection])[data-night=true] .desktop-sidebar .selected {
    background: var(--soft) !important;
    border-color: var(--line) !important;
    color: var(--accent);
  }
  body:is([data-page=shelf], [data-page=pool], [data-page=script-collection]) #app > .page {
    max-width: 1300px;
    padding: 32px 32px 48px;
  }
  body:is([data-page=shelf], [data-page=pool]) #app > .top {
    height: 64px;
    min-height: 64px;
    padding-inline: 32px;
  }
  body:is([data-page=shelf], [data-page=pool]) .top > .shelf-tabs {
    gap: 32px;
    margin: 0;
    height: 64px;
    align-items: stretch;
  }
  body:is([data-page=shelf], [data-page=pool]) .top > .shelf-tabs button {
    font-size: 14px;
    padding: 0 0;
    border-bottom: 2px solid transparent;
  }
  body:is([data-page=shelf], [data-page=pool]) .top > .shelf-tabs button.selected {
    border-bottom-color: var(--accent);
    color: var(--ink);
  }
  .desktop-shelf-actions {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 32px;
  }
  .desktop-shelf-actions .shelf-random,
  .desktop-shelf-actions .shelf-work-actions {
    margin: 0;
    padding: 0;
    border: 0;
  }
  .desktop-shelf-actions .shelf-random-buttons,
  .desktop-shelf-actions .shelf-work-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
  }
  .desktop-shelf-actions button {
    font-size: 14px;
    min-height: 42px;
    padding: 9px 16px;
    border-radius: 5px;
  }
  .desktop-shelf-actions .random-start {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--paper);
  }
  .desktop-shelf-actions .random-group-note {
    font-size: 12px;
    min-height: 32px;
    padding: 4px 0;
  }
  body[data-page=shelf] .collection-empty {
    padding: 80px 16px;
    text-align: center;
  }
  body[data-page=shelf] .collection-empty p {
    font-size: 18px;
    line-height: 1.8;
    color: var(--muted);
    margin: 0 0 24px;
  }
  body[data-page=shelf] .shelf-empty-script {
    border: 2px solid var(--accent);
    background: var(--paper);
    font-size: 14px;
    min-height: 44px;
    padding: 9px 24px;
  }
  .script-list-filter {
    box-shadow: 0 1px 2px var(--shadow);
    margin-bottom: 24px;
  }
  .script-list-filter summary {
    font-size: 14px;
  }
  .script-filter-fields input[type=search],
  .script-filter-fields select {
    height: 40px;
    max-width: none;
    font-size: 14px;
  }
  .script-filter-fields input[type=search] {
    flex-basis: 256px;
  }
  .script-filter-fields button {
    font-size: 14px;
  }
  .desktop-list-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 32px;
  }
  .desktop-list-actions:empty {
    display: none;
  }
  .desktop-list-actions .shelf-book-add {
    width: auto;
    min-width: 0;
  }
  .desktop-list-actions .shelf-book-add .cover {
    display: none;
  }
  .desktop-list-actions .shelf-book-add .book-button {
    border: 1px solid var(--accent);
    background: var(--accent);
    color: var(--paper);
    padding: 10px 16px;
    border-radius: 5px;
    min-height: 42px;
  }
  .desktop-list-actions .shelf-book-name {
    margin: 0;
    color: inherit;
    font-size: 14px;
  }
  .desktop-list-actions .script-random-action {
    margin: 0;
    padding: 0;
    border: 0;
  }
  .desktop-list-actions .script-random-button {
    min-height: 42px;
    font-size: 14px;
    padding: 10px 16px;
  }
  .script-list-scope .script-books {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 32px 24px;
  }
  .script-list-scope .book-button {
    padding: 0;
  }
  .script-list-scope .shelf-book-name {
    font-size: 14px;
    line-height: 1.6;
    margin-top: 12px;
  }
  body[data-page=library] #app > .page.narrow {
    max-width: 960px;
    padding: 32px;
  }
  body[data-page=library] .library-tabs {
    gap: 8px !important;
    margin: 0 0 32px;
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
  }
  body[data-page=library] .library-tabs::after,
  body[data-page=library] .line-list::after {
    content: none;
  }
  body[data-page=library] .library-tabs > button {
    padding: 12px 16px !important;
    min-height: 48px;
    border: 0 !important;
    border-radius: 0 !important;
  }
  body[data-page=library] .library-tabs > button + button {
    border-left: 0 !important;
  }
  body[data-page=library] .library-tabs > button.selected {
    border-bottom: 2px solid var(--accent) !important;
    color: var(--accent);
  }
  body[data-page=library] .library-tabs strong {
    font-size: 14px;
  }
  body[data-page=library] .library-advanced {
    border: 0;
    margin: 0 0 32px;
    padding: 0;
  }
  body[data-page=library] .library-advanced summary {
    min-height: 36px;
    padding: 8px 0;
    font-size: 14px;
    color: var(--muted);
  }
  body[data-page=library] .library-advanced .row {
    padding-top: 12px;
  }
  .desktop-library-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
  }
  .desktop-library-actions input.library-search {
    width: 256px;
    height: 40px;
    max-width: 100%;
    margin: 0;
    font-size: 14px;
  }
  .desktop-library-actions button {
    font-size: 14px;
    min-height: 40px;
    margin: 0;
    padding: 9px 16px;
    flex: none;
    background: var(--accent);
    color: var(--paper);
    border-color: var(--accent);
  }
  body[data-page=library] .line-list {
    padding: 0;
    margin: 0;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 1px 2px var(--shadow);
  }
  body[data-page=library] .line-list .library-entry {
    padding: 16px;
    gap: 12px;
    min-height: 76px;
    border-radius: 0;
  }
  body[data-page=library] .entry-copy strong {
    font-size: 16px;
    line-height: 1.6;
  }
  body[data-page=library] .entry-copy small {
    font-size: 12px;
    line-height: 1.6;
  }
  body[data-page=library] .page > .empty {
    min-height: 35dvh;
    padding: 80px 16px;
    max-width: none;
  }
  body[data-page=library] .empty h2 {
    font-size: 24px;
  }
  body[data-page=library] .world-library-tools > .shelf-tabs {
    margin-bottom: 24px;
  }
  body[data-page=library] .world-library-tools > .shelf-tabs button {
    font-size: 14px;
    padding: 8px 12px;
  }
}
@media (min-width: 1280px) {
  .script-list-scope .script-books {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}
@media (min-width: 761px) {
  .desktop-library-actions input.library-search {
    flex: 0 1 256px;
    min-width: 160px;
  }
  .desktop-library-actions button {
    width: auto;
  }
}
.script-list-filter summary::before {
  content: none !important;
}
@media (min-width: 761px) {
  body[data-page=library] .desktop-library-actions input.library-search {
    height: 40px;
  }
}
@media (min-width: 761px) {
  body .desktop-list-actions .shelf-book-add .shelf-book-name {
    margin: 0;
  }
  body:is([data-page=shelf], [data-page=pool], [data-page=script-collection]) .script-filter-fields input[type=search],
  body:is([data-page=shelf], [data-page=pool], [data-page=script-collection]) .script-filter-fields select {
    height: 40px;
    max-width: none;
    font-size: 14px;
  }
}
.script-editor-panel:has(> .script-format-choice) {
  display: grid;
  gap: 16px;
}
.script-editor-panel .script-format-choice {
  gap: 16px 20px;
  align-items: start;
}
.script-editor-panel .script-format-choice > .field {
  margin: 0;
  gap: 8px;
  align-content: start;
  min-width: 0;
}
.script-editor-panel .script-format-choice > .field > label {
  margin: 0;
}
.script-editor-panel .script-format-choice .carrier-dropdown {
  margin: 0;
}
.script-editor .script-editor-panel .script-format-choice select {
  width: 100%;
  max-width: none;
  height: 38px;
}
.script-editor-panel .script-format-choice > [data-diary-chapters] {
  margin: 0;
  padding: 0;
  border: 0;
}
.script-editor-panel > [data-chapter-rules],
.script-editor-panel > [data-format-instructions] {
  margin: 0;
}
.script-editor-panel > [data-format-instructions] {
  gap: 8px;
}
.script-editor-panel > [data-format-instructions] > label:first-child {
  margin: 0;
}
.script-editor-panel > [data-format-instructions] > .script-text-editor {
  margin: 0;
}
.shelf-book .peach-price-note {
  font-size: 12px;
  text-align: left;
}
.mobile-shelf-entry,
.mobile-reading-back {
  display: none;
}
@media (max-width: 760px) {
  .mobile-shelf-entry {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 42px;
    grid-column: 1 / -1;
    margin-bottom: 24px;
  }
  .empty-actions .mobile-shelf-entry {
    margin-bottom: 0;
  }
  body:is([data-page=shelf], [data-page=pool]) .top > .mobile-reading-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 5px;
    margin-left: 0;
    white-space: nowrap;
  }
  .top:has(.mobile-reading-back) {
    gap: 8px;
  }
  .home-chapters {
    margin-top: 0;
  }
  .hero-actions {
    grid-template-columns: 1fr;
  }
  .hero-switch {
    display: none;
  }
}
@media (max-width: 760px) {
  body[data-page=shelf] #app > .page {
    padding-top: 0;
  }
  body[data-page=shelf] .page > .shelf-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    height: 48px;
    padding: 0;
    margin: 0 0 var(--shelf-section-gap);
    border-bottom: 1px solid var(--line);
  }
  body[data-page=shelf] .page > .shelf-tabs button {
    height: 48px;
    padding: 0 4px;
    font-size: 13px;
    white-space: nowrap;
    text-align: center;
  }
  body[data-page=shelf] .shelf-random {
    margin-bottom: 12px;
  }
  body[data-page=shelf] .shelf-tools.shelf-work-actions {
    align-items: center;
    margin-bottom: 0;
  }
  body[data-page=shelf] .shelf-tools.shelf-work-actions > [data-action=import] {
    border-radius: 5px;
    min-height: 36px;
    padding: 6px 12px;
    font-size: 13px;
  }
  body[data-page=shelf] .shelf-tools.shelf-work-actions > [data-action=favorite-filter] {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 6px 0;
    font-size: 13px;
    border-radius: 5px;
  }
  body[data-page=shelf] [data-action=favorite-filter]::before {
    content: "";
    box-sizing: border-box;
    width: 17px;
    height: 17px;
    border: 1px solid var(--muted);
    border-radius: 3px;
    background: var(--paper);
    font-size:13px;line-height:15px;font-weight:normal;font-style:normal;font-family:inherit;
    text-align: center;
  }
  body[data-page=shelf] [data-action=favorite-filter][aria-pressed=true]::before {
    content: "\2713";
    background: var(--accent);
    border-color: var(--accent);
    color: var(--paper);
  }
  body[data-page=shelf] .collection-empty {
    text-align: center;
    padding: 48px 0;
  }
  body[data-page=shelf] .collection-empty p {
    margin: 0 0 24px;
  }
  body[data-page=shelf] .shelf-empty-script {
    border: 1px solid var(--accent);
    border-radius: 5px;
    background: var(--paper);
    color: var(--ink);
    min-height: 40px;
    padding: 8px 20px;
  }
}
@media (max-width: 760px) {
  body[data-page=desktop-settings] .desktop-settings-list {
    display: flex;
    flex-direction: column;
  }
  body[data-page=desktop-settings] .desktop-setting-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin: 0;
    padding: 18px 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: none;
    box-shadow: none;
    text-align: left;
  }
}
@media (max-width: 760px) {
  body[data-page=desktop-settings] .top-title {
    position: absolute;
    left: 56px;
    right: 56px;
    top: 0;
    bottom: 0;
    transform: none;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
  }
}
[data-form=rule] .script-name-editor {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 100%;
}
[data-form=rule] .script-name-editor input {
  flex: 1;
  min-width: 0;
  width: auto;
  padding-right: 0;
}
[data-form=rule] .script-name-pencil {
  position: static;
  transform: none;
  flex: 0 0 28px;
}
[data-form=rule] .script-name-pencil:active {
  transform: none;
}
[data-diary-chapters] > [data-chapter-format-hint] {
  display: inline;
  margin: 0;
  align-self: center;
  line-height: inherit;
}
body[data-page=rule-edit],
.script-editor {
  --script-secondary:color-mix(in srgb,var(--ink) 55%,var(--muted));
}
body[data-page=rule-edit] .script-name-editor input {
  color: var(--accent);
}
.script-editor .script-editor-tabs > button:not([aria-selected=true]) {
  color: var(--script-secondary);
}
.script-editor .script-editor-panel .field > label {
  color: var(--muted);
}
body[data-page=rule-edit] .shelf-cover-actions button,
body[data-page=rule-edit] .script-bottom-tools > button,
body[data-page=rule-edit] .script-default-row > button {
  color: var(--script-secondary);
}
body[data-page=rule-edit] .script-cover-favorite[aria-pressed=true] {
  color: var(--accent);
}
@media (max-width: 760px) {
  .script-editor .script-editor-tabs > button {
    min-height: 36px;
    padding: 6px 4px;
  }
  .script-editor[data-form=rule] .script-editor-tabs > button {
    padding: 10px 4px 2px;
  }
  .script-editor .script-synopsis textarea {
    font-size: 14px;
    line-height: 1.9;
    padding: 7px 10px;
    min-height: 115px;
    height: 115px;
  }
}
body[data-page=rule-edit] .script-more {
  position: relative;
  justify-self: end;
  color: var(--script-secondary);
  z-index: 5;
}
body[data-page=rule-edit] .script-more > summary {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  list-style: none;
  cursor: pointer;
  border-radius: 5px;
}
body[data-page=rule-edit] .script-more > summary::-webkit-details-marker {
  display: none;
}
body[data-page=rule-edit] .script-more > summary:hover {
  background: var(--soft);
}
body[data-page=rule-edit] .script-more > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
body[data-page=rule-edit] .script-more-panel,
.script-more-panel.narrative-direction-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  display: grid;
  width: 190px;
  padding: 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 5px 16px var(--shadow);
}
body[data-page=rule-edit] .script-more-panel > button,
.script-more-panel.narrative-direction-menu > button {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 9px 12px;
  border: 0;
  background: transparent;
  box-shadow: none;
  text-align: left;
  color: var(--script-secondary, var(--ink));
}
body[data-page=rule-edit] .script-more-panel > button:hover,
.script-more-panel.narrative-direction-menu > button:hover {
  background: var(--soft);
}
body[data-page=rule-edit] .script-more-panel > button.danger {
  color: #9b625d;
  border-top: 1px solid var(--line);
  border-radius: 0;
  margin-top: 4px;
}
body[data-page=rule-edit][data-night=true] .script-more-panel > button.danger {
  color: #d39b94;
}
body[data-page=rule-edit] .script-more-panel svg {
  flex: none;
}
body[data-page=rule-edit] .script-more > summary::before,
body[data-page=rule-edit] .script-more > summary::after {
  display: none;
}
body[data-page=shelf] .shelf-book-empty {
  padding: 64px 0;
  text-align: center;
}
body[data-page=shelf] .shelf-book-empty p {
  font-size: 14px;
  margin: 0 0 22px;
}
.shelf-empty-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
body[data-page=shelf] .shelf-empty-actions > button {
  min-height: 40px;
  padding: 8px 18px;
  font-size: 14px;
  border-radius: 5px;
}
.shelf-book-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}
.shelf-book-toolbar-right {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-left: auto;
}
.shelf-book-toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  min-height: 36px;
  font-size: 13px;
  box-shadow: none;
}
.shelf-book-toolbar svg {
  width: 18px;
  height: 18px;
  flex: none;
}
.shelf-compact-import {
  padding: 7px 10px;
  background: var(--paper);
  color: var(--ink);
}
.shelf-compact-favorite {
  width: 36px;
  height: 36px;
  padding: 7px;
  background: transparent;
  border-color: transparent;
}
.shelf-compact-favorite[aria-pressed=true] {
  color: var(--accent);
  background: var(--soft);
  border-color: var(--line);
}
.shelf-compact-favorite[aria-pressed=true] svg {
  fill: currentColor;
}
.shelf-random-split {
  display: flex;
  align-items: stretch;
}
.shelf-random-split > .primary {
  border-radius: 5px 0 0 5px;
  padding: 7px 10px;
}
.shelf-random-more {
  position: relative;
  z-index: 4;
  color: var(--paper);
}
.shelf-random-more > summary {
  display: grid;
  place-items: center;
  width: 32px;
  min-height: 36px;
  height: 100%;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-left-color: var(--edge);
  border-radius: 0 5px 5px 0;
  list-style: none;
  cursor: pointer;
}
.shelf-random-more > summary::-webkit-details-marker {
  display: none;
}
.shelf-random-more > summary::before,
.shelf-random-more > summary::after {
  display: none;
}
.shelf-random-more > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.shelf-random-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  width: 190px;
  padding: 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 5px 16px var(--shadow);
  color: var(--ink);
}
.shelf-random-menu > button {
  width: 100%;
  justify-content: flex-start;
  min-height: 40px;
  padding: 8px 12px;
}
.shelf-random-menu > button:hover {
  background: var(--soft);
}
@media (max-width: 760px) {
  .shelf-book-toolbar {
    gap: 10px;
    margin-bottom: 24px;
  }
  .shelf-book-toolbar-right {
    gap: 8px;
  }
  .shelf-book-toolbar button {
    font-size: 12px;
  }
  .shelf-compact-import {
    padding: 7px 8px;
  }
  .shelf-random-split > .primary {
    padding: 7px 8px;
  }
  body[data-page=shelf] .shelf-book-empty {
    padding-top: 64px;
  }
}
body[data-page=shelf] .shelf-random-more {
  margin: 0;
}
body[data-page=shelf] .shelf-compact-favorite::before {
  display: none;
}
[data-form=rule] .script-name-editor {
  width: fit-content;
  max-width: 100%;
}
[data-form=rule] .script-name-editor input {
  field-sizing: content;
  flex: 0 1 auto;
  width: auto;
  max-width: calc(100% - 38px);
}
[data-form=rule] .script-name-editor input:not([readonly]) {
  min-width: min(12em, calc(100% - 38px));
}
.script-beauty-fold > .script-beauty-switch {
  display: none !important;
}
.script-editor .script-editor-panel .script-regex-item .script-text-editor > textarea {
  height: 160px;
  min-height: 160px;
}
@media (max-width: 760px) {
  .script-editor .script-editor-panel .script-regex-item .script-text-editor > textarea {
    height: 150px;
    min-height: 150px;
  }
}
[data-form=writing-rules] .script-text-editor > textarea {
  --rule-editor-rows:12;
  --rule-editor-inset:41px;
  height: calc((var(--rule-editor-rows) * 1lh + var(--rule-editor-inset)) * 2 / 3);
  min-height: 0;
}
[data-form=writing-rules] .script-text-editor > textarea[name=fixedRuleAppend] {
  --rule-editor-rows:8;
}
@media (min-width: 761px) {
  [data-form=writing-rules] .script-text-editor > textarea {
    --rule-editor-inset:42px;
  }
}
.script-text-editor:has(> textarea:not([hidden])) > .script-text-tools {
  bottom: 6px;
  height: 24px;
  min-height: 24px;
  align-items: center;
}
[data-form=entry] .script-text-editor > textarea {
  padding-bottom: 44px;
}
body[data-page=entry] [data-form=entry] .script-text-editor > textarea[name=content] {
  --entry-content-base-height:calc(13 * 1lh + 53px);
  height: calc(var(--entry-content-base-height) * 2 / 3);
  min-height: 0;
}
@media (min-width: 761px) {
  body[data-page=entry] [data-form=entry] .script-text-editor > textarea[name=content] {
    --entry-content-base-height:max(calc(13 * 1lh + 54px),calc(100dvh - 365px));
  }
}
[data-form=entry] .entry-save-status {
  display: block;
  margin-bottom: 14px;
}
.home-api-status {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 12px;
  color: var(--muted);
  margin: 12px 0;
}
.home-api-status > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.home-api-status .is-configured {
  color: var(--accent);
}
.home-api-status .is-configured > span {
  font-size: 16px;
  font-weight: 600;
}
.empty-actions > .home-api-status {
  margin: -2px 0 4px;
}
.top > :is(.library-quick-import, .entry-pack-action) {
  margin-left: auto;
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 13px;
  min-height: 30px;
  height: 30px;
  padding: 4px 12px;
}
body[data-page=quick-import] .page {
  max-width: 1160px;
  padding-bottom: 0;
}
setting-import-preview {
  display: block;
  min-width: 0;
}
@media (max-width: 760px) {
  body[data-page=quick-import] .page {
    padding-top: 18px;
  }
}
.quick-import-options {
  max-width: 750px;
  margin: 0 auto 24px;
  padding: 24px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.quick-import-options h2 {
  font-size: 18px;
  margin: 0 0 18px;
}
.quick-import-file-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.quick-import-file-actions button {
  flex: 1;
  min-height: 44px;
}
.quick-import-batch {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  border-top: 1px solid var(--line);
  margin-top: 22px;
  padding-top: 20px;
}
.quick-import-batch strong {
  display: block;
  font-size: 14px;
  font-weight: 500;
}
.quick-import-batch small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.quick-import-batch .row {
  gap: 8px;
  flex-wrap: wrap;
}
.quick-import-options button {
  font-size: 13px;
}
@media (max-width: 760px) {
  .quick-import-options {
    padding: 18px;
  }
  .quick-import-options h2 {
    font-size: 16px;
  }
  .quick-import-batch {
    display: block;
  }
  .quick-import-batch .row {
    margin-top: 12px;
    justify-content: flex-end;
  }
}
.script-card-check {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  background: var(--paper);
  border: 1px solid var(--accent);
  border-radius: 4px;
  color: var(--accent);
  pointer-events: none;
}
.script-books [role=checkbox][aria-checked=true] .cover {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.script-group-cover-row {
  width: 100%;
  text-align: left;
  background: transparent;
  box-shadow: none;
  border: 0;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.script-group-cover-row > span:last-child {
  margin-left: auto;
}
.collection-play-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.collection-play-bar button {
  font-size: 14px;
}
.collection-play > p {
  margin-top: 22px;
}
.collection-play-choices {
  margin: 22px 0;
}
.collection-play-mode {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 19px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.collection-play-mode input {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
  flex: none;
  margin: 0;
}
.collection-play-mode strong {
  display: block;
  font-weight: 500;
}
.collection-play-mode small {
  display: block;
  color: var(--muted);
  line-height: 1.7;
  margin-top: 5px;
}
.collection-play .form-footer {
  margin-top: 24px;
}
dialog:has(.collection-play) .sheet-head > [aria-label=\5173\95ed\9762\677f] {
  visibility: hidden;
  pointer-events: none;
}
.collection-play-finish {
  text-align: center;
  padding: 15vh 0 7vh;
}
.collection-play-finish .ornament {
  color: var(--accent);
  font-size: 28px;
  margin-bottom: 28px;
}
.collection-play-finish h1 {
  font-size: 30px;
  line-height: 1.8;
}
.collection-play-finish p {
  color: var(--muted);
  margin: 20px 0 40px;
}
.collection-play-finish button {
  display: block;
  width: 220px;
  margin: 14px auto;
}
body:is([data-page=script-collection], [data-page=script-group-add], [data-page=collection-finish]) .top {
  position: relative;
}
body:is([data-page=script-collection], [data-page=script-group-add], [data-page=collection-finish]) .top :is(.top-title, .object-title) {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 120px);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body #app > .top {
  position: relative;
}
body #app > .top :is(.top-title, .object-title, .top-section-title) {
  position: absolute !important;
  left: 60px !important;
  right: 60px !important;
  top: 0;
  bottom: 0;
  transform: none !important;
  width: auto !important;
  max-width: none !important;
  margin: 0;
  display: flex !important;
  align-items: center;
  justify-content: center !important;
  text-align: center !important;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body #app > .top .row {
  display: contents;
}
body .reader-header h1 {
  text-align: center;
}
.script-fullscreen > header {
  position: relative;
}
.script-fullscreen > header h2 {
  position: absolute;
  left: 70px;
  right: 70px;
  text-align: center;
  pointer-events: none;
}
.custom-rule-item + .custom-rule-item {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.custom-rule-fixed {
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.script-fullscreen > header > button {
  margin-left: auto;
}
body:is([data-page=desktop-settings], [data-page=desktop-backup], [data-page=desktop-reading], [data-page=writing-settings], [data-page=writing-rules], [data-page=writing-library]) #app > .top {
  position: relative;
  flex: none;
}
body:is([data-page=desktop-settings], [data-page=desktop-backup], [data-page=desktop-reading], [data-page=writing-settings], [data-page=writing-rules], [data-page=writing-library]) #app > .top .top-title {
  height: 100%;
  top: 0 !important;
  bottom: auto !important;
  align-items: center;
  line-height: 1.5;
}
.settings-menu .menu-item {
  width: 100%;
  min-height: 64px;
  box-shadow: none;
}
.settings-menu .menu-item small:empty {
  display: none;
}
.backup-menu [data-action=delete-archive] strong {
  color: var(--danger,#96605d);
}
.book-mark {
  position: relative;
  width: 124px;
  height: 108px;
  margin: 0 auto 30px;
  display: grid;
  place-items: center;
}
.book-mark:before {
  content: "";
  position: absolute;
  inset: -22px;
  border-radius: 50%;
  background:
    radial-gradient(
      ellipse,
      rgba(148, 166, 136, .13),
      transparent 70%);
}
.book-mark svg {
  width: 100px;
  height: 90px;
  overflow: visible;
  color: var(--accent);
  position: relative;
}
.book-base {
  fill: var(--paper);
  stroke: currentColor;
  stroke-width: 1.25;
  stroke-linejoin: round;
}
.book-shadow {
  fill: var(--accent);
  opacity: .07;
  animation: breathe 3.6s ease-in-out infinite;
}
.turn-page {
  transform-origin: 50px 45px;
  animation: turn 3.6s ease-in-out infinite;
  fill: #edf0e6;
  stroke: currentColor;
  stroke-width: 1.15;
  stroke-linejoin: round;
}
.ink-line {
  stroke: currentColor;
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-dasharray: 21;
  animation: ink 3.6s ease-in-out infinite;
}
.ink-line:nth-of-type(2) {
  animation-delay: .2s;
}
.ink-line:nth-of-type(3) {
  animation-delay: .4s;
}
.wait-title {
  font-size:23px;line-height:1.55;font-weight:400;font-style:normal;font-family:inherit;
  letter-spacing: 2px;
  margin: 0 0 10px;
}
.wait-description {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}
.wait-time {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: .4px;
  margin-top: 24px;
}
@keyframes turn {
  0%, 12% {
    transform: scaleX(1);
    opacity: .35;
  }
  45% {
    transform: scaleX(.04);
    opacity: .85;
  }
  77%, 100% {
    transform: scaleX(-1);
    opacity: 0;
  }
}
@keyframes ink {
  0%, 20% {
    stroke-dashoffset: 21;
    opacity: .15;
  }
  65%, 86% {
    stroke-dashoffset: 0;
    opacity: .6;
  }
  100% {
    stroke-dashoffset: 0;
    opacity: .15;
  }
}
@keyframes breathe {
  50% {
    transform: translateY(1px);
    opacity: .11;
  }
}
@keyframes dot {
  0%, 80%, 100% {
    opacity: .2;
    transform: translateY(0);
  }
  40% {
    opacity: .75;
    transform: translateY(-2px);
  }
}
.generation-wait {
  color: var(--ink);
  text-align: center;
  width: 100%;
}
.generation-wait.wait-stage {
  padding: 36px 20px;
}
.generation-wait .wait-content {
  max-width: 340px;
  margin: auto;
}
.generation-wait .wait-title {
  font-size: 23px !important;
}
.generation-wait.inline-wait {
  padding: 12px 18px;
}
.generation-wait.inline-wait .wait-content {
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  max-width: 600px;
}
.generation-wait.inline-wait .book-mark {
  width: 40px;
  height: 44px;
  margin: 0;
  flex: none;
}
.generation-wait.inline-wait .book-mark svg {
  width: 42px;
  height: 40px;
}
.generation-wait.inline-wait .wait-title {
  font-size: 14px !important;
  margin: 0;
}
.generation-wait.inline-wait .wait-description {
  display: none;
}
.generation-wait.inline-wait .wait-time {
  margin-top: 2px;
}
.generation-wait .wait-time {
  font-size: 12px;
}
.reader-phone {
  position: relative;
  box-sizing: border-box;
  width: min(100%, 410px);
  margin: 20px auto;
  padding: 22px 7px 20px;
  background: #454b45;
  border: 1px solid #73796f;
  border-radius: 38px;
  box-shadow: 0 2px 0 #202820, 0 12px 25px #353f3420;
}
.reader-phone:before {
  content: "";
  position: absolute;
  top: 8px;
  left: calc(50% - 21px);
  width: 42px;
  height: 4px;
  border-radius: 9px;
  background: #1f2722;
}
.reader-phone:after {
  content: "";
  position: absolute;
  bottom: 8px;
  left: calc(50% - 44px);
  width: 88px;
  height: 3px;
  border-radius: 10px;
  background: #a0a69c;
}
.reader-phone-screen {
  height: 700px;
  overflow: auto;
  overscroll-behavior: contain;
  border-radius: 23px;
  background: #fff;
  scrollbar-width: none;
}
.reader-phone-screen > reader-carrier {
  display: block;
  height: 100%;
  min-height: 0;
}
.reader-phone-screen > reader-moments {
  display: block;
  width: 100%;
  margin: 0;
}
@media (max-width: 760px) {
  .reader .manuscript:has(.reader-phone, reader-carrier, .serial-diary) {
    width: 100%;
    max-width: none;
    padding-inline: 0;
  }
  .manuscript:has(.reader-phone, reader-carrier, .serial-diary) .chapter > h2,
  .manuscript:has(.reader-phone, reader-carrier, .serial-diary) .chapter > .chapter-version {
    margin-inline: 22px;
  }
  .reader-phone {
    width: calc(100% - 4px);
    padding: 14px 4px;
    border-radius: 24px;
    margin: 12px 2px;
  }
  .reader-phone:before {
    top: 5px;
    height: 3px;
  }
  .reader-phone:after {
    bottom: 5px;
    height: 3px;
  }
  .reader-phone-screen {
    height: calc(max(390px, calc(100dvh - 130px)) + 50px);
    border-radius: 18px;
  }
}
.reader-tools.two-tools {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (prefers-reduced-motion: reduce) {
  .generation-wait * {
    animation: none !important;
  }
  .generation-wait .turn-page {
    display: none;
  }
}
.script-text-editor.has-ai-help {
  --ai-help-inset:2px;
  --ai-help-line:18px;
}
.script-text-editor > .editor-ai-help {
  position: absolute;
  top: var(--ai-help-inset);
  left: var(--ai-help-inset);
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin: 0;
  padding: 1px 4px;
  min-height: var(--ai-help-line);
  font-size: 10px;
  line-height: 1.4;
  color: var(--muted);
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--muted) 35%, transparent);
  box-shadow: none;
}
.script-text-editor > .editor-ai-help:hover {
  color: var(--ink);
  filter: none;
}
body .script-text-editor.has-ai-help > textarea[data-editor-assist] {
  padding-top: calc(var(--ai-help-inset) + var(--ai-help-line));
}
body[data-page=shelf] {
  --shelf-control-height:34px;
  --shelf-control-gap:12px;
  --shelf-section-gap:18px;
}
body[data-page=shelf] .top > .shelf-compact-random {
  position: absolute;
  right: 18px;
  top: 7px;
  z-index: 5;
}
body[data-page=shelf] .top .shelf-random-split > button {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: var(--shelf-control-height);
  padding: 5px 10px;
  background: var(--soft);
  color: var(--accent);
  border-color: var(--line);
  box-shadow: none;
  font-size: 12px;
}
body[data-page=shelf] .top .shelf-random-more > summary {
  min-height: var(--shelf-control-height);
  background: var(--soft);
  color: var(--accent);
  border-color: var(--line);
}
body[data-page=shelf] .top .random-group-note {
  position: absolute;
  right: 0;
  top: 100%;
  white-space: nowrap;
  background: var(--paper);
  font-size: 11px;
}
body[data-page=shelf] .shelf-book-toolbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--shelf-control-gap);
  margin-bottom: var(--shelf-section-gap);
}
body[data-page=shelf] .shelf-compact-favorite {
  width: auto;
  min-height: var(--shelf-control-height);
  height: var(--shelf-control-height);
  padding: 4px 0;
  gap: 5px;
  font-size: 12px;
  flex: none;
}
body[data-page=shelf] .shelf-compact-favorite svg {
  width: 16px;
  height: 16px;
}
body[data-page=shelf] .shelf-book-search {
  flex: 1;
  min-width: 0;
  max-width: none;
  height: var(--shelf-control-height);
  padding: 5px 10px;
  font-size: 13px;
  margin: 0;
}
body[data-page=shelf] .shelf-import-card .cover {
  border: 1px dashed var(--line);
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  align-items: center;
  justify-content: center;
}
body[data-page=shelf] .shelf-import-card .cover:after {
  display: none;
}
body[data-page=shelf] .shelf-import-card .cover svg {
  width: 32px;
  height: 32px;
}
body[data-page=shelf] .shelf-import-card .book-caption {
  display: flex;
}
.shelf-import-card .book-caption .book-title {
  text-align: center;
  color: var(--muted);
}
@media (min-width: 761px) {
  body[data-page=shelf] .top > .shelf-compact-random {
    right: 40px;
    top: 21px;
  }
  body[data-page=shelf] .top .shelf-tabs {
    max-width: calc(100% - 150px);
  }
  body[data-page=shelf] .shelf-book-search {
    max-width: 420px;
    margin-left: auto;
  }
}
.detail-cover {
  position: relative;
}
.detail-cover > .favorite-star {
  position: absolute;
  right: 6px;
  top: 6px;
  z-index: 1;
  background: transparent;
  color: var(--ink);
  border-radius: 0;
  box-shadow: none;
}
.detail-cover > .favorite-star[aria-pressed=true] {
  color: #c69b27;
}
.detail-copy .detail-setting-group {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
  margin: 4px 0 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.script-text-editor > .editor-ai-help::before {
  content: "";
  width: 10px;
  height: 10px;
  flex: none;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M9 3.5 10.5 7 14 8.5 10.5 10 9 13.5 7.5 10 4 8.5 7.5 7Z M3 1v4 M1 3h4' fill='none' stroke='black' stroke-width='1.2' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;
}
body button:is(.favorite-star, .script-card-favorite, .script-cover-favorite, .shelf-compact-favorite) {
  background: transparent;
  border-color: transparent;
  border-radius: 0;
  box-shadow: none;
}
.special-missing {
  color: var(--danger,#87534d);
  font-size: 12px;
  margin: 12px 0 4px;
}
.generation-wait .generation-stream-body {
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 35dvh;
  overflow: auto;
  margin-top: 12px;
  font: inherit;
}
:root {
  --notice-pink:#f6e3df;
  --notice-rose:#99594f;
  --notice-leaf:#65765a;
  --notice-space:28px;
}
body[data-night=true] {
  --notice-pink:#3e3030;
  --notice-rose:#e5b3a6;
  --notice-leaf:#b5c4a7;
}
#sheet:has(.announcement-list) {
  border-radius: 24px;
  width: min(560px, calc(100% - 36px));
  max-height: calc(100dvh - 36px);
  overflow: hidden;
}
#sheet:has(.announcement-list) .sheet-body {
  overflow-y: auto;
  padding: 10px var(--notice-space) 0;
  min-height: 0;
}
#sheet:has(.announcement-list) .sheet-head h2 {
  background: var(--notice-pink);
  color: var(--notice-rose);
  padding: 5px 12px;
  border-radius: 8px;
}
.announcement-update h3 {
  color: var(--accent);
  font-size: 24px;
  margin: 10px 0 12px;
}
.announcement-updates {
  padding-left: 22px;
  font-size: 14px;
  line-height: 1.85;
}
.announcement-updates li {
  padding-left: 3px;
  margin: 12px 0;
}
.announcement-updates p {
  margin: 0;
}
.announcement-list .entry-text {
  margin: 0;
  padding: 10px 0;
}
.announcement-list .separator {
  margin: 24px 0;
  border-top: 1px dashed var(--line);
}
.announcement-list .announcement-rules {
  padding: 0;
}
.announcement-footer {
  position: sticky;
  bottom: 0;
  background: var(--paper);
}
.announcement-top {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 60px 0;
  flex-shrink: 0;
}
.announcement-top .announcement-close {
  position: absolute;
  right: 14px;
  top: 12px;
}
.announcement-stamp {
  font-size: 12px;
  letter-spacing: 2px;
  background: var(--notice-pink);
  color: var(--notice-rose);
  padding: 5px 12px;
  border-radius: 8px;
  transform: rotate(-3deg);
}
.announcement-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size:26px;line-height:normal;font-weight:normal;font-style:normal;font-family:inherit;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
}
.announcement-close:hover {
  background: var(--soft);
}
.announcement-scroll {
  padding: 10px var(--notice-space) 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.announcement-hello {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
}
.announcement-peach {
  width: 78px;
  height: 78px;
  object-fit: contain;
  transform: rotate(-9deg);
}
.announcement-hello h1 {
  font-size: 28px;
  font-weight: bold;
  letter-spacing: 1px;
  margin-bottom: 8px;
  color: var(--accent);
}
.announcement-hello p {
  font-size: 14px;
  line-height: 1.8;
}
.announcement-reason {
  font-size: 14px;
  line-height: 1.9;
  color: var(--ink);
  padding-bottom: 20px;
  border-bottom: 1px dashed var(--line);
}
.announcement-rules {
  list-style: none;
  margin: 18px 0 0;
}
.announcement-rules li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 16px;
  font-size: 14px;
  line-height: 1.85;
}
.announcement-rules .announcement-daily {
  margin-top: 0;
  padding: 14px 16px;
  background: var(--soft);
  border-radius: 14px;
}
.announcement-flower {
  font-size: 25px;
  color: var(--notice-rose);
  line-height: 1.4;
}
.announcement-dot {
  color: var(--notice-leaf);
  font-size: 20px;
  flex-shrink: 0;
}
.announcement-daily strong {
  color: var(--notice-rose);
  white-space: nowrap;
}
.announcement-thanks {
  font-size: 13px;
  line-height: 1.8;
  color: var(--notice-leaf);
  margin: 22px 0 8px;
  text-align: center;
}
.announcement-footer {
  padding: 16px var(--notice-space) 22px;
  flex-shrink: 0;
}
.announcement-footer .btn {
  border-radius: 14px;
  min-height: 44px;
  font-size: 15px;
}
@media (max-width: 760px) {
  .announcement-list {
    --notice-space:22px;
  }
  .announcement-hello {
    gap: 12px;
  }
  .announcement-peach {
    width: 58px;
    height: 58px;
  }
  .announcement-hello h1 {
    font-size: 25px;
  }
  .announcement-update h3 {
    font-size: 22px;
  }
}
#sheet:has(.generation-config-prompt) {
  width: min(440px, calc(100vw - 40px));
  height: fit-content;
  max-height: calc(100dvh - 48px);
  inset: 0;
  margin: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
}
#sheet:has(.generation-config-prompt) .sheet-body {
  flex: none;
  padding: 18px 22px 22px;
  max-height: calc(100dvh - 140px);
}
.generation-config-prompt p {
  margin: 0;
  line-height: 1.8;
}
.generation-config-prompt .form-footer {
  margin-top: 20px;
}
.pwa-install-notice {
  position: fixed;
  z-index: 1000;
  top: env(safe-area-inset-top, 0px);
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--paper,#f5f3eb);
  color: var(--ink,#2f3c32);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 3px 12px #0002;
}
.pwa-install-notice div {
  flex: 1;
  min-width: 0;
}
.pwa-install-notice strong {
  font-size: 16px;
}
.pwa-install-notice p {
  font-size: 12px;
  margin: 4px 0 0;
}
.pwa-install-notice button {
  flex-shrink: 0;
}
.script-one-sentence .one-sentence-controls {
  display: grid;
  grid-template-columns: minmax(0, 420px) max-content;
  align-items: center;
  gap: 12px;
  margin: 0;
}
.script-one-sentence .one-sentence-controls select {
  margin: 0;
  min-width: 0;
}
.script-one-sentence .one-sentence-controls button {
  height: auto !important;
  min-height: 0 !important;
  line-height: 1.5;
  padding: 0 .9em !important;
  margin: 0;
  flex: none;
}
.script-one-sentence [name=oneSentenceRequest] {
  height: 115px;
  min-height: 115px;
}
.script-one-sentence [data-one-sentence-status]:empty {
  display: none;
}
@media (max-width: 760px) {
  .script-one-sentence .one-sentence-controls {
    grid-template-columns: minmax(0, 1fr) max-content;
  }
}
.script-beauty-fold .script-beauty-tools {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}
.script-beauty-fold .script-beauty-tools button {
  width: 100%;
  min-height: 0;
  height: auto;
  line-height: 1.5;
  padding: 0 .9em;
}
.script-beauty-fold .script-regex-area > .script-dashed {
  display: block;
  width: 100%;
  min-height: 0;
  line-height: 1.5;
  padding: .35em .9em;
  margin: 0;
}
.script-beauty-fold > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
body:is([data-page=home], [data-page=book]) .hero-copy {
  container-type: inline-size;
  align-items: stretch;
  gap: 8px;
  padding-top: 0;
  align-self: center;
}
body:is([data-page=home], [data-page=book]) .hero-copy .hero-title,
body:is([data-page=home], [data-page=book]) .hero-copy .detail-setting-group,
body:is([data-page=home], [data-page=book]) .hero-cast-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  text-wrap: pretty;
  max-width: 100%;
  margin: 0;
}
body:is([data-page=home], [data-page=book]) .hero-copy .hero-title {
  font-size: clamp(20px, 8cqi, 30px);
  line-height: 1.45;
  letter-spacing: 0;
}
body:is([data-page=home], [data-page=book]) .hero-copy .detail-setting-group {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}
body:is([data-page=home], [data-page=book]) .hero-cast {
  width: 100%;
  min-width: 0;
}
body:is([data-page=home], [data-page=book]) .hero-cast .cast-names {
  display: flex;
  align-items: center;
  gap: 6px;
  text-align: left;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
  font-size:clamp(13px, 7cqi, 18px);line-height:1.5;font-weight:normal;font-style:normal;font-family:inherit;
  color: var(--ink);
}
.hero-cast-text {
  flex: 1;
  min-width: 0;
}
.hero-cast .cast-names > span:last-child {
  flex: none;
  color: var(--muted);
}
body:is([data-page=home], [data-page=book]) .hero-copy .detail-count {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}
body:is([data-page=home], [data-page=book]) .hero-actions {
  margin: 4px 0 0;
  align-items: center;
}
body:is([data-page=home], [data-page=book]) .hero-actions .primary {
  margin: 0;
  white-space: nowrap;
  width: auto;
  padding: 6px 12px;
}
body:is([data-page=home], [data-page=book]) .page:not(:has(.empty)) {
  padding-bottom: 70px;
}
body:is([data-page=home], [data-page=book]) .book-switch {
  background: var(--paper);
  box-shadow: none;
}
body:is([data-page=home], [data-page=book]) .book-switch > div {
  display: flex;
  justify-content: space-between;
  max-width: 730px;
  gap: 24px;
}
body:is([data-page=home], [data-page=book]) .book-switch button {
  width: auto;
  min-height: 36px;
  height: 36px;
}
@media (max-width: 760px) {
  body:is([data-page=home], [data-page=book]) .reading-hero {
    gap: 18px;
  }
  body:is([data-page=home], [data-page=book]) .hero-copy {
    gap: 7px;
  }
  body:is([data-page=home], [data-page=book]) .hero-copy .hero-title {
    font-size: clamp(16px, 11cqi, 20px);
    line-height: 1.45;
  }
  body:is([data-page=home], [data-page=book]) .hero-cast .cast-names {
    font-size: clamp(13px, 8cqi, 16px);
  }
  body:is([data-page=home], [data-page=book]) .book-switch {
    bottom: calc(var(--mobile-nav-height,62px) + env(safe-area-inset-bottom));
    padding: 0 18px;
  }
  body:is([data-page=home], [data-page=book]) .page:not(:has(.empty)) {
    padding-bottom: calc(120px + env(safe-area-inset-bottom));
  }
}
@media (min-width: 761px) {
  body:is([data-page=home], [data-page=book]) .book-switch {
    left: var(--desktop-side);
    padding: 4px 40px 8px;
  }
}
@media (min-width: 761px) {
  body:is([data-page=home], [data-page=book]) #app > .page {
    max-width: none;
  }
  body:is([data-page=home], [data-page=book]) .reading-hero {
    width: 100%;
    max-width: none;
  }
}
@media (max-width: 760px) {
  body[data-page] {
    --page-control-height:34px;
    --page-top-gap:14px;
  }
  body[data-page]:not([data-page=reader]):not([data-page=shelf]):not([data-page=home]):not([data-page=book]) #app > .page {
    padding-top: var(--page-top-gap);
  }
  body[data-page] #app > .page :is(input[type=search], .field > input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=color]), .field > select, .key-input > input) {
    height: var(--page-control-height);
    min-height: var(--page-control-height);
    padding-block: 5px;
    line-height: 1.4;
  }
  body[data-page=api] .mars-api-settings :is(input:not([type=checkbox]), select, [data-api-command]) {
    height: var(--page-control-height);
    min-height: var(--page-control-height);
    padding-block: 5px;
    line-height: 1.4;
  }
}
.reader-tools.four-tools {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
body[data-page=shelf] .shelf-book-results .book-caption .book-title {
  text-align: center;
}
@media (max-width: 760px) {
  body[data-page=shelf] .shelf-book-results .books {
    row-gap: var(--shelf-section-gap);
  }
}
@media (max-width: 760px) {
  body:is([data-page=home], [data-page=book]) {
    --home-top-gap:14px;
    --home-section-gap:12px;
    --home-small-gap:6px;
  }
  body:is([data-page=home], [data-page=book]) #app > .page:not(:has(.empty)) {
    padding-top: var(--home-top-gap);
  }
  body:is([data-page=home], [data-page=book]) .reading-hero {
    margin-bottom: var(--home-section-gap);
  }
  body:is([data-page=home], [data-page=book]) .home-api-status {
    margin: var(--home-small-gap) 0;
  }
  body:is([data-page=home], [data-page=book]) .home-chapters {
    padding-top: var(--home-section-gap);
  }
  body:is([data-page=home], [data-page=book]) .home-chapters .section-head {
    margin-bottom: var(--home-small-gap);
  }
  body:is([data-page=home], [data-page=book]) .home-chapters h2 {
    font-size: 15px;
    line-height: 1.4;
  }
  body:is([data-page=home], [data-page=book]) .home-chapters .chapter-link {
    min-height: 36px;
    padding: 6px 0;
    font-size: 14px;
    line-height: 1.5;
  }
  body:is([data-page=home], [data-page=book]) .book-switch {
    border-top: 0;
  }
  body:is([data-page=home], [data-page=book]):has(.book-switch) .nav.app-navigation {
    border-top: 0;
  }
  body:is([data-page=shelf], [data-page=pool], [data-page=script-collection]) {
    --shelf-control-height:34px;
    --shelf-control-gap:12px;
    --shelf-section-gap:14px;
  }
  body[data-page=shelf] {
    --shelf-tab-height:var(--shelf-control-height);
  }
  body[data-page=shelf] .page > .shelf-tabs,
  body[data-page=shelf] .page > .shelf-tabs button {
    height: var(--shelf-tab-height);
  }
  body:is([data-page=shelf], [data-page=pool], [data-page=script-collection]) .script-list-filter {
    margin: 0 0 var(--shelf-section-gap);
  }
  body:is([data-page=shelf], [data-page=pool], [data-page=script-collection]) .script-list-filter summary {
    height: auto;
    min-height: calc(var(--shelf-control-height) - 2px);
    padding: 4px 12px;
    font-size: 13px;
    line-height: 1.4;
  }
  body:is([data-page=shelf], [data-page=pool], [data-page=script-collection]) .script-filter-fields {
    padding: 12px;
    gap: var(--shelf-control-gap);
  }
  body:is([data-page=shelf], [data-page=pool], [data-page=script-collection]) .script-filter-fields input[type=search],
  body:is([data-page=shelf], [data-page=pool], [data-page=script-collection]) .script-filter-fields select {
    height: var(--shelf-control-height);
    padding: 5px 10px;
    font-size: 13px;
  }
  body[data-page=shelf] .script-group-tabs {
    height: var(--shelf-control-height);
    padding: 3px;
    margin-bottom: var(--shelf-section-gap);
  }
  body[data-page=shelf] .script-group-tabs button {
    height: calc(var(--shelf-control-height) - 8px);
    min-height: 0;
    padding: 0 4px;
    font-size: 12px;
    line-height: 1.4;
  }
  body[data-page=shelf] .collection-card {
    padding: 12px 0;
  }
  body[data-page=shelf] .collection-list .binding-create {
    height: var(--shelf-control-height);
    min-height: var(--shelf-control-height);
    padding: 4px 12px;
    font-size: 13px;
    line-height: 1.4;
  }
}
body:is([data-page=home], [data-page=book]) .home-chapters {
  --chapter-heading-gap:4px;
  padding-top: var(--chapter-heading-gap);
}
@media (max-width: 760px) {
  body[data-page=shelf] {
    --shelf-random-height:28px;
  }
  body[data-page=shelf] .top > .shelf-compact-random {
    top: calc((48px - var(--shelf-random-height))/2);
  }
  body[data-page=shelf] .top .shelf-random-split > button {
    height: var(--shelf-random-height);
    min-height: var(--shelf-random-height);
    padding: 2px 10px;
  }
  body[data-page=shelf] .top .shelf-random-more > summary {
    height: var(--shelf-random-height);
    min-height: var(--shelf-random-height);
  }
}
@media (min-width: 761px) {
  body:is([data-page=shelf], [data-page=pool]) {
    --shelf-tab-bottom-gap:8px;
  }
  body:is([data-page=shelf], [data-page=pool]) .top > .shelf-tabs button {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0 0 var(--shelf-tab-bottom-gap);
  }
}
@media (min-width: 761px) {
  body:is([data-page=home], [data-page=book]) {
    --desktop-top-bottom-gap:8px;
  }
  body:is([data-page=home], [data-page=book]) #app > .top {
    align-items: flex-end;
    padding-bottom: var(--desktop-top-bottom-gap);
  }
  body:is([data-page=home], [data-page=book]) #app > .top :is(.top-title, .object-title, .top-section-title) {
    align-items: flex-end;
    padding-bottom: var(--desktop-top-bottom-gap);
  }
  body:is([data-page=home], [data-page=book]) #app > .top > button.icon {
    align-items: flex-end;
    padding: 0 5px;
  }
}
@media (min-width: 761px) {
  body:is([data-page=home], [data-page=book]) .home-chapters {
    width: 100%;
    max-width: none;
    margin-inline: 0;
  }
  body:is([data-page=home], [data-page=book]) .home-chapters .chapter-entry {
    grid-template-columns: minmax(0, 1fr);
  }
}
.reader[data-controls=true]:has(.reader-additional-rule) .manuscript {
  padding-bottom: max(var(--reader-additional-inset,0px), calc(56px + env(safe-area-inset-bottom)));
}
.reader-additional-rule {
  max-width: 760px;
  margin: 0 auto;
  padding: var(--ui-gap) calc(var(--ui-gap)*2) 0;
}
.reader-additional-rule textarea {
  resize: vertical;
  max-height: 20dvh;
}
.entry-advanced.ui-disclosure {
  margin: 0 0 12px;
}
.entry-advanced.ui-disclosure > summary {
  color: var(--muted);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.entry-advanced > summary > svg {
  width: 16px;
  height: 16px;
  flex: none;
}
.entry-advanced-fields {
  padding-top: 10px;
}
.entry-advanced .association-heading h3,
.entry-advanced .association-options .check-row {
  font-size:13px;line-height:1.6;font-weight:400;font-style:normal;font-family:inherit;
}
.entry-advanced .association-heading {
  gap: 8px;
}
.entry-advanced .association-hint {
  margin-bottom: 12px;
}
body[data-page=entry] [data-form=entry] .field {
  gap: calc(var(--ui-gap,8px) / 2);
  margin-bottom: var(--ui-gap,8px);
}
body[data-page=entry] .entry-editor-heading {
  margin: 0 0 var(--ui-gap,8px);
}
body[data-page=entry] .entry-editor-meta > .field:last-child {
  margin-bottom: 0;
}
body[data-page=entry] .entry-advanced.ui-disclosure {
  margin: 0 0 var(--ui-gap,8px);
}
body[data-page=entry] .entry-advanced.ui-disclosure > summary {
  padding-block: calc(var(--ui-gap,8px) / 2);
}
body[data-page=entry] [data-form=entry] .entry-save-status {
  margin: var(--ui-gap,8px) 0;
}
body[data-page=entry] [data-form=entry] .entry-save-status:empty {
  margin: 0;
}
@media (min-width: 761px) {
  body .script-list-filter + .desktop-list-actions {
    padding-top: var(--ui-gap,8px);
  }
}
.reader:has(reader-scratch) .manuscript {
  width: 100%;
  max-width: none;
  padding: 0;
  margin: 0;
}
.reader .chapter:has(> reader-scratch) {
  margin: 0;
  padding: 0;
}
reader-scratch {
  display: block;
  width: 100%;
}
body[data-page=entry] [data-form=entry] .field > .script-text-editor {
  margin: 0;
}
body[data-page=entry] [data-form=entry] .entry-person-fields > .field {
  margin-bottom: 0;
}
.reader-phone-chat .reader-phone-screen {
  height: var(--phone-chat-height,700px);
  overflow: hidden;
}
.reader-scroll:has(.reader-phone-chat) {
  overflow-anchor: none;
}
@media (max-width: 760px) {
  .reader-phone-chat {
    width: min(390px, calc(100% - 24px));
    margin: 12px auto;
  }
  .reader-phone-chat .reader-phone-screen {
    height: var(--phone-chat-height,calc(100svh - 180px));
  }
}
body #sheet.book-cover-panel {
  height: min(600px, calc(100dvh - 36px));
}
body #sheet.book-cover-panel > .sheet-body {
  padding: var(--ui-gap,8px) 18px 18px;
  display: block;
}
body #sheet.book-cover-panel > .sheet-body > .book-cover-workspace {
  padding-top: 0;
}
.book-cover-workspace {
  gap: 10px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.book-cover-workspace .field {
  margin: 0;
}
.cover-editor-overview {
  --cover-editor-width:120px;
  display: grid;
  grid-template-columns: var(--cover-editor-width) minmax(0, 1fr);
  align-items: start;
  gap: var(--ui-gap,8px) 16px;
  min-width: 0;
}
.cover-editor-overview .cover-preview {
  width: var(--cover-editor-width);
  margin: 0;
}
.cover-editor-overview .cover-preview .cover {
  width: 100%;
  height: auto;
  aspect-ratio: 2/3;
}
.cover-editor-overview .cover-preview .cover h3 {
  font-size: 13px;
  line-height: 1.6;
  letter-spacing: 0;
}
.cover-editor-fields {
  display: contents;
}
.cover-editor-fields > .field:has(#cover-file) {
  grid-column: 1/-1;
}
.book-cover-workspace textarea {
  min-height: 64px;
  height: 64px;
  line-height: 1.5;
}
.book-cover-workspace .hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}
.book-cover-workspace [data-cover-progress]:empty {
  display: none;
}
body #sheet.book-cover-panel > .form-footer {
  flex: none;
  margin: 0;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid var(--line);
}
body #sheet.book-cover-panel > .form-footer > button {
  width: 100%;
}
@media (max-width: 760px) {
  body #sheet.book-cover-panel {
    height: 100dvh;
    max-height: 100dvh;
  }
  .cover-editor-overview {
    --cover-editor-width:96px;
    column-gap: 12px;
  }
  .cover-file-row input {
    font-size: 12px;
  }
}
/* 总纲现代卡片排版规范 */
.serial-outline-view.clean-outline-layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 0 16px;
}
.clean-outline-layout .outline-section-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 12px 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
.clean-outline-layout .outline-card-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px dashed color-mix(in srgb, var(--line) 80%, transparent);
}
.clean-outline-layout .outline-card-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
}
.clean-outline-layout .outline-card-icon {
  font-size: 15px;
  line-height: 1;
}
.clean-outline-layout .outline-card-body {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink);
}
/* 总纲结构化网格流与折叠样式 */
.clean-outline-layout .outline-grid-flow {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 4px 0 0;
}
.clean-outline-layout .outline-flow-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 10px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--soft) 35%, var(--paper));
}
.clean-outline-layout .outline-cell-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.clean-outline-layout .outline-cell-val {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink);
}
.clean-outline-layout .outline-eye-summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 6px 10px;
  cursor: pointer;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  background: var(--soft);
}
.clean-outline-layout .outline-eye-summary::-webkit-details-marker {
  display: none;
}
.clean-outline-layout .outline-eye-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.clean-outline-layout .outline-spoilers {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  background: transparent;
}
.clean-outline-layout .outline-spoilers[open] > .outline-eye-summary {
  border-bottom: 1px solid var(--line);
  border-radius: 6px 6px 0 0;
}
.clean-outline-layout .outline-spoilers-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
}

.serial-outline-view p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0;
}
.serial-outline-view details {
  margin: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
}
.serial-outline-view summary {
  display: flex;
  align-items: center;
  box-sizing: border-box;
  min-height: 44px;
  height: 44px;
  padding: 10px 0;
  margin: 0;
  line-height: 24px;
}
.serial-outline-view details[open] > summary {
  margin-bottom: var(--ui-gap);
}
.serial-outline-view dl {
  margin: 0;
  display: grid;
  gap: var(--ui-gap);
}
.serial-outline-view dt {
  font-weight: 600;
}
.serial-outline-view dd {
  margin: 0 0 var(--ui-gap);
}
.serial-outline-view ul {
  padding-left: 1.4em;
  margin: 0;
  display: grid;
  gap: var(--ui-gap);
}
.serial-outline-view article {
  padding-block: calc(var(--ui-gap)*1.5);
  border-top: 1px solid var(--line);
}
.serial-outline-view h3 {
  margin: 0 0 calc(var(--ui-gap)*1.5);
  font-size: 1em;
}
.serial-outline-view h3 {
  text-align: center;
}
.script-au-settings {
  display: grid;
  gap: var(--ui-gap);
}
.script-au-settings > .hint {
  margin: 0;
}
.writing-rule-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 35%);
  gap: var(--ui-gap);
  margin-bottom: var(--ui-gap);
}
.writing-rule-toolbar .ui-search {
  min-width: 0;
}
.writing-rule-toolbar select {
  max-width: 100%;
}
.custom-rule-item.ui-disclosure {
  padding: var(--ui-gap);
  border: 1px solid var(--line);
  border-radius: var(--ui-control-radius);
  margin: 0 0 var(--ui-gap);
}
.custom-rule-item + .custom-rule-item {
  margin-top: 0;
  padding-top: var(--ui-gap);
}
.custom-rule-item > summary {
  font-size: 14px;
}
.custom-rule-item > summary span[data-rule-display] {
  min-width: 0;
  overflow-wrap: anywhere;
}
.custom-rule-item .field {
  margin-bottom: var(--ui-gap);
}
.writing-rule-add {
  width: 100%;
  margin-block: var(--ui-gap);
  height: var(--ui-button-height);
  min-height: var(--ui-button-height);
}
.writing-advanced-body {
  display: grid;
  gap: var(--ui-gap);
  padding: var(--ui-gap) 0;
}
.writing-scope-choice.ui-disclosure {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--ui-control-radius);
  padding: 0 var(--ui-gap);
  margin: 0;
}
.writing-scope-choice > summary {
  padding-block: 4px;
  min-height: var(--ui-control-height);
  font-size: 13px;
}
.writing-scope-choice [data-scope-count] {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}
.writing-scope-options {
  padding-bottom: var(--ui-gap);
}
.writing-scope-options > div {
  max-height: 200px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.writing-scope-options label {
  display: flex;
  align-items: center;
  gap: var(--ui-gap);
  padding: 6px 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.writing-scope-options [hidden],
.custom-rule-item[hidden] {
  display: none !important;
}
.writing-advanced-body > .writing-scope-choice {
  margin-left: 0;
}
@media (max-width: 760px) {
  .writing-rule-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }
  .writing-rule-add {
    padding: 3px 12px;
    font-size:13px;line-height:1.4;font-weight:normal;font-style:normal;font-family:inherit;
  }
}
.writing-rule-toolbar > .writing-rule-add {
  grid-column: 1/-1;
  margin: 0;
}
[data-form=writing-rules] .custom-rule-item .script-text-editor > textarea {
  --rule-editor-rows:8;
}
[data-rule-list] [data-custom-rule][hidden] {
  display: none;
}
.setting-cast-role {
  display: flex;
  align-items: center;
  gap: var(--ui-gap);
  margin: 0 0 var(--ui-gap);
  color: var(--muted);
  font-size: 13px;
}
.setting-cast-role[hidden] {
  display: none;
}
.setting-cast-role select,
.setting-cast-role .ui-select {
  flex: 1;
  min-width: 0;
}
.role-profile-heading {
  display: flex;
  align-items: center;
  gap: var(--ui-gap);
  margin-bottom: var(--ui-gap);
}
.role-profile-heading > div {
  flex: 1;
  min-width: 0;
}
.role-profile-heading strong,
.role-profile-heading small {
  display: block;
  overflow-wrap: anywhere;
}
.role-profile-heading small {
  color: var(--muted);
}
.role-profile-setting {
  margin-bottom: var(--ui-gap);
}
.role-profile-content {
  overflow-wrap: anywhere;
}
.role-profile-theaters h2 {
  font-size: 16px;
  margin-block: var(--ui-gap);
}
.role-profile-actions {
  margin-bottom: var(--ui-gap);
}
.role-chat-heading,
.role-chat-compose-actions,
.role-chat-reference {
  display: flex;
  align-items: center;
  gap: var(--ui-gap);
  flex-wrap: wrap;
}
.role-chat-heading > span,
.role-chat-reference > span {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.role-chat-history {
  min-height: 160px;
  max-height: 50dvh;
  overflow-y: auto;
  padding-block: var(--ui-gap);
}
.role-chat-message {
  margin-bottom: var(--ui-gap);
  padding: var(--ui-gap);
  background: var(--paper);
  border: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.role-chat-message.from-user {
  margin-left: 8%;
  background: var(--surface);
}
.role-chat-message.from-role {
  margin-right: 8%;
}
.role-chat-message small {
  color: var(--muted);
}
.role-chat-message p {
  margin-block: var(--ui-gap);
}
.role-chat-compose-actions {
  justify-content: space-between;
  margin-top: var(--ui-gap);
}
.role-chat-compose textarea,
.role-quote-original {
  width: 100%;
  box-sizing: border-box;
}
.role-chat-references {
  margin-bottom: var(--ui-gap);
}
.role-chat-message-sources {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ui-gap);
}
.generation-wait .generation-outline-preview {
  text-align: left;
  overflow-wrap: anywhere;
  margin-top: 12px;
}
.generation-wait .generation-outline-preview > summary {
  text-align: center;
}
.generation-wait .generation-outline-preview > div {
  max-height: 35dvh;
  overflow: auto;
}
.reader:has(reader-claw, reader-scratch, reader-connect-four, reader-life-restart) .manuscript {
  width: 100%;
  max-width: none;
  padding: 0;
  margin: 0;
}
.reader .chapter:has(> reader-claw, > reader-scratch, > reader-connect-four, > reader-life-restart) {
  margin: 0;
  padding: 0;
  scroll-margin-top: 0;
}
reader-claw,
reader-scratch,
reader-connect-four,
reader-life-restart {
  display: block;
  width: 100%;
}
.chapter-edit-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.chapter-edit-heading h3 {
  flex: 1;
  min-width: 0;
  font-size: 19px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.chapter-edit-pencil {
  flex-shrink: 0;
}
.chapter-edit-pencil svg {
  width: 20px;
  height: 20px;
  vertical-align: middle;
}
body[data-page=role] {
  --profile-brief-size:12px;
  --profile-brief-leading:24px;
  --profile-avatar-size:64px;
  --profile-record-gap:12px;
  --profile-brief-ink:color-mix(in srgb,var(--ink) 72%,var(--bg));
  --profile-section-gap:var(--ui-gap);
  --space-size:52px;
  --space-radius:16px;
  --space-sky-top:#f8f5e9;
  --space-sky-bottom:#e9ecdf;
  --space-daylight:#d9ba72;
  --space-roof:#748474;
  --space-wall:#e3ded0;
  --space-wall-side:#bec8b8;
  --space-door:#677167;
  --space-window:#fff9e9;
  --space-highlight:#f7f6ee;
  --space-shadow:rgba(30,35,30,.16);
}
body[data-page=role][data-night=true] {
  --profile-brief-ink:#a5a7ae;
  --space-sky-top:#343d4d;
  --space-sky-bottom:#232a35;
  --space-moonlight:#e7dfc6;
  --space-roof:#7e8ba2;
  --space-wall:#b4bdcb;
  --space-wall-side:#8e9bad;
  --space-door:#525f75;
  --space-window:#f5d99c;
  --space-highlight:#e1e1e4;
  --space-shadow:rgba(0,0,0,.24);
}
.role-profile-brief {
  max-height: calc(30dvh - 3 * var(--profile-brief-leading));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: var(--profile-brief-size);
  line-height: var(--profile-brief-leading);
  font-weight: 400;
  color: var(--profile-brief-ink);
}
.role-profile-heading {
  margin-bottom: var(--profile-section-gap);
}
.role-profile-heading .entry-avatar {
  width: var(--profile-avatar-size);
  height: var(--profile-avatar-size);
}
.role-profile-heading .entry-avatar svg {
  width: 48px;
  height: 48px;
}
.role-profile-heading strong {
  font-size: 14px;
  font-weight: 600;
}
.role-profile-heading small {
  font-size: 11px;
  margin-top: 2px;
}
body[data-page=role] .role-profile-setting {
  margin: 0;
  padding: 0;
}
body[data-page=role] .role-profile-setting > summary {
  padding-block: var(--ui-gap);
}
.role-profile-setting summary {
  font-size: 12px;
  color: color-mix(in srgb, var(--ink) 88%, var(--bg));
  min-height: 32px;
  align-content: center;
}
.role-profile-theaters h2 {
  font-size: 15px;
  font-weight: 500;
  margin-block: var(--ui-gap);
}
.role-profile-theaters .field {
  gap: calc(var(--ui-gap) / 2);
  margin-bottom: 0;
}
.role-profile-theaters [data-role-theaters] > .hint {
  margin-top: var(--ui-gap);
}
.role-profile-theaters .line-item {
  padding-block: var(--profile-record-gap);
}
.role-profile-theaters .field label {
  font-size: 11px;
}
.role-profile-theaters .line-item strong {
  font-size: 14px;
  font-weight: 500;
}
.role-profile-theaters .line-item small {
  font-size: 11px;
}
.role-profile-heading .role-space-entry {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100px;
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
}
.role-space-orb {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--space-size);
  height: var(--space-size);
  border-radius: var(--space-radius);
  background:
    linear-gradient(
      150deg,
      var(--space-sky-top),
      var(--space-sky-bottom));
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 var(--edge), 0 4px 10px var(--shadow);
}
.role-space-orb > svg {
  width: 40px;
  height: 40px;
}
.role-space-orb > .role-space-night {
  display: none;
}
body[data-night=true] .role-space-orb > .role-space-day {
  display: none;
}
body[data-night=true] .role-space-orb > .role-space-night {
  display: block;
}
.role-space-lock {
  position: absolute;
  right: -3px;
  bottom: -2px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: color-mix(in srgb, var(--ink) 80%, var(--paper));
  box-shadow: 0 1px 3px var(--shadow);
}
.role-space-lock svg {
  width: 12px;
  height: 12px;
}
.role-space-name {
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  max-width: 100%;
  overflow-wrap: anywhere;
  color: color-mix(in srgb, var(--ink) 84%, var(--bg));
}
.top.object-top .role-profile-edit {
  height: 28px;
  width: auto;
  white-space: nowrap;
  padding-inline: 8px;
}
body[data-page=role] #app > .top .object-title {
  left: 96px !important;
  right: 96px !important;
}
@media (min-width: 761px) {
  body[data-page=role] #app > .top .object-title {
    left: 120px !important;
    right: 120px !important;
  }
}
body[data-page=process] {
  --process-preview-height:clamp(240px,45dvh,420px);
}
.process-preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.process-workspace .process-preview-surface {
  height: var(--process-preview-height);
  min-height: 0;
  max-height: none;
  overflow: auto;
}
.process-workspace .import-preview {
  align-self: start;
}
.process-preview-surface:has([data-reading-fixed-viewport]),
.process-full-preview:has([data-reading-fixed-viewport]) {
  overflow: hidden;
  padding: 0;
}
body #sheet.ui-panel[open]:has(.process-full-preview) {
  position: fixed;
  inset: 0;
  margin: 0;
  width: 100%;
  max-width: none;
  height: 100dvh;
  max-height: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
body #sheet.ui-panel:has(.process-full-preview) .sheet-head {
  flex: none;
  padding-top: env(safe-area-inset-top);
}
body #sheet.ui-panel:has(.process-full-preview) .sheet-body {
  flex: 1;
  min-height: 0;
  max-height: none;
  padding: 0;
  overflow: hidden;
}
.preview-surface.process-full-preview {
  height: 100%;
  min-height: 0;
  max-height: none;
  padding-bottom: env(safe-area-inset-bottom);
  overflow: auto;
}
.image-model-list {
  display: grid;
  gap: var(--ui-gap);
  margin-block: var(--ui-gap);
}
.image-model-list > .hint {
  margin: 0;
}
.image-model-row {
  display: flex;
  align-items: center;
  gap: var(--ui-gap);
  min-width: 0;
}
.image-model-row > .check-row {
  flex: 1;
  min-width: 0;
  margin: 0;
}
.image-model-row > .check-row span {
  overflow-wrap: anywhere;
}
.image-model-row > button {
  flex: none;
}
.image-model-row > button[aria-pressed=true] {
  border-color: var(--accent);
  color: var(--accent);
}
.book-cover-workspace [data-action=cover-model] {
  max-width: 100%;
  height: auto;
  min-height: var(--ui-button-height);
  white-space: normal;
  overflow-wrap: anywhere;
}
.image-settings > .image-api.mars-api-section {
  border-bottom: 0;
}
.review-appearance-controls {
  margin-top: var(--ui-gap,8px);
}
.review-tags {
  border: 0;
  padding: 0;
  margin: 0 0 18px;
  min-width: 0;
}
.review-tags legend {
  margin-bottom: 8px;
}
.review-tags .review-tag-dropdown {
  padding: 0;
  border: 0;
  width: 100%;
  flex: none;
}
.review-tags .review-tag-dropdown > summary [data-review-tag-selected] {
  flex: 1;
  min-width: 0;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
}
.review-tags .review-tag-dropdown[open] > summary:after {
  transform: rotate(180deg);
}
.review-tag-dropdown-body {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-top: 0;
  background: var(--paper);
}
.review-tag-options {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.review-tag-options .check-row {
  margin: 0;
  width: 100%;
}
.review-tag-add {
  margin-top: 10px;
  gap: 8px;
}
.review-tag-add input {
  min-width: 0;
  flex: 1;
}
.review-tag-add button {
  flex-shrink: 0;
}
.review-appearances {
  margin-top: 12px;
}
.review-appearances .menu-list {
  margin-top: 10px;
}
.review-appearances .hint {
  margin: 12px 0;
}
.review-tag-add button {
  height: var(--ui-button-height,28px);
}
@media (max-width: 760px) {
  body[data-page=image-styles] .style-new-action {
    width: 100%;
  }
}
body:is([data-page=image-settings], [data-page=image-styles]) .page .field {
  row-gap: calc(var(--ui-gap) / 2);
  margin-bottom: var(--ui-gap);
}
.image-settings .image-model-actions {
  display: flex;
  gap: var(--ui-gap);
  flex: none;
}
.image-settings .image-model-action {
  border: 1px solid var(--line);
  border-radius: var(--ui-control-radius);
  background: var(--paper);
}
.image-settings .image-model-action[aria-pressed=true] {
  border-color: var(--accent);
  color: var(--accent);
}
.image-settings .image-supplement .image-supplement-advanced {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}
@media (max-width: 760px) {
  .image-settings .image-model-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
  .image-settings .image-model-row > .check-row {
    border-bottom: 0;
    padding-bottom: 0;
  }
  .image-settings .image-model-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
  .image-settings .image-model-actions > button,
  .image-settings .image-model-add {
    width: 100%;
  }
}
.book-completion-corner {
  width: 48px;
  height: 48px;
  z-index: 1;
}
.book-completion-corner > span {
  width: 76px;
  left: -22px;
  top: 11px;
}
.book-completion-label {
  display: inline-block;
  margin-left: 8px;
  padding: 0 5px;
  border-radius: 2px;
  background: var(--soft);
  color: var(--ink);
  font-size:10px;line-height:18px;font-weight:normal;font-style:normal;font-family:inherit;
  vertical-align: middle;
  letter-spacing: 0;
}
:root {
  --game-log-width:300px;
  --game-log-gap:12px;
  --game-log-padding:18px;
}
.game-log-panel {
  min-width: 0;
  overflow: hidden;
  border-left: 1px solid var(--line);
  background: var(--paper);
  padding: var(--game-log-padding);
  display: flex;
  flex-direction: column;
  gap: var(--game-log-gap);
}
.game-log-panel h2 {
  font-size:14px;line-height:1.6;font-weight:normal;font-style:normal;font-family:inherit;
  text-align: center;
  margin: 0;
}
.game-log-view {
  display: flex;
  flex-direction: column;
  gap: var(--game-log-gap);
  min-height: 0;
  flex: 1;
}
.game-log-search {
  width: 100%;
  flex-shrink: 0;
}
.game-log-list {
  overflow: auto;
  min-height: 0;
  overscroll-behavior: contain;
}
.game-log-entry {
  border-bottom: 1px solid var(--line);
  padding: var(--game-log-gap) 0;
}
.game-log-entry summary {
  display: grid;
  gap: 4px;
  cursor: pointer;
  font-size:12px;line-height:1.6;font-weight:normal;font-style:normal;font-family:inherit;
  overflow-wrap: anywhere;
  list-style: none;
}
.game-log-entry summary strong {
  font-weight: 500;
}
.game-log-entry summary time,
.game-log-entry summary span {
  color: var(--muted);
}
.game-log-timeline {
  list-style: none;
  padding: 0 0 0 var(--game-log-gap);
  margin: var(--game-log-gap) 0 0;
  border-left: 1px solid var(--line);
}
.game-log-timeline li {
  padding-bottom: var(--game-log-gap);
  font-size:12px;line-height:1.7;font-weight:normal;font-style:normal;font-family:inherit;
  overflow-wrap: anywhere;
}
.game-log-timeline time {
  display: block;
  color: var(--muted);
  font-size: 10px;
}
.game-log-timeline strong {
  font-weight: 500;
}
.game-log-timeline p {
  margin: 0;
  white-space: pre-wrap;
}
.game-log-timeline [data-kind=speech] p {
  color: var(--accent);
}
@media (min-width: 761px) {
  .reader.with-game-logs > .reader-scroll {
    width: calc(100% - var(--game-log-width));
  }
  .reader.with-game-logs > .reader-header,
  .reader.with-game-logs > .reader-bottom {
    width: calc(100% - var(--game-log-width));
    right: var(--game-log-width);
  }
  .reader.with-game-logs > .reader-header {
    padding-inline: max(16px, calc((100% - var(--game-log-width) - 920px)/2));
  }
  .reader.with-game-logs > .game-log-panel {
    position: absolute;
    inset: 0 0 0 auto;
    width: var(--game-log-width);
  }
}
@media (max-width: 760px) {
  .reader > .game-log-panel {
    display: none;
  }
}
body[data-ui-surface] .game-log-view .game-log-entry > summary {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 4px 8px;
  padding-right: 0;
}
.game-log-view .game-log-entry > summary::before,
.game-log-view .game-log-entry > summary::after {
  display: none;
}
.game-log-entry > summary > time,
.game-log-entry > summary > strong,
.game-log-entry > summary > span:not(.ui-disclosure-arrow) {
  grid-column: 2;
}
.game-log-entry > summary > .ui-disclosure-arrow {
  grid-column: 1;
  grid-row: 1 / span 3;
}
body[data-page=role-chat] #app .chat-preview-compose > [data-role-chat-references] {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 8px 6px;
  order: 0;
}
body[data-page=role-chat] #app .chat-preview-compose > [data-role-chat-references]:empty {
  display: none;
}
body[data-page=role-chat] #app .chat-preview-reference {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 4px 8px;
  margin: 0;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 30%, transparent);
  border-radius: 0;
  background: transparent;
}
body[data-page=role-chat] #app .chat-preview-reference .reference-title {
  margin-right: auto;
}
body[data-page=role-chat] #app.has-private-chat-font-size .role-chat-bubble {
  font-size: var(--private-chat-font-size) !important;
}
body[data-page=role-chat] #app.has-private-chat-font-size .role-chat-bubble p {
  font-size: inherit !important;
}
/* 气泡主题内的正文跟随私聊字号，状态栏内容比正文大三像素。 */
body[data-page=role-chat] #app .role-chat-bubble :is(.narrative-words,.cw-dialogue,.quote-words,.quote-bound,.quote-ink) {
  font-size: inherit !important;
}
body[data-page=role-chat] #app :is(.role-chat-scene,.role-chat-scene .cw-sb-card,.role-chat-scene .cw-sb-row,.role-chat-scene .cw-sb-k,.role-chat-scene .cw-sb-v) {
  font-size: calc(var(--private-chat-font-size, 15px) + 3px) !important;
}
body[data-page=role-chat] #app .cw-typing {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 50px;
  min-height: 28px;
}
body[data-page=role-chat] #app .cw-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: private-chat-dot 1.2s infinite ease-in-out;
}
body[data-page=role-chat] #app .cw-dot:nth-child(2) {
  animation-delay: .16s;
}
body[data-page=role-chat] #app .cw-dot:nth-child(3) {
  animation-delay: .32s;
}
@keyframes private-chat-dot {
  0%, 60%, 100% {
    opacity: .3;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}
body[data-page=role-chat] #app .chat-preview-send.is-stopping {
  opacity: 1;
  cursor: pointer;
}
body[data-page=role-chat] #app .chat-preview-send.is-stopping svg {
  display: none;
}
body[data-page=role-chat] #app .chat-preview-send.is-stopping:before {
  content: "";
  width: 12px;
  height: 12px;
  background: currentColor;
  border-radius: 2px;
  margin-right: 5px;
}
body[data-ui-surface] .chapter-append-link {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  padding: 0 !important;
  box-shadow: none !important;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}
body[data-ui-surface] .chapter-link .ui-chapter-number {
  font-size: .88em;
  font-weight: 500;
  color: var(--muted);
}
body[data-ui-surface] .chapter-link .chapter-title-name {
  font-size: 1em;
  font-weight: 650;
  color: var(--ink);
}
body[data-ui-surface] .chapter-title-separator {
  opacity: .4;
}
body[data-ui-surface] .chapter-entry {
  border-color: color-mix(in srgb, var(--line) 25%, transparent) !important;
}
body[data-ui-surface] .chapter-link {
  border-color: color-mix(in srgb, var(--line) 25%, transparent) !important;
}
body[data-page=role-chat] #app > .top,
body[data-page=role-chat] #app > .page.narrow {
  border-color: color-mix(in srgb, var(--line) 25%, transparent) !important;
}
.role-chat-settings .chat-settings-list > button {
  border-color: color-mix(in srgb, var(--line) 25%, transparent) !important;
}
.notebook-failures {
  margin-top: 18px;
  color: var(--muted);
}
.notebook-failures > summary {
  font-size: 12px;
  cursor: pointer;
}
.notebook-job pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
}
.annotation-letter-dialog {
  --letter-paper:#e6ddc9;
  max-width: min(440px, calc(100vw - 32px));
  width: 100%;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  max-height: 85dvh;
  overflow: hidden;
}
.annotation-letter-dialog::backdrop {
  background: #0003;
  backdrop-filter: none;
}
.annotation-letter-header {
  display: flex;
  flex: none;
  min-height: 32px;
  align-items: center;
  position: relative;
  justify-content: center;
  margin-bottom: 12px;
}
.annotation-letter-header h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}
.annotation-letter-header button {
  position: absolute;
  right: 0;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: inherit;
}
.annotation-envelope {
  position: relative;
  display: block;
  width: 85%;
  aspect-ratio: 1.55;
  margin: 24px auto 14px;
  padding: 0;
  overflow: hidden;
  border: 1px solid #bba984;
  border-radius: 5px;
  background:
    linear-gradient(
      155deg,
      #f4ead6,
      #ded0b2);
  box-shadow: 0 14px 28px #0002;
  color: #705d45;
  cursor: pointer;
}
.annotation-envelope:before,
.annotation-envelope:after {
  content: "";
  position: absolute;
  inset: 0;
  background: #eadcc0;
  clip-path: polygon(0 0, 50% 55%, 0 100%);
}
.annotation-envelope:after {
  transform: scaleX(-1);
}
.annotation-envelope-flap {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(#f3e9d4, #e6d5b5);
  clip-path: polygon(0 0, 100% 0, 50% 60%);
  filter: drop-shadow(0 2px 1px #0002);
}
.annotation-envelope-seal {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 45%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #8c5557;
  color: #ecd6c2;
  border: 3px double #b07878;
  box-shadow: 0 2px 5px #0003;
  font-size: 20px;
}
.annotation-envelope-caption {
  position: absolute;
  bottom: 13px;
  left: 0;
  right: 0;
  z-index: 2;
  font-size: 12px;
  letter-spacing: 2px;
}
.annotation-letter-open-hint {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}
.annotation-letter-paper {
  padding: 20px;
  margin-bottom: 16px;
  border-radius: 5px;
}
.annotation-letter-paper h3 {
  text-align: center;
  font-size: 15px;
}
.annotation-letter-paper p {
  white-space: pre-wrap;
  line-height: 1.8;
}
@media (prefers-reduced-motion: reduce) {
  body[data-page=role-chat] #app .cw-dot {
    animation: none;
  }
}
body[data-page=role-chat] {
  --private-wait-width:62px;
  --private-wait-height:36px;
}
body[data-page=role-chat] #app [data-role-chat-loading] > .chat-preview-message-body {
  width: auto !important;
  flex: 0 0 auto !important;
  min-width: 0 !important;
}
body[data-page=role-chat] #app [data-role-chat-loading] .cw-typing {
  width: var(--private-wait-width) !important;
  min-width: var(--private-wait-width) !important;
  min-height: var(--private-wait-height) !important;
  padding: 8px 12px !important;
}
body[data-page=role-chat] #app .chat-preview-send.is-stopping {
  display: flex !important;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--paper);
  gap: 4px;
}
body[data-page=role-chat] #app .chat-preview-send.is-stopping:before {
  flex: 0 0 12px;
  margin: 0;
}
body[data-page=role-chat] #app .chat-preview-send.is-stopping span {
  white-space: nowrap;
  flex: 0 0 auto;
  font-size: 12px;
}
body[data-ui-surface] .home-chapters,
body[data-ui-surface] .home-chapters .section-head {
  border-color: color-mix(in srgb, var(--line) 25%, transparent) !important;
}
body[data-ui-surface] dialog.annotation-letter-dialog {
  position: fixed !important;
  left: 50% !important;
  top: 50% !important;
  right: auto !important;
  bottom: auto !important;
  margin: 0 !important;
  transform: translate(-50%, -50%) !important;
  width: min(360px, calc(100vw - 32px)) !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: 85dvh !important;
  box-sizing: border-box;
}
.annotation-letter-sender {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}
body[data-page=role-chat] .private-phone-message {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}
body[data-page=role-chat] .private-phone-message .private-phone-row {
  margin: 0;
}
body[data-page=role-chat] .private-phone-message .private-phone-bubble {
  white-space: normal;
}
body[data-page=role-chat] .private-phone-extra {
  margin-left: calc(var(--chat-avatar) + 8px);
}
body[data-page=role-chat] .private-phone-message:hover > .role-chat-message-actions {
  opacity: 1;
}
.role-chat-settings [data-reply-length][hidden] {
  display: none;
}
body[data-page=role-chat] #app .private-phone-row .chat-preview-message-name {
  display: block !important;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
  margin-bottom: 4px;
}
.image-settings .image-model-add {
  width: 100%;
  border-style: dashed;
}
.image-settings .image-model-name-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--ui-gap);
  align-items: center;
  min-width: 0;
}
.image-settings .image-model-name-row > button {
  white-space: nowrap;
}
.image-settings .image-model-name-row > [data-generation-test-result] {
  grid-column: 1 / -1;
  min-width: 0;
  overflow-wrap: anywhere;
}
@media (min-width: 761px) {
  .image-settings .image-model-name-row {
    max-width: 420px;
  }
}
.image-settings .image-model-heading {
  text-align: center;
  font-size: 16px;
  margin: var(--ui-gap) 0;
}
.image-settings .image-model-row {
  display: flex;
  align-items: center;
  gap: var(--ui-gap);
}
.image-settings .image-model-row > .check-row {
  flex: 1;
  min-width: 0;
}
.image-settings .image-model-detail {
  flex: none;
  white-space: nowrap;
}
.image-settings .image-model-add-area {
  border-top: 1px solid var(--line);
  padding-top: calc(var(--ui-gap) * 2);
  margin-top: calc(var(--ui-gap) * 2);
}
.image-model-settings .image-model-delete {
  margin-top: calc(var(--ui-gap) * 3);
}
body[data-page=image-model-settings] .page .field {
  row-gap: calc(var(--ui-gap) / 2);
  margin-bottom: var(--ui-gap);
}
.image-model-edit-tools {
  display: flex;
  justify-content: flex-end;
  margin-bottom: var(--ui-gap);
}
.image-model-fields {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.annotation-letter-dialog[open] {
  display: flex;
  flex-direction: column;
}
.annotation-letter-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
@media (max-width: 760px) {
  body[data-page=entry] {
    --entry-mobile-input-size:16px;
  }
  body[data-page=entry] [data-form=entry] :is(input:not([type=file]):not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=hidden]):not([type=button]):not([type=submit]):not([type=reset]), textarea, select) {
    font-size: var(--entry-mobile-input-size) !important;
  }
}
.chapter-section-list {
  margin: 0 0 12px 20px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}
.chapter-section-link {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 10px 8px;
  text-align: left;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
}
.chapter-section-link > span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}
.chapter-section-link > span:last-child {
  flex: none;
}
body[data-page=role-chat] #app .chat-preview-send.is-preparing svg {
  display: none;
}
body[data-page=role-chat] #app .chat-preview-send.is-preparing span {
  white-space: nowrap;
  flex: 0 0 auto;
  font-size: 12px;
}
.reader .reader-header {
  background: var(--bg);
  backdrop-filter: none;
}
.reader .reader-header h1 {
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
}
@media (max-width: 760px) {
  .menu-list .menu-item {
    padding: 10px 0;
    gap: 8px;
  }
  .chapter-edit-heading h3 {
    font-size: 15px;
    line-height: 1.4;
  }
  .script-books {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .script-list-filter summary {
    padding: 8px 0;
  }
  .script-filter-fields {
    display: grid;
    gap: 8px;
  }
}
.sheet-head h2 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.inline-hint {
  position: relative;
  font-size: 13px;
}
.inline-hint > summary {
  list-style: none;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.inline-hint > summary::-webkit-details-marker {
  display: none;
}
.inline-hint > p {
  position: absolute;
  top: 28px;
  right: 0;
  z-index: 3;
  width: min(260px, 70vw);
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.5;
  text-align: left;
  white-space: normal;
}
.pin-action {
  display: grid;
  gap: 4px;
}
.pin-action small {
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
}
.cover-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.cover-title-icon {
  display: grid;
  width: 18px;
  height: 18px;
  color: var(--muted);
  flex: none;
}
.cover-title-icon svg {
  width: 18px;
  height: 18px;
}
.cover-file-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.cover-file-row [data-cover-name] {
  font-size: 12px;
  color: var(--muted);
}
.cover-generate-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.cover-generate-row button {
  width: 100%;
}
.binding-chevron svg {
  width: 16px;
  height: 16px;
  display: block;
  margin: auto;
}
.binding-selected {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  min-width: 0;
}
.binding-selected-names {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.binding-selected-count {
  flex: none;
  white-space: nowrap;
}
.binding-usage {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.binding-usage.over {
  color: #b55248;
}
body[data-page=process] .process-workspace {
  gap: 8px;
}
body[data-page=process] .process-workspace .process-editor .form-footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: var(--bg);
  padding: 8px 0;
}
body[data-page=process] #request {
  min-height: 96px;
}
.generation-wait {
  position: relative;
}
.wait-collapse {
  position: absolute;
  top: 8px;
  right: 8px;
  min-height: 0;
  padding: 2px 8px;
  font-size: 12px;
}
.generation-wait.is-collapsed .wait-content {
  display: none;
}
.generation-wait.is-collapsed {
  min-height: 36px;
}
.book-style-block {
  margin-top: 8px;
}
.book-style-block h3 {
  margin: 0 0 8px;
  font-size: 15px;
  text-align: center;
}
.book-settings-footer {
  margin-top: 8px;
}
body #sheet > .sheet-body:has(> [data-form=book-writing]),
body #sheet > .sheet-body:has(> [data-form=serial-clues]) {
  padding-top: var(--ui-gap,8px);
}
#sheet [data-form=book-writing],
#sheet [data-form=serial-clues] {
  padding-top: 0;
}
#sheet [data-form=book-writing] {
  display: grid;
  gap: var(--ui-gap,8px);
}
#sheet [data-form=book-writing] :is(.field, .hint, .book-style-block) {
  margin: 0;
}
#sheet [data-form=book-writing] .check-row {
  padding: 0;
  min-height: var(--ui-button-height,28px);
  border: 0;
  gap: var(--ui-gap,8px);
}
#sheet [data-form=book-writing] .book-style-block {
  display: grid;
  gap: var(--ui-gap,8px);
  padding-top: var(--ui-gap,8px);
  border-top: 1px solid var(--line);
}
#sheet [data-form=book-writing] .book-style-block h3 {
  margin: 0;
  font-size: 14px;
  text-align: left;
}
#sheet [data-form=book-writing] .hint {
  line-height: 1.6;
}
#sheet .serial-clue-list {
  gap: var(--ui-gap,8px);
}
#sheet .serial-clue {
  display: grid;
  gap: calc(var(--ui-gap,8px)/2);
}
#sheet .serial-clue-input {
  position: relative;
  min-width: 0;
}
#sheet .serial-clue-input textarea {
  display: block;
  margin: 0;
  min-height: 0;
  font-size: 14px;
  line-height: 1.6;
  padding-top: calc(var(--ui-button-height,28px) + var(--ui-gap,8px)/2);
}
#sheet .serial-clue-actions {
  position: absolute;
  top: 2px;
  right: calc(var(--ui-gap,8px)/2);
  display: flex;
  gap: calc(var(--ui-gap,8px)/2);
}
#sheet .serial-clue-actions button {
  display: grid;
  place-items: center;
  width: var(--ui-button-height,28px);
  height: var(--ui-button-height,28px);
  min-height: 0;
  padding: 0;
  color: var(--muted);
}
#sheet .serial-clue-actions button:hover,
#sheet .serial-clue-actions button:focus-visible {
  color: var(--ink);
}
#sheet .serial-clue-actions svg {
  width: 16px;
  height: 16px;
}
body #sheet:has([data-form=serial-clues]) > .sheet-head {
  position: relative;
  z-index: 4;
  overflow: visible;
}
#sheet:has([data-form=serial-clues]) .inline-hint {
  position: static;
}
#sheet:has([data-form=serial-clues]) .inline-hint > p {
  left: 18px;
  right: 18px;
  top: calc(100% - 1px);
  width: auto;
  max-height: calc(100dvh - 140px);
  overflow: auto;
  overflow-wrap: anywhere;
}
#sheet [data-form=book-writing] .book-style-help {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--ui-gap,8px);
}
#sheet [data-form=book-writing] .book-style-help .inline-hint {
  position: static;
  display: contents;
}
#sheet [data-form=book-writing] .book-style-help .inline-hint > p {
  position: static;
  flex-basis: 100%;
  width: 100%;
  max-height: none;
  margin: 0;
  overflow-wrap: anywhere;
  line-height: 1.6;
}
body[data-page=process] .process-toolbar {
  display: flex;
  align-items: flex-end;
  gap: var(--ui-gap);
  margin-bottom: var(--ui-gap);
}
body[data-page=process] .process-toolbar > .field {
  flex: 0 1 420px;
  min-width: 0;
  margin: 0;
}
body[data-page=process] .process-workspace {
  margin-top: var(--ui-gap);
}
body[data-page=process] .top > [data-action=template-list] {
  white-space: nowrap;
  width: auto;
  font-size: 13px;
}
.detail-cover > .cover-edit-trigger {
  display: block;
  width: 100%;
  height: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 0;
}
.novel-beauty-item {
  position: relative;
  overflow: hidden;
  padding-left: 48px;
}
.novel-beauty-corner {
  --ribbon-bg:#b44848;
  --ribbon-ink:#fff;
}
body[data-night=true] .novel-beauty-corner > span {
  background: var(--ribbon-bg);
  color: var(--ribbon-ink);
}
.review-style-tags .review-tag-add {
  margin: 0 0 var(--ui-gap);
}
.review-style-tag-option {
  display: flex;
  align-items: center;
  gap: calc(var(--ui-gap) / 2);
}
.review-tag-options .review-style-tag-option .check-row {
  width: auto;
  min-width: 0;
  border-bottom: 0;
}
.review-style-tag-option .check-row span {
  overflow-wrap: anywhere;
}
.review-style-tag-option .review-tag-remove {
  flex: 0 0 var(--ui-button-height, 28px);
  width: var(--ui-button-height, 28px);
  padding: 0;
}
body #sheet > .sheet-body:has(> [data-form=review-style-entry]) {
  padding-top: var(--ui-gap,8px);
}
#sheet [data-form=review-style-entry] {
  display: grid;
  gap: var(--ui-gap,8px);
  margin: 0;
  padding: 0;
}
#sheet [data-form=review-style-entry] > .field {
  margin: 0;
  gap: calc(var(--ui-gap,8px) / 2);
}
#sheet [data-form=review-style-entry] > .review-tags {
  margin: 0;
}
#sheet:has([data-form=review-style-entry]) > .sheet-head h2 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(var(--ui-gap,8px) / 2);
}
#sheet:has([data-form=review-style-entry]) .review-style-help {
  position: static;
}
#sheet:has([data-form=review-style-entry]) .review-style-help > summary {
  position: relative;
  width: 16px;
  height: 16px;
  min-height: 0;
  padding: 0;
  font-size: 10px;
  line-height: 1;
}
#sheet:has([data-form=review-style-entry]) .review-style-help > summary::after {
  content: "";
  position: absolute;
  inset: -6px;
}
#sheet:has([data-form=review-style-entry]) .review-style-help > p {
  left: 18px;
  right: 18px;
  top: calc(100% - 1px);
  width: auto;
  max-height: calc(100dvh - 140px);
  overflow: auto;
  overflow-wrap: anywhere;
}
body[data-page=role-chat] #app .chat-preview-compose > [data-role-chat-references] {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 8px 6px;
  order: 0;
  background: transparent;
  color: var(--ink);
}
body[data-page=role-chat] #app .chat-preview-compose > [data-role-chat-references]:empty {
  display: none;
}
body[data-page=role-chat] #app .chat-preview-compose > [data-role-chat-references] .chat-preview-reference {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 6px 8px;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
}
body[data-page=role-chat] #app .chat-preview-compose > [data-role-chat-references] .reference-excerpt {
  grid-column: 1/-1;
  max-height: 7.2em;
  margin: 0;
  overflow: auto;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
body[data-page=role-chat] #app .chat-preview-compose > [data-role-chat-references] .reference-title {
  min-width: 0;
  margin: 0;
  color: var(--ink);
}
body[data-page=role-chat] #app .chat-preview-compose > [data-role-chat-references] .chat-preview-reference button {
  color: var(--ink);
  background: var(--soft);
  border: 1px solid var(--line);
}
.bindings-editor[data-for-rule=false] .current-setting-note {
  margin: 0 0 8px;
  text-align: center;
  color: var(--muted);
}
.bindings-editor[data-for-rule=false] .binding-section > summary {
  grid-template-columns: auto 1fr 22px;
  align-items: center;
  gap: 8px;
  padding-block: 12px;
}
.bindings-editor[data-for-rule=false] .binding-selected {
  grid-row: 1;
  grid-column: 2;
  font-size: 13px;
  color: var(--muted);
}
.bindings-editor[data-for-rule=false] .binding-section[open] > summary .binding-selected {
  display: inline;
}
.bindings-editor[data-for-rule=false] .binding-chevron {
  grid-row: 1;
  grid-column: 3;
}
.bindings-editor[data-for-rule=false] .binding-usage {
  margin: 0 0 4px;
  line-height: 1.4;
}
.bindings-editor[data-for-rule=false] .binding-npc-section {
  margin-block: 8px;
  border: 0;
}
.bindings-editor[data-for-rule=false] .binding-npc-section > summary {
  font-size: 14px;
  padding-block: 8px;
}
.bindings-editor[data-for-rule=false] .binding-npc-section > summary span {
  margin-left: 8px;
  color: var(--muted);
}
.bindings-editor[data-for-rule=false] .current-setting-edit {
  margin: 0 0 8px;
  border: 0;
  padding-inline: 10px;
}
.bindings-editor[data-for-rule=false] .current-setting-edit > summary {
  font-size: 13px;
  color: var(--muted);
  padding-block: 8px;
}
.bindings-editor[data-for-rule=false] .current-setting-edit .field {
  margin-block: 8px;
}
.bindings-editor[data-for-rule=false] .current-setting-edit textarea {
  width: 100%;
}
.bindings-editor[data-for-rule=false] .current-setting-edit + .small {
  margin: 0 10px 8px;
}
.bindings-editor[data-for-rule=false] .current-setting-edit > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.bindings-editor[data-for-rule=false] .binding-section > summary::before {
  display: none;
}
.bindings-editor[data-for-rule=false] .binding-section-title {
  grid-column: 1;
  grid-row: 1;
}
.bindings-editor[data-for-rule=false] .binding-save > button {
  width: 100%;
}
.bindings-editor[data-for-rule=false] .current-setting-edit > summary > span,
.bindings-editor[data-for-rule=false] [data-action=binding-npc-local] {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.bindings-editor[data-for-rule=false] .binding-usage.over {
  color: var(--muted);
}
.bindings-editor[data-for-rule=false] .binding-usage.over .binding-usage-value {
  color: #b55248;
}
body[data-page=group] .group-kind-tabs ,body .group-choice-scope .group-kind-tabs{
  padding-block: 4px 8px;
  margin-bottom: 12px;
}
body[data-page=group] .group-section-heading ,body .group-choice-scope .group-section-heading{
  margin-bottom: 8px;
}
body[data-page=group] .group-panels .group-section ,body .group-choice-scope .group-panels .group-section{
  margin-bottom: 16px;
}
body[data-page=group] .group-check-item .check-row ,body .group-choice-scope .group-check-item .check-row{
  min-height: 0;
  padding-block: 6px;
  margin-block: 0;
}
body[data-page=group] .group-check-item:has(+ .setting-cast-role:not([hidden])) ,body .group-choice-scope .group-check-item:has(+ .setting-cast-role:not([hidden])){
  margin-bottom: var(--ui-gap);
}
body[data-page=group] .setting-cast-role ,body .group-choice-scope .setting-cast-role{
  margin-bottom: var(--ui-gap);
}
body[data-ui-surface=reading][data-page=group] .group-entry-view ,body[data-ui-surface=reading] .group-choice-scope .group-entry-view{
  border: 0;
  background: transparent;
  box-shadow: none;
}
body[data-ui-surface=reading][data-page=group] .group-entry-view:hover ,body[data-ui-surface=reading] .group-choice-scope .group-entry-view:hover{
  border: 0;
  background: transparent;
  box-shadow: none;
}
body[data-ui-surface=reading][data-page=group] .setting-cast-role :is(select.ui-input, .ui-select) ,body[data-ui-surface=reading] .group-choice-scope .setting-cast-role :is(select.ui-input, .ui-select){
  font-size: 13px !important;
  height: var(--ui-button-height) !important;
  min-height: var(--ui-button-height) !important;
  padding-block: 3px;
  line-height: 1.4;
}
body[data-page=group] .group-person-card ,body .group-choice-scope .group-person-card{
  --person-card-bg:var(--paper);
  --person-card-name:var(--ink);
  --person-card-description:var(--muted);
  --person-card-warning:#9a5b1b;
  --person-card-control:var(--ink);
  margin: 0 0 var(--ui-gap);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--person-card-bg);
  transition: none;
}
body[data-night=true][data-page=group] .group-person-card ,body[data-night=true] .group-choice-scope .group-person-card{
  --person-card-bg:#252525;
  --person-card-name:#f0f0f0;
  --person-card-description:#9e9e9e;
  --person-card-warning:#e0a356;
  --person-card-control:#d0d0d0;
}
body[data-page=group] .group-person-card:has(.group-check-item > .check-row > input:not(:checked)) ,body .group-choice-scope .group-person-card:has(.group-check-item > .check-row > input:not(:checked)){
  opacity: .72;
}
body[data-page=group] .group-person-card .group-check-item ,body .group-choice-scope .group-person-card .group-check-item{
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 60px;
  margin: 0;
  border: 0;
}
body[data-page=group] .group-person-card .check-row ,body .group-choice-scope .group-person-card .check-row{
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 0;
  margin: 0;
  padding: 0;
  flex: 1;
  min-width: 0;
}
body[data-page=group] .group-person-card .check-row > input ,body .group-choice-scope .group-person-card .check-row > input{
  margin-top: 3px !important;
}
body[data-page=group] .group-person-card .check-content ,body .group-choice-scope .group-person-card .check-content{
  display: block;
  min-width: 0;
  flex: 1;
}
body[data-page=group] .group-person-heading ,body .group-choice-scope .group-person-heading{
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
  line-height: 21px;
}
body[data-page=group] .group-person-card .group-person-heading strong ,body .group-choice-scope .group-person-card .group-person-heading strong{
  font-size: 15px;
  font-weight: 600;
  line-height: 21px;
  color: var(--person-card-name);
  overflow-wrap: anywhere;
}
body[data-page=group] .group-person-card .group-person-origin ,body .group-choice-scope .group-person-card .group-person-origin{
  display: inline;
  margin: 0;
  font-size: 11px;
  line-height: 16px;
  font-weight: 400;
  color: var(--person-card-description);
  white-space: nowrap;
}
body[data-page=group] .group-person-card .group-person-summary ,body .group-choice-scope .group-person-card .group-person-summary{
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--person-card-description);
  overflow-wrap: anywhere;
}
body[data-page=group] .group-person-card :is(.bound-char-note, .specified-people-note, .bound-npc-note) ,body .group-choice-scope .group-person-card :is(.bound-char-note, .specified-people-note, .bound-npc-note){
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--person-card-warning);
  overflow-wrap: anywhere;
}
body[data-page=group] .group-person-card .group-person-cast ,body .group-choice-scope .group-person-card .group-person-cast{
  display: block;
  align-self: flex-start;
  flex: 0 0 76px;
  min-width: 0;
  margin: 0;
}
body[data-page=group] .group-person-cast .group-cast-caption ,body .group-choice-scope .group-person-cast .group-cast-caption{
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
body[data-ui-surface=reading][data-page=group] .group-person-cast :is(select.ui-input, .ui-select) ,body[data-ui-surface=reading] .group-choice-scope .group-person-cast :is(select.ui-input, .ui-select){
  width: 100%;
  max-width: none;
  height: var(--ui-button-height) !important;
  min-height: var(--ui-button-height) !important;
  font-size: 13px !important;
  font-weight: 500;
  padding: 3px 5px;
  border-radius: var(--ui-control-radius);
  background: transparent;
  color: var(--person-card-control);
}
body[data-page=group] .group-person-cast select:disabled ,body .group-choice-scope .group-person-cast select:disabled{
  opacity: .45;
}
body[data-ui-surface=reading][data-page=group] .group-person-card .group-entry-view ,body[data-ui-surface=reading] .group-choice-scope .group-person-card .group-entry-view{
  flex: 0 0 24px;
  width: 24px;
  min-width: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: 18px !important;
  color: var(--person-card-description);
}
body[data-page=group] .group-person-card .setting-photo-choices ,body .group-choice-scope .group-person-card .setting-photo-choices{
  margin-top: 8px;
}
body[data-page=group] .group-person-card .group-check-item ,body .group-choice-scope .group-person-card .group-check-item{
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 76px 24px;
  column-gap: 8px;
  row-gap: 4px;
  align-items: center;
  min-height: 0;
}
body[data-page=group] .group-person-card :is(.check-row, .check-content) ,body .group-choice-scope .group-person-card :is(.check-row, .check-content){
  display: contents;
}
body[data-page=group] .group-person-card .check-row > input ,body .group-choice-scope .group-person-card .check-row > input{
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  margin: 0 !important;
}
body[data-page=group] .group-person-card .group-person-heading ,body .group-choice-scope .group-person-card .group-person-heading{
  grid-column: 2;
  grid-row: 1;
}
body[data-page=group] .group-person-card .group-person-cast ,body .group-choice-scope .group-person-card .group-person-cast{
  grid-column: 3;
  grid-row: 1;
  align-self: center;
}
body[data-page=group] .group-person-card .group-entry-view ,body .group-choice-scope .group-person-card .group-entry-view{
  grid-column: 4;
  grid-row: 1;
  align-self: center;
}
body[data-page=group] .group-person-card .group-person-summary ,body .group-choice-scope .group-person-card .group-person-summary{
  grid-column: 1/-1;
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: color-mix(in srgb, var(--muted) 88%, var(--paper));
}
body[data-night=true][data-page=group] .group-person-card .group-person-summary ,body[data-night=true] .group-choice-scope .group-person-card .group-person-summary{
  color: #929292;
}
body[data-page=group] .group-person-card :is(.bound-char-note, .specified-people-note, .bound-npc-note) ,body .group-choice-scope .group-person-card :is(.bound-char-note, .specified-people-note, .bound-npc-note){
  grid-column: 1/-1;
  margin: 0;
}
body[data-page=group] .group-person-card .group-check-item ,body .group-choice-scope .group-person-card .group-check-item{
  grid-template-columns: 18px minmax(0, 1fr) 60px 24px;
}
body[data-page=group] .group-person-card .group-person-summary ,body .group-choice-scope .group-person-card .group-person-summary{
  font-size: 11px !important;
  line-height: 1.4;
  color: color-mix(in srgb, var(--muted) 70%, var(--paper));
}
body[data-night=true][data-page=group] .group-person-card .group-person-summary ,body[data-night=true] .group-choice-scope .group-person-card .group-person-summary{
  color: #7d7d7d;
}
body[data-page=group] .group-person-card .group-person-cast ,body .group-choice-scope .group-person-card .group-person-cast{
  width: 60px;
  flex-basis: 60px;
}
body[data-ui-surface=reading][data-page=group] .group-person-card .group-person-cast :is(select.ui-input, .ui-select) ,body[data-ui-surface=reading] .group-choice-scope .group-person-card .group-person-cast :is(select.ui-input, .ui-select){
  font-size: 11px !important;
  height: 22px !important;
  min-height: 22px !important;
  padding: 1px 4px;
  line-height: 1.2;
  border-radius: 4px;
}
.script-detail-layout {
  max-width: 560px;
  margin-inline: auto;
  padding-bottom: 100px;
}
.script-overview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.script-overview > .rule-detail-cover {
  width: 120px;
  height: 160px;
  margin: 0;
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 6px 16px #243c2620;
}
.script-overview-info {
  width: 100%;
  min-width: 0;
}
.script-detail-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}
.script-detail-meta > span {
  padding: 3px 9px;
  border-radius: 0;
  background: var(--soft,#eaece4);
}
.script-overview .rule-body {
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
}
.script-overview .rule-body p {
  margin: 0;
  line-height: inherit;
}
.script-detail-bindings {
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0 0;
}
.script-create-controls {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}
.script-settings-card {
  padding: 0 16px;
  background: color-mix(in srgb, var(--paper) 35%, transparent);
  border: 1px solid var(--line);
  border-radius: 0;
}
body[data-ui-surface] .script-settings-card > .creation-choice {
  --ui-button-height:56px;
  margin: 0;
  padding: 14px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: left;
  font-size: 14px;
}
.script-settings-card .script-group-value {
  padding-right: 14px;
  flex: 1;
  min-width: 0;
  text-align: right;
  color: var(--muted);
  overflow-wrap: anywhere;
  font-size: 13px;
}
.script-start-settings {
  margin: 0;
  border-top: 1px solid var(--line);
}
.script-start-settings .script-beauty-switch {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 12px;
  min-height: 48px;
  padding: 12px 0;
  margin: 0;
  border: 0;
  font-size: 14px;
}
.script-start-settings .script-beauty-switch input {
  appearance: none;
  flex: none;
  width: 38px;
  height: 22px;
  border-radius: 15px;
  background: #cbd0c5;
  border: 1px solid #cbd0c5;
  position: relative;
  padding: 0;
  margin: 0;
  cursor: pointer;
}
.script-start-settings .script-beauty-switch input:before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  background: #fffdf5;
  border-radius: 50%;
  left: 2px;
  top: 2px;
  transition: transform .15s;
}
.script-start-settings .script-beauty-switch input:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.script-start-settings .script-beauty-switch input:checked:before {
  transform: translateX(16px);
}
.script-start-settings .script-beauty-switch input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.script-rename-copy {
  display: contents;
}
.script-rename-copy > span {
  grid-column: 1;
  grid-row: 1;
}
.script-start-settings .script-beauty-switch input {
  grid-column: 2;
  grid-row: 1;
}
.script-rename-copy > .hint {
  grid-column: 1/-1;
  grid-row: 2;
  display: block;
  margin: 0;
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
}
.script-style-picker {
  border-top: 1px solid var(--line);
  margin: 0;
}
.script-style-picker.carrier-dropdown > summary {
  padding: 14px 0;
  min-height: 50px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
}
.script-style-picker :is([data-script-style-label], [data-script-image-label], [data-script-tone-label]) {
  padding-right: 14px;
  flex: 1;
  min-width: 0;
  text-align: right;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 13px;
}
.script-style-picker .carrier-dropdown-panel {
  top: calc(100% + 2px);
  padding: 4px;
  border-radius: 0;
  z-index: 35;
}
.script-style-picker.opens-up .carrier-dropdown-panel {
  top: auto;
  bottom: calc(100% + 4px);
}
.script-style-options {
  max-height: min(300px, 42dvh);
  overflow: auto;
  overscroll-behavior: contain;
}
body[data-ui-surface] .script-style-options > button.ui-button {
  --ui-button-height:42px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: left;
  font-size: 13px;
}
.script-style-options > button[aria-pressed=true] {
  background: var(--soft);
  color: var(--accent);
}
.script-style-options > button:not([aria-pressed=true]) .script-style-check {
  visibility: hidden;
}
.script-start-settings > select[hidden] {
  display: none !important;
}
.script-create-controls > .form-footer {
  margin: 0;
  padding: 0;
  gap: 8px;
}
.script-create-controls > .script-create-actions {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--glass,var(--paper));
  backdrop-filter: blur(14px);
}
.script-create-action-inner {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
  max-width: 560px;
  margin: auto;
}
body[data-ui-surface] .script-create-action-inner > .primary.ui-button {
  --ui-button-height:46px;
  flex: 1;
  border-radius: 0;
  font-weight: 600;
}
.script-create-action-inner > .quiet {
  flex: none;
  font-size: 12px;
}
@media (min-width: 761px) {
  .script-create-controls > .script-create-actions {
    left: var(--desktop-side,204px);
  }
}
.bindings-editor .binding-section > summary {
  display: flex;
  align-items: center;
  gap: var(--ui-gap);
  padding-block: var(--ui-gap);
}
.binding-heading-copy {
  flex: 1;
  min-width: 0;
}
.binding-heading-line {
  display: flex;
  align-items: center;
  gap: 4px;
}
.bindings-editor .binding-section > summary .binding-heading-line > .binding-selected {
  display: inline-flex;
  margin: 0;
  white-space: nowrap;
}
.binding-kind-hint {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
}
.bindings-editor .binding-chevron {
  margin-left: auto;
  flex: none;
}
body[data-ui-surface] .script-create-action-inner > button {
  min-width: 0;
  width: auto;
  margin: 0;
}
body[data-ui-surface] .script-create-action-inner > .quiet.ui-button {
  flex: 0 0 auto;
  width: auto;
  padding-inline: 8px;
}
body[data-ui-surface] .script-create-action-inner > .primary.ui-button {
  flex: 1 1 0;
  width: auto;
  white-space: normal;
}
.script-image-extra {
  border-top: 1px solid var(--line);
}
.script-image-extra:empty {
  display: none;
}
.script-image-extra > .field {
  margin: 0;
  padding: 12px 0;
}
.script-image-extra > .field > label {
  font-size: 12px;
  margin-bottom: 6px;
  color: var(--muted);
}
.script-image-extra > .form-footer {
  margin: 0;
  padding: 0 0 8px;
}
.script-image-extra select {
  border-radius: 0;
  background: transparent;
}
.script-image-extra > .form-footer {
  display: inline-flex;
  width: 50%;
  vertical-align: top;
}
.script-image-extra > .form-footer > button {
  width: 100%;
}
body[data-ui-surface] #sheet:has([data-form=review-style-entry]) > .sheet-head {
  grid-template-columns: 44px minmax(0, 1fr) 44px;
}
body[data-ui-surface] #sheet:has([data-form=review-style-entry]) > .sheet-head > [data-action=review-style-delete] {
  width: auto;
  min-width: 44px;
  margin: 0;
  padding: 4px 0;
  font-size: 12px;
  justify-self: end;
}
body[data-page=group] [data-action=group-delete] ,body .group-choice-scope [data-action=group-delete]{
  margin-top: 8px;
}
body[data-page=archive-reader] .archive-chapters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
body[data-page=archive-reader] .archive-saved-frame {
  display: block;
  width: 100%;
  height: 70dvh;
  border: 0;
  background: var(--paper);
}
body[data-page=archive-reader] .archive-saved-image {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 8px auto;
}
body[data-page=archives] .line-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
body[data-page=archives] .line-item small {
  color: var(--muted);
  font-size: 11px;
}
.script-image-extra.script-advanced-entry {
  display: flex;
  justify-content: stretch;
}
body[data-ui-surface] .script-advanced-entry > .ui-button {
  width: 100%;
  margin: 0;
}
.script-create-action-inner {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: var(--ui-gap);
}
body[data-ui-surface] .script-create-action-inner > .ui-button {
  width: 100%;
  margin: 0;
  padding: 3px 12px;
  font-size: 13px;
  font-weight: 400;
  border-radius: var(--ui-control-radius);
}
body[data-ui-surface] .script-create-action-inner > .primary.ui-button {
  --ui-button-height:inherit;
  width: 100%;
  font-weight: 400;
  border-radius: var(--ui-control-radius);
}
body[data-ui-surface] .script-create-action-inner > .quiet.ui-button {
  width: 100%;
  font-size: 13px;
}
.script-advanced-settings > .field {
  margin-bottom: var(--ui-gap);
}
.script-overview {
  gap: 10px;
}
.script-overview > .rule-detail-cover {
  width: 96px;
  height: 128px;
}
.script-overview .rule-body {
  margin-top: 8px;
}
.script-create-controls {
  gap: 8px;
  margin-top: 12px;
}
body[data-ui-surface] .script-settings-card > .creation-choice {
  --ui-button-height:42px;
  min-height: 42px;
  padding: 10px 0;
}
.script-start-settings .script-beauty-switch {
  min-height: 42px;
  padding: 8px 0;
}
.script-style-picker.carrier-dropdown > summary {
  min-height: 42px;
  padding: 10px 0;
}
.script-settings-card > .field { margin: 0; gap: 4px; }
.script-settings-card > .check-row { min-height: 34px; padding: 6px 0; }
.script-detail-layout {
  padding-bottom: 68px;
}
.script-advanced-settings {
  margin: 0 0 var(--ui-gap);
}
.creation-components [data-creation-components-label] {
  flex: 1;
  min-width: 0;
  text-align: right;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 13px;
}
.creation-components .carrier-dropdown-panel .hint,
.creation-components .danger-text {
  margin: 6px 8px;
}
.setting-sync-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 6px 0 12px;
  color: var(--muted);
  font-size: 13px;
}
.setting-sync-toolbar button {
  flex-shrink: 0;
}
.setting-sync-row {
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
}
.setting-sync-row > summary {
  cursor: pointer;
}
.setting-sync-row summary .check-row {
  margin: 0;
}
.setting-sync-row small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.setting-sync-compare {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 8px;
}
.setting-sync-compare > details {
  min-width: 0;
}
.setting-sync-compare summary {
  text-align: center;
  margin-bottom: 6px;
}
.setting-sync-review .field,
.setting-sync-confirm .field {
  margin-bottom: 10px;
}
.setting-sync-review textarea,
.setting-sync-confirm textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  white-space: pre-wrap;
}
.setting-sync-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}
.setting-sync-actions button {
  flex: 1 1 40%;
  white-space: normal;
}
.setting-sync-review .check-row {
  align-items: flex-start;
}
.setting-sync-extra textarea {
  width: 100%;
  box-sizing: border-box;
}
.setting-sync-review {
  min-width: 0;
}
.setting-sync-confirm {
  min-width: 0;
}
@media (min-width: 761px) {
  .setting-sync-compare {
    grid-template-columns: 1fr 1fr;
  }
}
.setting-sync-review textarea,
.setting-sync-confirm textarea {
  height: 132px;
  min-height: 96px;
}
.setting-sync-review .setting-sync-actions {
  position: sticky;
  bottom: 0;
  background: var(--paper);
  padding: 8px 0;
  margin-bottom: 0;
}
.setting-sync-review input[readonly],
.setting-sync-confirm input[readonly] {
  width: 100%;
  box-sizing: border-box;
}
body #sheet .cover-file-row {
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}
body #sheet .cover-file-row [hidden] {
  display: none !important;
}
body #sheet .cover-file-row [data-cover-name] {
  flex-basis: 100%;
  order: 2;
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}
body #sheet.book-cover-panel .book-cover-workspace :is(input:not([type=file]), textarea, [data-action=cover-pick], [data-action=cover-model]) {
  border: 1px solid color-mix(in srgb, var(--ink) 32%, transparent);
}
body #sheet.book-cover-panel .book-cover-workspace [data-action=cover-remove] {
  color: var(--muted);
  border: 1px solid color-mix(in srgb, var(--ink) 32%, transparent);
  background: transparent;
}
.script-overview > .rule-detail-cover {
  width: 128px;
  height: 170.67px;
}
.script-overview .rule-body {
  min-height: 96px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--ink) 32%, transparent);
  background: transparent;
  box-sizing: border-box;
}
.quick-import-file-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.quick-import-file-actions button {
  height: auto;
  min-height: var(--ui-button-height);
  padding: 5px 10px;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
}
.quick-import-batch {
  display: block;
}
.quick-import-batch > .row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  margin-top: 8px;
}
.quick-import-batch > .row > button {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.quick-import-batch > .row > button svg {
  width: 16px;
  height: 16px;
  flex: none;
}
@media (max-width: 760px) {
  .quick-import-file-actions {
    grid-template-columns: minmax(0, 1fr);
  }
}
.current-setting-person-fields {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  margin-bottom: 12px;
  gap: 10px;
}
.current-setting-person-fields textarea.ui-input {
  height: var(--ui-control-height);
  min-height: var(--ui-control-height);
  padding: 5px 10px;
  font-size: 13px;
  line-height: 1.4;
  resize: none;
}
.setting-person-merge-editor {
  position: relative;
}
.setting-person-merge-editor textarea[data-setting-content] {
  padding-top: 46px;
}
.setting-person-merge-editor .setting-person-merge-bar {
  position: absolute;
  z-index: 1;
  top: 8px;
  left: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin: 0;
  background: var(--paper);
}
.setting-person-merge-bar .hint {
  margin: 0;
}
.setting-person-merge-bar button {
  flex: none;
}
.current-setting-person-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  margin: 0 0 var(--ui-gap);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}
.current-setting-person-card > label.check-row {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  min-width: 0;
}
.current-setting-person-card .binding-excerpt {
  font-size: 11px !important;
  line-height: 1.4;
  color: var(--muted);
}
body[data-night=true] .current-setting-person-card {
  background: #252525;
}
body[data-night=true] .current-setting-person-card .binding-excerpt {
  color: #7d7d7d;
}
.current-setting-person-card > .setting-cast-role {
  display: block;
  min-width: 0;
  margin: 0;
  width: 60px;
  align-self: start;
}
.current-setting-person-card .group-cast-caption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
body[data-ui-surface=reading] .current-setting-person-card .setting-cast-role :is(select.ui-input, .ui-select) {
  width: 60px;
  height: 22px !important;
  min-height: 22px !important;
  font-size: 11px !important;
  padding: 1px 4px;
  line-height: 1.2;
  border-radius: 4px;
}
.bindings-editor[data-for-rule=false] .current-setting-edit > summary {
  padding-block: 4px;
}
.bindings-editor[data-for-rule=false] .current-setting-edit > .field:has([data-setting-name]) {
  margin-block: 4px 2px;
}
.bindings-editor[data-for-rule=false] .current-setting-edit .current-setting-person-fields {
  margin-block: 0 6px;
  gap: 8px;
}
.bindings-editor[data-for-rule=false] .current-setting-edit .current-setting-person-fields > .field {
  margin-block: 0;
}
.bindings-editor[data-for-rule=false] .current-setting-edit :is(.current-setting-person-fields > .field, .field:has([data-setting-name])) > label {
  margin-bottom: 4px;
}
.bindings-editor[data-for-rule=false] .binding-group {
  margin-bottom: 6px;
}
.bindings-editor[data-for-rule=false] .binding-group > .hint {
  margin-top: 4px;
}
.bindings-editor[data-for-rule=false] .binding-section > summary {
  padding-block: 6px;
}
.bindings-editor[data-for-rule=false] .binding-kind-hint {
  margin-top: 0;
  line-height: 1.3;
}
body[data-page=role-chat] #app .chat-preview-compose > [data-role-chat-references] {
  max-height: 38dvh;
  overflow-y: auto;
  flex: none;
}
body[data-page=role-chat] #app .chat-preview-compose > [data-role-chat-references] .chat-preview-reference {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}
body[data-page=role-chat] #app .chat-preview-reference .reference-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
body[data-page=role-chat] #app .chat-preview-reference .reference-head .reference-title {
  flex: 1;
  min-width: 0;
  text-align: left;
  font-size: 12px;
}
body[data-page=role-chat] #app .chat-preview-reference .reference-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
}
body[data-page=role-chat] #app .chat-preview-reference .reference-actions button {
  white-space: nowrap;
}
body[data-page=role-chat] #app .chat-preview-reference .reference-actions .reference-remove {
  width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
  border: 0;
  background: transparent;
  box-shadow: none;
}
body[data-page=role-chat] #app .chat-preview-compose > [data-role-chat-references] .reference-excerpt {
  max-height: 7.2em;
  overflow: auto;
  margin: 0;
}
.role-quote-original {
  -webkit-user-select: text;
  user-select: text;
  touch-action: auto;
  pointer-events: auto;
}
.bindings-editor[data-for-rule=false] .current-setting-edit :is(.current-setting-person-fields > .field, .field:has([data-setting-name])) {
  gap: 4px;
}
.bindings-editor[data-for-rule=false] .current-setting-edit :is(.current-setting-person-fields > .field, .field:has([data-setting-name])) > label {
  margin: 0;
  line-height: 16px;
}
body[data-page=role-chat] #app .chat-preview-reference .reference-head .reference-title {
  font-size: 14px;
  line-height: 1.4;
}
body[data-page=role-chat] #app .chat-preview-reference .reference-actions {
  gap: 16px;
}
body[data-page=role-chat] #app .chat-preview-compose > [data-role-chat-references] .chat-preview-reference .reference-actions button {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding-inline: 2px;
}
body[data-page=role-chat] #app .chat-preview-reference .reference-actions [data-action=role-chat-source] {
  text-decoration: underline;
  text-underline-offset: 3px;
}
body[data-page=role-chat] #app .chat-preview-reference .reference-actions .reference-remove {
  padding: 0;
}
body[data-page=role-chat] #app .chat-preview-compose > [data-role-chat-references] .reference-excerpt {
  line-height: 1.35;
  max-height: 8.1em;
}
body[data-page=role-chat] #app .chat-preview-reference .reference-head .reference-title {
  font-size: 15px;
  line-height: 1.4;
}
body[data-page=role-chat] #app .chat-preview-compose > [data-role-chat-references] .reference-excerpt {
  font-size: 12px;
  line-height: 1.55;
  max-height: 9.3em;
}
body[data-page=role-chat] #app .chat-preview-reference .reference-identity {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
  flex: 1;
}
body[data-page=role-chat] #app .chat-preview-compose > [data-role-chat-references] .chat-preview-reference .reference-toggle {
  flex: none;
  width: 20px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: 12px;
  line-height: 1;
  color: inherit;
}
body[data-page=role-chat] #app .chat-preview-reference .reference-excerpt[hidden] {
  display: none !important;
}
@media (max-width: 760px) {
  body[data-page=role-chat] #app .chat-preview-input-box {
    --role-compose-control-line:color-mix(in srgb,var(--ink) 32%,transparent);
  }
  body[data-page=role-chat] #app .role-chat-compose-mobile-left [data-role-chat-ui=more] svg {
    padding: 5px;
    border-color: var(--role-compose-control-line);
  }
  body[data-page=role-chat] #app .role-chat-compose-field {
    border-color: var(--role-compose-control-line);
  }
  body[data-page=role-chat] #app .chat-preview-send {
    border: 1px solid var(--role-compose-control-line);
  }
}
body[data-page=role-chat] #app .chat-preview-reference[data-reference-folded=true] .reference-title small {
  display: none;
}
@media (max-width: 760px) {
  body[data-page=role-chat] #app .chat-preview-send {
    top: 2px;
    bottom: 2px;
    height: 32px !important;
    min-height: 32px;
    line-height: 32px;
  }
}
body[data-page=role-chat] #app [data-role-chat-loading] .cw-typing {
  width: max-content !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  padding: 5px 9px !important;
  line-height: 1.5 !important;
}
body[data-page=role-chat] #app .private-reply-progress {
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
  gap: 3px;
  font-family: inherit;
}
body[data-page=role-chat] #app .private-reply-dots {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
}
body[data-page=role-chat] #app .private-reply-dots .cw-dot {
  display: inline-block;
  flex: none;
  width: auto;
  height: auto;
  background: none;
  border-radius: 0;
  font: inherit;
  animation: private-chat-dot 1.2s infinite ease-in-out;
}
body[data-page=role-chat] #app .private-reply-dots .cw-dot:nth-child(2) {
  animation-delay: .16s;
}
body[data-page=role-chat] #app .private-reply-dots .cw-dot:nth-child(3) {
  animation-delay: .32s;
}
.person-tools .field {
  margin-block: 8px 12px;
}
.person-tools .form-footer {
  margin-block: 10px;
}
.person-tools textarea {
  min-height: 0;
  field-sizing: fixed;
}
.person-tools textarea[name=personToolInput] {
  height: 88px;
}
.person-tool-row {
  margin-block: 16px;
}
.person-tool-row .section-head {
  margin: 0 0 8px;
  align-items: center;
}
.person-tool-row .section-head h3 {
  margin: 0;
  font-size: inherit;
}
.person-tool-row textarea {
  height: auto;
}
.person-tools .hint {
  margin-block: 8px;
}
.person-tools-appearance .field {
  margin-block: 0 8px;
}
.person-tools-appearance textarea[name=personToolInput] {
  height: 64px;
}
.person-tools-appearance .person-tool-row textarea {
  height: 72px;
}
.person-tools-appearance .person-tool-row {
  margin-block: 12px;
}
.person-tools-appearance .section-head {
  margin-bottom: 6px;
}
.person-tools-appearance .form-footer {
  margin-block: 8px;
}
.person-tools-appearance [data-person-tool-status]:empty {
  display: none;
}
.person-tools .field {
  gap: 2px;
}
.person-tools .field > label {
  margin-bottom: 0;
}
.person-tools .person-tool-row .section-head {
  margin-bottom: 2px;
  align-items: baseline;
  gap: 8px;
}
.person-tools .person-tool-row .section-head h3 {
  line-height: 1.4;
}
.person-tools .person-tool-favorite {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 2px;
  line-height: 1.4;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}
.person-tools .person-tool-favorite svg {
  width: 14px;
  height: 14px;
  flex: none;
}
.person-tools .person-tool-row > details {
  margin-bottom: 8px;
}
.person-tools .person-tool-row .section-head + .field {
  margin-top: 0;
}
.person-tools-appearance .person-tool-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.person-tools .person-tool-row .section-head h3 {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}
body[data-ui-surface] .person-tools button.person-tool-favorite {
  height: auto !important;
  min-height: 0 !important;
  padding-block: 0 !important;
  font-size: 12px;
  line-height: 1.6;
}
.person-tools .person-tool-row {
  margin-block: 8px;
}
.person-tools .person-tool-row .section-head + .field {
  margin-bottom: 0;
}
.person-tools .person-tool-row .section-head {
  align-items: center;
}
.person-tool-season {
  margin-bottom: 12px;
}
.person-tool-season > h3 {
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 4px;
}
.person-tools .person-tool-season .field {
  margin-block: 0 8px;
}
.person-tool-season textarea {
  height: 72px;
}
body #sheet.ui-panel:has(.person-tool-season) {
  width: min(640px, calc(100vw - 36px)) !important;
  height: fit-content !important;
  min-height: 0 !important;
  max-height: calc(100dvh - 36px) !important;
  inset: 0 !important;
  margin: auto !important;
  border: 1px solid var(--line) !important;
  border-radius: 10px !important;
  padding: 0 !important;
}
body #sheet.ui-panel:has(.person-tool-season) .sheet-body {
  flex: 0 1 auto;
  max-height: calc(100dvh - 110px);
  padding: 14px 18px 18px;
  overflow-y: auto;
}
.person-ending-preview .person-tool-season {
  margin: 0 0 10px;
}
.person-tools.person-ending-preview .field {
  margin: 0 0 10px;
  gap: 2px;
}
.person-tools.person-ending-preview #season-request {
  height: 56px;
}
.person-tools.person-ending-preview textarea[name=personToolInput] {
  height: 36px;
  resize: vertical;
  line-height: 1.4;
}
.person-tools.person-ending-preview .person-ending-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 0;
}
.person-ending-preview [data-person-tool-status]:empty {
  display: none;
}
#sheet:has(.person-ending-preview) .sheet-head > button {
  grid-column: 3;
  grid-row: 1;
  font-size: 24px;
  color: var(--muted);
}
#sheet:has(.person-ending-preview) .sheet-head > h2 {
  grid-column: 2;
  grid-row: 1;
}
#sheet:has(.person-ending-preview) .sheet-head > span {
  grid-column: 1;
  grid-row: 1;
}
.person-tools.person-ending-preview #season-request {
  height: 72px;
}
.person-tools.person-ending-preview textarea[name=personToolInput] {
  height: 44px;
}
@media (max-width: 760px) {
  .person-tools.person-ending-preview #season-request {
    height: 64px;
  }
  .person-tools.person-ending-preview textarea[name=personToolInput] {
    height: 40px;
  }
}
body #sheet.ui-panel:has(.person-ending-review) {
  width: min(560px, calc(100vw - 28px)) !important;
  height: fit-content !important;
  min-height: 0 !important;
  max-height: calc(100dvh - 28px) !important;
  inset: 0 !important;
  margin: auto !important;
  border: 1px solid var(--line) !important;
  border-radius: 10px !important;
  padding: 0 !important;
}
body #sheet.ui-panel:has(.person-ending-review) .sheet-body {
  flex: 0 1 auto;
  max-height: calc(100dvh - 100px);
  padding: 14px 16px 16px;
  overflow-y: auto;
}
.person-ending-review .npc-book {
  position: relative;
  padding: 16px 16px 0 22px;
  border: 1px solid var(--line);
  background:
    linear-gradient(
      90deg,
      #d4cbbf20,
      transparent 14px),
    var(--paper);
  box-shadow: 2px 3px 0 var(--bg), 3px 4px 0 var(--line);
  border-radius: 2px;
}
.person-ending-review .npc-book:before {
  content: "";
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  border-left: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
}
.npc-book-heading {
  text-align: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}
.npc-book-heading > span {
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--muted);
}
.npc-book-heading > h3 {
  font-size: 17px;
  line-height: 1.5;
  margin-top: 3px;
  letter-spacing: 2px;
}
.person-ending-review .person-tool-row {
  margin: 0;
}
.person-ending-review .person-tool-row .section-head {
  display: none;
}
.person-ending-review .person-tool-row textarea {
  height: 252px;
  font-size: 13px;
  line-height: 25px;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background:
    repeating-linear-gradient(
      transparent 0,
      transparent 24px,
      color-mix(in srgb, var(--line) 45%, transparent) 24px,
      color-mix(in srgb, var(--line) 45%, transparent) 25px);
  resize: vertical;
}
.person-ending-review .person-tool-row > details {
  font-size: 11px;
  text-align: right;
  margin: 0 0 6px;
}
.person-ending-review details .prose {
  text-align: left;
  font-size: 13px;
}
.person-ending-review .person-tool-row .field:has(select) {
  margin-top: 8px;
}
.npc-book-turns {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  margin-top: 10px;
  padding: 6px 0;
  font-size: 11px;
  color: var(--muted);
}
.person-tools .npc-book-turns button {
  font-size: 12px;
}
.person-ending-review .person-ending-actions {
  margin-top: 14px;
}
body[data-page=shelf] .top > .shelf-import-icon {
  position: absolute;
  left: 18px;
  top: 8px;
  width: 32px;
  height: 32px;
  min-height: 32px;
  margin: 0;
  padding: 5px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
}
body[data-page=shelf] .shelf-import-icon svg {
  width: 20px;
  height: 20px;
}
@media (min-width: 761px) {
  body[data-page=shelf] .top > .shelf-import-icon {
    left: 40px;
    top: 22px;
  }
  body[data-page=shelf] .top:has(> .shelf-import-icon) > .shelf-tabs {
    margin-left: 44px;
    max-width: calc(100% - 194px);
  }
  body[data-page=shelf] #app > .top.top-menu-only:has(> .shelf-import-icon) > .top-section-title {
    display: none !important;
  }
}
body[data-page=shelf] .shelf-book-toolbar {
  margin-bottom: 8px;
}
body[data-page=shelf] .shelf-book-toolbar > .ui-search {
  margin-bottom: 0;
}
#sheet .current-settings-overview .bindings-scroll {
  padding-top: 0;
}
#sheet .current-settings-overview .binding-group {
  margin-block: 0 8px;
}
#sheet .current-settings-overview .current-setting-group {
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
}
#sheet .current-settings-overview .current-setting-group > summary {
  padding-block: 8px;
  font-size: 12px;
  text-align: left;
}
#sheet .current-settings-overview .binding-section > summary {
  padding-block: 6px;
}
#sheet .current-settings-overview .binding-section {
  border-bottom: 1px solid var(--line);
}
#sheet .current-settings-overview .binding-choices {
  padding: 0 0 4px;
}
#sheet .current-settings-overview .binding-npc-section {
  margin: 0;
}
#sheet .current-settings-overview .binding-npc-section > summary {
  padding-block: 4px;
  font-size: 12px;
  gap: 0;
}
#sheet .current-settings-overview .binding-npc-section > summary > .ui-disclosure-arrow {
  margin: 0 6px 0 0;
}
#sheet .current-settings-overview .binding-npc-section > summary span:not(.ui-disclosure-arrow) {
  margin-left: 0;
}
#sheet .current-settings-overview .binding-heading-line {
  gap: 0;
}
#sheet .current-settings-overview .binding-section-title {
  font-size: 14px;
}
#sheet .current-settings-overview .binding-selected {
  font-size: 12px;
}
#sheet .current-settings-overview .current-setting-person-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0 8px;
  padding: 5px 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
#sheet .current-settings-overview .current-setting-person-card > .check-row {
  grid-column: 1;
  grid-row: 1/3;
  padding: 0;
  margin: 0;
  min-height: 0;
  border: 0;
  background: transparent;
  align-items: center;
  align-self: stretch;
  gap: 8px;
}
#sheet .current-settings-overview .check-row input[type=checkbox] {
  margin: 0;
  align-self: center;
}
#sheet .current-settings-overview .binding-choice-copy strong {
  font-size: 14px;
  line-height: 1.4;
}
#sheet .current-settings-overview .group-person-cast {
  grid-column: 2;
  grid-row: 2;
  margin: 0;
  justify-self: end;
  align-self: center;
}
#sheet .current-settings-overview .group-person-cast select {
  height: 22px;
  min-height: 22px;
  font-size: 11px;
}
#sheet .current-settings-overview .current-setting-edit-button {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  margin: 0;
  padding: 0 2px;
  height: 22px;
  min-height: 22px;
  font-size: 11px;
  line-height: 1;
  text-decoration: none;
  border: 0;
  background: transparent;
}
#sheet .current-settings-overview .current-setting-edit-button svg {
  width: 12px;
  height: 12px;
  flex: none;
}
#sheet .current-settings-overview .current-setting-edit-button span {
  font-size: inherit;
}
#sheet .current-settings-overview [data-action=binding-npc-local] {
  grid-column: 2;
  grid-row: 3;
  margin: 0;
}
#sheet .current-settings-overview .binding-excerpt {
  -webkit-line-clamp: 2;
  font-size: 11px;
  line-height: 1.4;
  margin-top: 2px;
}
#sheet .current-settings-overview .current-setting-choice {
  display: flex;
  gap: 8px;
  align-items: center;
}
#sheet .current-settings-overview .current-setting-choice > .check-row {
  flex: 1;
  margin: 0;
  padding: 5px 0;
  min-height: 32px;
  border: 0;
  gap: 8px;
  align-items: center;
  font-size: 14px;
}
#sheet .current-settings-overview .current-setting-save-actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}
#sheet .current-settings-overview .current-setting-save-actions > [data-setting-sync=review] {
  font-size: 12px;
  padding-inline: 0;
}
#sheet .current-settings-overview [data-current-setting][hidden],
#sheet .current-settings-overview .current-setting-edit[hidden] {
  display: none !important;
}
.setting-detail-dialog.ui-panel {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(640px, calc(100vw - 24px));
  height: auto;
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--ui-radius,5px);
  background: var(--paper);
  color: var(--ink);
  overflow: hidden;
}
.setting-detail-dialog.ui-panel[open] {
  display: flex;
  flex-direction: column;
}
.setting-detail-dialog .sheet-head {
  flex: none;
  min-height: 48px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  align-items: center;
}
.setting-detail-dialog .sheet-head h2 {
  grid-column: 2;
  grid-row: 1;
  text-align: center;
  font-size: 16px;
  margin: 0;
}
.setting-detail-dialog .sheet-head button {
  grid-column: 3;
  grid-row: 1;
  padding: 0;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 20px;
}
.setting-detail-dialog .sheet-body {
  min-height: 0;
  overflow: auto;
  padding: 12px;
  flex: 1;
}
.setting-detail-dialog .ui-panel-footer {
  flex: none;
  padding: 10px 12px;
  margin: 0;
  border-top: 1px solid var(--line);
  background: var(--paper);
  display: flex;
  gap: 8px;
}
.setting-detail-dialog .ui-panel-footer > button {
  flex: 1;
}
.setting-detail-dialog .field {
  margin: 0 0 10px;
  min-width: 0;
}
.setting-detail-dialog .field > label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.setting-detail-dialog :is(input:not([type=checkbox]), textarea, select) {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.setting-detail-dialog textarea {
  resize: vertical;
  min-height: 84px;
}
.setting-detail-dialog .current-setting-person-fields {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 8px;
}
.setting-detail-dialog .setting-sync-compare {
  display: block;
  margin: 0;
}
.setting-detail-dialog .setting-sync-compare > details {
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 0;
  margin: 0 0 8px;
}
.setting-detail-dialog .setting-sync-compare summary {
  text-align: left;
  padding-block: 8px;
  margin: 0;
}
.setting-detail-dialog .setting-sync-list {
  display: grid;
}
.setting-detail-dialog .setting-sync-list > .menu-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
}
.setting-detail-dialog .setting-sync-list strong {
  font-size: 14px;
  font-weight: 500;
}
.setting-detail-dialog .setting-sync-list small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}
.setting-detail-dialog .setting-sync-actions {
  position: static;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.setting-detail-dialog .setting-sync-actions button {
  font-size: 12px;
  padding: 6px;
  white-space: normal;
}
.setting-detail-dialog .hint {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 10px;
}
.setting-person-merge-editor textarea[data-setting-content] {
  padding-top: calc(var(--ai-help-inset) + var(--ai-help-line));
}
.setting-person-merge-editor [data-person-sync-status] {
  position: absolute;
  right: 4px;
  top: 3px;
  font-size: 10px;
  margin: 0;
}
.setting-detail-dialog [data-setting-content] {
  min-height: 180px;
}
body[data-ui-surface] #setting-detail-dialog.ui-panel {
  width: min(640px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  height: fit-content;
  min-height: 0;
  max-height: calc(100dvh - 40px);
  inset: 0;
  margin: auto;
  border-radius: var(--ui-control-radius,5px);
}
body[data-ui-surface] #setting-detail-dialog > .sheet-body {
  padding: 12px;
  flex: 0 1 auto;
}
body[data-ui-surface] #setting-detail-dialog .field {
  margin: 0 0 var(--ui-gap,8px);
  gap: 2px;
}
body[data-ui-surface] #setting-detail-dialog .field > label {
  margin: 0;
  padding: 0;
}
body[data-ui-surface] #setting-detail-dialog [data-setting-content] {
  height: 180px;
  min-height: 120px;
  max-height: none;
}
body[data-ui-surface] #setting-detail-dialog [data-sync-field]:not(.ui-input) {
  height: 84px;
  min-height: 60px;
}
body[data-ui-surface] #setting-detail-dialog .current-setting-person-fields .ui-input {
  height: var(--ui-control-height);
  min-height: var(--ui-control-height);
}
body[data-ui-surface] #setting-detail-dialog .setting-sync-actions {
  display: grid;
  grid-auto-flow: row;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: auto;
}
body[data-ui-surface] #setting-detail-dialog [data-declaration-draft] {
  height: 160px;
  min-height: 100px;
}
#setting-detail-dialog .setting-sync-compact {
  display: grid;
  gap: 0;
}
#setting-detail-dialog .setting-sync-section-head,
#setting-detail-dialog .setting-sync-local-tools,
#setting-detail-dialog .setting-sync-original {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ui-gap,8px);
}
#setting-detail-dialog .setting-sync-section-head h3 {
  font-size: var(--ui-label-size,12px);
  font-weight: 400;
  color: var(--muted);
  margin: 0;
}
#setting-detail-dialog .setting-sync-compact button {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding-inline: 4px;
  white-space: nowrap;
  font-size: 12px;
}
#setting-detail-dialog .setting-sync-compact button svg {
  width: 14px;
  height: 14px;
  flex: none;
}
#setting-detail-dialog .setting-sync-current-text {
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 4px 0 14px;
}
#setting-detail-dialog .setting-sync-compact details {
  min-width: 0;
  border: 0;
  margin: 0;
  padding: 0;
  flex: 1;
}
#setting-detail-dialog .setting-sync-compact summary {
  font-size: 12px;
  line-height: 20px;
  text-align: left;
  margin: 0;
  padding: 8px 0 0;
}
#setting-detail-dialog .setting-sync-original {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  align-items: flex-start;
}
#setting-detail-dialog .setting-sync-local-tools,
#setting-detail-dialog .setting-sync-original {
  display: block;
  position: relative;
}
#setting-detail-dialog .setting-sync-local-tools > button,
#setting-detail-dialog .setting-sync-original > button {
  position: absolute;
  right: 0;
  top: 0;
}
#setting-detail-dialog .setting-sync-original > button {
  top: 10px;
}
#setting-detail-dialog .setting-sync-local-tools > details > summary,
#setting-detail-dialog .setting-sync-original > details > summary {
  padding-right: 140px;
}
#setting-detail-dialog .setting-sync-values {
  display: grid;
  gap: var(--ui-gap,8px);
  margin: 4px 0 8px;
}
#setting-detail-dialog .setting-sync-values dt {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 2px;
}
#setting-detail-dialog .setting-sync-values dd {
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
body[data-ui-surface] #setting-detail-dialog .sheet-body > form {
  padding-top: 0;
}
body[data-ui-surface] #setting-detail-dialog .current-setting-person-fields {
  margin: 0;
}
body[data-ui-surface] #setting-detail-dialog [data-edit-status]:empty {
  display: none;
}
body[data-ui-surface] #setting-detail-dialog .field > .ui-text-editor {
  margin: 0;
}
body[data-ui-surface] #sheet .current-settings-overview button.quiet[data-setting-sync]:not(:disabled),
body[data-ui-surface] #setting-detail-dialog button.quiet[data-setting-sync]:not(:disabled),
body[data-ui-surface] #sheet .current-settings-overview button.quiet[data-setting-sync]:not(:disabled) > span,
body[data-ui-surface] #setting-detail-dialog button.quiet[data-setting-sync]:not(:disabled) > span {
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  text-decoration-skip-ink: auto;
}
body[data-ui-surface] #setting-detail-dialog > .sheet-body:has(> .setting-sync-compact) {
  padding-bottom: 0;
}
#setting-detail-dialog .setting-sync-local-tools > button,
#setting-detail-dialog .setting-sync-original > button {
  height: 28px;
  min-height: 28px;
  box-sizing: border-box;
  padding: 8px 4px 0;
  border: 0;
  line-height: 20px;
  align-items: flex-end;
}
body[data-ui-surface][data-page=reader] .reader-tools.four-tools > button {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}
.chapter-entry.has-sections {
  display: flex;
  align-items: center;
}
.chapter-entry.has-sections > .chapter-link {
  flex: 1;
  min-width: 0;
  width: auto;
}
.chapter-entry > .chapter-sections-toggle {
  flex: 0 0 44px;
  width: 44px;
  min-height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font: inherit;
}
.chapter-sections-toggle > span {
  display: block;
}
.chapter-sections-toggle[aria-expanded=true] > span {
  transform: rotate(90deg);
}
.chapter-section-list[hidden] {
  display: none;
}
.world-set-name + .line-list .line-item {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}
.world-set-name + .line-list .line-item > span:first-child {
  flex: 1;
  min-width: 0;
}
.world-set-name + .line-list .line-item small {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  line-height: 1.5;
}
.individual-worlds .world-name-edit {
  flex: 1;
  text-align: left;
  justify-content: flex-start;
  padding: 6px 0;
}
body[data-page=library] .line-list {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.world-member-overview {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.world-member-overview h3 {
  margin: 0 0 8px;
  font-size: 16px;
}
.world-member-preview {
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-line;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  max-height: 112px;
  overflow: hidden;
  color: var(--muted);
}
.world-member-detail {
  margin-top: 6px;
  padding: 6px 0;
  font-size: 14px;
  text-align: left;
  justify-content: flex-start;
}
.world-set-overview-list {
  margin: 0;
  padding: 0;
}
.world-member-overview {
  padding: 8px 0;
}
.world-member-preview {
  white-space: normal;
  -webkit-line-clamp: 2;
  max-height: 44.8px;
}
.world-member-overview h3 {
  margin-bottom: 4px;
}
.world-member-detail {
  margin-top: 2px;
}
.world-set-members .check-row {
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
}
.world-set-members .check-content {
  min-width: 0;
  flex: 1;
}
.world-set-members .check-content small {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  max-height: 3em;
  line-height: 1.5;
  margin-top: 4px;
}
button.world-member-overview {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: left;
  padding: 10px 0;
  color: inherit;
}
.world-member-title {
  display: block;
  font-size: 16px;
  font-weight: 400;
  margin-bottom: 4px;
}
button.world-member-overview .world-member-preview {
  display: block;
  position: relative;
  max-height: none;
  height: 3.2em;
  font-size: 14px;
  line-height: 1.6;
}
.world-member-excerpt {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  padding-right: 88px;
}
button.world-member-overview .world-member-detail {
  position: absolute;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 0;
  line-height: 1.6;
  font-size: 14px;
  color: var(--ink);
}
body[data-page=role] .role-profile-setting > summary:focus:not(:focus-visible) {
  outline: none;
}
body[data-page=role] .role-profile-heading .entry-avatar,
body[data-page=library] .entry-avatar {
  border-radius: 4px;
}
body[data-page=library] .world-search-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 8px;
  align-items: center;
  margin: 8px 0;
}
body[data-page=library] .world-search-tools .ui-search,
body[data-page=library] .world-search-tools .library-search {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
}
body[data-page=library] .world-filter-toggle {
  margin: 0;
  padding: 7px 12px;
  font-size: 14px;
  line-height: 20px;
  background: transparent;
  white-space: nowrap;
}
.world-filter-options {
  grid-column: 1/-1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}
.world-filter-options[hidden] {
  display: none;
}
.world-filter-options label,
.world-type-field {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  font-size: 14px;
  min-width: 0;
}
.world-filter-options select {
  flex: 1;
  min-width: 0;
  width: auto;
  margin: 0;
  font-size: 14px;
  padding-left: 8px;
  padding-right: 20px;
  background: var(--input-bg,#fffcf5);
  color: inherit;
}
.world-type-field {
  margin-bottom: 12px;
  max-width: 320px;
}
.world-type-field select {
  flex: 1;
  margin: 0;
}
.opening-map-control {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  font-size: 14px;
}
.opening-map-control[hidden] {
  display: none;
}
.opening-map-control input {
  margin: 0;
}
.world-map-data[hidden] {
  display: none;
}
.world-map-data-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.world-map-data-title label {
  margin-right: auto;
}
.world-map-data textarea {
  width: 100%;
  box-sizing: border-box;
}
.world-map-data pre {
  white-space: pre-wrap;
}
.world-map-data .hint {
  margin: 6px 0;
}
.world-map-data > label {
  display: block;
  margin: 0 0 3px;
}
.world-map-data > .script-text-editor {
  margin: 0;
}
.world-map-data .map-format-help {
  left: 62px;
}
.world-map-data {
  margin-top: 10px;
}
dialog.ui-confirm:has([data-form=role-chat-initialize]) {
  position: fixed;
}
[data-form=role-chat-initialize] .initial-scene-close {
  position: absolute;
  right: 10px;
  top: 8px;
  border: 0;
  background: transparent;
  box-shadow: none;
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 22px;
  color: var(--muted);
}
[data-form=role-chat-initialize] .field {
  margin: 0 0 10px;
  gap: 4px;
}
[data-form=role-chat-initialize] .check-row {
  margin: 0 0 10px;
  padding: 4px 0;
  border: 0;
  min-height: 0;
}
[data-form=role-chat-initialize] .form-footer {
  margin-top: 12px;
  padding-top: 0;
}
dialog.ui-confirm:has([data-form=role-chat-initialize]) .sheet-body {
  padding: 0;
}
dialog.ui-confirm [data-form=role-chat-initialize] .initial-scene-close {
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  font-size: 22px !important;
}
body[data-page=role] [data-action=role-edit] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 1px;
  text-decoration-skip-ink: auto;
}
body[data-page=role] [data-action=role-edit]::before {
  content: "";
  display: inline-block;
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  background: currentColor;
  mask: url(./role-chat-icons/\7f16\8f91.svg) center/contain no-repeat;
  -webkit-mask: url(./role-chat-icons/\7f16\8f91.svg) center/contain no-repeat;
}
@media (min-width: 761px) {
  body[data-ui-surface] .script-list-scope .desktop-list-actions .shelf-book-add .book-button {
    background: var(--paper);
    color: var(--ink);
    border: 1px solid var(--line);
    height: var(--ui-button-height,28px);
    min-height: var(--ui-button-height,28px);
    padding: 3px 12px;
    border-radius: var(--ui-control-radius,5px);
    font-size: 13px;
    line-height: 1.4;
    box-shadow: none;
  }
  body .script-list-scope .desktop-list-actions .shelf-book-add .shelf-book-name {
    font-size: 13px;
    line-height: 1.4;
    margin: 0;
    color: inherit;
  }
}
.npc-library-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}
.npc-library-tools .library-search {
  margin: 0;
  width: 100%;
  min-width: 0;
}
.npc-library-tools select {
  width: 100%;
  min-width: 0;
}
.npc-library-group {
  margin: 0;
  border-bottom: 1px solid var(--line);
}
.npc-library-group > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  cursor: pointer;
  font-size: 15px;
}
.npc-library-group > summary:before {
  content: "\203a";
  width: 12px;
  flex: none;
}
.npc-library-group[open] > summary:before {
  transform: rotate(90deg);
}
.npc-library-group > summary small {
  font-size: 12px;
  color: var(--muted);
  margin-left: auto;
}
.npc-library-group .line-list {
  margin: 0;
}
.npc-library-group .library-entry {
  width: 100%;
  padding: 10px 0;
}
.npc-library-group .entry-copy small {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.npc-library-group[hidden],
.npc-library-group .library-entry[hidden] {
  display: none;
}
@media (min-width: 640px) {
  .npc-library-tools {
    grid-template-columns: minmax(0, 1fr) minmax(160px, 35%);
  }
}
.reader.media-theater-reader .manuscript {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}
.reader .chapter.media-theater-chapter {
  margin: 0;
  padding: 0;
  scroll-margin-top: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.media-theater-chapter > reader-photo-theater,
.media-theater-chapter > reader-voice-call {
  display: block;
  width: 100%;
}
.media-theater-chapter > reader-voice-call > .reader-phone {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.media-theater-chapter > reader-voice-call > .reader-phone:before,
.media-theater-chapter > reader-voice-call > .reader-phone:after {
  display: none;
}
.media-theater-chapter > reader-voice-call .reader-phone-screen {
  height: 100dvh;
  border-radius: 0;
}
.reader.media-theater-reader[data-controls=true] .manuscript {
  padding-inline: 0;
}
.reader .reader-controls-restore {
  display: none;
  position: absolute;
  bottom: calc(6px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 21;
  width: 48px;
  height: 32px;
  min-height: 32px;
  padding: 6px 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--glass);
  color: var(--ink);
  box-shadow: 0 2px 8px var(--shadow);
  backdrop-filter: blur(10px);
  align-items: center;
  justify-content: center;
}
.reader[data-controls=false] .reader-controls-restore {
  display: flex;
}
.reader.media-theater-reader[data-controls=false] reader-carrier .fridge {
  min-height: 100dvh;
}
body[data-page=role] .role-profile-brief.ui-input {
  height: auto;
  min-height: var(--ui-control-height,34px);
  padding: 8px 10px;
  margin-block: var(--ui-gap);
  max-height: calc(30dvh - 3 * var(--profile-brief-leading));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.6;
  font-weight: 400;
  color: var(--ink);
}
body:is([data-page=entry], [data-page=entry-advanced-page]) .review-appearances {
  margin-top: 0;
  padding-bottom: var(--ui-gap,8px);
}
body[data-page=entry-advanced-page] .review-appearances > summary.entry-advanced-item {
  padding-block: var(--ui-gap,8px);
  border-bottom: 0;
}
body:is([data-page=entry], [data-page=entry-advanced-page]) .review-appearance-controls {
  margin: 4px 0;
  gap: var(--ui-gap,8px);
  align-items: center;
}
body:is([data-page=entry], [data-page=entry-advanced-page]) .review-appearance-controls .check-row {
  margin: 0;
  padding: 0;
  border: 0;
  min-height: var(--ui-button-height,28px);
}
body:is([data-page=entry], [data-page=entry-advanced-page]) .review-appearance-list {
  margin: 0;
}
body:is([data-page=entry], [data-page=entry-advanced-page]) .review-appearance-list > .menu-item {
  padding-block: var(--ui-gap,8px);
  margin: 0;
}
body:is([data-page=entry], [data-page=entry-advanced-page]) .review-appearance-list > .menu-item:last-child {
  border-bottom: 0;
}
body:is([data-page=entry], [data-page=entry-advanced-page]) .review-appearance-write,
body dialog.role-setting-dialog .role-setting-rename {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: none;
  border: 0;
  background: transparent;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 1px;
}
body:is([data-page=entry], [data-page=entry-advanced-page]) .review-appearance-write::before,
body dialog.role-setting-dialog .role-setting-rename::before {
  content: "";
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  background: currentColor;
  mask: url(./role-chat-icons/\7f16\8f91.svg) center/contain no-repeat;
  -webkit-mask: url(./role-chat-icons/\7f16\8f91.svg) center/contain no-repeat;
}
body:is([data-page=entry], [data-page=entry-advanced-page]) .review-appearance-add {
  justify-content: center;
  margin-top: 4px;
}
body[data-page=group] .group-person-card .group-person-heading strong ,body .group-choice-scope .group-person-card .group-person-heading strong{
  font-size: 13px;
  font-weight: 500;
}
.role-profile-theaters h2 {
  font-size: 13px;
}
#sheet .current-settings-overview .current-setting-person-card:has([data-setting-sync=switch-set]) > .check-row {
  grid-row: 1/4;
}
#sheet .current-settings-overview .current-setting-person-card > [data-setting-sync=switch-set] {
  grid-row: 3;
  max-width: 120px;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}
.role-setting-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 12px 8px;
  text-align: center;
  overflow-wrap: anywhere;
}
.role-setting-divider::before,
.role-setting-divider::after {
  content: "";
  height: 1px;
  background: var(--line);
  flex: 1;
  min-width: 16px;
}
body[data-ui-surface][data-page=role] #role-current-user.ui-input {
  font-size: 13px !important;
}
body[data-page=entry] .person-setting-editor .entry-editor-heading {
  gap: 12px;
  margin-bottom: 8px;
  align-items: start;
}
body[data-page=entry] .person-setting-editor .entry-avatar-button .entry-avatar {
  width: 72px;
  height: 72px;
}
body[data-page=entry] .person-setting-editor .entry-avatar-button {
  padding: 0;
}
body[data-page=entry] .person-setting-editor .field {
  gap: 3px;
  margin-bottom: 8px;
}
body[data-page=entry] .person-setting-editor .field > label {
  margin: 0;
  line-height: 18px;
}
body[data-page=entry] .person-setting-editor .entry-person-fields {
  gap: 8px;
}
body[data-page=entry] .person-setting-editor .script-text-editor > textarea {
  line-height: 1.5;
  padding-bottom: 28px;
}
body[data-page=entry] .person-setting-editor .script-text-editor > textarea[name=description] {
  height: 84px;
  min-height: 84px;
}
body[data-page=entry] .person-setting-editor .script-text-editor > textarea[name=appearance] {
  height: 96px;
  min-height: 96px;
}
body[data-page=entry] .person-setting-editor .script-text-editor > textarea[name=brief] {
  height: 112px;
  min-height: 112px;
}
@supports not (-webkit-touch-callout:none) {
  body[data-page=entry] .person-setting-editor {
    --entry-mobile-input-size:14px;
  }
  body[data-ui-surface][data-page=entry] .person-setting-editor :is(input.ui-input, select.ui-input, textarea) {
    font-size: 14px !important;
  }
}
body[data-ui-surface][data-page=entry] .person-setting-editor .entry-editor-meta input.ui-input {
  height: 30px !important;
  min-height: 30px !important;
  padding-block: 3px;
}
body[data-page=role] .role-profile-heading small.role-setting-count {
  display: flex;
  align-items: center;
  gap: 4px;
}
body[data-page=role] .role-setting-switch {
  flex: none;
  width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  color: var(--muted);
  box-shadow: none;
}
body[data-page=role] .role-setting-switch svg {
  width: 14px;
  height: 14px;
  transform: none;
}
.role-setting-list {
  max-height: 45dvh;
  overflow: auto;
  scrollbar-width: none;
  padding: 0 var(--ui-gap);
  border: 1px solid var(--line);
  border-radius: var(--ui-control-radius);
  background: var(--soft);
  background: color-mix(in srgb, var(--soft) 60%, var(--paper));
}
.role-setting-option:last-child {
  border-bottom: 0;
}
body dialog.role-setting-dialog.ui-confirm button.ui-button.role-setting-delete {
  flex: none;
  min-width: 40px;
  min-height: 28px;
  padding: 3px 6px;
  margin: 0;
  font-size:13px;line-height:18.2px;font-weight:normal;font-style:normal;font-family:inherit;
  color: #b84a42 !important;
  border: 1px solid currentColor !important;
  background: transparent !important;
  box-shadow: none !important;
  white-space: nowrap;
}
.role-setting-option {
  display: flex;
  align-items: center;
  gap: var(--ui-gap);
  border-bottom: 1px solid var(--line);
}
.role-setting-option > button[data-select-set] {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ui-gap);
  flex: 1;
  min-width: 0;
  min-height: 36px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  text-align: left;
  font-size:13px;line-height:1.4;font-weight:normal;font-style:normal;font-family:inherit;
}
.role-setting-option > button[data-select-set] > span:first-child {
  overflow-wrap: anywhere;
}
.role-setting-option small {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
body dialog.role-setting-dialog .role-setting-rename {
  flex: none;
  font-size:13px;line-height:1.4;font-weight:normal;font-style:normal;font-family:inherit;
  padding: 0;
  min-height: 28px;
  box-shadow: none;
}
.role-setting-add {
  margin-top: calc(var(--ui-gap) + 3px);
  width: 100%;
}
body dialog.role-setting-dialog.ui-confirm button.ui-button.role-setting-rename {
  border: 0 !important;
  background: transparent !important;
}
body dialog.role-setting-dialog.ui-confirm button.ui-button.script-dashed {
  border-style: dashed !important;
  background: transparent !important;
}
.role-setting-name {
  display: grid;
  gap: 4px;
  font-size: 13px;
}
.role-setting-name input {
  width: 100%;
  font-size: 16px !important;
}
body dialog.role-setting-dialog.ui-confirm[data-set-view=list] {
  padding-top: 17px !important;
  padding-bottom: 18.5px !important;
}
body dialog.role-setting-dialog.ui-confirm[data-set-view=list] > h2 {
  position: static;
  margin-bottom: 17px !important;
}
body dialog.role-setting-dialog.ui-confirm[data-set-view=list] > h2 > .identity-close {
  top: 0;
  right: 14px;
}
body dialog.role-setting-dialog.ui-confirm[data-set-view=list] .role-setting-add {
  margin-top: 18.5px;
}
body[data-page=group] .group-person-card .role-setting-choice ,body .group-choice-scope .group-person-card .role-setting-choice{
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: var(--ui-gap);
  margin: 2px 0 0;
  min-width: 0;
  white-space: nowrap;
}
body[data-page=group] .group-person-card .role-setting-choice select ,body .group-choice-scope .group-person-card .role-setting-choice select{
  flex: 1;
  width: 0;
  min-width: 0;
}
@supports (-webkit-touch-callout: none) {
  body[data-ui-surface=reading][data-page=group] .group-person-card .role-setting-choice select.ui-input ,body[data-ui-surface=reading] .group-choice-scope .group-person-card .role-setting-choice select.ui-input{
    font-size: 16px !important;
  }
}
body[data-page=group] [data-form=group] > .check-row ,body .group-choice-scope [data-form=group] > .check-row{
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--ui-gap);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  min-height: var(--ui-button-height);
  margin: var(--ui-gap) 0;
  padding: 0;
  border: 0;
}
body[data-ui-surface=reading][data-page=group] [data-form=group] > .check-row input ,body[data-ui-surface=reading] .group-choice-scope [data-form=group] > .check-row input{
  margin: 0;
}
body[data-page=group] .group-kind-tabs ,body .group-choice-scope .group-kind-tabs{
  margin-bottom: var(--ui-gap);
}
body[data-page=group] .group-section-heading h3 ,body .group-choice-scope .group-section-heading h3{
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}
body[data-page=group] .group-panels .group-section ,body .group-choice-scope .group-panels .group-section{
  margin-bottom: var(--ui-gap);
}
body[data-page=group] .group-editor-actions ,body .group-choice-scope .group-editor-actions{
  margin: var(--ui-gap) 0 0;
}
body[data-ui-surface=reading][data-page=group] .group-editor-actions > button ,body[data-ui-surface=reading] .group-choice-scope .group-editor-actions > button{
  min-width: 0;
  padding-inline: 4px;
  white-space: nowrap;
  border: 1px solid var(--line);
  background: var(--paper);
}
@supports not (-webkit-touch-callout: none) {
  body[data-ui-surface=reading][data-page=group] [data-form=group] > .field input.ui-input ,body[data-ui-surface=reading] .group-choice-scope [data-form=group] > .field input.ui-input{
    font-size: 14px !important;
  }
}
body[data-page=group] .group-name-heading ,body .group-choice-scope .group-name-heading{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}
body[data-page=group] .group-name-heading > label ,body .group-choice-scope .group-name-heading > label{
  margin: 0;
  font-size: 12px;
  font-weight: 400;
}
body[data-page=group] .group-name-heading .check-row ,body .group-choice-scope .group-name-heading .check-row{
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  padding: 0;
  border: 0;
  min-height: 24px;
  font-size: 12px;
  white-space: nowrap;
}
body[data-page=group] .group-name-heading input[type=checkbox] ,body .group-choice-scope .group-name-heading input[type=checkbox]{
  width: 14px;
  height: 14px;
  margin: 0;
}
body[data-page=group] .group-save-status ,body .group-choice-scope .group-save-status{
  display: block;
  min-height: 16px;
  margin-top: 3px;
  font-size: 11px;
  line-height: 16px;
  color: var(--muted);
}
body[data-page=group] .group-save-status[data-state=error] ,body .group-choice-scope .group-save-status[data-state=error]{
  color: var(--danger,#a24f43);
}
body[data-page=group] .group-kind-tabs ,body .group-choice-scope .group-kind-tabs{
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2px;
  padding: 3px;
  margin: 0 0 8px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 5px;
}
body[data-page=group] .group-kind-tabs button ,body .group-choice-scope .group-kind-tabs button{
  width: 100%;
  min-width: 0;
  min-height: 28px;
  margin: 0;
  padding: 4px 1px;
  font-size: 12px;
  font-weight: 400;
  line-height: 18px;
  white-space: nowrap;
  border: 0;
  border-radius: 3px;
}
body[data-page=group] .group-kind-tabs button.selected ,body .group-choice-scope .group-kind-tabs button.selected{
  background: var(--paper);
  color: var(--ink);
}
body[data-page=group] .group-section-heading ,body .group-choice-scope .group-section-heading{
  justify-content: flex-end;
  gap: 8px;
  margin: 0 0 6px;
}
body[data-page=group] .group-section-heading h3 ,body .group-choice-scope .group-section-heading h3{
  display: none;
}
body[data-page=group] .group-check-item .group-person-summary ,body .group-choice-scope .group-check-item .group-person-summary{
  grid-column: 2/-1;
}
body[data-page=group] .group-check-item .role-setting-choice ,body .group-choice-scope .group-check-item .role-setting-choice{
  grid-column: 2/-1;
  justify-content: flex-start;
}
body[data-page=group] .group-person-card .role-setting-choice select ,body .group-choice-scope .group-person-card .role-setting-choice select{
  flex: 0 1 150px;
  width: 150px;
  max-width: calc(100% - 32px);
}
body[data-page=group] [data-form=group] .replacement-advanced ,body .group-choice-scope [data-form=group] .replacement-advanced{
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper);
  margin: 10px 0 0;
  padding: 0 10px;
}
body[data-page=group] .replacement-advanced > summary ,body .group-choice-scope .replacement-advanced > summary{
  display: flex;
  align-items: center;
  list-style: none;
  padding: 9px 0;
  font-size: 13px;
}
body[data-page=group] .replacement-advanced > summary::-webkit-details-marker ,body .group-choice-scope .replacement-advanced > summary::-webkit-details-marker{
  display: none;
}
body[data-page=group] .replacement-advanced > summary::before ,body .group-choice-scope .replacement-advanced > summary::before{
  display: none;
}
body[data-page=group] .replacement-advanced .ui-disclosure-arrow ,body .group-choice-scope .replacement-advanced .ui-disclosure-arrow{
  order: 2;
  margin-left: auto;
}
body[data-page=group] .group-save-status:empty ,body .group-choice-scope .group-save-status:empty{
  display: none;
}
body[data-page=group] .group-name-field ,body .group-choice-scope .group-name-field{
  margin-bottom: 12px;
}
.group-more-menu .line-item {
  font-size: 13px;
  font-weight: 400;
}
.reader .reader-controls-restore {
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  padding: 6px;
  width: 44px;
  height: 36px;
}
.reader-controls-restore svg {
  width: 24px;
  height: 24px;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.current-people-tabs {
  display: flex;
  flex: none;
  border-bottom: 1px solid var(--line);
  gap: 0;
}
.current-people-tabs button {
  flex: 1;
  border: 0;
  background: transparent;
  border-radius: 0;
  color: var(--muted);
  box-shadow: none;
}
.current-people-tabs button[aria-selected=true] {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 5px;
}
.current-people-npc[hidden],
.bindings-editor[hidden] {
  display: none !important;
}
#sheet > .sheet-body:has(> .current-people-tabs) {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  gap: 0;
  overflow: hidden;
}
#sheet .current-people-tabs {
  width: 100%;
  padding: 0 18px;
  min-height: 40px;
  align-items: center;
}
#sheet .current-people-tabs button {
  white-space: nowrap;
  height: 40px;
}
#sheet .current-people-npc {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 12px 18px;
}
#sheet .bindings-editor {
  min-height: 0;
}
[data-form=serial-clues] > .inline-hint {
  float: right;
  margin: 0;
  position: relative;
  z-index: 1;
}
.reader .reader-controls-restore,
.reader .reader-controls-restore:hover,
.reader .reader-controls-restore:active,
.reader .reader-controls-restore:focus-visible {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  outline-offset: 2px;
}
.reader .reader-controls-restore::before {
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
  inset: auto;
  pointer-events: none;
  background:
    linear-gradient(
      110deg,
      #f8d9ac,
      #a9e2df,
      #e0bcf0,
      #f8d9ac);
  background-size: 300% 100%;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 14 6-6 6 6' fill='none' stroke='black' stroke-width='5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
  animation: reader-arrow-color 5s linear infinite, reader-arrow-float 2.8s ease-in-out infinite;
  filter: drop-shadow(0 1px 1px #242524);
}
.reader .reader-controls-restore svg {
  position: relative;
  z-index: 1;
  animation: reader-arrow-float 2.8s ease-in-out infinite;
  filter: drop-shadow(0 1px 1px #fff7);
}
.reader .reader-controls-restore svg path:first-child {
  stroke: transparent;
}
.reader .reader-controls-restore svg path:last-child {
  stroke: #343633;
  stroke-width: 1.5;
}
@keyframes reader-arrow-float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}
@keyframes reader-arrow-color {
  to {
    background-position: 150% 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .reader .reader-controls-restore,
  .reader .reader-controls-restore::before,
  .reader .reader-controls-restore svg {
    animation: none !important;
  }
}
.person-setting-editor > [data-action=entry-delete] {
  margin-top: 28px;
}
#sheet .writing-pick-grid {
  gap: 8px;
  margin: 6px 0 12px;
}
#sheet .writing-pick-grid > .writing-pick {
  min-height: 34px;
  height: auto;
  padding: 6px 10px;
  gap: 8px;
  border-radius: var(--ui-control-radius,5px);
  font-size: 13px;
  line-height: 20px;
}
#sheet .writing-pick > span {
  min-width: 0;
  overflow-wrap: anywhere;
}
#sheet [data-writing-section] > h3 {
  margin: 12px 0 6px;
  font-size: 13px;
  font-weight: 400;
}
#sheet .writing-none {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 13px;
  line-height: 20px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
#sheet .writing-current {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.5;
}
#sheet [data-form=book-writing] .field {
  margin: 0;
}
#sheet [data-form=book-writing] .field > label,
#sheet [data-form=book-writing] .book-style-help h3,
#sheet [data-form=book-writing] .check-row {
  font-size: 13px;
  font-weight: 400;
  line-height: 20px;
}
#sheet [data-form=book-writing] .writing-choice {
  min-height: 34px;
  height: auto;
  padding: 6px 10px;
  font-size: 13px;
  line-height: 20px;
  border-radius: var(--ui-control-radius,5px);
}
#sheet [data-form=book-writing] .book-style-help {
  margin: 0;
  gap: 8px;
}
#sheet [data-form=book-writing] .check-row {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
#sheet [data-form=book-writing] .book-style-block {
  margin: 0;
  padding-top: 8px;
}
#sheet [data-form=book-writing] .book-style-help h3 {
  margin: 0;
}
#sheet [data-form=book-writing] .writing-choice {
  min-height: 34px !important;
  height: auto !important;
}
#sheet [data-form=book-writing] .inline-hint > summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  list-style: none;
  padding: 0;
  line-height: 1;
}
#sheet [data-form=book-writing] .inline-hint > summary::before,
#sheet [data-form=book-writing] .inline-hint > summary::after {
  display: none !important;
}
/* 输入框下两项共用按钮横向等分，保留原发送强调色。 */
.compose-box .compose-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--ui-gap,8px);width:100%}
.compose-box .compose-actions>button{width:100%;min-width:0;margin:0;font-size:var(--ui-button-font-size,14px)}
.generation-wait [data-generation-controls]{display:flex;align-items:center;justify-content:flex-start;gap:var(--ui-gap,8px);margin-top:8px}
.generation-wait [data-generation-controls] button{display:inline-flex;align-items:center;justify-content:center;gap:6px;margin:0;min-height:28px}
.generation-wait .generation-stop-icon{width:28px;padding:4px;flex:none}
.generation-wait .generation-model-switch{max-width:calc(100% - 36px);min-width:0;padding:4px 8px}
.generation-wait [data-generation-controls] svg{width:18px;height:18px;flex:none}
.generation-wait .generation-model-switch span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.generation-wait .generation-outline-preview{width:100%;text-align:left}
.generation-wait .generation-outline-preview>summary{text-align:left}
.compose-box .compose-actions>button:not(.primary){border:1px solid var(--line);background:var(--paper);color:var(--ink)}

/* 封面换图操作放在预览右侧，与书名成组。 */
.cover-editor-overview .cover-editor-fields{display:flex;flex-direction:column;align-self:stretch;justify-content:space-between;min-width:0;gap:8px}
.cover-editor-overview .cover-editor-fields>.field:has(#cover-file){grid-column:auto;margin:0}


/* 生成控制行模型名缩小三像素，停止图标使用半透明圆底。 */
body[data-ui-surface=reading] .generation-wait button.generation-model-switch{font-size:10px;color:var(--muted);font-weight:400}
body[data-ui-surface=reading] .generation-wait button.generation-stop-icon{border-radius:50%;background:color-mix(in srgb,var(--ink) 12%,transparent);border:1px solid color-mix(in srgb,var(--ink) 18%,transparent);color:var(--muted)}


/* 世界观合集：操作成组，简介与详情分开。 */
[data-world-set-manager] .world-set-toolbar {display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:8px}
[data-world-set-manager] .world-set-toolbar .ui-button {width:100%;margin:0;min-width:0;font-size:13px}
[data-world-set-manager] .world-set-overview-list {display:block;margin:0;padding:0}
[data-world-set-manager] .world-set-item {padding:12px 0;border-bottom:1px solid var(--line)}
[data-world-set-manager] button.world-member-overview {padding:0;border:0}
[data-world-set-manager] .world-member-title {font-size:15px;line-height:1.5;margin:0 0 5px;font-weight:500}
[data-world-set-manager] button.world-member-overview .world-member-preview {height:auto;display:block;font-size:13px;line-height:1.6}
[data-world-set-manager] .world-member-excerpt {padding-right:0;-webkit-line-clamp:2;overflow-wrap:anywhere}
[data-world-set-manager] button.world-member-overview .world-member-detail {position:static;display:block;text-align:right;font-size:12px;margin-top:4px;color:var(--muted)}
[data-world-set-manager] .world-set-actions {display:flex;justify-content:flex-end;gap:6px;margin-top:6px}
[data-world-set-manager] .world-set-actions .ui-button {font-size:12px;min-height:28px;height:28px;padding:3px 10px;margin:0}
[data-world-set-manager] [data-ws-status]:empty {display:none}
[data-world-set-manager] button.world-member-overview {position:relative}
[data-world-set-manager] button.world-member-overview .world-member-preview {position:static;padding-bottom:0}
[data-world-set-manager] button.world-member-overview .world-member-detail {position:absolute;left:0;right:auto;bottom:-29px;line-height:28px;margin:0;text-align:left}

[data-world-set-manager] .world-set-actions[hidden]{display:none}
[data-world-set-manager] .world-set-detail{margin-left:auto!important}
[data-world-set-manager] .world-set-actions [data-ws-action="remove"]{display:inline-flex;align-items:center;justify-content:center}

.npc-selection-tools{display:grid;gap:6px;margin:0 0 10px}.npc-selection-tools input,.npc-selection-tools select{width:100%;min-width:0;margin:0}.npc-selection-selects{display:grid;grid-template-columns:1fr 1fr;gap:6px}[data-npc-filter-row][hidden]{display:none!important}

.npc-selection-search-row{display:flex;align-items:center;gap:6px}.npc-selection-search-row input{flex:1;min-width:0}.npc-selection-search-row button{flex:none;white-space:nowrap;font-size:13px;padding:6px 8px}

/* NPC选人区域：共用搜索外框与相邻控件统一高度。 */
.npc-selection-tools{gap:8px;margin-bottom:10px}
.npc-selection-search-row{display:grid;grid-template-columns:minmax(0,1fr) 108px;align-items:stretch;gap:8px}
.npc-selection-search-row .ui-search{width:100%;min-width:0;height:36px;min-height:36px;box-sizing:border-box;margin:0;border-radius:4px;box-shadow:none}
.npc-selection-search-row .ui-search input.ui-input{height:34px;min-height:0;box-sizing:border-box;margin:0;padding-top:0;padding-bottom:0;line-height:34px;font-size:14px;border:0;box-shadow:none}
.npc-selection-search-row button[data-npc-select-all],.npc-selection-selects select.ui-input{height:36px;min-height:36px;box-sizing:border-box;margin:0;border:1px solid var(--line);border-radius:4px;box-shadow:none;font-size:14px;line-height:normal;padding:0 10px}
.npc-selection-search-row button[data-npc-select-all]{width:108px;background:var(--paper);color:var(--accent)}
.npc-selection-search-row button[data-npc-select-all]:disabled{opacity:.45}
.npc-selection-selects{gap:8px}
[data-npc-selection-filter] .group-person-card select{height:30px;min-height:30px;box-sizing:border-box;margin:0;padding-top:0;padding-bottom:0;line-height:normal;border-radius:4px}
body[data-ui-surface=reading][data-page=group] .npc-selection-tools :is(button[data-npc-select-all],select.ui-input),body[data-ui-surface=reading] .group-choice-scope .npc-selection-tools :is(button[data-npc-select-all],select.ui-input){height:36px!important;min-height:36px!important;max-height:36px!important;padding-block:0!important;font-size:14px!important}
body[data-ui-surface=reading][data-page=group] .group-name-field,body[data-ui-surface=reading] .group-choice-scope .group-name-field{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:8px;margin-bottom:12px}
body[data-ui-surface=reading][data-page=group] .group-name-field>label,body[data-ui-surface=reading] .group-choice-scope .group-name-field>label{margin:0;white-space:nowrap;font-size:14px}
body[data-ui-surface=reading][data-page=group] .group-name-input-row,body[data-ui-surface=reading] .group-choice-scope .group-name-input-row{min-width:0;margin:0}
body[data-ui-surface=reading][data-page=group] .group-save-status,body[data-ui-surface=reading] .group-choice-scope .group-save-status{grid-column:1/-1}
body[data-ui-surface=reading][data-page=group] .group-kind-tabs,body[data-ui-surface=reading] .group-choice-scope .group-kind-tabs{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:0;padding:0;border:0;border-radius:0;background:transparent}
body[data-ui-surface=reading][data-page=group] .group-kind-tabs button,body[data-ui-surface=reading] .group-choice-scope .group-kind-tabs button{grid-column:span 2;height:32px;min-height:32px;border-radius:0!important;border-right:1px solid var(--line)!important;border-bottom:1px solid var(--line)!important}
body[data-ui-surface=reading][data-page=group] .group-kind-tabs button:nth-child(n+4),body[data-ui-surface=reading] .group-choice-scope .group-kind-tabs button:nth-child(n+4){grid-column:span 3}
body[data-ui-surface=reading][data-page=group] .group-kind-tabs button:nth-child(3),body[data-ui-surface=reading][data-page=group] .group-kind-tabs button:last-child,body[data-ui-surface=reading] .group-choice-scope .group-kind-tabs button:nth-child(3),body[data-ui-surface=reading] .group-choice-scope .group-kind-tabs button:last-child{border-right:0!important}
body[data-ui-surface=reading][data-page=group] [data-npc-filter-row] .group-check-item,body[data-ui-surface=reading] .group-choice-scope [data-npc-filter-row] .group-check-item{display:grid!important;grid-template-columns:20px minmax(0,1fr) 66px 20px;grid-template-rows:auto auto 30px;gap:6px 8px;align-items:center}
body[data-ui-surface=reading][data-page=group] [data-npc-filter-row] .check-row,body[data-ui-surface=reading][data-page=group] [data-npc-filter-row] .check-content,body[data-ui-surface=reading] .group-choice-scope [data-npc-filter-row] .check-row,body[data-ui-surface=reading] .group-choice-scope [data-npc-filter-row] .check-content{display:contents!important}
body[data-ui-surface=reading][data-page=group] [data-npc-filter-row] input[name=npc],body[data-ui-surface=reading] .group-choice-scope [data-npc-filter-row] input[name=npc]{grid-column:1;grid-row:1/4;align-self:center;margin:0!important}
body[data-ui-surface=reading][data-page=group] [data-npc-filter-row] .group-person-heading,body[data-ui-surface=reading] .group-choice-scope [data-npc-filter-row] .group-person-heading{grid-column:2/4;grid-row:1}
body[data-ui-surface=reading][data-page=group] [data-npc-filter-row] .group-person-summary,body[data-ui-surface=reading] .group-choice-scope [data-npc-filter-row] .group-person-summary{grid-column:2/4;grid-row:2;margin:0}
body[data-ui-surface=reading][data-page=group] [data-npc-filter-row] .role-setting-choice,body[data-ui-surface=reading] .group-choice-scope [data-npc-filter-row] .role-setting-choice{grid-column:2;grid-row:3;display:flex;gap:6px;margin:0!important;min-width:0}
body[data-ui-surface=reading][data-page=group] [data-npc-filter-row] .role-setting-choice select.ui-input,body[data-ui-surface=reading] .group-choice-scope [data-npc-filter-row] .role-setting-choice select.ui-input{width:100%;max-width:none;min-width:0;flex:1}
body[data-ui-surface=reading][data-page=group] [data-npc-filter-row] .group-person-cast,body[data-ui-surface=reading] .group-choice-scope [data-npc-filter-row] .group-person-cast{grid-column:3;grid-row:3;display:block;margin:0!important}
body[data-ui-surface=reading][data-page=group] [data-npc-filter-row] select.ui-input,body[data-ui-surface=reading] .group-choice-scope [data-npc-filter-row] select.ui-input{height:30px!important;min-height:30px!important;padding-block:0!important}
body[data-ui-surface=reading][data-page=group] [data-npc-filter-row] .group-entry-view,body[data-ui-surface=reading] .group-choice-scope [data-npc-filter-row] .group-entry-view{grid-column:4;grid-row:1/4;align-self:center;position:static!important;margin:0!important}
body[data-ui-surface=reading][data-page=group] #app .npc-selection-tools .ui-search,body[data-ui-surface=reading] #sheet .group-choice-scope .npc-selection-tools .ui-search{border:1px solid var(--line,#deded4)!important;background:var(--paper,#fffdf5)}
body[data-ui-surface=reading][data-page=group] #app .npc-selection-tools .ui-search:focus-within,body[data-ui-surface=reading] #sheet .group-choice-scope .npc-selection-tools .ui-search:focus-within{outline:1px solid var(--accent,#4c6254);outline-offset:0}
body[data-ui-surface=reading][data-page=group] #app .npc-selection-tools :is(button[data-npc-select-all],select.ui-input),body[data-ui-surface=reading] #sheet .group-choice-scope .npc-selection-tools :is(button[data-npc-select-all],select.ui-input){border:1px solid var(--line,#deded4)!important}
body[data-ui-surface=reading][data-page=group] #app .group-kind-tabs button,body[data-ui-surface=reading] #sheet .group-choice-scope .group-kind-tabs button{border-bottom:1px solid var(--line,#deded4)!important;border-right:1px solid var(--line,#deded4)!important}
body[data-ui-surface=reading][data-page=group] #app .group-kind-tabs button:nth-child(3),body[data-ui-surface=reading][data-page=group] #app .group-kind-tabs button:last-child,body[data-ui-surface=reading] #sheet .group-choice-scope .group-kind-tabs button:nth-child(3),body[data-ui-surface=reading] #sheet .group-choice-scope .group-kind-tabs button:last-child{border-right:0!important}
body[data-ui-surface=reading][data-page=group] #app [data-npc-filter-row] select.ui-input,body[data-ui-surface=reading] #sheet .group-choice-scope [data-npc-filter-row] select.ui-input{height:30px!important;min-height:30px!important;max-height:30px!important;padding-block:0!important;width:100%;box-sizing:border-box}
body[data-ui-surface=reading][data-page=group] #app .page,body[data-ui-surface=reading] #sheet .group-choice-scope .page{padding-top:14px}
/* 原设定下拉减淡底色与边框，保留文字和聚焦提示。 */
body[data-ui-surface=reading][data-page=group] #app [data-npc-filter-row] .role-setting-choice select.ui-input,body[data-ui-surface=reading] #sheet .group-choice-scope [data-npc-filter-row] .role-setting-choice select.ui-input{background-color:transparent!important;border-color:color-mix(in srgb,currentColor 10%,transparent)!important;box-shadow:none!important}
/* 辅助栏统一收轻；分类沿主页只保留内部连续细线。 */
body[data-ui-surface=reading][data-page=group] #app .group-kind-tabs,body[data-ui-surface=reading] #sheet .group-choice-scope .group-kind-tabs{gap:0!important;margin-bottom:10px}
body[data-ui-surface=reading][data-page=group] #app .group-kind-tabs button,body[data-ui-surface=reading] #sheet .group-choice-scope .group-kind-tabs button{height:30px;min-height:30px;margin:0!important;padding:0 6px!important;border:0!important;border-radius:0!important;box-shadow:none!important;font-size:13px;font-weight:400;background:transparent}
body[data-ui-surface=reading][data-page=group] #app .group-kind-tabs button:nth-child(n+4),body[data-ui-surface=reading] #sheet .group-choice-scope .group-kind-tabs button:nth-child(n+4){border-top:1px solid color-mix(in srgb,currentColor 10%,transparent)!important}
body[data-ui-surface=reading][data-page=group] #app .group-kind-tabs button:nth-child(2),body[data-ui-surface=reading][data-page=group] #app .group-kind-tabs button:nth-child(3),body[data-ui-surface=reading][data-page=group] #app .group-kind-tabs button:nth-child(5),body[data-ui-surface=reading] #sheet .group-choice-scope .group-kind-tabs button:nth-child(2),body[data-ui-surface=reading] #sheet .group-choice-scope .group-kind-tabs button:nth-child(3),body[data-ui-surface=reading] #sheet .group-choice-scope .group-kind-tabs button:nth-child(5){border-left:1px solid color-mix(in srgb,currentColor 10%,transparent)!important}
body[data-ui-surface=reading][data-page=group] #app .group-kind-tabs button.selected,body[data-ui-surface=reading] #sheet .group-choice-scope .group-kind-tabs button.selected{background:color-mix(in srgb,currentColor 4%,transparent);color:inherit}
body[data-ui-surface=reading][data-page=group] #app .npc-selection-tools,body[data-ui-surface=reading] #sheet .group-choice-scope .npc-selection-tools{gap:6px}
body[data-ui-surface=reading][data-page=group] #app .npc-selection-search-row,body[data-ui-surface=reading] #sheet .group-choice-scope .npc-selection-search-row{grid-template-columns:minmax(0,1fr) 96px}
body[data-ui-surface=reading][data-page=group] #app .npc-selection-tools :is(.ui-search,button[data-npc-select-all],select.ui-input),body[data-ui-surface=reading] #sheet .group-choice-scope .npc-selection-tools :is(.ui-search,button[data-npc-select-all],select.ui-input){width:100%;min-width:0;height:30px!important;min-height:30px!important;max-height:30px!important;box-sizing:border-box;margin:0!important;padding:0 8px!important;font-size:13px!important;font-weight:400;line-height:normal;border:1px solid color-mix(in srgb,currentColor 10%,transparent)!important;border-radius:4px!important;box-shadow:none!important;background:transparent!important;color:inherit}
body[data-ui-surface=reading][data-page=group] #app .npc-selection-tools .ui-search,body[data-ui-surface=reading] #sheet .group-choice-scope .npc-selection-tools .ui-search{padding:0!important}
body[data-ui-surface=reading][data-page=group] #app .npc-selection-tools .ui-search input.ui-input,body[data-ui-surface=reading] #sheet .group-choice-scope .npc-selection-tools .ui-search input.ui-input{height:28px!important;min-height:28px!important;box-sizing:border-box;margin:0!important;padding-block:0!important;font-size:13px!important;line-height:28px;border:0!important;background:transparent!important;box-shadow:none!important}
/* 配置设定主页保留名称与说明，减少分类格和搜索框的上下留白。 */
@media(max-width:760px){
body[data-ui-surface=reading][data-page=library] #app .library-tabs>button{height:48px!important;min-height:48px!important;padding-block:4px!important}
}
body[data-ui-surface=reading][data-page=library] #app .ui-search{height:30px;min-height:30px;box-sizing:border-box;box-shadow:none}
body[data-ui-surface=reading][data-page=library] #app .ui-search input.ui-input{height:28px!important;min-height:28px!important;padding-block:0!important;font-size:13px!important;line-height:28px;box-shadow:none!important}
/* 分类点击区加高，内容从标题栏下方紧接开始。 */
body[data-ui-surface=reading][data-page=group] #app>.page.narrow,body[data-ui-surface=reading] #sheet .group-choice-scope>.page.narrow{padding-top:10px!important}
body[data-ui-surface=reading][data-page=group] #app .group-kind-tabs button,body[data-ui-surface=reading] #sheet .group-choice-scope .group-kind-tabs button{height:38px!important;min-height:38px!important}
body[data-ui-surface=reading][data-page=group] #app .group-save-status:empty,body[data-ui-surface=reading] #sheet .group-choice-scope .group-save-status:empty{display:none!important}
body[data-ui-surface=reading][data-page=group] #app .group-name-field,body[data-ui-surface=reading][data-page=group] #app .group-name-input-row,body[data-ui-surface=reading][data-page=group] #app .group-name-input-row>.check-row,body[data-ui-surface=reading] #sheet .group-choice-scope .group-name-field,body[data-ui-surface=reading] #sheet .group-choice-scope .group-name-input-row,body[data-ui-surface=reading] #sheet .group-choice-scope .group-name-input-row>.check-row{border-bottom:0!important;box-shadow:none!important}
body[data-ui-surface=reading][data-page=group] #app .group-name-input-row,body[data-ui-surface=reading] #sheet .group-choice-scope .group-name-input-row{gap:4px!important}
body[data-ui-surface=reading][data-page=group] #app .group-name-input-row>.check-row,body[data-ui-surface=reading] #sheet .group-choice-scope .group-name-input-row>.check-row{gap:4px!important;padding:0!important;margin:0!important}

/* 生成控制整体居中；世界观名称与关联提示分行，长文本自然撑高。 */
.generation-wait [data-generation-controls]{justify-content:center;width:100%;box-sizing:border-box}
body[data-page=group] .group-section[data-group-kind=world] .check-row,body .group-choice-scope .group-section[data-group-kind=world] .check-row{display:grid!important;grid-template-columns:18px minmax(0,1fr);align-items:start;height:auto!important;min-height:40px;gap:4px 10px}
body[data-page=group] .group-section[data-group-kind=world] .check-row>input,body .group-choice-scope .group-section[data-group-kind=world] .check-row>input{grid-column:1;grid-row:1;margin-top:3px!important}
body[data-page=group] .group-section[data-group-kind=world] .check-row>span,body .group-choice-scope .group-section[data-group-kind=world] .check-row>span{grid-column:2;min-width:0;overflow-wrap:anywhere}
body[data-page=group] .group-section[data-group-kind=world] .check-row>.specified-people-note,body .group-choice-scope .group-section[data-group-kind=world] .check-row>.specified-people-note{grid-column:2;display:block;min-width:0;white-space:normal;overflow-wrap:anywhere;font-size:12px;line-height:1.5;margin:0}

body[data-page=group] .group-section[data-group-kind=world] .check-row>.world-name-edit,body .group-choice-scope .group-section[data-group-kind=world] .check-row>.world-name-edit{grid-column:2;grid-row:1;width:100%;min-width:0;max-width:100%;height:auto!important;min-height:0!important;white-space:normal;overflow-wrap:anywhere;text-align:left;line-height:1.5;padding:0!important;justify-content:flex-start}
body[data-page=group] .group-section[data-group-kind=world] .check-row>.specified-people-note,body .group-choice-scope .group-section[data-group-kind=world] .check-row>.specified-people-note{grid-row:2}

/* 配置设定列表筛选：与搜索文字协调，收紧框高。 */
body[data-page=library] [data-npc-selection-filter=library] .npc-selection-selects select{font-size:13px!important;height:30px!important;min-height:30px!important;max-height:30px!important;padding:0 10px!important;line-height:normal;box-sizing:border-box}

/* 配置设定搜索、筛选与新增之间统一紧凑间距。 */
body[data-page=library] [data-npc-selection-filter=library] .npc-selection-tools{gap:6px!important;margin-bottom:6px!important}
body[data-page=library] [data-npc-selection-filter=library] .npc-selection-tools .ui-search{margin:0!important}

/* 本页分类下方收紧；白底筛选减淡，新建使用淡橙黄。 */
body[data-page=library] .library-tabs:has(+[data-npc-selection-filter=library]){margin-bottom:8px!important;padding-bottom:8px!important}
body[data-page=library] [data-npc-selection-filter=library]{margin-top:0!important;padding-top:0!important}
body[data-page=library]:not([data-night=true]) [data-npc-selection-filter=library] .npc-selection-tools :is(.ui-search,select.ui-input){background:rgba(255,255,255,.14)!important;border-color:rgba(110,100,75,.13)!important;box-shadow:none!important}
body[data-page=library]:not([data-night=true]) [data-npc-selection-filter=library] .ui-search input{background:transparent!important}
body[data-page=library]:not([data-night=true]) [data-npc-selection-filter=library] button.library-create.script-dashed{color:#a77832!important;border-color:rgba(195,148,63,.32)!important;background:rgba(227,181,91,.045)!important;box-shadow:none!important}

/* 白天同类新增按钮统一淡橙黄，夜间保留原色。 */
body:not([data-night=true]){--add-button-ink:#a77832;--add-button-line:rgba(195,148,63,.32);--add-button-bg:rgba(227,181,91,.045)}
body:not([data-night=true])[data-ui-surface] button.script-dashed{color:var(--add-button-ink)!important;border-color:var(--add-button-line)!important;background:var(--add-button-bg)!important}
/* 搜索只保留外框，单色图标不随浅底一起变淡。 */
body[data-page=library] #app [data-npc-selection-filter=library] .ui-search{position:relative;background-image:none!important}
body[data-page=library] #app [data-npc-selection-filter=library] .ui-search::before{content:'';position:absolute;left:11px;top:8px;width:8px;height:8px;border:1.3px solid currentColor;border-radius:50%;color:var(--muted);opacity:.75;pointer-events:none}
body[data-page=library] #app [data-npc-selection-filter=library] .ui-search::after{content:'';position:absolute;left:19px;top:17px;width:5px;height:1.3px;background:var(--muted);transform:rotate(45deg);transform-origin:left center;opacity:.75;pointer-events:none}
body[data-page=library] #app [data-npc-selection-filter=library] .ui-search input.ui-input{border:0!important;border-bottom:0!important;box-shadow:none!important;background:transparent!important;background-image:none!important;padding-left:30px!important;outline-offset:-2px}

body[data-page=library] #app [data-npc-selection-filter=library] .ui-search{border:1px solid color-mix(in srgb,currentColor 12%,transparent)!important;border-radius:4px!important}
body[data-page=library] #app [data-npc-selection-filter=library] .ui-search::before{right:auto!important;bottom:auto!important;background:none!important;box-shadow:none!important;transform:none!important}
body[data-page=library] #app [data-npc-selection-filter=library] .ui-search::after{right:auto!important;bottom:auto!important;border:0!important;box-shadow:none!important}

body[data-page=library] .library-tabs:has(+[data-npc-selection-filter=library])::after{content:none!important}


/* 自定义规则编辑沿用共用表单间距，长文仍可全屏编辑。 */
body[data-page=writing-rule-editor] [data-form=writing-rules] .field{gap:4px;margin-bottom:var(--ui-gap)}
body[data-page=writing-rule-editor] [data-form=writing-rules] .field>label{margin:0}
body[data-page=writing-rule-editor] [data-form=writing-rules] .script-text-editor>textarea{height:160px;min-height:120px}
body[data-page=writing-rule-editor] [data-form=writing-rules] .writing-advanced{margin-block:var(--ui-gap)}
body[data-page=writing-rule-editor] #app .form-footer{margin-top:var(--ui-gap);padding-top:var(--ui-gap)}

/* 标题贴住本组填写框，整组按内容高度排列。 */
body[data-page=writing-rule-editor] [data-form=writing-rules] .field{gap:1px;align-content:start;align-items:start;grid-template-rows:min-content min-content;margin-bottom:12px}
body[data-page=writing-rule-editor] [data-form=writing-rules] .field>label{display:block;align-self:end;height:auto;min-height:0;margin:0;padding:0;line-height:16px}

/* 标题紧贴自己的填写框，组间保留适当空白；同行操作保持原排列。 */
body[data-ui-surface=reading] [data-form=writing-entry]>.field,
body[data-ui-surface=reading][data-page=desktop-reading] #app .desktop-reading-settings .field:not([data-image-interval-field]):has(>label),
body[data-ui-surface=reading][data-page=generation-settings] #app .field:has(>label[for=bodyWords]),
body[data-ui-surface=reading][data-page=world-set] #app [data-form=world-set]>.field:has(>label),
body[data-ui-surface=reading][data-page=rule-edit] #app .field:has(textarea:is([name=oneSentenceRequest],[name=synopsis])){gap:1px;align-content:start;align-items:start;grid-template-rows:min-content min-content;margin-bottom:12px}
body[data-ui-surface=reading] [data-form=writing-entry]>.field>label,
body[data-ui-surface=reading][data-page=desktop-reading] #app .desktop-reading-settings .field:not([data-image-interval-field]):has(>label)>label,
body[data-ui-surface=reading][data-page=generation-settings] #app .field:has(>label[for=bodyWords])>label,
body[data-ui-surface=reading][data-page=world-set] #app [data-form=world-set]>.field:has(>label)>label,
body[data-ui-surface=reading][data-page=rule-edit] #app .field:has(textarea:is([name=oneSentenceRequest],[name=synopsis]))>label{display:block;align-self:end;height:auto;min-height:0;margin:0;padding:0;line-height:16px}

/* 电脑端长文编辑外层不再额外叠加顶部空隙。 */
body[data-ui-surface=reading] [data-form=writing-entry]>.field>.script-text-editor,
body[data-ui-surface=reading][data-page=rule-edit] #app .field:has(textarea:is([name=oneSentenceRequest],[name=synopsis]))>.script-text-editor{margin-top:0}

/* 阅读设置按用户参考分成内容与排版两框。 */
body[data-page=desktop-reading] #app .desktop-reading-settings{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;max-width:720px;margin-inline:auto}
body[data-page=desktop-reading] #app .desktop-reading-settings>section{border:1px solid var(--line);border-radius:12px;padding:14px;background:var(--paper);min-width:0}
body[data-page=desktop-reading] #app .desktop-reading-settings .reading-options{display:contents}
body[data-page=desktop-reading] #app .reading-main-card>.reading-display-options>.field{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:8px;margin-bottom:8px}
body[data-page=desktop-reading] #app .reading-main-card .reading-settings-actions{margin:0 0 8px;justify-content:space-between}
body[data-page=desktop-reading] #app .reading-main-card [data-form=body-length-settings]{margin:0 0 4px}
body[data-page=desktop-reading] #app .reading-main-card .field{margin-bottom:8px}
body[data-page=desktop-reading] #app .reading-adjust-card .reading-layout-options{justify-content:space-between;gap:8px}
body[data-page=desktop-reading] #app .reading-adjust-card>.row.between{justify-content:flex-start;gap:8px;margin-top:8px}
body[data-page=desktop-reading] #app .reading-adjust-card [data-action=gutter-reset],body[data-page=desktop-reading] #app .reading-adjust-card [data-action=line-height-reset]{display:none}
body[data-page=desktop-reading] #app .reading-adjust-card .hint{font-size:11px;line-height:1.5;margin:4px 0 0}
body[data-page=desktop-reading] #app .reading-defaults{width:100%;margin-top:12px}
body[data-page=desktop-reading] #app .desktop-reading-sample{display:none}
body[data-page=desktop-reading] #app :is(#chapterImageMaxCount,#privateChatImageMaxCount){width:44px;min-width:44px;flex:0 0 44px;padding-inline:4px;text-align:center}
@media(max-width:400px){body[data-page=desktop-reading] #app .desktop-reading-settings>section{padding:10px}body[data-page=desktop-reading] #app .reading-display-controls{gap:4px}body[data-page=desktop-reading] #app .reading-display-controls>.check-row{font-size:11px}}

body[data-page=desktop-reading] #app .reading-mode-tabs{display:flex;flex:1;min-width:0;border:1px solid var(--line);border-radius:99px;padding:2px;background:var(--bg)}
body[data-page=desktop-reading] #app .reading-mode-tabs>button{flex:1;min-width:0;border:0;border-radius:99px;padding:3px 8px;font-size:14px;white-space:nowrap;background:transparent}
body[data-page=desktop-reading] #app .reading-mode-tabs>button[aria-pressed=true]{background:var(--tint);color:var(--ink)}
body[data-page=desktop-reading] #app .reading-theme-tabs{display:flex;gap:6px;margin-right:auto}
body[data-page=desktop-reading] #app .reading-theme-tabs>button{border-radius:99px;min-height:28px;padding:3px 10px;font-size:13px}
body[data-page=desktop-reading] #app .reading-theme-tabs>button:disabled{opacity:1;background:var(--tint);color:var(--ink)}
body[data-page=desktop-reading] #app .reading-main-card .reading-settings-actions{gap:6px;justify-content:flex-start}

/* 生图数字框按常用内容收窄，输入值不设额外限制。 */
body[data-page=desktop-reading] #app :is(#chapterImageIntervalWords,#privateChatImageIntervalWords){width:56px;min-width:56px;flex:0 0 56px;padding-inline:4px;text-align:center}

/* 阅读设置区分字段标题与填写提示，标题不再比提示细小。 */
body[data-ui-surface=reading][data-page=desktop-reading] #app>.top .top-title{font-size:16px}
body[data-ui-surface=reading][data-page=desktop-reading] #app .desktop-reading-settings :is(.field>label,.reading-settings-actions>span,.chapter-image-heading>span,.reading-layout-options>.row>label,.reading-layout-options>.row>span,.reading-adjust-card>.row>span){font-size:13px;line-height:18px;font-weight:400;color:var(--ink)}
body[data-ui-surface=reading][data-page=desktop-reading] #app .desktop-reading-settings input::placeholder{font-size:12px;font-weight:400;color:var(--muted);opacity:1}
body[data-ui-surface=reading][data-page=desktop-reading] #app .desktop-reading-settings :is(small,.chapter-image-numbers>label){font-size:12px;font-weight:400;color:var(--muted)}

/* 字段标题适度突出，分组与操作使用直角外框。 */
body[data-ui-surface=reading][data-page=desktop-reading] #app .desktop-reading-settings :is(section,.reading-mode-tabs,button,select,input:not([type=checkbox])){border-radius:5px!important}

/* 三组加减共用相同尺寸，数字框保持紧凑高度。 */
body[data-ui-surface=reading][data-page=desktop-reading] #app .reading-adjust-card :is([data-action$="-minus"],[data-action$="-plus"]){box-sizing:border-box;width:28px!important;min-width:28px!important;height:28px!important;min-height:28px!important;flex:0 0 28px;padding:0!important;display:grid;place-items:center;font-size:14px!important;line-height:1;border:1px solid var(--line);background:var(--paper);color:var(--ink)}
body[data-ui-surface=reading][data-page=desktop-reading] #app .reading-adjust-card output{display:inline-block;width:42px;min-width:42px;text-align:center;font-size:13px;line-height:28px}
body[data-ui-surface=reading][data-page=desktop-reading] #app :is(#chapterImageIntervalWords,#chapterImageMaxCount,#privateChatImageIntervalWords,#privateChatImageMaxCount){box-sizing:border-box;height:28px!important;min-height:28px!important;padding-block:2px!important;line-height:20px}

/* 按用户图示恢复轻圆角和紧凑字级，显示方式一行居中对齐。 */
body[data-ui-surface=reading][data-page=desktop-reading] #app .desktop-reading-settings>section:is(.reading-main-card,.reading-adjust-card){border-radius:8px!important}
body[data-ui-surface=reading][data-page=desktop-reading] #app .desktop-reading-settings :is(.reading-mode-tabs,.reading-mode-tabs>button,.reading-theme-tabs>button){border-radius:99px!important}
body[data-ui-surface=reading][data-page=desktop-reading] #app .reading-main-card>.reading-display-options>.field{grid-template-rows:auto;align-items:center;align-content:center;column-gap:8px;row-gap:0}
body[data-ui-surface=reading][data-page=desktop-reading] #app .reading-main-card>.reading-display-options>.field>label{align-self:center;line-height:18px;margin:0;white-space:nowrap}
body[data-ui-surface=reading][data-page=desktop-reading] #app .reading-display-controls{align-items:center}
body[data-ui-surface=reading][data-page=desktop-reading] #app .reading-display-controls>.check-row{align-items:center;margin:0;min-height:28px}
body[data-ui-surface=reading][data-page=desktop-reading] #app .reading-display-controls>.check-row input{margin:0}
body[data-ui-surface=reading][data-page=desktop-reading] #app .reading-mode-tabs>button{font-size:13px!important;line-height:20px;min-height:26px!important;height:26px!important;padding-block:3px!important}
body[data-ui-surface=reading][data-page=desktop-reading] #app .reading-adjust-card .row{gap:6px}
body[data-ui-surface=reading][data-page=desktop-reading] #app .reading-adjust-card output{width:36px;min-width:36px}

/* 按用户参考图的紧凑字级和图标呈现，沿用已确认布局。 */
body[data-ui-surface=reading][data-page=desktop-reading] #app .reading-main-card>.reading-display-options>.field{display:flex;align-items:center;gap:8px}
body[data-ui-surface=reading][data-page=desktop-reading] #app .reading-main-card>.reading-display-options>.field>label{flex:none;font-size:12px;line-height:18px;align-self:center!important}
body[data-ui-surface=reading][data-page=desktop-reading] #app .reading-display-controls{flex:1;min-width:0}
body[data-ui-surface=reading][data-page=desktop-reading] #app .desktop-reading-settings :is(.field>label,.reading-settings-actions>span,.chapter-image-heading>span,.reading-layout-options>.row>label,.reading-layout-options>.row>span,.reading-adjust-card>.row>span){font-size:12px;line-height:18px;font-weight:400;text-decoration:none}
body[data-ui-surface=reading][data-page=desktop-reading] #app .desktop-reading-settings :is(input:not([type=checkbox]),select){font-size:14px!important}
body[data-ui-surface=reading][data-page=desktop-reading] #app .desktop-reading-settings input::placeholder{font-size:13px}
body[data-ui-surface=reading][data-page=desktop-reading] #app .desktop-reading-settings :is(.reading-mode-tabs>button,.reading-theme-tabs>button){font-size:13px!important;display:inline-flex;align-items:center;justify-content:center;gap:4px}
body[data-ui-surface=reading][data-page=desktop-reading] #app .reading-mode-tabs>button[aria-pressed=true]{background:var(--tint)!important;box-shadow:inset 0 0 0 1px var(--line)}
body[data-ui-surface=reading][data-page=desktop-reading] #app .reading-settings-actions .check-row{font-size:12px;gap:4px}
body[data-ui-surface=reading][data-page=desktop-reading] #app .reading-settings-actions .check-row:has(#reading-sound){position:relative}
body[data-ui-surface=reading][data-page=desktop-reading] #app .reading-settings-actions .check-row:has(#reading-sound:not(:checked)) svg{opacity:.4}
body[data-ui-surface=reading][data-page=desktop-reading] #app .reading-settings-actions svg,body[data-ui-surface=reading][data-page=desktop-reading] #app .chapter-image-configure svg{width:15px;height:15px;vertical-align:middle;flex:none}

/* 开关紧邻对应文字，整页还原放在分组框外。 */
body[data-ui-surface=reading][data-page=desktop-reading] #app .reading-main-card .chapter-image-heading{display:flex;justify-content:flex-start;align-items:center;gap:8px}
body[data-ui-surface=reading][data-page=desktop-reading] #app .reading-main-card .chapter-image-heading>span{flex:none;margin:0}
body[data-ui-surface=reading][data-page=desktop-reading] #app .reading-main-card .chapter-image-heading>input{margin:0;flex:none}
body[data-ui-surface=reading][data-page=desktop-reading] #app .reading-page-reset>.reading-defaults{margin:0;width:100%;border-radius:5px}

/* 人物主页的记录筛选贴近标题，不占空记录区域。 */
.role-profile-theaters .role-record-toolbar{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;margin-block:8px 2px}
.role-profile-theaters .role-record-toolbar h2{margin:0;flex-shrink:0}
.role-profile-theaters .role-record-toolbar .field{display:flex;align-items:center;gap:6px;flex-direction:row;flex:0 1 auto;min-width:0;max-width:100%;margin:0}
.role-profile-theaters .role-record-toolbar label{white-space:nowrap;margin:0;font-size:12px}
.role-profile-theaters .role-record-toolbar select{width:142px;max-width:45vw;min-width:0;height:30px;padding-block:2px}

/* 阅读设置按手机图示加强状态区别，保留原分组与保存方式。 */
body[data-ui-surface=reading][data-page=desktop-reading] #app .reading-mode-tabs>button[aria-pressed=true]{background:#cfe2cf!important;color:#244b32!important;box-shadow:inset 0 0 0 1px #719c7c;font-weight:600}
body[data-ui-surface=reading][data-page=desktop-reading][data-night=true] #app .reading-mode-tabs>button[aria-pressed=true]{background:#3a654c!important;color:#f0fff3!important;box-shadow:inset 0 0 0 1px #8ab89a}
body[data-ui-surface=reading][data-page=desktop-reading] #app .reading-theme-toggle{margin-right:auto;display:inline-flex;align-items:center;gap:4px;min-height:28px!important;height:28px;padding:3px 10px!important;border-radius:99px!important;font-size:13px!important;line-height:20px}
body[data-ui-surface=reading][data-page=desktop-reading] #app .reading-theme-toggle[data-reading-theme=night]{background:#283a50!important;border-color:#7085a0!important;color:#e3ebff!important}
body[data-ui-surface=reading][data-page=desktop-reading] #app .reading-theme-toggle[data-reading-theme=light]{background:#f6e6ba!important;border-color:#be9d57!important;color:#634a21!important}
body[data-ui-surface=reading][data-page=desktop-reading] #app .chapter-image-heading input{background:#69716f!important;border-color:#69716f!important}
body[data-ui-surface=reading][data-page=desktop-reading] #app .chapter-image-heading input:checked{background:#4b9367!important;border-color:#4b9367!important}
body[data-ui-surface=reading][data-page=desktop-reading] #app :is(#bodyWords,#reading-font-family){box-sizing:border-box;height:28px!important;min-height:28px!important;padding-block:2px!important;line-height:20px}
body[data-ui-surface=reading][data-page=desktop-reading] #app .reading-adjust-card :is([data-action$="-minus"],[data-action$="-plus"]){width:24px!important;min-width:24px!important;height:24px!important;min-height:24px!important;flex-basis:24px!important}
body[data-ui-surface=reading][data-page=desktop-reading] #app .reading-adjust-card output{line-height:24px}
body[data-ui-surface=reading][data-page=desktop-reading] #app .reading-main-card .field{margin-bottom:6px}

/* 合集表单满行操作与独立拖动把手，正文仍可滑动。 */
[data-world-set-manager] .world-set-editor-actions{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;width:100%}
[data-world-set-manager] .world-set-editor-actions>.ui-button{width:100%;min-width:0;margin:0}
[data-world-set-manager] .world-set-item{position:relative}
[data-world-set-manager] button.world-member-overview{width:100%;padding-right:44px;box-sizing:border-box}
body[data-ui-surface=reading][data-page=group] [data-form=group] .group-inline-settings,body[data-ui-surface=reading] .group-choice-scope [data-form=group] .group-inline-settings{border:0;border-top:1px solid var(--line);border-radius:0;padding:10px 0 0;margin:12px 0;background:transparent}
.group-more-menu .group-menu-copy{flex:1;min-width:0}
.group-more-menu .group-menu-row{height:auto!important;min-height:52px!important;padding:12px 0;gap:12px}
.group-more-menu .group-menu-row strong{font-size:14px;font-weight:400}
.group-more-menu .group-menu-row small{font-size:12px;margin-top:3px}
.group-more-menu .group-menu-row .item-arrow{flex:none;margin-left:auto;align-self:center}

/* 演出脚本：同级设置统一，说明跟随对应操作。 */
.script-settings-organized{--script-row-height:48px}
.script-settings-organized .script-settings-group{margin:0 0 16px;padding:0;border:0}
.script-settings-organized .script-settings-group>h3{font-size:12px;line-height:1.5;font-weight:500;color:var(--muted);margin:0;padding:8px 0 4px}
.script-settings-organized .script-au-settings{margin:0;padding:0}
.script-settings-organized .script-au-settings>.check-row,.script-settings-organized .script-setting-fold>summary,.script-settings-organized .rule-binding-entry{box-sizing:border-box;min-height:var(--script-row-height);margin:0;padding:12px 0;font-size:15px;line-height:24px;border:0;border-bottom:1px solid var(--line);border-radius:0;background:transparent}
.script-settings-organized .script-au-settings>.hint{margin:6px 0 8px;font-size:12px;line-height:1.6}
.script-settings-organized .script-setting-fold{margin:0;border:0;border-bottom:1px solid var(--line)}
.script-settings-organized .script-setting-fold>summary{display:flex;align-items:center;gap:8px;border:0;list-style:none;cursor:pointer}
.script-settings-organized .script-setting-fold>summary::before{content:'›';flex:0 0 12px;font-size:20px;transition:transform .15s}
.script-settings-organized .script-setting-fold[open]>summary::before{transform:rotate(90deg)}
.script-settings-organized .script-setting-fold>summary::-webkit-details-marker{display:none}
.script-settings-organized .script-setting-current{margin-left:auto;max-width:52%;text-align:right;color:var(--muted);font-size:12px;line-height:1.5;overflow-wrap:anywhere}
.script-settings-organized .script-setting-fold .rule-random-settings{margin:0;padding:0 0 8px}
.script-settings-organized .script-weight-help{margin:0 0 12px;font-size:12px;line-height:1.7}
.script-settings-organized .script-setting-fold .script-writing-choices{margin:0;padding:0 0 12px}
.script-settings-organized .script-settings-restore{margin:0;display:flex;align-items:center;gap:12px}
.script-settings-organized .script-settings-restore>.hint{margin:0;flex:1;font-size:12px}
.script-settings-organized .script-settings-restore>[data-script-restore]{width:auto;min-width:88px;min-height:40px;margin:0}

.script-settings-organized .script-au-settings{gap:0}
.script-settings-organized[hidden]{display:none!important}

.script-settings-organized .script-delete-entry{margin:12px 0 0;min-height:44px}

/* 配置设定与组内分类共用格子外观；组内始终上三下二、等宽等高。 */
body[data-ui-surface=reading]:is([data-page=library],[data-page=group]) #app .setting-kind-tabs>button,body[data-ui-surface=reading] #sheet .group-choice-scope .setting-kind-tabs>button{
  box-sizing:border-box;min-width:0;width:100%;height:48px!important;min-height:48px!important;
  margin:0!important;padding:4px 2px!important;border:1px solid transparent!important;
  border-radius:3px!important;background:transparent;color:var(--ink);box-shadow:none!important;
  font-size:12px;font-weight:400;line-height:18px;white-space:nowrap;
}
body[data-ui-surface=reading]:is([data-page=library],[data-page=group]) #app .setting-kind-tabs>button:nth-child(3n+2),
body[data-ui-surface=reading]:is([data-page=library],[data-page=group]) #app .setting-kind-tabs>button:nth-child(3n+3),body[data-ui-surface=reading] #sheet .group-choice-scope .setting-kind-tabs>button:nth-child(3n+2),body[data-ui-surface=reading] #sheet .group-choice-scope .setting-kind-tabs>button:nth-child(3n+3){border-left-color:color-mix(in srgb,var(--line) 45%,transparent)!important}
body[data-ui-surface=reading]:is([data-page=library],[data-page=group]) #app .setting-kind-tabs>button:nth-child(n+4),body[data-ui-surface=reading] #sheet .group-choice-scope .setting-kind-tabs>button:nth-child(n+4){border-top-color:color-mix(in srgb,var(--line) 45%,transparent)!important}
body[data-ui-surface=reading]:is([data-page=library],[data-page=group]) #app .setting-kind-tabs>button.selected,body[data-ui-surface=reading] #sheet .group-choice-scope .setting-kind-tabs>button.selected{border-color:var(--line)!important;background:var(--paper);color:var(--ink)}
body[data-ui-surface=reading]:is([data-page=library],[data-page=group]) #app .setting-kind-tabs strong,body[data-ui-surface=reading] #sheet .group-choice-scope .setting-kind-tabs strong{display:block;font-size:13px;font-weight:500;line-height:18px}
body[data-ui-surface=reading]:is([data-page=library],[data-page=group]) #app .setting-kind-tabs small,body[data-ui-surface=reading] #sheet .group-choice-scope .setting-kind-tabs small{display:block;font-size:9px;font-weight:400;line-height:13.5px;margin-top:4px;color:var(--muted)}
body[data-ui-surface=reading][data-page=group] #app .group-kind-tabs,body[data-ui-surface=reading] #sheet .group-choice-scope .group-kind-tabs{grid-template-columns:repeat(3,minmax(0,1fr));padding:2px 0;margin-bottom:10px}
body[data-ui-surface=reading][data-page=group] #app .group-kind-tabs>button:nth-child(n),body[data-ui-surface=reading] #sheet .group-choice-scope .group-kind-tabs>button:nth-child(n){grid-column:auto}
body[data-ui-surface=reading][data-page=group] #app .group-name-input-row>.check-row,body[data-ui-surface=reading] #sheet .group-choice-scope .group-name-input-row>.check-row{display:inline-flex!important;align-items:center;justify-content:flex-start;width:auto;min-width:0;gap:4px!important}
body[data-ui-surface=reading][data-page=group] #app .group-name-input-row>.check-row>input[type=checkbox],body[data-ui-surface=reading] #sheet .group-choice-scope .group-name-input-row>.check-row>input[type=checkbox]{flex:0 0 17px;width:17px!important;height:17px!important;margin:0!important}
body[data-ui-surface=reading][data-page=group] #app .group-name-input-row>.check-row>span,body[data-ui-surface=reading] #sheet .group-choice-scope .group-name-input-row>.check-row>span{flex:none;margin:0;padding:0}
body[data-ui-surface=reading][data-page=group] #app .group-inline-settings,
body[data-ui-surface=reading][data-page=group] #app .group-inline-settings>.conditional-rules,
body[data-ui-surface=reading][data-page=group] #app .group-inline-settings>.condition-list-entry,body[data-ui-surface=reading] #sheet .group-choice-scope .group-inline-settings,body[data-ui-surface=reading] #sheet .group-choice-scope .group-inline-settings>.conditional-rules,body[data-ui-surface=reading] #sheet .group-choice-scope .group-inline-settings>.condition-list-entry{border:0!important;box-shadow:none!important;background:transparent}
body[data-ui-surface=reading][data-page=group] #app .group-inline-settings>.conditional-rules>.check-row,body[data-ui-surface=reading] #sheet .group-choice-scope .group-inline-settings>.conditional-rules>.check-row{border:0!important;box-shadow:none!important}

/* 桌面配置设定沿用分类格，搜索与新建相邻。 */
@media (min-width: 761px) {
  body[data-ui-surface=reading][data-page=library] #app > .page.narrow { margin-left: 32px; margin-right: auto; }
  body[data-ui-surface=reading][data-page=library] #app .setting-kind-tabs { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 0 !important; margin-bottom: 12px; }
  body[data-ui-surface=reading][data-page=library] #app .setting-kind-tabs > button { width: 100%; min-width: 0; }
  body[data-ui-surface=reading][data-page=library] .desktop-library-actions { justify-content: flex-start; gap: 8px; margin-bottom: 12px; }
  body[data-ui-surface=reading][data-page=library] .desktop-library-actions > .ui-search { flex: 0 1 256px; width: 256px; min-width: 0; margin: 0; }
  body[data-ui-surface=reading][data-page=library] .page > .empty { min-height: 0; padding: 32px 16px; }
}

/* 待确认只使用共用小弹窗，正文与操作按手机阅读尺寸排布。 */
#sheet.ui-confirm:has([data-serial-review]){position:fixed;width:min(480px,calc(100% - 32px));padding:20px 18px;max-height:calc(100dvh - 40px)}
#sheet.ui-confirm:has([data-serial-review])>h2{padding-inline:28px;font-size:18px;line-height:1.4;font-weight:600;margin-bottom:16px}
#sheet.ui-confirm .serial-review-close{position:absolute;right:12px;top:12px;width:32px;height:32px;padding:0!important;border:0!important;box-shadow:none!important;background:transparent!important;font-size:26px!important;line-height:1!important;font-weight:normal!important;font-style:normal!important;font-family:inherit!important;color:inherit}
#sheet [data-serial-review]{font-size:16px;line-height:1.6;color:var(--ink)}
#sheet [data-serial-review] p{font-size:16px;line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere;margin:0 0 12px}
#sheet [data-serial-review] .serial-review-summary{background:var(--soft);padding:12px;margin:0 0 12px}
#sheet [data-serial-review] .serial-review-summary p:last-child{margin-bottom:0}
#sheet [data-serial-review] .serial-review-note{font-size:14px;line-height:1.6;margin-top:12px}
#sheet [data-serial-review] details{margin:0;padding:0;border:0;box-shadow:none}
#sheet [data-serial-review] summary{font-size:15px;line-height:1.6;padding:8px 0;min-height:40px}
#sheet [data-serial-review] .serial-review-change{padding:10px 0;border-top:1px solid var(--line)}
#sheet [data-serial-review] .serial-review-change p{margin:6px 0}
#sheet [data-serial-review] .serial-review-change p span{display:block;font-size:14px}
#sheet.ui-confirm:has([data-serial-review]) .ui-confirm-actions{margin:12px 0 0!important;padding:0!important}
#sheet.ui-confirm:has([data-serial-review]) .ui-confirm-actions button{min-height:44px!important;height:auto!important;font-size:15px!important;line-height:1.4;white-space:normal}

/* 插图小节沿原列表显示，操作贴近标题。 */
[data-image-panel] .image-resume-status p{margin:0 0 4px;font-size:13px}
[data-image-panel] .image-resume-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:10px 0}
[data-image-panel] .image-resume-filters{margin:8px 0}
[data-image-panel] .image-resume-list .entry-text{padding:12px 0;margin:0}
[data-image-panel] .image-resume-heading{display:flex;align-items:center;gap:8px}
[data-image-panel] .image-resume-heading h3{flex:1;min-width:0;margin:0;font-size:14px;line-height:1.5}
[data-image-panel] .image-resume-row-actions{display:flex;align-items:center;gap:4px;flex-shrink:0}
[data-image-panel] .image-resume-row-actions button{white-space:nowrap;padding:4px 6px;font-size:12px}
[data-image-panel] .image-resume-refresh{width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center}
[data-image-panel] .image-resume-refresh svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
[data-image-panel] [data-story-image-records] h3{font-size:14px;line-height:1.5;font-weight:400;margin:8px 0}
[data-image-panel] .image-resume-list p{margin:6px 0;font-size:13px;line-height:1.5}

[data-image-panel] .image-resume-filters{grid-template-columns:repeat(3,minmax(0,1fr))}

/* 进入私聊的下拉选项沿用设定组勾选尺寸与设定选择行高。 */
body[data-ui-surface=reading] #sheet .private-entry-dropdown>[data-entry-options]{display:grid;gap:0;margin:0 0 8px}
body[data-ui-surface=reading] #sheet .private-entry-dropdown>[data-entry-options]>.check-row{display:flex;align-items:center;justify-content:flex-start;min-height:28px;margin:0;padding:0;gap:8px;border:0;font-size:13px;line-height:18px}
body[data-ui-surface=reading] #sheet .private-entry-dropdown>[data-entry-options]>.check-row>input{width:17px;height:17px;min-height:17px;flex:0 0 17px;margin:0}
body[data-ui-surface=reading] #sheet .private-entry-dropdown>[data-entry-options]>.check-row>span{flex:none}

/* 世界观集保留条目细线，取消资料库列表叠加的末线。 */
body[data-page=library] [data-world-set-manager] .world-set-overview-list::after{content:none}
[data-world-set-manager] button.world-member-overview{padding-right:76px}

/* 插图补齐沿原同行操作显示等待，不改变按钮大小。 */
[data-image-panel] .image-resume-fill{text-decoration:underline;text-underline-offset:3px}
[data-image-panel] .image-resume-refresh[aria-busy="true"]{opacity:1}
[data-image-panel] .image-resume-refresh[aria-busy="true"] svg{animation:image-resume-rotate 1s linear infinite;transform-origin:center}
:is([data-paragraph-image],[data-frame-paragraph-image])[aria-busy="true"]{display:inline-grid;place-items:center;opacity:1}
:is([data-paragraph-image],[data-frame-paragraph-image])[aria-busy="true"][hidden]{display:none}
:is([data-paragraph-image],[data-frame-paragraph-image])[aria-busy="true"] svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;animation:image-resume-rotate 1s linear infinite}
@keyframes image-resume-rotate{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){:is([data-image-panel] .image-resume-refresh,[data-paragraph-image],[data-frame-paragraph-image])[aria-busy="true"] svg{animation:none}}

/* 便签1586fb6a：剧目详情沿原组件收紧，长章名在章名列内换行。 */
body:is([data-page=home], [data-page=book]) .hero-copy {
  align-self: stretch;
  gap: 4px;
}
body:is([data-page=home], [data-page=book]) .hero-copy-heading {
  justify-content: flex-end;
}
body:is([data-page=home], [data-page=book]) .hero-copy .detail-count {
  margin-top: auto;
}
body:is([data-page=home], [data-page=book]) .hero-actions {
  margin-top: 0;
}


body:is([data-page=home], [data-page=book]) .reading-hero {
  margin-bottom: 0;
}
body:is([data-page=home], [data-page=book]) .home-api-status {
  margin: 0 0 4px;
}
body:is([data-page=home], [data-page=book]) .home-chapters .setting-sync-toolbar {
  margin: 0 0 4px;
}
.chapter-link > span:first-child:has(.ui-chapter-number) {
  display: grid;
  grid-template-columns: max-content max-content minmax(0, 1fr);
  align-items: baseline;
  flex: 1;
}
.chapter-link .ui-chapter-number,
.chapter-link .chapter-title-separator {
  white-space: pre;
}
.chapter-link .chapter-title-name {
  min-width: 0;
  overflow-wrap: anywhere;
}
.chapter-entry:has(.chapter-sections-toggle[aria-expanded=true]) {
  border-bottom: 0;
}
.chapter-section-list {
  margin-bottom: 4px;
}
.chapter-section-link {
  min-height: 36px;
  padding-block: 6px;
  box-shadow: none;
}
body:is([data-page=home], [data-page=book]) .book-switch {
  border-top: 0;
  box-shadow: none;
}
@media (max-width: 760px) {
  body:is([data-page=home], [data-page=book], [data-page=pool], [data-page=rule-view], [data-page=rule-edit]) #app > .top :is(.top-section-title, .top-title, .object-title, h1) {
    padding-top: 6px;
  }
}

/* 主角与世界观调整页的字号层级和页签指示线 */
#sheet .current-settings-overview .current-au-declaration-toolbar > span {
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
}
#sheet .current-settings-overview .binding-usage {
  text-align: center;
}
#sheet .current-settings-overview .binding-section-title {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
}
#sheet .current-settings-overview .binding-excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 3;
}
#sheet .current-settings-overview .setting-cast-role {
  align-self: start;
  transform: translateY(-2px);
}
#sheet .current-settings-overview [data-action=binding-npc-local] {
  grid-column: 1;
  justify-self: start;
  align-self: start;
  transform: translateY(-2px);
}
#sheet .current-people-tabs button {
  position: relative;
  transform: translateY(-1px);
}
#sheet .current-people-tabs button[aria-selected=true] {
  position: relative;
  text-decoration: none;
}
#sheet .current-people-tabs button[aria-selected=true]::after {
  position: absolute;
  right: 50%;
  bottom: -2px;
  width: 24px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  content: "";
  transform: translateX(50%);
}
body[data-night=true] #sheet .current-people-tabs button[aria-selected=true]::after {
  background: #fff;
}

/* 当前剧目设定沿已确认样例排列。 */
#sheet .current-people-tools{padding:12px 16px 4px;gap:8px;border:0;min-height:0}
#sheet .current-people-tools button{height:28px;min-height:28px;border:1px solid var(--line);border-radius:5px;background:var(--paper);color:var(--ink);font-size:13px;line-height:18px}
#sheet .current-people-tools button[aria-expanded=true]{background:var(--soft);color:var(--accent)}
#sheet .current-people-npc:not([hidden]){flex:none;max-height:35vh;overflow:auto;padding:8px 16px}
#sheet .current-settings-overview .current-setting-person-card{grid-template-columns:minmax(0,1fr) auto;gap:8px;padding:10px;margin:0 0 10px;border:1px solid var(--line);border-radius:5px;background:var(--paper)}
#sheet .current-settings-overview .current-setting-person-card>.check-row{grid-column:1;grid-row:1;gap:8px}
#sheet .current-setting-avatar{display:grid;place-items:center;flex:none;width:38px;height:48px;border-radius:4px;background:var(--soft);color:var(--muted);font-size:18px;overflow:hidden}
#sheet .current-setting-avatar img{width:100%;height:100%;object-fit:cover}
#sheet .current-settings-overview .current-setting-person-card>.current-setting-edit-button{grid-column:2;grid-row:1;width:28px;height:28px;min-height:28px;border:0;padding:4px;background:transparent;box-shadow:none}
#sheet .current-settings-overview .current-setting-person-card>.current-setting-edit-button svg{width:16px;height:16px}
#sheet .current-settings-overview .current-setting-person-controls{grid-column:1/-1;grid-row:2;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:center;gap:8px;margin-left:26px;min-width:0}
#sheet .current-settings-overview .current-setting-person-controls>:is(.role-setting-choice,.group-person-cast){display:flex;grid-area:auto;justify-self:stretch;align-self:center;transform:none;align-items:center;gap:6px;min-width:0;width:auto;margin:0;color:var(--muted);font-size:12px;font-weight:400;line-height:16px}
#sheet .current-settings-overview .current-setting-person-controls select{box-sizing:border-box;flex:1;width:0;min-width:0;max-width:100%;height:24px!important;min-height:24px!important;margin:0;padding:1px 6px;border:1px solid var(--line);border-radius:5px;background:var(--paper);color:var(--ink);font-family:inherit;font-size:13px!important;font-weight:400;line-height:20px}
#sheet .current-settings-overview .group-cast-caption{display:inline!important;position:static;width:auto;height:auto;overflow:visible;clip-path:none;white-space:nowrap;font-size:12px;font-weight:400;line-height:16px}
#sheet .current-settings-overview .binding-usage{text-align:center}
#sheet .current-settings-overview .current-people-tools{padding:8px 0 4px}
#sheet .current-settings-overview .current-people-npc:not([hidden]){padding:8px 0}
#sheet .current-settings-overview .binding-group{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;column-gap:8px}
#sheet .current-settings-overview .binding-group>label{margin:0}
#sheet .current-settings-overview .binding-group>small{grid-column:1/-1}
@media(max-width:760px){#sheet .current-settings-overview .current-setting-person-controls select{font-size:13px!important}}

/* 演出脚本搜索与筛选同行，筛选选项在原位置展开。 */
.script-list-scope .script-filter-row{display:flex;align-items:center;gap:8px;position:relative;margin:0 0 12px;border:0;background:transparent}
.script-filter-row>input[type=search]{flex:1;min-width:0;height:34px;margin:0}
.script-filter-row .script-filter-menu{position:relative;flex:none}
.script-filter-row .script-filter-menu>summary{display:flex;align-items:center;justify-content:center;min-height:34px;height:34px;padding:3px 12px;border:1px solid var(--line);border-radius:5px;background:var(--paper);font-size:13px;list-style:none;cursor:pointer}
.script-filter-row .script-filter-menu>summary::-webkit-details-marker{display:none}
.script-filter-row .script-filter-fields{position:absolute;right:0;top:calc(100% + 4px);z-index:20;display:flex;flex-direction:column;align-items:stretch;gap:8px;width:min(240px,85vw);padding:12px;border:1px solid var(--line);border-radius:5px;background:var(--paper);box-shadow:0 4px 16px #0002}
.script-filter-row .script-filter-fields select{width:100%;height:34px}
.script-filter-row [data-filter-indicator]{display:none}

/* 书架筛选贴搜索框，选择项在原位打开。 */
.shelf-book-toolbar .shelf-filter-menu{position:relative;flex:none}
.shelf-filter-menu>summary{display:flex;align-items:center;justify-content:center;height:34px;padding:3px 12px;border:1px solid var(--line);border-radius:5px;background:var(--paper);font-size:13px;cursor:pointer;list-style:none}
.shelf-filter-menu>summary::-webkit-details-marker{display:none}
.shelf-filter-fields{position:absolute;top:calc(100% + 4px);left:0;z-index:20;width:min(260px,85vw);padding:12px;display:grid;gap:8px;border:1px solid var(--line);border-radius:5px;background:var(--paper);box-shadow:0 4px 16px #0002}
.shelf-filter-fields label:not(.check-row){display:grid;gap:3px;font-size:12px}
.shelf-filter-fields select,.shelf-filter-fields input[type=number]{width:100%;height:34px;min-width:0}
.shelf-filter-count{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.shelf-filter-fields .check-row{margin:0}
.shelf-filter-fields [data-shelf-filter-clear]{height:28px}

/* 随机开演入口收轻，保持原操作。 */
body[data-page=shelf] .shelf-random-split>button,body[data-page=shelf] .shelf-random-more>summary{background:transparent!important;border-color:transparent!important;box-shadow:none!important;color:var(--muted)!important}

body[data-page=home] .top-menu-only .theater-copy-shortcut{position:absolute;left:18px;top:8px;width:32px;height:32px;min-height:32px;padding:7px;border:0;background:transparent;box-shadow:none;color:var(--ink)}

/* 与广场筛选使用同尺寸漏斗图标，紧贴搜索框。 */
.shelf-book-toolbar{gap:0!important}.shelf-filter-menu>summary,.script-filter-row .script-filter-menu>summary{width:34px;height:34px;min-height:34px;padding:0;display:flex;align-items:center;justify-content:center;color:var(--ink)}
.shelf-filter-menu>summary::before,.shelf-filter-menu>summary::after,.script-filter-menu>summary::before,.script-filter-menu>summary::after{display:none!important}
.shelf-filter-menu>summary{border-top-right-radius:0;border-bottom-right-radius:0}.shelf-book-toolbar .shelf-book-search{border-top-left-radius:0;border-bottom-left-radius:0;margin-left:-1px}
/* 漏斗在前，搜索外框与按钮等高，清除共用搜索的下边距。 */
.script-list-scope .script-filter-row{gap:0}
.script-filter-row>.script-filter-menu{height:34px;min-height:34px;border:0;margin:0}
.script-filter-row .script-filter-menu>summary{border-radius:5px 0 0 5px;margin:0}
.script-filter-row>.ui-search{flex:1;min-width:0;height:34px;margin:0 0 0 -1px!important}
.script-filter-row>.ui-search>input[type=search],.script-filter-row>input[type=search]{border-radius:0 5px 5px 0}
.script-filter-row .script-filter-fields{left:0;right:auto}
.shelf-filter-menu[open]>summary,.script-filter-menu[open]>summary{color:var(--accent);background:var(--soft)}

.shelf-filter-menu>summary>.ui-disclosure-arrow,.script-filter-menu>summary>.ui-disclosure-arrow{display:none!important}

.script-filter-row .script-filter-menu>summary,.shelf-book-toolbar .shelf-filter-menu>summary{padding:0!important;box-sizing:border-box}.script-filter-menu>summary>svg,.shelf-filter-menu>summary>svg{width:18px!important;height:18px!important;flex:0 0 18px}

.overall-filter-label{display:flex;align-items:center;gap:8px;font-size:13px;margin:8px 0}.overall-filter-label select{height:34px;max-width:240px}

.script-group-tabs{grid-template-columns:repeat(4,minmax(0,1fr))}.script-group-tabs button{min-width:0;white-space:nowrap}

/* 脚本集演绎沿用本页勾选框，与脚本数量同行。 */
body[data-ui-surface] .collection-play-bar>.collection-play-check{display:flex;align-items:center;gap:4px;min-height:28px;padding:0;margin:0;border:0;background:transparent;white-space:nowrap;font-size:14px;font-weight:400;line-height:1.6;cursor:pointer}
body[data-ui-surface] .collection-play-bar>.collection-play-check>input[type=checkbox]{margin:0!important}

body:not([data-night=true]){--bg:#f2eadf}

body[data-page]:not([data-night=true]){--bg:#f2eadf}

/* 世界观整条拖动：高亮原条目，并在松手前标出插入边界。 */
[data-world-set-manager] .world-set-item{user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;cursor:grab}
[data-world-set-manager] button.world-member-overview{width:100%;padding-right:0;box-sizing:border-box;cursor:grab}
[data-world-set-manager] .world-set-dragging{background:color-mix(in srgb,var(--accent) 18%,var(--paper));outline:2px solid var(--accent);outline-offset:-2px;opacity:1;cursor:grabbing}
[data-world-set-manager] .world-set-dragging button.world-member-overview{cursor:grabbing}
[data-world-set-manager] .world-set-drop-before::before,[data-world-set-manager] .world-set-drop-after::after{content:"";position:absolute;left:0;right:0;height:3px;background:var(--accent);z-index:2;pointer-events:none}
[data-world-set-manager] .world-set-drop-before::before{top:-2px}
[data-world-set-manager] .world-set-drop-after::after{bottom:-2px}

/* 系统设置主页：只调整新卡片与组合页，不改变共用顶栏和页面底图。 */
.settings-home-page.page{padding-top:14px;padding-bottom:32px;}
.settings-home-grid{display:grid;gap:14px;width:100%;max-width:760px;margin:0 auto;}
.settings-home-grid .settings-home-card{box-sizing:border-box;position:relative;display:flex;overflow:hidden;width:100%;margin:0;border:1px solid color-mix(in srgb,var(--accent) 25%,var(--line));border-radius:12px;padding:18px;background:var(--paper);color:var(--ink);text-align:left;box-shadow:0 3px 9px color-mix(in srgb,var(--ink) 5%,transparent);font-family:inherit;line-height:1.4;cursor:pointer;transition:background-color .18s,transform .18s,border-color .18s;}
.settings-home-grid .settings-home-card:active{transform:scale(.985);}
.settings-home-grid .settings-home-card:focus-visible{outline:2px solid var(--accent);outline-offset:3px;}
.settings-home-grid .settings-home-card:hover{border-color:color-mix(in srgb,var(--accent) 55%,var(--line));}
.settings-home-copy{position:relative;z-index:1;display:flex;min-width:0;flex-direction:column;align-items:flex-start;gap:6px;}
.settings-home-copy strong{font-size:16px;line-height:24px;font-weight:500;}
.settings-home-copy small{font-size:12px;font-weight:400;line-height:18px;color:var(--muted);}
.settings-home-grid .settings-home-director{min-height:144px;align-items:center;background:linear-gradient(110deg,var(--paper),color-mix(in srgb,var(--add-button-ink,var(--accent)) 9%,var(--paper)));}
.settings-home-director .settings-home-copy{max-width:calc(100% - 67px);}
.settings-home-director .settings-home-copy small{max-width:228px;}
.settings-home-status{box-sizing:border-box;display:block;max-width:100%;margin-top:7px;padding:3px 10px;border-radius:20px;background:color-mix(in srgb,var(--accent) 12%,var(--paper));color:var(--accent);font-size:12px;font-weight:500;line-height:18px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.settings-home-feather{position:absolute;right:9px;top:17px;width:82px;height:108px;opacity:.7;color:var(--add-button-ink,var(--accent));pointer-events:none;}
.settings-home-feather svg{display:block;width:100%;height:100%;}
.settings-home-pair{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:14px;}
.settings-home-pair .settings-home-card{min-height:152px;flex-direction:column;justify-content:space-between;gap:16px;padding:17px;}
.settings-home-art{display:block;width:44px;height:44px;color:var(--add-button-ink,var(--accent));}
.settings-home-art svg{display:block;width:100%;height:100%;}
.settings-home-pair .settings-home-copy{gap:4px;}
.settings-home-archive .settings-home-copy small{max-width:125px;}
.settings-home-grid .settings-home-engine{min-height:68px;align-items:center;justify-content:space-between;gap:10px;padding:12px 18px;background:color-mix(in srgb,var(--paper) 64%,transparent);box-shadow:none;}
.settings-home-engine .settings-home-copy{gap:1px;}
.settings-home-engine .settings-home-copy strong{font-size:14px;line-height:21px;}
.settings-home-connection{display:flex;flex-shrink:0;align-items:center;gap:6px;font-size:12px;line-height:18px;color:var(--muted);}
.settings-home-connection i{width:7px;height:7px;flex-shrink:0;border-radius:50%;background:var(--muted);opacity:.7;}
.settings-home-connection[data-configured=true] i{background:var(--add-button-ink,var(--accent));opacity:1;}
.settings-announcement.icon{position:absolute;right:18px;top:7px;display:grid;width:32px;height:32px;min-height:32px;padding:6px;place-items:center;border:0;background:transparent;box-shadow:none;color:var(--ink);}
.settings-announcement svg{display:block;width:18px;height:18px;}
.settings-announcement-dot{position:absolute;top:4px;right:3px;width:5px;height:5px;border-radius:50%;background:var(--ui-delete-ink);}
.settings-announcement-dot[hidden]{display:none;}
.settings-hub-tabs{position:sticky;top:48px;z-index:15;display:flex;justify-content:center;gap:0;padding:0 18px;background:var(--bg);border-bottom:1px solid var(--line);}
.settings-hub-tabs button{box-sizing:border-box;flex:1;max-width:250px;min-width:0;height:38px;margin:0;padding:6px 3px;border:0;border-radius:0;background:transparent;color:var(--muted);font-size:13px;line-height:20px;white-space:nowrap;font-weight:400;box-shadow:none;}
.settings-hub-tabs button[aria-current=page]{color:var(--accent);font-weight:500;box-shadow:inset 0 -2px var(--accent);}
.settings-hub-page.page{padding-top:14px;}
[data-settings-vector-host]{max-width:760px;margin:0 auto;}
body[data-night=true] .settings-home-grid .settings-home-card{background:color-mix(in srgb,var(--paper) 93%,var(--add-button-ink,var(--accent)));box-shadow:none;}
body[data-night=true] .settings-home-grid .settings-home-director{background:linear-gradient(110deg,color-mix(in srgb,var(--paper) 93%,var(--add-button-ink,var(--accent))),color-mix(in srgb,var(--paper) 83%,var(--add-button-ink,var(--accent))));}
body[data-night=true] .settings-home-status{color:var(--ink);background:color-mix(in srgb,var(--add-button-ink,var(--accent)) 30%,var(--paper));}
body[data-night=true] .settings-home-grid .settings-home-engine{background:color-mix(in srgb,var(--paper) 65%,transparent);}
@media(min-width:761px){.settings-home-grid .settings-home-director{min-height:156px;padding:24px;}.settings-home-pair .settings-home-card{min-height:164px;padding:22px;}.settings-home-feather{right:36px;width:105px;}.settings-home-director .settings-home-copy{max-width:calc(100% - 130px);}.settings-home-director .settings-home-copy small{max-width:none;}}

/* 设置组合页沿用线上书架的山水桃花底图与取景。 */
body:is([data-page="desktop-settings"],[data-page="writing-library"],[data-page="writing-rules"],[data-page="desktop-reading"],[data-page="image-settings"],[data-page="image-styles"],[data-page="voice-settings"],[data-page="desktop-backup"],[data-page="api"],[data-page="settings-vector"]){isolation:isolate}
body:is([data-page="desktop-settings"],[data-page="writing-library"],[data-page="writing-rules"],[data-page="desktop-reading"],[data-page="image-settings"],[data-page="image-styles"],[data-page="voice-settings"],[data-page="desktop-backup"],[data-page="api"],[data-page="settings-vector"])::before{content:"";position:fixed;inset:0;z-index:-1;pointer-events:none;background:url('./account-home/background-day-landscape.webp') 72% top/auto 100% no-repeat;opacity:.68}
body[data-night="true"]:is([data-page="desktop-settings"],[data-page="writing-library"],[data-page="writing-rules"],[data-page="desktop-reading"],[data-page="image-settings"],[data-page="image-styles"],[data-page="voice-settings"],[data-page="desktop-backup"],[data-page="api"],[data-page="settings-vector"])::before{background-image:url('./account-home/background-landscape.webp')}
.settings-home-top{isolation:isolate}
.settings-home-top::before{content:"";position:absolute;inset:0 auto 0 0;width:146px;pointer-events:none;background:url('./book-home/blossom.webp') left top/146px auto no-repeat;opacity:.65;z-index:-1}
@media(min-width:761px){.settings-hub-tabs{top:76px}body:is([data-page="desktop-settings"],[data-page="writing-library"],[data-page="writing-rules"],[data-page="desktop-reading"],[data-page="image-settings"],[data-page="image-styles"],[data-page="voice-settings"],[data-page="desktop-backup"],[data-page="api"],[data-page="settings-vector"])::before{background-size:cover}}

/* 角色改名适配的开启状态使用绿色，保留原圆角开关与关闭色。 */
.script-rename-setting{--script-rename-on:#486050}
body[data-night=true] .script-rename-setting{--script-rename-on:#65806c}
.script-start-settings .script-rename-setting input[data-script-au-rename]:checked{background:var(--script-rename-on);border-color:var(--script-rename-on)}

/* 阅读与视听沿用当前剧目讯息的页面底图与日夜配色。 */
body:has(.av-page){
 --av-fill:color-mix(in srgb,var(--info-paper) 76%,#93a48c);
 --av-selected:#dfe8d9;
 --av-selected-ink:#303d35;
 background:var(--info-paper) var(--info-wash) center/100% 100% no-repeat fixed!important;
 color:var(--info-ink);
 min-height:100dvh;
}
body[data-night=true]:has(.av-page){--av-selected:#506652;--av-selected-ink:#f0ebdc}
body:has(.av-page)::before{display:none}
body:has(.av-page) #app{background:transparent!important}
body #app .av-header,body #app .av-tabs{
 color:var(--info-ink);background:color-mix(in srgb,var(--info-paper) 93%,transparent);
 border-color:var(--info-line);
}
body #app .av-header :is(.top-title,.icon){color:var(--info-ink)}
body #app .av-tabs{padding-inline:14px}
body #app .av-tabs button{height:32px;min-height:32px;padding:4px 2px;color:var(--info-muted);line-height:1.4;border-radius:0}
body #app .av-tabs button[aria-current=page]{color:var(--info-ink);box-shadow:inset 0 -2px #8b9f88}
body #app .av-tabs[hidden],.av-page [hidden]{display:none!important}
body #app .av-page.page{
 display:grid;align-content:start;gap:12px;width:100%;max-width:760px;margin-inline:auto;
 padding:12px 14px calc(18px + env(safe-area-inset-bottom))!important;
 height:auto;min-height:0;overflow:visible;background:transparent;
 color:var(--info-ink);
}
.av-page :is(.av-reading,.av-reading-main,.av-reading-layout){display:grid;grid-template-columns:minmax(0,1fr);gap:12px;width:100%;margin:0}
.av-page .av-card{min-width:0;padding:12px;border:1px solid var(--info-line);border-radius:7px;background:var(--info-row)}
.av-card h2{margin:0 0 6px;font-size:14px;font-weight:500;line-height:1.4;color:var(--info-ink)}
.av-page :is(.av-display-row,.av-display,.av-theme-row,.av-switch,.av-numeric-row,.av-font-row,.av-adjust-item,.av-image-heading,.av-frequency-row,.av-frequency-values){
 display:flex;align-items:center;gap:6px;min-width:0;margin:0;font-size:13px;line-height:1.4;
}
.av-page .av-reading-main{gap:0}
.av-reading-main>:not(h2){padding:8px 0;border-bottom:1px solid var(--info-line)}
.av-reading-main>:last-child{padding-bottom:0;border-bottom:0}
.av-display-row,.av-theme-row,.av-numeric-row,.av-switch,.av-adjust-item,.av-image-heading,.av-frequency-row{justify-content:space-between}
.av-display,.av-switch{white-space:nowrap}
.av-display-row>.av-switch:only-child{margin-left:auto}
.av-mode{display:flex;align-items:center;padding:2px;gap:2px;border:1px solid var(--info-line);border-radius:16px;background:var(--info-paper)}
.av-page .av-mode button,.av-page .av-theme{padding:2px 8px;min-height:24px;border-radius:14px;font-size:13px;line-height:1.4;box-shadow:none}
.av-page .av-mode button{border:0;background:transparent;color:var(--info-muted);white-space:nowrap}
.av-page .av-mode button[aria-pressed=true],.av-page .av-theme{background:var(--av-selected);color:var(--av-selected-ink)}
.av-page .av-theme{display:flex;justify-content:center;align-items:center;gap:6px;min-height:28px;border:1px solid var(--info-line)}
.av-page .av-theme svg,.av-voice-shortcuts svg{width:16px;height:16px;flex:none}
.av-theme-row>.av-theme,.av-theme-row>.av-switch{flex:1}
.av-theme-row>.av-switch{padding-left:8px}
body #app .av-page input.switch-ui[type=checkbox]{
 appearance:none;position:relative;width:34px;height:19px;min-height:19px;flex:0 0 34px;margin:0;padding:0;
 background:var(--av-fill);border:1px solid var(--info-line);border-radius:20px;box-shadow:none;cursor:pointer;
}
body #app .av-page input.switch-ui[type=checkbox]::after{content:"";width:13px;height:13px;position:absolute;left:2px;top:2px;transform:none;border:0;border-radius:50%;background:#fffcf0;box-shadow:0 1px 2px #10151033;transition:translate .18s ease}
body #app .av-page input.switch-ui[type=checkbox]:checked{background:#788e76}
body #app .av-page input.switch-ui[type=checkbox]:checked::after{translate:15px}
.av-page .av-reading-layout{gap:0}
.av-font-preview{margin:6px 0 8px;min-height:44px;padding-block:10px;border:1px solid var(--info-line);border-radius:6px;background:var(--info-paper);color:var(--info-ink);overflow-wrap:anywhere;text-align:center}
.av-page .av-font-row{padding:4px 0 8px;border-bottom:1px solid var(--info-line)}
.av-font-row select{flex:1;width:0;min-width:0;margin:0}
.av-font-row label{white-space:nowrap}
.av-page :is(.av-font-row button,.av-gallery-actions button){min-height:28px;height:28px;padding:3px 9px;font-size:13px;white-space:nowrap}
.av-adjust-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:10px}
.av-page .av-adjust-item{padding:8px 0 4px;gap:4px;white-space:nowrap}
.av-page .av-stepper{display:flex;align-items:stretch;flex:none;height:28px;min-width:0;border:1px solid var(--info-line);border-radius:5px;overflow:hidden;background:var(--info-paper)}
body #app .av-page .av-stepper :is(button,input,output){
 display:grid;place-items:center;width:auto;height:26px;min-height:26px;min-width:0;max-width:none;padding:0 2px;margin:0;
 border:0;border-radius:0;background:transparent;color:var(--info-ink);box-shadow:none;text-align:center;font-size:13px;line-height:1.4;
}
body #app .av-page .av-stepper button:not(.av-value){width:22px;flex:0 0 22px;background:var(--av-fill);font-size:16px}
body #app .av-page .av-stepper :is(input,output,.av-value){width:43px;flex:0 0 43px;font-variant-numeric:tabular-nums}
body #app .av-page .av-stepper input{appearance:textfield}
.av-stepper input::-webkit-inner-spin-button,.av-stepper input::-webkit-outer-spin-button{appearance:none;margin:0}
body #app .av-page .av-stepper :focus-visible{outline:2px solid #8b9f88;outline-offset:-2px}
.av-page .av-image-card{padding:0;overflow:clip}
.av-image-heading{padding:10px 12px 4px}
.av-image-heading h2{margin:0;flex:1}
.av-image-heading:has(+#av-plot-content[hidden]),.av-image-heading:has(+#av-plot-content>.av-frequency[hidden]){padding-bottom:10px}
.av-page .av-plot-fold{display:grid;place-items:center;width:26px;height:26px;min-height:26px;margin:0 0 0 -5px;padding:0;border:0;background:transparent;box-shadow:none;color:var(--info-ink)}
.av-plot-fold svg{display:block;width:15px;height:15px;pointer-events:none}
.av-plot-fold[aria-expanded=true] svg{transform:rotate(90deg)}
.av-image-heading .av-switch span{width:1px;height:1px;overflow:hidden;position:absolute;clip-path:inset(50%)}
.av-frequency{padding:0 12px 8px;margin:0}
.av-page .av-frequency-row{min-height:36px;gap:4px}
.av-page .av-frequency-values{gap:4px;justify-content:flex-end;white-space:nowrap}
body #app .av-page .av-frequency .av-stepper:nth-of-type(2) input{width:29px;flex-basis:29px}
.av-page .av-engine>summary,.av-page .av-gallery-bar summary{
 display:flex;align-items:center;gap:6px;min-height:34px;padding:6px 12px;
 color:var(--info-ink);font-size:13px;line-height:1.4;cursor:pointer;list-style:none;
}
.av-page :is(.av-engine,.av-gallery-bar) summary::-webkit-details-marker{display:none}
.av-page :is(.av-engine,.av-gallery-bar) summary::before{display:none!important}
.av-page :is(.av-engine,.av-gallery-bar) summary>.ui-disclosure-arrow{order:1;margin-left:auto}
.av-image-card .av-engine>summary{background:var(--av-selected);color:var(--av-selected-ink);justify-content:center}
.av-image-card .av-engine>summary>.ui-disclosure-arrow{margin-left:1px}
.av-engine summary small{font-size:12px;color:inherit;opacity:.87}
.av-engine-body{padding:8px 12px}
.av-page .av-engine-body :is(.image-settings,.image-api,.image-enable-options,.image-model-list,.menu-list){max-width:none;margin:0;padding:0;border:0;background:transparent;min-height:0}
.av-page .av-engine-body .image-model-heading{display:none}
.av-page .av-engine-body .image-model-list{padding-block:4px 6px}
.av-page .av-engine-body .image-model-list>.hint{margin:4px 0 7px}
.av-page .av-engine-body .image-model-row{padding:5px 0;min-height:35px}
.av-page .av-engine-body .image-model-add-area{margin:6px 0 2px}
.av-page .av-engine-body .menu-item{min-height:36px;padding:5px 0;background:transparent}
.av-page .av-engine-body .menu-item small{display:none}
.av-page .av-gallery{margin:2px 0 0;max-width:none}
body #app .av-visual-page.page{
 height:calc(100dvh - var(--ui-top-height,48px) - 33px);
 grid-template-rows:auto minmax(0,1fr);overflow:hidden;
}
.av-visual-page>.av-image-card{max-height:52dvh;overflow:auto}
.av-visual-page .av-gallery{display:flex;min-height:0;flex-direction:column}
.av-visual-page .av-gallery :is(.av-gallery-bar,.style-gallery-status){flex:none}
.av-visual-page .av-gallery-list{min-height:0;overflow:auto;overscroll-behavior:contain}
.av-gallery-bar{position:relative;display:flex;justify-content:space-between;align-items:start;gap:8px;margin-bottom:12px}
.av-page .av-gallery-bar summary{
 min-height:28px;height:28px;padding:3px 8px;border:1px solid var(--info-line);border-radius:5px;
 background:var(--info-row);white-space:nowrap;
}
.av-gallery-bar summary>.ui-disclosure-arrow{margin-left:1px}
.av-gallery-bar .style-gallery-fields{
 position:absolute;z-index:10;inset:34px 0 auto;padding:12px;border:1px solid var(--info-line);border-radius:7px;
 max-height:44dvh;overflow:auto;background:var(--info-paper);box-shadow:0 8px 26px #10151022;
}
.av-gallery-actions{display:flex;gap:8px;white-space:nowrap}
.av-page :is(.av-gallery-actions .quiet,.av-font-row button){
 border:1px solid var(--info-line);background:var(--info-row);color:var(--info-ink);
}
.av-page .av-gallery-actions .primary{background:var(--av-selected);color:var(--av-selected-ink);border-color:var(--info-line)}
.av-gallery .style-card-grid{gap:12px}
body #app .av-gallery .style-card{
 position:relative;display:block;width:100%;min-width:0;height:auto;min-height:0;aspect-ratio:1;padding:0;margin:0;
 border:1px solid var(--info-line);border-radius:7px;background:var(--info-row);color:var(--info-ink);overflow:hidden;text-align:left;box-shadow:none
}
.av-gallery .style-card-caption{background:var(--info-paper);border:0;color:var(--info-ink)}
.av-gallery .style-card-system-badge{right:auto;left:6px}
.av-gallery .style-card:has(.style-card-system-badge) .style-card-status{top:30px}
.av-default-style{position:absolute;top:6px;right:6px;padding:2px 6px;border-radius:4px;background:#657d65;color:#fff;font-size:12px;line-height:16px}
.av-page .voice-full{width:100%;max-width:none}
.av-page .voice-full [data-voice-screen]{gap:12px}
.av-voice-shortcuts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.av-page .voice-full .av-voice-shortcuts .voice-entry{
 display:flex;flex-direction:column;justify-content:center;gap:5px;min-height:53px;padding:5px 2px;border:1px solid var(--info-line);
 border-radius:5px;background:var(--info-row);color:var(--info-ink);font-size:13px;line-height:1.4;text-align:center;
}
.av-voice-shortcuts .voice-entry :is(small,span[aria-hidden]){display:none}
.av-page .voice-full :is(.av-voice-play,.av-voice-engine) .voice-entry{min-height:36px;padding:6px 0;font-size:13px;color:var(--info-ink);border-color:var(--info-line)}
.av-page .voice-full :is(.av-voice-play,.av-voice-engine) .voice-entry:last-child{border-bottom:0}
.av-page .av-voice-engine{padding:0}
.av-page .av-voice-engine[open]>summary{border-bottom:1px solid var(--info-line)}
.av-page .av-voice-engine .av-engine-body{display:grid}
@media(max-width:380px){
 .av-page .av-display-row{gap:4px}
 .av-page .av-mode button{padding-inline:5px}
 .av-page .av-frequency-values{gap:3px}
 body #app .av-page .av-frequency .av-stepper button{width:19px;flex-basis:19px}
}
@media(min-width:761px){
 body #app .av-page.page{padding-inline:22px!important}
}

/* 设置内页沿用当前剧目讯息的水墨桃影；主页保留已确认花景。 */
body:is([data-page="writing-library"],[data-page="writing-rules"],[data-page="writing-rule-editor"],[data-page="desktop-reading"],[data-page="image-settings"],[data-page="image-styles"],[data-page="voice-settings"],[data-page="desktop-backup"],[data-page="api"],[data-page="settings-vector"])::before{background-image:url('./story-info-wash-day.svg')!important;background-position:center!important;background-size:100% 100%!important;background-repeat:no-repeat!important;opacity:1}
body[data-night=true]:is([data-page="writing-library"],[data-page="writing-rules"],[data-page="writing-rule-editor"],[data-page="desktop-reading"],[data-page="image-settings"],[data-page="image-styles"],[data-page="voice-settings"],[data-page="desktop-backup"],[data-page="api"],[data-page="settings-vector"])::before{background-image:url('./story-info-wash-night.svg')!important}
body #app .settings-hub-tabs{--settings-tab-ink:#303d35}
body[data-night=true] #app .settings-hub-tabs{--settings-tab-ink:#c9c9bc}
body #app .settings-hub-tabs button[aria-current=page]{color:var(--settings-tab-ink);font-weight:400;text-decoration-line:underline!important;text-decoration-thickness:2px!important;text-underline-offset:4px!important;box-shadow:none}

body[data-page="writing-rule-editor"]{isolation:isolate}
body[data-page="writing-rule-editor"]::before{content:"";position:fixed;inset:0;z-index:-1;pointer-events:none}

/* 生图模型选择预览：整页滚动，选用状态与参数编辑分别显示。 */
body #app .av-visual-page.page{height:auto;grid-template-rows:none;overflow:visible}
.av-visual-page>.av-image-card{max-height:none;overflow:visible}
.av-visual-page .av-gallery-list{overflow:visible}
.av-page .av-models-card .av-engine-body{padding:0}
.av-page .av-models-card .image-enable-options{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 0 10px;border-bottom:1px solid var(--info-line)}
.av-models-card .image-enable-options h2{margin:0}
.av-page .av-models-card .image-enable-options .check-row{margin:0;padding:0;gap:6px;font-size:13px;min-height:28px;border:0}
.av-page .av-models-card .image-model-heading{display:flex;justify-content:space-between;align-items:center;gap:8px;margin:12px 0 4px;font-size:13px;line-height:20px;font-weight:500}
.av-models-card [data-av-model-count]{font-size:12px;font-weight:400;color:var(--info-muted)}
.av-page .av-models-card .image-model-list>.hint{margin:0 0 10px;font-size:12px;line-height:1.5}
body #app .av-page .av-model-choice{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px;min-height:64px;margin:0 0 8px;padding:9px 10px;border:1px solid var(--info-line);border-radius:6px;background:var(--info-row)}
body #app .av-page .av-model-choice[data-selected=true]{background:#e3eadf;border-color:#89a084}
body[data-night=true] #app .av-page .av-model-choice[data-selected=true]{background:#2f3d33;border-color:#6e8f74}
body #app .av-page .av-model-choice>.check-row{display:flex;align-items:center;gap:10px;width:100%;min-width:0;min-height:44px;margin:0;padding:0;border:0;background:transparent}
body #app .av-model-choice input[type=checkbox]{appearance:none!important;flex:none;width:18px!important;min-width:18px!important;height:18px!important;min-height:18px!important;padding:0!important;margin:0!important;border:1px solid var(--info-muted)!important;border-radius:3px!important;background:transparent!important;box-shadow:none!important}
body #app .av-model-choice input[type=checkbox]:checked{border-color:#65806c!important;background:#65806c url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='m4 9 3.2 3.2L14 5.5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/18px 18px no-repeat!important}
body #app .av-model-choice input:focus-visible{outline:2px solid #65806c;outline-offset:3px}
.av-model-copy{display:grid;grid-template-columns:minmax(0,1fr);gap:1px;min-width:0}
body #app .av-model-copy [data-image-model-label]{font-size:14px;font-weight:500;line-height:1.4;overflow-wrap:anywhere;color:var(--info-ink)}
.av-model-copy small,.av-model-state{font-size:12px;line-height:1.4;color:var(--info-muted)}
.av-model-choice[data-selected=true] .av-model-state{color:#486050}
body[data-night=true] .av-model-choice[data-selected=true] .av-model-state{color:#b0c8ac}
body #app .av-model-choice .image-model-detail{height:28px;min-height:28px;align-self:center;white-space:nowrap;font-size:13px;padding:3px 8px}
.av-page .av-models-card .image-model-add-area{margin-top:10px}
.av-models-off{margin:10px 0 0;font-size:12px;line-height:1.5}
.av-page .av-cloud-card .menu-list{padding:0;margin:0;border:0;background:transparent}
.av-page .av-cloud-card .menu-item{padding:0;min-height:34px;background:transparent;border:0}
.av-page .av-cloud-card .menu-item small{display:none}
.av-page .av-gallery>h2{font-size:14px;font-weight:500;margin:0 0 10px;line-height:1.4}

.av-model-copy{grid-template-columns:minmax(0,1fr) auto;gap:3px 6px}
.av-model-copy [data-image-model-label]{grid-column:1;grid-row:1}
.av-model-copy small{grid-column:1/-1;grid-row:2}
.av-model-copy .av-model-state{grid-column:2;grid-row:1;align-self:center;white-space:nowrap}

.av-page .av-models-card .image-model-list{display:block;padding:0}
body #app .av-model-choice .image-model-detail{background:var(--info-row)!important;color:var(--info-ink)!important;border:1px solid var(--info-line)!important}

/* 阅读与视听沿正式广场的一级菱形标记、二级浅底页签。 */
body #app .av-tabs{--av-tab-marker:16.666%;position:sticky;gap:0;padding-inline:18px;border-bottom:1px solid var(--info-line)}
body #app .av-tabs:has(button:nth-child(2)[aria-current=page]){--av-tab-marker:50%}
body #app .av-tabs:has(button:nth-child(3)[aria-current=page]){--av-tab-marker:83.333%}
body #app .av-tabs button{position:relative;height:32px;min-height:32px;padding:3px 2px;line-height:24px;font-size:13px}
body #app .av-tabs button[aria-current=page]{text-decoration:none!important;font-weight:500;background:linear-gradient(0deg,color-mix(in srgb,var(--info-ink) 8%,transparent),transparent 60%)}
body #app .av-tabs button[aria-current=page]::after{content:"";position:absolute;width:5px;height:5px;left:calc(50% - 3px);bottom:-3px;transform:rotate(45deg);background:var(--info-paper);border:1px solid var(--info-ink);z-index:1}
.av-visual-tabs{display:flex;gap:6px;padding:3px 0;margin:0}
body #app .av-visual-tabs>button{height:24px;min-height:24px;padding:1px 10px;line-height:20px;font-size:12px;font-weight:400;border:0;border-radius:4px;background:transparent;color:var(--info-muted);box-shadow:none}
body #app .av-visual-tabs>button[aria-pressed=true]{background:var(--info-soft,var(--soft));color:var(--info-ink)}
.av-visual-panel{display:grid;gap:12px;min-width:0}
.av-visual-panel[hidden]{display:none!important}
.av-visual-panel>.av-image-card{max-height:none;overflow:visible}
@media(min-width:761px){body #app .av-visual-tabs>button{height:26px;min-height:26px;padding:2px 12px}}

/* 云端保存留在可见底部，列表末尾预留空间。 */
.av-visual-panel[data-av-visual-panel=config]{padding-bottom:74px}
body #app .av-visual-panel>.av-cloud-card{position:fixed;z-index:16;bottom:calc(12px + env(safe-area-inset-bottom));left:14px;right:14px;margin:0;background:var(--info-paper);box-shadow:0 -3px 12px #20282012}
@media(min-width:761px){body #app .av-visual-panel>.av-cloud-card{left:22px;right:22px}}

.av-page .av-image-heading .av-switch span{position:static;clip-path:none;width:auto;height:auto;overflow:visible;font-size:13px;line-height:20px}

/* 叙事引导复用阅读与视听的内页底板、卡片与分类栏。 */
body:has(.narrative-page){--paper:var(--info-paper);--ink:var(--info-ink);--muted:var(--info-muted);--line:var(--info-line)}
body #app .narrative-page .narrative-menu{display:block;padding:0 12px;margin:0}
body #app .narrative-page .menu-item{display:flex;align-items:center;justify-content:space-between;min-height:48px;margin:0;padding:10px 0;border:0;border-bottom:1px solid var(--info-line);border-radius:0;background:transparent;color:var(--info-ink);font-size:14px;line-height:20px;font-weight:400;box-shadow:none}
body #app .narrative-page .menu-item:last-child{border-bottom:0}
body #app .narrative-page .check-row{display:flex;align-items:center;justify-content:flex-start;gap:6px;min-height:28px;padding:0;margin:0;border:0;font-size:13px;line-height:20px;color:var(--info-ink)}
.narrative-page input[type=checkbox]{flex:none;width:16px;height:16px;min-height:16px;margin:0;accent-color:#65806c}
.narrative-card{display:grid;gap:12px}
.narrative-page .narrative-choice-controls>label{display:grid;gap:3px;margin:0;font-size:13px;line-height:18px}
.narrative-page .narrative-choice-controls select{box-sizing:border-box;width:100%;height:34px;min-height:34px;margin:0;border:1px solid var(--info-line);border-radius:5px;background:var(--info-paper);color:var(--info-ink)}
.narrative-page .writing-user-list{display:grid;gap:12px;margin:0}
.narrative-page .writing-custom{display:flex;align-items:center;gap:8px;margin:0;padding:12px;border:1px solid var(--info-line);border-radius:7px;background:var(--info-row)}
.narrative-page .writing-custom h3{flex:1;min-width:0;margin:0;font-size:14px;line-height:20px;font-weight:500;overflow-wrap:anywhere}
.narrative-page .writing-custom button{height:28px;min-height:28px;margin:0;padding:3px 10px;font-size:13px;line-height:20px}
.narrative-page .writing-custom [data-action=writing-delete]{color:var(--ui-delete-ink)}
body #app .narrative-page .narrative-direction-toolbar{display:flex;padding:8px 12px}
body #app .narrative-page .narrative-directions-card{display:block;margin:0;padding:0 12px}
.narrative-page [data-narrative-directions]>.pulse-direction-scroll{padding:0}
body #app .narrative-page .pulse-direction-group>summary{min-height:46px;font-size:14px;line-height:20px;color:var(--info-ink)}
.narrative-page .pulse-direction-group>summary::before{display:none!important}
.narrative-page .pulse-direction-group:last-of-type{border-bottom:0!important}
.narrative-page .pulse-direction-list label{display:flex;align-items:flex-start;gap:6px;min-width:0;margin:0;padding:0;font-size:13px;line-height:20px}
.narrative-page .pulse-direction-list input{margin-top:2px}
.narrative-page .pulse-direction-list label:has(input:checked){color:var(--info-ink)}
.narrative-page .pulse-direction-list small{color:var(--info-muted)}
body[data-page=writing-library] #app .av-tabs button,body[data-page=writing-rules] #app .av-tabs button{height:32px!important;min-height:32px!important}
body #app .narrative-page .pulse-direction-group>summary::after{content:none}
body #app .narrative-page .pulse-direction-list small{color:var(--info-muted)!important}
body #app .narrative-page:has([data-narrative-directions]){flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior-y:contain}
