/* ==========================================================================
   OneMine — Broadsheet MVP stylesheet
   Derived from "OneMine Redesign v87-2 teal" design canvas: a scholarly
   journal aesthetic — ink on paper, hairline rules, pill controls.
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Newsreader:opsz,wght@6..72,300;6..72,400;6..72,500;6..72,600;6..72,700&family=IBM+Plex+Mono:wght@400;500&display=swap");

:root {
  /* Paper / ink */
  --paper: #e8e4d8;
  --card: #fdfcf7;
  --ink-900: #1a1a15;
  --ink-700: #33322a;
  --ink-600: #4a4941;
  --ink-500: #6b6960;
  --ink-400: #8a8678;

  /* Lines */
  --line: #d3cfc2;
  --line-soft: #e6e2d6;
  --line-strong: #c9c4b5;

  /* Surfaces */
  --surface-tint: #f3f0e7;
  --surface-chip: #eae6da;
  --surface-border: #e0dccf;

  /* Accent (teal) */
  --accent-500: #0e87ab;
  --accent-700: #0a6280;
  --accent-tint: #dbeff6;

  /* Semantic badges — shared across brands */
  --gold-fg: #7a5a12; --gold-bg: #f7ecd4;
  --purchase-fg: #175e3f; --purchase-bg: #e2efe7;
  --ai-fg: #4a3880; --ai-bg: #eeeaf8;
  --queued-fg: #55534a; --queued-bg: #eae6da;
  --review-fg: #7a5a12; --review-bg: #f6eddb;

  --font-serif: "Newsreader", Georgia, serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --shadow-sheet: 0 1px 2px rgba(26,26,21,0.10), 0 22px 50px rgba(26,26,21,0.14);
  --shadow-field: 0 1px 1px rgba(26,26,21,0.04), 0 4px 16px rgba(26,26,21,0.12), 0 0 0 1px rgba(26,26,21,0.05);
  --shadow-field-lg: 0 1px 1px rgba(26,26,21,0.05), 0 6px 22px rgba(26,26,21,0.13), 0 0 0 1px rgba(26,26,21,0.05);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  font-family: var(--font-serif);
  color: var(--ink-900);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: var(--accent-500); text-decoration: none; }
a:hover { color: var(--accent-700); text-decoration: underline; }
button { font-family: inherit; }
.label {
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-500);
}
.gray-photo { filter: grayscale(1) contrast(1.08); }

/* ---------- Sheet shell ---------- */
.sheet { max-width: 1280px; margin: 40px auto; background: var(--card); box-shadow: var(--shadow-sheet); }
.sheet-bar { height: 7px; background: var(--ink-900); }

/* ---------- Buttons / fields ---------- */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px; font-family: var(--font-serif); font-weight: 600;
  cursor: pointer; border: none; white-space: nowrap;
}
.pill-solid { background: var(--accent-500); color: var(--card); }
.pill-solid:hover { background: var(--accent-700); text-decoration: none; }
.pill-tint { background: var(--accent-tint); color: var(--accent-700); }
.pill-tint:hover { text-decoration: none; filter: brightness(0.97); }
.pill-outline { background: transparent; border: 1px solid var(--ink-900); color: var(--ink-900); }

.search-pill {
  display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 999px;
  box-shadow: var(--shadow-field);
}
.search-pill .icon { flex: none; display: inline-flex; font-size: 15px; color: var(--ink-400); }
.search-pill .icon svg { display: block; }
.search-pill input { flex: 1; min-width: 0; border: none; outline: none; background: none; font-family: var(--font-serif); color: var(--ink-900); }
.search-pill input::placeholder { color: var(--ink-500); }

/* ---------- Masthead (search/document/uploader header) ---------- */
.masthead {
  padding: 14px 56px; border-bottom: 1px solid var(--ink-900);
  display: flex; align-items: center; gap: 32px;
}
.masthead .brand-logo { height: 30px; display: block; flex: none; }
.masthead form.search-pill { flex: 1; padding: 5px 5px 5px 20px; box-shadow: var(--shadow-field); }
.masthead form.search-pill input { font-size: 17px; }
.masthead form.search-pill .pill-solid { font-size: 16px; padding: 10px 22px; }
.masthead .right {
  flex: none; display: flex; align-items: center; gap: 14px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-600);
}
.avatar-circle {
  display: flex; align-items: center; justify-content: center; width: 28px; height: 28px;
  background: var(--paper); border-radius: 50%; letter-spacing: 0; font-size: 11px; font-family: var(--font-mono);
}
.hamburger-mono { display: none; background: none; border: none; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-600); cursor: pointer; }

