:root {
  color-scheme: light;
  --phone-width: 393px;
  --phone-frame-border-width: 1px;
  --phone-frame-width: calc(var(--phone-width) + (var(--phone-frame-border-width) * 2));
  --phone-height: 852px;
  --bg: #ede8df;
  --frame: #f9f4ea;
  --panel: #fffdf8;
  --panel-strong: #f1e7d8;
  --ink: #29251f;
  --muted: #746b5f;
  --line: #d9cdbb;
  --accent: #287765;
  --accent-strong: #1f5e50;
  --danger: #9d3b36;
  --shadow: 0 10px 28px rgba(41, 37, 31, 0.14);
  --space: 12px;
  --type-level-1: 20px;
  --type-level-2: 16px;
  --type-level-3: 13px;
  --type-body: 13px;
  --type-caption: 12px;
  --type-value: 18px;
  --app-header-height: 60px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  height: 100%;
}

body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: max(14px, var(--safe-top)) max(14px, var(--safe-right)) max(14px, var(--safe-bottom)) max(14px, var(--safe-left));
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: var(--type-body);
  line-height: 1.5;
}

.demo-shell {
  width: min(100%, var(--phone-width));
}

button,
input,
select {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.app-frame {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(100%, var(--phone-width));
  height: min(calc(100vh - 28px), var(--phone-height));
  height: min(calc(100dvh - 28px), var(--phone-height));
  min-height: 0;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid #cfc0aa;
  border-radius: 18px;
  background: var(--frame);
  box-shadow: var(--shadow);
}

.app-header {
  position: relative;
  order: 1;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  min-height: calc(var(--app-header-height) + var(--safe-top));
  padding: calc(10px + var(--safe-top)) calc(18px + var(--safe-right)) 10px calc(18px + var(--safe-left));
  background: #263c35;
  color: #fffdf8;
  text-align: center;
}

.account-toggle {
  position: absolute;
  right: calc(12px + var(--safe-right));
  top: calc(14px + var(--safe-top));
  min-height: 32px;
  border: 1px solid rgba(255, 253, 248, 0.5);
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(255, 253, 248, 0.12);
  color: #fffdf8;
  font-size: var(--type-caption);
  font-weight: 800;
  cursor: pointer;
}

.account-panel {
  position: absolute;
  top: calc(var(--app-header-height) - 4px + var(--safe-top));
  right: calc(12px + var(--safe-right));
  z-index: 70;
  display: grid;
  gap: 8px;
  width: min(300px, calc(100vw - 32px));
  border: 1px solid #cfc0aa;
  border-radius: 10px;
  padding: 10px;
  background: rgba(255, 253, 248, 0.98);
  color: var(--ink);
  box-shadow: var(--shadow);
  text-align: left;
}

.account-panel input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--panel);
  color: var(--ink);
}

.account-password-form {
  display: grid;
  gap: 8px;
}

.remember-account {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: var(--type-caption);
  font-weight: 700;
}

.remember-account input {
  width: 16px;
  min-height: auto;
  margin: 0;
}

.account-actions,
.account-sync-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.account-panel button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.account-panel .danger {
  border-color: #c9928e;
  color: var(--danger);
}

.account-status {
  color: var(--muted);
  font-size: var(--type-caption);
}

.account-status.is-error {
  color: var(--danger);
}

.account-version {
  margin: -2px 0 0;
  color: rgba(116, 107, 95, 0.58);
  font-size: 10px;
  line-height: 1;
  text-align: right;
}

.account-sync-progress {
  display: grid;
  gap: 4px;
  margin-top: -2px;
}

.account-sync-progress-track {
  position: relative;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(139, 115, 80, 0.16);
}

.account-sync-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #9a7a4f;
  transition: width 0.25s ease;
}

.account-sync-progress.is-indeterminate .account-sync-progress-track span {
  width: 38% !important;
  animation: account-sync-progress-slide 1.1s ease-in-out infinite;
}

.account-sync-progress small {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: var(--type-caption);
  line-height: 1.35;
}

.account-sync-progress small span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-sync-progress small span:last-child {
  flex: 0 0 auto;
}

@keyframes account-sync-progress-slide {
  0% {
    transform: translateX(-105%);
  }
  100% {
    transform: translateX(265%);
  }
}

.login-wall {
  order: 4;
  flex: 1 1 auto;
  display: grid;
  align-content: center;
  gap: 14px;
  min-height: 0;
  padding: 22px 18px calc(22px + var(--safe-bottom));
  background: var(--frame);
}

.login-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  background: var(--panel);
  box-shadow: 0 8px 18px rgba(41, 37, 31, 0.08);
}

.login-card h2 {
  margin: 0;
  font-size: var(--type-level-1);
  line-height: 1.25;
}

.login-card p {
  margin: 0;
}

.login-card input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fffdf8;
  color: var(--ink);
}

.login-card .remember-account input {
  width: 16px;
  min-height: auto;
  padding: 0;
}

.login-help-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  background: #eef7f2;
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(41, 37, 31, 0.06);
}

.login-help-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--accent-strong);
  font-size: var(--type-body);
}

.login-help-card ol {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 1.2em;
  color: var(--muted);
  font-size: var(--type-caption);
  line-height: 1.5;
}

.login-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.login-actions button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.login-actions button:first-child {
  border-color: var(--accent);
  background: var(--accent);
  color: #fffdf8;
}

.app-header h1 {
  margin: 0;
  max-width: calc(100% - 112px);
  overflow-wrap: anywhere;
  font-size: 24px;
  line-height: 1.2;
}

.guild-name-button {
  max-width: 100%;
  border: 0;
  min-height: 36px;
  padding: 2px 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: inherit;
  font-weight: 800;
  text-align: center;
}

.guild-name-input {
  width: min(100%, 280px);
  min-height: 36px;
  border: 1px solid rgba(255, 253, 248, 0.62);
  border-radius: 8px;
  padding: 2px 8px;
  background: rgba(255, 253, 248, 0.12);
  color: inherit;
  font-size: 24px;
  font-weight: 800;
  text-align: center;
}

.summary-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--panel);
}

.summary-card span {
  display: block;
  color: inherit;
  font-size: var(--type-caption);
  opacity: 0.72;
}

.summary-card strong {
  display: block;
  margin-top: 2px;
  font-size: var(--type-value);
}

.global-summary {
  order: 3;
  flex: 0 0 auto;
  padding: 6px 14px;
  border-top: 1px solid var(--line);
  background: var(--frame);
}

.resource-summary.summary-grid {
  grid-template-columns: 1fr;
  gap: 0;
}

.global-summary .summary-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
  border-radius: 8px;
  padding: 6px 10px;
}

.global-summary .summary-card span {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  opacity: 1;
}

.global-summary .summary-card strong {
  margin: 0;
  font-size: 12px;
  font-weight: 400;
}

.record-notebook-summary {
  display: grid;
  gap: 0;
}

.record-notebook-summary.is-section-open {
  position: absolute;
  top: calc(var(--app-header-height) + var(--safe-top));
  right: 0;
  bottom: 69px;
  left: 0;
  z-index: 25;
  overflow: hidden;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: var(--frame);
}

