:root {
  --ink: #171814;
  --ink-soft: #3f423c;
  --paper: #f5f6f2;
  --paper-deep: #e9ebe5;
  --white: #ffffff;
  --line: #cdd1c8;
  --green: #087a55;
  --green-deep: #07503b;
  --burgundy: #7f2938;
  --gold: #d2a84b;
  --serif: "Iowan Old Style", "Baskerville", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --sans: "Aptos", "Helvetica Neue", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(135deg, transparent 0 72%, rgba(8, 122, 85, 0.055) 72% 72.25%, transparent 72.25%),
    linear-gradient(rgba(23, 24, 20, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 24, 20, 0.026) 1px, transparent 1px);
  background-size: 100% 100%, 36px 36px, 36px 36px;
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(14, 89, 67, 0.3);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.tab {
  padding: 8px 0;
  color: var(--ink);
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  cursor: pointer;
}

.tab:hover,
.tab.active {
  border-bottom-color: var(--ink);
}

main {
  flex: 1;
}

.search-stage {
  width: min(820px, 91vw);
  min-height: 100vh;
  margin: 0 auto;
  padding: 80px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: stage-in 700ms ease-out both;
}

.search-stage.compact {
  width: min(1180px, 91vw);
  min-height: auto;
  padding: 22px 0;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  justify-content: flex-start;
  border-bottom: 1px solid var(--line);
}

.home-brand {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  color: var(--ink);
  text-decoration: none;
}

.home-brand img {
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
}

.home-brand span {
  font-family: var(--serif);
  font-size: 72px;
  line-height: 1;
}

.search-modes {
  margin-top: 30px;
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.5);
}

.mode-button {
  min-height: 34px;
  padding: 0 14px;
  color: var(--ink-soft);
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 11px;
}

.mode-button:hover,
.mode-button.active {
  color: var(--white);
  background: var(--ink);
}

.search-stage.compact .search-modes {
  margin-top: 0;
}

.search-stage.compact .home-brand {
  gap: 10px;
}

.search-stage.compact .home-brand img {
  width: 42px;
  height: 42px;
}

.search-stage.compact .home-brand span {
  font-size: 30px;
}

.eyebrow {
  margin: 0 0 15px;
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  text-wrap: pretty;
}

h1 {
  max-width: 840px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(48px, 6.8vw, 92px);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: 0;
}

.lede {
  max-width: 660px;
  margin: 28px 0 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.55;
}

.search-form {
  width: 100%;
  max-width: 780px;
  margin-top: 20px;
}

.search-disclosure {
  width: 100%;
  max-width: 780px;
  margin: 11px 0 0;
  color: #73786f;
  font-size: 10px;
  line-height: 1.45;
  text-align: center;
}

.private-import,
.monitor-home {
  width: 100%;
  max-width: 780px;
  margin-top: 14px;
  padding-top: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #666b62;
  border-top: 1px solid var(--line);
  font-size: 11px;
}

.file-button {
  min-height: 34px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  color: var(--white);
  background: var(--green-deep);
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
}

.monitor-home {
  display: block;
}

.monitor-home p {
  margin: 0 0 10px;
}

#monitor-home-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

#monitor-home-list button {
  min-height: 30px;
  padding: 0 10px;
  color: var(--ink);
  border: 1px solid var(--line);
  background: var(--white);
  cursor: pointer;
}

.search-stage.compact .private-import,
.search-stage.compact .monitor-home {
  max-width: none;
  grid-column: 2 / 4;
  margin-top: -10px;
}

.search-stage.compact .search-disclosure {
  grid-column: 3;
  margin-top: -18px;
  text-align: left;
}

