/* Chat2Mind — Minimalist Monochrome Design System
 * Pure black & white. Serif typography. Sharp precision.
 */

/* === FONT FACES (Self-hosted) === */

/* Playfair Display — Display & Headlines */
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 400;
  src: url('fonts/playfair-display-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD, U+2000-200D, U+2018-201F, U+2E00-2E7F;
  font-display: block;
}
@font-face {
  font-family: 'Playfair Display';
  font-style: italic;
  font-weight: 400;
  src: url('fonts/playfair-display-400-italic.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD, U+2000-200D, U+2018-201F, U+2E00-2E7F;
  font-display: block;
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 500;
  src: url('fonts/playfair-display-500.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD, U+2000-200D, U+2018-201F, U+2E00-2E7F;
  font-display: block;
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 600;
  src: url('fonts/playfair-display-600.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD, U+2000-200D, U+2018-201F, U+2E00-2E7F;
  font-display: block;
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 700;
  src: url('fonts/playfair-display-700.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD, U+2000-200D, U+2018-201F, U+2E00-2E7F;
  font-display: block;
}

/* Source Serif 4 — Body text */
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 400;
  src: url('fonts/source-serif-4-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD, U+2000-200D, U+2018-201F, U+2E00-2E7F, U+2E80-2FD5, U+F900-FAFF, U+20000-2FFFD;
  font-display: block;
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 600;
  src: url('fonts/source-serif-4-600.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD, U+2000-200D, U+2018-201F, U+2E00-2E7F, U+2E80-2FD5, U+F900-FAFF, U+20000-2FFFD;
  font-display: block;
}

:root {
  /* === FOUNDATIONS === */

  /* Typography */
  --font-serif: 'Playfair Display', Georgia, 'Source Serif 4', serif;
  --font-body: 'Source Serif 4', Georgia, serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Type Scale — Dramatic range */
  --text-xs: 0.75rem;      /* 12px — Fine print, metadata */
  --text-sm: 0.875rem;     /* 14px — Captions, labels */
  --text-base: 1rem;       /* 16px — Body text minimum */
  --text-lg: 1.125rem;     /* 18px — Body text preferred */
  --text-xl: 1.25rem;      /* 20px — Lead paragraphs */
  --text-2xl: 1.5rem;      /* 24px — Section intros */
  --text-3xl: 2rem;        /* 32px — Subheadings */
  --text-4xl: 2.5rem;      /* 40px — Section titles */
  --text-5xl: 3.5rem;      /* 56px — Page titles */
  --text-6xl: 4.5rem;      /* 72px — Hero subheadings */
  --text-7xl: 6rem;        /* 96px — Hero headlines */
  --text-display: 9rem;    /* 144px — Oversized statement */

  /* Line Heights */
  --leading-none: 1;
  --leading-tight: 1.1;
  --leading-snug: 1.3;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;

  /* Letter Spacing */
  --tracking-tighter: -0.05em;
  --tracking-tight: -0.025em;
  --tracking-normal: 0;
  --tracking-wide: 0.025em;
  --tracking-wider: 0.1em;

  /* Spacing */
  --space-0: 0;
  --space-1: 0.25rem;    /* 4px */
  --space-2: 0.5rem;     /* 8px */
  --space-3: 0.75rem;    /* 12px */
  --space-4: 1rem;       /* 16px */
  --space-5: 1.25rem;    /* 20px */
  --space-6: 1.5rem;     /* 24px */
  --space-8: 2rem;       /* 32px */
  --space-10: 2.5rem;    /* 40px */
  --space-12: 3rem;      /* 48px */
  --space-16: 4rem;      /* 64px */
  --space-20: 5rem;      /* 80px */
  --space-24: 6rem;      /* 96px */
  --space-32: 8rem;      /* 128px */
  --space-40: 10rem;     /* 160px */

  /* Colors — Strictly Monochrome */
  --foreground: #000000;
  --background: #FFFFFF;
  --muted: #F5F5F5;
  --muted-foreground: #525252;
  --border: #000000;
  --border-light: #E5E5E5;
  --error-bg: #fef2f2;
  --error-text: #991b1b;

  /* Border weights */
  --border-hairline: 1px solid var(--border-light);
  --border-thin: 1px solid var(--border);
  --border-medium: 2px solid var(--border);
  --border-thick: 4px solid var(--border);
  --border-ultra: 8px solid var(--border);

  /* Motion — Instant, binary. Maximum 100ms. */
  --transition: 100ms ease;
}

/* === BASE RESET === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--foreground);
  background-color: var(--background);
  min-height: 100vh;
}

/* === SELECTION === */
::selection {
  background: var(--foreground);
  color: var(--background);
}

/* === SCROLLBAR — Sharp, minimal */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-light);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--muted-foreground);
}

/* === LAYOUT === */
.container {
  width: 100%;
  max-width: 72rem; /* 1152px — Editorial width */
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.main > .container {
  max-width: 48rem; /* 768px — Reading width for the main content area */
}

@media (max-width: 640px) {
  .container {
    padding: 0 var(--space-4);
  }
}

/* === HEADER === */
.header {
  position: relative;
  padding-top: var(--space-12);
  padding-bottom: var(--space-12);
}

.header::after {
  content: '';
  display: block;
  height: var(--border-thick);
  background: var(--foreground);
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--foreground);
  transition: opacity var(--transition);
}

.logo:hover {
  opacity: 0.6;
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 2px solid var(--foreground);
  background: var(--background);
  color: var(--foreground);
  /* Sharp — zero radius */
}

.logo-icon svg {
  width: 20px;
  height: 20px;
}

.logo-text {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
}

/* === HEADER ACTIONS & USER MENU === */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.user-info {
  position: relative;
}

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.user-menu-btn svg {
  transition: transform var(--transition);
}

.user-menu-btn.open svg {
  transform: rotate(180deg);
}

.user-dropdown {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  min-width: 120px;
  background: var(--background);
  border: 2px solid var(--foreground);
  box-shadow: 4px 4px 0 var(--foreground);
  z-index: 100;
}

.user-dropdown.hidden {
  display: none;
}

.dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: var(--space-2) var(--space-3);
  border: none;
  background: transparent;
  color: var(--foreground);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: background var(--transition);
}

.dropdown-item:hover {
  background: var(--muted-background);
}

#user-email {
  font-family: var(--font-body);
  font-size: var(--text-sm);
}

