:root {
  --paper: #f7f4eb;
  --sheet: #fffcf4;
  --ink: #292a24;
  --muted: #65665d;
  --rule: #cbc7b9;
  --red: #963f2e;
  --red-dark: #773024;
  --serif: Georgia, 'Noto Serif CJK SC', 'Songti SC', 'STSong', 'SimSun', serif;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Consolas, monospace;
  color-scheme: light;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: inherit;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button,
select {
  cursor: pointer;
}
button {
  touch-action: manipulation;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: 3px solid #92682c;
  outline-offset: 4px;
}
hr {
  border: 0;
  border-top: 1px solid var(--rule);
}
h1,
h2,
h3,
h4,
p,
figure {
  margin: 0;
}
h1,
h2,
h3,
.brand {
  font-family: var(--serif);
}
h1,
h2,
h3 {
  font-weight: 600;
}
img {
  display: block;
  max-width: 100%;
}
body {
  max-width: 1440px;
  margin: auto;
  padding: 0 clamp(19px, 4.2vw, 72px);
}
.skip {
  position: fixed;
  top: -8rem;
  z-index: 5;
  background: var(--ink);
  color: white;
  padding: 12px;
}
.skip:focus {
  top: 8px;
}
.skip:not(:focus) {
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
}
.mast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 78px;
  border-bottom: 1px solid #858477;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  text-decoration: none;
  font-size: clamp(22px, 2.2vw, 33px);
  font-weight: 600;
  letter-spacing: -0.045em;
}
.brand img {
  width: 42px;
}
.brand i {
  height: 22px;
  width: 1px;
  background: #aaa498;
}
.brand small {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
}
.language,
.text,
.quiet {
  background: transparent;
  border: 0;
}
.language {
  padding: 7px 13px;
  border: 1px solid #a5a394;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.language:hover,
.quiet:hover,
.text:hover {
  color: var(--red);
}
.hero {
  display: grid;
  grid-template-columns: 44% 56%;
  align-items: center;
  padding: clamp(32px, 4.4vw, 66px) 0 30px;
}
.hero-copy {
  position: relative;
  z-index: 2;
}
.hero h1 {
  font-size: clamp(43px, 4.5vw, 74px);
  line-height: 1.19;
  letter-spacing: -0.045em;
}
.hero-copy > p {
  line-height: 1.82;
  color: #55564e;
  font-size: clamp(14px, 1.2vw, 17px);
  max-width: 31em;
  padding-right: 22px;
  margin: 18px 0 23px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.button {
  border-radius: 4px;
  padding: 11px 20px;
  min-height: 43px;
  font-weight: 610;
  font-size: 14px;
  display: inline-flex;
  gap: 15px;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition:
    background 0.16s,
    color 0.16s,
    border-color 0.16s;
}
.primary {
  border: 1px solid var(--red);
  color: #fffaf3;
  background: var(--red);
}
.primary:hover:enabled {
  background: var(--red-dark);
  border-color: var(--red-dark);
}
.outline {
  border: 1px solid #af9f91;
  color: #783a2c;
  background: transparent;
}
.outline:hover:enabled {
  border-color: var(--red);
  background: #eee7da;
}
.quiet {
  border: 1px solid var(--rule);
}
.text {
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 4px;
  padding: 7px 0;
}
.spread {
  position: relative;
  aspect-ratio: 2.2;
  isolation: isolate;
  margin: 0 1.5% 0 3.5%;
}
.print {
  position: absolute;
  top: 20%;
  width: 37%;
  padding: clamp(5px, 0.55vw, 9px);
  padding-bottom: 0;
  background: #fdf9ee;
  border: 1px solid #cfc8b7;
  box-shadow: 1px 8px 16px #423a2621;
}
.print img {
  width: 100%;
  aspect-ratio: 1.25;
  object-fit: cover;
}
.print span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #555346;
  font: clamp(7px, 0.73vw, 11px) / 1 var(--mono);
  letter-spacing: 0.18em;
  padding: 7% 1%;
}
.print b {
  font-weight: 400;
  color: #827c6c;
}
.print-a {
  left: 0;
  transform: rotate(-8deg);
}
.print-b {
  left: 32%;
  top: 3%;
  transform: rotate(3deg);
}
.print-c {
  left: 63%;
  top: 24%;
  transform: rotate(8deg);
}
.ruler {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  color: #79796d;
  font: 10px var(--mono);
  letter-spacing: 0.1em;
  height: 19px;
  margin: 0 0 30px;
}
.ruler i {
  flex: 1;
  height: 8px;
  border-bottom: 1px solid var(--rule);
  background: repeating-linear-gradient(90deg, transparent 0 47px, #d4d0c4 47px 48px);
  opacity: 0.8;
}
#workspace {
  scroll-margin-top: 12px;
  outline: 0;
  padding-bottom: 36px;
}
.section-head,
.result-head,
.row,
.field-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}
.section-head {
  margin-bottom: 17px;
}
.section-head h2 {
  font-size: clamp(25px, 2.35vw, 34px);
  letter-spacing: -0.035em;
}
.mode-switch {
  display: flex;
  border: 1px solid #9a9989;
  border-radius: 5px;
  overflow: hidden;
}
.mode {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 50%;
  padding: 14px 8px;
  background: transparent;
  border: 0;
  font-size: clamp(14px, 1.3vw, 19px);
  font-weight: 600;
}
.mode + .mode {
  border-left: 1px solid #9a9989;
}
.mode[aria-pressed='true'] {
  background: var(--ink);
  color: var(--sheet);
}
.mode[aria-pressed='false']:hover {
  background: #ece7da;
}
.mode:focus-visible {
  outline-offset: -4px;
}
.index {
  font: 11px var(--mono);
  opacity: 0.75;
}
.description {
  line-height: 1.7;
  color: var(--muted);
  font-size: 14px;
  margin: 16px 0 20px;
}
.import-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.import-grid.single {
  grid-template-columns: 1fr;
}
.well {
  background: #faf8f0;
  border: 1px dashed #ada996;
  border-radius: 5px;
  padding: 19px 22px;
  min-width: 0;
}
.well.drag {
  outline: 2px solid var(--red);
  outline-offset: -3px;
}
.well h3,
.result-head h3 {
  font-size: 21px;
  letter-spacing: -0.025em;
}
.well p,
.detail,
.note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.well p {
  margin: 6px 0 10px;
}
.well .actions {
  gap: 16px;
}
.small-action {
  color: var(--red);
  background: none;
  border: 0;
  padding: 4px 0;
  text-align: left;
  font-size: 13px;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.small-action:disabled {
  color: var(--muted);
}
.meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.filmstrip {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin: 12px 0 2px;
}
.filmstrip img,
.thumb-more {
  width: 47px;
  height: 42px;
  object-fit: cover;
  border-radius: 2px;
}
.thumb-more {
  display: grid;
  place-content: center;
  border: 1px solid var(--rule);
  font: 12px var(--mono);
  color: var(--muted);
}
.refs {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}
.refs li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  line-height: 1.6;
  padding: 5px 0;
  border-top: 1px solid #e1ddcf;
  font-size: 13px;
}
.refs li span {
  overflow-wrap: anywhere;
}
.refs img {
  width: 31px;
  height: 26px;
  object-fit: cover;
  border-radius: 1px;
}
.album-mark {
  display: flex;
  align-items: center;
  gap: 8px;
}
.run-row {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: flex-end;
  border-bottom: 1px solid var(--rule);
  padding: 17px 0 21px;
}
.run-row .detail {
  margin-right: auto;
}
#live:not(:empty) {
  padding: 12px 0 0;
  font-size: 14px;
  color: #465441;
  line-height: 1.6;
}
#errors:not(:empty) {
  border-left: 3px solid var(--red);
  background: #f1e5db;
  margin-top: 12px;
  padding: 10px 13px;
  color: #773b2f;
  overflow-wrap: anywhere;
}
#errors p,
#errors li {
  font-size: 13px;
  line-height: 1.65;
}
#errors ul {
  padding-left: 19px;
  margin: 6px 0;
}
.result {
  margin-top: 24px;
}
.result-head {
  margin: 0 0 10px;
}
.result-head h3 {
  font-size: 26px;
}
.result-head .actions {
  justify-content: flex-end;
}
.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 12px;
  margin: 15px 0;
}
.plan {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  min-width: 0;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 15px;
}
.plan:hover,
.plan.selected {
  border-color: var(--red);
}
.plan.selected {
  box-shadow: inset 0 0 0 1px var(--red);
}
.plan h4 {
  font-size: 16px;
}
.plan p {
  margin: 5px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.mini-group {
  display: flex;
  gap: 5px;
  align-items: center;
  min-width: 0;
  margin-top: 8px;
}
.mini-group img {
  width: 31px;
  height: 29px;
  object-fit: cover;
}
.mini-group span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: var(--muted);
}
.plan-foot {
  margin-top: auto;
  padding-top: 13px;
  color: var(--red);
  font-weight: 650;
  font-size: 12px;
}
.plan-stack {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.plan-stack .plan {
  flex: 1;
}
.more-groups {
  color: var(--muted);
  font-size: 12px;
  margin-top: 5px;
}
.more-groups summary {
  cursor: pointer;
  padding: 5px 0;
}
.more-groups-list {
  max-height: 15rem;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0 6px;
}
.groups {
  display: grid;
  gap: 15px;
  margin-top: 16px;
}
.group {
  border-top: 1px solid #bab5a6;
  padding: 15px 0 5px;
}
.group.uncertain {
  border-top: 2px solid #b36e42;
}
.group-head {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.group-title {
  font-size: 18px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.edit-name {
  background: transparent;
  border: 1px solid transparent;
  border-bottom-color: #bbb6a8;
  border-radius: 2px;
  padding: 4px 2px;
  max-width: min(100%, 22em);
  font-size: 17px;
  font-weight: 600;
}
.edit-name:focus {
  background: var(--sheet);
}
.group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 145px), 1fr));
  gap: 13px;
  margin: 12px 0;
}
.photo-card {
  min-width: 0;
  max-width: 260px;
}
.photo-preview {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  text-align: left;
  background: none;
}
.photo-preview img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 3px;
}
.photo-name {
  font: 12px/1.5 var(--sans);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 6px 0 2px;
}
.photo-card .hint {
  font-size: 11px;
  color: var(--muted);
  margin: 2px 0 5px;
  overflow-wrap: anywhere;
}
.photo-card select {
  width: 100%;
  border: 1px solid #bfb9a9;
  border-radius: 3px;
  background: #f9f6ed;
  padding: 5px 3px;
  font-size: 12px;
}
.photo-card .accept-suggestion {
  display: block;
  margin: 0 0 6px;
}
.export-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: space-between;
  border-top: 1px solid var(--rule);
  margin-top: 20px;
  padding: 18px 0;
}
.export-bar .note {
  max-width: 60em;
}
.empty {
  margin: 8px 0;
  font-size: 13px;
  color: var(--muted);
}
footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0 30px;
  border-top: 1px solid #939284;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}
