:root {
  --bg: #eaf2f6;
  --card: #ffffff;
  --border: #c8d8e6;
  --heading: #173b5f;
  --primary: #3a79b8;
  --highlight: #fff39a;
  --text: #243746;
  --muted: #5d7285;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
}
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}
.site-header h1 { margin: 0; color: var(--heading); }
.subtitle { margin: 0.25rem 0 0; color: var(--muted); }
nav { display: flex; gap: 0.9rem; align-items: center; flex-wrap: wrap; }
nav a { color: var(--primary); text-decoration: none; }
.user-chip {
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #f8fbfd;
}
.page-shell { max-width: 1400px; margin: 0 auto; padding: 1.5rem; }
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.results-stack {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
}
.narrow { max-width: 480px; margin: 2rem auto; }
.panel h2, .results-card h2 { margin-top: 0; color: var(--heading); }
.stack-form { display: grid; gap: 0.9rem; }
label { display: grid; gap: 0.35rem; font-weight: 600; }
input, select, button {
  font: inherit;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--border);
}
button {
  background: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
}

.two-up {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.error {
  color: #b42318;
}

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

.result-item {
  border-top: 1px solid var(--border);
  padding-top: 0.85rem;
  margin-top: 0.85rem;
}

.result-meta {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}

mark {
  background: var(--highlight);
}

/* desktop + general result styling */
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.results-count {
  font-size: 1.05rem;
  color: #173a63;
}

.v3-card {
  background: #f8fbff;
  border: 1px solid #c8d9ee;
  border-radius: 16px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.result-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
  margin-bottom: 0.8rem;
  font-size: 0.95rem;
  color: #4c6f97;
}

.segment-badge {
  display: inline-block;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: #dcebfb;
  color: #16508f;
  font-weight: 700;
  font-size: 0.9rem;
}

.meta-type,
.meta-source,
.meta-date {
  color: #59789b;
}

.result-title {
  margin: 0 0 1rem 0;
  font-size: 1.15rem;
  color: #153f6d;
}

.result-box {
  background: #f3f8fe;
  border: 1px solid #bcd0e7;
  border-radius: 12px;
  padding: 0.9rem 1rem;
  margin-bottom: 0.9rem;
}

.result-box-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: #184978;
  margin-bottom: 0.6rem;
}

.result-box-body p {
  margin: 0;
  line-height: 1.5;
  color: #15314f;
}

.result-links {
  display: flex;
  gap: 1.2rem;
  margin-top: 0.4rem;
}

.result-links a {
  color: #1a5ea8;
  font-weight: 600;
  text-decoration: none;
}

.result-links a:hover {
  text-decoration: underline;
}

mark {
  background: #ffe76a;
  padding: 0 0.12rem;
  border-radius: 2px;
}

  .button-link {
    display: inline-block;
    padding: 0.7rem 0.8rem;
    border-radius: 10px;
    background: var(--primary);
    color: white;
    border: none;
    text-decoration: none;
    font: inherit;
    cursor: pointer;
  }
  
  .button-link:hover {
    opacity: 0.9;
    text-decoration: none;
  }
.manual-content {
  line-height: 1.65;
  color: var(--text);
}

.manual-content h1,
.manual-content h2,
.manual-content h3,
.manual-content h4 {
  color: var(--heading);
  margin-top: 1.25rem;
  margin-bottom: 0.6rem;
}

.manual-content p {
  margin: 0.55rem 0;
}

.manual-content ul,
.manual-content ol {
  margin: 0.5rem 0 0.8rem 1.4rem;
}

.manual-content code {
  background: #f3f8fe;
  border: 1px solid #d6e3f0;
  border-radius: 6px;
  padding: 0.08rem 0.35rem;
  font-family: monospace;
}

.manual-content pre {
  background: #f7fbff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  overflow-x: auto;
}

.manual-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 0.8rem 0;
}

.manual-content th,
.manual-content td {
  border: 1px solid var(--border);
  padding: 0.55rem 0.7rem;
  text-align: left;
}

.manual-fallback {
  white-space: normal;
}
.save-search-form input[type="text"],
.save-search-form select {
  width: 100%;
  display: block;
  position: relative;
  z-index: 1;
}

.save-search-form {
  margin-top: 0.8rem;
}

.result-box-body {
  word-break: break-word;
}

/* only mobile-specific overrides go here */
@media (max-width: 960px) {
  .dashboard-grid,
  .two-up {
    grid-template-columns: 1fr;
  }

  .results-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.5rem;
  }
}
  
