/* ============================================
   aiffärsidé — Warm Scandinavian Typography
   ============================================ */

/* Honeypot — hidden from humans, visible to bots */
.hp-field {
  position: absolute;
  left: -9999px;
  top: -9999px;
  height: 0;
  width: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

:root {
  --color-bg: #FBF5EC;
  --color-bg-warm: #F5EBE0;
  --color-bg-result: #F0E6D8;
  --color-accent: #C75B39;
  --color-accent-hover: #A84A2E;
  --color-accent-glow: rgba(199, 91, 57, 0.15);
  --color-text: #2A2520;
  --color-text-muted: #7A7168;
  --color-text-light: #A49A8E;
  --color-border: #D9CCBD;
  --color-border-focus: #C75B39;
  --color-white: #FFFFFF;
  --color-success: #4A7C59;
  --color-error: #B8423A;

  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

  --max-width: 680px;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-pill: 100px;
  --shadow-sm: 0 1px 3px rgba(42, 37, 32, 0.06);
  --shadow-md: 0 4px 16px rgba(42, 37, 32, 0.08);
  --shadow-lg: 0 8px 32px rgba(42, 37, 32, 0.1);
  --shadow-lift: 0 6px 20px rgba(42, 37, 32, 0.12);
}

/* ---- Reset & Base ---- */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Paper grain texture — the signature detail */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 512px 512px;
}

/* ---- Hidden override ---- */
[hidden] {
  display: none !important;
}

/* ---- Accessibility ---- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Layout ---- */

main {
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 4rem 1.5rem 3rem;
  flex: 1;
}

/* ---- Hero / Header ---- */

.hero {
  text-align: center;
  margin-bottom: 3rem;
}

.top-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.logo {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.5rem, 7vw, 4rem);
  letter-spacing: -0.03em;
  color: var(--color-text);
  line-height: 1.05;
  margin-bottom: 0;
  text-shadow: 0 2px 8px rgba(42, 37, 32, 0.06);
}

.logo .accent {
  color: var(--color-accent);
  font-style: italic;
}

.tagline {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
  margin-top: 0.1rem;
}

/* ---- Navigation ---- */

.main-nav {
  display: flex;
  gap: 1.25rem;
}

.nav-link {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--color-accent);
}

/* ---- Navi Intro ---- */

.navi-intro {
  display: flex;
  gap: 1.5rem;
  align-items: stretch;
  text-align: left;
  background: var(--color-white);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.navi-intro picture {
  display: flex;
  align-self: stretch;
  align-items: flex-end;
  flex-shrink: 0;
}

.navi-avatar {
  width: 200px;
  height: auto;
  border-radius: 12px;
  flex-shrink: 0;
}

.navi-speech {
  flex: 1;
  min-width: 0;
}

.navi-greeting {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--color-text);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.navi-greeting strong {
  color: var(--color-accent);
  font-weight: 700;
}

.navi-description {
  font-size: 0.95rem;
  color: var(--color-text);
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.navi-tip {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  line-height: 1.55;
  font-style: italic;
}

/* ---- Input Section ---- */

.input-section {
  margin-bottom: 2rem;
}

.input-label {
  display: block;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.company-name-input {
  width: 100%;
  padding: 0.85rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--color-text);
  background: var(--color-white);
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
}

.company-name-input::placeholder {
  color: var(--color-text-light);
  font-style: italic;
}

.company-name-input:focus {
  outline: none;
  border-color: var(--color-border-focus);
  box-shadow: 0 0 0 4px var(--color-accent-glow), var(--shadow-sm);
}

#idea-input {
  width: 100%;
  min-height: 180px;
  padding: 1.25rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--color-text);
  background: var(--color-white);
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  resize: vertical;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  box-shadow: var(--shadow-sm);
}

#idea-input::placeholder {
  color: var(--color-text-light);
  font-style: italic;
}