/* responsive: wrap when narrow */
@media (max-width: 480px) {
  .header .container {
    flex-wrap: wrap;
    gap: var(--space-3);
  }
}

/* === HERO === */
.hero {
  padding-top: var(--space-20);
  padding-bottom: var(--space-16);
  text-align: left;
  position: relative;
  border-bottom: var(--border-thick);
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  font-weight: 700;
  line-height: var(--leading-tight);
  color: var(--foreground);
  margin-bottom: var(--space-6);
  letter-spacing: var(--tracking-tight);
}

.hero-title em {
  font-style: italic;
}

.hero-subtitle {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  color: var(--muted-foreground);
  max-width: 40rem;
  margin: 0;
  line-height: var(--leading-relaxed);
}

@media (max-width: 640px) {
  .hero {
    padding-top: var(--space-12);
    padding-bottom: var(--space-10);
  }
  .hero-subtitle {
    font-size: var(--text-base);
  }
}

/* === INPUT SECTION === */
.input-section {
  padding: var(--space-32) 0;
  border-bottom: var(--border-thick);
}

@media (max-width: 768px) {
  :root {
    --space-16: 3rem;
    --space-20: 4rem;
    --space-24: 5rem;
    --space-32: 6rem;
    --space-40: 8rem;
  }
}

.input-label {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--muted-foreground);
  margin-bottom: var(--space-2);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.input-wrapper {
  position: relative;
}

.input-group input,
.input-group textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--background);
  border: 2px solid var(--foreground);
  color: var(--foreground);
  font-family: var(--font-body);
  font-size: var(--text-lg);
  line-height: var(--leading-normal);
  transition: all var(--transition);
  resize: vertical;
  border-radius: 0;
}

.input-group input::placeholder,
.input-group textarea::placeholder {
  color: var(--muted-foreground);
  font-style: italic;
}

.input-group input:hover,
.input-group textarea:hover {
  background: var(--muted-background);
  border-width: 3px;
}

.input-group input:focus,
.input-group textarea:focus {
  outline: none;
  background: var(--muted-background);
  border-width: 4px;
}

/* === DIVIDER === */
.divider {
  display: flex;
  align-items: center;
  margin: var(--space-8) 0;
  color: var(--muted-foreground);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 400;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-light);
}

.divider span {
  padding: 0 var(--space-4);
}

/* === TOGGLE BUTTON === */
.toggle-input-type {
  margin: var(--space-4) 0;
}

.toggle-input-type .btn {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  padding: var(--space-2) var(--space-4);
  color: var(--muted-foreground);
  background: transparent;
  border: 1px solid var(--border-light);
  transition: all var(--transition);
}

.toggle-input-type .btn:hover {
  color: var(--foreground);
  border-color: var(--foreground);
}

