:root {
  --bg: #f3f6fb;
  --panel: #ffffff;
  --panel-soft: #f7f8ff;
  --border: #dde4f0;
  --text: #1d2433;
  --muted: #697588;
  --purple-strong: #7c5cff;
  --purple-soft: #f0ebff;
  --purple-border: #d9d1ff;
  --blue-strong: #2b7af7;
  --blue-soft: #ebf3ff;
  --blue-border: #d7e7ff;
  --shadow: 0 16px 32px rgba(35, 52, 82, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Noto Sans JP', sans-serif;
  background: linear-gradient(180deg, #eef3f8 0%, #f8f9fd 100%);
  color: var(--text);
}

button,
select,
textarea {
  font: inherit;
}

.page-shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.topbar {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(221, 228, 240, 0.8);
  border-radius: 18px;
  box-shadow: 0 8px 20px rgba(28, 41, 75, 0.04);
  margin-bottom: 28px;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 24px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--purple-strong), #9a8dff);
  color: white;
  font-weight: 800;
  box-shadow: inset 0 -4px 12px rgba(0, 0, 0, 0.08);
}

.brand-text {
  font-size: clamp(1.1rem, 1.8vw, 1.8rem);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1.2fr);
  gap: 26px;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 26px 22px 22px;
  box-shadow: var(--shadow);
}

.panel-assistant {
  background: linear-gradient(180deg, #fff 0%, var(--purple-soft) 100%);
  border-color: var(--purple-border);
}

.panel-generator {
  background: linear-gradient(180deg, #fff 0%, var(--blue-soft) 100%);
  border-color: var(--blue-border);
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.section-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.accent-purple {
  color: var(--purple-strong);
  background: rgba(124, 92, 255, 0.12);
}

.accent-blue {
  color: var(--blue-strong);
  background: rgba(43, 122, 247, 0.12);
}

h2 {
  margin: 0;
  font-size: clamp(1.5rem, 2vw, 2.2rem);
  line-height: 1.3;
}

.section-copy {
  margin: 10px 0 22px;
  color: var(--muted);
  line-height: 1.7;
  font-size: 0.95rem;
}

.field-group {
  margin-bottom: 18px;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.95rem;
  font-weight: 700;
}

.upload-box {
  display: grid;
  place-items: center;
  min-height: 128px;
  border: 2px dashed #b7c5e1;
  background: rgba(255, 255, 255, 0.58);
  border-radius: 16px;
  text-align: center;
  transition: all 0.2s ease;
  cursor: pointer;
}

.upload-box:hover,
.upload-box:focus-visible {
  border-color: var(--purple-strong);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.08);
}

.upload-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(124, 92, 255, 0.1);
  color: var(--purple-strong);
  font-size: 2rem;
  font-weight: 400;
  margin-bottom: 8px;
}

.upload-text {
  font-weight: 700;
  margin-bottom: 4px;
}

.upload-subtext {
  font-size: 0.75rem;
  color: var(--muted);
}

.select-input,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  padding: 12px 14px;
  font-size: 0.96rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.select-input:focus,
textarea:focus {
  outline: none;
  border-color: var(--purple-strong);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.1);
}

textarea {
  resize: vertical;
  min-height: 112px;
}

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

.primary-button {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 16px 20px;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

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

.button-purple {
  background: linear-gradient(135deg, var(--purple-strong), #8c7dff);
  color: white;
  box-shadow: 0 14px 20px rgba(124, 92, 255, 0.18);
}

.button-blue {
  background: linear-gradient(135deg, var(--blue-strong), #4ea2ff);
  color: white;
  box-shadow: 0 14px 20px rgba(43, 122, 247, 0.18);
}

.result-box {
  margin-top: 22px;
  padding: 18px 18px 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(124, 92, 255, 0.18);
}

.result-title {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.result-box ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  line-height: 1.8;
}

.result-text {
  color: var(--text);
  line-height: 1.8;
  white-space: pre-wrap;
  padding-bottom: 8px;
}

.script-text {
  font-size: 0.92rem;
}

.preview-header {
  margin-top: 22px;
  margin-bottom: 14px;
}

.preview-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.preview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.preview-card {
  flex: 1 1 190px;
  min-width: 0;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(43, 122, 247, 0.12);
  border-radius: 18px;
  padding: 12px 12px 10px;
  box-shadow: 0 8px 18px rgba(39, 61, 98, 0.06);
}

.preview-tag {
  font-size: 0.9rem;
  font-weight: 800;
  margin-bottom: 2px;
}

.preview-subtag {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.preview-image {
  height: 180px;
  border-radius: 14px;
  background: linear-gradient(135deg, #edf3ff 0%, #dfeafc 100%);
  border: 1px solid rgba(43, 122, 247, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  color: #3a5d88;
}

.preview-image span {
  font-weight: 700;
  margin-bottom: 6px;
}

.preview-image small {
  display: block;
  max-width: 190px;
  line-height: 1.6;
  color: #5f7391;
}

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

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 20px, 520px);
    padding-top: 20px;
  }

  .panel {
    padding: 18px 16px 16px;
    border-radius: 20px;
  }

  .brand-wrap {
    padding: 14px 16px;
  }

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

  .preview-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .preview-card {
    flex-basis: auto;
  }
}