.record-notebook-panel {
  display: grid;
  gap: 0;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  background: var(--panel);
}

.record-notebook-panel.is-detail {
  height: 100%;
  min-height: 0;
  grid-template-rows: auto 1fr;
  gap: 10px;
  border-radius: 12px;
  padding: 10px 12px 12px;
}

.record-notebook-panel.is-open {
  gap: 6px;
}

.record-notebook-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 22px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.record-notebook-toggle span {
  font-size: 15px;
  font-weight: 800;
}

.record-notebook-toggle em {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  font-style: normal;
  white-space: nowrap;
}

.record-notebook-category-list {
  display: grid;
  gap: 6px;
}

.record-notebook-category-button {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2px 10px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  background: #fffaf1;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.record-notebook-category-button span {
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
}

.record-notebook-category-button em {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.record-notebook-detail-head {
  display: grid;
  grid-template-columns: minmax(34px, auto) 1fr minmax(34px, auto);
  align-items: center;
  gap: 8px;
}

.record-notebook-detail-head .plain-button.compact,
.record-notebook-detail-spacer {
  min-width: 34px;
}

.record-notebook-detail-head .plain-button.compact {
  min-height: 23px;
  padding: 2px 8px;
  border-radius: 6px;
  line-height: 1;
}

.record-notebook-detail-spacer {
  min-height: 23px;
}

.record-notebook-detail-head strong {
  min-width: 0;
  text-align: center;
}

.record-notebook-detail-scroll {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 4px;
}

.record-notebook-section {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 7px;
}

.record-notebook-section:first-child {
  border-top: 0;
  padding-top: 0;
}

.record-notebook-section h4 {
  margin: 0;
  color: var(--accent-strong);
  font-size: 13px;
}

.record-notebook-section p {
  display: grid;
  gap: 2px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.record-notebook-section p strong {
  color: var(--ink);
  font-size: 12px;
}

.record-notebook-section p em {
  font-style: normal;
}

.record-notebook-entry {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.record-notebook-entry-toggle {
  display: block;
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 8px;
  background: #fffaf1;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.record-notebook-entry-toggle:disabled {
  cursor: default;
  color: var(--muted);
  background: rgba(255, 250, 241, 0.55);
}

.record-notebook-entry-toggle strong {
  font-size: 12px;
}

.record-notebook-entry.is-expanded .record-notebook-entry-toggle {
  border-color: rgba(37, 128, 107, 0.45);
  background: #eef8f2;
}

.record-notebook-entry-detail {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 0 8px 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.record-notebook-entry-detail span,
.record-notebook-entry-detail em {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.record-notebook-entry-detail em {
  font-style: normal;
}

.tab-bar {
  order: 4;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(54px, 1fr));
  gap: 4px;
  padding: 8px;
  border-top: 1px solid var(--line);
  background: #fbf6ed;
}

.tab-button {
  position: relative;
  display: grid;
  gap: 2px;
  place-items: center;
  min-height: 52px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}

.tab-button.has-attention::after {
  content: "!";
  position: absolute;
  top: 5px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #d13a32;
  color: #fffdf8;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 0 0 2px #fbf6ed;
}

.tab-button span {
  font-size: 19px;
  line-height: 1;
}

.tab-button.is-active {
  border-color: var(--line);
  background: #fffdf8;
  color: var(--accent-strong);
  font-weight: 700;
}

.tab-button.is-hidden {
  display: none;
}

.screen-stack {
  position: relative;
  order: 2;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px calc(14px + var(--safe-right)) 14px calc(14px + var(--safe-left));
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.screen {
  display: none;
}

.screen.is-active {
  display: grid;
  gap: var(--space);
}

.screen.is-active.is-opening-title,
.screen.is-active.is-opening-summary {
  min-height: 100%;
}

.screen.is-opening-title .story-beat-card,
.screen.is-opening-summary .story-beat-card {
  display: none;
}

.screen.is-active.is-opening-title {
  place-items: center;
}

.screen.is-active.is-opening-summary {
  grid-template-rows: auto 1fr;
}

.screen-title {
  margin: 0;
}

.screen-title h2 {
  margin: 0;
  font-size: var(--type-level-1);
  text-align: center;
}

.weapon-leaderboard-button {
  position: absolute;
  left: calc(12px + var(--safe-left));
  top: calc(14px + var(--safe-top));
  z-index: 13;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  min-height: 32px;
  border: 1px solid rgba(255, 234, 164, 0.72);
  border-radius: 999px;
  padding: 0;
  background:
    linear-gradient(180deg, rgba(255, 239, 169, 0.98), rgba(211, 157, 47, 0.96));
  color: #5a3a05;
  box-shadow:
    inset 0 1px 0 rgba(255, 253, 248, 0.55),
    0 1px 4px rgba(20, 28, 23, 0.26);
  cursor: pointer;
}

.weapon-leaderboard-button svg {
  width: 19px;
  height: 19px;
  fill: rgba(255, 253, 248, 0.2);
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.weapon-leaderboard-list {
  display: grid;
  gap: 8px;
}

.weapon-leaderboard-status {
  display: grid;
  gap: 8px;
}

.weapon-leaderboard-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.weapon-leaderboard-toolbar small {
  color: var(--muted);
  font-size: var(--type-caption);
  line-height: 1.4;
}

.weapon-leaderboard-limit-button {
  flex: 0 0 auto;
  min-height: 32px;
  border: 1px solid rgba(40, 119, 101, 0.34);
  border-radius: 999px;
  padding: 5px 12px;
  background: #e0f0ea;
  color: var(--accent-strong);
  font-size: var(--type-caption);
  font-weight: 800;
  line-height: 1;
  box-shadow:
    inset 0 1px 0 rgba(255, 253, 248, 0.75),
    0 1px 2px rgba(41, 37, 31, 0.08);
  cursor: pointer;
}

.weapon-leaderboard-limit-button:hover {
  border-color: rgba(40, 119, 101, 0.52);
  background: #d6ebe3;
  color: var(--accent-strong);
}

.weapon-leaderboard-entry {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel);
  cursor: pointer;
}

.weapon-leaderboard-entry.is-expanded {
  background: #fffdf8;
}

.weapon-leaderboard-rank {
  display: grid;
  place-items: center;
  min-width: 52px;
  min-height: 32px;
  border-radius: 6px;
  background: #2f473e;
  color: #fffdf8;
  font-size: var(--type-caption);
  font-weight: 800;
}

.weapon-leaderboard-rank.is-medal {
  min-width: 52px;
  min-height: 32px;
  border: 0;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
}

.weapon-leaderboard-medal {
  position: relative;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.82);
  color: #b78518;
  font-size: 15px;
  line-height: 1;
  box-shadow:
    inset 0 1px 0 rgba(255, 253, 248, 0.82),
    0 1px 2px rgba(41, 37, 31, 0.12);
}

.weapon-leaderboard-medal::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(255, 253, 248, 0.55);
  border-radius: inherit;
}

.weapon-leaderboard-rank.is-gold .weapon-leaderboard-medal {
  color: #b88310;
  background: linear-gradient(180deg, #fff4b8, #e4bb4b);
}

.weapon-leaderboard-rank.is-silver .weapon-leaderboard-medal {
  color: #6f7b80;
  background: linear-gradient(180deg, #ffffff, #cbd5d8);
}

.weapon-leaderboard-rank.is-bronze .weapon-leaderboard-medal {
  color: #9b5a25;
  background: linear-gradient(180deg, #f7c58f, #c57a3b);
}

.weapon-leaderboard-body {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.weapon-leaderboard-body strong {
  overflow-wrap: anywhere;
}

.weapon-leaderboard-body small {
  color: var(--muted);
  font-size: var(--type-caption);
}

.weapon-leaderboard-entry .inventory-detail {
  grid-column: 1 / -1;
  cursor: default;
}

#storyChapterTitle {
  text-align: center;
}

.story-opening-panel {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 100%;
  border: 0;
  padding: 24px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: center;
}

.story-opening-title {
  font-size: 24px;
  font-weight: 800;
}

.story-opening-summary-text {
  max-width: 30ch;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.editable-party-title {
  display: flex;
  justify-content: center;
  min-width: 0;
}

.party-name-button {
  max-width: 100%;
  border: 0;
  min-height: 36px;
  padding: 2px 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: var(--type-level-1);
  font-weight: 800;
  text-align: center;
}

.party-name-input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 3px 7px;
  background: #fffdf8;
  color: var(--ink);
  font-size: var(--type-level-1);
  font-weight: 800;
  text-align: center;
}

.screen-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: var(--type-body);
}

.card h3 {
  margin: 0 0 8px;
  font-size: var(--type-level-2);
}

.protagonist-card {
  display: grid;
  gap: 8px;
}

.protagonist-head {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

#protagonistNameSlot {
  min-width: 0;
}

.protagonist-head > span {
  color: var(--muted);
  font-size: 12px;
}

#protagonistTitleSlot {
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
}

.protagonist-card p,
.story-beat-card p,
.story-main-items-card p,
.story-beat-card small {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.protagonist-support {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.protagonist-support h3 {
  margin: 0;
  font-size: 15px;
}

.support-toggle {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 28px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.support-toggle span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.protagonist-name-button {
  max-width: 180px;
  border: 0;
  min-height: 36px;
  padding: 4px 0;
  background: transparent;
  color: var(--accent-strong);
  cursor: pointer;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
  text-align: right;
  overflow-wrap: anywhere;
}

.protagonist-name-edit {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 6px;
  width: 100%;
}

.protagonist-name-edit input {
  min-width: 0;
  min-height: 34px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 4px 8px;
  background: #fffdf8;
  color: var(--ink);
  font-weight: 800;
}

.card.story-beat-card,
.card.story-main-items-card {
  position: relative;
  display: grid;
  gap: 8px;
  border-color: #bda46f;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff9eb;
}

.story-beat-card.is-hidden,
.story-main-items-card.is-hidden {
  display: none;
}

.story-beat-card.has-attention::after {
  content: "!";
  position: absolute;
  top: 10px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #d13a32;
  color: #fffdf8;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 0 0 2px #fff9eb;
}

.story-beat-card h3,
.story-main-items-card h3 {
  margin-bottom: 0;
  font-size: 15px;
}

.story-notebook-toggle,
.story-main-items-toggle {
  display: block;
  width: 100%;
  min-height: 24px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.story-notebook-toggle h3,
.story-main-items-toggle h3 {
  margin: 0;
  font-size: 15px;
}

.story-notebook-content {
  display: grid;
  gap: 8px;
}

.story-chapter-entry {
  display: grid;
  gap: 8px;
}

.story-chapter-button {
  display: block;
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  text-align: left;
}

.story-section-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0 0 0 20px;
  list-style: none;
}

.story-section-item {
  border: 1px solid #e2cf9a;
  border-radius: 10px;
  padding: 10px;
  background: #fffdf8;
}

.story-section-item > strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
}

.story-section-item p strong {
  color: var(--ink);
}

.story-main-item-list {
  display: grid;
  gap: 8px;
}

.story-main-dungeon-item {
  display: grid;
  gap: 8px;
}

.story-main-dungeon-item > strong {
  margin-bottom: 0;
}

.story-main-dungeon-item ol {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.story-main-dungeon-item li {
  display: grid;
  gap: 3px;
  border-top: 1px solid #eadbb4;
  padding-top: 6px;
}

.story-main-dungeon-item li:first-child {
  border-top: 0;
  padding-top: 0;
}

.story-main-dungeon-item li strong {
  color: var(--ink);
  font-size: 13px;
}

.objective-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 13px;
}

.objective-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #fbf6ed;
}

.objective-item strong,
.support-card strong {
  display: block;
  color: var(--ink);
}

.objective-item p,
.support-card p {
  margin: 3px 0 0;
}

.objective-item small {
  display: block;
  margin-top: 4px;
}

.objective-action {
  margin-top: 8px;
}

.objective-item > span {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 3px 7px;
  background: #eee5d8;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.objective-item.is-active {
  border-color: var(--accent);
  background: #eef7f2;
}

.objective-item.is-active > span {
  background: #d3eadf;
  color: var(--accent-strong);
}

.objective-item.is-complete {
  opacity: 0.72;
}

.objective-item.is-complete > span {
  background: #e0f0ea;
  color: var(--accent-strong);
}

.objective-item.is-locked {
  opacity: 0.55;
}

.support-list {
  display: grid;
  gap: 6px;
}

.support-card {
  border: 1px solid #d8c285;
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff9e8;
  color: var(--muted);
  font-size: 12px;
}

.card,
.party-card,
.member-card,
.inventory-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: 14px;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: var(--space);
}

.field span {
  color: var(--muted);
  font-size: 13px;
}

.field small {
  color: var(--muted);
  font-size: 12px;
}

.field input,
.field select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
}

.field select {
  min-height: 38px;
  padding: 6px 10px;
}

.primary-button,
.plain-button,
.danger-button {
  min-height: 44px;
  border-radius: 10px;
  cursor: pointer;
}

.primary-button {
  width: 100%;
  border: 0;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.plain-button {
  margin-bottom: 0;
  border: 1px solid var(--line);
  background: #fffdf8;
  color: var(--accent-strong);
}

.plain-button.compact {
  width: auto;
  min-height: 34px;
  padding: 4px 10px;
  margin-bottom: 0;
}

.primary-button.compact {
  width: auto;
  min-height: 34px;
  padding: 4px 10px;
}

.danger-button {
  border: 1px solid #bc746e;
  background: var(--danger);
  color: #fff;
  font-weight: 800;
}

.danger-button:hover {
  background: #7f2f2b;
}

.primary-button:disabled,
.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.66;
}

.dispatch-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: var(--space);
}

.dispatch-card-head h3 {
  margin: 0;
}

.dispatch-difficulty-toggle {
  flex: 0 0 76px;
  min-height: 32px;
  border: 1px solid #bc746e;
  border-radius: 10px;
  background: #fffdf8;
  color: #9b3a1c;
  font-weight: 800;
  cursor: pointer;
}

.dispatch-difficulty-toggle.is-active {
  background: var(--danger);
  color: #fff;
}

.dispatch-difficulty-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.dispatch-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 8px;
  align-items: stretch;
}

.dispatch-reservation-button {
  min-width: 72px;
  padding: 0 10px;
  font-size: 15px;
  line-height: 1;
  white-space: nowrap;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
}

.summary-card {
  border-color: var(--line);
  background: var(--panel);
}

.summary-card strong {
  font-size: 16px;
}

.guild-menu,
.shop-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
  gap: 8px;
  margin-bottom: 0;
}