/* === ACTIONS === */
.actions {
  margin-top: var(--space-8);
  padding-top: var(--space-8);
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: center;
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 400;
  line-height: 1;
  text-decoration: none;
  border: none;
  cursor: pointer;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--foreground);
  color: var(--background);
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-sm);
}

.btn-primary:hover:not(:disabled) {
  background: var(--background);
  color: var(--foreground);
  outline: 2px solid var(--foreground);
  outline-offset: -2px;
}

.btn-secondary {
  background: transparent;
  color: var(--foreground);
  border: 2px solid var(--foreground);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--foreground);
  color: var(--background);
}

.btn-ghost {
  background: transparent;
  color: var(--muted-foreground);
  padding-left: 0;
  padding-right: 0;
  text-transform: none;
  letter-spacing: normal;
  font-size: inherit;
}

.btn-ghost:hover:not(:disabled) {
  color: var(--foreground);
  text-decoration: underline;
}

.btn-sm {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
}

/* === SPINNER === */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
  border-radius: 0; /* Sharp corners */
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* === HIDDEN === */
.hidden {
  display: none !important;
}

/* === ERROR BOX === */
.error-box {
  margin-top: var(--space-6);
  padding: var(--space-4);
  border: 1px solid var(--error-text);
  color: var(--error-text);
  font-size: var(--text-sm);
}

.error-box:empty {
  display: none;
}

/* Payment Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay.hidden {
  display: none !important;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
}

.modal-content {
  position: relative;
  z-index: 1;
  background: var(--background);
  border: var(--border-thick);
  max-width: 500px;
  width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  padding: var(--space-10);
}

/* PayPal button container - give it enough space */
#payment-button-container {
  min-height: 60px;
  margin: var(--space-6) 0;
}

#paypal-button-slot,
#paypal-button-container > div {
  min-height: 55px;
}

.modal-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-6);
  background: transparent;
  border: none;
  font-size: var(--text-3xl);
  line-height: 1;
  cursor: pointer;
  color: var(--muted-foreground);
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: var(--foreground);
}

.modal-title {
  font-family: var(--font-serif);
  font-size: var(--text-3xl);
  font-weight: 700;
  margin: 0 0 var(--space-4) 0;
  letter-spacing: var(--tracking-tight);
}

.modal-description {
  color: var(--muted-foreground);
  margin-bottom: var(--space-8);
  line-height: var(--leading-relaxed);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.pricing-option {
  border: var(--border-thin);
  padding: var(--space-4);
  text-align: center;
  position: relative;
}

.pricing-option.popular {
  border: var(--border-medium);
  border-color: var(--foreground);
}

.pricing-option.popular::before {
  content: 'Popular';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--foreground);
  color: var(--background);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  padding: 2px var(--space-3);
  letter-spacing: var(--tracking-wide);
}

.pricing-name {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.pricing-price {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.pricing-price span {
  font-size: var(--text-sm);
  color: var(--muted-foreground);
  font-weight: 400;
}

.pricing-desc {
  font-size: var(--text-sm);
  color: var(--muted-foreground);
  margin-bottom: var(--space-4);
}

.pay-btn {
  width: 100%;
  text-decoration: none;
  justify-content: center;
}

.modal-footer {
  margin: 0;
  padding-top: var(--space-6);
  border-top: var(--border-hairline);
  font-size: var(--text-sm);
  color: var(--muted-foreground);
  text-align: center;
}

#open-payment-modal {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--muted-foreground);
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  cursor: pointer;
  margin-top: var(--space-4);
}

#open-payment-modal:hover {
  color: var(--foreground);
  border-color: var(--foreground);
}

@media (max-width: 640px) {
  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .modal-content {
    padding: var(--space-6);
  }
}

/* === OUTPUT SECTION === */
.output-section {
  margin-top: var(--space-16);
  padding-top: var(--space-16);
  border-top: var(--border-thick);
}

.output-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--border-light);
}

/* Toolbar with only actions (no title) */
.output-toolbar:has(.output-actions:only-child) {
  justify-content: flex-end;
}

.output-title {
  font-family: var(--font-serif);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--foreground);
  margin: 0;
  letter-spacing: var(--tracking-tight);
}

.output-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

/* Layout selector */
.layout-selector {
  display: flex;
  gap: var(--space-1);
  background: var(--muted);
  padding: 2px;
}

.layout-btn {
  background: transparent;
  color: var(--muted-foreground);
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  border: none;
  cursor: pointer;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  transition: all var(--transition);
}

.layout-btn:hover {
  color: var(--foreground);
}

.layout-btn.active {
  background: var(--foreground);
  color: var(--background);
}