/* ---------- Home masthead ---------- */
.dateline {
  padding: 16px 56px 0; display: flex; align-items: baseline; justify-content: space-between;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-500);
}
.masthead-lockup { padding: 10px 56px 18px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.masthead-lockup img { height: 62px; display: block; }
.masthead-lockup .tagline { font-size: 18px; font-weight: 600; color: var(--ink-600); }

.nav-bar {
  border-top: 3px solid var(--ink-900); border-bottom: 1px solid var(--ink-900);
  padding: 11px 56px; display: flex; align-items: center; justify-content: space-between;
}
.nav-bar .links { display: flex; gap: 30px; font-size: 18px; font-weight: 600; }
.nav-bar .links a { color: var(--ink-900); }
.nav-bar .links a.active { color: var(--accent-500); border-bottom: 2px solid var(--accent-500); padding-bottom: 2px; }
.nav-bar .right { display: flex; align-items: center; gap: 26px; font-size: 18px; font-weight: 600; color: var(--ink-600); }
.nav-bar .right a { color: var(--ink-600); }
.nav-bar .login-pill { background: var(--accent-500); color: var(--card); border-radius: 999px; padding: 8px 22px; }
.mobile-menu-toggle { display: none; }
.mobile-menu-panel {
  display: none; flex-direction: column; border-bottom: 1px solid var(--ink-900); background: var(--card);
}
.mobile-menu-panel.open { display: flex; }
.mobile-menu-panel a, .mobile-menu-panel button {
  padding: 14px 20px; border-bottom: 1px solid var(--line-soft); font-size: 17px; color: var(--ink-900);
  background: none; border-left: none; border-right: none; border-top: none; text-align: left; font-family: var(--font-serif);
}

/* ---------- Hero (home) ---------- */
.hero-split { padding: 44px 56px 40px; display: grid; grid-template-columns: 1.15fr 1px 0.85fr; gap: 44px; }
.hero-split .divider { background: var(--line); }
.hero-eyebrow { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent-500); }
.hero-title { font-size: 68px; line-height: 1.02; font-weight: 600; letter-spacing: -0.02em; text-wrap: balance; margin: 0; }
.hero-title em { font-style: normal; color: var(--accent-500); }
.hero-sub { font-size: 20px; line-height: 1.55; color: var(--ink-700); max-width: 600px; }
.hero-search-block { margin-top: 8px; display: flex; flex-direction: column; gap: 12px; }
.hero-search-block .search-pill { padding: 9px 9px 9px 28px; box-shadow: var(--shadow-field-lg); }
.hero-search-block .search-pill .icon { font-size: 19px; }
.hero-search-block .search-pill input { font-size: 21px; }
.hero-search-block .search-pill .pill-solid { font-size: 19px; padding: 16px 34px; }
.field-tabs { display: flex; gap: 22px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-500); flex-wrap: wrap; }
.field-tabs .active { color: var(--ink-900); border-bottom: 1px solid var(--accent-500); padding-bottom: 2px; }

.stat-row { margin-top: 12px; display: flex; align-items: stretch; border-top: 1px solid var(--line); padding-top: 16px; }
.stat-row .stat { flex: 1; display: flex; flex-direction: column; gap: 3px; padding-left: 24px; }
.stat-row .stat:first-child { padding-left: 0; }
.stat-row .stat-divider { width: 1px; background: var(--line); }
.stat-row .stat .n { font-size: 30px; font-weight: 600; line-height: 1; }
.stat-row .stat .l { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-500); }