.shop-actions {
  grid-template-columns: repeat(5, 1fr);
}

.guild-expansion-panel {
  display: grid;
  gap: var(--space);
}

.guild-expansion-card {
  display: grid;
  gap: 12px;
}

.guild-expansion-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.guild-expansion-head h3,
.guild-expansion-head p {
  margin: 0;
}

.guild-expansion-head p {
  color: var(--muted);
  font-size: var(--type-caption);
}

.guild-expansion-head > strong {
  color: var(--accent-strong);
  font-size: 22px;
  line-height: 1.1;
}

.guild-expansion-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.guild-expansion-step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  background: #fbf6ed;
}

.guild-expansion-step.is-complete {
  border-color: #b7d1c6;
  background: #eef8f4;
}

.guild-expansion-step.is-next {
  border-color: var(--accent);
  background: #f1faf6;
}

.guild-expansion-step span {
  display: grid;
  gap: 2px;
}

.guild-expansion-step strong {
  font-size: var(--type-body);
}

.guild-expansion-step small {
  color: var(--muted);
  font-size: var(--type-caption);
}

.guild-expansion-step em {
  color: var(--accent-strong);
  font-size: var(--type-caption);
  font-style: normal;
  font-weight: 800;
}

.menu-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffdf8;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
}

.menu-button.is-active {
  border-color: var(--accent);
  background: #e0f0ea;
  color: var(--accent-strong);
  font-weight: 800;
}