#idea-input:focus {
  outline: none;
  border-color: var(--color-border-focus);
  box-shadow: 0 0 0 4px var(--color-accent-glow), var(--shadow-sm);
}

.input-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}

.char-count {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--color-text-light);
  letter-spacing: 0.02em;
}

/* ---- CTA Button ---- */

.cta-button {
  display: block;
  width: 100%;
  padding: 1.1rem 2rem;
  font-family: var(--font-body);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--color-white);
  background: var(--color-accent);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  min-height: 56px;
  position: relative;
  overflow: hidden;
  transition: background-color 0.2s ease, transform 0.12s ease, box-shadow 0.2s ease;
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.cta-button::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, transparent 50%);
  pointer-events: none;
}

.cta-button:hover:not(:disabled) {
  background-color: var(--color-accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lift), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.cta-button:active:not(:disabled) {
  transform: translateY(0) scale(0.985);
  box-shadow: var(--shadow-sm);
}

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

/* ---- Loading Section ---- */

.loading-section {
  text-align: center;
  padding: 3rem 1rem;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  margin: 0 auto 1.5rem;
}

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

.loading-text {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 400;
  font-style: italic;
  color: var(--color-text-muted);
  min-height: 1.6em;
  transition: opacity 0.3s ease;
}

/* ---- Result Section ---- */

.result-section {
  background: var(--color-bg-result);
  margin: 0 -1.5rem;
  padding: 2.5rem 1.5rem 2rem;
  border-radius: var(--radius) var(--radius) 0 0;
  position: relative;
}

/* Top border accent line */
.result-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 2rem;
  right: 2rem;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
  border-radius: 2px;
}

.result-section.visible {
  animation: revealResult 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes revealResult {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-heading {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.4rem, 3vw, 1.75rem);
  color: var(--color-text);
  margin-bottom: 0.35rem;
}

.result-intro {
  font-size: 0.92rem;
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
}

.result-textarea {
  width: 100%;
  min-height: 260px;
  padding: 1.25rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  line-height: 1.8;
  color: var(--color-text);
  background: var(--color-white);
  border: 2px solid var(--color-accent);
  border-radius: var(--radius);
  resize: vertical;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  box-shadow: var(--shadow-sm);
}

.result-textarea:focus {
  outline: none;
  box-shadow: 0 0 0 4px var(--color-accent-glow), var(--shadow-sm);
}

/* (Action buttons removed — replaced by feedback-box + redo-section) */

/* ---- Tone Section ---- */

.tone-section {
  margin-top: 1.5rem;
}

.tone-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-bottom: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
}

.tone-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.chip {
  padding: 0.55rem 1.1rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text);
  background: var(--color-white);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.chip:hover:not(:disabled) {
  border-color: var(--color-accent);
  color: var(--color-accent);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.chip.active {
  background: var(--color-accent);
  color: var(--color-white);
  border-color: var(--color-accent);
  box-shadow: 0 2px 8px var(--color-accent-glow);
}

.chip:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---- Feedback Box ---- */

.feedback-box {
  margin-top: 1.25rem;
  padding: 1.25rem 1.5rem;
  background: rgba(199, 91, 57, 0.04);
  border: 2px solid var(--color-border);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius-sm);
}

.feedback-box-heading {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.25rem;
}

.feedback-box-subtitle {
  font-size: 0.84rem;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
  font-style: italic;
  line-height: 1.5;
}

.feedback-textarea {
  width: 100%;
  min-height: 80px;
  padding: 0.85rem 1rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-white);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  resize: vertical;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  margin-bottom: 0.85rem;
}

.feedback-textarea:focus {
  outline: none;
  border-color: var(--color-border-focus);
  box-shadow: 0 0 0 4px var(--color-accent-glow);
}

.feedback-textarea::placeholder {
  color: var(--color-text-light);
  font-style: italic;
}

.feedback-cta {
  width: 100%;
}

/* ---- Crazy Bananas Section ---- */

.crazy-section {
  margin-top: 1.25rem;
  text-align: center;
}

