:root {
  color-scheme: light;
  --paper: #faf8f2;
  --paper-2: #f3efe6;
  --paper-3: #ebe6d9;
  --ink: #14130f;
  --ink-2: #2c2a24;
  --muted: #6f6a5e;
  --muted-2: #948e80;
  --line: #e0dac8;
  --line-soft: #ece6d5;
  --white: #ffffff;
  --accent: #3b006d;
  --accent-dark: #27004b;
  --accent-soft: #f3eef9;
  --moss: #4b7a62;
  --moss-soft: #edf6f0;
  --terracotta: #a85f43;
  --terracotta-soft: #fbf0eb;
  --amber: #b87723;
  --shadow-sm: 0 1px 2px rgba(20, 19, 15, 0.04);
  --shadow-md: 0 4px 16px rgba(20, 19, 15, 0.06);
  --shadow-lg: 0 18px 42px rgba(20, 19, 15, 0.1);
  --font-serif: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --font-sans: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.65) 0%, rgba(250, 248, 242, 0) 240px),
    var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-feature-settings: "palt";
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px clamp(18px, 3.2vw, 40px);
  border-bottom: 1px solid var(--line);
  background: rgba(250, 248, 242, 0.92);
  backdrop-filter: blur(12px);
}

.brand-logo-link,
.brand-title {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  color: var(--ink);
  font-weight: 850;
  text-decoration: none;
}

.brand-title {
  margin-right: auto;
  font-size: 1.02rem;
}

.brand-logo {
  display: block;
  width: 154px;
  height: 42px;
  object-fit: contain;
}

.brand-title {
  overflow: hidden;
  max-width: 260px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-actions,
.tone-switch {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-actions .primary-button {
  min-width: 108px;
  border-color: var(--accent);
  background: var(--accent);
  color: var(--paper);
}

.top-actions .primary-button:hover {
  background: var(--accent-dark);
}

.primary-button,
.ghost-button,
.tone {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 14px;
  background: var(--white);
  color: var(--ink);
  font-weight: 800;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

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

.primary-button:hover {
  background: var(--ink-2);
}

.ghost-button:hover,
.tone:hover {
  border-color: var(--muted-2);
  background: #fffdf7;
}

.tone {
  min-height: 32px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 0.82rem;
}

.tone.active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.app-shell {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 26px clamp(18px, 3.2vw, 40px) 48px;
}

.legal-page {
  display: grid;
  gap: 16px;
  max-width: 880px;
  margin: 0 auto;
  padding: 56px clamp(18px, 4vw, 44px);
  line-height: 1.85;
}

.legal-page h1,
.legal-page h2,
.legal-page p {
  margin: 0;
}

.legal-page h1 {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
}

.legal-page h2 {
  margin-top: 20px;
  border-left: 4px solid var(--accent);
  padding-left: 10px;
  font-size: 1.08rem;
}

.intro {
  display: grid;
  gap: 42px;
  align-items: center;
  margin-bottom: 34px;
  border-bottom: 1px solid var(--line);
  padding: 44px 0 36px;
}

.intro-main {
  display: grid;
  justify-items: center;
  text-align: center;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
}

h1,
h2 {
  margin: 0;
}

h1 {
  max-width: 920px;
  font-family: var(--font-serif);
  font-size: clamp(2.1rem, 5vw, 5.1rem);
  font-weight: 650;
  line-height: 1.12;
  color: var(--accent-dark);
  white-space: nowrap;
}

.intro > div > p:not(.eyebrow) {
  max-width: 740px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.9;
}

.intro > div > p strong {
  color: var(--accent-dark);
  font-weight: 950;
}

.input-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 18px;
  padding: 9px 14px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.6;
}

.input-notice-icon {
  flex-shrink: 0;
  color: #8f3f29;
  font-size: 0.9rem;
}

.intro-actions {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 28px;
  width: min(1140px, 100%);
  margin: 0 auto;
}

.intro-action-group {
  display: grid;
  gap: 14px;
}

.intro-action-group-create {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.intro-action-group-data {
  grid-template-columns: 1fr;
}

.intro-group-title {
  display: flex;
  grid-column: 1 / -1;
  align-items: baseline;
  gap: 14px;
  color: var(--accent-dark);
}

.intro-group-title span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 900;
}

.intro-group-title strong {
  font-family: var(--font-serif);
  font-size: 1.24rem;
}

.intro-group-title small {
  color: var(--muted);
  font-size: 0.82rem;
}

.intro-action {
  display: grid;
  gap: 12px;
  min-height: 248px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 24px;
  background: var(--white);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 14px 34px rgba(20, 19, 15, 0.05);
}

.intro-action:hover {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
  transform: translateY(-1px);
}

.intro-action.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--paper);
  box-shadow: 0 24px 60px rgba(59, 0, 109, 0.22);
}

