/* Pimg.me — the "ID card front and back on one page" page.
   Loaded after site.css and uses its tokens. Sections: page head, tool (panels, settings, preview,
   outputs), fact strip, article body, small screens, CJK. */

/* ---- page head ---- */
.idpage {
  padding: 34px 0 76px;
  background: linear-gradient(to bottom, var(--surface), var(--paper) 420px);
}
.idpage__top { max-width: 840px; margin: 0 auto 26px; text-align: center; }
.trail {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 0 0 10px;
  color: var(--ink-quiet);
  font-size: 14px;
  font-weight: 700;
}
.trail a { color: var(--ink-quiet); text-decoration: none; }
.trail a:hover { color: var(--rose-deep); }
.idpage h1 {
  margin: 0 0 14px;
  font-size: clamp(29px, 4.5vw, 44px);
  font-weight: 900;
  line-height: 1.14;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.idpage__lead { margin: 0; color: var(--ink-quiet); font-size: 18px; }

/* ---- tool ---- */
.cardkit {
  padding: 22px;
  border: var(--edge);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: 0 30px 60px -36px var(--shade), 0 8px 20px -16px var(--shade);
  font-size: 15px;
  line-height: 1.5;
}
.cardkit [hidden] { display: none !important; }
.cardkit button, .cardkit select, .cardkit input { font: inherit; color: inherit; }
.cardkit button { cursor: pointer; }
.cardkit p { margin: 0; }

.stepdot {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 10px;
  background: var(--rose-action);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  transform: rotate(-6deg);
}

.cardkit__sides { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.shotbox { min-width: 0; }
.shotbox__head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 9px; margin-bottom: 10px; }
.shotbox__head strong { font-size: 16.5px; font-weight: 900; }
.shotbox__hint { margin-left: auto; color: var(--ink-quiet); font-size: 13px; font-weight: 600; }

.shotbox__empty {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  aspect-ratio: 856 / 540;
  padding: 16px;
  border: 2px dashed var(--rose-rule);
  border-radius: 20px;
  background: var(--paper);
  color: var(--ink-quiet);
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.shotbox__empty svg { color: var(--rose); }
.shotbox__empty input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.shotbox__empty:hover, .shotbox.is-target .shotbox__empty { border-color: var(--rose-action); background: var(--rose-wash); }
.shotbox__empty:focus-within { outline: 3px solid var(--rose); outline-offset: 3px; }

.shotbox__stage { display: flex; justify-content: center; border-radius: 16px; background: var(--ink); }
.shotbox.is-target .shotbox__stage { outline: 3px solid var(--rose); outline-offset: 3px; }
.shotbox__photo { position: relative; flex: none; }
.shotbox__photo canvas { display: block; width: 100%; height: 100%; border-radius: 16px; cursor: move; }
.shotbox__grip {
  position: absolute;
  z-index: 1;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  padding: 0;
  border: 3.5px solid var(--rose-action);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 8px rgba(45, 36, 69, .45);
  cursor: grab;
  touch-action: none;
  transition: transform .12s;
}
.shotbox__grip::after { content: ""; position: absolute; inset: -14px; border-radius: 50%; }
.shotbox__grip.is-held { transform: scale(1.25); cursor: grabbing; }

.shotbox__tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.shotbox__tools button, .cardkit__try button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border: var(--edge);
  border-radius: 12px;
  background: var(--surface);
  font-size: 13.5px;
  font-weight: 800;
}
.shotbox__tools button:hover, .cardkit__try button:hover { border-color: var(--rose-rule); background: var(--rose-wash); }
.shotbox__tools svg { flex: none; color: var(--rose-action); }
.cardkit__try { margin-top: 14px !important; color: var(--ink-quiet); font-size: 14px; font-weight: 600; text-align: center; }
.cardkit__try button { margin-left: 4px; }

.cardkit__desk {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .56fr) minmax(0, .6fr);
  align-items: start;
  gap: 20px;
  margin-top: 18px;
  padding-top: 20px;
  border-top: var(--edge);
}