footer a {
  text-underline-offset: 3px;
}
.seal {
  color: var(--red);
  margin-right: 7px;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
dialog {
  width: min(450px, 92vw);
  background: var(--paper);
  color: var(--ink);
  border: 1px solid #928c7d;
  border-radius: 6px;
  padding: 24px;
}
dialog::backdrop {
  background: #23251ec2;
}
dialog h2 {
  font-size: 26px;
}
dialog p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  margin: 9px 0 16px;
}
dialog label {
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
}
dialog input {
  width: 100%;
  background: var(--sheet);
  border: 1px solid #aaa492;
  border-radius: 4px;
  padding: 10px;
  margin-bottom: 14px;
}
#photo-dialog {
  width: fit-content;
  max-width: 92vw;
  text-align: right;
}
#full-photo {
  max-height: 69vh;
  margin: 12px auto 0;
  object-fit: contain;
}
#full-name {
  text-align: left;
  overflow-wrap: anywhere;
  margin-bottom: 0;
}
@media (min-width: 1600px) {
  .hero {
    padding-top: 75px;
    padding-bottom: 44px;
  }
}
@media (max-width: 820px) {
  .hero {
    grid-template-columns: 48% 52%;
  }
  .mast {
    height: 65px;
  }
  .hero h1 {
    font-size: 39px;
  }
  .hero-copy > p {
    font-size: 14px;
  }
  .spread {
    margin-left: 0;
  }
  .hero .button {
    padding: 10px 13px;
  }
  .well {
    padding: 15px;
  }
  .mode {
    padding: 13px 6px;
  }
}
@media (max-width: 620px) {
  .mast {
    height: 59px;
  }
  .brand {
    gap: 8px;
    font-size: 23px;
  }
  .brand img {
    width: 33px;
  }
  .brand small {
    font-size: 10px;
  }
  .brand i {
    height: 17px;
  }
  .language {
    padding: 6px 9px;
  }
  .hero {
    grid-template-columns: 1fr;
    padding: 25px 0 3px;
  }
  .hero h1 {
    font-size: 40px;
  }
  .hero-copy > p {
    max-width: 35em;
    padding: 0;
    margin: 10px 0 14px;
  }
  .spread {
    width: min(91%, 440px);
    aspect-ratio: 2.85;
    margin: 20px auto 8px;
  }
  .print {
    width: 32%;
  }
  .print-a {
    left: 3%;
  }
  .print-b {
    left: 34%;
  }
  .print-c {
    left: 65%;
  }
  .print span {
    padding: 6% 0;
  }
  .ruler {
    margin-bottom: 20px;
  }
  .section-head {
    margin-bottom: 11px;
  }
  .import-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .mode {
    gap: 6px;
  }
  .description {
    margin: 12px 0;
  }
  .result-head,
  .export-bar {
    align-items: flex-start;
    flex-direction: column;
  }
  .run-row {
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
  }
  .group-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .well .actions {
    gap: 12px;
  }
  footer {
    gap: 12px;
    flex-wrap: wrap;
  }
  .group-head {
    gap: 8px;
  }
  .meta {
    white-space: normal;
  }
  .button {
    padding: 10px 15px;
  }
  .group-title {
    font-size: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
/* Keep the language control readable even with narrow CJK or Latin text metrics. */
.language {
  white-space: nowrap;
  flex: none;
}
.draft-tools {
  margin-top: 18px;
  border-top: 1px solid var(--rule);
  padding: 13px 0 0;
}
.draft-tools summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  width: fit-content;
}
.draft-tools .note {
  margin-top: 8px;
}
.draft-tools .actions {
  gap: 16px;
  margin-top: 6px;
}
@media (max-width: 410px) {
  .mast .brand small,
  .mast .brand i {
    display: none;
  }
}
.hero h1,
.section-head h2,
.well h3,
.result-head h3 {
  font-synthesis: weight;
}
#full-meta {
  text-align: left;
  margin-top: 5px;
}
.format-note {
  color: var(--muted);
  font-size: 12px;
  margin-top: 11px;
}
.format-note summary {
  cursor: pointer;
  width: fit-content;
}
.format-note p {
  margin-top: 6px;
}

