:root {
  --ink: #151515;
  --ink-soft: #3d3d3d;
  --paper: #fffaf0;
  --surface: #ffffff;
  --line: #ded7ca;
  --accent: #f7b801;
  --accent-strong: #d89100;
  --green: #16a085;
  --rose: #ef476f;
  --shadow: 0 24px 60px rgba(21, 21, 21, 0.12);
  --radius: 8px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(135deg, rgba(247, 184, 1, 0.12), transparent 34%),
    linear-gradient(225deg, rgba(22, 160, 133, 0.12), transparent 28%),
    var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
  line-height: 1.7;
}

a {
  color: inherit;
}

.site-header,
.site-footer {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: var(--accent);
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(21, 21, 21, 0.18);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1rem;
}

.brand small {
  color: var(--ink-soft);
  font-size: 0.75rem;
  line-height: 1.25;
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.top-nav a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 0.92rem;
  text-decoration: none;
}

.top-nav a:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
}

main {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  min-height: calc(100vh - 76px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.85fr);
  align-items: center;
  gap: 44px;
  padding: 36px 0 64px;
}

.hero-copy {
  max-width: 720px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(2.25rem, 7vw, 4.7rem);
  line-height: 1.04;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.25;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.35;
}

.lead {
  max-width: 640px;
  margin: 22px 0 0;
  color: var(--ink-soft);
  font-size: 1.08rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ink);
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  background: var(--ink);
  color: white;
}

.button.secondary {
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
}

.visual-panel {
  display: flex;
  justify-content: center;
}

.device-shell {
  width: min(100%, 410px);
  aspect-ratio: 0.72;
  position: relative;
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 48px 22px 22px;
  border: 12px solid var(--ink);
  border-radius: 34px;
  background:
    linear-gradient(160deg, #fff 0%, #f5efe2 100%);
  box-shadow: var(--shadow);
}

.device-bar {
  position: absolute;
  top: 18px;
  left: 50%;
  width: 86px;
  height: 8px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #303030;
}

.preview-card,
.url-box,
.doc-section,
.contact-form,
.output-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(21, 21, 21, 0.06);
}

.preview-card {
  position: relative;
  min-height: 128px;
  padding: 20px;
  overflow: hidden;
}

.preview-card::after {
  content: "";
  position: absolute;
  right: -24px;
  bottom: -34px;
  width: 112px;
  height: 112px;
  border: 16px solid rgba(247, 184, 1, 0.3);
  border-radius: 50%;
}

.preview-card.muted::after {
  border-color: rgba(22, 160, 133, 0.26);
}

.preview-card p,
.preview-card small,
.preview-card strong {
  position: relative;
  z-index: 1;
  display: block;
}

.preview-card p {
  margin: 0 0 8px;
  color: var(--ink-soft);
  font-size: 0.83rem;
  font-weight: 700;
}

.preview-card strong {
  font-size: 1.35rem;
  line-height: 1.2;
}

.preview-card small {
  margin-top: 10px;
  color: var(--ink-soft);
}

.status-dot {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 50%;
  background: var(--rose);
}

.status-dot.green {
  background: var(--green);
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.mini-grid span {
  min-height: 58px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(21, 21, 21, 0.1), rgba(21, 21, 21, 0.03));
}

.url-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 16px 0 54px;
}

.url-strip article {
  min-height: 190px;
  padding: 22px;
  border-left: 4px solid var(--ink);
  background: rgba(255, 255, 255, 0.7);
}

.url-strip span {
  color: var(--green);
  font-weight: 900;
}

.url-strip h2 {
  margin-top: 12px;
}

.url-strip p {
  margin-bottom: 0;
  color: var(--ink-soft);
}

.builder {
  padding: 54px 0 78px;
  border-top: 1px solid var(--line);
}

.section-heading {
  max-width: 720px;
  margin-bottom: 24px;
}

.section-heading p:last-child {
  color: var(--ink-soft);
}

.builder-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 20px;
  align-items: start;
}

.builder-form,
.contact-form {
  display: grid;
  gap: 16px;
}

.builder-form {
  padding: 0;
}

.card-form {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 28px rgba(21, 21, 21, 0.06);
}

label {
  display: grid;
  gap: 7px;
}

label span {
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  padding: 10px 12px;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  outline: 3px solid rgba(247, 184, 1, 0.35);
  border-color: var(--accent-strong);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.output-panel {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 14px;
  padding: 20px;
}

.output-header .eyebrow {
  margin-bottom: 4px;
}

.url-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 10px;
  padding: 14px;
}

