:root {
  color-scheme: light;
  font-family:
    "Hiragino Kaku Gothic ProN", "Yu Gothic", "Yu Gothic UI", Meiryo, sans-serif;
  background: #f5f6f8;
  color: #171717;
  --line: #d7dce2;
  --soft: #ffffff;
  --muted: #59616c;
  --focus: #111111;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100dvh;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  min-height: 100dvh;
  padding: calc(16px + env(safe-area-inset-top)) 14px calc(22px + env(safe-area-inset-bottom));
  display: grid;
  gap: 16px;
  align-content: start;
}

.masthead {
  display: grid;
  gap: 4px;
}

.eyebrow {
  margin: 0;
  color: #e9232f;
  font-size: 12px;
  font-weight: 900;
}

.masthead h1 {
  margin: 0;
  font-size: clamp(30px, 9.4vw, 54px);
  line-height: 0.96;
  text-wrap: balance;
  overflow-wrap: anywhere;
  line-break: anywhere;
}

.masthead p:last-child {
  margin: 0;
  max-width: 36rem;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
  text-wrap: pretty;
}

.maker {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.stage {
  min-width: 0;
  min-height: 268px;
  display: grid;
  place-items: center;
  padding: 14px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(20, 20, 20, 0.055) 1px, transparent 1px),
    linear-gradient(rgba(20, 20, 20, 0.055) 1px, transparent 1px), #ffffff;
  background-size: 20px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.svg-preview {
  display: block;
  width: min(100%, 680px);
  max-width: 100%;
  aspect-ratio: 1200 / 698;
  object-fit: contain;
  background: #ffffff;
  box-shadow: 0 14px 28px rgba(22, 22, 22, 0.12);
}

.notice-card {
  --accent: #e9232f;
  --accent-dark: #111111;
  --paper: #fff7f7;
  --ink: #111111;
  position: relative;
  width: min(100%, 680px);
  max-width: 100%;
  aspect-ratio: 1.72 / 1;
  overflow: hidden;
  border: clamp(2px, 0.55vw, 4px) solid var(--accent-dark);
  background:
    linear-gradient(145deg, transparent 0 66%, rgba(255, 255, 255, 0.96) 66% 72%, transparent 72%),
    linear-gradient(90deg, var(--paper) 0 54%, var(--accent) 54% 100%);
  box-shadow: 0 14px 28px rgba(22, 22, 22, 0.12);
}

.stage .notice-card {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.notice-card::before {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 9.5% 3.5% 8% 3.5%;
  border: 1px solid rgba(17, 17, 17, 0.18);
  pointer-events: none;
}

.notice-card::after {
  content: "";
  position: absolute;
  z-index: 2;
  right: -5%;
  bottom: -4%;
  width: 56%;
  height: 70%;
  background: repeating-linear-gradient(
    115deg,
    rgba(255, 255, 255, 0.32) 0 12px,
    rgba(255, 255, 255, 0) 12px 26px
  );
  opacity: 0.7;
  pointer-events: none;
}

.edge {
  position: absolute;
  z-index: 3;
  background: repeating-linear-gradient(
    135deg,
    var(--accent) 0 11px,
    #ffffff 11px 20px,
    var(--accent-dark) 20px 28px,
    #ffffff 28px 38px
  );
}

.edge-top {
  inset: 0 0 auto 0;
  height: 7.2%;
}

.edge-left {
  inset: 0 auto 0 0;
  width: 5.2%;
}

.watermark {
  position: absolute;
  z-index: 1;
  left: 12%;
  bottom: 4%;
  color: rgba(0, 0, 0, 0.065);
  font-size: clamp(48px, 16vw, 118px);
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}

.stamp-mark {
  position: absolute;
  z-index: 4;
  top: 12%;
  left: 14%;
  color: rgba(255, 255, 255, 0.42);
  font-size: clamp(50px, 15vw, 120px);
  font-weight: 900;
  line-height: 1;
  -webkit-text-stroke: 2px rgba(0, 0, 0, 0.08);
  transform: rotate(-8deg);
  pointer-events: none;
}

.doc-window {
  position: absolute;
  z-index: 5;
  top: 23%;
  left: 12%;
  width: 29%;
  height: 28%;
  padding: 6.2% 4.8%;
  display: grid;
  gap: 10%;
  border: 2px solid #cfcfcf;
  background: #ffffff;
  box-shadow: 10px 10px 0 rgba(0, 0, 0, 0.13);
}

.doc-window span {
  display: block;
  height: 6px;
  max-height: 6px;
  background: linear-gradient(90deg, #858585 0 58%, transparent 58%);
}

.copy-block {
  position: absolute;
  z-index: 5;
  top: 22%;
  right: 5%;
  width: 43%;
  color: #ffffff;
}

.kicker {
  margin: 0 0 1.8%;
  display: inline-block;
  max-width: 100%;
  padding: 1.6% 3.2%;
  background: var(--accent-dark);
  font-size: clamp(9px, 2.15vw, 14px);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.copy-block h2 {
  margin: 0;
  width: fit-content;
  min-width: min(64%, 190px);
  padding: 2.4% 5.6%;
  color: #ffffff;
  background: var(--accent-dark);
  border: 2px solid rgba(255, 255, 255, 0.86);
  font-size: clamp(34px, 10.8vw, 72px);
  line-height: 1;
  text-align: center;
  overflow-wrap: anywhere;
  line-break: anywhere;
}

.message {
  margin: 3.2% 0 0;
  width: fit-content;
  max-width: 100%;
  padding: 2.2% 3.6%;
  color: var(--ink);
  background: #ffffff;
  font-size: clamp(11px, 2.9vw, 20px);
  font-weight: 900;
  overflow-wrap: anywhere;
  line-break: anywhere;
}

.seal {
  position: absolute;
  z-index: 6;
  top: 15%;
  right: 3.2%;
  width: 12%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 2%;
  color: #202020;
  background: #ffffff;
  border: 2px solid var(--accent-dark);
  border-radius: 50%;
  font-size: clamp(8px, 1.9vw, 12px);
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
  overflow-wrap: anywhere;
}

.bottom-row {
  position: absolute;
  z-index: 6;
  left: 12%;
  right: 8%;
  bottom: 11%;
  display: grid;
  grid-template-columns: 29% 1fr;
  gap: 5%;
  align-items: end;
}

.barcode {
  height: clamp(24px, 6.8vw, 34px);
  padding: 2% 4.5%;
  display: flex;
  gap: 4%;
  align-items: stretch;
  background: #ffffff;
  border: 2px solid var(--ink);
}

.barcode i {
  display: block;
  width: 6%;
  background: #151515;
}

.barcode i:nth-child(2),
.barcode i:nth-child(5),
.barcode i:nth-child(8) {
  width: 13%;
}

.deadline {
  min-height: clamp(24px, 6.8vw, 34px);
  display: grid;
  place-items: center;
  padding: 1% 3%;
  color: var(--ink);
  background: #ffffff;
  border: 2px solid var(--ink);
  font-size: clamp(10px, 2.75vw, 18px);
  font-weight: 900;
  text-align: center;
  overflow-wrap: anywhere;
  line-break: anywhere;
}

.tape {
  position: absolute;
  z-index: 2;
  height: 10%;
  width: 78%;
  background: repeating-linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.86) 0 12px,
    rgba(255, 255, 255, 0.08) 12px 23px
  );
  opacity: 0.22;
}

.tape-one {
  top: 34%;
  left: -10%;
  transform: rotate(-18deg);
}

.tape-two {
  right: -15%;
  bottom: 21%;
  transform: rotate(-18deg);
}

.theme-yellow {
  --accent: #f4d21f;
  --accent-dark: #171717;
  --paper: #fff6b8;
  background:
    linear-gradient(23deg, transparent 0 18%, #111111 18% 33%, transparent 33% 50%, #111111 50% 65%, transparent 65%),
    #f7d925;
}

.theme-yellow .message {
  background: #f4d21f;
}

.theme-yellow .edge,
.theme-yellow .watermark,
.theme-yellow .stamp-mark,
.theme-yellow .barcode,
.theme-yellow .deadline {
  display: none;
}

.theme-yellow::before {
  inset: 0;
  border: 2px solid rgba(17, 17, 17, 0.42);
}

.theme-yellow::after {
  display: none;
}

.theme-yellow .doc-window {
  top: 11%;
  left: 6%;
  width: 44%;
  height: 43%;
  border-color: #4a4a4a;
  border-radius: 14px;
  box-shadow: none;
}

.theme-yellow .copy-block {
  top: 57%;
  left: 32%;
  right: auto;
  width: 40%;
  text-align: center;
}

.theme-yellow .kicker {
  position: absolute;
  top: -118%;
  left: 58%;
  width: 82%;
  color: #ffffff;
  background: transparent;
  font-size: clamp(13px, 3.7vw, 25px);
  line-height: 1.05;
  transform: rotate(23deg);
}

.theme-yellow .kicker::after {
  content: "OPEN IMMEDIATELY";
  display: block;
  margin-top: 2%;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.58em;
  letter-spacing: 0;
}

.theme-yellow .copy-block h2 {
  min-width: 100%;
  padding: 0;
  color: #ffffff;
  background: transparent;
  border: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(35px, 10.5vw, 72px);
  line-height: 0.88;
}

.theme-yellow .message {
  display: none;
}

.theme-yellow .copy-block h2::after {
  content: "IMPORTANT";
  display: block;
  margin-top: 4%;
  font-size: 0.42em;
  letter-spacing: 0.08em;
}

.theme-yellow .seal {
  top: 11%;
  right: 5%;
  width: 12%;
  border-color: #777777;
}

.theme-pop {
  --accent: #f0479b;
  --accent-dark: #111111;
  --paper: #f6f421;
  background:
    radial-gradient(ellipse at center, rgba(255, 255, 255, 0) 0 44%, rgba(255, 255, 255, 0.32) 45% 58%, rgba(255, 255, 255, 0) 59%) 0 0 / 44px 48px,
    repeating-linear-gradient(
      100deg,
      #24c75a 0 11px,
      #ffffff 11px 20px,
      #f0479b 20px 31px,
      #ffffff 31px 40px,
      #f5ec20 40px 51px,
      #ffffff 51px 60px
    );
}

.theme-pop::before,
.theme-pop::after,
.theme-pop .edge,
.theme-pop .watermark,
.theme-pop .stamp-mark {
  display: none;
}

.theme-pop .doc-window {
  top: 12%;
  left: 6%;
  width: 44%;
  height: 39%;
  border-color: #a4a4a4;
  border-radius: 14px;
  box-shadow: none;
}

.theme-pop .copy-block {
  top: 22%;
  right: 4%;
  width: 38%;
}

.theme-pop .kicker {
  display: none;
}

.theme-pop .copy-block h2 {
  min-width: 66%;
  padding: 2% 8%;
  color: #ffffff;
  background: #111111;
  border: 4px solid #ffffff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 8vw, 58px);
}

.theme-pop .message {
  margin-top: 20%;
  width: 100%;
  padding: 4%;
  color: #ffffff;
  background: #111111;
  border: 4px solid #ffffff;
  font-size: clamp(11px, 2.9vw, 20px);
  line-height: 1.35;
}

.theme-pop .seal {
  top: 12%;
  right: 5%;
  width: 11%;
  border-color: #999999;
}

.theme-pop .bottom-row {
  left: 6%;
  right: 50%;
  bottom: 16%;
  display: block;
}

.theme-pop .barcode {
  display: none;
}

.theme-pop .deadline {
  min-height: clamp(24px, 7vw, 42px);
  border-color: #999999;
}

.theme-mono {
  --accent: #222222;
  --accent-dark: #0f0f0f;
  --paper: #f4f4f4;
  background:
    linear-gradient(145deg, transparent 0 64%, #ffffff 64% 70%, transparent 70%),
    linear-gradient(90deg, var(--paper) 0 52%, #222222 52% 100%);
}

.theme-blue {
  --accent: #75c9ef;
  --accent-dark: #254456;
  --paper: #e8f8ff;
  --ink: #254456;
  background:
    linear-gradient(145deg, transparent 0 66%, rgba(255, 255, 255, 0.96) 66% 72%, transparent 72%),
    linear-gradient(90deg, var(--paper) 0 56%, #ffffff 56% 100%);
}

.theme-blue .copy-block h2 {
  color: #254456;
  background: #ffffff;
  border-color: #254456;
}

.theme-blue .message {
  color: #254456;
}

.theme-pink {
  --accent: #f256a3;
  --accent-dark: #121212;
  --paper: #fff0f7;
  background:
    repeating-linear-gradient(135deg, #f36aad 0 46px, #ffffff 46px 82px);
}

.theme-pink::before {
  inset: 0;
  border: 2px solid rgba(17, 17, 17, 0.3);
}

.theme-pink::after,
.theme-pink .edge,
.theme-pink .watermark,
.theme-pink .stamp-mark {
  display: none;
}

.theme-pink .doc-window {
  top: 12%;
  left: 6%;
  width: 44%;
  height: 42%;
  border-color: #8f8f8f;
  border-radius: 8px;
  box-shadow: none;
}

.theme-pink .copy-block {
  top: 52%;
  right: 5%;
  width: 41%;
  padding: 2%;
  background: #111111;
  border: 4px solid #ffffff;
}

.theme-pink .kicker {
  display: none;
}

.theme-pink .copy-block h2 {
  min-width: 100%;
  padding: 0;
  background: transparent;
  border: 0;
  font-size: clamp(25px, 7.5vw, 54px);
}

.theme-pink .message {
  display: block;
  margin: 1% 0 0;
  width: 100%;
  padding: 0;
  color: #ffffff;
  background: transparent;
  font-size: clamp(13px, 3.9vw, 26px);
  line-height: 1.05;
}

.theme-pink .seal {
  top: 12%;
  right: 5%;
  width: 12%;
  border-color: #777777;
}

.theme-pink .bottom-row {
  left: 6%;
  right: 53%;
  bottom: 15%;
  display: block;
}

.theme-pink .barcode {
  display: none;
}

.theme-pink .deadline {
  min-height: clamp(24px, 7vw, 42px);
  border-color: #999999;
}

.theme-orange {
  --accent: #f38b38;
  --accent-dark: #1b1b1b;
  --paper: #fff1e4;
  background:
    linear-gradient(145deg, transparent 0 64%, rgba(255, 255, 255, 0.96) 64% 70%, transparent 70%),
    linear-gradient(90deg, var(--paper) 0 52%, var(--accent) 52% 100%);
}

.controls {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.control-group {
  padding: 14px;
  display: grid;
  gap: 12px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
}

.group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.control-group h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
}

.icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid #cbd2db;
  border-radius: 8px;
  background: #ffffff;
  color: #171717;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
}

.preset-board {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  padding: 8px;
  background:
    linear-gradient(135deg, #111 0 12px, #ffd83d 12px 24px, #111 24px 36px, #ffd83d 36px 48px);
  border: 3px solid #111;
  border-radius: 8px;
}

.preset-board-head {
  min-height: 32px;
  display: grid;
  grid-template-columns: 52px 38px minmax(54px, 0.8fr) minmax(92px, 1fr);
  gap: 8px;
  align-items: center;
  padding: 5px 10px;
  color: #ffffff;
  background: #2a2626;
  border: 2px solid #111;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.preset {
  min-width: 0;
  min-height: 52px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 52px 38px minmax(54px, 0.8fr) minmax(92px, 1fr);
  gap: 8px;
  align-items: center;
  color: #171717;
  background: #f7f8fa;
  border: 2px solid #111;
  border-radius: 0;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.preset.is-active {
  border-color: var(--focus);
  box-shadow: inset 0 0 0 1px var(--focus);
}

.preset-level {
  color: #111111;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.preset-copy {
  min-width: 0;
  overflow-wrap: anywhere;
}

.preset-risk {
  min-width: 0;
  justify-self: end;
  color: #111111;
  background: transparent;
  border-radius: 0;
  font-size: 16px;
  line-height: 1.2;
  white-space: nowrap;
}

.mini {
  width: 38px;
  height: 24px;
  border: 1px solid rgba(0, 0, 0, 0.24);
  background: linear-gradient(90deg, #fff 0 52%, #e9232f 52%);
}

.preset-danger-7 {
  color: #ffffff;
  background: #d80000;
}

.preset-danger-7 .preset-level,
.preset-danger-7 .preset-risk {
  color: #ffffff;
}

.preset-danger-6,
.preset-danger-5 {
  background: #f22d2d;
}

.preset-danger-4,
.preset-danger-3 {
  background: #ff914d;
}

.preset-danger-2 {
  background: #ffe147;
}

.preset-danger-1 {
  background: #79d9ec;
}

.mini-red {
  background: linear-gradient(90deg, #fff 0 52%, #e9232f 52%);
}

.mini-pop {
  background: repeating-linear-gradient(100deg, #24c75a 0 5px, #fff 5px 8px, #f0479b 8px 13px, #fff 13px 16px, #f5ec20 16px 21px);
}

.mini-yellow {
  background: linear-gradient(90deg, #f4d21f 0 52%, #171717 52%);
}

.mini-mono {
  background: linear-gradient(90deg, #f4f4f4 0 52%, #222222 52%);
}

.mini-blue {
  background: linear-gradient(90deg, #e8f8ff 0 52%, #75c9ef 52%);
}

.mini-pink {
  background: linear-gradient(90deg, #fff0f7 0 52%, #121212 52%);
}

.mini-orange {
  background: linear-gradient(90deg, #fff1e4 0 52%, #f38b38 52%);
}

.mini-solid-white {
  background: #f7f7f1;
}

.mini-solid-yellow {
  background: #f5cf18;
}

.mini-solid-pink {
  background: #e98ab3;
}

.mini-solid-black {
  background: #202020;
}

.fields {
  grid-template-columns: 1fr;
}

.fields label {
  display: grid;
  gap: 6px;
  color: #4f5660;
  font-size: 12px;
  font-weight: 900;
}

.fields input {
  width: 100%;
  min-height: 44px;
  padding: 9px 10px;
  color: #171717;
  background: #ffffff;
  border: 1px solid #cfd6de;
  border-radius: 6px;
}

.fields input:focus,
.preset:focus-visible,
.icon-button:focus-visible,
.primary-action:focus-visible,
.secondary-action:focus-visible {
  outline: 3px solid rgba(17, 17, 17, 0.22);
  outline-offset: 2px;
}

.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.primary-action,
.secondary-action {
  min-height: 48px;
  display: grid;
  place-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.primary-action {
  grid-column: 1 / -1;
  color: #ffffff;
  background: #111111;
  border: 1px solid #111111;
}

.secondary-action {
  color: #171717;
  background: #ffffff;
  border: 1px solid #cbd2db;
}

.status {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
}

@media (min-width: 720px) {
  .app-shell {
    width: min(1180px, 100%);
    margin: 0 auto;
    padding: 28px 24px 34px;
    gap: 20px;
  }

  .maker {
    grid-template-columns: minmax(0, 1fr) 360px;
    align-items: start;
  }

  .stage {
    min-height: 560px;
    padding: 28px;
  }

  .controls {
    position: sticky;
    top: 20px;
  }

  .fields {
    grid-template-columns: 1fr 1fr;
  }

  .fields label:nth-child(1),
  .fields label:nth-child(4),
  .fields label:nth-child(5) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 374px) {
  .stage {
    padding: 10px;
  }

  .preset-board {
    padding: 6px;
  }

  .preset-board-head {
    grid-template-columns: 42px 30px minmax(46px, 0.7fr) minmax(76px, 1fr);
    gap: 6px;
    padding-inline: 8px;
    font-size: 10px;
  }

  .preset {
    grid-template-columns: 42px 30px minmax(46px, 0.7fr) minmax(76px, 1fr);
    gap: 6px;
    padding-inline: 8px;
    font-size: 12px;
  }

  .preset-level {
    font-size: 30px;
  }

  .mini {
    width: 30px;
    height: 20px;
  }

  .preset-risk {
    font-size: 13px;
  }
}

@media (max-width: 520px) {
  .masthead h1 {
    font-size: clamp(29px, 8.6vw, 36px);
  }

  .copy-block {
    top: 21%;
    right: 4%;
    width: 45%;
  }

  .notice-card {
    width: calc(100vw - 58px);
    max-width: calc(100vw - 58px);
  }

  .svg-preview {
    width: calc(100vw - 58px);
    max-width: calc(100vw - 58px);
  }

  .kicker {
    font-size: clamp(8px, 2.2vw, 12px);
  }

  .copy-block h2 {
    min-width: 56%;
    max-width: 100%;
    font-size: clamp(30px, 9.8vw, 50px);
  }

  .message {
    width: 100%;
    font-size: clamp(10px, 2.9vw, 16px);
    text-align: center;
  }

  .seal {
    right: 2.4%;
    width: 11%;
    font-size: clamp(7px, 1.8vw, 10px);
  }
}