.crazy-btn {
  display: inline-block;
  padding: 0.85rem 2rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-white);
  background: linear-gradient(135deg, #E8543E, #F2994A, #E8543E);
  background-size: 200% 200%;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  min-height: 48px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 16px rgba(232, 84, 62, 0.25);
  animation: crazyGradient 3s ease infinite;
}

@keyframes crazyGradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.crazy-btn:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 24px rgba(232, 84, 62, 0.35);
}

.crazy-btn:active:not(:disabled) {
  transform: translateY(0) scale(0.97);
}

.crazy-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  animation: none;
}

.crazy-hint {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-top: 0.5rem;
  font-style: italic;
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}

/* ---- Redo Section (Nuclear Option) ---- */

.redo-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  text-align: center;
}

.redo-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.redo-btn {
  padding: 0.65rem 1.5rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-muted);
  background: transparent;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-height: 44px;
  transition: all 0.2s ease;
}

.redo-btn:hover:not(:disabled) {
  color: var(--color-text);
  border-color: var(--color-text-muted);
  background: var(--color-white);
}

.redo-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.redo-hint {
  font-size: 0.78rem;
  color: var(--color-text-light);
  margin-top: 0.4rem;
  font-style: italic;
}

/* ---- Done Button ---- */

.done-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  text-align: center;
}

.done-btn {
  display: inline-block;
  padding: 1rem 2.5rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-white);
  background: var(--color-success);
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  min-height: 52px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  box-shadow: 0 4px 16px rgba(74, 124, 89, 0.25);
}

.done-btn:hover:not(:disabled) {
  background: #3D6A4A;
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(74, 124, 89, 0.35);
}

.done-btn:active:not(:disabled) {
  transform: translateY(0) scale(0.97);
}

.done-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---- Done/Completion View ---- */

.done-section-view {
  background: var(--color-bg-result);
  margin: 0 -1.5rem;
  padding: 2.5rem 1.5rem 2rem;
  border-radius: var(--radius) var(--radius) 0 0;
  position: relative;
  animation: revealResult 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.done-section-view::before {
  content: '';
  position: absolute;
  top: 0;
  left: 2rem;
  right: 2rem;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--color-success), transparent);
  border-radius: 2px;
}

.done-navi-hero {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  text-align: left;
  background: var(--color-white);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.done-navi-avatar {
  width: 100px;
  height: auto;
  border-radius: 10px;
  flex-shrink: 0;
}

.done-navi-speech {
  flex: 1;
  min-width: 0;
}

.done-heading {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.4rem, 4vw, 1.8rem);
  color: var(--color-success);
  margin-bottom: 0.5rem;
}

.done-subheading {
  font-size: 0.95rem;
  color: var(--color-text);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.done-navi-farewell {
  font-size: 0.92rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: 0.25rem;
}

.done-navi-farewell strong {
  color: var(--color-accent);
}

.done-navi-signature {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.done-textarea {
  border-color: var(--color-success);
}

.done-export-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  text-align: center;
}

.done-back-section {
  margin-top: 2rem;
  text-align: center;
}

/* ---- Length Section ---- */

.length-section {
  margin-top: 1.5rem;
}

.length-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-bottom: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
}

.length-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.length-chip {
  padding: 0.55rem 1.1rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text);
  background: var(--color-white);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.length-chip:hover:not(:disabled) {
  border-color: var(--color-accent);
  color: var(--color-accent);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.length-chip:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---- Export Heading ---- */

.export-heading {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-text);
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  margin-bottom: 0.75rem;
  text-align: center;
}

/* ---- Version History ---- */

.version-history {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

.version-history-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.version-history-hint {
  font-size: 0.82rem;
  color: var(--color-text-light);
  margin-bottom: 0.85rem;
  font-style: italic;
}

.version-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 280px;
  overflow-y: auto;
}

.version-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  background: var(--color-white);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--color-text-muted);
  text-align: left;
  width: 100%;
}

