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

:root {
  --bg: #000000;
  --surface: #0f0f0f;
  --border: rgba(255,255,255,0.1);
  --border-hover: rgba(255,255,255,0.25);
  --text: #ffffff;
  --text-muted: rgba(255,255,255,0.45);
  --text-sub: rgba(255,255,255,0.65);
  --accent: #ffffff;
  --badge-bg: transparent;
  --radius: 8px;
  --radius-sm: 6px;
  --container: 720px;

  --status-filed: #22c55e;
  --status-inbox: #f59e0b;
  --status-dup: #64748b;
  --status-error: #ef4444;
}

html { font-size: 16px; -webkit-font-smoothing: antialiased; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 400;
  line-height: 1.5;
  min-height: 100vh;
}

/* ── HEADER ── */
.header {
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 52px;
  display: flex;
  align-items: center;
}
.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
}
.wordmark {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text);
}
.header-tag {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 2px 8px;
}

/* ── MAIN ── */
.main {
  max-width: var(--container);
  margin: 0 auto;
  padding: 64px 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* ── HERO ── */
.hero { text-align: center; }
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 4px 12px;
  margin-bottom: 20px;
}
.hero-title {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 16px;
}
.hero-sub {
  font-size: 15px;
  color: var(--text-sub);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ── DROP ZONE ── */
.drop-zone {
  border: 1.5px dashed var(--border);
  border-radius: 12px;
  padding: 56px 32px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: var(--surface);
  position: relative;
}
.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--border-hover);
  background: rgba(255,255,255,0.03);
}
.drop-zone.dragover { border-style: solid; }

.drop-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: var(--text-muted);
}
.drop-primary {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}
.drop-secondary {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.browse-label {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}
.drop-hint {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

/* ── UPLOAD BUTTON ROW ── */
.upload-btn-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.selected-info {
  font-size: 13px;
  color: var(--text-muted);
}
.btn-primary {
  background: #fff;
  color: #000;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.88; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── RESULTS ── */
.results-section { display: flex; flex-direction: column; gap: 12px; }
.results-heading {
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.result-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.result-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.result-body { flex: 1; min-width: 0; }
.result-original {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.result-new {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  word-break: break-all;
}
.result-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.result-meta-item { display: flex; align-items: center; gap: 4px; }
.result-meta-dot {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--border);
}
.result-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 100px;
  white-space: nowrap;
}
.badge-filed   { background: rgba(34,197,94,0.12);  color: var(--status-filed); }
.badge-inbox   { background: rgba(245,158,11,0.12); color: var(--status-inbox); }
.badge-dup     { background: rgba(100,116,139,0.12);color: var(--status-dup);   }
.badge-error   { background: rgba(239,68,68,0.12);  color: var(--status-error); }

/* ── EMAIL CALLOUT ── */
.email-callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.email-callout-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.email-callout-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
}
.email-callout-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.email-callout-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.email-callout-address {
  font-family: 'Courier New', monospace;
  font-size: clamp(18px, 3.4vw, 24px);
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.01em;
  text-decoration: none;
  word-break: break-all;
  flex: 1 1 auto;
  min-width: 0;
}
.email-callout-address:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(255,255,255,0.35);
}
.email-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  flex-shrink: 0;
}
.email-copy-btn:hover {
  background: rgba(255,255,255,0.12);
  border-color: var(--border-hover);
}
.email-copy-btn.copied {
  color: var(--status-filed);
  border-color: rgba(34,197,94,0.4);
  background: rgba(34,197,94,0.08);
}
.email-callout-sub {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── INFO GRID ── */
.info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.info-card-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.info-card-body { flex: 1; }
.info-card-title {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}
.info-card-email {
  font-size: 13px;
  font-family: 'Courier New', monospace;
  color: var(--text-sub);
  margin-bottom: 4px;
}
.info-card-sub {
  font-size: 12px;
  color: var(--text-muted);
}
.info-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.info-list li {
  font-size: 13px;
  color: var(--text-sub);
  padding-left: 12px;
  position: relative;
}
.info-list li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--text-muted);
  font-size: 10px;
  top: 2px;
}

/* ── LOADING OVERLAY ── */
.upload-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(4px);
}
.upload-overlay-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.spinner {
  width: 36px;
  height: 36px;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.uploading-text {
  font-size: 14px;
  color: rgba(255,255,255,0.65);
}

/* ── CORRECTION FORM ── */
.correction-form {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.correction-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.correction-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.correction-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 180px;
}
.correction-field--wide {
  flex: 2 1 260px;
}
.correction-field-label {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.correction-select,
.correction-input {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  padding: 7px 10px;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
}
.correction-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.35)' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}
.correction-select:focus,
.correction-input:focus {
  border-color: var(--border-hover);
}
.correction-select option {
  background: #1a1a1a;
  color: var(--text);
}
.correction-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
}
.correction-status {
  font-size: 12px;
  color: var(--text-muted);
  flex: 1;
}
.correction-status--error {
  color: var(--status-error);
}
.btn-correction {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.btn-correction:hover {
  background: rgba(255,255,255,0.13);
  border-color: var(--border-hover);
}
.btn-correction:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.correction-done {
  font-size: 12px;
  color: var(--status-filed);
  padding-top: 4px;
}

.result-folder-path {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  word-break: break-word;
}

.result-drive-link {
  font-size: 12px;
  color: var(--text-sub);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.2);
  padding-bottom: 1px;
  transition: color 0.15s, border-color 0.15s;
}
.result-drive-link:hover {
  color: var(--text);
  border-bottom-color: var(--text);
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
