.sp-overlay {
  --sp-ink: #293e37;
  --sp-outline: #564b38;
  --sp-weak: #6d6655;
  --sp-red: #a63d33;
  --sp-jade: #356955;
  --sp-paper: #fff6dd;
  --sp-rule: #d8c7a5;
  --sp-accent: #9e4036;
  --sp-frame: #71513e;
  position: absolute;
  z-index: 60;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  isolation: isolate;
  font: 500 1rem/1.45 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--sp-ink);
  letter-spacing: 0;
  text-shadow: none;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.sp-overlay.sp-viewport { position: fixed; }
.sp-overlay[hidden], .sp-overlay [hidden] { display: none !important; }
.sp-overlay *, .sp-overlay *::before, .sp-overlay *::after { box-sizing: border-box; }
.sp-overlay[data-group="tasks"] { --sp-accent: #886224; --sp-frame: #76603b; }
.sp-overlay[data-group="shop"] { --sp-accent: #3c6b58; --sp-frame: #415f50; }
.sp-overlay[data-group="accounts"] { --sp-accent: #526980; --sp-frame: #515f66; }
.sp-overlay[data-group="options"] { --sp-accent: #6b5765; --sp-frame: #635261; }
.sp-dim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-color: rgba(29, 40, 35, .6);
  animation: sp-fade .13s ease-out both;
}
.sp-sheet {
  display: flex;
  flex-direction: column;
  width: min(100%, 540px);
  max-width: 100%;
  height: min(86%, 790px);
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 3px solid var(--sp-outline);
  border-radius: 7px 7px 0 0;
  background: #f5ead0;
  box-shadow: 0 -3px 0 #f6d99a, 0 -6px 0 var(--sp-outline), 0 12px 60px rgba(31, 33, 27, .24);
  animation: sp-rise .16s ease-out both;
}
.sp-header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  border-bottom: 2px solid #9e825e;
  padding: 9px 12px 10px;
  background: linear-gradient(to bottom, #fff6d9 0 3px, transparent 3px), repeating-linear-gradient(to bottom, transparent 0 3px, rgba(153, 106, 47, .035) 3px 4px), #ecd6a3;
}
.sp-emblem {
  width: 40px;
  height: 40px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  background: #fff4d2;
  border: 2px solid var(--sp-frame);
  border-radius: 3px;
  box-shadow: inset 0 -3px #e3c68a, 2px 2px #b89c72;
}
.sp-overlay h2, .sp-overlay h3, .sp-overlay h4, .sp-overlay p, .sp-overlay ul, .sp-overlay ol, .sp-overlay dl { margin: 0; }
.sp-header h2 {
  margin-right: auto;
  color: var(--sp-ink);
  font-size: 1.3rem;
  line-height: 1.25;
  letter-spacing: .08em;
  font-weight: 900;
}
.sp-overlay button, .sp-overlay textarea {
  font-family: inherit;
  letter-spacing: inherit;
}
.sp-overlay button {
  cursor: pointer;
  touch-action: manipulation;
  -webkit-appearance: none;
  appearance: none;
  text-align: center;
  font-size: .875rem;
  font-weight: 750;
  line-height: 1.35;
  margin: 0;
}
.sp-overlay button:focus-visible, .sp-overlay summary:focus-visible, .sp-overlay textarea:focus-visible {
  outline: 3px solid #5c8b79;
  outline-offset: 2px;
  z-index: 1;
}
.sp-close {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 2px solid var(--sp-frame);
  border-radius: 3px;
  color: var(--sp-ink);
  background: #fff4d6;
  box-shadow: inset 0 -3px #dec494, 1px 2px #b69b72;
}
.sp-close span { position: relative; display: block; width: 17px; height: 17px; }
.sp-close span::before, .sp-close span::after { content: ''; position: absolute; top: 7px; left: -1px; width: 19px; height: 3px; background: #604e3c; transform: rotate(45deg); }
.sp-close span::after { transform: rotate(-45deg); }
.sp-tabs {
  flex: 0 0 auto;
  display: flex;
  gap: 4px;
  padding: 7px 11px;
  background: #fff3d6;
  border-bottom: 1px solid var(--sp-rule);
}
.sp-tabs button {
  border: 1px solid transparent;
  border-radius: 3px;
  flex: 1;
  min-width: 0;
  min-height: 39px;
  padding: 5px 8px;
  background: transparent;
  color: #625944;
  box-shadow: none;
}
.sp-tabs button[aria-current] {
  color: #fff9df;
  background: var(--sp-accent);
  border-color: var(--sp-frame);
  box-shadow: inset 0 2px rgba(255, 255, 255, .16), inset 0 -2px rgba(60, 35, 28, .22);
}
.sp-scroll {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-color: #b5a37d #f5ead0;
  scrollbar-width: thin;
  background-color: #f5ead0;
  background-image: repeating-linear-gradient(to bottom, transparent 0 5px, rgba(140, 108, 65, .025) 5px 6px);
}
.sp-content {
  display: grid;
  gap: 9px;
  align-content: start;
  width: 100%;
  padding: 13px 12px max(20px, env(safe-area-inset-bottom, 0px));
}
.sp-pixel { display: block; width: 30px; height: 30px; object-fit: contain; image-rendering: pixelated; pointer-events: none; }
.sp-stats { display: flex; gap: 7px; }
.sp-stat {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-content: center;
  align-items: center;
  column-gap: 6px;
  flex: 1 1 0;
  min-width: 0;
  min-height: 56px;
  padding: 6px 9px;
  border: 1px solid #bbab86;
  border-bottom: 2px solid #b9a77e;
  border-radius: 3px;
  background: #ece3c9;
}
.sp-stat .sp-pixel { grid-row: span 2; width: 26px; height: 26px; }
.sp-stat span { color: #655f50; font-size: .76rem; line-height: 1.3; }
.sp-stat strong { color: #344c41; font-weight: 800; font-size: .94rem; line-height: 1.35; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sp-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 2px 1px 0; }
.sp-label h3 { font-size: .96rem; font-weight: 850; line-height: 1.4; }
.sp-label > span { color: var(--sp-weak); font-size: .8rem; }
.sp-card, .sp-paper {
  position: relative;
  min-width: 0;
  padding: 12px;
  display: grid;
  gap: 7px;
  border: 1px solid #baaa87;
  border-radius: 4px;
  background-color: var(--sp-paper);
  box-shadow: 0 2px 0 #d6c6a4, inset 0 1px #fffbeb;
}
.sp-card.sp-current { border-color: #a98147; border-top: 4px solid #b39150; padding-top: 10px; }
.sp-card-head { display: flex; gap: 10px; align-items: center; }
.sp-artbox { display: grid; place-items: center; width: 46px; height: 46px; flex: 0 0 auto; border: 1px solid #d4bf94; border-radius: 3px; box-shadow: inset 0 -2px #e2cca0; background-color: #f5e5bf; }
.sp-artbox .sp-pixel { width: 38px; height: 38px; }
.sp-card-title { display: flex; align-items: center; justify-content: space-between; gap: 7px; flex: 1; flex-wrap: wrap; min-width: 0; }
.sp-card h4, .sp-guide h4 { color: var(--sp-ink); font-size: 1.04rem; line-height: 1.3; font-weight: 850; letter-spacing: .01em; }
.sp-status { display: inline-block; font-size: .76rem; font-weight: 700; padding: 2px 5px; color: #655f50; background: #ede4cd; border: 1px solid #d5c8ac; border-radius: 2px; overflow-wrap: anywhere; }
.sp-status.sp-ready { color: #793d31; background: #f9e4cb; border-color: #d9ae8a; }
.sp-status.sp-done { color: #345e4d; background: #e5edd7; border-color: #b7c6a4; }
.sp-copy, .sp-guide p, .sp-note { color: #554e40; font-size: .9rem; line-height: 1.5; }
.sp-card .sp-meta { font-size: .83rem; line-height: 1.45; font-weight: 600; color: #716246; }
.sp-actions { display: flex; align-items: stretch; gap: 7px; flex-wrap: wrap; }
.sp-action {
  min-height: 40px;
  padding: 7px 13px;
  width: auto;
  max-width: 100%;
  justify-self: start;
  border: 1px solid #694839;
  border-bottom: 2px solid #654339;
  border-radius: 3px;
  background: #a9473b;
  box-shadow: inset 0 2px rgba(255, 255, 255, .23), inset 0 -2px rgba(74, 36, 28, .2);
  color: #fff8e7;
}
.sp-action.sp-quiet { color: #514b3d; background: #f1e1b9; border-color: #a18c65; box-shadow: inset 0 2px #fff3d3, inset 0 -2px #ddc798; }
.sp-action:disabled, .sp-action.sp-quiet:disabled { cursor: default; background: #e8dfc7; color: #736b59; border-color: #cbbea0; box-shadow: none; }
.sp-overlay button:active:not(:disabled) { translate: 0 1px; }
.sp-objectives, .sp-ranked, .sp-timeline { list-style: none; padding: 0; }
.sp-objectives { display: grid; gap: 7px; }
.sp-objectives li { display: grid; align-items: center; gap: 1px 6px; grid-template-columns: 15px minmax(0, 1fr) auto; min-height: 30px; font-size: .85rem; }
.sp-objectives li strong, .sp-ranked strong { color: #6f624b; font-size: .8rem; font-weight: 650; }
.sp-tick { width: 13px; height: 13px; background: #eee1be; border: 1px solid #b8a47c; display: flex; justify-content: center; align-items: center; border-radius: 1px; }
.sp-achieved .sp-tick { background: var(--sp-jade); color: #fff7d8; border-color: var(--sp-jade); }
.sp-progress { display: block; height: 6px; width: 100%; overflow: hidden; background: #e3d9bf; border: 1px solid #c4b697; border-radius: 1px; }
.sp-progress i { display: block; height: 100%; background: #789669; }
.sp-objectives .sp-progress, .sp-ranked .sp-progress { grid-column: 2 / -1; height: 4px; border-width: 0; }
.sp-details, .sp-future { color: #655a45; }
.sp-future { padding: 0 8px; background: rgba(255, 247, 219, .6); border: 1px dashed #ac9870; border-radius: 3px; }
.sp-overlay summary { cursor: pointer; font-size: .875rem; font-weight: 700; padding: 10px 3px; }
.sp-future summary > span { margin-left: 6px; color: #7a705d; font-weight: 550; font-size: .82rem; }
.sp-future > article { margin: 0 0 10px; }
.sp-future > article:last-child { margin-bottom: 8px; }
.sp-details summary { padding: 7px 0; }
.sp-empty { display: grid; justify-items: center; gap: 8px; padding: 22px 16px; text-align: center; color: var(--sp-weak); font-size: .9rem; }
.sp-empty .sp-pixel { width: 38px; height: 38px; }
.sp-dl { font-variant-numeric: tabular-nums; }
.sp-dl div { padding: 5px 0; display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px dotted #d4c5a4; font-size: .91rem; }
.sp-dl div:last-child { border-bottom: 0; }
.sp-dl dd { margin: 0; font-weight: 750; color: #5f5644; }
.sp-ranked { display: grid; gap: 8px; }
.sp-ranked li { display: grid; grid-template-columns: 21px 1fr auto; gap: 3px 6px; align-items: center; font-size: .88rem; }
.sp-ranked b { grid-row: span 2; display: grid; align-items: center; justify-items: center; font-size: .78rem; background: #eed9a2; border-radius: 2px; color: #745323; }
.sp-ranked .sp-progress i { background: #ca9a56; }
.sp-table { border-collapse: collapse; width: 100%; font-size: .83rem; line-height: 1.5; font-variant-numeric: tabular-nums; }
.sp-table th, .sp-table td { text-align: right; padding: 6px 3px; border-bottom: 1px dotted #d4c5a4; }
.sp-table th:first-child { text-align: left; }
.sp-table thead th { color: var(--sp-weak); font-weight: 650; }
.sp-table tr:last-child td, .sp-table tbody tr:last-child th { border-width: 0; }
.sp-credit { color: #3c6d56; }
.sp-debit { color: #914236; }
.sp-timeline { padding: 0 12px; background: var(--sp-paper); border: 1px solid var(--sp-rule); border-radius: 3px; }
.sp-timeline li { display: grid; grid-template-columns: 58px 1fr; gap: 7px; align-items: baseline; padding: 9px 0; border-bottom: 1px dotted #d4c5a4; }
.sp-timeline li:last-child { border: 0; }
.sp-timeline span { font-size: .78rem; color: #7a684a; font-weight: 650; }
.sp-timeline p { font-size: .9rem; }
.sp-guide { display: flex; gap: 12px; align-items: flex-start; }
.sp-guide .sp-pixel { flex: 0 0 auto; }
.sp-guide p { padding-top: 4px; }
.sp-file { display: none; }
.sp-import { display: grid; gap: 7px; margin-top: 4px; }
.sp-import label { font-size: .85rem; font-weight: 700; }
.sp-import textarea, .sp-export-field { display: block; width: 100%; resize: vertical; min-height: 75px; padding: 8px; border: 1px solid #ad9b77; background: #fffbed; border-radius: 3px; font-size: 16px; color: var(--sp-ink); }
.sp-export-field { margin-top: 5px; }
@media (min-width: 720px) and (min-height: 560px) {
  .sp-overlay { align-items: center; }
  .sp-sheet { border-radius: 7px; height: min(84%, 780px); }
}
@media (max-width: 405px) {
  .sp-content { padding-inline: 9px; }
  .sp-stat { padding: 6px; gap: 0 4px; }
  .sp-stat .sp-pixel { width: 22px; height: 22px; }
  .sp-stats:has(.sp-stat:nth-child(3)) .sp-stat .sp-pixel { display: none; }
  .sp-stats:has(.sp-stat:nth-child(3)) .sp-stat { grid-template-columns: 1fr; }
}
@media (max-height: 530px) { .sp-sheet { height: 94%; } .sp-header { padding-block: 5px; } }
@media (prefers-reduced-motion: reduce) { .sp-sheet, .sp-dim { animation: none; } }
@keyframes sp-rise { from { transform: translateY(12px); opacity: .65; } to { transform: translateY(0); opacity: 1; } }
@keyframes sp-fade { from { opacity: 0; } to { opacity: 1; } }
.sp-header h2, .sp-label h3, .sp-card h4, .sp-guide h4, .sp-fair h4 { font-family: var(--pixel, inherit); font-weight: 500; }
.sp-pricing { display: grid; gap: 6px; }
.sp-pricing > div { display: grid; grid-template-columns: minmax(76px, auto) 1fr; gap: 9px; align-items: center; }
.sp-pricing .sp-action { width: 100%; }
.sp-pricing .sp-action:disabled { color: #fff6d7; background-color: var(--sp-jade); border-color: #344d3e; }
.sp-pricing p { color: var(--sp-weak); font-size: .84rem; }
.sp-fair h4 { font-size: 1.05rem; }
.sp-fair .sp-meta { color: var(--sp-weak); font-size: .82rem; font-weight: 650; }
.sp-lab { border: 2px solid #8b7651; padding: 0; gap: 0; background: #fff4d7; }
.sp-lab-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px 9px; border-bottom: 1px solid #b8a278; background: repeating-linear-gradient(90deg, transparent 0 7px, #6a80600b 7px 8px), #e0dfb8; }
.sp-lab-head .sp-artbox { width: 46px; height: 46px; border: 1px solid #ae986b; background: #fff1ce; }
.sp-lab-head small { font-size: .76rem; color: #576449; font-weight: 750; }
.sp-lab-head h4 { font: 500 1.15rem/1.2 var(--pixel, inherit); margin-top: 3px; }
.sp-lab-body { display: grid; gap: 9px; padding: 11px 12px; }
.sp-stages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 0; list-style: none; }
.sp-stages li { display: flex; gap: 3px; align-items: center; justify-content: center; min-height: 33px; font-size: .82rem; font-weight: 750; color: #716855; background: #eee4cd; border: 1px solid #d1c1a1; }
.sp-stages .sp-pixel { width: 19px; height: 19px; }
.sp-stages .sp-past { color: #3f684e; background: #e4e8cc; border-color: #b6c1a2; }
.sp-stages .sp-now { color: #75402d; background: #f5dcac; border-color: #bc945c; box-shadow: inset 0 -2px #ddbb83; }
.sp-taste-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.sp-overlay .sp-taste-option { width: 100%; min-height: 48px; padding: 7px 5px; border: 1px solid #927c54; border-bottom-width: 2px; border-radius: 3px; background: #f2e0b5; box-shadow: inset 0 2px #fff0ce; color: #56482f; display: grid; align-content: center; gap: 3px; }
.sp-overlay .sp-taste-option strong { font-size: .93rem; }
.sp-overlay .sp-taste-option span { font-weight: 500; font-size: .81rem; line-height: 1.4; }
.sp-ticket { padding: 10px 12px; border-left: 3px solid #67885c; }
.sp-ticket .sp-artbox { width: 40px; height: 40px; }
.sp-ticket .sp-artbox .sp-pixel { width: 33px; height: 33px; }
.sp-recipe-note { color: #477256; border-left: 2px solid #91aa77; padding-left: 6px; font-size: .83rem; line-height: 1.45; }
.sp-overlay .sp-taste-option:disabled { background: #eee6cf; color: #726c5c; border-color: #c7b896; box-shadow: none; cursor: default; }
.sp-ticket h4 { font: 500 1rem/1.25 var(--pixel, inherit); }
.sp-ticket .sp-meta { font-size: .76rem; color: #59694c; font-weight: 750; }
.sp-method-head h3 { font-family: inherit; font-size: .84rem; font-weight: 700; line-height: 1.4; }
.sp-lab .sp-taste-option:disabled:has(+ .sp-taste-option:enabled), .sp-lab .sp-taste-option:enabled + .sp-taste-option:disabled { border-color: #8a9c71; background: #e1e8c9; color: #466447; }