.dials { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-content: start; gap: 12px 14px; }
.dials__head { grid-column: 1 / -1; display: flex; align-items: center; gap: 9px; }
.dials__head strong { font-size: 16.5px; font-weight: 900; }
.dials__wide { grid-column: 1 / -1; }
.dials label { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.dials label > span { font-size: 13.5px; font-weight: 800; }
.dials small { color: var(--ink-quiet); font-size: 12.5px; font-weight: 600; }
.dials select, .dials input[type="text"], .outs__limit select {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: var(--edge);
  border-radius: 12px;
  background-color: var(--surface);
  font-size: 15px;
  font-weight: 600;
}
.dials select:hover, .dials input[type="text"]:hover, .outs__limit select:hover { border-color: var(--rose-rule); }
.dials input::placeholder { color: #8E87A1; }
.dials__ticks { display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; }
.dials label.tick { flex-direction: row; align-items: center; gap: 9px; cursor: pointer; }
.dials label.tick > span { font-weight: 700; font-size: 14.5px; }
.tick input { flex: none; width: 19px; height: 19px; margin: 0; accent-color: var(--rose-action); }

.proof { position: relative; padding: 12px; border-radius: 18px; background: #F4EFF8; }
.proof canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 210 / 297;
  border-radius: 3px;
  background: #fff;
  box-shadow: 0 10px 22px -12px rgba(76, 46, 110, .5);
}
.proof__empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--ink-quiet);
  font-size: 13.5px;
  font-weight: 700;
  text-align: center;
  pointer-events: none;
}
.proof.is-filled .proof__empty { display: none; }

.outs { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.outs__btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 9px 14px;
  border: var(--edge);
  border-radius: 15px;
  background: var(--surface);
  text-align: left;
  transition: background .15s, transform .15s;
}
.outs__btn svg { flex: none; color: var(--rose-action); }
.outs__btn span { display: flex; flex-direction: column; min-width: 0; }
.outs__btn b { font-size: 15px; font-weight: 900; line-height: 1.3; }
.outs__btn small { color: var(--ink-quiet); font-size: 12.5px; font-weight: 600; }
.outs__btn:hover:not(:disabled) { border-color: var(--rose-rule); background: var(--rose-wash); }
.outs__btn:active:not(:disabled) { transform: scale(.98); }
.outs__btn:disabled { opacity: .45; cursor: not-allowed; }
.outs__btn.is-main {
  min-height: 58px;
  border-color: var(--rose-action);
  background: var(--rose-action);
  box-shadow: 0 14px 26px -14px var(--shade-rose);
  color: #fff;
}
.outs__btn.is-main svg { color: #fff; }
.outs__btn.is-main small { color: var(--rose-wash); }
.outs__btn.is-main:hover:not(:disabled) { border-color: var(--rose-deep); background: var(--rose-deep); }
.outs__group { display: flex; flex-direction: column; gap: 6px; }
.outs__limit { display: flex; align-items: center; gap: 8px; color: var(--ink-quiet); font-size: 13px; font-weight: 700; }
.outs__limit select { width: auto; height: 32px; padding: 0 8px; border-radius: 10px; color: var(--ink); font-size: 13.5px; }
.outs__status { min-height: 1.5em; color: var(--rose-deep); font-size: 13.5px; font-weight: 800; }
.outs__hint { color: var(--ink-quiet); font-size: 13px; }

.cardkit__lock {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 18px !important;
  padding: 11px 16px;
  border-radius: 14px;
  background: var(--mint-wash);
  font-size: 14px;
  font-weight: 700;
}
.cardkit__lock svg { flex: none; }

/* ---- fact strip ---- */
.idfacts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}
.idfacts li { padding: 14px 18px; border: var(--edge); border-radius: 20px; background: var(--surface); }
.idfacts b { display: block; color: var(--rose-deep); font-size: 22px; font-weight: 900; line-height: 1.3; }
.idfacts span { display: block; color: var(--ink-quiet); font-size: 14px; font-weight: 700; line-height: 1.5; }

/* ---- article body ---- */
.idbody { max-width: 820px; margin: 56px auto 0; }
.idsec { margin: 0 0 54px; scroll-margin-top: 84px; }
.idsec h2 {
  margin: 0 0 12px;
  font-size: clamp(24px, 3vw, 31px);
  font-weight: 900;
  line-height: 1.22;
  letter-spacing: -.015em;
}
.idsec h3 { margin: 22px 0 6px; font-size: 19px; font-weight: 900; line-height: 1.3; }
.idsec p { margin: 0 0 12px; color: var(--ink-mid); }
.idsec ul, .idsec ol.plain { margin: 0 0 12px; padding-left: 1.2em; }
.idsec li { margin: 6px 0; color: var(--ink-mid); }
.idsec li::marker { color: var(--rose); font-weight: 800; }
.idsec .lead { color: var(--ink-quiet); font-size: 18px; }
.idsec .tip {
  margin: 16px 0 12px;
  padding: 12px 16px;
  border-radius: 16px;
  background: var(--mint-wash);
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
}
.idsec .snap { margin-top: 22px; }
.idsec .ask p { margin: 0; }
.idsec .ask p + p { margin-top: -8px; }

