:root {
  --bg: #f3f0e8;
  --panel: #ffffff;
  --ink: #132033;
  --muted: #5f6b7a;
  --line: #d9d0c1;
  --accent: #0087A9;
  --accent-strong: #006b86;
  --accent-soft: rgba(0, 135, 169, 0.12);
  --shadow: 0 20px 50px rgba(12, 28, 41, 0.08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--ink);
  background: #f5f7fa;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

.shell {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
}

.page-frame {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-content {
  flex: 1;
  width: 100%;
}

.landing-page .page-content {
  flex: 0;
}

.login-page .page-content {
  flex: 1;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
  background: #ffffff;
  border-bottom: 1px solid rgba(16, 24, 40, 0.08);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
  width: 100%;
}

.site-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.landing-page .site-header-inner,
.results-page .site-header-inner,
.content-page .site-header-inner {
  padding: 0 28px;
}

.brand {
  display: inline-flex;
  gap: 14px;
  align-items: baseline;
  padding: 20px 0;
  flex-shrink: 0;
  margin-right: auto;
  text-align: left;
}

.site-footer {
  padding: 20px 0 28px;
}

.site-footer .shell {
  text-align: center;
}

.site-footer p {
  margin: 0;
  color: #8a94a3;
  font-size: 12px;
  line-height: 1.6;
}

.brand-kicker,
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 12px;
  color: #0087A9;
}

.hero,
.product-header,
.doc-section,
.results,
.bulk-actions {
  margin: 28px 0;
}

.landing-center {
  min-height: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 18vh 0 0;
}

.landing-center .hero {
  width: min(92vw, 860px);
  margin: 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  transition: box-shadow 160ms ease;
}

.landing-page .site-footer {
  padding-top: 32px;
}

.login-page .site-footer {
  padding-top: 32px;
}

.landing-page .hero:hover {
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.08);
}

.hero,
.product-header,
.doc-section,
.results,
.login-card {
  background: var(--panel);
  border: 1px solid rgba(16, 24, 40, 0.06);
  border-radius: 18px;
  box-shadow: 0 12px 32px rgba(16, 24, 40, 0.08);
}

.hero,
.results,
.doc-section,
.login-card {
  padding: 28px;
}

.login-shell {
  min-height: calc(100vh - 220px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 0 0;
}

.login-card {
  width: min(92vw, 420px);
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.password-field {
  position: relative;
}

.field {
  display: grid;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
}

.field span {
  font-weight: 600;
}

.field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 15px;
  background: #fff;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.password-field input {
  padding-right: 78px;
}

.field input:focus {
  outline: none;
  border-color: #0087A9;
  box-shadow: 0 0 0 3px rgba(0, 135, 169, 0.15);
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 8px;
  box-shadow: none;
}

.password-toggle:hover {
  background: rgba(0, 135, 169, 0.06);
  box-shadow: none;
  transform: translateY(-50%);
}

.header-logout {
  white-space: nowrap;
}

.login-error {
  margin-top: 18px;
  border: 1px solid rgba(183, 29, 24, 0.14);
  background: rgba(183, 29, 24, 0.06);
  color: #b42318;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
}

.accordion-section {
  padding: 0;
  overflow: hidden;
  transition: border-color 220ms ease, box-shadow 220ms ease;
}

.product-header {
  padding: 28px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
}

h1,
h2 {
  margin: 0;
}

.hero h1 {
  margin-top: 0;
  max-width: 14ch;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 0.96;
}

.hero .eyebrow {
  margin: 0 0 14px;
}

.hero-copy {
  color: var(--muted);
  max-width: 60ch;
}

.search-form {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.header-search {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
  justify-content: flex-end;
}

.header-search input {
  width: clamp(240px, 26vw, 340px);
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  background: #fff;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.header-search input::placeholder {
  color: #94A3B8;
}

.header-search input:focus {
  outline: none;
  border-color: #0087A9;
  box-shadow: 0 0 0 3px rgba(0, 135, 169, 0.15);
}

.header-search button {
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1;
  background: #FF8300;
}

.header-search button:hover {
  background: #e87500;
}

.combobox {
  position: relative;
  flex: 1;
  min-width: 0;
}

.input-hint {
  position: absolute;
  top: 16px;
  right: 16px;
  color: #8a94a3;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  pointer-events: none;
}

.search-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 92px 16px 18px;
  font-size: 16px;
  background: #fff;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.search-form input::placeholder {
  color: #94A3B8;
}

.search-form input:focus {
  outline: none;
  border-color: #0087A9;
  box-shadow: 0 0 0 3px rgba(0, 135, 169, 0.15);
}

button,
.button {
  border: none;
  border-radius: 14px;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 700;
  background: var(--accent);
  color: white;
  cursor: pointer;
  transition: background-color 200ms ease, border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease, color 200ms ease;
}

button:hover,
.button:hover {
  background: var(--accent-strong);
  box-shadow: 0 8px 18px rgba(0, 107, 134, 0.16);
  transform: translateY(-1px);
}

.search-form > button {
  background: #FF8300;
}

.search-form > button:hover {
  background: #e87500;
}

.copy-link-inline {
  border: none;
  background: transparent;
  padding: 0;
  font: inherit;
  cursor: pointer;
  color: var(--accent-strong);
  transition: color 180ms ease, opacity 180ms ease;
  box-shadow: none;
  transform: none;
}

.file-link {
  color: var(--ink);
  text-decoration: none;
  transition: color 180ms ease;
}

.file-link:hover {
  color: var(--accent-strong);
}

.button.secondary {
  background: transparent;
  color: var(--accent-strong);
  border: 1px solid rgba(0, 135, 169, 0.32);
}

.button.secondary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #ffffff;
}

