:root {
  --app-primary: #005eb8;
  --app-primary-600: #004a90;
  --app-accent: #00a0df;
  --app-dark: #0b1b2b;
  --app-bg: #f6f9fc;
  --app-card: #ffffff;
  --app-muted: #5b728a;
  --app-border: #e5edf5;
  --focus-ring: 0 94 184;

  --radius: 14px;
  --shadow: 0 10px 24px rgba(11, 27, 43, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--app-dark);
  background: var(--app-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  width: min(1100px, 92vw);
  margin-inline: auto;
}

.topbar {
  background: linear-gradient(90deg, var(--app-primary), var(--app-accent));
  color: #fff;
  height: 60px;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: min(1100px, 92vw);
  margin-inline: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-name {
  font-weight: 650;
  font-size: 1.7rem;
  letter-spacing: 0.4px;
  color: #ffffff;
}

.topnav {
  display: flex;
  gap: 18px;
}

.navlink {
  color: #ffffffd9;
  text-decoration: none;
  font-weight: 500;
  padding: 8px 10px;
  border-radius: 10px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.navlink:hover {
  background: #ffffff22;
  color: #fff;
}

.main {
  display: grid;
  gap: 18px;
  padding: 24px 0 40px;
}

.card {
  background: var(--app-card);
  border: 1px solid var(--app-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.hero {
  padding: 22px 20px;
}

.hero-title {
  margin: 6px 0 8px;
  font-size: clamp(22px, 2.2vw + 12px, 32px);
}

.hero-sub {
  margin: 0;
  color: var(--app-muted);
}

.searchbar {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.searchbar input {
  flex: 1;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--app-border);
  background: #fff;
  font-size: 16px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.searchbar input:focus {
  border-color: var(--app-primary);
  box-shadow: 0 0 0 3px rgb(var(--focus-ring) / 0.2);
}

.btn {
  padding: 12px 16px;
  border-radius: 12px;
  border: 0;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.04s ease, background-color 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--app-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--app-primary-600);
}

.status {
  margin-top: 8px;
  color: var(--app-muted);
  min-height: 1.2em;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-title {
  margin: 4px 0 10px;
  font-size: 18px;
}

.chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 44px;
  transition: opacity 0.2s ease;
}

.chip {
  background: #f0f7ff;
  color: var(--app-primary);
  border: 1px solid #cae6ff;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.04s ease;
}

.chip:hover {
  background: #e4f1ff;
}

.chip:active {
  transform: translateY(1px);
}

.chip.ctrl {
  background: #fff;
  border-color: var(--app-border);
  padding: 6px 10px;
}

.chip.ctrl:hover {
  background: #f7fbff;
}

.fade-out {
  opacity: 0.25;
}

.fade-in {
  opacity: 1;
}

.result-box {
  margin-top: 8px;
  padding: 16px 18px;
  border-radius: 10px;
  background: #f7f9fc;
  min-height: 58px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
  transition: opacity 0.2s ease;
}

.result-box.empty {
  opacity: 0.85;
  color: #7c8a99;
}

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

.result-term {
  font-weight: 700;
  font-size: 18px;
}

.result-def {
  line-height: 1.55;
  letter-spacing: 0.1px;
  word-break: break-word;
}

.muted {
  color: var(--app-muted);
}

.error {
  color: #b00020;
}

.footer {
  padding: 24px 0;
  color: #6b7f95;
  font-size: 14px;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:where(a, button, input) {
  outline: none;
}

:where(a, button, input):focus-visible {
  box-shadow: 0 0 0 3px rgb(var(--focus-ring) / 0.3);
  border-radius: 10px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 520px) {
  .topbar-inner {
    padding: 12px 0;
  }
  .topnav {
    gap: 10px;
  }
  .navlink {
    padding: 6px 8px;
  }
  .searchbar {
    flex-direction: column;
    align-items: stretch;
  }
  .btn {
    width: 100%;
  }
}