.intro-action > span:not(.intro-icon) {
  margin-top: 4px;
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1.35;
}

.intro-action small {
  color: inherit;
  font-size: 0.86rem;
  line-height: 1.8;
  opacity: 0.72;
}

.intro-action strong {
  margin-top: auto;
  border-top: 1px solid color-mix(in srgb, currentColor 18%, transparent);
  padding-top: 16px;
  font-size: 0.86rem;
}

.intro-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.85rem;
  font-weight: 950;
}

.intro-action.primary .intro-icon {
  background: rgba(255, 255, 255, 0.14);
  color: var(--paper);
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  overflow: hidden;
  width: min(520px, 100%);
  margin: -14px auto 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.stats div {
  padding: 14px 18px;
}

.stats div + div {
  border-left: 1px solid var(--line);
}

.stats strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
}

.stats span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(380px, 2.2fr);
  gap: 0;
  overflow: hidden;
  min-height: 760px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow-md);
}

.editor-panel,
.preview-panel {
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: var(--white);
  box-shadow: none;
}

.editor-panel {
  border-right: 1px solid var(--line);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 74px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: #fffdf8;
}

.panel-head h2 {
  font-size: 1.08rem;
}

.panel-tools {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.tool-help {
  max-width: 430px;
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.6;
  text-align: right;
}

.form-grid {
  display: grid;
  gap: 16px;
  padding: 20px 24px 56px;
}

.import-box {
  display: grid;
  gap: 14px;
  margin: 20px 24px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: linear-gradient(180deg, #fffdf7 0%, var(--paper) 100%);
}

.import-head,
.import-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.import-head {
  justify-content: space-between;
}

.import-head h3 {
  margin: 0;
  font-size: 1rem;
}

.source-label {
  font-size: 0.82rem;
}

.source-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.import-flow,
.import-step {
  display: grid;
  gap: 12px;
}

.import-step {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.64);
}

.import-step-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.import-step-head strong,
.import-step-head small {
  display: block;
}

.import-step-head strong {
  font-size: 0.94rem;
}

.import-step-head small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.55;
}

.step-number {
  display: inline-grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.76rem;
  font-weight: 900;
}

.pdf-import,
.ai-actions {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.visually-hidden-file {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.pdf-import span,
.ai-actions span {
  min-height: 20px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
}

.pdf-import #pdfStatus {
  grid-column: 1 / -1;
}

.selected-file-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-actions {
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
}

.ai-actions span {
  grid-column: auto;
}

.primary-button:disabled,
.ghost-button:disabled {
  cursor: not-allowed;
  border-color: var(--line);
  background: #ede7dc;
  color: #9c927f;
  box-shadow: none;
}

.mapping-profile {
  max-width: 280px;
  font-size: 0.82rem;
}

.import-result {
  min-height: 20px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.import-summary,
.download-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.import-summary span,
.download-summary span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  background: var(--white);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 800;
}

.import-details,
.source-preview,
.download-list {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: var(--white);
}

.import-details summary,
.source-preview summary {
  cursor: pointer;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 850;
}

.import-details ul {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.import-details li {
  display: grid;
  gap: 2px;
}

.manual-map-row {
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.8fr);
  gap: 10px;
  align-items: end;
}

.manual-map-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.manual-map-actions select,
.manual-map-actions button {
  min-height: 36px;
}

.import-details small {
  color: var(--muted);
}

.source-preview pre {
  overflow: auto;
  max-height: 260px;
  margin: 10px 0 0;
  white-space: pre-wrap;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  line-height: 1.65;
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink-2);
  font-size: 0.84rem;
  font-weight: 850;
}

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

.form-section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fffdf8;
}

.form-section legend,
.advanced-section summary {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 900;
}

.form-section legend {
  padding: 0 8px;
  font-family: var(--font-serif);
  font-weight: 700;
}

.advanced-section {
  display: block;
}

.advanced-section summary {
  cursor: pointer;
}

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

.section-note {
  margin: 14px 0 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 14px;
  background: var(--paper-2);
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.7;
}

.subsection-title {
  margin: 10px 0 -2px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  color: var(--accent-dark);
  font-family: var(--font-serif);
  font-size: 1.02rem;
  font-weight: 750;
}

.subsection-title:first-child {
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
}

.location-list {
  display: grid;
  gap: 12px;
}

.location-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
}

.location-card summary {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 900;
}