.walk { margin: 16px 0 0; padding: 0; list-style: none; counter-reset: walk; }
.walk li {
  position: relative;
  margin: 0 0 10px;
  padding: 16px 18px 14px 68px;
  border: var(--edge);
  border-radius: 20px;
  background: var(--surface);
  counter-increment: walk;
}
.walk li::before {
  content: counter(walk);
  position: absolute;
  top: 16px;
  left: 16px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 13px;
  background: var(--rose-wash);
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  transform: rotate(-6deg);
}
.walk li:nth-child(4n+2)::before { background: var(--honey-wash); }
.walk li:nth-child(4n+3)::before { background: var(--mint-wash); }
.walk h3 { margin: 0 0 4px; font-size: 18px; }
.walk p { margin: 0; font-size: 16px; }

.sizes { margin: 16px 0; border: var(--edge); border-radius: 18px; background: var(--surface); overflow-x: auto; }
.sizes table { width: 100%; border-collapse: collapse; font-size: 15.5px; line-height: 1.55; }
.sizes th, .sizes td { padding: 10px 14px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
.sizes th { background: var(--rose-wash); font-weight: 900; white-space: nowrap; }
.sizes td { color: var(--ink-mid); }
.sizes td:first-child { color: var(--ink); font-weight: 800; white-space: nowrap; }
.sizes td:not(:last-child) { white-space: nowrap; }
.sizes tr:last-child td { border-bottom: 0; }

.idsec .nextup { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.nextup li { margin: 0; }
.nextup a {
  display: block;
  height: 100%;
  padding: 16px 18px;
  border: var(--edge);
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}
.nextup a:hover { border-color: var(--rose-rule); background: var(--rose-wash); }
.nextup b { display: block; font-weight: 900; }
.nextup span { color: var(--ink-quiet); font-size: 15px; }

/* ---- smaller screens ---- */
@media (max-width: 940px) {
  .cardkit__desk { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .dials { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  .idpage { padding-top: 22px; }
  .idpage__top { text-align: left; }
  .trail { justify-content: flex-start; }
  .idpage__lead { font-size: 16.5px; }
  .cardkit { padding: 14px; border-radius: 22px; }
  .cardkit__sides { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .shotbox__hint { width: 100%; margin-left: 0; }
  .shotbox__tools button { padding: 8px 12px; }
  .cardkit__desk { grid-template-columns: minmax(0, 1fr); }
  .dials select, .dials input[type="text"] { height: 46px; font-size: 16px; }
  .proof { width: 100%; max-width: 290px; margin: 0 auto; }
  .outs__btn { min-height: 52px; }
  .outs__limit select { height: 40px; font-size: 16px; }
  .cardkit__lock { align-items: flex-start; justify-content: flex-start; text-align: left; }
  .cardkit__lock svg { margin-top: 2px; }
  .idbody { margin-top: 44px; }
  .idsec { margin-bottom: 44px; }
  .walk li { padding: 14px 14px 12px 60px; }
  .walk li::before { left: 12px; top: 14px; }
  .sizes table { font-size: 14.5px; }
  .sizes th, .sizes td { padding: 9px 11px; }
}

@media (max-width: 400px) {
  .dials { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .shotbox__grip, .outs__btn, .shotbox__empty { transition: none; }
}

/* ---- Chinese, Japanese and Korean pages ---- */
.cjk .idpage h1 { font-size: clamp(27px, 4vw, 40px); line-height: 1.32; letter-spacing: 0; }
.cjk .idsec h2 { line-height: 1.4; }
.cjk .cardkit { line-height: 1.6; }
.cjk-ja .idbody, .cjk-zh .idbody { line-break: strict; }
.cjk-ko .idpage h1, .cjk-ko .idsec h2, .cjk-ko .walk li::before {
  font-family: Jua, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-weight: 400;
  letter-spacing: 0;
}