.menu-button:disabled {
  cursor: not-allowed;
  color: #9a9186;
  background: #eee5d8;
}

.party-list,
.member-overview-list,
.inventory-list,
.history-list {
  display: grid;
  gap: var(--space);
}

#partyListView,
#partyDetailView,
#partyDetail {
  display: grid;
  gap: var(--space);
}

.party-card {
  display: grid;
  gap: var(--space);
  cursor: pointer;
}

.party-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(40, 119, 101, 0.12);
}

.party-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
}

.party-head > div {
  min-width: 0;
}

.party-head h3,
.member-card h3 {
  margin: 0;
  font-size: var(--type-level-2);
}

.party-head p,
.member-card p,
.inventory-item p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: var(--type-body);
}

.active-badge {
  border-radius: 999px;
  padding: 4px 8px;
  background: #e0f0ea;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.active-badge.busy {
  background: #f8e1c6;
  color: #8f5315;
}

.party-loot-rates {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 0 1 auto;
  justify-content: flex-end;
  margin: 0;
}

.party-loot-rates span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid rgba(40, 119, 101, 0.22);
  border-radius: 999px;
  padding: 3px 8px;
  background: #eef6f1;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.muted-text {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.party-detail-stack {
  display: grid;
  gap: var(--space);
}

.formation-card {
  display: grid;
  gap: var(--space);
}

.formation-card h3 {
  margin-bottom: 0;
}

.formation-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
}

.formation-slot {
  display: grid;
  grid-template-rows: 46px 16px 18px;
  gap: 2px;
  align-items: center;
  min-width: 0;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 5px 3px;
  background: #fffaf1;
  color: var(--ink);
  text-align: center;
  overflow: hidden;
}

button.formation-slot {
  cursor: pointer;
}

.formation-grid.is-editable .formation-slot.has-member {
  cursor: grab;
  touch-action: none;
}

.formation-grid.is-editable.has-pending-slot .formation-slot.has-member {
  border-color: rgba(40, 119, 101, 0.52);
  background: #edf7f2;
}

.formation-slot.is-dragging {
  border-color: var(--accent);
  background: #e0f0ea;
  opacity: 0.72;
}

.formation-slot.is-empty {
  display: grid;
  place-items: center;
  border-style: dashed;
  color: #9a9186;
  background: rgba(255, 253, 248, 0.62);
}

.formation-grid.is-editable .formation-slot.is-empty {
  cursor: pointer;
}

.formation-portrait {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 46px;
  margin: 0 auto;
  border-radius: 9px;
  background: #e8f2ee;
  line-height: 1;
  overflow: hidden;
}

.formation-avatar {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.formation-empty-number {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: #e2f0eb;
  color: #82938e;
  font-weight: 800;
}

.formation-name {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1px;
  min-width: 0;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.formation-name-text,
.formation-hp {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.formation-hp {
  justify-self: center;
  border-radius: 999px;
  min-width: 5ch;
  padding: 2px 3px;
  background: var(--panel-strong);
  font-size: 10px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.reserve-picker {
  display: grid;
  gap: 8px;
}

.reserve-picker h4 {
  margin: 0;
  font-size: 13px;
}

.reserve-list {
  display: grid;
  gap: 8px;
}

.reserve-member {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 8px;
  align-items: center;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 8px;
  background: #fffaf1;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.reserve-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  overflow: hidden;
  background: #e8f2ee;
}

.reserve-avatar-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.reserve-member strong,
.reserve-member small {
  display: block;
}

.reserve-member small {
  color: var(--muted);
  font-size: 12px;
}

.reserve-party-name {
  color: var(--accent-strong);
  font-weight: 800;
}

.reserve-member em {
  border-radius: 999px;
  padding: 3px 6px;
  background: var(--panel-strong);
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.member-overview-row {
  position: relative;
  min-height: 72px;
  border-radius: 10px;
  overflow: hidden;
  touch-action: pan-y;
}

.member-overview-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #fffaf1;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: transform 0.18s ease;
}

.member-overview-row.is-delete-open .member-overview-card {
  transform: translateX(-78px);
}

.member-overview-avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #e8f2ee;
  overflow: hidden;
}

.member-overview-avatar-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.member-overview-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.member-overview-body strong,
.member-overview-body small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-overview-body strong {
  font-size: var(--type-body);
  font-weight: 800;
}

.member-overview-body small {
  color: var(--muted);
  font-size: var(--type-caption);
}

.member-overview-delete {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  width: 78px;
  border-radius: 0 10px 10px 0;
}

.hire-panel {
  display: grid;
  gap: var(--space);
}

.hire-identity-card,
.hire-card,
.hire-preview-card,
.hire-summary-card {
  display: grid;
  gap: 10px;
}

.hire-card h3,
.hire-preview-card h3 {
  margin-bottom: 0;
}

.hire-identity-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.hire-avatar-picker {
  align-self: center;
}

.hire-avatar-menu {
  left: -2px;
}

.hire-name-field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.hire-name-field span {
  color: var(--muted);
  font-size: var(--type-caption);
}

.hire-name-field input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 10px;
  background: #fffdf8;
  color: var(--ink);
  font-weight: 800;
}

.hire-random-button {
  min-width: 58px;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.talent-choice-grid {
  max-height: calc((36px * 4) + (8px * 3));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  scrollbar-gutter: stable;
}

.choice-button {
  display: grid;
  gap: 2px;
  align-items: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 5px 8px;
  background: #fffdf8;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.talent-choice-grid .choice-button {
  min-height: 36px;
}

.choice-button.is-active {
  border-color: var(--accent);
  background: #e0f0ea;
  color: var(--accent-strong);
  box-shadow: 0 0 0 2px rgba(40, 119, 101, 0.1);
}

.choice-button span {
  font-weight: 800;
}

.choice-button em {
  color: var(--muted);
  font-style: normal;
  font-size: var(--type-caption);
}

.choice-button.is-active em {
  color: var(--accent-strong);
}

.hire-option-description {
  display: grid;
  gap: 4px;
  margin-top: 2px;
  color: var(--muted);
  font-size: var(--type-caption);
  line-height: 1.55;
}

.hire-option-description p {
  margin: 0;
}

.hire-option-body + .hire-option-detail {
  margin-top: 8px;
}

.talent-option-description {
  gap: 6px;
}

.talent-option-description .hire-option-detail {
  color: var(--ink);
  font-weight: 700;
}

.hire-gender-control {
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
}

.hire-preview-head,
.hire-summary-card {
  display: grid;
  gap: 10px;
  align-items: center;
}

.hire-preview-head {
  grid-template-columns: 1fr auto;
}

.hire-summary-card {
  grid-template-columns: 1fr;
}

.hire-preview-head h3 {
  margin: 0;
  font-size: var(--type-level-2);
}

.hire-preview-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: var(--type-body);
}

.hire-summary-card .primary-button {
  grid-column: 1 / -1;
}

.small-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffdf8;
  color: var(--ink);
  cursor: pointer;
}

.small-button.primary {
  border-color: var(--accent);
  background: #e0f0ea;
  color: var(--accent-strong);
  font-weight: 800;
}

.member-card {
  display: grid;
  gap: 10px;
}

.member-actions {
  display: grid;
  gap: 8px;
}

.member-actions .danger-button {
  width: 100%;
}

.member-story-card {
  display: grid;
  gap: 10px;
}

.member-story-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.member-story-card-head h3 {
  margin: 0;
  min-width: 0;
}

.story-npc-rebirth-menu {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  border: 1px solid rgba(109, 83, 56, 0.14);
  border-radius: 8px;
  padding: 8px;
  background: #fffaf0;
}

.story-npc-rebirth-option {
  min-height: 76px;
}

.member-head {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
}

.member-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  padding: 0;
  background: #e2f0eb;
  color: inherit;
  overflow: hidden;
}