.location-remove {
  min-height: 30px;
  border: 1px solid #e2b8a9;
  border-radius: 4px;
  padding: 0 10px;
  background: var(--terracotta-soft);
  color: #8f3f29;
  font-size: 0.78rem;
  font-weight: 850;
}

.location-remove[hidden] {
  display: none;
}

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

.location-actions {
  display: flex;
  justify-content: flex-start;
}

.required {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: 999px;
  padding: 2px 7px;
  background: var(--terracotta-soft);
  color: #8f3f29;
  font-size: 0.7rem;
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 9px 11px;
  background: var(--white);
  color: var(--ink);
  outline: none;
}

textarea {
  resize: vertical;
  line-height: 1.65;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(81, 64, 111, 0.12);
}

.preview-panel {
  position: static;
  max-height: none;
  overflow: visible;
  background: var(--paper-2);
}

.preview-head {
  position: static;
  z-index: 2;
  background: var(--paper-2);
}

.preview-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 11px;
  background: var(--paper);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.status-pill.ready {
  border-color: #b8d7c5;
  background: var(--moss-soft);
  color: var(--moss);
}

.job-preview {
  margin: 24px;
  min-height: 620px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 28px 26px;
  background: var(--white);
  box-shadow: 0 1px 0 var(--line), 0 12px 32px rgba(20, 19, 15, 0.06);
  line-height: 1.85;
}

.job-preview h3 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  line-height: 1.35;
}

.job-preview .company {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 850;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 24px;
}

.summary-item {
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 9px 10px;
  background: var(--paper-2);
}

.summary-item span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
}

.summary-item strong {
  display: block;
  margin-top: 2px;
  overflow-wrap: anywhere;
  font-size: 0.9rem;
}

.preview-section {
  margin-top: 22px;
}

.preview-section h4 {
  margin: 0 0 8px;
  border-left: 4px solid var(--accent);
  padding-left: 10px;
  font-size: 0.94rem;
}

.preview-section p {
  margin: 0;
  color: var(--ink-2);
  white-space: pre-wrap;
}

