.dagbooks-browser {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #2a3441;
  box-shadow: 0 24px 60px -28px rgba(15, 23, 42, 0.45);
  background: #0f1419;
}

.dagbooks-browser__chrome {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  background: #1a2332;
  border-bottom: 1px solid #2a3441;
}

.dagbooks-browser__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #3d4f63;
}

.dagbooks-browser__dot:nth-child(1) { background: #ff5f57; }
.dagbooks-browser__dot:nth-child(2) { background: #febc2e; }
.dagbooks-browser__dot:nth-child(3) { background: #28c840; }

.dagbooks-browser__url {
  margin-left: 8px;
  flex: 1;
  font-size: 0.78rem;
  color: #94a3b8;
  background: #0f1419;
  border: 1px solid #2a3441;
  border-radius: 8px;
  padding: 6px 12px;
  text-align: center;
}

.dagbooks-app {
  background: #f4f6f8;
  color: #0f172a;
  padding: 24px 20px 20px;
}

.dagbooks-app__header {
  text-align: center;
  margin-bottom: 20px;
}

.dagbooks-app__brand {
  font-family: var(--sans);
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #0f172a;
}

.dagbooks-app__brand span {
  color: #036b3a;
}

.dagbooks-app__subtitle {
  margin: 6px 0 0;
  font-size: 0.88rem;
  color: #64748b;
}

.dagbooks-app__toolbar {
  margin-bottom: 16px;
}

.dagbooks-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid #dbe3ea;
  border-radius: 12px;
  padding: 0 14px;
  min-height: 46px;
}

.dagbooks-search svg {
  width: 18px;
  height: 18px;
  color: #94a3b8;
  flex-shrink: 0;
}

.dagbooks-search__input {
  width: 100%;
  border: none;
  background: transparent;
  font-family: var(--sans);
  font-size: 0.95rem;
  color: #0f172a;
  padding: 10px 0;
  outline: none;
}

.dagbooks-filters-wrap {
  margin-bottom: 18px;
}

.dagbooks-filters-label {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}

.dagbooks-filters {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.dagbooks-filters::-webkit-scrollbar {
  display: none;
}

.dagbooks-filter {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #dbe3ea;
  background: #fff;
  color: #475569;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.dagbooks-filter:hover {
  border-color: #036b3a;
  color: #036b3a;
}

.dagbooks-filter.is-active {
  background: #036b3a;
  border-color: #036b3a;
  color: #fff;
}

.dagbooks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
  max-height: none;
}

.dagbooks-app--compact .dagbooks-grid {
  max-height: none;
}

.dagbooks-app:not(.dagbooks-app--compact) .dagbooks-grid {
  max-height: 70vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.dagbooks-book {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.dagbooks-book:hover,
.dagbooks-book:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px -14px rgba(3, 107, 58, 0.35);
  border-color: #9fd4b8;
  outline: none;
}

.dagbooks-book__cover {
  position: relative;
  aspect-ratio: 2 / 3;
  background: #e8edf2;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dagbooks-book__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dagbooks-book__cover--fallback {
  background: linear-gradient(145deg, #1e3a5f 0%, #2d5a87 100%);
  padding: 14px;
}

.dagbooks-book__fallback-title {
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dagbooks-book__spine {
  display: none;
}

.dagbooks-book__title {
  display: none;
}

.dagbooks-book__meta {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.dagbooks-book__meta h3 {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.35;
  color: #0f172a;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dagbooks-book__tag {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #036b3a;
}

.dagbooks-book__actions {
  display: flex;
  gap: 6px;
  margin-top: auto;
  padding-top: 4px;
}

.dagbooks-book__action {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  color: #64748b;
  background: #f8fafc;
}

.dagbooks-book__action--primary {
  background: #036b3a;
  border-color: #036b3a;
  color: #fff;
}

.dagbooks-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 24px 16px;
  text-align: center;
  color: #64748b;
  font-size: 0.92rem;
  background: #fff;
  border-radius: 12px;
  border: 1px dashed #cbd5e1;
}

.dagbooks-app__footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
  text-align: center;
}

.dagbooks-app__footer p {
  margin: 0;
  font-size: 0.84rem;
  color: #64748b;
}

.dagbooks-open-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  background: #036b3a;
  color: #fff;
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s ease;
}

.dagbooks-open-btn:hover {
  background: #024d29;
  color: #fff;
}

.dagbooks-section-note {
  max-width: 640px;
  margin: 0 auto 28px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.96rem;
  line-height: 1.6;
}

@media (min-width: 768px) {
  .dagbooks-app {
    padding: 28px 28px 24px;
  }

  .dagbooks-grid {
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 16px;
  }

  .dagbooks-app__footer {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

@media (max-width: 480px) {
  .dagbooks-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .dagbooks-book__cover {
    aspect-ratio: 2 / 3;
  }
}