.member-avatar-button {
  cursor: pointer;
}

.member-avatar-picker {
  position: relative;
  width: 44px;
  height: 44px;
}

.member-avatar-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, 34px);
  gap: 6px;
  width: max-content;
  max-width: calc(100vw - 32px);
  border: 1px solid rgba(109, 83, 56, 0.22);
  border-radius: 8px;
  padding: 8px;
  background: #fffdf8;
  box-shadow: 0 14px 28px rgba(67, 47, 30, 0.18);
}

.member-avatar-option {
  display: block;
  width: 34px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 0;
  background: #efe3d1;
  cursor: pointer;
  overflow: hidden;
}

.member-avatar-option:hover,
.member-avatar-option:focus-visible {
  border-color: var(--accent);
  outline: 2px solid rgba(132, 91, 52, 0.2);
  outline-offset: 1px;
}

.member-avatar-option.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(132, 91, 52, 0.22);
}

.member-avatar-option-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.member-avatar {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.member-name-button {
  border: 0;
  min-height: 36px;
  padding: 2px 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: inherit;
  font-weight: 800;
  text-align: left;
}

.member-name-input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 3px 7px;
  background: #fffdf8;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
}

.level-badge {
  border-radius: 10px;
  padding: 5px 8px;
  background: var(--panel-strong);
  font-size: 13px;
  font-weight: 800;
}

.promotion-head-button {
  position: relative;
  min-height: 34px;
  border: 1px solid rgba(40, 119, 101, 0.35);
  border-radius: 8px;
  padding: 5px 10px;
  background: #e0f0ea;
  color: var(--accent-strong);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.promotion-picker {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(40, 119, 101, 0.24);
  border-radius: 8px;
  padding: 10px;
  background: #f5fbf7;
}

.promotion-picker h4 {
  margin: 0;
  font-size: var(--type-level-3);
}

.promotion-option-card {
  display: grid;
  gap: 7px;
  border-top: 1px solid rgba(109, 83, 56, 0.14);
  padding-top: 8px;
}

.promotion-option-card:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.promotion-option-card div {
  display: flex;
  align-items: center;
}

.promotion-option-card strong {
  font-size: 14px;
}

.promotion-option-card span,
.promotion-option-card p {
  color: var(--muted);
  font-size: 12px;
}

.promotion-option-card p {
  margin: 0;
  line-height: 1.45;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.stat-grid span {
  border-radius: 8px;
  padding: 5px 6px;
  background: #f3ecdf;
  font-size: 12px;
  white-space: nowrap;
}

.member-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.member-info-panel {
  min-width: 0;
  border: 1px solid rgba(109, 83, 56, 0.18);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 253, 248, 0.62);
}

.member-info-panel.wide {
  grid-column: 1 / -1;
}

.member-info-panel h4 {
  margin: 0 0 8px;
  font-size: var(--type-level-3);
}

.member-info-panel-head {
  position: relative;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 8px;
}

.member-info-panel-head h4 {
  margin: 0;
}

.member-info-panel p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: var(--type-caption);
  line-height: 1.5;
}

.member-info-panel .detail-plain-text {
  display: block;
  width: 100%;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: var(--type-caption);
  line-height: 1.5;
  text-indent: 0;
}

.member-action-control-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
}

.member-action-control {
  display: grid;
  grid-template-columns: auto 42px;
  gap: 6px;
  align-items: center;
  min-height: 28px;
  justify-content: start;
}

.member-action-control span {
  min-width: 0;
  color: var(--ink);
  font-size: var(--type-caption);
  font-weight: 700;
  white-space: nowrap;
}

.combat-behavior-editor {
  position: relative;
}

.combat-behavior-summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 0;
  border-radius: 10px;
  padding: 5px 10px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  list-style: none;
  white-space: nowrap;
}

.combat-behavior-summary:hover,
.combat-behavior-editor[open] .combat-behavior-summary {
  background: var(--accent-strong);
}

.combat-behavior-summary::-webkit-details-marker {
  display: none;
}

.combat-behavior-summary:disabled {
  background: var(--accent);
  cursor: not-allowed;
  opacity: 0.66;
}

.combat-behavior-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  display: grid;
  width: min(360px, calc(100vw - 48px));
  max-height: min(560px, 72vh);
  gap: 10px;
  overflow: auto;
  border: 1px solid rgba(109, 83, 56, 0.22);
  border-radius: 8px;
  padding: 10px;
  background: #fffdf8;
  box-shadow: 0 14px 30px rgba(62, 45, 28, 0.16);
}

.combat-skill-order-section {
  display: grid;
  gap: 8px;
}

