:root {
  --bg: #1e5dff;
  --paper: #ffffff;
  --ink: #111111;
  --accent: #ff8a00;
  --accent-2: #ffe600;
  --border: #000000;
  --shadow: 4px 4px 0 #000000;
  --radius: 16px;
}

* { box-sizing: border-box; }

a { color: inherit; text-decoration: none; }

a:hover { text-decoration: underline; }

body {
  margin: 0;
  padding: 28px 20px 70px;
  font-family: "Noto Sans JP", sans-serif;
  font-weight: 800;
  font-size: 20px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
}

.hero {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 20px;
}

.hero-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.logo-image {
  display: block;
  width: min(416px, 85vw);
  height: auto;
}

.page-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 6px 14px;
  background: var(--accent-2);
  border: 3px solid var(--border);
  border-radius: 999px;
  font-size: 16px;
  letter-spacing: 0.05em;
}

.tagline {
  margin: 10px 0 0;
  color: #ffffff;
  text-shadow: 2px 2px 0 #000000;
  font-size: 18px;
}

.card {
  background: var(--paper);
  border: 4px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin: 18px 0;
  box-shadow: var(--shadow);
}

.label-badge {
  display: inline-block;
  padding: 6px 14px;
  margin: 12px 0 8px;
  background: var(--accent-2);
  border: 3px solid var(--border);
  border-radius: 999px;
  font-size: 16px;
  letter-spacing: 0.05em;
}

.topic-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.note-text {
  margin-left: auto;
  text-align: right;
  font-size: 16px;
  font-weight: 600;
}

.label-tag {
  display: inline-block;
  padding: 6px 10px;
  background: #fff7a6;
  border: 3px solid var(--border);
  border-radius: 10px;
  font-size: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 220px;
}

.custom-input {
  margin-top: 6px;
}

textarea {
  width: 100%;
  min-height: 220px;
  padding: 12px;
  font-family: inherit;
  font-weight: 800;
  font-size: 20px;
  line-height: 1.5;
  background: #ffffff;
  border: 4px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  resize: vertical;
}

.auto-grow {
  overflow: hidden;
  resize: none;
}

.topic-box {
  min-height: 100px;
}

input,
select {
  min-width: 220px;
  padding: 10px 12px;
  font-family: inherit;
  font-weight: 800;
  font-size: 20px;
  background: #ffffff;
  border: 4px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

pre {
  background: #ffffff;
  padding: 12px;
  border-radius: 12px;
  border: 4px solid var(--border);
  box-shadow: var(--shadow);
  white-space: pre-wrap;
  font-family: inherit;
  font-weight: 800;
  font-size: 19px;
}

.ai-output {
  background: #ffffff;
  padding: 12px;
  border-radius: 12px;
  border: 4px solid var(--border);
  box-shadow: var(--shadow);
  font-weight: 800;
  font-size: 19px;
  line-height: 1.6;
  word-break: break-word;
}

.ai-output p {
  margin: 0 0 10px;
}

.ai-output p:last-child {
  margin-bottom: 0;
}

.ai-output h2,
.ai-output h3,
.ai-output h4 {
  margin: 8px 0 6px;
  font-weight: 900;
}

.ai-output h2 { font-size: 28px; }
.ai-output h3 { font-size: 24px; }
.ai-output h4 { font-size: 22px; }

.ai-output .ai-underline {
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 4px;
}

.ai-output .ai-gap {
  height: 10px;
}

.ai-output .ai-list {
  margin: 0 0 10px 22px;
  padding: 0;
  list-style: disc;
}

.ai-output .ai-list li {
  margin: 4px 0;
}

.ai-output.ai-comment,
.ai-output .ai-comment-heading,
.ai-output .ai-comment-block {
  color: #1e63c8;
}

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

.tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0 12px;
}

.tab-button {
  font-size: 18px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 3px solid var(--border);
  background: #fff7a6;
  color: #000000;
  box-shadow: var(--shadow);
}

.tab-button.active {
  background: var(--accent);
}

.tab-panel {
  margin-top: 6px;
}

.copy-button {
  border: 3px solid currentColor;
  background: transparent;
  color: #000000;
  border-radius: 999px;
  padding: 6px;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}

.copy-button:hover {
  transform: translate(1px, 1px);
}

.copy-button--light {
  color: #ffffff;
  box-shadow: 3px 3px 0 #000000;
}

.copy-button--dark {
  color: #000000;
}

.copy-icon {
  width: 22px;
  height: 22px;
  display: block;
}

.copy-button--light .copy-icon {
  filter: invert(1);
}

.prompt-box {
  margin-top: 8px;
}

button {
  cursor: pointer;
  border: 4px solid var(--border);
  border-radius: 999px;
  background: var(--accent);
  color: #000000;
  font-family: inherit;
  font-weight: 900;
  font-size: 20px;
  padding: 12px 20px;
  box-shadow: var(--shadow);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

button:hover {
  transform: translate(1px, 1px);
}

button:active {
  transform: translate(4px, 4px);
  box-shadow: 0 0 0 #000000;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.cta-button {
  font-size: 24px;
  padding: 18px 34px;
  min-width: 240px;
}

.secondary-button {
  background: var(--accent-2);
}

.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.row.center {
  justify-content: center;
}

.settings-row {
  align-items: flex-start;
}

.action-row {
  margin-top: 18px;
}

.center-text {
  text-align: center;
  margin-top: 8px;
}

.muted {
  color: #222222;
}

.error {
  color: #d30000;
}

.small {
  font-size: 16px;
}

.grid3 {
  display: grid;
  grid-template-columns: 1fr 0.9fr 1fr;
  gap: 14px;
  margin-top: 12px;
}

@media (max-width: 980px) {
  .grid3 { grid-template-columns: 1fr; }
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 12px;
}

@media (max-width: 980px) {
  .grid2 { grid-template-columns: 1fr; }
}

.panel {
  background: #ffffff;
  border: 4px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  box-shadow: var(--shadow);
}

.step-panel {
  position: relative;
  overflow: hidden;
}

.step-panel::after {
  content: attr(data-step);
  position: absolute;
  right: 12px;
  bottom: -18px;
  font-size: clamp(88px, 12vw, 160px);
  font-weight: 900;
  color: #b7e6ff;
  opacity: 0.6;
  line-height: 1;
  z-index: 0;
  pointer-events: none;
}

.step-panel > * {
  position: relative;
  z-index: 1;
}

.final-comment {
  margin-top: 14px;
}

.panel-actions {
  justify-content: flex-end;
}

.panel-actions .muted {
  margin-right: auto;
}

.panel-title {
  display: inline-block;
  margin: 0 0 8px;
  padding: 4px 10px;
  background: var(--accent-2);
  border: 3px solid var(--border);
  border-radius: 999px;
  font-size: 17px;
}

.hidden { display: none; }

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}

.modal-card {
  position: relative;
  width: min(92vw, 560px);
  background: #ffffff;
  border-radius: 20px;
  padding: 22px;
  border: 4px solid var(--border);
  box-shadow: 6px 6px 0 #000000;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-header h3 {
  margin: 0;
  font-size: 22px;
}

.modal-close {
  border: 4px solid var(--border);
  background: var(--accent-2);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 2px 2px 0 #000000;
}

.modal-body {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.modal-qr {
  width: min(320px, 80vw);
  height: min(320px, 80vw);
  border-radius: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.modal-url-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}

.modal-url {
  width: min(100%, 420px);
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
