:root {
  --white: #ffffff;
  --ink: #24272d;
  --blue: #145dff;
  --blue-soft: #eef3ff;
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 48px;
  --radius: 12px;
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", sans-serif;
  color: var(--ink);
  background: var(--white);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; font-size: 16px; line-height: 1.6; letter-spacing: .01em; }
button, input, select, textarea { font: inherit; color: inherit; }
button, select { min-height: 44px; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 20; padding: 12px 16px; background: var(--blue); color: var(--white); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }

.site-header { display: flex; justify-content: space-between; align-items: center; min-height: 52px; padding: 4px clamp(20px, 4vw, 56px); border-bottom: 1px solid rgb(36 39 45 / 12%); }
.site-header p { margin: 0; color: rgb(36 39 45 / 56%); font-size: 12px; letter-spacing: .08em; }
.brand { color: rgb(36 39 45 / 72%); font-size: 12px; font-weight: 700; text-decoration: none; letter-spacing: .1em; text-transform: uppercase; }
.brand span { color: var(--blue); }

main { width: min(100%, 1320px); margin-inline: auto; }
.tool-intro { padding: 28px clamp(20px, 4vw, 56px) 20px; }
.eyebrow { margin: 0 0 4px; color: rgb(20 93 255 / 72%); font-size: 12px; font-weight: 700; letter-spacing: .14em; }
h1, h2, h3, p { overflow-wrap: normal; word-break: normal; }
h1 { margin: 0; max-width: 900px; color: rgb(36 39 45 / 84%); font-size: clamp(28px, 3vw, 36px); line-height: 1.2; letter-spacing: -.035em; }
h1 span { color: var(--blue); }
.lead { max-width: 760px; margin: 8px 0 0; color: rgb(36 39 45 / 56%); font-size: 12px; line-height: 1.6; }

.controls { position: sticky; top: 0; z-index: 5; padding: 8px clamp(20px, 4vw, 56px); background: rgb(255 255 255 / 96%); border-block: 1px solid rgb(36 39 45 / 10%); }
.control-grid { display: grid; grid-template-columns: minmax(240px, 2fr) repeat(3, minmax(140px, 1fr)); gap: 16px; }
label { display: grid; gap: 4px; color: rgb(36 39 45 / 56%); font-size: 12px; font-weight: 700; letter-spacing: .04em; }
input, select, textarea { width: 100%; border: 1px solid rgb(36 39 45 / 16%); border-radius: 2px; background: var(--white); }
input, select { min-height: 44px; padding: 8px 12px; font-size: 14px; }
textarea { padding: 16px; line-height: 1.6; resize: vertical; }
.text-button { margin-top: 8px; padding: 0; border: 0; background: transparent; color: rgb(20 93 255 / 64%); font-size: 12px; font-weight: 700; text-decoration: none; }

.catalog { padding: 24px clamp(20px, 4vw, 56px) 96px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 16px; }
.section-heading h2 { margin: 0; color: rgb(36 39 45 / 64%); font-size: 16px; line-height: 1.3; }
.section-heading > p { margin: 0; color: rgb(36 39 45 / 48%); font-size: 12px; font-weight: 400; letter-spacing: .08em; }
.prompt-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 16px; }
.prompt-card { display: flex; flex-direction: column; min-width: 0; }
.generated-preview {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: var(--white);
  border: 1px solid rgb(36 39 45 / 12%);
  border-radius: 0;
}
.preview { position: relative; display: grid; min-height: 220px; padding: 24px; overflow: hidden; background: var(--blue-soft); border-bottom: 1px solid var(--ink); }
.preview.dark { color: var(--white); background: var(--ink); }
.preview::after { content: ""; position: absolute; width: 96px; height: 96px; right: 24px; bottom: 24px; border: 16px solid var(--blue); border-radius: 50%; }
.preview.person::after { width: 80px; height: 132px; border: 0; border-radius: 40px 40px 0 0; background: var(--blue); }
.preview .mini-label { align-self: start; width: max-content; padding: 4px 8px; color: var(--white); background: var(--blue); font-size: 16px; font-weight: 700; }
.preview strong { align-self: end; max-width: 70%; font-size: 24px; line-height: 1.35; z-index: 1; }
.card-body { display: flex; flex: 1; flex-direction: column; padding: 8px 0 0; }
.card-meta { margin: 0 0 4px; color: rgb(20 93 255 / 68%); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.card-body h3 { margin: 0; color: rgb(36 39 45 / 76%); font-size: 16px; line-height: 1.4; }
.card-use { margin: 4px 0 8px; color: rgb(36 39 45 / 52%); font-size: 12px; line-height: 1.6; }
.card-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: auto 0 20px; padding: 0; list-style: none; }
.card-tags li { padding: 4px 8px; background: var(--blue-soft); font-size: 12px; }
.primary-button, .detail-button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 16px; border: 1px solid var(--blue); border-radius: 6px; font-weight: 700; }
.primary-button { color: var(--white); background: var(--blue); }
.secondary-button { min-height: 44px; padding: 8px 20px; border: 1px solid rgb(36 39 45 / 16%); border-radius: 2px; color: var(--blue); background: var(--white); font-size: 12px; font-weight: 700; }
.load-more-wrap { display: flex; justify-content: center; min-height: 64px; padding-top: 24px; }
.load-sentinel { display: grid; width: 100%; height: 40px; place-items: center; }
.load-sentinel span { width: 32px; height: 1px; background: rgb(20 93 255 / 48%); }
.detail-button { align-self: flex-start; width: auto; min-height: 44px; padding: 4px 0; border: 0; color: rgb(20 93 255 / 72%); background: var(--white); font-size: 12px; }
.empty-state { padding: 48px 24px; text-align: center; border: 1px solid var(--ink); }
.empty-state h3 { margin: 0; font-size: 24px; }

