:root {
  color-scheme: light;
  --ink: #183c39;
  --teal: #17665a;
  --line: #cfdbd5;
  --muted: #506760;
  font-family: "Yu Gothic UI", "Meiryo", sans-serif;
  color: var(--ink);
  background: #f4f7f3;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button,
select,
input[type="checkbox"] {
  cursor: pointer;
}
button:disabled {
  cursor: default;
}
button:focus-visible,
select:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid #e68b39;
  outline-offset: 3px;
}
button {
  font-weight: 700;
}
header {
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.wrap {
  max-width: 1250px;
  margin: auto;
  padding: 0 clamp(16px, 4vw, 64px);
}
.mast {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 64px;
}
.mast b {
  font-family: "Yu Mincho", serif;
  font-size: 1.55rem;
  letter-spacing: 0.12em;
}
.mast > span:last-child {
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: bold;
}
.logo {
  display: grid;
  place-items: center;
  background: var(--ink);
  color: #f5d396;
  border-radius: 8px;
  width: 33px;
  height: 33px;
  font-size: 1.45rem;
}
.divider {
  height: 18px;
  border-left: 1px solid var(--line);
}
.hero {
  background-color: #193f3a;
  background-image:
    linear-gradient(#ffffff08 1px, transparent 1px),
    linear-gradient(90deg, #ffffff08 1px, transparent 1px);
  background-size: 24px 24px;
  color: white;
  position: relative;
  overflow: hidden;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 164px;
  padding: 26px clamp(22px, 4vw, 48px);
  margin: 28px 0 22px;
}
.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: 0.06em;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
}
.hero p {
  margin: 0;
  color: #e1ece4;
  line-height: 1.8;
  max-width: 39em;
}
.illustration {
  position: relative;
  width: 190px;
  height: 116px;
  flex: none;
  transform: rotate(-12deg) skewY(2deg);
  margin: 0 30px;
}
.sheet {
  position: absolute;
  inset: 15px 16px;
  border: 1px solid #153e39;
  border-radius: 3px 7px 5px 3px;
  box-shadow: 0 3px #0d312d;
}
.back {
  background: #81a69a;
  transform: translate(10px, 12px);
}
.middle {
  background: #d8ceac;
  transform: translate(5px, 6px);
}
.face {
  background: linear-gradient(90deg, #fff6d8 48%, #c0bca2 50%, #f2e5bc 51%);
  display: flex;
  gap: 18px;
  padding: 13px 11px;
}
.face i {
  flex: 1;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 7px,
    #8c9e8d 7px 8px
  );
  border-top: 6px solid #b9834b;
}
.face i:first-child {
  background:
    linear-gradient(145deg, transparent 43%, #386d60 44% 62%, #91b29d 63%),
    #d9dfc9;
  border: 0;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(282px, 32%);
  gap: 20px;
  align-items: start;
}
.editor {
  display: grid;
  gap: 20px;
  min-width: 0;
}
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 22px;
  min-width: 0;
}
.ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ico svg {
  width: 1.2em;
  height: 1.2em;
}
.panel h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.14rem;
  margin: 0 0 18px;
}
.panel h2 .ico {
  color: var(--teal);
}
#drop {
  border: 1.5px dashed #8aada0;
  border-radius: 9px;
  background: #f3f8f3;
  padding: 21px;
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 5px;
}
#drop.drag {
  background: #dceedf;
  border-color: var(--teal);
}
#drop strong {
  overflow-wrap: anywhere;
}
.upload-icon {
  color: var(--teal);
  font-size: 1.65rem;
  margin-bottom: 3px;
}
#sourceInfo,
.hint,
.note,
#empty,
small {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.65;
}
.outline {
  background: #fff;
  border: 1px solid #89a99b;
  color: var(--ink);
  padding: 7px 22px;
  border-radius: 6px;
  margin-top: 9px;
}
.outline:hover,
.tabs button:hover {
  background: #e7f0e8;
}
.tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  gap: 18px;
}
.tabs button {
  color: var(--muted);
  background: none;
  border: 0;
  padding: 4px 2px 13px;
}
.tabs button.active {
  color: var(--teal);
  box-shadow: inset 0 -3px var(--teal);
}
.hint {
  margin: 15px 0;
}
#empty {
  text-align: center;
  border-radius: 7px;
  background: #f6f8f5;
  padding: 20px 10px;
}
#empty .ico {
  font-size: 1.55rem;
  color: #718d80;
}
#empty p {
  margin: 6px 0 0;
}
fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}
legend,
.name,
.controls label {
  font-size: 0.92rem;
  font-weight: bold;
}
legend {
  margin-bottom: 10px;
}
legend small {
  margin-left: 7px;
  font-size: 0.78rem;
  font-weight: 400;
}
.choice {
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 8px;
  padding: 12px;
  cursor: pointer;
}
.choice:has(:checked) {
  background: #eff7ef;
  border-color: #73a48b;
}
.choice input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}
.choice b,
.choice small {
  display: block;
}
.choice small,
.note {
  font-size: 0.8rem;
}
.name {
  display: block;
  margin: 17px 0 8px;
}
#title,
select {
  background: #fff;
  color: var(--ink);
  border: 1px solid #a8b9af;
  border-radius: 6px;
  padding: 9px;
  width: 100%;
  min-width: 0;
}
#title:disabled {
  background: #f7f8f6;
}
.note {
  margin: 7px 0 18px;
}
.primary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  background: var(--teal);
  color: white;
  padding: 12px;
  border-radius: 7px;
}
.primary:disabled {
  background: #dae3dd;
  color: #51655c;
}
.primary:enabled:hover {
  background: #114e45;
}
#downloads a {
  display: block;
  margin: 12px 0 0;
  color: var(--teal);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}