.version-item:hover {
  border-color: var(--color-accent);
  color: var(--color-text);
  transform: translateX(4px);
}

.version-item.active {
  background: var(--color-accent);
  color: var(--color-white);
  border-color: var(--color-accent);
  box-shadow: 0 2px 8px var(--color-accent-glow);
  font-weight: 600;
}

.version-item-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-weight: 700;
  font-size: 0.78rem;
  border-radius: 50%;
  background: var(--color-bg-warm);
  flex-shrink: 0;
}

.version-item.active .version-item-number {
  background: rgba(255, 255, 255, 0.2);
}

.version-item-label {
  flex: 1;
}

/* ---- Utility Buttons ---- */

.utility-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
}

.utility-btn {
  padding: 0.65rem 0.5rem;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-text-muted);
  background: transparent;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-height: 44px;
  transition: all 0.2s ease;
  text-align: center;
}

.utility-btn:hover {
  color: var(--color-text);
  border-color: var(--color-text-muted);
  background: var(--color-white);
}

.utility-btn.success {
  color: var(--color-success);
  border-color: var(--color-success);
  background: rgba(74, 124, 89, 0.06);
}

/* ---- Error Message ---- */

.error-message {
  font-size: 0.9rem;
  color: var(--color-error);
  background: rgba(184, 66, 58, 0.06);
  border: 1px solid rgba(184, 66, 58, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---- Confirmation Modal ---- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(42, 37, 32, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease;
}

.modal-box {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.75rem;
}

.modal-text {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.modal-btn {
  padding: 0.65rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-height: 44px;
  transition: all 0.2s ease;
}

.modal-btn-cancel {
  color: var(--color-text-muted);
  background: transparent;
  border: 1.5px solid var(--color-border);
}

.modal-btn-cancel:hover {
  border-color: var(--color-text-muted);
  color: var(--color-text);
}

.modal-btn-confirm {
  color: var(--color-white);
  background: var(--color-accent);
  border: 1.5px solid var(--color-accent);
}

.modal-btn-confirm:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

/* ---- Footer ---- */

.site-footer {
  text-align: center;
  padding: 2rem 1.5rem;
  font-size: 0.85rem;
  color: var(--color-text-light);
}

/* ---- Responsive ---- */

@media (max-width: 680px) {
  main {
    padding: 2.5rem 1.25rem 2rem;
  }

  .hero {
    margin-bottom: 2rem;
  }

  .top-bar {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
  }

  .main-nav {
    gap: 1rem;
  }

  .navi-intro {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.25rem;
    gap: 1rem;
  }

  .navi-avatar {
    width: 120px;
  }

  .navi-speech {
    text-align: center;
  }

  .result-section {
    margin: 0 -1.25rem;
    padding: 2rem 1.25rem 1.5rem;
  }

  .result-section::before {
    left: 1.25rem;
    right: 1.25rem;
  }

  .tone-chips {
    gap: 0.4rem;
  }

  .chip {
    font-size: 0.82rem;
    padding: 0.5rem 0.9rem;
  }

  .length-chip {
    font-size: 0.82rem;
    padding: 0.5rem 0.9rem;
  }

  .done-section-view {
    margin: 0 -1.25rem;
    padding: 2rem 1.25rem 1.5rem;
  }

  .done-navi-hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.25rem;
    gap: 1rem;
  }

  .done-navi-avatar {
    width: 80px;
  }
}

/* ---- Print ---- */

@media print {
  body::before,
  .main-nav,
  .input-section,
  .loading-section,
  .feedback-box,
  .crazy-section,
  .tone-section,
  .length-section,
  .redo-section,
  .version-history,
  .done-section,
  .export-heading,
  .utility-buttons,
  .done-back-section,
  .site-footer {
    display: none;
  }

  .result-section {
    background: none;
    margin: 0;
    padding: 0;
  }

  .result-textarea {
    border: none;
    padding: 0;
    font-family: var(--font-body);
  }
}