.copy-review {
  margin: 1rem 0;
  padding: clamp(1rem, 3vw, 1.75rem);
  background: #f1ecdf;
  border: 1px solid #bcb29c;
  border-radius: 8px;
}
.copy-review h3 {
  margin: 0;
}
.copy-review > .note {
  max-width: 72ch;
}
.copy-review .actions {
  margin: 0.75rem 0;
}
.copy-set {
  border-top: 1px solid #c8beaa;
  padding: 0.7rem 0;
}
.copy-set summary {
  cursor: pointer;
  font-weight: 650;
}
.copy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(13rem, 100%), 1fr));
  gap: 0.7rem;
  margin-top: 0.75rem;
}
.copy-entry {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 0.35rem;
  background: #fbf8ef;
  border: 1px solid #c9bfac;
  border-radius: 5px;
  padding: 0.65rem;
}
.copy-entry.omitted {
  background: #e6e1d6;
  border-style: dashed;
}
.copy-preview {
  width: 100%;
  aspect-ratio: 1.8;
  overflow: hidden;
  border: 0;
  border-radius: 3px;
  padding: 0;
  background: #dcd8c8;
  cursor: zoom-in;
}
.copy-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.copy-file,
.copy-entry .note {
  overflow-wrap: anywhere;
}
.copy-tag {
  font-size: 0.78rem;
  color: #23584b;
}
.copy-entry .note {
  font-size: 0.85rem;
  line-height: 1.45;
  margin: 0 0 0.25rem;
}
.copy-entry .small-action {
  margin-top: auto;
}
