:root {
  --bg: #ffffff;
  --surface: #f9fafb;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --line-hover: #d1d5db;
  --accent: #111827;
  --accent-text: #ffffff;
  --link: #2563eb;
  --link-dark: #1d4ed8;
  --green: #059669;
  --green-soft: #ecfdf5;
  --amber: #b45309;
  --amber-soft: #fffbeb;
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --radius: 8px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px; line-height: 1.6; color: var(--ink);
  background: var(--bg); min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.02em; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { width: min(1080px, calc(100% - 48px)); margin-inline: auto; }
.muted { color: var(--muted); }

.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255,255,255,.95); backdrop-filter: blur(4px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 20px; padding-block: 14px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.main-nav { display: flex; gap: 16px; }
.main-nav a { color: var(--ink); font-weight: 500; font-size: 14px; }
.main-nav a:hover { color: var(--link); }
.header-side { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.header-side form { display: contents; }
.lang-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--bg); }
.lang-switch a { padding: 4px 10px; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .03em; }
.lang-switch a:hover { text-decoration: none; color: var(--ink); background: var(--surface); }
.lang-switch a.active { background: var(--ink); color: #fff; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 6px; font-weight: 500; cursor: pointer; border: 1px solid transparent; transition: all .12s ease; white-space: nowrap; font-size: 14px; text-decoration: none; }
.btn.sm { padding: 5px 12px; font-size: 13px; }
.btn.xs { padding: 3px 8px; font-size: 12px; }
.btn.lg { padding: 11px 24px; font-size: 15px; }
.btn.primary { background: var(--accent); color: var(--accent-text); }
.btn.primary:hover { background: #374151; text-decoration: none; }
.btn.ghost { border-color: var(--line); background: var(--bg); color: var(--ink); }
.btn.ghost:hover { border-color: var(--line-hover); background: var(--surface); text-decoration: none; }
.btn.link { background: none; color: var(--muted); border: none; }
.btn.link:hover { color: var(--red); }
.btn.danger { background: none; border-color: var(--red); color: var(--red); }
.btn.danger:hover { background: var(--red-soft); }
.btn.wide { width: 100%; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }

.hero { padding-block: clamp(56px, 10vw, 112px) clamp(32px, 5vw, 56px); }
.kicker { text-transform: uppercase; letter-spacing: .1em; font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 16px; }
.hero h1 { font-size: clamp(30px, 5vw, 52px); max-width: 22ch; font-weight: 700; letter-spacing: -.03em; line-height: 1.08; }
.lede { margin-top: 18px; max-width: 56ch; font-size: clamp(15px, 2vw, 17px); color: var(--muted); line-height: 1.65; }
.cta-row { margin-top: 32px; display: flex; gap: 10px; flex-wrap: wrap; }
.stats-line { margin-top: 20px; font-size: 13px; color: var(--muted); letter-spacing: .02em; }

.audiences { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; padding-bottom: clamp(40px, 7vw, 72px); }
.aud-card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 10px; transition: border-color .15s ease; }
.aud-card:hover { border-color: var(--line-hover); }
.aud-card h3 { font-size: 16px; font-weight: 600; }
.aud-card p { color: var(--muted); font-size: 13.5px; flex: 1; line-height: 1.55; }
.aud-card .btn { align-self: flex-start; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-student { background: var(--amber); }
.dot-supervisor { background: var(--green); }
.dot-sponsor { background: var(--blue); }

.how { padding-bottom: clamp(48px, 8vw, 88px); }
.how h2 { font-size: clamp(22px, 3vw, 30px); margin-bottom: 28px; font-weight: 700; letter-spacing: -.02em; }
.steps { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.steps li { display: flex; gap: 14px; align-items: flex-start; }
.step-num { flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 600; display: grid; place-items: center; font-size: 13px; }
.steps h3 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.steps p { font-size: 13.5px; color: var(--muted); line-height: 1.55; }

.faq { padding-bottom: clamp(48px, 8vw, 88px); max-width: 720px; }
.faq h2 { font-size: clamp(22px, 3vw, 30px); margin-bottom: 18px; font-weight: 700; letter-spacing: -.02em; }
.faq-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 8px; background: var(--bg); }
.faq-item summary { cursor: pointer; font-weight: 500; font-size: 14.5px; }
.faq-item p { margin-top: 10px; color: var(--muted); font-size: 14px; line-height: 1.6; }

.catalog-page { padding-block: 40px 72px; }
.catalog-page > h1 { font-size: clamp(26px, 4vw, 34px); font-weight: 700; letter-spacing: -.02em; }
.tabs { display: flex; gap: 0; flex-wrap: wrap; margin-top: 20px; border-bottom: 1px solid var(--line); }
.tab { padding: 8px 16px; color: var(--muted); font-weight: 500; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { text-decoration: none; color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }
.search-form { margin-top: 20px; display: flex; gap: 8px; max-width: 640px; flex-wrap: wrap; }
.search-form input[type="search"] { flex: 1; min-width: 200px; }
.search-form select { width: auto; min-width: 120px; }
.check-inline { display: flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.check-inline input { width: auto; accent-color: var(--ink); }
.tag-cloud { margin-top: 14px; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.tag-cloud-label { color: var(--muted); }
.cards-grid { margin-top: 28px; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.empty-state { margin-top: 36px; padding: 48px 20px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }
.empty-state .btn { margin-top: 14px; }
.pagination { margin-top: 32px; display: flex; align-items: center; justify-content: center; gap: 16px; }

.chip { display: inline-block; font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.chip-link { color: var(--ink); }
.chip-link:hover { text-decoration: none; border-color: var(--line-hover); background: var(--surface); }
.chip-active { outline: 2px solid var(--ink); outline-offset: 1px; }

.pc-wrap { position: relative; }
.profile-card { display: block; height: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; color: var(--ink); transition: border-color .15s ease; }
.profile-card:hover { text-decoration: none; border-color: var(--line-hover); }
.pc-top { display: flex; gap: 12px; align-items: center; }
.avatar { flex-shrink: 0; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-weight: 600; letter-spacing: .03em; }
.avatar-img { object-fit: cover; border-radius: 50%; }
.av-0 { background: #374151; } .av-1 { background: #4b5563; } .av-2 { background: #6b7280; }
.av-3 { background: #9ca3af; } .av-4 { background: #475569; } .av-5 { background: #78716c; }
.pc-name { font-size: 16px; font-weight: 600; }
.vmark { display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; background: var(--green); color: #fff; font-size: 9px; font-weight: 700; vertical-align: 2px; margin-left: 5px; }
.pc-id { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.badge { display: inline-block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; border-radius: 4px; padding: 2px 7px; }
.badge-student { background: var(--amber-soft); color: var(--amber); }
.badge-supervisor { background: var(--green-soft); color: var(--green); }
.badge-sponsor { background: var(--blue-soft); color: var(--blue); }
.badge-draft { background: #f3f4f6; color: var(--muted); }
.pc-headline { margin-top: 10px; font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pc-meta { margin-top: 10px; display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.pc-place { font-size: 12.5px; color: var(--muted); }
.star-form { position: absolute; top: 12px; right: 12px; z-index: 2; }
.star-active { color: var(--amber) !important; border-color: var(--amber) !important; }

.profile-page { padding-block: 40px 80px; max-width: 760px; }
.back-link { display: inline-block; margin-bottom: 20px; font-size: 13.5px; }
.profile-header { display: flex; gap: 18px; align-items: center; }
.profile-header > div { display: flex; flex-direction: column; gap: 7px; align-items: flex-start; }
.profile-header h1 { font-size: clamp(24px, 4vw, 32px); font-weight: 700; letter-spacing: -.02em; }
.profile-actions { margin-left: auto; align-self: flex-start; display: flex; gap: 6px; flex-wrap: wrap; }
.profile-headline { margin-top: 14px; font-size: 16px; color: var(--muted); }
.meta-grid { margin-top: 22px; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px 24px; }
.meta-item dt { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 3px; font-weight: 600; }
.contact-box { margin-top: 24px; padding: 16px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.contact-box h2, .profile-bio h2 { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.contact-box ul { list-style: none; display: grid; gap: 5px; font-size: 14px; }
.profile-bio { margin-top: 26px; }
.profile-bio p + p { margin-top: 10px; }
.profile-page .tag-cloud { margin-top: 20px; }
.report-box { margin-top: 28px; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; background: var(--bg); }
.report-box summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.report-box form { margin-top: 12px; }

.auth-page { padding-block: 56px 80px; display: flex; justify-content: center; }
.form-card { width: min(460px, 100%); background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.form-card.wide-card { width: 100%; margin-top: 24px; }
.form-card h1 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 4px; }
.form-card h2 { font-size: 15px; font-weight: 600; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.field { margin-top: 16px; display: flex; flex-direction: column; gap: 5px; }
.field label, .field-label { font-size: 13px; font-weight: 500; }
input, select, textarea { font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 9px 12px; width: 100%; transition: border-color .12s ease; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,.08); }
input::placeholder, textarea::placeholder { color: #9ca3af; }
.hint { font-size: 12px; color: var(--muted); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-card .btn.primary { margin-top: 20px; }
.auth-switch { display: block; margin-top: 14px; font-size: 13.5px; text-align: center; }
.alert { margin-top: 14px; padding: 10px 14px; border-radius: 6px; font-size: 14px; }
.alert-error { background: var(--red-soft); color: var(--red); }
.alert-success { background: var(--green-soft); color: var(--green); }

.dash-page { padding-block: 36px 72px; max-width: 820px; }
.dash-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dash-head h1 { font-size: clamp(24px, 4vw, 30px); font-weight: 700; letter-spacing: -.02em; }
.dash-actions { margin-left: auto; display: flex; gap: 6px; }
.draft-note { margin-top: 14px; font-size: 13px; color: var(--amber); background: var(--amber-soft); border-radius: 6px; padding: 8px 14px; display: inline-block; }
.meter-block { margin-top: 14px; max-width: 320px; }
.meter { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.meter-fill { height: 100%; border-radius: 999px; background: var(--ink); transition: width .3s ease; }
.meter-block .hint { display: block; margin-top: 4px; }
.publish-row { margin-top: 24px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.checkbox { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.checkbox input { width: auto; accent-color: var(--ink); }
.publish-row .hint { display: block; margin-top: 3px; }
.save-row { margin-top: 20px; display: flex; gap: 8px; flex-wrap: wrap; }
.save-row .btn.primary { margin-top: 0; }
.photo-row { display: flex; align-items: center; gap: 14px; margin-top: 4px; }
.photo-btns { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.photo-btns input[type="file"] { max-width: 240px; padding: 6px 10px; font-size: 12px; background: var(--surface); }
.photo-btns .btn.link { color: var(--red); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.narrow-page { max-width: 720px; }
.inline-form { display: inline; }
.resend-row, .save-row-top { margin-top: 12px; }
.self-end { align-self: end; }
.danger-card { border-color: #fecaca; }

.stat-cards { margin-top: 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.stat-card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 1px; }
.stat-card b { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.stat-card span { color: var(--muted); font-size: 12px; }
.stat-alert { border-color: var(--red); }
.stat-alert b { color: var(--red); }
.admin-search { margin-top: 20px; max-width: 520px; }
.table-wrap { margin-top: 16px; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.admin-table { width: 100%; border-collapse: collapse; min-width: 860px; }
.admin-table th, .admin-table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 13.5px; vertical-align: middle; }
.admin-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface); font-weight: 600; }
.admin-table tbody tr:last-child td { border-bottom: none; }
.cell-email { color: var(--muted); }
.cell-actions { white-space: nowrap; }
.cell-actions form { display: inline-block; margin-right: 4px; margin-top: 2px; }
.cell-reason { max-width: 300px; white-space: pre-wrap; }
.cell-avatar img { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; display: block; }
.reports-section { margin-top: 28px; }
.reports-section h2 { font-size: 17px; font-weight: 600; margin-bottom: 12px; }
.reset-code { display: block; margin: 14px 0; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; word-break: break-all; font-size: 13px; color: var(--ink); }

.prose-page, .nf { padding-block: 48px 96px; max-width: 680px; }
.prose-page h1 { font-size: clamp(26px, 4vw, 34px); font-weight: 700; letter-spacing: -.02em; margin-bottom: 16px; }
.prose-page p + p { margin-top: 10px; }
.nf-code { font-size: 64px; font-weight: 700; color: var(--line); letter-spacing: -.04em; }
.nf h1 { font-size: 26px; font-weight: 700; margin-bottom: 6px; }
.nf p { color: var(--muted); margin-bottom: 20px; }

.site-footer { border-top: 1px solid var(--line); background: var(--bg); margin-top: 40px; }
.footer-inner { padding-block: 28px; display: flex; gap: 24px; flex-wrap: wrap; align-items: baseline; }
.foot-brand { font-weight: 700; font-size: 16px; }
.foot-tagline { font-size: 13px; color: var(--muted); margin-top: 2px; }
.foot-nav { display: flex; gap: 14px; margin-left: auto; font-size: 13.5px; }
.foot-nav a { color: var(--muted); }
.footer-inner small { width: 100%; color: var(--muted); margin-top: 8px; }

.lang-banner { display: flex; align-items: center; gap: 10px; justify-content: center; flex-wrap: wrap; padding: 8px 16px; background: var(--blue-soft); border-bottom: 1px solid #dbeafe; font-size: 13.5px; }
.lang-banner[hidden] { display: none; }

.vmark { display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; background: var(--green); color: #fff; font-size: 9px; font-weight: 700; vertical-align: 2px; margin-left: 5px; }
.hidden { display: none !important; }
.visually-hidden { position: absolute; clip: rect(0,0,0,0); width: 1px; height: 1px; }

/* ── Tablet: ≤768px ──────────────────────────────────── */
@media (max-width: 768px) {
  .container { width: calc(100% - 32px); }
  .header-inner { flex-wrap: wrap; padding-block: 10px; gap: 10px; }
  .brand { font-size: 15px; }
  .main-nav { order: 3; width: 100%; display: flex; gap: 0; border-top: 1px solid var(--line); padding-top: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .main-nav a { padding: 6px 14px; white-space: nowrap; font-size: 13.5px; }
  .header-side { gap: 6px; margin-left: auto; }
  .hero { padding-block: 40px 28px; }
  .hero h1 { font-size: 28px; }
  .lede { font-size: 15px; }
  .cta-row { flex-direction: column; gap: 8px; }
  .cta-row .btn { width: 100%; }
  .cards-grid { grid-template-columns: 1fr; gap: 10px; }
  .audiences { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
  .tab { white-space: nowrap; font-size: 13px; padding: 7px 14px; }
  .search-form { flex-direction: column; }
  .search-form input[type="search"] { width: 100%; }
  .search-form select { width: 100%; }
  .profile-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .profile-actions { margin-left: 0; margin-top: 8px; flex-wrap: wrap; }
  .meta-grid { grid-template-columns: 1fr 1fr; }
  .form-card { padding: 20px; }
  .form-card.wide-card { padding: 18px; }
  .row-2 { grid-template-columns: 1fr; }
  .auth-page { padding-block: 32px 60px; }
  .dash-head { flex-direction: column; align-items: flex-start; }
  .dash-actions { margin-left: 0; margin-top: 8px; }
  .dash-page { padding-block: 24px 56px; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .admin-table { min-width: 700px; }
  .admin-search { max-width: 100%; }
  .footer-inner { flex-direction: column; gap: 12px; }
  .foot-nav { margin-left: 0; flex-wrap: wrap; gap: 10px; }
}

/* ── Mobile: ≤480px ──────────────────────────────────── */
@media (max-width: 480px) {
  .container { width: calc(100% - 24px); }
  .hero h1 { font-size: 24px; }
  .lede { font-size: 14px; }
  .catalog-page > h1 { font-size: 22px; }
  .form-card { padding: 16px; }
  .form-card.wide-card { padding: 14px; }
  .profile-page { padding-block: 24px 60px; }
  .profile-header h1 { font-size: 22px; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat-card { padding: 10px 12px; }
  .stat-card b { font-size: 20px; }
  .faq-item { padding: 10px 14px; }
  .faq-item summary { font-size: 14px; }
  .prose-page, .nf { padding-block: 32px 60px; }
  .nf-code { font-size: 48px; }
  .nf h1 { font-size: 22px; }
  .how h2, .faq h2 { font-size: 20px; }
  .catalog-page > h1 { font-size: 20px; }
  .dash-head h1 { font-size: 22px; }
  .contact-box { padding: 12px 14px; }
  .contact-box ul { font-size: 13px; }
  .photo-row { flex-direction: column; align-items: flex-start; }
}

.field label::after { content: ""; }
.field label:has(+ [required])::after { content: " *"; color: var(--red); }
.hint[id$="Counter"] { text-align: right; margin-top: -2px; }
.photo-row { margin-block: 8px; }
.photo-btns { gap: 8px; }
.photo-btns input[type="file"]::file-selector-button {
  border: 1px solid var(--line); border-radius: 6px;
  padding: 6px 14px; background: var(--bg); color: var(--ink);
  cursor: pointer; font: inherit; font-size: 13px; margin-right: 10px;
}
.photo-btns input[type="file"]::file-selector-button:hover {
  background: var(--surface); border-color: var(--line-hover);
}
.publish-row .checkbox span { font-weight: 600; font-size: 14.5px; }
.save-row .btn.lg { padding: 11px 32px; }

.pc-views { font-size: 12px; color: var(--muted); }
