:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #4f46e5;
  --brand-dark: #4338ca;
  --danger: #dc2626;
  --ok: #16a34a;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 8px 24px rgba(15, 23, 42, 0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--card);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand img { height: 30px; display: block; }
.nav a {
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  margin-left: 20px;
}
.nav a:hover { color: var(--ink); text-decoration: none; }

/* Homepage simplified style */
.home-simple {
  max-width: 760px;
  padding-top: 50px;
  padding-bottom: 48px;
}
.simple-upload-box {
  margin: 0 auto;
  max-width: 480px;
  background: var(--card);
  border: 1px dashed #94a3b8;
  padding: 26px 28px;
  text-align: center;
  overflow: visible;
}
.simple-dropzone {
  display: block;
  padding: 8px;
  cursor: pointer;
  border: 1px dashed transparent;
  border-radius: 10px;
}
.simple-dropzone.dragover {
  border-color: var(--brand);
  background: #f5f3ff;
}
.simple-line {
  font-size: 18px;
  color: var(--ink);
}
.simple-sep {
  margin: 8px 0;
  color: var(--muted);
}
.simple-upload-btn {
  display: inline-block;
  margin-top: 8px;
  border: 1px solid #9ca3af;
  color: #111827;
  font-size: 13px;
  padding: 6px 10px;
  background: #f9fafb;
}
.simple-dropzone input[type="file"] {
  display: none;
}
.simple-hint {
  margin-top: 10px;
  margin-bottom: 10px;
}
.simple-submit-btn {
  width: 100%;
  margin-top: 10px;
}
.cf-turnstile {
  width: 300px;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}
.home-simple .cf-turnstile {
  margin-top: 12px;
}
.card .cf-turnstile {
  margin-bottom: 16px;
}

/* Buttons */
.btn {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 11px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; }
.btn.secondary { background: #eef2ff; color: var(--brand-dark); }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; }

/* Result */
.result {
  margin-top: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
/* Bulk upload */
.bulk-result { margin-top: 16px; }
.bulk-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.bulk-result-head h2 {
  margin: 0;
  font-size: 20px;
}
.bulk-result-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.bulk-table-wrap {
  margin-top: 10px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.bulk-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}
.bulk-table th,
.bulk-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}
.bulk-table th {
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
}
.bulk-status-ok { color: #166534; font-weight: 700; }
.bulk-status-error { color: #991b1b; font-weight: 700; }

/* Forms */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  margin: 24px 0 48px;
}
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; }
.field input, .field textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
}
.field textarea { min-height: 110px; resize: vertical; }
.hint { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* Messages */
.msg { padding: 12px 14px; border-radius: 10px; margin: 12px 0; font-size: 14px; display: none; }
.msg.show { display: block; }
.msg.error { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.msg.success { background: #f0fdf4; color: var(--ok); border: 1px solid #bbf7d0; }

/* Content pages */
.prose { padding: 8px 0 48px; }
.prose h1 { font-size: 30px; }
.prose h2 { font-size: 20px; margin-top: 32px; }
.prose address { color: var(--muted); font-style: normal; background: #f1f5f9; padding: 12px 14px; border-radius: 10px; display: inline-block; }

/* Admin removal page */
body.admin-page .container { max-width: 1280px; }
.admin-wrap { padding: 24px 0 48px; }

.admin-filters {
  display: flex;
  gap: 14px;
  align-items: end;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.admin-filters label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
}
.admin-filters select {
  min-width: 150px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  background: #fff;
}

.admin-summary {
  color: var(--muted);
  margin-bottom: 10px;
  font-size: 14px;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.admin-toolbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}
.admin-table th,
.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
  font-size: 14px;
}
.admin-table th {
  background: #f8fafc;
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
  position: sticky;
  top: 0;
}
.admin-table tbody tr:hover { background: #f8fafc; }
.admin-cell-wrap {
  max-width: 340px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.admin-empty {
  text-align: center;
  color: var(--muted);
  padding: 22px;
}

.admin-status {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 999px;
  padding: 2px 10px;
}
.status-pending { background: #fef9c3; color: #854d0e; }
.status-actioned { background: #dcfce7; color: #166534; }
.status-rejected { background: #fee2e2; color: #991b1b; }

.usage-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.usage-card {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
}
.usage-card h3 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.usage-stat {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 4px 0;
}
.usage-label {
  font-size: 14px;
  color: var(--text);
}
.usage-value {
  font-size: 14px;
  font-weight: 600;
}
.usage-limit {
  font-weight: 400;
  color: var(--muted);
}
.usage-history {
  margin-top: 14px;
}
.usage-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.usage-history-table th,
.usage-history-table td {
  padding: 6px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.usage-history-table th {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.admin-pagination {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 12px;
}
.admin-btn-disabled {
  opacity: 0.55;
  pointer-events: none;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.site-footer a { color: var(--muted); margin: 0 4px; }
.footer-line {
  margin: 0;
  line-height: 1.6;
}

/* Removal page intro (Imgur-style notice) */
.removal-intro {
  background: var(--surface, var(--card));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px;
  margin: 0 0 24px;
}
.removal-intro p { margin: 0 0 12px; }
.removal-intro p:last-child { margin-bottom: 0; }

/* Upload / form consent line (Imgur-style) */
.upload-consent {
  margin: 14px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.upload-consent a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* TOS page */
.tos-updated { color: var(--muted); margin-bottom: 24px; }
.tos-contact {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 20px;
  display: inline-block;
  line-height: 1.7;
}

/* Centered notice pages */
.notice { text-align: center; padding: 80px 0; }
.notice h1 { font-size: 28px; }
.notice p { color: var(--muted); }

/* ========== Responsive / mobile ========== */
@media (max-width: 600px) {
  .container { padding: 0 16px; }

  .site-header .container { height: 56px; }
  .brand img { height: 26px; }

  .home-simple { padding-top: 32px; padding-bottom: 32px; }

  .simple-upload-box {
    max-width: 100%;
    padding: 20px 16px;
    border-radius: 0;
  }

  .simple-line { font-size: 16px; }
  .simple-upload-btn { font-size: 12px; padding: 6px 8px; }

  .bulk-result-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .bulk-result-actions { width: 100%; }
  .bulk-result-actions .btn { flex: 1; text-align: center; font-size: 13px; padding: 9px 10px; }

  .prose { padding: 0 0 32px; }
  .prose h1 { font-size: 24px; }
  .prose h2 { font-size: 18px; margin-top: 24px; }

  .card { padding: 20px 16px; margin: 16px 0 32px; }
  .field textarea { min-height: 90px; }

  .removal-intro { padding: 14px 14px; }

  .notice { padding: 48px 0; }
  .notice h1 { font-size: 22px; }

  .footer-line { font-size: 12px; }
  .site-footer { padding: 18px 0; }

  .tos-contact { padding: 14px 16px; font-size: 14px; }
}