.combat-skill-order-section h5 {
  margin: 0;
  font-size: var(--type-caption);
}

.combat-skill-order-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.combat-skill-order-list li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 42px auto;
  gap: 8px;
  align-items: center;
  border-top: 1px solid rgba(109, 83, 56, 0.12);
  padding-top: 6px;
}

.combat-skill-order-list li:first-child {
  border-top: 0;
  padding-top: 0;
}

.combat-skill-order-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: #f3ecdf;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.combat-skill-order-body {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.combat-skill-order-body strong,
.combat-skill-order-body span,
.combat-skill-order-body em {
  min-width: 0;
  overflow-wrap: anywhere;
}

.combat-skill-order-body strong {
  font-size: var(--type-caption);
}

.combat-skill-order-body span,
.combat-skill-order-body em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.combat-skill-order-actions {
  display: flex;
  gap: 4px;
}

.combat-skill-order-actions .plain-button.compact {
  min-width: 30px;
  min-height: 30px;
  padding: 0;
}

.combat-behavior-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.action-switch {
  appearance: none;
  position: relative;
  width: 42px;
  height: 24px;
  margin: 0;
  border: 1px solid rgba(109, 83, 56, 0.28);
  border-radius: 999px;
  background: #eee5d7;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.action-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fffdf8;
  box-shadow: 0 1px 2px rgba(45, 34, 24, 0.22);
  transition: transform 0.16s ease;
}

.action-switch:checked {
  border-color: rgba(40, 119, 101, 0.42);
  background: var(--accent);
}

.action-switch:checked::after {
  transform: translateX(18px);
}

.action-switch:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.detail-subsection {
  display: grid;
  gap: 3px;
}

.detail-subsection + .detail-subsection {
  margin-top: 8px;
}

.detail-subsection .detail-plain-text {
  margin: 0;
}

.detail-subsection > strong {
  color: var(--ink);
  font-size: var(--type-level-3);
  line-height: 1.35;
}

.final-panel-rows {
  display: grid;
  gap: 2px;
}

.final-panel-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  column-gap: 8px;
  align-items: start;
}

.final-panel-row-label {
  color: var(--ink);
  font-size: var(--type-caption);
  font-weight: 400;
  line-height: 1.5;
}

.final-panel-row > span {
  min-width: 0;
}

.career-path-list li span:first-child {
  border-radius: 7px;
  padding: 4px 6px;
  background: #f3ecdf;
  font-size: var(--type-caption);
  font-weight: 700;
}

.career-path-list,
.compact-detail-list {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.career-path-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 8px;
  align-items: center;
}

.career-path-list li strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--type-body);
}

.career-path-list li em {
  grid-column: 2;
  color: var(--muted);
  font-size: var(--type-caption);
  font-style: normal;
}

.compact-detail-list li {
  display: grid;
  gap: 4px;
  justify-items: stretch;
  color: var(--muted);
  font-size: var(--type-caption);
  line-height: 1.5;
}

.compact-detail-list li.is-locked {
  opacity: 0.72;
}

.compact-detail-list li strong {
  color: var(--ink);
  font-size: var(--type-level-3);
  line-height: 1.5;
}

.compact-detail-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.compact-detail-head span {
  justify-self: end;
  border-radius: 7px;
  padding: 3px 6px;
  background: #f3ecdf;
  color: var(--ink);
  font-size: var(--type-caption);
  font-weight: 700;
  white-space: nowrap;
}

.compact-detail-list li em {
  display: block;
  width: 100%;
  color: var(--muted);
  font-size: var(--type-caption);
  font-style: normal;
  line-height: 1.5;
  text-indent: 0;
}

.skill-detail-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.skill-detail-list li {
  display: grid;
  grid-template-columns: minmax(64px, 1fr) auto;
  gap: 2px 8px;
  align-items: center;
  justify-items: stretch;
}

.skill-detail-list li.is-disabled {
  opacity: 0.55;
}

.skill-detail-list li.is-locked {
  opacity: 0.72;
}

.skill-detail-list strong {
  font-size: var(--type-body);
  line-height: 1.5;
}

.skill-detail-list span {
  justify-self: start;
  border-radius: 7px;
  padding: 3px 6px;
  background: #f3ecdf;
  font-size: var(--type-caption);
  font-weight: 700;
}

.skill-detail-list em {
  display: block;
  grid-column: 1 / -1;
  width: 100%;
  color: var(--muted);
  font-size: var(--type-caption);
  font-style: normal;
  line-height: 1.5;
  text-indent: 0;
}

.skill-detail-list .skill-unlock-state {
  grid-column: 2;
  justify-self: end;
}

.weapon-affinity-list {
  display: grid;
  gap: 4px;
}

.item-name {
  color: var(--ink);
  font-weight: 800;
}

@keyframes item-rarity-rainbow-flow {
  from {
    background-position: 0% 50%;
  }

  to {
    background-position: 200% 50%;
  }
}

.item-rarity-common {
  color: var(--ink);
}

.item-rarity-fine {
  color: #21835a;
}

.item-rarity-excellent {
  color: #246fd1;
}

.item-rarity-rare {
  color: #7a47b8;
}

.item-rarity-legendary {
  color: #b7791f;
}

.item-rarity-mythic {
  color: #c7362f;
}

.item-rarity-supreme_legendary {
  color: #d88921;
}

.item-rarity-creation_mythic {
  color: #8b5cf6;
}

.item-unique-affix {
  color: #8b5cf6;
}

