/* TalkProof (톡프루프) - Web App + Crisp A4 Print CSS */
:root {
  --navy: #0F172A;
  --navy-2: #1E293B;
  --slate: #475569;
  --muted: #64748B;
  --border: #CBD5E1;
  --border-light: #E2E8F0;
  --bg: #F1F5F9;
  --card: #FFFFFF;
  --emerald: #059669;
  --emerald-bright: #10B981;
  --emerald-soft: #ECFDF5;
  --amber: #D97706;
  --amber-soft: #FFFBEB;
  --red: #DC2626;
  --red-soft: #FEF2F2;
  --highlight: #FEF08A;
}

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

body {
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--navy);
  line-height: 1.55;
  font-size: 14px;
}

.hidden {
  display: none !important;
}

/* Header */
.site-header {
  background: var(--navy);
  color: #FFFFFF;
  border-bottom: 1px solid #1E293B;
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, #10B981, #047857);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 16px;
  color: #FFFFFF;
  flex-shrink: 0;
}

.logo-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.4px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.logo-sub {
  font-size: 11.5px;
  color: #94A3B8;
}

.plan-pill {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
}

.plan-pill.free {
  background: #334155;
  color: #E2E8F0;
}

.plan-pill.pro {
  background: #10B981;
  color: #FFFFFF;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.security-pill {
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: #6EE7B7;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 7px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.14s ease;
  font-size: 13px;
  padding: 8px 14px;
}

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

.btn-primary {
  background: var(--emerald-bright);
  color: #FFFFFF;
}

.btn-primary:hover:not(:disabled) {
  background: var(--emerald);
}

.btn-navy {
  background: var(--navy);
  color: #FFFFFF;
}

.btn-navy:hover:not(:disabled) {
  background: var(--navy-2);
}

.btn-outline {
  background: #FFFFFF;
  color: var(--navy);
  border-color: var(--border);
}

.btn-outline:hover:not(:disabled) {
  background: #F8FAFC;
  border-color: #94A3B8;
}

.btn-pro {
  background: linear-gradient(135deg, #F59E0B, #D97706);
  color: #FFFFFF;
}

.btn-pro:hover:not(:disabled) {
  filter: brightness(0.95);
}

.btn-sm {
  font-size: 12px;
  padding: 6px 11px;
}

/* Hero Banner */
.hero-strip {
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
  color: #FFFFFF;
  padding: 26px 20px 28px;
}

.hero-inner {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.hero-copy h1 {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.6px;
  line-height: 1.3;
  margin-bottom: 8px;
}

.hero-copy h1 span {
  color: #34D399;
}

.hero-copy p {
  font-size: 14px;
  color: #CBD5E1;
  max-width: 680px;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.hero-badge {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #E2E8F0;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
}

/* Main Workspace */
.workspace {
  max-width: 1320px;
  margin: 20px auto 36px;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 20px;
  align-items: start;
}

/* Left Panel */
.panel {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.panel-section {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-light);
}

.panel-section:last-child {
  border-bottom: none;
}

.section-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.step-tag {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--emerald);
  background: var(--emerald-soft);
  padding: 2px 7px;
  border-radius: 4px;
}

.pro-tag {
  font-size: 10px;
  font-weight: 800;
  color: #B45309;
  background: #FEF3C7;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Dropzone */
.dropzone {
  border: 2px dashed #94A3B8;
  border-radius: 10px;
  padding: 22px 14px;
  text-align: center;
  background: #F8FAFC;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--emerald-bright);
  background: var(--emerald-soft);
}

.dropzone-icon {
  font-size: 26px;
  margin-bottom: 6px;
}

.dropzone-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 4px;
}

.dropzone-sub {
  font-size: 11.5px;
  color: var(--muted);
}

.upload-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.upload-actions .btn {
  flex: 1;
}

.file-info-box {
  margin-top: 10px;
  padding: 9px 11px;
  background: var(--emerald-soft);
  border: 1px solid #A7F3D0;
  border-radius: 7px;
  font-size: 12px;
  color: #065F46;
}

.file-info-box strong {
  display: block;
  margin-bottom: 2px;
}

/* Form Controls */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.form-field {
  margin-bottom: 9px;
}

.form-field:last-child {
  margin-bottom: 0;
}

.form-field label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--slate);
  margin-bottom: 4px;
}

.form-field input[type="text"],
.form-field input[type="date"],
.form-field select {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--navy);
  background: #FFFFFF;
}

.form-field input:focus,
.form-field select:focus {
  outline: none;
  border-color: var(--emerald-bright);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.15);
}

.toggle-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.toggle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  background: #F8FAFC;
  border: 1px solid var(--border-light);
  border-radius: 7px;
  font-size: 12.5px;
  cursor: pointer;
}

