﻿:root {
  color-scheme: light;
  --bg: #f7f4ef;
  --bg-deep: #eef1f4;
  --surface: #ffffff;
  --surface-alt: #f3f6f8;
  --ink: #0f1c24;
  --muted: #55626d;
  --accent: #ff6b35;
  --accent-dark: #e45a25;
  --accent-soft: rgba(255, 107, 53, 0.12);
  --teal: #2a9d8f;
  --border: #d7dde3;
  --shadow: 0 20px 50px rgba(17, 28, 38, 0.12);
  --radius: 18px;
  --radius-sm: 12px;
  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background: radial-gradient(circle at top left, #fff3e7 0%, var(--bg) 45%, var(--bg-deep) 100%);
  color: var(--ink);
  min-height: 100vh;
  padding: 2.5rem 1.5rem 4rem;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.hero {
  padding: 2.8rem 3rem;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(15, 28, 36, 0.08), rgba(255, 107, 53, 0.15));
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: rgba(15, 28, 36, 0.85);
  color: #fff;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 1rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 4vw, 3.4rem);
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.hero-top-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.6rem;
}

.hero-top h1 {
  margin: 0;
}

.hero p {
  max-width: 720px;
  line-height: 1.7;
  font-size: 1.05rem;
  color: var(--muted);
}

.hero-meta {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-meta span {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.hero-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.hero-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 28, 36, 0.2);
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.hero-link:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.hero-actions .btn.ghost {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(15, 28, 36, 0.2);
  color: var(--ink);
}

.hero-actions .btn.ghost:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.panel {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 1.8rem 2rem;
}

.is-hidden {
  display: none;
}

.panel-header {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1.4rem;
}

.panel-header h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
}

.panel-header p {
  color: var(--muted);
  font-size: 0.95rem;
}

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

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.filters-panel.embedded {
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  padding: 1rem;
}

.filters-panel.embedded .panel-header {
  margin-bottom: 0.8rem;
}

.filters-panel.embedded .panel-header h2 {
  font-size: 1.05rem;
}

.filters-panel.embedded .panel-header p {
  font-size: 0.85rem;
}

.filters-panel.embedded .filters-grid {
  grid-template-columns: 1fr;
  gap: 0.8rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.9rem;
}

.field span {
  font-weight: 600;
  color: var(--muted);
}

.field input,
.field select {
  padding: 0.65rem 0.8rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--surface);
  color: var(--ink);
}

.fixed-value {
  padding: 0.65rem 0.8rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--ink);
  font-size: 0.95rem;
  font-family: var(--font-body);
  word-break: break-all;
}

.field input:focus,
.field select:focus {
  outline: 2px solid rgba(255, 107, 53, 0.3);
  border-color: var(--accent);
}

.search-actions {
  display: flex;
  gap: 0.6rem;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1.2rem;
  font-family: var(--font-display);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 24px rgba(255, 107, 53, 0.3);
}

.btn.primary:hover {
  background: var(--accent-dark);
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}

.btn.ghost:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.btn.small {
  padding: 0.45rem 0.9rem;
  font-size: 0.82rem;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.status-row {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
  background: var(--surface-alt);
  border-radius: 12px;
  padding: 0.6rem 0.8rem;
}

.status-row.error {
  color: #b42318;
  background: rgba(180, 35, 24, 0.12);
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem;
}

.config-card {
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.config-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.inline-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.hint {
  color: var(--muted);
  font-size: 0.85rem;
}

.hint.error {
  color: #b42318;
}

.file-input {
  display: none;
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.2rem;
}

.note-card {
  border-radius: var(--radius-sm);
  padding: 1.2rem;
  border: 1px solid var(--border);
  background: #fff;
}

.note-card h3 {
  font-family: var(--font-display);
  margin-bottom: 0.6rem;
}

.note-card ul {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  color: var(--muted);
  list-style: none;
}

.note-card li {
  position: relative;
  padding-left: 1rem;
}

.note-card li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.results-section {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.results-header h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
}

.results-header p {
  color: var(--muted);
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
}

.result-column {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  min-height: 520px;
}

.column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.column-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  display: block;
}

.column-sub {
  font-size: 0.8rem;
  color: var(--muted);
}

.column-meta {
  font-size: 0.85rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 600;
}

.column-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.result-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  flex: 1;
}

.result-card {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  padding: 0.9rem;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.result-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(17, 28, 38, 0.12);
}

.result-title {
  font-weight: 600;
  font-size: 1rem;
  font-family: var(--font-display);
}

.result-author {
  color: var(--muted);
  font-size: 0.9rem;
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--muted);
}

.result-row span:last-child {
  font-weight: 600;
  color: var(--ink);
}

.result-snippet {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--ink);
}

.result-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(42, 157, 143, 0.15);
  color: var(--teal);
  width: fit-content;
}

.empty-state {
  color: var(--muted);
  font-size: 0.9rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: center;
}

.loading {
  color: var(--accent-dark);
  font-weight: 600;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}

.modal.is-hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 28, 36, 0.55);
  backdrop-filter: blur(6px);
}

.modal-card {
  position: relative;
  background: var(--surface);
  border-radius: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  width: min(960px, 92vw);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.filter-modal .modal-card {
  width: min(640px, 92vw);
}

.filter-modal .modal-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.4rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.modal-body {
  padding: 1.2rem 1.4rem 1.6rem;
  overflow: auto;
}

.modal-body pre {
  white-space: pre-wrap;
  font-family: var(--font-body);
  line-height: 1.7;
  font-size: 0.95rem;
  color: var(--ink);
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  .search-grid {
    grid-template-columns: 1fr;
  }

  .search-actions {
    justify-content: flex-start;
  }

  .hero {
    padding: 2rem 2.2rem;
  }
}

@media (max-width: 600px) {
  body {
    padding: 1.5rem 1rem 3rem;
  }

  .hero {
    padding: 1.6rem;
  }

  .panel {
    padding: 1.4rem;
  }

  .result-column {
    min-height: auto;
  }
}