@supports ((background-clip: text) or (-webkit-background-clip: text)) {
  .item-name.item-rarity-supreme_legendary:not(.equipment-summary) {
    background-image: linear-gradient(105deg, #8a5d20 0%, #d88921 28%, #fff2b8 52%, #d68a1f 76%, #7e4c14 100%);
    background-size: 160% 100%;
    background-position: 0% 50%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 10px rgba(255, 216, 109, 0.28);
  }

  .item-name.item-rarity-creation_mythic:not(.equipment-summary) {
    background-image: linear-gradient(105deg, #ff4d6d 0%, #ff9f1c 18%, #ffe66d 34%, #35d07f 50%, #38bdf8 66%, #8b5cf6 82%, #ff4d6d 100%);
    background-size: 220% 100%;
    background-position: 0% 50%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 12px rgba(139, 92, 246, 0.28);
    animation: item-rarity-rainbow-flow 5s linear infinite;
  }

  .item-name.item-unique-affix:not(.equipment-summary) {
    background-image: linear-gradient(105deg, #ff4d6d 0%, #ff9f1c 18%, #ffe66d 34%, #35d07f 50%, #38bdf8 66%, #8b5cf6 82%, #ff4d6d 100%);
    background-size: 220% 100%;
    background-position: 0% 50%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 12px rgba(139, 92, 246, 0.28);
    animation: item-rarity-rainbow-flow 5s linear infinite;
  }
}

@media (prefers-reduced-motion: reduce) {
  .item-name.item-rarity-creation_mythic:not(.equipment-summary),
  .item-name.item-unique-affix:not(.equipment-summary) {
    animation: none;
  }
}

.inventory-category {
  display: grid;
  gap: 6px;
}

.inventory-filter-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.inventory-filter-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 9px;
  background: var(--panel);
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
}

.inventory-filter-button.is-active {
  border-color: var(--accent);
  background: #e0f0ea;
  color: var(--accent-strong);
  font-weight: 800;
}

.inventory-filter-button em {
  border-radius: 999px;
  padding: 1px 6px;
  background: var(--panel-strong);
  color: var(--muted);
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
}

.inventory-rarity-filter-bar {
  padding-top: 2px;
}

.inventory-sale-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  border: 1px solid rgba(40, 119, 101, 0.22);
  border-radius: 10px;
  padding: 9px 10px;
  background: #eef7f2;
}

.inventory-sale-toolbar div {
  display: grid;
  gap: 2px;
}

.inventory-sale-toolbar strong {
  color: var(--accent-strong);
  font-size: 13px;
}

.inventory-sale-toolbar span {
  color: var(--muted);
  font-size: 12px;
}

.inventory-category-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.inventory-category-toggle span {
  color: var(--accent-strong);
  font-weight: 800;
}

.inventory-category-toggle em {
  min-width: 24px;
  border-radius: 999px;
  padding: 2px 7px;
  background: var(--panel-strong);
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.inventory-category.is-expanded .inventory-category-toggle {
  border-color: var(--accent);
  background: #f5fbf8;
}

.inventory-category-items {
  display: grid;
  gap: 6px;
}

.inventory-notice {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  background: #fffaf1;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.inventory-notice-success {
  border-color: rgba(40, 119, 101, 0.35);
  background: #e9f5ef;
  color: var(--accent-strong);
}

.inventory-notice-warning {
  border-color: rgba(174, 91, 83, 0.35);
  background: #fff0ed;
  color: #7f2f2b;
}

.inventory-item {
  display: block;
  align-items: center;
  min-height: 38px;
  margin-left: 2em;
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
}

.inventory-item.is-expanded {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(40, 119, 101, 0.12);
}

.inventory-item strong {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  line-height: 1.25;
}

.inventory-item-badges {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  flex: 0 0 auto;
}

.inventory-lock-badge {
  border-radius: 999px;
  padding: 2px 7px;
  background: #fff0ed;
  color: #7f2f2b;
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.inventory-stack-count {
  border-radius: 999px;
  padding: 2px 7px;
  background: var(--panel-strong);
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.inventory-detail {
  grid-column: 1 / -1;
  display: grid;
  gap: var(--space);
  padding-top: var(--space);
  border-top: 1px solid var(--line);
}

.inventory-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.inventory-detail-grid span,
.inventory-rules span {
  border-radius: 8px;
  padding: 6px 7px;
  background: #f3ecdf;
  color: var(--muted);
  font-size: 12px;
}

.inventory-detail-grid strong {
  color: var(--ink);
}

.inventory-detail-section {
  display: grid;
  gap: 7px;
}

.inventory-detail-section h4 {
  margin: 0;
  font-size: 13px;
}

.inventory-affix-row {
  display: grid;
  gap: 5px;
  border-radius: 10px;
  padding: 8px;
  background: #fffaf1;
}

.inventory-affix-row strong {
  font-size: 13px;
}

.inventory-affix-row-unique {
  border: 1px solid rgba(139, 92, 246, 0.22);
}

.inventory-rules {
  display: grid;
  gap: 6px;
}

.enhancement-panel {
  border-top: 1px solid var(--line);
  padding-top: var(--space);
}

.enhancement-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.enhancement-grid span {
  border-radius: 8px;
  padding: 6px 7px;
  background: #f3ecdf;
  color: var(--muted);
  font-size: 12px;
}

.enhancement-grid strong {
  color: var(--ink);
}

.enhance-button {
  justify-self: start;
}

.sale-quantity-field {
  display: grid;
  grid-template-columns: auto minmax(72px, 120px);
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.sale-quantity-field input {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
}

.sale-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.adventure-list,
.adventure-detail,
.record-detail {
  display: grid;
  gap: var(--space);
}

.adventure-detail,
.record-detail {
  margin-top: 0;
}

.record-library {
  display: grid;
  gap: 10px;
}

.record-library-card {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: var(--panel);
}

.record-library-card h3 {
  margin: 0;
  font-size: 15px;
}

.record-library-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.codex-entry-list {
  display: grid;
  gap: 6px;
}

.codex-entry {
  display: grid;
  gap: 3px;
  border: 1px solid rgba(80, 64, 41, 0.1);
  border-radius: 8px;
  padding: 7px 8px;
  background: #fffaf1;
}

.codex-entry span,
.codex-entry em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

.expedition-card,
.record-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: 12px;
  cursor: pointer;
}

.expedition-card {
  position: relative;
}

.expedition-card__head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
  min-width: 0;
}

.expedition-card__title {
  display: block;
  min-width: 0;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.expedition-card__time {
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  text-align: right;
  white-space: nowrap;
}

.expedition-card.has-attention .expedition-card__time {
  padding-right: 22px;
}

.expedition-card.has-attention::after {
  content: "!";
  position: absolute;
  top: 12px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #d13a32;
  color: #fffdf8;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 0 0 2px var(--panel);
}

.expedition-card.is-selected,
.record-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(40, 119, 101, 0.12);
}

.progress-bar {
  overflow: hidden;
  height: 8px;
  margin-top: 10px;
  border-radius: 999px;
  background: #eadfce;
}

.progress-bar span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: var(--accent);
}

.dungeon-progress-list {
  display: grid;
  gap: 8px;
  margin: 10px 0 12px;
}

.dungeon-progress-summary {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #fffaf1;
}

.dungeon-progress-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
}

.dungeon-progress-status-mark {
  flex: 0 0 auto;
  width: 14px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.dungeon-progress-requirement {
  flex: 1 1 180px;
  color: #9b3a1c;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.dungeon-progress-percent {
  margin-left: auto;
  color: var(--accent);
  font-weight: 800;
}

.dungeon-progress-summary p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.mini-log {
  max-height: 320px;
  overflow: auto;
  border: 1px solid #201c17;
  border-radius: 12px;
  padding: 12px;
  background: #24201a;
  color: #f8ead4;
  white-space: pre-wrap;
  font-size: 13px;
}

.expedition-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: stretch;
  margin-top: 12px;
}

.expedition-actions .mini-log {
  margin: 0;
}

.expedition-actions .danger-button {
  min-width: 72px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(41, 37, 31, 0.36);
}

.confirm-dialog {
  width: min(100%, 340px);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.confirm-dialog h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.confirm-dialog p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.quick-sale-dialog {
  width: min(100%, 420px);
}

.quick-sale-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.quick-sale-dialog-head h3 {
  margin: 0;
}

.quick-sale-mode-toggle {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid rgba(40, 119, 101, 0.3);
  border-radius: 8px;
  overflow: hidden;
  background: #fffaf1;
}

.quick-sale-mode-toggle button {
  min-width: 48px;
  border: 0;
  border-radius: 0;
  padding: 6px 9px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.quick-sale-mode-toggle button.is-active {
  background: var(--accent);
  color: #fff;
}

.quick-sale-fieldset {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.quick-sale-fieldset legend {
  padding: 0 4px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
}

.quick-sale-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
  gap: 8px;
}

.quick-sale-checkbox {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  border: 1px solid rgba(72, 62, 48, 0.16);
  border-radius: 8px;
  padding: 6px 8px;
  background: #fffaf1;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.quick-sale-checkbox input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
  flex: 0 0 auto;
}

.quick-sale-checkbox span {
  line-height: 1.25;
  white-space: pre-line;
}

.quick-sale-level-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  border: 1px solid rgba(72, 62, 48, 0.16);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fffaf1;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.quick-sale-level-control {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.quick-sale-level-control input {
  width: 72px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  text-align: center;
}

.quick-sale-level-control em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  white-space: nowrap;
}

.quick-sale-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  border: 1px solid rgba(40, 119, 101, 0.22);
  border-radius: 8px;
  padding: 9px 10px;
  background: #eef7f2;
}

.quick-sale-summary strong {
  color: var(--accent-strong);
  font-size: 14px;
}

.quick-sale-summary span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.event-timeline {
  display: grid;
  gap: var(--space);
  margin: 12px 0;
}

.progress-event {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #fffaf1;
}

.progress-event time {
  color: var(--muted);
  font-size: 12px;
}

.progress-event strong {
  font-size: 14px;
}

.progress-event p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  white-space: pre-wrap;
}

.progress-event p strong {
  color: var(--ink);
  font-weight: 800;
}

.progress-label-main-quest {
  color: var(--danger);
  font-weight: 800;
}

.progress-event.is-battle {
  border-color: #cdbb96;
  background: #fff6e4;
}

.progress-event.is-main-quest > strong {
  color: var(--danger);
}

.record-card ul {
  margin: 8px 0 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 13px;
}

.record-card > span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.record-card em,
.expedition-card em {
  display: inline-block;
  margin-top: 8px;
  color: var(--accent-strong);
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 18px;
  background: rgba(255, 253, 248, 0.62);
  color: var(--muted);
  text-align: center;
}

.empty-state.compact {
  border-radius: 8px;
  padding: 10px;
  font-size: var(--type-caption);
}

.is-hidden {
  display: none;
}

.gm-footer {
  position: fixed;
  right: calc(16px + var(--safe-right));
  bottom: calc(18px + var(--safe-bottom));
  z-index: 60;
  width: auto;
  max-width: calc(100vw - 16px);
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  touch-action: none;
}

.gm-toggle {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  min-height: 56px;
  border: 1px solid #af9a73;
  border-radius: 999px;
  padding: 0;
  background: #263c35;
  color: #fffdf8;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 10px 22px rgba(38, 60, 53, 0.24);
  cursor: grab;
}

.gm-toggle:active {
  cursor: grabbing;
}

.gm-panel {
  position: absolute;
  right: 0;
  bottom: 64px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  width: min(260px, calc(100vw - 24px));
  max-height: min(560px, calc(100vh - 96px));
  overflow: auto;
  padding: 10px;
  border: 1px solid #cfc0aa;
  border-radius: 12px;
  background: rgba(249, 244, 234, 0.96);
  box-shadow: var(--shadow);
}

.gm-footer.is-left-side .gm-panel {
  right: auto;
  left: 0;
}

.gm-footer.is-upper-side .gm-panel {
  top: 64px;
  bottom: auto;
}

.gm-panel.is-hidden {
  display: none;
}

.gm-command {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fffdf8;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.gm-command.danger {
  border-color: #c9928e;
  color: var(--danger);
}

.gm-cloud-grant {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid #d8ccb9;
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.72);
}

.gm-cloud-grant input,
.gm-cloud-grant textarea {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 9px;
  background: #fffdf8;
  color: var(--ink);
  font: inherit;
}

.gm-cloud-grant textarea {
  min-height: 72px;
  padding-block: 8px;
  resize: vertical;
}

.gm-command-status {
  min-height: 16px;
  margin: 0;
  color: var(--muted);
  font-size: var(--type-caption);
  line-height: 1.35;
}

.gm-command-status.is-error {
  color: var(--danger);
}

#partyListView.is-hidden,
#partyDetailView.is-hidden {
  display: none;
}