.search-box {
  min-height: 70px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 40px auto;
  align-items: center;
  gap: 16px;
  padding: 8px 8px 8px 24px;
  border: 1px solid #9da49a;
  border-bottom: 3px solid var(--gold);
  background: var(--white);
  box-shadow: 0 18px 55px rgba(23, 24, 20, 0.13);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.search-box:focus-within {
  border-color: var(--green);
  box-shadow: 0 16px 45px rgba(23, 24, 20, 0.12);
}

.search-glyph {
  width: 17px;
  height: 17px;
  border: 1.8px solid var(--ink);
  border-radius: 50%;
  position: relative;
}

.search-glyph::after {
  content: "";
  width: 8px;
  height: 1.8px;
  background: var(--ink);
  position: absolute;
  right: -6px;
  bottom: -3px;
  transform: rotate(45deg);
  transform-origin: left center;
}

.search-box input {
  width: 100%;
  min-width: 0;
  padding: 0;
  color: var(--ink);
  border: 0;
  outline: 0;
  background: transparent;
  font-family: var(--serif);
  font-size: 19px;
}

.search-box input::placeholder {
  color: #757a71;
  opacity: 1;
}

.search-box input::-webkit-search-cancel-button {
  display: none;
  -webkit-appearance: none;
}

.search-button,
.secondary-button {
  min-height: 52px;
  padding: 0 28px;
  color: var(--white);
  border: 1px solid var(--green-deep);
  border-radius: 0;
  background: var(--green-deep);
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
  transition: background 160ms ease, transform 160ms ease;
}

.search-button:hover,
.secondary-button:hover {
  background: var(--green);
}

.search-button:active,
.secondary-button:active {
  transform: translateY(1px);
}

.clear-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--ink-soft);
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  font-size: 25px;
  line-height: 1;
  visibility: hidden;
}

.clear-button.visible {
  visibility: visible;
}

.clear-button:hover {
  background: var(--paper-deep);
}

.search-stage.compact .search-form {
  margin-top: 0;
  max-width: none;
}

.search-stage.compact .search-box {
  min-height: 62px;
  box-shadow: none;
}

.results-view {
  width: min(1280px, 92vw);
  margin: 0 auto;
  padding: 46px 0 80px;
  animation: results-in 420ms ease-out both;
}

.results-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
}

.result-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.sort-control {
  height: 38px;
  padding: 0 11px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #6d7269;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
  font-size: 11px;
}

.sort-control select {
  color: var(--ink);
  border: 0;
  outline: 0;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
}

.utility-button,
.copy-button {
  min-height: 38px;
  padding: 0 14px;
  color: var(--ink);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  font-size: 12px;
}

.utility-button:hover,
.copy-button:hover {
  color: var(--white);
  border-color: var(--ink);
  background: var(--ink);
}

.utility-button:disabled {
  color: #9ca198;
  background: transparent;
  cursor: not-allowed;
}

.results-toolbar h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 400;
}

.view-tabs {
  display: flex;
  gap: 28px;
}

.tab {
  color: var(--ink-soft);
  font-size: 13px;
}

.tab.active {
  color: var(--ink);
  font-weight: 700;
}

.results-meta {
  margin-top: 18px;
  padding: 13px 0;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: #656a61;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  text-transform: uppercase;
}

.source-bar {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}

.source-bar::-webkit-scrollbar,
.research-paths::-webkit-scrollbar {
  display: none;
}

.source-filters {
  min-width: max-content;
  display: flex;
  gap: 8px;
}

.source-filter {
  min-height: 38px;
  padding: 0 12px;
  color: var(--ink-soft);
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
}

.source-filter:hover,
.source-filter.active {
  color: var(--green-deep);
  border-bottom-color: var(--green-deep);
  background: rgba(8, 122, 85, 0.06);
}

.source-filter:disabled {
  color: #a1a59e;
  cursor: not-allowed;
}