.hero-figure { display: flex; flex-direction: column; gap: 10px; }
.hero-figure img { width: 100%; height: 420px; object-fit: cover; display: block; }
.hero-figure .caption {
  display: flex; gap: 10px; font-family: var(--font-mono); font-size: 10px; line-height: 1.6;
  letter-spacing: 0.06em; color: var(--ink-500); border-bottom: 1px solid var(--line); padding-bottom: 10px;
}
.hero-figure .caption .tag { color: var(--accent-500); flex: none; }
.announcements { margin-top: 8px; display: flex; flex-direction: column; gap: 9px; }
.announcements .head { font-size: 18px; font-weight: 600; border-bottom: 1px solid var(--ink-900); padding-bottom: 7px; }
.announcements .item { display: flex; gap: 12px; border-top: 1px solid var(--line-soft); padding-top: 9px; }
.announcements .item:first-of-type { border-top: none; padding-top: 0; }
.announcements .date { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; color: var(--accent-500); flex: none; padding-top: 4px; }
.announcements .text { font-size: 16px; line-height: 1.45; color: var(--ink-700); }

/* ---------- Sections ---------- */
.section-rule { border-top: 1px solid var(--ink-900); border-bottom: 1px solid var(--ink-900); padding: 34px 56px; }
.section-rule.tinted { background: var(--surface-tint); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 22px; gap: 12px; flex-wrap: wrap; }
.section-head .title { font-size: 20px; font-weight: 600; }
.section-head .more { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-500); }

.subject-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.subject-card {
  background: var(--surface-tint); border: 1px solid var(--surface-border); border-radius: 10px;
  padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; text-align: left; cursor: pointer; font-family: inherit;
}
.subject-card svg { display: block; color: var(--accent-500); }
.subject-card .name { font-size: 21px; line-height: 1.25; font-weight: 600; text-wrap: pretty; color: var(--ink-900); }
.subject-card .count { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-500); }

.news-grid { display: grid; grid-template-columns: 1fr 1px 1fr 1px 1fr; gap: 28px; }
.news-grid .divider { background: var(--line); }
.news-card { display: flex; flex-direction: column; gap: 11px; }
.news-card img { width: 100%; height: 150px; object-fit: cover; display: block; }
.news-card .kicker { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-500); }
.news-card h3 { font-size: 25px; line-height: 1.18; font-weight: 600; text-wrap: pretty; margin: 0; }
.news-card p { font-size: 16px; line-height: 1.55; color: var(--ink-600); margin: 0; text-wrap: pretty; }

.ad-slot { padding: 46px 56px 50px; display: flex; flex-direction: column; align-items: center; gap: 16px; border-bottom: 1px solid var(--ink-900); }
.ad-slot .label { letter-spacing: 0.2em; }

.societies-section { padding: 64px 56px 80px; }
.societies-section .title { font-size: 20px; font-weight: 600; margin-bottom: 44px; }
.society-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 64px 72px; padding: 0 24px; }
.society-tile { height: 78px; display: flex; align-items: center; justify-content: center; }
.society-tile img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink-900); color: #e8e4d8; padding: 34px 56px 30px; display: flex; flex-direction: column; gap: 22px; }
.site-footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 36px; }
.site-footer .brand-col { display: flex; flex-direction: column; align-items: flex-start; gap: 9px; }
.site-footer .brand-col img { height: 36px; width: auto; align-self: flex-start; flex: none; }
.site-footer .brand-col p { font-size: 15px; line-height: 1.6; color: #b7b3a6; margin: 0; }
.site-footer .col { display: flex; flex-direction: column; gap: 8px; }
.site-footer .col .head { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: #8a887d; }
.site-footer .col span, .site-footer .col a { font-size: 15px; color: #e8e4d8; }
.site-footer .bottom {
  border-top: 1px solid #3a3a30; padding-top: 16px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: #8a887d;
}

/* ---------- Breadcrumb ---------- */
.breadcrumb-strip {
  padding: 11px 56px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-500);
}
.breadcrumb-strip a { color: var(--accent-500); }

/* ---------- Search layout ---------- */
.search-layout { padding: 26px 56px 44px; display: grid; grid-template-columns: 250px 1px 1fr; gap: 36px; align-items: start; }
.search-layout .col-divider { background: var(--line); align-self: stretch; }
.facet-rail { display: flex; flex-direction: column; gap: 22px; }
.facet-rail-head { font-size: 18px; font-weight: 600; border-bottom: 2px solid var(--ink-900); padding-bottom: 8px; }
.facet-group { display: flex; flex-direction: column; gap: 9px; border-top: 1px solid var(--line); padding-top: 18px; }
.facet-group:first-of-type { border-top: none; padding-top: 0; }
.facet-group-title { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-500); }
.facet-option {
  display: flex; align-items: baseline; gap: 9px; font-size: 16px; font-family: var(--font-serif); color: var(--ink-900);
  background: none; border: none; padding: 0; cursor: pointer; text-align: left; width: 100%;
}
.facet-option .box { width: 13px; height: 13px; flex: none; border: 1px solid var(--ink-400); background: none; }
.facet-option.checked .box { background: var(--accent-500); border-color: var(--accent-500); }
.facet-option .name { flex: 1; }
.facet-option .count { font-family: var(--font-mono); font-size: 11px; color: var(--ink-500); }
.facet-more { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-500); background: none; border: none; cursor: pointer; padding: 0; text-align: left; }

