:root {
  --ink: #172033;
  --muted: #667085;
  --line: #e4e8f0;
  --page: #f3f6fb;
  --card: #ffffff;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-soft: #eff6ff;
  --cyan-soft: #ecfeff;
  --green: #15803d;
  --orange: #c2410c;
  --red: #b42318;
  --purple: #7e22ce;
  --shadow: 0 18px 48px rgba(15, 23, 42, .09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(37, 99, 235, .08), transparent 25rem),
    radial-gradient(circle at 95% 20%, rgba(6, 182, 212, .08), transparent 25rem),
    var(--page);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--blue-dark); }
[hidden] { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.hp-field { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }

.page-shell { max-width: 1220px; margin: 34px auto; padding: 0 20px; }
.main-card { background: var(--card); border: 1px solid rgba(228, 232, 240, .85); border-radius: 24px; padding: 28px; box-shadow: var(--shadow); }
.banner-wrap { margin-bottom: 22px; }
.banner-wrap img { display: block; width: 100%; max-height: 300px; object-fit: cover; border-radius: 18px; }

.poll-tabs { display: inline-flex; gap: 5px; padding: 5px; background: #eef2f7; border-radius: 13px; margin-bottom: 26px; }
.poll-tabs a { padding: 9px 15px; color: #526076; text-decoration: none; border-radius: 9px; font-size: 14px; font-weight: 700; }
.poll-tabs a.active { background: #fff; color: var(--blue-dark); box-shadow: 0 2px 8px rgba(15, 23, 42, .09); }

.page-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap; margin-bottom: 24px; }
.page-header h1 { margin: 2px 0 8px; font-size: clamp(28px, 4vw, 42px); line-height: 1.12; letter-spacing: -.035em; }
.page-header p { max-width: 700px; margin: 0; color: var(--muted); font-size: 17px; }
.eyebrow { color: var(--blue-dark); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.account-chip { padding: 9px 12px; border: 1px solid var(--line); background: #fafbfc; border-radius: 11px; font-size: 13px; }
.ranking-jump-button { white-space: nowrap; }

.button { appearance: none; border: 0; border-radius: 11px; padding: 10px 15px; font-weight: 750; cursor: pointer; text-decoration: none; display: inline-flex; justify-content: center; align-items: center; gap: 7px; transition: transform .16s ease, box-shadow .16s ease, background .16s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .text-button:focus-visible, .request-card:focus-visible { outline: 3px solid rgba(37, 99, 235, .25); outline-offset: 2px; }
.button.primary { background: linear-gradient(135deg, var(--blue), #1e40af); color: #fff; box-shadow: 0 8px 18px rgba(37, 99, 235, .23); }
.button.secondary { color: #344054; background: #fff; border: 1px solid var(--line); }
.button.success { color: #fff; background: var(--green); }
.button.danger-soft { color: var(--red); background: #fff1f0; border: 1px solid #fecaca; }
.button:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.button.compact-button { padding: 8px 13px; font-size: 14px; white-space: nowrap; }

.notice { border-radius: 16px; padding: 16px 18px; margin: 18px 0; }
.notice p { margin: 4px 0 0; }
.voting-notice { display: flex; justify-content: space-between; gap: 22px; align-items: center; background: var(--blue-soft); border: 1px solid #cfe0ff; }
.vote-usage { flex: 0 0 auto; padding: 10px 13px; background: #fff; border: 1px solid #dbeafe; border-radius: 11px; font-size: 14px; }
.manhwa-notice { background: #fff8ed; border: 1px solid #fed7aa; color: #7c2d12; }
.error-notice { background: #fff1f0; border: 1px solid #fda29b; color: #912018; }
.login-notice { background: var(--blue-soft); border: 1px solid #bfdbfe; }

.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 24px 0; }
.summary-grid article { padding: 17px; border: 1px solid var(--line); background: #fafbfc; border-radius: 15px; display: flex; flex-direction: column; }
.summary-number { font-size: 27px; line-height: 1.1; font-weight: 850; color: var(--blue-dark); }
.summary-grid article span:last-child { color: var(--muted); font-size: 13px; margin-top: 4px; }

.latest-section { margin: 30px 0 34px; padding-bottom: 30px; border-bottom: 1px solid var(--line); }
.latest-heading { align-items: center; }
.latest-request-list .request-card { border-left: 3px solid #93b4f5; }
.ranking-section { scroll-margin-top: 18px; }

.controls { display: grid; grid-template-columns: minmax(220px, 1fr) 180px 210px; gap: 10px; margin: 26px 0 18px; }
.controls input, .controls select, .modal input, .modal select, .modal textarea {
  width: 100%;
  border: 1px solid #d0d5dd;
  background: #fff;
  color: var(--ink);
  border-radius: 11px;
  padding: 11px 12px;
}
.modal textarea { resize: vertical; min-height: 74px; }

.list-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 12px; }
.list-heading h2 { margin: 0; font-size: 23px; }
.list-heading p { color: var(--muted); margin: 3px 0 0; font-size: 14px; }
.text-button { border: 0; background: none; color: var(--blue-dark); font-weight: 750; cursor: pointer; padding: 7px; }
.request-list { display: grid; gap: 11px; }
.loading-card, .empty-card { padding: 34px; text-align: center; color: var(--muted); background: #fafbfc; border: 1px dashed #cfd6e1; border-radius: 16px; }

.request-card { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 15px; align-items: center; border: 1px solid var(--line); border-radius: 16px; padding: 15px; background: #fff; transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.request-card:hover { border-color: #c5d5f7; box-shadow: 0 8px 22px rgba(15, 23, 42, .07); transform: translateY(-1px); }
.request-cover { width: 58px; height: 78px; border-radius: 10px; background: linear-gradient(145deg, #dbeafe, #e0f2fe); color: #1e40af; display: grid; place-items: center; font-size: 19px; font-weight: 850; overflow: hidden; }
.request-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.request-main { min-width: 0; }
.request-topline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rank { color: var(--blue-dark); font-size: 12px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.type-pill { color: #475467; background: #f2f4f7; border-radius: 999px; padding: 3px 8px; font-size: 11px; font-weight: 750; }
.request-title { margin: 5px 0 3px; font-size: 18px; line-height: 1.3; overflow-wrap: anywhere; }
.request-meta { color: var(--muted); font-size: 13px; display: flex; gap: 10px; flex-wrap: wrap; }
.request-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex-wrap: wrap; max-width: 310px; }
.vote-count { min-width: 76px; text-align: right; }
.vote-count strong { display: block; font-size: 21px; line-height: 1.05; }
.vote-count span { color: var(--muted); font-size: 11px; }

.status-badge { display: inline-flex; align-items: center; max-width: 100%; border-radius: 999px; padding: 5px 9px; font-size: 11px; font-weight: 800; line-height: 1.25; }
.status-pending { color: #92400e; background: #fef3c7; }
.status-open { color: #166534; background: #dcfce7; }
.status-review { color: #1d4ed8; background: #dbeafe; }
.status-selected { color: #6b21a8; background: #f3e8ff; }
.status-production { color: #9a3412; background: #ffedd5; }
.status-soon { color: #9f1239; background: #ffe4e6; }
.status-available { color: #166534; background: #dcfce7; }
.status-rejected { color: #991b1b; background: #fee2e2; }
.status-merged { color: #475467; background: #eaecf0; }
.manhwa-mini-note { color: #9a3412; font-size: 12px; margin-top: 5px; }

.page-footer { color: var(--muted); margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 14px; }
.page-footer p { margin: 0; }

.toast { position: fixed; top: 20px; right: 20px; z-index: 1200; width: min(390px, calc(100vw - 32px)); padding: 13px 16px; border-radius: 12px; background: #ecfdf3; color: #166534; border: 1px solid #a6f4c5; box-shadow: 0 15px 35px rgba(15, 23, 42, .18); opacity: 0; transform: translateY(-12px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #fff1f0; color: #912018; border-color: #fda29b; }

.modal { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .58); backdrop-filter: blur(3px); }
.modal-panel { position: relative; width: min(650px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: #fff; border-radius: 20px; padding: 25px; box-shadow: 0 25px 70px rgba(0, 0, 0, .28); }
.request-form-panel { width: min(760px, 100%); }
.modal-close { position: absolute; top: 12px; right: 14px; border: 0; background: #f2f4f7; color: #344054; width: 34px; height: 34px; border-radius: 50%; font-size: 24px; cursor: pointer; }
.modal h2 { margin: 4px 42px 16px 0; font-size: 25px; }
.modal label { display: block; margin: 13px 0; }
.modal label > span { display: block; margin-bottom: 6px; font-weight: 720; font-size: 14px; }
.modal label small { color: var(--muted); font-weight: 400; }
.modal label b { color: var(--red); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-consent { background: #f8fafc; border: 1px solid var(--line); padding: 11px 12px; border-radius: 11px; color: #475467; font-size: 13px; }
.inline-manhwa-note { background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; padding: 10px 12px; border-radius: 10px; font-size: 13px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; }
.duplicate-results { margin: -4px 0 12px; border: 1px solid #bfdbfe; background: #f8fbff; border-radius: 12px; padding: 10px; }
.duplicate-results h3 { font-size: 13px; margin: 0 0 6px; color: #344054; }
.duplicate-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px; border-top: 1px solid #e5edfb; font-size: 13px; }
.duplicate-item:first-of-type { border-top: 0; }
.duplicate-item button, .duplicate-item a { flex: 0 0 auto; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.detail-grid div { padding: 11px; background: #f8fafc; border-radius: 10px; }
.detail-grid span { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.reason-box { padding: 14px; border-radius: 12px; background: #fff1f0; border: 1px solid #fecaca; white-space: pre-wrap; }

@media (max-width: 820px) {
  .main-card { padding: 20px; border-radius: 19px; }
  .controls { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
  .voting-notice { align-items: flex-start; flex-direction: column; }
  .request-card { grid-template-columns: 62px minmax(0, 1fr); }
  .request-actions { grid-column: 1 / -1; max-width: none; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 11px; }
  .vote-count { text-align: left; }
}

@media (max-width: 560px) {
  .page-shell { margin: 0; padding: 0; }
  .main-card { border-radius: 0; border-left: 0; border-right: 0; padding: 17px; }
  .poll-tabs { display: flex; }
  .poll-tabs a { flex: 1; text-align: center; padding: 9px; }
  .header-actions { width: 100%; justify-content: flex-start; }
  .header-actions .primary { flex: 1 1 100%; }
  .latest-section { margin: 24px 0 28px; padding-bottom: 25px; }
  .latest-heading { align-items: flex-start; }
  .summary-grid { grid-template-columns: 1fr; }
  .summary-grid article { flex-direction: row; gap: 10px; align-items: baseline; }
  .controls { grid-template-columns: 1fr; }
  .search-field { grid-column: auto; }
  .request-card { grid-template-columns: 50px minmax(0, 1fr); padding: 12px; gap: 11px; }
  .request-cover { width: 48px; height: 66px; }
  .request-title { font-size: 16px; }
  .request-actions .button { flex: 1; }
  .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .modal { padding: 10px; }
  .modal-panel { padding: 21px 17px; max-height: calc(100vh - 20px); border-radius: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