.image-filter {
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.research-paths {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 18px 0 2px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.research-paths > span {
  margin-right: 4px;
  color: #6d7269;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

.research-paths button {
  min-height: 32px;
  padding: 0 12px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  font-size: 11px;
  white-space: nowrap;
}

.research-paths button:hover {
  border-color: var(--green);
  color: var(--green);
}

.advanced-panel {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.advanced-panel summary {
  padding: 13px 2px;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.advanced-grid {
  padding: 4px 0 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.advanced-grid label:not(.check-filter) {
  display: grid;
  gap: 6px;
}

.advanced-grid label > span {
  color: #6f746b;
  font-size: 10px;
  text-transform: uppercase;
}

.advanced-grid input[type="date"],
.advanced-grid select {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  color: var(--ink);
  border: 1px solid var(--line);
  background: var(--white);
  font-size: 12px;
}

.check-filter {
  min-height: 38px;
  align-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}

.check-filter span {
  text-transform: none !important;
}

.database-panel {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.database-panel summary {
  padding: 14px 2px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  color: var(--ink);
  cursor: pointer;
  font-family: var(--serif);
  font-size: 14px;
}

.database-panel summary small {
  color: #747970;
  font-family: var(--sans);
  font-size: 10px;
}

.database-dock {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-top: 1px solid var(--ink);
}

.database-dock a {
  min-width: 0;
  padding: 15px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--ink);
  border-right: 1px solid var(--line);
  text-decoration: none;
  transition: color 160ms ease, background 160ms ease;
}

.database-dock a:last-child {
  border-right: 0;
}

.database-dock a:hover {
  color: var(--white);
  background: var(--ink);
}

.database-dock strong {
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 400;
  white-space: nowrap;
}

.database-dock span {
  color: #70756c;
  font-size: 10px;
  text-transform: uppercase;
}

.database-dock a:hover span {
  color: #c8cec4;
}

.results-layout {
  min-width: 0;
  margin-top: 30px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 370px;
  gap: clamp(40px, 5vw, 70px);
  align-items: start;
}

.results-list,
.result-item {
  min-width: 0;
  max-width: 100%;
}

.result-item {
  padding: 0 0 25px;
  margin-bottom: 25px;
  border-bottom: 1px solid var(--line);
  animation: item-in 420ms ease-out both;
}

.result-source {
  margin: 0;
  color: var(--green);
  font-size: 12px;
  font-weight: 650;
}

.result-source-row {
  margin-bottom: 9px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.access-label {
  margin-left: auto;
  padding: 4px 7px;
  color: #61665e;
  border: 1px solid var(--line);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.access-label.private {
  color: #5d3f79;
  border-color: #aa96bb;
  background: #f4f0f7;
}

.source-mark {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: var(--white);
  background: var(--green);
  font-family: var(--serif);
  font-size: 11px;
}

.result-item[data-source="sec"] .source-mark { background: var(--burgundy); }
.result-item[data-source="private"] .source-mark { background: #5d3f79; }
.result-item[data-source="market"] .source-mark { background: #156a72; }
.result-item[data-source="federal"] .source-mark { background: #315a85; }
.result-item[data-source="spending"] .source-mark { background: #8a641c; }
.result-item[data-source="tax"] .source-mark { background: #6b4b86; }
.result-item[data-source="fec"] .source-mark { background: #a33b48; }

.result-item[data-source="sec"] .result-source {
  color: var(--burgundy);
}

.result-item[data-source="private"] .result-source {
  color: #5d3f79;
}

.result-item[data-source="market"] .result-source {
  color: #156a72;
}

.result-item[data-source="federal"] .result-source {
  color: #315a85;
}

.result-item[data-source="spending"] .result-source {
  color: #8a641c;
}

.result-item[data-source="tax"] .result-source {
  color: #6b4b86;
}

.result-item[data-source="fec"] .result-source {
  color: #a33b48;
}

.result-item h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(22px, 2.2vw, 28px);
  font-weight: 400;
  line-height: 1.15;
}

.result-item h3 a {
  color: var(--ink);
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  transition: color 160ms ease, text-decoration-color 160ms ease;
}

.result-item h3 a:hover {
  color: var(--green);
  text-decoration-color: var(--green);
}

.result-item p {
  max-width: 760px;
  margin: 13px 0 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.58;
}

.result-link {
  width: 100%;
  display: inline-block;
  max-width: 100%;
  margin-top: 13px;
  color: #70756c;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

.result-record-meta {
  display: block;
  margin-top: 13px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 650;
}

.result-tools {
  margin-top: 14px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

.why-result summary,
.record-action {
  min-height: 30px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  font-size: 10px;
}

.record-action:hover,
.why-result summary:hover {
  color: var(--green);
  border-color: var(--green);
}

.why-result[open] p {
  width: min(460px, 75vw);
  margin: 7px 0 0;
  padding: 12px;
  color: var(--ink-soft);
  border-left: 2px solid var(--green);
  background: var(--paper-deep);
  font-family: var(--sans);
  font-size: 11px;
  line-height: 1.5;
}

.filtered-empty {
  padding: 42px 0;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-family: var(--serif);
}

.research-memo {
  padding: 26px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--ink);
  background: rgba(255, 255, 255, 0.72);
  position: sticky;
  top: 24px;
}

.memo-heading {
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.memo-heading .eyebrow {
  margin-bottom: 7px;
}

.copy-button {
  min-height: 30px;
  padding: 0 10px;
  flex: 0 0 auto;
  font-size: 10px;
}

.research-memo h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 400;
}

.summary-section {
  padding: 17px 0;
  border-top: 1px solid var(--line);
}

.summary-section:first-child {
  border-top-color: var(--ink);
}

.summary-section h4 {
  margin: 0 0 7px;
  color: var(--green);
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.summary-section p {
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.55;
}

.summary-citation {
  display: inline-block;
  margin-top: 8px;
  color: var(--green);
  font-size: 10px;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.summary-coverage {
  padding-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  border-top: 1px solid var(--line);
}

.summary-coverage span {
  padding: 7px 8px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 10px;
}

.memo-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  margin-bottom: 22px;
  object-fit: cover;
  background: var(--paper-deep);
}

.memo-monogram {
  width: 100%;
  aspect-ratio: 4 / 3;
  margin-bottom: 22px;
  display: grid;
  place-items: center;
  color: var(--paper);
  background: var(--green-deep);
  font-family: var(--serif);
  font-size: 80px;
}

.memo-summary {
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.62;
}

.memo-source {
  margin: 22px 0 0;
  padding-top: 15px;
  color: #6f746b;
  border-top: 1px solid var(--line);
  font-size: 11px;
  line-height: 1.5;
}

.visual-grid {
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 20px;
}

.visual-item {
  color: var(--ink);
  text-decoration: none;
  animation: item-in 420ms ease-out both;
}

.visual-frame {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--paper-deep);
}

.visual-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  filter: saturate(0.82) contrast(1.04);
  transition: transform 350ms ease, filter 350ms ease;
}

.visual-item:hover img {
  transform: scale(1.025);
  filter: saturate(1) contrast(1);
}

.visual-item h3 {
  margin: 13px 0 0;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 400;
  line-height: 1.25;
}

.loading-state {
  max-width: 760px;
  margin-top: 44px;
}

.loading-line {
  height: 14px;
  margin-bottom: 18px;
  background: linear-gradient(90deg, var(--paper-deep) 0%, #dfe2da 50%, var(--paper-deep) 100%);
  background-size: 200% 100%;
  animation: loading 1.2s linear infinite;
}

.loading-line.long {
  width: 100%;
  height: 26px;
  margin-top: 38px;
}

.loading-line.medium {
  width: 78%;
}

.loading-line.short {
  width: 52%;
}

.error-state,
.empty-state {
  max-width: 620px;
  margin: 64px 0;
}

.error-state h3,
.empty-state h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 400;
}

.error-state > p:not(.eyebrow),
.empty-state p {
  color: var(--ink-soft);
  font-family: var(--serif);
  line-height: 1.6;
}

.secondary-button {
  margin-top: 12px;
}

.workspace-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: min(820px, calc(100vh - 32px));
  padding: 0;
  color: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
}

.workspace-dialog::backdrop {
  background: rgba(15, 17, 13, 0.6);
  backdrop-filter: blur(4px);
}

.workspace-header {
  padding: 26px 30px 22px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.workspace-header h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 400;
}

.workspace-close {
  width: 36px;
  height: 36px;
  color: var(--ink);
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 25px;
}

.workspace-section {
  padding: 22px 30px 6px;
}

.workspace-section h3 {
  margin: 0 0 10px;
  font-size: 11px;
  text-transform: uppercase;
}

.workspace-item {
  padding: 12px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
}

.workspace-item > div:first-child {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.workspace-item strong,
.workspace-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-item span,
.workspace-empty,
.workspace-note {
  color: #6f746b;
  font-size: 10px;
}

.workspace-item > div:last-child {
  display: flex;
  gap: 6px;
}

.workspace-item button {
  min-height: 28px;
  padding: 0 9px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  font-size: 10px;
}

.workspace-empty {
  margin: 0;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.workspace-note {
  margin: 18px 30px 26px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  line-height: 1.5;
}


[hidden] {
  display: none !important;
}

@keyframes stage-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes results-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes item-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes loading {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

@media (max-width: 820px) {
  .search-stage {
    padding-top: 68px;
  }

  .search-stage.compact {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
  }

  .search-stage.compact .home-brand {
    grid-column: 1;
    grid-row: 1;
  }

  .search-stage.compact .search-form {
    grid-column: 2;
    grid-row: 1;
  }

  .search-stage.compact .search-modes {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: start;
  }

  .search-stage.compact .private-import,
  .search-stage.compact .monitor-home {
    grid-column: 1 / -1;
    grid-row: 4;
    margin-top: 0;
  }

  .search-stage.compact .search-disclosure {
    grid-column: 1 / -1;
    grid-row: 3;
    margin-top: 0;
    text-align: left;
  }

  .advanced-grid {
    grid-template-columns: 1fr 1fr;
  }

  .results-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .research-memo {
    position: static;
    order: -1;
  }

  .visual-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .database-dock {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .database-dock a {
    border-bottom: 1px solid var(--line);
  }

  .database-dock a:nth-child(even) {
    border-right: 0;
  }
}

@media (max-width: 560px) {
  .search-stage,
  .results-view {
    width: calc(100vw - 32px);
  }

  .search-stage {
    min-height: calc(100vh - 124px);
    padding: 52px 0 38px;
  }

  .search-modes {
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .search-modes::-webkit-scrollbar {
    display: none;
  }

  .mode-button {
    flex: 1 0 auto;
    padding: 0 11px;
  }

  .private-import {
    align-items: flex-start;
    flex-direction: column;
  }

  .search-form {
    margin-top: 32px;
  }

  .search-box {
    min-height: 60px;
    grid-template-columns: 20px minmax(0, 1fr) 32px;
    gap: 10px;
    padding: 8px 12px 8px 18px;
  }

  .search-box input {
    font-size: 16px;
  }

  .search-button {
    grid-column: 1 / 4;
    width: calc(100% + 30px);
    margin: 0 -12px -8px -18px;
  }

  .search-stage.compact {
    min-height: auto;
    padding: 24px 0 20px;
  }

  .search-stage.compact .search-button {
    display: none;
  }

  .search-stage.compact .search-box {
    grid-template-columns: 20px minmax(0, 1fr) 32px;
  }

  .results-view {
    padding-top: 32px;
  }

  .results-toolbar {
    display: block;
  }

  .result-actions {
    margin-top: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .result-actions .sort-control {
    grid-column: 1 / -1;
  }

  .sort-control,
  .sort-control select {
    min-width: 0;
  }

  .sort-control select {
    width: 100%;
  }

  .results-toolbar h2 {
    font-size: 32px;
  }

  .results-meta span:last-child {
    display: none;
  }

  .database-panel summary {
    display: block;
  }

  .database-panel summary small {
    display: block;
    margin-top: 5px;
    line-height: 1.4;
  }

  .advanced-grid {
    grid-template-columns: 1fr;
  }

  .check-filter {
    align-self: start;
  }

  .research-memo {
    display: block;
    padding: 22px;
  }

  .memo-image,
  .memo-monogram {
    margin-bottom: 20px;
  }

  .visual-grid {
    grid-template-columns: 1fr;
  }

  .database-dock {
    grid-template-columns: 1fr 1fr;
  }

  .database-dock a,
  .database-dock a:nth-child(3) {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .database-dock a:nth-child(even) {
    border-right: 0;
  }

  .database-dock a:last-child {
    border-bottom: 0;
  }

  .workspace-header,
  .workspace-section {
    padding-left: 20px;
    padding-right: 20px;
  }

  .workspace-item {
    display: block;
  }

  .workspace-item > div:last-child {
    margin-top: 10px;
  }

  .workspace-note {
    margin-left: 20px;
    margin-right: 20px;
  }

}

@media print {
  body {
    background: white;
  }

  .search-stage,
  .result-actions,
  .source-bar,
  .research-paths,
  .database-panel,
  .visual-grid {
    display: none !important;
  }

  .results-view {
    width: 100%;
    padding: 0;
  }

  .results-layout {
    grid-template-columns: 1fr;
  }

  .research-memo {
    position: static;
    order: -1;
    break-inside: avoid;
  }

  .result-item {
    break-inside: avoid;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}