.year-bars { display: flex; align-items: flex-end; gap: 3px; height: 44px; }
.year-bars span { flex: 1; background: var(--line-strong); display: block; }
.year-bars span.lit { background: var(--accent-500); }
.year-range-labels { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 10px; color: var(--ink-500); }

.results-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.results-summary {
  display: flex; align-items: baseline; justify-content: space-between; border-bottom: 2px solid var(--ink-900);
  padding-bottom: 10px; gap: 12px; flex-wrap: wrap;
}
.results-summary .count { font-size: 17px; color: var(--ink-700); }
.results-summary .count b { font-weight: 600; }
.sort-row { display: flex; gap: 20px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-500); }
.sort-row button { background: none; border: none; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-500); cursor: pointer; padding-bottom: 2px; border-bottom: 1px solid transparent; }
.sort-row button.active { color: var(--ink-900); border-bottom-color: var(--accent-500); }

.filtered-by { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-600); }
.filtered-by .lead { color: var(--ink-500); }
.filtered-by .tag { border-bottom: 1px solid var(--accent-500); padding-bottom: 2px; color: var(--ink-900); background: none; border-left: none; border-right: none; border-top: none; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer; }
.filtered-by .clear { color: var(--accent-500); background: none; border: none; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer; padding: 0; }

.result-row { display: flex; gap: 20px; padding: 20px 0; border-top: 1px solid var(--line); }
.result-row:last-of-type { border-bottom: 1px solid var(--line); }
.result-index { flex: none; width: 34px; font-family: var(--font-mono); font-size: 13px; color: var(--accent-500); padding-top: 6px; }
.result-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.result-title { font-size: 27px; line-height: 1.2; font-weight: 600; text-wrap: pretty; color: var(--ink-900); }
.result-title a { color: inherit; }
.result-byline { font-size: 17px; color: var(--ink-700); }
.result-snippet { font-size: 17px; line-height: 1.55; color: var(--ink-600); }
.result-meta { display: flex; gap: 16px; margin-top: 3px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-500); flex-wrap: wrap; }
.result-meta .soc { color: var(--accent-500); }
.result-actions { flex: none; width: 152px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; text-align: right; }
.result-actions .pill { width: 100%; padding: 9px 17px; font-size: 16px; }
.result-actions .links { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-500); }
.no-results { padding: 60px 0; text-align: center; color: var(--ink-500); font-size: 18px; }

.badge-pill { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; border-radius: 999px; padding: 5px 11px; display: inline-block; }
.badge-gold { color: var(--gold-fg); background: var(--gold-bg); }
.badge-purchase { color: var(--purchase-fg); background: var(--purchase-bg); }
.badge-ai { color: var(--ai-fg); background: var(--ai-bg); }
.badge-review { color: var(--review-fg); background: var(--review-bg); }
.badge-queued { color: var(--queued-fg); background: var(--queued-bg); }
.badge-ready { color: var(--accent-700); background: var(--accent-tint); }