.equipment-list {
  display: grid;
  gap: var(--space);
}


.equipment-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.equipment-field.is-expanded {
  gap: 8px;
}

.equipment-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 10px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.equipment-summary:disabled {
  opacity: 0.7;
  cursor: default;
}

.equipment-summary-main {
  display: grid;
  min-width: 0;
}

.equipment-summary-main strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.equipment-summary-arrow {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
  text-align: right;
}

.equipment-picker {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  background: #fffdf8;
}

.equipment-filter-bar {
  padding-bottom: 0;
}

.equipment-category {
  gap: 6px;
}

.equipment-choice-list {
  display: grid;
  gap: 6px;
}

.equipment-choice {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 9px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.equipment-choice:hover,
.equipment-choice:focus-visible {
  border-color: var(--accent);
  outline: 0;
}

.equipment-choice.is-equipped {
  border-color: var(--accent);
  background: #f5fbf8;
}

.equipment-choice-check {
  width: 18px;
  color: var(--accent-strong);
  font-weight: 900;
  text-align: center;
}

.equipment-choice-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.equipment-choice-body strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.equipment-choice-body small {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
  white-space: normal;
}

.equipment-choice .inventory-stack-count {
  justify-self: end;
}

.equipment-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.equipment-card-head h3 {
  flex: 0 0 auto;
  margin: 0;
  font-size: var(--type-level-3);
}

.equipment-lock-note {
  flex: 1 1 auto;
  margin: 0;
  font-size: var(--type-caption);
  line-height: 1.35;
  text-align: right;
}

.segmented-control {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffdf8;
}

.segmented-control button {
  min-width: 48px;
  min-height: 32px;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: var(--type-caption);
}

.segmented-control button:first-child {
  border-left: 0;
}

.segmented-control button.is-active {
  background: #e0f0ea;
  color: var(--accent-strong);
  font-weight: 800;
}

.item-stat-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.item-stat-list span {
  border-radius: 999px;
  padding: 3px 7px;
  background: #f3ecdf;
  color: var(--ink);
  font-size: 12px;
}

.item-stat-list .empty-stat {
  color: var(--muted);
}

@media (max-width: 393px) {
  body {
    padding: 0;
  }

  .app-frame {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
}

@media (max-width: 520px) {
  body {
    padding: 0;
  }

  .app-frame {
    height: min(100vh, var(--phone-height));
    height: min(100dvh, var(--phone-height));
  }

  .screen-stack {
    padding: 12px calc(12px + var(--safe-right)) 12px calc(12px + var(--safe-left));
  }

  .gm-toggle {
    width: 52px;
    height: 52px;
    min-height: 52px;
  }

  .gm-command {
    min-height: 36px;
  }

  .member-detail-grid {
    grid-template-columns: 1fr;
  }

  .member-info-panel.wide {
    grid-column: auto;
  }

  .story-npc-rebirth-menu {
    grid-template-columns: 1fr;
  }

  .guild-menu,
  .shop-actions {
    grid-template-columns: 1fr 1fr;
  }
}