#status {
  min-height: 1.6em;
  margin: 18px 0 28px;
  font-weight: 600;
}
#status.error {
  color: #943a26;
}
#pages {
  display: flex;
  align-items: center;
  overflow-x: auto;
  padding: 14px 4px 18px;
  background: #f6f8f5;
  border-radius: 7px;
}
#pages:empty {
  display: none;
}
figure {
  margin: 0;
}
.thumb {
  flex: 0 0 118px;
  text-align: center;
}
.thumb img,
.leaf img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: white;
}
.thumb img {
  aspect-ratio: 210/297;
  height: auto;
  border: 1px solid #bac7bc;
}
.thumb figcaption,
.frame figcaption {
  font-size: 0.85rem;
  margin-top: 7px;
  color: var(--muted);
}
.pair {
  flex: 0 0 78px;
  border: 1px dashed #8fa79a;
  color: var(--teal);
  border-radius: 6px;
  background: #fff;
  font-size: 0.78rem;
  padding: 6px;
  margin: 0 5px;
}
.pair[aria-pressed="true"] {
  background: var(--teal);
  color: white;
  border-style: solid;
}
.pair:disabled {
  color: #758077;
  background: #edf0ed;
  border-color: #d4dbd5;
}
.controls {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}
.controls label {
  flex: 1;
}
.controls select {
  display: block;
  margin-top: 5px;
  font-weight: 400;
}
.frame {
  margin: 16px 0;
  background: #eff3ef;
  border-radius: 8px;
  padding: 14px;
  text-align: center;
}
.spread {
  display: flex;
  max-width: 620px;
  margin: auto;
  align-items: stretch;
  justify-content: center;
}
.leaf {
  width: 50%;
  aspect-ratio: 210/297;
  border: 1px solid #c6cfc6;
  background: white;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.leaf + .leaf {
  border-left: 0;
}
.leaf.outside {
  border: 0;
  background: transparent;
}
.leaf.blank {
  color: #66766c;
  font-size: 0.85rem;
}
.frame figcaption {
  font-weight: 600;
}
[hidden] {
  display: none !important;
}
@media (max-width: 800px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) 265px;
    gap: 12px;
  }
  .panel {
    padding: 16px;
  }
  .illustration {
    margin: 0;
    width: 140px;
  }
  .hero {
    padding: 22px;
  }
}
@media (max-width: 650px) {
  .workspace {
    grid-template-columns: 1fr;
  }
  .hero {
    margin-top: 16px;
    min-height: 130px;
  }
  .hero p {
    font-size: 0.875rem;
  }
  .illustration {
    width: 82px;
    height: 76px;
    margin: 0 -10px 0 5px;
  }
  .sheet {
    inset: 12px 5px;
  }
  .face {
    padding: 6px;
    gap: 8px;
  }
  .controls {
    flex-wrap: wrap;
  }
  .thumb {
    flex-basis: 100px;
  }
}
