/* ═══════════════════════════════════════════════════════════════
   ARCHIVE LAYOUT — shared by the content category pages.
   Three columns, after Google's 2012 results page:
   content types | search + results | most recent.
   Markup is generated by archive.js into #archiveApp.
   ═══════════════════════════════════════════════════════════════ */

.arc {
  max-width: 1320px;
  margin: 0 auto;
  padding: 2.2rem clamp(1.25rem, 4vw, 3rem) 4.5rem;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 320px;
  grid-template-rows: auto auto 1fr;
  column-gap: 2.75rem;
  grid-template-areas:
    "side   tools   tools"
    "side   adv     adv"
    "side   results panel";
  align-items: start;
}

/* ── header: title with its description beneath, then scoped search ── */
/* title and description sit at the top of the left column, so the
   description is never wider than that column */
.arc-head { margin-bottom: 2.2rem; }
.arc-title {
  font-family: var(--serif);
  font-size: 2.3rem;
  font-weight: 500;
  line-height: 1.1;
  color: var(--forest);
}
.arc-search {
  flex: 1 1 280px;
  min-width: 0;
  display: flex;
  border: 1px solid var(--rule);
  background: #fff;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.arc-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 2px 10px rgba(26, 25, 22, 0.06);
}
.arc-search input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  padding: 0.5rem 0.85rem;
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--ink);
}
.arc-search input::placeholder { color: var(--ink-3); opacity: 0.8; }
.arc-search input::-webkit-search-cancel-button { cursor: pointer; }
.arc-search-btn {
  flex-shrink: 0;
  width: 2.8rem;
  border: none;
  background: var(--accent);
  color: var(--parchment);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s;
}
.arc-search-btn:hover { background: var(--accent-l); }
.arc-desc {
  margin-top: 0.55rem;
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--ink-2);
}

/* ── tools row: count, filters, sort, view ── */
.arc-tools {
  grid-area: tools;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 0 0 1.6rem;
  padding: 0.7rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.arc-controls { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.arc-facets { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }

.arc-dd { position: relative; }
.arc-dd-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--sans);
  font-size: 0.66rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.38rem 0.6rem;
  cursor: pointer;
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color 0.18s, color 0.18s;
}
.arc-dd-btn:hover { border-color: var(--ink-3); color: var(--ink); }
.arc-dd.is-set .arc-dd-btn { color: var(--accent); border-color: var(--accent); background: rgba(43, 71, 54, 0.05); }
.arc-dd-chevron { width: 10px; height: 10px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2.4; transition: transform 0.18s; }
.arc-dd.open .arc-dd-chevron { transform: rotate(180deg); }
.arc-dd-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 25;
  min-width: 200px;
  max-width: 300px;
  max-height: 340px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--rule);
  box-shadow: 0 12px 28px rgba(26, 25, 22, 0.12);
  padding: 0.35rem 0;
}
.arc-dd.open .arc-dd-menu { display: block; }
.arc-dd-opt {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-left: 2px solid transparent;
  padding: 0.45rem 0.9rem;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 300;
  color: var(--ink);
  cursor: pointer;
}
.arc-dd-opt:hover { background: var(--paper); color: var(--terracotta); }
.arc-dd-opt.selected { border-left-color: var(--terracotta); font-weight: 500; }
.arc-dd-n { font-size: 0.7rem; color: var(--ink-3); }

.arc-clear {
  background: none;
  border: none;
  font-family: var(--sans);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--terracotta);
  cursor: pointer;
  padding: 0.38rem 0.3rem;
}
.arc-clear:hover { text-decoration: underline; }

.arc-view-toggle { display: flex; border: 1px solid var(--rule); border-radius: 2px; overflow: hidden; }
.arc-view-toggle button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 1.85rem;
  background: none;
  border: none;
  color: var(--ink-3);
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}
.arc-view-toggle button + button { border-left: 1px solid var(--rule); }
.arc-view-toggle button:hover { color: var(--ink); }
.arc-view-toggle button.active { background: var(--accent); color: var(--parchment); }
.arc-view-toggle svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.7; }