.toggle-item input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--emerald);
  cursor: pointer;
}

.speakers-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 110px;
  overflow-y: auto;
}

.speaker-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  background: #F1F5F9;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.speaker-chip.checked {
  background: var(--emerald-soft);
  border-color: #6EE7B7;
  color: #065F46;
}

.speaker-chip input {
  accent-color: var(--emerald);
}

.radio-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.radio-card {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  background: #FFFFFF;
  font-size: 12px;
}

.radio-card.active {
  border-color: var(--emerald-bright);
  background: var(--emerald-soft);
}

.radio-card strong {
  display: block;
  font-size: 12.5px;
  color: var(--navy);
}

.radio-card span {
  font-size: 11px;
  color: var(--muted);
}

/* Right Preview Area */
.preview-toolbar {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.stat-value {
  font-size: 15px;
  font-weight: 900;
  color: var(--navy);
}

.stat-value.accent {
  color: var(--emerald);
}

.export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Lock Banner inside Preview */
.paywall-banner {
  background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
  border: 1.5px solid #F59E0B;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.paywall-banner h3 {
  font-size: 14px;
  font-weight: 800;
  color: #92400E;
  margin-bottom: 3px;
}

.paywall-banner p {
  font-size: 12.5px;
  color: #78350F;
}

/* A4 Document Paper Container */
.paper-stage {
  background: #CBD5E1;
  border-radius: 12px;
  padding: 24px;
  min-height: 680px;
  display: flex;
  justify-content: center;
  overflow-x: auto;
}

.a4-document {
  position: relative;
  width: 210mm;
  min-height: 297mm;
  background: #FFFFFF;
  color: #111827;
  padding: 18mm 16mm;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
  border-radius: 3px;
}

/* Free Preview Watermark Overlay */
.watermark-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 5;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
}

.watermark-text {
  font-size: 40px;
  font-weight: 900;
  color: rgba(15, 23, 42, 0.065);
  transform: rotate(-28deg);
  white-space: nowrap;
  letter-spacing: 3px;
  user-select: none;
}

/* Formal Document Header */
.doc-header {
  border-bottom: 2.5px solid #0F172A;
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.doc-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 800;
  color: #0F172A;
  border: 1px solid #0F172A;
  padding: 2px 8px;
  letter-spacing: 0.6px;
  margin-bottom: 6px;
}

.doc-title {
  font-size: 22px;
  font-weight: 900;
  color: #0F172A;
  letter-spacing: -0.5px;
}

.doc-subtitle {
  font-size: 12px;
  color: #475569;
  margin-top: 4px;
}

.doc-meta-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 14px;
  font-size: 12px;
}

.doc-meta-table th,
.doc-meta-table td {
  border: 1px solid #94A3B8;
  padding: 6px 9px;
  text-align: left;
}

.doc-meta-table th {
  background: #F1F5F9;
  font-weight: 700;
  width: 17%;
  color: #1E293B;
}

.doc-meta-table td {
  width: 33%;
  color: #0F172A;
}

.hash-box {
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  border-left: 4px solid #0F172A;
  padding: 7px 10px;
  margin-bottom: 14px;
  font-size: 11px;
  color: #334155;
  word-break: break-all;
}

.hash-box strong {
  color: #0F172A;
}

/* Formal Table Layout */
.chat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.8px;
  line-height: 1.5;
}

.chat-table thead {
  display: table-header-group;
}

.chat-table th {
  background: #0F172A;
  color: #FFFFFF;
  font-weight: 700;
  padding: 7px 8px;
  border: 1px solid #0F172A;
  text-align: center;
}

.chat-table td {
  border: 1px solid #CBD5E1;
  padding: 6px 8px;
  vertical-align: top;
}

.chat-table tr {
  break-inside: avoid;
  page-break-inside: avoid;
}

.chat-table tr:nth-child(even) td {
  background: #F8FAFC;
}

.chat-table tr.kw-row td {
  background: #FEFCE8;
}