.pagination { display: flex; align-items: center; justify-content: space-between; padding-top: 6px; flex-wrap: wrap; gap: 10px; }
.pagination .status { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-500); }
.pagination .pages { display: flex; gap: 16px; font-family: var(--font-mono); font-size: 12px; color: var(--ink-600); }
.pagination .pages .current { color: var(--ink-900); border-bottom: 1px solid var(--accent-500); }
.pagination .pages .next { color: var(--accent-500); }

.filter-toggle-btn { display: none; }

/* ---------- Document detail ---------- */
.doc-hero {
  padding: 52px 56px 26px; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center;
  border-bottom: 1px solid var(--ink-900);
}
.doc-hero .kicker { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent-500); }
.doc-hero .title { font-size: 52px; line-height: 1.1; font-weight: 600; max-width: 1000px; letter-spacing: -0.015em; text-wrap: balance; margin: 0; }
.doc-hero .authors { font-size: 21px; color: var(--ink-700); }
.doc-hero .affil { font-size: 17px; color: var(--ink-500); }

.doc-layout { padding: 34px 56px 48px; display: grid; grid-template-columns: 1fr 1px 320px; gap: 40px; align-items: start; }
.doc-layout .col-divider { background: var(--line); align-self: stretch; }
.doc-main { min-width: 0; display: flex; flex-direction: column; gap: 30px; }
.doc-block-title { font-size: 18px; font-weight: 600; border-bottom: 1px solid var(--ink-900); padding-bottom: 8px; }
.doc-abstract { font-size: 20px; line-height: 1.68; color: var(--ink-700); text-wrap: pretty; }
.topic-tags { display: flex; gap: 10px; flex-wrap: wrap; font-size: 16px; }
.topic-tags a { border-bottom: 1px solid var(--accent-500); color: var(--accent-500); }
.topic-tags .sep { color: var(--line-strong); }

.pages-preview { display: flex; gap: 16px; flex-wrap: wrap; }
.page-thumb { display: flex; flex-direction: column; gap: 7px; }
.page-thumb .img { width: 150px; height: 194px; border: 1px solid var(--line); background: repeating-linear-gradient(0deg, var(--surface-tint) 0 3px, var(--card) 3px 9px); }
.page-thumb .cap { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-500); }
.page-thumb-more {
  display: flex; flex-direction: column; gap: 7px; justify-content: center; align-items: center;
  width: 96px; height: 194px; border: 1px dashed var(--line-strong); font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-500); text-align: center;
}

.related-row { display: flex; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); color: inherit; }
.related-row:last-child { border-bottom: none; }
.related-row .idx { flex: none; width: 26px; font-family: var(--font-mono); font-size: 12px; color: var(--accent-500); padding-top: 4px; }
.related-row .title { font-size: 20px; line-height: 1.3; font-weight: 600; color: var(--ink-900); }
.related-row .meta { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-500); }

.access-card { display: flex; flex-direction: column; gap: 12px; border: 1px solid var(--ink-900); padding: 20px; }
.access-card .kicker { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-500); }
.access-card .meta { font-size: 17px; color: var(--ink-600); }
.access-card .actions { display: flex; flex-direction: column; gap: 9px; margin-top: 2px; }
.access-card .actions .pill { padding: 14px; font-size: 19px; }
.access-card .links { display: flex; gap: 14px; justify-content: center; margin-top: 4px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; }
.access-card .links button { background: none; border: none; color: var(--accent-500); cursor: pointer; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; padding: 0; }
.access-card .links .sep { color: var(--line-strong); }

.dotted-row { display: flex; align-items: baseline; font-size: 16px; }
.dotted-row .k { color: var(--ink-500); }
.dotted-row .fill { flex: 1; border-bottom: 1px dotted var(--line-strong); margin: 0 8px; transform: translateY(-5px); }
.dotted-row .v { font-family: var(--font-mono); font-size: 13px; }
.record-block { display: flex; flex-direction: column; gap: 10px; }

.cite-box { font-size: 15px; line-height: 1.6; color: var(--ink-700); background: var(--surface-tint); padding: 14px; border-left: 2px solid var(--accent-500); }

