:root {
  --bg: #f2f7fa;
  --card: #ffffff;
  --ink: #0e2833;
  --muted: #4b6572;
  --line: #d5e3ea;
  --accent: #0f7a8d;
  --accent-dark: #0b5f6f;
  --accent-soft: #dff4f8;
  --warning: #7a4c12;
  --navy: #0f2c3f;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Avenir Next", "Gill Sans", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 12%, #e7fbff 0%, transparent 44%),
    radial-gradient(circle at 90% 14%, #d6edf6 0%, transparent 40%),
    linear-gradient(160deg, #f5fbff 0%, #edf4f9 56%, #e9f1f6 100%);
  min-height: 100vh;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.2rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-logo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  box-shadow: 0 8px 20px rgba(12, 46, 62, 0.18);
}

.eyebrow {
  margin: 0;
  color: var(--accent-dark);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.05;
}

.subtitle {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid #d5e6ec;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 999px;
  padding: 0.38rem 0.7rem;
  box-shadow: 0 8px 18px rgba(10, 49, 68, 0.08);
}

.user-label {
  color: var(--muted);
  font-size: 0.78rem;
}

.user-name {
  font-weight: 700;
  color: #143240;
  font-size: 0.84rem;
}

.desktop-badge {
  display: inline-block;
  border: 1px solid #cce4ec;
  background: #eaf8fc;
  color: #0f5f71;
  border-radius: 999px;
  padding: 0.33rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.layout { max-width: 1040px; margin: 1.8rem auto; padding: 0 1rem 2.25rem; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.1rem 1.2rem;
  margin-bottom: 1.1rem;
  box-shadow: 0 12px 34px rgba(6, 38, 54, 0.08);
  animation: rise 300ms ease-out;
}

.hidden { display: none; }
.card-wide { max-width: 760px; margin: 2.2rem auto 0; }
.notice {
  margin-bottom: 1.1rem;
  border: 1px solid #efdfbf;
  background: linear-gradient(120deg, #fff8ea 0%, #fff4de 100%);
  color: var(--warning);
  border-radius: 12px;
  padding: 0.78rem 0.94rem;
  font-weight: 600;
}

h2 {
  margin: 0 0 0.7rem;
  font-size: 1.7rem;
  color: #1a3140;
}

h3 {
  margin: 0;
  color: #1f4152;
  font-size: 1.03rem;
}

.search-shell {
  position: relative;
}

.search-input-wrap {
  position: relative;
}

.search-row { display: flex; gap: 0.5rem; }
.search-row input {
  flex: 1;
  min-width: 180px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.6rem 0.7rem;
  font-size: 0.97rem;
}
button {
  border: 1px solid var(--accent);
  background: linear-gradient(160deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff;
  border-radius: 10px;
  padding: 0.52rem 0.9rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 100ms ease, box-shadow 180ms ease;
}
button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(15, 104, 122, 0.3);
}
button.ghost {
  border-color: var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: none;
}

a {
  color: #0c6276;
  font-weight: 600;
}
a:hover { color: #084f61; }

.error { color: #a81634; }

.downloads ul,
#directory-results ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.downloads li,
#directory-results li {
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 0.6rem;
  padding: 0.78rem;
  background: linear-gradient(180deg, #ffffff 0%, #fdfefe 100%);
}

.row-title {
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: #1a3a49;
}

.meta {
  color: var(--muted);
  font-size: 0.9rem;
}
.small { font-size: 0.82rem; }

.download-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.search-suggestions {
  position: absolute;
  top: calc(100% + 0.45rem);
  left: 0;
  right: 0;
  z-index: 15;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 38px rgba(8, 42, 59, 0.14);
  overflow: hidden;
}

.search-suggestion {
  padding: 0.8rem 0.95rem;
  cursor: pointer;
  border-bottom: 1px solid #edf3f6;
  transition: background 120ms ease;
}

.search-suggestion:last-child {
  border-bottom: 0;
}

.search-suggestion:hover,
.search-suggestion.active {
  background: #eef8fb;
}

.search-suggestion-title {
  font-weight: 700;
  color: #183746;
}

.search-suggestion-meta {
  margin-top: 0.18rem;
  color: var(--muted);
  font-size: 0.86rem;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 0.9rem 1rem;
  }
  .brand-logo {
    width: 48px;
    height: 48px;
  }
  h2 { font-size: 1.52rem; }
  .top-actions {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }
  .search-row { flex-direction: column; }
  .layout { margin-top: 1.15rem; }
}