:root {
  /* --- THEME VARIABLES --- */
  --bg: #1a0033;       /* Deep Purple Background */
  --card: #2a0a4a;     /* Lighter Purple for cards */
  --line: #3a2358;     /* Borders */
  --ink: #f7f7f7;      /* Text Color */
  --muted: #c59fd6;    /* Secondary Text */
  
  --accent: #22c55e;   /* Green (Success/Action) */
  --brand: #ffd94a;    /* Yellow (Headers/Brand) */
  --pink: #ff7ab6;     /* Secondary Accent */
  --blue: #4b8dff;     /* Blue */
  --red: #ef4444;      /* Red (Delete/Clear) */
  
  --input-bg: #0e1520; /* Very dark blue for inputs */
}

/* --- GLOBAL RESETS --- */
* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Segoe UI', Inter, Roboto, Helvetica, Arial, sans-serif;
  text-align: center;
}

/* --- FORM ELEMENTS --- */
input, textarea, select, button {
  font-family: inherit;
  font-size: 14px;
}

input[type="text"],
input[type="number"],
input[type="email"],
textarea {
  width: 100%;
  background: var(--input-bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  transition: border-color 0.2s;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--pink);
  box-shadow: 0 0 0 2px rgba(255, 122, 182, 0.2);
}

/* --- LAYOUT --- */
.wrap {
  max-width: 1180px;
  margin: 24px auto;
  padding: 0 16px 64px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* --- HERO --- */
.hero {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.hero .title {
  font-weight: 900;
  font-size: 32px;
  color: var(--brand);
  letter-spacing: 1px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.hero .subtitle { color: var(--pink); font-weight: 700; font-size: 18px; }
.hero .subsub { margin-top: 6px; color: var(--muted); font-size: 13px; }

/* --- CARDS --- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  overflow: hidden;
  text-align: left;
}

.card > .hd {
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.card > .hd h2 {
  margin: 0;
  font-size: 15px;
  color: var(--brand);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.card > .bd { padding: 20px; }

/* --- GRID --- */
.stack { display: flex; flex-direction: column; gap: 20px; }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media(min-width: 900px) { .grid2 { grid-template-columns: 1fr 1fr; } }

.row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.row > * { flex: 1 1 200px; }

/* --- LABELS --- */
label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
}

/* --- DROPZONE --- */
.dropzone {
  border: 2px dashed var(--line);
  border-radius: 12px;
  padding: 40px 20px;
  text-align: center;
  background: rgba(0,0,0,0.2);
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--ink);
  margin-bottom: 20px;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent);
  background: rgba(34, 197, 94, 0.05);
  transform: translateY(-2px);
}

.note { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* --- BUTTONS --- */
.btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }

.btn {
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  font-size: 12px;
  color: #fff;
  transition: filter 0.2s, transform 0.1s;
}

.btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; filter: grayscale(1); }