/* ── advanced search: the filter dropdowns, hidden until asked for ── */
.arc-adv-toggle {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: none;
  padding: 0.38rem 0.2rem;
  font-family: var(--sans);
  font-size: 0.66rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  cursor: pointer;
  white-space: nowrap;
}
.arc-adv-toggle:hover { color: var(--terracotta); }
.arc-adv-toggle.open .arc-dd-chevron { transform: rotate(180deg); }
.arc-adv-toggle.is-set::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--terracotta);
}
.arc-advanced {
  grid-area: adv;
  margin: -0.8rem 0 1.4rem;   /* tucked just under the toolbar row */
}
.arc-advanced[hidden] { display: none; }
.arc-advanced .arc-dd-menu { right: auto; left: 0; }

/* ── paging, Google Careers-style: "5–8 of 45" with arrows ── */
.arc-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.4rem;
}
.arc-pager-range { margin-right: 0.6rem; font-size: 0.82rem; color: var(--ink-2); }
.arc-pager-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: none;
  color: var(--accent);
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
}
.arc-pager-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.arc-pager-btn:hover:not(:disabled) { background: var(--paper-2); border-color: var(--accent); }
.arc-pager-btn:disabled { color: var(--ink-3); opacity: 0.4; cursor: default; }

/* ── "search all of Phronesis" link under a category search ── */
.arc-expand {
  margin-top: 1.4rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
}
.arc-expand-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.95rem;
  color: var(--accent);
  cursor: pointer;
  text-align: left;
}
.arc-expand-btn:hover { color: var(--terracotta); text-decoration: underline; text-underline-offset: 3px; }

/* ── left rail: other content types ── */
.arc-side { grid-area: side; min-width: 0; align-self: stretch; }
/* stretched to the full height of the page body so this block can stay
   in view while the results and Recently added column scroll past */
.arc-sticky { position: sticky; top: 1.5rem; }
.arc-rail-label { padding-left: 0.85rem; margin-bottom: 0.4rem; }
.arc-rail ul { list-style: none; }
.arc-rail a {
  display: block;
  padding: 0.4rem 0 0.4rem 0.85rem;
  border-left: 3px solid transparent;
  font-size: 0.85rem;
  color: var(--ink-2);
  transition: color 0.18s;
}
.arc-rail a:hover { color: var(--terracotta); }
.arc-rail a.active { color: var(--terracotta); font-weight: 500; border-left-color: var(--terracotta); }
.arc-rail-divider { height: 1px; background: var(--rule); margin: 0.9rem 0 0.9rem 0.85rem; }
.arc-rail-divider--top { margin: 0.1rem 0 0.6rem 0.85rem; }

/* ── results: list view ── */
.arc-results { grid-area: results; min-width: 0; }
/* Google-style load time; shares its height with the "Recently added"
   heading so results and the spotlit box start on the same line */
.arc-stats,
.arc-panel > .arc-panel-label:first-child {
  height: 1rem;
  line-height: 1rem;
  margin: 0 0 0.9rem;
}
.arc-stats { font-size: 0.8rem; color: var(--ink-3); }
.arc-list { max-width: 660px; }
.arc-result { padding-bottom: 1.6rem; }
.arc-result-title {
  font-family: var(--serif);
  font-size: 1.28rem;
  font-weight: 500;
  line-height: 1.25;
  color: var(--forest);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.18s, color 0.18s;
}
a.arc-result-title:hover { color: var(--terracotta); text-decoration-color: currentColor; }
.arc-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.1rem 0;
  margin-top: 0.25rem;
  font-size: 0.74rem;
  color: var(--ink-3);
}
.arc-pub { color: var(--accent-l); }
.arc-sep { margin: 0 0.45rem; opacity: 0.6; }
.arc-badge {
  margin-left: 0.6rem;
  font-size: 0.56rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--terracotta);
  border: 1px solid var(--terracotta);
  border-radius: 2px;
  padding: 0.05rem 0.35rem;
}
.arc-snippet { margin-top: 0.3rem; font-size: 0.86rem; line-height: 1.58; color: var(--ink-2); }
.arc-snippet b, .arc-card-text b, .arc-result-title b, .arc-card-title b { font-weight: 600; color: var(--ink); }
.arc-result-title b, .arc-card-title b { color: inherit; }

