/* paperCircle — hand-written styles mirroring the original Tailwind/shadcn theme. */

:root {
  --background: 210 40% 98%;
  --foreground: 222 47% 11%;
  --card: 0 0% 100%;
  --border: 214 32% 91%;
  --muted: 210 40% 96.1%;
  --muted-foreground: 215.4 16.3% 46.9%;
  --primary: 230 50% 30%;
  --primary-foreground: 210 40% 98%;
  --accent: 175 70% 35%;
  --destructive: 0 84.2% 60.2%;
  --success: 142 72% 29%;
  --ring: 230 50% 30%;
  --radius: 0.5rem;
  --shadow-sm: 0 1px 2px -1px rgb(0 0 0 / .06), 0 1px 3px rgb(0 0 0 / .04);
  --shadow-md: 0 4px 12px -2px rgb(0 0 0 / .08);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: var(--font); font-size: 16px; line-height: 1.5;
  background: hsl(var(--background)); color: hsl(var(--foreground));
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.875rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
h2 { font-size: 1.875rem; font-weight: 700; line-height: 1.25; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Layout helpers ---------------------------------------------------- */
.container { width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 1rem; }
.narrow { max-width: 56rem; }
.narrower { max-width: 42rem; }
.narrow-3 { max-width: 48rem; }
.narrow-5 { max-width: 64rem; }
.page { padding-top: 2rem; padding-bottom: 3rem; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 2rem; }
.page-head p { margin-top: .25rem; }
.row { display: flex; align-items: center; }
.row.top { align-items: flex-start; }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.gap-1 { gap: .25rem; } .gap-2 { gap: .5rem; } .gap-3 { gap: .75rem; } .gap-4 { gap: 1rem; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.stack-sm { display: flex; flex-direction: column; gap: .5rem; }
.stack-lg { display: flex; flex-direction: column; gap: 1.5rem; }
.flex-1 { flex: 1; }
.shrink-0 { flex-shrink: 0; }
.min-w-0 { min-width: 0; }
.w-full { width: 100%; }
.ml-auto { margin-left: auto; }
.mt-2 { margin-top: .5rem; } .mt-3 { margin-top: .75rem; } .mt-4 { margin-top: 1rem; } .mt-8 { margin-top: 2rem; }
.mb-2 { margin-bottom: .5rem; } .mb-3 { margin-bottom: .75rem; } .mb-6 { margin-bottom: 1.5rem; } .mb-8 { margin-bottom: 2rem; }
.center { text-align: center; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.grid { display: grid; gap: 1.5rem; }
.grid-2, .grid-3, .grid-4, .grid-5, .grid-cards { grid-template-columns: 1fr; }
.grid.gap-4 { gap: 1rem; }
.grid-4 { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.grid-5 { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.grid-2.gap-4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .grid-5 { grid-template-columns: repeat(5, 1fr); }
  .grid-cards { grid-template-columns: repeat(2, 1fr); }
  .upload-grid { grid-template-columns: 2fr 1fr; gap: 2rem; }
}
@media (min-width: 1024px) {
  .grid-cards { grid-template-columns: repeat(3, 1fr); }
  .profile-grid { grid-template-columns: 1fr 2fr; gap: 2rem; }
}

/* ---- Type & color ------------------------------------------------------ */
.muted { color: hsl(var(--muted-foreground)); }
.muted-2 { color: hsl(var(--muted-foreground) / .6); }
.faint { color: hsl(var(--muted-foreground) / .3); }
.fg { color: hsl(var(--foreground)); }
.small { font-size: .875rem; }
.tiny { font-size: .75rem; }
.strong { font-weight: 600; }
.mono { font-family: Menlo, monospace; }
.relaxed { line-height: 1.65; }
.eyebrow { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.text-primary { color: hsl(var(--primary)); }
.text-accent { color: hsl(var(--accent)); }
.text-accent-light { color: hsl(175 70% 60%); }
.text-blue { color: #3b82f6; }
.text-green { color: #16a34a; }
.text-green-light { color: #86efac; }
.text-red { color: #ef4444; }
.text-yellow { color: #fde047; }
.text-yellow-dark { color: #ca8a04; }
.link { font-weight: 500; color: hsl(var(--primary)); }
.link:hover { text-decoration: underline; }

/* ---- Icons ------------------------------------------------------------- */
.icon { width: 1rem; height: 1rem; flex-shrink: 0; }
.icon-xs { width: .75rem; height: .75rem; }
.icon-sm { width: .875rem; height: .875rem; }
.icon-lg { width: 1.75rem; height: 1.75rem; }
.icon-xl { width: 2.5rem; height: 2.5rem; }
.icon-2xl { width: 4rem; height: 4rem; }
.pulse { animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .4; } }

/* ---- Buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  height: 2.25rem; padding: 0 1rem; border-radius: var(--radius);
  border: 1px solid transparent; background: none;
  font-size: .875rem; font-weight: 500; white-space: nowrap;
  transition: background-color .15s, color .15s, border-color .15s, opacity .15s;
}
.btn:disabled, .btn.disabled { opacity: .5; pointer-events: none; }
.btn-sm { height: 2rem; padding: 0 .75rem; font-size: .8125rem; }
.btn-xs { height: 1.5rem; padding: 0 .5rem; font-size: .75rem; }
.btn-lg { height: 3rem; padding: 0 2rem; font-size: 1rem; }
.btn-icon { width: 2.25rem; padding: 0; }
.btn-icon.btn-sm { width: 2rem; }
.btn-primary { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: hsl(var(--primary) / .9); }
.btn-outline { border-color: hsl(var(--border)); background: hsl(var(--card)); box-shadow: var(--shadow-sm); }
.btn-outline:hover { background: hsl(var(--muted)); }
.btn-ghost { color: hsl(var(--muted-foreground)); }
.btn-ghost:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.btn-soft { background: hsl(var(--primary) / .06); color: hsl(var(--primary)); }
.btn-soft:hover { background: hsl(var(--primary) / .12); }
.btn-muted { background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }
.btn-muted:hover { background: hsl(var(--primary) / .1); color: hsl(var(--primary)); }
.btn-success { background: #16a34a; color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-danger { background: hsl(var(--destructive)); color: #fff; }
.btn-danger:hover { background: hsl(var(--destructive) / .9); }

/* ---- Forms ------------------------------------------------------------- */
.input {
  width: 100%; height: 2.25rem; padding: 0 .75rem;
  border: 1px solid hsl(var(--border)); border-radius: var(--radius);
  background: hsl(var(--card)); font-size: .875rem; box-shadow: var(--shadow-sm);
}
textarea.input { height: auto; padding: .5rem .75rem; resize: vertical; min-height: 4.5rem; }
select.input { appearance: none; padding-right: 2rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2364748b' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .6rem center; }
.input:focus { outline: none; border-color: hsl(var(--ring) / .6); box-shadow: 0 0 0 3px hsl(var(--ring) / .15); }
.field { display: flex; flex-direction: column; gap: .5rem; font-size: .875rem; font-weight: 500; }
.hint { font-size: .75rem; font-weight: 400; color: hsl(var(--muted-foreground)); }
.input-icon { position: relative; display: block; }
.input-icon .icon { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: hsl(var(--muted-foreground)); pointer-events: none; }
.input-icon .input { padding-left: 2.25rem; }

.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .25rem;
  padding: 2rem; border: 2px dashed hsl(var(--border)); border-radius: .75rem;
  background: hsl(var(--muted) / .4); cursor: pointer; text-align: center; transition: border-color .15s, background .15s;
}
.dropzone:hover { border-color: hsl(var(--primary) / .5); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone .icon { margin-bottom: .5rem; }
.dropzone .dz-empty, .dropzone .dz-file { display: flex; flex-direction: column; align-items: center; gap: .25rem; }
.dropzone .dz-file, .dropzone.has-file .dz-empty { display: none; }
.dropzone.has-file .dz-file { display: flex; }
.dropzone.has-file { border-color: hsl(var(--primary)); background: hsl(var(--primary) / .05); }
.progress { height: .375rem; border-radius: 999px; background: hsl(var(--muted)); overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: hsl(var(--primary)); transition: width .2s; }

/* ---- Cards ------------------------------------------------------------- */
.card { background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: .75rem; box-shadow: var(--shadow-sm); }
.card-head { padding: 1.5rem 1.5rem 0; }
.card-head p { margin-top: .25rem; }
.card-title { font-size: 1.25rem; font-weight: 600; line-height: 1.3; }
.card-body { padding: 1.5rem; }
.card-muted { background: hsl(var(--muted) / .5); }
.card-primary { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); border: none; box-shadow: var(--shadow-md); }
.on-primary-muted { color: hsl(var(--primary-foreground) / .8); margin-bottom: 1.25rem; }
.pad-lg { padding: 1.5rem; }
.pad-xl { padding: 2rem; }
.h-card { font-weight: 700; margin-bottom: .5rem; font-size: 1rem; }
.h-feature { font-size: 1.25rem; font-weight: 700; margin: 1rem 0 .75rem; }
.h-num { font-size: 1.25rem; font-weight: 700; }
.icon-tile { width: 2.5rem; height: 2.5rem; border-radius: var(--radius); background: hsl(var(--primary) / .1); display: grid; place-items: center; margin-bottom: 1rem; }
.icon-tile .icon { width: 1.25rem; height: 1.25rem; }
.divider-top { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid hsl(var(--border)); }
.avatar { width: 1.75rem; height: 1.75rem; border-radius: 999px; background: hsl(var(--primary) / .1); color: hsl(var(--primary)); display: grid; place-items: center; font-size: .75rem; font-weight: 700; flex-shrink: 0; }
.avatar-lg { width: 3.5rem; height: 3.5rem; border-radius: 999px; background: hsl(var(--accent) / .1); display: grid; place-items: center; flex-shrink: 0; }
.avatar-xl { width: 4rem; height: 4rem; border-radius: 999px; background: hsl(var(--primary) / .1); display: grid; place-items: center; margin: 0 auto 1rem; }

.stat { padding: 1.5rem; display: flex; flex-direction: column; align-items: center; text-align: center; }
.stat .icon { margin-bottom: .5rem; }
.stat-value { font-size: 1.875rem; font-weight: 700; line-height: 1.2; display: flex; align-items: center; gap: .25rem; }
.stat-label { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: hsl(var(--muted-foreground)); }
.stat-sm { padding: 1rem; }
.stat-sm .stat-value { font-size: 1.5rem; }
.stat-alert { background: hsl(var(--primary) / .1); border-color: hsl(var(--primary) / .2); }

/* ---- Badges, tags, notes ---------------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: .25rem; padding: .125rem .625rem; border-radius: 999px; border: 1px solid transparent; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.badge-outline { border-color: hsl(var(--border)); font-weight: 400; }
.badge-primary { background: hsl(var(--primary) / .1); color: hsl(var(--primary)); border-color: hsl(var(--primary) / .2); }
.badge-muted { background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }
.badge-approved { background: rgb(34 197 94 / .1); color: #15803d; border-color: rgb(34 197 94 / .2); }
.badge-pending { background: rgb(234 179 8 / .1); color: #a16207; border-color: rgb(234 179 8 / .2); }
.badge-rejected { background: rgb(239 68 68 / .1); color: #b91c1c; border-color: rgb(239 68 68 / .2); }
.badge-duplicate { background: rgb(107 114 128 / .1); color: #374151; border-color: rgb(107 114 128 / .2); }
a.badge:hover { background: hsl(var(--primary) / .18); }
.tag { padding: .125rem .5rem; border-radius: .25rem; font-size: .75rem; font-weight: 600; text-transform: uppercase; background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }
.tag-open { background: #ffedd5; color: #9a3412; }
.note { padding: .5rem .75rem; border-radius: var(--radius); background: hsl(var(--muted) / .5); border: 1px solid hsl(var(--border) / .6); font-size: .875rem; display: flex; flex-direction: column; gap: .125rem; }
.callout { display: flex; align-items: flex-start; gap: .5rem; padding: .625rem .75rem; border-radius: var(--radius); border: 1px solid hsl(var(--border)); background: hsl(var(--muted) / .4); }
.callout .icon { margin-top: .15rem; }
.callout-warn { background: #fefce8; border-color: #fef08a; color: #854d0e; }
.callout-ok { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.callout-bad { background: #fef2f2; border-color: #fecaca; color: #991b1b; text-align: left; }

/* ---- Navbar & footer --------------------------------------------------- */
.navbar { position: sticky; top: 0; z-index: 40; border-bottom: 1px solid hsl(var(--border)); background: hsl(var(--background) / .85); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.navbar-inner { height: 4rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .625rem; font-weight: 700; font-size: 1.25rem; letter-spacing: -0.01em; }
.nav-links, .nav-actions { display: none; align-items: center; }
.nav-links { gap: 1.5rem; }
.nav-actions { gap: .5rem; }
.nav-links a { font-size: .875rem; font-weight: 500; color: hsl(var(--muted-foreground)); transition: color .15s; }
.nav-links a:hover, .nav-links a[aria-current] { color: hsl(var(--foreground)); }
.nav-links a.text-primary { color: hsl(var(--primary)); }
.nav-actions .link { font-size: .875rem; color: hsl(var(--foreground)); margin-right: .5rem; }
.points-pill { display: inline-flex; align-items: center; gap: .25rem; padding: .25rem .625rem; border-radius: 999px; background: hsl(var(--accent) / .1); color: hsl(var(--accent)); font-size: .8125rem; font-weight: 600; }
@media (min-width: 768px) {
  .nav-links, .nav-actions { display: flex; }
  .menu-toggle { display: none; }
}

.footer { border-top: 1px solid hsl(var(--border)); font-size: .75rem; color: hsl(var(--muted-foreground)); }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: .5rem; padding-top: .75rem; padding-bottom: .75rem; }
.footer nav { display: flex; gap: .75rem; }
.footer a:hover { color: hsl(var(--foreground)); }
.footer .dot { color: hsl(var(--border)); }
@media (min-width: 640px) { .footer-inner { flex-direction: row; justify-content: space-between; } }

/* ---- Dialogs (modal + mobile sheet) ------------------------------------ */
dialog { border: none; padding: 0; color: inherit; }
dialog::backdrop { background: rgb(0 0 0 / .5); }
.modal { width: calc(100% - 2rem); max-width: 32rem; border-radius: .75rem; background: hsl(var(--card)); box-shadow: 0 20px 50px rgb(0 0 0 / .2); }
.modal-sm { max-width: 24rem; }
.modal-lg { max-width: 36rem; }
.modal > form { padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.modal-title { font-size: 1.125rem; font-weight: 600; display: flex; align-items: center; gap: .5rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; }
.modal[open] { animation: pop .15s ease-out; }
@keyframes pop { from { opacity: 0; transform: scale(.97); } }

.sheet { margin: 0 0 0 auto; height: 100%; max-height: 100%; width: min(20rem, 85vw); background: hsl(var(--card)); padding: 1.25rem; }
.sheet[open] { display: flex; flex-direction: column; animation: slide .2s ease-out; }
@keyframes slide { from { transform: translateX(100%); } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.sheet-head .brand { font-size: 1.125rem; }
.sheet-links { display: flex; flex-direction: column; gap: 1rem; flex: 1; }
.sheet-links > a { font-size: 1.125rem; font-weight: 500; }
.sheet-footer { margin-top: auto; padding-top: 1rem; border-top: 1px solid hsl(var(--border)); }
.sheet-footer.stack { gap: .75rem; }

/* Action dropdown (no-JS <details>) */
.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; right: 0; top: calc(100% + .25rem); z-index: 20; min-width: 11rem; padding: .25rem; background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius); box-shadow: var(--shadow-md); }
.menu-list > * { display: flex; align-items: center; gap: .5rem; width: 100%; padding: .5rem; border: 0; background: none; border-radius: .25rem; font-size: .875rem; text-align: left; }
.menu-list > *:hover { background: hsl(var(--muted)); }
.menu-list .danger { color: hsl(var(--destructive)); }

/* ---- Toasts ------------------------------------------------------------ */
.toasts { position: fixed; z-index: 60; right: 1rem; bottom: 1rem; left: 1rem; display: flex; flex-direction: column; gap: .5rem; align-items: flex-end; pointer-events: none; }
.toast { pointer-events: auto; width: 100%; max-width: 24rem; display: flex; justify-content: space-between; gap: .75rem; padding: 1rem; border-radius: var(--radius); border: 1px solid hsl(var(--border)); background: hsl(var(--card)); box-shadow: 0 10px 30px rgb(0 0 0 / .12); font-size: .875rem; transition: opacity .3s, transform .3s; animation: toast-in .25s ease-out; }
.toast p { color: hsl(var(--muted-foreground)); margin-top: .125rem; }
.toast-error { background: hsl(var(--destructive)); border-color: hsl(var(--destructive)); color: #fff; }
.toast-error p { color: rgb(255 255 255 / .9); }
.toast-close { border: 0; background: none; padding: 0; opacity: .6; align-self: flex-start; }
.toast-close:hover { opacity: 1; }
.toast.hide { opacity: 0; transform: translateY(.5rem); }
@keyframes toast-in { from { opacity: 0; transform: translateY(.5rem); } }

/* ---- Home -------------------------------------------------------------- */
.hero { padding: 5rem 0; background: linear-gradient(to bottom, hsl(var(--primary) / .05), hsl(var(--background))); border-bottom: 1px solid hsl(var(--primary) / .1); }
.pill { display: inline-flex; align-items: center; gap: .375rem; padding: .25rem .75rem; margin-bottom: 1.5rem; border-radius: 999px; background: hsl(var(--primary) / .1); color: hsl(var(--primary)); border: 1px solid hsl(var(--primary) / .2); font-size: .875rem; font-weight: 500; }
.hero-title { font-size: 2.25rem; font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; margin-bottom: 1.5rem; }
.lead { font-size: 1.25rem; color: hsl(var(--muted-foreground)); line-height: 1.65; max-width: 42rem; margin: 0 auto 2.5rem; }
.lead-sm { font-size: 1.125rem; color: hsl(var(--muted-foreground)); max-width: 42rem; margin: 0 auto 2rem; }
.cta-row { display: flex; flex-direction: column; justify-content: center; gap: 1rem; }
@media (min-width: 640px) { .cta-row { flex-direction: row; } }
@media (min-width: 768px) { .hero { padding: 7rem 0; } .hero-title { font-size: 3.75rem; } }
.section { padding: 4rem 0; border-bottom: 1px solid hsl(var(--border)); }
.section.band { padding: 3rem 0; background: hsl(var(--card) / .3); }
.muted-band { background: hsl(var(--muted) / .2); }
.primary-band { background: hsl(var(--primary) / .05); padding: 5rem 0; border-bottom: 0; }
.primary-band h2 { margin-bottom: 1rem; }
.section-head { text-align: center; margin-bottom: 3rem; }
.section-head h2 { margin-bottom: 1rem; }
.section-head .lead-sm { margin-bottom: 0; }
.steps { gap: 2rem; }
.step { display: flex; flex-direction: column; align-items: center; text-align: center; }
.step p { max-width: 20rem; }
.step-num { position: relative; width: 3.5rem; height: 3.5rem; margin-bottom: 1rem; border-radius: 999px; background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); display: grid; place-items: center; font-size: 1.25rem; font-weight: 700; box-shadow: var(--shadow-md); }
.step-icon { position: absolute; right: -.25rem; bottom: -.25rem; width: 1.5rem; height: 1.5rem; border-radius: 999px; background: hsl(var(--accent)); display: grid; place-items: center; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; }
.chip { padding: .375rem 1rem; border-radius: 999px; border: 1px solid hsl(var(--border)); background: hsl(var(--card)); font-size: .875rem; font-weight: 500; transition: all .15s; }
.chip:hover { border-color: hsl(var(--primary) / .4); color: hsl(var(--primary)); background: hsl(var(--primary) / .05); }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; font-size: .875rem; }
.checklist li { display: flex; align-items: center; gap: .5rem; }

/* ---- Browse & paper cards --------------------------------------------- */
.filters { padding: 1rem; margin-bottom: 2rem; }
.filters-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 768px) { .filters-grid { grid-template-columns: repeat(4, 1fr); } .span-2 { grid-column: span 2; } }
.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid hsl(var(--border) / .6); }
.paper-card { display: flex; flex-direction: column; height: 100%; transition: box-shadow .2s; }
.paper-card:hover, .upload-card:hover { box-shadow: var(--shadow-md); }
.paper-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1rem 1rem .5rem; }
.paper-title { font-size: 1.0625rem; font-weight: 600; line-height: 1.3; }
.paper-head p { margin-top: .25rem; }
.paper-body { padding: .5rem 1rem; flex: 1; }
.paper-foot { margin-top: auto; padding: .75rem 1rem 1rem; display: flex; flex-direction: column; gap: .75rem; }
.pager { display: flex; justify-content: center; align-items: center; gap: 1.5rem; margin-top: 3rem; }
.empty { padding: 5rem 1rem; text-align: center; background: hsl(var(--card)); border: 1px dashed hsl(var(--border)); border-radius: .75rem; display: flex; flex-direction: column; align-items: center; }
.empty .icon { margin-bottom: 1rem; width: 3rem; height: 3rem; }
.empty h3 { font-size: 1.125rem; font-weight: 600; }
.empty p { max-width: 24rem; margin-top: .5rem; }

/* My uploads */
.upload-card { display: flex; flex-direction: column; overflow: hidden; transition: box-shadow .2s; }
.upload-card-body { padding: 1rem; flex: 1; }
.strip { display: flex; align-items: flex-start; gap: .625rem; padding: .75rem 1rem; font-size: .75rem; border-top: 1px solid; }
.strip .icon { margin-top: .1rem; }
.strip p + p { margin-top: .125rem; opacity: .9; }
.strip-warn { background: #fefce8; border-color: #fef9c3; color: #854d0e; }
.strip-ok { background: #f0fdf4; border-color: #dcfce7; color: #166534; }
.strip-bad { background: #fef2f2; border-color: #fee2e2; color: #b91c1c; }
.strip-neutral { background: #f9fafb; border-color: #e5e7eb; color: #4b5563; }

/* Profile */
.history-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .75rem; border-radius: var(--radius); border: 1px solid hsl(var(--border)); }
.history-row:hover { background: hsl(var(--muted) / .3); }
.history-icon { width: 2rem; height: 2rem; border-radius: 999px; display: grid; place-items: center; flex-shrink: 0; }
.history-icon.up { background: #dcfce7; color: #16a34a; }
.history-icon.down { background: #fee2e2; color: #ef4444; }

/* ---- Admin ------------------------------------------------------------- */
.tabs { display: flex; flex-wrap: wrap; gap: .25rem; padding: .25rem; margin-bottom: 1.5rem; background: hsl(var(--muted)); border-radius: var(--radius); width: fit-content; max-width: 100%; }
.tab { display: inline-flex; align-items: center; gap: .5rem; padding: .375rem .75rem; border-radius: .375rem; font-size: .875rem; font-weight: 500; color: hsl(var(--muted-foreground)); }
.tab:hover { color: hsl(var(--foreground)); }
.tab[aria-current] { background: hsl(var(--card)); color: hsl(var(--foreground)); box-shadow: var(--shadow-sm); }
.count { padding: .125rem .375rem; border-radius: 999px; font-size: .75rem; line-height: 1; color: #fff; }
.count-warn { background: #eab308; }
.count-primary { background: hsl(var(--primary)); }
.count-muted { background: hsl(var(--border)); color: hsl(var(--muted-foreground)); }
.report { padding: 1rem; display: flex; flex-direction: column; gap: 1rem; justify-content: space-between; }
.report-open { border-left: 4px solid #f97316; }
@media (min-width: 768px) { .report { flex-direction: row; align-items: center; } }
.table-wrap { border: 1px solid hsl(var(--border)); border-radius: .75rem; overflow: hidden; background: hsl(var(--card)); }
.table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table th { text-align: left; padding: .75rem 1rem; background: hsl(var(--muted) / .5); font-size: .75rem; font-weight: 600; text-transform: uppercase; color: hsl(var(--muted-foreground)); }
.table td { padding: .75rem 1rem; border-top: 1px solid hsl(var(--border)); vertical-align: middle; }
.table tbody tr:hover { background: hsl(var(--muted) / .2); }
.table td:first-child { max-width: 18rem; }
@media (max-width: 767px) {
  .table thead { display: none; }
  .table tr { display: block; padding: .75rem 1rem; border-top: 1px solid hsl(var(--border)); }
  .table tr:first-child { border-top: 0; }
  .table td { display: flex; align-items: center; gap: .5rem; padding: .25rem 0; border: 0; max-width: none !important; }
  .table td:not(:first-child)::before { content: attr(data-label) ':'; width: 5rem; font-size: .75rem; font-weight: 500; color: hsl(var(--muted-foreground)); }
}

/* ---- Auth & misc pages ------------------------------------------------- */
.auth-wrap { min-height: calc(100vh - 8rem); display: flex; align-items: center; justify-content: center; padding: 3rem 1rem; }
.auth-card { width: 100%; max-width: 25rem; padding: 2rem; display: flex; flex-direction: column; gap: 1.25rem; box-shadow: var(--shadow-md); }
.auth-title { font-size: 1.25rem; font-weight: 700; text-align: center; }
.auth-card > .muted.center { margin-top: -.75rem; }
.center-screen { min-height: calc(100vh - 8rem); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .75rem; padding: 2rem 1rem; text-align: center; }
.center-screen h2 { font-size: 1.5rem; }
.center-screen .btn { margin-top: .75rem; }
.prose h1 { margin-bottom: .5rem; }
.prose > p.muted { margin-bottom: 2rem; }
.prose section { margin-bottom: 1.5rem; }
.prose h2 { font-size: 1.25rem; font-weight: 600; margin-bottom: .5rem; }
.prose section p { color: hsl(var(--muted-foreground)); line-height: 1.7; font-size: .9375rem; }