.preview-agency-block {
  margin-top: 28px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.preview-divider {
  display: grid;
  gap: 4px;
  border: 1px solid #d8c9e8;
  border-radius: 6px;
  padding: 12px 14px;
  background: #fbf7ff;
}

.preview-divider strong {
  color: var(--accent-dark);
  font-size: 0.92rem;
}

.preview-divider span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.check-panel {
  border-top: 1px solid var(--line);
  padding: 18px 24px 28px;
  background: var(--paper-2);
}

.check-ready {
  display: grid;
  gap: 4px;
  border: 1px solid #b8d7c5;
  border-radius: 6px;
  padding: 12px;
  background: var(--moss-soft);
  color: var(--moss);
}

.check-ready span,
.check-head span,
.missing-list small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

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

.missing-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.missing-list li {
  display: grid;
  grid-template-columns: minmax(84px, auto) minmax(0, 1fr);
  gap: 6px 10px;
  align-items: start;
  border: 1px solid #ead4b5;
  border-radius: 6px;
  padding: 10px;
  background: #fffaf1;
}

.missing-list li span {
  border-radius: 999px;
  padding: 2px 7px;
  background: #fff0df;
  color: #8b5515;
  font-size: 0.7rem;
  font-weight: 900;
}

.missing-list li strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.missing-list small {
  grid-column: 2;
}

.empty-note {
  display: grid;
  min-height: 520px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  border-radius: 6px;
  padding: 12px 16px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 850;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.download-dialog {
  width: min(640px, calc(100vw - 32px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: var(--paper);
  box-shadow: var(--shadow-lg);
}

.download-dialog::backdrop {
  background: rgba(20, 19, 15, 0.45);
}

.download-modal {
  display: grid;
  gap: 16px;
  padding: 24px;
}

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

.modal-head h2 {
  margin: 0;
  font-size: 1.28rem;
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  font-size: 1.3rem;
  font-weight: 800;
}

.download-list.danger {
  border-color: #e2b8a9;
  background: var(--terracotta-soft);
}

.download-list.warning {
  border-color: #ead4b5;
  background: #fff9eb;
}

.download-list ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.pdf-audience {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fffdf8;
}

.pdf-audience[hidden] {
  display: none;
}

.pdf-audience legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.pdf-audience label {
  display: flex;
  min-height: 42px;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: var(--white);
  font-weight: 850;
}

.pdf-audience input {
  width: auto;
  min-height: auto;
}

.checkbox-label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  font-weight: 750;
}

.checkbox-label input {
  width: auto;
  min-height: auto;
  margin-top: 5px;
}

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

.privacy-note,
.download-error {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.75;
}

.download-error {
  color: #8f3f29;
  font-weight: 850;
}

.download-progress,
.ai-progress,
.pdf-progress {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  border: 1px solid #c8d9ce;
  border-radius: 6px;
  padding: 14px;
  background: var(--moss-soft);
}

.download-progress[hidden],
.ai-progress[hidden],
.pdf-progress[hidden] {
  display: none;
}

.progress-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid #c8d9ce;
  border-top-color: var(--moss);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}

.download-progress strong,
.download-progress p,
.ai-progress strong,
.ai-progress p,
.pdf-progress strong,
.pdf-progress p {
  margin: 0;
}

.download-progress p,
.ai-progress p,
.pdf-progress p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.7;
}

.trust-list {
  display: grid;
  gap: 4px;
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.6;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  border-top: 1px solid var(--line);
  padding: 22px clamp(16px, 4vw, 44px) 34px;
  color: var(--muted);
  font-size: 0.84rem;
}

.site-footer a,
.legal-page a,
.privacy-note a {
  color: var(--accent-dark);
  font-weight: 850;
  text-decoration: none;
}

.pdf-export-document {
  display: grid;
  gap: 0;
  width: 210mm;
  margin: 24px auto;
  padding: 0;
  background: transparent;
  color: var(--ink);
  pointer-events: none;
}

.pdf-page {
  overflow: hidden;
  width: 210mm;
  height: 297mm;
  padding: 14mm;
  background: #fff;
}

.pdf-export-head {
  margin-bottom: 14px;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 10px;
}

.pdf-export-head p,
.pdf-export-head h1,
.pdf-export-head span {
  margin: 0;
}

.pdf-export-head h1 {
  margin-top: 4px;
  font-size: 1.7rem;
  line-height: 1.35;
}

.pdf-export-head p,
.pdf-export-head span {
  color: var(--muted);
  font-weight: 800;
}

.pdf-export-document .summary-item,
.pdf-export-document .preview-section {
  break-inside: avoid;
  page-break-inside: avoid;
}

@media print {
  body {
    background: #fff;
  }

  .topbar,
  .intro,
  .editor-panel,
  .check-panel,
  .toast,
  .download-dialog {
    display: none !important;
  }

  .workspace {
    display: block;
    max-width: none;
    padding: 0;
  }

  .preview-panel {
    position: static;
    border: 0;
    box-shadow: none;
  }

  .preview-head {
    display: none;
  }

  .job-preview {
    min-height: auto;
    padding: 0;
  }
}

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

  .editor-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .preview-panel {
    position: static;
    max-height: none;
  }
}

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

  .stats {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 900px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .brand-logo-link,
  .brand-title {
    justify-content: space-between;
  }

  .top-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .top-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .intro-actions {
    grid-template-columns: 1fr;
  }

  .intro-action-group-create {
    grid-template-columns: 1fr;
  }

  .intro {
    gap: 28px;
    padding-top: 28px;
  }

  h1 {
    font-size: clamp(1.9rem, 9vw, 3.2rem);
  }

  .intro-group-title {
    display: grid;
    gap: 4px;
  }

  .intro-action {
    min-height: 190px;
  }

  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .panel-tools {
    justify-items: stretch;
  }

  .tool-help {
    max-width: none;
    text-align: left;
  }

  .import-head,
  .import-actions,
  .source-actions,
  .pdf-import,
  .ai-actions {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .selected-file-name,
  .pdf-import #pdfStatus {
    grid-column: 1 / -1;
  }

  .ai-actions span {
    grid-column: 1 / -1;
  }

  .manual-map-row,
  .manual-map-actions {
    grid-template-columns: 1fr;
  }

  .tone-switch {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .form-section,
  .advanced-grid,
  .location-grid,
  .pdf-audience,
  .save-profile,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .job-preview {
    margin: 16px;
    min-height: 520px;
    padding: 22px;
  }

  .check-panel,
  .form-grid,
  .panel-head {
    padding-right: 18px;
    padding-left: 18px;
  }

  .import-box {
    margin-right: 18px;
    margin-left: 18px;
  }
}

@media (max-width: 520px) {
  .brand-logo-link,
  .brand-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-logo {
    width: 138px;
    height: 38px;
  }

  h1 {
    font-size: clamp(1.72rem, 8.4vw, 2.5rem);
  }

  .top-actions,
  .tone-switch {
    grid-template-columns: 1fr;
  }

  .preview-actions {
    align-items: stretch;
    flex-direction: column;
  }

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

  .stats div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .download-modal {
    padding: 20px;
  }
}