/* ---------- Login ---------- */
.login-shell { max-width: 1000px; }
.login-lockup { padding: 26px 48px 20px; display: flex; flex-direction: column; align-items: center; gap: 6px; border-bottom: 3px solid var(--ink-900); }
.login-lockup img { height: 42px; display: block; }
.login-lockup .tagline { font-size: 16px; font-weight: 600; color: var(--ink-600); }
.login-layout { display: grid; grid-template-columns: 1fr 1px 0.85fr; gap: 40px; padding: 40px 48px 46px; align-items: start; }
.login-layout .col-divider { background: var(--line); align-self: stretch; }
.login-form-col { display: flex; flex-direction: column; gap: 20px; }
.login-form-col h1 { font-size: 38px; line-height: 1.1; font-weight: 600; letter-spacing: -0.015em; margin: 0; }
.login-form-col .sub { font-size: 17px; line-height: 1.55; color: var(--ink-600); }
.form-field { display: flex; flex-direction: column; gap: 7px; }
.form-field input {
  display: flex; align-items: center; background: #fff; box-shadow: var(--shadow-field); border-radius: 999px;
  height: 52px; padding: 0 24px; font-size: 18px; color: var(--ink-900); border: none; outline: none; font-family: var(--font-serif);
}
.form-row-between { display: flex; align-items: center; justify-content: space-between; padding-top: 2px; flex-wrap: wrap; gap: 8px; }
.check-inline { display: flex; align-items: center; gap: 10px; font-size: 16px; color: var(--ink-700); cursor: pointer; }
.check-inline input { width: 14px; height: 14px; accent-color: var(--accent-500); }
.link-mono { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-500); background: none; border: none; cursor: pointer; padding: 0; }
.or-divider { display: flex; align-items: center; gap: 14px; margin: 6px 0; }
.or-divider .line { flex: 1; height: 1px; background: var(--line); }
.or-divider .word { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-400); }
.membership-col { display: flex; flex-direction: column; gap: 16px; }
.membership-col .callout { margin-top: 8px; background: var(--surface-tint); border-left: 2px solid var(--accent-500); padding: 16px; font-size: 16px; line-height: 1.6; color: var(--ink-700); }

/* ---------- Uploader / partner portal ---------- */
.portal-masthead { padding: 14px 56px; border-bottom: 1px solid var(--ink-900); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.portal-masthead .left { display: flex; align-items: center; gap: 16px; }
.portal-tag { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-700); background: var(--paper); border-radius: 999px; padding: 6px 13px; }
.portal-body { padding: 34px 56px 44px; display: grid; grid-template-columns: 1fr 1px 300px; gap: 40px; align-items: start; }
.portal-body .col-divider { background: var(--line); align-self: stretch; }
.portal-main { min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.portal-main h1 { font-size: 44px; line-height: 1.1; font-weight: 600; letter-spacing: -0.015em; margin: 0; }
.portal-main .sub { font-size: 19px; color: var(--ink-600); }

.dropzone {
  border: 1.5px dashed var(--ink-400); border-radius: 14px; padding: 36px; display: flex; flex-direction: column;
  align-items: center; gap: 9px; background: var(--surface-tint); cursor: pointer;
}
.dropzone.drag { border-color: var(--accent-500); background: var(--accent-tint); }
.dropzone .glyph { font-size: 24px; color: var(--accent-500); }
.dropzone h3 { font-size: 22px; font-weight: 600; margin: 0; }
.dropzone p { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-500); margin: 0; }

.defaults-block { display: flex; flex-direction: column; gap: 14px; }
.defaults-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 20px; }
.defaults-field { display: flex; flex-direction: column; gap: 7px; }
.defaults-field .value {
  display: flex; align-items: center; justify-content: space-between; background: #fff; box-shadow: var(--shadow-field);
  border-radius: 999px; height: 46px; padding: 0 22px; font-size: 17px; overflow: hidden; white-space: nowrap;
}
.defaults-field .value.locked { background: var(--surface-chip); box-shadow: none; }