.button.secondary.copy-link-button:hover,
.button.secondary.copy-link-button:focus-visible {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff;
  box-shadow: 0 8px 18px rgba(0, 107, 134, 0.18);
}

.button-small {
  padding: 10px 14px;
  font-size: 14px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 18px;
}

.accordion-header {
  margin: 0;
  padding: 22px 28px;
  align-items: center;
  cursor: pointer;
  list-style: none;
  transition: background-color 200ms ease;
}

.accordion-header::-webkit-details-marker {
  display: none;
}

.accordion-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.accordion-title h2 {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.2;
}

.accordion-title::before {
  content: "";
  display: inline-flex;
  width: 10px;
  height: 10px;
  align-items: center;
  justify-content: center;
  border-right: 2px solid var(--accent-strong);
  border-bottom: 2px solid var(--accent-strong);
  transform: rotate(-45deg);
  transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1);
  margin-left: 4px;
}

.accordion-section.is-open .accordion-title::before,
.accordion-section[open] .accordion-title::before {
  transform: rotate(45deg);
}

.accordion-body {
  height: 0;
  opacity: 0;
  overflow: hidden;
  border-top: 0 solid rgba(19, 32, 51, 0.08);
  transition:
    height 280ms cubic-bezier(0.4, 0, 0.2, 1),
    opacity 280ms cubic-bezier(0.4, 0, 0.2, 1),
    border-top-width 280ms cubic-bezier(0.4, 0, 0.2, 1);
}

.accordion-inner {
  padding: 0 28px 28px;
}

.accordion-section.is-open .accordion-body,
.accordion-section[open] .accordion-body {
  opacity: 1;
  border-top: 1px solid rgba(19, 32, 51, 0.08);
}

.section-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.result-grid,
.doc-list {
  display: grid;
  gap: 14px;
}

.subgroup + .subgroup {
  margin-top: 22px;
}

.subgroup h3 {
  margin: 0 0 12px;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.result-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.result-card,
.doc-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.result-card {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.result-card span,
.doc-meta,
.empty-state {
  color: var(--muted);
}

.doc-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: start;
  padding: 16px;
}

.doc-select {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
}

.doc-main {
  min-width: 0;
}

.doc-main strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.35;
}

.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-top: 8px;
  font-size: 14px;
}

.pill {
  padding: 4px 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-radius: 999px;
}

.doc-actions {
  display: flex;
  flex-direction: row;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  white-space: nowrap;
}

.text-link {
  color: var(--accent-strong);
  font-weight: 600;
  font-size: 13px;
  transition: color 180ms ease, opacity 180ms ease;
}

.accordion-header:hover {
  background: rgba(0, 135, 169, 0.04);
}

.doc-card:hover {
  border-color: #9ec9d8;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.04);
  transform: translateY(-1px);
}

.text-link:hover,
.copy-link-inline:hover {
  color: var(--accent);
  background: transparent;
  box-shadow: none;
  transform: none;
}

.doc-actions .copy-link-inline,
.doc-actions .copy-link-inline:hover,
.doc-actions .copy-link-inline:focus-visible {
  background: transparent;
  border: none;
  color: var(--accent-strong);
  box-shadow: none;
  transform: none;
  padding: 0;
}

.doc-actions .copy-link-inline:hover,
.doc-actions .copy-link-inline:focus-visible {
  color: var(--accent);
}

.copy-feedback {
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 140ms ease, transform 140ms ease;
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 700;
}

.copy-feedback.visible {
  opacity: 1;
  transform: translateY(0);
}

.bulk-actions {
  display: flex;
  justify-content: flex-end;
  padding-bottom: 28px;
  transition: opacity 220ms ease, transform 220ms ease;
}

.bulk-actions-hidden {
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
}

.bulk-actions-visible {
  opacity: 1;
  transform: translateY(0);
}

code {
  font-family: "SFMono-Regular", ui-monospace, monospace;
  background: rgba(19, 32, 51, 0.06);
  padding: 2px 6px;
  border-radius: 8px;
}

@media (max-width: 760px) {
  .search-form,
  .product-header,
  .doc-card {
    grid-template-columns: 1fr;
    display: grid;
  }

  .doc-actions {
    align-items: center;
    flex-direction: row;
  }

  .site-header-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .site-header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .header-search {
    width: 100%;
  }

  .header-search input {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }
}