dialog { width: min(1180px, calc(100% - 32px)); height: min(820px, calc(100dvh - 32px)); max-height: calc(100dvh - 32px); padding: 0; overflow: hidden; border: 1px solid var(--ink); border-radius: 2px; color: var(--ink); background: var(--white); }
dialog::backdrop { background: rgb(51 51 51 / 72%); }
.dialog-close { position: sticky; top: 0; z-index: 2; display: flex; justify-content: end; padding: 8px; background: var(--white); border-bottom: 1px solid var(--ink); }
.dialog-close button { min-width: 72px; border: 0; background: transparent; font-weight: 700; }
.dialog-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(360px, .8fr); height: calc(100% - 61px); min-height: 0; }
.dialog-design { display: flex; min-width: 0; margin: 0; padding: 24px; flex-direction: column; justify-content: center; background: var(--blue-soft); border-right: 1px solid rgb(36 39 45 / 20%); }
.dialog-design img { display: block; width: 100%; height: auto; max-height: calc(100% - 40px); object-fit: contain; border: 1px solid var(--ink); background: var(--white); }
.dialog-design .preview { width: 100%; min-height: 0; aspect-ratio: 16 / 9; border: 1px solid var(--ink); }
.dialog-design figcaption { margin-top: 8px; color: rgb(36 39 45 / 52%); font-size: 12px; font-weight: 400; text-align: center; letter-spacing: .08em; }
.dialog-content { min-height: 0; padding: 24px 32px 40px; overflow-y: auto; overscroll-behavior: contain; }
.dialog-content h2 { margin: 0; color: rgb(36 39 45 / 84%); font-size: 24px; line-height: 1.3; }
.dialog-content h3 { margin: 0 0 8px; color: rgb(36 39 45 / 64%); font-size: 12px; letter-spacing: .06em; }
.dialog-content section { margin-top: 24px; }
.dialog-content section p { margin: 0; }
.dialog-lead, .dialog-content section p { color: rgb(36 39 45 / 64%); font-size: 14px; }
.warning { padding: 16px; border-left: 4px solid var(--blue); background: var(--blue-soft); }
#copy-prompt { width: 100%; margin-top: 16px; }
#copy-status { min-height: 28px; margin: 8px 0 0; text-align: center; font-weight: 700; }

footer { display: flex; justify-content: space-between; gap: 24px; padding: 20px clamp(20px, 5vw, 72px); color: rgb(255 255 255 / 56%); background: var(--ink); font-size: 12px; letter-spacing: .08em; }
footer p { margin: 0; }

@media (max-width: 980px) {
  .control-grid { grid-template-columns: repeat(2, 1fr); }
  .prompt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .site-header { align-items: flex-start; }
  .site-header p { max-width: 120px; text-align: right; }
  .brand span { display: block; }
  .tool-intro { padding-top: 48px; gap: 40px; }
  h1 { font-size: 28px; }
  .lead { font-size: 12px; }
  .control-grid, .prompt-grid { grid-template-columns: 1fr; }
  .section-heading { display: block; }
  .section-heading > p { margin-top: 16px; }
  .preview { min-height: 200px; }
  .dialog-content { padding-inline: 20px; }
  .dialog-content h2 { font-size: 24px; }
  footer { display: block; }
  footer p + p { margin-top: 8px; }
}

@media (max-width: 800px) {
  dialog { height: calc(100dvh - 16px); width: calc(100% - 16px); max-height: calc(100dvh - 16px); }
  .dialog-layout { display: flex; flex-direction: column; }
  .dialog-design { position: sticky; top: 0; z-index: 1; flex: 0 0 auto; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--ink); }
  .dialog-design img, .dialog-design .preview { width: min(100%, 520px); max-height: 30dvh; margin-inline: auto; }
  .dialog-design figcaption { margin-top: 4px; }
  .dialog-content { flex: 1 1 auto; padding-top: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