.batch-block { display: flex; flex-direction: column; }
.batch-head-row { display: flex; align-items: center; justify-content: space-between; border-bottom: 2px solid var(--ink-900); padding-bottom: 9px; flex-wrap: wrap; gap: 8px; }
.batch-head-row .title { font-size: 18px; font-weight: 600; }
.batch-head-row .actions { display: flex; gap: 16px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-500); }
.batch-head-row .actions button { background: none; border: none; color: var(--accent-500); font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; cursor: pointer; padding: 0; }
.batch-row { display: flex; align-items: center; gap: 18px; padding: 15px 0; border-top: 1px solid var(--surface-border); overflow-x: auto; }
.batch-idx { flex: none; width: 22px; font-family: var(--font-mono); font-size: 12px; color: var(--accent-500); }
.batch-check { flex: none; width: 14px; height: 14px; border: 1px solid var(--ink-400); }
.batch-check.checked { background: var(--accent-500); border-color: var(--accent-500); }
.batch-file { flex: none; width: 104px; font-family: var(--font-mono); font-size: 11px; color: var(--ink-500); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.batch-title-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.batch-title-col .t { font-size: 16px; color: var(--ink-900); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.batch-title-col .t.ai { border-bottom: 1px dashed #a48fd0; padding-bottom: 1px; display: inline-block; }
.batch-title-col .a { font-size: 14px; color: var(--ink-500); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.batch-date { flex: none; width: 104px; font-family: var(--font-mono); font-size: 12px; color: var(--ink-900); }
.batch-status-col { flex: none; width: 112px; display: flex; justify-content: flex-end; }
.batch-foot { display: flex; align-items: center; justify-content: space-between; gap: 24px; border-top: 2px solid var(--ink-900); padding-top: 18px; margin-top: 4px; flex-wrap: wrap; }
.batch-foot .summary { font-size: 16px; color: var(--ink-600); }
.batch-foot .summary b { color: var(--ink-900); font-weight: 600; }
.batch-foot .actions { display: flex; gap: 12px; }
.batch-foot .actions .pill { padding: 13px 24px; font-size: 18px; }

.portal-aside { display: flex; flex-direction: column; gap: 26px; }
.recent-batch-item { display: flex; flex-direction: column; gap: 3px; border-top: 1px solid var(--surface-border); padding-top: 11px; }
.recent-batch-item:first-of-type { border-top: none; padding-top: 0; }
.recent-batch-item .name { font-size: 19px; font-weight: 600; }
.recent-batch-item .meta { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-500); }
.recent-batch-item .meta.active { color: var(--accent-500); }

/* ---------- Mobile filter sheet ---------- */
.sheet-overlay { position: fixed; inset: 0; background: rgba(26,26,21,0.45); z-index: 90; display: none; }
.sheet-overlay.open { display: block; }
.filter-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; max-height: 84vh; background: var(--card);
  border-top: 3px solid var(--ink-900); display: flex; flex-direction: column; z-index: 91;
  transform: translateY(100%); transition: transform 0.22s ease;
}
.filter-sheet.open { transform: translateY(0); }
.filter-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 12px; border-bottom: 1px solid var(--ink-900); }
.filter-sheet-head .t { font-size: 26px; font-weight: 600; }
.filter-sheet-head .clear { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-500); background: none; border: none; cursor: pointer; }
.filter-sheet-body { flex: 1; overflow-y: auto; }
.sheet-sort-block { padding: 16px 18px 12px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--line); }
.sheet-sort-options { display: flex; gap: 8px; }
.sheet-sort-options button { flex: 1; text-align: center; background: var(--surface-chip); color: var(--ink-900); font-size: 17px; font-weight: 600; padding: 12px 0; border-radius: 999px; border: none; font-family: var(--font-serif); }
.sheet-sort-options button.active { background: var(--accent-500); color: var(--card); }
.sheet-group-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; border-bottom: 1px solid var(--line); background: none; width: 100%; border-left: none; border-right: none; border-top: none; font-size: 19px; font-weight: 600; text-align: left; font-family: var(--font-serif); color: var(--ink-900); }
.sheet-group-head.expanded { background: var(--surface-tint); }
.sheet-count-pill { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--card); background: var(--accent-500); border-radius: 999px; padding: 3px 9px; }
.sheet-option-row { display: flex; align-items: baseline; gap: 11px; padding: 8px 18px; font-size: 17px; }
.sheet-option-row .box { width: 14px; height: 14px; flex: none; border: 1px solid var(--ink-400); }
.sheet-option-row.checked .box { background: var(--accent-500); border-color: var(--accent-500); }
.filter-sheet-foot { padding: 14px 18px 20px; border-top: 2px solid var(--ink-900); }
.filter-sheet-foot .pill { width: 100%; padding: 16px; font-size: 18px; }