.url-box span {
  grid-column: 1 / -1;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.url-box a {
  min-width: 0;
  color: var(--ink);
  font-size: 0.92rem;
  word-break: break-all;
}

.icon-button {
  min-height: 34px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--ink);
  color: white;
  font-weight: 800;
  cursor: pointer;
}

.icon-button.copied {
  background: var(--green);
  border-color: var(--green);
}

.checklist {
  padding: 2px 0 0;
}

.checklist ul,
.doc-section ul {
  margin: 10px 0 0;
  padding-left: 1.25rem;
}

.checklist li,
.doc-section li {
  margin: 6px 0;
}

.form-status {
  min-height: 1.6em;
  margin: 0;
  color: var(--ink-soft);
  font-weight: 700;
}

.form-status[data-tone="error"] {
  color: #b42318;
}

.form-status[data-tone="success"] {
  color: #087443;
}

.form-status[data-tone="pending"] {
  color: var(--accent-strong);
}

.empty-result {
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--ink-soft);
}

.empty-result p {
  margin: 0;
}

.empty-note {
  margin: 12px 0 0;
  color: var(--ink-soft);
}

.issued-result {
  display: grid;
  gap: 14px;
}

.id-badge {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(247, 184, 1, 0.12);
}

.id-badge span {
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.id-badge strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  overflow-wrap: anywhere;
}

.document-page {
  padding: 44px 0 74px;
}

.generated-page {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 44px 0 74px;
}

.generated-hero {
  min-height: 300px;
  display: grid;
  align-content: center;
  padding: 34px 0;
}

.generated-hero.compact {
  min-height: 230px;
}

.generated-hero h1 {
  max-width: 950px;
  font-size: clamp(2rem, 6vw, 4rem);
}

.generated-hero p:not(.eyebrow),
.generated-description {
  max-width: 780px;
  color: var(--ink-soft);
  font-size: 1.04rem;
}

.generated-description p {
  margin: 14px 0 0;
}

.generated-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.generated-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.screenshot-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.screenshot-card {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8f6f1;
  overflow: hidden;
}

.screenshot-card img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 520px;
  object-fit: contain;
}

.policy-body p {
  color: var(--ink-soft);
}

.document-hero {
  max-width: 900px;
  min-height: 280px;
  display: grid;
  align-content: center;
  padding: 34px 0;
}

.document-hero.compact {
  min-height: 210px;
}

.document-hero h1 {
  font-size: clamp(2rem, 6vw, 4rem);
}

.document-hero p:not(.eyebrow) {
  max-width: 760px;
  color: var(--ink-soft);
  font-size: 1.04rem;
}

.document-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.doc-section {
  padding: 24px;
}

.doc-section.wide {
  grid-column: 1 / -1;
}

.doc-section h2 {
  font-size: 1.18rem;
}

.doc-section p {
  color: var(--ink-soft);
}

.text-link {
  display: inline-flex;
  color: var(--ink);
  font-weight: 800;
}

.meta-line {
  margin-bottom: 0;
  font-weight: 800;
}

.contact-form {
  max-width: 760px;
  padding: 22px;
}

.hidden-field {
  display: none;
}

.admin-page {
  max-width: 900px;
}

.admin-panel {
  display: grid;
  gap: 14px;
}

.admin-form {
  display: grid;
  gap: 16px;
}

.mono-textarea {
  min-height: 360px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92rem;
  line-height: 1.55;
  white-space: pre;
}

.admin-help {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-logout {
  display: flex;
  justify-content: flex-end;
}

.admin-notice {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-weight: 800;
}

.admin-notice.success {
  border-color: rgba(22, 160, 133, 0.35);
  background: rgba(22, 160, 133, 0.1);
  color: #087443;
}

.admin-notice.error {
  border-color: rgba(239, 71, 111, 0.35);
  background: rgba(239, 71, 111, 0.1);
  color: #b42318;
}

.admin-notice.info {
  border-color: rgba(247, 184, 1, 0.42);
  background: rgba(247, 184, 1, 0.12);
}

.site-footer {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.9rem;
}

@media (max-width: 880px) {
  .hero,
  .builder-layout,
  .document-grid,
  .generated-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .visual-panel {
    justify-content: start;
  }

  .url-strip {
    grid-template-columns: 1fr;
  }

  .output-panel {
    position: static;
  }

  .doc-section.wide {
    grid-column: auto;
  }
}

@media (max-width: 620px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px 0;
  }

  .top-nav {
    justify-content: flex-start;
  }

  .top-nav a {
    padding: 0 10px;
  }

  .hero {
    padding-top: 22px;
  }

  .hero-actions,
  .generated-actions,
  .admin-actions,
  .button {
    width: 100%;
  }

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

  .url-box {
    grid-template-columns: 1fr;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: 16px 0;
  }
}
