:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --panel: #ffffff;
  --text: #18201f;
  --muted: #5c6864;
  --line: #cfd7d2;
  --accent: #186b62;
  --accent-strong: #0f4f49;
  --warn: #8a5200;
  --error: #8f1f26;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  padding: 0 0 64px;
  background: var(--bg);
  color: var(--text);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(16px, 4vw, 48px) 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  position: sticky;
  top: 0;
  z-index: 5;
}

h1 {
  margin: 0;
  font-size: 1.8rem;
  line-height: 1.1;
}

.slogan {
  margin: 4px 0 0;
  color: var(--muted);
}

button,
input,
select {
  font: inherit;
}

button,
select,
input {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

button {
  min-height: 40px;
  padding: 0 14px;
  cursor: pointer;
}

button:hover,
.file-card:hover {
  border-color: var(--accent);
}

.page-shell,
.requirements-view {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px clamp(16px, 4vw, 48px) 36px;
}

.controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 280px) auto;
  gap: 14px;
  align-items: end;
}

.field {
  display: grid;
  gap: 6px;
}

label {
  font-weight: 700;
  font-size: 0.88rem;
}

input,
select {
  min-height: 42px;
  padding: 0 12px;
}

.result-count {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  white-space: nowrap;
}

.password-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.state-message {
  margin: 18px 0;
  color: var(--muted);
}

.state-message[data-state-kind="error"] {
  color: var(--error);
}

.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  align-items: stretch;
}

.file-card {
  position: relative;
  display: grid;
  grid-template-columns: 58px 1fr auto;
  gap: 12px;
  min-height: 126px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(18, 32, 31, 0.06);
}

.file-card:focus-visible {
  outline: 3px solid rgba(24, 107, 98, 0.34);
  outline-offset: 2px;
}

.file-icon,
.download-icon {
  width: 100%;
  aspect-ratio: 1;
  color: var(--accent);
}

.file-icon svg,
.download-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.download-icon {
  width: 28px;
  align-self: start;
  color: var(--accent-strong);
}

.file-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
}

.file-name,
.file-date {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.description-popover {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: calc(100% - 8px);
  z-index: 3;
  display: none;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffffe;
  color: var(--text);
  box-shadow: 0 8px 28px rgba(18, 32, 31, 0.18);
  font-size: 0.9rem;
}

.file-card[data-has-description="true"].is-description-visible .description-popover {
  display: block;
}

.requirements-view[hidden] {
  display: none;
}

.requirements-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.requirements-content {
  line-height: 1.58;
}

.requirements-content code {
  background: #e9efed;
  padding: 0.1em 0.32em;
  border-radius: 5px;
}

.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 48px;
  padding: 8px clamp(16px, 4vw, 48px);
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}

.site-footer time {
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

@media (max-width: 700px) {
  .site-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .controls {
    grid-template-columns: 1fr;
  }

  .file-card {
    grid-template-columns: 50px 1fr 26px;
  }
}