.arc-tags { display: flex; flex-wrap: wrap; gap: 0.2rem 0.9rem; margin-top: 0.35rem; }
.arc-tag {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 300;
  color: var(--accent);
  cursor: pointer;
}
.arc-tag::before { content: '\21B3\00A0'; color: var(--ink-3); }
.arc-tag:hover { color: var(--terracotta); text-decoration: underline; }

/* summaries that link to their item: block-level, same look as plain text */
.arc-body-link { display: block; color: var(--ink-2); cursor: pointer; }
.arc-body-link:hover { color: var(--ink); }
.arc-result:has(.arc-body-link:hover) .arc-result-title,
.arc-card:has(.arc-body-link:hover) .arc-card-title,
.arc-spot:has(.arc-body-link:hover) .arc-spot-title { color: var(--terracotta); }

/* ── results: card view ── */
.arc-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
.arc-card { background: var(--paper); padding: 1.4rem 1.3rem; display: flex; flex-direction: column; transition: background 0.18s; }
.arc-card:hover { background: #fff; }
.arc-card-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.8rem; }
.arc-chip {
  font-size: 0.56rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-3);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.1rem 0.4rem;
}
.arc-chip--accent { color: var(--accent); border-color: var(--accent); }
.arc-card-title {
  font-family: var(--serif);
  font-size: 1.12rem;
  font-weight: 500;
  line-height: 1.28;
  color: var(--ink);
  margin-bottom: 0.55rem;
}
a.arc-card-title:hover { color: var(--terracotta); }
.arc-card-text { font-size: 0.78rem; line-height: 1.55; color: var(--ink-2); margin-bottom: 1rem; flex-grow: 1; }
.arc-card-foot {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 0.7rem;
  border-top: 1px solid var(--rule);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.arc-card-foot > span:first-child { white-space: nowrap; flex-shrink: 0; }
.arc-card-src { text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.arc-more {
  display: block;
  margin: 0.5rem 0 0;
  background: none;
  border: 1px solid var(--rule);
  padding: 0.6rem 1.2rem;
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  cursor: pointer;
}
.arc-cards + .arc-more { margin-top: 1.4rem; }
.arc-more:hover { border-color: var(--accent); }
.arc-empty { padding: 1rem 0 2rem; font-family: var(--serif); font-size: 1.05rem; color: var(--ink-3); }
.arc-empty .arc-clear { margin-top: 0.6rem; padding-left: 0; }

/* ── right panel: newest item spotlit, ten more as cards ── */
.arc-panel { grid-area: panel; min-width: 0; }
.arc-panel:empty { display: none; }
.arc-panel-label {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 0.7rem;
}
.arc-spot + .arc-mini-grid { margin-top: 1rem; }

.arc-spot {
  background: #fff;
  border: 1px solid var(--rule);
  border-top: 3px solid var(--terracotta);
  padding: 1.3rem 1.3rem 1.2rem;
}
.arc-spot-title {
  display: block;
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--ink);
}
a.arc-spot-title:hover { color: var(--terracotta); }
.arc-spot-text { margin-top: 0.55rem; font-size: 0.8rem; line-height: 1.55; color: var(--ink-2); }

.arc-mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
.arc-mini {
  position: relative;
  background: var(--paper);
  padding: 0.85rem 0.8rem 0.8rem;
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: background 0.18s;
}
.arc-mini:hover { background: #fff; }
.arc-mini-kicker {
  font-size: 0.54rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.35rem;
}
.arc-mini-title {
  font-family: var(--serif);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.25;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.5rem;
}
a.arc-mini-title::after { content: ''; position: absolute; inset: 0; }  /* whole card clickable */
.arc-mini:hover a.arc-mini-title { color: var(--terracotta); }
.arc-mini-meta { margin-top: auto; font-size: 0.64rem; color: var(--ink-3); }
.arc-mini-src {
  font-size: 0.64rem;
  color: var(--accent-l);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── tech & AI bills: auto-scrolling list, pauses on hover or focus ── */
.arc-bills {
  --arc-bill-h: 3.7rem;   /* compact rows: badge line + one-line title */
  margin-top: 1.4rem;
  border: 1px solid var(--accent);
  border-radius: 3px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(26, 25, 22, 0.06);
  overflow: hidden;
}
.arc-bills-head {
  padding: 0.55rem 0.8rem;
  background: var(--accent);
  color: var(--parchment);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
/* three bills fit in the window at once: each row has a fixed height and
   the title is clamped to one line (the full title shows on hover).
   The window scrolls on its own (archive.js) and by hand. */
.arc-bills-window {
  height: calc(3 * var(--arc-bill-h));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
  position: relative;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 0.6rem, #000 calc(100% - 0.6rem), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 0.6rem, #000 calc(100% - 0.6rem), transparent 100%);
}
.arc-bills-window::-webkit-scrollbar { width: 5px; }
.arc-bills-window::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 3px; }
.arc-bills-track { list-style: none; }
.arc-bill {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  box-sizing: border-box;
  height: var(--arc-bill-h);
  overflow: hidden;
  padding: 0.55rem 0.8rem;
  border-bottom: 1px dashed var(--rule);
}
.arc-bill-top { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.arc-bill:hover .arc-bill-title { color: var(--terracotta); }
.arc-bill-badge {
  flex-shrink: 0;
  width: 2.1rem;
  padding: 0.12rem 0;
  text-align: center;
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--parchment);
  background: var(--accent);
  border-radius: 2px;
}
.arc-bill-title {
  font-family: var(--serif);
  font-size: 0.92rem;
  line-height: 1.25;
  color: var(--ink);
  transition: color 0.18s;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.arc-bill-status { font-size: 0.64rem; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arc-bills-src { padding: 0.5rem 0.8rem; border-top: 1px solid var(--rule); font-size: 0.62rem; color: var(--ink-3); }
.arc-bills-src a { color: var(--accent-l); text-decoration: underline; text-underline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .arc-bills-track li[aria-hidden="true"] { display: none; }
}

/* ── essay reader ── */
.arc-reader {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(26, 25, 22, 0.45);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.arc-reader.open { display: flex; align-items: center; justify-content: center; }
.arc-reader-panel {
  background: var(--paper);
  border: 1px solid var(--rule);
  width: min(90vw, 760px);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 48px rgba(26, 25, 22, 0.18);
}
.arc-reader-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.6rem;
  border-bottom: 1px solid var(--rule);
  background: var(--paper-2);
  flex-shrink: 0;
}
.arc-reader-label { font-size: 0.6rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.arc-reader-close {
  font-family: var(--sans);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: none;
  border: 1px solid var(--accent);
  border-radius: 2px;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
}
.arc-reader-close:hover { background: var(--accent); color: var(--parchment); }
.arc-reader-scroll { overflow-y: auto; flex: 1; }
.arc-reader-body {
  padding: 2.5rem 3rem 3rem;
  font-family: var(--serif);
  font-size: 1.08rem;
  font-weight: 300;
  line-height: 1.85;
  color: var(--ink-2);
}
.arc-reader-body h1, .arc-reader-body h2, .arc-reader-body h3 {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--ink);
  margin: 2rem 0 0.8rem;
  line-height: 1.2;
}
.arc-reader-body h1 { font-size: 1.8rem; margin-top: 0; }
.arc-reader-body h2 { font-size: 1.35rem; }
.arc-reader-body h3 { font-size: 1.1rem; }
.arc-reader-body p { margin-bottom: 1.2rem; }
.arc-reader-body figure { margin: 2rem 0; text-align: center; }
.arc-reader-body img { max-width: 100%; height: auto; border-radius: 4px; }
.arc-reader-body figcaption { font-family: var(--sans); font-size: 0.78rem; color: var(--ink-3); font-style: italic; margin-top: 0.6rem; }
.arc-reader-body blockquote { border-left: 3px solid var(--accent); margin: 1.5rem 0; padding-left: 1.2rem; font-style: italic; }
.arc-reader-body ul, .arc-reader-body ol { margin: 1rem 0; padding-left: 1.5rem; }
.arc-reader-body li { margin-bottom: 0.4rem; }
.arc-reader-body a { color: var(--accent); text-decoration: underline; }
.arc-reader-byline { font-style: italic; color: var(--ink-3); }

/* ── narrower screens ── */
@media (max-width: 1100px) {
  .arc { grid-template-columns: 150px minmax(0, 1fr) 270px; column-gap: 2rem; }
}
@media (max-width: 900px) {
  .arc {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    grid-template-areas: "head" "rail" "tools" "adv" "results" "panel" "bills";
    padding-top: 1.6rem;
  }
  .arc-head { grid-area: head; margin-bottom: 1.1rem; }
  .arc-title { font-size: 1.8rem; }
  .arc-rail-label { display: none; }
  .arc-side, .arc-sticky { display: contents; }
  .arc-bills { grid-area: bills; }
  .arc-rail {
    grid-area: rail;
    position: static;
    padding-top: 0;
    margin-top: 0;
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    border-bottom: 1px solid var(--rule);
  }
  .arc-rail::-webkit-scrollbar { display: none; }
  .arc-rail ul { display: flex; flex-shrink: 0; }
  .arc-rail a {
    white-space: nowrap;
    padding: 0.55rem 0.8rem;
    border-left: none;
    border-bottom: 3px solid transparent;
    font-size: 0.8rem;
  }
  .arc-rail a.active { border-bottom-color: var(--terracotta); }
  .arc-rail-divider { display: none; }
  .arc-tools { border-top: none; }
  .arc-search { order: -1; flex-basis: 100%; }
  .arc-panel { margin-top: 2rem; }
}
@media (max-width: 600px) {
  .arc-reader-panel { width: 100vw; max-height: 100vh; height: 100vh; }
  .arc-reader-body { padding: 1.5rem; }
}
@media (max-width: 520px) {
  .arc-dd-menu { right: auto; left: 0; }
  /* search on its own line, then Advanced search + Sort with the view
     toggle beside them, so the filters open right under the button */
  .arc-tools { gap: 0.7rem 0.5rem; }
  .arc-controls { gap: 0.4rem; }
  .arc-adv-toggle, .arc-dd-btn { letter-spacing: 0.06em; }
  .arc-view-toggle { margin-left: auto; }
}
/* phones: the advanced-search filters share one row;
   long labels (a chosen publisher, say) are cut off with "…" rather than
   wrapping, and the last two menus open leftward so they stay on screen */
@media (max-width: 600px) {
  .arc-facets {
    flex-wrap: nowrap;
    gap: 0.3rem;
    width: 100%;
  }
  /* each filter starts at its natural width and gives up space in
     proportion to it, so short labels like YEAR stay whole */
  .arc-facets > .arc-dd { flex: 1 1 auto; min-width: 0; }
  .arc-facets > .arc-clear { flex: 0 0 auto; }
  .arc-facets .arc-dd-btn {
    width: 100%;
    max-width: none;
    justify-content: center;
    gap: 0.2rem;
    padding: 0.4rem 0.3rem;
    font-size: 0.58rem;
    letter-spacing: 0.02em;
  }
  .arc-dd-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .arc-facets .arc-dd-chevron { width: 8px; height: 8px; }
  .arc-facets .arc-dd-menu { left: 0; right: auto; }
  .arc-facets .arc-dd:nth-last-of-type(-n+2) .arc-dd-menu { left: auto; right: 0; }
  .arc-facets .arc-clear { padding: 0.4rem 0; font-size: 0.58rem; }
}
/* small phones: tighten the toolbar so the view toggle stays beside Sort */
@media (max-width: 400px) {
  .arc-controls { gap: 0.25rem; }
  .arc-adv-toggle, .arc-dd-btn { font-size: 0.6rem; letter-spacing: 0.04em; }
  .arc-adv-toggle { padding-left: 0; padding-right: 0.1rem; }
  .arc-dd-btn { padding: 0.38rem 0.45rem; }
  .arc-view-toggle button { width: 1.8rem; }
}