/* Mindmap operation hints - vertical on right side */
/* Mindmap operation hints - horizontal above canvas */
.mindmap-hints {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--muted-foreground);
  letter-spacing: var(--tracking-wide);
}

.hint-item {
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--border-light);
}

.hint-divider {
  color: var(--border-light);
}

.hint-divider {
  display: none;
}

/* Mindmap wrapper */
.mindmap-wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 0 var(--space-10);
}

.mindmap-container {
  flex: 1;
  min-height: 600px;
  height: 80vh;
  border: var(--border-thin);
  overflow: hidden;
  background: var(--background);
  position: relative;
  max-width: 90rem;
  /* Wider than main content (48rem) but still bounded */
}

/* Editor-style grid texture for mindmap canvas */
.mindmap-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    linear-gradient(rgba(0,0,0,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
  z-index: 0;
}

.mindmap-container > * {
  position: relative;
  z-index: 1;
}

/* Make mindmap canvas fill container */
.mindmap-container canvas {
  width: 100% !important;
  height: 100% !important;
}

/* === HISTORY SECTION === */
.history-section {
  margin-top: var(--space-20);
  padding-top: var(--space-10);
}

.history-section h3 {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: var(--space-8);
  letter-spacing: var(--tracking-tight);
  padding-bottom: var(--space-4);
  border-bottom: 2px solid var(--foreground);
}

.history-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0; /* Gap removed — borders separate items */
}

.history-item {
  border: 1px solid var(--border-light);
  padding: var(--space-6);
  cursor: pointer;
  transition: all var(--transition);
  background: var(--background);
}

.history-item:hover {
  background: var(--foreground);
  color: var(--background);
}

.history-item-title {
  font-weight: 600;
  margin-bottom: var(--space-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--text-base);
}

.history-item:hover .history-item-title {
  color: var(--background);
}

.history-item-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.history-item-date {
  font-size: var(--text-sm);
  color: var(--muted-foreground);
  font-family: var(--font-mono);
  letter-spacing: var(--tracking-wide);
}

.history-item:hover .history-item-date {
  color: rgba(255, 255, 255, 0.6);
}

.history-status {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.history-status-paid {
  background: #16a34a;
  color: white;
}

.history-item:hover .history-status-paid {
  background: #15803d;
  color: white;
}

.history-status-unpaid {
  background: #ea580c;
  color: white;
}

.history-item:hover .history-status-unpaid {
  background: #c2410c;
  color: white;
}

/* === FOOTER === */
.footer {
  margin-top: var(--space-32);
  padding: var(--space-10) 0;
  border-top: var(--border-thick);
}

.footer p {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--muted-foreground);
  font-family: var(--font-mono);
  letter-spacing: var(--tracking-wide);
}

.footer a {
  color: var(--foreground);
  text-decoration: none;
  border-bottom: 1px solid var(--muted-foreground);
}

.footer a:hover {
  color: var(--background);
  background: var(--foreground);
  border-color: var(--foreground);
}

/* === FOCUS STYLES — Monochrome accessible === */
a:focus-visible {
  outline: 3px solid var(--foreground);
  outline-offset: 3px;
}

button:focus-visible {
  outline: 3px solid var(--foreground);
  outline-offset: 3px;
}

/* === OUTPUT TOOLBAR — Responsive === */
@media (max-width: 640px) {
  .output-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .output-actions {
    width: 100%;
  }
  .history-list {
    grid-template-columns: 1fr;
  }
  .output-title {
    font-size: var(--text-xl);
  }
  .actions {
    justify-content: stretch;
  }
  .btn-primary {
    width: 100%;
  }
}

/* === PRINT === */
@media print {
  .header,
  .input-section,
  .history-section,
  .footer,
  .output-toolbar,
  .toggle-input-type {
    display: none !important;
  }
  .output-section {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
  }
  .mindmap-container {
    min-height: auto !important;
    page-break-inside: avoid;
  }
  body {
    background: none !important;
    background-image: none !important;
  }
}

/* === MIND MAP LINE COLOR OVERRIDE === */
/* Force monochrome gray lines for all SVG lines and paths in mindmap */
.mindmap-container line,
.mindmap-container path:not([fill]),
.mindmap-container path[fill="none"],
.mindmap-container path[fill=""] {
  stroke: #525252 !important;
}

/* Also override any node text colors if needed */
.mindmap-container text {
  /* Let theme handle text colors */
}

/* Make sure root node text is white on black background */
.mindmap-container g[data-node-level="0"] text,
.mindmap-container g:first-child text {
  fill: #FFFFFF !important;
}
}