/* ---------- Modal / login popup (reused for header login trigger, unused for full login page) ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(26,26,21,0.5); z-index: 100; display: none; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal-card { width: 420px; max-width: calc(100vw - 40px); background: var(--card); box-shadow: var(--shadow-sheet); padding: 0; position: relative; max-height: 90vh; overflow-y: auto; }
.modal-close { position: absolute; top: 16px; right: 20px; background: none; border: none; color: var(--ink-500); font-size: 20px; cursor: pointer; z-index: 2; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: var(--ink-900); color: var(--paper); font-size: 15px; padding: 13px 22px; border-radius: 999px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.25); z-index: 200; opacity: 0; pointer-events: none; transition: all 0.2s ease;
  max-width: calc(100vw - 40px); text-align: center; font-family: var(--font-serif);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1080px) {
  .sheet { margin: 0 auto; max-width: 100%; }
  .dateline, .masthead-lockup, .nav-bar, .hero-split, .section-rule, .ad-slot, .societies-section,
  .site-footer, .breadcrumb-strip, .masthead, .portal-masthead, .portal-body, .doc-hero, .doc-layout,
  .search-layout, .login-lockup, .login-layout { padding-left: 32px; padding-right: 32px; }
  .subject-grid { grid-template-columns: repeat(2, 1fr); }
  .news-grid { grid-template-columns: 1fr; gap: 24px; }
  .news-grid .divider { display: none; }
  .society-grid { grid-template-columns: repeat(3, 1fr); gap: 40px; }
  .hero-split { grid-template-columns: 1fr; }
  .hero-split .divider { display: none; }
  .hero-title { font-size: 48px; }
  .nav-bar .links { display: none; }
  .mobile-menu-toggle { display: inline-flex; }
  .facet-rail { display: none; }
  .filter-toggle-btn { display: inline-flex; }
  .search-layout { grid-template-columns: 1fr; }
  .search-layout .col-divider { display: none; }
  .doc-layout { grid-template-columns: 1fr; }
  .doc-layout .col-divider { display: none; }
  .pages-preview { display: none; }
  .login-layout { grid-template-columns: 1fr; }
  .login-layout .col-divider { display: none; }
  .portal-body { grid-template-columns: 1fr; }
  .portal-body .col-divider { display: none; }
  .site-footer .cols { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px) {
  .dateline, .masthead-lockup, .nav-bar, .hero-split, .section-rule, .ad-slot, .societies-section,
  .site-footer, .breadcrumb-strip, .masthead, .portal-masthead, .portal-body, .doc-hero, .doc-layout,
  .search-layout, .login-lockup, .login-layout { padding-left: 18px; padding-right: 18px; }
  .dateline span:nth-child(2) { display: none; }
  .masthead-lockup img { height: 44px; }
  .hero-title { font-size: 32px; }
  .hero-sub { display: none; }
  .stat-row .l { font-size: 9px; }
  .subject-grid { grid-template-columns: 1fr 1fr; }
  .society-grid { grid-template-columns: repeat(2, 1fr); gap: 28px; }
  .site-footer .cols { grid-template-columns: 1fr; gap: 22px; }
  .doc-hero .title { font-size: 32px; }
  .result-row { flex-wrap: wrap; }
  .result-index { display: none; }
  .result-actions { width: 100%; flex-direction: row; align-items: center; justify-content: space-between; text-align: left; }
  .result-actions .pill { width: auto; }
  .masthead form.search-pill { padding: 4px 4px 4px 14px; }
  .masthead form.search-pill input { font-size: 15px; }
  .portal-main h1 { font-size: 32px; }
  .defaults-grid { grid-template-columns: 1fr; }
  .batch-foot { flex-direction: column; align-items: stretch; }
  .batch-foot .actions .pill { flex: 1; }
}