.col-no { width: 46px; text-align: center; color: #64748B; font-weight: 700; }
.col-date { width: 128px; text-align: center; color: #334155; font-size: 11px; white-space: nowrap; }
.col-sender { width: 92px; text-align: center; font-weight: 700; color: #0F172A; word-break: keep-all; }
.col-msg { white-space: pre-wrap; word-break: break-word; color: #111827; }

.date-divider-row td {
  background: #E2E8F0 !important;
  color: #0F172A;
  font-weight: 800;
  text-align: center;
  font-size: 11.5px;
  padding: 5px 8px;
}

mark.kw-hit {
  background: var(--highlight);
  color: #713F12;
  padding: 0 2px;
  border-radius: 2px;
  font-weight: 700;
}

/* Bubble Layout */
.bubble-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bubble-date-sep {
  text-align: center;
  margin: 10px 0 4px;
}

.bubble-date-sep span {
  display: inline-block;
  background: #E2E8F0;
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 999px;
}

.bubble-row {
  display: flex;
  flex-direction: column;
  max-width: 78%;
  break-inside: avoid;
  page-break-inside: avoid;
}

.bubble-row.left {
  align-self: flex-start;
}

.bubble-row.right {
  align-self: flex-end;
  align-items: flex-end;
}

.bubble-meta {
  font-size: 10.5px;
  color: #475569;
  margin-bottom: 3px;
  font-weight: 700;
}

.bubble-box {
  padding: 8px 11px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid #CBD5E1;
  background: #F8FAFC;
}

.bubble-row.right .bubble-box {
  background: #ECFDF5;
  border-color: #A7F3D0;
}

.truncated-notice {
  margin-top: 18px;
  padding: 18px;
  border: 2px dashed #D97706;
  background: #FFFBEB;
  border-radius: 10px;
  text-align: center;
}

.truncated-notice h4 {
  font-size: 15px;
  font-weight: 800;
  color: #92400E;
  margin-bottom: 5px;
}

.truncated-notice p {
  font-size: 12.5px;
  color: #78350F;
  margin-bottom: 12px;
}

.doc-footer {
  margin-top: 20px;
  padding-top: 10px;
  border-top: 1px solid #CBD5E1;
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: #64748B;
}

.empty-paper {
  text-align: center;
  padding: 110px 24px;
  color: #64748B;
}

.empty-paper h3 {
  font-size: 18px;
  color: #0F172A;
  margin-bottom: 8px;
}

.empty-paper p {
  font-size: 13px;
  margin-bottom: 18px;
}

/* SEO Guide & FAQ Section */
.info-section {
  max-width: 1320px;
  margin: 0 auto 48px;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.info-card {
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 20px;
}

.info-card h2 {
  font-size: 15.5px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 10px;
}

.info-card ol,
.info-card ul {
  padding-left: 18px;
  font-size: 13px;
  color: var(--slate);
  line-height: 1.7;
}

.info-card p {
  font-size: 13px;
  color: var(--slate);
  line-height: 1.65;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.modal-card {
  width: 100%;
  max-width: 460px;
  background: #FFFFFF;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
}

.modal-header {
  background: var(--navy);
  color: #FFFFFF;
  padding: 15px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 800;
}

.modal-close {
  background: transparent;
  border: none;
  color: #CBD5E1;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.modal-body {
  padding: 18px;
}

.pro-box {
  background: var(--emerald-soft);
  border: 1px solid #A7F3D0;
  border-radius: 10px;
  padding: 13px 15px;
  margin-bottom: 14px;
}

.pro-price {
  font-size: 16px;
  font-weight: 900;
  color: #047857;
  margin-bottom: 8px;
}

.pro-box ul {
  padding-left: 18px;
  font-size: 13px;
  color: #1E293B;
  line-height: 1.65;
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 14px 0 12px;
  color: #94A3B8;
  font-size: 12px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--border-light);
}

.divider span {
  padding: 0 10px;
}

.license-input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: monospace;
  font-size: 13px;
  margin-bottom: 9px;
}

.status-msg {
  font-size: 12.5px;
  font-weight: 700;
  margin-top: 8px;
  min-height: 18px;
}

.status-msg.ok { color: var(--emerald); }
.status-msg.err { color: var(--red); }

.site-footer {
  text-align: center;
  padding: 20px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border-light);
  background: #FFFFFF;
}

.toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  background: var(--navy);
  color: #FFFFFF;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  z-index: 200;
}

/* Responsive */
@media (max-width: 1040px) {
  .workspace {
    grid-template-columns: 1fr;
  }
  .info-section {
    grid-template-columns: 1fr;
  }
  .a4-document {
    width: 100%;
    min-height: auto;
    padding: 20px 16px;
  }
  .paper-stage {
    padding: 12px;
  }
}

/* ============================================================
   A4 VECTOR PDF PRINT STYLESHEET (Native Crisp Korean Text)
   ============================================================ */
@page {
  size: A4 portrait;
  margin: 14mm 12mm 15mm 12mm;
}

@media print {
  body {
    background: #FFFFFF !important;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .no-print {
    display: none !important;
  }

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

  .paper-stage {
    background: #FFFFFF !important;
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
    overflow: visible !important;
    min-height: auto !important;
  }

  .a4-document {
    width: 100% !important;
    min-height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
  }

  .chat-table th {
    background: #0F172A !important;
    color: #FFFFFF !important;
  }

  mark.kw-hit {
    background: #FEF08A !important;
  }
}