.b-blue   { background: var(--blue); color: #fff; }
.b-green  { background: var(--accent); color: #fff; }
.b-accent { background: var(--brand); color: #1a0033; }
.b-red    { background: var(--red); color: #fff; }
.b-pink   { background: var(--pink); color: #1a0033; }

.ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.ghost:hover { border-color: var(--ink); color: var(--ink); }

/* --- PREVIEWS & LOGS --- */
.thumbs { display: grid; grid-template-columns: 1fr; gap: 15px; }
.thumb { background: rgba(0,0,0,0.2); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.thumb .meta { padding: 10px; border-top: 1px solid var(--line); font-size: 12px; display: flex; flex-direction: column; gap: 8px; }

.wysi .page { border: 1px solid var(--line); margin-bottom: 10px; border-radius: 8px; overflow: hidden; position: relative; }
.wysi canvas { display: block; width: 100%; height: auto; }

.empty { padding: 30px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); text-align: center; font-style: italic; }

.log { font-family: monospace; background: rgba(0,0,0,0.3); padding: 10px; border-radius: 8px; border: 1px solid var(--line); color: var(--accent); white-space: pre-wrap; max-height: 150px; overflow-y: auto; font-size: 12px; }

.footer { margin-top: 30px; color: var(--muted); font-size: 11px; opacity: 0.6; }

.badge-select { width: 100%; margin-top: 8px; background: var(--input-bg); color: var(--brand); border: 1px solid var(--line); padding: 6px; border-radius: 6px; font-weight: bold; font-size: 11px; text-transform: uppercase; cursor: pointer; }

.wysi-badge-overlay { position: absolute; top: 10px; right: 10px; background: var(--accent); color: #fff; padding: 4px 10px; font-size: 12px; font-weight: 900; text-transform: uppercase; border-radius: 4px; box-shadow: 0 2px 5px rgba(0,0,0,0.5); pointer-events: none; z-index: 10; border: 1px solid rgba(255,255,255,0.3); }
.wysi-badge-overlay[data-label="POD"] { background: var(--accent); }
.wysi-badge-overlay[data-label="OTHER PAPERWORK"] { background: var(--muted); color: #000; }

/* ========================================================= */
/* --- PDF APP SPECIFIC STYLES (Added to match your theme) --- */
/* ========================================================= */

/* 1. THE SHARED HEADER STYLE 
   This makes "Full Text Comparison" look exactly like "Change Summary" */
.section-header {
  background: rgba(0, 0, 0, 0.2); /* Matches .card > .hd */
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  
  font-family: inherit;
  font-weight: 800; 
  font-size: 15px;
  color: var(--brand); /* Yellow Brand Color */
  text-transform: uppercase;
  letter-spacing: 1px;
  
  display: block;
  border-radius: 8px 8px 0 0; /* Rounded top corners only */
  margin-top: 0;
}

/* 2. CONTAINERS FOR SUMMARY & DIFF 
   These act like your ".card" class but are specific for the results */
#results-area, #summary-area {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  margin-bottom: 24px;
  overflow: hidden; /* Keeps the header inside the rounded corners */
  text-align: left;
}

/* 3. SUMMARY TABLE STYLING */
.summary-table {
  display: table;
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.summary-table th { 
  background: rgba(0,0,0,0.2); 
  color: var(--muted); 
  text-align: left; 
  padding: 12px 16px; 
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.summary-table td { 
  padding: 12px 16px; 
  border-bottom: 1px solid rgba(255,255,255,0.05); 
  color: var(--ink); 
  vertical-align: top;
}

/* 4. DIFF OUTPUT STYLING */
.diff-container { 
  padding: 20px;
  white-space: pre-wrap; 
  font-family: 'Roboto Mono', monospace; 
  line-height: 1.6; 
  font-size: 14px; 
  color: var(--ink); 
}

.file-info { 
  padding: 10px 20px; 
  background: rgba(0,0,0,0.2);
  border-bottom: 1px solid var(--line);
  display: flex; 
  justify-content: space-between; 
  color: var(--pink); 
  font-family: monospace; 
  font-size: 12px;
}

/* 5. TEXT HIGHLIGHTING (High Contrast) */
.added, .badge.add { 
  background-color: rgba(34, 197, 94, 0.5); 
  color: #ffffff; 
  border-radius: 4px; 
  padding: 2px 4px; 
  font-weight: bold;
}

.removed, .badge.del { 
  background-color: rgba(239, 68, 68, 0.6); 
  color: #ffffff; 
  text-decoration: line-through;
  border-radius: 4px;
  padding: 2px 4px;
  margin-right: 4px;
}
.badge.del { text-decoration: none; }

.badge.mod { background: rgba(255, 217, 74, 0.2); color: var(--brand); }
.badge { display: inline-block; padding: 2px 6px; border-radius: 4px; font-size: 11px; font-weight: bold; text-transform: uppercase; }

.ctx { color: var(--muted); font-style: italic; font-size: 0.9em; }
.domain-cell { color: var(--pink); font-family: monospace; }