/* browse/browse.css — standalone browse styling (decoupled) */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Carlito","Helvetica Neue",Arial,sans-serif;
  background: #fafafa;
  color: #333;
}

.tj-wrap { width: 100%; max-width: none; margin: 0; padding: 0 12px 56px; }

/* Topbar / Header */
.tj-topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: .5rem;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.tj-topbar .tj-back { font-size: .88rem; color: #0b5cab; text-decoration: none; }

.tj-header {
  display: flex; justify-content: space-between; align-items: center;
  gap: .5rem; padding: 8px 0; border-bottom: 1px solid rgba(0,0,0,.06);
}
.tj-header-actions {
  display: inline-flex;
  align-items: stretch;
  gap: .4rem;
  flex-wrap: wrap;
}
.tj-header-control {
  border: 1px solid rgba(0,0,0,.14);
  background: #fff;
  border-radius: 4px;
  height: 31px;
  padding: 0 .52rem;
  cursor: pointer;
  font-size: .72rem;
  line-height: 1;
  color: #111827;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: top;
  transition: background .2s, color .2s, border-color .2s, box-shadow .2s;
  text-decoration: none;
}
.tj-header-control:hover {
  background: rgba(37,99,235,.06);
  color: #0b5cab;
  border-color: rgba(37,99,235,.25);
}
.tj-header-control:focus-visible {
  outline: 2px solid rgba(37,99,235,.22);
  outline-offset: 1px;
}
.tj-settings-btn {
  width: 31px;
  padding: 0;
  font-size: .88rem;
}

/* Buttons */
.tj-btn {
  border: 1px solid rgba(0,0,0,.14);
  background: #fff;
  border-radius: 5px;
  padding: .22rem .38rem;
  cursor: pointer;
  font-size: .72rem;
  line-height: 1.15;
  transition: background .2s, color .2s, border-color .2s, box-shadow .2s;
}
.tj-btn:hover { background: rgba(37,99,235,.06); color: #0b5cab; border-color: rgba(37,99,235,.25); }
.tj-btn-ghost { background: transparent; padding: .2rem .35rem; font-size: .75rem; }
.tj-btn[disabled] { opacity: .45; cursor: not-allowed; }
.tj-btn-link { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; }

/* Modals */
.tj-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
.tj-modal.is-open { display: flex; }
.tj-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.22);
}
.tj-modal-panel {
  position: relative;
  background: #fff;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 10px;
  width: min(360px, 92vw);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0,0,0,.15);
  padding: .75rem .85rem .85rem;
}
.tj-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .5rem;
}
.tj-modal-title {
  font-size: .85rem;
  font-weight: 700;
  color: #111827;
}
.tj-modal-close {
  border: 1px solid rgba(0,0,0,.12);
  background: #fff;
  border-radius: 6px;
  width: 26px;
  height: 26px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
.tj-modal-body {
  overflow: auto;
  padding-right: .15rem;
}
.tj-setting-group {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: .35rem 0 0;
}
.tj-setting-label {
  font-size: .72rem;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: .15rem;
}
.tj-check {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .75rem;
  color: #111827;
}

/* Getting started modal content */
.tj-started-body {
  font-size: .74rem;
  color: #374151;
  line-height: 1.45;
}
.tj-started-body h2 { margin: .6rem 0 .25rem; font-size: .78rem; font-weight: 700; letter-spacing: .01em; }
.tj-started-body p { margin: .25rem 0 .4rem; }
.tj-started-body li { margin: .2rem 0; }
.tj-started-body ol, .tj-started-body ul { margin: .2rem 0 .5rem 1rem; padding: 0; }
.tj-started-body strong { color: #111827; }
.tj-started-link a { font-size: .72rem; color: #0b5cab; text-decoration: none; }
.tj-started-link a:hover { text-decoration: underline; }

/* Browse controls */
.tj-browse-controls {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: stretch;
  margin: .2rem 0 .6rem;
}
.tj-browse-input,
.tj-browse-select {
  border: 1px solid rgba(0,0,0,.14);
  background: #fff;
  border-radius: 6px;
  padding: .3rem .45rem;
  font-size: .72rem;
  height: 34px;
}
.tj-browse-input { min-width: 180px; flex: 1; }
.tj-browse-controls .tj-btn {
  height: 34px;
  padding: 0 .6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tj-browse-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.tj-browse-card {
  border: 1px solid rgba(0,0,0,.07);
  border-radius: 12px;
  background: #fff;
  padding: .6rem .65rem .7rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.03);
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.tj-browse-card h3 { margin: 0; font-size: .85rem; }
.tj-browse-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.tj-browse-meta { display: flex; flex-wrap: wrap; gap: .25rem; }
.tj-browse-pill {
  font-size: .66rem;
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 999px;
  padding: .12rem .45rem;
  color: #4b5563;
}
.tj-browse-open {
  align-self: flex-start;
  margin-top: .15rem;
  border: 1px solid rgba(0,0,0,.14);
  background: #fff;
  border-radius: 6px;
  padding: .2rem .45rem;
  font-size: .7rem;
  cursor: pointer;
}
.tj-browse-actions { display: flex; gap: .35rem; flex-wrap: wrap; }
.tj-browse-open:hover {
  background: rgba(37,99,235,.06);
  border-color: rgba(37,99,235,.25);
  color: #0b5cab;
}
.tj-browse-empty { margin-top: .6rem; color: #6b7280; font-size: .75rem; }

@media (max-width: 640px) {
  .tj-browse-input { min-width: 100%; }
  .tj-browse-select { width: 100%; }
}
